'use strict'; function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var path = _interopDefault(require('path')); var fs$1 = _interopDefault(require('fs')); /** * @desc Parses JSON metamodel into an {@link XKTModel}. * * @param {Object} params Parsing parameters. * @param {JSON} params.metaModelData Metamodel data. * @param {String[]} [params.excludeTypes] Types to exclude from parsing. * @param {String[]} [params.includeTypes] Types to include in parsing. * @param {XKTModel} params.xktModel XKTModel to parse into. * @param {function} [params.log] Logging callback. * @returns {Promise} */ function parseMetaModelIntoXKTModel({metaModelData, xktModel, includeTypes, excludeTypes, log}) { return new Promise(function (resolve, reject) { const metaObjects = metaModelData.metaObjects || []; xktModel.modelId = metaModelData.revisionId || ""; // HACK xktModel.projectId = metaModelData.projectId || ""; xktModel.revisionId = metaModelData.revisionId || ""; xktModel.author = metaModelData.author || ""; xktModel.createdAt = metaModelData.createdAt || ""; xktModel.creatingApplication = metaModelData.creatingApplication || ""; xktModel.schema = metaModelData.schema || ""; let includeTypesMap; if (includeTypes) { includeTypesMap = {}; for (let i = 0, len = includeTypes.length; i < len; i++) { includeTypesMap[includeTypes[i]] = true; } } let excludeTypesMap; if (excludeTypes) { excludeTypesMap = {}; for (let i = 0, len = excludeTypes.length; i < len; i++) { excludeTypesMap[excludeTypes[i]] = true; } } let countMetaObjects = 0; for (let i = 0, len = metaObjects.length; i < len; i++) { const metaObject = metaObjects[i]; const type = metaObject.type; if (excludeTypesMap && excludeTypesMap[type]) { continue; } if (includeTypesMap && !includeTypesMap[type]) { continue; } xktModel.createMetaObject({ metaObjectId: metaObject.id, metaObjectType: metaObject.type, metaObjectName: metaObject.name, parentMetaObjectId: metaObject.parent }); countMetaObjects++; } if (log) { log("Converted meta objects: " + countMetaObjects); } resolve(); }); } /** @private */ function earcut(data, holeIndices, dim) { dim = dim || 2; var hasHoles = holeIndices && holeIndices.length, outerLen = hasHoles ? holeIndices[0] * dim : data.length, outerNode = linkedList(data, 0, outerLen, dim, true), triangles = []; if (!outerNode || outerNode.next === outerNode.prev) return triangles; var minX, minY, maxX, maxY, x, y, invSize; if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim); // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox if (data.length > 80 * dim) { minX = maxX = data[0]; minY = maxY = data[1]; for (var i = dim; i < outerLen; i += dim) { x = data[i]; y = data[i + 1]; if (x < minX) minX = x; if (y < minY) minY = y; if (x > maxX) maxX = x; if (y > maxY) maxY = y; } // minX, minY and invSize are later used to transform coords into integers for z-order calculation invSize = Math.max(maxX - minX, maxY - minY); invSize = invSize !== 0 ? 1 / invSize : 0; } earcutLinked(outerNode, triangles, dim, minX, minY, invSize); return triangles; } // create a circular doubly linked list from polygon points in the specified winding order function linkedList(data, start, end, dim, clockwise) { var i, last; if (clockwise === (signedArea(data, start, end, dim) > 0)) { for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last); } else { for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last); } if (last && equals(last, last.next)) { removeNode(last); last = last.next; } return last; } // eliminate colinear or duplicate points function filterPoints(start, end) { if (!start) return start; if (!end) end = start; var p = start, again; do { again = false; if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) { removeNode(p); p = end = p.prev; if (p === p.next) break; again = true; } else { p = p.next; } } while (again || p !== end); return end; } // main ear slicing loop which triangulates a polygon (given as a linked list) function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) { if (!ear) return; // interlink polygon nodes in z-order if (!pass && invSize) indexCurve(ear, minX, minY, invSize); var stop = ear, prev, next; // iterate through ears, slicing them one by one while (ear.prev !== ear.next) { prev = ear.prev; next = ear.next; if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) { // cut off the triangle triangles.push(prev.i / dim); triangles.push(ear.i / dim); triangles.push(next.i / dim); removeNode(ear); // skipping the next vertex leads to less sliver triangles ear = next.next; stop = next.next; continue; } ear = next; // if we looped through the whole remaining polygon and can't find any more ears if (ear === stop) { // try filtering points and slicing again if (!pass) { earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1); // if this didn't work, try curing all small self-intersections locally } else if (pass === 1) { ear = cureLocalIntersections(filterPoints(ear), triangles, dim); earcutLinked(ear, triangles, dim, minX, minY, invSize, 2); // as a last resort, try splitting the remaining polygon into two } else if (pass === 2) { splitEarcut(ear, triangles, dim, minX, minY, invSize); } break; } } } // check whether a polygon node forms a valid ear with adjacent nodes function isEar(ear) { var a = ear.prev, b = ear, c = ear.next; if (area(a, b, c) >= 0) return false; // reflex, can't be an ear // now make sure we don't have other points inside the potential ear var p = ear.next.next; while (p !== ear.prev) { if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false; p = p.next; } return true; } function isEarHashed(ear, minX, minY, invSize) { var a = ear.prev, b = ear, c = ear.next; if (area(a, b, c) >= 0) return false; // reflex, can't be an ear // triangle bbox; min & max are calculated like this for speed var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x), minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y), maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x), maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y); // z-order range for the current triangle bbox; var minZ = zOrder(minTX, minTY, minX, minY, invSize), maxZ = zOrder(maxTX, maxTY, minX, minY, invSize); var p = ear.prevZ, n = ear.nextZ; // look for points inside the triangle in both directions while (p && p.z >= minZ && n && n.z <= maxZ) { if (p !== ear.prev && p !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false; p = p.prevZ; if (n !== ear.prev && n !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false; n = n.nextZ; } // look for remaining points in decreasing z-order while (p && p.z >= minZ) { if (p !== ear.prev && p !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false; p = p.prevZ; } // look for remaining points in increasing z-order while (n && n.z <= maxZ) { if (n !== ear.prev && n !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false; n = n.nextZ; } return true; } // go through all polygon nodes and cure small local self-intersections function cureLocalIntersections(start, triangles, dim) { var p = start; do { var a = p.prev, b = p.next.next; if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) { triangles.push(a.i / dim); triangles.push(p.i / dim); triangles.push(b.i / dim); // remove two nodes involved removeNode(p); removeNode(p.next); p = start = b; } p = p.next; } while (p !== start); return filterPoints(p); } // try splitting polygon into two and triangulate them independently function splitEarcut(start, triangles, dim, minX, minY, invSize) { // look for a valid diagonal that divides the polygon into two var a = start; do { var b = a.next.next; while (b !== a.prev) { if (a.i !== b.i && isValidDiagonal(a, b)) { // split the polygon in two by the diagonal var c = splitPolygon(a, b); // filter colinear points around the cuts a = filterPoints(a, a.next); c = filterPoints(c, c.next); // run earcut on each half earcutLinked(a, triangles, dim, minX, minY, invSize); earcutLinked(c, triangles, dim, minX, minY, invSize); return; } b = b.next; } a = a.next; } while (a !== start); } // link every hole into the outer loop, producing a single-ring polygon without holes function eliminateHoles(data, holeIndices, outerNode, dim) { var queue = [], i, len, start, end, list; for (i = 0, len = holeIndices.length; i < len; i++) { start = holeIndices[i] * dim; end = i < len - 1 ? holeIndices[i + 1] * dim : data.length; list = linkedList(data, start, end, dim, false); if (list === list.next) list.steiner = true; queue.push(getLeftmost(list)); } queue.sort(compareX); // process holes from left to right for (i = 0; i < queue.length; i++) { eliminateHole(queue[i], outerNode); outerNode = filterPoints(outerNode, outerNode.next); } return outerNode; } function compareX(a, b) { return a.x - b.x; } // find a bridge between vertices that connects hole with an outer ring and and link it function eliminateHole(hole, outerNode) { outerNode = findHoleBridge(hole, outerNode); if (outerNode) { var b = splitPolygon(outerNode, hole); // filter collinear points around the cuts filterPoints(outerNode, outerNode.next); filterPoints(b, b.next); } } // David Eberly's algorithm for finding a bridge between hole and outer polygon function findHoleBridge(hole, outerNode) { var p = outerNode, hx = hole.x, hy = hole.y, qx = -Infinity, m; // find a segment intersected by a ray from the hole's leftmost point to the left; // segment's endpoint with lesser x will be potential connection point do { if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) { var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y); if (x <= hx && x > qx) { qx = x; if (x === hx) { if (hy === p.y) return p; if (hy === p.next.y) return p.next; } m = p.x < p.next.x ? p : p.next; } } p = p.next; } while (p !== outerNode); if (!m) return null; if (hx === qx) return m; // hole touches outer segment; pick leftmost endpoint // look for points inside the triangle of hole point, segment intersection and endpoint; // if there are no points found, we have a valid connection; // otherwise choose the point of the minimum angle with the ray as connection point var stop = m, mx = m.x, my = m.y, tanMin = Infinity, tan; p = m; do { if (hx >= p.x && p.x >= mx && hx !== p.x && pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) { tan = Math.abs(hy - p.y) / (hx - p.x); // tangential if (locallyInside(p, hole) && (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) { m = p; tanMin = tan; } } p = p.next; } while (p !== stop); return m; } // whether sector in vertex m contains sector in vertex p in the same coordinates function sectorContainsSector(m, p) { return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0; } // interlink polygon nodes in z-order function indexCurve(start, minX, minY, invSize) { var p = start; do { if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize); p.prevZ = p.prev; p.nextZ = p.next; p = p.next; } while (p !== start); p.prevZ.nextZ = null; p.prevZ = null; sortLinked(p); } // Simon Tatham's linked list merge sort algorithm // http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html function sortLinked(list) { var i, p, q, e, tail, numMerges, pSize, qSize, inSize = 1; do { p = list; list = null; tail = null; numMerges = 0; while (p) { numMerges++; q = p; pSize = 0; for (i = 0; i < inSize; i++) { pSize++; q = q.nextZ; if (!q) break; } qSize = inSize; while (pSize > 0 || (qSize > 0 && q)) { if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) { e = p; p = p.nextZ; pSize--; } else { e = q; q = q.nextZ; qSize--; } if (tail) tail.nextZ = e; else list = e; e.prevZ = tail; tail = e; } p = q; } tail.nextZ = null; inSize *= 2; } while (numMerges > 1); return list; } // z-order of a point given coords and inverse of the longer side of data bbox function zOrder(x, y, minX, minY, invSize) { // coords are transformed into non-negative 15-bit integer range x = 32767 * (x - minX) * invSize; y = 32767 * (y - minY) * invSize; x = (x | (x << 8)) & 0x00FF00FF; x = (x | (x << 4)) & 0x0F0F0F0F; x = (x | (x << 2)) & 0x33333333; x = (x | (x << 1)) & 0x55555555; y = (y | (y << 8)) & 0x00FF00FF; y = (y | (y << 4)) & 0x0F0F0F0F; y = (y | (y << 2)) & 0x33333333; y = (y | (y << 1)) & 0x55555555; return x | (y << 1); } // find the leftmost node of a polygon ring function getLeftmost(start) { var p = start, leftmost = start; do { if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p; p = p.next; } while (p !== start); return leftmost; } // check if a point lies within a convex triangle function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) { return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 && (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 && (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0; } // check if a diagonal between two polygon nodes is valid (lies in polygon interior) function isValidDiagonal(a, b) { return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case } // signed area of a triangle function area(p, q, r) { return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y); } // check if two points are equal function equals(p1, p2) { return p1.x === p2.x && p1.y === p2.y; } // check if two segments intersect function intersects(p1, q1, p2, q2) { var o1 = sign(area(p1, q1, p2)); var o2 = sign(area(p1, q1, q2)); var o3 = sign(area(p2, q2, p1)); var o4 = sign(area(p2, q2, q1)); if (o1 !== o2 && o3 !== o4) return true; // general case if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1 if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1 if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2 if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2 return false; } // for collinear points p, q, r, check if point q lies on segment pr function onSegment(p, q, r) { return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y); } function sign(num) { return num > 0 ? 1 : num < 0 ? -1 : 0; } // check if a polygon diagonal intersects any polygon segments function intersectsPolygon(a, b) { var p = a; do { if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a, b)) return true; p = p.next; } while (p !== a); return false; } // check if a polygon diagonal is locally inside the polygon function locallyInside(a, b) { return area(a.prev, a, a.next) < 0 ? area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 : area(a, b, a.prev) < 0 || area(a, a.next, b) < 0; } // check if the middle point of a polygon diagonal is inside the polygon function middleInside(a, b) { var p = a, inside = false, px = (a.x + b.x) / 2, py = (a.y + b.y) / 2; do { if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x)) inside = !inside; p = p.next; } while (p !== a); return inside; } // link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two; // if one belongs to the outer ring and another to a hole, it merges it into a single ring function splitPolygon(a, b) { var a2 = new Node(a.i, a.x, a.y), b2 = new Node(b.i, b.x, b.y), an = a.next, bp = b.prev; a.next = b; b.prev = a; a2.next = an; an.prev = a2; b2.next = a2; a2.prev = b2; bp.next = b2; b2.prev = bp; return b2; } // create a node and optionally link it with previous one (in a circular doubly linked list) function insertNode(i, x, y, last) { var p = new Node(i, x, y); if (!last) { p.prev = p; p.next = p; } else { p.next = last.next; p.prev = last; last.next.prev = p; last.next = p; } return p; } function removeNode(p) { p.next.prev = p.prev; p.prev.next = p.next; if (p.prevZ) p.prevZ.nextZ = p.nextZ; if (p.nextZ) p.nextZ.prevZ = p.prevZ; } function Node(i, x, y) { // vertex index in coordinates array this.i = i; // vertex coordinates this.x = x; this.y = y; // previous and next vertex nodes in a polygon ring this.prev = null; this.next = null; // z-order curve value this.z = null; // previous and next nodes in z-order this.prevZ = null; this.nextZ = null; // indicates whether this is a steiner point this.steiner = false; } // return a percentage difference between the polygon area and its triangulation area; // used to verify correctness of triangulation earcut.deviation = function (data, holeIndices, dim, triangles) { var hasHoles = holeIndices && holeIndices.length; var outerLen = hasHoles ? holeIndices[0] * dim : data.length; var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim)); if (hasHoles) { for (var i = 0, len = holeIndices.length; i < len; i++) { var start = holeIndices[i] * dim; var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length; polygonArea -= Math.abs(signedArea(data, start, end, dim)); } } var trianglesArea = 0; for (i = 0; i < triangles.length; i += 3) { var a = triangles[i] * dim; var b = triangles[i + 1] * dim; var c = triangles[i + 2] * dim; trianglesArea += Math.abs( (data[a] - data[c]) * (data[b + 1] - data[a + 1]) - (data[a] - data[b]) * (data[c + 1] - data[a + 1])); } return polygonArea === 0 && trianglesArea === 0 ? 0 : Math.abs((trianglesArea - polygonArea) / polygonArea); }; function signedArea(data, start, end, dim) { var sum = 0; for (var i = start, j = end - dim; i < end; i += dim) { sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]); j = i; } return sum; } // turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts earcut.flatten = function (data) { var dim = data[0][0].length, result = {vertices: [], holes: [], dimensions: dim}, holeIndex = 0; for (var i = 0; i < data.length; i++) { for (var j = 0; j < data[i].length; j++) { for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]); } if (i > 0) { holeIndex += data[i - 1].length; result.holes.push(holeIndex); } } return result; }; // Some temporary vars to help avoid garbage collection const FloatArrayType = Float64Array ; const tempMat1 = new FloatArrayType(16); const tempMat2 = new FloatArrayType(16); const tempVec4 = new FloatArrayType(4); /** * @private */ const math = { MIN_DOUBLE: -Number.MAX_SAFE_INTEGER, MAX_DOUBLE: Number.MAX_SAFE_INTEGER, /** * The number of radiians in a degree (0.0174532925). * @property DEGTORAD * @type {Number} */ DEGTORAD: 0.0174532925, /** * The number of degrees in a radian. * @property RADTODEG * @type {Number} */ RADTODEG: 57.295779513, /** * Returns a new, uninitialized two-element vector. * @method vec2 * @param [values] Initial values. * @static * @returns {Number[]} */ vec2(values) { return new FloatArrayType(values || 2); }, /** * Returns a new, uninitialized three-element vector. * @method vec3 * @param [values] Initial values. * @static * @returns {Number[]} */ vec3(values) { return new FloatArrayType(values || 3); }, /** * Returns a new, uninitialized four-element vector. * @method vec4 * @param [values] Initial values. * @static * @returns {Number[]} */ vec4(values) { return new FloatArrayType(values || 4); }, /** * Returns a new, uninitialized 3x3 matrix. * @method mat3 * @param [values] Initial values. * @static * @returns {Number[]} */ mat3(values) { return new FloatArrayType(values || 9); }, /** * Converts a 3x3 matrix to 4x4 * @method mat3ToMat4 * @param mat3 3x3 matrix. * @param mat4 4x4 matrix * @static * @returns {Number[]} */ mat3ToMat4(mat3, mat4 = new FloatArrayType(16)) { mat4[0] = mat3[0]; mat4[1] = mat3[1]; mat4[2] = mat3[2]; mat4[3] = 0; mat4[4] = mat3[3]; mat4[5] = mat3[4]; mat4[6] = mat3[5]; mat4[7] = 0; mat4[8] = mat3[6]; mat4[9] = mat3[7]; mat4[10] = mat3[8]; mat4[11] = 0; mat4[12] = 0; mat4[13] = 0; mat4[14] = 0; mat4[15] = 1; return mat4; }, /** * Returns a new, uninitialized 4x4 matrix. * @method mat4 * @param [values] Initial values. * @static * @returns {Number[]} */ mat4(values) { return new FloatArrayType(values || 16); }, /** * Converts a 4x4 matrix to 3x3 * @method mat4ToMat3 * @param mat4 4x4 matrix. * @param mat3 3x3 matrix * @static * @returns {Number[]} */ mat4ToMat3(mat4, mat3) { // TODO //return new FloatArrayType(values || 9); }, /** * Returns a new UUID. * @method createUUID * @static * @return string The new UUID */ createUUID: ((() => { const lut = []; for (let i = 0; i < 256; i++) { lut[i] = (i < 16 ? '0' : '') + (i).toString(16); } return () => { const d0 = Math.random() * 0xffffffff | 0; const d1 = Math.random() * 0xffffffff | 0; const d2 = Math.random() * 0xffffffff | 0; const d3 = Math.random() * 0xffffffff | 0; return `${lut[d0 & 0xff] + lut[d0 >> 8 & 0xff] + lut[d0 >> 16 & 0xff] + lut[d0 >> 24 & 0xff]}-${lut[d1 & 0xff]}${lut[d1 >> 8 & 0xff]}-${lut[d1 >> 16 & 0x0f | 0x40]}${lut[d1 >> 24 & 0xff]}-${lut[d2 & 0x3f | 0x80]}${lut[d2 >> 8 & 0xff]}-${lut[d2 >> 16 & 0xff]}${lut[d2 >> 24 & 0xff]}${lut[d3 & 0xff]}${lut[d3 >> 8 & 0xff]}${lut[d3 >> 16 & 0xff]}${lut[d3 >> 24 & 0xff]}`; }; }))(), /** * Clamps a value to the given range. * @param {Number} value Value to clamp. * @param {Number} min Lower bound. * @param {Number} max Upper bound. * @returns {Number} Clamped result. */ clamp(value, min, max) { return Math.max(min, Math.min(max, value)); }, /** * Floating-point modulus * @method fmod * @static * @param {Number} a * @param {Number} b * @returns {*} */ fmod(a, b) { if (a < b) { console.error("math.fmod : Attempting to find modulus within negative range - would be infinite loop - ignoring"); return a; } while (b <= a) { a -= b; } return a; }, /** * Negates a four-element vector. * @method negateVec4 * @static * @param {Array(Number)} v Vector to negate * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, v otherwise */ negateVec4(v, dest) { if (!dest) { dest = v; } dest[0] = -v[0]; dest[1] = -v[1]; dest[2] = -v[2]; dest[3] = -v[3]; return dest; }, /** * Adds one four-element vector to another. * @method addVec4 * @static * @param {Array(Number)} u First vector * @param {Array(Number)} v Second vector * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, u otherwise */ addVec4(u, v, dest) { if (!dest) { dest = u; } dest[0] = u[0] + v[0]; dest[1] = u[1] + v[1]; dest[2] = u[2] + v[2]; dest[3] = u[3] + v[3]; return dest; }, /** * Adds a scalar value to each element of a four-element vector. * @method addVec4Scalar * @static * @param {Array(Number)} v The vector * @param {Number} s The scalar * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, v otherwise */ addVec4Scalar(v, s, dest) { if (!dest) { dest = v; } dest[0] = v[0] + s; dest[1] = v[1] + s; dest[2] = v[2] + s; dest[3] = v[3] + s; return dest; }, /** * Adds one three-element vector to another. * @method addVec3 * @static * @param {Array(Number)} u First vector * @param {Array(Number)} v Second vector * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, u otherwise */ addVec3(u, v, dest) { if (!dest) { dest = u; } dest[0] = u[0] + v[0]; dest[1] = u[1] + v[1]; dest[2] = u[2] + v[2]; return dest; }, /** * Adds a scalar value to each element of a three-element vector. * @method addVec4Scalar * @static * @param {Array(Number)} v The vector * @param {Number} s The scalar * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, v otherwise */ addVec3Scalar(v, s, dest) { if (!dest) { dest = v; } dest[0] = v[0] + s; dest[1] = v[1] + s; dest[2] = v[2] + s; return dest; }, /** * Subtracts one four-element vector from another. * @method subVec4 * @static * @param {Array(Number)} u First vector * @param {Array(Number)} v Vector to subtract * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, u otherwise */ subVec4(u, v, dest) { if (!dest) { dest = u; } dest[0] = u[0] - v[0]; dest[1] = u[1] - v[1]; dest[2] = u[2] - v[2]; dest[3] = u[3] - v[3]; return dest; }, /** * Subtracts one three-element vector from another. * @method subVec3 * @static * @param {Array(Number)} u First vector * @param {Array(Number)} v Vector to subtract * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, u otherwise */ subVec3(u, v, dest) { if (!dest) { dest = u; } dest[0] = u[0] - v[0]; dest[1] = u[1] - v[1]; dest[2] = u[2] - v[2]; return dest; }, /** * Subtracts one two-element vector from another. * @method subVec2 * @static * @param {Array(Number)} u First vector * @param {Array(Number)} v Vector to subtract * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, u otherwise */ subVec2(u, v, dest) { if (!dest) { dest = u; } dest[0] = u[0] - v[0]; dest[1] = u[1] - v[1]; return dest; }, /** * Subtracts a scalar value from each element of a four-element vector. * @method subVec4Scalar * @static * @param {Array(Number)} v The vector * @param {Number} s The scalar * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, v otherwise */ subVec4Scalar(v, s, dest) { if (!dest) { dest = v; } dest[0] = v[0] - s; dest[1] = v[1] - s; dest[2] = v[2] - s; dest[3] = v[3] - s; return dest; }, /** * Sets each element of a 4-element vector to a scalar value minus the value of that element. * @method subScalarVec4 * @static * @param {Array(Number)} v The vector * @param {Number} s The scalar * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, v otherwise */ subScalarVec4(v, s, dest) { if (!dest) { dest = v; } dest[0] = s - v[0]; dest[1] = s - v[1]; dest[2] = s - v[2]; dest[3] = s - v[3]; return dest; }, /** * Multiplies one three-element vector by another. * @method mulVec3 * @static * @param {Array(Number)} u First vector * @param {Array(Number)} v Second vector * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, u otherwise */ mulVec4(u, v, dest) { if (!dest) { dest = u; } dest[0] = u[0] * v[0]; dest[1] = u[1] * v[1]; dest[2] = u[2] * v[2]; dest[3] = u[3] * v[3]; return dest; }, /** * Multiplies each element of a four-element vector by a scalar. * @method mulVec34calar * @static * @param {Array(Number)} v The vector * @param {Number} s The scalar * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, v otherwise */ mulVec4Scalar(v, s, dest) { if (!dest) { dest = v; } dest[0] = v[0] * s; dest[1] = v[1] * s; dest[2] = v[2] * s; dest[3] = v[3] * s; return dest; }, /** * Multiplies each element of a three-element vector by a scalar. * @method mulVec3Scalar * @static * @param {Array(Number)} v The vector * @param {Number} s The scalar * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, v otherwise */ mulVec3Scalar(v, s, dest) { if (!dest) { dest = v; } dest[0] = v[0] * s; dest[1] = v[1] * s; dest[2] = v[2] * s; return dest; }, /** * Multiplies each element of a two-element vector by a scalar. * @method mulVec2Scalar * @static * @param {Array(Number)} v The vector * @param {Number} s The scalar * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, v otherwise */ mulVec2Scalar(v, s, dest) { if (!dest) { dest = v; } dest[0] = v[0] * s; dest[1] = v[1] * s; return dest; }, /** * Divides one three-element vector by another. * @method divVec3 * @static * @param {Array(Number)} u First vector * @param {Array(Number)} v Second vector * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, u otherwise */ divVec3(u, v, dest) { if (!dest) { dest = u; } dest[0] = u[0] / v[0]; dest[1] = u[1] / v[1]; dest[2] = u[2] / v[2]; return dest; }, /** * Divides one four-element vector by another. * @method divVec4 * @static * @param {Array(Number)} u First vector * @param {Array(Number)} v Second vector * @param {Array(Number)} [dest] Destination vector * @return {Array(Number)} dest if specified, u otherwise */ divVec4(u, v, dest) { if (!dest) { dest = u; } dest[0] = u[0] / v[0]; dest[1] = u[1] / v[1]; dest[2] = u[2] / v[2]; dest[3] = u[3] / v[3]; return dest; }, /** * Divides a scalar by a three-element vector, returning a new vector. * @method divScalarVec3 * @static * @param v vec3 * @param s scalar * @param dest vec3 - optional destination * @return [] dest if specified, v otherwise */ divScalarVec3(s, v, dest) { if (!dest) { dest = v; } dest[0] = s / v[0]; dest[1] = s / v[1]; dest[2] = s / v[2]; return dest; }, /** * Divides a three-element vector by a scalar. * @method divVec3Scalar * @static * @param v vec3 * @param s scalar * @param dest vec3 - optional destination * @return [] dest if specified, v otherwise */ divVec3Scalar(v, s, dest) { if (!dest) { dest = v; } dest[0] = v[0] / s; dest[1] = v[1] / s; dest[2] = v[2] / s; return dest; }, /** * Divides a four-element vector by a scalar. * @method divVec4Scalar * @static * @param v vec4 * @param s scalar * @param dest vec4 - optional destination * @return [] dest if specified, v otherwise */ divVec4Scalar(v, s, dest) { if (!dest) { dest = v; } dest[0] = v[0] / s; dest[1] = v[1] / s; dest[2] = v[2] / s; dest[3] = v[3] / s; return dest; }, /** * Divides a scalar by a four-element vector, returning a new vector. * @method divScalarVec4 * @static * @param s scalar * @param v vec4 * @param dest vec4 - optional destination * @return [] dest if specified, v otherwise */ divScalarVec4(s, v, dest) { if (!dest) { dest = v; } dest[0] = s / v[0]; dest[1] = s / v[1]; dest[2] = s / v[2]; dest[3] = s / v[3]; return dest; }, /** * Returns the dot product of two four-element vectors. * @method dotVec4 * @static * @param {Array(Number)} u First vector * @param {Array(Number)} v Second vector * @return The dot product */ dotVec4(u, v) { return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2] + u[3] * v[3]); }, /** * Returns the cross product of two four-element vectors. * @method cross3Vec4 * @static * @param {Array(Number)} u First vector * @param {Array(Number)} v Second vector * @return The cross product */ cross3Vec4(u, v) { const u0 = u[0]; const u1 = u[1]; const u2 = u[2]; const v0 = v[0]; const v1 = v[1]; const v2 = v[2]; return [ u1 * v2 - u2 * v1, u2 * v0 - u0 * v2, u0 * v1 - u1 * v0, 0.0]; }, /** * Returns the cross product of two three-element vectors. * @method cross3Vec3 * @static * @param {Array(Number)} u First vector * @param {Array(Number)} v Second vector * @return The cross product */ cross3Vec3(u, v, dest) { if (!dest) { dest = u; } const x = u[0]; const y = u[1]; const z = u[2]; const x2 = v[0]; const y2 = v[1]; const z2 = v[2]; dest[0] = y * z2 - z * y2; dest[1] = z * x2 - x * z2; dest[2] = x * y2 - y * x2; return dest; }, sqLenVec4(v) { // TODO return math.dotVec4(v, v); }, /** * Returns the length of a four-element vector. * @method lenVec4 * @static * @param {Array(Number)} v The vector * @return The length */ lenVec4(v) { return Math.sqrt(math.sqLenVec4(v)); }, /** * Returns the dot product of two three-element vectors. * @method dotVec3 * @static * @param {Array(Number)} u First vector * @param {Array(Number)} v Second vector * @return The dot product */ dotVec3(u, v) { return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2]); }, /** * Returns the dot product of two two-element vectors. * @method dotVec4 * @static * @param {Array(Number)} u First vector * @param {Array(Number)} v Second vector * @return The dot product */ dotVec2(u, v) { return (u[0] * v[0] + u[1] * v[1]); }, sqLenVec3(v) { return math.dotVec3(v, v); }, sqLenVec2(v) { return math.dotVec2(v, v); }, /** * Returns the length of a three-element vector. * @method lenVec3 * @static * @param {Array(Number)} v The vector * @return The length */ lenVec3(v) { return Math.sqrt(math.sqLenVec3(v)); }, distVec3: ((() => { const vec = new FloatArrayType(3); return (v, w) => math.lenVec3(math.subVec3(v, w, vec)); }))(), /** * Returns the length of a two-element vector. * @method lenVec2 * @static * @param {Array(Number)} v The vector * @return The length */ lenVec2(v) { return Math.sqrt(math.sqLenVec2(v)); }, distVec2: ((() => { const vec = new FloatArrayType(2); return (v, w) => math.lenVec2(math.subVec2(v, w, vec)); }))(), /** * @method rcpVec3 * @static * @param v vec3 * @param dest vec3 - optional destination * @return [] dest if specified, v otherwise * */ rcpVec3(v, dest) { return math.divScalarVec3(1.0, v, dest); }, /** * Normalizes a four-element vector * @method normalizeVec4 * @static * @param v vec4 * @param dest vec4 - optional destination * @return [] dest if specified, v otherwise * */ normalizeVec4(v, dest) { const f = 1.0 / math.lenVec4(v); return math.mulVec4Scalar(v, f, dest); }, /** * Normalizes a three-element vector * @method normalizeVec4 * @static */ normalizeVec3(v, dest) { const f = 1.0 / math.lenVec3(v); return math.mulVec3Scalar(v, f, dest); }, /** * Normalizes a two-element vector * @method normalizeVec2 * @static */ normalizeVec2(v, dest) { const f = 1.0 / math.lenVec2(v); return math.mulVec2Scalar(v, f, dest); }, /** * Gets the angle between two vectors * @method angleVec3 * @param v * @param w * @returns {number} */ angleVec3(v, w) { let theta = math.dotVec3(v, w) / (Math.sqrt(math.sqLenVec3(v) * math.sqLenVec3(w))); theta = theta < -1 ? -1 : (theta > 1 ? 1 : theta); // Clamp to handle numerical problems return Math.acos(theta); }, /** * Creates a three-element vector from the rotation part of a sixteen-element matrix. * @param m * @param dest */ vec3FromMat4Scale: ((() => { const tempVec3 = new FloatArrayType(3); return (m, dest) => { tempVec3[0] = m[0]; tempVec3[1] = m[1]; tempVec3[2] = m[2]; dest[0] = math.lenVec3(tempVec3); tempVec3[0] = m[4]; tempVec3[1] = m[5]; tempVec3[2] = m[6]; dest[1] = math.lenVec3(tempVec3); tempVec3[0] = m[8]; tempVec3[1] = m[9]; tempVec3[2] = m[10]; dest[2] = math.lenVec3(tempVec3); return dest; }; }))(), /** * Converts an n-element vector to a JSON-serializable * array with values rounded to two decimal places. */ vecToArray: ((() => { function trunc(v) { return Math.round(v * 100000) / 100000 } return v => { v = Array.prototype.slice.call(v); for (let i = 0, len = v.length; i < len; i++) { v[i] = trunc(v[i]); } return v; }; }))(), /** * Converts a 3-element vector from an array to an object of the form ````{x:999, y:999, z:999}````. * @param arr * @returns {{x: *, y: *, z: *}} */ xyzArrayToObject(arr) { return {"x": arr[0], "y": arr[1], "z": arr[2]}; }, /** * Converts a 3-element vector object of the form ````{x:999, y:999, z:999}```` to an array. * @param xyz * @param [arry] * @returns {*[]} */ xyzObjectToArray(xyz, arry) { arry = arry || new FloatArrayType(3); arry[0] = xyz.x; arry[1] = xyz.y; arry[2] = xyz.z; return arry; }, /** * Duplicates a 4x4 identity matrix. * @method dupMat4 * @static */ dupMat4(m) { return m.slice(0, 16); }, /** * Extracts a 3x3 matrix from a 4x4 matrix. * @method mat4To3 * @static */ mat4To3(m) { return [ m[0], m[1], m[2], m[4], m[5], m[6], m[8], m[9], m[10] ]; }, /** * Returns a 4x4 matrix with each element set to the given scalar value. * @method m4s * @static */ m4s(s) { return [ s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s ]; }, /** * Returns a 4x4 matrix with each element set to zero. * @method setMat4ToZeroes * @static */ setMat4ToZeroes() { return math.m4s(0.0); }, /** * Returns a 4x4 matrix with each element set to 1.0. * @method setMat4ToOnes * @static */ setMat4ToOnes() { return math.m4s(1.0); }, /** * Returns a 4x4 matrix with each element set to 1.0. * @method setMat4ToOnes * @static */ diagonalMat4v(v) { return new FloatArrayType([ v[0], 0.0, 0.0, 0.0, 0.0, v[1], 0.0, 0.0, 0.0, 0.0, v[2], 0.0, 0.0, 0.0, 0.0, v[3] ]); }, /** * Returns a 4x4 matrix with diagonal elements set to the given vector. * @method diagonalMat4c * @static */ diagonalMat4c(x, y, z, w) { return math.diagonalMat4v([x, y, z, w]); }, /** * Returns a 4x4 matrix with diagonal elements set to the given scalar. * @method diagonalMat4s * @static */ diagonalMat4s(s) { return math.diagonalMat4c(s, s, s, s); }, /** * Returns a 4x4 identity matrix. * @method identityMat4 * @static */ identityMat4(mat = new FloatArrayType(16)) { mat[0] = 1.0; mat[1] = 0.0; mat[2] = 0.0; mat[3] = 0.0; mat[4] = 0.0; mat[5] = 1.0; mat[6] = 0.0; mat[7] = 0.0; mat[8] = 0.0; mat[9] = 0.0; mat[10] = 1.0; mat[11] = 0.0; mat[12] = 0.0; mat[13] = 0.0; mat[14] = 0.0; mat[15] = 1.0; return mat; }, /** * Returns a 3x3 identity matrix. * @method identityMat3 * @static */ identityMat3(mat = new FloatArrayType(9)) { mat[0] = 1.0; mat[1] = 0.0; mat[2] = 0.0; mat[3] = 0.0; mat[4] = 1.0; mat[5] = 0.0; mat[6] = 0.0; mat[7] = 0.0; mat[8] = 1.0; return mat; }, /** * Tests if the given 4x4 matrix is the identity matrix. * @method isIdentityMat4 * @static */ isIdentityMat4(m) { if (m[0] !== 1.0 || m[1] !== 0.0 || m[2] !== 0.0 || m[3] !== 0.0 || m[4] !== 0.0 || m[5] !== 1.0 || m[6] !== 0.0 || m[7] !== 0.0 || m[8] !== 0.0 || m[9] !== 0.0 || m[10] !== 1.0 || m[11] !== 0.0 || m[12] !== 0.0 || m[13] !== 0.0 || m[14] !== 0.0 || m[15] !== 1.0) { return false; } return true; }, /** * Negates the given 4x4 matrix. * @method negateMat4 * @static */ negateMat4(m, dest) { if (!dest) { dest = m; } dest[0] = -m[0]; dest[1] = -m[1]; dest[2] = -m[2]; dest[3] = -m[3]; dest[4] = -m[4]; dest[5] = -m[5]; dest[6] = -m[6]; dest[7] = -m[7]; dest[8] = -m[8]; dest[9] = -m[9]; dest[10] = -m[10]; dest[11] = -m[11]; dest[12] = -m[12]; dest[13] = -m[13]; dest[14] = -m[14]; dest[15] = -m[15]; return dest; }, /** * Adds the given 4x4 matrices together. * @method addMat4 * @static */ addMat4(a, b, dest) { if (!dest) { dest = a; } dest[0] = a[0] + b[0]; dest[1] = a[1] + b[1]; dest[2] = a[2] + b[2]; dest[3] = a[3] + b[3]; dest[4] = a[4] + b[4]; dest[5] = a[5] + b[5]; dest[6] = a[6] + b[6]; dest[7] = a[7] + b[7]; dest[8] = a[8] + b[8]; dest[9] = a[9] + b[9]; dest[10] = a[10] + b[10]; dest[11] = a[11] + b[11]; dest[12] = a[12] + b[12]; dest[13] = a[13] + b[13]; dest[14] = a[14] + b[14]; dest[15] = a[15] + b[15]; return dest; }, /** * Adds the given scalar to each element of the given 4x4 matrix. * @method addMat4Scalar * @static */ addMat4Scalar(m, s, dest) { if (!dest) { dest = m; } dest[0] = m[0] + s; dest[1] = m[1] + s; dest[2] = m[2] + s; dest[3] = m[3] + s; dest[4] = m[4] + s; dest[5] = m[5] + s; dest[6] = m[6] + s; dest[7] = m[7] + s; dest[8] = m[8] + s; dest[9] = m[9] + s; dest[10] = m[10] + s; dest[11] = m[11] + s; dest[12] = m[12] + s; dest[13] = m[13] + s; dest[14] = m[14] + s; dest[15] = m[15] + s; return dest; }, /** * Adds the given scalar to each element of the given 4x4 matrix. * @method addScalarMat4 * @static */ addScalarMat4(s, m, dest) { return math.addMat4Scalar(m, s, dest); }, /** * Subtracts the second 4x4 matrix from the first. * @method subMat4 * @static */ subMat4(a, b, dest) { if (!dest) { dest = a; } dest[0] = a[0] - b[0]; dest[1] = a[1] - b[1]; dest[2] = a[2] - b[2]; dest[3] = a[3] - b[3]; dest[4] = a[4] - b[4]; dest[5] = a[5] - b[5]; dest[6] = a[6] - b[6]; dest[7] = a[7] - b[7]; dest[8] = a[8] - b[8]; dest[9] = a[9] - b[9]; dest[10] = a[10] - b[10]; dest[11] = a[11] - b[11]; dest[12] = a[12] - b[12]; dest[13] = a[13] - b[13]; dest[14] = a[14] - b[14]; dest[15] = a[15] - b[15]; return dest; }, /** * Subtracts the given scalar from each element of the given 4x4 matrix. * @method subMat4Scalar * @static */ subMat4Scalar(m, s, dest) { if (!dest) { dest = m; } dest[0] = m[0] - s; dest[1] = m[1] - s; dest[2] = m[2] - s; dest[3] = m[3] - s; dest[4] = m[4] - s; dest[5] = m[5] - s; dest[6] = m[6] - s; dest[7] = m[7] - s; dest[8] = m[8] - s; dest[9] = m[9] - s; dest[10] = m[10] - s; dest[11] = m[11] - s; dest[12] = m[12] - s; dest[13] = m[13] - s; dest[14] = m[14] - s; dest[15] = m[15] - s; return dest; }, /** * Subtracts the given scalar from each element of the given 4x4 matrix. * @method subScalarMat4 * @static */ subScalarMat4(s, m, dest) { if (!dest) { dest = m; } dest[0] = s - m[0]; dest[1] = s - m[1]; dest[2] = s - m[2]; dest[3] = s - m[3]; dest[4] = s - m[4]; dest[5] = s - m[5]; dest[6] = s - m[6]; dest[7] = s - m[7]; dest[8] = s - m[8]; dest[9] = s - m[9]; dest[10] = s - m[10]; dest[11] = s - m[11]; dest[12] = s - m[12]; dest[13] = s - m[13]; dest[14] = s - m[14]; dest[15] = s - m[15]; return dest; }, /** * Multiplies the two given 4x4 matrix by each other. * @method mulMat4 * @static */ mulMat4(a, b, dest) { if (!dest) { dest = a; } // Cache the matrix values (makes for huge speed increases!) const a00 = a[0]; const a01 = a[1]; const a02 = a[2]; const a03 = a[3]; const a10 = a[4]; const a11 = a[5]; const a12 = a[6]; const a13 = a[7]; const a20 = a[8]; const a21 = a[9]; const a22 = a[10]; const a23 = a[11]; const a30 = a[12]; const a31 = a[13]; const a32 = a[14]; const a33 = a[15]; const b00 = b[0]; const b01 = b[1]; const b02 = b[2]; const b03 = b[3]; const b10 = b[4]; const b11 = b[5]; const b12 = b[6]; const b13 = b[7]; const b20 = b[8]; const b21 = b[9]; const b22 = b[10]; const b23 = b[11]; const b30 = b[12]; const b31 = b[13]; const b32 = b[14]; const b33 = b[15]; dest[0] = b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30; dest[1] = b00 * a01 + b01 * a11 + b02 * a21 + b03 * a31; dest[2] = b00 * a02 + b01 * a12 + b02 * a22 + b03 * a32; dest[3] = b00 * a03 + b01 * a13 + b02 * a23 + b03 * a33; dest[4] = b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30; dest[5] = b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31; dest[6] = b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32; dest[7] = b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33; dest[8] = b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30; dest[9] = b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31; dest[10] = b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32; dest[11] = b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33; dest[12] = b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30; dest[13] = b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31; dest[14] = b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32; dest[15] = b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33; return dest; }, /** * Multiplies the two given 3x3 matrices by each other. * @method mulMat4 * @static */ mulMat3(a, b, dest) { if (!dest) { dest = new FloatArrayType(9); } const a11 = a[0]; const a12 = a[3]; const a13 = a[6]; const a21 = a[1]; const a22 = a[4]; const a23 = a[7]; const a31 = a[2]; const a32 = a[5]; const a33 = a[8]; const b11 = b[0]; const b12 = b[3]; const b13 = b[6]; const b21 = b[1]; const b22 = b[4]; const b23 = b[7]; const b31 = b[2]; const b32 = b[5]; const b33 = b[8]; dest[0] = a11 * b11 + a12 * b21 + a13 * b31; dest[3] = a11 * b12 + a12 * b22 + a13 * b32; dest[6] = a11 * b13 + a12 * b23 + a13 * b33; dest[1] = a21 * b11 + a22 * b21 + a23 * b31; dest[4] = a21 * b12 + a22 * b22 + a23 * b32; dest[7] = a21 * b13 + a22 * b23 + a23 * b33; dest[2] = a31 * b11 + a32 * b21 + a33 * b31; dest[5] = a31 * b12 + a32 * b22 + a33 * b32; dest[8] = a31 * b13 + a32 * b23 + a33 * b33; return dest; }, /** * Multiplies each element of the given 4x4 matrix by the given scalar. * @method mulMat4Scalar * @static */ mulMat4Scalar(m, s, dest) { if (!dest) { dest = m; } dest[0] = m[0] * s; dest[1] = m[1] * s; dest[2] = m[2] * s; dest[3] = m[3] * s; dest[4] = m[4] * s; dest[5] = m[5] * s; dest[6] = m[6] * s; dest[7] = m[7] * s; dest[8] = m[8] * s; dest[9] = m[9] * s; dest[10] = m[10] * s; dest[11] = m[11] * s; dest[12] = m[12] * s; dest[13] = m[13] * s; dest[14] = m[14] * s; dest[15] = m[15] * s; return dest; }, /** * Multiplies the given 4x4 matrix by the given four-element vector. * @method mulMat4v4 * @static */ mulMat4v4(m, v, dest = math.vec4()) { const v0 = v[0]; const v1 = v[1]; const v2 = v[2]; const v3 = v[3]; dest[0] = m[0] * v0 + m[4] * v1 + m[8] * v2 + m[12] * v3; dest[1] = m[1] * v0 + m[5] * v1 + m[9] * v2 + m[13] * v3; dest[2] = m[2] * v0 + m[6] * v1 + m[10] * v2 + m[14] * v3; dest[3] = m[3] * v0 + m[7] * v1 + m[11] * v2 + m[15] * v3; return dest; }, /** * Transposes the given 4x4 matrix. * @method transposeMat4 * @static */ transposeMat4(mat, dest) { // If we are transposing ourselves we can skip a few steps but have to cache some values const m4 = mat[4]; const m14 = mat[14]; const m8 = mat[8]; const m13 = mat[13]; const m12 = mat[12]; const m9 = mat[9]; if (!dest || mat === dest) { const a01 = mat[1]; const a02 = mat[2]; const a03 = mat[3]; const a12 = mat[6]; const a13 = mat[7]; const a23 = mat[11]; mat[1] = m4; mat[2] = m8; mat[3] = m12; mat[4] = a01; mat[6] = m9; mat[7] = m13; mat[8] = a02; mat[9] = a12; mat[11] = m14; mat[12] = a03; mat[13] = a13; mat[14] = a23; return mat; } dest[0] = mat[0]; dest[1] = m4; dest[2] = m8; dest[3] = m12; dest[4] = mat[1]; dest[5] = mat[5]; dest[6] = m9; dest[7] = m13; dest[8] = mat[2]; dest[9] = mat[6]; dest[10] = mat[10]; dest[11] = m14; dest[12] = mat[3]; dest[13] = mat[7]; dest[14] = mat[11]; dest[15] = mat[15]; return dest; }, /** * Transposes the given 3x3 matrix. * * @method transposeMat3 * @static */ transposeMat3(mat, dest) { if (dest === mat) { const a01 = mat[1]; const a02 = mat[2]; const a12 = mat[5]; dest[1] = mat[3]; dest[2] = mat[6]; dest[3] = a01; dest[5] = mat[7]; dest[6] = a02; dest[7] = a12; } else { dest[0] = mat[0]; dest[1] = mat[3]; dest[2] = mat[6]; dest[3] = mat[1]; dest[4] = mat[4]; dest[5] = mat[7]; dest[6] = mat[2]; dest[7] = mat[5]; dest[8] = mat[8]; } return dest; }, /** * Returns the determinant of the given 4x4 matrix. * @method determinantMat4 * @static */ determinantMat4(mat) { // Cache the matrix values (makes for huge speed increases!) const a00 = mat[0]; const a01 = mat[1]; const a02 = mat[2]; const a03 = mat[3]; const a10 = mat[4]; const a11 = mat[5]; const a12 = mat[6]; const a13 = mat[7]; const a20 = mat[8]; const a21 = mat[9]; const a22 = mat[10]; const a23 = mat[11]; const a30 = mat[12]; const a31 = mat[13]; const a32 = mat[14]; const a33 = mat[15]; return a30 * a21 * a12 * a03 - a20 * a31 * a12 * a03 - a30 * a11 * a22 * a03 + a10 * a31 * a22 * a03 + a20 * a11 * a32 * a03 - a10 * a21 * a32 * a03 - a30 * a21 * a02 * a13 + a20 * a31 * a02 * a13 + a30 * a01 * a22 * a13 - a00 * a31 * a22 * a13 - a20 * a01 * a32 * a13 + a00 * a21 * a32 * a13 + a30 * a11 * a02 * a23 - a10 * a31 * a02 * a23 - a30 * a01 * a12 * a23 + a00 * a31 * a12 * a23 + a10 * a01 * a32 * a23 - a00 * a11 * a32 * a23 - a20 * a11 * a02 * a33 + a10 * a21 * a02 * a33 + a20 * a01 * a12 * a33 - a00 * a21 * a12 * a33 - a10 * a01 * a22 * a33 + a00 * a11 * a22 * a33; }, /** * Returns the inverse of the given 4x4 matrix. * @method inverseMat4 * @static */ inverseMat4(mat, dest) { if (!dest) { dest = mat; } // Cache the matrix values (makes for huge speed increases!) const a00 = mat[0]; const a01 = mat[1]; const a02 = mat[2]; const a03 = mat[3]; const a10 = mat[4]; const a11 = mat[5]; const a12 = mat[6]; const a13 = mat[7]; const a20 = mat[8]; const a21 = mat[9]; const a22 = mat[10]; const a23 = mat[11]; const a30 = mat[12]; const a31 = mat[13]; const a32 = mat[14]; const a33 = mat[15]; const b00 = a00 * a11 - a01 * a10; const b01 = a00 * a12 - a02 * a10; const b02 = a00 * a13 - a03 * a10; const b03 = a01 * a12 - a02 * a11; const b04 = a01 * a13 - a03 * a11; const b05 = a02 * a13 - a03 * a12; const b06 = a20 * a31 - a21 * a30; const b07 = a20 * a32 - a22 * a30; const b08 = a20 * a33 - a23 * a30; const b09 = a21 * a32 - a22 * a31; const b10 = a21 * a33 - a23 * a31; const b11 = a22 * a33 - a23 * a32; // Calculate the determinant (inlined to avoid double-caching) const invDet = 1 / (b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06); dest[0] = (a11 * b11 - a12 * b10 + a13 * b09) * invDet; dest[1] = (-a01 * b11 + a02 * b10 - a03 * b09) * invDet; dest[2] = (a31 * b05 - a32 * b04 + a33 * b03) * invDet; dest[3] = (-a21 * b05 + a22 * b04 - a23 * b03) * invDet; dest[4] = (-a10 * b11 + a12 * b08 - a13 * b07) * invDet; dest[5] = (a00 * b11 - a02 * b08 + a03 * b07) * invDet; dest[6] = (-a30 * b05 + a32 * b02 - a33 * b01) * invDet; dest[7] = (a20 * b05 - a22 * b02 + a23 * b01) * invDet; dest[8] = (a10 * b10 - a11 * b08 + a13 * b06) * invDet; dest[9] = (-a00 * b10 + a01 * b08 - a03 * b06) * invDet; dest[10] = (a30 * b04 - a31 * b02 + a33 * b00) * invDet; dest[11] = (-a20 * b04 + a21 * b02 - a23 * b00) * invDet; dest[12] = (-a10 * b09 + a11 * b07 - a12 * b06) * invDet; dest[13] = (a00 * b09 - a01 * b07 + a02 * b06) * invDet; dest[14] = (-a30 * b03 + a31 * b01 - a32 * b00) * invDet; dest[15] = (a20 * b03 - a21 * b01 + a22 * b00) * invDet; return dest; }, /** * Returns the trace of the given 4x4 matrix. * @method traceMat4 * @static */ traceMat4(m) { return (m[0] + m[5] + m[10] + m[15]); }, /** * Returns 4x4 translation matrix. * @method translationMat4 * @static */ translationMat4v(v, dest) { const m = dest || math.identityMat4(); m[12] = v[0]; m[13] = v[1]; m[14] = v[2]; return m; }, /** * Returns 3x3 translation matrix. * @method translationMat3 * @static */ translationMat3v(v, dest) { const m = dest || math.identityMat3(); m[6] = v[0]; m[7] = v[1]; return m; }, /** * Returns 4x4 translation matrix. * @method translationMat4c * @static */ translationMat4c: ((() => { const xyz = new FloatArrayType(3); return (x, y, z, dest) => { xyz[0] = x; xyz[1] = y; xyz[2] = z; return math.translationMat4v(xyz, dest); }; }))(), /** * Returns 4x4 translation matrix. * @method translationMat4s * @static */ translationMat4s(s, dest) { return math.translationMat4c(s, s, s, dest); }, /** * Efficiently post-concatenates a translation to the given matrix. * @param v * @param m */ translateMat4v(xyz, m) { return math.translateMat4c(xyz[0], xyz[1], xyz[2], m); }, /** * Efficiently post-concatenates a translation to the given matrix. * @param x * @param y * @param z * @param m */ OLDtranslateMat4c(x, y, z, m) { const m12 = m[12]; m[0] += m12 * x; m[4] += m12 * y; m[8] += m12 * z; const m13 = m[13]; m[1] += m13 * x; m[5] += m13 * y; m[9] += m13 * z; const m14 = m[14]; m[2] += m14 * x; m[6] += m14 * y; m[10] += m14 * z; const m15 = m[15]; m[3] += m15 * x; m[7] += m15 * y; m[11] += m15 * z; return m; }, translateMat4c(x, y, z, m) { const m3 = m[3]; m[0] += m3 * x; m[1] += m3 * y; m[2] += m3 * z; const m7 = m[7]; m[4] += m7 * x; m[5] += m7 * y; m[6] += m7 * z; const m11 = m[11]; m[8] += m11 * x; m[9] += m11 * y; m[10] += m11 * z; const m15 = m[15]; m[12] += m15 * x; m[13] += m15 * y; m[14] += m15 * z; return m; }, /** * Returns 4x4 rotation matrix. * @method rotationMat4v * @static */ rotationMat4v(anglerad, axis, m) { const ax = math.normalizeVec4([axis[0], axis[1], axis[2], 0.0], []); const s = Math.sin(anglerad); const c = Math.cos(anglerad); const q = 1.0 - c; const x = ax[0]; const y = ax[1]; const z = ax[2]; let xy; let yz; let zx; let xs; let ys; let zs; //xx = x * x; used once //yy = y * y; used once //zz = z * z; used once xy = x * y; yz = y * z; zx = z * x; xs = x * s; ys = y * s; zs = z * s; m = m || math.mat4(); m[0] = (q * x * x) + c; m[1] = (q * xy) + zs; m[2] = (q * zx) - ys; m[3] = 0.0; m[4] = (q * xy) - zs; m[5] = (q * y * y) + c; m[6] = (q * yz) + xs; m[7] = 0.0; m[8] = (q * zx) + ys; m[9] = (q * yz) - xs; m[10] = (q * z * z) + c; m[11] = 0.0; m[12] = 0.0; m[13] = 0.0; m[14] = 0.0; m[15] = 1.0; return m; }, /** * Returns 4x4 rotation matrix. * @method rotationMat4c * @static */ rotationMat4c(anglerad, x, y, z, mat) { return math.rotationMat4v(anglerad, [x, y, z], mat); }, /** * Returns 4x4 scale matrix. * @method scalingMat4v * @static */ scalingMat4v(v, m = math.identityMat4()) { m[0] = v[0]; m[5] = v[1]; m[10] = v[2]; return m; }, /** * Returns 3x3 scale matrix. * @method scalingMat3v * @static */ scalingMat3v(v, m = math.identityMat3()) { m[0] = v[0]; m[4] = v[1]; return m; }, /** * Returns 4x4 scale matrix. * @method scalingMat4c * @static */ scalingMat4c: ((() => { const xyz = new FloatArrayType(3); return (x, y, z, dest) => { xyz[0] = x; xyz[1] = y; xyz[2] = z; return math.scalingMat4v(xyz, dest); }; }))(), /** * Efficiently post-concatenates a scaling to the given matrix. * @method scaleMat4c * @param x * @param y * @param z * @param m */ scaleMat4c(x, y, z, m) { m[0] *= x; m[4] *= y; m[8] *= z; m[1] *= x; m[5] *= y; m[9] *= z; m[2] *= x; m[6] *= y; m[10] *= z; m[3] *= x; m[7] *= y; m[11] *= z; return m; }, /** * Efficiently post-concatenates a scaling to the given matrix. * @method scaleMat4c * @param xyz * @param m */ scaleMat4v(xyz, m) { const x = xyz[0]; const y = xyz[1]; const z = xyz[2]; m[0] *= x; m[4] *= y; m[8] *= z; m[1] *= x; m[5] *= y; m[9] *= z; m[2] *= x; m[6] *= y; m[10] *= z; m[3] *= x; m[7] *= y; m[11] *= z; return m; }, /** * Returns 4x4 scale matrix. * @method scalingMat4s * @static */ scalingMat4s(s) { return math.scalingMat4c(s, s, s); }, /** * Creates a matrix from a quaternion rotation and vector translation * * @param {Number[]} q Rotation quaternion * @param {Number[]} v Translation vector * @param {Number[]} dest Destination matrix * @returns {Number[]} dest */ rotationTranslationMat4(q, v, dest = math.mat4()) { const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3]; const x2 = x + x; const y2 = y + y; const z2 = z + z; const xx = x * x2; const xy = x * y2; const xz = x * z2; const yy = y * y2; const yz = y * z2; const zz = z * z2; const wx = w * x2; const wy = w * y2; const wz = w * z2; dest[0] = 1 - (yy + zz); dest[1] = xy + wz; dest[2] = xz - wy; dest[3] = 0; dest[4] = xy - wz; dest[5] = 1 - (xx + zz); dest[6] = yz + wx; dest[7] = 0; dest[8] = xz + wy; dest[9] = yz - wx; dest[10] = 1 - (xx + yy); dest[11] = 0; dest[12] = v[0]; dest[13] = v[1]; dest[14] = v[2]; dest[15] = 1; return dest; }, /** * Gets Euler angles from a 4x4 matrix. * * @param {Number[]} mat The 4x4 matrix. * @param {String} order Desired Euler angle order: "XYZ", "YXZ", "ZXY" etc. * @param {Number[]} [dest] Destination Euler angles, created by default. * @returns {Number[]} The Euler angles. */ mat4ToEuler(mat, order, dest = math.vec4()) { const clamp = math.clamp; // Assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) const m11 = mat[0]; const m12 = mat[4]; const m13 = mat[8]; const m21 = mat[1]; const m22 = mat[5]; const m23 = mat[9]; const m31 = mat[2]; const m32 = mat[6]; const m33 = mat[10]; if (order === 'XYZ') { dest[1] = Math.asin(clamp(m13, -1, 1)); if (Math.abs(m13) < 0.99999) { dest[0] = Math.atan2(-m23, m33); dest[2] = Math.atan2(-m12, m11); } else { dest[0] = Math.atan2(m32, m22); dest[2] = 0; } } else if (order === 'YXZ') { dest[0] = Math.asin(-clamp(m23, -1, 1)); if (Math.abs(m23) < 0.99999) { dest[1] = Math.atan2(m13, m33); dest[2] = Math.atan2(m21, m22); } else { dest[1] = Math.atan2(-m31, m11); dest[2] = 0; } } else if (order === 'ZXY') { dest[0] = Math.asin(clamp(m32, -1, 1)); if (Math.abs(m32) < 0.99999) { dest[1] = Math.atan2(-m31, m33); dest[2] = Math.atan2(-m12, m22); } else { dest[1] = 0; dest[2] = Math.atan2(m21, m11); } } else if (order === 'ZYX') { dest[1] = Math.asin(-clamp(m31, -1, 1)); if (Math.abs(m31) < 0.99999) { dest[0] = Math.atan2(m32, m33); dest[2] = Math.atan2(m21, m11); } else { dest[0] = 0; dest[2] = Math.atan2(-m12, m22); } } else if (order === 'YZX') { dest[2] = Math.asin(clamp(m21, -1, 1)); if (Math.abs(m21) < 0.99999) { dest[0] = Math.atan2(-m23, m22); dest[1] = Math.atan2(-m31, m11); } else { dest[0] = 0; dest[1] = Math.atan2(m13, m33); } } else if (order === 'XZY') { dest[2] = Math.asin(-clamp(m12, -1, 1)); if (Math.abs(m12) < 0.99999) { dest[0] = Math.atan2(m32, m22); dest[1] = Math.atan2(m13, m11); } else { dest[0] = Math.atan2(-m23, m33); dest[1] = 0; } } return dest; }, composeMat4(position, quaternion, scale, mat = math.mat4()) { math.quaternionToRotationMat4(quaternion, mat); math.scaleMat4v(scale, mat); math.translateMat4v(position, mat); return mat; }, decomposeMat4: (() => { const vec = new FloatArrayType(3); const matrix = new FloatArrayType(16); return function decompose(mat, position, quaternion, scale) { vec[0] = mat[0]; vec[1] = mat[1]; vec[2] = mat[2]; let sx = math.lenVec3(vec); vec[0] = mat[4]; vec[1] = mat[5]; vec[2] = mat[6]; const sy = math.lenVec3(vec); vec[8] = mat[8]; vec[9] = mat[9]; vec[10] = mat[10]; const sz = math.lenVec3(vec); // if determine is negative, we need to invert one scale const det = math.determinantMat4(mat); if (det < 0) { sx = -sx; } position[0] = mat[12]; position[1] = mat[13]; position[2] = mat[14]; // scale the rotation part matrix.set(mat); const invSX = 1 / sx; const invSY = 1 / sy; const invSZ = 1 / sz; matrix[0] *= invSX; matrix[1] *= invSX; matrix[2] *= invSX; matrix[4] *= invSY; matrix[5] *= invSY; matrix[6] *= invSY; matrix[8] *= invSZ; matrix[9] *= invSZ; matrix[10] *= invSZ; math.mat4ToQuaternion(matrix, quaternion); scale[0] = sx; scale[1] = sy; scale[2] = sz; return this; }; })(), /** * Returns a 4x4 'lookat' viewing transform matrix. * @method lookAtMat4v * @param pos vec3 position of the viewer * @param target vec3 point the viewer is looking at * @param up vec3 pointing "up" * @param dest mat4 Optional, mat4 matrix will be written into * * @return {mat4} dest if specified, a new mat4 otherwise */ lookAtMat4v(pos, target, up, dest) { if (!dest) { dest = math.mat4(); } const posx = pos[0]; const posy = pos[1]; const posz = pos[2]; const upx = up[0]; const upy = up[1]; const upz = up[2]; const targetx = target[0]; const targety = target[1]; const targetz = target[2]; if (posx === targetx && posy === targety && posz === targetz) { return math.identityMat4(); } let z0; let z1; let z2; let x0; let x1; let x2; let y0; let y1; let y2; let len; //vec3.direction(eye, center, z); z0 = posx - targetx; z1 = posy - targety; z2 = posz - targetz; // normalize (no check needed for 0 because of early return) len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); z0 *= len; z1 *= len; z2 *= len; //vec3.normalize(vec3.cross(up, z, x)); x0 = upy * z2 - upz * z1; x1 = upz * z0 - upx * z2; x2 = upx * z1 - upy * z0; len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); if (!len) { x0 = 0; x1 = 0; x2 = 0; } else { len = 1 / len; x0 *= len; x1 *= len; x2 *= len; } //vec3.normalize(vec3.cross(z, x, y)); y0 = z1 * x2 - z2 * x1; y1 = z2 * x0 - z0 * x2; y2 = z0 * x1 - z1 * x0; len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); if (!len) { y0 = 0; y1 = 0; y2 = 0; } else { len = 1 / len; y0 *= len; y1 *= len; y2 *= len; } dest[0] = x0; dest[1] = y0; dest[2] = z0; dest[3] = 0; dest[4] = x1; dest[5] = y1; dest[6] = z1; dest[7] = 0; dest[8] = x2; dest[9] = y2; dest[10] = z2; dest[11] = 0; dest[12] = -(x0 * posx + x1 * posy + x2 * posz); dest[13] = -(y0 * posx + y1 * posy + y2 * posz); dest[14] = -(z0 * posx + z1 * posy + z2 * posz); dest[15] = 1; return dest; }, /** * Returns a 4x4 'lookat' viewing transform matrix. * @method lookAtMat4c * @static */ lookAtMat4c(posx, posy, posz, targetx, targety, targetz, upx, upy, upz) { return math.lookAtMat4v([posx, posy, posz], [targetx, targety, targetz], [upx, upy, upz], []); }, /** * Returns a 4x4 orthographic projection matrix. * @method orthoMat4c * @static */ orthoMat4c(left, right, bottom, top, near, far, dest) { if (!dest) { dest = math.mat4(); } const rl = (right - left); const tb = (top - bottom); const fn = (far - near); dest[0] = 2.0 / rl; dest[1] = 0.0; dest[2] = 0.0; dest[3] = 0.0; dest[4] = 0.0; dest[5] = 2.0 / tb; dest[6] = 0.0; dest[7] = 0.0; dest[8] = 0.0; dest[9] = 0.0; dest[10] = -2.0 / fn; dest[11] = 0.0; dest[12] = -(left + right) / rl; dest[13] = -(top + bottom) / tb; dest[14] = -(far + near) / fn; dest[15] = 1.0; return dest; }, /** * Returns a 4x4 perspective projection matrix. * @method frustumMat4v * @static */ frustumMat4v(fmin, fmax, m) { if (!m) { m = math.mat4(); } const fmin4 = [fmin[0], fmin[1], fmin[2], 0.0]; const fmax4 = [fmax[0], fmax[1], fmax[2], 0.0]; math.addVec4(fmax4, fmin4, tempMat1); math.subVec4(fmax4, fmin4, tempMat2); const t = 2.0 * fmin4[2]; const tempMat20 = tempMat2[0]; const tempMat21 = tempMat2[1]; const tempMat22 = tempMat2[2]; m[0] = t / tempMat20; m[1] = 0.0; m[2] = 0.0; m[3] = 0.0; m[4] = 0.0; m[5] = t / tempMat21; m[6] = 0.0; m[7] = 0.0; m[8] = tempMat1[0] / tempMat20; m[9] = tempMat1[1] / tempMat21; m[10] = -tempMat1[2] / tempMat22; m[11] = -1.0; m[12] = 0.0; m[13] = 0.0; m[14] = -t * fmax4[2] / tempMat22; m[15] = 0.0; return m; }, /** * Returns a 4x4 perspective projection matrix. * @method frustumMat4v * @static */ frustumMat4(left, right, bottom, top, near, far, dest) { if (!dest) { dest = math.mat4(); } const rl = (right - left); const tb = (top - bottom); const fn = (far - near); dest[0] = (near * 2) / rl; dest[1] = 0; dest[2] = 0; dest[3] = 0; dest[4] = 0; dest[5] = (near * 2) / tb; dest[6] = 0; dest[7] = 0; dest[8] = (right + left) / rl; dest[9] = (top + bottom) / tb; dest[10] = -(far + near) / fn; dest[11] = -1; dest[12] = 0; dest[13] = 0; dest[14] = -(far * near * 2) / fn; dest[15] = 0; return dest; }, /** * Returns a 4x4 perspective projection matrix. * @method perspectiveMat4v * @static */ perspectiveMat4(fovyrad, aspectratio, znear, zfar, m) { const pmin = []; const pmax = []; pmin[2] = znear; pmax[2] = zfar; pmax[1] = pmin[2] * Math.tan(fovyrad / 2.0); pmin[1] = -pmax[1]; pmax[0] = pmax[1] * aspectratio; pmin[0] = -pmax[0]; return math.frustumMat4v(pmin, pmax, m); }, /** * Transforms a three-element position by a 4x4 matrix. * @method transformPoint3 * @static */ transformPoint3(m, p, dest = math.vec3()) { const x = p[0]; const y = p[1]; const z = p[2]; dest[0] = (m[0] * x) + (m[4] * y) + (m[8] * z) + m[12]; dest[1] = (m[1] * x) + (m[5] * y) + (m[9] * z) + m[13]; dest[2] = (m[2] * x) + (m[6] * y) + (m[10] * z) + m[14]; return dest; }, /** * Transforms a homogeneous coordinate by a 4x4 matrix. * @method transformPoint3 * @static */ transformPoint4(m, v, dest = math.vec4()) { dest[0] = m[0] * v[0] + m[4] * v[1] + m[8] * v[2] + m[12] * v[3]; dest[1] = m[1] * v[0] + m[5] * v[1] + m[9] * v[2] + m[13] * v[3]; dest[2] = m[2] * v[0] + m[6] * v[1] + m[10] * v[2] + m[14] * v[3]; dest[3] = m[3] * v[0] + m[7] * v[1] + m[11] * v[2] + m[15] * v[3]; return dest; }, /** * Transforms an array of three-element positions by a 4x4 matrix. * @method transformPoints3 * @static */ transformPoints3(m, points, points2) { const result = points2 || []; const len = points.length; let p0; let p1; let p2; let pi; // cache values const m0 = m[0]; const m1 = m[1]; const m2 = m[2]; const m3 = m[3]; const m4 = m[4]; const m5 = m[5]; const m6 = m[6]; const m7 = m[7]; const m8 = m[8]; const m9 = m[9]; const m10 = m[10]; const m11 = m[11]; const m12 = m[12]; const m13 = m[13]; const m14 = m[14]; const m15 = m[15]; let r; for (let i = 0; i < len; ++i) { // cache values pi = points[i]; p0 = pi[0]; p1 = pi[1]; p2 = pi[2]; r = result[i] || (result[i] = [0, 0, 0]); r[0] = (m0 * p0) + (m4 * p1) + (m8 * p2) + m12; r[1] = (m1 * p0) + (m5 * p1) + (m9 * p2) + m13; r[2] = (m2 * p0) + (m6 * p1) + (m10 * p2) + m14; r[3] = (m3 * p0) + (m7 * p1) + (m11 * p2) + m15; } result.length = len; return result; }, /** * Transforms an array of positions by a 4x4 matrix. * @method transformPositions3 * @static */ transformPositions3(m, p, p2 = p) { let i; const len = p.length; let x; let y; let z; const m0 = m[0]; const m1 = m[1]; const m2 = m[2]; const m3 = m[3]; const m4 = m[4]; const m5 = m[5]; const m6 = m[6]; const m7 = m[7]; const m8 = m[8]; const m9 = m[9]; const m10 = m[10]; const m11 = m[11]; const m12 = m[12]; const m13 = m[13]; const m14 = m[14]; const m15 = m[15]; for (i = 0; i < len; i += 3) { x = p[i + 0]; y = p[i + 1]; z = p[i + 2]; p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12; p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13; p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14; p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15; } return p2; }, /** * Transforms an array of positions by a 4x4 matrix. * @method transformPositions4 * @static */ transformPositions4(m, p, p2 = p) { let i; const len = p.length; let x; let y; let z; const m0 = m[0]; const m1 = m[1]; const m2 = m[2]; const m3 = m[3]; const m4 = m[4]; const m5 = m[5]; const m6 = m[6]; const m7 = m[7]; const m8 = m[8]; const m9 = m[9]; const m10 = m[10]; const m11 = m[11]; const m12 = m[12]; const m13 = m[13]; const m14 = m[14]; const m15 = m[15]; for (i = 0; i < len; i += 4) { x = p[i + 0]; y = p[i + 1]; z = p[i + 2]; p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12; p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13; p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14; p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15; } return p2; }, /** * Transforms a three-element vector by a 4x4 matrix. * @method transformVec3 * @static */ transformVec3(m, v, dest) { const v0 = v[0]; const v1 = v[1]; const v2 = v[2]; dest = dest || this.vec3(); dest[0] = (m[0] * v0) + (m[4] * v1) + (m[8] * v2); dest[1] = (m[1] * v0) + (m[5] * v1) + (m[9] * v2); dest[2] = (m[2] * v0) + (m[6] * v1) + (m[10] * v2); return dest; }, /** * Transforms a four-element vector by a 4x4 matrix. * @method transformVec4 * @static */ transformVec4(m, v, dest) { const v0 = v[0]; const v1 = v[1]; const v2 = v[2]; const v3 = v[3]; dest = dest || math.vec4(); dest[0] = m[0] * v0 + m[4] * v1 + m[8] * v2 + m[12] * v3; dest[1] = m[1] * v0 + m[5] * v1 + m[9] * v2 + m[13] * v3; dest[2] = m[2] * v0 + m[6] * v1 + m[10] * v2 + m[14] * v3; dest[3] = m[3] * v0 + m[7] * v1 + m[11] * v2 + m[15] * v3; return dest; }, /** * Rotate a 3D vector around the x-axis * * @method rotateVec3X * @param {Number[]} a The vec3 point to rotate * @param {Number[]} b The origin of the rotation * @param {Number} c The angle of rotation * @param {Number[]} dest The receiving vec3 * @returns {Number[]} dest * @static */ rotateVec3X(a, b, c, dest) { const p = []; const r = []; //Translate point to the origin p[0] = a[0] - b[0]; p[1] = a[1] - b[1]; p[2] = a[2] - b[2]; //perform rotation r[0] = p[0]; r[1] = p[1] * Math.cos(c) - p[2] * Math.sin(c); r[2] = p[1] * Math.sin(c) + p[2] * Math.cos(c); //translate to correct position dest[0] = r[0] + b[0]; dest[1] = r[1] + b[1]; dest[2] = r[2] + b[2]; return dest; }, /** * Rotate a 3D vector around the y-axis * * @method rotateVec3Y * @param {Number[]} a The vec3 point to rotate * @param {Number[]} b The origin of the rotation * @param {Number} c The angle of rotation * @param {Number[]} dest The receiving vec3 * @returns {Number[]} dest * @static */ rotateVec3Y(a, b, c, dest) { const p = []; const r = []; //Translate point to the origin p[0] = a[0] - b[0]; p[1] = a[1] - b[1]; p[2] = a[2] - b[2]; //perform rotation r[0] = p[2] * Math.sin(c) + p[0] * Math.cos(c); r[1] = p[1]; r[2] = p[2] * Math.cos(c) - p[0] * Math.sin(c); //translate to correct position dest[0] = r[0] + b[0]; dest[1] = r[1] + b[1]; dest[2] = r[2] + b[2]; return dest; }, /** * Rotate a 3D vector around the z-axis * * @method rotateVec3Z * @param {Number[]} a The vec3 point to rotate * @param {Number[]} b The origin of the rotation * @param {Number} c The angle of rotation * @param {Number[]} dest The receiving vec3 * @returns {Number[]} dest * @static */ rotateVec3Z(a, b, c, dest) { const p = []; const r = []; //Translate point to the origin p[0] = a[0] - b[0]; p[1] = a[1] - b[1]; p[2] = a[2] - b[2]; //perform rotation r[0] = p[0] * Math.cos(c) - p[1] * Math.sin(c); r[1] = p[0] * Math.sin(c) + p[1] * Math.cos(c); r[2] = p[2]; //translate to correct position dest[0] = r[0] + b[0]; dest[1] = r[1] + b[1]; dest[2] = r[2] + b[2]; return dest; }, /** * Transforms a four-element vector by a 4x4 projection matrix. * * @method projectVec4 * @param {Number[]} p 3D View-space coordinate * @param {Number[]} q 2D Projected coordinate * @returns {Number[]} 2D Projected coordinate * @static */ projectVec4(p, q) { const f = 1.0 / p[3]; q = q || math.vec2(); q[0] = v[0] * f; q[1] = v[1] * f; return q; }, /** * Unprojects a three-element vector. * * @method unprojectVec3 * @param {Number[]} p 3D Projected coordinate * @param {Number[]} viewMat View matrix * @returns {Number[]} projMat Projection matrix * @static */ unprojectVec3: ((() => { const mat = new FloatArrayType(16); const mat2 = new FloatArrayType(16); const mat3 = new FloatArrayType(16); return function (p, viewMat, projMat, q) { return this.transformVec3(this.mulMat4(this.inverseMat4(viewMat, mat), this.inverseMat4(projMat, mat2), mat3), p, q) }; }))(), /** * Linearly interpolates between two 3D vectors. * @method lerpVec3 * @static */ lerpVec3(t, t1, t2, p1, p2, dest) { const result = dest || math.vec3(); const f = (t - t1) / (t2 - t1); result[0] = p1[0] + (f * (p2[0] - p1[0])); result[1] = p1[1] + (f * (p2[1] - p1[1])); result[2] = p1[2] + (f * (p2[2] - p1[2])); return result; }, /** * Flattens a two-dimensional array into a one-dimensional array. * * @method flatten * @static * @param {Array of Arrays} a A 2D array * @returns Flattened 1D array */ flatten(a) { const result = []; let i; let leni; let j; let lenj; let item; for (i = 0, leni = a.length; i < leni; i++) { item = a[i]; for (j = 0, lenj = item.length; j < lenj; j++) { result.push(item[j]); } } return result; }, identityQuaternion(dest = math.vec4()) { dest[0] = 0.0; dest[1] = 0.0; dest[2] = 0.0; dest[3] = 1.0; return dest; }, /** * Initializes a quaternion from Euler angles. * * @param {Number[]} euler The Euler angles. * @param {String} order Euler angle order: "XYZ", "YXZ", "ZXY" etc. * @param {Number[]} [dest] Destination quaternion, created by default. * @returns {Number[]} The quaternion. */ eulerToQuaternion(euler, order, dest = math.vec4()) { // http://www.mathworks.com/matlabcentral/fileexchange/ // 20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/ // content/SpinCalc.m const a = (euler[0] * math.DEGTORAD) / 2; const b = (euler[1] * math.DEGTORAD) / 2; const c = (euler[2] * math.DEGTORAD) / 2; const c1 = Math.cos(a); const c2 = Math.cos(b); const c3 = Math.cos(c); const s1 = Math.sin(a); const s2 = Math.sin(b); const s3 = Math.sin(c); if (order === 'XYZ') { dest[0] = s1 * c2 * c3 + c1 * s2 * s3; dest[1] = c1 * s2 * c3 - s1 * c2 * s3; dest[2] = c1 * c2 * s3 + s1 * s2 * c3; dest[3] = c1 * c2 * c3 - s1 * s2 * s3; } else if (order === 'YXZ') { dest[0] = s1 * c2 * c3 + c1 * s2 * s3; dest[1] = c1 * s2 * c3 - s1 * c2 * s3; dest[2] = c1 * c2 * s3 - s1 * s2 * c3; dest[3] = c1 * c2 * c3 + s1 * s2 * s3; } else if (order === 'ZXY') { dest[0] = s1 * c2 * c3 - c1 * s2 * s3; dest[1] = c1 * s2 * c3 + s1 * c2 * s3; dest[2] = c1 * c2 * s3 + s1 * s2 * c3; dest[3] = c1 * c2 * c3 - s1 * s2 * s3; } else if (order === 'ZYX') { dest[0] = s1 * c2 * c3 - c1 * s2 * s3; dest[1] = c1 * s2 * c3 + s1 * c2 * s3; dest[2] = c1 * c2 * s3 - s1 * s2 * c3; dest[3] = c1 * c2 * c3 + s1 * s2 * s3; } else if (order === 'YZX') { dest[0] = s1 * c2 * c3 + c1 * s2 * s3; dest[1] = c1 * s2 * c3 + s1 * c2 * s3; dest[2] = c1 * c2 * s3 - s1 * s2 * c3; dest[3] = c1 * c2 * c3 - s1 * s2 * s3; } else if (order === 'XZY') { dest[0] = s1 * c2 * c3 - c1 * s2 * s3; dest[1] = c1 * s2 * c3 - s1 * c2 * s3; dest[2] = c1 * c2 * s3 + s1 * s2 * c3; dest[3] = c1 * c2 * c3 + s1 * s2 * s3; } return dest; }, mat4ToQuaternion(m, dest = math.vec4()) { // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm // Assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) const m11 = m[0]; const m12 = m[4]; const m13 = m[8]; const m21 = m[1]; const m22 = m[5]; const m23 = m[9]; const m31 = m[2]; const m32 = m[6]; const m33 = m[10]; let s; const trace = m11 + m22 + m33; if (trace > 0) { s = 0.5 / Math.sqrt(trace + 1.0); dest[3] = 0.25 / s; dest[0] = (m32 - m23) * s; dest[1] = (m13 - m31) * s; dest[2] = (m21 - m12) * s; } else if (m11 > m22 && m11 > m33) { s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); dest[3] = (m32 - m23) / s; dest[0] = 0.25 * s; dest[1] = (m12 + m21) / s; dest[2] = (m13 + m31) / s; } else if (m22 > m33) { s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); dest[3] = (m13 - m31) / s; dest[0] = (m12 + m21) / s; dest[1] = 0.25 * s; dest[2] = (m23 + m32) / s; } else { s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); dest[3] = (m21 - m12) / s; dest[0] = (m13 + m31) / s; dest[1] = (m23 + m32) / s; dest[2] = 0.25 * s; } return dest; }, vec3PairToQuaternion(u, v, dest = math.vec4()) { const norm_u_norm_v = Math.sqrt(math.dotVec3(u, u) * math.dotVec3(v, v)); let real_part = norm_u_norm_v + math.dotVec3(u, v); if (real_part < 0.00000001 * norm_u_norm_v) { // If u and v are exactly opposite, rotate 180 degrees // around an arbitrary orthogonal axis. Axis normalisation // can happen later, when we normalise the quaternion. real_part = 0.0; if (Math.abs(u[0]) > Math.abs(u[2])) { dest[0] = -u[1]; dest[1] = u[0]; dest[2] = 0; } else { dest[0] = 0; dest[1] = -u[2]; dest[2] = u[1]; } } else { // Otherwise, build quaternion the standard way. math.cross3Vec3(u, v, dest); } dest[3] = real_part; return math.normalizeQuaternion(dest); }, angleAxisToQuaternion(angleAxis, dest = math.vec4()) { const halfAngle = angleAxis[3] / 2.0; const fsin = Math.sin(halfAngle); dest[0] = fsin * angleAxis[0]; dest[1] = fsin * angleAxis[1]; dest[2] = fsin * angleAxis[2]; dest[3] = Math.cos(halfAngle); return dest; }, quaternionToEuler: ((() => { const mat = new FloatArrayType(16); return (q, order, dest) => { dest = dest || math.vec3(); math.quaternionToRotationMat4(q, mat); math.mat4ToEuler(mat, order, dest); return dest; }; }))(), mulQuaternions(p, q, dest = math.vec4()) { const p0 = p[0]; const p1 = p[1]; const p2 = p[2]; const p3 = p[3]; const q0 = q[0]; const q1 = q[1]; const q2 = q[2]; const q3 = q[3]; dest[0] = p3 * q0 + p0 * q3 + p1 * q2 - p2 * q1; dest[1] = p3 * q1 + p1 * q3 + p2 * q0 - p0 * q2; dest[2] = p3 * q2 + p2 * q3 + p0 * q1 - p1 * q0; dest[3] = p3 * q3 - p0 * q0 - p1 * q1 - p2 * q2; return dest; }, vec3ApplyQuaternion(q, vec, dest = math.vec3()) { const x = vec[0]; const y = vec[1]; const z = vec[2]; const qx = q[0]; const qy = q[1]; const qz = q[2]; const qw = q[3]; // calculate quat * vector const ix = qw * x + qy * z - qz * y; const iy = qw * y + qz * x - qx * z; const iz = qw * z + qx * y - qy * x; const iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat dest[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; dest[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; dest[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; return dest; }, quaternionToMat4(q, dest) { dest = math.identityMat4(dest); const q0 = q[0]; //x const q1 = q[1]; //y const q2 = q[2]; //z const q3 = q[3]; //w const tx = 2.0 * q0; const ty = 2.0 * q1; const tz = 2.0 * q2; const twx = tx * q3; const twy = ty * q3; const twz = tz * q3; const txx = tx * q0; const txy = ty * q0; const txz = tz * q0; const tyy = ty * q1; const tyz = tz * q1; const tzz = tz * q2; dest[0] = 1.0 - (tyy + tzz); dest[1] = txy + twz; dest[2] = txz - twy; dest[4] = txy - twz; dest[5] = 1.0 - (txx + tzz); dest[6] = tyz + twx; dest[8] = txz + twy; dest[9] = tyz - twx; dest[10] = 1.0 - (txx + tyy); return dest; }, quaternionToRotationMat4(q, m) { const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3]; const x2 = x + x; const y2 = y + y; const z2 = z + z; const xx = x * x2; const xy = x * y2; const xz = x * z2; const yy = y * y2; const yz = y * z2; const zz = z * z2; const wx = w * x2; const wy = w * y2; const wz = w * z2; m[0] = 1 - (yy + zz); m[4] = xy - wz; m[8] = xz + wy; m[1] = xy + wz; m[5] = 1 - (xx + zz); m[9] = yz - wx; m[2] = xz - wy; m[6] = yz + wx; m[10] = 1 - (xx + yy); // last column m[3] = 0; m[7] = 0; m[11] = 0; // bottom row m[12] = 0; m[13] = 0; m[14] = 0; m[15] = 1; return m; }, normalizeQuaternion(q, dest = q) { const len = math.lenVec4([q[0], q[1], q[2], q[3]]); dest[0] = q[0] / len; dest[1] = q[1] / len; dest[2] = q[2] / len; dest[3] = q[3] / len; return dest; }, conjugateQuaternion(q, dest = q) { dest[0] = -q[0]; dest[1] = -q[1]; dest[2] = -q[2]; dest[3] = q[3]; return dest; }, inverseQuaternion(q, dest) { return math.normalizeQuaternion(math.conjugateQuaternion(q, dest)); }, quaternionToAngleAxis(q, angleAxis = math.vec4()) { q = math.normalizeQuaternion(q, tempVec4); const q3 = q[3]; const angle = 2 * Math.acos(q3); const s = Math.sqrt(1 - q3 * q3); if (s < 0.001) { // test to avoid divide by zero, s is always positive due to sqrt angleAxis[0] = q[0]; angleAxis[1] = q[1]; angleAxis[2] = q[2]; } else { angleAxis[0] = q[0] / s; angleAxis[1] = q[1] / s; angleAxis[2] = q[2] / s; } angleAxis[3] = angle; // * 57.295779579; return angleAxis; }, //------------------------------------------------------------------------------------------------------------------ // Boundaries //------------------------------------------------------------------------------------------------------------------ /** * Returns a new, uninitialized 3D axis-aligned bounding box. * * @private */ AABB3(values) { return new FloatArrayType(values || 6); }, /** * Returns a new, uninitialized 2D axis-aligned bounding box. * * @private */ AABB2(values) { return new FloatArrayType(values || 4); }, /** * Returns a new, uninitialized 3D oriented bounding box (OBB). * * @private */ OBB3(values) { return new FloatArrayType(values || 32); }, /** * Returns a new, uninitialized 2D oriented bounding box (OBB). * * @private */ OBB2(values) { return new FloatArrayType(values || 16); }, /** Returns a new 3D bounding sphere */ Sphere3(x, y, z, r) { return new FloatArrayType([x, y, z, r]); }, /** * Transforms an OBB3 by a 4x4 matrix. * * @private */ transformOBB3(m, p, p2 = p) { let i; const len = p.length; let x; let y; let z; const m0 = m[0]; const m1 = m[1]; const m2 = m[2]; const m3 = m[3]; const m4 = m[4]; const m5 = m[5]; const m6 = m[6]; const m7 = m[7]; const m8 = m[8]; const m9 = m[9]; const m10 = m[10]; const m11 = m[11]; const m12 = m[12]; const m13 = m[13]; const m14 = m[14]; const m15 = m[15]; for (i = 0; i < len; i += 4) { x = p[i + 0]; y = p[i + 1]; z = p[i + 2]; p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12; p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13; p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14; p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15; } return p2; }, /** Returns true if the first AABB contains the second AABB. * @param aabb1 * @param aabb2 * @returns {boolean} */ containsAABB3: function (aabb1, aabb2) { const result = ( aabb1[0] <= aabb2[0] && aabb2[3] <= aabb1[3] && aabb1[1] <= aabb2[1] && aabb2[4] <= aabb1[4] && aabb1[2] <= aabb2[2] && aabb2[5] <= aabb1[5]); return result; }, /** * Gets the diagonal size of an AABB3 given as minima and maxima. * * @private */ getAABB3Diag: ((() => { const min = new FloatArrayType(3); const max = new FloatArrayType(3); const tempVec3 = new FloatArrayType(3); return aabb => { min[0] = aabb[0]; min[1] = aabb[1]; min[2] = aabb[2]; max[0] = aabb[3]; max[1] = aabb[4]; max[2] = aabb[5]; math.subVec3(max, min, tempVec3); return Math.abs(math.lenVec3(tempVec3)); }; }))(), /** * Get a diagonal boundary size that is symmetrical about the given point. * * @private */ getAABB3DiagPoint: ((() => { const min = new FloatArrayType(3); const max = new FloatArrayType(3); const tempVec3 = new FloatArrayType(3); return (aabb, p) => { min[0] = aabb[0]; min[1] = aabb[1]; min[2] = aabb[2]; max[0] = aabb[3]; max[1] = aabb[4]; max[2] = aabb[5]; const diagVec = math.subVec3(max, min, tempVec3); const xneg = p[0] - aabb[0]; const xpos = aabb[3] - p[0]; const yneg = p[1] - aabb[1]; const ypos = aabb[4] - p[1]; const zneg = p[2] - aabb[2]; const zpos = aabb[5] - p[2]; diagVec[0] += (xneg > xpos) ? xneg : xpos; diagVec[1] += (yneg > ypos) ? yneg : ypos; diagVec[2] += (zneg > zpos) ? zneg : zpos; return Math.abs(math.lenVec3(diagVec)); }; }))(), /** * Gets the center of an AABB. * * @private */ getAABB3Center(aabb, dest) { const r = dest || math.vec3(); r[0] = (aabb[0] + aabb[3]) / 2; r[1] = (aabb[1] + aabb[4]) / 2; r[2] = (aabb[2] + aabb[5]) / 2; return r; }, /** * Gets the center of a 2D AABB. * * @private */ getAABB2Center(aabb, dest) { const r = dest || math.vec2(); r[0] = (aabb[2] + aabb[0]) / 2; r[1] = (aabb[3] + aabb[1]) / 2; return r; }, /** * Collapses a 3D axis-aligned boundary, ready to expand to fit 3D points. * Creates new AABB if none supplied. * * @private */ collapseAABB3(aabb = math.AABB3()) { aabb[0] = math.MAX_DOUBLE; aabb[1] = math.MAX_DOUBLE; aabb[2] = math.MAX_DOUBLE; aabb[3] = -math.MAX_DOUBLE; aabb[4] = -math.MAX_DOUBLE; aabb[5] = -math.MAX_DOUBLE; return aabb; }, /** * Converts an axis-aligned 3D boundary into an oriented boundary consisting of * an array of eight 3D positions, one for each corner of the boundary. * * @private */ AABB3ToOBB3(aabb, obb = math.OBB3()) { obb[0] = aabb[0]; obb[1] = aabb[1]; obb[2] = aabb[2]; obb[3] = 1; obb[4] = aabb[3]; obb[5] = aabb[1]; obb[6] = aabb[2]; obb[7] = 1; obb[8] = aabb[3]; obb[9] = aabb[4]; obb[10] = aabb[2]; obb[11] = 1; obb[12] = aabb[0]; obb[13] = aabb[4]; obb[14] = aabb[2]; obb[15] = 1; obb[16] = aabb[0]; obb[17] = aabb[1]; obb[18] = aabb[5]; obb[19] = 1; obb[20] = aabb[3]; obb[21] = aabb[1]; obb[22] = aabb[5]; obb[23] = 1; obb[24] = aabb[3]; obb[25] = aabb[4]; obb[26] = aabb[5]; obb[27] = 1; obb[28] = aabb[0]; obb[29] = aabb[4]; obb[30] = aabb[5]; obb[31] = 1; return obb; }, /** * Finds the minimum axis-aligned 3D boundary enclosing the homogeneous 3D points (x,y,z,w) given in a flattened array. * * @private */ positions3ToAABB3: ((() => { const p = new FloatArrayType(3); return (positions, aabb, positionsDecodeMatrix) => { aabb = aabb || math.AABB3(); let xmin = math.MAX_DOUBLE; let ymin = math.MAX_DOUBLE; let zmin = math.MAX_DOUBLE; let xmax = -math.MAX_DOUBLE; let ymax = -math.MAX_DOUBLE; let zmax = -math.MAX_DOUBLE; let x; let y; let z; for (let i = 0, len = positions.length; i < len; i += 3) { if (positionsDecodeMatrix) { p[0] = positions[i + 0]; p[1] = positions[i + 1]; p[2] = positions[i + 2]; math.decompressPosition(p, positionsDecodeMatrix, p); x = p[0]; y = p[1]; z = p[2]; } else { x = positions[i + 0]; y = positions[i + 1]; z = positions[i + 2]; } if (x < xmin) { xmin = x; } if (y < ymin) { ymin = y; } if (z < zmin) { zmin = z; } if (x > xmax) { xmax = x; } if (y > ymax) { ymax = y; } if (z > zmax) { zmax = z; } } aabb[0] = xmin; aabb[1] = ymin; aabb[2] = zmin; aabb[3] = xmax; aabb[4] = ymax; aabb[5] = zmax; return aabb; }; }))(), /** * Finds the minimum axis-aligned 3D boundary enclosing the homogeneous 3D points (x,y,z,w) given in a flattened array. * * @private */ OBB3ToAABB3(obb, aabb = math.AABB3()) { let xmin = math.MAX_DOUBLE; let ymin = math.MAX_DOUBLE; let zmin = math.MAX_DOUBLE; let xmax = -math.MAX_DOUBLE; let ymax = -math.MAX_DOUBLE; let zmax = -math.MAX_DOUBLE; let x; let y; let z; for (let i = 0, len = obb.length; i < len; i += 4) { x = obb[i + 0]; y = obb[i + 1]; z = obb[i + 2]; if (x < xmin) { xmin = x; } if (y < ymin) { ymin = y; } if (z < zmin) { zmin = z; } if (x > xmax) { xmax = x; } if (y > ymax) { ymax = y; } if (z > zmax) { zmax = z; } } aabb[0] = xmin; aabb[1] = ymin; aabb[2] = zmin; aabb[3] = xmax; aabb[4] = ymax; aabb[5] = zmax; return aabb; }, /** * Finds the minimum axis-aligned 3D boundary enclosing the given 3D points. * * @private */ points3ToAABB3(points, aabb = math.AABB3()) { let xmin = math.MAX_DOUBLE; let ymin = math.MAX_DOUBLE; let zmin = math.MAX_DOUBLE; let xmax = -math.MAX_DOUBLE; let ymax = -math.MAX_DOUBLE; let zmax = -math.MAX_DOUBLE; let x; let y; let z; for (let i = 0, len = points.length; i < len; i++) { x = points[i][0]; y = points[i][1]; z = points[i][2]; if (x < xmin) { xmin = x; } if (y < ymin) { ymin = y; } if (z < zmin) { zmin = z; } if (x > xmax) { xmax = x; } if (y > ymax) { ymax = y; } if (z > zmax) { zmax = z; } } aabb[0] = xmin; aabb[1] = ymin; aabb[2] = zmin; aabb[3] = xmax; aabb[4] = ymax; aabb[5] = zmax; return aabb; }, /** * Finds the minimum boundary sphere enclosing the given 3D points. * * @private */ points3ToSphere3: ((() => { const tempVec3 = new FloatArrayType(3); return (points, sphere) => { sphere = sphere || math.vec4(); let x = 0; let y = 0; let z = 0; let i; const numPoints = points.length; for (i = 0; i < numPoints; i++) { x += points[i][0]; y += points[i][1]; z += points[i][2]; } sphere[0] = x / numPoints; sphere[1] = y / numPoints; sphere[2] = z / numPoints; let radius = 0; let dist; for (i = 0; i < numPoints; i++) { dist = Math.abs(math.lenVec3(math.subVec3(points[i], sphere, tempVec3))); if (dist > radius) { radius = dist; } } sphere[3] = radius; return sphere; }; }))(), /** * Finds the minimum boundary sphere enclosing the given 3D positions. * * @private */ positions3ToSphere3: ((() => { const tempVec3a = new FloatArrayType(3); const tempVec3b = new FloatArrayType(3); return (positions, sphere) => { sphere = sphere || math.vec4(); let x = 0; let y = 0; let z = 0; let i; const lenPositions = positions.length; let radius = 0; for (i = 0; i < lenPositions; i += 3) { x += positions[i]; y += positions[i + 1]; z += positions[i + 2]; } const numPositions = lenPositions / 3; sphere[0] = x / numPositions; sphere[1] = y / numPositions; sphere[2] = z / numPositions; let dist; for (i = 0; i < lenPositions; i += 3) { tempVec3a[0] = positions[i]; tempVec3a[1] = positions[i + 1]; tempVec3a[2] = positions[i + 2]; dist = Math.abs(math.lenVec3(math.subVec3(tempVec3a, sphere, tempVec3b))); if (dist > radius) { radius = dist; } } sphere[3] = radius; return sphere; }; }))(), /** * Finds the minimum boundary sphere enclosing the given 3D points. * * @private */ OBB3ToSphere3: ((() => { const point = new FloatArrayType(3); const tempVec3 = new FloatArrayType(3); return (points, sphere) => { sphere = sphere || math.vec4(); let x = 0; let y = 0; let z = 0; let i; const lenPoints = points.length; const numPoints = lenPoints / 4; for (i = 0; i < lenPoints; i += 4) { x += points[i + 0]; y += points[i + 1]; z += points[i + 2]; } sphere[0] = x / numPoints; sphere[1] = y / numPoints; sphere[2] = z / numPoints; let radius = 0; let dist; for (i = 0; i < lenPoints; i += 4) { point[0] = points[i + 0]; point[1] = points[i + 1]; point[2] = points[i + 2]; dist = Math.abs(math.lenVec3(math.subVec3(point, sphere, tempVec3))); if (dist > radius) { radius = dist; } } sphere[3] = radius; return sphere; }; }))(), /** * Gets the center of a bounding sphere. * * @private */ getSphere3Center(sphere, dest = math.vec3()) { dest[0] = sphere[0]; dest[1] = sphere[1]; dest[2] = sphere[2]; return dest; }, /** * Expands the first axis-aligned 3D boundary to enclose the second, if required. * * @private */ expandAABB3(aabb1, aabb2) { if (aabb1[0] > aabb2[0]) { aabb1[0] = aabb2[0]; } if (aabb1[1] > aabb2[1]) { aabb1[1] = aabb2[1]; } if (aabb1[2] > aabb2[2]) { aabb1[2] = aabb2[2]; } if (aabb1[3] < aabb2[3]) { aabb1[3] = aabb2[3]; } if (aabb1[4] < aabb2[4]) { aabb1[4] = aabb2[4]; } if (aabb1[5] < aabb2[5]) { aabb1[5] = aabb2[5]; } return aabb1; }, /** * Expands an axis-aligned 3D boundary to enclose the given point, if needed. * * @private */ expandAABB3Point3(aabb, p) { if (aabb[0] > p[0]) { aabb[0] = p[0]; } if (aabb[1] > p[1]) { aabb[1] = p[1]; } if (aabb[2] > p[2]) { aabb[2] = p[2]; } if (aabb[3] < p[0]) { aabb[3] = p[0]; } if (aabb[4] < p[1]) { aabb[4] = p[1]; } if (aabb[5] < p[2]) { aabb[5] = p[2]; } return aabb; }, /** * Calculates the normal vector of a triangle. * * @private */ triangleNormal(a, b, c, normal = math.vec3()) { const p1x = b[0] - a[0]; const p1y = b[1] - a[1]; const p1z = b[2] - a[2]; const p2x = c[0] - a[0]; const p2y = c[1] - a[1]; const p2z = c[2] - a[2]; const p3x = p1y * p2z - p1z * p2y; const p3y = p1z * p2x - p1x * p2z; const p3z = p1x * p2y - p1y * p2x; const mag = Math.sqrt(p3x * p3x + p3y * p3y + p3z * p3z); if (mag === 0) { normal[0] = 0; normal[1] = 0; normal[2] = 0; } else { normal[0] = p3x / mag; normal[1] = p3y / mag; normal[2] = p3z / mag; } return normal } }; const tempVec2a = math.vec2(); const tempVec3a = math.vec3(); const tempVec3b = math.vec3(); const tempVec3c = math.vec3(); /** * @desc Parses a CityJSON model into an {@link XKTModel}. * * [CityJSON](https://www.cityjson.org) is a JSON-based encoding for a subset of the CityGML data model (version 2.0.0), * which is an open standardised data model and exchange format to store digital 3D models of cities and * landscapes. CityGML is an official standard of the [Open Geospatial Consortium](https://www.ogc.org/). * * This converter function supports most of the [CityJSON 1.0.2 Specification](https://www.cityjson.org/specs/1.0.2), * with the following limitations: * * * Does not (yet) support CityJSON semantics for geometry primitives. * * Does not (yet) support textured geometries. * * Does not (yet) support geometry templates. * * When the CityJSON file provides multiple *themes* for a geometry, then we parse only the first of the provided themes for that geometry. * * ## Usage * * In the example below we'll create an {@link XKTModel}, then load a CityJSON model into it. * * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#parsers_CityJSON_DenHaag)] * * ````javascript * utils.loadJSON("./models/cityjson/DenHaag.json", async (data) => { * * const xktModel = new XKTModel(); * * parseCityJSONIntoXKTModel({ * data, * xktModel, * log: (msg) => { console.log(msg); } * }).then(()=>{ * xktModel.finalize(); * }, * (msg) => { * console.error(msg); * }); * }); * ```` * * @param {Object} params Parsing params. * @param {Object} params.data CityJSON data. * @param {XKTModel} params.xktModel XKTModel to parse into. * @param {Boolean} [params.rotateX=true] Whether to rotate the model 90 degrees about the X axis to make the Y * axis "up", if neccessary. * @param {Object} [params.stats] Collects statistics. * @param {function} [params.log] Logging callback. * @returns {Promise} */ function parseCityJSONIntoXKTModel({data, xktModel, rotateX = true, stats = {}, log}) { return new Promise(function (resolve, reject) { if (!data) { reject("Argument expected: data"); return; } if (data.type !== "CityJSON") { reject("Invalid argument: data is not a CityJSON file"); return; } if (!xktModel) { reject("Argument expected: xktModel"); return; } const vertices = data.transform // Avoid side effects - don't modify the CityJSON data ? transformVertices(data.vertices, data.transform, rotateX) : data.vertices; stats.sourceFormat = data.type || ""; stats.schemaVersion = data.version || ""; stats.title = ""; stats.author = ""; stats.created = ""; stats.numMetaObjects = 0; stats.numPropertySets = 0; stats.numTriangles = 0; stats.numVertices = 0; stats.numObjects = 0; stats.numGeometries = 0; const rootMetaObjectId = math.createUUID(); xktModel.createMetaObject({ metaObjectId: rootMetaObjectId, metaObjectType: "Model", metaObjectName: "Model" }); stats.numMetaObjects++; const modelMetaObjectId = math.createUUID(); xktModel.createMetaObject({ metaObjectId: modelMetaObjectId, metaObjectType: "CityJSON", metaObjectName: "CityJSON", parentMetaObjectId: rootMetaObjectId }); stats.numMetaObjects++; const ctx = { data, vertices, xktModel, rootMetaObjectId: modelMetaObjectId, log: (log || function (msg) { }), nextId: 0, stats }; ctx.xktModel.schema = data.type + " " + data.version; ctx.log("Converting " + ctx.xktModel.schema); if (rotateX) { ctx.log("Rotating model about X-axis"); } parseCityJSON(ctx); resolve(); }); } function transformVertices(vertices, transform, rotateX) { const transformedVertices = []; const scale = transform.scale || math.vec3([1, 1, 1]); const translate = transform.translate || math.vec3([0, 0, 0]); for (let i = 0, j = 0; i < vertices.length; i++, j += 3) { const x = (vertices[i][0] * scale[0]) + translate[0]; const y = (vertices[i][1] * scale[1]) + translate[1]; const z = (vertices[i][2] * scale[2]) + translate[2]; if (rotateX) { transformedVertices.push([x, z, y]); } else { transformedVertices.push([x, y, z]); } } return transformedVertices; } function parseCityJSON(ctx) { const data = ctx.data; const cityObjects = data.CityObjects; for (const objectId in cityObjects) { if (cityObjects.hasOwnProperty(objectId)) { const cityObject = cityObjects[objectId]; parseCityObject(ctx, cityObject, objectId); } } } function parseCityObject(ctx, cityObject, objectId) { const xktModel = ctx.xktModel; const data = ctx.data; const metaObjectId = objectId; const metaObjectType = cityObject.type; const metaObjectName = metaObjectType + " : " + objectId; const parentMetaObjectId = cityObject.parents ? cityObject.parents[0] : ctx.rootMetaObjectId; xktModel.createMetaObject({ metaObjectId, metaObjectName, metaObjectType, parentMetaObjectId }); ctx.stats.numMetaObjects++; if (!(cityObject.geometry && cityObject.geometry.length > 0)) { return; } const meshIds = []; for (let i = 0, len = cityObject.geometry.length; i < len; i++) { const geometry = cityObject.geometry[i]; let objectMaterial; let surfaceMaterials; const appearance = data.appearance; if (appearance) { const materials = appearance.materials; if (materials) { const geometryMaterial = geometry.material; if (geometryMaterial) { const themeIds = Object.keys(geometryMaterial); if (themeIds.length > 0) { const themeId = themeIds[0]; const theme = geometryMaterial[themeId]; if (theme.value !== undefined) { objectMaterial = materials[theme.value]; } else { const values = theme.values; if (values) { surfaceMaterials = []; for (let j = 0, lenj = values.length; j < lenj; j++) { const value = values[i]; const surfaceMaterial = materials[value]; surfaceMaterials.push(surfaceMaterial); } } } } } } } if (surfaceMaterials) { parseGeometrySurfacesWithOwnMaterials(ctx, geometry, surfaceMaterials, meshIds); } else { parseGeometrySurfacesWithSharedMaterial(ctx, geometry, objectMaterial, meshIds); } } if (meshIds.length > 0) { xktModel.createEntity({ entityId: objectId, meshIds: meshIds }); ctx.stats.numObjects++; } } function parseGeometrySurfacesWithOwnMaterials(ctx, geometry, surfaceMaterials, meshIds) { const geomType = geometry.type; switch (geomType) { case "MultiPoint": break; case "MultiLineString": break; case "MultiSurface": case "CompositeSurface": const surfaces = geometry.boundaries; parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds); break; case "Solid": const shells = geometry.boundaries; for (let j = 0; j < shells.length; j++) { const surfaces = shells[j]; parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds); } break; case "MultiSolid": case "CompositeSolid": const solids = geometry.boundaries; for (let j = 0; j < solids.length; j++) { for (let k = 0; k < solids[j].length; k++) { const surfaces = solids[j][k]; parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds); } } break; } } function parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds) { const vertices = ctx.vertices; const xktModel = ctx.xktModel; for (let i = 0; i < surfaces.length; i++) { const surface = surfaces[i]; const surfaceMaterial = surfaceMaterials[i] || {diffuseColor: [0.8, 0.8, 0.8], transparency: 1.0}; const face = []; const holes = []; const sharedIndices = []; const geometryCfg = { positions: [], indices: [] }; for (let j = 0; j < surface.length; j++) { if (face.length > 0) { holes.push(face.length); } const newFace = extractLocalIndices(ctx, surface[j], sharedIndices, geometryCfg); face.push(...newFace); } if (face.length === 3) { // Triangle geometryCfg.indices.push(face[0]); geometryCfg.indices.push(face[1]); geometryCfg.indices.push(face[2]); } else if (face.length > 3) { // Polygon // Prepare to triangulate const pList = []; for (let k = 0; k < face.length; k++) { pList.push({ x: vertices[sharedIndices[face[k]]][0], y: vertices[sharedIndices[face[k]]][1], z: vertices[sharedIndices[face[k]]][2] }); } const normal = getNormalOfPositions(pList, math.vec3()); // Convert to 2D let pv = []; for (let k = 0; k < pList.length; k++) { to2D(pList[k], normal, tempVec2a); pv.unshift(tempVec2a[0]); pv.unshift(tempVec2a[1]); } // Triangulate const tr = earcut(pv, holes, 2); // Create triangles for (let k = 0; k < tr.length; k += 3) { geometryCfg.indices.unshift(face[tr[k]]); geometryCfg.indices.unshift(face[tr[k + 1]]); geometryCfg.indices.unshift(face[tr[k + 2]]); } } const geometryId = "" + ctx.nextId++; const meshId = "" + ctx.nextId++; xktModel.createGeometry({ geometryId: geometryId, primitiveType: "triangles", positions: geometryCfg.positions, indices: geometryCfg.indices }); xktModel.createMesh({ meshId: meshId, geometryId: geometryId, color: (surfaceMaterial && surfaceMaterial.diffuseColor) ? surfaceMaterial.diffuseColor : [0.8, 0.8, 0.8], opacity: 1.0 //opacity: (surfaceMaterial && surfaceMaterial.transparency !== undefined) ? (1.0 - surfaceMaterial.transparency) : 1.0 }); meshIds.push(meshId); ctx.stats.numGeometries++; ctx.stats.numVertices += geometryCfg.positions.length / 3; ctx.stats.numTriangles += geometryCfg.indices.length / 3; } } function parseGeometrySurfacesWithSharedMaterial(ctx, geometry, objectMaterial, meshIds) { const xktModel = ctx.xktModel; const sharedIndices = []; const geometryCfg = { positions: [], indices: [] }; const geomType = geometry.type; switch (geomType) { case "MultiPoint": break; case "MultiLineString": break; case "MultiSurface": case "CompositeSurface": const surfaces = geometry.boundaries; parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg); break; case "Solid": const shells = geometry.boundaries; for (let j = 0; j < shells.length; j++) { const surfaces = shells[j]; parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg); } break; case "MultiSolid": case "CompositeSolid": const solids = geometry.boundaries; for (let j = 0; j < solids.length; j++) { for (let k = 0; k < solids[j].length; k++) { const surfaces = solids[j][k]; parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg); } } break; } const geometryId = "" + ctx.nextId++; const meshId = "" + ctx.nextId++; xktModel.createGeometry({ geometryId: geometryId, primitiveType: "triangles", positions: geometryCfg.positions, indices: geometryCfg.indices }); xktModel.createMesh({ meshId: meshId, geometryId: geometryId, color: (objectMaterial && objectMaterial.diffuseColor) ? objectMaterial.diffuseColor : [0.8, 0.8, 0.8], opacity: 1.0 //opacity: (objectMaterial && objectMaterial.transparency !== undefined) ? (1.0 - objectMaterial.transparency) : 1.0 }); meshIds.push(meshId); ctx.stats.numGeometries++; ctx.stats.numVertices += geometryCfg.positions.length / 3; ctx.stats.numTriangles += geometryCfg.indices.length / 3; } function parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, primitiveCfg) { const vertices = ctx.vertices; for (let i = 0; i < surfaces.length; i++) { let boundary = []; let holes = []; for (let j = 0; j < surfaces[i].length; j++) { if (boundary.length > 0) { holes.push(boundary.length); } const newBoundary = extractLocalIndices(ctx, surfaces[i][j], sharedIndices, primitiveCfg); boundary.push(...newBoundary); } if (boundary.length === 3) { // Triangle primitiveCfg.indices.push(boundary[0]); primitiveCfg.indices.push(boundary[1]); primitiveCfg.indices.push(boundary[2]); } else if (boundary.length > 3) { // Polygon let pList = []; for (let k = 0; k < boundary.length; k++) { pList.push({ x: vertices[sharedIndices[boundary[k]]][0], y: vertices[sharedIndices[boundary[k]]][1], z: vertices[sharedIndices[boundary[k]]][2] }); } const normal = getNormalOfPositions(pList, math.vec3()); let pv = []; for (let k = 0; k < pList.length; k++) { to2D(pList[k], normal, tempVec2a); pv.unshift(tempVec2a[0]); pv.unshift(tempVec2a[1]); } const tr = earcut(pv, holes, 2); for (let k = 0; k < tr.length; k += 3) { primitiveCfg.indices.unshift(boundary[tr[k]]); primitiveCfg.indices.unshift(boundary[tr[k + 1]]); primitiveCfg.indices.unshift(boundary[tr[k + 2]]); } } } } function extractLocalIndices(ctx, boundary, sharedIndices, geometryCfg) { const vertices = ctx.vertices; const newBoundary = []; for (let i = 0, len = boundary.length; i < len; i++) { const index = boundary[i]; if (sharedIndices.includes(index)) { const vertexIndex = sharedIndices.indexOf(index); newBoundary.push(vertexIndex); } else { geometryCfg.positions.push(vertices[index][0]); geometryCfg.positions.push(vertices[index][1]); geometryCfg.positions.push(vertices[index][2]); newBoundary.push(sharedIndices.length); sharedIndices.push(index); } } return newBoundary } function getNormalOfPositions(positions, normal) { for (let i = 0; i < positions.length; i++) { let nexti = i + 1; if (nexti === positions.length) { nexti = 0; } normal[0] += ((positions[i].y - positions[nexti].y) * (positions[i].z + positions[nexti].z)); normal[1] += ((positions[i].z - positions[nexti].z) * (positions[i].x + positions[nexti].x)); normal[2] += ((positions[i].x - positions[nexti].x) * (positions[i].y + positions[nexti].y)); } return math.normalizeVec3(normal); } function to2D(_p, _n, re) { const p = tempVec3a; const n = tempVec3b; const x3 = tempVec3c; p[0] = _p.x; p[1] = _p.y; p[2] = _p.z; n[0] = _n.x; n[1] = _n.y; n[2] = _n.z; x3[0] = 1.1; x3[1] = 1.1; x3[2] = 1.1; const dist = math.lenVec3(math.subVec3(x3, n)); if (dist < 0.01) { x3[0] += 1.0; x3[1] += 2.0; x3[2] += 3.0; } const dot = math.dotVec3(x3, n); const tmp2 = math.mulVec3Scalar(n, dot, math.vec3()); x3[0] -= tmp2[0]; x3[1] -= tmp2[1]; x3[2] -= tmp2[2]; math.normalizeVec3(x3); const y3 = math.cross3Vec3(n, x3, math.vec3()); const x = math.dotVec3(p, x3); const y = math.dotVec3(p, y3); re[0] = x; re[1] = y; } function isString(value) { return (typeof value === 'string' || value instanceof String); } /** * @private */ const utils = { isString: isString, }; const atob2 = (typeof atob !== 'undefined') ? atob : a => Buffer.from(a, 'base64').toString('binary'); const WEBGL_COMPONENT_TYPES = { 5120: Int8Array, 5121: Uint8Array, 5122: Int16Array, 5123: Uint16Array, 5125: Uint32Array, 5126: Float32Array }; const WEBGL_TYPE_SIZES = { 'SCALAR': 1, 'VEC2': 2, 'VEC3': 3, 'VEC4': 4, 'MAT2': 4, 'MAT3': 9, 'MAT4': 16 }; /** * @desc Parses glTF JSON into an {@link XKTModel}. * * * Supports glTF 2. * * Provides option to reduce XKT file size by ignoring STL normals and relying on xeokit to auto-generate them. * * ## Usage * * In the example below we'll create an {@link XKTModel}, then load a glTF model into it. * * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#parsers_glTF_Duplex)] * * ````javascript * utils.loadJSON("./models/gltf/duplex/scene.gltf", async (data) => { * * const xktModel = new XKTModel(); * * parseGLTFIntoXKTModel({ * data, * xktModel, * log: (msg) => { console.log(msg); } * }).then(()=>{ * xktModel.finalize(); * }, * (msg) => { * console.error(msg); * }); * }); * ```` * * @param {Object} params Parsing parameters. * @param {Object} params.data The glTF JSON. * @param {XKTModel} params.xktModel XKTModel to parse into. * @param {Boolean} [params.autoNormals=false] When true, the parser will ignore the glTF geometry normals, and the glTF * data will rely on the xeokit ````Viewer```` to automatically generate them. This has the limitation that the * normals will be face-aligned, and therefore the ````Viewer```` will only be able to render a flat-shaded representation * of the glTF. * @param {function} [params.getAttachment] Callback through which to fetch attachments, if the glTF has them. * @param {Object} [params.stats] Collects statistics. * @param {function} [params.log] Logging callback. * @returns {Promise} */ function parseGLTFIntoXKTModel({data, xktModel, autoNormals, getAttachment, stats={}, log}) { return new Promise(function (resolve, reject) { if (!data) { reject("Argument expected: data"); return; } if (!xktModel) { reject("Argument expected: xktModel"); return; } stats.sourceFormat = "glTF"; stats.schemaVersion = "2.0"; stats.title = ""; stats.author = ""; stats.created = ""; stats.numTriangles = 0; stats.numVertices = 0; stats.numObjects = 0; stats.numGeometries = 0; const ctx = { gltf: data, getAttachment: getAttachment || (() => { throw new Error('You must define getAttachment() method to convert glTF with external resources') }), log: (log || function (msg) { }), xktModel: xktModel, autoNormals: autoNormals, geometryCreated: {}, nextGeometryId: 0, nextMeshId: 0, nextDefaultEntityId: 0, stats }; parseBuffers(ctx).then(() => { parseBufferViews(ctx); freeBuffers(ctx); parseMaterials(ctx); parseDefaultScene(ctx); resolve(); }, (errMsg) => { reject(errMsg); }); }); } function parseBuffers(ctx) { // Parses geometry buffers into temporary "_buffer" Unit8Array properties on the glTF "buffer" elements const buffers = ctx.gltf.buffers; if (buffers) { return Promise.all(buffers.map(buffer => parseBuffer(ctx, buffer))); } else { return new Promise(function (resolve, reject) { resolve(); }); } } function parseBuffer(ctx, bufferInfo) { return new Promise(function (resolve, reject) { const uri = bufferInfo.uri; if (!uri) { reject('gltf/handleBuffer missing uri in ' + JSON.stringify(bufferInfo)); return; } parseArrayBuffer(ctx, uri).then((arrayBuffer) => { bufferInfo._buffer = arrayBuffer; resolve(arrayBuffer); }, (errMsg) => { reject(errMsg); }); }); } function parseArrayBuffer(ctx, uri) { return new Promise(function (resolve, reject) { const dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/; // Check for data: URI const dataUriRegexResult = uri.match(dataUriRegex); if (dataUriRegexResult) { // Safari can't handle data URIs through XMLHttpRequest const isBase64 = !!dataUriRegexResult[2]; let data = dataUriRegexResult[3]; data = decodeURIComponent(data); if (isBase64) { data = atob2(data); } const buffer = new ArrayBuffer(data.length); const view = new Uint8Array(buffer); for (let i = 0; i < data.length; i++) { view[i] = data.charCodeAt(i); } resolve(buffer); } else { // Uri is a path to a file ctx.getAttachment(uri).then( (arrayBuffer) => { resolve(arrayBuffer); }, (errMsg) => { reject(errMsg); }); } }); } function parseBufferViews(ctx) { // Parses our temporary "_buffer" properties into "_buffer" properties on glTF "bufferView" elements const bufferViewsInfo = ctx.gltf.bufferViews; if (bufferViewsInfo) { for (let i = 0, len = bufferViewsInfo.length; i < len; i++) { parseBufferView(ctx, bufferViewsInfo[i]); } } } function parseBufferView(ctx, bufferViewInfo) { const buffer = ctx.gltf.buffers[bufferViewInfo.buffer]; bufferViewInfo._typedArray = null; const byteLength = bufferViewInfo.byteLength || 0; const byteOffset = bufferViewInfo.byteOffset || 0; bufferViewInfo._buffer = buffer._buffer.slice(byteOffset, byteOffset + byteLength); } function freeBuffers(ctx) { // Deletes the "_buffer" properties from the glTF "buffer" elements, to save memory const buffers = ctx.gltf.buffers; if (buffers) { for (let i = 0, len = buffers.length; i < len; i++) { buffers[i]._buffer = null; } } } function parseMaterials(ctx) { const materialsInfo = ctx.gltf.materials; if (materialsInfo) { for (let i = 0, len = materialsInfo.length; i < len; i++) { const materialInfo = materialsInfo[i]; const material = parseMaterial(ctx, materialInfo); materialInfo._materialData = material; } } } function parseMaterial(ctx, materialInfo) { // Attempts to extract an RGBA color for a glTF material const material = { color: new Float32Array([1, 1, 1]), opacity: 1.0, metallic: 0, roughness: 1 }; const extensions = materialInfo.extensions; if (extensions) { const specularPBR = extensions["KHR_materials_pbrSpecularGlossiness"]; if (specularPBR) { const diffuseFactor = specularPBR.diffuseFactor; if (diffuseFactor !== null && diffuseFactor !== undefined) { material.color[0] = diffuseFactor[0]; material.color[1] = diffuseFactor[1]; material.color[2] = diffuseFactor[2]; } } const common = extensions["KHR_materials_common"]; if (common) { const technique = common.technique; const values = common.values || {}; const blinn = technique === "BLINN"; const phong = technique === "PHONG"; const lambert = technique === "LAMBERT"; const diffuse = values.diffuse; if (diffuse && (blinn || phong || lambert)) { if (!utils.isString(diffuse)) { material.color[0] = diffuse[0]; material.color[1] = diffuse[1]; material.color[2] = diffuse[2]; } } const transparency = values.transparency; if (transparency !== null && transparency !== undefined) { material.opacity = transparency; } const transparent = values.transparent; if (transparent !== null && transparent !== undefined) { material.opacity = transparent; } } } const metallicPBR = materialInfo.pbrMetallicRoughness; if (metallicPBR) { const baseColorFactor = metallicPBR.baseColorFactor; if (baseColorFactor) { material.color[0] = baseColorFactor[0]; material.color[1] = baseColorFactor[1]; material.color[2] = baseColorFactor[2]; material.opacity = baseColorFactor[3]; } const metallicFactor = metallicPBR.metallicFactor; if (metallicFactor !== null && metallicFactor !== undefined) { material.metallic = metallicFactor; } const roughnessFactor = metallicPBR.roughnessFactor; if (roughnessFactor !== null && roughnessFactor !== undefined) { material.roughness = roughnessFactor; } } return material; } function parseDefaultScene(ctx) { const scene = ctx.gltf.scene || 0; const defaultSceneInfo = ctx.gltf.scenes[scene]; if (!defaultSceneInfo) { throw new Error("glTF has no default scene"); } parseScene(ctx, defaultSceneInfo); } function parseScene(ctx, sceneInfo) { const nodes = sceneInfo.nodes; if (!nodes) { return; } for (let i = 0, len = nodes.length; i < len; i++) { const glTFNode = ctx.gltf.nodes[nodes[i]]; if (glTFNode) { parseNode(ctx, glTFNode, null); } } } function parseNode(ctx, glTFNode, matrix) { const gltf = ctx.gltf; const xktModel = ctx.xktModel; let localMatrix; if (glTFNode.matrix) { localMatrix = glTFNode.matrix; if (matrix) { matrix = math.mulMat4(matrix, localMatrix, math.mat4()); } else { matrix = localMatrix; } } if (glTFNode.translation) { localMatrix = math.translationMat4v(glTFNode.translation); if (matrix) { matrix = math.mulMat4(matrix, localMatrix, localMatrix); } else { matrix = localMatrix; } } if (glTFNode.rotation) { localMatrix = math.quaternionToMat4(glTFNode.rotation); if (matrix) { matrix = math.mulMat4(matrix, localMatrix, localMatrix); } else { matrix = localMatrix; } } if (glTFNode.scale) { localMatrix = math.scalingMat4v(glTFNode.scale); if (matrix) { matrix = math.mulMat4(matrix, localMatrix, localMatrix); } else { matrix = localMatrix; } } const gltfMeshId = glTFNode.mesh; if (gltfMeshId !== undefined) { const meshInfo = gltf.meshes[gltfMeshId]; if (meshInfo) { const numPrimitivesInMesh = meshInfo.primitives.length; if (numPrimitivesInMesh > 0) { const xktMeshIds = []; for (let i = 0; i < numPrimitivesInMesh; i++) { const primitiveInfo = meshInfo.primitives[i]; const materialIndex = primitiveInfo.material; const materialInfo = (materialIndex !== null && materialIndex !== undefined) ? gltf.materials[materialIndex] : null; const color = materialInfo ? materialInfo._materialData.color : new Float32Array([1.0, 1.0, 1.0, 1.0]); const opacity = materialInfo ? materialInfo._materialData.opacity : 1.0; const metallic = materialInfo ? materialInfo._materialData.metallic : 0.0; const roughness = materialInfo ? materialInfo._materialData.roughness : 1.0; const xktGeometryId = createPrimitiveGeometryHash(primitiveInfo); if (!ctx.geometryCreated[xktGeometryId]) { const geometryArrays = {}; parsePrimitiveGeometry(ctx, primitiveInfo, geometryArrays); const colors = geometryArrays.colors; let colorsCompressed; if (geometryArrays.colors) { colorsCompressed = []; for (let j = 0, lenj = colors.length; j < lenj; j += 4) { colorsCompressed.push(colors[j + 0]); colorsCompressed.push(colors[j + 1]); colorsCompressed.push(colors[j + 2]); colorsCompressed.push(255); } } xktModel.createGeometry({ geometryId: xktGeometryId, primitiveType: geometryArrays.primitive, positions: geometryArrays.positions, normals: ctx.autoNormals ? null : geometryArrays.normals, colorsCompressed: colorsCompressed, indices: geometryArrays.indices }); ctx.stats.numGeometries++; ctx.stats.numVertices += geometryArrays.positions ? geometryArrays.positions.length / 3 : 0; ctx.stats.numTriangles += geometryArrays.indices ? geometryArrays.indices.length / 3 : 0; ctx.geometryCreated[xktGeometryId] = true; } const xktMeshId = ctx.nextMeshId++; xktModel.createMesh({ meshId: xktMeshId, geometryId: xktGeometryId, matrix: matrix ? matrix.slice() : math.identityMat4(), color: color, opacity: opacity, metallic: metallic, roughness: roughness }); xktMeshIds.push(xktMeshId); } const xktEntityId = glTFNode.name || ("entity" + ctx.nextDefaultEntityId++); xktModel.createEntity({ entityId: xktEntityId, meshIds: xktMeshIds }); ctx.stats.numObjects++; } } } if (glTFNode.children) { const children = glTFNode.children; for (let i = 0, len = children.length; i < len; i++) { const childNodeIdx = children[i]; const childGLTFNode = gltf.nodes[childNodeIdx]; if (!childGLTFNode) { console.warn('Node not found: ' + i); continue; } parseNode(ctx, childGLTFNode, matrix); } } } function createPrimitiveGeometryHash(primitiveInfo) { const attributes = primitiveInfo.attributes; if (!attributes) { return "empty"; } const positions = primitiveInfo.attributes.POSITION; const normals = primitiveInfo.attributes.NORMAL; const colors = primitiveInfo.attributes.COLOR; return [ primitiveInfo.mode, (primitiveInfo.indices !== null && primitiveInfo.indices !== undefined) ? primitiveInfo.indices : "-", (positions !== null && positions !== undefined) ? positions : "-", (normals !== null && normals !== undefined) ? normals : "-", (colors !== null && colors !== undefined) ? colors : "-", (primitiveInfo.material !== null && primitiveInfo.material !== undefined) ? primitiveInfo.material : "-" ].join(";"); } function parsePrimitiveGeometry(ctx, primitiveInfo, geometryArrays) { const attributes = primitiveInfo.attributes; if (!attributes) { return; } switch (primitiveInfo.mode) { case 0: // POINTS geometryArrays.primitive = "points"; break; case 1: // LINES geometryArrays.primitive = "lines"; break; case 2: // LINE_LOOP // TODO: convert geometryArrays.primitive = "lines"; break; case 3: // LINE_STRIP // TODO: convert geometryArrays.primitive = "lines"; break; case 4: // TRIANGLES geometryArrays.primitive = "triangles"; break; case 5: // TRIANGLE_STRIP // TODO: convert geometryArrays.primitive = "triangles"; break; case 6: // TRIANGLE_FAN // TODO: convert geometryArrays.primitive = "triangles"; break; } const accessors = ctx.gltf.accessors; const indicesIndex = primitiveInfo.indices; if (indicesIndex !== null && indicesIndex !== undefined) { const accessorInfo = accessors[indicesIndex]; geometryArrays.indices = parseAccessorTypedArray(ctx, accessorInfo); } const positionsIndex = attributes.POSITION; if (positionsIndex !== null && positionsIndex !== undefined) { const accessorInfo = accessors[positionsIndex]; geometryArrays.positions = parseAccessorTypedArray(ctx, accessorInfo); } const normalsIndex = attributes.NORMAL; if (normalsIndex !== null && normalsIndex !== undefined) { const accessorInfo = accessors[normalsIndex]; geometryArrays.normals = parseAccessorTypedArray(ctx, accessorInfo); } const colorsIndex = attributes.COLOR_0; if (colorsIndex !== null && colorsIndex !== undefined) { const accessorInfo = accessors[colorsIndex]; geometryArrays.colors = parseAccessorTypedArray(ctx, accessorInfo); } } function parseAccessorTypedArray(ctx, accessorInfo) { const bufferView = ctx.gltf.bufferViews[accessorInfo.bufferView]; const itemSize = WEBGL_TYPE_SIZES[accessorInfo.type]; const TypedArray = WEBGL_COMPONENT_TYPES[accessorInfo.componentType]; const elementBytes = TypedArray.BYTES_PER_ELEMENT; // For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12. const itemBytes = elementBytes * itemSize; if (accessorInfo.byteStride && accessorInfo.byteStride !== itemBytes) { // The buffer is not interleaved if the stride is the item size in bytes. throw new Error("interleaved buffer!"); // TODO } else { return new TypedArray(bufferView._buffer, accessorInfo.byteOffset || 0, accessorInfo.count * itemSize); } } var __defProp = Object.defineProperty; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __require = (x) => { if (typeof require !== "undefined") return require(x); throw new Error('Dynamic require of "' + x + '" is not supported'); }; var __commonJS = (cb, mod) => function __require2() { return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __async = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { try { step(generator.next(value)); } catch (e) { reject(e); } }; var rejected = (value) => { try { step(generator.throw(value)); } catch (e) { reject(e); } }; var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); step((generator = generator.apply(__this, __arguments)).next()); }); }; // (disabled):crypto var require_crypto = __commonJS({ "(disabled):crypto"() { } }); // dist/web-ifc.js var require_web_ifc = __commonJS({ "dist/web-ifc.js"(exports, module) { var WebIFCWasm2 = function() { var _scriptDir = typeof document !== "undefined" && document.currentScript ? document.currentScript.src : void 0; if (typeof __filename !== "undefined") _scriptDir = _scriptDir || __filename; return function(WebIFCWasm3) { WebIFCWasm3 = WebIFCWasm3 || {}; var Module = typeof WebIFCWasm3 !== "undefined" ? WebIFCWasm3 : {}; var readyPromiseResolve, readyPromiseReject; Module["ready"] = new Promise(function(resolve, reject) { readyPromiseResolve = resolve; readyPromiseReject = reject; }); var moduleOverrides = {}; var key; for (key in Module) { if (Module.hasOwnProperty(key)) { moduleOverrides[key] = Module[key]; } } var arguments_ = []; var thisProgram = "./this.program"; var quit_ = function(status, toThrow) { throw toThrow; }; var ENVIRONMENT_IS_WEB = false; var ENVIRONMENT_IS_WORKER = false; var ENVIRONMENT_IS_NODE = false; var ENVIRONMENT_IS_SHELL = false; ENVIRONMENT_IS_WEB = typeof window === "object"; ENVIRONMENT_IS_WORKER = typeof importScripts === "function"; ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string"; ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; var scriptDirectory = ""; function locateFile(path) { if (Module["locateFile"]) { return Module["locateFile"](path, scriptDirectory); } return scriptDirectory + path; } var read_, readBinary; var nodeFS; var nodePath; if (ENVIRONMENT_IS_NODE) { if (ENVIRONMENT_IS_WORKER) { scriptDirectory = __require("path").dirname(scriptDirectory) + "/"; } else { scriptDirectory = __dirname + "/"; } read_ = function shell_read(filename, binary) { if (!nodeFS) nodeFS = __require("fs"); if (!nodePath) nodePath = __require("path"); filename = nodePath["normalize"](filename); return nodeFS["readFileSync"](filename, binary ? null : "utf8"); }; readBinary = function readBinary2(filename) { var ret = read_(filename, true); if (!ret.buffer) { ret = new Uint8Array(ret); } assert(ret.buffer); return ret; }; if (process["argv"].length > 1) { thisProgram = process["argv"][1].replace(/\\/g, "/"); } arguments_ = process["argv"].slice(2); process["on"]("uncaughtException", function(ex) { if (!(ex instanceof ExitStatus)) { throw ex; } }); process["on"]("unhandledRejection", abort); quit_ = function(status) { process["exit"](status); }; Module["inspect"] = function() { return "[Emscripten Module object]"; }; } else if (ENVIRONMENT_IS_SHELL) { if (typeof read != "undefined") { read_ = function shell_read(f) { return read(f); }; } readBinary = function readBinary2(f) { var data; if (typeof readbuffer === "function") { return new Uint8Array(readbuffer(f)); } data = read(f, "binary"); assert(typeof data === "object"); return data; }; if (typeof scriptArgs != "undefined") { arguments_ = scriptArgs; } else if (typeof arguments != "undefined") { arguments_ = arguments; } if (typeof quit === "function") { quit_ = function(status) { quit(status); }; } if (typeof print !== "undefined") { if (typeof console === "undefined") console = {}; console.log = print; console.warn = console.error = typeof printErr !== "undefined" ? printErr : print; } } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { if (ENVIRONMENT_IS_WORKER) { scriptDirectory = self.location.href; } else if (typeof document !== "undefined" && document.currentScript) { scriptDirectory = document.currentScript.src; } if (_scriptDir) { scriptDirectory = _scriptDir; } if (scriptDirectory.indexOf("blob:") !== 0) { scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1); } else { scriptDirectory = ""; } { read_ = function shell_read(url) { var xhr = new XMLHttpRequest(); xhr.open("GET", url, false); xhr.send(null); return xhr.responseText; }; if (ENVIRONMENT_IS_WORKER) { readBinary = function readBinary2(url) { var xhr = new XMLHttpRequest(); xhr.open("GET", url, false); xhr.responseType = "arraybuffer"; xhr.send(null); return new Uint8Array(xhr.response); }; } } } var out = Module["print"] || console.log.bind(console); var err = Module["printErr"] || console.warn.bind(console); for (key in moduleOverrides) { if (moduleOverrides.hasOwnProperty(key)) { Module[key] = moduleOverrides[key]; } } moduleOverrides = null; if (Module["arguments"]) arguments_ = Module["arguments"]; if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; if (Module["quit"]) quit_ = Module["quit"]; var STACK_ALIGN = 16; function alignMemory(size, factor) { if (!factor) factor = STACK_ALIGN; return Math.ceil(size / factor) * factor; } var wasmBinary; if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; var noExitRuntime; if (Module["noExitRuntime"]) noExitRuntime = Module["noExitRuntime"]; if (typeof WebAssembly !== "object") { abort("no native wasm support detected"); } var wasmMemory; var ABORT = false; function assert(condition, text) { if (!condition) { abort("Assertion failed: " + text); } } var UTF8Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : void 0; function UTF8ArrayToString(heap, idx, maxBytesToRead) { idx >>>= 0; var endIdx = idx + maxBytesToRead; var endPtr = idx; while (heap[endPtr >>> 0] && !(endPtr >= endIdx)) ++endPtr; if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) { return UTF8Decoder.decode(heap.subarray(idx >>> 0, endPtr >>> 0)); } else { var str = ""; while (idx < endPtr) { var u0 = heap[idx++ >>> 0]; if (!(u0 & 128)) { str += String.fromCharCode(u0); continue; } var u1 = heap[idx++ >>> 0] & 63; if ((u0 & 224) == 192) { str += String.fromCharCode((u0 & 31) << 6 | u1); continue; } var u2 = heap[idx++ >>> 0] & 63; if ((u0 & 240) == 224) { u0 = (u0 & 15) << 12 | u1 << 6 | u2; } else { u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++ >>> 0] & 63; } if (u0 < 65536) { str += String.fromCharCode(u0); } else { var ch = u0 - 65536; str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023); } } } return str; } function UTF8ToString(ptr, maxBytesToRead) { ptr >>>= 0; return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ""; } function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { outIdx >>>= 0; if (!(maxBytesToWrite > 0)) return 0; var startIdx = outIdx; var endIdx = outIdx + maxBytesToWrite - 1; for (var i = 0; i < str.length; ++i) { var u = str.charCodeAt(i); if (u >= 55296 && u <= 57343) { var u1 = str.charCodeAt(++i); u = 65536 + ((u & 1023) << 10) | u1 & 1023; } if (u <= 127) { if (outIdx >= endIdx) break; heap[outIdx++ >>> 0] = u; } else if (u <= 2047) { if (outIdx + 1 >= endIdx) break; heap[outIdx++ >>> 0] = 192 | u >> 6; heap[outIdx++ >>> 0] = 128 | u & 63; } else if (u <= 65535) { if (outIdx + 2 >= endIdx) break; heap[outIdx++ >>> 0] = 224 | u >> 12; heap[outIdx++ >>> 0] = 128 | u >> 6 & 63; heap[outIdx++ >>> 0] = 128 | u & 63; } else { if (outIdx + 3 >= endIdx) break; heap[outIdx++ >>> 0] = 240 | u >> 18; heap[outIdx++ >>> 0] = 128 | u >> 12 & 63; heap[outIdx++ >>> 0] = 128 | u >> 6 & 63; heap[outIdx++ >>> 0] = 128 | u & 63; } } heap[outIdx >>> 0] = 0; return outIdx - startIdx; } function stringToUTF8(str, outPtr, maxBytesToWrite) { return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); } function lengthBytesUTF8(str) { var len = 0; for (var i = 0; i < str.length; ++i) { var u = str.charCodeAt(i); if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; if (u <= 127) ++len; else if (u <= 2047) len += 2; else if (u <= 65535) len += 3; else len += 4; } return len; } var UTF16Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-16le") : void 0; function UTF16ToString(ptr, maxBytesToRead) { var endPtr = ptr; var idx = endPtr >> 1; var maxIdx = idx + maxBytesToRead / 2; while (!(idx >= maxIdx) && HEAPU16[idx >>> 0]) ++idx; endPtr = idx << 1; if (endPtr - ptr > 32 && UTF16Decoder) { return UTF16Decoder.decode(HEAPU8.subarray(ptr >>> 0, endPtr >>> 0)); } else { var str = ""; for (var i = 0; !(i >= maxBytesToRead / 2); ++i) { var codeUnit = HEAP16[ptr + i * 2 >>> 1]; if (codeUnit == 0) break; str += String.fromCharCode(codeUnit); } return str; } } function stringToUTF16(str, outPtr, maxBytesToWrite) { if (maxBytesToWrite === void 0) { maxBytesToWrite = 2147483647; } if (maxBytesToWrite < 2) return 0; maxBytesToWrite -= 2; var startPtr = outPtr; var numCharsToWrite = maxBytesToWrite < str.length * 2 ? maxBytesToWrite / 2 : str.length; for (var i = 0; i < numCharsToWrite; ++i) { var codeUnit = str.charCodeAt(i); HEAP16[outPtr >>> 1] = codeUnit; outPtr += 2; } HEAP16[outPtr >>> 1] = 0; return outPtr - startPtr; } function lengthBytesUTF16(str) { return str.length * 2; } function UTF32ToString(ptr, maxBytesToRead) { var i = 0; var str = ""; while (!(i >= maxBytesToRead / 4)) { var utf32 = HEAP32[ptr + i * 4 >>> 2]; if (utf32 == 0) break; ++i; if (utf32 >= 65536) { var ch = utf32 - 65536; str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023); } else { str += String.fromCharCode(utf32); } } return str; } function stringToUTF32(str, outPtr, maxBytesToWrite) { outPtr >>>= 0; if (maxBytesToWrite === void 0) { maxBytesToWrite = 2147483647; } if (maxBytesToWrite < 4) return 0; var startPtr = outPtr; var endPtr = startPtr + maxBytesToWrite - 4; for (var i = 0; i < str.length; ++i) { var codeUnit = str.charCodeAt(i); if (codeUnit >= 55296 && codeUnit <= 57343) { var trailSurrogate = str.charCodeAt(++i); codeUnit = 65536 + ((codeUnit & 1023) << 10) | trailSurrogate & 1023; } HEAP32[outPtr >>> 2] = codeUnit; outPtr += 4; if (outPtr + 4 > endPtr) break; } HEAP32[outPtr >>> 2] = 0; return outPtr - startPtr; } function lengthBytesUTF32(str) { var len = 0; for (var i = 0; i < str.length; ++i) { var codeUnit = str.charCodeAt(i); if (codeUnit >= 55296 && codeUnit <= 57343) ++i; len += 4; } return len; } function writeArrayToMemory(array, buffer2) { HEAP8.set(array, buffer2 >>> 0); } function writeAsciiToMemory(str, buffer2, dontAddNull) { for (var i = 0; i < str.length; ++i) { HEAP8[buffer2++ >>> 0] = str.charCodeAt(i); } if (!dontAddNull) HEAP8[buffer2 >>> 0] = 0; } function alignUp(x, multiple) { if (x % multiple > 0) { x += multiple - x % multiple; } return x; } var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; function updateGlobalBufferAndViews(buf) { buffer = buf; Module["HEAP8"] = HEAP8 = new Int8Array(buf); Module["HEAP16"] = HEAP16 = new Int16Array(buf); Module["HEAP32"] = HEAP32 = new Int32Array(buf); Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf); Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf); Module["HEAPF32"] = HEAPF32 = new Float32Array(buf); Module["HEAPF64"] = HEAPF64 = new Float64Array(buf); } var INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216; if (Module["wasmMemory"]) { wasmMemory = Module["wasmMemory"]; } else { wasmMemory = new WebAssembly.Memory({ "initial": INITIAL_MEMORY / 65536, "maximum": 4294967296 / 65536 }); } if (wasmMemory) { buffer = wasmMemory.buffer; } INITIAL_MEMORY = buffer.byteLength; updateGlobalBufferAndViews(buffer); var wasmTable; var __ATPRERUN__ = []; var __ATINIT__ = []; var __ATMAIN__ = []; var __ATPOSTRUN__ = []; function preRun() { if (Module["preRun"]) { if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; while (Module["preRun"].length) { addOnPreRun(Module["preRun"].shift()); } } callRuntimeCallbacks(__ATPRERUN__); } function initRuntime() { if (!Module["noFSInit"] && !FS.init.initialized) FS.init(); TTY.init(); callRuntimeCallbacks(__ATINIT__); } function preMain() { FS.ignorePermissions = false; callRuntimeCallbacks(__ATMAIN__); } function postRun() { if (Module["postRun"]) { if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; while (Module["postRun"].length) { addOnPostRun(Module["postRun"].shift()); } } callRuntimeCallbacks(__ATPOSTRUN__); } function addOnPreRun(cb) { __ATPRERUN__.unshift(cb); } function addOnPostRun(cb) { __ATPOSTRUN__.unshift(cb); } var runDependencies = 0; var dependenciesFulfilled = null; function addRunDependency(id) { runDependencies++; if (Module["monitorRunDependencies"]) { Module["monitorRunDependencies"](runDependencies); } } function removeRunDependency(id) { runDependencies--; if (Module["monitorRunDependencies"]) { Module["monitorRunDependencies"](runDependencies); } if (runDependencies == 0) { if (dependenciesFulfilled) { var callback = dependenciesFulfilled; dependenciesFulfilled = null; callback(); } } } Module["preloadedImages"] = {}; Module["preloadedAudios"] = {}; function abort(what) { if (Module["onAbort"]) { Module["onAbort"](what); } what += ""; err(what); ABORT = true; what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; var e = new WebAssembly.RuntimeError(what); readyPromiseReject(e); throw e; } function hasPrefix(str, prefix) { return String.prototype.startsWith ? str.startsWith(prefix) : str.indexOf(prefix) === 0; } var dataURIPrefix = "data:application/octet-stream;base64,"; function isDataURI(filename) { return hasPrefix(filename, dataURIPrefix); } var fileURIPrefix = "file://"; function isFileURI(filename) { return hasPrefix(filename, fileURIPrefix); } var wasmBinaryFile = "web-ifc.wasm"; if (!isDataURI(wasmBinaryFile)) { wasmBinaryFile = locateFile(wasmBinaryFile); } function getBinary() { try { if (wasmBinary) { return new Uint8Array(wasmBinary); } if (readBinary) { return readBinary(wasmBinaryFile); } else { throw "both async and sync fetching of the wasm failed"; } } catch (err2) { abort(err2); } } function getBinaryPromise() { if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === "function" && !isFileURI(wasmBinaryFile)) { return fetch(wasmBinaryFile, { credentials: "same-origin" }).then(function(response) { if (!response["ok"]) { throw "failed to load wasm binary file at '" + wasmBinaryFile + "'"; } return response["arrayBuffer"](); }).catch(function() { return getBinary(); }); } return Promise.resolve().then(getBinary); } function createWasm() { var info = { "a": asmLibraryArg }; function receiveInstance(instance, module2) { var exports3 = instance.exports; Module["asm"] = exports3; wasmTable = Module["asm"]["X"]; removeRunDependency(); } addRunDependency(); function receiveInstantiatedSource(output) { receiveInstance(output["instance"]); } function instantiateArrayBuffer(receiver) { return getBinaryPromise().then(function(binary) { return WebAssembly.instantiate(binary, info); }).then(receiver, function(reason) { err("failed to asynchronously prepare wasm: " + reason); abort(reason); }); } function instantiateAsync() { if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") { return fetch(wasmBinaryFile, { credentials: "same-origin" }).then(function(response) { var result = WebAssembly.instantiateStreaming(response, info); return result.then(receiveInstantiatedSource, function(reason) { err("wasm streaming compile failed: " + reason); err("falling back to ArrayBuffer instantiation"); return instantiateArrayBuffer(receiveInstantiatedSource); }); }); } else { return instantiateArrayBuffer(receiveInstantiatedSource); } } if (Module["instantiateWasm"]) { try { var exports2 = Module["instantiateWasm"](info, receiveInstance); return exports2; } catch (e) { err("Module.instantiateWasm callback failed with error: " + e); return false; } } instantiateAsync().catch(readyPromiseReject); return {}; } var tempDouble; var tempI64; function callRuntimeCallbacks(callbacks) { while (callbacks.length > 0) { var callback = callbacks.shift(); if (typeof callback == "function") { callback(Module); continue; } var func = callback.func; if (typeof func === "number") { if (callback.arg === void 0) { wasmTable.get(func)(); } else { wasmTable.get(func)(callback.arg); } } else { func(callback.arg === void 0 ? null : callback.arg); } } } function dynCallLegacy(sig, ptr, args) { if (args && args.length) { return Module["dynCall_" + sig].apply(null, [ptr].concat(args)); } return Module["dynCall_" + sig].call(null, ptr); } function dynCall(sig, ptr, args) { if (sig.indexOf("j") != -1) { return dynCallLegacy(sig, ptr, args); } return wasmTable.get(ptr).apply(null, args); } function ___assert_fail(condition, filename, line, func) { abort("Assertion failed: " + UTF8ToString(condition) + ", at: " + [filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function"]); } function setErrNo(value) { HEAP32[___errno_location() >>> 2] = value; return value; } var PATH = { splitPath: function(filename) { var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; return splitPathRe.exec(filename).slice(1); }, normalizeArray: function(parts, allowAboveRoot) { var up = 0; for (var i = parts.length - 1; i >= 0; i--) { var last = parts[i]; if (last === ".") { parts.splice(i, 1); } else if (last === "..") { parts.splice(i, 1); up++; } else if (up) { parts.splice(i, 1); up--; } } if (allowAboveRoot) { for (; up; up--) { parts.unshift(".."); } } return parts; }, normalize: function(path) { var isAbsolute = path.charAt(0) === "/", trailingSlash = path.substr(-1) === "/"; path = PATH.normalizeArray(path.split("/").filter(function(p) { return !!p; }), !isAbsolute).join("/"); if (!path && !isAbsolute) { path = "."; } if (path && trailingSlash) { path += "/"; } return (isAbsolute ? "/" : "") + path; }, dirname: function(path) { var result = PATH.splitPath(path), root = result[0], dir = result[1]; if (!root && !dir) { return "."; } if (dir) { dir = dir.substr(0, dir.length - 1); } return root + dir; }, basename: function(path) { if (path === "/") return "/"; path = PATH.normalize(path); path = path.replace(/\/$/, ""); var lastSlash = path.lastIndexOf("/"); if (lastSlash === -1) return path; return path.substr(lastSlash + 1); }, extname: function(path) { return PATH.splitPath(path)[3]; }, join: function() { var paths = Array.prototype.slice.call(arguments, 0); return PATH.normalize(paths.join("/")); }, join2: function(l, r) { return PATH.normalize(l + "/" + r); } }; function getRandomDevice() { if (typeof crypto === "object" && typeof crypto["getRandomValues"] === "function") { var randomBuffer = new Uint8Array(1); return function() { crypto.getRandomValues(randomBuffer); return randomBuffer[0]; }; } else if (ENVIRONMENT_IS_NODE) { try { var crypto_module = require_crypto(); return function() { return crypto_module["randomBytes"](1)[0]; }; } catch (e) { } } return function() { abort("randomDevice"); }; } var PATH_FS = { resolve: function() { var resolvedPath = "", resolvedAbsolute = false; for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { var path = i >= 0 ? arguments[i] : FS.cwd(); if (typeof path !== "string") { throw new TypeError("Arguments to path.resolve must be strings"); } else if (!path) { return ""; } resolvedPath = path + "/" + resolvedPath; resolvedAbsolute = path.charAt(0) === "/"; } resolvedPath = PATH.normalizeArray(resolvedPath.split("/").filter(function(p) { return !!p; }), !resolvedAbsolute).join("/"); return (resolvedAbsolute ? "/" : "") + resolvedPath || "."; }, relative: function(from, to) { from = PATH_FS.resolve(from).substr(1); to = PATH_FS.resolve(to).substr(1); function trim(arr) { var start = 0; for (; start < arr.length; start++) { if (arr[start] !== "") break; } var end = arr.length - 1; for (; end >= 0; end--) { if (arr[end] !== "") break; } if (start > end) return []; return arr.slice(start, end - start + 1); } var fromParts = trim(from.split("/")); var toParts = trim(to.split("/")); var length = Math.min(fromParts.length, toParts.length); var samePartsLength = length; for (var i = 0; i < length; i++) { if (fromParts[i] !== toParts[i]) { samePartsLength = i; break; } } var outputParts = []; for (var i = samePartsLength; i < fromParts.length; i++) { outputParts.push(".."); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join("/"); } }; var TTY = { ttys: [], init: function() { }, shutdown: function() { }, register: function(dev, ops) { TTY.ttys[dev] = { input: [], output: [], ops }; FS.registerDevice(dev, TTY.stream_ops); }, stream_ops: { open: function(stream) { var tty = TTY.ttys[stream.node.rdev]; if (!tty) { throw new FS.ErrnoError(43); } stream.tty = tty; stream.seekable = false; }, close: function(stream) { stream.tty.ops.flush(stream.tty); }, flush: function(stream) { stream.tty.ops.flush(stream.tty); }, read: function(stream, buffer2, offset, length, pos) { if (!stream.tty || !stream.tty.ops.get_char) { throw new FS.ErrnoError(60); } var bytesRead = 0; for (var i = 0; i < length; i++) { var result; try { result = stream.tty.ops.get_char(stream.tty); } catch (e) { throw new FS.ErrnoError(29); } if (result === void 0 && bytesRead === 0) { throw new FS.ErrnoError(6); } if (result === null || result === void 0) break; bytesRead++; buffer2[offset + i] = result; } if (bytesRead) { stream.node.timestamp = Date.now(); } return bytesRead; }, write: function(stream, buffer2, offset, length, pos) { if (!stream.tty || !stream.tty.ops.put_char) { throw new FS.ErrnoError(60); } try { for (var i = 0; i < length; i++) { stream.tty.ops.put_char(stream.tty, buffer2[offset + i]); } } catch (e) { throw new FS.ErrnoError(29); } if (length) { stream.node.timestamp = Date.now(); } return i; } }, default_tty_ops: { get_char: function(tty) { if (!tty.input.length) { var result = null; if (ENVIRONMENT_IS_NODE) { var BUFSIZE = 256; var buf = Buffer.alloc ? Buffer.alloc(BUFSIZE) : new Buffer(BUFSIZE); var bytesRead = 0; try { bytesRead = nodeFS.readSync(process.stdin.fd, buf, 0, BUFSIZE, null); } catch (e) { if (e.toString().indexOf("EOF") != -1) bytesRead = 0; else throw e; } if (bytesRead > 0) { result = buf.slice(0, bytesRead).toString("utf-8"); } else { result = null; } } else if (typeof window != "undefined" && typeof window.prompt == "function") { result = window.prompt("Input: "); if (result !== null) { result += "\n"; } } else if (typeof readline == "function") { result = readline(); if (result !== null) { result += "\n"; } } if (!result) { return null; } tty.input = intArrayFromString(result, true); } return tty.input.shift(); }, put_char: function(tty, val) { if (val === null || val === 10) { out(UTF8ArrayToString(tty.output, 0)); tty.output = []; } else { if (val != 0) tty.output.push(val); } }, flush: function(tty) { if (tty.output && tty.output.length > 0) { out(UTF8ArrayToString(tty.output, 0)); tty.output = []; } } }, default_tty1_ops: { put_char: function(tty, val) { if (val === null || val === 10) { err(UTF8ArrayToString(tty.output, 0)); tty.output = []; } else { if (val != 0) tty.output.push(val); } }, flush: function(tty) { if (tty.output && tty.output.length > 0) { err(UTF8ArrayToString(tty.output, 0)); tty.output = []; } } } }; function mmapAlloc(size) { var alignedSize = alignMemory(size, 16384); var ptr = _malloc(alignedSize); while (size < alignedSize) HEAP8[ptr + size++ >>> 0] = 0; return ptr; } var MEMFS = { ops_table: null, mount: function(mount) { return MEMFS.createNode(null, "/", 16384 | 511, 0); }, createNode: function(parent, name2, mode, dev) { if (FS.isBlkdev(mode) || FS.isFIFO(mode)) { throw new FS.ErrnoError(63); } if (!MEMFS.ops_table) { MEMFS.ops_table = { dir: { node: { getattr: MEMFS.node_ops.getattr, setattr: MEMFS.node_ops.setattr, lookup: MEMFS.node_ops.lookup, mknod: MEMFS.node_ops.mknod, rename: MEMFS.node_ops.rename, unlink: MEMFS.node_ops.unlink, rmdir: MEMFS.node_ops.rmdir, readdir: MEMFS.node_ops.readdir, symlink: MEMFS.node_ops.symlink }, stream: { llseek: MEMFS.stream_ops.llseek } }, file: { node: { getattr: MEMFS.node_ops.getattr, setattr: MEMFS.node_ops.setattr }, stream: { llseek: MEMFS.stream_ops.llseek, read: MEMFS.stream_ops.read, write: MEMFS.stream_ops.write, allocate: MEMFS.stream_ops.allocate, mmap: MEMFS.stream_ops.mmap, msync: MEMFS.stream_ops.msync } }, link: { node: { getattr: MEMFS.node_ops.getattr, setattr: MEMFS.node_ops.setattr, readlink: MEMFS.node_ops.readlink }, stream: {} }, chrdev: { node: { getattr: MEMFS.node_ops.getattr, setattr: MEMFS.node_ops.setattr }, stream: FS.chrdev_stream_ops } }; } var node = FS.createNode(parent, name2, mode, dev); if (FS.isDir(node.mode)) { node.node_ops = MEMFS.ops_table.dir.node; node.stream_ops = MEMFS.ops_table.dir.stream; node.contents = {}; } else if (FS.isFile(node.mode)) { node.node_ops = MEMFS.ops_table.file.node; node.stream_ops = MEMFS.ops_table.file.stream; node.usedBytes = 0; node.contents = null; } else if (FS.isLink(node.mode)) { node.node_ops = MEMFS.ops_table.link.node; node.stream_ops = MEMFS.ops_table.link.stream; } else if (FS.isChrdev(node.mode)) { node.node_ops = MEMFS.ops_table.chrdev.node; node.stream_ops = MEMFS.ops_table.chrdev.stream; } node.timestamp = Date.now(); if (parent) { parent.contents[name2] = node; } return node; }, getFileDataAsRegularArray: function(node) { if (node.contents && node.contents.subarray) { var arr = []; for (var i = 0; i < node.usedBytes; ++i) arr.push(node.contents[i]); return arr; } return node.contents; }, getFileDataAsTypedArray: function(node) { if (!node.contents) return new Uint8Array(0); if (node.contents.subarray) return node.contents.subarray(0, node.usedBytes); return new Uint8Array(node.contents); }, expandFileStorage: function(node, newCapacity) { newCapacity >>>= 0; var prevCapacity = node.contents ? node.contents.length : 0; if (prevCapacity >= newCapacity) return; var CAPACITY_DOUBLING_MAX = 1024 * 1024; newCapacity = Math.max(newCapacity, prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125) >>> 0); if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); var oldContents = node.contents; node.contents = new Uint8Array(newCapacity); if (node.usedBytes > 0) node.contents.set(oldContents.subarray(0, node.usedBytes), 0); return; }, resizeFileStorage: function(node, newSize) { newSize >>>= 0; if (node.usedBytes == newSize) return; if (newSize == 0) { node.contents = null; node.usedBytes = 0; return; } if (!node.contents || node.contents.subarray) { var oldContents = node.contents; node.contents = new Uint8Array(newSize); if (oldContents) { node.contents.set(oldContents.subarray(0, Math.min(newSize, node.usedBytes))); } node.usedBytes = newSize; return; } if (!node.contents) node.contents = []; if (node.contents.length > newSize) node.contents.length = newSize; else while (node.contents.length < newSize) node.contents.push(0); node.usedBytes = newSize; }, node_ops: { getattr: function(node) { var attr = {}; attr.dev = FS.isChrdev(node.mode) ? node.id : 1; attr.ino = node.id; attr.mode = node.mode; attr.nlink = 1; attr.uid = 0; attr.gid = 0; attr.rdev = node.rdev; if (FS.isDir(node.mode)) { attr.size = 4096; } else if (FS.isFile(node.mode)) { attr.size = node.usedBytes; } else if (FS.isLink(node.mode)) { attr.size = node.link.length; } else { attr.size = 0; } attr.atime = new Date(node.timestamp); attr.mtime = new Date(node.timestamp); attr.ctime = new Date(node.timestamp); attr.blksize = 4096; attr.blocks = Math.ceil(attr.size / attr.blksize); return attr; }, setattr: function(node, attr) { if (attr.mode !== void 0) { node.mode = attr.mode; } if (attr.timestamp !== void 0) { node.timestamp = attr.timestamp; } if (attr.size !== void 0) { MEMFS.resizeFileStorage(node, attr.size); } }, lookup: function(parent, name2) { throw FS.genericErrors[44]; }, mknod: function(parent, name2, mode, dev) { return MEMFS.createNode(parent, name2, mode, dev); }, rename: function(old_node, new_dir, new_name) { if (FS.isDir(old_node.mode)) { var new_node; try { new_node = FS.lookupNode(new_dir, new_name); } catch (e) { } if (new_node) { for (var i in new_node.contents) { throw new FS.ErrnoError(55); } } } delete old_node.parent.contents[old_node.name]; old_node.name = new_name; new_dir.contents[new_name] = old_node; old_node.parent = new_dir; }, unlink: function(parent, name2) { delete parent.contents[name2]; }, rmdir: function(parent, name2) { var node = FS.lookupNode(parent, name2); for (var i in node.contents) { throw new FS.ErrnoError(55); } delete parent.contents[name2]; }, readdir: function(node) { var entries = [".", ".."]; for (var key2 in node.contents) { if (!node.contents.hasOwnProperty(key2)) { continue; } entries.push(key2); } return entries; }, symlink: function(parent, newname, oldpath) { var node = MEMFS.createNode(parent, newname, 511 | 40960, 0); node.link = oldpath; return node; }, readlink: function(node) { if (!FS.isLink(node.mode)) { throw new FS.ErrnoError(28); } return node.link; } }, stream_ops: { read: function(stream, buffer2, offset, length, position) { var contents = stream.node.contents; if (position >= stream.node.usedBytes) return 0; var size = Math.min(stream.node.usedBytes - position, length); if (size > 8 && contents.subarray) { buffer2.set(contents.subarray(position, position + size), offset); } else { for (var i = 0; i < size; i++) buffer2[offset + i] = contents[position + i]; } return size; }, write: function(stream, buffer2, offset, length, position, canOwn) { if (buffer2.buffer === HEAP8.buffer) { canOwn = false; } if (!length) return 0; var node = stream.node; node.timestamp = Date.now(); if (buffer2.subarray && (!node.contents || node.contents.subarray)) { if (canOwn) { node.contents = buffer2.subarray(offset, offset + length); node.usedBytes = length; return length; } else if (node.usedBytes === 0 && position === 0) { node.contents = buffer2.slice(offset, offset + length); node.usedBytes = length; return length; } else if (position + length <= node.usedBytes) { node.contents.set(buffer2.subarray(offset, offset + length), position); return length; } } MEMFS.expandFileStorage(node, position + length); if (node.contents.subarray && buffer2.subarray) { node.contents.set(buffer2.subarray(offset, offset + length), position); } else { for (var i = 0; i < length; i++) { node.contents[position + i] = buffer2[offset + i]; } } node.usedBytes = Math.max(node.usedBytes, position + length); return length; }, llseek: function(stream, offset, whence) { var position = offset; if (whence === 1) { position += stream.position; } else if (whence === 2) { if (FS.isFile(stream.node.mode)) { position += stream.node.usedBytes; } } if (position < 0) { throw new FS.ErrnoError(28); } return position; }, allocate: function(stream, offset, length) { MEMFS.expandFileStorage(stream.node, offset + length); stream.node.usedBytes = Math.max(stream.node.usedBytes, offset + length); }, mmap: function(stream, address, length, position, prot, flags) { assert(address === 0); if (!FS.isFile(stream.node.mode)) { throw new FS.ErrnoError(43); } var ptr; var allocated; var contents = stream.node.contents; if (!(flags & 2) && contents.buffer === buffer) { allocated = false; ptr = contents.byteOffset; } else { if (position > 0 || position + length < contents.length) { if (contents.subarray) { contents = contents.subarray(position, position + length); } else { contents = Array.prototype.slice.call(contents, position, position + length); } } allocated = true; ptr = mmapAlloc(length); if (!ptr) { throw new FS.ErrnoError(48); } ptr >>>= 0; HEAP8.set(contents, ptr >>> 0); } return { ptr, allocated }; }, msync: function(stream, buffer2, offset, length, mmapFlags) { if (!FS.isFile(stream.node.mode)) { throw new FS.ErrnoError(43); } if (mmapFlags & 2) { return 0; } var bytesWritten = MEMFS.stream_ops.write(stream, buffer2, 0, length, offset, false); return 0; } } }; var FS = { root: null, mounts: [], devices: {}, streams: [], nextInode: 1, nameTable: null, currentPath: "/", initialized: false, ignorePermissions: true, trackingDelegate: {}, tracking: { openFlags: { READ: 1, WRITE: 2 } }, ErrnoError: null, genericErrors: {}, filesystems: null, syncFSRequests: 0, lookupPath: function(path, opts) { path = PATH_FS.resolve(FS.cwd(), path); opts = opts || {}; if (!path) return { path: "", node: null }; var defaults = { follow_mount: true, recurse_count: 0 }; for (var key2 in defaults) { if (opts[key2] === void 0) { opts[key2] = defaults[key2]; } } if (opts.recurse_count > 8) { throw new FS.ErrnoError(32); } var parts = PATH.normalizeArray(path.split("/").filter(function(p) { return !!p; }), false); var current = FS.root; var current_path = "/"; for (var i = 0; i < parts.length; i++) { var islast = i === parts.length - 1; if (islast && opts.parent) { break; } current = FS.lookupNode(current, parts[i]); current_path = PATH.join2(current_path, parts[i]); if (FS.isMountpoint(current)) { if (!islast || islast && opts.follow_mount) { current = current.mounted.root; } } if (!islast || opts.follow) { var count = 0; while (FS.isLink(current.mode)) { var link = FS.readlink(current_path); current_path = PATH_FS.resolve(PATH.dirname(current_path), link); var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count }); current = lookup.node; if (count++ > 40) { throw new FS.ErrnoError(32); } } } } return { path: current_path, node: current }; }, getPath: function(node) { var path; while (true) { if (FS.isRoot(node)) { var mount = node.mount.mountpoint; if (!path) return mount; return mount[mount.length - 1] !== "/" ? mount + "/" + path : mount + path; } path = path ? node.name + "/" + path : node.name; node = node.parent; } }, hashName: function(parentid, name2) { var hash = 0; for (var i = 0; i < name2.length; i++) { hash = (hash << 5) - hash + name2.charCodeAt(i) | 0; } return (parentid + hash >>> 0) % FS.nameTable.length; }, hashAddNode: function(node) { var hash = FS.hashName(node.parent.id, node.name); node.name_next = FS.nameTable[hash]; FS.nameTable[hash] = node; }, hashRemoveNode: function(node) { var hash = FS.hashName(node.parent.id, node.name); if (FS.nameTable[hash] === node) { FS.nameTable[hash] = node.name_next; } else { var current = FS.nameTable[hash]; while (current) { if (current.name_next === node) { current.name_next = node.name_next; break; } current = current.name_next; } } }, lookupNode: function(parent, name2) { var errCode = FS.mayLookup(parent); if (errCode) { throw new FS.ErrnoError(errCode, parent); } var hash = FS.hashName(parent.id, name2); for (var node = FS.nameTable[hash]; node; node = node.name_next) { var nodeName = node.name; if (node.parent.id === parent.id && nodeName === name2) { return node; } } return FS.lookup(parent, name2); }, createNode: function(parent, name2, mode, rdev) { var node = new FS.FSNode(parent, name2, mode, rdev); FS.hashAddNode(node); return node; }, destroyNode: function(node) { FS.hashRemoveNode(node); }, isRoot: function(node) { return node === node.parent; }, isMountpoint: function(node) { return !!node.mounted; }, isFile: function(mode) { return (mode & 61440) === 32768; }, isDir: function(mode) { return (mode & 61440) === 16384; }, isLink: function(mode) { return (mode & 61440) === 40960; }, isChrdev: function(mode) { return (mode & 61440) === 8192; }, isBlkdev: function(mode) { return (mode & 61440) === 24576; }, isFIFO: function(mode) { return (mode & 61440) === 4096; }, isSocket: function(mode) { return (mode & 49152) === 49152; }, flagModes: { "r": 0, "r+": 2, "w": 577, "w+": 578, "a": 1089, "a+": 1090 }, modeStringToFlags: function(str) { var flags = FS.flagModes[str]; if (typeof flags === "undefined") { throw new Error("Unknown file open mode: " + str); } return flags; }, flagsToPermissionString: function(flag) { var perms = ["r", "w", "rw"][flag & 3]; if (flag & 512) { perms += "w"; } return perms; }, nodePermissions: function(node, perms) { if (FS.ignorePermissions) { return 0; } if (perms.indexOf("r") !== -1 && !(node.mode & 292)) { return 2; } else if (perms.indexOf("w") !== -1 && !(node.mode & 146)) { return 2; } else if (perms.indexOf("x") !== -1 && !(node.mode & 73)) { return 2; } return 0; }, mayLookup: function(dir) { var errCode = FS.nodePermissions(dir, "x"); if (errCode) return errCode; if (!dir.node_ops.lookup) return 2; return 0; }, mayCreate: function(dir, name2) { try { var node = FS.lookupNode(dir, name2); return 20; } catch (e) { } return FS.nodePermissions(dir, "wx"); }, mayDelete: function(dir, name2, isdir) { var node; try { node = FS.lookupNode(dir, name2); } catch (e) { return e.errno; } var errCode = FS.nodePermissions(dir, "wx"); if (errCode) { return errCode; } if (isdir) { if (!FS.isDir(node.mode)) { return 54; } if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) { return 10; } } else { if (FS.isDir(node.mode)) { return 31; } } return 0; }, mayOpen: function(node, flags) { if (!node) { return 44; } if (FS.isLink(node.mode)) { return 32; } else if (FS.isDir(node.mode)) { if (FS.flagsToPermissionString(flags) !== "r" || flags & 512) { return 31; } } return FS.nodePermissions(node, FS.flagsToPermissionString(flags)); }, MAX_OPEN_FDS: 4096, nextfd: function(fd_start, fd_end) { fd_start = fd_start || 0; fd_end = fd_end || FS.MAX_OPEN_FDS; for (var fd = fd_start; fd <= fd_end; fd++) { if (!FS.streams[fd]) { return fd; } } throw new FS.ErrnoError(33); }, getStream: function(fd) { return FS.streams[fd]; }, createStream: function(stream, fd_start, fd_end) { if (!FS.FSStream) { FS.FSStream = function() { }; FS.FSStream.prototype = { object: { get: function() { return this.node; }, set: function(val) { this.node = val; } }, isRead: { get: function() { return (this.flags & 2097155) !== 1; } }, isWrite: { get: function() { return (this.flags & 2097155) !== 0; } }, isAppend: { get: function() { return this.flags & 1024; } } }; } var newStream = new FS.FSStream(); for (var p in stream) { newStream[p] = stream[p]; } stream = newStream; var fd = FS.nextfd(fd_start, fd_end); stream.fd = fd; FS.streams[fd] = stream; return stream; }, closeStream: function(fd) { FS.streams[fd] = null; }, chrdev_stream_ops: { open: function(stream) { var device = FS.getDevice(stream.node.rdev); stream.stream_ops = device.stream_ops; if (stream.stream_ops.open) { stream.stream_ops.open(stream); } }, llseek: function() { throw new FS.ErrnoError(70); } }, major: function(dev) { return dev >> 8; }, minor: function(dev) { return dev & 255; }, makedev: function(ma, mi) { return ma << 8 | mi; }, registerDevice: function(dev, ops) { FS.devices[dev] = { stream_ops: ops }; }, getDevice: function(dev) { return FS.devices[dev]; }, getMounts: function(mount) { var mounts = []; var check = [mount]; while (check.length) { var m = check.pop(); mounts.push(m); check.push.apply(check, m.mounts); } return mounts; }, syncfs: function(populate, callback) { if (typeof populate === "function") { callback = populate; populate = false; } FS.syncFSRequests++; if (FS.syncFSRequests > 1) { err("warning: " + FS.syncFSRequests + " FS.syncfs operations in flight at once, probably just doing extra work"); } var mounts = FS.getMounts(FS.root.mount); var completed = 0; function doCallback(errCode) { FS.syncFSRequests--; return callback(errCode); } function done(errCode) { if (errCode) { if (!done.errored) { done.errored = true; return doCallback(errCode); } return; } if (++completed >= mounts.length) { doCallback(null); } } mounts.forEach(function(mount) { if (!mount.type.syncfs) { return done(null); } mount.type.syncfs(mount, populate, done); }); }, mount: function(type, opts, mountpoint) { var root = mountpoint === "/"; var pseudo = !mountpoint; var node; if (root && FS.root) { throw new FS.ErrnoError(10); } else if (!root && !pseudo) { var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); mountpoint = lookup.path; node = lookup.node; if (FS.isMountpoint(node)) { throw new FS.ErrnoError(10); } if (!FS.isDir(node.mode)) { throw new FS.ErrnoError(54); } } var mount = { type, opts, mountpoint, mounts: [] }; var mountRoot = type.mount(mount); mountRoot.mount = mount; mount.root = mountRoot; if (root) { FS.root = mountRoot; } else if (node) { node.mounted = mount; if (node.mount) { node.mount.mounts.push(mount); } } return mountRoot; }, unmount: function(mountpoint) { var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); if (!FS.isMountpoint(lookup.node)) { throw new FS.ErrnoError(28); } var node = lookup.node; var mount = node.mounted; var mounts = FS.getMounts(mount); Object.keys(FS.nameTable).forEach(function(hash) { var current = FS.nameTable[hash]; while (current) { var next = current.name_next; if (mounts.indexOf(current.mount) !== -1) { FS.destroyNode(current); } current = next; } }); node.mounted = null; var idx = node.mount.mounts.indexOf(mount); node.mount.mounts.splice(idx, 1); }, lookup: function(parent, name2) { return parent.node_ops.lookup(parent, name2); }, mknod: function(path, mode, dev) { var lookup = FS.lookupPath(path, { parent: true }); var parent = lookup.node; var name2 = PATH.basename(path); if (!name2 || name2 === "." || name2 === "..") { throw new FS.ErrnoError(28); } var errCode = FS.mayCreate(parent, name2); if (errCode) { throw new FS.ErrnoError(errCode); } if (!parent.node_ops.mknod) { throw new FS.ErrnoError(63); } return parent.node_ops.mknod(parent, name2, mode, dev); }, create: function(path, mode) { mode = mode !== void 0 ? mode : 438; mode &= 4095; mode |= 32768; return FS.mknod(path, mode, 0); }, mkdir: function(path, mode) { mode = mode !== void 0 ? mode : 511; mode &= 511 | 512; mode |= 16384; return FS.mknod(path, mode, 0); }, mkdirTree: function(path, mode) { var dirs = path.split("/"); var d = ""; for (var i = 0; i < dirs.length; ++i) { if (!dirs[i]) continue; d += "/" + dirs[i]; try { FS.mkdir(d, mode); } catch (e) { if (e.errno != 20) throw e; } } }, mkdev: function(path, mode, dev) { if (typeof dev === "undefined") { dev = mode; mode = 438; } mode |= 8192; return FS.mknod(path, mode, dev); }, symlink: function(oldpath, newpath) { if (!PATH_FS.resolve(oldpath)) { throw new FS.ErrnoError(44); } var lookup = FS.lookupPath(newpath, { parent: true }); var parent = lookup.node; if (!parent) { throw new FS.ErrnoError(44); } var newname = PATH.basename(newpath); var errCode = FS.mayCreate(parent, newname); if (errCode) { throw new FS.ErrnoError(errCode); } if (!parent.node_ops.symlink) { throw new FS.ErrnoError(63); } return parent.node_ops.symlink(parent, newname, oldpath); }, rename: function(old_path, new_path) { var old_dirname = PATH.dirname(old_path); var new_dirname = PATH.dirname(new_path); var old_name = PATH.basename(old_path); var new_name = PATH.basename(new_path); var lookup, old_dir, new_dir; lookup = FS.lookupPath(old_path, { parent: true }); old_dir = lookup.node; lookup = FS.lookupPath(new_path, { parent: true }); new_dir = lookup.node; if (!old_dir || !new_dir) throw new FS.ErrnoError(44); if (old_dir.mount !== new_dir.mount) { throw new FS.ErrnoError(75); } var old_node = FS.lookupNode(old_dir, old_name); var relative = PATH_FS.relative(old_path, new_dirname); if (relative.charAt(0) !== ".") { throw new FS.ErrnoError(28); } relative = PATH_FS.relative(new_path, old_dirname); if (relative.charAt(0) !== ".") { throw new FS.ErrnoError(55); } var new_node; try { new_node = FS.lookupNode(new_dir, new_name); } catch (e) { } if (old_node === new_node) { return; } var isdir = FS.isDir(old_node.mode); var errCode = FS.mayDelete(old_dir, old_name, isdir); if (errCode) { throw new FS.ErrnoError(errCode); } errCode = new_node ? FS.mayDelete(new_dir, new_name, isdir) : FS.mayCreate(new_dir, new_name); if (errCode) { throw new FS.ErrnoError(errCode); } if (!old_dir.node_ops.rename) { throw new FS.ErrnoError(63); } if (FS.isMountpoint(old_node) || new_node && FS.isMountpoint(new_node)) { throw new FS.ErrnoError(10); } if (new_dir !== old_dir) { errCode = FS.nodePermissions(old_dir, "w"); if (errCode) { throw new FS.ErrnoError(errCode); } } try { if (FS.trackingDelegate["willMovePath"]) { FS.trackingDelegate["willMovePath"](old_path, new_path); } } catch (e) { err("FS.trackingDelegate['willMovePath']('" + old_path + "', '" + new_path + "') threw an exception: " + e.message); } FS.hashRemoveNode(old_node); try { old_dir.node_ops.rename(old_node, new_dir, new_name); } catch (e) { throw e; } finally { FS.hashAddNode(old_node); } try { if (FS.trackingDelegate["onMovePath"]) FS.trackingDelegate["onMovePath"](old_path, new_path); } catch (e) { err("FS.trackingDelegate['onMovePath']('" + old_path + "', '" + new_path + "') threw an exception: " + e.message); } }, rmdir: function(path) { var lookup = FS.lookupPath(path, { parent: true }); var parent = lookup.node; var name2 = PATH.basename(path); var node = FS.lookupNode(parent, name2); var errCode = FS.mayDelete(parent, name2, true); if (errCode) { throw new FS.ErrnoError(errCode); } if (!parent.node_ops.rmdir) { throw new FS.ErrnoError(63); } if (FS.isMountpoint(node)) { throw new FS.ErrnoError(10); } try { if (FS.trackingDelegate["willDeletePath"]) { FS.trackingDelegate["willDeletePath"](path); } } catch (e) { err("FS.trackingDelegate['willDeletePath']('" + path + "') threw an exception: " + e.message); } parent.node_ops.rmdir(parent, name2); FS.destroyNode(node); try { if (FS.trackingDelegate["onDeletePath"]) FS.trackingDelegate["onDeletePath"](path); } catch (e) { err("FS.trackingDelegate['onDeletePath']('" + path + "') threw an exception: " + e.message); } }, readdir: function(path) { var lookup = FS.lookupPath(path, { follow: true }); var node = lookup.node; if (!node.node_ops.readdir) { throw new FS.ErrnoError(54); } return node.node_ops.readdir(node); }, unlink: function(path) { var lookup = FS.lookupPath(path, { parent: true }); var parent = lookup.node; var name2 = PATH.basename(path); var node = FS.lookupNode(parent, name2); var errCode = FS.mayDelete(parent, name2, false); if (errCode) { throw new FS.ErrnoError(errCode); } if (!parent.node_ops.unlink) { throw new FS.ErrnoError(63); } if (FS.isMountpoint(node)) { throw new FS.ErrnoError(10); } try { if (FS.trackingDelegate["willDeletePath"]) { FS.trackingDelegate["willDeletePath"](path); } } catch (e) { err("FS.trackingDelegate['willDeletePath']('" + path + "') threw an exception: " + e.message); } parent.node_ops.unlink(parent, name2); FS.destroyNode(node); try { if (FS.trackingDelegate["onDeletePath"]) FS.trackingDelegate["onDeletePath"](path); } catch (e) { err("FS.trackingDelegate['onDeletePath']('" + path + "') threw an exception: " + e.message); } }, readlink: function(path) { var lookup = FS.lookupPath(path); var link = lookup.node; if (!link) { throw new FS.ErrnoError(44); } if (!link.node_ops.readlink) { throw new FS.ErrnoError(28); } return PATH_FS.resolve(FS.getPath(link.parent), link.node_ops.readlink(link)); }, stat: function(path, dontFollow) { var lookup = FS.lookupPath(path, { follow: !dontFollow }); var node = lookup.node; if (!node) { throw new FS.ErrnoError(44); } if (!node.node_ops.getattr) { throw new FS.ErrnoError(63); } return node.node_ops.getattr(node); }, lstat: function(path) { return FS.stat(path, true); }, chmod: function(path, mode, dontFollow) { var node; if (typeof path === "string") { var lookup = FS.lookupPath(path, { follow: !dontFollow }); node = lookup.node; } else { node = path; } if (!node.node_ops.setattr) { throw new FS.ErrnoError(63); } node.node_ops.setattr(node, { mode: mode & 4095 | node.mode & ~4095, timestamp: Date.now() }); }, lchmod: function(path, mode) { FS.chmod(path, mode, true); }, fchmod: function(fd, mode) { var stream = FS.getStream(fd); if (!stream) { throw new FS.ErrnoError(8); } FS.chmod(stream.node, mode); }, chown: function(path, uid, gid, dontFollow) { var node; if (typeof path === "string") { var lookup = FS.lookupPath(path, { follow: !dontFollow }); node = lookup.node; } else { node = path; } if (!node.node_ops.setattr) { throw new FS.ErrnoError(63); } node.node_ops.setattr(node, { timestamp: Date.now() }); }, lchown: function(path, uid, gid) { FS.chown(path, uid, gid, true); }, fchown: function(fd, uid, gid) { var stream = FS.getStream(fd); if (!stream) { throw new FS.ErrnoError(8); } FS.chown(stream.node, uid, gid); }, truncate: function(path, len) { if (len < 0) { throw new FS.ErrnoError(28); } var node; if (typeof path === "string") { var lookup = FS.lookupPath(path, { follow: true }); node = lookup.node; } else { node = path; } if (!node.node_ops.setattr) { throw new FS.ErrnoError(63); } if (FS.isDir(node.mode)) { throw new FS.ErrnoError(31); } if (!FS.isFile(node.mode)) { throw new FS.ErrnoError(28); } var errCode = FS.nodePermissions(node, "w"); if (errCode) { throw new FS.ErrnoError(errCode); } node.node_ops.setattr(node, { size: len, timestamp: Date.now() }); }, ftruncate: function(fd, len) { var stream = FS.getStream(fd); if (!stream) { throw new FS.ErrnoError(8); } if ((stream.flags & 2097155) === 0) { throw new FS.ErrnoError(28); } FS.truncate(stream.node, len); }, utime: function(path, atime, mtime) { var lookup = FS.lookupPath(path, { follow: true }); var node = lookup.node; node.node_ops.setattr(node, { timestamp: Math.max(atime, mtime) }); }, open: function(path, flags, mode, fd_start, fd_end) { if (path === "") { throw new FS.ErrnoError(44); } flags = typeof flags === "string" ? FS.modeStringToFlags(flags) : flags; mode = typeof mode === "undefined" ? 438 : mode; if (flags & 64) { mode = mode & 4095 | 32768; } else { mode = 0; } var node; if (typeof path === "object") { node = path; } else { path = PATH.normalize(path); try { var lookup = FS.lookupPath(path, { follow: !(flags & 131072) }); node = lookup.node; } catch (e) { } } var created = false; if (flags & 64) { if (node) { if (flags & 128) { throw new FS.ErrnoError(20); } } else { node = FS.mknod(path, mode, 0); created = true; } } if (!node) { throw new FS.ErrnoError(44); } if (FS.isChrdev(node.mode)) { flags &= ~512; } if (flags & 65536 && !FS.isDir(node.mode)) { throw new FS.ErrnoError(54); } if (!created) { var errCode = FS.mayOpen(node, flags); if (errCode) { throw new FS.ErrnoError(errCode); } } if (flags & 512) { FS.truncate(node, 0); } flags &= ~(128 | 512 | 131072); var stream = FS.createStream({ node, path: FS.getPath(node), flags, seekable: true, position: 0, stream_ops: node.stream_ops, ungotten: [], error: false }, fd_start, fd_end); if (stream.stream_ops.open) { stream.stream_ops.open(stream); } if (Module["logReadFiles"] && !(flags & 1)) { if (!FS.readFiles) FS.readFiles = {}; if (!(path in FS.readFiles)) { FS.readFiles[path] = 1; err("FS.trackingDelegate error on read file: " + path); } } try { if (FS.trackingDelegate["onOpenFile"]) { var trackingFlags = 0; if ((flags & 2097155) !== 1) { trackingFlags |= FS.tracking.openFlags.READ; } if ((flags & 2097155) !== 0) { trackingFlags |= FS.tracking.openFlags.WRITE; } FS.trackingDelegate["onOpenFile"](path, trackingFlags); } } catch (e) { err("FS.trackingDelegate['onOpenFile']('" + path + "', flags) threw an exception: " + e.message); } return stream; }, close: function(stream) { if (FS.isClosed(stream)) { throw new FS.ErrnoError(8); } if (stream.getdents) stream.getdents = null; try { if (stream.stream_ops.close) { stream.stream_ops.close(stream); } } catch (e) { throw e; } finally { FS.closeStream(stream.fd); } stream.fd = null; }, isClosed: function(stream) { return stream.fd === null; }, llseek: function(stream, offset, whence) { if (FS.isClosed(stream)) { throw new FS.ErrnoError(8); } if (!stream.seekable || !stream.stream_ops.llseek) { throw new FS.ErrnoError(70); } if (whence != 0 && whence != 1 && whence != 2) { throw new FS.ErrnoError(28); } stream.position = stream.stream_ops.llseek(stream, offset, whence); stream.ungotten = []; return stream.position; }, read: function(stream, buffer2, offset, length, position) { offset >>>= 0; if (length < 0 || position < 0) { throw new FS.ErrnoError(28); } if (FS.isClosed(stream)) { throw new FS.ErrnoError(8); } if ((stream.flags & 2097155) === 1) { throw new FS.ErrnoError(8); } if (FS.isDir(stream.node.mode)) { throw new FS.ErrnoError(31); } if (!stream.stream_ops.read) { throw new FS.ErrnoError(28); } var seeking = typeof position !== "undefined"; if (!seeking) { position = stream.position; } else if (!stream.seekable) { throw new FS.ErrnoError(70); } var bytesRead = stream.stream_ops.read(stream, buffer2, offset, length, position); if (!seeking) stream.position += bytesRead; return bytesRead; }, write: function(stream, buffer2, offset, length, position, canOwn) { offset >>>= 0; if (length < 0 || position < 0) { throw new FS.ErrnoError(28); } if (FS.isClosed(stream)) { throw new FS.ErrnoError(8); } if ((stream.flags & 2097155) === 0) { throw new FS.ErrnoError(8); } if (FS.isDir(stream.node.mode)) { throw new FS.ErrnoError(31); } if (!stream.stream_ops.write) { throw new FS.ErrnoError(28); } if (stream.seekable && stream.flags & 1024) { FS.llseek(stream, 0, 2); } var seeking = typeof position !== "undefined"; if (!seeking) { position = stream.position; } else if (!stream.seekable) { throw new FS.ErrnoError(70); } var bytesWritten = stream.stream_ops.write(stream, buffer2, offset, length, position, canOwn); if (!seeking) stream.position += bytesWritten; try { if (stream.path && FS.trackingDelegate["onWriteToFile"]) FS.trackingDelegate["onWriteToFile"](stream.path); } catch (e) { err("FS.trackingDelegate['onWriteToFile']('" + stream.path + "') threw an exception: " + e.message); } return bytesWritten; }, allocate: function(stream, offset, length) { if (FS.isClosed(stream)) { throw new FS.ErrnoError(8); } if (offset < 0 || length <= 0) { throw new FS.ErrnoError(28); } if ((stream.flags & 2097155) === 0) { throw new FS.ErrnoError(8); } if (!FS.isFile(stream.node.mode) && !FS.isDir(stream.node.mode)) { throw new FS.ErrnoError(43); } if (!stream.stream_ops.allocate) { throw new FS.ErrnoError(138); } stream.stream_ops.allocate(stream, offset, length); }, mmap: function(stream, address, length, position, prot, flags) { address >>>= 0; if ((prot & 2) !== 0 && (flags & 2) === 0 && (stream.flags & 2097155) !== 2) { throw new FS.ErrnoError(2); } if ((stream.flags & 2097155) === 1) { throw new FS.ErrnoError(2); } if (!stream.stream_ops.mmap) { throw new FS.ErrnoError(43); } return stream.stream_ops.mmap(stream, address, length, position, prot, flags); }, msync: function(stream, buffer2, offset, length, mmapFlags) { offset >>>= 0; if (!stream || !stream.stream_ops.msync) { return 0; } return stream.stream_ops.msync(stream, buffer2, offset, length, mmapFlags); }, munmap: function(stream) { return 0; }, ioctl: function(stream, cmd, arg) { if (!stream.stream_ops.ioctl) { throw new FS.ErrnoError(59); } return stream.stream_ops.ioctl(stream, cmd, arg); }, readFile: function(path, opts) { opts = opts || {}; opts.flags = opts.flags || 0; opts.encoding = opts.encoding || "binary"; if (opts.encoding !== "utf8" && opts.encoding !== "binary") { throw new Error('Invalid encoding type "' + opts.encoding + '"'); } var ret; var stream = FS.open(path, opts.flags); var stat = FS.stat(path); var length = stat.size; var buf = new Uint8Array(length); FS.read(stream, buf, 0, length, 0); if (opts.encoding === "utf8") { ret = UTF8ArrayToString(buf, 0); } else if (opts.encoding === "binary") { ret = buf; } FS.close(stream); return ret; }, writeFile: function(path, data, opts) { opts = opts || {}; opts.flags = opts.flags || 577; var stream = FS.open(path, opts.flags, opts.mode); if (typeof data === "string") { var buf = new Uint8Array(lengthBytesUTF8(data) + 1); var actualNumBytes = stringToUTF8Array(data, buf, 0, buf.length); FS.write(stream, buf, 0, actualNumBytes, void 0, opts.canOwn); } else if (ArrayBuffer.isView(data)) { FS.write(stream, data, 0, data.byteLength, void 0, opts.canOwn); } else { throw new Error("Unsupported data type"); } FS.close(stream); }, cwd: function() { return FS.currentPath; }, chdir: function(path) { var lookup = FS.lookupPath(path, { follow: true }); if (lookup.node === null) { throw new FS.ErrnoError(44); } if (!FS.isDir(lookup.node.mode)) { throw new FS.ErrnoError(54); } var errCode = FS.nodePermissions(lookup.node, "x"); if (errCode) { throw new FS.ErrnoError(errCode); } FS.currentPath = lookup.path; }, createDefaultDirectories: function() { FS.mkdir("/tmp"); FS.mkdir("/home"); FS.mkdir("/home/web_user"); }, createDefaultDevices: function() { FS.mkdir("/dev"); FS.registerDevice(FS.makedev(1, 3), { read: function() { return 0; }, write: function(stream, buffer2, offset, length, pos) { return length; } }); FS.mkdev("/dev/null", FS.makedev(1, 3)); TTY.register(FS.makedev(5, 0), TTY.default_tty_ops); TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops); FS.mkdev("/dev/tty", FS.makedev(5, 0)); FS.mkdev("/dev/tty1", FS.makedev(6, 0)); var random_device = getRandomDevice(); FS.createDevice("/dev", "random", random_device); FS.createDevice("/dev", "urandom", random_device); FS.mkdir("/dev/shm"); FS.mkdir("/dev/shm/tmp"); }, createSpecialDirectories: function() { FS.mkdir("/proc"); FS.mkdir("/proc/self"); FS.mkdir("/proc/self/fd"); FS.mount({ mount: function() { var node = FS.createNode("/proc/self", "fd", 16384 | 511, 73); node.node_ops = { lookup: function(parent, name2) { var fd = +name2; var stream = FS.getStream(fd); if (!stream) throw new FS.ErrnoError(8); var ret = { parent: null, mount: { mountpoint: "fake" }, node_ops: { readlink: function() { return stream.path; } } }; ret.parent = ret; return ret; } }; return node; } }, {}, "/proc/self/fd"); }, createStandardStreams: function() { if (Module["stdin"]) { FS.createDevice("/dev", "stdin", Module["stdin"]); } else { FS.symlink("/dev/tty", "/dev/stdin"); } if (Module["stdout"]) { FS.createDevice("/dev", "stdout", null, Module["stdout"]); } else { FS.symlink("/dev/tty", "/dev/stdout"); } if (Module["stderr"]) { FS.createDevice("/dev", "stderr", null, Module["stderr"]); } else { FS.symlink("/dev/tty1", "/dev/stderr"); } var stdin = FS.open("/dev/stdin", 0); var stdout = FS.open("/dev/stdout", 1); var stderr = FS.open("/dev/stderr", 1); }, ensureErrnoError: function() { if (FS.ErrnoError) return; FS.ErrnoError = function ErrnoError(errno, node) { this.node = node; this.setErrno = function(errno2) { this.errno = errno2; }; this.setErrno(errno); this.message = "FS error"; }; FS.ErrnoError.prototype = new Error(); FS.ErrnoError.prototype.constructor = FS.ErrnoError; [44].forEach(function(code) { FS.genericErrors[code] = new FS.ErrnoError(code); FS.genericErrors[code].stack = ""; }); }, staticInit: function() { FS.ensureErrnoError(); FS.nameTable = new Array(4096); FS.mount(MEMFS, {}, "/"); FS.createDefaultDirectories(); FS.createDefaultDevices(); FS.createSpecialDirectories(); FS.filesystems = { "MEMFS": MEMFS }; }, init: function(input, output, error) { FS.init.initialized = true; FS.ensureErrnoError(); Module["stdin"] = input || Module["stdin"]; Module["stdout"] = output || Module["stdout"]; Module["stderr"] = error || Module["stderr"]; FS.createStandardStreams(); }, quit: function() { FS.init.initialized = false; var fflush = Module["_fflush"]; if (fflush) fflush(0); for (var i = 0; i < FS.streams.length; i++) { var stream = FS.streams[i]; if (!stream) { continue; } FS.close(stream); } }, getMode: function(canRead, canWrite) { var mode = 0; if (canRead) mode |= 292 | 73; if (canWrite) mode |= 146; return mode; }, findObject: function(path, dontResolveLastLink) { var ret = FS.analyzePath(path, dontResolveLastLink); if (ret.exists) { return ret.object; } else { return null; } }, analyzePath: function(path, dontResolveLastLink) { try { var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); path = lookup.path; } catch (e) { } var ret = { isRoot: false, exists: false, error: 0, name: null, path: null, object: null, parentExists: false, parentPath: null, parentObject: null }; try { var lookup = FS.lookupPath(path, { parent: true }); ret.parentExists = true; ret.parentPath = lookup.path; ret.parentObject = lookup.node; ret.name = PATH.basename(path); lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); ret.exists = true; ret.path = lookup.path; ret.object = lookup.node; ret.name = lookup.node.name; ret.isRoot = lookup.path === "/"; } catch (e) { ret.error = e.errno; } return ret; }, createPath: function(parent, path, canRead, canWrite) { parent = typeof parent === "string" ? parent : FS.getPath(parent); var parts = path.split("/").reverse(); while (parts.length) { var part = parts.pop(); if (!part) continue; var current = PATH.join2(parent, part); try { FS.mkdir(current); } catch (e) { } parent = current; } return current; }, createFile: function(parent, name2, properties, canRead, canWrite) { var path = PATH.join2(typeof parent === "string" ? parent : FS.getPath(parent), name2); var mode = FS.getMode(canRead, canWrite); return FS.create(path, mode); }, createDataFile: function(parent, name2, data, canRead, canWrite, canOwn) { var path = name2 ? PATH.join2(typeof parent === "string" ? parent : FS.getPath(parent), name2) : parent; var mode = FS.getMode(canRead, canWrite); var node = FS.create(path, mode); if (data) { if (typeof data === "string") { var arr = new Array(data.length); for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i); data = arr; } FS.chmod(node, mode | 146); var stream = FS.open(node, 577); FS.write(stream, data, 0, data.length, 0, canOwn); FS.close(stream); FS.chmod(node, mode); } return node; }, createDevice: function(parent, name2, input, output) { var path = PATH.join2(typeof parent === "string" ? parent : FS.getPath(parent), name2); var mode = FS.getMode(!!input, !!output); if (!FS.createDevice.major) FS.createDevice.major = 64; var dev = FS.makedev(FS.createDevice.major++, 0); FS.registerDevice(dev, { open: function(stream) { stream.seekable = false; }, close: function(stream) { if (output && output.buffer && output.buffer.length) { output(10); } }, read: function(stream, buffer2, offset, length, pos) { var bytesRead = 0; for (var i = 0; i < length; i++) { var result; try { result = input(); } catch (e) { throw new FS.ErrnoError(29); } if (result === void 0 && bytesRead === 0) { throw new FS.ErrnoError(6); } if (result === null || result === void 0) break; bytesRead++; buffer2[offset + i] = result; } if (bytesRead) { stream.node.timestamp = Date.now(); } return bytesRead; }, write: function(stream, buffer2, offset, length, pos) { for (var i = 0; i < length; i++) { try { output(buffer2[offset + i]); } catch (e) { throw new FS.ErrnoError(29); } } if (length) { stream.node.timestamp = Date.now(); } return i; } }); return FS.mkdev(path, mode, dev); }, forceLoadFile: function(obj) { if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true; if (typeof XMLHttpRequest !== "undefined") { throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread."); } else if (read_) { try { obj.contents = intArrayFromString(read_(obj.url), true); obj.usedBytes = obj.contents.length; } catch (e) { throw new FS.ErrnoError(29); } } else { throw new Error("Cannot load without read() or XMLHttpRequest."); } }, createLazyFile: function(parent, name2, url, canRead, canWrite) { function LazyUint8Array() { this.lengthKnown = false; this.chunks = []; } LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) { if (idx > this.length - 1 || idx < 0) { return void 0; } var chunkOffset = idx % this.chunkSize; var chunkNum = idx / this.chunkSize | 0; return this.getter(chunkNum)[chunkOffset]; }; LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) { this.getter = getter; }; LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() { var xhr = new XMLHttpRequest(); xhr.open("HEAD", url, false); xhr.send(null); if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status); var datalength = Number(xhr.getResponseHeader("Content-length")); var header; var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes"; var usesGzip = (header = xhr.getResponseHeader("Content-Encoding")) && header === "gzip"; var chunkSize = 1024 * 1024; if (!hasByteServing) chunkSize = datalength; var doXHR = function(from, to) { if (from > to) throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!"); if (to > datalength - 1) throw new Error("only " + datalength + " bytes available! programmer error!"); var xhr2 = new XMLHttpRequest(); xhr2.open("GET", url, false); if (datalength !== chunkSize) xhr2.setRequestHeader("Range", "bytes=" + from + "-" + to); if (typeof Uint8Array != "undefined") xhr2.responseType = "arraybuffer"; if (xhr2.overrideMimeType) { xhr2.overrideMimeType("text/plain; charset=x-user-defined"); } xhr2.send(null); if (!(xhr2.status >= 200 && xhr2.status < 300 || xhr2.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr2.status); if (xhr2.response !== void 0) { return new Uint8Array(xhr2.response || []); } else { return intArrayFromString(xhr2.responseText || "", true); } }; var lazyArray2 = this; lazyArray2.setDataGetter(function(chunkNum) { var start = chunkNum * chunkSize; var end = (chunkNum + 1) * chunkSize - 1; end = Math.min(end, datalength - 1); if (typeof lazyArray2.chunks[chunkNum] === "undefined") { lazyArray2.chunks[chunkNum] = doXHR(start, end); } if (typeof lazyArray2.chunks[chunkNum] === "undefined") throw new Error("doXHR failed!"); return lazyArray2.chunks[chunkNum]; }); if (usesGzip || !datalength) { chunkSize = datalength = 1; datalength = this.getter(0).length; chunkSize = datalength; out("LazyFiles on gzip forces download of the whole file when length is accessed"); } this._length = datalength; this._chunkSize = chunkSize; this.lengthKnown = true; }; if (typeof XMLHttpRequest !== "undefined") { if (!ENVIRONMENT_IS_WORKER) throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc"; var lazyArray = new LazyUint8Array(); Object.defineProperties(lazyArray, { length: { get: function() { if (!this.lengthKnown) { this.cacheLength(); } return this._length; } }, chunkSize: { get: function() { if (!this.lengthKnown) { this.cacheLength(); } return this._chunkSize; } } }); var properties = { isDevice: false, contents: lazyArray }; } else { var properties = { isDevice: false, url }; } var node = FS.createFile(parent, name2, properties, canRead, canWrite); if (properties.contents) { node.contents = properties.contents; } else if (properties.url) { node.contents = null; node.url = properties.url; } Object.defineProperties(node, { usedBytes: { get: function() { return this.contents.length; } } }); var stream_ops = {}; var keys = Object.keys(node.stream_ops); keys.forEach(function(key2) { var fn = node.stream_ops[key2]; stream_ops[key2] = function forceLoadLazyFile() { FS.forceLoadFile(node); return fn.apply(null, arguments); }; }); stream_ops.read = function stream_ops_read(stream, buffer2, offset, length, position) { FS.forceLoadFile(node); var contents = stream.node.contents; if (position >= contents.length) return 0; var size = Math.min(contents.length - position, length); if (contents.slice) { for (var i = 0; i < size; i++) { buffer2[offset + i] = contents[position + i]; } } else { for (var i = 0; i < size; i++) { buffer2[offset + i] = contents.get(position + i); } } return size; }; node.stream_ops = stream_ops; return node; }, createPreloadedFile: function(parent, name2, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn, preFinish) { Browser.init(); var fullname = name2 ? PATH_FS.resolve(PATH.join2(parent, name2)) : parent; function processData(byteArray) { function finish(byteArray2) { if (preFinish) preFinish(); if (!dontCreateFile) { FS.createDataFile(parent, name2, byteArray2, canRead, canWrite, canOwn); } if (onload) onload(); removeRunDependency(); } var handled = false; Module["preloadPlugins"].forEach(function(plugin) { if (handled) return; if (plugin["canHandle"](fullname)) { plugin["handle"](byteArray, fullname, finish, function() { if (onerror) onerror(); removeRunDependency(); }); handled = true; } }); if (!handled) finish(byteArray); } addRunDependency(); if (typeof url == "string") { Browser.asyncLoad(url, function(byteArray) { processData(byteArray); }, onerror); } else { processData(url); } }, indexedDB: function() { return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; }, DB_NAME: function() { return "EM_FS_" + window.location.pathname; }, DB_VERSION: 20, DB_STORE_NAME: "FILE_DATA", saveFilesToDB: function(paths, onload, onerror) { onload = onload || function() { }; onerror = onerror || function() { }; var indexedDB = FS.indexedDB(); try { var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION); } catch (e) { return onerror(e); } openRequest.onupgradeneeded = function openRequest_onupgradeneeded() { out("creating db"); var db = openRequest.result; db.createObjectStore(FS.DB_STORE_NAME); }; openRequest.onsuccess = function openRequest_onsuccess() { var db = openRequest.result; var transaction = db.transaction([FS.DB_STORE_NAME], "readwrite"); var files = transaction.objectStore(FS.DB_STORE_NAME); var ok = 0, fail = 0, total = paths.length; function finish() { if (fail == 0) onload(); else onerror(); } paths.forEach(function(path) { var putRequest = files.put(FS.analyzePath(path).object.contents, path); putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish(); }; putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish(); }; }); transaction.onerror = onerror; }; openRequest.onerror = onerror; }, loadFilesFromDB: function(paths, onload, onerror) { onload = onload || function() { }; onerror = onerror || function() { }; var indexedDB = FS.indexedDB(); try { var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION); } catch (e) { return onerror(e); } openRequest.onupgradeneeded = onerror; openRequest.onsuccess = function openRequest_onsuccess() { var db = openRequest.result; try { var transaction = db.transaction([FS.DB_STORE_NAME], "readonly"); } catch (e) { onerror(e); return; } var files = transaction.objectStore(FS.DB_STORE_NAME); var ok = 0, fail = 0, total = paths.length; function finish() { if (fail == 0) onload(); else onerror(); } paths.forEach(function(path) { var getRequest = files.get(path); getRequest.onsuccess = function getRequest_onsuccess() { if (FS.analyzePath(path).exists) { FS.unlink(path); } FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true); ok++; if (ok + fail == total) finish(); }; getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish(); }; }); transaction.onerror = onerror; }; openRequest.onerror = onerror; } }; var SYSCALLS = { mappings: {}, DEFAULT_POLLMASK: 5, umask: 511, calculateAt: function(dirfd, path) { if (path[0] !== "/") { var dir; if (dirfd === -100) { dir = FS.cwd(); } else { var dirstream = FS.getStream(dirfd); if (!dirstream) throw new FS.ErrnoError(8); dir = dirstream.path; } path = PATH.join2(dir, path); } return path; }, doStat: function(func, path, buf) { try { var stat = func(path); } catch (e) { if (e && e.node && PATH.normalize(path) !== PATH.normalize(FS.getPath(e.node))) { return -54; } throw e; } HEAP32[buf >>> 2] = stat.dev; HEAP32[buf + 4 >>> 2] = 0; HEAP32[buf + 8 >>> 2] = stat.ino; HEAP32[buf + 12 >>> 2] = stat.mode; HEAP32[buf + 16 >>> 2] = stat.nlink; HEAP32[buf + 20 >>> 2] = stat.uid; HEAP32[buf + 24 >>> 2] = stat.gid; HEAP32[buf + 28 >>> 2] = stat.rdev; HEAP32[buf + 32 >>> 2] = 0; tempI64 = [stat.size >>> 0, (tempDouble = stat.size, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[buf + 40 >>> 2] = tempI64[0], HEAP32[buf + 44 >>> 2] = tempI64[1]; HEAP32[buf + 48 >>> 2] = 4096; HEAP32[buf + 52 >>> 2] = stat.blocks; HEAP32[buf + 56 >>> 2] = stat.atime.getTime() / 1e3 | 0; HEAP32[buf + 60 >>> 2] = 0; HEAP32[buf + 64 >>> 2] = stat.mtime.getTime() / 1e3 | 0; HEAP32[buf + 68 >>> 2] = 0; HEAP32[buf + 72 >>> 2] = stat.ctime.getTime() / 1e3 | 0; HEAP32[buf + 76 >>> 2] = 0; tempI64 = [stat.ino >>> 0, (tempDouble = stat.ino, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[buf + 80 >>> 2] = tempI64[0], HEAP32[buf + 84 >>> 2] = tempI64[1]; return 0; }, doMsync: function(addr, stream, len, flags, offset) { var buffer2 = HEAPU8.slice(addr, addr + len); FS.msync(stream, buffer2, offset, len, flags); }, doMkdir: function(path, mode) { path = PATH.normalize(path); if (path[path.length - 1] === "/") path = path.substr(0, path.length - 1); FS.mkdir(path, mode, 0); return 0; }, doMknod: function(path, mode, dev) { switch (mode & 61440) { case 32768: case 8192: case 24576: case 4096: case 49152: break; default: return -28; } FS.mknod(path, mode, dev); return 0; }, doReadlink: function(path, buf, bufsize) { if (bufsize <= 0) return -28; var ret = FS.readlink(path); var len = Math.min(bufsize, lengthBytesUTF8(ret)); var endChar = HEAP8[buf + len >>> 0]; stringToUTF8(ret, buf, bufsize + 1); HEAP8[buf + len >>> 0] = endChar; return len; }, doAccess: function(path, amode) { if (amode & ~7) { return -28; } var node; var lookup = FS.lookupPath(path, { follow: true }); node = lookup.node; if (!node) { return -44; } var perms = ""; if (amode & 4) perms += "r"; if (amode & 2) perms += "w"; if (amode & 1) perms += "x"; if (perms && FS.nodePermissions(node, perms)) { return -2; } return 0; }, doDup: function(path, flags, suggestFD) { var suggest = FS.getStream(suggestFD); if (suggest) FS.close(suggest); return FS.open(path, flags, 0, suggestFD, suggestFD).fd; }, doReadv: function(stream, iov, iovcnt, offset) { var ret = 0; for (var i = 0; i < iovcnt; i++) { var ptr = HEAP32[iov + i * 8 >>> 2]; var len = HEAP32[iov + (i * 8 + 4) >>> 2]; var curr = FS.read(stream, HEAP8, ptr, len, offset); if (curr < 0) return -1; ret += curr; if (curr < len) break; } return ret; }, doWritev: function(stream, iov, iovcnt, offset) { var ret = 0; for (var i = 0; i < iovcnt; i++) { var ptr = HEAP32[iov + i * 8 >>> 2]; var len = HEAP32[iov + (i * 8 + 4) >>> 2]; var curr = FS.write(stream, HEAP8, ptr, len, offset); if (curr < 0) return -1; ret += curr; } return ret; }, varargs: void 0, get: function() { SYSCALLS.varargs += 4; var ret = HEAP32[SYSCALLS.varargs - 4 >>> 2]; return ret; }, getStr: function(ptr) { var ret = UTF8ToString(ptr); return ret; }, getStreamFromFD: function(fd) { var stream = FS.getStream(fd); if (!stream) throw new FS.ErrnoError(8); return stream; }, get64: function(low, high) { return low; } }; function ___sys_fcntl64(fd, cmd, varargs) { SYSCALLS.varargs = varargs; try { var stream = SYSCALLS.getStreamFromFD(fd); switch (cmd) { case 0: { var arg = SYSCALLS.get(); if (arg < 0) { return -28; } var newStream; newStream = FS.open(stream.path, stream.flags, 0, arg); return newStream.fd; } case 1: case 2: return 0; case 3: return stream.flags; case 4: { var arg = SYSCALLS.get(); stream.flags |= arg; return 0; } case 12: { var arg = SYSCALLS.get(); var offset = 0; HEAP16[arg + offset >>> 1] = 2; return 0; } case 13: case 14: return 0; case 16: case 8: return -28; case 9: setErrNo(28); return -1; default: { return -28; } } } catch (e) { if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); return -e.errno; } } function ___sys_ioctl(fd, op, varargs) { SYSCALLS.varargs = varargs; try { var stream = SYSCALLS.getStreamFromFD(fd); switch (op) { case 21509: case 21505: { if (!stream.tty) return -59; return 0; } case 21510: case 21511: case 21512: case 21506: case 21507: case 21508: { if (!stream.tty) return -59; return 0; } case 21519: { if (!stream.tty) return -59; var argp = SYSCALLS.get(); HEAP32[argp >>> 2] = 0; return 0; } case 21520: { if (!stream.tty) return -59; return -28; } case 21531: { var argp = SYSCALLS.get(); return FS.ioctl(stream, op, argp); } case 21523: { if (!stream.tty) return -59; return 0; } case 21524: { if (!stream.tty) return -59; return 0; } default: abort("bad ioctl syscall " + op); } } catch (e) { if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); return -e.errno; } } function ___sys_open(path, flags, varargs) { SYSCALLS.varargs = varargs; try { var pathname = SYSCALLS.getStr(path); var mode = SYSCALLS.get(); var stream = FS.open(pathname, flags, mode); return stream.fd; } catch (e) { if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); return -e.errno; } } var tupleRegistrations = {}; function runDestructors(destructors) { while (destructors.length) { var ptr = destructors.pop(); var del = destructors.pop(); del(ptr); } } function simpleReadValueFromPointer(pointer) { return this["fromWireType"](HEAPU32[pointer >>> 2]); } var awaitingDependencies = {}; var registeredTypes = {}; var typeDependencies = {}; var char_0 = 48; var char_9 = 57; function makeLegalFunctionName(name2) { if (name2 === void 0) { return "_unknown"; } name2 = name2.replace(/[^a-zA-Z0-9_]/g, "$"); var f = name2.charCodeAt(0); if (f >= char_0 && f <= char_9) { return "_" + name2; } else { return name2; } } function createNamedFunction(name2, body) { name2 = makeLegalFunctionName(name2); return new Function("body", "return function " + name2 + '() {\n "use strict"; return body.apply(this, arguments);\n};\n')(body); } function extendError(baseErrorType, errorName) { var errorClass = createNamedFunction(errorName, function(message) { this.name = errorName; this.message = message; var stack = new Error(message).stack; if (stack !== void 0) { this.stack = this.toString() + "\n" + stack.replace(/^Error(:[^\n]*)?\n/, ""); } }); errorClass.prototype = Object.create(baseErrorType.prototype); errorClass.prototype.constructor = errorClass; errorClass.prototype.toString = function() { if (this.message === void 0) { return this.name; } else { return this.name + ": " + this.message; } }; return errorClass; } var InternalError = void 0; function throwInternalError(message) { throw new InternalError(message); } function whenDependentTypesAreResolved(myTypes, dependentTypes, getTypeConverters) { myTypes.forEach(function(type) { typeDependencies[type] = dependentTypes; }); function onComplete(typeConverters2) { var myTypeConverters = getTypeConverters(typeConverters2); if (myTypeConverters.length !== myTypes.length) { throwInternalError("Mismatched type converter count"); } for (var i = 0; i < myTypes.length; ++i) { registerType(myTypes[i], myTypeConverters[i]); } } var typeConverters = new Array(dependentTypes.length); var unregisteredTypes = []; var registered = 0; dependentTypes.forEach(function(dt, i) { if (registeredTypes.hasOwnProperty(dt)) { typeConverters[i] = registeredTypes[dt]; } else { unregisteredTypes.push(dt); if (!awaitingDependencies.hasOwnProperty(dt)) { awaitingDependencies[dt] = []; } awaitingDependencies[dt].push(function() { typeConverters[i] = registeredTypes[dt]; ++registered; if (registered === unregisteredTypes.length) { onComplete(typeConverters); } }); } }); if (unregisteredTypes.length === 0) { onComplete(typeConverters); } } function __embind_finalize_value_array(rawTupleType) { var reg = tupleRegistrations[rawTupleType]; delete tupleRegistrations[rawTupleType]; var elements = reg.elements; var elementsLength = elements.length; var elementTypes = elements.map(function(elt) { return elt.getterReturnType; }).concat(elements.map(function(elt) { return elt.setterArgumentType; })); var rawConstructor = reg.rawConstructor; var rawDestructor = reg.rawDestructor; whenDependentTypesAreResolved([rawTupleType], elementTypes, function(elementTypes2) { elements.forEach(function(elt, i) { var getterReturnType = elementTypes2[i]; var getter = elt.getter; var getterContext = elt.getterContext; var setterArgumentType = elementTypes2[i + elementsLength]; var setter = elt.setter; var setterContext = elt.setterContext; elt.read = function(ptr) { return getterReturnType["fromWireType"](getter(getterContext, ptr)); }; elt.write = function(ptr, o) { var destructors = []; setter(setterContext, ptr, setterArgumentType["toWireType"](destructors, o)); runDestructors(destructors); }; }); return [{ name: reg.name, "fromWireType": function(ptr) { var rv = new Array(elementsLength); for (var i = 0; i < elementsLength; ++i) { rv[i] = elements[i].read(ptr); } rawDestructor(ptr); return rv; }, "toWireType": function(destructors, o) { if (elementsLength !== o.length) { throw new TypeError("Incorrect number of tuple elements for " + reg.name + ": expected=" + elementsLength + ", actual=" + o.length); } var ptr = rawConstructor(); for (var i = 0; i < elementsLength; ++i) { elements[i].write(ptr, o[i]); } if (destructors !== null) { destructors.push(rawDestructor, ptr); } return ptr; }, "argPackAdvance": 8, "readValueFromPointer": simpleReadValueFromPointer, destructorFunction: rawDestructor }]; }); } var structRegistrations = {}; function __embind_finalize_value_object(structType) { var reg = structRegistrations[structType]; delete structRegistrations[structType]; var rawConstructor = reg.rawConstructor; var rawDestructor = reg.rawDestructor; var fieldRecords = reg.fields; var fieldTypes = fieldRecords.map(function(field) { return field.getterReturnType; }).concat(fieldRecords.map(function(field) { return field.setterArgumentType; })); whenDependentTypesAreResolved([structType], fieldTypes, function(fieldTypes2) { var fields = {}; fieldRecords.forEach(function(field, i) { var fieldName = field.fieldName; var getterReturnType = fieldTypes2[i]; var getter = field.getter; var getterContext = field.getterContext; var setterArgumentType = fieldTypes2[i + fieldRecords.length]; var setter = field.setter; var setterContext = field.setterContext; fields[fieldName] = { read: function(ptr) { return getterReturnType["fromWireType"](getter(getterContext, ptr)); }, write: function(ptr, o) { var destructors = []; setter(setterContext, ptr, setterArgumentType["toWireType"](destructors, o)); runDestructors(destructors); } }; }); return [{ name: reg.name, "fromWireType": function(ptr) { var rv = {}; for (var i in fields) { rv[i] = fields[i].read(ptr); } rawDestructor(ptr); return rv; }, "toWireType": function(destructors, o) { for (var fieldName in fields) { if (!(fieldName in o)) { throw new TypeError('Missing field: "' + fieldName + '"'); } } var ptr = rawConstructor(); for (fieldName in fields) { fields[fieldName].write(ptr, o[fieldName]); } if (destructors !== null) { destructors.push(rawDestructor, ptr); } return ptr; }, "argPackAdvance": 8, "readValueFromPointer": simpleReadValueFromPointer, destructorFunction: rawDestructor }]; }); } function getShiftFromSize(size) { switch (size) { case 1: return 0; case 2: return 1; case 4: return 2; case 8: return 3; default: throw new TypeError("Unknown type size: " + size); } } function embind_init_charCodes() { var codes = new Array(256); for (var i = 0; i < 256; ++i) { codes[i] = String.fromCharCode(i); } embind_charCodes = codes; } var embind_charCodes = void 0; function readLatin1String(ptr) { var ret = ""; var c = ptr; while (HEAPU8[c >>> 0]) { ret += embind_charCodes[HEAPU8[c++ >>> 0]]; } return ret; } var BindingError = void 0; function throwBindingError(message) { throw new BindingError(message); } function registerType(rawType, registeredInstance, options) { options = options || {}; if (!("argPackAdvance" in registeredInstance)) { throw new TypeError("registerType registeredInstance requires argPackAdvance"); } var name2 = registeredInstance.name; if (!rawType) { throwBindingError('type "' + name2 + '" must have a positive integer typeid pointer'); } if (registeredTypes.hasOwnProperty(rawType)) { if (options.ignoreDuplicateRegistrations) { return; } else { throwBindingError("Cannot register type '" + name2 + "' twice"); } } registeredTypes[rawType] = registeredInstance; delete typeDependencies[rawType]; if (awaitingDependencies.hasOwnProperty(rawType)) { var callbacks = awaitingDependencies[rawType]; delete awaitingDependencies[rawType]; callbacks.forEach(function(cb) { cb(); }); } } function __embind_register_bool(rawType, name2, size, trueValue, falseValue) { var shift = getShiftFromSize(size); name2 = readLatin1String(name2); registerType(rawType, { name: name2, "fromWireType": function(wt) { return !!wt; }, "toWireType": function(destructors, o) { return o ? trueValue : falseValue; }, "argPackAdvance": 8, "readValueFromPointer": function(pointer) { var heap; if (size === 1) { heap = HEAP8; } else if (size === 2) { heap = HEAP16; } else if (size === 4) { heap = HEAP32; } else { throw new TypeError("Unknown boolean type size: " + name2); } return this["fromWireType"](heap[pointer >>> shift]); }, destructorFunction: null }); } function ClassHandle_isAliasOf(other) { if (!(this instanceof ClassHandle)) { return false; } if (!(other instanceof ClassHandle)) { return false; } var leftClass = this.$$.ptrType.registeredClass; var left = this.$$.ptr; var rightClass = other.$$.ptrType.registeredClass; var right = other.$$.ptr; while (leftClass.baseClass) { left = leftClass.upcast(left); leftClass = leftClass.baseClass; } while (rightClass.baseClass) { right = rightClass.upcast(right); rightClass = rightClass.baseClass; } return leftClass === rightClass && left === right; } function shallowCopyInternalPointer(o) { return { count: o.count, deleteScheduled: o.deleteScheduled, preservePointerOnDelete: o.preservePointerOnDelete, ptr: o.ptr, ptrType: o.ptrType, smartPtr: o.smartPtr, smartPtrType: o.smartPtrType }; } function throwInstanceAlreadyDeleted(obj) { function getInstanceTypeName(handle) { return handle.$$.ptrType.registeredClass.name; } throwBindingError(getInstanceTypeName(obj) + " instance already deleted"); } var finalizationGroup = false; function detachFinalizer(handle) { } function runDestructor($$) { if ($$.smartPtr) { $$.smartPtrType.rawDestructor($$.smartPtr); } else { $$.ptrType.registeredClass.rawDestructor($$.ptr); } } function releaseClassHandle($$) { $$.count.value -= 1; var toDelete = $$.count.value === 0; if (toDelete) { runDestructor($$); } } function attachFinalizer(handle) { if (typeof FinalizationGroup === "undefined") { attachFinalizer = function(handle2) { return handle2; }; return handle; } finalizationGroup = new FinalizationGroup(function(iter) { for (var result = iter.next(); !result.done; result = iter.next()) { var $$ = result.value; if (!$$.ptr) { console.warn("object already deleted: " + $$.ptr); } else { releaseClassHandle($$); } } }); attachFinalizer = function(handle2) { finalizationGroup.register(handle2, handle2.$$, handle2.$$); return handle2; }; detachFinalizer = function(handle2) { finalizationGroup.unregister(handle2.$$); }; return attachFinalizer(handle); } function ClassHandle_clone() { if (!this.$$.ptr) { throwInstanceAlreadyDeleted(this); } if (this.$$.preservePointerOnDelete) { this.$$.count.value += 1; return this; } else { var clone = attachFinalizer(Object.create(Object.getPrototypeOf(this), { $$: { value: shallowCopyInternalPointer(this.$$) } })); clone.$$.count.value += 1; clone.$$.deleteScheduled = false; return clone; } } function ClassHandle_delete() { if (!this.$$.ptr) { throwInstanceAlreadyDeleted(this); } if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) { throwBindingError("Object already scheduled for deletion"); } detachFinalizer(this); releaseClassHandle(this.$$); if (!this.$$.preservePointerOnDelete) { this.$$.smartPtr = void 0; this.$$.ptr = void 0; } } function ClassHandle_isDeleted() { return !this.$$.ptr; } var delayFunction = void 0; var deletionQueue = []; function flushPendingDeletes() { while (deletionQueue.length) { var obj = deletionQueue.pop(); obj.$$.deleteScheduled = false; obj["delete"](); } } function ClassHandle_deleteLater() { if (!this.$$.ptr) { throwInstanceAlreadyDeleted(this); } if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) { throwBindingError("Object already scheduled for deletion"); } deletionQueue.push(this); if (deletionQueue.length === 1 && delayFunction) { delayFunction(flushPendingDeletes); } this.$$.deleteScheduled = true; return this; } function init_ClassHandle() { ClassHandle.prototype["isAliasOf"] = ClassHandle_isAliasOf; ClassHandle.prototype["clone"] = ClassHandle_clone; ClassHandle.prototype["delete"] = ClassHandle_delete; ClassHandle.prototype["isDeleted"] = ClassHandle_isDeleted; ClassHandle.prototype["deleteLater"] = ClassHandle_deleteLater; } function ClassHandle() { } var registeredPointers = {}; function ensureOverloadTable(proto, methodName, humanName) { if (proto[methodName].overloadTable === void 0) { var prevFunc = proto[methodName]; proto[methodName] = function() { if (!proto[methodName].overloadTable.hasOwnProperty(arguments.length)) { throwBindingError("Function '" + humanName + "' called with an invalid number of arguments (" + arguments.length + ") - expects one of (" + proto[methodName].overloadTable + ")!"); } return proto[methodName].overloadTable[arguments.length].apply(this, arguments); }; proto[methodName].overloadTable = []; proto[methodName].overloadTable[prevFunc.argCount] = prevFunc; } } function exposePublicSymbol(name2, value, numArguments) { if (Module.hasOwnProperty(name2)) { if (numArguments === void 0 || Module[name2].overloadTable !== void 0 && Module[name2].overloadTable[numArguments] !== void 0) { throwBindingError("Cannot register public name '" + name2 + "' twice"); } ensureOverloadTable(Module, name2, name2); if (Module.hasOwnProperty(numArguments)) { throwBindingError("Cannot register multiple overloads of a function with the same number of arguments (" + numArguments + ")!"); } Module[name2].overloadTable[numArguments] = value; } else { Module[name2] = value; if (numArguments !== void 0) { Module[name2].numArguments = numArguments; } } } function RegisteredClass(name2, constructor, instancePrototype, rawDestructor, baseClass, getActualType, upcast, downcast) { this.name = name2; this.constructor = constructor; this.instancePrototype = instancePrototype; this.rawDestructor = rawDestructor; this.baseClass = baseClass; this.getActualType = getActualType; this.upcast = upcast; this.downcast = downcast; this.pureVirtualFunctions = []; } function upcastPointer(ptr, ptrClass, desiredClass) { while (ptrClass !== desiredClass) { if (!ptrClass.upcast) { throwBindingError("Expected null or instance of " + desiredClass.name + ", got an instance of " + ptrClass.name); } ptr = ptrClass.upcast(ptr); ptrClass = ptrClass.baseClass; } return ptr; } function constNoSmartPtrRawPointerToWireType(destructors, handle) { if (handle === null) { if (this.isReference) { throwBindingError("null is not a valid " + this.name); } return 0; } if (!handle.$$) { throwBindingError('Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name); } if (!handle.$$.ptr) { throwBindingError("Cannot pass deleted object as a pointer of type " + this.name); } var handleClass = handle.$$.ptrType.registeredClass; var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass); return ptr; } function genericPointerToWireType(destructors, handle) { var ptr; if (handle === null) { if (this.isReference) { throwBindingError("null is not a valid " + this.name); } if (this.isSmartPointer) { ptr = this.rawConstructor(); if (destructors !== null) { destructors.push(this.rawDestructor, ptr); } return ptr; } else { return 0; } } if (!handle.$$) { throwBindingError('Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name); } if (!handle.$$.ptr) { throwBindingError("Cannot pass deleted object as a pointer of type " + this.name); } if (!this.isConst && handle.$$.ptrType.isConst) { throwBindingError("Cannot convert argument of type " + (handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name) + " to parameter type " + this.name); } var handleClass = handle.$$.ptrType.registeredClass; ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass); if (this.isSmartPointer) { if (handle.$$.smartPtr === void 0) { throwBindingError("Passing raw pointer to smart pointer is illegal"); } switch (this.sharingPolicy) { case 0: if (handle.$$.smartPtrType === this) { ptr = handle.$$.smartPtr; } else { throwBindingError("Cannot convert argument of type " + (handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name) + " to parameter type " + this.name); } break; case 1: ptr = handle.$$.smartPtr; break; case 2: if (handle.$$.smartPtrType === this) { ptr = handle.$$.smartPtr; } else { var clonedHandle = handle["clone"](); ptr = this.rawShare(ptr, __emval_register(function() { clonedHandle["delete"](); })); if (destructors !== null) { destructors.push(this.rawDestructor, ptr); } } break; default: throwBindingError("Unsupporting sharing policy"); } } return ptr; } function nonConstNoSmartPtrRawPointerToWireType(destructors, handle) { if (handle === null) { if (this.isReference) { throwBindingError("null is not a valid " + this.name); } return 0; } if (!handle.$$) { throwBindingError('Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name); } if (!handle.$$.ptr) { throwBindingError("Cannot pass deleted object as a pointer of type " + this.name); } if (handle.$$.ptrType.isConst) { throwBindingError("Cannot convert argument of type " + handle.$$.ptrType.name + " to parameter type " + this.name); } var handleClass = handle.$$.ptrType.registeredClass; var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass); return ptr; } function RegisteredPointer_getPointee(ptr) { if (this.rawGetPointee) { ptr = this.rawGetPointee(ptr); } return ptr; } function RegisteredPointer_destructor(ptr) { if (this.rawDestructor) { this.rawDestructor(ptr); } } function RegisteredPointer_deleteObject(handle) { if (handle !== null) { handle["delete"](); } } function downcastPointer(ptr, ptrClass, desiredClass) { if (ptrClass === desiredClass) { return ptr; } if (desiredClass.baseClass === void 0) { return null; } var rv = downcastPointer(ptr, ptrClass, desiredClass.baseClass); if (rv === null) { return null; } return desiredClass.downcast(rv); } function getInheritedInstanceCount() { return Object.keys(registeredInstances).length; } function getLiveInheritedInstances() { var rv = []; for (var k in registeredInstances) { if (registeredInstances.hasOwnProperty(k)) { rv.push(registeredInstances[k]); } } return rv; } function setDelayFunction(fn) { delayFunction = fn; if (deletionQueue.length && delayFunction) { delayFunction(flushPendingDeletes); } } function init_embind() { Module["getInheritedInstanceCount"] = getInheritedInstanceCount; Module["getLiveInheritedInstances"] = getLiveInheritedInstances; Module["flushPendingDeletes"] = flushPendingDeletes; Module["setDelayFunction"] = setDelayFunction; } var registeredInstances = {}; function getBasestPointer(class_, ptr) { if (ptr === void 0) { throwBindingError("ptr should not be undefined"); } while (class_.baseClass) { ptr = class_.upcast(ptr); class_ = class_.baseClass; } return ptr; } function getInheritedInstance(class_, ptr) { ptr = getBasestPointer(class_, ptr); return registeredInstances[ptr]; } function makeClassHandle(prototype, record) { if (!record.ptrType || !record.ptr) { throwInternalError("makeClassHandle requires ptr and ptrType"); } var hasSmartPtrType = !!record.smartPtrType; var hasSmartPtr = !!record.smartPtr; if (hasSmartPtrType !== hasSmartPtr) { throwInternalError("Both smartPtrType and smartPtr must be specified"); } record.count = { value: 1 }; return attachFinalizer(Object.create(prototype, { $$: { value: record } })); } function RegisteredPointer_fromWireType(ptr) { var rawPointer = this.getPointee(ptr); if (!rawPointer) { this.destructor(ptr); return null; } var registeredInstance = getInheritedInstance(this.registeredClass, rawPointer); if (registeredInstance !== void 0) { if (registeredInstance.$$.count.value === 0) { registeredInstance.$$.ptr = rawPointer; registeredInstance.$$.smartPtr = ptr; return registeredInstance["clone"](); } else { var rv = registeredInstance["clone"](); this.destructor(ptr); return rv; } } function makeDefaultHandle() { if (this.isSmartPointer) { return makeClassHandle(this.registeredClass.instancePrototype, { ptrType: this.pointeeType, ptr: rawPointer, smartPtrType: this, smartPtr: ptr }); } else { return makeClassHandle(this.registeredClass.instancePrototype, { ptrType: this, ptr }); } } var actualType = this.registeredClass.getActualType(rawPointer); var registeredPointerRecord = registeredPointers[actualType]; if (!registeredPointerRecord) { return makeDefaultHandle.call(this); } var toType; if (this.isConst) { toType = registeredPointerRecord.constPointerType; } else { toType = registeredPointerRecord.pointerType; } var dp = downcastPointer(rawPointer, this.registeredClass, toType.registeredClass); if (dp === null) { return makeDefaultHandle.call(this); } if (this.isSmartPointer) { return makeClassHandle(toType.registeredClass.instancePrototype, { ptrType: toType, ptr: dp, smartPtrType: this, smartPtr: ptr }); } else { return makeClassHandle(toType.registeredClass.instancePrototype, { ptrType: toType, ptr: dp }); } } function init_RegisteredPointer() { RegisteredPointer.prototype.getPointee = RegisteredPointer_getPointee; RegisteredPointer.prototype.destructor = RegisteredPointer_destructor; RegisteredPointer.prototype["argPackAdvance"] = 8; RegisteredPointer.prototype["readValueFromPointer"] = simpleReadValueFromPointer; RegisteredPointer.prototype["deleteObject"] = RegisteredPointer_deleteObject; RegisteredPointer.prototype["fromWireType"] = RegisteredPointer_fromWireType; } function RegisteredPointer(name2, registeredClass, isReference, isConst, isSmartPointer, pointeeType, sharingPolicy, rawGetPointee, rawConstructor, rawShare, rawDestructor) { this.name = name2; this.registeredClass = registeredClass; this.isReference = isReference; this.isConst = isConst; this.isSmartPointer = isSmartPointer; this.pointeeType = pointeeType; this.sharingPolicy = sharingPolicy; this.rawGetPointee = rawGetPointee; this.rawConstructor = rawConstructor; this.rawShare = rawShare; this.rawDestructor = rawDestructor; if (!isSmartPointer && registeredClass.baseClass === void 0) { if (isConst) { this["toWireType"] = constNoSmartPtrRawPointerToWireType; this.destructorFunction = null; } else { this["toWireType"] = nonConstNoSmartPtrRawPointerToWireType; this.destructorFunction = null; } } else { this["toWireType"] = genericPointerToWireType; } } function replacePublicSymbol(name2, value, numArguments) { if (!Module.hasOwnProperty(name2)) { throwInternalError("Replacing nonexistant public symbol"); } if (Module[name2].overloadTable !== void 0 && numArguments !== void 0) { Module[name2].overloadTable[numArguments] = value; } else { Module[name2] = value; Module[name2].argCount = numArguments; } } function getDynCaller(sig, ptr) { assert(sig.indexOf("j") >= 0, "getDynCaller should only be called with i64 sigs"); var argCache = []; return function() { argCache.length = arguments.length; for (var i = 0; i < arguments.length; i++) { argCache[i] = arguments[i]; } return dynCall(sig, ptr, argCache); }; } function embind__requireFunction(signature, rawFunction) { signature = readLatin1String(signature); function makeDynCaller() { if (signature.indexOf("j") != -1) { return getDynCaller(signature, rawFunction); } return wasmTable.get(rawFunction); } var fp = makeDynCaller(); if (typeof fp !== "function") { throwBindingError("unknown function pointer with signature " + signature + ": " + rawFunction); } return fp; } var UnboundTypeError = void 0; function getTypeName(type) { var ptr = ___getTypeName(type); var rv = readLatin1String(ptr); _free(ptr); return rv; } function throwUnboundTypeError(message, types) { var unboundTypes = []; var seen = {}; function visit(type) { if (seen[type]) { return; } if (registeredTypes[type]) { return; } if (typeDependencies[type]) { typeDependencies[type].forEach(visit); return; } unboundTypes.push(type); seen[type] = true; } types.forEach(visit); throw new UnboundTypeError(message + ": " + unboundTypes.map(getTypeName).join([", "])); } function __embind_register_class(rawType, rawPointerType, rawConstPointerType, baseClassRawType, getActualTypeSignature, getActualType, upcastSignature, upcast, downcastSignature, downcast, name2, destructorSignature, rawDestructor) { name2 = readLatin1String(name2); getActualType = embind__requireFunction(getActualTypeSignature, getActualType); if (upcast) { upcast = embind__requireFunction(upcastSignature, upcast); } if (downcast) { downcast = embind__requireFunction(downcastSignature, downcast); } rawDestructor = embind__requireFunction(destructorSignature, rawDestructor); var legalFunctionName = makeLegalFunctionName(name2); exposePublicSymbol(legalFunctionName, function() { throwUnboundTypeError("Cannot construct " + name2 + " due to unbound types", [baseClassRawType]); }); whenDependentTypesAreResolved([rawType, rawPointerType, rawConstPointerType], baseClassRawType ? [baseClassRawType] : [], function(base) { base = base[0]; var baseClass; var basePrototype; if (baseClassRawType) { baseClass = base.registeredClass; basePrototype = baseClass.instancePrototype; } else { basePrototype = ClassHandle.prototype; } var constructor = createNamedFunction(legalFunctionName, function() { if (Object.getPrototypeOf(this) !== instancePrototype) { throw new BindingError("Use 'new' to construct " + name2); } if (registeredClass.constructor_body === void 0) { throw new BindingError(name2 + " has no accessible constructor"); } var body = registeredClass.constructor_body[arguments.length]; if (body === void 0) { throw new BindingError("Tried to invoke ctor of " + name2 + " with invalid number of parameters (" + arguments.length + ") - expected (" + Object.keys(registeredClass.constructor_body).toString() + ") parameters instead!"); } return body.apply(this, arguments); }); var instancePrototype = Object.create(basePrototype, { constructor: { value: constructor } }); constructor.prototype = instancePrototype; var registeredClass = new RegisteredClass(name2, constructor, instancePrototype, rawDestructor, baseClass, getActualType, upcast, downcast); var referenceConverter = new RegisteredPointer(name2, registeredClass, true, false, false); var pointerConverter = new RegisteredPointer(name2 + "*", registeredClass, false, false, false); var constPointerConverter = new RegisteredPointer(name2 + " const*", registeredClass, false, true, false); registeredPointers[rawType] = { pointerType: pointerConverter, constPointerType: constPointerConverter }; replacePublicSymbol(legalFunctionName, constructor); return [referenceConverter, pointerConverter, constPointerConverter]; }); } function heap32VectorToArray(count, firstElement) { var array = []; for (var i = 0; i < count; i++) { array.push(HEAP32[(firstElement >> 2) + i >>> 0]); } return array; } function __embind_register_class_constructor(rawClassType, argCount, rawArgTypesAddr, invokerSignature, invoker, rawConstructor) { assert(argCount > 0); var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr); invoker = embind__requireFunction(invokerSignature, invoker); var args = [rawConstructor]; var destructors = []; whenDependentTypesAreResolved([], [rawClassType], function(classType) { classType = classType[0]; var humanName = "constructor " + classType.name; if (classType.registeredClass.constructor_body === void 0) { classType.registeredClass.constructor_body = []; } if (classType.registeredClass.constructor_body[argCount - 1] !== void 0) { throw new BindingError("Cannot register multiple constructors with identical number of parameters (" + (argCount - 1) + ") for class '" + classType.name + "'! Overload resolution is currently only performed using the parameter count, not actual type info!"); } classType.registeredClass.constructor_body[argCount - 1] = function unboundTypeHandler() { throwUnboundTypeError("Cannot construct " + classType.name + " due to unbound types", rawArgTypes); }; whenDependentTypesAreResolved([], rawArgTypes, function(argTypes) { classType.registeredClass.constructor_body[argCount - 1] = function constructor_body() { if (arguments.length !== argCount - 1) { throwBindingError(humanName + " called with " + arguments.length + " arguments, expected " + (argCount - 1)); } destructors.length = 0; args.length = argCount; for (var i = 1; i < argCount; ++i) { args[i] = argTypes[i]["toWireType"](destructors, arguments[i - 1]); } var ptr = invoker.apply(null, args); runDestructors(destructors); return argTypes[0]["fromWireType"](ptr); }; return []; }); return []; }); } function new_(constructor, argumentList) { if (!(constructor instanceof Function)) { throw new TypeError("new_ called with constructor type " + typeof constructor + " which is not a function"); } var dummy = createNamedFunction(constructor.name || "unknownFunctionName", function() { }); dummy.prototype = constructor.prototype; var obj = new dummy(); var r = constructor.apply(obj, argumentList); return r instanceof Object ? r : obj; } function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc) { var argCount = argTypes.length; if (argCount < 2) { throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!"); } var isClassMethodFunc = argTypes[1] !== null && classType !== null; var needsDestructorStack = false; for (var i = 1; i < argTypes.length; ++i) { if (argTypes[i] !== null && argTypes[i].destructorFunction === void 0) { needsDestructorStack = true; break; } } var returns = argTypes[0].name !== "void"; var argsList = ""; var argsListWired = ""; for (var i = 0; i < argCount - 2; ++i) { argsList += (i !== 0 ? ", " : "") + "arg" + i; argsListWired += (i !== 0 ? ", " : "") + "arg" + i + "Wired"; } var invokerFnBody = "return function " + makeLegalFunctionName(humanName) + "(" + argsList + ") {\nif (arguments.length !== " + (argCount - 2) + ") {\nthrowBindingError('function " + humanName + " called with ' + arguments.length + ' arguments, expected " + (argCount - 2) + " args!');\n}\n"; if (needsDestructorStack) { invokerFnBody += "var destructors = [];\n"; } var dtorStack = needsDestructorStack ? "destructors" : "null"; var args1 = ["throwBindingError", "invoker", "fn", "runDestructors", "retType", "classParam"]; var args2 = [throwBindingError, cppInvokerFunc, cppTargetFunc, runDestructors, argTypes[0], argTypes[1]]; if (isClassMethodFunc) { invokerFnBody += "var thisWired = classParam.toWireType(" + dtorStack + ", this);\n"; } for (var i = 0; i < argCount - 2; ++i) { invokerFnBody += "var arg" + i + "Wired = argType" + i + ".toWireType(" + dtorStack + ", arg" + i + "); // " + argTypes[i + 2].name + "\n"; args1.push("argType" + i); args2.push(argTypes[i + 2]); } if (isClassMethodFunc) { argsListWired = "thisWired" + (argsListWired.length > 0 ? ", " : "") + argsListWired; } invokerFnBody += (returns ? "var rv = " : "") + "invoker(fn" + (argsListWired.length > 0 ? ", " : "") + argsListWired + ");\n"; if (needsDestructorStack) { invokerFnBody += "runDestructors(destructors);\n"; } else { for (var i = isClassMethodFunc ? 1 : 2; i < argTypes.length; ++i) { var paramName = i === 1 ? "thisWired" : "arg" + (i - 2) + "Wired"; if (argTypes[i].destructorFunction !== null) { invokerFnBody += paramName + "_dtor(" + paramName + "); // " + argTypes[i].name + "\n"; args1.push(paramName + "_dtor"); args2.push(argTypes[i].destructorFunction); } } } if (returns) { invokerFnBody += "var ret = retType.fromWireType(rv);\nreturn ret;\n"; } invokerFnBody += "}\n"; args1.push(invokerFnBody); var invokerFunction = new_(Function, args1).apply(null, args2); return invokerFunction; } function __embind_register_class_function(rawClassType, methodName, argCount, rawArgTypesAddr, invokerSignature, rawInvoker, context, isPureVirtual) { var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr); methodName = readLatin1String(methodName); rawInvoker = embind__requireFunction(invokerSignature, rawInvoker); whenDependentTypesAreResolved([], [rawClassType], function(classType) { classType = classType[0]; var humanName = classType.name + "." + methodName; if (isPureVirtual) { classType.registeredClass.pureVirtualFunctions.push(methodName); } function unboundTypesHandler() { throwUnboundTypeError("Cannot call " + humanName + " due to unbound types", rawArgTypes); } var proto = classType.registeredClass.instancePrototype; var method = proto[methodName]; if (method === void 0 || method.overloadTable === void 0 && method.className !== classType.name && method.argCount === argCount - 2) { unboundTypesHandler.argCount = argCount - 2; unboundTypesHandler.className = classType.name; proto[methodName] = unboundTypesHandler; } else { ensureOverloadTable(proto, methodName, humanName); proto[methodName].overloadTable[argCount - 2] = unboundTypesHandler; } whenDependentTypesAreResolved([], rawArgTypes, function(argTypes) { var memberFunction = craftInvokerFunction(humanName, argTypes, classType, rawInvoker, context); if (proto[methodName].overloadTable === void 0) { memberFunction.argCount = argCount - 2; proto[methodName] = memberFunction; } else { proto[methodName].overloadTable[argCount - 2] = memberFunction; } return []; }); return []; }); } var emval_free_list = []; var emval_handle_array = [{}, { value: void 0 }, { value: null }, { value: true }, { value: false }]; function __emval_decref(handle) { if (handle > 4 && --emval_handle_array[handle].refcount === 0) { emval_handle_array[handle] = void 0; emval_free_list.push(handle); } } function count_emval_handles() { var count = 0; for (var i = 5; i < emval_handle_array.length; ++i) { if (emval_handle_array[i] !== void 0) { ++count; } } return count; } function get_first_emval() { for (var i = 5; i < emval_handle_array.length; ++i) { if (emval_handle_array[i] !== void 0) { return emval_handle_array[i]; } } return null; } function init_emval() { Module["count_emval_handles"] = count_emval_handles; Module["get_first_emval"] = get_first_emval; } function __emval_register(value) { switch (value) { case void 0: { return 1; } case null: { return 2; } case true: { return 3; } case false: { return 4; } default: { var handle = emval_free_list.length ? emval_free_list.pop() : emval_handle_array.length; emval_handle_array[handle] = { refcount: 1, value }; return handle; } } } function __embind_register_emval(rawType, name2) { name2 = readLatin1String(name2); registerType(rawType, { name: name2, "fromWireType": function(handle) { var rv = emval_handle_array[handle].value; __emval_decref(handle); return rv; }, "toWireType": function(destructors, value) { return __emval_register(value); }, "argPackAdvance": 8, "readValueFromPointer": simpleReadValueFromPointer, destructorFunction: null }); } function _embind_repr(v) { if (v === null) { return "null"; } var t = typeof v; if (t === "object" || t === "array" || t === "function") { return v.toString(); } else { return "" + v; } } function floatReadValueFromPointer(name2, shift) { switch (shift) { case 2: return function(pointer) { return this["fromWireType"](HEAPF32[pointer >>> 2]); }; case 3: return function(pointer) { return this["fromWireType"](HEAPF64[pointer >>> 3]); }; default: throw new TypeError("Unknown float type: " + name2); } } function __embind_register_float(rawType, name2, size) { var shift = getShiftFromSize(size); name2 = readLatin1String(name2); registerType(rawType, { name: name2, "fromWireType": function(value) { return value; }, "toWireType": function(destructors, value) { if (typeof value !== "number" && typeof value !== "boolean") { throw new TypeError('Cannot convert "' + _embind_repr(value) + '" to ' + this.name); } return value; }, "argPackAdvance": 8, "readValueFromPointer": floatReadValueFromPointer(name2, shift), destructorFunction: null }); } function __embind_register_function(name2, argCount, rawArgTypesAddr, signature, rawInvoker, fn) { var argTypes = heap32VectorToArray(argCount, rawArgTypesAddr); name2 = readLatin1String(name2); rawInvoker = embind__requireFunction(signature, rawInvoker); exposePublicSymbol(name2, function() { throwUnboundTypeError("Cannot call " + name2 + " due to unbound types", argTypes); }, argCount - 1); whenDependentTypesAreResolved([], argTypes, function(argTypes2) { var invokerArgsArray = [argTypes2[0], null].concat(argTypes2.slice(1)); replacePublicSymbol(name2, craftInvokerFunction(name2, invokerArgsArray, null, rawInvoker, fn), argCount - 1); return []; }); } function integerReadValueFromPointer(name2, shift, signed) { switch (shift) { case 0: return signed ? function readS8FromPointer(pointer) { return HEAP8[pointer >>> 0]; } : function readU8FromPointer(pointer) { return HEAPU8[pointer >>> 0]; }; case 1: return signed ? function readS16FromPointer(pointer) { return HEAP16[pointer >>> 1]; } : function readU16FromPointer(pointer) { return HEAPU16[pointer >>> 1]; }; case 2: return signed ? function readS32FromPointer(pointer) { return HEAP32[pointer >>> 2]; } : function readU32FromPointer(pointer) { return HEAPU32[pointer >>> 2]; }; default: throw new TypeError("Unknown integer type: " + name2); } } function __embind_register_integer(primitiveType, name2, size, minRange, maxRange) { name2 = readLatin1String(name2); if (maxRange === -1) { maxRange = 4294967295; } var shift = getShiftFromSize(size); var fromWireType = function(value) { return value; }; if (minRange === 0) { var bitshift = 32 - 8 * size; fromWireType = function(value) { return value << bitshift >>> bitshift; }; } var isUnsignedType = name2.indexOf("unsigned") != -1; registerType(primitiveType, { name: name2, "fromWireType": fromWireType, "toWireType": function(destructors, value) { if (typeof value !== "number" && typeof value !== "boolean") { throw new TypeError('Cannot convert "' + _embind_repr(value) + '" to ' + this.name); } if (value < minRange || value > maxRange) { throw new TypeError('Passing a number "' + _embind_repr(value) + '" from JS side to C/C++ side to an argument of type "' + name2 + '", which is outside the valid range [' + minRange + ", " + maxRange + "]!"); } return isUnsignedType ? value >>> 0 : value | 0; }, "argPackAdvance": 8, "readValueFromPointer": integerReadValueFromPointer(name2, shift, minRange !== 0), destructorFunction: null }); } function __embind_register_memory_view(rawType, dataTypeIndex, name2) { var typeMapping = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array]; var TA = typeMapping[dataTypeIndex]; function decodeMemoryView(handle) { handle = handle >> 2; var heap = HEAPU32; var size = heap[handle >>> 0]; var data = heap[handle + 1 >>> 0]; return new TA(buffer, data, size); } name2 = readLatin1String(name2); registerType(rawType, { name: name2, "fromWireType": decodeMemoryView, "argPackAdvance": 8, "readValueFromPointer": decodeMemoryView }, { ignoreDuplicateRegistrations: true }); } function __embind_register_std_string(rawType, name2) { name2 = readLatin1String(name2); var stdStringIsUTF8 = name2 === "std::string"; registerType(rawType, { name: name2, "fromWireType": function(value) { var length = HEAPU32[value >>> 2]; var str; if (stdStringIsUTF8) { var decodeStartPtr = value + 4; for (var i = 0; i <= length; ++i) { var currentBytePtr = value + 4 + i; if (i == length || HEAPU8[currentBytePtr >>> 0] == 0) { var maxRead = currentBytePtr - decodeStartPtr; var stringSegment = UTF8ToString(decodeStartPtr, maxRead); if (str === void 0) { str = stringSegment; } else { str += String.fromCharCode(0); str += stringSegment; } decodeStartPtr = currentBytePtr + 1; } } } else { var a = new Array(length); for (var i = 0; i < length; ++i) { a[i] = String.fromCharCode(HEAPU8[value + 4 + i >>> 0]); } str = a.join(""); } _free(value); return str; }, "toWireType": function(destructors, value) { if (value instanceof ArrayBuffer) { value = new Uint8Array(value); } var getLength; var valueIsOfTypeString = typeof value === "string"; if (!(valueIsOfTypeString || value instanceof Uint8Array || value instanceof Uint8ClampedArray || value instanceof Int8Array)) { throwBindingError("Cannot pass non-string to std::string"); } if (stdStringIsUTF8 && valueIsOfTypeString) { getLength = function() { return lengthBytesUTF8(value); }; } else { getLength = function() { return value.length; }; } var length = getLength(); var ptr = _malloc(4 + length + 1); ptr >>>= 0; HEAPU32[ptr >>> 2] = length; if (stdStringIsUTF8 && valueIsOfTypeString) { stringToUTF8(value, ptr + 4, length + 1); } else { if (valueIsOfTypeString) { for (var i = 0; i < length; ++i) { var charCode = value.charCodeAt(i); if (charCode > 255) { _free(ptr); throwBindingError("String has UTF-16 code units that do not fit in 8 bits"); } HEAPU8[ptr + 4 + i >>> 0] = charCode; } } else { for (var i = 0; i < length; ++i) { HEAPU8[ptr + 4 + i >>> 0] = value[i]; } } } if (destructors !== null) { destructors.push(_free, ptr); } return ptr; }, "argPackAdvance": 8, "readValueFromPointer": simpleReadValueFromPointer, destructorFunction: function(ptr) { _free(ptr); } }); } function __embind_register_std_wstring(rawType, charSize, name2) { name2 = readLatin1String(name2); var decodeString, encodeString, getHeap, lengthBytesUTF, shift; if (charSize === 2) { decodeString = UTF16ToString; encodeString = stringToUTF16; lengthBytesUTF = lengthBytesUTF16; getHeap = function() { return HEAPU16; }; shift = 1; } else if (charSize === 4) { decodeString = UTF32ToString; encodeString = stringToUTF32; lengthBytesUTF = lengthBytesUTF32; getHeap = function() { return HEAPU32; }; shift = 2; } registerType(rawType, { name: name2, "fromWireType": function(value) { var length = HEAPU32[value >>> 2]; var HEAP = getHeap(); var str; var decodeStartPtr = value + 4; for (var i = 0; i <= length; ++i) { var currentBytePtr = value + 4 + i * charSize; if (i == length || HEAP[currentBytePtr >>> shift] == 0) { var maxReadBytes = currentBytePtr - decodeStartPtr; var stringSegment = decodeString(decodeStartPtr, maxReadBytes); if (str === void 0) { str = stringSegment; } else { str += String.fromCharCode(0); str += stringSegment; } decodeStartPtr = currentBytePtr + charSize; } } _free(value); return str; }, "toWireType": function(destructors, value) { if (!(typeof value === "string")) { throwBindingError("Cannot pass non-string to C++ string type " + name2); } var length = lengthBytesUTF(value); var ptr = _malloc(4 + length + charSize); ptr >>>= 0; HEAPU32[ptr >>> 2] = length >> shift; encodeString(value, ptr + 4, length + charSize); if (destructors !== null) { destructors.push(_free, ptr); } return ptr; }, "argPackAdvance": 8, "readValueFromPointer": simpleReadValueFromPointer, destructorFunction: function(ptr) { _free(ptr); } }); } function __embind_register_value_array(rawType, name2, constructorSignature, rawConstructor, destructorSignature, rawDestructor) { tupleRegistrations[rawType] = { name: readLatin1String(name2), rawConstructor: embind__requireFunction(constructorSignature, rawConstructor), rawDestructor: embind__requireFunction(destructorSignature, rawDestructor), elements: [] }; } function __embind_register_value_array_element(rawTupleType, getterReturnType, getterSignature, getter, getterContext, setterArgumentType, setterSignature, setter, setterContext) { tupleRegistrations[rawTupleType].elements.push({ getterReturnType, getter: embind__requireFunction(getterSignature, getter), getterContext, setterArgumentType, setter: embind__requireFunction(setterSignature, setter), setterContext }); } function __embind_register_value_object(rawType, name2, constructorSignature, rawConstructor, destructorSignature, rawDestructor) { structRegistrations[rawType] = { name: readLatin1String(name2), rawConstructor: embind__requireFunction(constructorSignature, rawConstructor), rawDestructor: embind__requireFunction(destructorSignature, rawDestructor), fields: [] }; } function __embind_register_value_object_field(structType, fieldName, getterReturnType, getterSignature, getter, getterContext, setterArgumentType, setterSignature, setter, setterContext) { structRegistrations[structType].fields.push({ fieldName: readLatin1String(fieldName), getterReturnType, getter: embind__requireFunction(getterSignature, getter), getterContext, setterArgumentType, setter: embind__requireFunction(setterSignature, setter), setterContext }); } function __embind_register_void(rawType, name2) { name2 = readLatin1String(name2); registerType(rawType, { isVoid: true, name: name2, "argPackAdvance": 0, "fromWireType": function() { return void 0; }, "toWireType": function(destructors, o) { return void 0; } }); } function requireHandle(handle) { if (!handle) { throwBindingError("Cannot use deleted val. handle = " + handle); } return emval_handle_array[handle].value; } function requireRegisteredType(rawType, humanName) { var impl = registeredTypes[rawType]; if (impl === void 0) { throwBindingError(humanName + " has unknown type " + getTypeName(rawType)); } return impl; } function __emval_as(handle, returnType, destructorsRef) { handle = requireHandle(handle); returnType = requireRegisteredType(returnType, "emval::as"); var destructors = []; var rd = __emval_register(destructors); HEAP32[destructorsRef >>> 2] = rd; return returnType["toWireType"](destructors, handle); } function __emval_lookupTypes(argCount, argTypes) { var a = new Array(argCount); for (var i = 0; i < argCount; ++i) { a[i] = requireRegisteredType(HEAP32[(argTypes >> 2) + i >>> 0], "parameter " + i); } return a; } function __emval_call(handle, argCount, argTypes, argv) { handle = requireHandle(handle); var types = __emval_lookupTypes(argCount, argTypes); var args = new Array(argCount); for (var i = 0; i < argCount; ++i) { var type = types[i]; args[i] = type["readValueFromPointer"](argv); argv += type["argPackAdvance"]; } var rv = handle.apply(void 0, args); return __emval_register(rv); } var emval_symbols = {}; function getStringOrSymbol(address) { var symbol = emval_symbols[address]; if (symbol === void 0) { return readLatin1String(address); } else { return symbol; } } function emval_get_global() { if (typeof globalThis === "object") { return globalThis; } return function() { return Function; }()("return this")(); } function __emval_get_global(name2) { if (name2 === 0) { return __emval_register(emval_get_global()); } else { name2 = getStringOrSymbol(name2); return __emval_register(emval_get_global()[name2]); } } function __emval_get_property(handle, key2) { handle = requireHandle(handle); key2 = requireHandle(key2); return __emval_register(handle[key2]); } function __emval_incref(handle) { if (handle > 4) { emval_handle_array[handle].refcount += 1; } } function __emval_instanceof(object, constructor) { object = requireHandle(object); constructor = requireHandle(constructor); return object instanceof constructor; } function __emval_is_number(handle) { handle = requireHandle(handle); return typeof handle === "number"; } function __emval_new_array() { return __emval_register([]); } function __emval_new_cstring(v) { return __emval_register(getStringOrSymbol(v)); } function __emval_new_object() { return __emval_register({}); } function __emval_run_destructors(handle) { var destructors = emval_handle_array[handle].value; runDestructors(destructors); __emval_decref(handle); } function __emval_set_property(handle, key2, value) { handle = requireHandle(handle); key2 = requireHandle(key2); value = requireHandle(value); handle[key2] = value; } function __emval_take_value(type, argv) { type = requireRegisteredType(type, "_emval_take_value"); var v = type["readValueFromPointer"](argv); return __emval_register(v); } function _abort() { abort(); } var _emscripten_get_now; if (ENVIRONMENT_IS_NODE) { _emscripten_get_now = function() { var t = process["hrtime"](); return t[0] * 1e3 + t[1] / 1e6; }; } else if (typeof dateNow !== "undefined") { _emscripten_get_now = dateNow; } else _emscripten_get_now = function() { return performance.now(); }; var _emscripten_get_now_is_monotonic = true; function _clock_gettime(clk_id, tp) { var now; if (clk_id === 0) { now = Date.now(); } else if ((clk_id === 1 || clk_id === 4) && _emscripten_get_now_is_monotonic) { now = _emscripten_get_now(); } else { setErrNo(28); return -1; } HEAP32[tp >>> 2] = now / 1e3 | 0; HEAP32[tp + 4 >>> 2] = now % 1e3 * 1e3 * 1e3 | 0; return 0; } function _emscripten_memcpy_big(dest, src, num) { HEAPU8.copyWithin(dest >>> 0, src >>> 0, src + num >>> 0); } function _emscripten_get_heap_size() { return HEAPU8.length; } function emscripten_realloc_buffer(size) { try { wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); updateGlobalBufferAndViews(wasmMemory.buffer); return 1; } catch (e) { } } function _emscripten_resize_heap(requestedSize) { requestedSize = requestedSize >>> 0; var oldSize = _emscripten_get_heap_size(); var maxHeapSize = 4294967296; if (requestedSize > maxHeapSize) { return false; } var minHeapSize = 16777216; for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); var newSize = Math.min(maxHeapSize, alignUp(Math.max(minHeapSize, requestedSize, overGrownHeapSize), 65536)); var replacement = emscripten_realloc_buffer(newSize); if (replacement) { return true; } } return false; } var ENV = {}; function getExecutableName() { return thisProgram || "./this.program"; } function getEnvStrings() { if (!getEnvStrings.strings) { var lang = (typeof navigator === "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8"; var env = { "USER": "web_user", "LOGNAME": "web_user", "PATH": "/", "PWD": "/", "HOME": "/home/web_user", "LANG": lang, "_": getExecutableName() }; for (var x in ENV) { env[x] = ENV[x]; } var strings = []; for (var x in env) { strings.push(x + "=" + env[x]); } getEnvStrings.strings = strings; } return getEnvStrings.strings; } function _environ_get(__environ, environ_buf) { try { var bufSize = 0; getEnvStrings().forEach(function(string, i) { var ptr = environ_buf + bufSize; HEAP32[__environ + i * 4 >>> 2] = ptr; writeAsciiToMemory(string, ptr); bufSize += string.length + 1; }); return 0; } catch (e) { if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); return e.errno; } } function _environ_sizes_get(penviron_count, penviron_buf_size) { try { var strings = getEnvStrings(); HEAP32[penviron_count >>> 2] = strings.length; var bufSize = 0; strings.forEach(function(string) { bufSize += string.length + 1; }); HEAP32[penviron_buf_size >>> 2] = bufSize; return 0; } catch (e) { if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); return e.errno; } } function _fd_close(fd) { try { var stream = SYSCALLS.getStreamFromFD(fd); FS.close(stream); return 0; } catch (e) { if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); return e.errno; } } function _fd_read(fd, iov, iovcnt, pnum) { try { var stream = SYSCALLS.getStreamFromFD(fd); var num = SYSCALLS.doReadv(stream, iov, iovcnt); HEAP32[pnum >>> 2] = num; return 0; } catch (e) { if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); return e.errno; } } function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { try { var stream = SYSCALLS.getStreamFromFD(fd); var HIGH_OFFSET = 4294967296; var offset = offset_high * HIGH_OFFSET + (offset_low >>> 0); var DOUBLE_LIMIT = 9007199254740992; if (offset <= -DOUBLE_LIMIT || offset >= DOUBLE_LIMIT) { return -61; } FS.llseek(stream, offset, whence); tempI64 = [stream.position >>> 0, (tempDouble = stream.position, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[newOffset >>> 2] = tempI64[0], HEAP32[newOffset + 4 >>> 2] = tempI64[1]; if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null; return 0; } catch (e) { if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); return e.errno; } } function _fd_write(fd, iov, iovcnt, pnum) { try { var stream = SYSCALLS.getStreamFromFD(fd); var num = SYSCALLS.doWritev(stream, iov, iovcnt); HEAP32[pnum >>> 2] = num; return 0; } catch (e) { if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); return e.errno; } } function _setTempRet0($i) { } function __isLeapYear(year) { return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); } function __arraySum(array, index) { var sum = 0; for (var i = 0; i <= index; sum += array[i++]) { } return sum; } var __MONTH_DAYS_LEAP = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; var __MONTH_DAYS_REGULAR = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; function __addDays(date, days) { var newDate = new Date(date.getTime()); while (days > 0) { var leap = __isLeapYear(newDate.getFullYear()); var currentMonth = newDate.getMonth(); var daysInCurrentMonth = (leap ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR)[currentMonth]; if (days > daysInCurrentMonth - newDate.getDate()) { days -= daysInCurrentMonth - newDate.getDate() + 1; newDate.setDate(1); if (currentMonth < 11) { newDate.setMonth(currentMonth + 1); } else { newDate.setMonth(0); newDate.setFullYear(newDate.getFullYear() + 1); } } else { newDate.setDate(newDate.getDate() + days); return newDate; } } return newDate; } function _strftime(s, maxsize, format, tm) { var tm_zone = HEAP32[tm + 40 >>> 2]; var date = { tm_sec: HEAP32[tm >>> 2], tm_min: HEAP32[tm + 4 >>> 2], tm_hour: HEAP32[tm + 8 >>> 2], tm_mday: HEAP32[tm + 12 >>> 2], tm_mon: HEAP32[tm + 16 >>> 2], tm_year: HEAP32[tm + 20 >>> 2], tm_wday: HEAP32[tm + 24 >>> 2], tm_yday: HEAP32[tm + 28 >>> 2], tm_isdst: HEAP32[tm + 32 >>> 2], tm_gmtoff: HEAP32[tm + 36 >>> 2], tm_zone: tm_zone ? UTF8ToString(tm_zone) : "" }; var pattern = UTF8ToString(format); var EXPANSION_RULES_1 = { "%c": "%a %b %d %H:%M:%S %Y", "%D": "%m/%d/%y", "%F": "%Y-%m-%d", "%h": "%b", "%r": "%I:%M:%S %p", "%R": "%H:%M", "%T": "%H:%M:%S", "%x": "%m/%d/%y", "%X": "%H:%M:%S", "%Ec": "%c", "%EC": "%C", "%Ex": "%m/%d/%y", "%EX": "%H:%M:%S", "%Ey": "%y", "%EY": "%Y", "%Od": "%d", "%Oe": "%e", "%OH": "%H", "%OI": "%I", "%Om": "%m", "%OM": "%M", "%OS": "%S", "%Ou": "%u", "%OU": "%U", "%OV": "%V", "%Ow": "%w", "%OW": "%W", "%Oy": "%y" }; for (var rule in EXPANSION_RULES_1) { pattern = pattern.replace(new RegExp(rule, "g"), EXPANSION_RULES_1[rule]); } var WEEKDAYS = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; function leadingSomething(value, digits, character) { var str = typeof value === "number" ? value.toString() : value || ""; while (str.length < digits) { str = character[0] + str; } return str; } function leadingNulls(value, digits) { return leadingSomething(value, digits, "0"); } function compareByDay(date1, date2) { function sgn(value) { return value < 0 ? -1 : value > 0 ? 1 : 0; } var compare; if ((compare = sgn(date1.getFullYear() - date2.getFullYear())) === 0) { if ((compare = sgn(date1.getMonth() - date2.getMonth())) === 0) { compare = sgn(date1.getDate() - date2.getDate()); } } return compare; } function getFirstWeekStartDate(janFourth) { switch (janFourth.getDay()) { case 0: return new Date(janFourth.getFullYear() - 1, 11, 29); case 1: return janFourth; case 2: return new Date(janFourth.getFullYear(), 0, 3); case 3: return new Date(janFourth.getFullYear(), 0, 2); case 4: return new Date(janFourth.getFullYear(), 0, 1); case 5: return new Date(janFourth.getFullYear() - 1, 11, 31); case 6: return new Date(janFourth.getFullYear() - 1, 11, 30); } } function getWeekBasedYear(date2) { var thisDate = __addDays(new Date(date2.tm_year + 1900, 0, 1), date2.tm_yday); var janFourthThisYear = new Date(thisDate.getFullYear(), 0, 4); var janFourthNextYear = new Date(thisDate.getFullYear() + 1, 0, 4); var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear); var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear); if (compareByDay(firstWeekStartThisYear, thisDate) <= 0) { if (compareByDay(firstWeekStartNextYear, thisDate) <= 0) { return thisDate.getFullYear() + 1; } else { return thisDate.getFullYear(); } } else { return thisDate.getFullYear() - 1; } } var EXPANSION_RULES_2 = { "%a": function(date2) { return WEEKDAYS[date2.tm_wday].substring(0, 3); }, "%A": function(date2) { return WEEKDAYS[date2.tm_wday]; }, "%b": function(date2) { return MONTHS[date2.tm_mon].substring(0, 3); }, "%B": function(date2) { return MONTHS[date2.tm_mon]; }, "%C": function(date2) { var year = date2.tm_year + 1900; return leadingNulls(year / 100 | 0, 2); }, "%d": function(date2) { return leadingNulls(date2.tm_mday, 2); }, "%e": function(date2) { return leadingSomething(date2.tm_mday, 2, " "); }, "%g": function(date2) { return getWeekBasedYear(date2).toString().substring(2); }, "%G": function(date2) { return getWeekBasedYear(date2); }, "%H": function(date2) { return leadingNulls(date2.tm_hour, 2); }, "%I": function(date2) { var twelveHour = date2.tm_hour; if (twelveHour == 0) twelveHour = 12; else if (twelveHour > 12) twelveHour -= 12; return leadingNulls(twelveHour, 2); }, "%j": function(date2) { return leadingNulls(date2.tm_mday + __arraySum(__isLeapYear(date2.tm_year + 1900) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, date2.tm_mon - 1), 3); }, "%m": function(date2) { return leadingNulls(date2.tm_mon + 1, 2); }, "%M": function(date2) { return leadingNulls(date2.tm_min, 2); }, "%n": function() { return "\n"; }, "%p": function(date2) { if (date2.tm_hour >= 0 && date2.tm_hour < 12) { return "AM"; } else { return "PM"; } }, "%S": function(date2) { return leadingNulls(date2.tm_sec, 2); }, "%t": function() { return " "; }, "%u": function(date2) { return date2.tm_wday || 7; }, "%U": function(date2) { var janFirst = new Date(date2.tm_year + 1900, 0, 1); var firstSunday = janFirst.getDay() === 0 ? janFirst : __addDays(janFirst, 7 - janFirst.getDay()); var endDate = new Date(date2.tm_year + 1900, date2.tm_mon, date2.tm_mday); if (compareByDay(firstSunday, endDate) < 0) { var februaryFirstUntilEndMonth = __arraySum(__isLeapYear(endDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, endDate.getMonth() - 1) - 31; var firstSundayUntilEndJanuary = 31 - firstSunday.getDate(); var days = firstSundayUntilEndJanuary + februaryFirstUntilEndMonth + endDate.getDate(); return leadingNulls(Math.ceil(days / 7), 2); } return compareByDay(firstSunday, janFirst) === 0 ? "01" : "00"; }, "%V": function(date2) { var janFourthThisYear = new Date(date2.tm_year + 1900, 0, 4); var janFourthNextYear = new Date(date2.tm_year + 1901, 0, 4); var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear); var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear); var endDate = __addDays(new Date(date2.tm_year + 1900, 0, 1), date2.tm_yday); if (compareByDay(endDate, firstWeekStartThisYear) < 0) { return "53"; } if (compareByDay(firstWeekStartNextYear, endDate) <= 0) { return "01"; } var daysDifference; if (firstWeekStartThisYear.getFullYear() < date2.tm_year + 1900) { daysDifference = date2.tm_yday + 32 - firstWeekStartThisYear.getDate(); } else { daysDifference = date2.tm_yday + 1 - firstWeekStartThisYear.getDate(); } return leadingNulls(Math.ceil(daysDifference / 7), 2); }, "%w": function(date2) { return date2.tm_wday; }, "%W": function(date2) { var janFirst = new Date(date2.tm_year, 0, 1); var firstMonday = janFirst.getDay() === 1 ? janFirst : __addDays(janFirst, janFirst.getDay() === 0 ? 1 : 7 - janFirst.getDay() + 1); var endDate = new Date(date2.tm_year + 1900, date2.tm_mon, date2.tm_mday); if (compareByDay(firstMonday, endDate) < 0) { var februaryFirstUntilEndMonth = __arraySum(__isLeapYear(endDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, endDate.getMonth() - 1) - 31; var firstMondayUntilEndJanuary = 31 - firstMonday.getDate(); var days = firstMondayUntilEndJanuary + februaryFirstUntilEndMonth + endDate.getDate(); return leadingNulls(Math.ceil(days / 7), 2); } return compareByDay(firstMonday, janFirst) === 0 ? "01" : "00"; }, "%y": function(date2) { return (date2.tm_year + 1900).toString().substring(2); }, "%Y": function(date2) { return date2.tm_year + 1900; }, "%z": function(date2) { var off = date2.tm_gmtoff; var ahead = off >= 0; off = Math.abs(off) / 60; off = off / 60 * 100 + off % 60; return (ahead ? "+" : "-") + String("0000" + off).slice(-4); }, "%Z": function(date2) { return date2.tm_zone; }, "%%": function() { return "%"; } }; for (var rule in EXPANSION_RULES_2) { if (pattern.indexOf(rule) >= 0) { pattern = pattern.replace(new RegExp(rule, "g"), EXPANSION_RULES_2[rule](date)); } } var bytes = intArrayFromString(pattern, false); if (bytes.length > maxsize) { return 0; } writeArrayToMemory(bytes, s); return bytes.length - 1; } function _strftime_l(s, maxsize, format, tm) { return _strftime(s, maxsize, format, tm); } var FSNode = function(parent, name2, mode, rdev) { if (!parent) { parent = this; } this.parent = parent; this.mount = parent.mount; this.mounted = null; this.id = FS.nextInode++; this.name = name2; this.mode = mode; this.node_ops = {}; this.stream_ops = {}; this.rdev = rdev; }; var readMode = 292 | 73; var writeMode = 146; Object.defineProperties(FSNode.prototype, { read: { get: function() { return (this.mode & readMode) === readMode; }, set: function(val) { val ? this.mode |= readMode : this.mode &= ~readMode; } }, write: { get: function() { return (this.mode & writeMode) === writeMode; }, set: function(val) { val ? this.mode |= writeMode : this.mode &= ~writeMode; } }, isFolder: { get: function() { return FS.isDir(this.mode); } }, isDevice: { get: function() { return FS.isChrdev(this.mode); } } }); FS.FSNode = FSNode; FS.staticInit(); Module["FS_createPath"] = FS.createPath; Module["FS_createDataFile"] = FS.createDataFile; Module["FS_createPreloadedFile"] = FS.createPreloadedFile; Module["FS_createLazyFile"] = FS.createLazyFile; Module["FS_createDevice"] = FS.createDevice; Module["FS_unlink"] = FS.unlink; InternalError = Module["InternalError"] = extendError(Error, "InternalError"); embind_init_charCodes(); BindingError = Module["BindingError"] = extendError(Error, "BindingError"); init_ClassHandle(); init_RegisteredPointer(); init_embind(); UnboundTypeError = Module["UnboundTypeError"] = extendError(Error, "UnboundTypeError"); init_emval(); function intArrayFromString(stringy, dontAddNull, length) { var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1; var u8array = new Array(len); var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length); if (dontAddNull) u8array.length = numBytesWritten; return u8array; } __ATINIT__.push({ func: function() { ___wasm_call_ctors(); } }); var asmLibraryArg = { "x": ___assert_fail, "A": ___sys_fcntl64, "P": ___sys_ioctl, "Q": ___sys_open, "U": __embind_finalize_value_array, "s": __embind_finalize_value_object, "S": __embind_register_bool, "v": __embind_register_class, "u": __embind_register_class_constructor, "d": __embind_register_class_function, "R": __embind_register_emval, "C": __embind_register_float, "g": __embind_register_function, "m": __embind_register_integer, "k": __embind_register_memory_view, "D": __embind_register_std_string, "w": __embind_register_std_wstring, "V": __embind_register_value_array, "h": __embind_register_value_array_element, "t": __embind_register_value_object, "j": __embind_register_value_object_field, "T": __embind_register_void, "q": __emval_as, "W": __emval_call, "b": __emval_decref, "F": __emval_get_global, "n": __emval_get_property, "l": __emval_incref, "N": __emval_instanceof, "E": __emval_is_number, "y": __emval_new_array, "f": __emval_new_cstring, "r": __emval_new_object, "p": __emval_run_destructors, "i": __emval_set_property, "e": __emval_take_value, "c": _abort, "M": _clock_gettime, "I": _emscripten_memcpy_big, "o": _emscripten_resize_heap, "K": _environ_get, "L": _environ_sizes_get, "B": _fd_close, "O": _fd_read, "G": _fd_seek, "z": _fd_write, "a": wasmMemory, "H": _setTempRet0, "J": _strftime_l }; var asm = createWasm(); var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function() { return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["Y"]).apply(null, arguments); }; var _main = Module["_main"] = function() { return (_main = Module["_main"] = Module["asm"]["Z"]).apply(null, arguments); }; var _malloc = Module["_malloc"] = function() { return (_malloc = Module["_malloc"] = Module["asm"]["_"]).apply(null, arguments); }; var ___getTypeName = Module["___getTypeName"] = function() { return (___getTypeName = Module["___getTypeName"] = Module["asm"]["$"]).apply(null, arguments); }; var ___embind_register_native_and_builtin_types = Module["___embind_register_native_and_builtin_types"] = function() { return (___embind_register_native_and_builtin_types = Module["___embind_register_native_and_builtin_types"] = Module["asm"]["aa"]).apply(null, arguments); }; var ___errno_location = Module["___errno_location"] = function() { return (___errno_location = Module["___errno_location"] = Module["asm"]["ba"]).apply(null, arguments); }; var _free = Module["_free"] = function() { return (_free = Module["_free"] = Module["asm"]["ca"]).apply(null, arguments); }; var dynCall_jiji = Module["dynCall_jiji"] = function() { return (dynCall_jiji = Module["dynCall_jiji"] = Module["asm"]["da"]).apply(null, arguments); }; var dynCall_viijii = Module["dynCall_viijii"] = function() { return (dynCall_viijii = Module["dynCall_viijii"] = Module["asm"]["ea"]).apply(null, arguments); }; var dynCall_iiiiiijj = Module["dynCall_iiiiiijj"] = function() { return (dynCall_iiiiiijj = Module["dynCall_iiiiiijj"] = Module["asm"]["fa"]).apply(null, arguments); }; var dynCall_iiiiij = Module["dynCall_iiiiij"] = function() { return (dynCall_iiiiij = Module["dynCall_iiiiij"] = Module["asm"]["ga"]).apply(null, arguments); }; var dynCall_iiiiijj = Module["dynCall_iiiiijj"] = function() { return (dynCall_iiiiijj = Module["dynCall_iiiiijj"] = Module["asm"]["ha"]).apply(null, arguments); }; Module["addRunDependency"] = addRunDependency; Module["removeRunDependency"] = removeRunDependency; Module["FS_createPath"] = FS.createPath; Module["FS_createDataFile"] = FS.createDataFile; Module["FS_createPreloadedFile"] = FS.createPreloadedFile; Module["FS_createLazyFile"] = FS.createLazyFile; Module["FS_createDevice"] = FS.createDevice; Module["FS_unlink"] = FS.unlink; Module["FS"] = FS; var calledRun; function ExitStatus(status) { this.name = "ExitStatus"; this.message = "Program terminated with exit(" + status + ")"; this.status = status; } dependenciesFulfilled = function runCaller() { if (!calledRun) run(); if (!calledRun) dependenciesFulfilled = runCaller; }; function callMain(args) { var entryFunction = Module["_main"]; var argc = 0; var argv = 0; try { var ret = entryFunction(argc, argv); exit(ret, true); } catch (e) { if (e instanceof ExitStatus) { return; } else if (e == "unwind") { noExitRuntime = true; return; } else { var toLog = e; if (e && typeof e === "object" && e.stack) { toLog = [e, e.stack]; } err("exception thrown: " + toLog); quit_(1, e); } } finally { } } function run(args) { if (runDependencies > 0) { return; } preRun(); if (runDependencies > 0) return; function doRun() { if (calledRun) return; calledRun = true; Module["calledRun"] = true; if (ABORT) return; initRuntime(); preMain(); readyPromiseResolve(Module); if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); if (shouldRunNow) callMain(); postRun(); } if (Module["setStatus"]) { Module["setStatus"]("Running..."); setTimeout(function() { setTimeout(function() { Module["setStatus"](""); }, 1); doRun(); }, 1); } else { doRun(); } } Module["run"] = run; function exit(status, implicit) { if (implicit && noExitRuntime && status === 0) { return; } if (noExitRuntime) ; else { if (Module["onExit"]) Module["onExit"](status); ABORT = true; } quit_(status, new ExitStatus(status)); } if (Module["preInit"]) { if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; while (Module["preInit"].length > 0) { Module["preInit"].pop()(); } } var shouldRunNow = true; if (Module["noInitialRun"]) shouldRunNow = false; noExitRuntime = true; run(); return WebIFCWasm3.ready; }; }(); if (typeof exports === "object" && typeof module === "object") module.exports = WebIFCWasm2; else if (typeof define === "function" && define["amd"]) define([], function() { return WebIFCWasm2; }); else if (typeof exports === "object") exports["WebIFCWasm"] = WebIFCWasm2; } }); // dist/ifc2x4.ts var IFCACTIONREQUEST = 3821786052; var IFCACTOR = 2296667514; var IFCACTORROLE = 3630933823; var IFCACTUATOR = 4288193352; var IFCACTUATORTYPE = 2874132201; var IFCADDRESS = 618182010; var IFCADVANCEDBREP = 1635779807; var IFCADVANCEDBREPWITHVOIDS = 2603310189; var IFCADVANCEDFACE = 3406155212; var IFCAIRTERMINAL = 1634111441; var IFCAIRTERMINALBOX = 177149247; var IFCAIRTERMINALBOXTYPE = 1411407467; var IFCAIRTERMINALTYPE = 3352864051; var IFCAIRTOAIRHEATRECOVERY = 2056796094; var IFCAIRTOAIRHEATRECOVERYTYPE = 1871374353; var IFCALARM = 3087945054; var IFCALARMTYPE = 3001207471; var IFCALIGNMENT = 325726236; var IFCALIGNMENT2DHORIZONTAL = 749761778; var IFCALIGNMENT2DHORIZONTALSEGMENT = 3199563722; var IFCALIGNMENT2DSEGMENT = 2483840362; var IFCALIGNMENT2DVERSEGCIRCULARARC = 3379348081; var IFCALIGNMENT2DVERSEGLINE = 3239324667; var IFCALIGNMENT2DVERSEGPARABOLICARC = 4263986512; var IFCALIGNMENT2DVERTICAL = 53199957; var IFCALIGNMENT2DVERTICALSEGMENT = 2029264950; var IFCALIGNMENTCURVE = 3512275521; var IFCANNOTATION = 1674181508; var IFCANNOTATIONFILLAREA = 669184980; var IFCAPPLICATION = 639542469; var IFCAPPLIEDVALUE = 411424972; var IFCAPPROVAL = 130549933; var IFCAPPROVALRELATIONSHIP = 3869604511; var IFCARBITRARYCLOSEDPROFILEDEF = 3798115385; var IFCARBITRARYOPENPROFILEDEF = 1310608509; var IFCARBITRARYPROFILEDEFWITHVOIDS = 2705031697; var IFCASSET = 3460190687; var IFCASYMMETRICISHAPEPROFILEDEF = 3207858831; var IFCAUDIOVISUALAPPLIANCE = 277319702; var IFCAUDIOVISUALAPPLIANCETYPE = 1532957894; var IFCAXIS1PLACEMENT = 4261334040; var IFCAXIS2PLACEMENT2D = 3125803723; var IFCAXIS2PLACEMENT3D = 2740243338; var IFCBSPLINECURVE = 1967976161; var IFCBSPLINECURVEWITHKNOTS = 2461110595; var IFCBSPLINESURFACE = 2887950389; var IFCBSPLINESURFACEWITHKNOTS = 167062518; var IFCBEAM = 753842376; var IFCBEAMSTANDARDCASE = 2906023776; var IFCBEAMTYPE = 819618141; var IFCBEARING = 4196446775; var IFCBEARINGTYPE = 3649138523; var IFCBLOBTEXTURE = 616511568; var IFCBLOCK = 1334484129; var IFCBOILER = 32344328; var IFCBOILERTYPE = 231477066; var IFCBOOLEANCLIPPINGRESULT = 3649129432; var IFCBOOLEANRESULT = 2736907675; var IFCBOUNDARYCONDITION = 4037036970; var IFCBOUNDARYCURVE = 1136057603; var IFCBOUNDARYEDGECONDITION = 1560379544; var IFCBOUNDARYFACECONDITION = 3367102660; var IFCBOUNDARYNODECONDITION = 1387855156; var IFCBOUNDARYNODECONDITIONWARPING = 2069777674; var IFCBOUNDEDCURVE = 1260505505; var IFCBOUNDEDSURFACE = 4182860854; var IFCBOUNDINGBOX = 2581212453; var IFCBOXEDHALFSPACE = 2713105998; var IFCBRIDGE = 644574406; var IFCBRIDGEPART = 963979645; var IFCBUILDING = 4031249490; var IFCBUILDINGELEMENT = 3299480353; var IFCBUILDINGELEMENTPART = 2979338954; var IFCBUILDINGELEMENTPARTTYPE = 39481116; var IFCBUILDINGELEMENTPROXY = 1095909175; var IFCBUILDINGELEMENTPROXYTYPE = 1909888760; var IFCBUILDINGELEMENTTYPE = 1950629157; var IFCBUILDINGSTOREY = 3124254112; var IFCBUILDINGSYSTEM = 1177604601; var IFCBURNER = 2938176219; var IFCBURNERTYPE = 2188180465; var IFCCSHAPEPROFILEDEF = 2898889636; var IFCCABLECARRIERFITTING = 635142910; var IFCCABLECARRIERFITTINGTYPE = 395041908; var IFCCABLECARRIERSEGMENT = 3758799889; var IFCCABLECARRIERSEGMENTTYPE = 3293546465; var IFCCABLEFITTING = 1051757585; var IFCCABLEFITTINGTYPE = 2674252688; var IFCCABLESEGMENT = 4217484030; var IFCCABLESEGMENTTYPE = 1285652485; var IFCCAISSONFOUNDATION = 3999819293; var IFCCAISSONFOUNDATIONTYPE = 3203706013; var IFCCARTESIANPOINT = 1123145078; var IFCCARTESIANPOINTLIST = 574549367; var IFCCARTESIANPOINTLIST2D = 1675464909; var IFCCARTESIANPOINTLIST3D = 2059837836; var IFCCARTESIANTRANSFORMATIONOPERATOR = 59481748; var IFCCARTESIANTRANSFORMATIONOPERATOR2D = 3749851601; var IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM = 3486308946; var IFCCARTESIANTRANSFORMATIONOPERATOR3D = 3331915920; var IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM = 1416205885; var IFCCENTERLINEPROFILEDEF = 3150382593; var IFCCHILLER = 3902619387; var IFCCHILLERTYPE = 2951183804; var IFCCHIMNEY = 3296154744; var IFCCHIMNEYTYPE = 2197970202; var IFCCIRCLE = 2611217952; var IFCCIRCLEHOLLOWPROFILEDEF = 2937912522; var IFCCIRCLEPROFILEDEF = 1383045692; var IFCCIRCULARARCSEGMENT2D = 1062206242; var IFCCIVILELEMENT = 1677625105; var IFCCIVILELEMENTTYPE = 3893394355; var IFCCLASSIFICATION = 747523909; var IFCCLASSIFICATIONREFERENCE = 647927063; var IFCCLOSEDSHELL = 2205249479; var IFCCOIL = 639361253; var IFCCOILTYPE = 2301859152; var IFCCOLOURRGB = 776857604; var IFCCOLOURRGBLIST = 3285139300; var IFCCOLOURSPECIFICATION = 3264961684; var IFCCOLUMN = 843113511; var IFCCOLUMNSTANDARDCASE = 905975707; var IFCCOLUMNTYPE = 300633059; var IFCCOMMUNICATIONSAPPLIANCE = 3221913625; var IFCCOMMUNICATIONSAPPLIANCETYPE = 400855858; var IFCCOMPLEXPROPERTY = 2542286263; var IFCCOMPLEXPROPERTYTEMPLATE = 3875453745; var IFCCOMPOSITECURVE = 3732776249; var IFCCOMPOSITECURVEONSURFACE = 15328376; var IFCCOMPOSITECURVESEGMENT = 2485617015; var IFCCOMPOSITEPROFILEDEF = 1485152156; var IFCCOMPRESSOR = 3571504051; var IFCCOMPRESSORTYPE = 3850581409; var IFCCONDENSER = 2272882330; var IFCCONDENSERTYPE = 2816379211; var IFCCONIC = 2510884976; var IFCCONNECTEDFACESET = 370225590; var IFCCONNECTIONCURVEGEOMETRY = 1981873012; var IFCCONNECTIONGEOMETRY = 2859738748; var IFCCONNECTIONPOINTECCENTRICITY = 45288368; var IFCCONNECTIONPOINTGEOMETRY = 2614616156; var IFCCONNECTIONSURFACEGEOMETRY = 2732653382; var IFCCONNECTIONVOLUMEGEOMETRY = 775493141; var IFCCONSTRAINT = 1959218052; var IFCCONSTRUCTIONEQUIPMENTRESOURCE = 3898045240; var IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE = 2185764099; var IFCCONSTRUCTIONMATERIALRESOURCE = 1060000209; var IFCCONSTRUCTIONMATERIALRESOURCETYPE = 4105962743; var IFCCONSTRUCTIONPRODUCTRESOURCE = 488727124; var IFCCONSTRUCTIONPRODUCTRESOURCETYPE = 1525564444; var IFCCONSTRUCTIONRESOURCE = 2559216714; var IFCCONSTRUCTIONRESOURCETYPE = 2574617495; var IFCCONTEXT = 3419103109; var IFCCONTEXTDEPENDENTUNIT = 3050246964; var IFCCONTROL = 3293443760; var IFCCONTROLLER = 25142252; var IFCCONTROLLERTYPE = 578613899; var IFCCONVERSIONBASEDUNIT = 2889183280; var IFCCONVERSIONBASEDUNITWITHOFFSET = 2713554722; var IFCCOOLEDBEAM = 4136498852; var IFCCOOLEDBEAMTYPE = 335055490; var IFCCOOLINGTOWER = 3640358203; var IFCCOOLINGTOWERTYPE = 2954562838; var IFCCOORDINATEOPERATION = 1785450214; var IFCCOORDINATEREFERENCESYSTEM = 1466758467; var IFCCOSTITEM = 3895139033; var IFCCOSTSCHEDULE = 1419761937; var IFCCOSTVALUE = 602808272; var IFCCOVERING = 1973544240; var IFCCOVERINGTYPE = 1916426348; var IFCCREWRESOURCE = 3295246426; var IFCCREWRESOURCETYPE = 1815067380; var IFCCSGPRIMITIVE3D = 2506170314; var IFCCSGSOLID = 2147822146; var IFCCURRENCYRELATIONSHIP = 539742890; var IFCCURTAINWALL = 3495092785; var IFCCURTAINWALLTYPE = 1457835157; var IFCCURVE = 2601014836; var IFCCURVEBOUNDEDPLANE = 2827736869; var IFCCURVEBOUNDEDSURFACE = 2629017746; var IFCCURVESEGMENT2D = 1186437898; var IFCCURVESTYLE = 3800577675; var IFCCURVESTYLEFONT = 1105321065; var IFCCURVESTYLEFONTANDSCALING = 2367409068; var IFCCURVESTYLEFONTPATTERN = 3510044353; var IFCCYLINDRICALSURFACE = 1213902940; var IFCDAMPER = 4074379575; var IFCDAMPERTYPE = 3961806047; var IFCDEEPFOUNDATION = 3426335179; var IFCDEEPFOUNDATIONTYPE = 1306400036; var IFCDERIVEDPROFILEDEF = 3632507154; var IFCDERIVEDUNIT = 1765591967; var IFCDERIVEDUNITELEMENT = 1045800335; var IFCDIMENSIONALEXPONENTS = 2949456006; var IFCDIRECTION = 32440307; var IFCDISCRETEACCESSORY = 1335981549; var IFCDISCRETEACCESSORYTYPE = 2635815018; var IFCDISTANCEEXPRESSION = 1945343521; var IFCDISTRIBUTIONCHAMBERELEMENT = 1052013943; var IFCDISTRIBUTIONCHAMBERELEMENTTYPE = 1599208980; var IFCDISTRIBUTIONCIRCUIT = 562808652; var IFCDISTRIBUTIONCONTROLELEMENT = 1062813311; var IFCDISTRIBUTIONCONTROLELEMENTTYPE = 2063403501; var IFCDISTRIBUTIONELEMENT = 1945004755; var IFCDISTRIBUTIONELEMENTTYPE = 3256556792; var IFCDISTRIBUTIONFLOWELEMENT = 3040386961; var IFCDISTRIBUTIONFLOWELEMENTTYPE = 3849074793; var IFCDISTRIBUTIONPORT = 3041715199; var IFCDISTRIBUTIONSYSTEM = 3205830791; var IFCDOCUMENTINFORMATION = 1154170062; var IFCDOCUMENTINFORMATIONRELATIONSHIP = 770865208; var IFCDOCUMENTREFERENCE = 3732053477; var IFCDOOR = 395920057; var IFCDOORLININGPROPERTIES = 2963535650; var IFCDOORPANELPROPERTIES = 1714330368; var IFCDOORSTANDARDCASE = 3242481149; var IFCDOORSTYLE = 526551008; var IFCDOORTYPE = 2323601079; var IFCDRAUGHTINGPREDEFINEDCOLOUR = 445594917; var IFCDRAUGHTINGPREDEFINEDCURVEFONT = 4006246654; var IFCDUCTFITTING = 342316401; var IFCDUCTFITTINGTYPE = 869906466; var IFCDUCTSEGMENT = 3518393246; var IFCDUCTSEGMENTTYPE = 3760055223; var IFCDUCTSILENCER = 1360408905; var IFCDUCTSILENCERTYPE = 2030761528; var IFCEDGE = 3900360178; var IFCEDGECURVE = 476780140; var IFCEDGELOOP = 1472233963; var IFCELECTRICAPPLIANCE = 1904799276; var IFCELECTRICAPPLIANCETYPE = 663422040; var IFCELECTRICDISTRIBUTIONBOARD = 862014818; var IFCELECTRICDISTRIBUTIONBOARDTYPE = 2417008758; var IFCELECTRICFLOWSTORAGEDEVICE = 3310460725; var IFCELECTRICFLOWSTORAGEDEVICETYPE = 3277789161; var IFCELECTRICGENERATOR = 264262732; var IFCELECTRICGENERATORTYPE = 1534661035; var IFCELECTRICMOTOR = 402227799; var IFCELECTRICMOTORTYPE = 1217240411; var IFCELECTRICTIMECONTROL = 1003880860; var IFCELECTRICTIMECONTROLTYPE = 712377611; var IFCELEMENT = 1758889154; var IFCELEMENTASSEMBLY = 4123344466; var IFCELEMENTASSEMBLYTYPE = 2397081782; var IFCELEMENTCOMPONENT = 1623761950; var IFCELEMENTCOMPONENTTYPE = 2590856083; var IFCELEMENTQUANTITY = 1883228015; var IFCELEMENTTYPE = 339256511; var IFCELEMENTARYSURFACE = 2777663545; var IFCELLIPSE = 1704287377; var IFCELLIPSEPROFILEDEF = 2835456948; var IFCENERGYCONVERSIONDEVICE = 1658829314; var IFCENERGYCONVERSIONDEVICETYPE = 2107101300; var IFCENGINE = 2814081492; var IFCENGINETYPE = 132023988; var IFCEVAPORATIVECOOLER = 3747195512; var IFCEVAPORATIVECOOLERTYPE = 3174744832; var IFCEVAPORATOR = 484807127; var IFCEVAPORATORTYPE = 3390157468; var IFCEVENT = 4148101412; var IFCEVENTTIME = 211053100; var IFCEVENTTYPE = 4024345920; var IFCEXTENDEDPROPERTIES = 297599258; var IFCEXTERNALINFORMATION = 4294318154; var IFCEXTERNALREFERENCE = 3200245327; var IFCEXTERNALREFERENCERELATIONSHIP = 1437805879; var IFCEXTERNALSPATIALELEMENT = 1209101575; var IFCEXTERNALSPATIALSTRUCTUREELEMENT = 2853485674; var IFCEXTERNALLYDEFINEDHATCHSTYLE = 2242383968; var IFCEXTERNALLYDEFINEDSURFACESTYLE = 1040185647; var IFCEXTERNALLYDEFINEDTEXTFONT = 3548104201; var IFCEXTRUDEDAREASOLID = 477187591; var IFCEXTRUDEDAREASOLIDTAPERED = 2804161546; var IFCFACE = 2556980723; var IFCFACEBASEDSURFACEMODEL = 2047409740; var IFCFACEBOUND = 1809719519; var IFCFACEOUTERBOUND = 803316827; var IFCFACESURFACE = 3008276851; var IFCFACETEDBREP = 807026263; var IFCFACETEDBREPWITHVOIDS = 3737207727; var IFCFACILITY = 24185140; var IFCFACILITYPART = 1310830890; var IFCFAILURECONNECTIONCONDITION = 4219587988; var IFCFAN = 3415622556; var IFCFANTYPE = 346874300; var IFCFASTENER = 647756555; var IFCFASTENERTYPE = 2489546625; var IFCFEATUREELEMENT = 2827207264; var IFCFEATUREELEMENTADDITION = 2143335405; var IFCFEATUREELEMENTSUBTRACTION = 1287392070; var IFCFILLAREASTYLE = 738692330; var IFCFILLAREASTYLEHATCHING = 374418227; var IFCFILLAREASTYLETILES = 315944413; var IFCFILTER = 819412036; var IFCFILTERTYPE = 1810631287; var IFCFIRESUPPRESSIONTERMINAL = 1426591983; var IFCFIRESUPPRESSIONTERMINALTYPE = 4222183408; var IFCFIXEDREFERENCESWEPTAREASOLID = 2652556860; var IFCFLOWCONTROLLER = 2058353004; var IFCFLOWCONTROLLERTYPE = 3907093117; var IFCFLOWFITTING = 4278956645; var IFCFLOWFITTINGTYPE = 3198132628; var IFCFLOWINSTRUMENT = 182646315; var IFCFLOWINSTRUMENTTYPE = 4037862832; var IFCFLOWMETER = 2188021234; var IFCFLOWMETERTYPE = 3815607619; var IFCFLOWMOVINGDEVICE = 3132237377; var IFCFLOWMOVINGDEVICETYPE = 1482959167; var IFCFLOWSEGMENT = 987401354; var IFCFLOWSEGMENTTYPE = 1834744321; var IFCFLOWSTORAGEDEVICE = 707683696; var IFCFLOWSTORAGEDEVICETYPE = 1339347760; var IFCFLOWTERMINAL = 2223149337; var IFCFLOWTERMINALTYPE = 2297155007; var IFCFLOWTREATMENTDEVICE = 3508470533; var IFCFLOWTREATMENTDEVICETYPE = 3009222698; var IFCFOOTING = 900683007; var IFCFOOTINGTYPE = 1893162501; var IFCFURNISHINGELEMENT = 263784265; var IFCFURNISHINGELEMENTTYPE = 4238390223; var IFCFURNITURE = 1509553395; var IFCFURNITURETYPE = 1268542332; var IFCGEOGRAPHICELEMENT = 3493046030; var IFCGEOGRAPHICELEMENTTYPE = 4095422895; var IFCGEOMETRICCURVESET = 987898635; var IFCGEOMETRICREPRESENTATIONCONTEXT = 3448662350; var IFCGEOMETRICREPRESENTATIONITEM = 2453401579; var IFCGEOMETRICREPRESENTATIONSUBCONTEXT = 4142052618; var IFCGEOMETRICSET = 3590301190; var IFCGRID = 3009204131; var IFCGRIDAXIS = 852622518; var IFCGRIDPLACEMENT = 178086475; var IFCGROUP = 2706460486; var IFCHALFSPACESOLID = 812098782; var IFCHEATEXCHANGER = 3319311131; var IFCHEATEXCHANGERTYPE = 1251058090; var IFCHUMIDIFIER = 2068733104; var IFCHUMIDIFIERTYPE = 1806887404; var IFCISHAPEPROFILEDEF = 1484403080; var IFCIMAGETEXTURE = 3905492369; var IFCINDEXEDCOLOURMAP = 3570813810; var IFCINDEXEDPOLYCURVE = 2571569899; var IFCINDEXEDPOLYGONALFACE = 178912537; var IFCINDEXEDPOLYGONALFACEWITHVOIDS = 2294589976; var IFCINDEXEDTEXTUREMAP = 1437953363; var IFCINDEXEDTRIANGLETEXTUREMAP = 2133299955; var IFCINTERCEPTOR = 4175244083; var IFCINTERCEPTORTYPE = 3946677679; var IFCINTERSECTIONCURVE = 3113134337; var IFCINVENTORY = 2391368822; var IFCIRREGULARTIMESERIES = 3741457305; var IFCIRREGULARTIMESERIESVALUE = 3020489413; var IFCJUNCTIONBOX = 2176052936; var IFCJUNCTIONBOXTYPE = 4288270099; var IFCLSHAPEPROFILEDEF = 572779678; var IFCLABORRESOURCE = 3827777499; var IFCLABORRESOURCETYPE = 428585644; var IFCLAGTIME = 1585845231; var IFCLAMP = 76236018; var IFCLAMPTYPE = 1051575348; var IFCLIBRARYINFORMATION = 2655187982; var IFCLIBRARYREFERENCE = 3452421091; var IFCLIGHTDISTRIBUTIONDATA = 4162380809; var IFCLIGHTFIXTURE = 629592764; var IFCLIGHTFIXTURETYPE = 1161773419; var IFCLIGHTINTENSITYDISTRIBUTION = 1566485204; var IFCLIGHTSOURCE = 1402838566; var IFCLIGHTSOURCEAMBIENT = 125510826; var IFCLIGHTSOURCEDIRECTIONAL = 2604431987; var IFCLIGHTSOURCEGONIOMETRIC = 4266656042; var IFCLIGHTSOURCEPOSITIONAL = 1520743889; var IFCLIGHTSOURCESPOT = 3422422726; var IFCLINE = 1281925730; var IFCLINESEGMENT2D = 3092502836; var IFCLINEARPLACEMENT = 388784114; var IFCLINEARPOSITIONINGELEMENT = 1154579445; var IFCLOCALPLACEMENT = 2624227202; var IFCLOOP = 1008929658; var IFCMANIFOLDSOLIDBREP = 1425443689; var IFCMAPCONVERSION = 3057273783; var IFCMAPPEDITEM = 2347385850; var IFCMATERIAL = 1838606355; var IFCMATERIALCLASSIFICATIONRELATIONSHIP = 1847130766; var IFCMATERIALCONSTITUENT = 3708119e3; var IFCMATERIALCONSTITUENTSET = 2852063980; var IFCMATERIALDEFINITION = 760658860; var IFCMATERIALDEFINITIONREPRESENTATION = 2022407955; var IFCMATERIALLAYER = 248100487; var IFCMATERIALLAYERSET = 3303938423; var IFCMATERIALLAYERSETUSAGE = 1303795690; var IFCMATERIALLAYERWITHOFFSETS = 1847252529; var IFCMATERIALLIST = 2199411900; var IFCMATERIALPROFILE = 2235152071; var IFCMATERIALPROFILESET = 164193824; var IFCMATERIALPROFILESETUSAGE = 3079605661; var IFCMATERIALPROFILESETUSAGETAPERING = 3404854881; var IFCMATERIALPROFILEWITHOFFSETS = 552965576; var IFCMATERIALPROPERTIES = 3265635763; var IFCMATERIALRELATIONSHIP = 853536259; var IFCMATERIALUSAGEDEFINITION = 1507914824; var IFCMEASUREWITHUNIT = 2597039031; var IFCMECHANICALFASTENER = 377706215; var IFCMECHANICALFASTENERTYPE = 2108223431; var IFCMEDICALDEVICE = 1437502449; var IFCMEDICALDEVICETYPE = 1114901282; var IFCMEMBER = 1073191201; var IFCMEMBERSTANDARDCASE = 1911478936; var IFCMEMBERTYPE = 3181161470; var IFCMETRIC = 3368373690; var IFCMIRROREDPROFILEDEF = 2998442950; var IFCMONETARYUNIT = 2706619895; var IFCMOTORCONNECTION = 2474470126; var IFCMOTORCONNECTIONTYPE = 977012517; var IFCNAMEDUNIT = 1918398963; var IFCOBJECT = 3888040117; var IFCOBJECTDEFINITION = 219451334; var IFCOBJECTPLACEMENT = 3701648758; var IFCOBJECTIVE = 2251480897; var IFCOCCUPANT = 4143007308; var IFCOFFSETCURVE = 590820931; var IFCOFFSETCURVE2D = 3388369263; var IFCOFFSETCURVE3D = 3505215534; var IFCOFFSETCURVEBYDISTANCES = 2485787929; var IFCOPENSHELL = 2665983363; var IFCOPENINGELEMENT = 3588315303; var IFCOPENINGSTANDARDCASE = 3079942009; var IFCORGANIZATION = 4251960020; var IFCORGANIZATIONRELATIONSHIP = 1411181986; var IFCORIENTATIONEXPRESSION = 643959842; var IFCORIENTEDEDGE = 1029017970; var IFCOUTERBOUNDARYCURVE = 144952367; var IFCOUTLET = 3694346114; var IFCOUTLETTYPE = 2837617999; var IFCOWNERHISTORY = 1207048766; var IFCPARAMETERIZEDPROFILEDEF = 2529465313; var IFCPATH = 2519244187; var IFCPCURVE = 1682466193; var IFCPERFORMANCEHISTORY = 2382730787; var IFCPERMEABLECOVERINGPROPERTIES = 3566463478; var IFCPERMIT = 3327091369; var IFCPERSON = 2077209135; var IFCPERSONANDORGANIZATION = 101040310; var IFCPHYSICALCOMPLEXQUANTITY = 3021840470; var IFCPHYSICALQUANTITY = 2483315170; var IFCPHYSICALSIMPLEQUANTITY = 2226359599; var IFCPILE = 1687234759; var IFCPILETYPE = 1158309216; var IFCPIPEFITTING = 310824031; var IFCPIPEFITTINGTYPE = 804291784; var IFCPIPESEGMENT = 3612865200; var IFCPIPESEGMENTTYPE = 4231323485; var IFCPIXELTEXTURE = 597895409; var IFCPLACEMENT = 2004835150; var IFCPLANARBOX = 603570806; var IFCPLANAREXTENT = 1663979128; var IFCPLANE = 220341763; var IFCPLATE = 3171933400; var IFCPLATESTANDARDCASE = 1156407060; var IFCPLATETYPE = 4017108033; var IFCPOINT = 2067069095; var IFCPOINTONCURVE = 4022376103; var IFCPOINTONSURFACE = 1423911732; var IFCPOLYLOOP = 2924175390; var IFCPOLYGONALBOUNDEDHALFSPACE = 2775532180; var IFCPOLYGONALFACESET = 2839578677; var IFCPOLYLINE = 3724593414; var IFCPORT = 3740093272; var IFCPOSITIONINGELEMENT = 1946335990; var IFCPOSTALADDRESS = 3355820592; var IFCPREDEFINEDCOLOUR = 759155922; var IFCPREDEFINEDCURVEFONT = 2559016684; var IFCPREDEFINEDITEM = 3727388367; var IFCPREDEFINEDPROPERTIES = 3778827333; var IFCPREDEFINEDPROPERTYSET = 3967405729; var IFCPREDEFINEDTEXTFONT = 1775413392; var IFCPRESENTATIONITEM = 677532197; var IFCPRESENTATIONLAYERASSIGNMENT = 2022622350; var IFCPRESENTATIONLAYERWITHSTYLE = 1304840413; var IFCPRESENTATIONSTYLE = 3119450353; var IFCPRESENTATIONSTYLEASSIGNMENT = 2417041796; var IFCPROCEDURE = 2744685151; var IFCPROCEDURETYPE = 569719735; var IFCPROCESS = 2945172077; var IFCPRODUCT = 4208778838; var IFCPRODUCTDEFINITIONSHAPE = 673634403; var IFCPRODUCTREPRESENTATION = 2095639259; var IFCPROFILEDEF = 3958567839; var IFCPROFILEPROPERTIES = 2802850158; var IFCPROJECT = 103090709; var IFCPROJECTLIBRARY = 653396225; var IFCPROJECTORDER = 2904328755; var IFCPROJECTEDCRS = 3843373140; var IFCPROJECTIONELEMENT = 3651124850; var IFCPROPERTY = 2598011224; var IFCPROPERTYABSTRACTION = 986844984; var IFCPROPERTYBOUNDEDVALUE = 871118103; var IFCPROPERTYDEFINITION = 1680319473; var IFCPROPERTYDEPENDENCYRELATIONSHIP = 148025276; var IFCPROPERTYENUMERATEDVALUE = 4166981789; var IFCPROPERTYENUMERATION = 3710013099; var IFCPROPERTYLISTVALUE = 2752243245; var IFCPROPERTYREFERENCEVALUE = 941946838; var IFCPROPERTYSET = 1451395588; var IFCPROPERTYSETDEFINITION = 3357820518; var IFCPROPERTYSETTEMPLATE = 492091185; var IFCPROPERTYSINGLEVALUE = 3650150729; var IFCPROPERTYTABLEVALUE = 110355661; var IFCPROPERTYTEMPLATE = 3521284610; var IFCPROPERTYTEMPLATEDEFINITION = 1482703590; var IFCPROTECTIVEDEVICE = 738039164; var IFCPROTECTIVEDEVICETRIPPINGUNIT = 2295281155; var IFCPROTECTIVEDEVICETRIPPINGUNITTYPE = 655969474; var IFCPROTECTIVEDEVICETYPE = 1842657554; var IFCPROXY = 3219374653; var IFCPUMP = 90941305; var IFCPUMPTYPE = 2250791053; var IFCQUANTITYAREA = 2044713172; var IFCQUANTITYCOUNT = 2093928680; var IFCQUANTITYLENGTH = 931644368; var IFCQUANTITYSET = 2090586900; var IFCQUANTITYTIME = 3252649465; var IFCQUANTITYVOLUME = 2405470396; var IFCQUANTITYWEIGHT = 825690147; var IFCRAILING = 2262370178; var IFCRAILINGTYPE = 2893384427; var IFCRAMP = 3024970846; var IFCRAMPFLIGHT = 3283111854; var IFCRAMPFLIGHTTYPE = 2324767716; var IFCRAMPTYPE = 1469900589; var IFCRATIONALBSPLINECURVEWITHKNOTS = 1232101972; var IFCRATIONALBSPLINESURFACEWITHKNOTS = 683857671; var IFCRECTANGLEHOLLOWPROFILEDEF = 2770003689; var IFCRECTANGLEPROFILEDEF = 3615266464; var IFCRECTANGULARPYRAMID = 2798486643; var IFCRECTANGULARTRIMMEDSURFACE = 3454111270; var IFCRECURRENCEPATTERN = 3915482550; var IFCREFERENCE = 2433181523; var IFCREFERENT = 4021432810; var IFCREGULARTIMESERIES = 3413951693; var IFCREINFORCEMENTBARPROPERTIES = 1580146022; var IFCREINFORCEMENTDEFINITIONPROPERTIES = 3765753017; var IFCREINFORCINGBAR = 979691226; var IFCREINFORCINGBARTYPE = 2572171363; var IFCREINFORCINGELEMENT = 3027567501; var IFCREINFORCINGELEMENTTYPE = 964333572; var IFCREINFORCINGMESH = 2320036040; var IFCREINFORCINGMESHTYPE = 2310774935; var IFCRELAGGREGATES = 160246688; var IFCRELASSIGNS = 3939117080; var IFCRELASSIGNSTOACTOR = 1683148259; var IFCRELASSIGNSTOCONTROL = 2495723537; var IFCRELASSIGNSTOGROUP = 1307041759; var IFCRELASSIGNSTOGROUPBYFACTOR = 1027710054; var IFCRELASSIGNSTOPROCESS = 4278684876; var IFCRELASSIGNSTOPRODUCT = 2857406711; var IFCRELASSIGNSTORESOURCE = 205026976; var IFCRELASSOCIATES = 1865459582; var IFCRELASSOCIATESAPPROVAL = 4095574036; var IFCRELASSOCIATESCLASSIFICATION = 919958153; var IFCRELASSOCIATESCONSTRAINT = 2728634034; var IFCRELASSOCIATESDOCUMENT = 982818633; var IFCRELASSOCIATESLIBRARY = 3840914261; var IFCRELASSOCIATESMATERIAL = 2655215786; var IFCRELCONNECTS = 826625072; var IFCRELCONNECTSELEMENTS = 1204542856; var IFCRELCONNECTSPATHELEMENTS = 3945020480; var IFCRELCONNECTSPORTTOELEMENT = 4201705270; var IFCRELCONNECTSPORTS = 3190031847; var IFCRELCONNECTSSTRUCTURALACTIVITY = 2127690289; var IFCRELCONNECTSSTRUCTURALMEMBER = 1638771189; var IFCRELCONNECTSWITHECCENTRICITY = 504942748; var IFCRELCONNECTSWITHREALIZINGELEMENTS = 3678494232; var IFCRELCONTAINEDINSPATIALSTRUCTURE = 3242617779; var IFCRELCOVERSBLDGELEMENTS = 886880790; var IFCRELCOVERSSPACES = 2802773753; var IFCRELDECLARES = 2565941209; var IFCRELDECOMPOSES = 2551354335; var IFCRELDEFINES = 693640335; var IFCRELDEFINESBYOBJECT = 1462361463; var IFCRELDEFINESBYPROPERTIES = 4186316022; var IFCRELDEFINESBYTEMPLATE = 307848117; var IFCRELDEFINESBYTYPE = 781010003; var IFCRELFILLSELEMENT = 3940055652; var IFCRELFLOWCONTROLELEMENTS = 279856033; var IFCRELINTERFERESELEMENTS = 427948657; var IFCRELNESTS = 3268803585; var IFCRELPOSITIONS = 1441486842; var IFCRELPROJECTSELEMENT = 750771296; var IFCRELREFERENCEDINSPATIALSTRUCTURE = 1245217292; var IFCRELSEQUENCE = 4122056220; var IFCRELSERVICESBUILDINGS = 366585022; var IFCRELSPACEBOUNDARY = 3451746338; var IFCRELSPACEBOUNDARY1STLEVEL = 3523091289; var IFCRELSPACEBOUNDARY2NDLEVEL = 1521410863; var IFCRELVOIDSELEMENT = 1401173127; var IFCRELATIONSHIP = 478536968; var IFCREPARAMETRISEDCOMPOSITECURVESEGMENT = 816062949; var IFCREPRESENTATION = 1076942058; var IFCREPRESENTATIONCONTEXT = 3377609919; var IFCREPRESENTATIONITEM = 3008791417; var IFCREPRESENTATIONMAP = 1660063152; var IFCRESOURCE = 2914609552; var IFCRESOURCEAPPROVALRELATIONSHIP = 2943643501; var IFCRESOURCECONSTRAINTRELATIONSHIP = 1608871552; var IFCRESOURCELEVELRELATIONSHIP = 2439245199; var IFCRESOURCETIME = 1042787934; var IFCREVOLVEDAREASOLID = 1856042241; var IFCREVOLVEDAREASOLIDTAPERED = 3243963512; var IFCRIGHTCIRCULARCONE = 4158566097; var IFCRIGHTCIRCULARCYLINDER = 3626867408; var IFCROOF = 2016517767; var IFCROOFTYPE = 2781568857; var IFCROOT = 2341007311; var IFCROUNDEDRECTANGLEPROFILEDEF = 2778083089; var IFCSIUNIT = 448429030; var IFCSANITARYTERMINAL = 3053780830; var IFCSANITARYTERMINALTYPE = 1768891740; var IFCSCHEDULINGTIME = 1054537805; var IFCSEAMCURVE = 2157484638; var IFCSECTIONPROPERTIES = 2042790032; var IFCSECTIONREINFORCEMENTPROPERTIES = 4165799628; var IFCSECTIONEDSOLID = 1862484736; var IFCSECTIONEDSOLIDHORIZONTAL = 1290935644; var IFCSECTIONEDSPINE = 1509187699; var IFCSENSOR = 4086658281; var IFCSENSORTYPE = 1783015770; var IFCSHADINGDEVICE = 1329646415; var IFCSHADINGDEVICETYPE = 4074543187; var IFCSHAPEASPECT = 867548509; var IFCSHAPEMODEL = 3982875396; var IFCSHAPEREPRESENTATION = 4240577450; var IFCSHELLBASEDSURFACEMODEL = 4124623270; var IFCSIMPLEPROPERTY = 3692461612; var IFCSIMPLEPROPERTYTEMPLATE = 3663146110; var IFCSITE = 4097777520; var IFCSLAB = 1529196076; var IFCSLABELEMENTEDCASE = 3127900445; var IFCSLABSTANDARDCASE = 3027962421; var IFCSLABTYPE = 2533589738; var IFCSLIPPAGECONNECTIONCONDITION = 2609359061; var IFCSOLARDEVICE = 3420628829; var IFCSOLARDEVICETYPE = 1072016465; var IFCSOLIDMODEL = 723233188; var IFCSPACE = 3856911033; var IFCSPACEHEATER = 1999602285; var IFCSPACEHEATERTYPE = 1305183839; var IFCSPACETYPE = 3812236995; var IFCSPATIALELEMENT = 1412071761; var IFCSPATIALELEMENTTYPE = 710998568; var IFCSPATIALSTRUCTUREELEMENT = 2706606064; var IFCSPATIALSTRUCTUREELEMENTTYPE = 3893378262; var IFCSPATIALZONE = 463610769; var IFCSPATIALZONETYPE = 2481509218; var IFCSPHERE = 451544542; var IFCSPHERICALSURFACE = 4015995234; var IFCSTACKTERMINAL = 1404847402; var IFCSTACKTERMINALTYPE = 3112655638; var IFCSTAIR = 331165859; var IFCSTAIRFLIGHT = 4252922144; var IFCSTAIRFLIGHTTYPE = 1039846685; var IFCSTAIRTYPE = 338393293; var IFCSTRUCTURALACTION = 682877961; var IFCSTRUCTURALACTIVITY = 3544373492; var IFCSTRUCTURALANALYSISMODEL = 2515109513; var IFCSTRUCTURALCONNECTION = 1179482911; var IFCSTRUCTURALCONNECTIONCONDITION = 2273995522; var IFCSTRUCTURALCURVEACTION = 1004757350; var IFCSTRUCTURALCURVECONNECTION = 4243806635; var IFCSTRUCTURALCURVEMEMBER = 214636428; var IFCSTRUCTURALCURVEMEMBERVARYING = 2445595289; var IFCSTRUCTURALCURVEREACTION = 2757150158; var IFCSTRUCTURALITEM = 3136571912; var IFCSTRUCTURALLINEARACTION = 1807405624; var IFCSTRUCTURALLOAD = 2162789131; var IFCSTRUCTURALLOADCASE = 385403989; var IFCSTRUCTURALLOADCONFIGURATION = 3478079324; var IFCSTRUCTURALLOADGROUP = 1252848954; var IFCSTRUCTURALLOADLINEARFORCE = 1595516126; var IFCSTRUCTURALLOADORRESULT = 609421318; var IFCSTRUCTURALLOADPLANARFORCE = 2668620305; var IFCSTRUCTURALLOADSINGLEDISPLACEMENT = 2473145415; var IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION = 1973038258; var IFCSTRUCTURALLOADSINGLEFORCE = 1597423693; var IFCSTRUCTURALLOADSINGLEFORCEWARPING = 1190533807; var IFCSTRUCTURALLOADSTATIC = 2525727697; var IFCSTRUCTURALLOADTEMPERATURE = 3408363356; var IFCSTRUCTURALMEMBER = 530289379; var IFCSTRUCTURALPLANARACTION = 1621171031; var IFCSTRUCTURALPOINTACTION = 2082059205; var IFCSTRUCTURALPOINTCONNECTION = 734778138; var IFCSTRUCTURALPOINTREACTION = 1235345126; var IFCSTRUCTURALREACTION = 3689010777; var IFCSTRUCTURALRESULTGROUP = 2986769608; var IFCSTRUCTURALSURFACEACTION = 3657597509; var IFCSTRUCTURALSURFACECONNECTION = 1975003073; var IFCSTRUCTURALSURFACEMEMBER = 3979015343; var IFCSTRUCTURALSURFACEMEMBERVARYING = 2218152070; var IFCSTRUCTURALSURFACEREACTION = 603775116; var IFCSTYLEMODEL = 2830218821; var IFCSTYLEDITEM = 3958052878; var IFCSTYLEDREPRESENTATION = 3049322572; var IFCSUBCONTRACTRESOURCE = 148013059; var IFCSUBCONTRACTRESOURCETYPE = 4095615324; var IFCSUBEDGE = 2233826070; var IFCSURFACE = 2513912981; var IFCSURFACECURVE = 699246055; var IFCSURFACECURVESWEPTAREASOLID = 2028607225; var IFCSURFACEFEATURE = 3101698114; var IFCSURFACEOFLINEAREXTRUSION = 2809605785; var IFCSURFACEOFREVOLUTION = 4124788165; var IFCSURFACEREINFORCEMENTAREA = 2934153892; var IFCSURFACESTYLE = 1300840506; var IFCSURFACESTYLELIGHTING = 3303107099; var IFCSURFACESTYLEREFRACTION = 1607154358; var IFCSURFACESTYLERENDERING = 1878645084; var IFCSURFACESTYLESHADING = 846575682; var IFCSURFACESTYLEWITHTEXTURES = 1351298697; var IFCSURFACETEXTURE = 626085974; var IFCSWEPTAREASOLID = 2247615214; var IFCSWEPTDISKSOLID = 1260650574; var IFCSWEPTDISKSOLIDPOLYGONAL = 1096409881; var IFCSWEPTSURFACE = 230924584; var IFCSWITCHINGDEVICE = 1162798199; var IFCSWITCHINGDEVICETYPE = 2315554128; var IFCSYSTEM = 2254336722; var IFCSYSTEMFURNITUREELEMENT = 413509423; var IFCSYSTEMFURNITUREELEMENTTYPE = 1580310250; var IFCTSHAPEPROFILEDEF = 3071757647; var IFCTABLE = 985171141; var IFCTABLECOLUMN = 2043862942; var IFCTABLEROW = 531007025; var IFCTANK = 812556717; var IFCTANKTYPE = 5716631; var IFCTASK = 3473067441; var IFCTASKTIME = 1549132990; var IFCTASKTIMERECURRING = 2771591690; var IFCTASKTYPE = 3206491090; var IFCTELECOMADDRESS = 912023232; var IFCTENDON = 3824725483; var IFCTENDONANCHOR = 2347447852; var IFCTENDONANCHORTYPE = 3081323446; var IFCTENDONCONDUIT = 3663046924; var IFCTENDONCONDUITTYPE = 2281632017; var IFCTENDONTYPE = 2415094496; var IFCTESSELLATEDFACESET = 2387106220; var IFCTESSELLATEDITEM = 901063453; var IFCTEXTLITERAL = 4282788508; var IFCTEXTLITERALWITHEXTENT = 3124975700; var IFCTEXTSTYLE = 1447204868; var IFCTEXTSTYLEFONTMODEL = 1983826977; var IFCTEXTSTYLEFORDEFINEDFONT = 2636378356; var IFCTEXTSTYLETEXTMODEL = 1640371178; var IFCTEXTURECOORDINATE = 280115917; var IFCTEXTURECOORDINATEGENERATOR = 1742049831; var IFCTEXTUREMAP = 2552916305; var IFCTEXTUREVERTEX = 1210645708; var IFCTEXTUREVERTEXLIST = 3611470254; var IFCTIMEPERIOD = 1199560280; var IFCTIMESERIES = 3101149627; var IFCTIMESERIESVALUE = 581633288; var IFCTOPOLOGICALREPRESENTATIONITEM = 1377556343; var IFCTOPOLOGYREPRESENTATION = 1735638870; var IFCTOROIDALSURFACE = 1935646853; var IFCTRANSFORMER = 3825984169; var IFCTRANSFORMERTYPE = 1692211062; var IFCTRANSITIONCURVESEGMENT2D = 2595432518; var IFCTRANSPORTELEMENT = 1620046519; var IFCTRANSPORTELEMENTTYPE = 2097647324; var IFCTRAPEZIUMPROFILEDEF = 2715220739; var IFCTRIANGULATEDFACESET = 2916149573; var IFCTRIANGULATEDIRREGULARNETWORK = 1229763772; var IFCTRIMMEDCURVE = 3593883385; var IFCTUBEBUNDLE = 3026737570; var IFCTUBEBUNDLETYPE = 1600972822; var IFCTYPEOBJECT = 1628702193; var IFCTYPEPROCESS = 3736923433; var IFCTYPEPRODUCT = 2347495698; var IFCTYPERESOURCE = 3698973494; var IFCUSHAPEPROFILEDEF = 427810014; var IFCUNITASSIGNMENT = 180925521; var IFCUNITARYCONTROLELEMENT = 630975310; var IFCUNITARYCONTROLELEMENTTYPE = 3179687236; var IFCUNITARYEQUIPMENT = 4292641817; var IFCUNITARYEQUIPMENTTYPE = 1911125066; var IFCVALVE = 4207607924; var IFCVALVETYPE = 728799441; var IFCVECTOR = 1417489154; var IFCVERTEX = 2799835756; var IFCVERTEXLOOP = 2759199220; var IFCVERTEXPOINT = 1907098498; var IFCVIBRATIONDAMPER = 1530820697; var IFCVIBRATIONDAMPERTYPE = 3956297820; var IFCVIBRATIONISOLATOR = 2391383451; var IFCVIBRATIONISOLATORTYPE = 3313531582; var IFCVIRTUALELEMENT = 2769231204; var IFCVIRTUALGRIDINTERSECTION = 891718957; var IFCVOIDINGFEATURE = 926996030; var IFCWALL = 2391406946; var IFCWALLELEMENTEDCASE = 4156078855; var IFCWALLSTANDARDCASE = 3512223829; var IFCWALLTYPE = 1898987631; var IFCWASTETERMINAL = 4237592921; var IFCWASTETERMINALTYPE = 1133259667; var IFCWINDOW = 3304561284; var IFCWINDOWLININGPROPERTIES = 336235671; var IFCWINDOWPANELPROPERTIES = 512836454; var IFCWINDOWSTANDARDCASE = 486154966; var IFCWINDOWSTYLE = 1299126871; var IFCWINDOWTYPE = 4009809668; var IFCWORKCALENDAR = 4088093105; var IFCWORKCONTROL = 1028945134; var IFCWORKPLAN = 4218914973; var IFCWORKSCHEDULE = 3342526732; var IFCWORKTIME = 1236880293; var IFCZSHAPEPROFILEDEF = 2543172580; var IFCZONE = 1033361043; // dist/ifc2x4_helper.ts var FromRawLineData = {}; FromRawLineData[IFCACTIONREQUEST] = (d) => { return IfcActionRequest.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCACTOR] = (d) => { return IfcActor.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCACTORROLE] = (d) => { return IfcActorRole.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCACTUATOR] = (d) => { return IfcActuator.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCACTUATORTYPE] = (d) => { return IfcActuatorType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCADDRESS] = (d) => { return IfcAddress.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCADVANCEDBREP] = (d) => { return IfcAdvancedBrep.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCADVANCEDBREPWITHVOIDS] = (d) => { return IfcAdvancedBrepWithVoids.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCADVANCEDFACE] = (d) => { return IfcAdvancedFace.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAIRTERMINAL] = (d) => { return IfcAirTerminal.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAIRTERMINALBOX] = (d) => { return IfcAirTerminalBox.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAIRTERMINALBOXTYPE] = (d) => { return IfcAirTerminalBoxType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAIRTERMINALTYPE] = (d) => { return IfcAirTerminalType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAIRTOAIRHEATRECOVERY] = (d) => { return IfcAirToAirHeatRecovery.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAIRTOAIRHEATRECOVERYTYPE] = (d) => { return IfcAirToAirHeatRecoveryType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCALARM] = (d) => { return IfcAlarm.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCALARMTYPE] = (d) => { return IfcAlarmType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCALIGNMENT] = (d) => { return IfcAlignment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCALIGNMENT2DHORIZONTAL] = (d) => { return IfcAlignment2DHorizontal.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCALIGNMENT2DHORIZONTALSEGMENT] = (d) => { return IfcAlignment2DHorizontalSegment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCALIGNMENT2DSEGMENT] = (d) => { return IfcAlignment2DSegment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCALIGNMENT2DVERSEGCIRCULARARC] = (d) => { return IfcAlignment2DVerSegCircularArc.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCALIGNMENT2DVERSEGLINE] = (d) => { return IfcAlignment2DVerSegLine.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCALIGNMENT2DVERSEGPARABOLICARC] = (d) => { return IfcAlignment2DVerSegParabolicArc.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCALIGNMENT2DVERTICAL] = (d) => { return IfcAlignment2DVertical.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCALIGNMENT2DVERTICALSEGMENT] = (d) => { return IfcAlignment2DVerticalSegment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCALIGNMENTCURVE] = (d) => { return IfcAlignmentCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCANNOTATION] = (d) => { return IfcAnnotation.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCANNOTATIONFILLAREA] = (d) => { return IfcAnnotationFillArea.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAPPLICATION] = (d) => { return IfcApplication.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAPPLIEDVALUE] = (d) => { return IfcAppliedValue.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAPPROVAL] = (d) => { return IfcApproval.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAPPROVALRELATIONSHIP] = (d) => { return IfcApprovalRelationship.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCARBITRARYCLOSEDPROFILEDEF] = (d) => { return IfcArbitraryClosedProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCARBITRARYOPENPROFILEDEF] = (d) => { return IfcArbitraryOpenProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCARBITRARYPROFILEDEFWITHVOIDS] = (d) => { return IfcArbitraryProfileDefWithVoids.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCASSET] = (d) => { return IfcAsset.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCASYMMETRICISHAPEPROFILEDEF] = (d) => { return IfcAsymmetricIShapeProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAUDIOVISUALAPPLIANCE] = (d) => { return IfcAudioVisualAppliance.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAUDIOVISUALAPPLIANCETYPE] = (d) => { return IfcAudioVisualApplianceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAXIS1PLACEMENT] = (d) => { return IfcAxis1Placement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAXIS2PLACEMENT2D] = (d) => { return IfcAxis2Placement2D.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCAXIS2PLACEMENT3D] = (d) => { return IfcAxis2Placement3D.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBSPLINECURVE] = (d) => { return IfcBSplineCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBSPLINECURVEWITHKNOTS] = (d) => { return IfcBSplineCurveWithKnots.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBSPLINESURFACE] = (d) => { return IfcBSplineSurface.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBSPLINESURFACEWITHKNOTS] = (d) => { return IfcBSplineSurfaceWithKnots.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBEAM] = (d) => { return IfcBeam.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBEAMSTANDARDCASE] = (d) => { return IfcBeamStandardCase.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBEAMTYPE] = (d) => { return IfcBeamType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBEARING] = (d) => { return IfcBearing.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBEARINGTYPE] = (d) => { return IfcBearingType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBLOBTEXTURE] = (d) => { return IfcBlobTexture.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBLOCK] = (d) => { return IfcBlock.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBOILER] = (d) => { return IfcBoiler.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBOILERTYPE] = (d) => { return IfcBoilerType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBOOLEANCLIPPINGRESULT] = (d) => { return IfcBooleanClippingResult.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBOOLEANRESULT] = (d) => { return IfcBooleanResult.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBOUNDARYCONDITION] = (d) => { return IfcBoundaryCondition.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBOUNDARYCURVE] = (d) => { return IfcBoundaryCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBOUNDARYEDGECONDITION] = (d) => { return IfcBoundaryEdgeCondition.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBOUNDARYFACECONDITION] = (d) => { return IfcBoundaryFaceCondition.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBOUNDARYNODECONDITION] = (d) => { return IfcBoundaryNodeCondition.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBOUNDARYNODECONDITIONWARPING] = (d) => { return IfcBoundaryNodeConditionWarping.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBOUNDEDCURVE] = (d) => { return IfcBoundedCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBOUNDEDSURFACE] = (d) => { return IfcBoundedSurface.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBOUNDINGBOX] = (d) => { return IfcBoundingBox.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBOXEDHALFSPACE] = (d) => { return IfcBoxedHalfSpace.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBRIDGE] = (d) => { return IfcBridge.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBRIDGEPART] = (d) => { return IfcBridgePart.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBUILDING] = (d) => { return IfcBuilding.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBUILDINGELEMENT] = (d) => { return IfcBuildingElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBUILDINGELEMENTPART] = (d) => { return IfcBuildingElementPart.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBUILDINGELEMENTPARTTYPE] = (d) => { return IfcBuildingElementPartType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBUILDINGELEMENTPROXY] = (d) => { return IfcBuildingElementProxy.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBUILDINGELEMENTPROXYTYPE] = (d) => { return IfcBuildingElementProxyType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBUILDINGELEMENTTYPE] = (d) => { return IfcBuildingElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBUILDINGSTOREY] = (d) => { return IfcBuildingStorey.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBUILDINGSYSTEM] = (d) => { return IfcBuildingSystem.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBURNER] = (d) => { return IfcBurner.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCBURNERTYPE] = (d) => { return IfcBurnerType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCSHAPEPROFILEDEF] = (d) => { return IfcCShapeProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCABLECARRIERFITTING] = (d) => { return IfcCableCarrierFitting.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCABLECARRIERFITTINGTYPE] = (d) => { return IfcCableCarrierFittingType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCABLECARRIERSEGMENT] = (d) => { return IfcCableCarrierSegment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCABLECARRIERSEGMENTTYPE] = (d) => { return IfcCableCarrierSegmentType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCABLEFITTING] = (d) => { return IfcCableFitting.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCABLEFITTINGTYPE] = (d) => { return IfcCableFittingType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCABLESEGMENT] = (d) => { return IfcCableSegment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCABLESEGMENTTYPE] = (d) => { return IfcCableSegmentType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCAISSONFOUNDATION] = (d) => { return IfcCaissonFoundation.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCAISSONFOUNDATIONTYPE] = (d) => { return IfcCaissonFoundationType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCARTESIANPOINT] = (d) => { return IfcCartesianPoint.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCARTESIANPOINTLIST] = (d) => { return IfcCartesianPointList.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCARTESIANPOINTLIST2D] = (d) => { return IfcCartesianPointList2D.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCARTESIANPOINTLIST3D] = (d) => { return IfcCartesianPointList3D.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCARTESIANTRANSFORMATIONOPERATOR] = (d) => { return IfcCartesianTransformationOperator.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCARTESIANTRANSFORMATIONOPERATOR2D] = (d) => { return IfcCartesianTransformationOperator2D.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM] = (d) => { return IfcCartesianTransformationOperator2DnonUniform.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCARTESIANTRANSFORMATIONOPERATOR3D] = (d) => { return IfcCartesianTransformationOperator3D.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM] = (d) => { return IfcCartesianTransformationOperator3DnonUniform.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCENTERLINEPROFILEDEF] = (d) => { return IfcCenterLineProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCHILLER] = (d) => { return IfcChiller.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCHILLERTYPE] = (d) => { return IfcChillerType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCHIMNEY] = (d) => { return IfcChimney.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCHIMNEYTYPE] = (d) => { return IfcChimneyType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCIRCLE] = (d) => { return IfcCircle.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCIRCLEHOLLOWPROFILEDEF] = (d) => { return IfcCircleHollowProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCIRCLEPROFILEDEF] = (d) => { return IfcCircleProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCIRCULARARCSEGMENT2D] = (d) => { return IfcCircularArcSegment2D.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCIVILELEMENT] = (d) => { return IfcCivilElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCIVILELEMENTTYPE] = (d) => { return IfcCivilElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCLASSIFICATION] = (d) => { return IfcClassification.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCLASSIFICATIONREFERENCE] = (d) => { return IfcClassificationReference.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCLOSEDSHELL] = (d) => { return IfcClosedShell.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOIL] = (d) => { return IfcCoil.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOILTYPE] = (d) => { return IfcCoilType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOLOURRGB] = (d) => { return IfcColourRgb.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOLOURRGBLIST] = (d) => { return IfcColourRgbList.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOLOURSPECIFICATION] = (d) => { return IfcColourSpecification.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOLUMN] = (d) => { return IfcColumn.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOLUMNSTANDARDCASE] = (d) => { return IfcColumnStandardCase.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOLUMNTYPE] = (d) => { return IfcColumnType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOMMUNICATIONSAPPLIANCE] = (d) => { return IfcCommunicationsAppliance.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOMMUNICATIONSAPPLIANCETYPE] = (d) => { return IfcCommunicationsApplianceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOMPLEXPROPERTY] = (d) => { return IfcComplexProperty.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOMPLEXPROPERTYTEMPLATE] = (d) => { return IfcComplexPropertyTemplate.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOMPOSITECURVE] = (d) => { return IfcCompositeCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOMPOSITECURVEONSURFACE] = (d) => { return IfcCompositeCurveOnSurface.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOMPOSITECURVESEGMENT] = (d) => { return IfcCompositeCurveSegment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOMPOSITEPROFILEDEF] = (d) => { return IfcCompositeProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOMPRESSOR] = (d) => { return IfcCompressor.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOMPRESSORTYPE] = (d) => { return IfcCompressorType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONDENSER] = (d) => { return IfcCondenser.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONDENSERTYPE] = (d) => { return IfcCondenserType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONIC] = (d) => { return IfcConic.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONNECTEDFACESET] = (d) => { return IfcConnectedFaceSet.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONNECTIONCURVEGEOMETRY] = (d) => { return IfcConnectionCurveGeometry.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONNECTIONGEOMETRY] = (d) => { return IfcConnectionGeometry.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONNECTIONPOINTECCENTRICITY] = (d) => { return IfcConnectionPointEccentricity.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONNECTIONPOINTGEOMETRY] = (d) => { return IfcConnectionPointGeometry.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONNECTIONSURFACEGEOMETRY] = (d) => { return IfcConnectionSurfaceGeometry.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONNECTIONVOLUMEGEOMETRY] = (d) => { return IfcConnectionVolumeGeometry.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONSTRAINT] = (d) => { return IfcConstraint.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONSTRUCTIONEQUIPMENTRESOURCE] = (d) => { return IfcConstructionEquipmentResource.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE] = (d) => { return IfcConstructionEquipmentResourceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONSTRUCTIONMATERIALRESOURCE] = (d) => { return IfcConstructionMaterialResource.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONSTRUCTIONMATERIALRESOURCETYPE] = (d) => { return IfcConstructionMaterialResourceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONSTRUCTIONPRODUCTRESOURCE] = (d) => { return IfcConstructionProductResource.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONSTRUCTIONPRODUCTRESOURCETYPE] = (d) => { return IfcConstructionProductResourceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONSTRUCTIONRESOURCE] = (d) => { return IfcConstructionResource.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONSTRUCTIONRESOURCETYPE] = (d) => { return IfcConstructionResourceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONTEXT] = (d) => { return IfcContext.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONTEXTDEPENDENTUNIT] = (d) => { return IfcContextDependentUnit.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONTROL] = (d) => { return IfcControl.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONTROLLER] = (d) => { return IfcController.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONTROLLERTYPE] = (d) => { return IfcControllerType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONVERSIONBASEDUNIT] = (d) => { return IfcConversionBasedUnit.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCONVERSIONBASEDUNITWITHOFFSET] = (d) => { return IfcConversionBasedUnitWithOffset.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOOLEDBEAM] = (d) => { return IfcCooledBeam.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOOLEDBEAMTYPE] = (d) => { return IfcCooledBeamType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOOLINGTOWER] = (d) => { return IfcCoolingTower.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOOLINGTOWERTYPE] = (d) => { return IfcCoolingTowerType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOORDINATEOPERATION] = (d) => { return IfcCoordinateOperation.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOORDINATEREFERENCESYSTEM] = (d) => { return IfcCoordinateReferenceSystem.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOSTITEM] = (d) => { return IfcCostItem.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOSTSCHEDULE] = (d) => { return IfcCostSchedule.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOSTVALUE] = (d) => { return IfcCostValue.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOVERING] = (d) => { return IfcCovering.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCOVERINGTYPE] = (d) => { return IfcCoveringType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCREWRESOURCE] = (d) => { return IfcCrewResource.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCREWRESOURCETYPE] = (d) => { return IfcCrewResourceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCSGPRIMITIVE3D] = (d) => { return IfcCsgPrimitive3D.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCSGSOLID] = (d) => { return IfcCsgSolid.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCURRENCYRELATIONSHIP] = (d) => { return IfcCurrencyRelationship.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCURTAINWALL] = (d) => { return IfcCurtainWall.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCURTAINWALLTYPE] = (d) => { return IfcCurtainWallType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCURVE] = (d) => { return IfcCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCURVEBOUNDEDPLANE] = (d) => { return IfcCurveBoundedPlane.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCURVEBOUNDEDSURFACE] = (d) => { return IfcCurveBoundedSurface.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCURVESEGMENT2D] = (d) => { return IfcCurveSegment2D.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCURVESTYLE] = (d) => { return IfcCurveStyle.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCURVESTYLEFONT] = (d) => { return IfcCurveStyleFont.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCURVESTYLEFONTANDSCALING] = (d) => { return IfcCurveStyleFontAndScaling.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCURVESTYLEFONTPATTERN] = (d) => { return IfcCurveStyleFontPattern.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCCYLINDRICALSURFACE] = (d) => { return IfcCylindricalSurface.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDAMPER] = (d) => { return IfcDamper.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDAMPERTYPE] = (d) => { return IfcDamperType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDEEPFOUNDATION] = (d) => { return IfcDeepFoundation.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDEEPFOUNDATIONTYPE] = (d) => { return IfcDeepFoundationType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDERIVEDPROFILEDEF] = (d) => { return IfcDerivedProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDERIVEDUNIT] = (d) => { return IfcDerivedUnit.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDERIVEDUNITELEMENT] = (d) => { return IfcDerivedUnitElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDIMENSIONALEXPONENTS] = (d) => { return IfcDimensionalExponents.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDIRECTION] = (d) => { return IfcDirection.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDISCRETEACCESSORY] = (d) => { return IfcDiscreteAccessory.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDISCRETEACCESSORYTYPE] = (d) => { return IfcDiscreteAccessoryType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDISTANCEEXPRESSION] = (d) => { return IfcDistanceExpression.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDISTRIBUTIONCHAMBERELEMENT] = (d) => { return IfcDistributionChamberElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDISTRIBUTIONCHAMBERELEMENTTYPE] = (d) => { return IfcDistributionChamberElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDISTRIBUTIONCIRCUIT] = (d) => { return IfcDistributionCircuit.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDISTRIBUTIONCONTROLELEMENT] = (d) => { return IfcDistributionControlElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDISTRIBUTIONCONTROLELEMENTTYPE] = (d) => { return IfcDistributionControlElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDISTRIBUTIONELEMENT] = (d) => { return IfcDistributionElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDISTRIBUTIONELEMENTTYPE] = (d) => { return IfcDistributionElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDISTRIBUTIONFLOWELEMENT] = (d) => { return IfcDistributionFlowElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDISTRIBUTIONFLOWELEMENTTYPE] = (d) => { return IfcDistributionFlowElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDISTRIBUTIONPORT] = (d) => { return IfcDistributionPort.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDISTRIBUTIONSYSTEM] = (d) => { return IfcDistributionSystem.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDOCUMENTINFORMATION] = (d) => { return IfcDocumentInformation.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDOCUMENTINFORMATIONRELATIONSHIP] = (d) => { return IfcDocumentInformationRelationship.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDOCUMENTREFERENCE] = (d) => { return IfcDocumentReference.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDOOR] = (d) => { return IfcDoor.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDOORLININGPROPERTIES] = (d) => { return IfcDoorLiningProperties.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDOORPANELPROPERTIES] = (d) => { return IfcDoorPanelProperties.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDOORSTANDARDCASE] = (d) => { return IfcDoorStandardCase.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDOORSTYLE] = (d) => { return IfcDoorStyle.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDOORTYPE] = (d) => { return IfcDoorType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDRAUGHTINGPREDEFINEDCOLOUR] = (d) => { return IfcDraughtingPreDefinedColour.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDRAUGHTINGPREDEFINEDCURVEFONT] = (d) => { return IfcDraughtingPreDefinedCurveFont.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDUCTFITTING] = (d) => { return IfcDuctFitting.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDUCTFITTINGTYPE] = (d) => { return IfcDuctFittingType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDUCTSEGMENT] = (d) => { return IfcDuctSegment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDUCTSEGMENTTYPE] = (d) => { return IfcDuctSegmentType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDUCTSILENCER] = (d) => { return IfcDuctSilencer.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCDUCTSILENCERTYPE] = (d) => { return IfcDuctSilencerType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEDGE] = (d) => { return IfcEdge.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEDGECURVE] = (d) => { return IfcEdgeCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEDGELOOP] = (d) => { return IfcEdgeLoop.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELECTRICAPPLIANCE] = (d) => { return IfcElectricAppliance.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELECTRICAPPLIANCETYPE] = (d) => { return IfcElectricApplianceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELECTRICDISTRIBUTIONBOARD] = (d) => { return IfcElectricDistributionBoard.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELECTRICDISTRIBUTIONBOARDTYPE] = (d) => { return IfcElectricDistributionBoardType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELECTRICFLOWSTORAGEDEVICE] = (d) => { return IfcElectricFlowStorageDevice.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELECTRICFLOWSTORAGEDEVICETYPE] = (d) => { return IfcElectricFlowStorageDeviceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELECTRICGENERATOR] = (d) => { return IfcElectricGenerator.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELECTRICGENERATORTYPE] = (d) => { return IfcElectricGeneratorType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELECTRICMOTOR] = (d) => { return IfcElectricMotor.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELECTRICMOTORTYPE] = (d) => { return IfcElectricMotorType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELECTRICTIMECONTROL] = (d) => { return IfcElectricTimeControl.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELECTRICTIMECONTROLTYPE] = (d) => { return IfcElectricTimeControlType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELEMENT] = (d) => { return IfcElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELEMENTASSEMBLY] = (d) => { return IfcElementAssembly.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELEMENTASSEMBLYTYPE] = (d) => { return IfcElementAssemblyType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELEMENTCOMPONENT] = (d) => { return IfcElementComponent.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELEMENTCOMPONENTTYPE] = (d) => { return IfcElementComponentType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELEMENTQUANTITY] = (d) => { return IfcElementQuantity.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELEMENTTYPE] = (d) => { return IfcElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELEMENTARYSURFACE] = (d) => { return IfcElementarySurface.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELLIPSE] = (d) => { return IfcEllipse.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCELLIPSEPROFILEDEF] = (d) => { return IfcEllipseProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCENERGYCONVERSIONDEVICE] = (d) => { return IfcEnergyConversionDevice.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCENERGYCONVERSIONDEVICETYPE] = (d) => { return IfcEnergyConversionDeviceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCENGINE] = (d) => { return IfcEngine.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCENGINETYPE] = (d) => { return IfcEngineType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEVAPORATIVECOOLER] = (d) => { return IfcEvaporativeCooler.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEVAPORATIVECOOLERTYPE] = (d) => { return IfcEvaporativeCoolerType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEVAPORATOR] = (d) => { return IfcEvaporator.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEVAPORATORTYPE] = (d) => { return IfcEvaporatorType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEVENT] = (d) => { return IfcEvent.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEVENTTIME] = (d) => { return IfcEventTime.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEVENTTYPE] = (d) => { return IfcEventType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEXTENDEDPROPERTIES] = (d) => { return IfcExtendedProperties.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEXTERNALINFORMATION] = (d) => { return IfcExternalInformation.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEXTERNALREFERENCE] = (d) => { return IfcExternalReference.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEXTERNALREFERENCERELATIONSHIP] = (d) => { return IfcExternalReferenceRelationship.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEXTERNALSPATIALELEMENT] = (d) => { return IfcExternalSpatialElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEXTERNALSPATIALSTRUCTUREELEMENT] = (d) => { return IfcExternalSpatialStructureElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEXTERNALLYDEFINEDHATCHSTYLE] = (d) => { return IfcExternallyDefinedHatchStyle.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEXTERNALLYDEFINEDSURFACESTYLE] = (d) => { return IfcExternallyDefinedSurfaceStyle.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEXTERNALLYDEFINEDTEXTFONT] = (d) => { return IfcExternallyDefinedTextFont.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEXTRUDEDAREASOLID] = (d) => { return IfcExtrudedAreaSolid.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCEXTRUDEDAREASOLIDTAPERED] = (d) => { return IfcExtrudedAreaSolidTapered.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFACE] = (d) => { return IfcFace.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFACEBASEDSURFACEMODEL] = (d) => { return IfcFaceBasedSurfaceModel.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFACEBOUND] = (d) => { return IfcFaceBound.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFACEOUTERBOUND] = (d) => { return IfcFaceOuterBound.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFACESURFACE] = (d) => { return IfcFaceSurface.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFACETEDBREP] = (d) => { return IfcFacetedBrep.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFACETEDBREPWITHVOIDS] = (d) => { return IfcFacetedBrepWithVoids.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFACILITY] = (d) => { return IfcFacility.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFACILITYPART] = (d) => { return IfcFacilityPart.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFAILURECONNECTIONCONDITION] = (d) => { return IfcFailureConnectionCondition.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFAN] = (d) => { return IfcFan.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFANTYPE] = (d) => { return IfcFanType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFASTENER] = (d) => { return IfcFastener.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFASTENERTYPE] = (d) => { return IfcFastenerType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFEATUREELEMENT] = (d) => { return IfcFeatureElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFEATUREELEMENTADDITION] = (d) => { return IfcFeatureElementAddition.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFEATUREELEMENTSUBTRACTION] = (d) => { return IfcFeatureElementSubtraction.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFILLAREASTYLE] = (d) => { return IfcFillAreaStyle.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFILLAREASTYLEHATCHING] = (d) => { return IfcFillAreaStyleHatching.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFILLAREASTYLETILES] = (d) => { return IfcFillAreaStyleTiles.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFILTER] = (d) => { return IfcFilter.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFILTERTYPE] = (d) => { return IfcFilterType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFIRESUPPRESSIONTERMINAL] = (d) => { return IfcFireSuppressionTerminal.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFIRESUPPRESSIONTERMINALTYPE] = (d) => { return IfcFireSuppressionTerminalType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFIXEDREFERENCESWEPTAREASOLID] = (d) => { return IfcFixedReferenceSweptAreaSolid.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWCONTROLLER] = (d) => { return IfcFlowController.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWCONTROLLERTYPE] = (d) => { return IfcFlowControllerType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWFITTING] = (d) => { return IfcFlowFitting.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWFITTINGTYPE] = (d) => { return IfcFlowFittingType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWINSTRUMENT] = (d) => { return IfcFlowInstrument.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWINSTRUMENTTYPE] = (d) => { return IfcFlowInstrumentType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWMETER] = (d) => { return IfcFlowMeter.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWMETERTYPE] = (d) => { return IfcFlowMeterType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWMOVINGDEVICE] = (d) => { return IfcFlowMovingDevice.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWMOVINGDEVICETYPE] = (d) => { return IfcFlowMovingDeviceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWSEGMENT] = (d) => { return IfcFlowSegment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWSEGMENTTYPE] = (d) => { return IfcFlowSegmentType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWSTORAGEDEVICE] = (d) => { return IfcFlowStorageDevice.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWSTORAGEDEVICETYPE] = (d) => { return IfcFlowStorageDeviceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWTERMINAL] = (d) => { return IfcFlowTerminal.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWTERMINALTYPE] = (d) => { return IfcFlowTerminalType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWTREATMENTDEVICE] = (d) => { return IfcFlowTreatmentDevice.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFLOWTREATMENTDEVICETYPE] = (d) => { return IfcFlowTreatmentDeviceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFOOTING] = (d) => { return IfcFooting.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFOOTINGTYPE] = (d) => { return IfcFootingType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFURNISHINGELEMENT] = (d) => { return IfcFurnishingElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFURNISHINGELEMENTTYPE] = (d) => { return IfcFurnishingElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFURNITURE] = (d) => { return IfcFurniture.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCFURNITURETYPE] = (d) => { return IfcFurnitureType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCGEOGRAPHICELEMENT] = (d) => { return IfcGeographicElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCGEOGRAPHICELEMENTTYPE] = (d) => { return IfcGeographicElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCGEOMETRICCURVESET] = (d) => { return IfcGeometricCurveSet.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCGEOMETRICREPRESENTATIONCONTEXT] = (d) => { return IfcGeometricRepresentationContext.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCGEOMETRICREPRESENTATIONITEM] = (d) => { return IfcGeometricRepresentationItem.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCGEOMETRICREPRESENTATIONSUBCONTEXT] = (d) => { return IfcGeometricRepresentationSubContext.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCGEOMETRICSET] = (d) => { return IfcGeometricSet.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCGRID] = (d) => { return IfcGrid.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCGRIDAXIS] = (d) => { return IfcGridAxis.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCGRIDPLACEMENT] = (d) => { return IfcGridPlacement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCGROUP] = (d) => { return IfcGroup.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCHALFSPACESOLID] = (d) => { return IfcHalfSpaceSolid.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCHEATEXCHANGER] = (d) => { return IfcHeatExchanger.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCHEATEXCHANGERTYPE] = (d) => { return IfcHeatExchangerType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCHUMIDIFIER] = (d) => { return IfcHumidifier.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCHUMIDIFIERTYPE] = (d) => { return IfcHumidifierType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCISHAPEPROFILEDEF] = (d) => { return IfcIShapeProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCIMAGETEXTURE] = (d) => { return IfcImageTexture.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCINDEXEDCOLOURMAP] = (d) => { return IfcIndexedColourMap.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCINDEXEDPOLYCURVE] = (d) => { return IfcIndexedPolyCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCINDEXEDPOLYGONALFACE] = (d) => { return IfcIndexedPolygonalFace.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCINDEXEDPOLYGONALFACEWITHVOIDS] = (d) => { return IfcIndexedPolygonalFaceWithVoids.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCINDEXEDTEXTUREMAP] = (d) => { return IfcIndexedTextureMap.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCINDEXEDTRIANGLETEXTUREMAP] = (d) => { return IfcIndexedTriangleTextureMap.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCINTERCEPTOR] = (d) => { return IfcInterceptor.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCINTERCEPTORTYPE] = (d) => { return IfcInterceptorType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCINTERSECTIONCURVE] = (d) => { return IfcIntersectionCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCINVENTORY] = (d) => { return IfcInventory.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCIRREGULARTIMESERIES] = (d) => { return IfcIrregularTimeSeries.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCIRREGULARTIMESERIESVALUE] = (d) => { return IfcIrregularTimeSeriesValue.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCJUNCTIONBOX] = (d) => { return IfcJunctionBox.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCJUNCTIONBOXTYPE] = (d) => { return IfcJunctionBoxType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLSHAPEPROFILEDEF] = (d) => { return IfcLShapeProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLABORRESOURCE] = (d) => { return IfcLaborResource.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLABORRESOURCETYPE] = (d) => { return IfcLaborResourceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLAGTIME] = (d) => { return IfcLagTime.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLAMP] = (d) => { return IfcLamp.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLAMPTYPE] = (d) => { return IfcLampType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLIBRARYINFORMATION] = (d) => { return IfcLibraryInformation.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLIBRARYREFERENCE] = (d) => { return IfcLibraryReference.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLIGHTDISTRIBUTIONDATA] = (d) => { return IfcLightDistributionData.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLIGHTFIXTURE] = (d) => { return IfcLightFixture.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLIGHTFIXTURETYPE] = (d) => { return IfcLightFixtureType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLIGHTINTENSITYDISTRIBUTION] = (d) => { return IfcLightIntensityDistribution.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLIGHTSOURCE] = (d) => { return IfcLightSource.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLIGHTSOURCEAMBIENT] = (d) => { return IfcLightSourceAmbient.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLIGHTSOURCEDIRECTIONAL] = (d) => { return IfcLightSourceDirectional.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLIGHTSOURCEGONIOMETRIC] = (d) => { return IfcLightSourceGoniometric.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLIGHTSOURCEPOSITIONAL] = (d) => { return IfcLightSourcePositional.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLIGHTSOURCESPOT] = (d) => { return IfcLightSourceSpot.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLINE] = (d) => { return IfcLine.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLINESEGMENT2D] = (d) => { return IfcLineSegment2D.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLINEARPLACEMENT] = (d) => { return IfcLinearPlacement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLINEARPOSITIONINGELEMENT] = (d) => { return IfcLinearPositioningElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLOCALPLACEMENT] = (d) => { return IfcLocalPlacement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCLOOP] = (d) => { return IfcLoop.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMANIFOLDSOLIDBREP] = (d) => { return IfcManifoldSolidBrep.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMAPCONVERSION] = (d) => { return IfcMapConversion.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMAPPEDITEM] = (d) => { return IfcMappedItem.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIAL] = (d) => { return IfcMaterial.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALCLASSIFICATIONRELATIONSHIP] = (d) => { return IfcMaterialClassificationRelationship.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALCONSTITUENT] = (d) => { return IfcMaterialConstituent.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALCONSTITUENTSET] = (d) => { return IfcMaterialConstituentSet.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALDEFINITION] = (d) => { return IfcMaterialDefinition.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALDEFINITIONREPRESENTATION] = (d) => { return IfcMaterialDefinitionRepresentation.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALLAYER] = (d) => { return IfcMaterialLayer.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALLAYERSET] = (d) => { return IfcMaterialLayerSet.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALLAYERSETUSAGE] = (d) => { return IfcMaterialLayerSetUsage.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALLAYERWITHOFFSETS] = (d) => { return IfcMaterialLayerWithOffsets.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALLIST] = (d) => { return IfcMaterialList.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALPROFILE] = (d) => { return IfcMaterialProfile.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALPROFILESET] = (d) => { return IfcMaterialProfileSet.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALPROFILESETUSAGE] = (d) => { return IfcMaterialProfileSetUsage.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALPROFILESETUSAGETAPERING] = (d) => { return IfcMaterialProfileSetUsageTapering.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALPROFILEWITHOFFSETS] = (d) => { return IfcMaterialProfileWithOffsets.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALPROPERTIES] = (d) => { return IfcMaterialProperties.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALRELATIONSHIP] = (d) => { return IfcMaterialRelationship.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMATERIALUSAGEDEFINITION] = (d) => { return IfcMaterialUsageDefinition.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMEASUREWITHUNIT] = (d) => { return IfcMeasureWithUnit.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMECHANICALFASTENER] = (d) => { return IfcMechanicalFastener.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMECHANICALFASTENERTYPE] = (d) => { return IfcMechanicalFastenerType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMEDICALDEVICE] = (d) => { return IfcMedicalDevice.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMEDICALDEVICETYPE] = (d) => { return IfcMedicalDeviceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMEMBER] = (d) => { return IfcMember.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMEMBERSTANDARDCASE] = (d) => { return IfcMemberStandardCase.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMEMBERTYPE] = (d) => { return IfcMemberType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMETRIC] = (d) => { return IfcMetric.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMIRROREDPROFILEDEF] = (d) => { return IfcMirroredProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMONETARYUNIT] = (d) => { return IfcMonetaryUnit.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMOTORCONNECTION] = (d) => { return IfcMotorConnection.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCMOTORCONNECTIONTYPE] = (d) => { return IfcMotorConnectionType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCNAMEDUNIT] = (d) => { return IfcNamedUnit.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOBJECT] = (d) => { return IfcObject.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOBJECTDEFINITION] = (d) => { return IfcObjectDefinition.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOBJECTPLACEMENT] = (d) => { return IfcObjectPlacement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOBJECTIVE] = (d) => { return IfcObjective.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOCCUPANT] = (d) => { return IfcOccupant.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOFFSETCURVE] = (d) => { return IfcOffsetCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOFFSETCURVE2D] = (d) => { return IfcOffsetCurve2D.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOFFSETCURVE3D] = (d) => { return IfcOffsetCurve3D.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOFFSETCURVEBYDISTANCES] = (d) => { return IfcOffsetCurveByDistances.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOPENSHELL] = (d) => { return IfcOpenShell.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOPENINGELEMENT] = (d) => { return IfcOpeningElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOPENINGSTANDARDCASE] = (d) => { return IfcOpeningStandardCase.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCORGANIZATION] = (d) => { return IfcOrganization.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCORGANIZATIONRELATIONSHIP] = (d) => { return IfcOrganizationRelationship.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCORIENTATIONEXPRESSION] = (d) => { return IfcOrientationExpression.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCORIENTEDEDGE] = (d) => { return IfcOrientedEdge.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOUTERBOUNDARYCURVE] = (d) => { return IfcOuterBoundaryCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOUTLET] = (d) => { return IfcOutlet.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOUTLETTYPE] = (d) => { return IfcOutletType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCOWNERHISTORY] = (d) => { return IfcOwnerHistory.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPARAMETERIZEDPROFILEDEF] = (d) => { return IfcParameterizedProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPATH] = (d) => { return IfcPath.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPCURVE] = (d) => { return IfcPcurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPERFORMANCEHISTORY] = (d) => { return IfcPerformanceHistory.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPERMEABLECOVERINGPROPERTIES] = (d) => { return IfcPermeableCoveringProperties.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPERMIT] = (d) => { return IfcPermit.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPERSON] = (d) => { return IfcPerson.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPERSONANDORGANIZATION] = (d) => { return IfcPersonAndOrganization.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPHYSICALCOMPLEXQUANTITY] = (d) => { return IfcPhysicalComplexQuantity.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPHYSICALQUANTITY] = (d) => { return IfcPhysicalQuantity.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPHYSICALSIMPLEQUANTITY] = (d) => { return IfcPhysicalSimpleQuantity.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPILE] = (d) => { return IfcPile.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPILETYPE] = (d) => { return IfcPileType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPIPEFITTING] = (d) => { return IfcPipeFitting.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPIPEFITTINGTYPE] = (d) => { return IfcPipeFittingType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPIPESEGMENT] = (d) => { return IfcPipeSegment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPIPESEGMENTTYPE] = (d) => { return IfcPipeSegmentType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPIXELTEXTURE] = (d) => { return IfcPixelTexture.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPLACEMENT] = (d) => { return IfcPlacement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPLANARBOX] = (d) => { return IfcPlanarBox.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPLANAREXTENT] = (d) => { return IfcPlanarExtent.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPLANE] = (d) => { return IfcPlane.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPLATE] = (d) => { return IfcPlate.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPLATESTANDARDCASE] = (d) => { return IfcPlateStandardCase.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPLATETYPE] = (d) => { return IfcPlateType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPOINT] = (d) => { return IfcPoint.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPOINTONCURVE] = (d) => { return IfcPointOnCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPOINTONSURFACE] = (d) => { return IfcPointOnSurface.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPOLYLOOP] = (d) => { return IfcPolyLoop.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPOLYGONALBOUNDEDHALFSPACE] = (d) => { return IfcPolygonalBoundedHalfSpace.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPOLYGONALFACESET] = (d) => { return IfcPolygonalFaceSet.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPOLYLINE] = (d) => { return IfcPolyline.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPORT] = (d) => { return IfcPort.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPOSITIONINGELEMENT] = (d) => { return IfcPositioningElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPOSTALADDRESS] = (d) => { return IfcPostalAddress.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPREDEFINEDCOLOUR] = (d) => { return IfcPreDefinedColour.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPREDEFINEDCURVEFONT] = (d) => { return IfcPreDefinedCurveFont.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPREDEFINEDITEM] = (d) => { return IfcPreDefinedItem.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPREDEFINEDPROPERTIES] = (d) => { return IfcPreDefinedProperties.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPREDEFINEDPROPERTYSET] = (d) => { return IfcPreDefinedPropertySet.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPREDEFINEDTEXTFONT] = (d) => { return IfcPreDefinedTextFont.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPRESENTATIONITEM] = (d) => { return IfcPresentationItem.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPRESENTATIONLAYERASSIGNMENT] = (d) => { return IfcPresentationLayerAssignment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPRESENTATIONLAYERWITHSTYLE] = (d) => { return IfcPresentationLayerWithStyle.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPRESENTATIONSTYLE] = (d) => { return IfcPresentationStyle.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPRESENTATIONSTYLEASSIGNMENT] = (d) => { return IfcPresentationStyleAssignment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROCEDURE] = (d) => { return IfcProcedure.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROCEDURETYPE] = (d) => { return IfcProcedureType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROCESS] = (d) => { return IfcProcess.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPRODUCT] = (d) => { return IfcProduct.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPRODUCTDEFINITIONSHAPE] = (d) => { return IfcProductDefinitionShape.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPRODUCTREPRESENTATION] = (d) => { return IfcProductRepresentation.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROFILEDEF] = (d) => { return IfcProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROFILEPROPERTIES] = (d) => { return IfcProfileProperties.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROJECT] = (d) => { return IfcProject.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROJECTLIBRARY] = (d) => { return IfcProjectLibrary.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROJECTORDER] = (d) => { return IfcProjectOrder.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROJECTEDCRS] = (d) => { return IfcProjectedCRS.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROJECTIONELEMENT] = (d) => { return IfcProjectionElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTY] = (d) => { return IfcProperty.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYABSTRACTION] = (d) => { return IfcPropertyAbstraction.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYBOUNDEDVALUE] = (d) => { return IfcPropertyBoundedValue.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYDEFINITION] = (d) => { return IfcPropertyDefinition.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYDEPENDENCYRELATIONSHIP] = (d) => { return IfcPropertyDependencyRelationship.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYENUMERATEDVALUE] = (d) => { return IfcPropertyEnumeratedValue.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYENUMERATION] = (d) => { return IfcPropertyEnumeration.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYLISTVALUE] = (d) => { return IfcPropertyListValue.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYREFERENCEVALUE] = (d) => { return IfcPropertyReferenceValue.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYSET] = (d) => { return IfcPropertySet.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYSETDEFINITION] = (d) => { return IfcPropertySetDefinition.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYSETTEMPLATE] = (d) => { return IfcPropertySetTemplate.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYSINGLEVALUE] = (d) => { return IfcPropertySingleValue.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYTABLEVALUE] = (d) => { return IfcPropertyTableValue.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYTEMPLATE] = (d) => { return IfcPropertyTemplate.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROPERTYTEMPLATEDEFINITION] = (d) => { return IfcPropertyTemplateDefinition.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROTECTIVEDEVICE] = (d) => { return IfcProtectiveDevice.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROTECTIVEDEVICETRIPPINGUNIT] = (d) => { return IfcProtectiveDeviceTrippingUnit.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROTECTIVEDEVICETRIPPINGUNITTYPE] = (d) => { return IfcProtectiveDeviceTrippingUnitType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROTECTIVEDEVICETYPE] = (d) => { return IfcProtectiveDeviceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPROXY] = (d) => { return IfcProxy.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPUMP] = (d) => { return IfcPump.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCPUMPTYPE] = (d) => { return IfcPumpType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCQUANTITYAREA] = (d) => { return IfcQuantityArea.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCQUANTITYCOUNT] = (d) => { return IfcQuantityCount.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCQUANTITYLENGTH] = (d) => { return IfcQuantityLength.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCQUANTITYSET] = (d) => { return IfcQuantitySet.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCQUANTITYTIME] = (d) => { return IfcQuantityTime.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCQUANTITYVOLUME] = (d) => { return IfcQuantityVolume.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCQUANTITYWEIGHT] = (d) => { return IfcQuantityWeight.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRAILING] = (d) => { return IfcRailing.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRAILINGTYPE] = (d) => { return IfcRailingType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRAMP] = (d) => { return IfcRamp.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRAMPFLIGHT] = (d) => { return IfcRampFlight.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRAMPFLIGHTTYPE] = (d) => { return IfcRampFlightType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRAMPTYPE] = (d) => { return IfcRampType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRATIONALBSPLINECURVEWITHKNOTS] = (d) => { return IfcRationalBSplineCurveWithKnots.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRATIONALBSPLINESURFACEWITHKNOTS] = (d) => { return IfcRationalBSplineSurfaceWithKnots.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRECTANGLEHOLLOWPROFILEDEF] = (d) => { return IfcRectangleHollowProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRECTANGLEPROFILEDEF] = (d) => { return IfcRectangleProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRECTANGULARPYRAMID] = (d) => { return IfcRectangularPyramid.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRECTANGULARTRIMMEDSURFACE] = (d) => { return IfcRectangularTrimmedSurface.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRECURRENCEPATTERN] = (d) => { return IfcRecurrencePattern.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREFERENCE] = (d) => { return IfcReference.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREFERENT] = (d) => { return IfcReferent.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREGULARTIMESERIES] = (d) => { return IfcRegularTimeSeries.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREINFORCEMENTBARPROPERTIES] = (d) => { return IfcReinforcementBarProperties.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREINFORCEMENTDEFINITIONPROPERTIES] = (d) => { return IfcReinforcementDefinitionProperties.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREINFORCINGBAR] = (d) => { return IfcReinforcingBar.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREINFORCINGBARTYPE] = (d) => { return IfcReinforcingBarType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREINFORCINGELEMENT] = (d) => { return IfcReinforcingElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREINFORCINGELEMENTTYPE] = (d) => { return IfcReinforcingElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREINFORCINGMESH] = (d) => { return IfcReinforcingMesh.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREINFORCINGMESHTYPE] = (d) => { return IfcReinforcingMeshType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELAGGREGATES] = (d) => { return IfcRelAggregates.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSIGNS] = (d) => { return IfcRelAssigns.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSIGNSTOACTOR] = (d) => { return IfcRelAssignsToActor.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSIGNSTOCONTROL] = (d) => { return IfcRelAssignsToControl.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSIGNSTOGROUP] = (d) => { return IfcRelAssignsToGroup.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSIGNSTOGROUPBYFACTOR] = (d) => { return IfcRelAssignsToGroupByFactor.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSIGNSTOPROCESS] = (d) => { return IfcRelAssignsToProcess.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSIGNSTOPRODUCT] = (d) => { return IfcRelAssignsToProduct.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSIGNSTORESOURCE] = (d) => { return IfcRelAssignsToResource.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSOCIATES] = (d) => { return IfcRelAssociates.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSOCIATESAPPROVAL] = (d) => { return IfcRelAssociatesApproval.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSOCIATESCLASSIFICATION] = (d) => { return IfcRelAssociatesClassification.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSOCIATESCONSTRAINT] = (d) => { return IfcRelAssociatesConstraint.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSOCIATESDOCUMENT] = (d) => { return IfcRelAssociatesDocument.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSOCIATESLIBRARY] = (d) => { return IfcRelAssociatesLibrary.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELASSOCIATESMATERIAL] = (d) => { return IfcRelAssociatesMaterial.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELCONNECTS] = (d) => { return IfcRelConnects.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELCONNECTSELEMENTS] = (d) => { return IfcRelConnectsElements.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELCONNECTSPATHELEMENTS] = (d) => { return IfcRelConnectsPathElements.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELCONNECTSPORTTOELEMENT] = (d) => { return IfcRelConnectsPortToElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELCONNECTSPORTS] = (d) => { return IfcRelConnectsPorts.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELCONNECTSSTRUCTURALACTIVITY] = (d) => { return IfcRelConnectsStructuralActivity.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELCONNECTSSTRUCTURALMEMBER] = (d) => { return IfcRelConnectsStructuralMember.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELCONNECTSWITHECCENTRICITY] = (d) => { return IfcRelConnectsWithEccentricity.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELCONNECTSWITHREALIZINGELEMENTS] = (d) => { return IfcRelConnectsWithRealizingElements.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELCONTAINEDINSPATIALSTRUCTURE] = (d) => { return IfcRelContainedInSpatialStructure.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELCOVERSBLDGELEMENTS] = (d) => { return IfcRelCoversBldgElements.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELCOVERSSPACES] = (d) => { return IfcRelCoversSpaces.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELDECLARES] = (d) => { return IfcRelDeclares.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELDECOMPOSES] = (d) => { return IfcRelDecomposes.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELDEFINES] = (d) => { return IfcRelDefines.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELDEFINESBYOBJECT] = (d) => { return IfcRelDefinesByObject.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELDEFINESBYPROPERTIES] = (d) => { return IfcRelDefinesByProperties.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELDEFINESBYTEMPLATE] = (d) => { return IfcRelDefinesByTemplate.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELDEFINESBYTYPE] = (d) => { return IfcRelDefinesByType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELFILLSELEMENT] = (d) => { return IfcRelFillsElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELFLOWCONTROLELEMENTS] = (d) => { return IfcRelFlowControlElements.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELINTERFERESELEMENTS] = (d) => { return IfcRelInterferesElements.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELNESTS] = (d) => { return IfcRelNests.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELPOSITIONS] = (d) => { return IfcRelPositions.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELPROJECTSELEMENT] = (d) => { return IfcRelProjectsElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELREFERENCEDINSPATIALSTRUCTURE] = (d) => { return IfcRelReferencedInSpatialStructure.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELSEQUENCE] = (d) => { return IfcRelSequence.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELSERVICESBUILDINGS] = (d) => { return IfcRelServicesBuildings.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELSPACEBOUNDARY] = (d) => { return IfcRelSpaceBoundary.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELSPACEBOUNDARY1STLEVEL] = (d) => { return IfcRelSpaceBoundary1stLevel.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELSPACEBOUNDARY2NDLEVEL] = (d) => { return IfcRelSpaceBoundary2ndLevel.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELVOIDSELEMENT] = (d) => { return IfcRelVoidsElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRELATIONSHIP] = (d) => { return IfcRelationship.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREPARAMETRISEDCOMPOSITECURVESEGMENT] = (d) => { return IfcReparametrisedCompositeCurveSegment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREPRESENTATION] = (d) => { return IfcRepresentation.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREPRESENTATIONCONTEXT] = (d) => { return IfcRepresentationContext.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREPRESENTATIONITEM] = (d) => { return IfcRepresentationItem.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREPRESENTATIONMAP] = (d) => { return IfcRepresentationMap.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRESOURCE] = (d) => { return IfcResource.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRESOURCEAPPROVALRELATIONSHIP] = (d) => { return IfcResourceApprovalRelationship.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRESOURCECONSTRAINTRELATIONSHIP] = (d) => { return IfcResourceConstraintRelationship.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRESOURCELEVELRELATIONSHIP] = (d) => { return IfcResourceLevelRelationship.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRESOURCETIME] = (d) => { return IfcResourceTime.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREVOLVEDAREASOLID] = (d) => { return IfcRevolvedAreaSolid.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCREVOLVEDAREASOLIDTAPERED] = (d) => { return IfcRevolvedAreaSolidTapered.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRIGHTCIRCULARCONE] = (d) => { return IfcRightCircularCone.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCRIGHTCIRCULARCYLINDER] = (d) => { return IfcRightCircularCylinder.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCROOF] = (d) => { return IfcRoof.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCROOFTYPE] = (d) => { return IfcRoofType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCROOT] = (d) => { return IfcRoot.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCROUNDEDRECTANGLEPROFILEDEF] = (d) => { return IfcRoundedRectangleProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSIUNIT] = (d) => { return IfcSIUnit.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSANITARYTERMINAL] = (d) => { return IfcSanitaryTerminal.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSANITARYTERMINALTYPE] = (d) => { return IfcSanitaryTerminalType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSCHEDULINGTIME] = (d) => { return IfcSchedulingTime.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSEAMCURVE] = (d) => { return IfcSeamCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSECTIONPROPERTIES] = (d) => { return IfcSectionProperties.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSECTIONREINFORCEMENTPROPERTIES] = (d) => { return IfcSectionReinforcementProperties.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSECTIONEDSOLID] = (d) => { return IfcSectionedSolid.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSECTIONEDSOLIDHORIZONTAL] = (d) => { return IfcSectionedSolidHorizontal.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSECTIONEDSPINE] = (d) => { return IfcSectionedSpine.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSENSOR] = (d) => { return IfcSensor.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSENSORTYPE] = (d) => { return IfcSensorType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSHADINGDEVICE] = (d) => { return IfcShadingDevice.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSHADINGDEVICETYPE] = (d) => { return IfcShadingDeviceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSHAPEASPECT] = (d) => { return IfcShapeAspect.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSHAPEMODEL] = (d) => { return IfcShapeModel.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSHAPEREPRESENTATION] = (d) => { return IfcShapeRepresentation.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSHELLBASEDSURFACEMODEL] = (d) => { return IfcShellBasedSurfaceModel.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSIMPLEPROPERTY] = (d) => { return IfcSimpleProperty.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSIMPLEPROPERTYTEMPLATE] = (d) => { return IfcSimplePropertyTemplate.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSITE] = (d) => { return IfcSite.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSLAB] = (d) => { return IfcSlab.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSLABELEMENTEDCASE] = (d) => { return IfcSlabElementedCase.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSLABSTANDARDCASE] = (d) => { return IfcSlabStandardCase.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSLABTYPE] = (d) => { return IfcSlabType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSLIPPAGECONNECTIONCONDITION] = (d) => { return IfcSlippageConnectionCondition.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSOLARDEVICE] = (d) => { return IfcSolarDevice.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSOLARDEVICETYPE] = (d) => { return IfcSolarDeviceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSOLIDMODEL] = (d) => { return IfcSolidModel.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSPACE] = (d) => { return IfcSpace.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSPACEHEATER] = (d) => { return IfcSpaceHeater.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSPACEHEATERTYPE] = (d) => { return IfcSpaceHeaterType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSPACETYPE] = (d) => { return IfcSpaceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSPATIALELEMENT] = (d) => { return IfcSpatialElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSPATIALELEMENTTYPE] = (d) => { return IfcSpatialElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSPATIALSTRUCTUREELEMENT] = (d) => { return IfcSpatialStructureElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSPATIALSTRUCTUREELEMENTTYPE] = (d) => { return IfcSpatialStructureElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSPATIALZONE] = (d) => { return IfcSpatialZone.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSPATIALZONETYPE] = (d) => { return IfcSpatialZoneType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSPHERE] = (d) => { return IfcSphere.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSPHERICALSURFACE] = (d) => { return IfcSphericalSurface.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTACKTERMINAL] = (d) => { return IfcStackTerminal.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTACKTERMINALTYPE] = (d) => { return IfcStackTerminalType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTAIR] = (d) => { return IfcStair.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTAIRFLIGHT] = (d) => { return IfcStairFlight.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTAIRFLIGHTTYPE] = (d) => { return IfcStairFlightType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTAIRTYPE] = (d) => { return IfcStairType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALACTION] = (d) => { return IfcStructuralAction.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALACTIVITY] = (d) => { return IfcStructuralActivity.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALANALYSISMODEL] = (d) => { return IfcStructuralAnalysisModel.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALCONNECTION] = (d) => { return IfcStructuralConnection.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALCONNECTIONCONDITION] = (d) => { return IfcStructuralConnectionCondition.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALCURVEACTION] = (d) => { return IfcStructuralCurveAction.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALCURVECONNECTION] = (d) => { return IfcStructuralCurveConnection.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALCURVEMEMBER] = (d) => { return IfcStructuralCurveMember.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALCURVEMEMBERVARYING] = (d) => { return IfcStructuralCurveMemberVarying.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALCURVEREACTION] = (d) => { return IfcStructuralCurveReaction.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALITEM] = (d) => { return IfcStructuralItem.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALLINEARACTION] = (d) => { return IfcStructuralLinearAction.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALLOAD] = (d) => { return IfcStructuralLoad.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALLOADCASE] = (d) => { return IfcStructuralLoadCase.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALLOADCONFIGURATION] = (d) => { return IfcStructuralLoadConfiguration.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALLOADGROUP] = (d) => { return IfcStructuralLoadGroup.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALLOADLINEARFORCE] = (d) => { return IfcStructuralLoadLinearForce.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALLOADORRESULT] = (d) => { return IfcStructuralLoadOrResult.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALLOADPLANARFORCE] = (d) => { return IfcStructuralLoadPlanarForce.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALLOADSINGLEDISPLACEMENT] = (d) => { return IfcStructuralLoadSingleDisplacement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION] = (d) => { return IfcStructuralLoadSingleDisplacementDistortion.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALLOADSINGLEFORCE] = (d) => { return IfcStructuralLoadSingleForce.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALLOADSINGLEFORCEWARPING] = (d) => { return IfcStructuralLoadSingleForceWarping.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALLOADSTATIC] = (d) => { return IfcStructuralLoadStatic.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALLOADTEMPERATURE] = (d) => { return IfcStructuralLoadTemperature.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALMEMBER] = (d) => { return IfcStructuralMember.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALPLANARACTION] = (d) => { return IfcStructuralPlanarAction.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALPOINTACTION] = (d) => { return IfcStructuralPointAction.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALPOINTCONNECTION] = (d) => { return IfcStructuralPointConnection.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALPOINTREACTION] = (d) => { return IfcStructuralPointReaction.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALREACTION] = (d) => { return IfcStructuralReaction.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALRESULTGROUP] = (d) => { return IfcStructuralResultGroup.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALSURFACEACTION] = (d) => { return IfcStructuralSurfaceAction.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALSURFACECONNECTION] = (d) => { return IfcStructuralSurfaceConnection.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALSURFACEMEMBER] = (d) => { return IfcStructuralSurfaceMember.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALSURFACEMEMBERVARYING] = (d) => { return IfcStructuralSurfaceMemberVarying.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTRUCTURALSURFACEREACTION] = (d) => { return IfcStructuralSurfaceReaction.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTYLEMODEL] = (d) => { return IfcStyleModel.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTYLEDITEM] = (d) => { return IfcStyledItem.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSTYLEDREPRESENTATION] = (d) => { return IfcStyledRepresentation.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSUBCONTRACTRESOURCE] = (d) => { return IfcSubContractResource.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSUBCONTRACTRESOURCETYPE] = (d) => { return IfcSubContractResourceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSUBEDGE] = (d) => { return IfcSubedge.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSURFACE] = (d) => { return IfcSurface.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSURFACECURVE] = (d) => { return IfcSurfaceCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSURFACECURVESWEPTAREASOLID] = (d) => { return IfcSurfaceCurveSweptAreaSolid.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSURFACEFEATURE] = (d) => { return IfcSurfaceFeature.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSURFACEOFLINEAREXTRUSION] = (d) => { return IfcSurfaceOfLinearExtrusion.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSURFACEOFREVOLUTION] = (d) => { return IfcSurfaceOfRevolution.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSURFACEREINFORCEMENTAREA] = (d) => { return IfcSurfaceReinforcementArea.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSURFACESTYLE] = (d) => { return IfcSurfaceStyle.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSURFACESTYLELIGHTING] = (d) => { return IfcSurfaceStyleLighting.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSURFACESTYLEREFRACTION] = (d) => { return IfcSurfaceStyleRefraction.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSURFACESTYLERENDERING] = (d) => { return IfcSurfaceStyleRendering.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSURFACESTYLESHADING] = (d) => { return IfcSurfaceStyleShading.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSURFACESTYLEWITHTEXTURES] = (d) => { return IfcSurfaceStyleWithTextures.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSURFACETEXTURE] = (d) => { return IfcSurfaceTexture.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSWEPTAREASOLID] = (d) => { return IfcSweptAreaSolid.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSWEPTDISKSOLID] = (d) => { return IfcSweptDiskSolid.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSWEPTDISKSOLIDPOLYGONAL] = (d) => { return IfcSweptDiskSolidPolygonal.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSWEPTSURFACE] = (d) => { return IfcSweptSurface.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSWITCHINGDEVICE] = (d) => { return IfcSwitchingDevice.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSWITCHINGDEVICETYPE] = (d) => { return IfcSwitchingDeviceType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSYSTEM] = (d) => { return IfcSystem.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSYSTEMFURNITUREELEMENT] = (d) => { return IfcSystemFurnitureElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCSYSTEMFURNITUREELEMENTTYPE] = (d) => { return IfcSystemFurnitureElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTSHAPEPROFILEDEF] = (d) => { return IfcTShapeProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTABLE] = (d) => { return IfcTable.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTABLECOLUMN] = (d) => { return IfcTableColumn.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTABLEROW] = (d) => { return IfcTableRow.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTANK] = (d) => { return IfcTank.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTANKTYPE] = (d) => { return IfcTankType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTASK] = (d) => { return IfcTask.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTASKTIME] = (d) => { return IfcTaskTime.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTASKTIMERECURRING] = (d) => { return IfcTaskTimeRecurring.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTASKTYPE] = (d) => { return IfcTaskType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTELECOMADDRESS] = (d) => { return IfcTelecomAddress.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTENDON] = (d) => { return IfcTendon.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTENDONANCHOR] = (d) => { return IfcTendonAnchor.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTENDONANCHORTYPE] = (d) => { return IfcTendonAnchorType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTENDONCONDUIT] = (d) => { return IfcTendonConduit.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTENDONCONDUITTYPE] = (d) => { return IfcTendonConduitType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTENDONTYPE] = (d) => { return IfcTendonType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTESSELLATEDFACESET] = (d) => { return IfcTessellatedFaceSet.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTESSELLATEDITEM] = (d) => { return IfcTessellatedItem.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTEXTLITERAL] = (d) => { return IfcTextLiteral.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTEXTLITERALWITHEXTENT] = (d) => { return IfcTextLiteralWithExtent.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTEXTSTYLE] = (d) => { return IfcTextStyle.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTEXTSTYLEFONTMODEL] = (d) => { return IfcTextStyleFontModel.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTEXTSTYLEFORDEFINEDFONT] = (d) => { return IfcTextStyleForDefinedFont.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTEXTSTYLETEXTMODEL] = (d) => { return IfcTextStyleTextModel.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTEXTURECOORDINATE] = (d) => { return IfcTextureCoordinate.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTEXTURECOORDINATEGENERATOR] = (d) => { return IfcTextureCoordinateGenerator.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTEXTUREMAP] = (d) => { return IfcTextureMap.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTEXTUREVERTEX] = (d) => { return IfcTextureVertex.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTEXTUREVERTEXLIST] = (d) => { return IfcTextureVertexList.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTIMEPERIOD] = (d) => { return IfcTimePeriod.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTIMESERIES] = (d) => { return IfcTimeSeries.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTIMESERIESVALUE] = (d) => { return IfcTimeSeriesValue.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTOPOLOGICALREPRESENTATIONITEM] = (d) => { return IfcTopologicalRepresentationItem.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTOPOLOGYREPRESENTATION] = (d) => { return IfcTopologyRepresentation.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTOROIDALSURFACE] = (d) => { return IfcToroidalSurface.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTRANSFORMER] = (d) => { return IfcTransformer.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTRANSFORMERTYPE] = (d) => { return IfcTransformerType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTRANSITIONCURVESEGMENT2D] = (d) => { return IfcTransitionCurveSegment2D.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTRANSPORTELEMENT] = (d) => { return IfcTransportElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTRANSPORTELEMENTTYPE] = (d) => { return IfcTransportElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTRAPEZIUMPROFILEDEF] = (d) => { return IfcTrapeziumProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTRIANGULATEDFACESET] = (d) => { return IfcTriangulatedFaceSet.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTRIANGULATEDIRREGULARNETWORK] = (d) => { return IfcTriangulatedIrregularNetwork.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTRIMMEDCURVE] = (d) => { return IfcTrimmedCurve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTUBEBUNDLE] = (d) => { return IfcTubeBundle.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTUBEBUNDLETYPE] = (d) => { return IfcTubeBundleType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTYPEOBJECT] = (d) => { return IfcTypeObject.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTYPEPROCESS] = (d) => { return IfcTypeProcess.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTYPEPRODUCT] = (d) => { return IfcTypeProduct.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCTYPERESOURCE] = (d) => { return IfcTypeResource.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCUSHAPEPROFILEDEF] = (d) => { return IfcUShapeProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCUNITASSIGNMENT] = (d) => { return IfcUnitAssignment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCUNITARYCONTROLELEMENT] = (d) => { return IfcUnitaryControlElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCUNITARYCONTROLELEMENTTYPE] = (d) => { return IfcUnitaryControlElementType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCUNITARYEQUIPMENT] = (d) => { return IfcUnitaryEquipment.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCUNITARYEQUIPMENTTYPE] = (d) => { return IfcUnitaryEquipmentType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCVALVE] = (d) => { return IfcValve.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCVALVETYPE] = (d) => { return IfcValveType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCVECTOR] = (d) => { return IfcVector.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCVERTEX] = (d) => { return IfcVertex.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCVERTEXLOOP] = (d) => { return IfcVertexLoop.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCVERTEXPOINT] = (d) => { return IfcVertexPoint.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCVIBRATIONDAMPER] = (d) => { return IfcVibrationDamper.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCVIBRATIONDAMPERTYPE] = (d) => { return IfcVibrationDamperType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCVIBRATIONISOLATOR] = (d) => { return IfcVibrationIsolator.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCVIBRATIONISOLATORTYPE] = (d) => { return IfcVibrationIsolatorType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCVIRTUALELEMENT] = (d) => { return IfcVirtualElement.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCVIRTUALGRIDINTERSECTION] = (d) => { return IfcVirtualGridIntersection.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCVOIDINGFEATURE] = (d) => { return IfcVoidingFeature.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWALL] = (d) => { return IfcWall.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWALLELEMENTEDCASE] = (d) => { return IfcWallElementedCase.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWALLSTANDARDCASE] = (d) => { return IfcWallStandardCase.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWALLTYPE] = (d) => { return IfcWallType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWASTETERMINAL] = (d) => { return IfcWasteTerminal.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWASTETERMINALTYPE] = (d) => { return IfcWasteTerminalType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWINDOW] = (d) => { return IfcWindow.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWINDOWLININGPROPERTIES] = (d) => { return IfcWindowLiningProperties.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWINDOWPANELPROPERTIES] = (d) => { return IfcWindowPanelProperties.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWINDOWSTANDARDCASE] = (d) => { return IfcWindowStandardCase.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWINDOWSTYLE] = (d) => { return IfcWindowStyle.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWINDOWTYPE] = (d) => { return IfcWindowType.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWORKCALENDAR] = (d) => { return IfcWorkCalendar.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWORKCONTROL] = (d) => { return IfcWorkControl.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWORKPLAN] = (d) => { return IfcWorkPlan.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWORKSCHEDULE] = (d) => { return IfcWorkSchedule.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCWORKTIME] = (d) => { return IfcWorkTime.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCZSHAPEPROFILEDEF] = (d) => { return IfcZShapeProfileDef.FromTape(d.ID, d.type, d.arguments); }; FromRawLineData[IFCZONE] = (d) => { return IfcZone.FromTape(d.ID, d.type, d.arguments); }; var IfcActionRequest = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, PredefinedType, Status, LongDescription) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.PredefinedType = PredefinedType; this.Status = Status; this.LongDescription = LongDescription; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let PredefinedType = tape[ptr++]; let Status = tape[ptr++]; let LongDescription = tape[ptr++]; return new IfcActionRequest(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, PredefinedType, Status, LongDescription); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.PredefinedType); args.push(this.Status); args.push(this.LongDescription); return args; } }; var IfcActor = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, TheActor) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.TheActor = TheActor; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let TheActor = tape[ptr++]; return new IfcActor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, TheActor); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.TheActor); return args; } }; var IfcActorRole = class { constructor(expressID, type, Role, UserDefinedRole, Description) { this.expressID = expressID; this.type = type; this.Role = Role; this.UserDefinedRole = UserDefinedRole; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let Role = tape[ptr++]; let UserDefinedRole = tape[ptr++]; let Description = tape[ptr++]; return new IfcActorRole(expressID, type, Role, UserDefinedRole, Description); } ToTape() { let args = []; args.push(this.Role); args.push(this.UserDefinedRole); args.push(this.Description); return args; } }; var IfcActuator = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcActuator(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcActuatorType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcActuatorType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcAddress = class { constructor(expressID, type, Purpose, Description, UserDefinedPurpose) { this.expressID = expressID; this.type = type; this.Purpose = Purpose; this.Description = Description; this.UserDefinedPurpose = UserDefinedPurpose; } static FromTape(expressID, type, tape) { let ptr = 0; let Purpose = tape[ptr++]; let Description = tape[ptr++]; let UserDefinedPurpose = tape[ptr++]; return new IfcAddress(expressID, type, Purpose, Description, UserDefinedPurpose); } ToTape() { let args = []; args.push(this.Purpose); args.push(this.Description); args.push(this.UserDefinedPurpose); return args; } }; var IfcAdvancedBrep = class { constructor(expressID, type, Outer) { this.expressID = expressID; this.type = type; this.Outer = Outer; } static FromTape(expressID, type, tape) { let ptr = 0; let Outer = tape[ptr++]; return new IfcAdvancedBrep(expressID, type, Outer); } ToTape() { let args = []; args.push(this.Outer); return args; } }; var IfcAdvancedBrepWithVoids = class { constructor(expressID, type, Outer, Voids) { this.expressID = expressID; this.type = type; this.Outer = Outer; this.Voids = Voids; } static FromTape(expressID, type, tape) { let ptr = 0; let Outer = tape[ptr++]; let Voids = tape[ptr++]; return new IfcAdvancedBrepWithVoids(expressID, type, Outer, Voids); } ToTape() { let args = []; args.push(this.Outer); args.push(this.Voids); return args; } }; var IfcAdvancedFace = class { constructor(expressID, type, Bounds, FaceSurface, SameSense) { this.expressID = expressID; this.type = type; this.Bounds = Bounds; this.FaceSurface = FaceSurface; this.SameSense = SameSense; } static FromTape(expressID, type, tape) { let ptr = 0; let Bounds = tape[ptr++]; let FaceSurface = tape[ptr++]; let SameSense = tape[ptr++]; return new IfcAdvancedFace(expressID, type, Bounds, FaceSurface, SameSense); } ToTape() { let args = []; args.push(this.Bounds); args.push(this.FaceSurface); args.push(this.SameSense); return args; } }; var IfcAirTerminal = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcAirTerminal(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcAirTerminalBox = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcAirTerminalBox(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcAirTerminalBoxType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcAirTerminalBoxType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcAirTerminalType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcAirTerminalType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcAirToAirHeatRecovery = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcAirToAirHeatRecovery(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcAirToAirHeatRecoveryType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcAirToAirHeatRecoveryType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcAlarm = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcAlarm(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcAlarmType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcAlarmType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcAlignment = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Axis, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Axis = Axis; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Axis = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcAlignment(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Axis, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Axis); args.push(this.PredefinedType); return args; } }; var IfcAlignment2DHorizontal = class { constructor(expressID, type, StartDistAlong, Segments) { this.expressID = expressID; this.type = type; this.StartDistAlong = StartDistAlong; this.Segments = Segments; } static FromTape(expressID, type, tape) { let ptr = 0; let StartDistAlong = tape[ptr++]; let Segments = tape[ptr++]; return new IfcAlignment2DHorizontal(expressID, type, StartDistAlong, Segments); } ToTape() { let args = []; args.push(this.StartDistAlong); args.push(this.Segments); return args; } }; var IfcAlignment2DHorizontalSegment = class { constructor(expressID, type, TangentialContinuity, StartTag, EndTag, CurveGeometry) { this.expressID = expressID; this.type = type; this.TangentialContinuity = TangentialContinuity; this.StartTag = StartTag; this.EndTag = EndTag; this.CurveGeometry = CurveGeometry; } static FromTape(expressID, type, tape) { let ptr = 0; let TangentialContinuity = tape[ptr++]; let StartTag = tape[ptr++]; let EndTag = tape[ptr++]; let CurveGeometry = tape[ptr++]; return new IfcAlignment2DHorizontalSegment(expressID, type, TangentialContinuity, StartTag, EndTag, CurveGeometry); } ToTape() { let args = []; args.push(this.TangentialContinuity); args.push(this.StartTag); args.push(this.EndTag); args.push(this.CurveGeometry); return args; } }; var IfcAlignment2DSegment = class { constructor(expressID, type, TangentialContinuity, StartTag, EndTag) { this.expressID = expressID; this.type = type; this.TangentialContinuity = TangentialContinuity; this.StartTag = StartTag; this.EndTag = EndTag; } static FromTape(expressID, type, tape) { let ptr = 0; let TangentialContinuity = tape[ptr++]; let StartTag = tape[ptr++]; let EndTag = tape[ptr++]; return new IfcAlignment2DSegment(expressID, type, TangentialContinuity, StartTag, EndTag); } ToTape() { let args = []; args.push(this.TangentialContinuity); args.push(this.StartTag); args.push(this.EndTag); return args; } }; var IfcAlignment2DVerSegCircularArc = class { constructor(expressID, type, TangentialContinuity, StartTag, EndTag, StartDistAlong, HorizontalLength, StartHeight, StartGradient, Radius, IsConvex) { this.expressID = expressID; this.type = type; this.TangentialContinuity = TangentialContinuity; this.StartTag = StartTag; this.EndTag = EndTag; this.StartDistAlong = StartDistAlong; this.HorizontalLength = HorizontalLength; this.StartHeight = StartHeight; this.StartGradient = StartGradient; this.Radius = Radius; this.IsConvex = IsConvex; } static FromTape(expressID, type, tape) { let ptr = 0; let TangentialContinuity = tape[ptr++]; let StartTag = tape[ptr++]; let EndTag = tape[ptr++]; let StartDistAlong = tape[ptr++]; let HorizontalLength = tape[ptr++]; let StartHeight = tape[ptr++]; let StartGradient = tape[ptr++]; let Radius = tape[ptr++]; let IsConvex = tape[ptr++]; return new IfcAlignment2DVerSegCircularArc(expressID, type, TangentialContinuity, StartTag, EndTag, StartDistAlong, HorizontalLength, StartHeight, StartGradient, Radius, IsConvex); } ToTape() { let args = []; args.push(this.TangentialContinuity); args.push(this.StartTag); args.push(this.EndTag); args.push(this.StartDistAlong); args.push(this.HorizontalLength); args.push(this.StartHeight); args.push(this.StartGradient); args.push(this.Radius); args.push(this.IsConvex); return args; } }; var IfcAlignment2DVerSegLine = class { constructor(expressID, type, TangentialContinuity, StartTag, EndTag, StartDistAlong, HorizontalLength, StartHeight, StartGradient) { this.expressID = expressID; this.type = type; this.TangentialContinuity = TangentialContinuity; this.StartTag = StartTag; this.EndTag = EndTag; this.StartDistAlong = StartDistAlong; this.HorizontalLength = HorizontalLength; this.StartHeight = StartHeight; this.StartGradient = StartGradient; } static FromTape(expressID, type, tape) { let ptr = 0; let TangentialContinuity = tape[ptr++]; let StartTag = tape[ptr++]; let EndTag = tape[ptr++]; let StartDistAlong = tape[ptr++]; let HorizontalLength = tape[ptr++]; let StartHeight = tape[ptr++]; let StartGradient = tape[ptr++]; return new IfcAlignment2DVerSegLine(expressID, type, TangentialContinuity, StartTag, EndTag, StartDistAlong, HorizontalLength, StartHeight, StartGradient); } ToTape() { let args = []; args.push(this.TangentialContinuity); args.push(this.StartTag); args.push(this.EndTag); args.push(this.StartDistAlong); args.push(this.HorizontalLength); args.push(this.StartHeight); args.push(this.StartGradient); return args; } }; var IfcAlignment2DVerSegParabolicArc = class { constructor(expressID, type, TangentialContinuity, StartTag, EndTag, StartDistAlong, HorizontalLength, StartHeight, StartGradient, ParabolaConstant, IsConvex) { this.expressID = expressID; this.type = type; this.TangentialContinuity = TangentialContinuity; this.StartTag = StartTag; this.EndTag = EndTag; this.StartDistAlong = StartDistAlong; this.HorizontalLength = HorizontalLength; this.StartHeight = StartHeight; this.StartGradient = StartGradient; this.ParabolaConstant = ParabolaConstant; this.IsConvex = IsConvex; } static FromTape(expressID, type, tape) { let ptr = 0; let TangentialContinuity = tape[ptr++]; let StartTag = tape[ptr++]; let EndTag = tape[ptr++]; let StartDistAlong = tape[ptr++]; let HorizontalLength = tape[ptr++]; let StartHeight = tape[ptr++]; let StartGradient = tape[ptr++]; let ParabolaConstant = tape[ptr++]; let IsConvex = tape[ptr++]; return new IfcAlignment2DVerSegParabolicArc(expressID, type, TangentialContinuity, StartTag, EndTag, StartDistAlong, HorizontalLength, StartHeight, StartGradient, ParabolaConstant, IsConvex); } ToTape() { let args = []; args.push(this.TangentialContinuity); args.push(this.StartTag); args.push(this.EndTag); args.push(this.StartDistAlong); args.push(this.HorizontalLength); args.push(this.StartHeight); args.push(this.StartGradient); args.push(this.ParabolaConstant); args.push(this.IsConvex); return args; } }; var IfcAlignment2DVertical = class { constructor(expressID, type, Segments) { this.expressID = expressID; this.type = type; this.Segments = Segments; } static FromTape(expressID, type, tape) { let ptr = 0; let Segments = tape[ptr++]; return new IfcAlignment2DVertical(expressID, type, Segments); } ToTape() { let args = []; args.push(this.Segments); return args; } }; var IfcAlignment2DVerticalSegment = class { constructor(expressID, type, TangentialContinuity, StartTag, EndTag, StartDistAlong, HorizontalLength, StartHeight, StartGradient) { this.expressID = expressID; this.type = type; this.TangentialContinuity = TangentialContinuity; this.StartTag = StartTag; this.EndTag = EndTag; this.StartDistAlong = StartDistAlong; this.HorizontalLength = HorizontalLength; this.StartHeight = StartHeight; this.StartGradient = StartGradient; } static FromTape(expressID, type, tape) { let ptr = 0; let TangentialContinuity = tape[ptr++]; let StartTag = tape[ptr++]; let EndTag = tape[ptr++]; let StartDistAlong = tape[ptr++]; let HorizontalLength = tape[ptr++]; let StartHeight = tape[ptr++]; let StartGradient = tape[ptr++]; return new IfcAlignment2DVerticalSegment(expressID, type, TangentialContinuity, StartTag, EndTag, StartDistAlong, HorizontalLength, StartHeight, StartGradient); } ToTape() { let args = []; args.push(this.TangentialContinuity); args.push(this.StartTag); args.push(this.EndTag); args.push(this.StartDistAlong); args.push(this.HorizontalLength); args.push(this.StartHeight); args.push(this.StartGradient); return args; } }; var IfcAlignmentCurve = class { constructor(expressID, type, Horizontal, Vertical, Tag) { this.expressID = expressID; this.type = type; this.Horizontal = Horizontal; this.Vertical = Vertical; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let Horizontal = tape[ptr++]; let Vertical = tape[ptr++]; let Tag = tape[ptr++]; return new IfcAlignmentCurve(expressID, type, Horizontal, Vertical, Tag); } ToTape() { let args = []; args.push(this.Horizontal); args.push(this.Vertical); args.push(this.Tag); return args; } }; var IfcAnnotation = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; return new IfcAnnotation(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); return args; } }; var IfcAnnotationFillArea = class { constructor(expressID, type, OuterBoundary, InnerBoundaries) { this.expressID = expressID; this.type = type; this.OuterBoundary = OuterBoundary; this.InnerBoundaries = InnerBoundaries; } static FromTape(expressID, type, tape) { let ptr = 0; let OuterBoundary = tape[ptr++]; let InnerBoundaries = tape[ptr++]; return new IfcAnnotationFillArea(expressID, type, OuterBoundary, InnerBoundaries); } ToTape() { let args = []; args.push(this.OuterBoundary); args.push(this.InnerBoundaries); return args; } }; var IfcApplication = class { constructor(expressID, type, ApplicationDeveloper, Version, ApplicationFullName, ApplicationIdentifier) { this.expressID = expressID; this.type = type; this.ApplicationDeveloper = ApplicationDeveloper; this.Version = Version; this.ApplicationFullName = ApplicationFullName; this.ApplicationIdentifier = ApplicationIdentifier; } static FromTape(expressID, type, tape) { let ptr = 0; let ApplicationDeveloper = tape[ptr++]; let Version = tape[ptr++]; let ApplicationFullName = tape[ptr++]; let ApplicationIdentifier = tape[ptr++]; return new IfcApplication(expressID, type, ApplicationDeveloper, Version, ApplicationFullName, ApplicationIdentifier); } ToTape() { let args = []; args.push(this.ApplicationDeveloper); args.push(this.Version); args.push(this.ApplicationFullName); args.push(this.ApplicationIdentifier); return args; } }; var IfcAppliedValue = class { constructor(expressID, type, Name, Description, AppliedValue, UnitBasis, ApplicableDate, FixedUntilDate, Category, Condition, ArithmeticOperator, Components) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.AppliedValue = AppliedValue; this.UnitBasis = UnitBasis; this.ApplicableDate = ApplicableDate; this.FixedUntilDate = FixedUntilDate; this.Category = Category; this.Condition = Condition; this.ArithmeticOperator = ArithmeticOperator; this.Components = Components; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let AppliedValue = tape[ptr++]; let UnitBasis = tape[ptr++]; let ApplicableDate = tape[ptr++]; let FixedUntilDate = tape[ptr++]; let Category = tape[ptr++]; let Condition = tape[ptr++]; let ArithmeticOperator = tape[ptr++]; let Components = tape[ptr++]; return new IfcAppliedValue(expressID, type, Name, Description, AppliedValue, UnitBasis, ApplicableDate, FixedUntilDate, Category, Condition, ArithmeticOperator, Components); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.AppliedValue); args.push(this.UnitBasis); args.push(this.ApplicableDate); args.push(this.FixedUntilDate); args.push(this.Category); args.push(this.Condition); args.push(this.ArithmeticOperator); args.push(this.Components); return args; } }; var IfcApproval = class { constructor(expressID, type, Identifier, Name, Description, TimeOfApproval, Status, Level, Qualifier, RequestingApproval, GivingApproval) { this.expressID = expressID; this.type = type; this.Identifier = Identifier; this.Name = Name; this.Description = Description; this.TimeOfApproval = TimeOfApproval; this.Status = Status; this.Level = Level; this.Qualifier = Qualifier; this.RequestingApproval = RequestingApproval; this.GivingApproval = GivingApproval; } static FromTape(expressID, type, tape) { let ptr = 0; let Identifier = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let TimeOfApproval = tape[ptr++]; let Status = tape[ptr++]; let Level = tape[ptr++]; let Qualifier = tape[ptr++]; let RequestingApproval = tape[ptr++]; let GivingApproval = tape[ptr++]; return new IfcApproval(expressID, type, Identifier, Name, Description, TimeOfApproval, Status, Level, Qualifier, RequestingApproval, GivingApproval); } ToTape() { let args = []; args.push(this.Identifier); args.push(this.Name); args.push(this.Description); args.push(this.TimeOfApproval); args.push(this.Status); args.push(this.Level); args.push(this.Qualifier); args.push(this.RequestingApproval); args.push(this.GivingApproval); return args; } }; var IfcApprovalRelationship = class { constructor(expressID, type, Name, Description, RelatingApproval, RelatedApprovals) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.RelatingApproval = RelatingApproval; this.RelatedApprovals = RelatedApprovals; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingApproval = tape[ptr++]; let RelatedApprovals = tape[ptr++]; return new IfcApprovalRelationship(expressID, type, Name, Description, RelatingApproval, RelatedApprovals); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.RelatingApproval); args.push(this.RelatedApprovals); return args; } }; var IfcArbitraryClosedProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, OuterCurve) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.OuterCurve = OuterCurve; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let OuterCurve = tape[ptr++]; return new IfcArbitraryClosedProfileDef(expressID, type, ProfileType, ProfileName, OuterCurve); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.OuterCurve); return args; } }; var IfcArbitraryOpenProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Curve) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Curve = Curve; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Curve = tape[ptr++]; return new IfcArbitraryOpenProfileDef(expressID, type, ProfileType, ProfileName, Curve); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Curve); return args; } }; var IfcArbitraryProfileDefWithVoids = class { constructor(expressID, type, ProfileType, ProfileName, OuterCurve, InnerCurves) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.OuterCurve = OuterCurve; this.InnerCurves = InnerCurves; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let OuterCurve = tape[ptr++]; let InnerCurves = tape[ptr++]; return new IfcArbitraryProfileDefWithVoids(expressID, type, ProfileType, ProfileName, OuterCurve, InnerCurves); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.OuterCurve); args.push(this.InnerCurves); return args; } }; var IfcAsset = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, OriginalValue, CurrentValue, TotalReplacementCost, Owner, User, ResponsiblePerson, IncorporationDate, DepreciatedValue) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.OriginalValue = OriginalValue; this.CurrentValue = CurrentValue; this.TotalReplacementCost = TotalReplacementCost; this.Owner = Owner; this.User = User; this.ResponsiblePerson = ResponsiblePerson; this.IncorporationDate = IncorporationDate; this.DepreciatedValue = DepreciatedValue; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let OriginalValue = tape[ptr++]; let CurrentValue = tape[ptr++]; let TotalReplacementCost = tape[ptr++]; let Owner = tape[ptr++]; let User = tape[ptr++]; let ResponsiblePerson = tape[ptr++]; let IncorporationDate = tape[ptr++]; let DepreciatedValue = tape[ptr++]; return new IfcAsset(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, OriginalValue, CurrentValue, TotalReplacementCost, Owner, User, ResponsiblePerson, IncorporationDate, DepreciatedValue); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.OriginalValue); args.push(this.CurrentValue); args.push(this.TotalReplacementCost); args.push(this.Owner); args.push(this.User); args.push(this.ResponsiblePerson); args.push(this.IncorporationDate); args.push(this.DepreciatedValue); return args; } }; var IfcAsymmetricIShapeProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position, BottomFlangeWidth, OverallDepth, WebThickness, BottomFlangeThickness, BottomFlangeFilletRadius, TopFlangeWidth, TopFlangeThickness, TopFlangeFilletRadius, BottomFlangeEdgeRadius, BottomFlangeSlope, TopFlangeEdgeRadius, TopFlangeSlope) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; this.BottomFlangeWidth = BottomFlangeWidth; this.OverallDepth = OverallDepth; this.WebThickness = WebThickness; this.BottomFlangeThickness = BottomFlangeThickness; this.BottomFlangeFilletRadius = BottomFlangeFilletRadius; this.TopFlangeWidth = TopFlangeWidth; this.TopFlangeThickness = TopFlangeThickness; this.TopFlangeFilletRadius = TopFlangeFilletRadius; this.BottomFlangeEdgeRadius = BottomFlangeEdgeRadius; this.BottomFlangeSlope = BottomFlangeSlope; this.TopFlangeEdgeRadius = TopFlangeEdgeRadius; this.TopFlangeSlope = TopFlangeSlope; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; let BottomFlangeWidth = tape[ptr++]; let OverallDepth = tape[ptr++]; let WebThickness = tape[ptr++]; let BottomFlangeThickness = tape[ptr++]; let BottomFlangeFilletRadius = tape[ptr++]; let TopFlangeWidth = tape[ptr++]; let TopFlangeThickness = tape[ptr++]; let TopFlangeFilletRadius = tape[ptr++]; let BottomFlangeEdgeRadius = tape[ptr++]; let BottomFlangeSlope = tape[ptr++]; let TopFlangeEdgeRadius = tape[ptr++]; let TopFlangeSlope = tape[ptr++]; return new IfcAsymmetricIShapeProfileDef(expressID, type, ProfileType, ProfileName, Position, BottomFlangeWidth, OverallDepth, WebThickness, BottomFlangeThickness, BottomFlangeFilletRadius, TopFlangeWidth, TopFlangeThickness, TopFlangeFilletRadius, BottomFlangeEdgeRadius, BottomFlangeSlope, TopFlangeEdgeRadius, TopFlangeSlope); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); args.push(this.BottomFlangeWidth); args.push(this.OverallDepth); args.push(this.WebThickness); args.push(this.BottomFlangeThickness); args.push(this.BottomFlangeFilletRadius); args.push(this.TopFlangeWidth); args.push(this.TopFlangeThickness); args.push(this.TopFlangeFilletRadius); args.push(this.BottomFlangeEdgeRadius); args.push(this.BottomFlangeSlope); args.push(this.TopFlangeEdgeRadius); args.push(this.TopFlangeSlope); return args; } }; var IfcAudioVisualAppliance = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcAudioVisualAppliance(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcAudioVisualApplianceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcAudioVisualApplianceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcAxis1Placement = class { constructor(expressID, type, Location, Axis) { this.expressID = expressID; this.type = type; this.Location = Location; this.Axis = Axis; } static FromTape(expressID, type, tape) { let ptr = 0; let Location = tape[ptr++]; let Axis = tape[ptr++]; return new IfcAxis1Placement(expressID, type, Location, Axis); } ToTape() { let args = []; args.push(this.Location); args.push(this.Axis); return args; } }; var IfcAxis2Placement2D = class { constructor(expressID, type, Location, RefDirection) { this.expressID = expressID; this.type = type; this.Location = Location; this.RefDirection = RefDirection; } static FromTape(expressID, type, tape) { let ptr = 0; let Location = tape[ptr++]; let RefDirection = tape[ptr++]; return new IfcAxis2Placement2D(expressID, type, Location, RefDirection); } ToTape() { let args = []; args.push(this.Location); args.push(this.RefDirection); return args; } }; var IfcAxis2Placement3D = class { constructor(expressID, type, Location, Axis, RefDirection) { this.expressID = expressID; this.type = type; this.Location = Location; this.Axis = Axis; this.RefDirection = RefDirection; } static FromTape(expressID, type, tape) { let ptr = 0; let Location = tape[ptr++]; let Axis = tape[ptr++]; let RefDirection = tape[ptr++]; return new IfcAxis2Placement3D(expressID, type, Location, Axis, RefDirection); } ToTape() { let args = []; args.push(this.Location); args.push(this.Axis); args.push(this.RefDirection); return args; } }; var IfcBSplineCurve = class { constructor(expressID, type, Degree, ControlPointsList, CurveForm, ClosedCurve, SelfIntersect) { this.expressID = expressID; this.type = type; this.Degree = Degree; this.ControlPointsList = ControlPointsList; this.CurveForm = CurveForm; this.ClosedCurve = ClosedCurve; this.SelfIntersect = SelfIntersect; } static FromTape(expressID, type, tape) { let ptr = 0; let Degree = tape[ptr++]; let ControlPointsList = tape[ptr++]; let CurveForm = tape[ptr++]; let ClosedCurve = tape[ptr++]; let SelfIntersect = tape[ptr++]; return new IfcBSplineCurve(expressID, type, Degree, ControlPointsList, CurveForm, ClosedCurve, SelfIntersect); } ToTape() { let args = []; args.push(this.Degree); args.push(this.ControlPointsList); args.push(this.CurveForm); args.push(this.ClosedCurve); args.push(this.SelfIntersect); return args; } }; var IfcBSplineCurveWithKnots = class { constructor(expressID, type, Degree, ControlPointsList, CurveForm, ClosedCurve, SelfIntersect, KnotMultiplicities, Knots, KnotSpec) { this.expressID = expressID; this.type = type; this.Degree = Degree; this.ControlPointsList = ControlPointsList; this.CurveForm = CurveForm; this.ClosedCurve = ClosedCurve; this.SelfIntersect = SelfIntersect; this.KnotMultiplicities = KnotMultiplicities; this.Knots = Knots; this.KnotSpec = KnotSpec; } static FromTape(expressID, type, tape) { let ptr = 0; let Degree = tape[ptr++]; let ControlPointsList = tape[ptr++]; let CurveForm = tape[ptr++]; let ClosedCurve = tape[ptr++]; let SelfIntersect = tape[ptr++]; let KnotMultiplicities = tape[ptr++]; let Knots = tape[ptr++]; let KnotSpec = tape[ptr++]; return new IfcBSplineCurveWithKnots(expressID, type, Degree, ControlPointsList, CurveForm, ClosedCurve, SelfIntersect, KnotMultiplicities, Knots, KnotSpec); } ToTape() { let args = []; args.push(this.Degree); args.push(this.ControlPointsList); args.push(this.CurveForm); args.push(this.ClosedCurve); args.push(this.SelfIntersect); args.push(this.KnotMultiplicities); args.push(this.Knots); args.push(this.KnotSpec); return args; } }; var IfcBSplineSurface = class { constructor(expressID, type, UDegree, VDegree, ControlPointsList, SurfaceForm, UClosed, VClosed, SelfIntersect) { this.expressID = expressID; this.type = type; this.UDegree = UDegree; this.VDegree = VDegree; this.ControlPointsList = ControlPointsList; this.SurfaceForm = SurfaceForm; this.UClosed = UClosed; this.VClosed = VClosed; this.SelfIntersect = SelfIntersect; } static FromTape(expressID, type, tape) { let ptr = 0; let UDegree = tape[ptr++]; let VDegree = tape[ptr++]; let ControlPointsList = tape[ptr++]; let SurfaceForm = tape[ptr++]; let UClosed = tape[ptr++]; let VClosed = tape[ptr++]; let SelfIntersect = tape[ptr++]; return new IfcBSplineSurface(expressID, type, UDegree, VDegree, ControlPointsList, SurfaceForm, UClosed, VClosed, SelfIntersect); } ToTape() { let args = []; args.push(this.UDegree); args.push(this.VDegree); args.push(this.ControlPointsList); args.push(this.SurfaceForm); args.push(this.UClosed); args.push(this.VClosed); args.push(this.SelfIntersect); return args; } }; var IfcBSplineSurfaceWithKnots = class { constructor(expressID, type, UDegree, VDegree, ControlPointsList, SurfaceForm, UClosed, VClosed, SelfIntersect, UMultiplicities, VMultiplicities, UKnots, VKnots, KnotSpec) { this.expressID = expressID; this.type = type; this.UDegree = UDegree; this.VDegree = VDegree; this.ControlPointsList = ControlPointsList; this.SurfaceForm = SurfaceForm; this.UClosed = UClosed; this.VClosed = VClosed; this.SelfIntersect = SelfIntersect; this.UMultiplicities = UMultiplicities; this.VMultiplicities = VMultiplicities; this.UKnots = UKnots; this.VKnots = VKnots; this.KnotSpec = KnotSpec; } static FromTape(expressID, type, tape) { let ptr = 0; let UDegree = tape[ptr++]; let VDegree = tape[ptr++]; let ControlPointsList = tape[ptr++]; let SurfaceForm = tape[ptr++]; let UClosed = tape[ptr++]; let VClosed = tape[ptr++]; let SelfIntersect = tape[ptr++]; let UMultiplicities = tape[ptr++]; let VMultiplicities = tape[ptr++]; let UKnots = tape[ptr++]; let VKnots = tape[ptr++]; let KnotSpec = tape[ptr++]; return new IfcBSplineSurfaceWithKnots(expressID, type, UDegree, VDegree, ControlPointsList, SurfaceForm, UClosed, VClosed, SelfIntersect, UMultiplicities, VMultiplicities, UKnots, VKnots, KnotSpec); } ToTape() { let args = []; args.push(this.UDegree); args.push(this.VDegree); args.push(this.ControlPointsList); args.push(this.SurfaceForm); args.push(this.UClosed); args.push(this.VClosed); args.push(this.SelfIntersect); args.push(this.UMultiplicities); args.push(this.VMultiplicities); args.push(this.UKnots); args.push(this.VKnots); args.push(this.KnotSpec); return args; } }; var IfcBeam = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBeam(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcBeamStandardCase = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBeamStandardCase(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcBeamType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBeamType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcBearing = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBearing(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcBearingType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBearingType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcBlobTexture = class { constructor(expressID, type, RepeatS, RepeatT, Mode, TextureTransform, Parameter, RasterFormat, RasterCode) { this.expressID = expressID; this.type = type; this.RepeatS = RepeatS; this.RepeatT = RepeatT; this.Mode = Mode; this.TextureTransform = TextureTransform; this.Parameter = Parameter; this.RasterFormat = RasterFormat; this.RasterCode = RasterCode; } static FromTape(expressID, type, tape) { let ptr = 0; let RepeatS = tape[ptr++]; let RepeatT = tape[ptr++]; let Mode = tape[ptr++]; let TextureTransform = tape[ptr++]; let Parameter = tape[ptr++]; let RasterFormat = tape[ptr++]; let RasterCode = tape[ptr++]; return new IfcBlobTexture(expressID, type, RepeatS, RepeatT, Mode, TextureTransform, Parameter, RasterFormat, RasterCode); } ToTape() { let args = []; args.push(this.RepeatS); args.push(this.RepeatT); args.push(this.Mode); args.push(this.TextureTransform); args.push(this.Parameter); args.push(this.RasterFormat); args.push(this.RasterCode); return args; } }; var IfcBlock = class { constructor(expressID, type, Position, XLength, YLength, ZLength) { this.expressID = expressID; this.type = type; this.Position = Position; this.XLength = XLength; this.YLength = YLength; this.ZLength = ZLength; } static FromTape(expressID, type, tape) { let ptr = 0; let Position = tape[ptr++]; let XLength = tape[ptr++]; let YLength = tape[ptr++]; let ZLength = tape[ptr++]; return new IfcBlock(expressID, type, Position, XLength, YLength, ZLength); } ToTape() { let args = []; args.push(this.Position); args.push(this.XLength); args.push(this.YLength); args.push(this.ZLength); return args; } }; var IfcBoiler = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBoiler(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcBoilerType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBoilerType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcBooleanClippingResult = class { constructor(expressID, type, Operator, FirstOperand, SecondOperand) { this.expressID = expressID; this.type = type; this.Operator = Operator; this.FirstOperand = FirstOperand; this.SecondOperand = SecondOperand; } static FromTape(expressID, type, tape) { let ptr = 0; let Operator = tape[ptr++]; let FirstOperand = tape[ptr++]; let SecondOperand = tape[ptr++]; return new IfcBooleanClippingResult(expressID, type, Operator, FirstOperand, SecondOperand); } ToTape() { let args = []; args.push(this.Operator); args.push(this.FirstOperand); args.push(this.SecondOperand); return args; } }; var IfcBooleanResult = class { constructor(expressID, type, Operator, FirstOperand, SecondOperand) { this.expressID = expressID; this.type = type; this.Operator = Operator; this.FirstOperand = FirstOperand; this.SecondOperand = SecondOperand; } static FromTape(expressID, type, tape) { let ptr = 0; let Operator = tape[ptr++]; let FirstOperand = tape[ptr++]; let SecondOperand = tape[ptr++]; return new IfcBooleanResult(expressID, type, Operator, FirstOperand, SecondOperand); } ToTape() { let args = []; args.push(this.Operator); args.push(this.FirstOperand); args.push(this.SecondOperand); return args; } }; var IfcBoundaryCondition = class { constructor(expressID, type, Name) { this.expressID = expressID; this.type = type; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; return new IfcBoundaryCondition(expressID, type, Name); } ToTape() { let args = []; args.push(this.Name); return args; } }; var IfcBoundaryCurve = class { constructor(expressID, type, Segments, SelfIntersect) { this.expressID = expressID; this.type = type; this.Segments = Segments; this.SelfIntersect = SelfIntersect; } static FromTape(expressID, type, tape) { let ptr = 0; let Segments = tape[ptr++]; let SelfIntersect = tape[ptr++]; return new IfcBoundaryCurve(expressID, type, Segments, SelfIntersect); } ToTape() { let args = []; args.push(this.Segments); args.push(this.SelfIntersect); return args; } }; var IfcBoundaryEdgeCondition = class { constructor(expressID, type, Name, TranslationalStiffnessByLengthX, TranslationalStiffnessByLengthY, TranslationalStiffnessByLengthZ, RotationalStiffnessByLengthX, RotationalStiffnessByLengthY, RotationalStiffnessByLengthZ) { this.expressID = expressID; this.type = type; this.Name = Name; this.TranslationalStiffnessByLengthX = TranslationalStiffnessByLengthX; this.TranslationalStiffnessByLengthY = TranslationalStiffnessByLengthY; this.TranslationalStiffnessByLengthZ = TranslationalStiffnessByLengthZ; this.RotationalStiffnessByLengthX = RotationalStiffnessByLengthX; this.RotationalStiffnessByLengthY = RotationalStiffnessByLengthY; this.RotationalStiffnessByLengthZ = RotationalStiffnessByLengthZ; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let TranslationalStiffnessByLengthX = tape[ptr++]; let TranslationalStiffnessByLengthY = tape[ptr++]; let TranslationalStiffnessByLengthZ = tape[ptr++]; let RotationalStiffnessByLengthX = tape[ptr++]; let RotationalStiffnessByLengthY = tape[ptr++]; let RotationalStiffnessByLengthZ = tape[ptr++]; return new IfcBoundaryEdgeCondition(expressID, type, Name, TranslationalStiffnessByLengthX, TranslationalStiffnessByLengthY, TranslationalStiffnessByLengthZ, RotationalStiffnessByLengthX, RotationalStiffnessByLengthY, RotationalStiffnessByLengthZ); } ToTape() { let args = []; args.push(this.Name); args.push(this.TranslationalStiffnessByLengthX); args.push(this.TranslationalStiffnessByLengthY); args.push(this.TranslationalStiffnessByLengthZ); args.push(this.RotationalStiffnessByLengthX); args.push(this.RotationalStiffnessByLengthY); args.push(this.RotationalStiffnessByLengthZ); return args; } }; var IfcBoundaryFaceCondition = class { constructor(expressID, type, Name, TranslationalStiffnessByAreaX, TranslationalStiffnessByAreaY, TranslationalStiffnessByAreaZ) { this.expressID = expressID; this.type = type; this.Name = Name; this.TranslationalStiffnessByAreaX = TranslationalStiffnessByAreaX; this.TranslationalStiffnessByAreaY = TranslationalStiffnessByAreaY; this.TranslationalStiffnessByAreaZ = TranslationalStiffnessByAreaZ; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let TranslationalStiffnessByAreaX = tape[ptr++]; let TranslationalStiffnessByAreaY = tape[ptr++]; let TranslationalStiffnessByAreaZ = tape[ptr++]; return new IfcBoundaryFaceCondition(expressID, type, Name, TranslationalStiffnessByAreaX, TranslationalStiffnessByAreaY, TranslationalStiffnessByAreaZ); } ToTape() { let args = []; args.push(this.Name); args.push(this.TranslationalStiffnessByAreaX); args.push(this.TranslationalStiffnessByAreaY); args.push(this.TranslationalStiffnessByAreaZ); return args; } }; var IfcBoundaryNodeCondition = class { constructor(expressID, type, Name, TranslationalStiffnessX, TranslationalStiffnessY, TranslationalStiffnessZ, RotationalStiffnessX, RotationalStiffnessY, RotationalStiffnessZ) { this.expressID = expressID; this.type = type; this.Name = Name; this.TranslationalStiffnessX = TranslationalStiffnessX; this.TranslationalStiffnessY = TranslationalStiffnessY; this.TranslationalStiffnessZ = TranslationalStiffnessZ; this.RotationalStiffnessX = RotationalStiffnessX; this.RotationalStiffnessY = RotationalStiffnessY; this.RotationalStiffnessZ = RotationalStiffnessZ; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let TranslationalStiffnessX = tape[ptr++]; let TranslationalStiffnessY = tape[ptr++]; let TranslationalStiffnessZ = tape[ptr++]; let RotationalStiffnessX = tape[ptr++]; let RotationalStiffnessY = tape[ptr++]; let RotationalStiffnessZ = tape[ptr++]; return new IfcBoundaryNodeCondition(expressID, type, Name, TranslationalStiffnessX, TranslationalStiffnessY, TranslationalStiffnessZ, RotationalStiffnessX, RotationalStiffnessY, RotationalStiffnessZ); } ToTape() { let args = []; args.push(this.Name); args.push(this.TranslationalStiffnessX); args.push(this.TranslationalStiffnessY); args.push(this.TranslationalStiffnessZ); args.push(this.RotationalStiffnessX); args.push(this.RotationalStiffnessY); args.push(this.RotationalStiffnessZ); return args; } }; var IfcBoundaryNodeConditionWarping = class { constructor(expressID, type, Name, TranslationalStiffnessX, TranslationalStiffnessY, TranslationalStiffnessZ, RotationalStiffnessX, RotationalStiffnessY, RotationalStiffnessZ, WarpingStiffness) { this.expressID = expressID; this.type = type; this.Name = Name; this.TranslationalStiffnessX = TranslationalStiffnessX; this.TranslationalStiffnessY = TranslationalStiffnessY; this.TranslationalStiffnessZ = TranslationalStiffnessZ; this.RotationalStiffnessX = RotationalStiffnessX; this.RotationalStiffnessY = RotationalStiffnessY; this.RotationalStiffnessZ = RotationalStiffnessZ; this.WarpingStiffness = WarpingStiffness; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let TranslationalStiffnessX = tape[ptr++]; let TranslationalStiffnessY = tape[ptr++]; let TranslationalStiffnessZ = tape[ptr++]; let RotationalStiffnessX = tape[ptr++]; let RotationalStiffnessY = tape[ptr++]; let RotationalStiffnessZ = tape[ptr++]; let WarpingStiffness = tape[ptr++]; return new IfcBoundaryNodeConditionWarping(expressID, type, Name, TranslationalStiffnessX, TranslationalStiffnessY, TranslationalStiffnessZ, RotationalStiffnessX, RotationalStiffnessY, RotationalStiffnessZ, WarpingStiffness); } ToTape() { let args = []; args.push(this.Name); args.push(this.TranslationalStiffnessX); args.push(this.TranslationalStiffnessY); args.push(this.TranslationalStiffnessZ); args.push(this.RotationalStiffnessX); args.push(this.RotationalStiffnessY); args.push(this.RotationalStiffnessZ); args.push(this.WarpingStiffness); return args; } }; var IfcBoundedCurve = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcBoundedCurve(expressID, type); } ToTape() { let args = []; return args; } }; var IfcBoundedSurface = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcBoundedSurface(expressID, type); } ToTape() { let args = []; return args; } }; var IfcBoundingBox = class { constructor(expressID, type, Corner, XDim, YDim, ZDim) { this.expressID = expressID; this.type = type; this.Corner = Corner; this.XDim = XDim; this.YDim = YDim; this.ZDim = ZDim; } static FromTape(expressID, type, tape) { let ptr = 0; let Corner = tape[ptr++]; let XDim = tape[ptr++]; let YDim = tape[ptr++]; let ZDim = tape[ptr++]; return new IfcBoundingBox(expressID, type, Corner, XDim, YDim, ZDim); } ToTape() { let args = []; args.push(this.Corner); args.push(this.XDim); args.push(this.YDim); args.push(this.ZDim); return args; } }; var IfcBoxedHalfSpace = class { constructor(expressID, type, BaseSurface, AgreementFlag, Enclosure) { this.expressID = expressID; this.type = type; this.BaseSurface = BaseSurface; this.AgreementFlag = AgreementFlag; this.Enclosure = Enclosure; } static FromTape(expressID, type, tape) { let ptr = 0; let BaseSurface = tape[ptr++]; let AgreementFlag = tape[ptr++]; let Enclosure = tape[ptr++]; return new IfcBoxedHalfSpace(expressID, type, BaseSurface, AgreementFlag, Enclosure); } ToTape() { let args = []; args.push(this.BaseSurface); args.push(this.AgreementFlag); args.push(this.Enclosure); return args; } }; var IfcBridge = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.LongName = LongName; this.CompositionType = CompositionType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let LongName = tape[ptr++]; let CompositionType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBridge(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.LongName); args.push(this.CompositionType); args.push(this.PredefinedType); return args; } }; var IfcBridgePart = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.LongName = LongName; this.CompositionType = CompositionType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let LongName = tape[ptr++]; let CompositionType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBridgePart(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.LongName); args.push(this.CompositionType); args.push(this.PredefinedType); return args; } }; var IfcBuilding = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType, ElevationOfRefHeight, ElevationOfTerrain, BuildingAddress) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.LongName = LongName; this.CompositionType = CompositionType; this.ElevationOfRefHeight = ElevationOfRefHeight; this.ElevationOfTerrain = ElevationOfTerrain; this.BuildingAddress = BuildingAddress; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let LongName = tape[ptr++]; let CompositionType = tape[ptr++]; let ElevationOfRefHeight = tape[ptr++]; let ElevationOfTerrain = tape[ptr++]; let BuildingAddress = tape[ptr++]; return new IfcBuilding(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType, ElevationOfRefHeight, ElevationOfTerrain, BuildingAddress); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.LongName); args.push(this.CompositionType); args.push(this.ElevationOfRefHeight); args.push(this.ElevationOfTerrain); args.push(this.BuildingAddress); return args; } }; var IfcBuildingElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcBuildingElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcBuildingElementPart = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBuildingElementPart(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcBuildingElementPartType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBuildingElementPartType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcBuildingElementProxy = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBuildingElementProxy(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcBuildingElementProxyType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBuildingElementProxyType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcBuildingElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcBuildingElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcBuildingStorey = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType, Elevation) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.LongName = LongName; this.CompositionType = CompositionType; this.Elevation = Elevation; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let LongName = tape[ptr++]; let CompositionType = tape[ptr++]; let Elevation = tape[ptr++]; return new IfcBuildingStorey(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType, Elevation); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.LongName); args.push(this.CompositionType); args.push(this.Elevation); return args; } }; var IfcBuildingSystem = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, PredefinedType, LongName) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.PredefinedType = PredefinedType; this.LongName = LongName; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let PredefinedType = tape[ptr++]; let LongName = tape[ptr++]; return new IfcBuildingSystem(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, PredefinedType, LongName); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.PredefinedType); args.push(this.LongName); return args; } }; var IfcBurner = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBurner(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcBurnerType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcBurnerType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcCShapeProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position, Depth, Width, WallThickness, Girth, InternalFilletRadius) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; this.Depth = Depth; this.Width = Width; this.WallThickness = WallThickness; this.Girth = Girth; this.InternalFilletRadius = InternalFilletRadius; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; let Depth = tape[ptr++]; let Width = tape[ptr++]; let WallThickness = tape[ptr++]; let Girth = tape[ptr++]; let InternalFilletRadius = tape[ptr++]; return new IfcCShapeProfileDef(expressID, type, ProfileType, ProfileName, Position, Depth, Width, WallThickness, Girth, InternalFilletRadius); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); args.push(this.Depth); args.push(this.Width); args.push(this.WallThickness); args.push(this.Girth); args.push(this.InternalFilletRadius); return args; } }; var IfcCableCarrierFitting = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCableCarrierFitting(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcCableCarrierFittingType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCableCarrierFittingType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcCableCarrierSegment = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCableCarrierSegment(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcCableCarrierSegmentType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCableCarrierSegmentType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcCableFitting = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCableFitting(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcCableFittingType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCableFittingType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcCableSegment = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCableSegment(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcCableSegmentType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCableSegmentType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcCaissonFoundation = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCaissonFoundation(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcCaissonFoundationType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCaissonFoundationType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcCartesianPoint = class { constructor(expressID, type, Coordinates) { this.expressID = expressID; this.type = type; this.Coordinates = Coordinates; } static FromTape(expressID, type, tape) { let ptr = 0; let Coordinates = tape[ptr++]; return new IfcCartesianPoint(expressID, type, Coordinates); } ToTape() { let args = []; args.push(this.Coordinates); return args; } }; var IfcCartesianPointList = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcCartesianPointList(expressID, type); } ToTape() { let args = []; return args; } }; var IfcCartesianPointList2D = class { constructor(expressID, type, CoordList, TagList) { this.expressID = expressID; this.type = type; this.CoordList = CoordList; this.TagList = TagList; } static FromTape(expressID, type, tape) { let ptr = 0; let CoordList = tape[ptr++]; let TagList = tape[ptr++]; return new IfcCartesianPointList2D(expressID, type, CoordList, TagList); } ToTape() { let args = []; args.push(this.CoordList); args.push(this.TagList); return args; } }; var IfcCartesianPointList3D = class { constructor(expressID, type, CoordList, TagList) { this.expressID = expressID; this.type = type; this.CoordList = CoordList; this.TagList = TagList; } static FromTape(expressID, type, tape) { let ptr = 0; let CoordList = tape[ptr++]; let TagList = tape[ptr++]; return new IfcCartesianPointList3D(expressID, type, CoordList, TagList); } ToTape() { let args = []; args.push(this.CoordList); args.push(this.TagList); return args; } }; var IfcCartesianTransformationOperator = class { constructor(expressID, type, Axis1, Axis2, LocalOrigin, Scale) { this.expressID = expressID; this.type = type; this.Axis1 = Axis1; this.Axis2 = Axis2; this.LocalOrigin = LocalOrigin; this.Scale = Scale; } static FromTape(expressID, type, tape) { let ptr = 0; let Axis1 = tape[ptr++]; let Axis2 = tape[ptr++]; let LocalOrigin = tape[ptr++]; let Scale = tape[ptr++]; return new IfcCartesianTransformationOperator(expressID, type, Axis1, Axis2, LocalOrigin, Scale); } ToTape() { let args = []; args.push(this.Axis1); args.push(this.Axis2); args.push(this.LocalOrigin); args.push(this.Scale); return args; } }; var IfcCartesianTransformationOperator2D = class { constructor(expressID, type, Axis1, Axis2, LocalOrigin, Scale) { this.expressID = expressID; this.type = type; this.Axis1 = Axis1; this.Axis2 = Axis2; this.LocalOrigin = LocalOrigin; this.Scale = Scale; } static FromTape(expressID, type, tape) { let ptr = 0; let Axis1 = tape[ptr++]; let Axis2 = tape[ptr++]; let LocalOrigin = tape[ptr++]; let Scale = tape[ptr++]; return new IfcCartesianTransformationOperator2D(expressID, type, Axis1, Axis2, LocalOrigin, Scale); } ToTape() { let args = []; args.push(this.Axis1); args.push(this.Axis2); args.push(this.LocalOrigin); args.push(this.Scale); return args; } }; var IfcCartesianTransformationOperator2DnonUniform = class { constructor(expressID, type, Axis1, Axis2, LocalOrigin, Scale, Scale2) { this.expressID = expressID; this.type = type; this.Axis1 = Axis1; this.Axis2 = Axis2; this.LocalOrigin = LocalOrigin; this.Scale = Scale; this.Scale2 = Scale2; } static FromTape(expressID, type, tape) { let ptr = 0; let Axis1 = tape[ptr++]; let Axis2 = tape[ptr++]; let LocalOrigin = tape[ptr++]; let Scale = tape[ptr++]; let Scale2 = tape[ptr++]; return new IfcCartesianTransformationOperator2DnonUniform(expressID, type, Axis1, Axis2, LocalOrigin, Scale, Scale2); } ToTape() { let args = []; args.push(this.Axis1); args.push(this.Axis2); args.push(this.LocalOrigin); args.push(this.Scale); args.push(this.Scale2); return args; } }; var IfcCartesianTransformationOperator3D = class { constructor(expressID, type, Axis1, Axis2, LocalOrigin, Scale, Axis3) { this.expressID = expressID; this.type = type; this.Axis1 = Axis1; this.Axis2 = Axis2; this.LocalOrigin = LocalOrigin; this.Scale = Scale; this.Axis3 = Axis3; } static FromTape(expressID, type, tape) { let ptr = 0; let Axis1 = tape[ptr++]; let Axis2 = tape[ptr++]; let LocalOrigin = tape[ptr++]; let Scale = tape[ptr++]; let Axis3 = tape[ptr++]; return new IfcCartesianTransformationOperator3D(expressID, type, Axis1, Axis2, LocalOrigin, Scale, Axis3); } ToTape() { let args = []; args.push(this.Axis1); args.push(this.Axis2); args.push(this.LocalOrigin); args.push(this.Scale); args.push(this.Axis3); return args; } }; var IfcCartesianTransformationOperator3DnonUniform = class { constructor(expressID, type, Axis1, Axis2, LocalOrigin, Scale, Axis3, Scale2, Scale3) { this.expressID = expressID; this.type = type; this.Axis1 = Axis1; this.Axis2 = Axis2; this.LocalOrigin = LocalOrigin; this.Scale = Scale; this.Axis3 = Axis3; this.Scale2 = Scale2; this.Scale3 = Scale3; } static FromTape(expressID, type, tape) { let ptr = 0; let Axis1 = tape[ptr++]; let Axis2 = tape[ptr++]; let LocalOrigin = tape[ptr++]; let Scale = tape[ptr++]; let Axis3 = tape[ptr++]; let Scale2 = tape[ptr++]; let Scale3 = tape[ptr++]; return new IfcCartesianTransformationOperator3DnonUniform(expressID, type, Axis1, Axis2, LocalOrigin, Scale, Axis3, Scale2, Scale3); } ToTape() { let args = []; args.push(this.Axis1); args.push(this.Axis2); args.push(this.LocalOrigin); args.push(this.Scale); args.push(this.Axis3); args.push(this.Scale2); args.push(this.Scale3); return args; } }; var IfcCenterLineProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Curve, Thickness) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Curve = Curve; this.Thickness = Thickness; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Curve = tape[ptr++]; let Thickness = tape[ptr++]; return new IfcCenterLineProfileDef(expressID, type, ProfileType, ProfileName, Curve, Thickness); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Curve); args.push(this.Thickness); return args; } }; var IfcChiller = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcChiller(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcChillerType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcChillerType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcChimney = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcChimney(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcChimneyType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcChimneyType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcCircle = class { constructor(expressID, type, Position, Radius) { this.expressID = expressID; this.type = type; this.Position = Position; this.Radius = Radius; } static FromTape(expressID, type, tape) { let ptr = 0; let Position = tape[ptr++]; let Radius = tape[ptr++]; return new IfcCircle(expressID, type, Position, Radius); } ToTape() { let args = []; args.push(this.Position); args.push(this.Radius); return args; } }; var IfcCircleHollowProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position, Radius, WallThickness) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; this.Radius = Radius; this.WallThickness = WallThickness; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; let Radius = tape[ptr++]; let WallThickness = tape[ptr++]; return new IfcCircleHollowProfileDef(expressID, type, ProfileType, ProfileName, Position, Radius, WallThickness); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); args.push(this.Radius); args.push(this.WallThickness); return args; } }; var IfcCircleProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position, Radius) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; this.Radius = Radius; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; let Radius = tape[ptr++]; return new IfcCircleProfileDef(expressID, type, ProfileType, ProfileName, Position, Radius); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); args.push(this.Radius); return args; } }; var IfcCircularArcSegment2D = class { constructor(expressID, type, StartPoint, StartDirection, SegmentLength, Radius, IsCCW) { this.expressID = expressID; this.type = type; this.StartPoint = StartPoint; this.StartDirection = StartDirection; this.SegmentLength = SegmentLength; this.Radius = Radius; this.IsCCW = IsCCW; } static FromTape(expressID, type, tape) { let ptr = 0; let StartPoint = tape[ptr++]; let StartDirection = tape[ptr++]; let SegmentLength = tape[ptr++]; let Radius = tape[ptr++]; let IsCCW = tape[ptr++]; return new IfcCircularArcSegment2D(expressID, type, StartPoint, StartDirection, SegmentLength, Radius, IsCCW); } ToTape() { let args = []; args.push(this.StartPoint); args.push(this.StartDirection); args.push(this.SegmentLength); args.push(this.Radius); args.push(this.IsCCW); return args; } }; var IfcCivilElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcCivilElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcCivilElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcCivilElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcClassification = class { constructor(expressID, type, Source, Edition, EditionDate, Name, Description, Location, ReferenceTokens) { this.expressID = expressID; this.type = type; this.Source = Source; this.Edition = Edition; this.EditionDate = EditionDate; this.Name = Name; this.Description = Description; this.Location = Location; this.ReferenceTokens = ReferenceTokens; } static FromTape(expressID, type, tape) { let ptr = 0; let Source = tape[ptr++]; let Edition = tape[ptr++]; let EditionDate = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let Location = tape[ptr++]; let ReferenceTokens = tape[ptr++]; return new IfcClassification(expressID, type, Source, Edition, EditionDate, Name, Description, Location, ReferenceTokens); } ToTape() { let args = []; args.push(this.Source); args.push(this.Edition); args.push(this.EditionDate); args.push(this.Name); args.push(this.Description); args.push(this.Location); args.push(this.ReferenceTokens); return args; } }; var IfcClassificationReference = class { constructor(expressID, type, Location, Identification, Name, ReferencedSource, Description, Sort) { this.expressID = expressID; this.type = type; this.Location = Location; this.Identification = Identification; this.Name = Name; this.ReferencedSource = ReferencedSource; this.Description = Description; this.Sort = Sort; } static FromTape(expressID, type, tape) { let ptr = 0; let Location = tape[ptr++]; let Identification = tape[ptr++]; let Name = tape[ptr++]; let ReferencedSource = tape[ptr++]; let Description = tape[ptr++]; let Sort = tape[ptr++]; return new IfcClassificationReference(expressID, type, Location, Identification, Name, ReferencedSource, Description, Sort); } ToTape() { let args = []; args.push(this.Location); args.push(this.Identification); args.push(this.Name); args.push(this.ReferencedSource); args.push(this.Description); args.push(this.Sort); return args; } }; var IfcClosedShell = class { constructor(expressID, type, CfsFaces) { this.expressID = expressID; this.type = type; this.CfsFaces = CfsFaces; } static FromTape(expressID, type, tape) { let ptr = 0; let CfsFaces = tape[ptr++]; return new IfcClosedShell(expressID, type, CfsFaces); } ToTape() { let args = []; args.push(this.CfsFaces); return args; } }; var IfcCoil = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCoil(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcCoilType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCoilType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcColourRgb = class { constructor(expressID, type, Name, Red, Green, Blue) { this.expressID = expressID; this.type = type; this.Name = Name; this.Red = Red; this.Green = Green; this.Blue = Blue; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Red = tape[ptr++]; let Green = tape[ptr++]; let Blue = tape[ptr++]; return new IfcColourRgb(expressID, type, Name, Red, Green, Blue); } ToTape() { let args = []; args.push(this.Name); args.push(this.Red); args.push(this.Green); args.push(this.Blue); return args; } }; var IfcColourRgbList = class { constructor(expressID, type, ColourList) { this.expressID = expressID; this.type = type; this.ColourList = ColourList; } static FromTape(expressID, type, tape) { let ptr = 0; let ColourList = tape[ptr++]; return new IfcColourRgbList(expressID, type, ColourList); } ToTape() { let args = []; args.push(this.ColourList); return args; } }; var IfcColourSpecification = class { constructor(expressID, type, Name) { this.expressID = expressID; this.type = type; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; return new IfcColourSpecification(expressID, type, Name); } ToTape() { let args = []; args.push(this.Name); return args; } }; var IfcColumn = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcColumn(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcColumnStandardCase = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcColumnStandardCase(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcColumnType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcColumnType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcCommunicationsAppliance = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCommunicationsAppliance(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcCommunicationsApplianceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCommunicationsApplianceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcComplexProperty = class { constructor(expressID, type, Name, Description, UsageName, HasProperties) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.UsageName = UsageName; this.HasProperties = HasProperties; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let UsageName = tape[ptr++]; let HasProperties = tape[ptr++]; return new IfcComplexProperty(expressID, type, Name, Description, UsageName, HasProperties); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.UsageName); args.push(this.HasProperties); return args; } }; var IfcComplexPropertyTemplate = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, UsageName, TemplateType, HasPropertyTemplates) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.UsageName = UsageName; this.TemplateType = TemplateType; this.HasPropertyTemplates = HasPropertyTemplates; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let UsageName = tape[ptr++]; let TemplateType = tape[ptr++]; let HasPropertyTemplates = tape[ptr++]; return new IfcComplexPropertyTemplate(expressID, type, GlobalId, OwnerHistory, Name, Description, UsageName, TemplateType, HasPropertyTemplates); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.UsageName); args.push(this.TemplateType); args.push(this.HasPropertyTemplates); return args; } }; var IfcCompositeCurve = class { constructor(expressID, type, Segments, SelfIntersect) { this.expressID = expressID; this.type = type; this.Segments = Segments; this.SelfIntersect = SelfIntersect; } static FromTape(expressID, type, tape) { let ptr = 0; let Segments = tape[ptr++]; let SelfIntersect = tape[ptr++]; return new IfcCompositeCurve(expressID, type, Segments, SelfIntersect); } ToTape() { let args = []; args.push(this.Segments); args.push(this.SelfIntersect); return args; } }; var IfcCompositeCurveOnSurface = class { constructor(expressID, type, Segments, SelfIntersect) { this.expressID = expressID; this.type = type; this.Segments = Segments; this.SelfIntersect = SelfIntersect; } static FromTape(expressID, type, tape) { let ptr = 0; let Segments = tape[ptr++]; let SelfIntersect = tape[ptr++]; return new IfcCompositeCurveOnSurface(expressID, type, Segments, SelfIntersect); } ToTape() { let args = []; args.push(this.Segments); args.push(this.SelfIntersect); return args; } }; var IfcCompositeCurveSegment = class { constructor(expressID, type, Transition, SameSense, ParentCurve) { this.expressID = expressID; this.type = type; this.Transition = Transition; this.SameSense = SameSense; this.ParentCurve = ParentCurve; } static FromTape(expressID, type, tape) { let ptr = 0; let Transition = tape[ptr++]; let SameSense = tape[ptr++]; let ParentCurve = tape[ptr++]; return new IfcCompositeCurveSegment(expressID, type, Transition, SameSense, ParentCurve); } ToTape() { let args = []; args.push(this.Transition); args.push(this.SameSense); args.push(this.ParentCurve); return args; } }; var IfcCompositeProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Profiles, Label) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Profiles = Profiles; this.Label = Label; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Profiles = tape[ptr++]; let Label = tape[ptr++]; return new IfcCompositeProfileDef(expressID, type, ProfileType, ProfileName, Profiles, Label); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Profiles); args.push(this.Label); return args; } }; var IfcCompressor = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCompressor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcCompressorType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCompressorType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcCondenser = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCondenser(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcCondenserType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCondenserType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcConic = class { constructor(expressID, type, Position) { this.expressID = expressID; this.type = type; this.Position = Position; } static FromTape(expressID, type, tape) { let ptr = 0; let Position = tape[ptr++]; return new IfcConic(expressID, type, Position); } ToTape() { let args = []; args.push(this.Position); return args; } }; var IfcConnectedFaceSet = class { constructor(expressID, type, CfsFaces) { this.expressID = expressID; this.type = type; this.CfsFaces = CfsFaces; } static FromTape(expressID, type, tape) { let ptr = 0; let CfsFaces = tape[ptr++]; return new IfcConnectedFaceSet(expressID, type, CfsFaces); } ToTape() { let args = []; args.push(this.CfsFaces); return args; } }; var IfcConnectionCurveGeometry = class { constructor(expressID, type, CurveOnRelatingElement, CurveOnRelatedElement) { this.expressID = expressID; this.type = type; this.CurveOnRelatingElement = CurveOnRelatingElement; this.CurveOnRelatedElement = CurveOnRelatedElement; } static FromTape(expressID, type, tape) { let ptr = 0; let CurveOnRelatingElement = tape[ptr++]; let CurveOnRelatedElement = tape[ptr++]; return new IfcConnectionCurveGeometry(expressID, type, CurveOnRelatingElement, CurveOnRelatedElement); } ToTape() { let args = []; args.push(this.CurveOnRelatingElement); args.push(this.CurveOnRelatedElement); return args; } }; var IfcConnectionGeometry = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcConnectionGeometry(expressID, type); } ToTape() { let args = []; return args; } }; var IfcConnectionPointEccentricity = class { constructor(expressID, type, PointOnRelatingElement, PointOnRelatedElement, EccentricityInX, EccentricityInY, EccentricityInZ) { this.expressID = expressID; this.type = type; this.PointOnRelatingElement = PointOnRelatingElement; this.PointOnRelatedElement = PointOnRelatedElement; this.EccentricityInX = EccentricityInX; this.EccentricityInY = EccentricityInY; this.EccentricityInZ = EccentricityInZ; } static FromTape(expressID, type, tape) { let ptr = 0; let PointOnRelatingElement = tape[ptr++]; let PointOnRelatedElement = tape[ptr++]; let EccentricityInX = tape[ptr++]; let EccentricityInY = tape[ptr++]; let EccentricityInZ = tape[ptr++]; return new IfcConnectionPointEccentricity(expressID, type, PointOnRelatingElement, PointOnRelatedElement, EccentricityInX, EccentricityInY, EccentricityInZ); } ToTape() { let args = []; args.push(this.PointOnRelatingElement); args.push(this.PointOnRelatedElement); args.push(this.EccentricityInX); args.push(this.EccentricityInY); args.push(this.EccentricityInZ); return args; } }; var IfcConnectionPointGeometry = class { constructor(expressID, type, PointOnRelatingElement, PointOnRelatedElement) { this.expressID = expressID; this.type = type; this.PointOnRelatingElement = PointOnRelatingElement; this.PointOnRelatedElement = PointOnRelatedElement; } static FromTape(expressID, type, tape) { let ptr = 0; let PointOnRelatingElement = tape[ptr++]; let PointOnRelatedElement = tape[ptr++]; return new IfcConnectionPointGeometry(expressID, type, PointOnRelatingElement, PointOnRelatedElement); } ToTape() { let args = []; args.push(this.PointOnRelatingElement); args.push(this.PointOnRelatedElement); return args; } }; var IfcConnectionSurfaceGeometry = class { constructor(expressID, type, SurfaceOnRelatingElement, SurfaceOnRelatedElement) { this.expressID = expressID; this.type = type; this.SurfaceOnRelatingElement = SurfaceOnRelatingElement; this.SurfaceOnRelatedElement = SurfaceOnRelatedElement; } static FromTape(expressID, type, tape) { let ptr = 0; let SurfaceOnRelatingElement = tape[ptr++]; let SurfaceOnRelatedElement = tape[ptr++]; return new IfcConnectionSurfaceGeometry(expressID, type, SurfaceOnRelatingElement, SurfaceOnRelatedElement); } ToTape() { let args = []; args.push(this.SurfaceOnRelatingElement); args.push(this.SurfaceOnRelatedElement); return args; } }; var IfcConnectionVolumeGeometry = class { constructor(expressID, type, VolumeOnRelatingElement, VolumeOnRelatedElement) { this.expressID = expressID; this.type = type; this.VolumeOnRelatingElement = VolumeOnRelatingElement; this.VolumeOnRelatedElement = VolumeOnRelatedElement; } static FromTape(expressID, type, tape) { let ptr = 0; let VolumeOnRelatingElement = tape[ptr++]; let VolumeOnRelatedElement = tape[ptr++]; return new IfcConnectionVolumeGeometry(expressID, type, VolumeOnRelatingElement, VolumeOnRelatedElement); } ToTape() { let args = []; args.push(this.VolumeOnRelatingElement); args.push(this.VolumeOnRelatedElement); return args; } }; var IfcConstraint = class { constructor(expressID, type, Name, Description, ConstraintGrade, ConstraintSource, CreatingActor, CreationTime, UserDefinedGrade) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.ConstraintGrade = ConstraintGrade; this.ConstraintSource = ConstraintSource; this.CreatingActor = CreatingActor; this.CreationTime = CreationTime; this.UserDefinedGrade = UserDefinedGrade; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let ConstraintGrade = tape[ptr++]; let ConstraintSource = tape[ptr++]; let CreatingActor = tape[ptr++]; let CreationTime = tape[ptr++]; let UserDefinedGrade = tape[ptr++]; return new IfcConstraint(expressID, type, Name, Description, ConstraintGrade, ConstraintSource, CreatingActor, CreationTime, UserDefinedGrade); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.ConstraintGrade); args.push(this.ConstraintSource); args.push(this.CreatingActor); args.push(this.CreationTime); args.push(this.UserDefinedGrade); return args; } }; var IfcConstructionEquipmentResource = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Usage, BaseCosts, BaseQuantity, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.LongDescription = LongDescription; this.Usage = Usage; this.BaseCosts = BaseCosts; this.BaseQuantity = BaseQuantity; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let Usage = tape[ptr++]; let BaseCosts = tape[ptr++]; let BaseQuantity = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcConstructionEquipmentResource(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Usage, BaseCosts, BaseQuantity, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.LongDescription); args.push(this.Usage); args.push(this.BaseCosts); args.push(this.BaseQuantity); args.push(this.PredefinedType); return args; } }; var IfcConstructionEquipmentResourceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType, BaseCosts, BaseQuantity, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.Identification = Identification; this.LongDescription = LongDescription; this.ResourceType = ResourceType; this.BaseCosts = BaseCosts; this.BaseQuantity = BaseQuantity; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let ResourceType = tape[ptr++]; let BaseCosts = tape[ptr++]; let BaseQuantity = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcConstructionEquipmentResourceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType, BaseCosts, BaseQuantity, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.Identification); args.push(this.LongDescription); args.push(this.ResourceType); args.push(this.BaseCosts); args.push(this.BaseQuantity); args.push(this.PredefinedType); return args; } }; var IfcConstructionMaterialResource = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Usage, BaseCosts, BaseQuantity, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.LongDescription = LongDescription; this.Usage = Usage; this.BaseCosts = BaseCosts; this.BaseQuantity = BaseQuantity; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let Usage = tape[ptr++]; let BaseCosts = tape[ptr++]; let BaseQuantity = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcConstructionMaterialResource(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Usage, BaseCosts, BaseQuantity, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.LongDescription); args.push(this.Usage); args.push(this.BaseCosts); args.push(this.BaseQuantity); args.push(this.PredefinedType); return args; } }; var IfcConstructionMaterialResourceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType, BaseCosts, BaseQuantity, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.Identification = Identification; this.LongDescription = LongDescription; this.ResourceType = ResourceType; this.BaseCosts = BaseCosts; this.BaseQuantity = BaseQuantity; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let ResourceType = tape[ptr++]; let BaseCosts = tape[ptr++]; let BaseQuantity = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcConstructionMaterialResourceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType, BaseCosts, BaseQuantity, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.Identification); args.push(this.LongDescription); args.push(this.ResourceType); args.push(this.BaseCosts); args.push(this.BaseQuantity); args.push(this.PredefinedType); return args; } }; var IfcConstructionProductResource = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Usage, BaseCosts, BaseQuantity, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.LongDescription = LongDescription; this.Usage = Usage; this.BaseCosts = BaseCosts; this.BaseQuantity = BaseQuantity; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let Usage = tape[ptr++]; let BaseCosts = tape[ptr++]; let BaseQuantity = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcConstructionProductResource(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Usage, BaseCosts, BaseQuantity, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.LongDescription); args.push(this.Usage); args.push(this.BaseCosts); args.push(this.BaseQuantity); args.push(this.PredefinedType); return args; } }; var IfcConstructionProductResourceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType, BaseCosts, BaseQuantity, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.Identification = Identification; this.LongDescription = LongDescription; this.ResourceType = ResourceType; this.BaseCosts = BaseCosts; this.BaseQuantity = BaseQuantity; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let ResourceType = tape[ptr++]; let BaseCosts = tape[ptr++]; let BaseQuantity = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcConstructionProductResourceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType, BaseCosts, BaseQuantity, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.Identification); args.push(this.LongDescription); args.push(this.ResourceType); args.push(this.BaseCosts); args.push(this.BaseQuantity); args.push(this.PredefinedType); return args; } }; var IfcConstructionResource = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Usage, BaseCosts, BaseQuantity) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.LongDescription = LongDescription; this.Usage = Usage; this.BaseCosts = BaseCosts; this.BaseQuantity = BaseQuantity; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let Usage = tape[ptr++]; let BaseCosts = tape[ptr++]; let BaseQuantity = tape[ptr++]; return new IfcConstructionResource(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Usage, BaseCosts, BaseQuantity); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.LongDescription); args.push(this.Usage); args.push(this.BaseCosts); args.push(this.BaseQuantity); return args; } }; var IfcConstructionResourceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType, BaseCosts, BaseQuantity) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.Identification = Identification; this.LongDescription = LongDescription; this.ResourceType = ResourceType; this.BaseCosts = BaseCosts; this.BaseQuantity = BaseQuantity; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let ResourceType = tape[ptr++]; let BaseCosts = tape[ptr++]; let BaseQuantity = tape[ptr++]; return new IfcConstructionResourceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType, BaseCosts, BaseQuantity); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.Identification); args.push(this.LongDescription); args.push(this.ResourceType); args.push(this.BaseCosts); args.push(this.BaseQuantity); return args; } }; var IfcContext = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, LongName, Phase, RepresentationContexts, UnitsInContext) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.LongName = LongName; this.Phase = Phase; this.RepresentationContexts = RepresentationContexts; this.UnitsInContext = UnitsInContext; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let LongName = tape[ptr++]; let Phase = tape[ptr++]; let RepresentationContexts = tape[ptr++]; let UnitsInContext = tape[ptr++]; return new IfcContext(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, LongName, Phase, RepresentationContexts, UnitsInContext); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.LongName); args.push(this.Phase); args.push(this.RepresentationContexts); args.push(this.UnitsInContext); return args; } }; var IfcContextDependentUnit = class { constructor(expressID, type, Dimensions, UnitType, Name) { this.expressID = expressID; this.type = type; this.Dimensions = Dimensions; this.UnitType = UnitType; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Dimensions = tape[ptr++]; let UnitType = tape[ptr++]; let Name = tape[ptr++]; return new IfcContextDependentUnit(expressID, type, Dimensions, UnitType, Name); } ToTape() { let args = []; args.push(this.Dimensions); args.push(this.UnitType); args.push(this.Name); return args; } }; var IfcControl = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; return new IfcControl(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); return args; } }; var IfcController = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcController(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcControllerType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcControllerType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcConversionBasedUnit = class { constructor(expressID, type, Dimensions, UnitType, Name, ConversionFactor) { this.expressID = expressID; this.type = type; this.Dimensions = Dimensions; this.UnitType = UnitType; this.Name = Name; this.ConversionFactor = ConversionFactor; } static FromTape(expressID, type, tape) { let ptr = 0; let Dimensions = tape[ptr++]; let UnitType = tape[ptr++]; let Name = tape[ptr++]; let ConversionFactor = tape[ptr++]; return new IfcConversionBasedUnit(expressID, type, Dimensions, UnitType, Name, ConversionFactor); } ToTape() { let args = []; args.push(this.Dimensions); args.push(this.UnitType); args.push(this.Name); args.push(this.ConversionFactor); return args; } }; var IfcConversionBasedUnitWithOffset = class { constructor(expressID, type, Dimensions, UnitType, Name, ConversionFactor, ConversionOffset) { this.expressID = expressID; this.type = type; this.Dimensions = Dimensions; this.UnitType = UnitType; this.Name = Name; this.ConversionFactor = ConversionFactor; this.ConversionOffset = ConversionOffset; } static FromTape(expressID, type, tape) { let ptr = 0; let Dimensions = tape[ptr++]; let UnitType = tape[ptr++]; let Name = tape[ptr++]; let ConversionFactor = tape[ptr++]; let ConversionOffset = tape[ptr++]; return new IfcConversionBasedUnitWithOffset(expressID, type, Dimensions, UnitType, Name, ConversionFactor, ConversionOffset); } ToTape() { let args = []; args.push(this.Dimensions); args.push(this.UnitType); args.push(this.Name); args.push(this.ConversionFactor); args.push(this.ConversionOffset); return args; } }; var IfcCooledBeam = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCooledBeam(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcCooledBeamType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCooledBeamType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcCoolingTower = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCoolingTower(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcCoolingTowerType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCoolingTowerType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcCoordinateOperation = class { constructor(expressID, type, SourceCRS, TargetCRS) { this.expressID = expressID; this.type = type; this.SourceCRS = SourceCRS; this.TargetCRS = TargetCRS; } static FromTape(expressID, type, tape) { let ptr = 0; let SourceCRS = tape[ptr++]; let TargetCRS = tape[ptr++]; return new IfcCoordinateOperation(expressID, type, SourceCRS, TargetCRS); } ToTape() { let args = []; args.push(this.SourceCRS); args.push(this.TargetCRS); return args; } }; var IfcCoordinateReferenceSystem = class { constructor(expressID, type, Name, Description, GeodeticDatum, VerticalDatum) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.GeodeticDatum = GeodeticDatum; this.VerticalDatum = VerticalDatum; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let GeodeticDatum = tape[ptr++]; let VerticalDatum = tape[ptr++]; return new IfcCoordinateReferenceSystem(expressID, type, Name, Description, GeodeticDatum, VerticalDatum); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.GeodeticDatum); args.push(this.VerticalDatum); return args; } }; var IfcCostItem = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, PredefinedType, CostValues, CostQuantities) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.PredefinedType = PredefinedType; this.CostValues = CostValues; this.CostQuantities = CostQuantities; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let PredefinedType = tape[ptr++]; let CostValues = tape[ptr++]; let CostQuantities = tape[ptr++]; return new IfcCostItem(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, PredefinedType, CostValues, CostQuantities); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.PredefinedType); args.push(this.CostValues); args.push(this.CostQuantities); return args; } }; var IfcCostSchedule = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, PredefinedType, Status, SubmittedOn, UpdateDate) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.PredefinedType = PredefinedType; this.Status = Status; this.SubmittedOn = SubmittedOn; this.UpdateDate = UpdateDate; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let PredefinedType = tape[ptr++]; let Status = tape[ptr++]; let SubmittedOn = tape[ptr++]; let UpdateDate = tape[ptr++]; return new IfcCostSchedule(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, PredefinedType, Status, SubmittedOn, UpdateDate); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.PredefinedType); args.push(this.Status); args.push(this.SubmittedOn); args.push(this.UpdateDate); return args; } }; var IfcCostValue = class { constructor(expressID, type, Name, Description, AppliedValue, UnitBasis, ApplicableDate, FixedUntilDate, Category, Condition, ArithmeticOperator, Components) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.AppliedValue = AppliedValue; this.UnitBasis = UnitBasis; this.ApplicableDate = ApplicableDate; this.FixedUntilDate = FixedUntilDate; this.Category = Category; this.Condition = Condition; this.ArithmeticOperator = ArithmeticOperator; this.Components = Components; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let AppliedValue = tape[ptr++]; let UnitBasis = tape[ptr++]; let ApplicableDate = tape[ptr++]; let FixedUntilDate = tape[ptr++]; let Category = tape[ptr++]; let Condition = tape[ptr++]; let ArithmeticOperator = tape[ptr++]; let Components = tape[ptr++]; return new IfcCostValue(expressID, type, Name, Description, AppliedValue, UnitBasis, ApplicableDate, FixedUntilDate, Category, Condition, ArithmeticOperator, Components); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.AppliedValue); args.push(this.UnitBasis); args.push(this.ApplicableDate); args.push(this.FixedUntilDate); args.push(this.Category); args.push(this.Condition); args.push(this.ArithmeticOperator); args.push(this.Components); return args; } }; var IfcCovering = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCovering(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcCoveringType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCoveringType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcCrewResource = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Usage, BaseCosts, BaseQuantity, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.LongDescription = LongDescription; this.Usage = Usage; this.BaseCosts = BaseCosts; this.BaseQuantity = BaseQuantity; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let Usage = tape[ptr++]; let BaseCosts = tape[ptr++]; let BaseQuantity = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCrewResource(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Usage, BaseCosts, BaseQuantity, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.LongDescription); args.push(this.Usage); args.push(this.BaseCosts); args.push(this.BaseQuantity); args.push(this.PredefinedType); return args; } }; var IfcCrewResourceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType, BaseCosts, BaseQuantity, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.Identification = Identification; this.LongDescription = LongDescription; this.ResourceType = ResourceType; this.BaseCosts = BaseCosts; this.BaseQuantity = BaseQuantity; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let ResourceType = tape[ptr++]; let BaseCosts = tape[ptr++]; let BaseQuantity = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCrewResourceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType, BaseCosts, BaseQuantity, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.Identification); args.push(this.LongDescription); args.push(this.ResourceType); args.push(this.BaseCosts); args.push(this.BaseQuantity); args.push(this.PredefinedType); return args; } }; var IfcCsgPrimitive3D = class { constructor(expressID, type, Position) { this.expressID = expressID; this.type = type; this.Position = Position; } static FromTape(expressID, type, tape) { let ptr = 0; let Position = tape[ptr++]; return new IfcCsgPrimitive3D(expressID, type, Position); } ToTape() { let args = []; args.push(this.Position); return args; } }; var IfcCsgSolid = class { constructor(expressID, type, TreeRootExpression) { this.expressID = expressID; this.type = type; this.TreeRootExpression = TreeRootExpression; } static FromTape(expressID, type, tape) { let ptr = 0; let TreeRootExpression = tape[ptr++]; return new IfcCsgSolid(expressID, type, TreeRootExpression); } ToTape() { let args = []; args.push(this.TreeRootExpression); return args; } }; var IfcCurrencyRelationship = class { constructor(expressID, type, Name, Description, RelatingMonetaryUnit, RelatedMonetaryUnit, ExchangeRate, RateDateTime, RateSource) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.RelatingMonetaryUnit = RelatingMonetaryUnit; this.RelatedMonetaryUnit = RelatedMonetaryUnit; this.ExchangeRate = ExchangeRate; this.RateDateTime = RateDateTime; this.RateSource = RateSource; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingMonetaryUnit = tape[ptr++]; let RelatedMonetaryUnit = tape[ptr++]; let ExchangeRate = tape[ptr++]; let RateDateTime = tape[ptr++]; let RateSource = tape[ptr++]; return new IfcCurrencyRelationship(expressID, type, Name, Description, RelatingMonetaryUnit, RelatedMonetaryUnit, ExchangeRate, RateDateTime, RateSource); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.RelatingMonetaryUnit); args.push(this.RelatedMonetaryUnit); args.push(this.ExchangeRate); args.push(this.RateDateTime); args.push(this.RateSource); return args; } }; var IfcCurtainWall = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCurtainWall(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcCurtainWallType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcCurtainWallType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcCurve = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcCurve(expressID, type); } ToTape() { let args = []; return args; } }; var IfcCurveBoundedPlane = class { constructor(expressID, type, BasisSurface, OuterBoundary, InnerBoundaries) { this.expressID = expressID; this.type = type; this.BasisSurface = BasisSurface; this.OuterBoundary = OuterBoundary; this.InnerBoundaries = InnerBoundaries; } static FromTape(expressID, type, tape) { let ptr = 0; let BasisSurface = tape[ptr++]; let OuterBoundary = tape[ptr++]; let InnerBoundaries = tape[ptr++]; return new IfcCurveBoundedPlane(expressID, type, BasisSurface, OuterBoundary, InnerBoundaries); } ToTape() { let args = []; args.push(this.BasisSurface); args.push(this.OuterBoundary); args.push(this.InnerBoundaries); return args; } }; var IfcCurveBoundedSurface = class { constructor(expressID, type, BasisSurface, Boundaries, ImplicitOuter) { this.expressID = expressID; this.type = type; this.BasisSurface = BasisSurface; this.Boundaries = Boundaries; this.ImplicitOuter = ImplicitOuter; } static FromTape(expressID, type, tape) { let ptr = 0; let BasisSurface = tape[ptr++]; let Boundaries = tape[ptr++]; let ImplicitOuter = tape[ptr++]; return new IfcCurveBoundedSurface(expressID, type, BasisSurface, Boundaries, ImplicitOuter); } ToTape() { let args = []; args.push(this.BasisSurface); args.push(this.Boundaries); args.push(this.ImplicitOuter); return args; } }; var IfcCurveSegment2D = class { constructor(expressID, type, StartPoint, StartDirection, SegmentLength) { this.expressID = expressID; this.type = type; this.StartPoint = StartPoint; this.StartDirection = StartDirection; this.SegmentLength = SegmentLength; } static FromTape(expressID, type, tape) { let ptr = 0; let StartPoint = tape[ptr++]; let StartDirection = tape[ptr++]; let SegmentLength = tape[ptr++]; return new IfcCurveSegment2D(expressID, type, StartPoint, StartDirection, SegmentLength); } ToTape() { let args = []; args.push(this.StartPoint); args.push(this.StartDirection); args.push(this.SegmentLength); return args; } }; var IfcCurveStyle = class { constructor(expressID, type, Name, CurveFont, CurveWidth, CurveColour, ModelOrDraughting) { this.expressID = expressID; this.type = type; this.Name = Name; this.CurveFont = CurveFont; this.CurveWidth = CurveWidth; this.CurveColour = CurveColour; this.ModelOrDraughting = ModelOrDraughting; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let CurveFont = tape[ptr++]; let CurveWidth = tape[ptr++]; let CurveColour = tape[ptr++]; let ModelOrDraughting = tape[ptr++]; return new IfcCurveStyle(expressID, type, Name, CurveFont, CurveWidth, CurveColour, ModelOrDraughting); } ToTape() { let args = []; args.push(this.Name); args.push(this.CurveFont); args.push(this.CurveWidth); args.push(this.CurveColour); args.push(this.ModelOrDraughting); return args; } }; var IfcCurveStyleFont = class { constructor(expressID, type, Name, PatternList) { this.expressID = expressID; this.type = type; this.Name = Name; this.PatternList = PatternList; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let PatternList = tape[ptr++]; return new IfcCurveStyleFont(expressID, type, Name, PatternList); } ToTape() { let args = []; args.push(this.Name); args.push(this.PatternList); return args; } }; var IfcCurveStyleFontAndScaling = class { constructor(expressID, type, Name, CurveFont, CurveFontScaling) { this.expressID = expressID; this.type = type; this.Name = Name; this.CurveFont = CurveFont; this.CurveFontScaling = CurveFontScaling; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let CurveFont = tape[ptr++]; let CurveFontScaling = tape[ptr++]; return new IfcCurveStyleFontAndScaling(expressID, type, Name, CurveFont, CurveFontScaling); } ToTape() { let args = []; args.push(this.Name); args.push(this.CurveFont); args.push(this.CurveFontScaling); return args; } }; var IfcCurveStyleFontPattern = class { constructor(expressID, type, VisibleSegmentLength, InvisibleSegmentLength) { this.expressID = expressID; this.type = type; this.VisibleSegmentLength = VisibleSegmentLength; this.InvisibleSegmentLength = InvisibleSegmentLength; } static FromTape(expressID, type, tape) { let ptr = 0; let VisibleSegmentLength = tape[ptr++]; let InvisibleSegmentLength = tape[ptr++]; return new IfcCurveStyleFontPattern(expressID, type, VisibleSegmentLength, InvisibleSegmentLength); } ToTape() { let args = []; args.push(this.VisibleSegmentLength); args.push(this.InvisibleSegmentLength); return args; } }; var IfcCylindricalSurface = class { constructor(expressID, type, Position, Radius) { this.expressID = expressID; this.type = type; this.Position = Position; this.Radius = Radius; } static FromTape(expressID, type, tape) { let ptr = 0; let Position = tape[ptr++]; let Radius = tape[ptr++]; return new IfcCylindricalSurface(expressID, type, Position, Radius); } ToTape() { let args = []; args.push(this.Position); args.push(this.Radius); return args; } }; var IfcDamper = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcDamper(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcDamperType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcDamperType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcDeepFoundation = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcDeepFoundation(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcDeepFoundationType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcDeepFoundationType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcDerivedProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, ParentProfile, Operator, Label) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.ParentProfile = ParentProfile; this.Operator = Operator; this.Label = Label; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let ParentProfile = tape[ptr++]; let Operator = tape[ptr++]; let Label = tape[ptr++]; return new IfcDerivedProfileDef(expressID, type, ProfileType, ProfileName, ParentProfile, Operator, Label); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.ParentProfile); args.push(this.Operator); args.push(this.Label); return args; } }; var IfcDerivedUnit = class { constructor(expressID, type, Elements, UnitType, UserDefinedType) { this.expressID = expressID; this.type = type; this.Elements = Elements; this.UnitType = UnitType; this.UserDefinedType = UserDefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let Elements = tape[ptr++]; let UnitType = tape[ptr++]; let UserDefinedType = tape[ptr++]; return new IfcDerivedUnit(expressID, type, Elements, UnitType, UserDefinedType); } ToTape() { let args = []; args.push(this.Elements); args.push(this.UnitType); args.push(this.UserDefinedType); return args; } }; var IfcDerivedUnitElement = class { constructor(expressID, type, Unit, Exponent) { this.expressID = expressID; this.type = type; this.Unit = Unit; this.Exponent = Exponent; } static FromTape(expressID, type, tape) { let ptr = 0; let Unit = tape[ptr++]; let Exponent = tape[ptr++]; return new IfcDerivedUnitElement(expressID, type, Unit, Exponent); } ToTape() { let args = []; args.push(this.Unit); args.push(this.Exponent); return args; } }; var IfcDimensionalExponents = class { constructor(expressID, type, LengthExponent, MassExponent, TimeExponent, ElectricCurrentExponent, ThermodynamicTemperatureExponent, AmountOfSubstanceExponent, LuminousIntensityExponent) { this.expressID = expressID; this.type = type; this.LengthExponent = LengthExponent; this.MassExponent = MassExponent; this.TimeExponent = TimeExponent; this.ElectricCurrentExponent = ElectricCurrentExponent; this.ThermodynamicTemperatureExponent = ThermodynamicTemperatureExponent; this.AmountOfSubstanceExponent = AmountOfSubstanceExponent; this.LuminousIntensityExponent = LuminousIntensityExponent; } static FromTape(expressID, type, tape) { let ptr = 0; let LengthExponent = tape[ptr++]; let MassExponent = tape[ptr++]; let TimeExponent = tape[ptr++]; let ElectricCurrentExponent = tape[ptr++]; let ThermodynamicTemperatureExponent = tape[ptr++]; let AmountOfSubstanceExponent = tape[ptr++]; let LuminousIntensityExponent = tape[ptr++]; return new IfcDimensionalExponents(expressID, type, LengthExponent, MassExponent, TimeExponent, ElectricCurrentExponent, ThermodynamicTemperatureExponent, AmountOfSubstanceExponent, LuminousIntensityExponent); } ToTape() { let args = []; args.push(this.LengthExponent); args.push(this.MassExponent); args.push(this.TimeExponent); args.push(this.ElectricCurrentExponent); args.push(this.ThermodynamicTemperatureExponent); args.push(this.AmountOfSubstanceExponent); args.push(this.LuminousIntensityExponent); return args; } }; var IfcDirection = class { constructor(expressID, type, DirectionRatios) { this.expressID = expressID; this.type = type; this.DirectionRatios = DirectionRatios; } static FromTape(expressID, type, tape) { let ptr = 0; let DirectionRatios = tape[ptr++]; return new IfcDirection(expressID, type, DirectionRatios); } ToTape() { let args = []; args.push(this.DirectionRatios); return args; } }; var IfcDiscreteAccessory = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcDiscreteAccessory(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcDiscreteAccessoryType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcDiscreteAccessoryType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcDistanceExpression = class { constructor(expressID, type, DistanceAlong, OffsetLateral, OffsetVertical, OffsetLongitudinal, AlongHorizontal) { this.expressID = expressID; this.type = type; this.DistanceAlong = DistanceAlong; this.OffsetLateral = OffsetLateral; this.OffsetVertical = OffsetVertical; this.OffsetLongitudinal = OffsetLongitudinal; this.AlongHorizontal = AlongHorizontal; } static FromTape(expressID, type, tape) { let ptr = 0; let DistanceAlong = tape[ptr++]; let OffsetLateral = tape[ptr++]; let OffsetVertical = tape[ptr++]; let OffsetLongitudinal = tape[ptr++]; let AlongHorizontal = tape[ptr++]; return new IfcDistanceExpression(expressID, type, DistanceAlong, OffsetLateral, OffsetVertical, OffsetLongitudinal, AlongHorizontal); } ToTape() { let args = []; args.push(this.DistanceAlong); args.push(this.OffsetLateral); args.push(this.OffsetVertical); args.push(this.OffsetLongitudinal); args.push(this.AlongHorizontal); return args; } }; var IfcDistributionChamberElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcDistributionChamberElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcDistributionChamberElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcDistributionChamberElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcDistributionCircuit = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, LongName, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.LongName = LongName; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let LongName = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcDistributionCircuit(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, LongName, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.LongName); args.push(this.PredefinedType); return args; } }; var IfcDistributionControlElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcDistributionControlElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcDistributionControlElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcDistributionControlElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcDistributionElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcDistributionElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcDistributionElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcDistributionElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcDistributionFlowElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcDistributionFlowElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcDistributionFlowElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcDistributionFlowElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcDistributionPort = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, FlowDirection, PredefinedType, SystemType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.FlowDirection = FlowDirection; this.PredefinedType = PredefinedType; this.SystemType = SystemType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let FlowDirection = tape[ptr++]; let PredefinedType = tape[ptr++]; let SystemType = tape[ptr++]; return new IfcDistributionPort(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, FlowDirection, PredefinedType, SystemType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.FlowDirection); args.push(this.PredefinedType); args.push(this.SystemType); return args; } }; var IfcDistributionSystem = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, LongName, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.LongName = LongName; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let LongName = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcDistributionSystem(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, LongName, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.LongName); args.push(this.PredefinedType); return args; } }; var IfcDocumentInformation = class { constructor(expressID, type, Identification, Name, Description, Location, Purpose, IntendedUse, Scope, Revision, DocumentOwner, Editors, CreationTime, LastRevisionTime, ElectronicFormat, ValidFrom, ValidUntil, Confidentiality, Status) { this.expressID = expressID; this.type = type; this.Identification = Identification; this.Name = Name; this.Description = Description; this.Location = Location; this.Purpose = Purpose; this.IntendedUse = IntendedUse; this.Scope = Scope; this.Revision = Revision; this.DocumentOwner = DocumentOwner; this.Editors = Editors; this.CreationTime = CreationTime; this.LastRevisionTime = LastRevisionTime; this.ElectronicFormat = ElectronicFormat; this.ValidFrom = ValidFrom; this.ValidUntil = ValidUntil; this.Confidentiality = Confidentiality; this.Status = Status; } static FromTape(expressID, type, tape) { let ptr = 0; let Identification = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let Location = tape[ptr++]; let Purpose = tape[ptr++]; let IntendedUse = tape[ptr++]; let Scope = tape[ptr++]; let Revision = tape[ptr++]; let DocumentOwner = tape[ptr++]; let Editors = tape[ptr++]; let CreationTime = tape[ptr++]; let LastRevisionTime = tape[ptr++]; let ElectronicFormat = tape[ptr++]; let ValidFrom = tape[ptr++]; let ValidUntil = tape[ptr++]; let Confidentiality = tape[ptr++]; let Status = tape[ptr++]; return new IfcDocumentInformation(expressID, type, Identification, Name, Description, Location, Purpose, IntendedUse, Scope, Revision, DocumentOwner, Editors, CreationTime, LastRevisionTime, ElectronicFormat, ValidFrom, ValidUntil, Confidentiality, Status); } ToTape() { let args = []; args.push(this.Identification); args.push(this.Name); args.push(this.Description); args.push(this.Location); args.push(this.Purpose); args.push(this.IntendedUse); args.push(this.Scope); args.push(this.Revision); args.push(this.DocumentOwner); args.push(this.Editors); args.push(this.CreationTime); args.push(this.LastRevisionTime); args.push(this.ElectronicFormat); args.push(this.ValidFrom); args.push(this.ValidUntil); args.push(this.Confidentiality); args.push(this.Status); return args; } }; var IfcDocumentInformationRelationship = class { constructor(expressID, type, Name, Description, RelatingDocument, RelatedDocuments, RelationshipType) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.RelatingDocument = RelatingDocument; this.RelatedDocuments = RelatedDocuments; this.RelationshipType = RelationshipType; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingDocument = tape[ptr++]; let RelatedDocuments = tape[ptr++]; let RelationshipType = tape[ptr++]; return new IfcDocumentInformationRelationship(expressID, type, Name, Description, RelatingDocument, RelatedDocuments, RelationshipType); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.RelatingDocument); args.push(this.RelatedDocuments); args.push(this.RelationshipType); return args; } }; var IfcDocumentReference = class { constructor(expressID, type, Location, Identification, Name, Description, ReferencedDocument) { this.expressID = expressID; this.type = type; this.Location = Location; this.Identification = Identification; this.Name = Name; this.Description = Description; this.ReferencedDocument = ReferencedDocument; } static FromTape(expressID, type, tape) { let ptr = 0; let Location = tape[ptr++]; let Identification = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ReferencedDocument = tape[ptr++]; return new IfcDocumentReference(expressID, type, Location, Identification, Name, Description, ReferencedDocument); } ToTape() { let args = []; args.push(this.Location); args.push(this.Identification); args.push(this.Name); args.push(this.Description); args.push(this.ReferencedDocument); return args; } }; var IfcDoor = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, OverallHeight, OverallWidth, PredefinedType, OperationType, UserDefinedOperationType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.OverallHeight = OverallHeight; this.OverallWidth = OverallWidth; this.PredefinedType = PredefinedType; this.OperationType = OperationType; this.UserDefinedOperationType = UserDefinedOperationType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let OverallHeight = tape[ptr++]; let OverallWidth = tape[ptr++]; let PredefinedType = tape[ptr++]; let OperationType = tape[ptr++]; let UserDefinedOperationType = tape[ptr++]; return new IfcDoor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, OverallHeight, OverallWidth, PredefinedType, OperationType, UserDefinedOperationType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.OverallHeight); args.push(this.OverallWidth); args.push(this.PredefinedType); args.push(this.OperationType); args.push(this.UserDefinedOperationType); return args; } }; var IfcDoorLiningProperties = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, LiningDepth, LiningThickness, ThresholdDepth, ThresholdThickness, TransomThickness, TransomOffset, LiningOffset, ThresholdOffset, CasingThickness, CasingDepth, ShapeAspectStyle, LiningToPanelOffsetX, LiningToPanelOffsetY) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.LiningDepth = LiningDepth; this.LiningThickness = LiningThickness; this.ThresholdDepth = ThresholdDepth; this.ThresholdThickness = ThresholdThickness; this.TransomThickness = TransomThickness; this.TransomOffset = TransomOffset; this.LiningOffset = LiningOffset; this.ThresholdOffset = ThresholdOffset; this.CasingThickness = CasingThickness; this.CasingDepth = CasingDepth; this.ShapeAspectStyle = ShapeAspectStyle; this.LiningToPanelOffsetX = LiningToPanelOffsetX; this.LiningToPanelOffsetY = LiningToPanelOffsetY; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let LiningDepth = tape[ptr++]; let LiningThickness = tape[ptr++]; let ThresholdDepth = tape[ptr++]; let ThresholdThickness = tape[ptr++]; let TransomThickness = tape[ptr++]; let TransomOffset = tape[ptr++]; let LiningOffset = tape[ptr++]; let ThresholdOffset = tape[ptr++]; let CasingThickness = tape[ptr++]; let CasingDepth = tape[ptr++]; let ShapeAspectStyle = tape[ptr++]; let LiningToPanelOffsetX = tape[ptr++]; let LiningToPanelOffsetY = tape[ptr++]; return new IfcDoorLiningProperties(expressID, type, GlobalId, OwnerHistory, Name, Description, LiningDepth, LiningThickness, ThresholdDepth, ThresholdThickness, TransomThickness, TransomOffset, LiningOffset, ThresholdOffset, CasingThickness, CasingDepth, ShapeAspectStyle, LiningToPanelOffsetX, LiningToPanelOffsetY); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.LiningDepth); args.push(this.LiningThickness); args.push(this.ThresholdDepth); args.push(this.ThresholdThickness); args.push(this.TransomThickness); args.push(this.TransomOffset); args.push(this.LiningOffset); args.push(this.ThresholdOffset); args.push(this.CasingThickness); args.push(this.CasingDepth); args.push(this.ShapeAspectStyle); args.push(this.LiningToPanelOffsetX); args.push(this.LiningToPanelOffsetY); return args; } }; var IfcDoorPanelProperties = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, PanelDepth, PanelOperation, PanelWidth, PanelPosition, ShapeAspectStyle) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.PanelDepth = PanelDepth; this.PanelOperation = PanelOperation; this.PanelWidth = PanelWidth; this.PanelPosition = PanelPosition; this.ShapeAspectStyle = ShapeAspectStyle; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let PanelDepth = tape[ptr++]; let PanelOperation = tape[ptr++]; let PanelWidth = tape[ptr++]; let PanelPosition = tape[ptr++]; let ShapeAspectStyle = tape[ptr++]; return new IfcDoorPanelProperties(expressID, type, GlobalId, OwnerHistory, Name, Description, PanelDepth, PanelOperation, PanelWidth, PanelPosition, ShapeAspectStyle); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.PanelDepth); args.push(this.PanelOperation); args.push(this.PanelWidth); args.push(this.PanelPosition); args.push(this.ShapeAspectStyle); return args; } }; var IfcDoorStandardCase = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, OverallHeight, OverallWidth, PredefinedType, OperationType, UserDefinedOperationType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.OverallHeight = OverallHeight; this.OverallWidth = OverallWidth; this.PredefinedType = PredefinedType; this.OperationType = OperationType; this.UserDefinedOperationType = UserDefinedOperationType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let OverallHeight = tape[ptr++]; let OverallWidth = tape[ptr++]; let PredefinedType = tape[ptr++]; let OperationType = tape[ptr++]; let UserDefinedOperationType = tape[ptr++]; return new IfcDoorStandardCase(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, OverallHeight, OverallWidth, PredefinedType, OperationType, UserDefinedOperationType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.OverallHeight); args.push(this.OverallWidth); args.push(this.PredefinedType); args.push(this.OperationType); args.push(this.UserDefinedOperationType); return args; } }; var IfcDoorStyle = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, OperationType, ConstructionType, ParameterTakesPrecedence, Sizeable) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.OperationType = OperationType; this.ConstructionType = ConstructionType; this.ParameterTakesPrecedence = ParameterTakesPrecedence; this.Sizeable = Sizeable; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let OperationType = tape[ptr++]; let ConstructionType = tape[ptr++]; let ParameterTakesPrecedence = tape[ptr++]; let Sizeable = tape[ptr++]; return new IfcDoorStyle(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, OperationType, ConstructionType, ParameterTakesPrecedence, Sizeable); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.OperationType); args.push(this.ConstructionType); args.push(this.ParameterTakesPrecedence); args.push(this.Sizeable); return args; } }; var IfcDoorType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, OperationType, ParameterTakesPrecedence, UserDefinedOperationType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; this.OperationType = OperationType; this.ParameterTakesPrecedence = ParameterTakesPrecedence; this.UserDefinedOperationType = UserDefinedOperationType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; let OperationType = tape[ptr++]; let ParameterTakesPrecedence = tape[ptr++]; let UserDefinedOperationType = tape[ptr++]; return new IfcDoorType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, OperationType, ParameterTakesPrecedence, UserDefinedOperationType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); args.push(this.OperationType); args.push(this.ParameterTakesPrecedence); args.push(this.UserDefinedOperationType); return args; } }; var IfcDraughtingPreDefinedColour = class { constructor(expressID, type, Name) { this.expressID = expressID; this.type = type; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; return new IfcDraughtingPreDefinedColour(expressID, type, Name); } ToTape() { let args = []; args.push(this.Name); return args; } }; var IfcDraughtingPreDefinedCurveFont = class { constructor(expressID, type, Name) { this.expressID = expressID; this.type = type; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; return new IfcDraughtingPreDefinedCurveFont(expressID, type, Name); } ToTape() { let args = []; args.push(this.Name); return args; } }; var IfcDuctFitting = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcDuctFitting(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcDuctFittingType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcDuctFittingType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcDuctSegment = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcDuctSegment(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcDuctSegmentType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcDuctSegmentType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcDuctSilencer = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcDuctSilencer(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcDuctSilencerType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcDuctSilencerType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcEdge = class { constructor(expressID, type, EdgeStart, EdgeEnd) { this.expressID = expressID; this.type = type; this.EdgeStart = EdgeStart; this.EdgeEnd = EdgeEnd; } static FromTape(expressID, type, tape) { let ptr = 0; let EdgeStart = tape[ptr++]; let EdgeEnd = tape[ptr++]; return new IfcEdge(expressID, type, EdgeStart, EdgeEnd); } ToTape() { let args = []; args.push(this.EdgeStart); args.push(this.EdgeEnd); return args; } }; var IfcEdgeCurve = class { constructor(expressID, type, EdgeStart, EdgeEnd, EdgeGeometry, SameSense) { this.expressID = expressID; this.type = type; this.EdgeStart = EdgeStart; this.EdgeEnd = EdgeEnd; this.EdgeGeometry = EdgeGeometry; this.SameSense = SameSense; } static FromTape(expressID, type, tape) { let ptr = 0; let EdgeStart = tape[ptr++]; let EdgeEnd = tape[ptr++]; let EdgeGeometry = tape[ptr++]; let SameSense = tape[ptr++]; return new IfcEdgeCurve(expressID, type, EdgeStart, EdgeEnd, EdgeGeometry, SameSense); } ToTape() { let args = []; args.push(this.EdgeStart); args.push(this.EdgeEnd); args.push(this.EdgeGeometry); args.push(this.SameSense); return args; } }; var IfcEdgeLoop = class { constructor(expressID, type, EdgeList) { this.expressID = expressID; this.type = type; this.EdgeList = EdgeList; } static FromTape(expressID, type, tape) { let ptr = 0; let EdgeList = tape[ptr++]; return new IfcEdgeLoop(expressID, type, EdgeList); } ToTape() { let args = []; args.push(this.EdgeList); return args; } }; var IfcElectricAppliance = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcElectricAppliance(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcElectricApplianceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcElectricApplianceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcElectricDistributionBoard = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcElectricDistributionBoard(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcElectricDistributionBoardType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcElectricDistributionBoardType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcElectricFlowStorageDevice = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcElectricFlowStorageDevice(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcElectricFlowStorageDeviceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcElectricFlowStorageDeviceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcElectricGenerator = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcElectricGenerator(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcElectricGeneratorType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcElectricGeneratorType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcElectricMotor = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcElectricMotor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcElectricMotorType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcElectricMotorType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcElectricTimeControl = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcElectricTimeControl(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcElectricTimeControlType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcElectricTimeControlType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcElementAssembly = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, AssemblyPlace, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.AssemblyPlace = AssemblyPlace; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let AssemblyPlace = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcElementAssembly(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, AssemblyPlace, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.AssemblyPlace); args.push(this.PredefinedType); return args; } }; var IfcElementAssemblyType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcElementAssemblyType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcElementComponent = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcElementComponent(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcElementComponentType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcElementComponentType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcElementQuantity = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, MethodOfMeasurement, Quantities) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.MethodOfMeasurement = MethodOfMeasurement; this.Quantities = Quantities; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let MethodOfMeasurement = tape[ptr++]; let Quantities = tape[ptr++]; return new IfcElementQuantity(expressID, type, GlobalId, OwnerHistory, Name, Description, MethodOfMeasurement, Quantities); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.MethodOfMeasurement); args.push(this.Quantities); return args; } }; var IfcElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcElementarySurface = class { constructor(expressID, type, Position) { this.expressID = expressID; this.type = type; this.Position = Position; } static FromTape(expressID, type, tape) { let ptr = 0; let Position = tape[ptr++]; return new IfcElementarySurface(expressID, type, Position); } ToTape() { let args = []; args.push(this.Position); return args; } }; var IfcEllipse = class { constructor(expressID, type, Position, SemiAxis1, SemiAxis2) { this.expressID = expressID; this.type = type; this.Position = Position; this.SemiAxis1 = SemiAxis1; this.SemiAxis2 = SemiAxis2; } static FromTape(expressID, type, tape) { let ptr = 0; let Position = tape[ptr++]; let SemiAxis1 = tape[ptr++]; let SemiAxis2 = tape[ptr++]; return new IfcEllipse(expressID, type, Position, SemiAxis1, SemiAxis2); } ToTape() { let args = []; args.push(this.Position); args.push(this.SemiAxis1); args.push(this.SemiAxis2); return args; } }; var IfcEllipseProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position, SemiAxis1, SemiAxis2) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; this.SemiAxis1 = SemiAxis1; this.SemiAxis2 = SemiAxis2; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; let SemiAxis1 = tape[ptr++]; let SemiAxis2 = tape[ptr++]; return new IfcEllipseProfileDef(expressID, type, ProfileType, ProfileName, Position, SemiAxis1, SemiAxis2); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); args.push(this.SemiAxis1); args.push(this.SemiAxis2); return args; } }; var IfcEnergyConversionDevice = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcEnergyConversionDevice(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcEnergyConversionDeviceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcEnergyConversionDeviceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcEngine = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcEngine(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcEngineType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcEngineType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcEvaporativeCooler = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcEvaporativeCooler(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcEvaporativeCoolerType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcEvaporativeCoolerType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcEvaporator = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcEvaporator(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcEvaporatorType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcEvaporatorType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcEvent = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, PredefinedType, EventTriggerType, UserDefinedEventTriggerType, EventOccurenceTime) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.LongDescription = LongDescription; this.PredefinedType = PredefinedType; this.EventTriggerType = EventTriggerType; this.UserDefinedEventTriggerType = UserDefinedEventTriggerType; this.EventOccurenceTime = EventOccurenceTime; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let PredefinedType = tape[ptr++]; let EventTriggerType = tape[ptr++]; let UserDefinedEventTriggerType = tape[ptr++]; let EventOccurenceTime = tape[ptr++]; return new IfcEvent(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, PredefinedType, EventTriggerType, UserDefinedEventTriggerType, EventOccurenceTime); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.LongDescription); args.push(this.PredefinedType); args.push(this.EventTriggerType); args.push(this.UserDefinedEventTriggerType); args.push(this.EventOccurenceTime); return args; } }; var IfcEventTime = class { constructor(expressID, type, Name, DataOrigin, UserDefinedDataOrigin, ActualDate, EarlyDate, LateDate, ScheduleDate) { this.expressID = expressID; this.type = type; this.Name = Name; this.DataOrigin = DataOrigin; this.UserDefinedDataOrigin = UserDefinedDataOrigin; this.ActualDate = ActualDate; this.EarlyDate = EarlyDate; this.LateDate = LateDate; this.ScheduleDate = ScheduleDate; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let DataOrigin = tape[ptr++]; let UserDefinedDataOrigin = tape[ptr++]; let ActualDate = tape[ptr++]; let EarlyDate = tape[ptr++]; let LateDate = tape[ptr++]; let ScheduleDate = tape[ptr++]; return new IfcEventTime(expressID, type, Name, DataOrigin, UserDefinedDataOrigin, ActualDate, EarlyDate, LateDate, ScheduleDate); } ToTape() { let args = []; args.push(this.Name); args.push(this.DataOrigin); args.push(this.UserDefinedDataOrigin); args.push(this.ActualDate); args.push(this.EarlyDate); args.push(this.LateDate); args.push(this.ScheduleDate); return args; } }; var IfcEventType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ProcessType, PredefinedType, EventTriggerType, UserDefinedEventTriggerType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.Identification = Identification; this.LongDescription = LongDescription; this.ProcessType = ProcessType; this.PredefinedType = PredefinedType; this.EventTriggerType = EventTriggerType; this.UserDefinedEventTriggerType = UserDefinedEventTriggerType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let ProcessType = tape[ptr++]; let PredefinedType = tape[ptr++]; let EventTriggerType = tape[ptr++]; let UserDefinedEventTriggerType = tape[ptr++]; return new IfcEventType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ProcessType, PredefinedType, EventTriggerType, UserDefinedEventTriggerType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.Identification); args.push(this.LongDescription); args.push(this.ProcessType); args.push(this.PredefinedType); args.push(this.EventTriggerType); args.push(this.UserDefinedEventTriggerType); return args; } }; var IfcExtendedProperties = class { constructor(expressID, type, Name, Description, Properties) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Properties = Properties; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Properties = tape[ptr++]; return new IfcExtendedProperties(expressID, type, Name, Description, Properties); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Properties); return args; } }; var IfcExternalInformation = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcExternalInformation(expressID, type); } ToTape() { let args = []; return args; } }; var IfcExternalReference = class { constructor(expressID, type, Location, Identification, Name) { this.expressID = expressID; this.type = type; this.Location = Location; this.Identification = Identification; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Location = tape[ptr++]; let Identification = tape[ptr++]; let Name = tape[ptr++]; return new IfcExternalReference(expressID, type, Location, Identification, Name); } ToTape() { let args = []; args.push(this.Location); args.push(this.Identification); args.push(this.Name); return args; } }; var IfcExternalReferenceRelationship = class { constructor(expressID, type, Name, Description, RelatingReference, RelatedResourceObjects) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.RelatingReference = RelatingReference; this.RelatedResourceObjects = RelatedResourceObjects; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingReference = tape[ptr++]; let RelatedResourceObjects = tape[ptr++]; return new IfcExternalReferenceRelationship(expressID, type, Name, Description, RelatingReference, RelatedResourceObjects); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.RelatingReference); args.push(this.RelatedResourceObjects); return args; } }; var IfcExternalSpatialElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.LongName = LongName; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let LongName = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcExternalSpatialElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.LongName); args.push(this.PredefinedType); return args; } }; var IfcExternalSpatialStructureElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.LongName = LongName; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let LongName = tape[ptr++]; return new IfcExternalSpatialStructureElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.LongName); return args; } }; var IfcExternallyDefinedHatchStyle = class { constructor(expressID, type, Location, Identification, Name) { this.expressID = expressID; this.type = type; this.Location = Location; this.Identification = Identification; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Location = tape[ptr++]; let Identification = tape[ptr++]; let Name = tape[ptr++]; return new IfcExternallyDefinedHatchStyle(expressID, type, Location, Identification, Name); } ToTape() { let args = []; args.push(this.Location); args.push(this.Identification); args.push(this.Name); return args; } }; var IfcExternallyDefinedSurfaceStyle = class { constructor(expressID, type, Location, Identification, Name) { this.expressID = expressID; this.type = type; this.Location = Location; this.Identification = Identification; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Location = tape[ptr++]; let Identification = tape[ptr++]; let Name = tape[ptr++]; return new IfcExternallyDefinedSurfaceStyle(expressID, type, Location, Identification, Name); } ToTape() { let args = []; args.push(this.Location); args.push(this.Identification); args.push(this.Name); return args; } }; var IfcExternallyDefinedTextFont = class { constructor(expressID, type, Location, Identification, Name) { this.expressID = expressID; this.type = type; this.Location = Location; this.Identification = Identification; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Location = tape[ptr++]; let Identification = tape[ptr++]; let Name = tape[ptr++]; return new IfcExternallyDefinedTextFont(expressID, type, Location, Identification, Name); } ToTape() { let args = []; args.push(this.Location); args.push(this.Identification); args.push(this.Name); return args; } }; var IfcExtrudedAreaSolid = class { constructor(expressID, type, SweptArea, Position, ExtrudedDirection, Depth) { this.expressID = expressID; this.type = type; this.SweptArea = SweptArea; this.Position = Position; this.ExtrudedDirection = ExtrudedDirection; this.Depth = Depth; } static FromTape(expressID, type, tape) { let ptr = 0; let SweptArea = tape[ptr++]; let Position = tape[ptr++]; let ExtrudedDirection = tape[ptr++]; let Depth = tape[ptr++]; return new IfcExtrudedAreaSolid(expressID, type, SweptArea, Position, ExtrudedDirection, Depth); } ToTape() { let args = []; args.push(this.SweptArea); args.push(this.Position); args.push(this.ExtrudedDirection); args.push(this.Depth); return args; } }; var IfcExtrudedAreaSolidTapered = class { constructor(expressID, type, SweptArea, Position, ExtrudedDirection, Depth, EndSweptArea) { this.expressID = expressID; this.type = type; this.SweptArea = SweptArea; this.Position = Position; this.ExtrudedDirection = ExtrudedDirection; this.Depth = Depth; this.EndSweptArea = EndSweptArea; } static FromTape(expressID, type, tape) { let ptr = 0; let SweptArea = tape[ptr++]; let Position = tape[ptr++]; let ExtrudedDirection = tape[ptr++]; let Depth = tape[ptr++]; let EndSweptArea = tape[ptr++]; return new IfcExtrudedAreaSolidTapered(expressID, type, SweptArea, Position, ExtrudedDirection, Depth, EndSweptArea); } ToTape() { let args = []; args.push(this.SweptArea); args.push(this.Position); args.push(this.ExtrudedDirection); args.push(this.Depth); args.push(this.EndSweptArea); return args; } }; var IfcFace = class { constructor(expressID, type, Bounds) { this.expressID = expressID; this.type = type; this.Bounds = Bounds; } static FromTape(expressID, type, tape) { let ptr = 0; let Bounds = tape[ptr++]; return new IfcFace(expressID, type, Bounds); } ToTape() { let args = []; args.push(this.Bounds); return args; } }; var IfcFaceBasedSurfaceModel = class { constructor(expressID, type, FbsmFaces) { this.expressID = expressID; this.type = type; this.FbsmFaces = FbsmFaces; } static FromTape(expressID, type, tape) { let ptr = 0; let FbsmFaces = tape[ptr++]; return new IfcFaceBasedSurfaceModel(expressID, type, FbsmFaces); } ToTape() { let args = []; args.push(this.FbsmFaces); return args; } }; var IfcFaceBound = class { constructor(expressID, type, Bound, Orientation) { this.expressID = expressID; this.type = type; this.Bound = Bound; this.Orientation = Orientation; } static FromTape(expressID, type, tape) { let ptr = 0; let Bound = tape[ptr++]; let Orientation = tape[ptr++]; return new IfcFaceBound(expressID, type, Bound, Orientation); } ToTape() { let args = []; args.push(this.Bound); args.push(this.Orientation); return args; } }; var IfcFaceOuterBound = class { constructor(expressID, type, Bound, Orientation) { this.expressID = expressID; this.type = type; this.Bound = Bound; this.Orientation = Orientation; } static FromTape(expressID, type, tape) { let ptr = 0; let Bound = tape[ptr++]; let Orientation = tape[ptr++]; return new IfcFaceOuterBound(expressID, type, Bound, Orientation); } ToTape() { let args = []; args.push(this.Bound); args.push(this.Orientation); return args; } }; var IfcFaceSurface = class { constructor(expressID, type, Bounds, FaceSurface, SameSense) { this.expressID = expressID; this.type = type; this.Bounds = Bounds; this.FaceSurface = FaceSurface; this.SameSense = SameSense; } static FromTape(expressID, type, tape) { let ptr = 0; let Bounds = tape[ptr++]; let FaceSurface = tape[ptr++]; let SameSense = tape[ptr++]; return new IfcFaceSurface(expressID, type, Bounds, FaceSurface, SameSense); } ToTape() { let args = []; args.push(this.Bounds); args.push(this.FaceSurface); args.push(this.SameSense); return args; } }; var IfcFacetedBrep = class { constructor(expressID, type, Outer) { this.expressID = expressID; this.type = type; this.Outer = Outer; } static FromTape(expressID, type, tape) { let ptr = 0; let Outer = tape[ptr++]; return new IfcFacetedBrep(expressID, type, Outer); } ToTape() { let args = []; args.push(this.Outer); return args; } }; var IfcFacetedBrepWithVoids = class { constructor(expressID, type, Outer, Voids) { this.expressID = expressID; this.type = type; this.Outer = Outer; this.Voids = Voids; } static FromTape(expressID, type, tape) { let ptr = 0; let Outer = tape[ptr++]; let Voids = tape[ptr++]; return new IfcFacetedBrepWithVoids(expressID, type, Outer, Voids); } ToTape() { let args = []; args.push(this.Outer); args.push(this.Voids); return args; } }; var IfcFacility = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.LongName = LongName; this.CompositionType = CompositionType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let LongName = tape[ptr++]; let CompositionType = tape[ptr++]; return new IfcFacility(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.LongName); args.push(this.CompositionType); return args; } }; var IfcFacilityPart = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.LongName = LongName; this.CompositionType = CompositionType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let LongName = tape[ptr++]; let CompositionType = tape[ptr++]; return new IfcFacilityPart(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.LongName); args.push(this.CompositionType); return args; } }; var IfcFailureConnectionCondition = class { constructor(expressID, type, Name, TensionFailureX, TensionFailureY, TensionFailureZ, CompressionFailureX, CompressionFailureY, CompressionFailureZ) { this.expressID = expressID; this.type = type; this.Name = Name; this.TensionFailureX = TensionFailureX; this.TensionFailureY = TensionFailureY; this.TensionFailureZ = TensionFailureZ; this.CompressionFailureX = CompressionFailureX; this.CompressionFailureY = CompressionFailureY; this.CompressionFailureZ = CompressionFailureZ; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let TensionFailureX = tape[ptr++]; let TensionFailureY = tape[ptr++]; let TensionFailureZ = tape[ptr++]; let CompressionFailureX = tape[ptr++]; let CompressionFailureY = tape[ptr++]; let CompressionFailureZ = tape[ptr++]; return new IfcFailureConnectionCondition(expressID, type, Name, TensionFailureX, TensionFailureY, TensionFailureZ, CompressionFailureX, CompressionFailureY, CompressionFailureZ); } ToTape() { let args = []; args.push(this.Name); args.push(this.TensionFailureX); args.push(this.TensionFailureY); args.push(this.TensionFailureZ); args.push(this.CompressionFailureX); args.push(this.CompressionFailureY); args.push(this.CompressionFailureZ); return args; } }; var IfcFan = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFan(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcFanType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFanType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcFastener = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFastener(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcFastenerType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFastenerType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcFeatureElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcFeatureElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcFeatureElementAddition = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcFeatureElementAddition(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcFeatureElementSubtraction = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcFeatureElementSubtraction(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcFillAreaStyle = class { constructor(expressID, type, Name, FillStyles, ModelorDraughting) { this.expressID = expressID; this.type = type; this.Name = Name; this.FillStyles = FillStyles; this.ModelorDraughting = ModelorDraughting; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let FillStyles = tape[ptr++]; let ModelorDraughting = tape[ptr++]; return new IfcFillAreaStyle(expressID, type, Name, FillStyles, ModelorDraughting); } ToTape() { let args = []; args.push(this.Name); args.push(this.FillStyles); args.push(this.ModelorDraughting); return args; } }; var IfcFillAreaStyleHatching = class { constructor(expressID, type, HatchLineAppearance, StartOfNextHatchLine, PointOfReferenceHatchLine, PatternStart, HatchLineAngle) { this.expressID = expressID; this.type = type; this.HatchLineAppearance = HatchLineAppearance; this.StartOfNextHatchLine = StartOfNextHatchLine; this.PointOfReferenceHatchLine = PointOfReferenceHatchLine; this.PatternStart = PatternStart; this.HatchLineAngle = HatchLineAngle; } static FromTape(expressID, type, tape) { let ptr = 0; let HatchLineAppearance = tape[ptr++]; let StartOfNextHatchLine = tape[ptr++]; let PointOfReferenceHatchLine = tape[ptr++]; let PatternStart = tape[ptr++]; let HatchLineAngle = tape[ptr++]; return new IfcFillAreaStyleHatching(expressID, type, HatchLineAppearance, StartOfNextHatchLine, PointOfReferenceHatchLine, PatternStart, HatchLineAngle); } ToTape() { let args = []; args.push(this.HatchLineAppearance); args.push(this.StartOfNextHatchLine); args.push(this.PointOfReferenceHatchLine); args.push(this.PatternStart); args.push(this.HatchLineAngle); return args; } }; var IfcFillAreaStyleTiles = class { constructor(expressID, type, TilingPattern, Tiles, TilingScale) { this.expressID = expressID; this.type = type; this.TilingPattern = TilingPattern; this.Tiles = Tiles; this.TilingScale = TilingScale; } static FromTape(expressID, type, tape) { let ptr = 0; let TilingPattern = tape[ptr++]; let Tiles = tape[ptr++]; let TilingScale = tape[ptr++]; return new IfcFillAreaStyleTiles(expressID, type, TilingPattern, Tiles, TilingScale); } ToTape() { let args = []; args.push(this.TilingPattern); args.push(this.Tiles); args.push(this.TilingScale); return args; } }; var IfcFilter = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFilter(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcFilterType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFilterType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcFireSuppressionTerminal = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFireSuppressionTerminal(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcFireSuppressionTerminalType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFireSuppressionTerminalType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcFixedReferenceSweptAreaSolid = class { constructor(expressID, type, SweptArea, Position, Directrix, StartParam, EndParam, FixedReference) { this.expressID = expressID; this.type = type; this.SweptArea = SweptArea; this.Position = Position; this.Directrix = Directrix; this.StartParam = StartParam; this.EndParam = EndParam; this.FixedReference = FixedReference; } static FromTape(expressID, type, tape) { let ptr = 0; let SweptArea = tape[ptr++]; let Position = tape[ptr++]; let Directrix = tape[ptr++]; let StartParam = tape[ptr++]; let EndParam = tape[ptr++]; let FixedReference = tape[ptr++]; return new IfcFixedReferenceSweptAreaSolid(expressID, type, SweptArea, Position, Directrix, StartParam, EndParam, FixedReference); } ToTape() { let args = []; args.push(this.SweptArea); args.push(this.Position); args.push(this.Directrix); args.push(this.StartParam); args.push(this.EndParam); args.push(this.FixedReference); return args; } }; var IfcFlowController = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcFlowController(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcFlowControllerType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcFlowControllerType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcFlowFitting = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcFlowFitting(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcFlowFittingType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcFlowFittingType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcFlowInstrument = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFlowInstrument(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcFlowInstrumentType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFlowInstrumentType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcFlowMeter = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFlowMeter(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcFlowMeterType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFlowMeterType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcFlowMovingDevice = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcFlowMovingDevice(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcFlowMovingDeviceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcFlowMovingDeviceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcFlowSegment = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcFlowSegment(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcFlowSegmentType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcFlowSegmentType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcFlowStorageDevice = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcFlowStorageDevice(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcFlowStorageDeviceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcFlowStorageDeviceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcFlowTerminal = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcFlowTerminal(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcFlowTerminalType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcFlowTerminalType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcFlowTreatmentDevice = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcFlowTreatmentDevice(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcFlowTreatmentDeviceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcFlowTreatmentDeviceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcFooting = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFooting(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcFootingType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFootingType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcFurnishingElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcFurnishingElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcFurnishingElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcFurnishingElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcFurniture = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFurniture(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcFurnitureType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, AssemblyPlace, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.AssemblyPlace = AssemblyPlace; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let AssemblyPlace = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcFurnitureType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, AssemblyPlace, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.AssemblyPlace); args.push(this.PredefinedType); return args; } }; var IfcGeographicElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcGeographicElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcGeographicElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcGeographicElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcGeometricCurveSet = class { constructor(expressID, type, Elements) { this.expressID = expressID; this.type = type; this.Elements = Elements; } static FromTape(expressID, type, tape) { let ptr = 0; let Elements = tape[ptr++]; return new IfcGeometricCurveSet(expressID, type, Elements); } ToTape() { let args = []; args.push(this.Elements); return args; } }; var IfcGeometricRepresentationContext = class { constructor(expressID, type, ContextIdentifier, ContextType, CoordinateSpaceDimension, Precision, WorldCoordinateSystem, TrueNorth) { this.expressID = expressID; this.type = type; this.ContextIdentifier = ContextIdentifier; this.ContextType = ContextType; this.CoordinateSpaceDimension = CoordinateSpaceDimension; this.Precision = Precision; this.WorldCoordinateSystem = WorldCoordinateSystem; this.TrueNorth = TrueNorth; } static FromTape(expressID, type, tape) { let ptr = 0; let ContextIdentifier = tape[ptr++]; let ContextType = tape[ptr++]; let CoordinateSpaceDimension = tape[ptr++]; let Precision = tape[ptr++]; let WorldCoordinateSystem = tape[ptr++]; let TrueNorth = tape[ptr++]; return new IfcGeometricRepresentationContext(expressID, type, ContextIdentifier, ContextType, CoordinateSpaceDimension, Precision, WorldCoordinateSystem, TrueNorth); } ToTape() { let args = []; args.push(this.ContextIdentifier); args.push(this.ContextType); args.push(this.CoordinateSpaceDimension); args.push(this.Precision); args.push(this.WorldCoordinateSystem); args.push(this.TrueNorth); return args; } }; var IfcGeometricRepresentationItem = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcGeometricRepresentationItem(expressID, type); } ToTape() { let args = []; return args; } }; var IfcGeometricRepresentationSubContext = class { constructor(expressID, type, ContextIdentifier, ContextType, CoordinateSpaceDimension, Precision, WorldCoordinateSystem, TrueNorth, ParentContext, TargetScale, TargetView, UserDefinedTargetView) { this.expressID = expressID; this.type = type; this.ContextIdentifier = ContextIdentifier; this.ContextType = ContextType; this.CoordinateSpaceDimension = CoordinateSpaceDimension; this.Precision = Precision; this.WorldCoordinateSystem = WorldCoordinateSystem; this.TrueNorth = TrueNorth; this.ParentContext = ParentContext; this.TargetScale = TargetScale; this.TargetView = TargetView; this.UserDefinedTargetView = UserDefinedTargetView; } static FromTape(expressID, type, tape) { let ptr = 0; let ContextIdentifier = tape[ptr++]; let ContextType = tape[ptr++]; let CoordinateSpaceDimension = tape[ptr++]; let Precision = tape[ptr++]; let WorldCoordinateSystem = tape[ptr++]; let TrueNorth = tape[ptr++]; let ParentContext = tape[ptr++]; let TargetScale = tape[ptr++]; let TargetView = tape[ptr++]; let UserDefinedTargetView = tape[ptr++]; return new IfcGeometricRepresentationSubContext(expressID, type, ContextIdentifier, ContextType, CoordinateSpaceDimension, Precision, WorldCoordinateSystem, TrueNorth, ParentContext, TargetScale, TargetView, UserDefinedTargetView); } ToTape() { let args = []; args.push(this.ContextIdentifier); args.push(this.ContextType); args.push(this.CoordinateSpaceDimension); args.push(this.Precision); args.push(this.WorldCoordinateSystem); args.push(this.TrueNorth); args.push(this.ParentContext); args.push(this.TargetScale); args.push(this.TargetView); args.push(this.UserDefinedTargetView); return args; } }; var IfcGeometricSet = class { constructor(expressID, type, Elements) { this.expressID = expressID; this.type = type; this.Elements = Elements; } static FromTape(expressID, type, tape) { let ptr = 0; let Elements = tape[ptr++]; return new IfcGeometricSet(expressID, type, Elements); } ToTape() { let args = []; args.push(this.Elements); return args; } }; var IfcGrid = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, UAxes, VAxes, WAxes, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.UAxes = UAxes; this.VAxes = VAxes; this.WAxes = WAxes; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let UAxes = tape[ptr++]; let VAxes = tape[ptr++]; let WAxes = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcGrid(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, UAxes, VAxes, WAxes, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.UAxes); args.push(this.VAxes); args.push(this.WAxes); args.push(this.PredefinedType); return args; } }; var IfcGridAxis = class { constructor(expressID, type, AxisTag, AxisCurve, SameSense) { this.expressID = expressID; this.type = type; this.AxisTag = AxisTag; this.AxisCurve = AxisCurve; this.SameSense = SameSense; } static FromTape(expressID, type, tape) { let ptr = 0; let AxisTag = tape[ptr++]; let AxisCurve = tape[ptr++]; let SameSense = tape[ptr++]; return new IfcGridAxis(expressID, type, AxisTag, AxisCurve, SameSense); } ToTape() { let args = []; args.push(this.AxisTag); args.push(this.AxisCurve); args.push(this.SameSense); return args; } }; var IfcGridPlacement = class { constructor(expressID, type, PlacementRelTo, PlacementLocation, PlacementRefDirection) { this.expressID = expressID; this.type = type; this.PlacementRelTo = PlacementRelTo; this.PlacementLocation = PlacementLocation; this.PlacementRefDirection = PlacementRefDirection; } static FromTape(expressID, type, tape) { let ptr = 0; let PlacementRelTo = tape[ptr++]; let PlacementLocation = tape[ptr++]; let PlacementRefDirection = tape[ptr++]; return new IfcGridPlacement(expressID, type, PlacementRelTo, PlacementLocation, PlacementRefDirection); } ToTape() { let args = []; args.push(this.PlacementRelTo); args.push(this.PlacementLocation); args.push(this.PlacementRefDirection); return args; } }; var IfcGroup = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; return new IfcGroup(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); return args; } }; var IfcHalfSpaceSolid = class { constructor(expressID, type, BaseSurface, AgreementFlag) { this.expressID = expressID; this.type = type; this.BaseSurface = BaseSurface; this.AgreementFlag = AgreementFlag; } static FromTape(expressID, type, tape) { let ptr = 0; let BaseSurface = tape[ptr++]; let AgreementFlag = tape[ptr++]; return new IfcHalfSpaceSolid(expressID, type, BaseSurface, AgreementFlag); } ToTape() { let args = []; args.push(this.BaseSurface); args.push(this.AgreementFlag); return args; } }; var IfcHeatExchanger = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcHeatExchanger(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcHeatExchangerType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcHeatExchangerType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcHumidifier = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcHumidifier(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcHumidifierType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcHumidifierType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcIShapeProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position, OverallWidth, OverallDepth, WebThickness, FlangeThickness, FilletRadius, FlangeEdgeRadius, FlangeSlope) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; this.OverallWidth = OverallWidth; this.OverallDepth = OverallDepth; this.WebThickness = WebThickness; this.FlangeThickness = FlangeThickness; this.FilletRadius = FilletRadius; this.FlangeEdgeRadius = FlangeEdgeRadius; this.FlangeSlope = FlangeSlope; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; let OverallWidth = tape[ptr++]; let OverallDepth = tape[ptr++]; let WebThickness = tape[ptr++]; let FlangeThickness = tape[ptr++]; let FilletRadius = tape[ptr++]; let FlangeEdgeRadius = tape[ptr++]; let FlangeSlope = tape[ptr++]; return new IfcIShapeProfileDef(expressID, type, ProfileType, ProfileName, Position, OverallWidth, OverallDepth, WebThickness, FlangeThickness, FilletRadius, FlangeEdgeRadius, FlangeSlope); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); args.push(this.OverallWidth); args.push(this.OverallDepth); args.push(this.WebThickness); args.push(this.FlangeThickness); args.push(this.FilletRadius); args.push(this.FlangeEdgeRadius); args.push(this.FlangeSlope); return args; } }; var IfcImageTexture = class { constructor(expressID, type, RepeatS, RepeatT, Mode, TextureTransform, Parameter, URLReference) { this.expressID = expressID; this.type = type; this.RepeatS = RepeatS; this.RepeatT = RepeatT; this.Mode = Mode; this.TextureTransform = TextureTransform; this.Parameter = Parameter; this.URLReference = URLReference; } static FromTape(expressID, type, tape) { let ptr = 0; let RepeatS = tape[ptr++]; let RepeatT = tape[ptr++]; let Mode = tape[ptr++]; let TextureTransform = tape[ptr++]; let Parameter = tape[ptr++]; let URLReference = tape[ptr++]; return new IfcImageTexture(expressID, type, RepeatS, RepeatT, Mode, TextureTransform, Parameter, URLReference); } ToTape() { let args = []; args.push(this.RepeatS); args.push(this.RepeatT); args.push(this.Mode); args.push(this.TextureTransform); args.push(this.Parameter); args.push(this.URLReference); return args; } }; var IfcIndexedColourMap = class { constructor(expressID, type, MappedTo, Opacity, Colours, ColourIndex) { this.expressID = expressID; this.type = type; this.MappedTo = MappedTo; this.Opacity = Opacity; this.Colours = Colours; this.ColourIndex = ColourIndex; } static FromTape(expressID, type, tape) { let ptr = 0; let MappedTo = tape[ptr++]; let Opacity = tape[ptr++]; let Colours = tape[ptr++]; let ColourIndex = tape[ptr++]; return new IfcIndexedColourMap(expressID, type, MappedTo, Opacity, Colours, ColourIndex); } ToTape() { let args = []; args.push(this.MappedTo); args.push(this.Opacity); args.push(this.Colours); args.push(this.ColourIndex); return args; } }; var IfcIndexedPolyCurve = class { constructor(expressID, type, Points, Segments, SelfIntersect) { this.expressID = expressID; this.type = type; this.Points = Points; this.Segments = Segments; this.SelfIntersect = SelfIntersect; } static FromTape(expressID, type, tape) { let ptr = 0; let Points = tape[ptr++]; let Segments = tape[ptr++]; let SelfIntersect = tape[ptr++]; return new IfcIndexedPolyCurve(expressID, type, Points, Segments, SelfIntersect); } ToTape() { let args = []; args.push(this.Points); args.push(this.Segments); args.push(this.SelfIntersect); return args; } }; var IfcIndexedPolygonalFace = class { constructor(expressID, type, CoordIndex) { this.expressID = expressID; this.type = type; this.CoordIndex = CoordIndex; } static FromTape(expressID, type, tape) { let ptr = 0; let CoordIndex = tape[ptr++]; return new IfcIndexedPolygonalFace(expressID, type, CoordIndex); } ToTape() { let args = []; args.push(this.CoordIndex); return args; } }; var IfcIndexedPolygonalFaceWithVoids = class { constructor(expressID, type, CoordIndex, InnerCoordIndices) { this.expressID = expressID; this.type = type; this.CoordIndex = CoordIndex; this.InnerCoordIndices = InnerCoordIndices; } static FromTape(expressID, type, tape) { let ptr = 0; let CoordIndex = tape[ptr++]; let InnerCoordIndices = tape[ptr++]; return new IfcIndexedPolygonalFaceWithVoids(expressID, type, CoordIndex, InnerCoordIndices); } ToTape() { let args = []; args.push(this.CoordIndex); args.push(this.InnerCoordIndices); return args; } }; var IfcIndexedTextureMap = class { constructor(expressID, type, Maps, MappedTo, TexCoords) { this.expressID = expressID; this.type = type; this.Maps = Maps; this.MappedTo = MappedTo; this.TexCoords = TexCoords; } static FromTape(expressID, type, tape) { let ptr = 0; let Maps = tape[ptr++]; let MappedTo = tape[ptr++]; let TexCoords = tape[ptr++]; return new IfcIndexedTextureMap(expressID, type, Maps, MappedTo, TexCoords); } ToTape() { let args = []; args.push(this.Maps); args.push(this.MappedTo); args.push(this.TexCoords); return args; } }; var IfcIndexedTriangleTextureMap = class { constructor(expressID, type, Maps, MappedTo, TexCoords, TexCoordIndex) { this.expressID = expressID; this.type = type; this.Maps = Maps; this.MappedTo = MappedTo; this.TexCoords = TexCoords; this.TexCoordIndex = TexCoordIndex; } static FromTape(expressID, type, tape) { let ptr = 0; let Maps = tape[ptr++]; let MappedTo = tape[ptr++]; let TexCoords = tape[ptr++]; let TexCoordIndex = tape[ptr++]; return new IfcIndexedTriangleTextureMap(expressID, type, Maps, MappedTo, TexCoords, TexCoordIndex); } ToTape() { let args = []; args.push(this.Maps); args.push(this.MappedTo); args.push(this.TexCoords); args.push(this.TexCoordIndex); return args; } }; var IfcInterceptor = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcInterceptor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcInterceptorType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcInterceptorType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcIntersectionCurve = class { constructor(expressID, type, Curve3D, AssociatedGeometry, MasterRepresentation) { this.expressID = expressID; this.type = type; this.Curve3D = Curve3D; this.AssociatedGeometry = AssociatedGeometry; this.MasterRepresentation = MasterRepresentation; } static FromTape(expressID, type, tape) { let ptr = 0; let Curve3D = tape[ptr++]; let AssociatedGeometry = tape[ptr++]; let MasterRepresentation = tape[ptr++]; return new IfcIntersectionCurve(expressID, type, Curve3D, AssociatedGeometry, MasterRepresentation); } ToTape() { let args = []; args.push(this.Curve3D); args.push(this.AssociatedGeometry); args.push(this.MasterRepresentation); return args; } }; var IfcInventory = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, PredefinedType, Jurisdiction, ResponsiblePersons, LastUpdateDate, CurrentValue, OriginalValue) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.PredefinedType = PredefinedType; this.Jurisdiction = Jurisdiction; this.ResponsiblePersons = ResponsiblePersons; this.LastUpdateDate = LastUpdateDate; this.CurrentValue = CurrentValue; this.OriginalValue = OriginalValue; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let PredefinedType = tape[ptr++]; let Jurisdiction = tape[ptr++]; let ResponsiblePersons = tape[ptr++]; let LastUpdateDate = tape[ptr++]; let CurrentValue = tape[ptr++]; let OriginalValue = tape[ptr++]; return new IfcInventory(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, PredefinedType, Jurisdiction, ResponsiblePersons, LastUpdateDate, CurrentValue, OriginalValue); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.PredefinedType); args.push(this.Jurisdiction); args.push(this.ResponsiblePersons); args.push(this.LastUpdateDate); args.push(this.CurrentValue); args.push(this.OriginalValue); return args; } }; var IfcIrregularTimeSeries = class { constructor(expressID, type, Name, Description, StartTime, EndTime, TimeSeriesDataType, DataOrigin, UserDefinedDataOrigin, Unit, Values) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.StartTime = StartTime; this.EndTime = EndTime; this.TimeSeriesDataType = TimeSeriesDataType; this.DataOrigin = DataOrigin; this.UserDefinedDataOrigin = UserDefinedDataOrigin; this.Unit = Unit; this.Values = Values; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let StartTime = tape[ptr++]; let EndTime = tape[ptr++]; let TimeSeriesDataType = tape[ptr++]; let DataOrigin = tape[ptr++]; let UserDefinedDataOrigin = tape[ptr++]; let Unit = tape[ptr++]; let Values = tape[ptr++]; return new IfcIrregularTimeSeries(expressID, type, Name, Description, StartTime, EndTime, TimeSeriesDataType, DataOrigin, UserDefinedDataOrigin, Unit, Values); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.StartTime); args.push(this.EndTime); args.push(this.TimeSeriesDataType); args.push(this.DataOrigin); args.push(this.UserDefinedDataOrigin); args.push(this.Unit); args.push(this.Values); return args; } }; var IfcIrregularTimeSeriesValue = class { constructor(expressID, type, TimeStamp, ListValues) { this.expressID = expressID; this.type = type; this.TimeStamp = TimeStamp; this.ListValues = ListValues; } static FromTape(expressID, type, tape) { let ptr = 0; let TimeStamp = tape[ptr++]; let ListValues = tape[ptr++]; return new IfcIrregularTimeSeriesValue(expressID, type, TimeStamp, ListValues); } ToTape() { let args = []; args.push(this.TimeStamp); args.push(this.ListValues); return args; } }; var IfcJunctionBox = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcJunctionBox(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcJunctionBoxType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcJunctionBoxType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcLShapeProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position, Depth, Width, Thickness, FilletRadius, EdgeRadius, LegSlope) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; this.Depth = Depth; this.Width = Width; this.Thickness = Thickness; this.FilletRadius = FilletRadius; this.EdgeRadius = EdgeRadius; this.LegSlope = LegSlope; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; let Depth = tape[ptr++]; let Width = tape[ptr++]; let Thickness = tape[ptr++]; let FilletRadius = tape[ptr++]; let EdgeRadius = tape[ptr++]; let LegSlope = tape[ptr++]; return new IfcLShapeProfileDef(expressID, type, ProfileType, ProfileName, Position, Depth, Width, Thickness, FilletRadius, EdgeRadius, LegSlope); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); args.push(this.Depth); args.push(this.Width); args.push(this.Thickness); args.push(this.FilletRadius); args.push(this.EdgeRadius); args.push(this.LegSlope); return args; } }; var IfcLaborResource = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Usage, BaseCosts, BaseQuantity, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.LongDescription = LongDescription; this.Usage = Usage; this.BaseCosts = BaseCosts; this.BaseQuantity = BaseQuantity; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let Usage = tape[ptr++]; let BaseCosts = tape[ptr++]; let BaseQuantity = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcLaborResource(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Usage, BaseCosts, BaseQuantity, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.LongDescription); args.push(this.Usage); args.push(this.BaseCosts); args.push(this.BaseQuantity); args.push(this.PredefinedType); return args; } }; var IfcLaborResourceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType, BaseCosts, BaseQuantity, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.Identification = Identification; this.LongDescription = LongDescription; this.ResourceType = ResourceType; this.BaseCosts = BaseCosts; this.BaseQuantity = BaseQuantity; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let ResourceType = tape[ptr++]; let BaseCosts = tape[ptr++]; let BaseQuantity = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcLaborResourceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType, BaseCosts, BaseQuantity, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.Identification); args.push(this.LongDescription); args.push(this.ResourceType); args.push(this.BaseCosts); args.push(this.BaseQuantity); args.push(this.PredefinedType); return args; } }; var IfcLagTime = class { constructor(expressID, type, Name, DataOrigin, UserDefinedDataOrigin, LagValue, DurationType) { this.expressID = expressID; this.type = type; this.Name = Name; this.DataOrigin = DataOrigin; this.UserDefinedDataOrigin = UserDefinedDataOrigin; this.LagValue = LagValue; this.DurationType = DurationType; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let DataOrigin = tape[ptr++]; let UserDefinedDataOrigin = tape[ptr++]; let LagValue = tape[ptr++]; let DurationType = tape[ptr++]; return new IfcLagTime(expressID, type, Name, DataOrigin, UserDefinedDataOrigin, LagValue, DurationType); } ToTape() { let args = []; args.push(this.Name); args.push(this.DataOrigin); args.push(this.UserDefinedDataOrigin); args.push(this.LagValue); args.push(this.DurationType); return args; } }; var IfcLamp = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcLamp(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcLampType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcLampType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcLibraryInformation = class { constructor(expressID, type, Name, Version, Publisher, VersionDate, Location, Description) { this.expressID = expressID; this.type = type; this.Name = Name; this.Version = Version; this.Publisher = Publisher; this.VersionDate = VersionDate; this.Location = Location; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Version = tape[ptr++]; let Publisher = tape[ptr++]; let VersionDate = tape[ptr++]; let Location = tape[ptr++]; let Description = tape[ptr++]; return new IfcLibraryInformation(expressID, type, Name, Version, Publisher, VersionDate, Location, Description); } ToTape() { let args = []; args.push(this.Name); args.push(this.Version); args.push(this.Publisher); args.push(this.VersionDate); args.push(this.Location); args.push(this.Description); return args; } }; var IfcLibraryReference = class { constructor(expressID, type, Location, Identification, Name, Description, Language, ReferencedLibrary) { this.expressID = expressID; this.type = type; this.Location = Location; this.Identification = Identification; this.Name = Name; this.Description = Description; this.Language = Language; this.ReferencedLibrary = ReferencedLibrary; } static FromTape(expressID, type, tape) { let ptr = 0; let Location = tape[ptr++]; let Identification = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let Language = tape[ptr++]; let ReferencedLibrary = tape[ptr++]; return new IfcLibraryReference(expressID, type, Location, Identification, Name, Description, Language, ReferencedLibrary); } ToTape() { let args = []; args.push(this.Location); args.push(this.Identification); args.push(this.Name); args.push(this.Description); args.push(this.Language); args.push(this.ReferencedLibrary); return args; } }; var IfcLightDistributionData = class { constructor(expressID, type, MainPlaneAngle, SecondaryPlaneAngle, LuminousIntensity) { this.expressID = expressID; this.type = type; this.MainPlaneAngle = MainPlaneAngle; this.SecondaryPlaneAngle = SecondaryPlaneAngle; this.LuminousIntensity = LuminousIntensity; } static FromTape(expressID, type, tape) { let ptr = 0; let MainPlaneAngle = tape[ptr++]; let SecondaryPlaneAngle = tape[ptr++]; let LuminousIntensity = tape[ptr++]; return new IfcLightDistributionData(expressID, type, MainPlaneAngle, SecondaryPlaneAngle, LuminousIntensity); } ToTape() { let args = []; args.push(this.MainPlaneAngle); args.push(this.SecondaryPlaneAngle); args.push(this.LuminousIntensity); return args; } }; var IfcLightFixture = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcLightFixture(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcLightFixtureType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcLightFixtureType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcLightIntensityDistribution = class { constructor(expressID, type, LightDistributionCurve, DistributionData) { this.expressID = expressID; this.type = type; this.LightDistributionCurve = LightDistributionCurve; this.DistributionData = DistributionData; } static FromTape(expressID, type, tape) { let ptr = 0; let LightDistributionCurve = tape[ptr++]; let DistributionData = tape[ptr++]; return new IfcLightIntensityDistribution(expressID, type, LightDistributionCurve, DistributionData); } ToTape() { let args = []; args.push(this.LightDistributionCurve); args.push(this.DistributionData); return args; } }; var IfcLightSource = class { constructor(expressID, type, Name, LightColour, AmbientIntensity, Intensity) { this.expressID = expressID; this.type = type; this.Name = Name; this.LightColour = LightColour; this.AmbientIntensity = AmbientIntensity; this.Intensity = Intensity; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let LightColour = tape[ptr++]; let AmbientIntensity = tape[ptr++]; let Intensity = tape[ptr++]; return new IfcLightSource(expressID, type, Name, LightColour, AmbientIntensity, Intensity); } ToTape() { let args = []; args.push(this.Name); args.push(this.LightColour); args.push(this.AmbientIntensity); args.push(this.Intensity); return args; } }; var IfcLightSourceAmbient = class { constructor(expressID, type, Name, LightColour, AmbientIntensity, Intensity) { this.expressID = expressID; this.type = type; this.Name = Name; this.LightColour = LightColour; this.AmbientIntensity = AmbientIntensity; this.Intensity = Intensity; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let LightColour = tape[ptr++]; let AmbientIntensity = tape[ptr++]; let Intensity = tape[ptr++]; return new IfcLightSourceAmbient(expressID, type, Name, LightColour, AmbientIntensity, Intensity); } ToTape() { let args = []; args.push(this.Name); args.push(this.LightColour); args.push(this.AmbientIntensity); args.push(this.Intensity); return args; } }; var IfcLightSourceDirectional = class { constructor(expressID, type, Name, LightColour, AmbientIntensity, Intensity, Orientation) { this.expressID = expressID; this.type = type; this.Name = Name; this.LightColour = LightColour; this.AmbientIntensity = AmbientIntensity; this.Intensity = Intensity; this.Orientation = Orientation; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let LightColour = tape[ptr++]; let AmbientIntensity = tape[ptr++]; let Intensity = tape[ptr++]; let Orientation = tape[ptr++]; return new IfcLightSourceDirectional(expressID, type, Name, LightColour, AmbientIntensity, Intensity, Orientation); } ToTape() { let args = []; args.push(this.Name); args.push(this.LightColour); args.push(this.AmbientIntensity); args.push(this.Intensity); args.push(this.Orientation); return args; } }; var IfcLightSourceGoniometric = class { constructor(expressID, type, Name, LightColour, AmbientIntensity, Intensity, Position, ColourAppearance, ColourTemperature, LuminousFlux, LightEmissionSource, LightDistributionDataSource) { this.expressID = expressID; this.type = type; this.Name = Name; this.LightColour = LightColour; this.AmbientIntensity = AmbientIntensity; this.Intensity = Intensity; this.Position = Position; this.ColourAppearance = ColourAppearance; this.ColourTemperature = ColourTemperature; this.LuminousFlux = LuminousFlux; this.LightEmissionSource = LightEmissionSource; this.LightDistributionDataSource = LightDistributionDataSource; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let LightColour = tape[ptr++]; let AmbientIntensity = tape[ptr++]; let Intensity = tape[ptr++]; let Position = tape[ptr++]; let ColourAppearance = tape[ptr++]; let ColourTemperature = tape[ptr++]; let LuminousFlux = tape[ptr++]; let LightEmissionSource = tape[ptr++]; let LightDistributionDataSource = tape[ptr++]; return new IfcLightSourceGoniometric(expressID, type, Name, LightColour, AmbientIntensity, Intensity, Position, ColourAppearance, ColourTemperature, LuminousFlux, LightEmissionSource, LightDistributionDataSource); } ToTape() { let args = []; args.push(this.Name); args.push(this.LightColour); args.push(this.AmbientIntensity); args.push(this.Intensity); args.push(this.Position); args.push(this.ColourAppearance); args.push(this.ColourTemperature); args.push(this.LuminousFlux); args.push(this.LightEmissionSource); args.push(this.LightDistributionDataSource); return args; } }; var IfcLightSourcePositional = class { constructor(expressID, type, Name, LightColour, AmbientIntensity, Intensity, Position, Radius, ConstantAttenuation, DistanceAttenuation, QuadricAttenuation) { this.expressID = expressID; this.type = type; this.Name = Name; this.LightColour = LightColour; this.AmbientIntensity = AmbientIntensity; this.Intensity = Intensity; this.Position = Position; this.Radius = Radius; this.ConstantAttenuation = ConstantAttenuation; this.DistanceAttenuation = DistanceAttenuation; this.QuadricAttenuation = QuadricAttenuation; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let LightColour = tape[ptr++]; let AmbientIntensity = tape[ptr++]; let Intensity = tape[ptr++]; let Position = tape[ptr++]; let Radius = tape[ptr++]; let ConstantAttenuation = tape[ptr++]; let DistanceAttenuation = tape[ptr++]; let QuadricAttenuation = tape[ptr++]; return new IfcLightSourcePositional(expressID, type, Name, LightColour, AmbientIntensity, Intensity, Position, Radius, ConstantAttenuation, DistanceAttenuation, QuadricAttenuation); } ToTape() { let args = []; args.push(this.Name); args.push(this.LightColour); args.push(this.AmbientIntensity); args.push(this.Intensity); args.push(this.Position); args.push(this.Radius); args.push(this.ConstantAttenuation); args.push(this.DistanceAttenuation); args.push(this.QuadricAttenuation); return args; } }; var IfcLightSourceSpot = class { constructor(expressID, type, Name, LightColour, AmbientIntensity, Intensity, Position, Radius, ConstantAttenuation, DistanceAttenuation, QuadricAttenuation, Orientation, ConcentrationExponent, SpreadAngle, BeamWidthAngle) { this.expressID = expressID; this.type = type; this.Name = Name; this.LightColour = LightColour; this.AmbientIntensity = AmbientIntensity; this.Intensity = Intensity; this.Position = Position; this.Radius = Radius; this.ConstantAttenuation = ConstantAttenuation; this.DistanceAttenuation = DistanceAttenuation; this.QuadricAttenuation = QuadricAttenuation; this.Orientation = Orientation; this.ConcentrationExponent = ConcentrationExponent; this.SpreadAngle = SpreadAngle; this.BeamWidthAngle = BeamWidthAngle; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let LightColour = tape[ptr++]; let AmbientIntensity = tape[ptr++]; let Intensity = tape[ptr++]; let Position = tape[ptr++]; let Radius = tape[ptr++]; let ConstantAttenuation = tape[ptr++]; let DistanceAttenuation = tape[ptr++]; let QuadricAttenuation = tape[ptr++]; let Orientation = tape[ptr++]; let ConcentrationExponent = tape[ptr++]; let SpreadAngle = tape[ptr++]; let BeamWidthAngle = tape[ptr++]; return new IfcLightSourceSpot(expressID, type, Name, LightColour, AmbientIntensity, Intensity, Position, Radius, ConstantAttenuation, DistanceAttenuation, QuadricAttenuation, Orientation, ConcentrationExponent, SpreadAngle, BeamWidthAngle); } ToTape() { let args = []; args.push(this.Name); args.push(this.LightColour); args.push(this.AmbientIntensity); args.push(this.Intensity); args.push(this.Position); args.push(this.Radius); args.push(this.ConstantAttenuation); args.push(this.DistanceAttenuation); args.push(this.QuadricAttenuation); args.push(this.Orientation); args.push(this.ConcentrationExponent); args.push(this.SpreadAngle); args.push(this.BeamWidthAngle); return args; } }; var IfcLine = class { constructor(expressID, type, Pnt, Dir) { this.expressID = expressID; this.type = type; this.Pnt = Pnt; this.Dir = Dir; } static FromTape(expressID, type, tape) { let ptr = 0; let Pnt = tape[ptr++]; let Dir = tape[ptr++]; return new IfcLine(expressID, type, Pnt, Dir); } ToTape() { let args = []; args.push(this.Pnt); args.push(this.Dir); return args; } }; var IfcLineSegment2D = class { constructor(expressID, type, StartPoint, StartDirection, SegmentLength) { this.expressID = expressID; this.type = type; this.StartPoint = StartPoint; this.StartDirection = StartDirection; this.SegmentLength = SegmentLength; } static FromTape(expressID, type, tape) { let ptr = 0; let StartPoint = tape[ptr++]; let StartDirection = tape[ptr++]; let SegmentLength = tape[ptr++]; return new IfcLineSegment2D(expressID, type, StartPoint, StartDirection, SegmentLength); } ToTape() { let args = []; args.push(this.StartPoint); args.push(this.StartDirection); args.push(this.SegmentLength); return args; } }; var IfcLinearPlacement = class { constructor(expressID, type, PlacementRelTo, PlacementMeasuredAlong, Distance, Orientation, CartesianPosition) { this.expressID = expressID; this.type = type; this.PlacementRelTo = PlacementRelTo; this.PlacementMeasuredAlong = PlacementMeasuredAlong; this.Distance = Distance; this.Orientation = Orientation; this.CartesianPosition = CartesianPosition; } static FromTape(expressID, type, tape) { let ptr = 0; let PlacementRelTo = tape[ptr++]; let PlacementMeasuredAlong = tape[ptr++]; let Distance = tape[ptr++]; let Orientation = tape[ptr++]; let CartesianPosition = tape[ptr++]; return new IfcLinearPlacement(expressID, type, PlacementRelTo, PlacementMeasuredAlong, Distance, Orientation, CartesianPosition); } ToTape() { let args = []; args.push(this.PlacementRelTo); args.push(this.PlacementMeasuredAlong); args.push(this.Distance); args.push(this.Orientation); args.push(this.CartesianPosition); return args; } }; var IfcLinearPositioningElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Axis) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Axis = Axis; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Axis = tape[ptr++]; return new IfcLinearPositioningElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Axis); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Axis); return args; } }; var IfcLocalPlacement = class { constructor(expressID, type, PlacementRelTo, RelativePlacement) { this.expressID = expressID; this.type = type; this.PlacementRelTo = PlacementRelTo; this.RelativePlacement = RelativePlacement; } static FromTape(expressID, type, tape) { let ptr = 0; let PlacementRelTo = tape[ptr++]; let RelativePlacement = tape[ptr++]; return new IfcLocalPlacement(expressID, type, PlacementRelTo, RelativePlacement); } ToTape() { let args = []; args.push(this.PlacementRelTo); args.push(this.RelativePlacement); return args; } }; var IfcLoop = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcLoop(expressID, type); } ToTape() { let args = []; return args; } }; var IfcManifoldSolidBrep = class { constructor(expressID, type, Outer) { this.expressID = expressID; this.type = type; this.Outer = Outer; } static FromTape(expressID, type, tape) { let ptr = 0; let Outer = tape[ptr++]; return new IfcManifoldSolidBrep(expressID, type, Outer); } ToTape() { let args = []; args.push(this.Outer); return args; } }; var IfcMapConversion = class { constructor(expressID, type, SourceCRS, TargetCRS, Eastings, Northings, OrthogonalHeight, XAxisAbscissa, XAxisOrdinate, Scale) { this.expressID = expressID; this.type = type; this.SourceCRS = SourceCRS; this.TargetCRS = TargetCRS; this.Eastings = Eastings; this.Northings = Northings; this.OrthogonalHeight = OrthogonalHeight; this.XAxisAbscissa = XAxisAbscissa; this.XAxisOrdinate = XAxisOrdinate; this.Scale = Scale; } static FromTape(expressID, type, tape) { let ptr = 0; let SourceCRS = tape[ptr++]; let TargetCRS = tape[ptr++]; let Eastings = tape[ptr++]; let Northings = tape[ptr++]; let OrthogonalHeight = tape[ptr++]; let XAxisAbscissa = tape[ptr++]; let XAxisOrdinate = tape[ptr++]; let Scale = tape[ptr++]; return new IfcMapConversion(expressID, type, SourceCRS, TargetCRS, Eastings, Northings, OrthogonalHeight, XAxisAbscissa, XAxisOrdinate, Scale); } ToTape() { let args = []; args.push(this.SourceCRS); args.push(this.TargetCRS); args.push(this.Eastings); args.push(this.Northings); args.push(this.OrthogonalHeight); args.push(this.XAxisAbscissa); args.push(this.XAxisOrdinate); args.push(this.Scale); return args; } }; var IfcMappedItem = class { constructor(expressID, type, MappingSource, MappingTarget) { this.expressID = expressID; this.type = type; this.MappingSource = MappingSource; this.MappingTarget = MappingTarget; } static FromTape(expressID, type, tape) { let ptr = 0; let MappingSource = tape[ptr++]; let MappingTarget = tape[ptr++]; return new IfcMappedItem(expressID, type, MappingSource, MappingTarget); } ToTape() { let args = []; args.push(this.MappingSource); args.push(this.MappingTarget); return args; } }; var IfcMaterial = class { constructor(expressID, type, Name, Description, Category) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Category = Category; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Category = tape[ptr++]; return new IfcMaterial(expressID, type, Name, Description, Category); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Category); return args; } }; var IfcMaterialClassificationRelationship = class { constructor(expressID, type, MaterialClassifications, ClassifiedMaterial) { this.expressID = expressID; this.type = type; this.MaterialClassifications = MaterialClassifications; this.ClassifiedMaterial = ClassifiedMaterial; } static FromTape(expressID, type, tape) { let ptr = 0; let MaterialClassifications = tape[ptr++]; let ClassifiedMaterial = tape[ptr++]; return new IfcMaterialClassificationRelationship(expressID, type, MaterialClassifications, ClassifiedMaterial); } ToTape() { let args = []; args.push(this.MaterialClassifications); args.push(this.ClassifiedMaterial); return args; } }; var IfcMaterialConstituent = class { constructor(expressID, type, Name, Description, Material, Fraction, Category) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Material = Material; this.Fraction = Fraction; this.Category = Category; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Material = tape[ptr++]; let Fraction = tape[ptr++]; let Category = tape[ptr++]; return new IfcMaterialConstituent(expressID, type, Name, Description, Material, Fraction, Category); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Material); args.push(this.Fraction); args.push(this.Category); return args; } }; var IfcMaterialConstituentSet = class { constructor(expressID, type, Name, Description, MaterialConstituents) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.MaterialConstituents = MaterialConstituents; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let MaterialConstituents = tape[ptr++]; return new IfcMaterialConstituentSet(expressID, type, Name, Description, MaterialConstituents); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.MaterialConstituents); return args; } }; var IfcMaterialDefinition = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcMaterialDefinition(expressID, type); } ToTape() { let args = []; return args; } }; var IfcMaterialDefinitionRepresentation = class { constructor(expressID, type, Name, Description, Representations, RepresentedMaterial) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Representations = Representations; this.RepresentedMaterial = RepresentedMaterial; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Representations = tape[ptr++]; let RepresentedMaterial = tape[ptr++]; return new IfcMaterialDefinitionRepresentation(expressID, type, Name, Description, Representations, RepresentedMaterial); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Representations); args.push(this.RepresentedMaterial); return args; } }; var IfcMaterialLayer = class { constructor(expressID, type, Material, LayerThickness, IsVentilated, Name, Description, Category, Priority) { this.expressID = expressID; this.type = type; this.Material = Material; this.LayerThickness = LayerThickness; this.IsVentilated = IsVentilated; this.Name = Name; this.Description = Description; this.Category = Category; this.Priority = Priority; } static FromTape(expressID, type, tape) { let ptr = 0; let Material = tape[ptr++]; let LayerThickness = tape[ptr++]; let IsVentilated = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let Category = tape[ptr++]; let Priority = tape[ptr++]; return new IfcMaterialLayer(expressID, type, Material, LayerThickness, IsVentilated, Name, Description, Category, Priority); } ToTape() { let args = []; args.push(this.Material); args.push(this.LayerThickness); args.push(this.IsVentilated); args.push(this.Name); args.push(this.Description); args.push(this.Category); args.push(this.Priority); return args; } }; var IfcMaterialLayerSet = class { constructor(expressID, type, MaterialLayers, LayerSetName, Description) { this.expressID = expressID; this.type = type; this.MaterialLayers = MaterialLayers; this.LayerSetName = LayerSetName; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let MaterialLayers = tape[ptr++]; let LayerSetName = tape[ptr++]; let Description = tape[ptr++]; return new IfcMaterialLayerSet(expressID, type, MaterialLayers, LayerSetName, Description); } ToTape() { let args = []; args.push(this.MaterialLayers); args.push(this.LayerSetName); args.push(this.Description); return args; } }; var IfcMaterialLayerSetUsage = class { constructor(expressID, type, ForLayerSet, LayerSetDirection, DirectionSense, OffsetFromReferenceLine, ReferenceExtent) { this.expressID = expressID; this.type = type; this.ForLayerSet = ForLayerSet; this.LayerSetDirection = LayerSetDirection; this.DirectionSense = DirectionSense; this.OffsetFromReferenceLine = OffsetFromReferenceLine; this.ReferenceExtent = ReferenceExtent; } static FromTape(expressID, type, tape) { let ptr = 0; let ForLayerSet = tape[ptr++]; let LayerSetDirection = tape[ptr++]; let DirectionSense = tape[ptr++]; let OffsetFromReferenceLine = tape[ptr++]; let ReferenceExtent = tape[ptr++]; return new IfcMaterialLayerSetUsage(expressID, type, ForLayerSet, LayerSetDirection, DirectionSense, OffsetFromReferenceLine, ReferenceExtent); } ToTape() { let args = []; args.push(this.ForLayerSet); args.push(this.LayerSetDirection); args.push(this.DirectionSense); args.push(this.OffsetFromReferenceLine); args.push(this.ReferenceExtent); return args; } }; var IfcMaterialLayerWithOffsets = class { constructor(expressID, type, Material, LayerThickness, IsVentilated, Name, Description, Category, Priority, OffsetDirection, OffsetValues) { this.expressID = expressID; this.type = type; this.Material = Material; this.LayerThickness = LayerThickness; this.IsVentilated = IsVentilated; this.Name = Name; this.Description = Description; this.Category = Category; this.Priority = Priority; this.OffsetDirection = OffsetDirection; this.OffsetValues = OffsetValues; } static FromTape(expressID, type, tape) { let ptr = 0; let Material = tape[ptr++]; let LayerThickness = tape[ptr++]; let IsVentilated = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let Category = tape[ptr++]; let Priority = tape[ptr++]; let OffsetDirection = tape[ptr++]; let OffsetValues = tape[ptr++]; return new IfcMaterialLayerWithOffsets(expressID, type, Material, LayerThickness, IsVentilated, Name, Description, Category, Priority, OffsetDirection, OffsetValues); } ToTape() { let args = []; args.push(this.Material); args.push(this.LayerThickness); args.push(this.IsVentilated); args.push(this.Name); args.push(this.Description); args.push(this.Category); args.push(this.Priority); args.push(this.OffsetDirection); args.push(this.OffsetValues); return args; } }; var IfcMaterialList = class { constructor(expressID, type, Materials) { this.expressID = expressID; this.type = type; this.Materials = Materials; } static FromTape(expressID, type, tape) { let ptr = 0; let Materials = tape[ptr++]; return new IfcMaterialList(expressID, type, Materials); } ToTape() { let args = []; args.push(this.Materials); return args; } }; var IfcMaterialProfile = class { constructor(expressID, type, Name, Description, Material, Profile, Priority, Category) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Material = Material; this.Profile = Profile; this.Priority = Priority; this.Category = Category; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Material = tape[ptr++]; let Profile = tape[ptr++]; let Priority = tape[ptr++]; let Category = tape[ptr++]; return new IfcMaterialProfile(expressID, type, Name, Description, Material, Profile, Priority, Category); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Material); args.push(this.Profile); args.push(this.Priority); args.push(this.Category); return args; } }; var IfcMaterialProfileSet = class { constructor(expressID, type, Name, Description, MaterialProfiles, CompositeProfile) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.MaterialProfiles = MaterialProfiles; this.CompositeProfile = CompositeProfile; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let MaterialProfiles = tape[ptr++]; let CompositeProfile = tape[ptr++]; return new IfcMaterialProfileSet(expressID, type, Name, Description, MaterialProfiles, CompositeProfile); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.MaterialProfiles); args.push(this.CompositeProfile); return args; } }; var IfcMaterialProfileSetUsage = class { constructor(expressID, type, ForProfileSet, CardinalPoint, ReferenceExtent) { this.expressID = expressID; this.type = type; this.ForProfileSet = ForProfileSet; this.CardinalPoint = CardinalPoint; this.ReferenceExtent = ReferenceExtent; } static FromTape(expressID, type, tape) { let ptr = 0; let ForProfileSet = tape[ptr++]; let CardinalPoint = tape[ptr++]; let ReferenceExtent = tape[ptr++]; return new IfcMaterialProfileSetUsage(expressID, type, ForProfileSet, CardinalPoint, ReferenceExtent); } ToTape() { let args = []; args.push(this.ForProfileSet); args.push(this.CardinalPoint); args.push(this.ReferenceExtent); return args; } }; var IfcMaterialProfileSetUsageTapering = class { constructor(expressID, type, ForProfileSet, CardinalPoint, ReferenceExtent, ForProfileEndSet, CardinalEndPoint) { this.expressID = expressID; this.type = type; this.ForProfileSet = ForProfileSet; this.CardinalPoint = CardinalPoint; this.ReferenceExtent = ReferenceExtent; this.ForProfileEndSet = ForProfileEndSet; this.CardinalEndPoint = CardinalEndPoint; } static FromTape(expressID, type, tape) { let ptr = 0; let ForProfileSet = tape[ptr++]; let CardinalPoint = tape[ptr++]; let ReferenceExtent = tape[ptr++]; let ForProfileEndSet = tape[ptr++]; let CardinalEndPoint = tape[ptr++]; return new IfcMaterialProfileSetUsageTapering(expressID, type, ForProfileSet, CardinalPoint, ReferenceExtent, ForProfileEndSet, CardinalEndPoint); } ToTape() { let args = []; args.push(this.ForProfileSet); args.push(this.CardinalPoint); args.push(this.ReferenceExtent); args.push(this.ForProfileEndSet); args.push(this.CardinalEndPoint); return args; } }; var IfcMaterialProfileWithOffsets = class { constructor(expressID, type, Name, Description, Material, Profile, Priority, Category, OffsetValues) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Material = Material; this.Profile = Profile; this.Priority = Priority; this.Category = Category; this.OffsetValues = OffsetValues; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Material = tape[ptr++]; let Profile = tape[ptr++]; let Priority = tape[ptr++]; let Category = tape[ptr++]; let OffsetValues = tape[ptr++]; return new IfcMaterialProfileWithOffsets(expressID, type, Name, Description, Material, Profile, Priority, Category, OffsetValues); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Material); args.push(this.Profile); args.push(this.Priority); args.push(this.Category); args.push(this.OffsetValues); return args; } }; var IfcMaterialProperties = class { constructor(expressID, type, Name, Description, Properties, Material) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Properties = Properties; this.Material = Material; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Properties = tape[ptr++]; let Material = tape[ptr++]; return new IfcMaterialProperties(expressID, type, Name, Description, Properties, Material); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Properties); args.push(this.Material); return args; } }; var IfcMaterialRelationship = class { constructor(expressID, type, Name, Description, RelatingMaterial, RelatedMaterials, Expression) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.RelatingMaterial = RelatingMaterial; this.RelatedMaterials = RelatedMaterials; this.Expression = Expression; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingMaterial = tape[ptr++]; let RelatedMaterials = tape[ptr++]; let Expression = tape[ptr++]; return new IfcMaterialRelationship(expressID, type, Name, Description, RelatingMaterial, RelatedMaterials, Expression); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.RelatingMaterial); args.push(this.RelatedMaterials); args.push(this.Expression); return args; } }; var IfcMaterialUsageDefinition = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcMaterialUsageDefinition(expressID, type); } ToTape() { let args = []; return args; } }; var IfcMeasureWithUnit = class { constructor(expressID, type, ValueComponent, UnitComponent) { this.expressID = expressID; this.type = type; this.ValueComponent = ValueComponent; this.UnitComponent = UnitComponent; } static FromTape(expressID, type, tape) { let ptr = 0; let ValueComponent = tape[ptr++]; let UnitComponent = tape[ptr++]; return new IfcMeasureWithUnit(expressID, type, ValueComponent, UnitComponent); } ToTape() { let args = []; args.push(this.ValueComponent); args.push(this.UnitComponent); return args; } }; var IfcMechanicalFastener = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, NominalDiameter, NominalLength, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.NominalDiameter = NominalDiameter; this.NominalLength = NominalLength; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let NominalDiameter = tape[ptr++]; let NominalLength = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcMechanicalFastener(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, NominalDiameter, NominalLength, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.NominalDiameter); args.push(this.NominalLength); args.push(this.PredefinedType); return args; } }; var IfcMechanicalFastenerType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, NominalDiameter, NominalLength) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; this.NominalDiameter = NominalDiameter; this.NominalLength = NominalLength; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; let NominalDiameter = tape[ptr++]; let NominalLength = tape[ptr++]; return new IfcMechanicalFastenerType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, NominalDiameter, NominalLength); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); args.push(this.NominalDiameter); args.push(this.NominalLength); return args; } }; var IfcMedicalDevice = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcMedicalDevice(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcMedicalDeviceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcMedicalDeviceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcMember = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcMember(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcMemberStandardCase = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcMemberStandardCase(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcMemberType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcMemberType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcMetric = class { constructor(expressID, type, Name, Description, ConstraintGrade, ConstraintSource, CreatingActor, CreationTime, UserDefinedGrade, Benchmark, ValueSource, DataValue, ReferencePath) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.ConstraintGrade = ConstraintGrade; this.ConstraintSource = ConstraintSource; this.CreatingActor = CreatingActor; this.CreationTime = CreationTime; this.UserDefinedGrade = UserDefinedGrade; this.Benchmark = Benchmark; this.ValueSource = ValueSource; this.DataValue = DataValue; this.ReferencePath = ReferencePath; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let ConstraintGrade = tape[ptr++]; let ConstraintSource = tape[ptr++]; let CreatingActor = tape[ptr++]; let CreationTime = tape[ptr++]; let UserDefinedGrade = tape[ptr++]; let Benchmark = tape[ptr++]; let ValueSource = tape[ptr++]; let DataValue = tape[ptr++]; let ReferencePath = tape[ptr++]; return new IfcMetric(expressID, type, Name, Description, ConstraintGrade, ConstraintSource, CreatingActor, CreationTime, UserDefinedGrade, Benchmark, ValueSource, DataValue, ReferencePath); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.ConstraintGrade); args.push(this.ConstraintSource); args.push(this.CreatingActor); args.push(this.CreationTime); args.push(this.UserDefinedGrade); args.push(this.Benchmark); args.push(this.ValueSource); args.push(this.DataValue); args.push(this.ReferencePath); return args; } }; var IfcMirroredProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, ParentProfile, Operator, Label) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.ParentProfile = ParentProfile; this.Operator = Operator; this.Label = Label; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let ParentProfile = tape[ptr++]; let Operator = tape[ptr++]; let Label = tape[ptr++]; return new IfcMirroredProfileDef(expressID, type, ProfileType, ProfileName, ParentProfile, Operator, Label); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.ParentProfile); args.push(this.Operator); args.push(this.Label); return args; } }; var IfcMonetaryUnit = class { constructor(expressID, type, Currency) { this.expressID = expressID; this.type = type; this.Currency = Currency; } static FromTape(expressID, type, tape) { let ptr = 0; let Currency = tape[ptr++]; return new IfcMonetaryUnit(expressID, type, Currency); } ToTape() { let args = []; args.push(this.Currency); return args; } }; var IfcMotorConnection = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcMotorConnection(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcMotorConnectionType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcMotorConnectionType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcNamedUnit = class { constructor(expressID, type, Dimensions, UnitType) { this.expressID = expressID; this.type = type; this.Dimensions = Dimensions; this.UnitType = UnitType; } static FromTape(expressID, type, tape) { let ptr = 0; let Dimensions = tape[ptr++]; let UnitType = tape[ptr++]; return new IfcNamedUnit(expressID, type, Dimensions, UnitType); } ToTape() { let args = []; args.push(this.Dimensions); args.push(this.UnitType); return args; } }; var IfcObject = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; return new IfcObject(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); return args; } }; var IfcObjectDefinition = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcObjectDefinition(expressID, type, GlobalId, OwnerHistory, Name, Description); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); return args; } }; var IfcObjectPlacement = class { constructor(expressID, type, PlacementRelTo) { this.expressID = expressID; this.type = type; this.PlacementRelTo = PlacementRelTo; } static FromTape(expressID, type, tape) { let ptr = 0; let PlacementRelTo = tape[ptr++]; return new IfcObjectPlacement(expressID, type, PlacementRelTo); } ToTape() { let args = []; args.push(this.PlacementRelTo); return args; } }; var IfcObjective = class { constructor(expressID, type, Name, Description, ConstraintGrade, ConstraintSource, CreatingActor, CreationTime, UserDefinedGrade, BenchmarkValues, LogicalAggregator, ObjectiveQualifier, UserDefinedQualifier) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.ConstraintGrade = ConstraintGrade; this.ConstraintSource = ConstraintSource; this.CreatingActor = CreatingActor; this.CreationTime = CreationTime; this.UserDefinedGrade = UserDefinedGrade; this.BenchmarkValues = BenchmarkValues; this.LogicalAggregator = LogicalAggregator; this.ObjectiveQualifier = ObjectiveQualifier; this.UserDefinedQualifier = UserDefinedQualifier; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let ConstraintGrade = tape[ptr++]; let ConstraintSource = tape[ptr++]; let CreatingActor = tape[ptr++]; let CreationTime = tape[ptr++]; let UserDefinedGrade = tape[ptr++]; let BenchmarkValues = tape[ptr++]; let LogicalAggregator = tape[ptr++]; let ObjectiveQualifier = tape[ptr++]; let UserDefinedQualifier = tape[ptr++]; return new IfcObjective(expressID, type, Name, Description, ConstraintGrade, ConstraintSource, CreatingActor, CreationTime, UserDefinedGrade, BenchmarkValues, LogicalAggregator, ObjectiveQualifier, UserDefinedQualifier); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.ConstraintGrade); args.push(this.ConstraintSource); args.push(this.CreatingActor); args.push(this.CreationTime); args.push(this.UserDefinedGrade); args.push(this.BenchmarkValues); args.push(this.LogicalAggregator); args.push(this.ObjectiveQualifier); args.push(this.UserDefinedQualifier); return args; } }; var IfcOccupant = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, TheActor, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.TheActor = TheActor; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let TheActor = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcOccupant(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, TheActor, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.TheActor); args.push(this.PredefinedType); return args; } }; var IfcOffsetCurve = class { constructor(expressID, type, BasisCurve) { this.expressID = expressID; this.type = type; this.BasisCurve = BasisCurve; } static FromTape(expressID, type, tape) { let ptr = 0; let BasisCurve = tape[ptr++]; return new IfcOffsetCurve(expressID, type, BasisCurve); } ToTape() { let args = []; args.push(this.BasisCurve); return args; } }; var IfcOffsetCurve2D = class { constructor(expressID, type, BasisCurve, Distance, SelfIntersect) { this.expressID = expressID; this.type = type; this.BasisCurve = BasisCurve; this.Distance = Distance; this.SelfIntersect = SelfIntersect; } static FromTape(expressID, type, tape) { let ptr = 0; let BasisCurve = tape[ptr++]; let Distance = tape[ptr++]; let SelfIntersect = tape[ptr++]; return new IfcOffsetCurve2D(expressID, type, BasisCurve, Distance, SelfIntersect); } ToTape() { let args = []; args.push(this.BasisCurve); args.push(this.Distance); args.push(this.SelfIntersect); return args; } }; var IfcOffsetCurve3D = class { constructor(expressID, type, BasisCurve, Distance, SelfIntersect, RefDirection) { this.expressID = expressID; this.type = type; this.BasisCurve = BasisCurve; this.Distance = Distance; this.SelfIntersect = SelfIntersect; this.RefDirection = RefDirection; } static FromTape(expressID, type, tape) { let ptr = 0; let BasisCurve = tape[ptr++]; let Distance = tape[ptr++]; let SelfIntersect = tape[ptr++]; let RefDirection = tape[ptr++]; return new IfcOffsetCurve3D(expressID, type, BasisCurve, Distance, SelfIntersect, RefDirection); } ToTape() { let args = []; args.push(this.BasisCurve); args.push(this.Distance); args.push(this.SelfIntersect); args.push(this.RefDirection); return args; } }; var IfcOffsetCurveByDistances = class { constructor(expressID, type, BasisCurve, OffsetValues, Tag) { this.expressID = expressID; this.type = type; this.BasisCurve = BasisCurve; this.OffsetValues = OffsetValues; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let BasisCurve = tape[ptr++]; let OffsetValues = tape[ptr++]; let Tag = tape[ptr++]; return new IfcOffsetCurveByDistances(expressID, type, BasisCurve, OffsetValues, Tag); } ToTape() { let args = []; args.push(this.BasisCurve); args.push(this.OffsetValues); args.push(this.Tag); return args; } }; var IfcOpenShell = class { constructor(expressID, type, CfsFaces) { this.expressID = expressID; this.type = type; this.CfsFaces = CfsFaces; } static FromTape(expressID, type, tape) { let ptr = 0; let CfsFaces = tape[ptr++]; return new IfcOpenShell(expressID, type, CfsFaces); } ToTape() { let args = []; args.push(this.CfsFaces); return args; } }; var IfcOpeningElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcOpeningElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcOpeningStandardCase = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcOpeningStandardCase(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcOrganization = class { constructor(expressID, type, Identification, Name, Description, Roles, Addresses) { this.expressID = expressID; this.type = type; this.Identification = Identification; this.Name = Name; this.Description = Description; this.Roles = Roles; this.Addresses = Addresses; } static FromTape(expressID, type, tape) { let ptr = 0; let Identification = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let Roles = tape[ptr++]; let Addresses = tape[ptr++]; return new IfcOrganization(expressID, type, Identification, Name, Description, Roles, Addresses); } ToTape() { let args = []; args.push(this.Identification); args.push(this.Name); args.push(this.Description); args.push(this.Roles); args.push(this.Addresses); return args; } }; var IfcOrganizationRelationship = class { constructor(expressID, type, Name, Description, RelatingOrganization, RelatedOrganizations) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.RelatingOrganization = RelatingOrganization; this.RelatedOrganizations = RelatedOrganizations; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingOrganization = tape[ptr++]; let RelatedOrganizations = tape[ptr++]; return new IfcOrganizationRelationship(expressID, type, Name, Description, RelatingOrganization, RelatedOrganizations); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.RelatingOrganization); args.push(this.RelatedOrganizations); return args; } }; var IfcOrientationExpression = class { constructor(expressID, type, LateralAxisDirection, VerticalAxisDirection) { this.expressID = expressID; this.type = type; this.LateralAxisDirection = LateralAxisDirection; this.VerticalAxisDirection = VerticalAxisDirection; } static FromTape(expressID, type, tape) { let ptr = 0; let LateralAxisDirection = tape[ptr++]; let VerticalAxisDirection = tape[ptr++]; return new IfcOrientationExpression(expressID, type, LateralAxisDirection, VerticalAxisDirection); } ToTape() { let args = []; args.push(this.LateralAxisDirection); args.push(this.VerticalAxisDirection); return args; } }; var IfcOrientedEdge = class { constructor(expressID, type, EdgeStart, EdgeEnd, EdgeElement, Orientation) { this.expressID = expressID; this.type = type; this.EdgeStart = EdgeStart; this.EdgeEnd = EdgeEnd; this.EdgeElement = EdgeElement; this.Orientation = Orientation; } static FromTape(expressID, type, tape) { let ptr = 0; let EdgeStart = tape[ptr++]; let EdgeEnd = tape[ptr++]; let EdgeElement = tape[ptr++]; let Orientation = tape[ptr++]; return new IfcOrientedEdge(expressID, type, EdgeStart, EdgeEnd, EdgeElement, Orientation); } ToTape() { let args = []; args.push(this.EdgeStart); args.push(this.EdgeEnd); args.push(this.EdgeElement); args.push(this.Orientation); return args; } }; var IfcOuterBoundaryCurve = class { constructor(expressID, type, Segments, SelfIntersect) { this.expressID = expressID; this.type = type; this.Segments = Segments; this.SelfIntersect = SelfIntersect; } static FromTape(expressID, type, tape) { let ptr = 0; let Segments = tape[ptr++]; let SelfIntersect = tape[ptr++]; return new IfcOuterBoundaryCurve(expressID, type, Segments, SelfIntersect); } ToTape() { let args = []; args.push(this.Segments); args.push(this.SelfIntersect); return args; } }; var IfcOutlet = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcOutlet(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcOutletType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcOutletType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcOwnerHistory = class { constructor(expressID, type, OwningUser, OwningApplication, State, ChangeAction, LastModifiedDate, LastModifyingUser, LastModifyingApplication, CreationDate) { this.expressID = expressID; this.type = type; this.OwningUser = OwningUser; this.OwningApplication = OwningApplication; this.State = State; this.ChangeAction = ChangeAction; this.LastModifiedDate = LastModifiedDate; this.LastModifyingUser = LastModifyingUser; this.LastModifyingApplication = LastModifyingApplication; this.CreationDate = CreationDate; } static FromTape(expressID, type, tape) { let ptr = 0; let OwningUser = tape[ptr++]; let OwningApplication = tape[ptr++]; let State = tape[ptr++]; let ChangeAction = tape[ptr++]; let LastModifiedDate = tape[ptr++]; let LastModifyingUser = tape[ptr++]; let LastModifyingApplication = tape[ptr++]; let CreationDate = tape[ptr++]; return new IfcOwnerHistory(expressID, type, OwningUser, OwningApplication, State, ChangeAction, LastModifiedDate, LastModifyingUser, LastModifyingApplication, CreationDate); } ToTape() { let args = []; args.push(this.OwningUser); args.push(this.OwningApplication); args.push(this.State); args.push(this.ChangeAction); args.push(this.LastModifiedDate); args.push(this.LastModifyingUser); args.push(this.LastModifyingApplication); args.push(this.CreationDate); return args; } }; var IfcParameterizedProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; return new IfcParameterizedProfileDef(expressID, type, ProfileType, ProfileName, Position); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); return args; } }; var IfcPath = class { constructor(expressID, type, EdgeList) { this.expressID = expressID; this.type = type; this.EdgeList = EdgeList; } static FromTape(expressID, type, tape) { let ptr = 0; let EdgeList = tape[ptr++]; return new IfcPath(expressID, type, EdgeList); } ToTape() { let args = []; args.push(this.EdgeList); return args; } }; var IfcPcurve = class { constructor(expressID, type, BasisSurface, ReferenceCurve) { this.expressID = expressID; this.type = type; this.BasisSurface = BasisSurface; this.ReferenceCurve = ReferenceCurve; } static FromTape(expressID, type, tape) { let ptr = 0; let BasisSurface = tape[ptr++]; let ReferenceCurve = tape[ptr++]; return new IfcPcurve(expressID, type, BasisSurface, ReferenceCurve); } ToTape() { let args = []; args.push(this.BasisSurface); args.push(this.ReferenceCurve); return args; } }; var IfcPerformanceHistory = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LifeCyclePhase, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.LifeCyclePhase = LifeCyclePhase; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let LifeCyclePhase = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcPerformanceHistory(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LifeCyclePhase, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.LifeCyclePhase); args.push(this.PredefinedType); return args; } }; var IfcPermeableCoveringProperties = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, OperationType, PanelPosition, FrameDepth, FrameThickness, ShapeAspectStyle) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.OperationType = OperationType; this.PanelPosition = PanelPosition; this.FrameDepth = FrameDepth; this.FrameThickness = FrameThickness; this.ShapeAspectStyle = ShapeAspectStyle; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let OperationType = tape[ptr++]; let PanelPosition = tape[ptr++]; let FrameDepth = tape[ptr++]; let FrameThickness = tape[ptr++]; let ShapeAspectStyle = tape[ptr++]; return new IfcPermeableCoveringProperties(expressID, type, GlobalId, OwnerHistory, Name, Description, OperationType, PanelPosition, FrameDepth, FrameThickness, ShapeAspectStyle); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.OperationType); args.push(this.PanelPosition); args.push(this.FrameDepth); args.push(this.FrameThickness); args.push(this.ShapeAspectStyle); return args; } }; var IfcPermit = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, PredefinedType, Status, LongDescription) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.PredefinedType = PredefinedType; this.Status = Status; this.LongDescription = LongDescription; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let PredefinedType = tape[ptr++]; let Status = tape[ptr++]; let LongDescription = tape[ptr++]; return new IfcPermit(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, PredefinedType, Status, LongDescription); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.PredefinedType); args.push(this.Status); args.push(this.LongDescription); return args; } }; var IfcPerson = class { constructor(expressID, type, Identification, FamilyName, GivenName, MiddleNames, PrefixTitles, SuffixTitles, Roles, Addresses) { this.expressID = expressID; this.type = type; this.Identification = Identification; this.FamilyName = FamilyName; this.GivenName = GivenName; this.MiddleNames = MiddleNames; this.PrefixTitles = PrefixTitles; this.SuffixTitles = SuffixTitles; this.Roles = Roles; this.Addresses = Addresses; } static FromTape(expressID, type, tape) { let ptr = 0; let Identification = tape[ptr++]; let FamilyName = tape[ptr++]; let GivenName = tape[ptr++]; let MiddleNames = tape[ptr++]; let PrefixTitles = tape[ptr++]; let SuffixTitles = tape[ptr++]; let Roles = tape[ptr++]; let Addresses = tape[ptr++]; return new IfcPerson(expressID, type, Identification, FamilyName, GivenName, MiddleNames, PrefixTitles, SuffixTitles, Roles, Addresses); } ToTape() { let args = []; args.push(this.Identification); args.push(this.FamilyName); args.push(this.GivenName); args.push(this.MiddleNames); args.push(this.PrefixTitles); args.push(this.SuffixTitles); args.push(this.Roles); args.push(this.Addresses); return args; } }; var IfcPersonAndOrganization = class { constructor(expressID, type, ThePerson, TheOrganization, Roles) { this.expressID = expressID; this.type = type; this.ThePerson = ThePerson; this.TheOrganization = TheOrganization; this.Roles = Roles; } static FromTape(expressID, type, tape) { let ptr = 0; let ThePerson = tape[ptr++]; let TheOrganization = tape[ptr++]; let Roles = tape[ptr++]; return new IfcPersonAndOrganization(expressID, type, ThePerson, TheOrganization, Roles); } ToTape() { let args = []; args.push(this.ThePerson); args.push(this.TheOrganization); args.push(this.Roles); return args; } }; var IfcPhysicalComplexQuantity = class { constructor(expressID, type, Name, Description, HasQuantities, Discrimination, Quality, Usage) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.HasQuantities = HasQuantities; this.Discrimination = Discrimination; this.Quality = Quality; this.Usage = Usage; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let HasQuantities = tape[ptr++]; let Discrimination = tape[ptr++]; let Quality = tape[ptr++]; let Usage = tape[ptr++]; return new IfcPhysicalComplexQuantity(expressID, type, Name, Description, HasQuantities, Discrimination, Quality, Usage); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.HasQuantities); args.push(this.Discrimination); args.push(this.Quality); args.push(this.Usage); return args; } }; var IfcPhysicalQuantity = class { constructor(expressID, type, Name, Description) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcPhysicalQuantity(expressID, type, Name, Description); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); return args; } }; var IfcPhysicalSimpleQuantity = class { constructor(expressID, type, Name, Description, Unit) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Unit = Unit; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Unit = tape[ptr++]; return new IfcPhysicalSimpleQuantity(expressID, type, Name, Description, Unit); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Unit); return args; } }; var IfcPile = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType, ConstructionType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; this.ConstructionType = ConstructionType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; let ConstructionType = tape[ptr++]; return new IfcPile(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType, ConstructionType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); args.push(this.ConstructionType); return args; } }; var IfcPileType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcPileType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcPipeFitting = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcPipeFitting(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcPipeFittingType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcPipeFittingType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcPipeSegment = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcPipeSegment(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcPipeSegmentType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcPipeSegmentType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcPixelTexture = class { constructor(expressID, type, RepeatS, RepeatT, Mode, TextureTransform, Parameter, Width, Height, ColourComponents, Pixel) { this.expressID = expressID; this.type = type; this.RepeatS = RepeatS; this.RepeatT = RepeatT; this.Mode = Mode; this.TextureTransform = TextureTransform; this.Parameter = Parameter; this.Width = Width; this.Height = Height; this.ColourComponents = ColourComponents; this.Pixel = Pixel; } static FromTape(expressID, type, tape) { let ptr = 0; let RepeatS = tape[ptr++]; let RepeatT = tape[ptr++]; let Mode = tape[ptr++]; let TextureTransform = tape[ptr++]; let Parameter = tape[ptr++]; let Width = tape[ptr++]; let Height = tape[ptr++]; let ColourComponents = tape[ptr++]; let Pixel = tape[ptr++]; return new IfcPixelTexture(expressID, type, RepeatS, RepeatT, Mode, TextureTransform, Parameter, Width, Height, ColourComponents, Pixel); } ToTape() { let args = []; args.push(this.RepeatS); args.push(this.RepeatT); args.push(this.Mode); args.push(this.TextureTransform); args.push(this.Parameter); args.push(this.Width); args.push(this.Height); args.push(this.ColourComponents); args.push(this.Pixel); return args; } }; var IfcPlacement = class { constructor(expressID, type, Location) { this.expressID = expressID; this.type = type; this.Location = Location; } static FromTape(expressID, type, tape) { let ptr = 0; let Location = tape[ptr++]; return new IfcPlacement(expressID, type, Location); } ToTape() { let args = []; args.push(this.Location); return args; } }; var IfcPlanarBox = class { constructor(expressID, type, SizeInX, SizeInY, Placement) { this.expressID = expressID; this.type = type; this.SizeInX = SizeInX; this.SizeInY = SizeInY; this.Placement = Placement; } static FromTape(expressID, type, tape) { let ptr = 0; let SizeInX = tape[ptr++]; let SizeInY = tape[ptr++]; let Placement = tape[ptr++]; return new IfcPlanarBox(expressID, type, SizeInX, SizeInY, Placement); } ToTape() { let args = []; args.push(this.SizeInX); args.push(this.SizeInY); args.push(this.Placement); return args; } }; var IfcPlanarExtent = class { constructor(expressID, type, SizeInX, SizeInY) { this.expressID = expressID; this.type = type; this.SizeInX = SizeInX; this.SizeInY = SizeInY; } static FromTape(expressID, type, tape) { let ptr = 0; let SizeInX = tape[ptr++]; let SizeInY = tape[ptr++]; return new IfcPlanarExtent(expressID, type, SizeInX, SizeInY); } ToTape() { let args = []; args.push(this.SizeInX); args.push(this.SizeInY); return args; } }; var IfcPlane = class { constructor(expressID, type, Position) { this.expressID = expressID; this.type = type; this.Position = Position; } static FromTape(expressID, type, tape) { let ptr = 0; let Position = tape[ptr++]; return new IfcPlane(expressID, type, Position); } ToTape() { let args = []; args.push(this.Position); return args; } }; var IfcPlate = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcPlate(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcPlateStandardCase = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcPlateStandardCase(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcPlateType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcPlateType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcPoint = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcPoint(expressID, type); } ToTape() { let args = []; return args; } }; var IfcPointOnCurve = class { constructor(expressID, type, BasisCurve, PointParameter) { this.expressID = expressID; this.type = type; this.BasisCurve = BasisCurve; this.PointParameter = PointParameter; } static FromTape(expressID, type, tape) { let ptr = 0; let BasisCurve = tape[ptr++]; let PointParameter = tape[ptr++]; return new IfcPointOnCurve(expressID, type, BasisCurve, PointParameter); } ToTape() { let args = []; args.push(this.BasisCurve); args.push(this.PointParameter); return args; } }; var IfcPointOnSurface = class { constructor(expressID, type, BasisSurface, PointParameterU, PointParameterV) { this.expressID = expressID; this.type = type; this.BasisSurface = BasisSurface; this.PointParameterU = PointParameterU; this.PointParameterV = PointParameterV; } static FromTape(expressID, type, tape) { let ptr = 0; let BasisSurface = tape[ptr++]; let PointParameterU = tape[ptr++]; let PointParameterV = tape[ptr++]; return new IfcPointOnSurface(expressID, type, BasisSurface, PointParameterU, PointParameterV); } ToTape() { let args = []; args.push(this.BasisSurface); args.push(this.PointParameterU); args.push(this.PointParameterV); return args; } }; var IfcPolyLoop = class { constructor(expressID, type, Polygon) { this.expressID = expressID; this.type = type; this.Polygon = Polygon; } static FromTape(expressID, type, tape) { let ptr = 0; let Polygon = tape[ptr++]; return new IfcPolyLoop(expressID, type, Polygon); } ToTape() { let args = []; args.push(this.Polygon); return args; } }; var IfcPolygonalBoundedHalfSpace = class { constructor(expressID, type, BaseSurface, AgreementFlag, Position, PolygonalBoundary) { this.expressID = expressID; this.type = type; this.BaseSurface = BaseSurface; this.AgreementFlag = AgreementFlag; this.Position = Position; this.PolygonalBoundary = PolygonalBoundary; } static FromTape(expressID, type, tape) { let ptr = 0; let BaseSurface = tape[ptr++]; let AgreementFlag = tape[ptr++]; let Position = tape[ptr++]; let PolygonalBoundary = tape[ptr++]; return new IfcPolygonalBoundedHalfSpace(expressID, type, BaseSurface, AgreementFlag, Position, PolygonalBoundary); } ToTape() { let args = []; args.push(this.BaseSurface); args.push(this.AgreementFlag); args.push(this.Position); args.push(this.PolygonalBoundary); return args; } }; var IfcPolygonalFaceSet = class { constructor(expressID, type, Coordinates, Closed, Faces, PnIndex) { this.expressID = expressID; this.type = type; this.Coordinates = Coordinates; this.Closed = Closed; this.Faces = Faces; this.PnIndex = PnIndex; } static FromTape(expressID, type, tape) { let ptr = 0; let Coordinates = tape[ptr++]; let Closed = tape[ptr++]; let Faces = tape[ptr++]; let PnIndex = tape[ptr++]; return new IfcPolygonalFaceSet(expressID, type, Coordinates, Closed, Faces, PnIndex); } ToTape() { let args = []; args.push(this.Coordinates); args.push(this.Closed); args.push(this.Faces); args.push(this.PnIndex); return args; } }; var IfcPolyline = class { constructor(expressID, type, Points) { this.expressID = expressID; this.type = type; this.Points = Points; } static FromTape(expressID, type, tape) { let ptr = 0; let Points = tape[ptr++]; return new IfcPolyline(expressID, type, Points); } ToTape() { let args = []; args.push(this.Points); return args; } }; var IfcPort = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; return new IfcPort(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); return args; } }; var IfcPositioningElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; return new IfcPositioningElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); return args; } }; var IfcPostalAddress = class { constructor(expressID, type, Purpose, Description, UserDefinedPurpose, InternalLocation, AddressLines, PostalBox, Town, Region, PostalCode, Country) { this.expressID = expressID; this.type = type; this.Purpose = Purpose; this.Description = Description; this.UserDefinedPurpose = UserDefinedPurpose; this.InternalLocation = InternalLocation; this.AddressLines = AddressLines; this.PostalBox = PostalBox; this.Town = Town; this.Region = Region; this.PostalCode = PostalCode; this.Country = Country; } static FromTape(expressID, type, tape) { let ptr = 0; let Purpose = tape[ptr++]; let Description = tape[ptr++]; let UserDefinedPurpose = tape[ptr++]; let InternalLocation = tape[ptr++]; let AddressLines = tape[ptr++]; let PostalBox = tape[ptr++]; let Town = tape[ptr++]; let Region = tape[ptr++]; let PostalCode = tape[ptr++]; let Country = tape[ptr++]; return new IfcPostalAddress(expressID, type, Purpose, Description, UserDefinedPurpose, InternalLocation, AddressLines, PostalBox, Town, Region, PostalCode, Country); } ToTape() { let args = []; args.push(this.Purpose); args.push(this.Description); args.push(this.UserDefinedPurpose); args.push(this.InternalLocation); args.push(this.AddressLines); args.push(this.PostalBox); args.push(this.Town); args.push(this.Region); args.push(this.PostalCode); args.push(this.Country); return args; } }; var IfcPreDefinedColour = class { constructor(expressID, type, Name) { this.expressID = expressID; this.type = type; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; return new IfcPreDefinedColour(expressID, type, Name); } ToTape() { let args = []; args.push(this.Name); return args; } }; var IfcPreDefinedCurveFont = class { constructor(expressID, type, Name) { this.expressID = expressID; this.type = type; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; return new IfcPreDefinedCurveFont(expressID, type, Name); } ToTape() { let args = []; args.push(this.Name); return args; } }; var IfcPreDefinedItem = class { constructor(expressID, type, Name) { this.expressID = expressID; this.type = type; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; return new IfcPreDefinedItem(expressID, type, Name); } ToTape() { let args = []; args.push(this.Name); return args; } }; var IfcPreDefinedProperties = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcPreDefinedProperties(expressID, type); } ToTape() { let args = []; return args; } }; var IfcPreDefinedPropertySet = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcPreDefinedPropertySet(expressID, type, GlobalId, OwnerHistory, Name, Description); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); return args; } }; var IfcPreDefinedTextFont = class { constructor(expressID, type, Name) { this.expressID = expressID; this.type = type; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; return new IfcPreDefinedTextFont(expressID, type, Name); } ToTape() { let args = []; args.push(this.Name); return args; } }; var IfcPresentationItem = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcPresentationItem(expressID, type); } ToTape() { let args = []; return args; } }; var IfcPresentationLayerAssignment = class { constructor(expressID, type, Name, Description, AssignedItems, Identifier) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.AssignedItems = AssignedItems; this.Identifier = Identifier; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let AssignedItems = tape[ptr++]; let Identifier = tape[ptr++]; return new IfcPresentationLayerAssignment(expressID, type, Name, Description, AssignedItems, Identifier); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.AssignedItems); args.push(this.Identifier); return args; } }; var IfcPresentationLayerWithStyle = class { constructor(expressID, type, Name, Description, AssignedItems, Identifier, LayerOn, LayerFrozen, LayerBlocked, LayerStyles) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.AssignedItems = AssignedItems; this.Identifier = Identifier; this.LayerOn = LayerOn; this.LayerFrozen = LayerFrozen; this.LayerBlocked = LayerBlocked; this.LayerStyles = LayerStyles; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let AssignedItems = tape[ptr++]; let Identifier = tape[ptr++]; let LayerOn = tape[ptr++]; let LayerFrozen = tape[ptr++]; let LayerBlocked = tape[ptr++]; let LayerStyles = tape[ptr++]; return new IfcPresentationLayerWithStyle(expressID, type, Name, Description, AssignedItems, Identifier, LayerOn, LayerFrozen, LayerBlocked, LayerStyles); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.AssignedItems); args.push(this.Identifier); args.push(this.LayerOn); args.push(this.LayerFrozen); args.push(this.LayerBlocked); args.push(this.LayerStyles); return args; } }; var IfcPresentationStyle = class { constructor(expressID, type, Name) { this.expressID = expressID; this.type = type; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; return new IfcPresentationStyle(expressID, type, Name); } ToTape() { let args = []; args.push(this.Name); return args; } }; var IfcPresentationStyleAssignment = class { constructor(expressID, type, Styles) { this.expressID = expressID; this.type = type; this.Styles = Styles; } static FromTape(expressID, type, tape) { let ptr = 0; let Styles = tape[ptr++]; return new IfcPresentationStyleAssignment(expressID, type, Styles); } ToTape() { let args = []; args.push(this.Styles); return args; } }; var IfcProcedure = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.LongDescription = LongDescription; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcProcedure(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.LongDescription); args.push(this.PredefinedType); return args; } }; var IfcProcedureType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ProcessType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.Identification = Identification; this.LongDescription = LongDescription; this.ProcessType = ProcessType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let ProcessType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcProcedureType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ProcessType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.Identification); args.push(this.LongDescription); args.push(this.ProcessType); args.push(this.PredefinedType); return args; } }; var IfcProcess = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.LongDescription = LongDescription; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; return new IfcProcess(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.LongDescription); return args; } }; var IfcProduct = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; return new IfcProduct(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); return args; } }; var IfcProductDefinitionShape = class { constructor(expressID, type, Name, Description, Representations) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Representations = Representations; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Representations = tape[ptr++]; return new IfcProductDefinitionShape(expressID, type, Name, Description, Representations); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Representations); return args; } }; var IfcProductRepresentation = class { constructor(expressID, type, Name, Description, Representations) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Representations = Representations; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Representations = tape[ptr++]; return new IfcProductRepresentation(expressID, type, Name, Description, Representations); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Representations); return args; } }; var IfcProfileDef = class { constructor(expressID, type, ProfileType, ProfileName) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; return new IfcProfileDef(expressID, type, ProfileType, ProfileName); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); return args; } }; var IfcProfileProperties = class { constructor(expressID, type, Name, Description, Properties, ProfileDefinition) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Properties = Properties; this.ProfileDefinition = ProfileDefinition; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Properties = tape[ptr++]; let ProfileDefinition = tape[ptr++]; return new IfcProfileProperties(expressID, type, Name, Description, Properties, ProfileDefinition); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Properties); args.push(this.ProfileDefinition); return args; } }; var IfcProject = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, LongName, Phase, RepresentationContexts, UnitsInContext) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.LongName = LongName; this.Phase = Phase; this.RepresentationContexts = RepresentationContexts; this.UnitsInContext = UnitsInContext; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let LongName = tape[ptr++]; let Phase = tape[ptr++]; let RepresentationContexts = tape[ptr++]; let UnitsInContext = tape[ptr++]; return new IfcProject(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, LongName, Phase, RepresentationContexts, UnitsInContext); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.LongName); args.push(this.Phase); args.push(this.RepresentationContexts); args.push(this.UnitsInContext); return args; } }; var IfcProjectLibrary = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, LongName, Phase, RepresentationContexts, UnitsInContext) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.LongName = LongName; this.Phase = Phase; this.RepresentationContexts = RepresentationContexts; this.UnitsInContext = UnitsInContext; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let LongName = tape[ptr++]; let Phase = tape[ptr++]; let RepresentationContexts = tape[ptr++]; let UnitsInContext = tape[ptr++]; return new IfcProjectLibrary(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, LongName, Phase, RepresentationContexts, UnitsInContext); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.LongName); args.push(this.Phase); args.push(this.RepresentationContexts); args.push(this.UnitsInContext); return args; } }; var IfcProjectOrder = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, PredefinedType, Status, LongDescription) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.PredefinedType = PredefinedType; this.Status = Status; this.LongDescription = LongDescription; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let PredefinedType = tape[ptr++]; let Status = tape[ptr++]; let LongDescription = tape[ptr++]; return new IfcProjectOrder(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, PredefinedType, Status, LongDescription); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.PredefinedType); args.push(this.Status); args.push(this.LongDescription); return args; } }; var IfcProjectedCRS = class { constructor(expressID, type, Name, Description, GeodeticDatum, VerticalDatum, MapProjection, MapZone, MapUnit) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.GeodeticDatum = GeodeticDatum; this.VerticalDatum = VerticalDatum; this.MapProjection = MapProjection; this.MapZone = MapZone; this.MapUnit = MapUnit; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let GeodeticDatum = tape[ptr++]; let VerticalDatum = tape[ptr++]; let MapProjection = tape[ptr++]; let MapZone = tape[ptr++]; let MapUnit = tape[ptr++]; return new IfcProjectedCRS(expressID, type, Name, Description, GeodeticDatum, VerticalDatum, MapProjection, MapZone, MapUnit); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.GeodeticDatum); args.push(this.VerticalDatum); args.push(this.MapProjection); args.push(this.MapZone); args.push(this.MapUnit); return args; } }; var IfcProjectionElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcProjectionElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcProperty = class { constructor(expressID, type, Name, Description) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcProperty(expressID, type, Name, Description); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); return args; } }; var IfcPropertyAbstraction = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcPropertyAbstraction(expressID, type); } ToTape() { let args = []; return args; } }; var IfcPropertyBoundedValue = class { constructor(expressID, type, Name, Description, UpperBoundValue, LowerBoundValue, Unit, SetPointValue) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.UpperBoundValue = UpperBoundValue; this.LowerBoundValue = LowerBoundValue; this.Unit = Unit; this.SetPointValue = SetPointValue; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let UpperBoundValue = tape[ptr++]; let LowerBoundValue = tape[ptr++]; let Unit = tape[ptr++]; let SetPointValue = tape[ptr++]; return new IfcPropertyBoundedValue(expressID, type, Name, Description, UpperBoundValue, LowerBoundValue, Unit, SetPointValue); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.UpperBoundValue); args.push(this.LowerBoundValue); args.push(this.Unit); args.push(this.SetPointValue); return args; } }; var IfcPropertyDefinition = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcPropertyDefinition(expressID, type, GlobalId, OwnerHistory, Name, Description); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); return args; } }; var IfcPropertyDependencyRelationship = class { constructor(expressID, type, Name, Description, DependingProperty, DependantProperty, Expression) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.DependingProperty = DependingProperty; this.DependantProperty = DependantProperty; this.Expression = Expression; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let DependingProperty = tape[ptr++]; let DependantProperty = tape[ptr++]; let Expression = tape[ptr++]; return new IfcPropertyDependencyRelationship(expressID, type, Name, Description, DependingProperty, DependantProperty, Expression); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.DependingProperty); args.push(this.DependantProperty); args.push(this.Expression); return args; } }; var IfcPropertyEnumeratedValue = class { constructor(expressID, type, Name, Description, EnumerationValues, EnumerationReference) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.EnumerationValues = EnumerationValues; this.EnumerationReference = EnumerationReference; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let EnumerationValues = tape[ptr++]; let EnumerationReference = tape[ptr++]; return new IfcPropertyEnumeratedValue(expressID, type, Name, Description, EnumerationValues, EnumerationReference); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.EnumerationValues); args.push(this.EnumerationReference); return args; } }; var IfcPropertyEnumeration = class { constructor(expressID, type, Name, EnumerationValues, Unit) { this.expressID = expressID; this.type = type; this.Name = Name; this.EnumerationValues = EnumerationValues; this.Unit = Unit; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let EnumerationValues = tape[ptr++]; let Unit = tape[ptr++]; return new IfcPropertyEnumeration(expressID, type, Name, EnumerationValues, Unit); } ToTape() { let args = []; args.push(this.Name); args.push(this.EnumerationValues); args.push(this.Unit); return args; } }; var IfcPropertyListValue = class { constructor(expressID, type, Name, Description, ListValues, Unit) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.ListValues = ListValues; this.Unit = Unit; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let ListValues = tape[ptr++]; let Unit = tape[ptr++]; return new IfcPropertyListValue(expressID, type, Name, Description, ListValues, Unit); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.ListValues); args.push(this.Unit); return args; } }; var IfcPropertyReferenceValue = class { constructor(expressID, type, Name, Description, UsageName, PropertyReference) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.UsageName = UsageName; this.PropertyReference = PropertyReference; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let UsageName = tape[ptr++]; let PropertyReference = tape[ptr++]; return new IfcPropertyReferenceValue(expressID, type, Name, Description, UsageName, PropertyReference); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.UsageName); args.push(this.PropertyReference); return args; } }; var IfcPropertySet = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, HasProperties) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.HasProperties = HasProperties; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let HasProperties = tape[ptr++]; return new IfcPropertySet(expressID, type, GlobalId, OwnerHistory, Name, Description, HasProperties); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.HasProperties); return args; } }; var IfcPropertySetDefinition = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcPropertySetDefinition(expressID, type, GlobalId, OwnerHistory, Name, Description); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); return args; } }; var IfcPropertySetTemplate = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, TemplateType, ApplicableEntity, HasPropertyTemplates) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.TemplateType = TemplateType; this.ApplicableEntity = ApplicableEntity; this.HasPropertyTemplates = HasPropertyTemplates; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let TemplateType = tape[ptr++]; let ApplicableEntity = tape[ptr++]; let HasPropertyTemplates = tape[ptr++]; return new IfcPropertySetTemplate(expressID, type, GlobalId, OwnerHistory, Name, Description, TemplateType, ApplicableEntity, HasPropertyTemplates); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.TemplateType); args.push(this.ApplicableEntity); args.push(this.HasPropertyTemplates); return args; } }; var IfcPropertySingleValue = class { constructor(expressID, type, Name, Description, NominalValue, Unit) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.NominalValue = NominalValue; this.Unit = Unit; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let NominalValue = tape[ptr++]; let Unit = tape[ptr++]; return new IfcPropertySingleValue(expressID, type, Name, Description, NominalValue, Unit); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.NominalValue); args.push(this.Unit); return args; } }; var IfcPropertyTableValue = class { constructor(expressID, type, Name, Description, DefiningValues, DefinedValues, Expression, DefiningUnit, DefinedUnit, CurveInterpolation) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.DefiningValues = DefiningValues; this.DefinedValues = DefinedValues; this.Expression = Expression; this.DefiningUnit = DefiningUnit; this.DefinedUnit = DefinedUnit; this.CurveInterpolation = CurveInterpolation; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let DefiningValues = tape[ptr++]; let DefinedValues = tape[ptr++]; let Expression = tape[ptr++]; let DefiningUnit = tape[ptr++]; let DefinedUnit = tape[ptr++]; let CurveInterpolation = tape[ptr++]; return new IfcPropertyTableValue(expressID, type, Name, Description, DefiningValues, DefinedValues, Expression, DefiningUnit, DefinedUnit, CurveInterpolation); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.DefiningValues); args.push(this.DefinedValues); args.push(this.Expression); args.push(this.DefiningUnit); args.push(this.DefinedUnit); args.push(this.CurveInterpolation); return args; } }; var IfcPropertyTemplate = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcPropertyTemplate(expressID, type, GlobalId, OwnerHistory, Name, Description); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); return args; } }; var IfcPropertyTemplateDefinition = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcPropertyTemplateDefinition(expressID, type, GlobalId, OwnerHistory, Name, Description); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); return args; } }; var IfcProtectiveDevice = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcProtectiveDevice(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcProtectiveDeviceTrippingUnit = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcProtectiveDeviceTrippingUnit(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcProtectiveDeviceTrippingUnitType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcProtectiveDeviceTrippingUnitType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcProtectiveDeviceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcProtectiveDeviceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcProxy = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, ProxyType, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.ProxyType = ProxyType; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let ProxyType = tape[ptr++]; let Tag = tape[ptr++]; return new IfcProxy(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, ProxyType, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.ProxyType); args.push(this.Tag); return args; } }; var IfcPump = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcPump(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcPumpType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcPumpType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcQuantityArea = class { constructor(expressID, type, Name, Description, Unit, AreaValue, Formula) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Unit = Unit; this.AreaValue = AreaValue; this.Formula = Formula; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Unit = tape[ptr++]; let AreaValue = tape[ptr++]; let Formula = tape[ptr++]; return new IfcQuantityArea(expressID, type, Name, Description, Unit, AreaValue, Formula); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Unit); args.push(this.AreaValue); args.push(this.Formula); return args; } }; var IfcQuantityCount = class { constructor(expressID, type, Name, Description, Unit, CountValue, Formula) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Unit = Unit; this.CountValue = CountValue; this.Formula = Formula; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Unit = tape[ptr++]; let CountValue = tape[ptr++]; let Formula = tape[ptr++]; return new IfcQuantityCount(expressID, type, Name, Description, Unit, CountValue, Formula); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Unit); args.push(this.CountValue); args.push(this.Formula); return args; } }; var IfcQuantityLength = class { constructor(expressID, type, Name, Description, Unit, LengthValue, Formula) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Unit = Unit; this.LengthValue = LengthValue; this.Formula = Formula; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Unit = tape[ptr++]; let LengthValue = tape[ptr++]; let Formula = tape[ptr++]; return new IfcQuantityLength(expressID, type, Name, Description, Unit, LengthValue, Formula); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Unit); args.push(this.LengthValue); args.push(this.Formula); return args; } }; var IfcQuantitySet = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcQuantitySet(expressID, type, GlobalId, OwnerHistory, Name, Description); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); return args; } }; var IfcQuantityTime = class { constructor(expressID, type, Name, Description, Unit, TimeValue, Formula) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Unit = Unit; this.TimeValue = TimeValue; this.Formula = Formula; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Unit = tape[ptr++]; let TimeValue = tape[ptr++]; let Formula = tape[ptr++]; return new IfcQuantityTime(expressID, type, Name, Description, Unit, TimeValue, Formula); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Unit); args.push(this.TimeValue); args.push(this.Formula); return args; } }; var IfcQuantityVolume = class { constructor(expressID, type, Name, Description, Unit, VolumeValue, Formula) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Unit = Unit; this.VolumeValue = VolumeValue; this.Formula = Formula; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Unit = tape[ptr++]; let VolumeValue = tape[ptr++]; let Formula = tape[ptr++]; return new IfcQuantityVolume(expressID, type, Name, Description, Unit, VolumeValue, Formula); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Unit); args.push(this.VolumeValue); args.push(this.Formula); return args; } }; var IfcQuantityWeight = class { constructor(expressID, type, Name, Description, Unit, WeightValue, Formula) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.Unit = Unit; this.WeightValue = WeightValue; this.Formula = Formula; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let Unit = tape[ptr++]; let WeightValue = tape[ptr++]; let Formula = tape[ptr++]; return new IfcQuantityWeight(expressID, type, Name, Description, Unit, WeightValue, Formula); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.Unit); args.push(this.WeightValue); args.push(this.Formula); return args; } }; var IfcRailing = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcRailing(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcRailingType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcRailingType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcRamp = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcRamp(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcRampFlight = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcRampFlight(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcRampFlightType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcRampFlightType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcRampType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcRampType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcRationalBSplineCurveWithKnots = class { constructor(expressID, type, Degree, ControlPointsList, CurveForm, ClosedCurve, SelfIntersect, KnotMultiplicities, Knots, KnotSpec, WeightsData) { this.expressID = expressID; this.type = type; this.Degree = Degree; this.ControlPointsList = ControlPointsList; this.CurveForm = CurveForm; this.ClosedCurve = ClosedCurve; this.SelfIntersect = SelfIntersect; this.KnotMultiplicities = KnotMultiplicities; this.Knots = Knots; this.KnotSpec = KnotSpec; this.WeightsData = WeightsData; } static FromTape(expressID, type, tape) { let ptr = 0; let Degree = tape[ptr++]; let ControlPointsList = tape[ptr++]; let CurveForm = tape[ptr++]; let ClosedCurve = tape[ptr++]; let SelfIntersect = tape[ptr++]; let KnotMultiplicities = tape[ptr++]; let Knots = tape[ptr++]; let KnotSpec = tape[ptr++]; let WeightsData = tape[ptr++]; return new IfcRationalBSplineCurveWithKnots(expressID, type, Degree, ControlPointsList, CurveForm, ClosedCurve, SelfIntersect, KnotMultiplicities, Knots, KnotSpec, WeightsData); } ToTape() { let args = []; args.push(this.Degree); args.push(this.ControlPointsList); args.push(this.CurveForm); args.push(this.ClosedCurve); args.push(this.SelfIntersect); args.push(this.KnotMultiplicities); args.push(this.Knots); args.push(this.KnotSpec); args.push(this.WeightsData); return args; } }; var IfcRationalBSplineSurfaceWithKnots = class { constructor(expressID, type, UDegree, VDegree, ControlPointsList, SurfaceForm, UClosed, VClosed, SelfIntersect, UMultiplicities, VMultiplicities, UKnots, VKnots, KnotSpec, WeightsData) { this.expressID = expressID; this.type = type; this.UDegree = UDegree; this.VDegree = VDegree; this.ControlPointsList = ControlPointsList; this.SurfaceForm = SurfaceForm; this.UClosed = UClosed; this.VClosed = VClosed; this.SelfIntersect = SelfIntersect; this.UMultiplicities = UMultiplicities; this.VMultiplicities = VMultiplicities; this.UKnots = UKnots; this.VKnots = VKnots; this.KnotSpec = KnotSpec; this.WeightsData = WeightsData; } static FromTape(expressID, type, tape) { let ptr = 0; let UDegree = tape[ptr++]; let VDegree = tape[ptr++]; let ControlPointsList = tape[ptr++]; let SurfaceForm = tape[ptr++]; let UClosed = tape[ptr++]; let VClosed = tape[ptr++]; let SelfIntersect = tape[ptr++]; let UMultiplicities = tape[ptr++]; let VMultiplicities = tape[ptr++]; let UKnots = tape[ptr++]; let VKnots = tape[ptr++]; let KnotSpec = tape[ptr++]; let WeightsData = tape[ptr++]; return new IfcRationalBSplineSurfaceWithKnots(expressID, type, UDegree, VDegree, ControlPointsList, SurfaceForm, UClosed, VClosed, SelfIntersect, UMultiplicities, VMultiplicities, UKnots, VKnots, KnotSpec, WeightsData); } ToTape() { let args = []; args.push(this.UDegree); args.push(this.VDegree); args.push(this.ControlPointsList); args.push(this.SurfaceForm); args.push(this.UClosed); args.push(this.VClosed); args.push(this.SelfIntersect); args.push(this.UMultiplicities); args.push(this.VMultiplicities); args.push(this.UKnots); args.push(this.VKnots); args.push(this.KnotSpec); args.push(this.WeightsData); return args; } }; var IfcRectangleHollowProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position, XDim, YDim, WallThickness, InnerFilletRadius, OuterFilletRadius) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; this.XDim = XDim; this.YDim = YDim; this.WallThickness = WallThickness; this.InnerFilletRadius = InnerFilletRadius; this.OuterFilletRadius = OuterFilletRadius; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; let XDim = tape[ptr++]; let YDim = tape[ptr++]; let WallThickness = tape[ptr++]; let InnerFilletRadius = tape[ptr++]; let OuterFilletRadius = tape[ptr++]; return new IfcRectangleHollowProfileDef(expressID, type, ProfileType, ProfileName, Position, XDim, YDim, WallThickness, InnerFilletRadius, OuterFilletRadius); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); args.push(this.XDim); args.push(this.YDim); args.push(this.WallThickness); args.push(this.InnerFilletRadius); args.push(this.OuterFilletRadius); return args; } }; var IfcRectangleProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position, XDim, YDim) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; this.XDim = XDim; this.YDim = YDim; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; let XDim = tape[ptr++]; let YDim = tape[ptr++]; return new IfcRectangleProfileDef(expressID, type, ProfileType, ProfileName, Position, XDim, YDim); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); args.push(this.XDim); args.push(this.YDim); return args; } }; var IfcRectangularPyramid = class { constructor(expressID, type, Position, XLength, YLength, Height) { this.expressID = expressID; this.type = type; this.Position = Position; this.XLength = XLength; this.YLength = YLength; this.Height = Height; } static FromTape(expressID, type, tape) { let ptr = 0; let Position = tape[ptr++]; let XLength = tape[ptr++]; let YLength = tape[ptr++]; let Height = tape[ptr++]; return new IfcRectangularPyramid(expressID, type, Position, XLength, YLength, Height); } ToTape() { let args = []; args.push(this.Position); args.push(this.XLength); args.push(this.YLength); args.push(this.Height); return args; } }; var IfcRectangularTrimmedSurface = class { constructor(expressID, type, BasisSurface, U1, V1, U2, V2, Usense, Vsense) { this.expressID = expressID; this.type = type; this.BasisSurface = BasisSurface; this.U1 = U1; this.V1 = V1; this.U2 = U2; this.V2 = V2; this.Usense = Usense; this.Vsense = Vsense; } static FromTape(expressID, type, tape) { let ptr = 0; let BasisSurface = tape[ptr++]; let U1 = tape[ptr++]; let V1 = tape[ptr++]; let U2 = tape[ptr++]; let V2 = tape[ptr++]; let Usense = tape[ptr++]; let Vsense = tape[ptr++]; return new IfcRectangularTrimmedSurface(expressID, type, BasisSurface, U1, V1, U2, V2, Usense, Vsense); } ToTape() { let args = []; args.push(this.BasisSurface); args.push(this.U1); args.push(this.V1); args.push(this.U2); args.push(this.V2); args.push(this.Usense); args.push(this.Vsense); return args; } }; var IfcRecurrencePattern = class { constructor(expressID, type, RecurrenceType, DayComponent, WeekdayComponent, MonthComponent, Position, Interval, Occurrences, TimePeriods) { this.expressID = expressID; this.type = type; this.RecurrenceType = RecurrenceType; this.DayComponent = DayComponent; this.WeekdayComponent = WeekdayComponent; this.MonthComponent = MonthComponent; this.Position = Position; this.Interval = Interval; this.Occurrences = Occurrences; this.TimePeriods = TimePeriods; } static FromTape(expressID, type, tape) { let ptr = 0; let RecurrenceType = tape[ptr++]; let DayComponent = tape[ptr++]; let WeekdayComponent = tape[ptr++]; let MonthComponent = tape[ptr++]; let Position = tape[ptr++]; let Interval = tape[ptr++]; let Occurrences = tape[ptr++]; let TimePeriods = tape[ptr++]; return new IfcRecurrencePattern(expressID, type, RecurrenceType, DayComponent, WeekdayComponent, MonthComponent, Position, Interval, Occurrences, TimePeriods); } ToTape() { let args = []; args.push(this.RecurrenceType); args.push(this.DayComponent); args.push(this.WeekdayComponent); args.push(this.MonthComponent); args.push(this.Position); args.push(this.Interval); args.push(this.Occurrences); args.push(this.TimePeriods); return args; } }; var IfcReference = class { constructor(expressID, type, TypeIdentifier, AttributeIdentifier, InstanceName, ListPositions, InnerReference) { this.expressID = expressID; this.type = type; this.TypeIdentifier = TypeIdentifier; this.AttributeIdentifier = AttributeIdentifier; this.InstanceName = InstanceName; this.ListPositions = ListPositions; this.InnerReference = InnerReference; } static FromTape(expressID, type, tape) { let ptr = 0; let TypeIdentifier = tape[ptr++]; let AttributeIdentifier = tape[ptr++]; let InstanceName = tape[ptr++]; let ListPositions = tape[ptr++]; let InnerReference = tape[ptr++]; return new IfcReference(expressID, type, TypeIdentifier, AttributeIdentifier, InstanceName, ListPositions, InnerReference); } ToTape() { let args = []; args.push(this.TypeIdentifier); args.push(this.AttributeIdentifier); args.push(this.InstanceName); args.push(this.ListPositions); args.push(this.InnerReference); return args; } }; var IfcReferent = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, PredefinedType, RestartDistance) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.PredefinedType = PredefinedType; this.RestartDistance = RestartDistance; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let PredefinedType = tape[ptr++]; let RestartDistance = tape[ptr++]; return new IfcReferent(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, PredefinedType, RestartDistance); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.PredefinedType); args.push(this.RestartDistance); return args; } }; var IfcRegularTimeSeries = class { constructor(expressID, type, Name, Description, StartTime, EndTime, TimeSeriesDataType, DataOrigin, UserDefinedDataOrigin, Unit, TimeStep, Values) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.StartTime = StartTime; this.EndTime = EndTime; this.TimeSeriesDataType = TimeSeriesDataType; this.DataOrigin = DataOrigin; this.UserDefinedDataOrigin = UserDefinedDataOrigin; this.Unit = Unit; this.TimeStep = TimeStep; this.Values = Values; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let StartTime = tape[ptr++]; let EndTime = tape[ptr++]; let TimeSeriesDataType = tape[ptr++]; let DataOrigin = tape[ptr++]; let UserDefinedDataOrigin = tape[ptr++]; let Unit = tape[ptr++]; let TimeStep = tape[ptr++]; let Values = tape[ptr++]; return new IfcRegularTimeSeries(expressID, type, Name, Description, StartTime, EndTime, TimeSeriesDataType, DataOrigin, UserDefinedDataOrigin, Unit, TimeStep, Values); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.StartTime); args.push(this.EndTime); args.push(this.TimeSeriesDataType); args.push(this.DataOrigin); args.push(this.UserDefinedDataOrigin); args.push(this.Unit); args.push(this.TimeStep); args.push(this.Values); return args; } }; var IfcReinforcementBarProperties = class { constructor(expressID, type, TotalCrossSectionArea, SteelGrade, BarSurface, EffectiveDepth, NominalBarDiameter, BarCount) { this.expressID = expressID; this.type = type; this.TotalCrossSectionArea = TotalCrossSectionArea; this.SteelGrade = SteelGrade; this.BarSurface = BarSurface; this.EffectiveDepth = EffectiveDepth; this.NominalBarDiameter = NominalBarDiameter; this.BarCount = BarCount; } static FromTape(expressID, type, tape) { let ptr = 0; let TotalCrossSectionArea = tape[ptr++]; let SteelGrade = tape[ptr++]; let BarSurface = tape[ptr++]; let EffectiveDepth = tape[ptr++]; let NominalBarDiameter = tape[ptr++]; let BarCount = tape[ptr++]; return new IfcReinforcementBarProperties(expressID, type, TotalCrossSectionArea, SteelGrade, BarSurface, EffectiveDepth, NominalBarDiameter, BarCount); } ToTape() { let args = []; args.push(this.TotalCrossSectionArea); args.push(this.SteelGrade); args.push(this.BarSurface); args.push(this.EffectiveDepth); args.push(this.NominalBarDiameter); args.push(this.BarCount); return args; } }; var IfcReinforcementDefinitionProperties = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, DefinitionType, ReinforcementSectionDefinitions) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.DefinitionType = DefinitionType; this.ReinforcementSectionDefinitions = ReinforcementSectionDefinitions; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let DefinitionType = tape[ptr++]; let ReinforcementSectionDefinitions = tape[ptr++]; return new IfcReinforcementDefinitionProperties(expressID, type, GlobalId, OwnerHistory, Name, Description, DefinitionType, ReinforcementSectionDefinitions); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.DefinitionType); args.push(this.ReinforcementSectionDefinitions); return args; } }; var IfcReinforcingBar = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, SteelGrade, NominalDiameter, CrossSectionArea, BarLength, PredefinedType, BarSurface) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.SteelGrade = SteelGrade; this.NominalDiameter = NominalDiameter; this.CrossSectionArea = CrossSectionArea; this.BarLength = BarLength; this.PredefinedType = PredefinedType; this.BarSurface = BarSurface; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let SteelGrade = tape[ptr++]; let NominalDiameter = tape[ptr++]; let CrossSectionArea = tape[ptr++]; let BarLength = tape[ptr++]; let PredefinedType = tape[ptr++]; let BarSurface = tape[ptr++]; return new IfcReinforcingBar(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, SteelGrade, NominalDiameter, CrossSectionArea, BarLength, PredefinedType, BarSurface); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.SteelGrade); args.push(this.NominalDiameter); args.push(this.CrossSectionArea); args.push(this.BarLength); args.push(this.PredefinedType); args.push(this.BarSurface); return args; } }; var IfcReinforcingBarType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, NominalDiameter, CrossSectionArea, BarLength, BarSurface, BendingShapeCode, BendingParameters) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; this.NominalDiameter = NominalDiameter; this.CrossSectionArea = CrossSectionArea; this.BarLength = BarLength; this.BarSurface = BarSurface; this.BendingShapeCode = BendingShapeCode; this.BendingParameters = BendingParameters; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; let NominalDiameter = tape[ptr++]; let CrossSectionArea = tape[ptr++]; let BarLength = tape[ptr++]; let BarSurface = tape[ptr++]; let BendingShapeCode = tape[ptr++]; let BendingParameters = tape[ptr++]; return new IfcReinforcingBarType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, NominalDiameter, CrossSectionArea, BarLength, BarSurface, BendingShapeCode, BendingParameters); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); args.push(this.NominalDiameter); args.push(this.CrossSectionArea); args.push(this.BarLength); args.push(this.BarSurface); args.push(this.BendingShapeCode); args.push(this.BendingParameters); return args; } }; var IfcReinforcingElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, SteelGrade) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.SteelGrade = SteelGrade; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let SteelGrade = tape[ptr++]; return new IfcReinforcingElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, SteelGrade); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.SteelGrade); return args; } }; var IfcReinforcingElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcReinforcingElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcReinforcingMesh = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, SteelGrade, MeshLength, MeshWidth, LongitudinalBarNominalDiameter, TransverseBarNominalDiameter, LongitudinalBarCrossSectionArea, TransverseBarCrossSectionArea, LongitudinalBarSpacing, TransverseBarSpacing, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.SteelGrade = SteelGrade; this.MeshLength = MeshLength; this.MeshWidth = MeshWidth; this.LongitudinalBarNominalDiameter = LongitudinalBarNominalDiameter; this.TransverseBarNominalDiameter = TransverseBarNominalDiameter; this.LongitudinalBarCrossSectionArea = LongitudinalBarCrossSectionArea; this.TransverseBarCrossSectionArea = TransverseBarCrossSectionArea; this.LongitudinalBarSpacing = LongitudinalBarSpacing; this.TransverseBarSpacing = TransverseBarSpacing; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let SteelGrade = tape[ptr++]; let MeshLength = tape[ptr++]; let MeshWidth = tape[ptr++]; let LongitudinalBarNominalDiameter = tape[ptr++]; let TransverseBarNominalDiameter = tape[ptr++]; let LongitudinalBarCrossSectionArea = tape[ptr++]; let TransverseBarCrossSectionArea = tape[ptr++]; let LongitudinalBarSpacing = tape[ptr++]; let TransverseBarSpacing = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcReinforcingMesh(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, SteelGrade, MeshLength, MeshWidth, LongitudinalBarNominalDiameter, TransverseBarNominalDiameter, LongitudinalBarCrossSectionArea, TransverseBarCrossSectionArea, LongitudinalBarSpacing, TransverseBarSpacing, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.SteelGrade); args.push(this.MeshLength); args.push(this.MeshWidth); args.push(this.LongitudinalBarNominalDiameter); args.push(this.TransverseBarNominalDiameter); args.push(this.LongitudinalBarCrossSectionArea); args.push(this.TransverseBarCrossSectionArea); args.push(this.LongitudinalBarSpacing); args.push(this.TransverseBarSpacing); args.push(this.PredefinedType); return args; } }; var IfcReinforcingMeshType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, MeshLength, MeshWidth, LongitudinalBarNominalDiameter, TransverseBarNominalDiameter, LongitudinalBarCrossSectionArea, TransverseBarCrossSectionArea, LongitudinalBarSpacing, TransverseBarSpacing, BendingShapeCode, BendingParameters) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; this.MeshLength = MeshLength; this.MeshWidth = MeshWidth; this.LongitudinalBarNominalDiameter = LongitudinalBarNominalDiameter; this.TransverseBarNominalDiameter = TransverseBarNominalDiameter; this.LongitudinalBarCrossSectionArea = LongitudinalBarCrossSectionArea; this.TransverseBarCrossSectionArea = TransverseBarCrossSectionArea; this.LongitudinalBarSpacing = LongitudinalBarSpacing; this.TransverseBarSpacing = TransverseBarSpacing; this.BendingShapeCode = BendingShapeCode; this.BendingParameters = BendingParameters; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; let MeshLength = tape[ptr++]; let MeshWidth = tape[ptr++]; let LongitudinalBarNominalDiameter = tape[ptr++]; let TransverseBarNominalDiameter = tape[ptr++]; let LongitudinalBarCrossSectionArea = tape[ptr++]; let TransverseBarCrossSectionArea = tape[ptr++]; let LongitudinalBarSpacing = tape[ptr++]; let TransverseBarSpacing = tape[ptr++]; let BendingShapeCode = tape[ptr++]; let BendingParameters = tape[ptr++]; return new IfcReinforcingMeshType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, MeshLength, MeshWidth, LongitudinalBarNominalDiameter, TransverseBarNominalDiameter, LongitudinalBarCrossSectionArea, TransverseBarCrossSectionArea, LongitudinalBarSpacing, TransverseBarSpacing, BendingShapeCode, BendingParameters); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); args.push(this.MeshLength); args.push(this.MeshWidth); args.push(this.LongitudinalBarNominalDiameter); args.push(this.TransverseBarNominalDiameter); args.push(this.LongitudinalBarCrossSectionArea); args.push(this.TransverseBarCrossSectionArea); args.push(this.LongitudinalBarSpacing); args.push(this.TransverseBarSpacing); args.push(this.BendingShapeCode); args.push(this.BendingParameters); return args; } }; var IfcRelAggregates = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingObject, RelatedObjects) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingObject = RelatingObject; this.RelatedObjects = RelatedObjects; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingObject = tape[ptr++]; let RelatedObjects = tape[ptr++]; return new IfcRelAggregates(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingObject, RelatedObjects); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingObject); args.push(this.RelatedObjects); return args; } }; var IfcRelAssigns = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatedObjectsType = RelatedObjectsType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatedObjectsType = tape[ptr++]; return new IfcRelAssigns(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatedObjectsType); return args; } }; var IfcRelAssignsToActor = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType, RelatingActor, ActingRole) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatedObjectsType = RelatedObjectsType; this.RelatingActor = RelatingActor; this.ActingRole = ActingRole; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatedObjectsType = tape[ptr++]; let RelatingActor = tape[ptr++]; let ActingRole = tape[ptr++]; return new IfcRelAssignsToActor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType, RelatingActor, ActingRole); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatedObjectsType); args.push(this.RelatingActor); args.push(this.ActingRole); return args; } }; var IfcRelAssignsToControl = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType, RelatingControl) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatedObjectsType = RelatedObjectsType; this.RelatingControl = RelatingControl; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatedObjectsType = tape[ptr++]; let RelatingControl = tape[ptr++]; return new IfcRelAssignsToControl(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType, RelatingControl); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatedObjectsType); args.push(this.RelatingControl); return args; } }; var IfcRelAssignsToGroup = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType, RelatingGroup) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatedObjectsType = RelatedObjectsType; this.RelatingGroup = RelatingGroup; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatedObjectsType = tape[ptr++]; let RelatingGroup = tape[ptr++]; return new IfcRelAssignsToGroup(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType, RelatingGroup); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatedObjectsType); args.push(this.RelatingGroup); return args; } }; var IfcRelAssignsToGroupByFactor = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType, RelatingGroup, Factor) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatedObjectsType = RelatedObjectsType; this.RelatingGroup = RelatingGroup; this.Factor = Factor; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatedObjectsType = tape[ptr++]; let RelatingGroup = tape[ptr++]; let Factor = tape[ptr++]; return new IfcRelAssignsToGroupByFactor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType, RelatingGroup, Factor); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatedObjectsType); args.push(this.RelatingGroup); args.push(this.Factor); return args; } }; var IfcRelAssignsToProcess = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType, RelatingProcess, QuantityInProcess) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatedObjectsType = RelatedObjectsType; this.RelatingProcess = RelatingProcess; this.QuantityInProcess = QuantityInProcess; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatedObjectsType = tape[ptr++]; let RelatingProcess = tape[ptr++]; let QuantityInProcess = tape[ptr++]; return new IfcRelAssignsToProcess(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType, RelatingProcess, QuantityInProcess); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatedObjectsType); args.push(this.RelatingProcess); args.push(this.QuantityInProcess); return args; } }; var IfcRelAssignsToProduct = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType, RelatingProduct) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatedObjectsType = RelatedObjectsType; this.RelatingProduct = RelatingProduct; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatedObjectsType = tape[ptr++]; let RelatingProduct = tape[ptr++]; return new IfcRelAssignsToProduct(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType, RelatingProduct); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatedObjectsType); args.push(this.RelatingProduct); return args; } }; var IfcRelAssignsToResource = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType, RelatingResource) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatedObjectsType = RelatedObjectsType; this.RelatingResource = RelatingResource; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatedObjectsType = tape[ptr++]; let RelatingResource = tape[ptr++]; return new IfcRelAssignsToResource(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatedObjectsType, RelatingResource); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatedObjectsType); args.push(this.RelatingResource); return args; } }; var IfcRelAssociates = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; return new IfcRelAssociates(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); return args; } }; var IfcRelAssociatesApproval = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingApproval) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatingApproval = RelatingApproval; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatingApproval = tape[ptr++]; return new IfcRelAssociatesApproval(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingApproval); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatingApproval); return args; } }; var IfcRelAssociatesClassification = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingClassification) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatingClassification = RelatingClassification; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatingClassification = tape[ptr++]; return new IfcRelAssociatesClassification(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingClassification); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatingClassification); return args; } }; var IfcRelAssociatesConstraint = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, Intent, RelatingConstraint) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.Intent = Intent; this.RelatingConstraint = RelatingConstraint; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let Intent = tape[ptr++]; let RelatingConstraint = tape[ptr++]; return new IfcRelAssociatesConstraint(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, Intent, RelatingConstraint); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.Intent); args.push(this.RelatingConstraint); return args; } }; var IfcRelAssociatesDocument = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingDocument) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatingDocument = RelatingDocument; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatingDocument = tape[ptr++]; return new IfcRelAssociatesDocument(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingDocument); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatingDocument); return args; } }; var IfcRelAssociatesLibrary = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingLibrary) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatingLibrary = RelatingLibrary; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatingLibrary = tape[ptr++]; return new IfcRelAssociatesLibrary(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingLibrary); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatingLibrary); return args; } }; var IfcRelAssociatesMaterial = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingMaterial) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatingMaterial = RelatingMaterial; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatingMaterial = tape[ptr++]; return new IfcRelAssociatesMaterial(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingMaterial); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatingMaterial); return args; } }; var IfcRelConnects = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcRelConnects(expressID, type, GlobalId, OwnerHistory, Name, Description); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); return args; } }; var IfcRelConnectsElements = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ConnectionGeometry, RelatingElement, RelatedElement) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ConnectionGeometry = ConnectionGeometry; this.RelatingElement = RelatingElement; this.RelatedElement = RelatedElement; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ConnectionGeometry = tape[ptr++]; let RelatingElement = tape[ptr++]; let RelatedElement = tape[ptr++]; return new IfcRelConnectsElements(expressID, type, GlobalId, OwnerHistory, Name, Description, ConnectionGeometry, RelatingElement, RelatedElement); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ConnectionGeometry); args.push(this.RelatingElement); args.push(this.RelatedElement); return args; } }; var IfcRelConnectsPathElements = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ConnectionGeometry, RelatingElement, RelatedElement, RelatingPriorities, RelatedPriorities, RelatedConnectionType, RelatingConnectionType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ConnectionGeometry = ConnectionGeometry; this.RelatingElement = RelatingElement; this.RelatedElement = RelatedElement; this.RelatingPriorities = RelatingPriorities; this.RelatedPriorities = RelatedPriorities; this.RelatedConnectionType = RelatedConnectionType; this.RelatingConnectionType = RelatingConnectionType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ConnectionGeometry = tape[ptr++]; let RelatingElement = tape[ptr++]; let RelatedElement = tape[ptr++]; let RelatingPriorities = tape[ptr++]; let RelatedPriorities = tape[ptr++]; let RelatedConnectionType = tape[ptr++]; let RelatingConnectionType = tape[ptr++]; return new IfcRelConnectsPathElements(expressID, type, GlobalId, OwnerHistory, Name, Description, ConnectionGeometry, RelatingElement, RelatedElement, RelatingPriorities, RelatedPriorities, RelatedConnectionType, RelatingConnectionType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ConnectionGeometry); args.push(this.RelatingElement); args.push(this.RelatedElement); args.push(this.RelatingPriorities); args.push(this.RelatedPriorities); args.push(this.RelatedConnectionType); args.push(this.RelatingConnectionType); return args; } }; var IfcRelConnectsPortToElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingPort, RelatedElement) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingPort = RelatingPort; this.RelatedElement = RelatedElement; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingPort = tape[ptr++]; let RelatedElement = tape[ptr++]; return new IfcRelConnectsPortToElement(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingPort, RelatedElement); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingPort); args.push(this.RelatedElement); return args; } }; var IfcRelConnectsPorts = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingPort, RelatedPort, RealizingElement) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingPort = RelatingPort; this.RelatedPort = RelatedPort; this.RealizingElement = RealizingElement; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingPort = tape[ptr++]; let RelatedPort = tape[ptr++]; let RealizingElement = tape[ptr++]; return new IfcRelConnectsPorts(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingPort, RelatedPort, RealizingElement); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingPort); args.push(this.RelatedPort); args.push(this.RealizingElement); return args; } }; var IfcRelConnectsStructuralActivity = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingElement, RelatedStructuralActivity) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingElement = RelatingElement; this.RelatedStructuralActivity = RelatedStructuralActivity; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingElement = tape[ptr++]; let RelatedStructuralActivity = tape[ptr++]; return new IfcRelConnectsStructuralActivity(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingElement, RelatedStructuralActivity); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingElement); args.push(this.RelatedStructuralActivity); return args; } }; var IfcRelConnectsStructuralMember = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingStructuralMember, RelatedStructuralConnection, AppliedCondition, AdditionalConditions, SupportedLength, ConditionCoordinateSystem) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingStructuralMember = RelatingStructuralMember; this.RelatedStructuralConnection = RelatedStructuralConnection; this.AppliedCondition = AppliedCondition; this.AdditionalConditions = AdditionalConditions; this.SupportedLength = SupportedLength; this.ConditionCoordinateSystem = ConditionCoordinateSystem; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingStructuralMember = tape[ptr++]; let RelatedStructuralConnection = tape[ptr++]; let AppliedCondition = tape[ptr++]; let AdditionalConditions = tape[ptr++]; let SupportedLength = tape[ptr++]; let ConditionCoordinateSystem = tape[ptr++]; return new IfcRelConnectsStructuralMember(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingStructuralMember, RelatedStructuralConnection, AppliedCondition, AdditionalConditions, SupportedLength, ConditionCoordinateSystem); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingStructuralMember); args.push(this.RelatedStructuralConnection); args.push(this.AppliedCondition); args.push(this.AdditionalConditions); args.push(this.SupportedLength); args.push(this.ConditionCoordinateSystem); return args; } }; var IfcRelConnectsWithEccentricity = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingStructuralMember, RelatedStructuralConnection, AppliedCondition, AdditionalConditions, SupportedLength, ConditionCoordinateSystem, ConnectionConstraint) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingStructuralMember = RelatingStructuralMember; this.RelatedStructuralConnection = RelatedStructuralConnection; this.AppliedCondition = AppliedCondition; this.AdditionalConditions = AdditionalConditions; this.SupportedLength = SupportedLength; this.ConditionCoordinateSystem = ConditionCoordinateSystem; this.ConnectionConstraint = ConnectionConstraint; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingStructuralMember = tape[ptr++]; let RelatedStructuralConnection = tape[ptr++]; let AppliedCondition = tape[ptr++]; let AdditionalConditions = tape[ptr++]; let SupportedLength = tape[ptr++]; let ConditionCoordinateSystem = tape[ptr++]; let ConnectionConstraint = tape[ptr++]; return new IfcRelConnectsWithEccentricity(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingStructuralMember, RelatedStructuralConnection, AppliedCondition, AdditionalConditions, SupportedLength, ConditionCoordinateSystem, ConnectionConstraint); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingStructuralMember); args.push(this.RelatedStructuralConnection); args.push(this.AppliedCondition); args.push(this.AdditionalConditions); args.push(this.SupportedLength); args.push(this.ConditionCoordinateSystem); args.push(this.ConnectionConstraint); return args; } }; var IfcRelConnectsWithRealizingElements = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ConnectionGeometry, RelatingElement, RelatedElement, RealizingElements, ConnectionType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ConnectionGeometry = ConnectionGeometry; this.RelatingElement = RelatingElement; this.RelatedElement = RelatedElement; this.RealizingElements = RealizingElements; this.ConnectionType = ConnectionType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ConnectionGeometry = tape[ptr++]; let RelatingElement = tape[ptr++]; let RelatedElement = tape[ptr++]; let RealizingElements = tape[ptr++]; let ConnectionType = tape[ptr++]; return new IfcRelConnectsWithRealizingElements(expressID, type, GlobalId, OwnerHistory, Name, Description, ConnectionGeometry, RelatingElement, RelatedElement, RealizingElements, ConnectionType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ConnectionGeometry); args.push(this.RelatingElement); args.push(this.RelatedElement); args.push(this.RealizingElements); args.push(this.ConnectionType); return args; } }; var IfcRelContainedInSpatialStructure = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedElements, RelatingStructure) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedElements = RelatedElements; this.RelatingStructure = RelatingStructure; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedElements = tape[ptr++]; let RelatingStructure = tape[ptr++]; return new IfcRelContainedInSpatialStructure(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedElements, RelatingStructure); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedElements); args.push(this.RelatingStructure); return args; } }; var IfcRelCoversBldgElements = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingBuildingElement, RelatedCoverings) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingBuildingElement = RelatingBuildingElement; this.RelatedCoverings = RelatedCoverings; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingBuildingElement = tape[ptr++]; let RelatedCoverings = tape[ptr++]; return new IfcRelCoversBldgElements(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingBuildingElement, RelatedCoverings); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingBuildingElement); args.push(this.RelatedCoverings); return args; } }; var IfcRelCoversSpaces = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingSpace, RelatedCoverings) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingSpace = RelatingSpace; this.RelatedCoverings = RelatedCoverings; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingSpace = tape[ptr++]; let RelatedCoverings = tape[ptr++]; return new IfcRelCoversSpaces(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingSpace, RelatedCoverings); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingSpace); args.push(this.RelatedCoverings); return args; } }; var IfcRelDeclares = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingContext, RelatedDefinitions) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingContext = RelatingContext; this.RelatedDefinitions = RelatedDefinitions; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingContext = tape[ptr++]; let RelatedDefinitions = tape[ptr++]; return new IfcRelDeclares(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingContext, RelatedDefinitions); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingContext); args.push(this.RelatedDefinitions); return args; } }; var IfcRelDecomposes = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcRelDecomposes(expressID, type, GlobalId, OwnerHistory, Name, Description); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); return args; } }; var IfcRelDefines = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcRelDefines(expressID, type, GlobalId, OwnerHistory, Name, Description); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); return args; } }; var IfcRelDefinesByObject = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingObject) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatingObject = RelatingObject; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatingObject = tape[ptr++]; return new IfcRelDefinesByObject(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingObject); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatingObject); return args; } }; var IfcRelDefinesByProperties = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingPropertyDefinition) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatingPropertyDefinition = RelatingPropertyDefinition; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatingPropertyDefinition = tape[ptr++]; return new IfcRelDefinesByProperties(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingPropertyDefinition); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatingPropertyDefinition); return args; } }; var IfcRelDefinesByTemplate = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedPropertySets, RelatingTemplate) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedPropertySets = RelatedPropertySets; this.RelatingTemplate = RelatingTemplate; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedPropertySets = tape[ptr++]; let RelatingTemplate = tape[ptr++]; return new IfcRelDefinesByTemplate(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedPropertySets, RelatingTemplate); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedPropertySets); args.push(this.RelatingTemplate); return args; } }; var IfcRelDefinesByType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedObjects = RelatedObjects; this.RelatingType = RelatingType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedObjects = tape[ptr++]; let RelatingType = tape[ptr++]; return new IfcRelDefinesByType(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedObjects, RelatingType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedObjects); args.push(this.RelatingType); return args; } }; var IfcRelFillsElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingOpeningElement, RelatedBuildingElement) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingOpeningElement = RelatingOpeningElement; this.RelatedBuildingElement = RelatedBuildingElement; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingOpeningElement = tape[ptr++]; let RelatedBuildingElement = tape[ptr++]; return new IfcRelFillsElement(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingOpeningElement, RelatedBuildingElement); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingOpeningElement); args.push(this.RelatedBuildingElement); return args; } }; var IfcRelFlowControlElements = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedControlElements, RelatingFlowElement) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedControlElements = RelatedControlElements; this.RelatingFlowElement = RelatingFlowElement; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedControlElements = tape[ptr++]; let RelatingFlowElement = tape[ptr++]; return new IfcRelFlowControlElements(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedControlElements, RelatingFlowElement); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedControlElements); args.push(this.RelatingFlowElement); return args; } }; var IfcRelInterferesElements = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingElement, RelatedElement, InterferenceGeometry, InterferenceType, ImpliedOrder) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingElement = RelatingElement; this.RelatedElement = RelatedElement; this.InterferenceGeometry = InterferenceGeometry; this.InterferenceType = InterferenceType; this.ImpliedOrder = ImpliedOrder; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingElement = tape[ptr++]; let RelatedElement = tape[ptr++]; let InterferenceGeometry = tape[ptr++]; let InterferenceType = tape[ptr++]; let ImpliedOrder = tape[ptr++]; return new IfcRelInterferesElements(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingElement, RelatedElement, InterferenceGeometry, InterferenceType, ImpliedOrder); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingElement); args.push(this.RelatedElement); args.push(this.InterferenceGeometry); args.push(this.InterferenceType); args.push(this.ImpliedOrder); return args; } }; var IfcRelNests = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingObject, RelatedObjects) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingObject = RelatingObject; this.RelatedObjects = RelatedObjects; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingObject = tape[ptr++]; let RelatedObjects = tape[ptr++]; return new IfcRelNests(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingObject, RelatedObjects); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingObject); args.push(this.RelatedObjects); return args; } }; var IfcRelPositions = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingPositioningElement, RelatedProducts) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingPositioningElement = RelatingPositioningElement; this.RelatedProducts = RelatedProducts; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingPositioningElement = tape[ptr++]; let RelatedProducts = tape[ptr++]; return new IfcRelPositions(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingPositioningElement, RelatedProducts); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingPositioningElement); args.push(this.RelatedProducts); return args; } }; var IfcRelProjectsElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingElement, RelatedFeatureElement) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingElement = RelatingElement; this.RelatedFeatureElement = RelatedFeatureElement; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingElement = tape[ptr++]; let RelatedFeatureElement = tape[ptr++]; return new IfcRelProjectsElement(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingElement, RelatedFeatureElement); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingElement); args.push(this.RelatedFeatureElement); return args; } }; var IfcRelReferencedInSpatialStructure = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedElements, RelatingStructure) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatedElements = RelatedElements; this.RelatingStructure = RelatingStructure; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedElements = tape[ptr++]; let RelatingStructure = tape[ptr++]; return new IfcRelReferencedInSpatialStructure(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatedElements, RelatingStructure); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatedElements); args.push(this.RelatingStructure); return args; } }; var IfcRelSequence = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingProcess, RelatedProcess, TimeLag, SequenceType, UserDefinedSequenceType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingProcess = RelatingProcess; this.RelatedProcess = RelatedProcess; this.TimeLag = TimeLag; this.SequenceType = SequenceType; this.UserDefinedSequenceType = UserDefinedSequenceType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingProcess = tape[ptr++]; let RelatedProcess = tape[ptr++]; let TimeLag = tape[ptr++]; let SequenceType = tape[ptr++]; let UserDefinedSequenceType = tape[ptr++]; return new IfcRelSequence(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingProcess, RelatedProcess, TimeLag, SequenceType, UserDefinedSequenceType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingProcess); args.push(this.RelatedProcess); args.push(this.TimeLag); args.push(this.SequenceType); args.push(this.UserDefinedSequenceType); return args; } }; var IfcRelServicesBuildings = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingSystem, RelatedBuildings) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingSystem = RelatingSystem; this.RelatedBuildings = RelatedBuildings; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingSystem = tape[ptr++]; let RelatedBuildings = tape[ptr++]; return new IfcRelServicesBuildings(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingSystem, RelatedBuildings); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingSystem); args.push(this.RelatedBuildings); return args; } }; var IfcRelSpaceBoundary = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingSpace, RelatedBuildingElement, ConnectionGeometry, PhysicalOrVirtualBoundary, InternalOrExternalBoundary) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingSpace = RelatingSpace; this.RelatedBuildingElement = RelatedBuildingElement; this.ConnectionGeometry = ConnectionGeometry; this.PhysicalOrVirtualBoundary = PhysicalOrVirtualBoundary; this.InternalOrExternalBoundary = InternalOrExternalBoundary; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingSpace = tape[ptr++]; let RelatedBuildingElement = tape[ptr++]; let ConnectionGeometry = tape[ptr++]; let PhysicalOrVirtualBoundary = tape[ptr++]; let InternalOrExternalBoundary = tape[ptr++]; return new IfcRelSpaceBoundary(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingSpace, RelatedBuildingElement, ConnectionGeometry, PhysicalOrVirtualBoundary, InternalOrExternalBoundary); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingSpace); args.push(this.RelatedBuildingElement); args.push(this.ConnectionGeometry); args.push(this.PhysicalOrVirtualBoundary); args.push(this.InternalOrExternalBoundary); return args; } }; var IfcRelSpaceBoundary1stLevel = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingSpace, RelatedBuildingElement, ConnectionGeometry, PhysicalOrVirtualBoundary, InternalOrExternalBoundary, ParentBoundary) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingSpace = RelatingSpace; this.RelatedBuildingElement = RelatedBuildingElement; this.ConnectionGeometry = ConnectionGeometry; this.PhysicalOrVirtualBoundary = PhysicalOrVirtualBoundary; this.InternalOrExternalBoundary = InternalOrExternalBoundary; this.ParentBoundary = ParentBoundary; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingSpace = tape[ptr++]; let RelatedBuildingElement = tape[ptr++]; let ConnectionGeometry = tape[ptr++]; let PhysicalOrVirtualBoundary = tape[ptr++]; let InternalOrExternalBoundary = tape[ptr++]; let ParentBoundary = tape[ptr++]; return new IfcRelSpaceBoundary1stLevel(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingSpace, RelatedBuildingElement, ConnectionGeometry, PhysicalOrVirtualBoundary, InternalOrExternalBoundary, ParentBoundary); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingSpace); args.push(this.RelatedBuildingElement); args.push(this.ConnectionGeometry); args.push(this.PhysicalOrVirtualBoundary); args.push(this.InternalOrExternalBoundary); args.push(this.ParentBoundary); return args; } }; var IfcRelSpaceBoundary2ndLevel = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingSpace, RelatedBuildingElement, ConnectionGeometry, PhysicalOrVirtualBoundary, InternalOrExternalBoundary, ParentBoundary, CorrespondingBoundary) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingSpace = RelatingSpace; this.RelatedBuildingElement = RelatedBuildingElement; this.ConnectionGeometry = ConnectionGeometry; this.PhysicalOrVirtualBoundary = PhysicalOrVirtualBoundary; this.InternalOrExternalBoundary = InternalOrExternalBoundary; this.ParentBoundary = ParentBoundary; this.CorrespondingBoundary = CorrespondingBoundary; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingSpace = tape[ptr++]; let RelatedBuildingElement = tape[ptr++]; let ConnectionGeometry = tape[ptr++]; let PhysicalOrVirtualBoundary = tape[ptr++]; let InternalOrExternalBoundary = tape[ptr++]; let ParentBoundary = tape[ptr++]; let CorrespondingBoundary = tape[ptr++]; return new IfcRelSpaceBoundary2ndLevel(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingSpace, RelatedBuildingElement, ConnectionGeometry, PhysicalOrVirtualBoundary, InternalOrExternalBoundary, ParentBoundary, CorrespondingBoundary); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingSpace); args.push(this.RelatedBuildingElement); args.push(this.ConnectionGeometry); args.push(this.PhysicalOrVirtualBoundary); args.push(this.InternalOrExternalBoundary); args.push(this.ParentBoundary); args.push(this.CorrespondingBoundary); return args; } }; var IfcRelVoidsElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingBuildingElement, RelatedOpeningElement) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.RelatingBuildingElement = RelatingBuildingElement; this.RelatedOpeningElement = RelatedOpeningElement; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingBuildingElement = tape[ptr++]; let RelatedOpeningElement = tape[ptr++]; return new IfcRelVoidsElement(expressID, type, GlobalId, OwnerHistory, Name, Description, RelatingBuildingElement, RelatedOpeningElement); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.RelatingBuildingElement); args.push(this.RelatedOpeningElement); return args; } }; var IfcRelationship = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcRelationship(expressID, type, GlobalId, OwnerHistory, Name, Description); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); return args; } }; var IfcReparametrisedCompositeCurveSegment = class { constructor(expressID, type, Transition, SameSense, ParentCurve, ParamLength) { this.expressID = expressID; this.type = type; this.Transition = Transition; this.SameSense = SameSense; this.ParentCurve = ParentCurve; this.ParamLength = ParamLength; } static FromTape(expressID, type, tape) { let ptr = 0; let Transition = tape[ptr++]; let SameSense = tape[ptr++]; let ParentCurve = tape[ptr++]; let ParamLength = tape[ptr++]; return new IfcReparametrisedCompositeCurveSegment(expressID, type, Transition, SameSense, ParentCurve, ParamLength); } ToTape() { let args = []; args.push(this.Transition); args.push(this.SameSense); args.push(this.ParentCurve); args.push(this.ParamLength); return args; } }; var IfcRepresentation = class { constructor(expressID, type, ContextOfItems, RepresentationIdentifier, RepresentationType, Items) { this.expressID = expressID; this.type = type; this.ContextOfItems = ContextOfItems; this.RepresentationIdentifier = RepresentationIdentifier; this.RepresentationType = RepresentationType; this.Items = Items; } static FromTape(expressID, type, tape) { let ptr = 0; let ContextOfItems = tape[ptr++]; let RepresentationIdentifier = tape[ptr++]; let RepresentationType = tape[ptr++]; let Items = tape[ptr++]; return new IfcRepresentation(expressID, type, ContextOfItems, RepresentationIdentifier, RepresentationType, Items); } ToTape() { let args = []; args.push(this.ContextOfItems); args.push(this.RepresentationIdentifier); args.push(this.RepresentationType); args.push(this.Items); return args; } }; var IfcRepresentationContext = class { constructor(expressID, type, ContextIdentifier, ContextType) { this.expressID = expressID; this.type = type; this.ContextIdentifier = ContextIdentifier; this.ContextType = ContextType; } static FromTape(expressID, type, tape) { let ptr = 0; let ContextIdentifier = tape[ptr++]; let ContextType = tape[ptr++]; return new IfcRepresentationContext(expressID, type, ContextIdentifier, ContextType); } ToTape() { let args = []; args.push(this.ContextIdentifier); args.push(this.ContextType); return args; } }; var IfcRepresentationItem = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcRepresentationItem(expressID, type); } ToTape() { let args = []; return args; } }; var IfcRepresentationMap = class { constructor(expressID, type, MappingOrigin, MappedRepresentation) { this.expressID = expressID; this.type = type; this.MappingOrigin = MappingOrigin; this.MappedRepresentation = MappedRepresentation; } static FromTape(expressID, type, tape) { let ptr = 0; let MappingOrigin = tape[ptr++]; let MappedRepresentation = tape[ptr++]; return new IfcRepresentationMap(expressID, type, MappingOrigin, MappedRepresentation); } ToTape() { let args = []; args.push(this.MappingOrigin); args.push(this.MappedRepresentation); return args; } }; var IfcResource = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.LongDescription = LongDescription; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; return new IfcResource(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.LongDescription); return args; } }; var IfcResourceApprovalRelationship = class { constructor(expressID, type, Name, Description, RelatedResourceObjects, RelatingApproval) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.RelatedResourceObjects = RelatedResourceObjects; this.RelatingApproval = RelatingApproval; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatedResourceObjects = tape[ptr++]; let RelatingApproval = tape[ptr++]; return new IfcResourceApprovalRelationship(expressID, type, Name, Description, RelatedResourceObjects, RelatingApproval); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.RelatedResourceObjects); args.push(this.RelatingApproval); return args; } }; var IfcResourceConstraintRelationship = class { constructor(expressID, type, Name, Description, RelatingConstraint, RelatedResourceObjects) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.RelatingConstraint = RelatingConstraint; this.RelatedResourceObjects = RelatedResourceObjects; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let RelatingConstraint = tape[ptr++]; let RelatedResourceObjects = tape[ptr++]; return new IfcResourceConstraintRelationship(expressID, type, Name, Description, RelatingConstraint, RelatedResourceObjects); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.RelatingConstraint); args.push(this.RelatedResourceObjects); return args; } }; var IfcResourceLevelRelationship = class { constructor(expressID, type, Name, Description) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcResourceLevelRelationship(expressID, type, Name, Description); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); return args; } }; var IfcResourceTime = class { constructor(expressID, type, Name, DataOrigin, UserDefinedDataOrigin, ScheduleWork, ScheduleUsage, ScheduleStart, ScheduleFinish, ScheduleContour, LevelingDelay, IsOverAllocated, StatusTime, ActualWork, ActualUsage, ActualStart, ActualFinish, RemainingWork, RemainingUsage, Completion) { this.expressID = expressID; this.type = type; this.Name = Name; this.DataOrigin = DataOrigin; this.UserDefinedDataOrigin = UserDefinedDataOrigin; this.ScheduleWork = ScheduleWork; this.ScheduleUsage = ScheduleUsage; this.ScheduleStart = ScheduleStart; this.ScheduleFinish = ScheduleFinish; this.ScheduleContour = ScheduleContour; this.LevelingDelay = LevelingDelay; this.IsOverAllocated = IsOverAllocated; this.StatusTime = StatusTime; this.ActualWork = ActualWork; this.ActualUsage = ActualUsage; this.ActualStart = ActualStart; this.ActualFinish = ActualFinish; this.RemainingWork = RemainingWork; this.RemainingUsage = RemainingUsage; this.Completion = Completion; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let DataOrigin = tape[ptr++]; let UserDefinedDataOrigin = tape[ptr++]; let ScheduleWork = tape[ptr++]; let ScheduleUsage = tape[ptr++]; let ScheduleStart = tape[ptr++]; let ScheduleFinish = tape[ptr++]; let ScheduleContour = tape[ptr++]; let LevelingDelay = tape[ptr++]; let IsOverAllocated = tape[ptr++]; let StatusTime = tape[ptr++]; let ActualWork = tape[ptr++]; let ActualUsage = tape[ptr++]; let ActualStart = tape[ptr++]; let ActualFinish = tape[ptr++]; let RemainingWork = tape[ptr++]; let RemainingUsage = tape[ptr++]; let Completion = tape[ptr++]; return new IfcResourceTime(expressID, type, Name, DataOrigin, UserDefinedDataOrigin, ScheduleWork, ScheduleUsage, ScheduleStart, ScheduleFinish, ScheduleContour, LevelingDelay, IsOverAllocated, StatusTime, ActualWork, ActualUsage, ActualStart, ActualFinish, RemainingWork, RemainingUsage, Completion); } ToTape() { let args = []; args.push(this.Name); args.push(this.DataOrigin); args.push(this.UserDefinedDataOrigin); args.push(this.ScheduleWork); args.push(this.ScheduleUsage); args.push(this.ScheduleStart); args.push(this.ScheduleFinish); args.push(this.ScheduleContour); args.push(this.LevelingDelay); args.push(this.IsOverAllocated); args.push(this.StatusTime); args.push(this.ActualWork); args.push(this.ActualUsage); args.push(this.ActualStart); args.push(this.ActualFinish); args.push(this.RemainingWork); args.push(this.RemainingUsage); args.push(this.Completion); return args; } }; var IfcRevolvedAreaSolid = class { constructor(expressID, type, SweptArea, Position, Axis, Angle) { this.expressID = expressID; this.type = type; this.SweptArea = SweptArea; this.Position = Position; this.Axis = Axis; this.Angle = Angle; } static FromTape(expressID, type, tape) { let ptr = 0; let SweptArea = tape[ptr++]; let Position = tape[ptr++]; let Axis = tape[ptr++]; let Angle = tape[ptr++]; return new IfcRevolvedAreaSolid(expressID, type, SweptArea, Position, Axis, Angle); } ToTape() { let args = []; args.push(this.SweptArea); args.push(this.Position); args.push(this.Axis); args.push(this.Angle); return args; } }; var IfcRevolvedAreaSolidTapered = class { constructor(expressID, type, SweptArea, Position, Axis, Angle, EndSweptArea) { this.expressID = expressID; this.type = type; this.SweptArea = SweptArea; this.Position = Position; this.Axis = Axis; this.Angle = Angle; this.EndSweptArea = EndSweptArea; } static FromTape(expressID, type, tape) { let ptr = 0; let SweptArea = tape[ptr++]; let Position = tape[ptr++]; let Axis = tape[ptr++]; let Angle = tape[ptr++]; let EndSweptArea = tape[ptr++]; return new IfcRevolvedAreaSolidTapered(expressID, type, SweptArea, Position, Axis, Angle, EndSweptArea); } ToTape() { let args = []; args.push(this.SweptArea); args.push(this.Position); args.push(this.Axis); args.push(this.Angle); args.push(this.EndSweptArea); return args; } }; var IfcRightCircularCone = class { constructor(expressID, type, Position, Height, BottomRadius) { this.expressID = expressID; this.type = type; this.Position = Position; this.Height = Height; this.BottomRadius = BottomRadius; } static FromTape(expressID, type, tape) { let ptr = 0; let Position = tape[ptr++]; let Height = tape[ptr++]; let BottomRadius = tape[ptr++]; return new IfcRightCircularCone(expressID, type, Position, Height, BottomRadius); } ToTape() { let args = []; args.push(this.Position); args.push(this.Height); args.push(this.BottomRadius); return args; } }; var IfcRightCircularCylinder = class { constructor(expressID, type, Position, Height, Radius) { this.expressID = expressID; this.type = type; this.Position = Position; this.Height = Height; this.Radius = Radius; } static FromTape(expressID, type, tape) { let ptr = 0; let Position = tape[ptr++]; let Height = tape[ptr++]; let Radius = tape[ptr++]; return new IfcRightCircularCylinder(expressID, type, Position, Height, Radius); } ToTape() { let args = []; args.push(this.Position); args.push(this.Height); args.push(this.Radius); return args; } }; var IfcRoof = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcRoof(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcRoofType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcRoofType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcRoot = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcRoot(expressID, type, GlobalId, OwnerHistory, Name, Description); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); return args; } }; var IfcRoundedRectangleProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position, XDim, YDim, RoundingRadius) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; this.XDim = XDim; this.YDim = YDim; this.RoundingRadius = RoundingRadius; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; let XDim = tape[ptr++]; let YDim = tape[ptr++]; let RoundingRadius = tape[ptr++]; return new IfcRoundedRectangleProfileDef(expressID, type, ProfileType, ProfileName, Position, XDim, YDim, RoundingRadius); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); args.push(this.XDim); args.push(this.YDim); args.push(this.RoundingRadius); return args; } }; var IfcSIUnit = class { constructor(expressID, type, Dimensions, UnitType, Prefix, Name) { this.expressID = expressID; this.type = type; this.Dimensions = Dimensions; this.UnitType = UnitType; this.Prefix = Prefix; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Dimensions = tape[ptr++]; let UnitType = tape[ptr++]; let Prefix = tape[ptr++]; let Name = tape[ptr++]; return new IfcSIUnit(expressID, type, Dimensions, UnitType, Prefix, Name); } ToTape() { let args = []; args.push(this.Dimensions); args.push(this.UnitType); args.push(this.Prefix); args.push(this.Name); return args; } }; var IfcSanitaryTerminal = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSanitaryTerminal(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcSanitaryTerminalType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSanitaryTerminalType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcSchedulingTime = class { constructor(expressID, type, Name, DataOrigin, UserDefinedDataOrigin) { this.expressID = expressID; this.type = type; this.Name = Name; this.DataOrigin = DataOrigin; this.UserDefinedDataOrigin = UserDefinedDataOrigin; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let DataOrigin = tape[ptr++]; let UserDefinedDataOrigin = tape[ptr++]; return new IfcSchedulingTime(expressID, type, Name, DataOrigin, UserDefinedDataOrigin); } ToTape() { let args = []; args.push(this.Name); args.push(this.DataOrigin); args.push(this.UserDefinedDataOrigin); return args; } }; var IfcSeamCurve = class { constructor(expressID, type, Curve3D, AssociatedGeometry, MasterRepresentation) { this.expressID = expressID; this.type = type; this.Curve3D = Curve3D; this.AssociatedGeometry = AssociatedGeometry; this.MasterRepresentation = MasterRepresentation; } static FromTape(expressID, type, tape) { let ptr = 0; let Curve3D = tape[ptr++]; let AssociatedGeometry = tape[ptr++]; let MasterRepresentation = tape[ptr++]; return new IfcSeamCurve(expressID, type, Curve3D, AssociatedGeometry, MasterRepresentation); } ToTape() { let args = []; args.push(this.Curve3D); args.push(this.AssociatedGeometry); args.push(this.MasterRepresentation); return args; } }; var IfcSectionProperties = class { constructor(expressID, type, SectionType, StartProfile, EndProfile) { this.expressID = expressID; this.type = type; this.SectionType = SectionType; this.StartProfile = StartProfile; this.EndProfile = EndProfile; } static FromTape(expressID, type, tape) { let ptr = 0; let SectionType = tape[ptr++]; let StartProfile = tape[ptr++]; let EndProfile = tape[ptr++]; return new IfcSectionProperties(expressID, type, SectionType, StartProfile, EndProfile); } ToTape() { let args = []; args.push(this.SectionType); args.push(this.StartProfile); args.push(this.EndProfile); return args; } }; var IfcSectionReinforcementProperties = class { constructor(expressID, type, LongitudinalStartPosition, LongitudinalEndPosition, TransversePosition, ReinforcementRole, SectionDefinition, CrossSectionReinforcementDefinitions) { this.expressID = expressID; this.type = type; this.LongitudinalStartPosition = LongitudinalStartPosition; this.LongitudinalEndPosition = LongitudinalEndPosition; this.TransversePosition = TransversePosition; this.ReinforcementRole = ReinforcementRole; this.SectionDefinition = SectionDefinition; this.CrossSectionReinforcementDefinitions = CrossSectionReinforcementDefinitions; } static FromTape(expressID, type, tape) { let ptr = 0; let LongitudinalStartPosition = tape[ptr++]; let LongitudinalEndPosition = tape[ptr++]; let TransversePosition = tape[ptr++]; let ReinforcementRole = tape[ptr++]; let SectionDefinition = tape[ptr++]; let CrossSectionReinforcementDefinitions = tape[ptr++]; return new IfcSectionReinforcementProperties(expressID, type, LongitudinalStartPosition, LongitudinalEndPosition, TransversePosition, ReinforcementRole, SectionDefinition, CrossSectionReinforcementDefinitions); } ToTape() { let args = []; args.push(this.LongitudinalStartPosition); args.push(this.LongitudinalEndPosition); args.push(this.TransversePosition); args.push(this.ReinforcementRole); args.push(this.SectionDefinition); args.push(this.CrossSectionReinforcementDefinitions); return args; } }; var IfcSectionedSolid = class { constructor(expressID, type, Directrix, CrossSections) { this.expressID = expressID; this.type = type; this.Directrix = Directrix; this.CrossSections = CrossSections; } static FromTape(expressID, type, tape) { let ptr = 0; let Directrix = tape[ptr++]; let CrossSections = tape[ptr++]; return new IfcSectionedSolid(expressID, type, Directrix, CrossSections); } ToTape() { let args = []; args.push(this.Directrix); args.push(this.CrossSections); return args; } }; var IfcSectionedSolidHorizontal = class { constructor(expressID, type, Directrix, CrossSections, CrossSectionPositions, FixedAxisVertical) { this.expressID = expressID; this.type = type; this.Directrix = Directrix; this.CrossSections = CrossSections; this.CrossSectionPositions = CrossSectionPositions; this.FixedAxisVertical = FixedAxisVertical; } static FromTape(expressID, type, tape) { let ptr = 0; let Directrix = tape[ptr++]; let CrossSections = tape[ptr++]; let CrossSectionPositions = tape[ptr++]; let FixedAxisVertical = tape[ptr++]; return new IfcSectionedSolidHorizontal(expressID, type, Directrix, CrossSections, CrossSectionPositions, FixedAxisVertical); } ToTape() { let args = []; args.push(this.Directrix); args.push(this.CrossSections); args.push(this.CrossSectionPositions); args.push(this.FixedAxisVertical); return args; } }; var IfcSectionedSpine = class { constructor(expressID, type, SpineCurve, CrossSections, CrossSectionPositions) { this.expressID = expressID; this.type = type; this.SpineCurve = SpineCurve; this.CrossSections = CrossSections; this.CrossSectionPositions = CrossSectionPositions; } static FromTape(expressID, type, tape) { let ptr = 0; let SpineCurve = tape[ptr++]; let CrossSections = tape[ptr++]; let CrossSectionPositions = tape[ptr++]; return new IfcSectionedSpine(expressID, type, SpineCurve, CrossSections, CrossSectionPositions); } ToTape() { let args = []; args.push(this.SpineCurve); args.push(this.CrossSections); args.push(this.CrossSectionPositions); return args; } }; var IfcSensor = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSensor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcSensorType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSensorType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcShadingDevice = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcShadingDevice(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcShadingDeviceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcShadingDeviceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcShapeAspect = class { constructor(expressID, type, ShapeRepresentations, Name, Description, ProductDefinitional, PartOfProductDefinitionShape) { this.expressID = expressID; this.type = type; this.ShapeRepresentations = ShapeRepresentations; this.Name = Name; this.Description = Description; this.ProductDefinitional = ProductDefinitional; this.PartOfProductDefinitionShape = PartOfProductDefinitionShape; } static FromTape(expressID, type, tape) { let ptr = 0; let ShapeRepresentations = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ProductDefinitional = tape[ptr++]; let PartOfProductDefinitionShape = tape[ptr++]; return new IfcShapeAspect(expressID, type, ShapeRepresentations, Name, Description, ProductDefinitional, PartOfProductDefinitionShape); } ToTape() { let args = []; args.push(this.ShapeRepresentations); args.push(this.Name); args.push(this.Description); args.push(this.ProductDefinitional); args.push(this.PartOfProductDefinitionShape); return args; } }; var IfcShapeModel = class { constructor(expressID, type, ContextOfItems, RepresentationIdentifier, RepresentationType, Items) { this.expressID = expressID; this.type = type; this.ContextOfItems = ContextOfItems; this.RepresentationIdentifier = RepresentationIdentifier; this.RepresentationType = RepresentationType; this.Items = Items; } static FromTape(expressID, type, tape) { let ptr = 0; let ContextOfItems = tape[ptr++]; let RepresentationIdentifier = tape[ptr++]; let RepresentationType = tape[ptr++]; let Items = tape[ptr++]; return new IfcShapeModel(expressID, type, ContextOfItems, RepresentationIdentifier, RepresentationType, Items); } ToTape() { let args = []; args.push(this.ContextOfItems); args.push(this.RepresentationIdentifier); args.push(this.RepresentationType); args.push(this.Items); return args; } }; var IfcShapeRepresentation = class { constructor(expressID, type, ContextOfItems, RepresentationIdentifier, RepresentationType, Items) { this.expressID = expressID; this.type = type; this.ContextOfItems = ContextOfItems; this.RepresentationIdentifier = RepresentationIdentifier; this.RepresentationType = RepresentationType; this.Items = Items; } static FromTape(expressID, type, tape) { let ptr = 0; let ContextOfItems = tape[ptr++]; let RepresentationIdentifier = tape[ptr++]; let RepresentationType = tape[ptr++]; let Items = tape[ptr++]; return new IfcShapeRepresentation(expressID, type, ContextOfItems, RepresentationIdentifier, RepresentationType, Items); } ToTape() { let args = []; args.push(this.ContextOfItems); args.push(this.RepresentationIdentifier); args.push(this.RepresentationType); args.push(this.Items); return args; } }; var IfcShellBasedSurfaceModel = class { constructor(expressID, type, SbsmBoundary) { this.expressID = expressID; this.type = type; this.SbsmBoundary = SbsmBoundary; } static FromTape(expressID, type, tape) { let ptr = 0; let SbsmBoundary = tape[ptr++]; return new IfcShellBasedSurfaceModel(expressID, type, SbsmBoundary); } ToTape() { let args = []; args.push(this.SbsmBoundary); return args; } }; var IfcSimpleProperty = class { constructor(expressID, type, Name, Description) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; return new IfcSimpleProperty(expressID, type, Name, Description); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); return args; } }; var IfcSimplePropertyTemplate = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, TemplateType, PrimaryMeasureType, SecondaryMeasureType, Enumerators, PrimaryUnit, SecondaryUnit, Expression, AccessState) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.TemplateType = TemplateType; this.PrimaryMeasureType = PrimaryMeasureType; this.SecondaryMeasureType = SecondaryMeasureType; this.Enumerators = Enumerators; this.PrimaryUnit = PrimaryUnit; this.SecondaryUnit = SecondaryUnit; this.Expression = Expression; this.AccessState = AccessState; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let TemplateType = tape[ptr++]; let PrimaryMeasureType = tape[ptr++]; let SecondaryMeasureType = tape[ptr++]; let Enumerators = tape[ptr++]; let PrimaryUnit = tape[ptr++]; let SecondaryUnit = tape[ptr++]; let Expression = tape[ptr++]; let AccessState = tape[ptr++]; return new IfcSimplePropertyTemplate(expressID, type, GlobalId, OwnerHistory, Name, Description, TemplateType, PrimaryMeasureType, SecondaryMeasureType, Enumerators, PrimaryUnit, SecondaryUnit, Expression, AccessState); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.TemplateType); args.push(this.PrimaryMeasureType); args.push(this.SecondaryMeasureType); args.push(this.Enumerators); args.push(this.PrimaryUnit); args.push(this.SecondaryUnit); args.push(this.Expression); args.push(this.AccessState); return args; } }; var IfcSite = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType, RefLatitude, RefLongitude, RefElevation, LandTitleNumber, SiteAddress) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.LongName = LongName; this.CompositionType = CompositionType; this.RefLatitude = RefLatitude; this.RefLongitude = RefLongitude; this.RefElevation = RefElevation; this.LandTitleNumber = LandTitleNumber; this.SiteAddress = SiteAddress; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let LongName = tape[ptr++]; let CompositionType = tape[ptr++]; let RefLatitude = tape[ptr++]; let RefLongitude = tape[ptr++]; let RefElevation = tape[ptr++]; let LandTitleNumber = tape[ptr++]; let SiteAddress = tape[ptr++]; return new IfcSite(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType, RefLatitude, RefLongitude, RefElevation, LandTitleNumber, SiteAddress); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.LongName); args.push(this.CompositionType); args.push(this.RefLatitude); args.push(this.RefLongitude); args.push(this.RefElevation); args.push(this.LandTitleNumber); args.push(this.SiteAddress); return args; } }; var IfcSlab = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSlab(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcSlabElementedCase = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSlabElementedCase(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcSlabStandardCase = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSlabStandardCase(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcSlabType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSlabType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcSlippageConnectionCondition = class { constructor(expressID, type, Name, SlippageX, SlippageY, SlippageZ) { this.expressID = expressID; this.type = type; this.Name = Name; this.SlippageX = SlippageX; this.SlippageY = SlippageY; this.SlippageZ = SlippageZ; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let SlippageX = tape[ptr++]; let SlippageY = tape[ptr++]; let SlippageZ = tape[ptr++]; return new IfcSlippageConnectionCondition(expressID, type, Name, SlippageX, SlippageY, SlippageZ); } ToTape() { let args = []; args.push(this.Name); args.push(this.SlippageX); args.push(this.SlippageY); args.push(this.SlippageZ); return args; } }; var IfcSolarDevice = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSolarDevice(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcSolarDeviceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSolarDeviceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcSolidModel = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcSolidModel(expressID, type); } ToTape() { let args = []; return args; } }; var IfcSpace = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType, PredefinedType, ElevationWithFlooring) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.LongName = LongName; this.CompositionType = CompositionType; this.PredefinedType = PredefinedType; this.ElevationWithFlooring = ElevationWithFlooring; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let LongName = tape[ptr++]; let CompositionType = tape[ptr++]; let PredefinedType = tape[ptr++]; let ElevationWithFlooring = tape[ptr++]; return new IfcSpace(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType, PredefinedType, ElevationWithFlooring); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.LongName); args.push(this.CompositionType); args.push(this.PredefinedType); args.push(this.ElevationWithFlooring); return args; } }; var IfcSpaceHeater = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSpaceHeater(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcSpaceHeaterType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSpaceHeaterType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcSpaceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, LongName) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; this.LongName = LongName; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; let LongName = tape[ptr++]; return new IfcSpaceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, LongName); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); args.push(this.LongName); return args; } }; var IfcSpatialElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.LongName = LongName; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let LongName = tape[ptr++]; return new IfcSpatialElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.LongName); return args; } }; var IfcSpatialElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcSpatialElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcSpatialStructureElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.LongName = LongName; this.CompositionType = CompositionType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let LongName = tape[ptr++]; let CompositionType = tape[ptr++]; return new IfcSpatialStructureElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, CompositionType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.LongName); args.push(this.CompositionType); return args; } }; var IfcSpatialStructureElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; return new IfcSpatialStructureElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); return args; } }; var IfcSpatialZone = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.LongName = LongName; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let LongName = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSpatialZone(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, LongName, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.LongName); args.push(this.PredefinedType); return args; } }; var IfcSpatialZoneType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, LongName) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; this.LongName = LongName; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; let LongName = tape[ptr++]; return new IfcSpatialZoneType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, LongName); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); args.push(this.LongName); return args; } }; var IfcSphere = class { constructor(expressID, type, Position, Radius) { this.expressID = expressID; this.type = type; this.Position = Position; this.Radius = Radius; } static FromTape(expressID, type, tape) { let ptr = 0; let Position = tape[ptr++]; let Radius = tape[ptr++]; return new IfcSphere(expressID, type, Position, Radius); } ToTape() { let args = []; args.push(this.Position); args.push(this.Radius); return args; } }; var IfcSphericalSurface = class { constructor(expressID, type, Position, Radius) { this.expressID = expressID; this.type = type; this.Position = Position; this.Radius = Radius; } static FromTape(expressID, type, tape) { let ptr = 0; let Position = tape[ptr++]; let Radius = tape[ptr++]; return new IfcSphericalSurface(expressID, type, Position, Radius); } ToTape() { let args = []; args.push(this.Position); args.push(this.Radius); return args; } }; var IfcStackTerminal = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcStackTerminal(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcStackTerminalType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcStackTerminalType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcStair = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcStair(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcStairFlight = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, NumberOfRisers, NumberOfTreads, RiserHeight, TreadLength, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.NumberOfRisers = NumberOfRisers; this.NumberOfTreads = NumberOfTreads; this.RiserHeight = RiserHeight; this.TreadLength = TreadLength; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let NumberOfRisers = tape[ptr++]; let NumberOfTreads = tape[ptr++]; let RiserHeight = tape[ptr++]; let TreadLength = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcStairFlight(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, NumberOfRisers, NumberOfTreads, RiserHeight, TreadLength, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.NumberOfRisers); args.push(this.NumberOfTreads); args.push(this.RiserHeight); args.push(this.TreadLength); args.push(this.PredefinedType); return args; } }; var IfcStairFlightType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcStairFlightType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcStairType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcStairType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcStructuralAction = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, DestabilizingLoad) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedLoad = AppliedLoad; this.GlobalOrLocal = GlobalOrLocal; this.DestabilizingLoad = DestabilizingLoad; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedLoad = tape[ptr++]; let GlobalOrLocal = tape[ptr++]; let DestabilizingLoad = tape[ptr++]; return new IfcStructuralAction(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, DestabilizingLoad); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedLoad); args.push(this.GlobalOrLocal); args.push(this.DestabilizingLoad); return args; } }; var IfcStructuralActivity = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedLoad = AppliedLoad; this.GlobalOrLocal = GlobalOrLocal; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedLoad = tape[ptr++]; let GlobalOrLocal = tape[ptr++]; return new IfcStructuralActivity(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedLoad); args.push(this.GlobalOrLocal); return args; } }; var IfcStructuralAnalysisModel = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, PredefinedType, OrientationOf2DPlane, LoadedBy, HasResults, SharedPlacement) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.PredefinedType = PredefinedType; this.OrientationOf2DPlane = OrientationOf2DPlane; this.LoadedBy = LoadedBy; this.HasResults = HasResults; this.SharedPlacement = SharedPlacement; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let PredefinedType = tape[ptr++]; let OrientationOf2DPlane = tape[ptr++]; let LoadedBy = tape[ptr++]; let HasResults = tape[ptr++]; let SharedPlacement = tape[ptr++]; return new IfcStructuralAnalysisModel(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, PredefinedType, OrientationOf2DPlane, LoadedBy, HasResults, SharedPlacement); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.PredefinedType); args.push(this.OrientationOf2DPlane); args.push(this.LoadedBy); args.push(this.HasResults); args.push(this.SharedPlacement); return args; } }; var IfcStructuralConnection = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedCondition) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedCondition = AppliedCondition; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedCondition = tape[ptr++]; return new IfcStructuralConnection(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedCondition); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedCondition); return args; } }; var IfcStructuralConnectionCondition = class { constructor(expressID, type, Name) { this.expressID = expressID; this.type = type; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; return new IfcStructuralConnectionCondition(expressID, type, Name); } ToTape() { let args = []; args.push(this.Name); return args; } }; var IfcStructuralCurveAction = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, DestabilizingLoad, ProjectedOrTrue, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedLoad = AppliedLoad; this.GlobalOrLocal = GlobalOrLocal; this.DestabilizingLoad = DestabilizingLoad; this.ProjectedOrTrue = ProjectedOrTrue; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedLoad = tape[ptr++]; let GlobalOrLocal = tape[ptr++]; let DestabilizingLoad = tape[ptr++]; let ProjectedOrTrue = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcStructuralCurveAction(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, DestabilizingLoad, ProjectedOrTrue, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedLoad); args.push(this.GlobalOrLocal); args.push(this.DestabilizingLoad); args.push(this.ProjectedOrTrue); args.push(this.PredefinedType); return args; } }; var IfcStructuralCurveConnection = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedCondition, Axis) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedCondition = AppliedCondition; this.Axis = Axis; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedCondition = tape[ptr++]; let Axis = tape[ptr++]; return new IfcStructuralCurveConnection(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedCondition, Axis); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedCondition); args.push(this.Axis); return args; } }; var IfcStructuralCurveMember = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, PredefinedType, Axis) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.PredefinedType = PredefinedType; this.Axis = Axis; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let PredefinedType = tape[ptr++]; let Axis = tape[ptr++]; return new IfcStructuralCurveMember(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, PredefinedType, Axis); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.PredefinedType); args.push(this.Axis); return args; } }; var IfcStructuralCurveMemberVarying = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, PredefinedType, Axis) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.PredefinedType = PredefinedType; this.Axis = Axis; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let PredefinedType = tape[ptr++]; let Axis = tape[ptr++]; return new IfcStructuralCurveMemberVarying(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, PredefinedType, Axis); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.PredefinedType); args.push(this.Axis); return args; } }; var IfcStructuralCurveReaction = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedLoad = AppliedLoad; this.GlobalOrLocal = GlobalOrLocal; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedLoad = tape[ptr++]; let GlobalOrLocal = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcStructuralCurveReaction(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedLoad); args.push(this.GlobalOrLocal); args.push(this.PredefinedType); return args; } }; var IfcStructuralItem = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; return new IfcStructuralItem(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); return args; } }; var IfcStructuralLinearAction = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, DestabilizingLoad, ProjectedOrTrue, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedLoad = AppliedLoad; this.GlobalOrLocal = GlobalOrLocal; this.DestabilizingLoad = DestabilizingLoad; this.ProjectedOrTrue = ProjectedOrTrue; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedLoad = tape[ptr++]; let GlobalOrLocal = tape[ptr++]; let DestabilizingLoad = tape[ptr++]; let ProjectedOrTrue = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcStructuralLinearAction(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, DestabilizingLoad, ProjectedOrTrue, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedLoad); args.push(this.GlobalOrLocal); args.push(this.DestabilizingLoad); args.push(this.ProjectedOrTrue); args.push(this.PredefinedType); return args; } }; var IfcStructuralLoad = class { constructor(expressID, type, Name) { this.expressID = expressID; this.type = type; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; return new IfcStructuralLoad(expressID, type, Name); } ToTape() { let args = []; args.push(this.Name); return args; } }; var IfcStructuralLoadCase = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, PredefinedType, ActionType, ActionSource, Coefficient, Purpose, SelfWeightCoefficients) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.PredefinedType = PredefinedType; this.ActionType = ActionType; this.ActionSource = ActionSource; this.Coefficient = Coefficient; this.Purpose = Purpose; this.SelfWeightCoefficients = SelfWeightCoefficients; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let PredefinedType = tape[ptr++]; let ActionType = tape[ptr++]; let ActionSource = tape[ptr++]; let Coefficient = tape[ptr++]; let Purpose = tape[ptr++]; let SelfWeightCoefficients = tape[ptr++]; return new IfcStructuralLoadCase(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, PredefinedType, ActionType, ActionSource, Coefficient, Purpose, SelfWeightCoefficients); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.PredefinedType); args.push(this.ActionType); args.push(this.ActionSource); args.push(this.Coefficient); args.push(this.Purpose); args.push(this.SelfWeightCoefficients); return args; } }; var IfcStructuralLoadConfiguration = class { constructor(expressID, type, Name, Values, Locations) { this.expressID = expressID; this.type = type; this.Name = Name; this.Values = Values; this.Locations = Locations; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Values = tape[ptr++]; let Locations = tape[ptr++]; return new IfcStructuralLoadConfiguration(expressID, type, Name, Values, Locations); } ToTape() { let args = []; args.push(this.Name); args.push(this.Values); args.push(this.Locations); return args; } }; var IfcStructuralLoadGroup = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, PredefinedType, ActionType, ActionSource, Coefficient, Purpose) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.PredefinedType = PredefinedType; this.ActionType = ActionType; this.ActionSource = ActionSource; this.Coefficient = Coefficient; this.Purpose = Purpose; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let PredefinedType = tape[ptr++]; let ActionType = tape[ptr++]; let ActionSource = tape[ptr++]; let Coefficient = tape[ptr++]; let Purpose = tape[ptr++]; return new IfcStructuralLoadGroup(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, PredefinedType, ActionType, ActionSource, Coefficient, Purpose); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.PredefinedType); args.push(this.ActionType); args.push(this.ActionSource); args.push(this.Coefficient); args.push(this.Purpose); return args; } }; var IfcStructuralLoadLinearForce = class { constructor(expressID, type, Name, LinearForceX, LinearForceY, LinearForceZ, LinearMomentX, LinearMomentY, LinearMomentZ) { this.expressID = expressID; this.type = type; this.Name = Name; this.LinearForceX = LinearForceX; this.LinearForceY = LinearForceY; this.LinearForceZ = LinearForceZ; this.LinearMomentX = LinearMomentX; this.LinearMomentY = LinearMomentY; this.LinearMomentZ = LinearMomentZ; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let LinearForceX = tape[ptr++]; let LinearForceY = tape[ptr++]; let LinearForceZ = tape[ptr++]; let LinearMomentX = tape[ptr++]; let LinearMomentY = tape[ptr++]; let LinearMomentZ = tape[ptr++]; return new IfcStructuralLoadLinearForce(expressID, type, Name, LinearForceX, LinearForceY, LinearForceZ, LinearMomentX, LinearMomentY, LinearMomentZ); } ToTape() { let args = []; args.push(this.Name); args.push(this.LinearForceX); args.push(this.LinearForceY); args.push(this.LinearForceZ); args.push(this.LinearMomentX); args.push(this.LinearMomentY); args.push(this.LinearMomentZ); return args; } }; var IfcStructuralLoadOrResult = class { constructor(expressID, type, Name) { this.expressID = expressID; this.type = type; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; return new IfcStructuralLoadOrResult(expressID, type, Name); } ToTape() { let args = []; args.push(this.Name); return args; } }; var IfcStructuralLoadPlanarForce = class { constructor(expressID, type, Name, PlanarForceX, PlanarForceY, PlanarForceZ) { this.expressID = expressID; this.type = type; this.Name = Name; this.PlanarForceX = PlanarForceX; this.PlanarForceY = PlanarForceY; this.PlanarForceZ = PlanarForceZ; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let PlanarForceX = tape[ptr++]; let PlanarForceY = tape[ptr++]; let PlanarForceZ = tape[ptr++]; return new IfcStructuralLoadPlanarForce(expressID, type, Name, PlanarForceX, PlanarForceY, PlanarForceZ); } ToTape() { let args = []; args.push(this.Name); args.push(this.PlanarForceX); args.push(this.PlanarForceY); args.push(this.PlanarForceZ); return args; } }; var IfcStructuralLoadSingleDisplacement = class { constructor(expressID, type, Name, DisplacementX, DisplacementY, DisplacementZ, RotationalDisplacementRX, RotationalDisplacementRY, RotationalDisplacementRZ) { this.expressID = expressID; this.type = type; this.Name = Name; this.DisplacementX = DisplacementX; this.DisplacementY = DisplacementY; this.DisplacementZ = DisplacementZ; this.RotationalDisplacementRX = RotationalDisplacementRX; this.RotationalDisplacementRY = RotationalDisplacementRY; this.RotationalDisplacementRZ = RotationalDisplacementRZ; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let DisplacementX = tape[ptr++]; let DisplacementY = tape[ptr++]; let DisplacementZ = tape[ptr++]; let RotationalDisplacementRX = tape[ptr++]; let RotationalDisplacementRY = tape[ptr++]; let RotationalDisplacementRZ = tape[ptr++]; return new IfcStructuralLoadSingleDisplacement(expressID, type, Name, DisplacementX, DisplacementY, DisplacementZ, RotationalDisplacementRX, RotationalDisplacementRY, RotationalDisplacementRZ); } ToTape() { let args = []; args.push(this.Name); args.push(this.DisplacementX); args.push(this.DisplacementY); args.push(this.DisplacementZ); args.push(this.RotationalDisplacementRX); args.push(this.RotationalDisplacementRY); args.push(this.RotationalDisplacementRZ); return args; } }; var IfcStructuralLoadSingleDisplacementDistortion = class { constructor(expressID, type, Name, DisplacementX, DisplacementY, DisplacementZ, RotationalDisplacementRX, RotationalDisplacementRY, RotationalDisplacementRZ, Distortion) { this.expressID = expressID; this.type = type; this.Name = Name; this.DisplacementX = DisplacementX; this.DisplacementY = DisplacementY; this.DisplacementZ = DisplacementZ; this.RotationalDisplacementRX = RotationalDisplacementRX; this.RotationalDisplacementRY = RotationalDisplacementRY; this.RotationalDisplacementRZ = RotationalDisplacementRZ; this.Distortion = Distortion; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let DisplacementX = tape[ptr++]; let DisplacementY = tape[ptr++]; let DisplacementZ = tape[ptr++]; let RotationalDisplacementRX = tape[ptr++]; let RotationalDisplacementRY = tape[ptr++]; let RotationalDisplacementRZ = tape[ptr++]; let Distortion = tape[ptr++]; return new IfcStructuralLoadSingleDisplacementDistortion(expressID, type, Name, DisplacementX, DisplacementY, DisplacementZ, RotationalDisplacementRX, RotationalDisplacementRY, RotationalDisplacementRZ, Distortion); } ToTape() { let args = []; args.push(this.Name); args.push(this.DisplacementX); args.push(this.DisplacementY); args.push(this.DisplacementZ); args.push(this.RotationalDisplacementRX); args.push(this.RotationalDisplacementRY); args.push(this.RotationalDisplacementRZ); args.push(this.Distortion); return args; } }; var IfcStructuralLoadSingleForce = class { constructor(expressID, type, Name, ForceX, ForceY, ForceZ, MomentX, MomentY, MomentZ) { this.expressID = expressID; this.type = type; this.Name = Name; this.ForceX = ForceX; this.ForceY = ForceY; this.ForceZ = ForceZ; this.MomentX = MomentX; this.MomentY = MomentY; this.MomentZ = MomentZ; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let ForceX = tape[ptr++]; let ForceY = tape[ptr++]; let ForceZ = tape[ptr++]; let MomentX = tape[ptr++]; let MomentY = tape[ptr++]; let MomentZ = tape[ptr++]; return new IfcStructuralLoadSingleForce(expressID, type, Name, ForceX, ForceY, ForceZ, MomentX, MomentY, MomentZ); } ToTape() { let args = []; args.push(this.Name); args.push(this.ForceX); args.push(this.ForceY); args.push(this.ForceZ); args.push(this.MomentX); args.push(this.MomentY); args.push(this.MomentZ); return args; } }; var IfcStructuralLoadSingleForceWarping = class { constructor(expressID, type, Name, ForceX, ForceY, ForceZ, MomentX, MomentY, MomentZ, WarpingMoment) { this.expressID = expressID; this.type = type; this.Name = Name; this.ForceX = ForceX; this.ForceY = ForceY; this.ForceZ = ForceZ; this.MomentX = MomentX; this.MomentY = MomentY; this.MomentZ = MomentZ; this.WarpingMoment = WarpingMoment; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let ForceX = tape[ptr++]; let ForceY = tape[ptr++]; let ForceZ = tape[ptr++]; let MomentX = tape[ptr++]; let MomentY = tape[ptr++]; let MomentZ = tape[ptr++]; let WarpingMoment = tape[ptr++]; return new IfcStructuralLoadSingleForceWarping(expressID, type, Name, ForceX, ForceY, ForceZ, MomentX, MomentY, MomentZ, WarpingMoment); } ToTape() { let args = []; args.push(this.Name); args.push(this.ForceX); args.push(this.ForceY); args.push(this.ForceZ); args.push(this.MomentX); args.push(this.MomentY); args.push(this.MomentZ); args.push(this.WarpingMoment); return args; } }; var IfcStructuralLoadStatic = class { constructor(expressID, type, Name) { this.expressID = expressID; this.type = type; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; return new IfcStructuralLoadStatic(expressID, type, Name); } ToTape() { let args = []; args.push(this.Name); return args; } }; var IfcStructuralLoadTemperature = class { constructor(expressID, type, Name, DeltaTConstant, DeltaTY, DeltaTZ) { this.expressID = expressID; this.type = type; this.Name = Name; this.DeltaTConstant = DeltaTConstant; this.DeltaTY = DeltaTY; this.DeltaTZ = DeltaTZ; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let DeltaTConstant = tape[ptr++]; let DeltaTY = tape[ptr++]; let DeltaTZ = tape[ptr++]; return new IfcStructuralLoadTemperature(expressID, type, Name, DeltaTConstant, DeltaTY, DeltaTZ); } ToTape() { let args = []; args.push(this.Name); args.push(this.DeltaTConstant); args.push(this.DeltaTY); args.push(this.DeltaTZ); return args; } }; var IfcStructuralMember = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; return new IfcStructuralMember(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); return args; } }; var IfcStructuralPlanarAction = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, DestabilizingLoad, ProjectedOrTrue, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedLoad = AppliedLoad; this.GlobalOrLocal = GlobalOrLocal; this.DestabilizingLoad = DestabilizingLoad; this.ProjectedOrTrue = ProjectedOrTrue; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedLoad = tape[ptr++]; let GlobalOrLocal = tape[ptr++]; let DestabilizingLoad = tape[ptr++]; let ProjectedOrTrue = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcStructuralPlanarAction(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, DestabilizingLoad, ProjectedOrTrue, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedLoad); args.push(this.GlobalOrLocal); args.push(this.DestabilizingLoad); args.push(this.ProjectedOrTrue); args.push(this.PredefinedType); return args; } }; var IfcStructuralPointAction = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, DestabilizingLoad) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedLoad = AppliedLoad; this.GlobalOrLocal = GlobalOrLocal; this.DestabilizingLoad = DestabilizingLoad; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedLoad = tape[ptr++]; let GlobalOrLocal = tape[ptr++]; let DestabilizingLoad = tape[ptr++]; return new IfcStructuralPointAction(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, DestabilizingLoad); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedLoad); args.push(this.GlobalOrLocal); args.push(this.DestabilizingLoad); return args; } }; var IfcStructuralPointConnection = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedCondition, ConditionCoordinateSystem) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedCondition = AppliedCondition; this.ConditionCoordinateSystem = ConditionCoordinateSystem; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedCondition = tape[ptr++]; let ConditionCoordinateSystem = tape[ptr++]; return new IfcStructuralPointConnection(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedCondition, ConditionCoordinateSystem); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedCondition); args.push(this.ConditionCoordinateSystem); return args; } }; var IfcStructuralPointReaction = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedLoad = AppliedLoad; this.GlobalOrLocal = GlobalOrLocal; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedLoad = tape[ptr++]; let GlobalOrLocal = tape[ptr++]; return new IfcStructuralPointReaction(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedLoad); args.push(this.GlobalOrLocal); return args; } }; var IfcStructuralReaction = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedLoad = AppliedLoad; this.GlobalOrLocal = GlobalOrLocal; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedLoad = tape[ptr++]; let GlobalOrLocal = tape[ptr++]; return new IfcStructuralReaction(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedLoad); args.push(this.GlobalOrLocal); return args; } }; var IfcStructuralResultGroup = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, TheoryType, ResultForLoadGroup, IsLinear) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.TheoryType = TheoryType; this.ResultForLoadGroup = ResultForLoadGroup; this.IsLinear = IsLinear; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let TheoryType = tape[ptr++]; let ResultForLoadGroup = tape[ptr++]; let IsLinear = tape[ptr++]; return new IfcStructuralResultGroup(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, TheoryType, ResultForLoadGroup, IsLinear); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.TheoryType); args.push(this.ResultForLoadGroup); args.push(this.IsLinear); return args; } }; var IfcStructuralSurfaceAction = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, DestabilizingLoad, ProjectedOrTrue, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedLoad = AppliedLoad; this.GlobalOrLocal = GlobalOrLocal; this.DestabilizingLoad = DestabilizingLoad; this.ProjectedOrTrue = ProjectedOrTrue; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedLoad = tape[ptr++]; let GlobalOrLocal = tape[ptr++]; let DestabilizingLoad = tape[ptr++]; let ProjectedOrTrue = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcStructuralSurfaceAction(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, DestabilizingLoad, ProjectedOrTrue, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedLoad); args.push(this.GlobalOrLocal); args.push(this.DestabilizingLoad); args.push(this.ProjectedOrTrue); args.push(this.PredefinedType); return args; } }; var IfcStructuralSurfaceConnection = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedCondition) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedCondition = AppliedCondition; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedCondition = tape[ptr++]; return new IfcStructuralSurfaceConnection(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedCondition); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedCondition); return args; } }; var IfcStructuralSurfaceMember = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, PredefinedType, Thickness) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.PredefinedType = PredefinedType; this.Thickness = Thickness; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let PredefinedType = tape[ptr++]; let Thickness = tape[ptr++]; return new IfcStructuralSurfaceMember(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, PredefinedType, Thickness); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.PredefinedType); args.push(this.Thickness); return args; } }; var IfcStructuralSurfaceMemberVarying = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, PredefinedType, Thickness) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.PredefinedType = PredefinedType; this.Thickness = Thickness; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let PredefinedType = tape[ptr++]; let Thickness = tape[ptr++]; return new IfcStructuralSurfaceMemberVarying(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, PredefinedType, Thickness); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.PredefinedType); args.push(this.Thickness); return args; } }; var IfcStructuralSurfaceReaction = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.AppliedLoad = AppliedLoad; this.GlobalOrLocal = GlobalOrLocal; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let AppliedLoad = tape[ptr++]; let GlobalOrLocal = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcStructuralSurfaceReaction(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, AppliedLoad, GlobalOrLocal, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.AppliedLoad); args.push(this.GlobalOrLocal); args.push(this.PredefinedType); return args; } }; var IfcStyleModel = class { constructor(expressID, type, ContextOfItems, RepresentationIdentifier, RepresentationType, Items) { this.expressID = expressID; this.type = type; this.ContextOfItems = ContextOfItems; this.RepresentationIdentifier = RepresentationIdentifier; this.RepresentationType = RepresentationType; this.Items = Items; } static FromTape(expressID, type, tape) { let ptr = 0; let ContextOfItems = tape[ptr++]; let RepresentationIdentifier = tape[ptr++]; let RepresentationType = tape[ptr++]; let Items = tape[ptr++]; return new IfcStyleModel(expressID, type, ContextOfItems, RepresentationIdentifier, RepresentationType, Items); } ToTape() { let args = []; args.push(this.ContextOfItems); args.push(this.RepresentationIdentifier); args.push(this.RepresentationType); args.push(this.Items); return args; } }; var IfcStyledItem = class { constructor(expressID, type, Item, Styles, Name) { this.expressID = expressID; this.type = type; this.Item = Item; this.Styles = Styles; this.Name = Name; } static FromTape(expressID, type, tape) { let ptr = 0; let Item = tape[ptr++]; let Styles = tape[ptr++]; let Name = tape[ptr++]; return new IfcStyledItem(expressID, type, Item, Styles, Name); } ToTape() { let args = []; args.push(this.Item); args.push(this.Styles); args.push(this.Name); return args; } }; var IfcStyledRepresentation = class { constructor(expressID, type, ContextOfItems, RepresentationIdentifier, RepresentationType, Items) { this.expressID = expressID; this.type = type; this.ContextOfItems = ContextOfItems; this.RepresentationIdentifier = RepresentationIdentifier; this.RepresentationType = RepresentationType; this.Items = Items; } static FromTape(expressID, type, tape) { let ptr = 0; let ContextOfItems = tape[ptr++]; let RepresentationIdentifier = tape[ptr++]; let RepresentationType = tape[ptr++]; let Items = tape[ptr++]; return new IfcStyledRepresentation(expressID, type, ContextOfItems, RepresentationIdentifier, RepresentationType, Items); } ToTape() { let args = []; args.push(this.ContextOfItems); args.push(this.RepresentationIdentifier); args.push(this.RepresentationType); args.push(this.Items); return args; } }; var IfcSubContractResource = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Usage, BaseCosts, BaseQuantity, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.LongDescription = LongDescription; this.Usage = Usage; this.BaseCosts = BaseCosts; this.BaseQuantity = BaseQuantity; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let Usage = tape[ptr++]; let BaseCosts = tape[ptr++]; let BaseQuantity = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSubContractResource(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Usage, BaseCosts, BaseQuantity, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.LongDescription); args.push(this.Usage); args.push(this.BaseCosts); args.push(this.BaseQuantity); args.push(this.PredefinedType); return args; } }; var IfcSubContractResourceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType, BaseCosts, BaseQuantity, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.Identification = Identification; this.LongDescription = LongDescription; this.ResourceType = ResourceType; this.BaseCosts = BaseCosts; this.BaseQuantity = BaseQuantity; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let ResourceType = tape[ptr++]; let BaseCosts = tape[ptr++]; let BaseQuantity = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSubContractResourceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType, BaseCosts, BaseQuantity, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.Identification); args.push(this.LongDescription); args.push(this.ResourceType); args.push(this.BaseCosts); args.push(this.BaseQuantity); args.push(this.PredefinedType); return args; } }; var IfcSubedge = class { constructor(expressID, type, EdgeStart, EdgeEnd, ParentEdge) { this.expressID = expressID; this.type = type; this.EdgeStart = EdgeStart; this.EdgeEnd = EdgeEnd; this.ParentEdge = ParentEdge; } static FromTape(expressID, type, tape) { let ptr = 0; let EdgeStart = tape[ptr++]; let EdgeEnd = tape[ptr++]; let ParentEdge = tape[ptr++]; return new IfcSubedge(expressID, type, EdgeStart, EdgeEnd, ParentEdge); } ToTape() { let args = []; args.push(this.EdgeStart); args.push(this.EdgeEnd); args.push(this.ParentEdge); return args; } }; var IfcSurface = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcSurface(expressID, type); } ToTape() { let args = []; return args; } }; var IfcSurfaceCurve = class { constructor(expressID, type, Curve3D, AssociatedGeometry, MasterRepresentation) { this.expressID = expressID; this.type = type; this.Curve3D = Curve3D; this.AssociatedGeometry = AssociatedGeometry; this.MasterRepresentation = MasterRepresentation; } static FromTape(expressID, type, tape) { let ptr = 0; let Curve3D = tape[ptr++]; let AssociatedGeometry = tape[ptr++]; let MasterRepresentation = tape[ptr++]; return new IfcSurfaceCurve(expressID, type, Curve3D, AssociatedGeometry, MasterRepresentation); } ToTape() { let args = []; args.push(this.Curve3D); args.push(this.AssociatedGeometry); args.push(this.MasterRepresentation); return args; } }; var IfcSurfaceCurveSweptAreaSolid = class { constructor(expressID, type, SweptArea, Position, Directrix, StartParam, EndParam, ReferenceSurface) { this.expressID = expressID; this.type = type; this.SweptArea = SweptArea; this.Position = Position; this.Directrix = Directrix; this.StartParam = StartParam; this.EndParam = EndParam; this.ReferenceSurface = ReferenceSurface; } static FromTape(expressID, type, tape) { let ptr = 0; let SweptArea = tape[ptr++]; let Position = tape[ptr++]; let Directrix = tape[ptr++]; let StartParam = tape[ptr++]; let EndParam = tape[ptr++]; let ReferenceSurface = tape[ptr++]; return new IfcSurfaceCurveSweptAreaSolid(expressID, type, SweptArea, Position, Directrix, StartParam, EndParam, ReferenceSurface); } ToTape() { let args = []; args.push(this.SweptArea); args.push(this.Position); args.push(this.Directrix); args.push(this.StartParam); args.push(this.EndParam); args.push(this.ReferenceSurface); return args; } }; var IfcSurfaceFeature = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSurfaceFeature(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcSurfaceOfLinearExtrusion = class { constructor(expressID, type, SweptCurve, Position, ExtrudedDirection, Depth) { this.expressID = expressID; this.type = type; this.SweptCurve = SweptCurve; this.Position = Position; this.ExtrudedDirection = ExtrudedDirection; this.Depth = Depth; } static FromTape(expressID, type, tape) { let ptr = 0; let SweptCurve = tape[ptr++]; let Position = tape[ptr++]; let ExtrudedDirection = tape[ptr++]; let Depth = tape[ptr++]; return new IfcSurfaceOfLinearExtrusion(expressID, type, SweptCurve, Position, ExtrudedDirection, Depth); } ToTape() { let args = []; args.push(this.SweptCurve); args.push(this.Position); args.push(this.ExtrudedDirection); args.push(this.Depth); return args; } }; var IfcSurfaceOfRevolution = class { constructor(expressID, type, SweptCurve, Position, AxisPosition) { this.expressID = expressID; this.type = type; this.SweptCurve = SweptCurve; this.Position = Position; this.AxisPosition = AxisPosition; } static FromTape(expressID, type, tape) { let ptr = 0; let SweptCurve = tape[ptr++]; let Position = tape[ptr++]; let AxisPosition = tape[ptr++]; return new IfcSurfaceOfRevolution(expressID, type, SweptCurve, Position, AxisPosition); } ToTape() { let args = []; args.push(this.SweptCurve); args.push(this.Position); args.push(this.AxisPosition); return args; } }; var IfcSurfaceReinforcementArea = class { constructor(expressID, type, Name, SurfaceReinforcement1, SurfaceReinforcement2, ShearReinforcement) { this.expressID = expressID; this.type = type; this.Name = Name; this.SurfaceReinforcement1 = SurfaceReinforcement1; this.SurfaceReinforcement2 = SurfaceReinforcement2; this.ShearReinforcement = ShearReinforcement; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let SurfaceReinforcement1 = tape[ptr++]; let SurfaceReinforcement2 = tape[ptr++]; let ShearReinforcement = tape[ptr++]; return new IfcSurfaceReinforcementArea(expressID, type, Name, SurfaceReinforcement1, SurfaceReinforcement2, ShearReinforcement); } ToTape() { let args = []; args.push(this.Name); args.push(this.SurfaceReinforcement1); args.push(this.SurfaceReinforcement2); args.push(this.ShearReinforcement); return args; } }; var IfcSurfaceStyle = class { constructor(expressID, type, Name, Side, Styles) { this.expressID = expressID; this.type = type; this.Name = Name; this.Side = Side; this.Styles = Styles; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Side = tape[ptr++]; let Styles = tape[ptr++]; return new IfcSurfaceStyle(expressID, type, Name, Side, Styles); } ToTape() { let args = []; args.push(this.Name); args.push(this.Side); args.push(this.Styles); return args; } }; var IfcSurfaceStyleLighting = class { constructor(expressID, type, DiffuseTransmissionColour, DiffuseReflectionColour, TransmissionColour, ReflectanceColour) { this.expressID = expressID; this.type = type; this.DiffuseTransmissionColour = DiffuseTransmissionColour; this.DiffuseReflectionColour = DiffuseReflectionColour; this.TransmissionColour = TransmissionColour; this.ReflectanceColour = ReflectanceColour; } static FromTape(expressID, type, tape) { let ptr = 0; let DiffuseTransmissionColour = tape[ptr++]; let DiffuseReflectionColour = tape[ptr++]; let TransmissionColour = tape[ptr++]; let ReflectanceColour = tape[ptr++]; return new IfcSurfaceStyleLighting(expressID, type, DiffuseTransmissionColour, DiffuseReflectionColour, TransmissionColour, ReflectanceColour); } ToTape() { let args = []; args.push(this.DiffuseTransmissionColour); args.push(this.DiffuseReflectionColour); args.push(this.TransmissionColour); args.push(this.ReflectanceColour); return args; } }; var IfcSurfaceStyleRefraction = class { constructor(expressID, type, RefractionIndex, DispersionFactor) { this.expressID = expressID; this.type = type; this.RefractionIndex = RefractionIndex; this.DispersionFactor = DispersionFactor; } static FromTape(expressID, type, tape) { let ptr = 0; let RefractionIndex = tape[ptr++]; let DispersionFactor = tape[ptr++]; return new IfcSurfaceStyleRefraction(expressID, type, RefractionIndex, DispersionFactor); } ToTape() { let args = []; args.push(this.RefractionIndex); args.push(this.DispersionFactor); return args; } }; var IfcSurfaceStyleRendering = class { constructor(expressID, type, SurfaceColour, Transparency, DiffuseColour, TransmissionColour, DiffuseTransmissionColour, ReflectionColour, SpecularColour, SpecularHighlight, ReflectanceMethod) { this.expressID = expressID; this.type = type; this.SurfaceColour = SurfaceColour; this.Transparency = Transparency; this.DiffuseColour = DiffuseColour; this.TransmissionColour = TransmissionColour; this.DiffuseTransmissionColour = DiffuseTransmissionColour; this.ReflectionColour = ReflectionColour; this.SpecularColour = SpecularColour; this.SpecularHighlight = SpecularHighlight; this.ReflectanceMethod = ReflectanceMethod; } static FromTape(expressID, type, tape) { let ptr = 0; let SurfaceColour = tape[ptr++]; let Transparency = tape[ptr++]; let DiffuseColour = tape[ptr++]; let TransmissionColour = tape[ptr++]; let DiffuseTransmissionColour = tape[ptr++]; let ReflectionColour = tape[ptr++]; let SpecularColour = tape[ptr++]; let SpecularHighlight = tape[ptr++]; let ReflectanceMethod = tape[ptr++]; return new IfcSurfaceStyleRendering(expressID, type, SurfaceColour, Transparency, DiffuseColour, TransmissionColour, DiffuseTransmissionColour, ReflectionColour, SpecularColour, SpecularHighlight, ReflectanceMethod); } ToTape() { let args = []; args.push(this.SurfaceColour); args.push(this.Transparency); args.push(this.DiffuseColour); args.push(this.TransmissionColour); args.push(this.DiffuseTransmissionColour); args.push(this.ReflectionColour); args.push(this.SpecularColour); args.push(this.SpecularHighlight); args.push(this.ReflectanceMethod); return args; } }; var IfcSurfaceStyleShading = class { constructor(expressID, type, SurfaceColour, Transparency) { this.expressID = expressID; this.type = type; this.SurfaceColour = SurfaceColour; this.Transparency = Transparency; } static FromTape(expressID, type, tape) { let ptr = 0; let SurfaceColour = tape[ptr++]; let Transparency = tape[ptr++]; return new IfcSurfaceStyleShading(expressID, type, SurfaceColour, Transparency); } ToTape() { let args = []; args.push(this.SurfaceColour); args.push(this.Transparency); return args; } }; var IfcSurfaceStyleWithTextures = class { constructor(expressID, type, Textures) { this.expressID = expressID; this.type = type; this.Textures = Textures; } static FromTape(expressID, type, tape) { let ptr = 0; let Textures = tape[ptr++]; return new IfcSurfaceStyleWithTextures(expressID, type, Textures); } ToTape() { let args = []; args.push(this.Textures); return args; } }; var IfcSurfaceTexture = class { constructor(expressID, type, RepeatS, RepeatT, Mode, TextureTransform, Parameter) { this.expressID = expressID; this.type = type; this.RepeatS = RepeatS; this.RepeatT = RepeatT; this.Mode = Mode; this.TextureTransform = TextureTransform; this.Parameter = Parameter; } static FromTape(expressID, type, tape) { let ptr = 0; let RepeatS = tape[ptr++]; let RepeatT = tape[ptr++]; let Mode = tape[ptr++]; let TextureTransform = tape[ptr++]; let Parameter = tape[ptr++]; return new IfcSurfaceTexture(expressID, type, RepeatS, RepeatT, Mode, TextureTransform, Parameter); } ToTape() { let args = []; args.push(this.RepeatS); args.push(this.RepeatT); args.push(this.Mode); args.push(this.TextureTransform); args.push(this.Parameter); return args; } }; var IfcSweptAreaSolid = class { constructor(expressID, type, SweptArea, Position) { this.expressID = expressID; this.type = type; this.SweptArea = SweptArea; this.Position = Position; } static FromTape(expressID, type, tape) { let ptr = 0; let SweptArea = tape[ptr++]; let Position = tape[ptr++]; return new IfcSweptAreaSolid(expressID, type, SweptArea, Position); } ToTape() { let args = []; args.push(this.SweptArea); args.push(this.Position); return args; } }; var IfcSweptDiskSolid = class { constructor(expressID, type, Directrix, Radius, InnerRadius, StartParam, EndParam) { this.expressID = expressID; this.type = type; this.Directrix = Directrix; this.Radius = Radius; this.InnerRadius = InnerRadius; this.StartParam = StartParam; this.EndParam = EndParam; } static FromTape(expressID, type, tape) { let ptr = 0; let Directrix = tape[ptr++]; let Radius = tape[ptr++]; let InnerRadius = tape[ptr++]; let StartParam = tape[ptr++]; let EndParam = tape[ptr++]; return new IfcSweptDiskSolid(expressID, type, Directrix, Radius, InnerRadius, StartParam, EndParam); } ToTape() { let args = []; args.push(this.Directrix); args.push(this.Radius); args.push(this.InnerRadius); args.push(this.StartParam); args.push(this.EndParam); return args; } }; var IfcSweptDiskSolidPolygonal = class { constructor(expressID, type, Directrix, Radius, InnerRadius, StartParam, EndParam, FilletRadius) { this.expressID = expressID; this.type = type; this.Directrix = Directrix; this.Radius = Radius; this.InnerRadius = InnerRadius; this.StartParam = StartParam; this.EndParam = EndParam; this.FilletRadius = FilletRadius; } static FromTape(expressID, type, tape) { let ptr = 0; let Directrix = tape[ptr++]; let Radius = tape[ptr++]; let InnerRadius = tape[ptr++]; let StartParam = tape[ptr++]; let EndParam = tape[ptr++]; let FilletRadius = tape[ptr++]; return new IfcSweptDiskSolidPolygonal(expressID, type, Directrix, Radius, InnerRadius, StartParam, EndParam, FilletRadius); } ToTape() { let args = []; args.push(this.Directrix); args.push(this.Radius); args.push(this.InnerRadius); args.push(this.StartParam); args.push(this.EndParam); args.push(this.FilletRadius); return args; } }; var IfcSweptSurface = class { constructor(expressID, type, SweptCurve, Position) { this.expressID = expressID; this.type = type; this.SweptCurve = SweptCurve; this.Position = Position; } static FromTape(expressID, type, tape) { let ptr = 0; let SweptCurve = tape[ptr++]; let Position = tape[ptr++]; return new IfcSweptSurface(expressID, type, SweptCurve, Position); } ToTape() { let args = []; args.push(this.SweptCurve); args.push(this.Position); return args; } }; var IfcSwitchingDevice = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSwitchingDevice(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcSwitchingDeviceType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSwitchingDeviceType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcSystem = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; return new IfcSystem(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); return args; } }; var IfcSystemFurnitureElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSystemFurnitureElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcSystemFurnitureElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcSystemFurnitureElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcTShapeProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position, Depth, FlangeWidth, WebThickness, FlangeThickness, FilletRadius, FlangeEdgeRadius, WebEdgeRadius, WebSlope, FlangeSlope) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; this.Depth = Depth; this.FlangeWidth = FlangeWidth; this.WebThickness = WebThickness; this.FlangeThickness = FlangeThickness; this.FilletRadius = FilletRadius; this.FlangeEdgeRadius = FlangeEdgeRadius; this.WebEdgeRadius = WebEdgeRadius; this.WebSlope = WebSlope; this.FlangeSlope = FlangeSlope; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; let Depth = tape[ptr++]; let FlangeWidth = tape[ptr++]; let WebThickness = tape[ptr++]; let FlangeThickness = tape[ptr++]; let FilletRadius = tape[ptr++]; let FlangeEdgeRadius = tape[ptr++]; let WebEdgeRadius = tape[ptr++]; let WebSlope = tape[ptr++]; let FlangeSlope = tape[ptr++]; return new IfcTShapeProfileDef(expressID, type, ProfileType, ProfileName, Position, Depth, FlangeWidth, WebThickness, FlangeThickness, FilletRadius, FlangeEdgeRadius, WebEdgeRadius, WebSlope, FlangeSlope); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); args.push(this.Depth); args.push(this.FlangeWidth); args.push(this.WebThickness); args.push(this.FlangeThickness); args.push(this.FilletRadius); args.push(this.FlangeEdgeRadius); args.push(this.WebEdgeRadius); args.push(this.WebSlope); args.push(this.FlangeSlope); return args; } }; var IfcTable = class { constructor(expressID, type, Name, Rows, Columns) { this.expressID = expressID; this.type = type; this.Name = Name; this.Rows = Rows; this.Columns = Columns; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Rows = tape[ptr++]; let Columns = tape[ptr++]; return new IfcTable(expressID, type, Name, Rows, Columns); } ToTape() { let args = []; args.push(this.Name); args.push(this.Rows); args.push(this.Columns); return args; } }; var IfcTableColumn = class { constructor(expressID, type, Identifier, Name, Description, Unit, ReferencePath) { this.expressID = expressID; this.type = type; this.Identifier = Identifier; this.Name = Name; this.Description = Description; this.Unit = Unit; this.ReferencePath = ReferencePath; } static FromTape(expressID, type, tape) { let ptr = 0; let Identifier = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let Unit = tape[ptr++]; let ReferencePath = tape[ptr++]; return new IfcTableColumn(expressID, type, Identifier, Name, Description, Unit, ReferencePath); } ToTape() { let args = []; args.push(this.Identifier); args.push(this.Name); args.push(this.Description); args.push(this.Unit); args.push(this.ReferencePath); return args; } }; var IfcTableRow = class { constructor(expressID, type, RowCells, IsHeading) { this.expressID = expressID; this.type = type; this.RowCells = RowCells; this.IsHeading = IsHeading; } static FromTape(expressID, type, tape) { let ptr = 0; let RowCells = tape[ptr++]; let IsHeading = tape[ptr++]; return new IfcTableRow(expressID, type, RowCells, IsHeading); } ToTape() { let args = []; args.push(this.RowCells); args.push(this.IsHeading); return args; } }; var IfcTank = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcTank(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcTankType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcTankType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcTask = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Status, WorkMethod, IsMilestone, Priority, TaskTime, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.LongDescription = LongDescription; this.Status = Status; this.WorkMethod = WorkMethod; this.IsMilestone = IsMilestone; this.Priority = Priority; this.TaskTime = TaskTime; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let Status = tape[ptr++]; let WorkMethod = tape[ptr++]; let IsMilestone = tape[ptr++]; let Priority = tape[ptr++]; let TaskTime = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcTask(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, LongDescription, Status, WorkMethod, IsMilestone, Priority, TaskTime, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.LongDescription); args.push(this.Status); args.push(this.WorkMethod); args.push(this.IsMilestone); args.push(this.Priority); args.push(this.TaskTime); args.push(this.PredefinedType); return args; } }; var IfcTaskTime = class { constructor(expressID, type, Name, DataOrigin, UserDefinedDataOrigin, DurationType, ScheduleDuration, ScheduleStart, ScheduleFinish, EarlyStart, EarlyFinish, LateStart, LateFinish, FreeFloat, TotalFloat, IsCritical, StatusTime, ActualDuration, ActualStart, ActualFinish, RemainingTime, Completion) { this.expressID = expressID; this.type = type; this.Name = Name; this.DataOrigin = DataOrigin; this.UserDefinedDataOrigin = UserDefinedDataOrigin; this.DurationType = DurationType; this.ScheduleDuration = ScheduleDuration; this.ScheduleStart = ScheduleStart; this.ScheduleFinish = ScheduleFinish; this.EarlyStart = EarlyStart; this.EarlyFinish = EarlyFinish; this.LateStart = LateStart; this.LateFinish = LateFinish; this.FreeFloat = FreeFloat; this.TotalFloat = TotalFloat; this.IsCritical = IsCritical; this.StatusTime = StatusTime; this.ActualDuration = ActualDuration; this.ActualStart = ActualStart; this.ActualFinish = ActualFinish; this.RemainingTime = RemainingTime; this.Completion = Completion; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let DataOrigin = tape[ptr++]; let UserDefinedDataOrigin = tape[ptr++]; let DurationType = tape[ptr++]; let ScheduleDuration = tape[ptr++]; let ScheduleStart = tape[ptr++]; let ScheduleFinish = tape[ptr++]; let EarlyStart = tape[ptr++]; let EarlyFinish = tape[ptr++]; let LateStart = tape[ptr++]; let LateFinish = tape[ptr++]; let FreeFloat = tape[ptr++]; let TotalFloat = tape[ptr++]; let IsCritical = tape[ptr++]; let StatusTime = tape[ptr++]; let ActualDuration = tape[ptr++]; let ActualStart = tape[ptr++]; let ActualFinish = tape[ptr++]; let RemainingTime = tape[ptr++]; let Completion = tape[ptr++]; return new IfcTaskTime(expressID, type, Name, DataOrigin, UserDefinedDataOrigin, DurationType, ScheduleDuration, ScheduleStart, ScheduleFinish, EarlyStart, EarlyFinish, LateStart, LateFinish, FreeFloat, TotalFloat, IsCritical, StatusTime, ActualDuration, ActualStart, ActualFinish, RemainingTime, Completion); } ToTape() { let args = []; args.push(this.Name); args.push(this.DataOrigin); args.push(this.UserDefinedDataOrigin); args.push(this.DurationType); args.push(this.ScheduleDuration); args.push(this.ScheduleStart); args.push(this.ScheduleFinish); args.push(this.EarlyStart); args.push(this.EarlyFinish); args.push(this.LateStart); args.push(this.LateFinish); args.push(this.FreeFloat); args.push(this.TotalFloat); args.push(this.IsCritical); args.push(this.StatusTime); args.push(this.ActualDuration); args.push(this.ActualStart); args.push(this.ActualFinish); args.push(this.RemainingTime); args.push(this.Completion); return args; } }; var IfcTaskTimeRecurring = class { constructor(expressID, type, Name, DataOrigin, UserDefinedDataOrigin, DurationType, ScheduleDuration, ScheduleStart, ScheduleFinish, EarlyStart, EarlyFinish, LateStart, LateFinish, FreeFloat, TotalFloat, IsCritical, StatusTime, ActualDuration, ActualStart, ActualFinish, RemainingTime, Completion, Recurrence) { this.expressID = expressID; this.type = type; this.Name = Name; this.DataOrigin = DataOrigin; this.UserDefinedDataOrigin = UserDefinedDataOrigin; this.DurationType = DurationType; this.ScheduleDuration = ScheduleDuration; this.ScheduleStart = ScheduleStart; this.ScheduleFinish = ScheduleFinish; this.EarlyStart = EarlyStart; this.EarlyFinish = EarlyFinish; this.LateStart = LateStart; this.LateFinish = LateFinish; this.FreeFloat = FreeFloat; this.TotalFloat = TotalFloat; this.IsCritical = IsCritical; this.StatusTime = StatusTime; this.ActualDuration = ActualDuration; this.ActualStart = ActualStart; this.ActualFinish = ActualFinish; this.RemainingTime = RemainingTime; this.Completion = Completion; this.Recurrence = Recurrence; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let DataOrigin = tape[ptr++]; let UserDefinedDataOrigin = tape[ptr++]; let DurationType = tape[ptr++]; let ScheduleDuration = tape[ptr++]; let ScheduleStart = tape[ptr++]; let ScheduleFinish = tape[ptr++]; let EarlyStart = tape[ptr++]; let EarlyFinish = tape[ptr++]; let LateStart = tape[ptr++]; let LateFinish = tape[ptr++]; let FreeFloat = tape[ptr++]; let TotalFloat = tape[ptr++]; let IsCritical = tape[ptr++]; let StatusTime = tape[ptr++]; let ActualDuration = tape[ptr++]; let ActualStart = tape[ptr++]; let ActualFinish = tape[ptr++]; let RemainingTime = tape[ptr++]; let Completion = tape[ptr++]; let Recurrence = tape[ptr++]; return new IfcTaskTimeRecurring(expressID, type, Name, DataOrigin, UserDefinedDataOrigin, DurationType, ScheduleDuration, ScheduleStart, ScheduleFinish, EarlyStart, EarlyFinish, LateStart, LateFinish, FreeFloat, TotalFloat, IsCritical, StatusTime, ActualDuration, ActualStart, ActualFinish, RemainingTime, Completion, Recurrence); } ToTape() { let args = []; args.push(this.Name); args.push(this.DataOrigin); args.push(this.UserDefinedDataOrigin); args.push(this.DurationType); args.push(this.ScheduleDuration); args.push(this.ScheduleStart); args.push(this.ScheduleFinish); args.push(this.EarlyStart); args.push(this.EarlyFinish); args.push(this.LateStart); args.push(this.LateFinish); args.push(this.FreeFloat); args.push(this.TotalFloat); args.push(this.IsCritical); args.push(this.StatusTime); args.push(this.ActualDuration); args.push(this.ActualStart); args.push(this.ActualFinish); args.push(this.RemainingTime); args.push(this.Completion); args.push(this.Recurrence); return args; } }; var IfcTaskType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ProcessType, PredefinedType, WorkMethod) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.Identification = Identification; this.LongDescription = LongDescription; this.ProcessType = ProcessType; this.PredefinedType = PredefinedType; this.WorkMethod = WorkMethod; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let ProcessType = tape[ptr++]; let PredefinedType = tape[ptr++]; let WorkMethod = tape[ptr++]; return new IfcTaskType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ProcessType, PredefinedType, WorkMethod); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.Identification); args.push(this.LongDescription); args.push(this.ProcessType); args.push(this.PredefinedType); args.push(this.WorkMethod); return args; } }; var IfcTelecomAddress = class { constructor(expressID, type, Purpose, Description, UserDefinedPurpose, TelephoneNumbers, FacsimileNumbers, PagerNumber, ElectronicMailAddresses, WWWHomePageURL, MessagingIDs) { this.expressID = expressID; this.type = type; this.Purpose = Purpose; this.Description = Description; this.UserDefinedPurpose = UserDefinedPurpose; this.TelephoneNumbers = TelephoneNumbers; this.FacsimileNumbers = FacsimileNumbers; this.PagerNumber = PagerNumber; this.ElectronicMailAddresses = ElectronicMailAddresses; this.WWWHomePageURL = WWWHomePageURL; this.MessagingIDs = MessagingIDs; } static FromTape(expressID, type, tape) { let ptr = 0; let Purpose = tape[ptr++]; let Description = tape[ptr++]; let UserDefinedPurpose = tape[ptr++]; let TelephoneNumbers = tape[ptr++]; let FacsimileNumbers = tape[ptr++]; let PagerNumber = tape[ptr++]; let ElectronicMailAddresses = tape[ptr++]; let WWWHomePageURL = tape[ptr++]; let MessagingIDs = tape[ptr++]; return new IfcTelecomAddress(expressID, type, Purpose, Description, UserDefinedPurpose, TelephoneNumbers, FacsimileNumbers, PagerNumber, ElectronicMailAddresses, WWWHomePageURL, MessagingIDs); } ToTape() { let args = []; args.push(this.Purpose); args.push(this.Description); args.push(this.UserDefinedPurpose); args.push(this.TelephoneNumbers); args.push(this.FacsimileNumbers); args.push(this.PagerNumber); args.push(this.ElectronicMailAddresses); args.push(this.WWWHomePageURL); args.push(this.MessagingIDs); return args; } }; var IfcTendon = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, SteelGrade, PredefinedType, NominalDiameter, CrossSectionArea, TensionForce, PreStress, FrictionCoefficient, AnchorageSlip, MinCurvatureRadius) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.SteelGrade = SteelGrade; this.PredefinedType = PredefinedType; this.NominalDiameter = NominalDiameter; this.CrossSectionArea = CrossSectionArea; this.TensionForce = TensionForce; this.PreStress = PreStress; this.FrictionCoefficient = FrictionCoefficient; this.AnchorageSlip = AnchorageSlip; this.MinCurvatureRadius = MinCurvatureRadius; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let SteelGrade = tape[ptr++]; let PredefinedType = tape[ptr++]; let NominalDiameter = tape[ptr++]; let CrossSectionArea = tape[ptr++]; let TensionForce = tape[ptr++]; let PreStress = tape[ptr++]; let FrictionCoefficient = tape[ptr++]; let AnchorageSlip = tape[ptr++]; let MinCurvatureRadius = tape[ptr++]; return new IfcTendon(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, SteelGrade, PredefinedType, NominalDiameter, CrossSectionArea, TensionForce, PreStress, FrictionCoefficient, AnchorageSlip, MinCurvatureRadius); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.SteelGrade); args.push(this.PredefinedType); args.push(this.NominalDiameter); args.push(this.CrossSectionArea); args.push(this.TensionForce); args.push(this.PreStress); args.push(this.FrictionCoefficient); args.push(this.AnchorageSlip); args.push(this.MinCurvatureRadius); return args; } }; var IfcTendonAnchor = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, SteelGrade, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.SteelGrade = SteelGrade; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let SteelGrade = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcTendonAnchor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, SteelGrade, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.SteelGrade); args.push(this.PredefinedType); return args; } }; var IfcTendonAnchorType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcTendonAnchorType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcTendonConduit = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, SteelGrade, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.SteelGrade = SteelGrade; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let SteelGrade = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcTendonConduit(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, SteelGrade, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.SteelGrade); args.push(this.PredefinedType); return args; } }; var IfcTendonConduitType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcTendonConduitType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcTendonType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, NominalDiameter, CrossSectionArea, SheathDiameter) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; this.NominalDiameter = NominalDiameter; this.CrossSectionArea = CrossSectionArea; this.SheathDiameter = SheathDiameter; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; let NominalDiameter = tape[ptr++]; let CrossSectionArea = tape[ptr++]; let SheathDiameter = tape[ptr++]; return new IfcTendonType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, NominalDiameter, CrossSectionArea, SheathDiameter); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); args.push(this.NominalDiameter); args.push(this.CrossSectionArea); args.push(this.SheathDiameter); return args; } }; var IfcTessellatedFaceSet = class { constructor(expressID, type, Coordinates) { this.expressID = expressID; this.type = type; this.Coordinates = Coordinates; } static FromTape(expressID, type, tape) { let ptr = 0; let Coordinates = tape[ptr++]; return new IfcTessellatedFaceSet(expressID, type, Coordinates); } ToTape() { let args = []; args.push(this.Coordinates); return args; } }; var IfcTessellatedItem = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcTessellatedItem(expressID, type); } ToTape() { let args = []; return args; } }; var IfcTextLiteral = class { constructor(expressID, type, Literal, Placement, Path) { this.expressID = expressID; this.type = type; this.Literal = Literal; this.Placement = Placement; this.Path = Path; } static FromTape(expressID, type, tape) { let ptr = 0; let Literal = tape[ptr++]; let Placement = tape[ptr++]; let Path = tape[ptr++]; return new IfcTextLiteral(expressID, type, Literal, Placement, Path); } ToTape() { let args = []; args.push(this.Literal); args.push(this.Placement); args.push(this.Path); return args; } }; var IfcTextLiteralWithExtent = class { constructor(expressID, type, Literal, Placement, Path, Extent, BoxAlignment) { this.expressID = expressID; this.type = type; this.Literal = Literal; this.Placement = Placement; this.Path = Path; this.Extent = Extent; this.BoxAlignment = BoxAlignment; } static FromTape(expressID, type, tape) { let ptr = 0; let Literal = tape[ptr++]; let Placement = tape[ptr++]; let Path = tape[ptr++]; let Extent = tape[ptr++]; let BoxAlignment = tape[ptr++]; return new IfcTextLiteralWithExtent(expressID, type, Literal, Placement, Path, Extent, BoxAlignment); } ToTape() { let args = []; args.push(this.Literal); args.push(this.Placement); args.push(this.Path); args.push(this.Extent); args.push(this.BoxAlignment); return args; } }; var IfcTextStyle = class { constructor(expressID, type, Name, TextCharacterAppearance, TextStyle, TextFontStyle, ModelOrDraughting) { this.expressID = expressID; this.type = type; this.Name = Name; this.TextCharacterAppearance = TextCharacterAppearance; this.TextStyle = TextStyle; this.TextFontStyle = TextFontStyle; this.ModelOrDraughting = ModelOrDraughting; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let TextCharacterAppearance = tape[ptr++]; let TextStyle = tape[ptr++]; let TextFontStyle = tape[ptr++]; let ModelOrDraughting = tape[ptr++]; return new IfcTextStyle(expressID, type, Name, TextCharacterAppearance, TextStyle, TextFontStyle, ModelOrDraughting); } ToTape() { let args = []; args.push(this.Name); args.push(this.TextCharacterAppearance); args.push(this.TextStyle); args.push(this.TextFontStyle); args.push(this.ModelOrDraughting); return args; } }; var IfcTextStyleFontModel = class { constructor(expressID, type, Name, FontFamily, FontStyle, FontVariant, FontWeight, FontSize) { this.expressID = expressID; this.type = type; this.Name = Name; this.FontFamily = FontFamily; this.FontStyle = FontStyle; this.FontVariant = FontVariant; this.FontWeight = FontWeight; this.FontSize = FontSize; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let FontFamily = tape[ptr++]; let FontStyle = tape[ptr++]; let FontVariant = tape[ptr++]; let FontWeight = tape[ptr++]; let FontSize = tape[ptr++]; return new IfcTextStyleFontModel(expressID, type, Name, FontFamily, FontStyle, FontVariant, FontWeight, FontSize); } ToTape() { let args = []; args.push(this.Name); args.push(this.FontFamily); args.push(this.FontStyle); args.push(this.FontVariant); args.push(this.FontWeight); args.push(this.FontSize); return args; } }; var IfcTextStyleForDefinedFont = class { constructor(expressID, type, Colour, BackgroundColour) { this.expressID = expressID; this.type = type; this.Colour = Colour; this.BackgroundColour = BackgroundColour; } static FromTape(expressID, type, tape) { let ptr = 0; let Colour = tape[ptr++]; let BackgroundColour = tape[ptr++]; return new IfcTextStyleForDefinedFont(expressID, type, Colour, BackgroundColour); } ToTape() { let args = []; args.push(this.Colour); args.push(this.BackgroundColour); return args; } }; var IfcTextStyleTextModel = class { constructor(expressID, type, TextIndent, TextAlign, TextDecoration, LetterSpacing, WordSpacing, TextTransform, LineHeight) { this.expressID = expressID; this.type = type; this.TextIndent = TextIndent; this.TextAlign = TextAlign; this.TextDecoration = TextDecoration; this.LetterSpacing = LetterSpacing; this.WordSpacing = WordSpacing; this.TextTransform = TextTransform; this.LineHeight = LineHeight; } static FromTape(expressID, type, tape) { let ptr = 0; let TextIndent = tape[ptr++]; let TextAlign = tape[ptr++]; let TextDecoration = tape[ptr++]; let LetterSpacing = tape[ptr++]; let WordSpacing = tape[ptr++]; let TextTransform = tape[ptr++]; let LineHeight = tape[ptr++]; return new IfcTextStyleTextModel(expressID, type, TextIndent, TextAlign, TextDecoration, LetterSpacing, WordSpacing, TextTransform, LineHeight); } ToTape() { let args = []; args.push(this.TextIndent); args.push(this.TextAlign); args.push(this.TextDecoration); args.push(this.LetterSpacing); args.push(this.WordSpacing); args.push(this.TextTransform); args.push(this.LineHeight); return args; } }; var IfcTextureCoordinate = class { constructor(expressID, type, Maps) { this.expressID = expressID; this.type = type; this.Maps = Maps; } static FromTape(expressID, type, tape) { let ptr = 0; let Maps = tape[ptr++]; return new IfcTextureCoordinate(expressID, type, Maps); } ToTape() { let args = []; args.push(this.Maps); return args; } }; var IfcTextureCoordinateGenerator = class { constructor(expressID, type, Maps, Mode, Parameter) { this.expressID = expressID; this.type = type; this.Maps = Maps; this.Mode = Mode; this.Parameter = Parameter; } static FromTape(expressID, type, tape) { let ptr = 0; let Maps = tape[ptr++]; let Mode = tape[ptr++]; let Parameter = tape[ptr++]; return new IfcTextureCoordinateGenerator(expressID, type, Maps, Mode, Parameter); } ToTape() { let args = []; args.push(this.Maps); args.push(this.Mode); args.push(this.Parameter); return args; } }; var IfcTextureMap = class { constructor(expressID, type, Maps, Vertices, MappedTo) { this.expressID = expressID; this.type = type; this.Maps = Maps; this.Vertices = Vertices; this.MappedTo = MappedTo; } static FromTape(expressID, type, tape) { let ptr = 0; let Maps = tape[ptr++]; let Vertices = tape[ptr++]; let MappedTo = tape[ptr++]; return new IfcTextureMap(expressID, type, Maps, Vertices, MappedTo); } ToTape() { let args = []; args.push(this.Maps); args.push(this.Vertices); args.push(this.MappedTo); return args; } }; var IfcTextureVertex = class { constructor(expressID, type, Coordinates) { this.expressID = expressID; this.type = type; this.Coordinates = Coordinates; } static FromTape(expressID, type, tape) { let ptr = 0; let Coordinates = tape[ptr++]; return new IfcTextureVertex(expressID, type, Coordinates); } ToTape() { let args = []; args.push(this.Coordinates); return args; } }; var IfcTextureVertexList = class { constructor(expressID, type, TexCoordsList) { this.expressID = expressID; this.type = type; this.TexCoordsList = TexCoordsList; } static FromTape(expressID, type, tape) { let ptr = 0; let TexCoordsList = tape[ptr++]; return new IfcTextureVertexList(expressID, type, TexCoordsList); } ToTape() { let args = []; args.push(this.TexCoordsList); return args; } }; var IfcTimePeriod = class { constructor(expressID, type, StartTime, EndTime) { this.expressID = expressID; this.type = type; this.StartTime = StartTime; this.EndTime = EndTime; } static FromTape(expressID, type, tape) { let ptr = 0; let StartTime = tape[ptr++]; let EndTime = tape[ptr++]; return new IfcTimePeriod(expressID, type, StartTime, EndTime); } ToTape() { let args = []; args.push(this.StartTime); args.push(this.EndTime); return args; } }; var IfcTimeSeries = class { constructor(expressID, type, Name, Description, StartTime, EndTime, TimeSeriesDataType, DataOrigin, UserDefinedDataOrigin, Unit) { this.expressID = expressID; this.type = type; this.Name = Name; this.Description = Description; this.StartTime = StartTime; this.EndTime = EndTime; this.TimeSeriesDataType = TimeSeriesDataType; this.DataOrigin = DataOrigin; this.UserDefinedDataOrigin = UserDefinedDataOrigin; this.Unit = Unit; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let Description = tape[ptr++]; let StartTime = tape[ptr++]; let EndTime = tape[ptr++]; let TimeSeriesDataType = tape[ptr++]; let DataOrigin = tape[ptr++]; let UserDefinedDataOrigin = tape[ptr++]; let Unit = tape[ptr++]; return new IfcTimeSeries(expressID, type, Name, Description, StartTime, EndTime, TimeSeriesDataType, DataOrigin, UserDefinedDataOrigin, Unit); } ToTape() { let args = []; args.push(this.Name); args.push(this.Description); args.push(this.StartTime); args.push(this.EndTime); args.push(this.TimeSeriesDataType); args.push(this.DataOrigin); args.push(this.UserDefinedDataOrigin); args.push(this.Unit); return args; } }; var IfcTimeSeriesValue = class { constructor(expressID, type, ListValues) { this.expressID = expressID; this.type = type; this.ListValues = ListValues; } static FromTape(expressID, type, tape) { let ptr = 0; let ListValues = tape[ptr++]; return new IfcTimeSeriesValue(expressID, type, ListValues); } ToTape() { let args = []; args.push(this.ListValues); return args; } }; var IfcTopologicalRepresentationItem = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcTopologicalRepresentationItem(expressID, type); } ToTape() { let args = []; return args; } }; var IfcTopologyRepresentation = class { constructor(expressID, type, ContextOfItems, RepresentationIdentifier, RepresentationType, Items) { this.expressID = expressID; this.type = type; this.ContextOfItems = ContextOfItems; this.RepresentationIdentifier = RepresentationIdentifier; this.RepresentationType = RepresentationType; this.Items = Items; } static FromTape(expressID, type, tape) { let ptr = 0; let ContextOfItems = tape[ptr++]; let RepresentationIdentifier = tape[ptr++]; let RepresentationType = tape[ptr++]; let Items = tape[ptr++]; return new IfcTopologyRepresentation(expressID, type, ContextOfItems, RepresentationIdentifier, RepresentationType, Items); } ToTape() { let args = []; args.push(this.ContextOfItems); args.push(this.RepresentationIdentifier); args.push(this.RepresentationType); args.push(this.Items); return args; } }; var IfcToroidalSurface = class { constructor(expressID, type, Position, MajorRadius, MinorRadius) { this.expressID = expressID; this.type = type; this.Position = Position; this.MajorRadius = MajorRadius; this.MinorRadius = MinorRadius; } static FromTape(expressID, type, tape) { let ptr = 0; let Position = tape[ptr++]; let MajorRadius = tape[ptr++]; let MinorRadius = tape[ptr++]; return new IfcToroidalSurface(expressID, type, Position, MajorRadius, MinorRadius); } ToTape() { let args = []; args.push(this.Position); args.push(this.MajorRadius); args.push(this.MinorRadius); return args; } }; var IfcTransformer = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcTransformer(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcTransformerType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcTransformerType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcTransitionCurveSegment2D = class { constructor(expressID, type, StartPoint, StartDirection, SegmentLength, StartRadius, EndRadius, IsStartRadiusCCW, IsEndRadiusCCW, TransitionCurveType) { this.expressID = expressID; this.type = type; this.StartPoint = StartPoint; this.StartDirection = StartDirection; this.SegmentLength = SegmentLength; this.StartRadius = StartRadius; this.EndRadius = EndRadius; this.IsStartRadiusCCW = IsStartRadiusCCW; this.IsEndRadiusCCW = IsEndRadiusCCW; this.TransitionCurveType = TransitionCurveType; } static FromTape(expressID, type, tape) { let ptr = 0; let StartPoint = tape[ptr++]; let StartDirection = tape[ptr++]; let SegmentLength = tape[ptr++]; let StartRadius = tape[ptr++]; let EndRadius = tape[ptr++]; let IsStartRadiusCCW = tape[ptr++]; let IsEndRadiusCCW = tape[ptr++]; let TransitionCurveType = tape[ptr++]; return new IfcTransitionCurveSegment2D(expressID, type, StartPoint, StartDirection, SegmentLength, StartRadius, EndRadius, IsStartRadiusCCW, IsEndRadiusCCW, TransitionCurveType); } ToTape() { let args = []; args.push(this.StartPoint); args.push(this.StartDirection); args.push(this.SegmentLength); args.push(this.StartRadius); args.push(this.EndRadius); args.push(this.IsStartRadiusCCW); args.push(this.IsEndRadiusCCW); args.push(this.TransitionCurveType); return args; } }; var IfcTransportElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcTransportElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcTransportElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcTransportElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcTrapeziumProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position, BottomXDim, TopXDim, YDim, TopXOffset) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; this.BottomXDim = BottomXDim; this.TopXDim = TopXDim; this.YDim = YDim; this.TopXOffset = TopXOffset; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; let BottomXDim = tape[ptr++]; let TopXDim = tape[ptr++]; let YDim = tape[ptr++]; let TopXOffset = tape[ptr++]; return new IfcTrapeziumProfileDef(expressID, type, ProfileType, ProfileName, Position, BottomXDim, TopXDim, YDim, TopXOffset); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); args.push(this.BottomXDim); args.push(this.TopXDim); args.push(this.YDim); args.push(this.TopXOffset); return args; } }; var IfcTriangulatedFaceSet = class { constructor(expressID, type, Coordinates, Normals, Closed, CoordIndex, PnIndex) { this.expressID = expressID; this.type = type; this.Coordinates = Coordinates; this.Normals = Normals; this.Closed = Closed; this.CoordIndex = CoordIndex; this.PnIndex = PnIndex; } static FromTape(expressID, type, tape) { let ptr = 0; let Coordinates = tape[ptr++]; let Normals = tape[ptr++]; let Closed = tape[ptr++]; let CoordIndex = tape[ptr++]; let PnIndex = tape[ptr++]; return new IfcTriangulatedFaceSet(expressID, type, Coordinates, Normals, Closed, CoordIndex, PnIndex); } ToTape() { let args = []; args.push(this.Coordinates); args.push(this.Normals); args.push(this.Closed); args.push(this.CoordIndex); args.push(this.PnIndex); return args; } }; var IfcTriangulatedIrregularNetwork = class { constructor(expressID, type, Coordinates, Normals, Closed, CoordIndex, PnIndex, Flags) { this.expressID = expressID; this.type = type; this.Coordinates = Coordinates; this.Normals = Normals; this.Closed = Closed; this.CoordIndex = CoordIndex; this.PnIndex = PnIndex; this.Flags = Flags; } static FromTape(expressID, type, tape) { let ptr = 0; let Coordinates = tape[ptr++]; let Normals = tape[ptr++]; let Closed = tape[ptr++]; let CoordIndex = tape[ptr++]; let PnIndex = tape[ptr++]; let Flags = tape[ptr++]; return new IfcTriangulatedIrregularNetwork(expressID, type, Coordinates, Normals, Closed, CoordIndex, PnIndex, Flags); } ToTape() { let args = []; args.push(this.Coordinates); args.push(this.Normals); args.push(this.Closed); args.push(this.CoordIndex); args.push(this.PnIndex); args.push(this.Flags); return args; } }; var IfcTrimmedCurve = class { constructor(expressID, type, BasisCurve, Trim1, Trim2, SenseAgreement, MasterRepresentation) { this.expressID = expressID; this.type = type; this.BasisCurve = BasisCurve; this.Trim1 = Trim1; this.Trim2 = Trim2; this.SenseAgreement = SenseAgreement; this.MasterRepresentation = MasterRepresentation; } static FromTape(expressID, type, tape) { let ptr = 0; let BasisCurve = tape[ptr++]; let Trim1 = tape[ptr++]; let Trim2 = tape[ptr++]; let SenseAgreement = tape[ptr++]; let MasterRepresentation = tape[ptr++]; return new IfcTrimmedCurve(expressID, type, BasisCurve, Trim1, Trim2, SenseAgreement, MasterRepresentation); } ToTape() { let args = []; args.push(this.BasisCurve); args.push(this.Trim1); args.push(this.Trim2); args.push(this.SenseAgreement); args.push(this.MasterRepresentation); return args; } }; var IfcTubeBundle = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcTubeBundle(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcTubeBundleType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcTubeBundleType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcTypeObject = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; return new IfcTypeObject(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); return args; } }; var IfcTypeProcess = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ProcessType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.Identification = Identification; this.LongDescription = LongDescription; this.ProcessType = ProcessType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let ProcessType = tape[ptr++]; return new IfcTypeProcess(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ProcessType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.Identification); args.push(this.LongDescription); args.push(this.ProcessType); return args; } }; var IfcTypeProduct = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; return new IfcTypeProduct(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); return args; } }; var IfcTypeResource = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.Identification = Identification; this.LongDescription = LongDescription; this.ResourceType = ResourceType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let Identification = tape[ptr++]; let LongDescription = tape[ptr++]; let ResourceType = tape[ptr++]; return new IfcTypeResource(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, Identification, LongDescription, ResourceType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.Identification); args.push(this.LongDescription); args.push(this.ResourceType); return args; } }; var IfcUShapeProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position, Depth, FlangeWidth, WebThickness, FlangeThickness, FilletRadius, EdgeRadius, FlangeSlope) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; this.Depth = Depth; this.FlangeWidth = FlangeWidth; this.WebThickness = WebThickness; this.FlangeThickness = FlangeThickness; this.FilletRadius = FilletRadius; this.EdgeRadius = EdgeRadius; this.FlangeSlope = FlangeSlope; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; let Depth = tape[ptr++]; let FlangeWidth = tape[ptr++]; let WebThickness = tape[ptr++]; let FlangeThickness = tape[ptr++]; let FilletRadius = tape[ptr++]; let EdgeRadius = tape[ptr++]; let FlangeSlope = tape[ptr++]; return new IfcUShapeProfileDef(expressID, type, ProfileType, ProfileName, Position, Depth, FlangeWidth, WebThickness, FlangeThickness, FilletRadius, EdgeRadius, FlangeSlope); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); args.push(this.Depth); args.push(this.FlangeWidth); args.push(this.WebThickness); args.push(this.FlangeThickness); args.push(this.FilletRadius); args.push(this.EdgeRadius); args.push(this.FlangeSlope); return args; } }; var IfcUnitAssignment = class { constructor(expressID, type, Units) { this.expressID = expressID; this.type = type; this.Units = Units; } static FromTape(expressID, type, tape) { let ptr = 0; let Units = tape[ptr++]; return new IfcUnitAssignment(expressID, type, Units); } ToTape() { let args = []; args.push(this.Units); return args; } }; var IfcUnitaryControlElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcUnitaryControlElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcUnitaryControlElementType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcUnitaryControlElementType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcUnitaryEquipment = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcUnitaryEquipment(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcUnitaryEquipmentType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcUnitaryEquipmentType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcValve = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcValve(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcValveType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcValveType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcVector = class { constructor(expressID, type, Orientation, Magnitude) { this.expressID = expressID; this.type = type; this.Orientation = Orientation; this.Magnitude = Magnitude; } static FromTape(expressID, type, tape) { let ptr = 0; let Orientation = tape[ptr++]; let Magnitude = tape[ptr++]; return new IfcVector(expressID, type, Orientation, Magnitude); } ToTape() { let args = []; args.push(this.Orientation); args.push(this.Magnitude); return args; } }; var IfcVertex = class { constructor(expressID, type) { this.expressID = expressID; this.type = type; } static FromTape(expressID, type, tape) { return new IfcVertex(expressID, type); } ToTape() { let args = []; return args; } }; var IfcVertexLoop = class { constructor(expressID, type, LoopVertex) { this.expressID = expressID; this.type = type; this.LoopVertex = LoopVertex; } static FromTape(expressID, type, tape) { let ptr = 0; let LoopVertex = tape[ptr++]; return new IfcVertexLoop(expressID, type, LoopVertex); } ToTape() { let args = []; args.push(this.LoopVertex); return args; } }; var IfcVertexPoint = class { constructor(expressID, type, VertexGeometry) { this.expressID = expressID; this.type = type; this.VertexGeometry = VertexGeometry; } static FromTape(expressID, type, tape) { let ptr = 0; let VertexGeometry = tape[ptr++]; return new IfcVertexPoint(expressID, type, VertexGeometry); } ToTape() { let args = []; args.push(this.VertexGeometry); return args; } }; var IfcVibrationDamper = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcVibrationDamper(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcVibrationDamperType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcVibrationDamperType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcVibrationIsolator = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcVibrationIsolator(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcVibrationIsolatorType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcVibrationIsolatorType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcVirtualElement = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; return new IfcVirtualElement(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); return args; } }; var IfcVirtualGridIntersection = class { constructor(expressID, type, IntersectingAxes, OffsetDistances) { this.expressID = expressID; this.type = type; this.IntersectingAxes = IntersectingAxes; this.OffsetDistances = OffsetDistances; } static FromTape(expressID, type, tape) { let ptr = 0; let IntersectingAxes = tape[ptr++]; let OffsetDistances = tape[ptr++]; return new IfcVirtualGridIntersection(expressID, type, IntersectingAxes, OffsetDistances); } ToTape() { let args = []; args.push(this.IntersectingAxes); args.push(this.OffsetDistances); return args; } }; var IfcVoidingFeature = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcVoidingFeature(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcWall = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcWall(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcWallElementedCase = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcWallElementedCase(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcWallStandardCase = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcWallStandardCase(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcWallType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcWallType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcWasteTerminal = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcWasteTerminal(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.PredefinedType); return args; } }; var IfcWasteTerminalType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcWasteTerminalType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); return args; } }; var IfcWindow = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, OverallHeight, OverallWidth, PredefinedType, PartitioningType, UserDefinedPartitioningType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.OverallHeight = OverallHeight; this.OverallWidth = OverallWidth; this.PredefinedType = PredefinedType; this.PartitioningType = PartitioningType; this.UserDefinedPartitioningType = UserDefinedPartitioningType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let OverallHeight = tape[ptr++]; let OverallWidth = tape[ptr++]; let PredefinedType = tape[ptr++]; let PartitioningType = tape[ptr++]; let UserDefinedPartitioningType = tape[ptr++]; return new IfcWindow(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, OverallHeight, OverallWidth, PredefinedType, PartitioningType, UserDefinedPartitioningType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.OverallHeight); args.push(this.OverallWidth); args.push(this.PredefinedType); args.push(this.PartitioningType); args.push(this.UserDefinedPartitioningType); return args; } }; var IfcWindowLiningProperties = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, LiningDepth, LiningThickness, TransomThickness, MullionThickness, FirstTransomOffset, SecondTransomOffset, FirstMullionOffset, SecondMullionOffset, ShapeAspectStyle, LiningOffset, LiningToPanelOffsetX, LiningToPanelOffsetY) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.LiningDepth = LiningDepth; this.LiningThickness = LiningThickness; this.TransomThickness = TransomThickness; this.MullionThickness = MullionThickness; this.FirstTransomOffset = FirstTransomOffset; this.SecondTransomOffset = SecondTransomOffset; this.FirstMullionOffset = FirstMullionOffset; this.SecondMullionOffset = SecondMullionOffset; this.ShapeAspectStyle = ShapeAspectStyle; this.LiningOffset = LiningOffset; this.LiningToPanelOffsetX = LiningToPanelOffsetX; this.LiningToPanelOffsetY = LiningToPanelOffsetY; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let LiningDepth = tape[ptr++]; let LiningThickness = tape[ptr++]; let TransomThickness = tape[ptr++]; let MullionThickness = tape[ptr++]; let FirstTransomOffset = tape[ptr++]; let SecondTransomOffset = tape[ptr++]; let FirstMullionOffset = tape[ptr++]; let SecondMullionOffset = tape[ptr++]; let ShapeAspectStyle = tape[ptr++]; let LiningOffset = tape[ptr++]; let LiningToPanelOffsetX = tape[ptr++]; let LiningToPanelOffsetY = tape[ptr++]; return new IfcWindowLiningProperties(expressID, type, GlobalId, OwnerHistory, Name, Description, LiningDepth, LiningThickness, TransomThickness, MullionThickness, FirstTransomOffset, SecondTransomOffset, FirstMullionOffset, SecondMullionOffset, ShapeAspectStyle, LiningOffset, LiningToPanelOffsetX, LiningToPanelOffsetY); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.LiningDepth); args.push(this.LiningThickness); args.push(this.TransomThickness); args.push(this.MullionThickness); args.push(this.FirstTransomOffset); args.push(this.SecondTransomOffset); args.push(this.FirstMullionOffset); args.push(this.SecondMullionOffset); args.push(this.ShapeAspectStyle); args.push(this.LiningOffset); args.push(this.LiningToPanelOffsetX); args.push(this.LiningToPanelOffsetY); return args; } }; var IfcWindowPanelProperties = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, OperationType, PanelPosition, FrameDepth, FrameThickness, ShapeAspectStyle) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.OperationType = OperationType; this.PanelPosition = PanelPosition; this.FrameDepth = FrameDepth; this.FrameThickness = FrameThickness; this.ShapeAspectStyle = ShapeAspectStyle; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let OperationType = tape[ptr++]; let PanelPosition = tape[ptr++]; let FrameDepth = tape[ptr++]; let FrameThickness = tape[ptr++]; let ShapeAspectStyle = tape[ptr++]; return new IfcWindowPanelProperties(expressID, type, GlobalId, OwnerHistory, Name, Description, OperationType, PanelPosition, FrameDepth, FrameThickness, ShapeAspectStyle); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.OperationType); args.push(this.PanelPosition); args.push(this.FrameDepth); args.push(this.FrameThickness); args.push(this.ShapeAspectStyle); return args; } }; var IfcWindowStandardCase = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, OverallHeight, OverallWidth, PredefinedType, PartitioningType, UserDefinedPartitioningType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.ObjectPlacement = ObjectPlacement; this.Representation = Representation; this.Tag = Tag; this.OverallHeight = OverallHeight; this.OverallWidth = OverallWidth; this.PredefinedType = PredefinedType; this.PartitioningType = PartitioningType; this.UserDefinedPartitioningType = UserDefinedPartitioningType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let ObjectPlacement = tape[ptr++]; let Representation = tape[ptr++]; let Tag = tape[ptr++]; let OverallHeight = tape[ptr++]; let OverallWidth = tape[ptr++]; let PredefinedType = tape[ptr++]; let PartitioningType = tape[ptr++]; let UserDefinedPartitioningType = tape[ptr++]; return new IfcWindowStandardCase(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, ObjectPlacement, Representation, Tag, OverallHeight, OverallWidth, PredefinedType, PartitioningType, UserDefinedPartitioningType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.ObjectPlacement); args.push(this.Representation); args.push(this.Tag); args.push(this.OverallHeight); args.push(this.OverallWidth); args.push(this.PredefinedType); args.push(this.PartitioningType); args.push(this.UserDefinedPartitioningType); return args; } }; var IfcWindowStyle = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ConstructionType, OperationType, ParameterTakesPrecedence, Sizeable) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ConstructionType = ConstructionType; this.OperationType = OperationType; this.ParameterTakesPrecedence = ParameterTakesPrecedence; this.Sizeable = Sizeable; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ConstructionType = tape[ptr++]; let OperationType = tape[ptr++]; let ParameterTakesPrecedence = tape[ptr++]; let Sizeable = tape[ptr++]; return new IfcWindowStyle(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ConstructionType, OperationType, ParameterTakesPrecedence, Sizeable); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ConstructionType); args.push(this.OperationType); args.push(this.ParameterTakesPrecedence); args.push(this.Sizeable); return args; } }; var IfcWindowType = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, PartitioningType, ParameterTakesPrecedence, UserDefinedPartitioningType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ApplicableOccurrence = ApplicableOccurrence; this.HasPropertySets = HasPropertySets; this.RepresentationMaps = RepresentationMaps; this.Tag = Tag; this.ElementType = ElementType; this.PredefinedType = PredefinedType; this.PartitioningType = PartitioningType; this.ParameterTakesPrecedence = ParameterTakesPrecedence; this.UserDefinedPartitioningType = UserDefinedPartitioningType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ApplicableOccurrence = tape[ptr++]; let HasPropertySets = tape[ptr++]; let RepresentationMaps = tape[ptr++]; let Tag = tape[ptr++]; let ElementType = tape[ptr++]; let PredefinedType = tape[ptr++]; let PartitioningType = tape[ptr++]; let ParameterTakesPrecedence = tape[ptr++]; let UserDefinedPartitioningType = tape[ptr++]; return new IfcWindowType(expressID, type, GlobalId, OwnerHistory, Name, Description, ApplicableOccurrence, HasPropertySets, RepresentationMaps, Tag, ElementType, PredefinedType, PartitioningType, ParameterTakesPrecedence, UserDefinedPartitioningType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ApplicableOccurrence); args.push(this.HasPropertySets); args.push(this.RepresentationMaps); args.push(this.Tag); args.push(this.ElementType); args.push(this.PredefinedType); args.push(this.PartitioningType); args.push(this.ParameterTakesPrecedence); args.push(this.UserDefinedPartitioningType); return args; } }; var IfcWorkCalendar = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, WorkingTimes, ExceptionTimes, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.WorkingTimes = WorkingTimes; this.ExceptionTimes = ExceptionTimes; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let WorkingTimes = tape[ptr++]; let ExceptionTimes = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcWorkCalendar(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, WorkingTimes, ExceptionTimes, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.WorkingTimes); args.push(this.ExceptionTimes); args.push(this.PredefinedType); return args; } }; var IfcWorkControl = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, CreationDate, Creators, Purpose, Duration, TotalFloat, StartTime, FinishTime) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.CreationDate = CreationDate; this.Creators = Creators; this.Purpose = Purpose; this.Duration = Duration; this.TotalFloat = TotalFloat; this.StartTime = StartTime; this.FinishTime = FinishTime; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let CreationDate = tape[ptr++]; let Creators = tape[ptr++]; let Purpose = tape[ptr++]; let Duration = tape[ptr++]; let TotalFloat = tape[ptr++]; let StartTime = tape[ptr++]; let FinishTime = tape[ptr++]; return new IfcWorkControl(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, CreationDate, Creators, Purpose, Duration, TotalFloat, StartTime, FinishTime); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.CreationDate); args.push(this.Creators); args.push(this.Purpose); args.push(this.Duration); args.push(this.TotalFloat); args.push(this.StartTime); args.push(this.FinishTime); return args; } }; var IfcWorkPlan = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, CreationDate, Creators, Purpose, Duration, TotalFloat, StartTime, FinishTime, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.CreationDate = CreationDate; this.Creators = Creators; this.Purpose = Purpose; this.Duration = Duration; this.TotalFloat = TotalFloat; this.StartTime = StartTime; this.FinishTime = FinishTime; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let CreationDate = tape[ptr++]; let Creators = tape[ptr++]; let Purpose = tape[ptr++]; let Duration = tape[ptr++]; let TotalFloat = tape[ptr++]; let StartTime = tape[ptr++]; let FinishTime = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcWorkPlan(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, CreationDate, Creators, Purpose, Duration, TotalFloat, StartTime, FinishTime, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.CreationDate); args.push(this.Creators); args.push(this.Purpose); args.push(this.Duration); args.push(this.TotalFloat); args.push(this.StartTime); args.push(this.FinishTime); args.push(this.PredefinedType); return args; } }; var IfcWorkSchedule = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, CreationDate, Creators, Purpose, Duration, TotalFloat, StartTime, FinishTime, PredefinedType) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.Identification = Identification; this.CreationDate = CreationDate; this.Creators = Creators; this.Purpose = Purpose; this.Duration = Duration; this.TotalFloat = TotalFloat; this.StartTime = StartTime; this.FinishTime = FinishTime; this.PredefinedType = PredefinedType; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let Identification = tape[ptr++]; let CreationDate = tape[ptr++]; let Creators = tape[ptr++]; let Purpose = tape[ptr++]; let Duration = tape[ptr++]; let TotalFloat = tape[ptr++]; let StartTime = tape[ptr++]; let FinishTime = tape[ptr++]; let PredefinedType = tape[ptr++]; return new IfcWorkSchedule(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, Identification, CreationDate, Creators, Purpose, Duration, TotalFloat, StartTime, FinishTime, PredefinedType); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.Identification); args.push(this.CreationDate); args.push(this.Creators); args.push(this.Purpose); args.push(this.Duration); args.push(this.TotalFloat); args.push(this.StartTime); args.push(this.FinishTime); args.push(this.PredefinedType); return args; } }; var IfcWorkTime = class { constructor(expressID, type, Name, DataOrigin, UserDefinedDataOrigin, RecurrencePattern, Start, Finish) { this.expressID = expressID; this.type = type; this.Name = Name; this.DataOrigin = DataOrigin; this.UserDefinedDataOrigin = UserDefinedDataOrigin; this.RecurrencePattern = RecurrencePattern; this.Start = Start; this.Finish = Finish; } static FromTape(expressID, type, tape) { let ptr = 0; let Name = tape[ptr++]; let DataOrigin = tape[ptr++]; let UserDefinedDataOrigin = tape[ptr++]; let RecurrencePattern = tape[ptr++]; let Start = tape[ptr++]; let Finish = tape[ptr++]; return new IfcWorkTime(expressID, type, Name, DataOrigin, UserDefinedDataOrigin, RecurrencePattern, Start, Finish); } ToTape() { let args = []; args.push(this.Name); args.push(this.DataOrigin); args.push(this.UserDefinedDataOrigin); args.push(this.RecurrencePattern); args.push(this.Start); args.push(this.Finish); return args; } }; var IfcZShapeProfileDef = class { constructor(expressID, type, ProfileType, ProfileName, Position, Depth, FlangeWidth, WebThickness, FlangeThickness, FilletRadius, EdgeRadius) { this.expressID = expressID; this.type = type; this.ProfileType = ProfileType; this.ProfileName = ProfileName; this.Position = Position; this.Depth = Depth; this.FlangeWidth = FlangeWidth; this.WebThickness = WebThickness; this.FlangeThickness = FlangeThickness; this.FilletRadius = FilletRadius; this.EdgeRadius = EdgeRadius; } static FromTape(expressID, type, tape) { let ptr = 0; let ProfileType = tape[ptr++]; let ProfileName = tape[ptr++]; let Position = tape[ptr++]; let Depth = tape[ptr++]; let FlangeWidth = tape[ptr++]; let WebThickness = tape[ptr++]; let FlangeThickness = tape[ptr++]; let FilletRadius = tape[ptr++]; let EdgeRadius = tape[ptr++]; return new IfcZShapeProfileDef(expressID, type, ProfileType, ProfileName, Position, Depth, FlangeWidth, WebThickness, FlangeThickness, FilletRadius, EdgeRadius); } ToTape() { let args = []; args.push(this.ProfileType); args.push(this.ProfileName); args.push(this.Position); args.push(this.Depth); args.push(this.FlangeWidth); args.push(this.WebThickness); args.push(this.FlangeThickness); args.push(this.FilletRadius); args.push(this.EdgeRadius); return args; } }; var IfcZone = class { constructor(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, LongName) { this.expressID = expressID; this.type = type; this.GlobalId = GlobalId; this.OwnerHistory = OwnerHistory; this.Name = Name; this.Description = Description; this.ObjectType = ObjectType; this.LongName = LongName; } static FromTape(expressID, type, tape) { let ptr = 0; let GlobalId = tape[ptr++]; let OwnerHistory = tape[ptr++]; let Name = tape[ptr++]; let Description = tape[ptr++]; let ObjectType = tape[ptr++]; let LongName = tape[ptr++]; return new IfcZone(expressID, type, GlobalId, OwnerHistory, Name, Description, ObjectType, LongName); } ToTape() { let args = []; args.push(this.GlobalId); args.push(this.OwnerHistory); args.push(this.Name); args.push(this.Description); args.push(this.ObjectType); args.push(this.LongName); return args; } }; // dist/web-ifc-api.ts var WebIFCWasm = require_web_ifc(); var IfcAPI = class { constructor() { this.wasmModule = void 0; this.fs = void 0; } Init() { return __async(this, null, function* () { if (WebIFCWasm) { this.wasmModule = yield WebIFCWasm({ noInitialRun: true }); this.fs = this.wasmModule.FS; } else { console.error(`Could not find wasm module at './web-ifc' from web-ifc-api.ts`); } }); } OpenModel(data, settings) { this.wasmModule["FS_createDataFile"]("/", "filename", data, true, true, true); let s = __spreadValues({ COORDINATE_TO_ORIGIN: false, USE_FAST_BOOLS: false, CIRCLE_SEGMENTS_LOW: 5, CIRCLE_SEGMENTS_MEDIUM: 8, CIRCLE_SEGMENTS_HIGH: 12 }, settings); let result = this.wasmModule.OpenModel(s); this.wasmModule["FS_unlink"]("/filename"); return result; } CreateModel(settings) { let s = __spreadValues({ COORDINATE_TO_ORIGIN: false, USE_FAST_BOOLS: false, CIRCLE_SEGMENTS_LOW: 5, CIRCLE_SEGMENTS_MEDIUM: 8, CIRCLE_SEGMENTS_HIGH: 12 }, settings); let result = this.wasmModule.CreateModel(s); return result; } ExportFileAsIFC(modelID) { this.wasmModule.ExportFileAsIFC(modelID); let result = this.fs.readFile("/export.ifc"); this.wasmModule["FS_unlink"]("/export.ifc"); return result; } GetGeometry(modelID, geometryExpressID) { return this.wasmModule.GetGeometry(modelID, geometryExpressID); } GetLine(modelID, expressID, flatten = false) { let rawLineData = this.GetRawLineData(modelID, expressID); let lineData = FromRawLineData[rawLineData.type](rawLineData); if (flatten) { this.FlattenLine(modelID, lineData); } return lineData; } WriteLine(modelID, lineObject) { Object.keys(lineObject).forEach((propertyName) => { let property = lineObject[propertyName]; if (property && property.expressID !== void 0) { this.WriteLine(modelID, property); lineObject[propertyName] = { type: 5, value: property.expressID }; } else if (Array.isArray(property) && property.length > 0) { for (let i = 0; i < property.length; i++) { if (property[i].expressID !== void 0) { this.WriteLine(modelID, property[i]); lineObject[propertyName][i] = { type: 5, value: property[i].expressID }; } } } }); let rawLineData = { ID: lineObject.expressID, type: lineObject.type, arguments: lineObject.ToTape() }; this.WriteRawLineData(modelID, rawLineData); } FlattenLine(modelID, line) { Object.keys(line).forEach((propertyName) => { let property = line[propertyName]; if (property && property.type === 5) { line[propertyName] = this.GetLine(modelID, property.value, true); } else if (Array.isArray(property) && property.length > 0 && property[0].type === 5) { for (let i = 0; i < property.length; i++) { line[propertyName][i] = this.GetLine(modelID, property[i].value, true); } } }); } GetRawLineData(modelID, expressID) { return this.wasmModule.GetLine(modelID, expressID); } WriteRawLineData(modelID, data) { return this.wasmModule.WriteLine(modelID, data.ID, data.type, data.arguments); } GetLineIDsWithType(modelID, type) { return this.wasmModule.GetLineIDsWithType(modelID, type); } GetAllLines(modelID) { return this.wasmModule.GetAllLines(modelID); } SetGeometryTransformation(modelID, transformationMatrix) { if (transformationMatrix.length != 16) { console.log(`Bad transformation matrix size: ${transformationMatrix.length}`); return; } this.wasmModule.SetGeometryTransformation(modelID, transformationMatrix); } GetCoordinationMatrix(modelID) { return this.wasmModule.GetCoordinationMatrix(modelID); } GetVertexArray(ptr, size) { return this.getSubArray(this.wasmModule.HEAPF32, ptr, size); } GetIndexArray(ptr, size) { return this.getSubArray(this.wasmModule.HEAPU32, ptr, size); } getSubArray(heap, startPtr, sizeBytes) { return heap.subarray(startPtr / 4, startPtr / 4 + sizeBytes).slice(0); } CloseModel(modelID) { this.wasmModule.CloseModel(modelID); } StreamAllMeshes(modelID, meshCallback) { this.wasmModule.StreamAllMeshes(modelID, meshCallback); } IsModelOpen(modelID) { return this.wasmModule.IsModelOpen(modelID); } LoadAllGeometry(modelID) { return this.wasmModule.LoadAllGeometry(modelID); } GetFlatMesh(modelID, expressID) { return this.wasmModule.GetFlatMesh(modelID, expressID); } SetWasmPath(path) { } }; /** * @desc Parses IFC STEP file data into an {@link XKTModel}. * * Internally, this function uses [web-ifc](https://github.com/tomvandig/web-ifc) to parse the IFC, which relies on a * WASM file to do the parsing. * * Depending on how we use this function, we may need to provide it with a path to the directory where that WASM file is stored. * * ## Usage * * In the example below we'll create an {@link XKTModel}, then load an IFC model into it. * * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#parsers_IFC_RevitSample1)] * * ````javascript * utils.loadArraybuffer("./models/ifc/rac_advanced_sample_project.ifc", async (data) => { * * const xktModel = new XKTModel(); * * parseIFCIntoXKTModel({ * data, * xktModel, * wasmPath: "../dist/", * autoNormals: true, * log: (msg) => { console.log(msg); } * }).then(()=>{ * xktModel.finalize(); * }, * (msg) => { * console.error(msg); * }); * }); * ```` * * @param {Object} params Parsing params. * @param {ArrayBuffer} [params.data] IFC file data. * @param {XKTModel} [params.xktModel] XKTModel to parse into. * @param {Boolean} [params.autoNormals=true] When true, the parser will ignore the IFC geometry normals, and the IFC * data will rely on the xeokit ````Viewer```` to automatically generate them. This has the limitation that the * normals will be face-aligned, and therefore the ````Viewer```` will only be able to render a flat-shaded representation * of the IFC model. This is ````true```` by default, because IFC models tend to look acceptable with flat-shading, * and we always want to minimize IFC model size wherever possible. * @param {String} params.wasmPath Path to ````web-ifc.wasm````, required by this function. * @param {Object} [params.stats] Collects statistics. * @param {function} [params.log] Logging callback. */ function parseIFCIntoXKTModel({ data, xktModel, autoNormals = true, includeTypes, excludeTypes, wasmPath, stats = {}, log }) { return new Promise(function (resolve, reject) { if (!data) { reject("Argument expected: data"); return; } if (!xktModel) { reject("Argument expected: xktModel"); return; } if (!wasmPath) { reject("Argument expected: wasmPath"); return; } const ifcAPI = new IfcAPI(); if (wasmPath) { ifcAPI.SetWasmPath(wasmPath); } ifcAPI.Init().then(() => { const dataArray = new Uint8Array(data); const modelID = ifcAPI.OpenModel(dataArray); stats.sourceFormat = "IFC"; stats.schemaVersion = ""; stats.title = ""; stats.author = ""; stats.created = ""; stats.numMetaObjects = 0; stats.numPropertySets = 0; stats.numObjects = 0; stats.numGeometries = 0; stats.numTriangles = 0; stats.numVertices = 0; const ctx = { modelID, ifcAPI, xktModel, autoNormals, log: (log || function (msg) { }), nextId: 0, stats }; if (includeTypes) { ctx.includeTypes = {}; for (let i = 0, len = includeTypes.length; i < len; i++) { ctx.includeTypes[includeTypes[i]] = true; } } if (excludeTypes) { ctx.excludeTypes = {}; for (let i = 0, len = excludeTypes.length; i < len; i++) { ctx.excludeTypes[excludeTypes[i]] = true; } } const lines = ctx.ifcAPI.GetLineIDsWithType(modelID, IFCPROJECT); const ifcProjectId = lines.get(0); const ifcProject = ctx.ifcAPI.GetLine(modelID, ifcProjectId); ctx.xktModel.schema = ""; ctx.xktModel.modelId = "" + modelID; ctx.xktModel.projectId = "" + ifcProjectId; parseMetadata(ctx); parseGeometry(ctx); parsePropertySets(ctx); resolve(); }).catch((e) => { reject(e); }); }); } function parsePropertySets(ctx) { const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, IFCRELDEFINESBYPROPERTIES); for (let i = 0; i < lines.size(); i++) { let relID = lines.get(i); let rel = ctx.ifcAPI.GetLine(ctx.modelID, relID, true); if (rel) { const relatedObjects = rel.RelatedObjects; if (!relatedObjects || relatedObjects.length === 0) { continue; } const relatingPropertyDefinition = rel.RelatingPropertyDefinition; if (!relatingPropertyDefinition) { continue; } const propertySetId = relatingPropertyDefinition.GlobalId.value; let usedByAnyMetaObjects = false; for (let i = 0, len = relatedObjects.length; i < len; i++) { const relatedObject = relatedObjects[i]; const metaObjectId = relatedObject.GlobalId.value; const metaObject = ctx.xktModel.metaObjects[metaObjectId]; if (metaObject) { if (!metaObject.propertySetIds) { metaObject.propertySetIds = []; } metaObject.propertySetIds.push(propertySetId); usedByAnyMetaObjects = true; } } if (!usedByAnyMetaObjects) { continue; } const props = relatingPropertyDefinition.HasProperties; if (props && props.length > 0) { const propertySetType = "Default"; const propertySetName = relatingPropertyDefinition.Name.value; const properties = []; for (let i = 0, len = props.length; i < len; i++) { const prop = props[i]; const name = prop.Name; const nominalValue = prop.NominalValue; if (name && nominalValue) { const property = { name: name.value, type: nominalValue.type, value: nominalValue.value, valueType: nominalValue.valueType }; if (prop.Description) { property.description = prop.Description.value; } else if (nominalValue.description) { property.description = nominalValue.description; } properties.push(property); } } ctx.xktModel.createPropertySet({propertySetId, propertySetType, propertySetName, properties}); ctx.stats.numPropertySets++; } } } } function parseMetadata(ctx) { const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, IFCPROJECT); const ifcProjectId = lines.get(0); const ifcProject = ctx.ifcAPI.GetLine(ctx.modelID, ifcProjectId); parseSpatialChildren(ctx, ifcProject); } function parseSpatialChildren(ctx, ifcElement, parentMetaObjectId) { const metaObjectType = ifcElement.__proto__.constructor.name; if (ctx.includeTypes && (!ctx.includeTypes[metaObjectType])) { return; } if (ctx.excludeTypes && ctx.excludeTypes[metaObjectType]) { return; } createMetaObject(ctx, ifcElement, parentMetaObjectId); const metaObjectId = ifcElement.GlobalId.value; parseRelatedItemsOfType( ctx, ifcElement.expressID, 'RelatingObject', 'RelatedObjects', IFCRELAGGREGATES, metaObjectId); parseRelatedItemsOfType( ctx, ifcElement.expressID, 'RelatingStructure', 'RelatedElements', IFCRELCONTAINEDINSPATIALSTRUCTURE, metaObjectId); } function createMetaObject(ctx, ifcElement, parentMetaObjectId) { const metaObjectId = ifcElement.GlobalId.value; const propertySetIds = null; const metaObjectType = ifcElement.__proto__.constructor.name; const metaObjectName = (ifcElement.Name && ifcElement.Name.value !== "") ? ifcElement.Name.value : metaObjectType; ctx.xktModel.createMetaObject({metaObjectId, propertySetIds, metaObjectType, metaObjectName, parentMetaObjectId}); ctx.stats.numMetaObjects++; } function parseRelatedItemsOfType(ctx, id, relation, related, type, parentMetaObjectId) { const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, type); for (let i = 0; i < lines.size(); i++) { const relID = lines.get(i); const rel = ctx.ifcAPI.GetLine(ctx.modelID, relID); const relatedItems = rel[relation]; let foundElement = false; if (Array.isArray(relatedItems)) { const values = relatedItems.map((item) => item.value); foundElement = values.includes(id); } else { foundElement = (relatedItems.value === id); } if (foundElement) { const element = rel[related]; if (!Array.isArray(element)) { const ifcElement = ctx.ifcAPI.GetLine(ctx.modelID, element.value); parseSpatialChildren(ctx, ifcElement, parentMetaObjectId); } else { element.forEach((element2) => { const ifcElement = ctx.ifcAPI.GetLine(ctx.modelID, element2.value); parseSpatialChildren(ctx, ifcElement, parentMetaObjectId); }); } } } } function parseGeometry(ctx) { // Parses the geometry and materials in the IFC, creates // XKTEntity, XKTMesh and XKTGeometry components within the XKTModel. const flatMeshes = ctx.ifcAPI.LoadAllGeometry(ctx.modelID); for (let i = 0, len = flatMeshes.size(); i < len; i++) { const flatMesh = flatMeshes.get(i); const flatMeshExpressID = flatMesh.expressID; const placedGeometries = flatMesh.geometries; const meshIds = []; const properties = ctx.ifcAPI.GetLine(ctx.modelID, flatMeshExpressID); const entityId = properties.GlobalId.value; const metaObjectId = entityId; const metaObject = ctx.xktModel.metaObjects[metaObjectId]; if (ctx.includeTypes && (!metaObject || (!ctx.includeTypes[metaObject.metaObjectType]))) { return; } if (ctx.excludeTypes && (!metaObject || ctx.excludeTypes[metaObject.metaObjectType])) { console.log("excluding: " + metaObjectId); return; } for (let j = 0, lenj = placedGeometries.size(); j < lenj; j++) { const placedGeometry = placedGeometries.get(j); const geometryId = "" + placedGeometry.geometryExpressID; if (!ctx.xktModel.geometries[geometryId]) { const geometry = ctx.ifcAPI.GetGeometry(ctx.modelID, placedGeometry.geometryExpressID); const vertexData = ctx.ifcAPI.GetVertexArray(geometry.GetVertexData(), geometry.GetVertexDataSize()); const indices = ctx.ifcAPI.GetIndexArray(geometry.GetIndexData(), geometry.GetIndexDataSize()); // De-interleave vertex arrays const positions = []; const normals = []; for (let k = 0, lenk = vertexData.length / 6; k < lenk; k++) { positions.push(vertexData[k * 6 + 0]); positions.push(vertexData[k * 6 + 1]); positions.push(vertexData[k * 6 + 2]); } if (!ctx.autoNormals) { for (let k = 0, lenk = vertexData.length / 6; k < lenk; k++) { normals.push(vertexData[k * 6 + 3]); normals.push(vertexData[k * 6 + 4]); normals.push(vertexData[k * 6 + 5]); } } ctx.xktModel.createGeometry({ geometryId: geometryId, primitiveType: "triangles", positions: positions, normals: ctx.autoNormals ? null : normals, indices: indices }); ctx.stats.numGeometries++; ctx.stats.numVertices += (positions.length / 3); ctx.stats.numTriangles += (indices.length / 3); } const meshId = ("mesh" + ctx.nextId++); ctx.xktModel.createMesh({ meshId: meshId, geometryId: geometryId, matrix: new Float32Array(placedGeometry.flatTransformation), color: [placedGeometry.color.x, placedGeometry.color.y, placedGeometry.color.z], opacity: placedGeometry.color.w }); meshIds.push(meshId); } ctx.xktModel.createEntity({ entityId: entityId, meshIds: meshIds }); ctx.stats.numObjects++; } } function assert(condition, message) { if (!condition) { throw new Error(message || 'loader assertion failed.'); } } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var globals = { self: typeof self !== 'undefined' && self, window: typeof window !== 'undefined' && window, global: typeof global !== 'undefined' && global, document: typeof document !== 'undefined' && document }; var global_ = globals.global || globals.self || globals.window; var isBrowser = (typeof process === "undefined" ? "undefined" : _typeof(process)) !== 'object' || String(process) !== '[object process]' || process.browser; var matches = typeof process !== 'undefined' && process.version && process.version.match(/v([0-9]*)/); var nodeVersion = matches && parseFloat(matches[1]) || 0; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function commonjsRequire () { throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); } function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } var runtime_1 = createCommonjsModule(function (module) { /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var runtime = (function (exports) { var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var undefined$1; // More compressible than void 0. var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); return obj[key]; } try { // IE 8 has a broken Object.defineProperty that only works on DOM objects. define({}, ""); } catch (err) { define = function(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, // .throw, and .return methods. generator._invoke = makeInvokeMethod(innerFn, self, context); return generator; } exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion // record like context.tryEntries[i].completion. This interface could // have been (and was previously) designed to take a closure to be // invoked without arguments, but in all the cases we care about we // already have an existing method we want to call, so there's no need // to create a new function object. We can even get away with assuming // the method takes exactly one argument, since that happens to be true // in every case, so we don't have to touch the arguments object. The // only additional allocation required is the completion record, which // has a stable shape and so hopefully should be cheap to allocate. function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as // breaking out of the dispatch switch statement. var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and // .constructor.prototype properties for functions that return Generator // objects. For full spec compliance, you may wish to configure your // minifier not to mangle the names of these two functions. function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. var IteratorPrototype = {}; IteratorPrototype[iteratorSymbol] = function () { return this; }; var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { // This environment has a native %IteratorPrototype%; use it instead // of the polyfill. IteratorPrototype = NativeIteratorPrototype; } var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; GeneratorFunctionPrototype.constructor = GeneratorFunction; GeneratorFunction.displayName = define( GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction" ); // Helper for defining the .next, .throw, and .return methods of the // Iterator interface in terms of a single ._invoke method. function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { define(prototype, method, function(arg) { return this._invoke(method, arg); }); }); } exports.isGeneratorFunction = function(genFun) { var ctor = typeof genFun === "function" && genFun.constructor; return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can // do is to check its .name property. (ctor.displayName || ctor.name) === "GeneratorFunction" : false; }; exports.mark = function(genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); } else { genFun.__proto__ = GeneratorFunctionPrototype; define(genFun, toStringTagSymbol, "GeneratorFunction"); } genFun.prototype = Object.create(Gp); return genFun; }; // Within the body of any async function, `await x` is transformed to // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test // `hasOwn.call(value, "__await")` to determine if the yielded value is // meant to be awaited. exports.awrap = function(arg) { return { __await: arg }; }; function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; if (value && typeof value === "object" && hasOwn.call(value, "__await")) { return PromiseImpl.resolve(value.__await).then(function(value) { invoke("next", value, resolve, reject); }, function(err) { invoke("throw", err, resolve, reject); }); } return PromiseImpl.resolve(value).then(function(unwrapped) { // When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the // current iteration. result.value = unwrapped; resolve(result); }, function(error) { // If a rejected Promise was yielded, throw the rejection back // into the async generator function so it can be handled there. return invoke("throw", error, resolve, reject); }); } } var previousPromise; function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function(resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = // If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to // call invoke immediately, without waiting on a callback to fire, // so that the async generator function has the opportunity to do // any necessary setup in a predictable way. This predictability // is why the Promise constructor synchronously invokes its // executor callback, and why async functions synchronously // execute code before the first await. Since we implement simple // async functions in terms of async generators, it is especially // important to get this right, even though it requires care. previousPromise ? previousPromise.then( callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later // invocations of the iterator. callInvokeWithMethodAndArg ) : callInvokeWithMethodAndArg(); } // Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). this._invoke = enqueue; } defineIteratorMethods(AsyncIterator.prototype); AsyncIterator.prototype[asyncIteratorSymbol] = function () { return this; }; exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of // AsyncIterator objects; they just return a Promise for the value of // the final result produced by the iterator. exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { if (PromiseImpl === void 0) PromiseImpl = Promise; var iter = new AsyncIterator( wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl ); return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. : iter.next().then(function(result) { return result.done ? result.value : iter.next(); }); }; function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart; return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); } if (state === GenStateCompleted) { if (method === "throw") { throw arg; } // Be forgiving, per 25.3.3.3.3 of the spec: // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume return doneResult(); } context.method = method; context.arg = arg; while (true) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (context.method === "next") { // Setting context._sent for legacy support of Babel's // function.sent implementation. context.sent = context._sent = context.arg; } else if (context.method === "throw") { if (state === GenStateSuspendedStart) { state = GenStateCompleted; throw context.arg; } context.dispatchException(context.arg); } else if (context.method === "return") { context.abrupt("return", context.arg); } state = GenStateExecuting; var record = tryCatch(innerFn, self, context); if (record.type === "normal") { // If an exception is thrown from innerFn, we leave state === // GenStateExecuting and loop back for another invocation. state = context.done ? GenStateCompleted : GenStateSuspendedYield; if (record.arg === ContinueSentinel) { continue; } return { value: record.arg, done: context.done }; } else if (record.type === "throw") { state = GenStateCompleted; // Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. context.method = "throw"; context.arg = record.arg; } } }; } // Call delegate.iterator[context.method](context.arg) and handle the // result, either by returning a { value, done } result from the // delegate iterator, or by modifying context.method and context.arg, // setting context.delegate to null, and returning the ContinueSentinel. function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (method === undefined$1) { // A .throw or .return when the delegate iterator has no .throw // method always terminates the yield* loop. context.delegate = null; if (context.method === "throw") { // Note: ["return"] must be used for ES3 parsing compatibility. if (delegate.iterator["return"]) { // If the delegate iterator has a return method, give it a // chance to clean up. context.method = "return"; context.arg = undefined$1; maybeInvokeDelegate(delegate, context); if (context.method === "throw") { // If maybeInvokeDelegate(context) changed context.method from // "return" to "throw", let that override the TypeError below. return ContinueSentinel; } } context.method = "throw"; context.arg = new TypeError( "The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; } var info = record.arg; if (! info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; } if (info.done) { // Assign the result of the finished delegate to the temporary // variable specified by delegate.resultName (see delegateYield). context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the // exception, let the outer generator proceed normally. If // context.method was "next", forget context.arg since it has been // "consumed" by the delegate iterator. If context.method was // "return", allow the original .return call to continue in the // outer generator. if (context.method !== "return") { context.method = "next"; context.arg = undefined$1; } } else { // Re-yield the result returned by the delegate method. return info; } // The delegate iterator is finished, so forget it and continue with // the outer generator. context.delegate = null; return ContinueSentinel; } // Define Generator.prototype.{next,throw,return} in terms of the // unified ._invoke helper method. defineIteratorMethods(Gp); define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the // @@iterator function is called on it. Some browsers' implementations of the // iterator prototype chain incorrectly implement this, causing the Generator // object to not be returned from this call. This ensures that doesn't happen. // See https://github.com/facebook/regenerator/issues/274 for more details. Gp[iteratorSymbol] = function() { return this; }; Gp.toString = function() { return "[object Generator]"; }; function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; if (1 in locs) { entry.catchLoc = locs[1]; } if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; } this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; } function Context(tryLocsList) { // The root entry object (effectively a try statement without a catch // or a finally block) gives us a place to store values thrown from // locations where there is no enclosing try statement. this.tryEntries = [{ tryLoc: "root" }]; tryLocsList.forEach(pushTryEntry, this); this.reset(true); } exports.keys = function(object) { var keys = []; for (var key in object) { keys.push(key); } keys.reverse(); // Rather than returning an object with a next method, we keep // things simple and return the next function itself. return function next() { while (keys.length) { var key = keys.pop(); if (key in object) { next.value = key; next.done = false; return next; } } // To avoid creating an additional object, we just hang the .value // and .done properties off the next function object itself. This // also ensures that the minifier will not anonymize the function. next.done = true; return next; }; }; function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) { return iteratorMethod.call(iterable); } if (typeof iterable.next === "function") { return iterable; } if (!isNaN(iterable.length)) { var i = -1, next = function next() { while (++i < iterable.length) { if (hasOwn.call(iterable, i)) { next.value = iterable[i]; next.done = false; return next; } } next.value = undefined$1; next.done = true; return next; }; return next.next = next; } } // Return an iterator with no values. return { next: doneResult }; } exports.values = values; function doneResult() { return { value: undefined$1, done: true }; } Context.prototype = { constructor: Context, reset: function(skipTempReset) { this.prev = 0; this.next = 0; // Resetting context._sent for legacy support of Babel's // function.sent implementation. this.sent = this._sent = undefined$1; this.done = false; this.delegate = null; this.method = "next"; this.arg = undefined$1; this.tryEntries.forEach(resetTryEntry); if (!skipTempReset) { for (var name in this) { // Not sure about the optimal order of these conditions: if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { this[name] = undefined$1; } } } }, stop: function() { this.done = true; var rootEntry = this.tryEntries[0]; var rootRecord = rootEntry.completion; if (rootRecord.type === "throw") { throw rootRecord.arg; } return this.rval; }, dispatchException: function(exception) { if (this.done) { throw exception; } var context = this; function handle(loc, caught) { record.type = "throw"; record.arg = exception; context.next = loc; if (caught) { // If the dispatched exception was caught by a catch block, // then let that catch block handle the exception normally. context.method = "next"; context.arg = undefined$1; } return !! caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === "root") { // Exception thrown outside of any try block that could handle // it, so set the completion value of the entire function to // throw the exception. return handle("end"); } if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"); var hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } else if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else if (hasCatch) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } } else if (hasFinally) { if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else { throw new Error("try statement without catch or finally"); } } } }, abrupt: function(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { // Ignore the finally entry if control is not jumping to a // location outside the try/catch block. finallyEntry = null; } var record = finallyEntry ? finallyEntry.completion : {}; record.type = type; record.arg = arg; if (finallyEntry) { this.method = "next"; this.next = finallyEntry.finallyLoc; return ContinueSentinel; } return this.complete(record); }, complete: function(record, afterLoc) { if (record.type === "throw") { throw record.arg; } if (record.type === "break" || record.type === "continue") { this.next = record.arg; } else if (record.type === "return") { this.rval = this.arg = record.arg; this.method = "return"; this.next = "end"; } else if (record.type === "normal" && afterLoc) { this.next = afterLoc; } return ContinueSentinel; }, finish: function(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc); resetTryEntry(entry); return ContinueSentinel; } } }, "catch": function(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === "throw") { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } // The context.catch method must only be called with a location // argument that corresponds to a known catch block. throw new Error("illegal catch attempt"); }, delegateYield: function(iterable, resultName, nextLoc) { this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }; if (this.method === "next") { // Deliberately forget the last sent value so that we don't // accidentally pass it on to the delegate. this.arg = undefined$1; } return ContinueSentinel; } }; // Regardless of whether this script is executing as a CommonJS module // or not, return the runtime object so that we can declare the variable // regeneratorRuntime in the outer scope, which allows this module to be // injected easily by `bin/regenerator --include-runtime script.js`. return exports; }( // If this script is executing as a CommonJS module, use module.exports // as the regeneratorRuntime namespace. Otherwise create a new empty // object. Either way, the resulting object will be used to initialize // the regeneratorRuntime variable at the top of this file. module.exports )); try { regeneratorRuntime = runtime; } catch (accidentalStrictMode) { // This module should not be running in strict mode, so the above // assignment should always work unless something is misconfigured. Just // in case runtime.js accidentally runs in strict mode, we can escape // strict mode using a global Function call. This could conceivably fail // if a Content Security Policy forbids using Function, but in that case // the proper solution is to fix the accidental strict mode problem. If // you've misconfigured your bundler to force strict mode and applied a // CSP to forbid Function, and you're not willing to fix either of those // problems, please detail your unique predicament in a GitHub issue. Function("r", "regeneratorRuntime = r")(runtime); } }); var regenerator = runtime_1; function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function getTransferList(object) { var recursive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var transfers = arguments.length > 2 ? arguments[2] : undefined; var transfersSet = transfers || new Set(); if (!object) ; else if (isTransferable(object)) { transfersSet.add(object); } else if (isTransferable(object.buffer)) { transfersSet.add(object.buffer); } else if (ArrayBuffer.isView(object)) ; else if (recursive && _typeof(object) === 'object') { for (var key in object) { getTransferList(object[key], recursive, transfersSet); } } return transfers === undefined ? Array.from(transfersSet) : []; } function isTransferable(object) { if (!object) { return false; } if (object instanceof ArrayBuffer) { return true; } if (typeof MessagePort !== 'undefined' && object instanceof MessagePort) { return true; } if (typeof ImageBitmap !== 'undefined' && object instanceof ImageBitmap) { return true; } if (typeof OffscreenCanvas !== 'undefined' && object instanceof OffscreenCanvas) { return true; } return false; } var VERSION = "2.3.13" ; function validateLoaderVersion(loader) { var coreVersion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : VERSION; assert(loader, 'no loader provided'); var loaderVersion = loader.version; if (!coreVersion || !loaderVersion) { return; } coreVersion = parseVersion(coreVersion); loaderVersion = parseVersion(loaderVersion); } function parseVersion(version) { var parts = version.split('.').map(Number); return { major: parts[0], minor: parts[1] }; } function _AwaitValue(value) { this.wrapped = value; } function _awaitAsyncGenerator(value) { return new _AwaitValue(value); } function AsyncGenerator(gen) { var front, back; function send(key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; if (back) { back = back.next = request; } else { front = back = request; resume(key, arg); } }); } function resume(key, arg) { try { var result = gen[key](arg); var value = result.value; var wrappedAwait = value instanceof _AwaitValue; Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { if (wrappedAwait) { resume(key === "return" ? "return" : "next", arg); return; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: true }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: false }); break; } front = front.next; if (front) { resume(front.key, front.arg); } else { back = null; } } this._invoke = send; if (typeof gen["return"] !== "function") { this["return"] = undefined; } } AsyncGenerator.prototype[typeof Symbol === "function" && Symbol.asyncIterator || "@@asyncIterator"] = function () { return this; }; AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); }; AsyncGenerator.prototype["throw"] = function (arg) { return this._invoke("throw", arg); }; AsyncGenerator.prototype["return"] = function (arg) { return this._invoke("return", arg); }; function _wrapAsyncGenerator(fn) { return function () { return new AsyncGenerator(fn.apply(this, arguments)); }; } function _asyncIterator(iterable) { var method; if (typeof Symbol !== "undefined") { if (Symbol.asyncIterator) method = iterable[Symbol.asyncIterator]; if (method == null && Symbol.iterator) method = iterable[Symbol.iterator]; } if (method == null) method = iterable["@@asyncIterator"]; if (method == null) method = iterable["@@iterator"]; if (method == null) throw new TypeError("Object is not async iterable"); return method.call(iterable); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var workerURLCache = new Map(); function getWorkerURL(workerSource) { assert(typeof workerSource === 'string', 'worker source'); if (workerSource.startsWith('url(') && workerSource.endsWith(')')) { var workerUrl = workerSource.match(/^url\((.*)\)$/)[1]; if (workerUrl && !workerUrl.startsWith('http')) { return workerUrl; } workerSource = buildScript(workerUrl); } var workerURL = workerURLCache.get(workerSource); if (!workerURL) { var blob = new Blob([workerSource], { type: 'application/javascript' }); workerURL = URL.createObjectURL(blob); workerURLCache.set(workerSource, workerURL); } return workerURL; } function buildScript(workerUrl) { return "try {\n importScripts('".concat(workerUrl, "');\n} catch (error) {\n console.error(error);\n}"); } var count = 0; function defaultOnMessage(_ref) { var data = _ref.data, resolve = _ref.resolve; resolve(data); } var WorkerThread = function () { function WorkerThread(_ref2) { var source = _ref2.source, _ref2$name = _ref2.name, name = _ref2$name === void 0 ? "web-worker-".concat(count++) : _ref2$name, onMessage = _ref2.onMessage; _classCallCheck(this, WorkerThread); var url = getWorkerURL(source); this.worker = new Worker(url, { name: name }); this.name = name; this.onMessage = onMessage || defaultOnMessage; } _createClass(WorkerThread, [{ key: "process", value: function () { var _process = _asyncToGenerator(regenerator.mark(function _callee(data) { var _this = this; return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: return _context.abrupt("return", new Promise(function (resolve, reject) { _this.worker.onmessage = function (event) { _this.onMessage({ worker: _this.worker, data: event.data, resolve: resolve, reject: reject }); }; _this.worker.onerror = function (error) { var message = "".concat(_this.name, ": WorkerThread.process() failed"); if (error.message) { message += " ".concat(error.message, " ").concat(error.filename, ":").concat(error.lineno, ":").concat(error.colno); } var betterError = new Error(message); console.error(error); reject(betterError); }; var transferList = getTransferList(data); _this.worker.postMessage(data, transferList); })); case 1: case "end": return _context.stop(); } } }, _callee); })); function process(_x) { return _process.apply(this, arguments); } return process; }() }, { key: "destroy", value: function destroy() { this.worker.terminate(); this.worker = null; } }]); return WorkerThread; }(); var WorkerPool = function () { function WorkerPool(_ref) { var source = _ref.source, _ref$name = _ref.name, name = _ref$name === void 0 ? 'unnamed' : _ref$name, _ref$maxConcurrency = _ref.maxConcurrency, maxConcurrency = _ref$maxConcurrency === void 0 ? 1 : _ref$maxConcurrency, onMessage = _ref.onMessage, _ref$onDebug = _ref.onDebug, onDebug = _ref$onDebug === void 0 ? function () {} : _ref$onDebug, _ref$reuseWorkers = _ref.reuseWorkers, reuseWorkers = _ref$reuseWorkers === void 0 ? true : _ref$reuseWorkers; _classCallCheck(this, WorkerPool); this.source = source; this.name = name; this.maxConcurrency = maxConcurrency; this.onMessage = onMessage; this.onDebug = onDebug; this.jobQueue = []; this.idleQueue = []; this.count = 0; this.isDestroyed = false; this.reuseWorkers = reuseWorkers; } _createClass(WorkerPool, [{ key: "destroy", value: function destroy() { this.idleQueue.forEach(function (worker) { return worker.destroy(); }); this.isDestroyed = true; } }, { key: "process", value: function process(data, jobName) { var _this = this; return new Promise(function (resolve, reject) { _this.jobQueue.push({ data: data, jobName: jobName, resolve: resolve, reject: reject }); _this._startQueuedJob(); }); } }, { key: "_startQueuedJob", value: function () { var _startQueuedJob2 = _asyncToGenerator(regenerator.mark(function _callee() { var worker, job; return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: if (this.jobQueue.length) { _context.next = 2; break; } return _context.abrupt("return"); case 2: worker = this._getAvailableWorker(); if (worker) { _context.next = 5; break; } return _context.abrupt("return"); case 5: job = this.jobQueue.shift(); this.onDebug({ message: 'processing', worker: worker.name, job: job.jobName, backlog: this.jobQueue.length }); _context.prev = 7; _context.t0 = job; _context.next = 11; return worker.process(job.data); case 11: _context.t1 = _context.sent; _context.t0.resolve.call(_context.t0, _context.t1); _context.next = 18; break; case 15: _context.prev = 15; _context.t2 = _context["catch"](7); job.reject(_context.t2); case 18: _context.prev = 18; this._onWorkerDone(worker); return _context.finish(18); case 21: case "end": return _context.stop(); } } }, _callee, this, [[7, 15, 18, 21]]); })); function _startQueuedJob() { return _startQueuedJob2.apply(this, arguments); } return _startQueuedJob; }() }, { key: "_onWorkerDone", value: function _onWorkerDone(worker) { if (this.isDestroyed) { worker.destroy(); return; } if (this.reuseWorkers) { this.idleQueue.push(worker); } else { worker.destroy(); this.count--; } this._startQueuedJob(); } }, { key: "_getAvailableWorker", value: function _getAvailableWorker() { if (this.idleQueue.length > 0) { return this.idleQueue.shift(); } if (this.count < this.maxConcurrency) { this.count++; var name = "".concat(this.name.toLowerCase(), " (#").concat(this.count, " of ").concat(this.maxConcurrency, ")"); return new WorkerThread({ source: this.source, onMessage: this.onMessage, name: name }); } return null; } }]); return WorkerPool; }(); var DEFAULT_MAX_CONCURRENCY = 5; var WorkerFarm = function () { _createClass(WorkerFarm, null, [{ key: "isSupported", value: function isSupported() { return typeof Worker !== 'undefined'; } }]); function WorkerFarm(_ref) { var _ref$maxConcurrency = _ref.maxConcurrency, maxConcurrency = _ref$maxConcurrency === void 0 ? DEFAULT_MAX_CONCURRENCY : _ref$maxConcurrency, _ref$onMessage = _ref.onMessage, onMessage = _ref$onMessage === void 0 ? null : _ref$onMessage, _ref$onDebug = _ref.onDebug, onDebug = _ref$onDebug === void 0 ? function () {} : _ref$onDebug, _ref$reuseWorkers = _ref.reuseWorkers, reuseWorkers = _ref$reuseWorkers === void 0 ? true : _ref$reuseWorkers; _classCallCheck(this, WorkerFarm); this.maxConcurrency = maxConcurrency; this.onMessage = onMessage; this.onDebug = onDebug; this.workerPools = new Map(); this.reuseWorkers = reuseWorkers; } _createClass(WorkerFarm, [{ key: "setProps", value: function setProps(props) { if ('maxConcurrency' in props) { this.maxConcurrency = props.maxConcurrency; } if ('onDebug' in props) { this.onDebug = props.onDebug; } if ('reuseWorkers' in props) { this.reuseWorkers = props.reuseWorkers; } } }, { key: "destroy", value: function destroy() { this.workerPools.forEach(function (workerPool) { return workerPool.destroy(); }); } }, { key: "process", value: function () { var _process = _asyncToGenerator(regenerator.mark(function _callee(workerSource, workerName, data) { var workerPool; return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: workerPool = this._getWorkerPool(workerSource, workerName); return _context.abrupt("return", workerPool.process(data)); case 2: case "end": return _context.stop(); } } }, _callee, this); })); function process(_x, _x2, _x3) { return _process.apply(this, arguments); } return process; }() }, { key: "_getWorkerPool", value: function _getWorkerPool(workerSource, workerName) { var workerPool = this.workerPools.get(workerName); if (!workerPool) { workerPool = new WorkerPool({ source: workerSource, name: workerName, onMessage: onWorkerMessage.bind(null, this.onMessage), maxConcurrency: this.maxConcurrency, onDebug: this.onDebug, reuseWorkers: this.reuseWorkers }); this.workerPools.set(workerName, workerPool); } return workerPool; } }]); return WorkerFarm; }(); function onWorkerMessage(onMessage, _ref2) { var worker = _ref2.worker, data = _ref2.data, resolve = _ref2.resolve, reject = _ref2.reject; if (onMessage) { onMessage({ worker: worker, data: data, resolve: resolve, reject: reject }); return; } switch (data.type) { case 'done': resolve(data.result); break; case 'error': reject(data.message); break; } } var ChildProcess = {}; var node = /*#__PURE__*/Object.freeze({ __proto__: null, 'default': ChildProcess }); function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function toArrayBuffer(data) { if (undefined) { data = undefined(data); } if (data instanceof ArrayBuffer) { return data; } if (ArrayBuffer.isView(data)) { return data.buffer; } if (typeof data === 'string') { var text = data; var uint8Array = new TextEncoder().encode(text); return uint8Array.buffer; } if (data && _typeof(data) === 'object' && data._toArrayBuffer) { return data._toArrayBuffer(); } return assert(false); } function compareArrayBuffers(arrayBuffer1, arrayBuffer2, byteLength) { byteLength = byteLength || arrayBuffer1.byteLength; if (arrayBuffer1.byteLength < byteLength || arrayBuffer2.byteLength < byteLength) { return false; } var array1 = new Uint8Array(arrayBuffer1); var array2 = new Uint8Array(arrayBuffer2); for (var i = 0; i < array1.length; ++i) { if (array1[i] !== array2[i]) { return false; } } return true; } function concatenateArrayBuffers() { for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) { sources[_key] = arguments[_key]; } var sourceArrays = sources.map(function (source2) { return source2 instanceof ArrayBuffer ? new Uint8Array(source2) : source2; }); var byteLength = sourceArrays.reduce(function (length, typedArray) { return length + typedArray.byteLength; }, 0); var result = new Uint8Array(byteLength); var offset = 0; var _iterator = _createForOfIteratorHelper(sourceArrays), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var sourceArray = _step.value; result.set(sourceArray, offset); offset += sourceArray.byteLength; } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } return result.buffer; } var pathPrefix = ''; var fileAliases = {}; function resolvePath(filename) { for (var alias in fileAliases) { if (filename.startsWith(alias)) { var replacement = fileAliases[alias]; filename = filename.replace(alias, replacement); } } if (!filename.startsWith('http://') && !filename.startsWith('https://')) { filename = "".concat(pathPrefix).concat(filename); } return filename; } function makeTextDecoderIterator(_x, _x2) { return _makeTextDecoderIterator.apply(this, arguments); } function _makeTextDecoderIterator() { _makeTextDecoderIterator = _wrapAsyncGenerator(regenerator.mark(function _callee(arrayBufferIterator, options) { var textDecoder, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, arrayBuffer; return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: textDecoder = new TextDecoder(options); _iteratorNormalCompletion = true; _didIteratorError = false; _context.prev = 3; _iterator = _asyncIterator(arrayBufferIterator); case 5: _context.next = 7; return _awaitAsyncGenerator(_iterator.next()); case 7: _step = _context.sent; _iteratorNormalCompletion = _step.done; _context.next = 11; return _awaitAsyncGenerator(_step.value); case 11: _value = _context.sent; if (_iteratorNormalCompletion) { _context.next = 19; break; } arrayBuffer = _value; _context.next = 16; return typeof arrayBuffer === 'string' ? arrayBuffer : textDecoder.decode(arrayBuffer, { stream: true }); case 16: _iteratorNormalCompletion = true; _context.next = 5; break; case 19: _context.next = 25; break; case 21: _context.prev = 21; _context.t0 = _context["catch"](3); _didIteratorError = true; _iteratorError = _context.t0; case 25: _context.prev = 25; _context.prev = 26; if (!(!_iteratorNormalCompletion && _iterator["return"] != null)) { _context.next = 30; break; } _context.next = 30; return _awaitAsyncGenerator(_iterator["return"]()); case 30: _context.prev = 30; if (!_didIteratorError) { _context.next = 33; break; } throw _iteratorError; case 33: return _context.finish(30); case 34: return _context.finish(25); case 35: case "end": return _context.stop(); } } }, _callee, null, [[3, 21, 25, 35], [26,, 30, 34]]); })); return _makeTextDecoderIterator.apply(this, arguments); } function makeLineIterator(_x5) { return _makeLineIterator.apply(this, arguments); } function _makeLineIterator() { _makeLineIterator = _wrapAsyncGenerator(regenerator.mark(function _callee3(textIterator) { var previous, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, _value3, textChunk, eolIndex, line; return regenerator.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: previous = ''; _iteratorNormalCompletion3 = true; _didIteratorError3 = false; _context3.prev = 3; _iterator3 = _asyncIterator(textIterator); case 5: _context3.next = 7; return _awaitAsyncGenerator(_iterator3.next()); case 7: _step3 = _context3.sent; _iteratorNormalCompletion3 = _step3.done; _context3.next = 11; return _awaitAsyncGenerator(_step3.value); case 11: _value3 = _context3.sent; if (_iteratorNormalCompletion3) { _context3.next = 26; break; } textChunk = _value3; previous += textChunk; eolIndex = void 0; case 16: if (!((eolIndex = previous.indexOf('\n')) >= 0)) { _context3.next = 23; break; } line = previous.slice(0, eolIndex + 1); previous = previous.slice(eolIndex + 1); _context3.next = 21; return line; case 21: _context3.next = 16; break; case 23: _iteratorNormalCompletion3 = true; _context3.next = 5; break; case 26: _context3.next = 32; break; case 28: _context3.prev = 28; _context3.t0 = _context3["catch"](3); _didIteratorError3 = true; _iteratorError3 = _context3.t0; case 32: _context3.prev = 32; _context3.prev = 33; if (!(!_iteratorNormalCompletion3 && _iterator3["return"] != null)) { _context3.next = 37; break; } _context3.next = 37; return _awaitAsyncGenerator(_iterator3["return"]()); case 37: _context3.prev = 37; if (!_didIteratorError3) { _context3.next = 40; break; } throw _iteratorError3; case 40: return _context3.finish(37); case 41: return _context3.finish(32); case 42: if (!(previous.length > 0)) { _context3.next = 45; break; } _context3.next = 45; return previous; case 45: case "end": return _context3.stop(); } } }, _callee3, null, [[3, 28, 32, 42], [33,, 37, 41]]); })); return _makeLineIterator.apply(this, arguments); } function forEach(_x, _x2) { return _forEach.apply(this, arguments); } function _forEach() { _forEach = _asyncToGenerator(regenerator.mark(function _callee(iterator, visitor) { var _yield$iterator$next, done, value, cancel; return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 3; return iterator.next(); case 3: _yield$iterator$next = _context.sent; done = _yield$iterator$next.done; value = _yield$iterator$next.value; if (!done) { _context.next = 9; break; } iterator["return"](); return _context.abrupt("return"); case 9: cancel = visitor(value); if (!cancel) { _context.next = 12; break; } return _context.abrupt("return"); case 12: _context.next = 0; break; case 14: case "end": return _context.stop(); } } }, _callee); })); return _forEach.apply(this, arguments); } function concatenateChunksAsync(_x3) { return _concatenateChunksAsync.apply(this, arguments); } function _concatenateChunksAsync() { _concatenateChunksAsync = _asyncToGenerator(regenerator.mark(function _callee2(asyncIterator) { var arrayBuffers, strings, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk; return regenerator.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: arrayBuffers = []; strings = []; _iteratorNormalCompletion = true; _didIteratorError = false; _context2.prev = 4; _iterator = _asyncIterator(asyncIterator); case 6: _context2.next = 8; return _iterator.next(); case 8: _step = _context2.sent; _iteratorNormalCompletion = _step.done; _context2.next = 12; return _step.value; case 12: _value = _context2.sent; if (_iteratorNormalCompletion) { _context2.next = 19; break; } chunk = _value; if (typeof chunk === 'string') { strings.push(chunk); } else { arrayBuffers.push(chunk); } case 16: _iteratorNormalCompletion = true; _context2.next = 6; break; case 19: _context2.next = 25; break; case 21: _context2.prev = 21; _context2.t0 = _context2["catch"](4); _didIteratorError = true; _iteratorError = _context2.t0; case 25: _context2.prev = 25; _context2.prev = 26; if (!(!_iteratorNormalCompletion && _iterator["return"] != null)) { _context2.next = 30; break; } _context2.next = 30; return _iterator["return"](); case 30: _context2.prev = 30; if (!_didIteratorError) { _context2.next = 33; break; } throw _iteratorError; case 33: return _context2.finish(30); case 34: return _context2.finish(25); case 35: if (!(strings.length > 0)) { _context2.next = 38; break; } assert(arrayBuffers.length === 0); return _context2.abrupt("return", strings.join('')); case 38: return _context2.abrupt("return", concatenateArrayBuffers.apply(void 0, arrayBuffers)); case 39: case "end": return _context2.stop(); } } }, _callee2, null, [[4, 21, 25, 35], [26,, 30, 34]]); })); return _concatenateChunksAsync.apply(this, arguments); } function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray$1(arr); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread(); } function getMeshBoundingBox(attributes) { if (!attributes || !attributes.POSITION) { return null; } var minX = Infinity; var minY = Infinity; var minZ = Infinity; var maxX = -Infinity; var maxY = -Infinity; var maxZ = -Infinity; var positions = attributes.POSITION.value; var len = positions && positions.length; if (!len) { return null; } for (var i = 0; i < len; i += 3) { var x = positions[i]; var y = positions[i + 1]; var z = positions[i + 2]; minX = x < minX ? x : minX; minY = y < minY ? y : minY; minZ = z < minZ ? z : minZ; maxX = x > maxX ? x : maxX; maxY = y > maxY ? y : maxY; maxZ = z > maxZ ? z : maxZ; } return [[minX, minY, minZ], [maxX, maxY, maxZ]]; } var isBoolean = function isBoolean(x) { return typeof x === 'boolean'; }; var isFunction = function isFunction(x) { return typeof x === 'function'; }; var isObject = function isObject(x) { return x !== null && _typeof(x) === 'object'; }; var isPureObject = function isPureObject(x) { return isObject(x) && x.constructor === {}.constructor; }; var isIterable = function isIterable(x) { return x && typeof x[Symbol.iterator] === 'function'; }; var isAsyncIterable = function isAsyncIterable(x) { return x && typeof x[Symbol.asyncIterator] === 'function'; }; var isResponse = function isResponse(x) { return typeof Response !== 'undefined' && x instanceof Response || x && x.arrayBuffer && x.text && x.json; }; var isBlob = function isBlob(x) { return typeof Blob !== 'undefined' && x instanceof Blob; }; var isReadableDOMStream = function isReadableDOMStream(x) { return typeof ReadableStream !== 'undefined' && x instanceof ReadableStream || isObject(x) && isFunction(x.tee) && isFunction(x.cancel) && isFunction(x.getReader); }; var isBuffer = function isBuffer(x) { return x && _typeof(x) === 'object' && x.isBuffer; }; var isReadableNodeStream = function isReadableNodeStream(x) { return isObject(x) && isFunction(x.read) && isFunction(x.pipe) && isBoolean(x.readable); }; var isReadableStream = function isReadableStream(x) { return isReadableDOMStream(x) || isReadableNodeStream(x); }; var DATA_URL_PATTERN = /^data:([-\w.]+\/[-\w.+]+)(;|,)/; var MIME_TYPE_PATTERN = /^([-\w.]+\/[-\w.+]+)/; function parseMIMEType(mimeString) { if (typeof mimeString !== 'string') { return ''; } var matches = mimeString.match(MIME_TYPE_PATTERN); if (matches) { return matches[1]; } return mimeString; } function parseMIMETypeFromURL(dataUrl) { if (typeof dataUrl !== 'string') { return ''; } var matches = dataUrl.match(DATA_URL_PATTERN); if (matches) { return matches[1]; } return ''; } var QUERY_STRING_PATTERN = /\?.*/; function getResourceUrlAndType(resource) { if (isResponse(resource)) { var contentType = parseMIMEType(resource.headers.get('content-type')); var urlType = parseMIMETypeFromURL(resource.url); return { url: stripQueryString(resource.url || ''), type: contentType || urlType || null }; } if (isBlob(resource)) { return { url: stripQueryString(resource.name || ''), type: resource.type || '' }; } if (typeof resource === 'string') { return { url: stripQueryString(resource), type: parseMIMETypeFromURL(resource) }; } return { url: '', type: '' }; } function getResourceContentLength(resource) { if (isResponse(resource)) { return resource.headers['content-length'] || -1; } if (isBlob(resource)) { return resource.size; } if (typeof resource === 'string') { return resource.length; } if (resource instanceof ArrayBuffer) { return resource.byteLength; } if (ArrayBuffer.isView(resource)) { return resource.byteLength; } return -1; } function stripQueryString(url) { return url.replace(QUERY_STRING_PATTERN, ''); } function makeResponse(_x) { return _makeResponse.apply(this, arguments); } function _makeResponse() { _makeResponse = _asyncToGenerator(regenerator.mark(function _callee(resource) { var headers, contentLength, _getResourceUrlAndTyp, url, type, initialDataUrl, response; return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: if (!isResponse(resource)) { _context.next = 2; break; } return _context.abrupt("return", resource); case 2: headers = {}; contentLength = getResourceContentLength(resource); if (contentLength >= 0) { headers['content-length'] = String(contentLength); } _getResourceUrlAndTyp = getResourceUrlAndType(resource), url = _getResourceUrlAndTyp.url, type = _getResourceUrlAndTyp.type; if (type) { headers['content-type'] = type; } _context.next = 9; return getInitialDataUrl(resource); case 9: initialDataUrl = _context.sent; if (initialDataUrl) { headers['x-first-bytes'] = initialDataUrl; } if (typeof resource === 'string') { resource = new TextEncoder().encode(resource); } response = new Response(resource, { headers: headers }); Object.defineProperty(response, 'url', { value: url }); return _context.abrupt("return", response); case 15: case "end": return _context.stop(); } } }, _callee); })); return _makeResponse.apply(this, arguments); } function checkResponse(_x2) { return _checkResponse.apply(this, arguments); } function _checkResponse() { _checkResponse = _asyncToGenerator(regenerator.mark(function _callee2(response) { var message; return regenerator.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: if (response.ok) { _context2.next = 5; break; } _context2.next = 3; return getResponseError(response); case 3: message = _context2.sent; throw new Error(message); case 5: case "end": return _context2.stop(); } } }, _callee2); })); return _checkResponse.apply(this, arguments); } function getResponseError(_x3) { return _getResponseError.apply(this, arguments); } function _getResponseError() { _getResponseError = _asyncToGenerator(regenerator.mark(function _callee3(response) { var message, contentType, text; return regenerator.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: message = "Failed to fetch resource ".concat(response.url, " (").concat(response.status, "): "); _context3.prev = 1; contentType = response.headers.get('Content-Type'); text = response.statusText; if (!contentType.includes('application/json')) { _context3.next = 11; break; } _context3.t0 = text; _context3.t1 = " "; _context3.next = 9; return response.text(); case 9: _context3.t2 = _context3.sent; text = _context3.t0 += _context3.t1.concat.call(_context3.t1, _context3.t2); case 11: message += text; message = message.length > 60 ? "".concat(message.slice(60), "...") : message; _context3.next = 17; break; case 15: _context3.prev = 15; _context3.t3 = _context3["catch"](1); case 17: return _context3.abrupt("return", message); case 18: case "end": return _context3.stop(); } } }, _callee3, null, [[1, 15]]); })); return _getResponseError.apply(this, arguments); } function getInitialDataUrl(_x4) { return _getInitialDataUrl.apply(this, arguments); } function _getInitialDataUrl() { _getInitialDataUrl = _asyncToGenerator(regenerator.mark(function _callee4(resource) { var INITIAL_DATA_LENGTH, blobSlice, slice, base64; return regenerator.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: INITIAL_DATA_LENGTH = 5; if (!(typeof resource === 'string')) { _context4.next = 3; break; } return _context4.abrupt("return", "data:,".concat(resource.slice(0, INITIAL_DATA_LENGTH))); case 3: if (!(resource instanceof Blob)) { _context4.next = 8; break; } blobSlice = resource.slice(0, 5); _context4.next = 7; return new Promise(function (resolve) { var reader = new FileReader(); reader.onload = function (event) { return resolve(event.target && event.target.result); }; reader.readAsDataURL(blobSlice); }); case 7: return _context4.abrupt("return", _context4.sent); case 8: if (!(resource instanceof ArrayBuffer)) { _context4.next = 12; break; } slice = resource.slice(0, INITIAL_DATA_LENGTH); base64 = arrayBufferToBase64(slice); return _context4.abrupt("return", "data:base64,".concat(base64)); case 12: return _context4.abrupt("return", null); case 13: case "end": return _context4.stop(); } } }, _callee4); })); return _getInitialDataUrl.apply(this, arguments); } function arrayBufferToBase64(buffer) { var binary = ''; var bytes = new Uint8Array(buffer); for (var i = 0; i < bytes.byteLength; i++) { binary += String.fromCharCode(bytes[i]); } return btoa(binary); } function getErrorMessageFromResponse(_x) { return _getErrorMessageFromResponse.apply(this, arguments); } function _getErrorMessageFromResponse() { _getErrorMessageFromResponse = _asyncToGenerator(regenerator.mark(function _callee(response) { var message, contentType; return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: message = "Failed to fetch resource ".concat(response.url, " (").concat(response.status, "): "); _context.prev = 1; contentType = response.headers.get('Content-Type'); if (!contentType.includes('application/json')) { _context.next = 10; break; } _context.t0 = message; _context.next = 7; return response.text(); case 7: message = _context.t0 += _context.sent; _context.next = 11; break; case 10: message += response.statusText; case 11: _context.next = 16; break; case 13: _context.prev = 13; _context.t1 = _context["catch"](1); return _context.abrupt("return", message); case 16: return _context.abrupt("return", message); case 17: case "end": return _context.stop(); } } }, _callee, null, [[1, 13]]); })); return _getErrorMessageFromResponse.apply(this, arguments); } function fetchFile(_x) { return _fetchFile.apply(this, arguments); } function _fetchFile() { _fetchFile = _asyncToGenerator(regenerator.mark(function _callee(url) { var options, response, _args = arguments; return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; if (!(typeof url !== 'string')) { _context.next = 5; break; } _context.next = 4; return makeResponse(url); case 4: return _context.abrupt("return", _context.sent); case 5: url = resolvePath(url); _context.next = 8; return fetch(url, options); case 8: response = _context.sent; if (!(!response.ok && options["throws"])) { _context.next = 15; break; } _context.t0 = Error; _context.next = 13; return getErrorMessageFromResponse(response); case 13: _context.t1 = _context.sent; throw new _context.t0(_context.t1); case 15: return _context.abrupt("return", response); case 16: case "end": return _context.stop(); } } }, _callee); })); return _fetchFile.apply(this, arguments); } var NullLog = function () { function NullLog() { _classCallCheck(this, NullLog); } _createClass(NullLog, [{ key: "log", value: function log() { return function (_) {}; } }, { key: "info", value: function info() { return function (_) {}; } }, { key: "warn", value: function warn() { return function (_) {}; } }, { key: "error", value: function error() { return function (_) {}; } }]); return NullLog; }(); var ConsoleLog = function () { function ConsoleLog() { _classCallCheck(this, ConsoleLog); this.console = console; } _createClass(ConsoleLog, [{ key: "log", value: function log() { var _this$console$log; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return (_this$console$log = this.console.log).bind.apply(_this$console$log, [this.console].concat(args)); } }, { key: "info", value: function info() { var _this$console$info; for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return (_this$console$info = this.console.info).bind.apply(_this$console$info, [this.console].concat(args)); } }, { key: "warn", value: function warn() { var _this$console$warn; for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } return (_this$console$warn = this.console.warn).bind.apply(_this$console$warn, [this.console].concat(args)); } }, { key: "error", value: function error() { var _this$console$error; for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { args[_key4] = arguments[_key4]; } return (_this$console$error = this.console.error).bind.apply(_this$console$error, [this.console].concat(args)); } }]); return ConsoleLog; }(); function _createForOfIteratorHelper$1(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$2(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray$2(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); } function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } var DEFAULT_LOADER_OPTIONS = { baseUri: '', fetch: null, CDN: 'https://unpkg.com/@loaders.gl', worker: true, log: new ConsoleLog(), metadata: false, transforms: [], reuseWorkers: true }; var DEPRECATED_LOADER_OPTIONS = { dataType: '(no longer used)', method: 'fetch.method', headers: 'fetch.headers', body: 'fetch.body', mode: 'fetch.mode', credentials: 'fetch.credentials', cache: 'fetch.cache', redirect: 'fetch.redirect', referrer: 'fetch.referrer', referrerPolicy: 'fetch.referrerPolicy', integrity: 'fetch.integrity', keepalive: 'fetch.keepalive', signal: 'fetch.signal' }; var getGlobalLoaderState = function getGlobalLoaderState() { global_.loaders = global_.loaders || {}; var loaders = global_.loaders; loaders._state = loaders._state || {}; return loaders._state; }; var getGlobalLoaderOptions = function getGlobalLoaderOptions() { var state = getGlobalLoaderState(); state.globalOptions = state.globalOptions || _objectSpread({}, DEFAULT_LOADER_OPTIONS); return state.globalOptions; }; function normalizeOptions(options, loader, loaders, url) { loaders = loaders || []; loaders = Array.isArray(loaders) ? loaders : [loaders]; validateOptions(options, loaders); return normalizeOptionsInternal(loader, options, url); } function getFetchFunction(options, context) { var globalOptions = getGlobalLoaderOptions(); var fetch = options.fetch || globalOptions.fetch; if (typeof fetch === 'function') { return fetch; } if (isObject(fetch)) { return function (url) { return fetchFile(url, fetch); }; } if (context && context.fetch) { return context.fetch; } return function (url) { return fetchFile(url, options); }; } function validateOptions(options, loaders) { var log = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : console; validateOptionsObject(options, null, log, DEFAULT_LOADER_OPTIONS, DEPRECATED_LOADER_OPTIONS, loaders); var _iterator = _createForOfIteratorHelper$1(loaders), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var loader = _step.value; var idOptions = options && options[loader.id] || {}; var loaderOptions = loader.options && loader.options[loader.id] || {}; var deprecatedOptions = loader.defaultOptions && loader.defaultOptions[loader.id] || {}; validateOptionsObject(idOptions, loader.id, log, loaderOptions, deprecatedOptions, loaders); } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } } function validateOptionsObject(options, id, log, defaultOptions, deprecatedOptions, loaders) { var loaderName = id || 'Top level'; var prefix = id ? "".concat(id, ".") : ''; for (var key in options) { var isSubOptions = !id && isObject(options[key]); if (!(key in defaultOptions)) { if (key in deprecatedOptions) { log.warn("".concat(loaderName, " loader option '").concat(prefix).concat(key, "' deprecated, use '").concat(deprecatedOptions[key], "'")); } else if (!isSubOptions) { var suggestion = findSimilarOption(key, loaders); log.warn("".concat(loaderName, " loader option '").concat(prefix).concat(key, "' not recognized. ").concat(suggestion)); } } } } function findSimilarOption(optionKey, loaders) { var lowerCaseOptionKey = optionKey.toLowerCase(); var bestSuggestion = ''; var _iterator2 = _createForOfIteratorHelper$1(loaders), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var loader = _step2.value; for (var key in loader.options) { if (optionKey === key) { return "Did you mean '".concat(loader.id, ".").concat(key, "'?"); } var lowerCaseKey = key.toLowerCase(); var isPartialMatch = lowerCaseOptionKey.startsWith(lowerCaseKey) || lowerCaseKey.startsWith(lowerCaseOptionKey); if (isPartialMatch) { bestSuggestion = bestSuggestion || "Did you mean '".concat(loader.id, ".").concat(key, "'?"); } } } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } return bestSuggestion; } function normalizeOptionsInternal(loader, options, url) { var loaderDefaultOptions = loader.options || {}; var mergedOptions = _objectSpread({}, loaderDefaultOptions); if (mergedOptions.log === null) { mergedOptions.log = new NullLog(); } mergeNestedFields(mergedOptions, getGlobalLoaderOptions()); mergeNestedFields(mergedOptions, options); addUrlOptions(mergedOptions, url); return mergedOptions; } function mergeNestedFields(mergedOptions, options) { for (var key in options) { if (key in options) { var value = options[key]; if (isPureObject(value) && isPureObject(mergedOptions[key])) { mergedOptions[key] = _objectSpread(_objectSpread({}, mergedOptions[key]), options[key]); } else { mergedOptions[key] = options[key]; } } } } function addUrlOptions(options, url) { if (url && !options.baseUri) { options.baseUri = url; } } function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function isLoaderObject(loader) { if (!loader) { return false; } if (Array.isArray(loader)) { loader = loader[0]; } var hasParser = loader.parseTextSync || loader.parseSync || loader.parse || loader.parseStream || loader.parseInBatches; var loaderOptions = loader.options && loader.options[loader.id]; hasParser = hasParser || loaderOptions && loaderOptions.workerUrl; return hasParser; } function normalizeLoader(loader) { assert(loader, 'null loader'); assert(isLoaderObject(loader), 'invalid loader'); var options; if (Array.isArray(loader)) { options = loader[1]; loader = loader[0]; loader = _objectSpread$1(_objectSpread$1({}, loader), {}, { options: _objectSpread$1(_objectSpread$1({}, loader.options), options) }); } if (loader.extension) { loader.extensions = loader.extensions || loader.extension; delete loader.extension; } if (!Array.isArray(loader.extensions)) { loader.extensions = [loader.extensions]; } assert(loader.extensions && loader.extensions.length > 0 && loader.extensions[0]); if (loader.parseTextSync || loader.parseText) { loader.text = true; } if (!loader.text) { loader.binary = true; } return loader; } var getGlobalLoaderRegistry = function getGlobalLoaderRegistry() { var state = getGlobalLoaderState(); state.loaderRegistry = state.loaderRegistry || []; return state.loaderRegistry; }; function getRegisteredLoaders() { return getGlobalLoaderRegistry(); } var _marked = regenerator.mark(makeStringIterator); function makeStringIterator(string) { var options, _options$chunkSize, chunkSize, offset, textEncoder, chunkLength, chunk, _args = arguments; return regenerator.wrap(function makeStringIterator$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; _options$chunkSize = options.chunkSize, chunkSize = _options$chunkSize === void 0 ? 256 * 1024 : _options$chunkSize; offset = 0; textEncoder = new TextEncoder(); case 4: if (!(offset < string.length)) { _context.next = 12; break; } chunkLength = Math.min(string.length - offset, chunkSize); chunk = string.slice(offset, offset + chunkLength); offset += chunkLength; _context.next = 10; return textEncoder.encode(chunk); case 10: _context.next = 4; break; case 12: case "end": return _context.stop(); } } }, _marked); } var _marked$1 = regenerator.mark(makeArrayBufferIterator); function makeArrayBufferIterator(arrayBuffer) { var options, _options$chunkSize, chunkSize, byteOffset, chunkByteLength, chunk, sourceArray, chunkArray, _args = arguments; return regenerator.wrap(function makeArrayBufferIterator$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; _options$chunkSize = options.chunkSize, chunkSize = _options$chunkSize === void 0 ? 256 * 1024 : _options$chunkSize; byteOffset = 0; case 3: if (!(byteOffset < arrayBuffer.byteLength)) { _context.next = 14; break; } chunkByteLength = Math.min(arrayBuffer.byteLength - byteOffset, chunkSize); chunk = new ArrayBuffer(chunkByteLength); sourceArray = new Uint8Array(arrayBuffer, byteOffset, chunkByteLength); chunkArray = new Uint8Array(chunk); chunkArray.set(sourceArray); byteOffset += chunkByteLength; _context.next = 12; return chunk; case 12: _context.next = 3; break; case 14: case "end": return _context.stop(); } } }, _marked$1); } var DEFAULT_CHUNK_SIZE = 1024 * 1024; function makeBlobIterator(_x) { return _makeBlobIterator.apply(this, arguments); } function _makeBlobIterator() { _makeBlobIterator = _wrapAsyncGenerator(regenerator.mark(function _callee(file) { var options, chunkSize, offset, end, chunk, _args = arguments; return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; chunkSize = options.chunkSize || DEFAULT_CHUNK_SIZE; offset = 0; case 3: if (!(offset < file.size)) { _context.next = 13; break; } end = offset + chunkSize; _context.next = 7; return _awaitAsyncGenerator(readFileSlice(file, offset, end)); case 7: chunk = _context.sent; offset = end; _context.next = 11; return chunk; case 11: _context.next = 3; break; case 13: case "end": return _context.stop(); } } }, _callee); })); return _makeBlobIterator.apply(this, arguments); } function readFileSlice(_x2, _x3, _x4) { return _readFileSlice.apply(this, arguments); } function _readFileSlice() { _readFileSlice = _asyncToGenerator(regenerator.mark(function _callee2(file, offset, end) { return regenerator.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.next = 2; return new Promise(function (resolve, reject) { var slice = file.slice(offset, end); var fileReader = new FileReader(); fileReader.onload = function (event) { return resolve(event.target && event.target.result); }; fileReader.onerror = function (error) { return reject(error); }; fileReader.readAsArrayBuffer(slice); }); case 2: return _context2.abrupt("return", _context2.sent); case 3: case "end": return _context2.stop(); } } }, _callee2); })); return _readFileSlice.apply(this, arguments); } function makeStreamIterator(stream) { if (isBrowser || nodeVersion >= 10) { if (typeof stream[Symbol.asyncIterator] === 'function') { return makeToArrayBufferIterator(stream); } if (typeof stream.getIterator === 'function') { return stream.getIterator(); } } return isBrowser ? makeBrowserStreamIterator(stream) : makeNodeStreamIterator(stream); } function makeToArrayBufferIterator(_x) { return _makeToArrayBufferIterator.apply(this, arguments); } function _makeToArrayBufferIterator() { _makeToArrayBufferIterator = _wrapAsyncGenerator(regenerator.mark(function _callee(asyncIterator) { var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk; return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _iteratorNormalCompletion = true; _didIteratorError = false; _context.prev = 2; _iterator = _asyncIterator(asyncIterator); case 4: _context.next = 6; return _awaitAsyncGenerator(_iterator.next()); case 6: _step = _context.sent; _iteratorNormalCompletion = _step.done; _context.next = 10; return _awaitAsyncGenerator(_step.value); case 10: _value = _context.sent; if (_iteratorNormalCompletion) { _context.next = 18; break; } chunk = _value; _context.next = 15; return toArrayBuffer(chunk); case 15: _iteratorNormalCompletion = true; _context.next = 4; break; case 18: _context.next = 24; break; case 20: _context.prev = 20; _context.t0 = _context["catch"](2); _didIteratorError = true; _iteratorError = _context.t0; case 24: _context.prev = 24; _context.prev = 25; if (!(!_iteratorNormalCompletion && _iterator["return"] != null)) { _context.next = 29; break; } _context.next = 29; return _awaitAsyncGenerator(_iterator["return"]()); case 29: _context.prev = 29; if (!_didIteratorError) { _context.next = 32; break; } throw _iteratorError; case 32: return _context.finish(29); case 33: return _context.finish(24); case 34: case "end": return _context.stop(); } } }, _callee, null, [[2, 20, 24, 34], [25,, 29, 33]]); })); return _makeToArrayBufferIterator.apply(this, arguments); } function makeBrowserStreamIterator(_x2) { return _makeBrowserStreamIterator.apply(this, arguments); } function _makeBrowserStreamIterator() { _makeBrowserStreamIterator = _wrapAsyncGenerator(regenerator.mark(function _callee2(stream) { var reader, _yield$_awaitAsyncGen, done, value; return regenerator.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: reader = stream.getReader(); _context2.prev = 1; case 2: _context2.next = 5; return _awaitAsyncGenerator(reader.read()); case 5: _yield$_awaitAsyncGen = _context2.sent; done = _yield$_awaitAsyncGen.done; value = _yield$_awaitAsyncGen.value; if (!done) { _context2.next = 10; break; } return _context2.abrupt("return"); case 10: _context2.next = 12; return toArrayBuffer(value); case 12: _context2.next = 2; break; case 14: _context2.next = 19; break; case 16: _context2.prev = 16; _context2.t0 = _context2["catch"](1); reader.releaseLock(); case 19: case "end": return _context2.stop(); } } }, _callee2, null, [[1, 16]]); })); return _makeBrowserStreamIterator.apply(this, arguments); } function makeNodeStreamIterator(_x3) { return _makeNodeStreamIterator.apply(this, arguments); } function _makeNodeStreamIterator() { _makeNodeStreamIterator = _wrapAsyncGenerator(regenerator.mark(function _callee3(stream) { var data; return regenerator.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: _context3.next = 2; return _awaitAsyncGenerator(stream); case 2: stream = _context3.sent; case 3: data = stream.read(); if (!(data !== null)) { _context3.next = 9; break; } _context3.next = 8; return toArrayBuffer(data); case 8: return _context3.abrupt("continue", 3); case 9: if (!stream._readableState.ended) { _context3.next = 11; break; } return _context3.abrupt("return"); case 11: _context3.next = 13; return _awaitAsyncGenerator(onceReadable(stream)); case 13: _context3.next = 3; break; case 15: case "end": return _context3.stop(); } } }, _callee3); })); return _makeNodeStreamIterator.apply(this, arguments); } function onceReadable(_x4) { return _onceReadable.apply(this, arguments); } function _onceReadable() { _onceReadable = _asyncToGenerator(regenerator.mark(function _callee4(stream) { return regenerator.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: return _context4.abrupt("return", new Promise(function (resolve) { stream.once('readable', resolve); })); case 1: case "end": return _context4.stop(); } } }, _callee4); })); return _onceReadable.apply(this, arguments); } function makeIterator(data) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; if (typeof data === 'string') { return makeStringIterator(data, options); } if (data instanceof ArrayBuffer) { return makeArrayBufferIterator(data, options); } if (isBlob(data)) { return makeBlobIterator(data, options); } if (isReadableStream(data)) { return makeStreamIterator(data); } if (isResponse(data)) { return makeStreamIterator(data.body); } return assert(false); } var ERR_DATA = 'Cannot convert supplied data type'; function getArrayBufferOrStringFromDataSync(data, loader) { if (loader.text && typeof data === 'string') { return data; } if (data instanceof ArrayBuffer) { var arrayBuffer = data; if (loader.text && !loader.binary) { var textDecoder = new TextDecoder('utf8'); return textDecoder.decode(arrayBuffer); } return arrayBuffer; } if (ArrayBuffer.isView(data) || isBuffer(data)) { if (loader.text && !loader.binary) { var _textDecoder = new TextDecoder('utf8'); return _textDecoder.decode(data); } var _arrayBuffer = data.buffer; var byteLength = data.byteLength || data.length; if (data.byteOffset !== 0 || byteLength !== _arrayBuffer.byteLength) { _arrayBuffer = _arrayBuffer.slice(data.byteOffset, data.byteOffset + byteLength); } return _arrayBuffer; } throw new Error(ERR_DATA); } function getArrayBufferOrStringFromData(_x, _x2) { return _getArrayBufferOrStringFromData.apply(this, arguments); } function _getArrayBufferOrStringFromData() { _getArrayBufferOrStringFromData = _asyncToGenerator(regenerator.mark(function _callee(data, loader) { var isArrayBuffer, response; return regenerator.wrap(function _callee$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: isArrayBuffer = data instanceof ArrayBuffer || ArrayBuffer.isView(data); if (!(typeof data === 'string' || isArrayBuffer)) { _context3.next = 3; break; } return _context3.abrupt("return", getArrayBufferOrStringFromDataSync(data, loader)); case 3: if (!isBlob(data)) { _context3.next = 7; break; } _context3.next = 6; return makeResponse(data); case 6: data = _context3.sent; case 7: if (!isResponse(data)) { _context3.next = 21; break; } response = data; _context3.next = 11; return checkResponse(response); case 11: if (!loader.binary) { _context3.next = 17; break; } _context3.next = 14; return response.arrayBuffer(); case 14: _context3.t0 = _context3.sent; _context3.next = 20; break; case 17: _context3.next = 19; return response.text(); case 19: _context3.t0 = _context3.sent; case 20: return _context3.abrupt("return", _context3.t0); case 21: if (isReadableStream(data)) { data = makeIterator(data); } if (!(isIterable(data) || isAsyncIterable(data))) { _context3.next = 24; break; } return _context3.abrupt("return", concatenateChunksAsync(data)); case 24: throw new Error(ERR_DATA); case 25: case "end": return _context3.stop(); } } }, _callee); })); return _getArrayBufferOrStringFromData.apply(this, arguments); } function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function getLoaderContext(context, options) { var previousContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; if (previousContext) { return previousContext; } context = _objectSpread$2({ fetch: getFetchFunction(options || {}, context) }, context); if (!Array.isArray(context.loaders)) { context.loaders = null; } return context; } function getLoaders(loaders, context) { if (!context && loaders && !Array.isArray(loaders)) { return loaders; } var candidateLoaders; if (loaders) { candidateLoaders = Array.isArray(loaders) ? loaders : [loaders]; } if (context && context.loaders) { var contextLoaders = Array.isArray(context.loaders) ? context.loaders : [context.loaders]; candidateLoaders = candidateLoaders ? [].concat(_toConsumableArray(candidateLoaders), _toConsumableArray(contextLoaders)) : contextLoaders; } return candidateLoaders && candidateLoaders.length ? candidateLoaders : null; } var VERSION$1 = "2.3.13" ; function canParseWithWorker(loader, data, options, context) { if (!WorkerFarm.isSupported()) { return false; } var loaderOptions = options && options[loader.id]; if (options.worker === 'local' && loaderOptions && loaderOptions.localWorkerUrl || options.worker && loaderOptions && loaderOptions.workerUrl) { return loader.useWorker ? loader.useWorker(options) : true; } return false; } function parseWithWorker(loader, data, options, context) { var _ref = options || {}, worker = _ref.worker; var loaderOptions = options && options[loader.id] || {}; var workerUrl = worker === 'local' ? loaderOptions.localWorkerUrl : loaderOptions.workerUrl; var workerSource = "url(".concat(workerUrl, ")"); var workerName = loader.name; var workerFarm = getWorkerFarm(options); options = JSON.parse(JSON.stringify(options)); var warning = loader.version !== VERSION$1 ? "(core version ".concat(VERSION$1, ")") : ''; return workerFarm.process(workerSource, "".concat(workerName, "-worker@").concat(loader.version).concat(warning), { arraybuffer: toArrayBuffer(data), options: options, source: "loaders.gl@".concat(VERSION$1), type: 'parse' }); } var _workerFarm = null; function getWorkerFarm() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var props = {}; if (options.maxConcurrency) { props.maxConcurrency = options.maxConcurrency; } if (options.onDebug) { props.onDebug = options.onDebug; } if ('reuseWorkers' in options) { props.reuseWorkers = options.reuseWorkers; } if (!_workerFarm) { _workerFarm = new WorkerFarm({ onMessage: onWorkerMessage$1 }); } _workerFarm.setProps(props); return _workerFarm; } function onWorkerMessage$1(_x) { return _onWorkerMessage.apply(this, arguments); } function _onWorkerMessage() { _onWorkerMessage = _asyncToGenerator(regenerator.mark(function _callee(_ref2) { var worker, data, resolve, reject, result; return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: worker = _ref2.worker, data = _ref2.data, resolve = _ref2.resolve, reject = _ref2.reject; _context.t0 = data.type; _context.next = _context.t0 === 'done' ? 4 : _context.t0 === 'parse' ? 6 : _context.t0 === 'error' ? 17 : 19; break; case 4: resolve(data.result); return _context.abrupt("break", 19); case 6: _context.prev = 6; _context.next = 9; return parse(data.arraybuffer, data.options, data.url); case 9: result = _context.sent; worker.postMessage({ type: 'parse-done', id: data.id, result: result }, getTransferList(result)); _context.next = 16; break; case 13: _context.prev = 13; _context.t1 = _context["catch"](6); worker.postMessage({ type: 'parse-error', id: data.id, message: _context.t1.message }); case 16: return _context.abrupt("break", 19); case 17: reject(data.message); return _context.abrupt("break", 19); case 19: case "end": return _context.stop(); } } }, _callee, null, [[6, 13]]); })); return _onWorkerMessage.apply(this, arguments); } function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _createForOfIteratorHelper$2(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray$3(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$3(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen); } function _arrayLikeToArray$3(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } var EXT_PATTERN = /\.([^.]+)$/; function selectLoader(_x) { return _selectLoader.apply(this, arguments); } function _selectLoader() { _selectLoader = _asyncToGenerator(regenerator.mark(function _callee(data) { var loaders, options, context, loader, _args = arguments; return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: loaders = _args.length > 1 && _args[1] !== undefined ? _args[1] : []; options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; context = _args.length > 3 && _args[3] !== undefined ? _args[3] : {}; loader = selectLoaderSync(data, loaders, _objectSpread$3(_objectSpread$3({}, options), {}, { nothrow: true }), context); if (!loader) { _context.next = 6; break; } return _context.abrupt("return", loader); case 6: if (!isBlob(data)) { _context.next = 11; break; } _context.next = 9; return readFileSlice(data, 0, 10); case 9: data = _context.sent; loader = selectLoaderSync(data, loaders, options, context); case 11: if (!(!loader && !options.nothrow)) { _context.next = 13; break; } throw new Error(getNoValidLoaderMessage(data)); case 13: return _context.abrupt("return", loader); case 14: case "end": return _context.stop(); } } }, _callee); })); return _selectLoader.apply(this, arguments); } function selectLoaderSync(data) { var loaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var context = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; if (loaders && !Array.isArray(loaders)) { return normalizeLoader(loaders); } loaders = [].concat(_toConsumableArray(loaders || []), _toConsumableArray(getRegisteredLoaders())); normalizeLoaders(loaders); var _getResourceUrlAndTyp = getResourceUrlAndType(data), url = _getResourceUrlAndTyp.url, type = _getResourceUrlAndTyp.type; var loader = findLoaderByUrl(loaders, url || context.url); loader = loader || findLoaderByContentType(loaders, type); loader = loader || findLoaderByExamingInitialData(loaders, data); if (!loader && !options.nothrow) { throw new Error(getNoValidLoaderMessage(data)); } return loader; } function getNoValidLoaderMessage(data) { var _getResourceUrlAndTyp2 = getResourceUrlAndType(data), url = _getResourceUrlAndTyp2.url, type = _getResourceUrlAndTyp2.type; var message = 'No valid loader found'; if (data) { message += " data: \"".concat(getFirstCharacters(data), "\", contentType: \"").concat(type, "\""); } if (url) { message += " url: ".concat(url); } return message; } function normalizeLoaders(loaders) { var _iterator = _createForOfIteratorHelper$2(loaders), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var loader = _step.value; normalizeLoader(loader); } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } } function findLoaderByUrl(loaders, url) { var match = url && url.match(EXT_PATTERN); var extension = match && match[1]; return extension && findLoaderByExtension(loaders, extension); } function findLoaderByExtension(loaders, extension) { extension = extension.toLowerCase(); var _iterator2 = _createForOfIteratorHelper$2(loaders), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var loader = _step2.value; var _iterator3 = _createForOfIteratorHelper$2(loader.extensions), _step3; try { for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { var loaderExtension = _step3.value; if (loaderExtension.toLowerCase() === extension) { return loader; } } } catch (err) { _iterator3.e(err); } finally { _iterator3.f(); } } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } return null; } function findLoaderByContentType(loaders, mimeType) { var _iterator4 = _createForOfIteratorHelper$2(loaders), _step4; try { for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { var loader = _step4.value; if (loader.mimeTypes && loader.mimeTypes.includes(mimeType)) { return loader; } if (mimeType === "application/x.".concat(loader.id)) { return loader; } } } catch (err) { _iterator4.e(err); } finally { _iterator4.f(); } return null; } function findLoaderByExamingInitialData(loaders, data) { if (!data) { return null; } var _iterator5 = _createForOfIteratorHelper$2(loaders), _step5; try { for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) { var loader = _step5.value; if (typeof data === 'string') { if (testDataAgainstText(data, loader)) { return loader; } } else if (ArrayBuffer.isView(data)) { if (testDataAgainstBinary(data.buffer, data.byteOffset, loader)) { return loader; } } else if (data instanceof ArrayBuffer) { var byteOffset = 0; if (testDataAgainstBinary(data, byteOffset, loader)) { return loader; } } } } catch (err) { _iterator5.e(err); } finally { _iterator5.f(); } return null; } function testDataAgainstText(data, loader) { return loader.testText && loader.testText(data); } function testDataAgainstBinary(data, byteOffset, loader) { var tests = Array.isArray(loader.tests) ? loader.tests : [loader.tests]; return tests.some(function (test) { return testBinary(data, byteOffset, loader, test); }); } function testBinary(data, byteOffset, loader, test) { if (test instanceof ArrayBuffer) { return compareArrayBuffers(test, data, test.byteLength); } switch (_typeof(test)) { case 'function': return test(data, loader); case 'string': var magic = getMagicString(data, byteOffset, test.length); return test === magic; default: return false; } } function getFirstCharacters(data) { var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5; if (typeof data === 'string') { return data.slice(0, length); } else if (ArrayBuffer.isView(data)) { return getMagicString(data.buffer, data.byteOffset, length); } else if (data instanceof ArrayBuffer) { var byteOffset = 0; return getMagicString(data, byteOffset, length); } return ''; } function getMagicString(arrayBuffer, byteOffset, length) { if (arrayBuffer.byteLength < byteOffset + length) { return ''; } var dataView = new DataView(arrayBuffer); var magic = ''; for (var i = 0; i < length; i++) { magic += String.fromCharCode(dataView.getUint8(byteOffset + i)); } return magic; } function parse(_x, _x2, _x3, _x4) { return _parse.apply(this, arguments); } function _parse() { _parse = _asyncToGenerator(regenerator.mark(function _callee(data, loaders, options, context) { var _getResourceUrlAndTyp, url, candidateLoaders, loader; return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: assert(!context || typeof context !== 'string', 'parse no longer accepts final url'); if (loaders && !Array.isArray(loaders) && !isLoaderObject(loaders)) { context = options; options = loaders; loaders = null; } _context.next = 4; return data; case 4: data = _context.sent; options = options || {}; _getResourceUrlAndTyp = getResourceUrlAndType(data), url = _getResourceUrlAndTyp.url; candidateLoaders = getLoaders(loaders, context); _context.next = 10; return selectLoader(data, candidateLoaders, options); case 10: loader = _context.sent; if (loader) { _context.next = 13; break; } return _context.abrupt("return", null); case 13: options = normalizeOptions(options, loader, candidateLoaders, url); context = getLoaderContext({ url: url, parse: parse, loaders: candidateLoaders }, options, context); _context.next = 17; return parseWithLoader(loader, data, options, context); case 17: return _context.abrupt("return", _context.sent); case 18: case "end": return _context.stop(); } } }, _callee); })); return _parse.apply(this, arguments); } function parseWithLoader(_x5, _x6, _x7, _x8) { return _parseWithLoader.apply(this, arguments); } function _parseWithLoader() { _parseWithLoader = _asyncToGenerator(regenerator.mark(function _callee2(loader, data, options, context) { return regenerator.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: validateLoaderVersion(loader); _context2.next = 3; return getArrayBufferOrStringFromData(data, loader); case 3: data = _context2.sent; if (!(loader.parseTextSync && typeof data === 'string')) { _context2.next = 7; break; } options.dataType = 'text'; return _context2.abrupt("return", loader.parseTextSync(data, options, context, loader)); case 7: if (!canParseWithWorker(loader, data, options)) { _context2.next = 11; break; } _context2.next = 10; return parseWithWorker(loader, data, options); case 10: return _context2.abrupt("return", _context2.sent); case 11: if (!(loader.parseText && typeof data === 'string')) { _context2.next = 15; break; } _context2.next = 14; return loader.parseText(data, options, context, loader); case 14: return _context2.abrupt("return", _context2.sent); case 15: if (!loader.parse) { _context2.next = 19; break; } _context2.next = 18; return loader.parse(data, options, context, loader); case 18: return _context2.abrupt("return", _context2.sent); case 19: assert(!loader.parseSync); return _context2.abrupt("return", assert(false)); case 21: case "end": return _context2.stop(); } } }, _callee2); })); return _parseWithLoader.apply(this, arguments); } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest(); } var lazPerf = createCommonjsModule(function (module) { // @ts-nocheck /* eslint-disable */ /* * Last update 2020-07-23 * * Compiled from Howard Butler's laz-perf * https://github.com/hobu/laz-perf * Under LGPL License * * To update this file: * - git clone https://github.com/hobu/laz-perf * - cd laz-perf * - echo 'set(CMAKE_CXX_FLAGS "-s SINGLE_FILE=1 ${CMAKE_CXX_FLAGS}"' >> emscripten/CMakeLists.txt * - mkdir build && cd build * - cmake .. -DEMSCRIPTEN=1 -DCMAKE_TOOLCHAIN_FILE=/emscripten//cmake/Modules/Platform/Emscripten.cmake * - VERBOSE=1 make * * See the laz-perf repository for required dependencies * * The result should be build/emscripten/laz-perf.asm.js * Copy the content of this file in the getModule function below */ // laz-perf.js module.exports = function getModule() { var Module = typeof Module !== "undefined" ? Module : {}; var moduleOverrides = {}; var key; for (key in Module) { if (Module.hasOwnProperty(key)) { moduleOverrides[key] = Module[key]; } } var arguments_ = []; var thisProgram = "./this.program"; var ENVIRONMENT_IS_WEB = false; var ENVIRONMENT_IS_WORKER = false; var ENVIRONMENT_IS_NODE = false; var ENVIRONMENT_IS_SHELL = false; ENVIRONMENT_IS_WEB = typeof window === "object"; ENVIRONMENT_IS_WORKER = typeof importScripts === "function"; ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string"; ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; var scriptDirectory = ""; function locateFile(path) { if (Module["locateFile"]) { return Module["locateFile"](path, scriptDirectory) } return scriptDirectory + path } var read_, readAsync, readBinary; var nodeFS; var nodePath; if (ENVIRONMENT_IS_NODE) { if (ENVIRONMENT_IS_WORKER) { scriptDirectory = path.dirname(scriptDirectory) + "/"; } else { scriptDirectory = __dirname + "/"; } read_ = function shell_read(filename, binary) { var ret = tryParseAsDataURI(filename); if (ret) { return binary ? ret : ret.toString() } if (!nodeFS) nodeFS = fs$1; if (!nodePath) nodePath = path; filename = nodePath["normalize"](filename); return nodeFS["readFileSync"](filename, binary ? null : "utf8") }; readBinary = function readBinary(filename) { var ret = read_(filename, true); if (!ret.buffer) { ret = new Uint8Array(ret); } assert(ret.buffer); return ret }; if (process["argv"].length > 1) { thisProgram = process["argv"][1].replace(/\\/g, "/"); } arguments_ = process["argv"].slice(2); { module["exports"] = Module; } process["on"]("uncaughtException", function (ex) { if (!(ex instanceof ExitStatus)) { throw ex } }); process["on"]("unhandledRejection", abort); Module["inspect"] = function () { return "[Emscripten Module object]" }; } else if (ENVIRONMENT_IS_SHELL) { if (typeof read != "undefined") { read_ = function shell_read(f) { var data = tryParseAsDataURI(f); if (data) { return intArrayToString(data) } return read(f) }; } readBinary = function readBinary(f) { var data; data = tryParseAsDataURI(f); if (data) { return data } if (typeof readbuffer === "function") { return new Uint8Array(readbuffer(f)) } data = read(f, "binary"); assert(typeof data === "object"); return data }; if (typeof scriptArgs != "undefined") { arguments_ = scriptArgs; } else if (typeof arguments != "undefined") { arguments_ = arguments; } if (typeof print !== "undefined") { if (typeof console === "undefined") console = {}; console.log = print; console.warn = console.error = typeof printErr !== "undefined" ? printErr : print; } } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { if (ENVIRONMENT_IS_WORKER) { scriptDirectory = self.location.href; } else if (document.currentScript) { scriptDirectory = document.currentScript.src; } if (scriptDirectory.indexOf("blob:") !== 0) { scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1); } else { scriptDirectory = ""; } { read_ = function shell_read(url) { try { var xhr = new XMLHttpRequest; xhr.open("GET", url, false); xhr.send(null); return xhr.responseText } catch (err) { var data = tryParseAsDataURI(url); if (data) { return intArrayToString(data) } throw err } }; if (ENVIRONMENT_IS_WORKER) { readBinary = function readBinary(url) { try { var xhr = new XMLHttpRequest; xhr.open("GET", url, false); xhr.responseType = "arraybuffer"; xhr.send(null); return new Uint8Array(xhr.response) } catch (err) { var data = tryParseAsDataURI(url); if (data) { return data } throw err } }; } readAsync = function readAsync(url, onload, onerror) { var xhr = new XMLHttpRequest; xhr.open("GET", url, true); xhr.responseType = "arraybuffer"; xhr.onload = function xhr_onload() { if (xhr.status == 200 || xhr.status == 0 && xhr.response) { onload(xhr.response); return } var data = tryParseAsDataURI(url); if (data) { onload(data.buffer); return } onerror(); }; xhr.onerror = onerror; xhr.send(null); }; } } var out = Module["print"] || console.log.bind(console); var err = Module["printErr"] || console.warn.bind(console); for (key in moduleOverrides) { if (moduleOverrides.hasOwnProperty(key)) { Module[key] = moduleOverrides[key]; } } moduleOverrides = null; if (Module["arguments"]) arguments_ = Module["arguments"]; if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; var functionPointers = new Array(0); var tempRet0 = 0; var setTempRet0 = function (value) { tempRet0 = value; }; var getTempRet0 = function () { return tempRet0 }; var GLOBAL_BASE = 8; var ABORT = false; function assert(condition, text) { if (!condition) { abort("Assertion failed: " + text); } } var UTF8Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : undefined; function UTF8ArrayToString(heap, idx, maxBytesToRead) { var endIdx = idx + maxBytesToRead; var endPtr = idx; while (heap[endPtr] && !(endPtr >= endIdx)) ++endPtr; if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) { return UTF8Decoder.decode(heap.subarray(idx, endPtr)) } else { var str = ""; while (idx < endPtr) { var u0 = heap[idx++]; if (!(u0 & 128)) { str += String.fromCharCode(u0); continue } var u1 = heap[idx++] & 63; if ((u0 & 224) == 192) { str += String.fromCharCode((u0 & 31) << 6 | u1); continue } var u2 = heap[idx++] & 63; if ((u0 & 240) == 224) { u0 = (u0 & 15) << 12 | u1 << 6 | u2; } else { u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63; } if (u0 < 65536) { str += String.fromCharCode(u0); } else { var ch = u0 - 65536; str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023); } } } return str } function UTF8ToString(ptr, maxBytesToRead) { return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "" } function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { if (!(maxBytesToWrite > 0)) return 0; var startIdx = outIdx; var endIdx = outIdx + maxBytesToWrite - 1; for (var i = 0; i < str.length; ++i) { var u = str.charCodeAt(i); if (u >= 55296 && u <= 57343) { var u1 = str.charCodeAt(++i); u = 65536 + ((u & 1023) << 10) | u1 & 1023; } if (u <= 127) { if (outIdx >= endIdx) break; heap[outIdx++] = u; } else if (u <= 2047) { if (outIdx + 1 >= endIdx) break; heap[outIdx++] = 192 | u >> 6; heap[outIdx++] = 128 | u & 63; } else if (u <= 65535) { if (outIdx + 2 >= endIdx) break; heap[outIdx++] = 224 | u >> 12; heap[outIdx++] = 128 | u >> 6 & 63; heap[outIdx++] = 128 | u & 63; } else { if (outIdx + 3 >= endIdx) break; heap[outIdx++] = 240 | u >> 18; heap[outIdx++] = 128 | u >> 12 & 63; heap[outIdx++] = 128 | u >> 6 & 63; heap[outIdx++] = 128 | u & 63; } } heap[outIdx] = 0; return outIdx - startIdx } function stringToUTF8(str, outPtr, maxBytesToWrite) { return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite) } function lengthBytesUTF8(str) { var len = 0; for (var i = 0; i < str.length; ++i) { var u = str.charCodeAt(i); if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; if (u <= 127) ++len; else if (u <= 2047) len += 2; else if (u <= 65535) len += 3; else len += 4; } return len } var UTF16Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-16le") : undefined; function UTF16ToString(ptr, maxBytesToRead) { var endPtr = ptr; var idx = endPtr >> 1; var maxIdx = idx + maxBytesToRead / 2; while (!(idx >= maxIdx) && HEAPU16[idx]) ++idx; endPtr = idx << 1; if (endPtr - ptr > 32 && UTF16Decoder) { return UTF16Decoder.decode(HEAPU8.subarray(ptr, endPtr)) } else { var i = 0; var str = ""; while (1) { var codeUnit = HEAP16[ptr + i * 2 >> 1]; if (codeUnit == 0 || i == maxBytesToRead / 2) return str; ++i; str += String.fromCharCode(codeUnit); } } } function stringToUTF16(str, outPtr, maxBytesToWrite) { if (maxBytesToWrite === undefined) { maxBytesToWrite = 2147483647; } if (maxBytesToWrite < 2) return 0; maxBytesToWrite -= 2; var startPtr = outPtr; var numCharsToWrite = maxBytesToWrite < str.length * 2 ? maxBytesToWrite / 2 : str.length; for (var i = 0; i < numCharsToWrite; ++i) { var codeUnit = str.charCodeAt(i); HEAP16[outPtr >> 1] = codeUnit; outPtr += 2; } HEAP16[outPtr >> 1] = 0; return outPtr - startPtr } function lengthBytesUTF16(str) { return str.length * 2 } function UTF32ToString(ptr, maxBytesToRead) { var i = 0; var str = ""; while (!(i >= maxBytesToRead / 4)) { var utf32 = HEAP32[ptr + i * 4 >> 2]; if (utf32 == 0) break; ++i; if (utf32 >= 65536) { var ch = utf32 - 65536; str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023); } else { str += String.fromCharCode(utf32); } } return str } function stringToUTF32(str, outPtr, maxBytesToWrite) { if (maxBytesToWrite === undefined) { maxBytesToWrite = 2147483647; } if (maxBytesToWrite < 4) return 0; var startPtr = outPtr; var endPtr = startPtr + maxBytesToWrite - 4; for (var i = 0; i < str.length; ++i) { var codeUnit = str.charCodeAt(i); if (codeUnit >= 55296 && codeUnit <= 57343) { var trailSurrogate = str.charCodeAt(++i); codeUnit = 65536 + ((codeUnit & 1023) << 10) | trailSurrogate & 1023; } HEAP32[outPtr >> 2] = codeUnit; outPtr += 4; if (outPtr + 4 > endPtr) break } HEAP32[outPtr >> 2] = 0; return outPtr - startPtr } function lengthBytesUTF32(str) { var len = 0; for (var i = 0; i < str.length; ++i) { var codeUnit = str.charCodeAt(i); if (codeUnit >= 55296 && codeUnit <= 57343) ++i; len += 4; } return len } var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; function updateGlobalBufferAndViews(buf) { buffer = buf; Module["HEAP8"] = HEAP8 = new Int8Array(buf); Module["HEAP16"] = HEAP16 = new Int16Array(buf); Module["HEAP32"] = HEAP32 = new Int32Array(buf); Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf); Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf); Module["HEAPF32"] = HEAPF32 = new Float32Array(buf); Module["HEAPF64"] = HEAPF64 = new Float64Array(buf); } var DYNAMIC_BASE = 5265264, DYNAMICTOP_PTR = 22176; var INITIAL_INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 167772160; if (Module["buffer"]) { buffer = Module["buffer"]; } else { buffer = new ArrayBuffer(INITIAL_INITIAL_MEMORY); } INITIAL_INITIAL_MEMORY = buffer.byteLength; updateGlobalBufferAndViews(buffer); HEAP32[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE; function callRuntimeCallbacks(callbacks) { while (callbacks.length > 0) { var callback = callbacks.shift(); if (typeof callback == "function") { callback(Module); continue } var func = callback.func; if (typeof func === "number") { if (callback.arg === undefined) { Module["dynCall_v"](func); } else { Module["dynCall_vi"](func, callback.arg); } } else { func(callback.arg === undefined ? null : callback.arg); } } } var __ATPRERUN__ = []; var __ATINIT__ = []; var __ATMAIN__ = []; var __ATPOSTRUN__ = []; function preRun() { if (Module["preRun"]) { if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; while (Module["preRun"].length) { addOnPreRun(Module["preRun"].shift()); } } callRuntimeCallbacks(__ATPRERUN__); } function initRuntime() { callRuntimeCallbacks(__ATINIT__); } function preMain() { callRuntimeCallbacks(__ATMAIN__); } function postRun() { if (Module["postRun"]) { if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; while (Module["postRun"].length) { addOnPostRun(Module["postRun"].shift()); } } callRuntimeCallbacks(__ATPOSTRUN__); } function addOnPreRun(cb) { __ATPRERUN__.unshift(cb); } function addOnPostRun(cb) { __ATPOSTRUN__.unshift(cb); } var runDependencies = 0; var dependenciesFulfilled = null; function addRunDependency(id) { runDependencies++; if (Module["monitorRunDependencies"]) { Module["monitorRunDependencies"](runDependencies); } } function removeRunDependency(id) { runDependencies--; if (Module["monitorRunDependencies"]) { Module["monitorRunDependencies"](runDependencies); } if (runDependencies == 0) { if (dependenciesFulfilled) { var callback = dependenciesFulfilled; dependenciesFulfilled = null; callback(); } } } Module["preloadedImages"] = {}; Module["preloadedAudios"] = {}; function abort(what) { if (Module["onAbort"]) { Module["onAbort"](what); } what += ""; out(what); err(what); ABORT = true; what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; throw what } var memoryInitializer = null; function hasPrefix(str, prefix) { return String.prototype.startsWith ? str.startsWith(prefix) : str.indexOf(prefix) === 0 } var dataURIPrefix = "data:application/octet-stream;base64,"; function isDataURI(filename) { return hasPrefix(filename, dataURIPrefix) } __ATINIT__.push({ func: function () { globalCtors(); } }); memoryInitializer = "data:application/octet-stream;base64,AAAAAAAAAAAPDg0MCwoJCA4AAQMGCgoJDQECBAcLCwoMAwQFCAwMCwsGBwgJDQ0MCgoLDA0ODg0JCgsMDQ4PDggJCgsMDQ4PAAECAwQFBgcBAAECAwQFBgIBAAECAwQFAwIBAAECAwQEAwIBAAECAwUEAwIBAAECBgUEAwIBAAEHBgUEAwIBAMgPAAAoDQAAEBAAACAQAADIDwAAUA0AABAQAAAgEAAAEQAKABEREQAAAAAFAAAAAAAACQAAAAALAAAAAAAAAAARAA8KERERAwoHAAEACQsLAAAJBgsAAAsABhEAAAAREREAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAEQAKChEREQAKAAACAAkLAAAACQALAAALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAADAAAAAAJDAAAAAAADAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAANAAAABA0AAAAACQ4AAAAAAA4AAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAADwAAAAAPAAAAAAkQAAAAAAAQAAAQAAASAAAAEhISAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAASEhIAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAAKAAAAAAoAAAAACQsAAAAAAAsAAAsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAMAAAAAAkMAAAAAAAMAAAMAAAwMTIzNDU2Nzg5QUJDREVGGRJEOwI/LEcUPTMwChsGRktFNw9JDo4XA0AdPGkrNh9KLRwBICUpIQgMFRYiLhA4Pgs0MRhkdHV2L0EJfzkRI0MyQomKiwUEJignDSoeNYwHGkiTE5SVAAAAAAAAAAAASWxsZWdhbCBieXRlIHNlcXVlbmNlAERvbWFpbiBlcnJvcgBSZXN1bHQgbm90IHJlcHJlc2VudGFibGUATm90IGEgdHR5AFBlcm1pc3Npb24gZGVuaWVkAE9wZXJhdGlvbiBub3QgcGVybWl0dGVkAE5vIHN1Y2ggZmlsZSBvciBkaXJlY3RvcnkATm8gc3VjaCBwcm9jZXNzAEZpbGUgZXhpc3RzAFZhbHVlIHRvbyBsYXJnZSBmb3IgZGF0YSB0eXBlAE5vIHNwYWNlIGxlZnQgb24gZGV2aWNlAE91dCBvZiBtZW1vcnkAUmVzb3VyY2UgYnVzeQBJbnRlcnJ1cHRlZCBzeXN0ZW0gY2FsbABSZXNvdXJjZSB0ZW1wb3JhcmlseSB1bmF2YWlsYWJsZQBJbnZhbGlkIHNlZWsAQ3Jvc3MtZGV2aWNlIGxpbmsAUmVhZC1vbmx5IGZpbGUgc3lzdGVtAERpcmVjdG9yeSBub3QgZW1wdHkAQ29ubmVjdGlvbiByZXNldCBieSBwZWVyAE9wZXJhdGlvbiB0aW1lZCBvdXQAQ29ubmVjdGlvbiByZWZ1c2VkAEhvc3QgaXMgZG93bgBIb3N0IGlzIHVucmVhY2hhYmxlAEFkZHJlc3MgaW4gdXNlAEJyb2tlbiBwaXBlAEkvTyBlcnJvcgBObyBzdWNoIGRldmljZSBvciBhZGRyZXNzAEJsb2NrIGRldmljZSByZXF1aXJlZABObyBzdWNoIGRldmljZQBOb3QgYSBkaXJlY3RvcnkASXMgYSBkaXJlY3RvcnkAVGV4dCBmaWxlIGJ1c3kARXhlYyBmb3JtYXQgZXJyb3IASW52YWxpZCBhcmd1bWVudABBcmd1bWVudCBsaXN0IHRvbyBsb25nAFN5bWJvbGljIGxpbmsgbG9vcABGaWxlbmFtZSB0b28gbG9uZwBUb28gbWFueSBvcGVuIGZpbGVzIGluIHN5c3RlbQBObyBmaWxlIGRlc2NyaXB0b3JzIGF2YWlsYWJsZQBCYWQgZmlsZSBkZXNjcmlwdG9yAE5vIGNoaWxkIHByb2Nlc3MAQmFkIGFkZHJlc3MARmlsZSB0b28gbGFyZ2UAVG9vIG1hbnkgbGlua3MATm8gbG9ja3MgYXZhaWxhYmxlAFJlc291cmNlIGRlYWRsb2NrIHdvdWxkIG9jY3VyAFN0YXRlIG5vdCByZWNvdmVyYWJsZQBQcmV2aW91cyBvd25lciBkaWVkAE9wZXJhdGlvbiBjYW5jZWxlZABGdW5jdGlvbiBub3QgaW1wbGVtZW50ZWQATm8gbWVzc2FnZSBvZiBkZXNpcmVkIHR5cGUASWRlbnRpZmllciByZW1vdmVkAERldmljZSBub3QgYSBzdHJlYW0ATm8gZGF0YSBhdmFpbGFibGUARGV2aWNlIHRpbWVvdXQAT3V0IG9mIHN0cmVhbXMgcmVzb3VyY2VzAExpbmsgaGFzIGJlZW4gc2V2ZXJlZABQcm90b2NvbCBlcnJvcgBCYWQgbWVzc2FnZQBGaWxlIGRlc2NyaXB0b3IgaW4gYmFkIHN0YXRlAE5vdCBhIHNvY2tldABEZXN0aW5hdGlvbiBhZGRyZXNzIHJlcXVpcmVkAE1lc3NhZ2UgdG9vIGxhcmdlAFByb3RvY29sIHdyb25nIHR5cGUgZm9yIHNvY2tldABQcm90b2NvbCBub3QgYXZhaWxhYmxlAFByb3RvY29sIG5vdCBzdXBwb3J0ZWQAU29ja2V0IHR5cGUgbm90IHN1cHBvcnRlZABOb3Qgc3VwcG9ydGVkAFByb3RvY29sIGZhbWlseSBub3Qgc3VwcG9ydGVkAEFkZHJlc3MgZmFtaWx5IG5vdCBzdXBwb3J0ZWQgYnkgcHJvdG9jb2wAQWRkcmVzcyBub3QgYXZhaWxhYmxlAE5ldHdvcmsgaXMgZG93bgBOZXR3b3JrIHVucmVhY2hhYmxlAENvbm5lY3Rpb24gcmVzZXQgYnkgbmV0d29yawBDb25uZWN0aW9uIGFib3J0ZWQATm8gYnVmZmVyIHNwYWNlIGF2YWlsYWJsZQBTb2NrZXQgaXMgY29ubmVjdGVkAFNvY2tldCBub3QgY29ubmVjdGVkAENhbm5vdCBzZW5kIGFmdGVyIHNvY2tldCBzaHV0ZG93bgBPcGVyYXRpb24gYWxyZWFkeSBpbiBwcm9ncmVzcwBPcGVyYXRpb24gaW4gcHJvZ3Jlc3MAU3RhbGUgZmlsZSBoYW5kbGUAUmVtb3RlIEkvTyBlcnJvcgBRdW90YSBleGNlZWRlZABObyBtZWRpdW0gZm91bmQAV3JvbmcgbWVkaXVtIHR5cGUATm8gZXJyb3IgaW5mb3JtYXRpb24AAAAAAADgFgAAmRgAAGAQAAAAAAAA4BYAAEIZAABgEAAAAAAAAOAWAAAqGgAASA8AAAAAAAC4FgAANBsAAOAWAACfGgAAMAoAAAAAAADgFgAAaRsAAEgPAAAAAAAA4BYAAIobAABIDwAAAAAAALgWAAAPHAAA4BYAAHwcAABIDwAAAAAAAOAWAACVHAAASA8AAAAAAADgFgAAHh0AAEgPAAAAAAAA4BYAAHcdAABIDwAAAAAAAOAWAACQHQAASA8AAAAAAADgFgAAQh4AAEgPAAAAAAAA4BYAAIceAABgEAAAAAAAAOAWAACkHwAASA8AAAAAAAC4FgAAZyAAAOAWAADkHwAA8AoAAAAAAADgFgAAjyAAAGAQAAAAAAAAuBYAAMMiAADgFgAAAiIAABgLAAAAAAAA4BYAAOEiAABgEAAAAAAAAOAWAADQJAAAGAsAAAAAAADgFgAAkSUAAGAQAAAAAAAA4BYAAIAnAAAYCwAAAAAAAOAWAAA9KAAAYBAAAAAAAADgFgAAJCoAABgLAAAAAAAA4BYAAOkqAABgEAAAAAAAAOAWAADgLAAA8AoAAAAAAADgFgAAui0AAGAQAAAAAAAA4BYAANsvAADwCgAAAAAAAOAWAADTMAAAYBAAAAAAAADgFgAAMDMAAPAKAAAAAAAA4BYAACQ0AABgEAAAAAAAAOAWAAB5NgAA8AoAAAAAAADgFgAAizcAAGAQAAAAAAAA4BYAABw6AABgEAAAAAAAAOAWAACdOgAAYBAAAAAAAADgFgAAXjsAAPAKAAAAAAAA4BYAALU7AABgEAAAAAAAAOAWAADMPAAAGAsAAAAAAADgFgAATz0AAGAQAAAAAAAA4BYAAL4+AAAYCwAAAAAAAOAWAABBPwAAYBAAAAAAAADgFgAAsEAAABgLAAAAAAAA4BYAADNBAABgEAAAAAAAAOAWAACiQgAAGAsAAAAAAADgFgAAJUMAAGAQAAAAAAAA4BYAAJREAAAYCwAAAAAAAOAWAAAXRQAAYBAAAAAAAADgFgAAhkYAABgLAAAAAAAA4BYAAAlHAABgEAAAAAAAALgWAAB4SAAAiBcAAIBIAAAAAAAAIA0AAIgXAACJSAAAAQAAACANAAC4FgAAqkgAAIgXAAC6SAAAAAAAAEgNAACIFwAAy0gAAAEAAABIDQAAuBYAABhMAAC4FgAAN0wAALgWAABWTAAAuBYAAHVMAAC4FgAAlEwAALgWAACzTAAAuBYAANJMAAC4FgAA8UwAALgWAAAQTQAAuBYAAC9NAAC4FgAATk0AALgWAABtTQAAuBYAAIxNAACkFwAAn00AAAAAAAABAAAA8A0AAAAAAAC4FgAA4U0AAKQXAAAHTgAAAAAAAAEAAADwDQAAAAAAAKQXAABJTgAAAAAAAAEAAADwDQAAAAAAAKQXAACITgAAAAAAAAEAAADwDQAAAAAAAKQXAADHTgAAAAAAAAEAAADwDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALgWAADNTwAA4BYAAC1QAAAADwAAAAAAAOAWAADaTwAAEA8AAAAAAAC4FgAA+08AAOAWAAAIUAAA8A4AAAAAAADgFgAAhlAAAOgOAAAAAAAA4BYAAJNQAADoDgAAAAAAAOAWAACjUAAA6A4AAAAAAADgFgAAtVAAADgPAAAAAAAA4BYAAMZQAAA4DwAAAAAAAOAWAADXUAAAAA8AAAAAAADgFgAA+VAAAHgPAAAAAAAA4BYAAB1RAAAADwAAAAAAAOAWAABCUQAAeA8AAAAAAADgFgAAjlEAAAAPAAAAAAAAbBcAALZRAABsFwAAuFEAAGwXAAC7UQAAbBcAAL1RAABsFwAAv1EAAGwXAADBUQAAbBcAAMNRAABsFwAAxVEAAGwXAADHUQAAbBcAAMlRAABsFwAAy1EAAGwXAADNUQAAbBcAAM9RAABsFwAA0VEAAOAWAADTUQAA8A4AAAAAAADgFgAARlIAAOgOAAAAAAAAuBYAAGJSAACkFwAAe1IAAAAAAAABAAAAWBAAAAAAAADgFgAA9FIAAIgQAAAAAAAA4BYAABdTAACYEAAAAAAAALgWAAAuUwAA4BYAAHBTAACIEAAAAAAAAOAWAACSUwAASA8AAAAAAAAAAAAAAAoAAAEAAAACAAAAAwAAAAEAAAAEAAAAAAAAABAKAAABAAAABQAAAAYAAAACAAAABwAAAAAAAAAgCgAACAAAAAkAAAABAAAAAAAAADgKAAAKAAAACwAAAAIAAAABAAAADAAAAA0AAAACAAAAAwAAAAMAAAAAAAAASAoAAAgAAAAOAAAAAQAAAAAAAABYCgAACAAAAA8AAAABAAAAAAAAAIAKAAAIAAAAEAAAAAEAAAAAAAAAcAoAAAgAAAARAAAAAQAAAAAAAACQCgAACAAAABIAAAABAAAAAAAAAKAKAAAIAAAAEwAAAAEAAAAAAAAAsAoAAAgAAAAUAAAAAQAAAAAAAADACgAACAAAABUAAAABAAAAAAAAANAKAAABAAAAFgAAABcAAAAEAAAAGAAAAAAAAADgCgAACAAAABkAAAABAAAAAAAAAPgKAAAFAAAAGgAAABsAAAAAAAAA8AoAAAEAAAAcAAAAHQAAAAAAAAAICwAAAQAAAB4AAAAfAAAABgAAACAAAAAAAAAAIAsAACEAAAAiAAAABwAAAAgAAAAAAAAAGAsAACMAAAAkAAAABwAAAAkAAAAAAAAAMAsAAAEAAAAlAAAAJgAAAAoAAAAnAAAAAAAAAEALAAAoAAAAKQAAAAcAAAALAAAAAAAAAFALAAABAAAAKgAAACsAAAAMAAAALAAAAAAAAABgCwAALQAAAC4AAAAHAAAADQAAAAAAAABwCwAAAQAAAC8AAAAwAAAADgAAADEAAAAAAAAAgAsAADIAAAAzAAAABwAAAA8AAAAAAAAAkAsAAAEAAAA0AAAANQAAABAAAAA2AAAAAAAAAKALAAARAAAANwAAADgAAAAAAAAAsAsAAAEAAAA5AAAAOgAAABIAAAA7AAAAAAAAAMALAAATAAAAPAAAAD0AAAAAAAAA0AsAAAEAAAA+AAAAPwAAABQAAABAAAAAAAAAAOALAAAVAAAAQQAAAEIAAAAAAAAA8AsAAAEAAABDAAAARAAAABYAAABFAAAAAAAAAAAMAAAXAAAARgAAAEcAAAAAAAAAEAwAAAEAAABIAAAASQAAABgAAABKAAAAAAAAACAMAAABAAAASwAAAEwAAAAZAAAATQAAAAAAAAAwDAAAAQAAAE4AAABPAAAAGgAAAFAAAAAAAAAAQAwAABsAAABRAAAAUgAAAAAAAABQDAAAAQAAAFMAAABUAAAAHAAAAFUAAAAAAAAAYAwAAFYAAABXAAAABwAAAB0AAAAAAAAAcAwAAAEAAABYAAAAWQAAAB4AAABaAAAAAAAAAIAMAABbAAAAXAAAAAcAAAAfAAAAAAAAAJAMAAABAAAAXQAAAF4AAAAgAAAAXwAAAAAAAACgDAAAYAAAAGEAAAAHAAAAIQAAAAAAAACwDAAAAQAAAGIAAABjAAAAIgAAAGQAAAAAAAAAwAwAAGUAAABmAAAABwAAACMAAAAAAAAA0AwAAAEAAABnAAAAaAAAACQAAABpAAAAAAAAAOAMAABqAAAAawAAAAcAAAAlAAAAAAAAAPAMAAABAAAAbAAAAG0AAAAmAAAAbgAAAAAAAAAADQAAbwAAAHAAAAAHAAAAJwAAAAAAAAAQDQAAAQAAAHEAAAByAAAAKAAAAHMAAAAoDQAAyA8AACgNAAAIEAAAEBAAACgNAABQDQAAyA8AAFANAAAgEAAAyA8AAFANAAAIEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwDgAAdAAAAHUAAAB2AAAAdwAAAAIAAAABAAAAAQAAAAEAAAAAAAAAGA8AAHQAAAB4AAAAdgAAAHcAAAACAAAAAgAAAAIAAAACAAAAAAAAACgPAAB5AAAAegAAAAQAAAAAAAAAOA8AAHsAAAB8AAAABQAAAAAAAABIDwAACAAAAH0AAAABAAAAAAAAAFgPAAB7AAAAfgAAAAUAAAAAAAAAaA8AAHsAAAB/AAAABQAAAAAAAAC4DwAAdAAAAIAAAAB2AAAAdwAAAAMAAAAAAAAAiA8AAHQAAACBAAAAdgAAAHcAAAAEAAAAAAAAADgQAAB0AAAAggAAAHYAAAB3AAAAAgAAAAMAAAADAAAAAwAAAAAAAABIEAAAgwAAAIQAAAAGAAAAAAAAAHgQAACFAAAAhgAAAAcAAAABAAAABQAAAAYAAAACAAAAAAAAAKAQAACFAAAAhwAAAAgAAAADAAAABQAAAAYAAAAEAAAA4BcAAAQYAAAAAAAAsBAAAIgAAACJAAAAAQAAAExBU1ppcABvcGVuAGdldFBvaW50AGdldENvdW50AER5bmFtaWNMQVNaaXAAYWRkRmllbGRGbG9hdGluZwBhZGRGaWVsZFNpZ25lZABhZGRGaWVsZFVuc2lnbmVkAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9wb2ludGVySVBONmxhc3ppcDdzdHJlYW1zMTNtZW1vcnlfc3RyZWFtRU5TXzE0ZGVmYXVsdF9kZWxldGVJUzNfRUVOU185YWxsb2NhdG9ySVMzX0VFRUUATlN0M19fMjE0ZGVmYXVsdF9kZWxldGVJTjZsYXN6aXA3c3RyZWFtczEzbWVtb3J5X3N0cmVhbUVFRQBOU3QzX18yMjBfX3NoYXJlZF9wdHJfcG9pbnRlcklQTjZsYXN6aXAyaW82cmVhZGVyMTBiYXNpY19maWxlSU5TMV83c3RyZWFtczEzbWVtb3J5X3N0cmVhbUVFRU5TXzE0ZGVmYXVsdF9kZWxldGVJUzdfRUVOU185YWxsb2NhdG9ySVM3X0VFRUUATlN0M19fMjE0ZGVmYXVsdF9kZWxldGVJTjZsYXN6aXAyaW82cmVhZGVyMTBiYXNpY19maWxlSU5TMV83c3RyZWFtczEzbWVtb3J5X3N0cmVhbUVFRUVFAExBU0YATjZsYXN6aXAxM2ludmFsaWRfbWFnaWNFAGFsbG9jYXRvcjxUPjo6YWxsb2NhdGUoc2l6ZV90IG4pICduJyBleGNlZWRzIG1heGltdW0gc3VwcG9ydGVkIHNpemUARmlsZSBtYWdpYyBpcyBub3QgdmFsaWQATlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJWk42bGFzemlwMmlvNnJlYWRlcjEwYmFzaWNfZmlsZUlOUzJfN3N0cmVhbXMxM21lbW9yeV9zdHJlYW1FRTExX3ZhbGlkYXRvcnNFdkVVbFJOUzNfNmhlYWRlckVFX05TXzlhbGxvY2F0b3JJU0JfRUVGdlNBX0VFRQBOU3QzX18yMTBfX2Z1bmN0aW9uNl9fYmFzZUlGdlJONmxhc3ppcDJpbzZoZWFkZXJFRUVFAE42bGFzemlwMjFvbGRfc3R5bGVfY29tcHJlc3Npb25FAE42bGFzemlwMTRub3RfY29tcHJlc3NlZEUAVGhlIGZpbGUgc2VlbXMgdG8gaGF2ZSBvbGQgc3R5bGUgY29tcHJlc3Npb24gd2hpY2ggaXMgbm90IHN1cHBvcnRlZABUaGUgZmlsZSBkb2Vzbid0IHNlZW0gdG8gYmUgY29tcHJlc3NlZABaTjZsYXN6aXAyaW82cmVhZGVyMTBiYXNpY19maWxlSU5TXzdzdHJlYW1zMTNtZW1vcnlfc3RyZWFtRUUxMV92YWxpZGF0b3JzRXZFVWxSTlMwXzZoZWFkZXJFRV8AbGFzemlwIGVuY29kZWQATjZsYXN6aXAxM25vX2xhc3ppcF92bHJFAE42bGFzemlwMjVsYXN6aXBfZm9ybWF0X3Vuc3VwcG9ydGVkRQBPbmx5IExBU3ppcCBQT0lOVFdJU0UgQ0hVTktFRCBkZWNvbXByZXNzb3IgaXMgc3VwcG9ydGVkAE5vIExBU3ppcCBWTFIgd2FzIGZvdW5kIGluIHRoZSBWTFJzIHNlY3Rpb24ATjZsYXN6aXAyMmNodW5rX3RhYmxlX3JlYWRfZXJyb3JFAENodW5rIHRhYmxlIG9mZnNldCA9PSAtMSBpcyBub3Qgc3VwcG9ydGVkIGF0IHRoaXMgdGltZQBONmxhc3ppcDEzbm90X3N1cHBvcnRlZEUATjZsYXN6aXAyNnVua25vd25fY2h1bmtfdGFibGVfZm9ybWF0RQBjaHVua19zaXplID09IHVpbnQubWF4IGlzIG5vdCBzdXBwb3J0ZWQgYXQgdGhpcyB0aW1lLgBUaGVyZSB3YXMgYSBwcm9ibGVtIHJlYWRpbmcgdGhlIGNodW5rIHRhYmxlAFRoZSBjaHVuayB0YWJsZSB2ZXJzaW9uIG51bWJlciBpcyB1bmtub3duAE42bGFzemlwMTFlbmRfb2ZfZmlsZUUAUmVhY2hlZCBFbmQgb2YgZmlsZQBJbnZhbGlkIG51bWJlciBvZiBzeW1ib2xzAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9wb2ludGVySVBONmxhc3ppcDhkZWNvZGVyczEwYXJpdGhtZXRpY0lOUzFfMmlvMThfX2lmc3RyZWFtX3dyYXBwZXJJTlMxXzdzdHJlYW1zMTNtZW1vcnlfc3RyZWFtRUVFRUVOU18xNGRlZmF1bHRfZGVsZXRlSVM5X0VFTlNfOWFsbG9jYXRvcklTOV9FRUVFAE5TdDNfXzIxNGRlZmF1bHRfZGVsZXRlSU42bGFzemlwOGRlY29kZXJzMTBhcml0aG1ldGljSU5TMV8yaW8xOF9faWZzdHJlYW1fd3JhcHBlcklOUzFfN3N0cmVhbXMxM21lbW9yeV9zdHJlYW1FRUVFRUVFAE42bGFzemlwMTl1bmtub3duX3NjaGVtYV90eXBlRQBUaGUgTEFaIHNjaGVtYSBpcyBub3QgcmVjb2duaXplZABONmxhc3ppcDdmb3JtYXRzMjZkeW5hbWljX2ZpZWxkX2RlY29tcHJlc3NvcklOU184ZGVjb2RlcnMxMGFyaXRobWV0aWNJTlNfMmlvMThfX2lmc3RyZWFtX3dyYXBwZXJJTlNfN3N0cmVhbXMxM21lbW9yeV9zdHJlYW1FRUVFRUVFAE42bGFzemlwN2Zvcm1hdHMyMGR5bmFtaWNfZGVjb21wcmVzc29yRQBOU3QzX18yMjBfX3NoYXJlZF9wdHJfcG9pbnRlcklQTjZsYXN6aXA3Zm9ybWF0czI2ZHluYW1pY19maWVsZF9kZWNvbXByZXNzb3JJTlMxXzhkZWNvZGVyczEwYXJpdGhtZXRpY0lOUzFfMmlvMThfX2lmc3RyZWFtX3dyYXBwZXJJTlMxXzdzdHJlYW1zMTNtZW1vcnlfc3RyZWFtRUVFRUVFRU5TXzE0ZGVmYXVsdF9kZWxldGVJU0NfRUVOU185YWxsb2NhdG9ySVNDX0VFRUUATlN0M19fMjE0ZGVmYXVsdF9kZWxldGVJTjZsYXN6aXA3Zm9ybWF0czI2ZHluYW1pY19maWVsZF9kZWNvbXByZXNzb3JJTlMxXzhkZWNvZGVyczEwYXJpdGhtZXRpY0lOUzFfMmlvMThfX2lmc3RyZWFtX3dyYXBwZXJJTlMxXzdzdHJlYW1zMTNtZW1vcnlfc3RyZWFtRUVFRUVFRUVFAE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TXzhkZWNvZGVyczEwYXJpdGhtZXRpY0lOU18yaW8xOF9faWZzdHJlYW1fd3JhcHBlcklOU183c3RyZWFtczEzbWVtb3J5X3N0cmVhbUVFRUVFTlMwXzVmaWVsZElOUzBfM2xhczdwb2ludDEwRU5TMF8yMHN0YW5kYXJkX2RpZmZfbWV0aG9kSVNDX0VFRUVFRQBONmxhc3ppcDdmb3JtYXRzMTBiYXNlX2ZpZWxkRQBOU3QzX18yMjBfX3NoYXJlZF9wdHJfcG9pbnRlcklQTjZsYXN6aXA3Zm9ybWF0czI2ZHluYW1pY19kZWNvbXByZXNzb3JfZmllbGRJTlMxXzhkZWNvZGVyczEwYXJpdGhtZXRpY0lOUzFfMmlvMThfX2lmc3RyZWFtX3dyYXBwZXJJTlMxXzdzdHJlYW1zMTNtZW1vcnlfc3RyZWFtRUVFRUVOUzJfNWZpZWxkSU5TMl8zbGFzN3BvaW50MTBFTlMyXzIwc3RhbmRhcmRfZGlmZl9tZXRob2RJU0VfRUVFRUVFTlNfMTRkZWZhdWx0X2RlbGV0ZUlTSV9FRU5TXzlhbGxvY2F0b3JJU0lfRUVFRQBOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUlONmxhc3ppcDdmb3JtYXRzMjZkeW5hbWljX2RlY29tcHJlc3Nvcl9maWVsZElOUzFfOGRlY29kZXJzMTBhcml0aG1ldGljSU5TMV8yaW8xOF9faWZzdHJlYW1fd3JhcHBlcklOUzFfN3N0cmVhbXMxM21lbW9yeV9zdHJlYW1FRUVFRU5TMl81ZmllbGRJTlMyXzNsYXM3cG9pbnQxMEVOUzJfMjBzdGFuZGFyZF9kaWZmX21ldGhvZElTRV9FRUVFRUVFRQBONmxhc3ppcDdmb3JtYXRzMjZkeW5hbWljX2RlY29tcHJlc3Nvcl9maWVsZElOU184ZGVjb2RlcnMxMGFyaXRobWV0aWNJTlNfMmlvMThfX2lmc3RyZWFtX3dyYXBwZXJJTlNfN3N0cmVhbXMxM21lbW9yeV9zdHJlYW1FRUVFRU5TMF81ZmllbGRJTlMwXzNsYXM3Z3BzdGltZUVOUzBfMjBzdGFuZGFyZF9kaWZmX21ldGhvZElTQ19FRUVFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX3BvaW50ZXJJUE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJTlMxXzJpbzE4X19pZnN0cmVhbV93cmFwcGVySU5TMV83c3RyZWFtczEzbWVtb3J5X3N0cmVhbUVFRUVFTlMyXzVmaWVsZElOUzJfM2xhczdncHN0aW1lRU5TMl8yMHN0YW5kYXJkX2RpZmZfbWV0aG9kSVNFX0VFRUVFRU5TXzE0ZGVmYXVsdF9kZWxldGVJU0lfRUVOU185YWxsb2NhdG9ySVNJX0VFRUUATlN0M19fMjE0ZGVmYXVsdF9kZWxldGVJTjZsYXN6aXA3Zm9ybWF0czI2ZHluYW1pY19kZWNvbXByZXNzb3JfZmllbGRJTlMxXzhkZWNvZGVyczEwYXJpdGhtZXRpY0lOUzFfMmlvMThfX2lmc3RyZWFtX3dyYXBwZXJJTlMxXzdzdHJlYW1zMTNtZW1vcnlfc3RyZWFtRUVFRUVOUzJfNWZpZWxkSU5TMl8zbGFzN2dwc3RpbWVFTlMyXzIwc3RhbmRhcmRfZGlmZl9tZXRob2RJU0VfRUVFRUVFRUUATjZsYXN6aXA3Zm9ybWF0czI2ZHluYW1pY19kZWNvbXByZXNzb3JfZmllbGRJTlNfOGRlY29kZXJzMTBhcml0aG1ldGljSU5TXzJpbzE4X19pZnN0cmVhbV93cmFwcGVySU5TXzdzdHJlYW1zMTNtZW1vcnlfc3RyZWFtRUVFRUVOUzBfNWZpZWxkSU5TMF8zbGFzM3JnYkVOUzBfMjBzdGFuZGFyZF9kaWZmX21ldGhvZElTQ19FRUVFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX3BvaW50ZXJJUE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJTlMxXzJpbzE4X19pZnN0cmVhbV93cmFwcGVySU5TMV83c3RyZWFtczEzbWVtb3J5X3N0cmVhbUVFRUVFTlMyXzVmaWVsZElOUzJfM2xhczNyZ2JFTlMyXzIwc3RhbmRhcmRfZGlmZl9tZXRob2RJU0VfRUVFRUVFTlNfMTRkZWZhdWx0X2RlbGV0ZUlTSV9FRU5TXzlhbGxvY2F0b3JJU0lfRUVFRQBOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUlONmxhc3ppcDdmb3JtYXRzMjZkeW5hbWljX2RlY29tcHJlc3Nvcl9maWVsZElOUzFfOGRlY29kZXJzMTBhcml0aG1ldGljSU5TMV8yaW8xOF9faWZzdHJlYW1fd3JhcHBlcklOUzFfN3N0cmVhbXMxM21lbW9yeV9zdHJlYW1FRUVFRU5TMl81ZmllbGRJTlMyXzNsYXMzcmdiRU5TMl8yMHN0YW5kYXJkX2RpZmZfbWV0aG9kSVNFX0VFRUVFRUVFAE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TXzhkZWNvZGVyczEwYXJpdGhtZXRpY0lOU18yaW8xOF9faWZzdHJlYW1fd3JhcHBlcklOU183c3RyZWFtczEzbWVtb3J5X3N0cmVhbUVFRUVFTlMwXzVmaWVsZElOUzBfM2xhczEwZXh0cmFieXRlc0VOUzBfMjBzdGFuZGFyZF9kaWZmX21ldGhvZElTQ19FRUVFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX3BvaW50ZXJJUE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJTlMxXzJpbzE4X19pZnN0cmVhbV93cmFwcGVySU5TMV83c3RyZWFtczEzbWVtb3J5X3N0cmVhbUVFRUVFTlMyXzVmaWVsZElOUzJfM2xhczEwZXh0cmFieXRlc0VOUzJfMjBzdGFuZGFyZF9kaWZmX21ldGhvZElTRV9FRUVFRUVOU18xNGRlZmF1bHRfZGVsZXRlSVNJX0VFTlNfOWFsbG9jYXRvcklTSV9FRUVFAE5TdDNfXzIxNGRlZmF1bHRfZGVsZXRlSU42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJTlMxXzJpbzE4X19pZnN0cmVhbV93cmFwcGVySU5TMV83c3RyZWFtczEzbWVtb3J5X3N0cmVhbUVFRUVFTlMyXzVmaWVsZElOUzJfM2xhczEwZXh0cmFieXRlc0VOUzJfMjBzdGFuZGFyZF9kaWZmX21ldGhvZElTRV9FRUVFRUVFRQBONmxhc3ppcDdmb3JtYXRzMjFkeW5hbWljX2RlY29tcHJlc3NvcjFJTlNfOGRlY29kZXJzMTBhcml0aG1ldGljSU5TXzJpbzE4X19pZnN0cmVhbV93cmFwcGVySU5TXzdzdHJlYW1zMTNtZW1vcnlfc3RyZWFtRUVFRUVOUzBfMTlyZWNvcmRfZGVjb21wcmVzc29ySUpOUzBfNWZpZWxkSU5TMF8zbGFzN3BvaW50MTBFTlMwXzIwc3RhbmRhcmRfZGlmZl9tZXRob2RJU0RfRUVFRUVFRUVFAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9wb2ludGVySVBONmxhc3ppcDdmb3JtYXRzMjFkeW5hbWljX2RlY29tcHJlc3NvcjFJTlMxXzhkZWNvZGVyczEwYXJpdGhtZXRpY0lOUzFfMmlvMThfX2lmc3RyZWFtX3dyYXBwZXJJTlMxXzdzdHJlYW1zMTNtZW1vcnlfc3RyZWFtRUVFRUVOUzJfMTlyZWNvcmRfZGVjb21wcmVzc29ySUpOUzJfNWZpZWxkSU5TMl8zbGFzN3BvaW50MTBFTlMyXzIwc3RhbmRhcmRfZGlmZl9tZXRob2RJU0ZfRUVFRUVFRUVFTlNfMTRkZWZhdWx0X2RlbGV0ZUlTS19FRU5TXzlhbGxvY2F0b3JJU0tfRUVFRQBOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUlONmxhc3ppcDdmb3JtYXRzMjFkeW5hbWljX2RlY29tcHJlc3NvcjFJTlMxXzhkZWNvZGVyczEwYXJpdGhtZXRpY0lOUzFfMmlvMThfX2lmc3RyZWFtX3dyYXBwZXJJTlMxXzdzdHJlYW1zMTNtZW1vcnlfc3RyZWFtRUVFRUVOUzJfMTlyZWNvcmRfZGVjb21wcmVzc29ySUpOUzJfNWZpZWxkSU5TMl8zbGFzN3BvaW50MTBFTlMyXzIwc3RhbmRhcmRfZGlmZl9tZXRob2RJU0ZfRUVFRUVFRUVFRUUATjZsYXN6aXA3Zm9ybWF0czIxZHluYW1pY19kZWNvbXByZXNzb3IxSU5TXzhkZWNvZGVyczEwYXJpdGhtZXRpY0lOU18yaW8xOF9faWZzdHJlYW1fd3JhcHBlcklOU183c3RyZWFtczEzbWVtb3J5X3N0cmVhbUVFRUVFTlMwXzE5cmVjb3JkX2RlY29tcHJlc3NvcklKTlMwXzVmaWVsZElOUzBfM2xhczdwb2ludDEwRU5TMF8yMHN0YW5kYXJkX2RpZmZfbWV0aG9kSVNEX0VFRUVOU0JfSU5TQ183Z3BzdGltZUVOU0VfSVNIX0VFRUVFRUVFRQBOU3QzX18yMjBfX3NoYXJlZF9wdHJfcG9pbnRlcklQTjZsYXN6aXA3Zm9ybWF0czIxZHluYW1pY19kZWNvbXByZXNzb3IxSU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJTlMxXzJpbzE4X19pZnN0cmVhbV93cmFwcGVySU5TMV83c3RyZWFtczEzbWVtb3J5X3N0cmVhbUVFRUVFTlMyXzE5cmVjb3JkX2RlY29tcHJlc3NvcklKTlMyXzVmaWVsZElOUzJfM2xhczdwb2ludDEwRU5TMl8yMHN0YW5kYXJkX2RpZmZfbWV0aG9kSVNGX0VFRUVOU0RfSU5TRV83Z3BzdGltZUVOU0dfSVNKX0VFRUVFRUVFRU5TXzE0ZGVmYXVsdF9kZWxldGVJU05fRUVOU185YWxsb2NhdG9ySVNOX0VFRUUATlN0M19fMjE0ZGVmYXVsdF9kZWxldGVJTjZsYXN6aXA3Zm9ybWF0czIxZHluYW1pY19kZWNvbXByZXNzb3IxSU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJTlMxXzJpbzE4X19pZnN0cmVhbV93cmFwcGVySU5TMV83c3RyZWFtczEzbWVtb3J5X3N0cmVhbUVFRUVFTlMyXzE5cmVjb3JkX2RlY29tcHJlc3NvcklKTlMyXzVmaWVsZElOUzJfM2xhczdwb2ludDEwRU5TMl8yMHN0YW5kYXJkX2RpZmZfbWV0aG9kSVNGX0VFRUVOU0RfSU5TRV83Z3BzdGltZUVOU0dfSVNKX0VFRUVFRUVFRUVFAE42bGFzemlwN2Zvcm1hdHMyMWR5bmFtaWNfZGVjb21wcmVzc29yMUlOU184ZGVjb2RlcnMxMGFyaXRobWV0aWNJTlNfMmlvMThfX2lmc3RyZWFtX3dyYXBwZXJJTlNfN3N0cmVhbXMxM21lbW9yeV9zdHJlYW1FRUVFRU5TMF8xOXJlY29yZF9kZWNvbXByZXNzb3JJSk5TMF81ZmllbGRJTlMwXzNsYXM3cG9pbnQxMEVOUzBfMjBzdGFuZGFyZF9kaWZmX21ldGhvZElTRF9FRUVFTlNCX0lOU0NfM3JnYkVOU0VfSVNIX0VFRUVFRUVFRQBOU3QzX18yMjBfX3NoYXJlZF9wdHJfcG9pbnRlcklQTjZsYXN6aXA3Zm9ybWF0czIxZHluYW1pY19kZWNvbXByZXNzb3IxSU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJTlMxXzJpbzE4X19pZnN0cmVhbV93cmFwcGVySU5TMV83c3RyZWFtczEzbWVtb3J5X3N0cmVhbUVFRUVFTlMyXzE5cmVjb3JkX2RlY29tcHJlc3NvcklKTlMyXzVmaWVsZElOUzJfM2xhczdwb2ludDEwRU5TMl8yMHN0YW5kYXJkX2RpZmZfbWV0aG9kSVNGX0VFRUVOU0RfSU5TRV8zcmdiRU5TR19JU0pfRUVFRUVFRUVFTlNfMTRkZWZhdWx0X2RlbGV0ZUlTTl9FRU5TXzlhbGxvY2F0b3JJU05fRUVFRQBOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUlONmxhc3ppcDdmb3JtYXRzMjFkeW5hbWljX2RlY29tcHJlc3NvcjFJTlMxXzhkZWNvZGVyczEwYXJpdGhtZXRpY0lOUzFfMmlvMThfX2lmc3RyZWFtX3dyYXBwZXJJTlMxXzdzdHJlYW1zMTNtZW1vcnlfc3RyZWFtRUVFRUVOUzJfMTlyZWNvcmRfZGVjb21wcmVzc29ySUpOUzJfNWZpZWxkSU5TMl8zbGFzN3BvaW50MTBFTlMyXzIwc3RhbmRhcmRfZGlmZl9tZXRob2RJU0ZfRUVFRU5TRF9JTlNFXzNyZ2JFTlNHX0lTSl9FRUVFRUVFRUVFRQBONmxhc3ppcDdmb3JtYXRzMjFkeW5hbWljX2RlY29tcHJlc3NvcjFJTlNfOGRlY29kZXJzMTBhcml0aG1ldGljSU5TXzJpbzE4X19pZnN0cmVhbV93cmFwcGVySU5TXzdzdHJlYW1zMTNtZW1vcnlfc3RyZWFtRUVFRUVOUzBfMTlyZWNvcmRfZGVjb21wcmVzc29ySUpOUzBfNWZpZWxkSU5TMF8zbGFzN3BvaW50MTBFTlMwXzIwc3RhbmRhcmRfZGlmZl9tZXRob2RJU0RfRUVFRU5TQl9JTlNDXzdncHN0aW1lRU5TRV9JU0hfRUVFRU5TQl9JTlNDXzNyZ2JFTlNFX0lTS19FRUVFRUVFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX3BvaW50ZXJJUE42bGFzemlwN2Zvcm1hdHMyMWR5bmFtaWNfZGVjb21wcmVzc29yMUlOUzFfOGRlY29kZXJzMTBhcml0aG1ldGljSU5TMV8yaW8xOF9faWZzdHJlYW1fd3JhcHBlcklOUzFfN3N0cmVhbXMxM21lbW9yeV9zdHJlYW1FRUVFRU5TMl8xOXJlY29yZF9kZWNvbXByZXNzb3JJSk5TMl81ZmllbGRJTlMyXzNsYXM3cG9pbnQxMEVOUzJfMjBzdGFuZGFyZF9kaWZmX21ldGhvZElTRl9FRUVFTlNEX0lOU0VfN2dwc3RpbWVFTlNHX0lTSl9FRUVFTlNEX0lOU0VfM3JnYkVOU0dfSVNNX0VFRUVFRUVFRU5TXzE0ZGVmYXVsdF9kZWxldGVJU1FfRUVOU185YWxsb2NhdG9ySVNRX0VFRUUATlN0M19fMjE0ZGVmYXVsdF9kZWxldGVJTjZsYXN6aXA3Zm9ybWF0czIxZHluYW1pY19kZWNvbXByZXNzb3IxSU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJTlMxXzJpbzE4X19pZnN0cmVhbV93cmFwcGVySU5TMV83c3RyZWFtczEzbWVtb3J5X3N0cmVhbUVFRUVFTlMyXzE5cmVjb3JkX2RlY29tcHJlc3NvcklKTlMyXzVmaWVsZElOUzJfM2xhczdwb2ludDEwRU5TMl8yMHN0YW5kYXJkX2RpZmZfbWV0aG9kSVNGX0VFRUVOU0RfSU5TRV83Z3BzdGltZUVOU0dfSVNKX0VFRUVOU0RfSU5TRV8zcmdiRU5TR19JU01fRUVFRUVFRUVFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX3BvaW50ZXJJUDEwYnVmX3N0cmVhbU5TXzE0ZGVmYXVsdF9kZWxldGVJUzFfRUVOU185YWxsb2NhdG9ySVMxX0VFRUUATlN0M19fMjE0ZGVmYXVsdF9kZWxldGVJMTBidWZfc3RyZWFtRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX3BvaW50ZXJJUE42bGFzemlwOGRlY29kZXJzMTBhcml0aG1ldGljSTEwYnVmX3N0cmVhbUVFTlNfMTRkZWZhdWx0X2RlbGV0ZUlTNV9FRU5TXzlhbGxvY2F0b3JJUzVfRUVFRQBOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUlONmxhc3ppcDhkZWNvZGVyczEwYXJpdGhtZXRpY0kxMGJ1Zl9zdHJlYW1FRUVFAE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZmllbGRfZGVjb21wcmVzc29ySU5TXzhkZWNvZGVyczEwYXJpdGhtZXRpY0kxMGJ1Zl9zdHJlYW1FRUVFAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9wb2ludGVySVBONmxhc3ppcDdmb3JtYXRzMjZkeW5hbWljX2ZpZWxkX2RlY29tcHJlc3NvcklOUzFfOGRlY29kZXJzMTBhcml0aG1ldGljSTEwYnVmX3N0cmVhbUVFRUVOU18xNGRlZmF1bHRfZGVsZXRlSVM4X0VFTlNfOWFsbG9jYXRvcklTOF9FRUVFAE5TdDNfXzIxNGRlZmF1bHRfZGVsZXRlSU42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZmllbGRfZGVjb21wcmVzc29ySU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJMTBidWZfc3RyZWFtRUVFRUVFAE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TXzhkZWNvZGVyczEwYXJpdGhtZXRpY0kxMGJ1Zl9zdHJlYW1FRU5TMF81ZmllbGRJaU5TMF8yMHN0YW5kYXJkX2RpZmZfbWV0aG9kSWlFRUVFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX3BvaW50ZXJJUE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJMTBidWZfc3RyZWFtRUVOUzJfNWZpZWxkSWlOUzJfMjBzdGFuZGFyZF9kaWZmX21ldGhvZElpRUVFRUVFTlNfMTRkZWZhdWx0X2RlbGV0ZUlTQ19FRU5TXzlhbGxvY2F0b3JJU0NfRUVFRQBOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUlONmxhc3ppcDdmb3JtYXRzMjZkeW5hbWljX2RlY29tcHJlc3Nvcl9maWVsZElOUzFfOGRlY29kZXJzMTBhcml0aG1ldGljSTEwYnVmX3N0cmVhbUVFTlMyXzVmaWVsZElpTlMyXzIwc3RhbmRhcmRfZGlmZl9tZXRob2RJaUVFRUVFRUVFAE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TXzhkZWNvZGVyczEwYXJpdGhtZXRpY0kxMGJ1Zl9zdHJlYW1FRU5TMF81ZmllbGRJak5TMF8yMHN0YW5kYXJkX2RpZmZfbWV0aG9kSWpFRUVFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX3BvaW50ZXJJUE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJMTBidWZfc3RyZWFtRUVOUzJfNWZpZWxkSWpOUzJfMjBzdGFuZGFyZF9kaWZmX21ldGhvZElqRUVFRUVFTlNfMTRkZWZhdWx0X2RlbGV0ZUlTQ19FRU5TXzlhbGxvY2F0b3JJU0NfRUVFRQBOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUlONmxhc3ppcDdmb3JtYXRzMjZkeW5hbWljX2RlY29tcHJlc3Nvcl9maWVsZElOUzFfOGRlY29kZXJzMTBhcml0aG1ldGljSTEwYnVmX3N0cmVhbUVFTlMyXzVmaWVsZElqTlMyXzIwc3RhbmRhcmRfZGlmZl9tZXRob2RJakVFRUVFRUVFAE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TXzhkZWNvZGVyczEwYXJpdGhtZXRpY0kxMGJ1Zl9zdHJlYW1FRU5TMF81ZmllbGRJYU5TMF8yMHN0YW5kYXJkX2RpZmZfbWV0aG9kSWFFRUVFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX3BvaW50ZXJJUE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJMTBidWZfc3RyZWFtRUVOUzJfNWZpZWxkSWFOUzJfMjBzdGFuZGFyZF9kaWZmX21ldGhvZElhRUVFRUVFTlNfMTRkZWZhdWx0X2RlbGV0ZUlTQ19FRU5TXzlhbGxvY2F0b3JJU0NfRUVFRQBOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUlONmxhc3ppcDdmb3JtYXRzMjZkeW5hbWljX2RlY29tcHJlc3Nvcl9maWVsZElOUzFfOGRlY29kZXJzMTBhcml0aG1ldGljSTEwYnVmX3N0cmVhbUVFTlMyXzVmaWVsZElhTlMyXzIwc3RhbmRhcmRfZGlmZl9tZXRob2RJYUVFRUVFRUVFAE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TXzhkZWNvZGVyczEwYXJpdGhtZXRpY0kxMGJ1Zl9zdHJlYW1FRU5TMF81ZmllbGRJc05TMF8yMHN0YW5kYXJkX2RpZmZfbWV0aG9kSXNFRUVFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX3BvaW50ZXJJUE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJMTBidWZfc3RyZWFtRUVOUzJfNWZpZWxkSXNOUzJfMjBzdGFuZGFyZF9kaWZmX21ldGhvZElzRUVFRUVFTlNfMTRkZWZhdWx0X2RlbGV0ZUlTQ19FRU5TXzlhbGxvY2F0b3JJU0NfRUVFRQBOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUlONmxhc3ppcDdmb3JtYXRzMjZkeW5hbWljX2RlY29tcHJlc3Nvcl9maWVsZElOUzFfOGRlY29kZXJzMTBhcml0aG1ldGljSTEwYnVmX3N0cmVhbUVFTlMyXzVmaWVsZElzTlMyXzIwc3RhbmRhcmRfZGlmZl9tZXRob2RJc0VFRUVFRUVFAE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TXzhkZWNvZGVyczEwYXJpdGhtZXRpY0kxMGJ1Zl9zdHJlYW1FRU5TMF81ZmllbGRJaE5TMF8yMHN0YW5kYXJkX2RpZmZfbWV0aG9kSWhFRUVFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX3BvaW50ZXJJUE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJMTBidWZfc3RyZWFtRUVOUzJfNWZpZWxkSWhOUzJfMjBzdGFuZGFyZF9kaWZmX21ldGhvZEloRUVFRUVFTlNfMTRkZWZhdWx0X2RlbGV0ZUlTQ19FRU5TXzlhbGxvY2F0b3JJU0NfRUVFRQBOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUlONmxhc3ppcDdmb3JtYXRzMjZkeW5hbWljX2RlY29tcHJlc3Nvcl9maWVsZElOUzFfOGRlY29kZXJzMTBhcml0aG1ldGljSTEwYnVmX3N0cmVhbUVFTlMyXzVmaWVsZEloTlMyXzIwc3RhbmRhcmRfZGlmZl9tZXRob2RJaEVFRUVFRUVFAE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TXzhkZWNvZGVyczEwYXJpdGhtZXRpY0kxMGJ1Zl9zdHJlYW1FRU5TMF81ZmllbGRJdE5TMF8yMHN0YW5kYXJkX2RpZmZfbWV0aG9kSXRFRUVFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX3BvaW50ZXJJUE42bGFzemlwN2Zvcm1hdHMyNmR5bmFtaWNfZGVjb21wcmVzc29yX2ZpZWxkSU5TMV84ZGVjb2RlcnMxMGFyaXRobWV0aWNJMTBidWZfc3RyZWFtRUVOUzJfNWZpZWxkSXROUzJfMjBzdGFuZGFyZF9kaWZmX21ldGhvZEl0RUVFRUVFTlNfMTRkZWZhdWx0X2RlbGV0ZUlTQ19FRU5TXzlhbGxvY2F0b3JJU0NfRUVFRQBOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUlONmxhc3ppcDdmb3JtYXRzMjZkeW5hbWljX2RlY29tcHJlc3Nvcl9maWVsZElOUzFfOGRlY29kZXJzMTBhcml0aG1ldGljSTEwYnVmX3N0cmVhbUVFTlMyXzVmaWVsZEl0TlMyXzIwc3RhbmRhcmRfZGlmZl9tZXRob2RJdEVFRUVFRUVFADZMQVNaaXAAUDZMQVNaaXAAUEs2TEFTWmlwAGlpAHYAdmkAdmlpaWkAdmlpaQBpaWkAMTNEeW5hbWljTEFTWmlwAFAxM0R5bmFtaWNMQVNaaXAAUEsxM0R5bmFtaWNMQVNaaXAAdm9pZABib29sAGNoYXIAc2lnbmVkIGNoYXIAdW5zaWduZWQgY2hhcgBzaG9ydAB1bnNpZ25lZCBzaG9ydABpbnQAdW5zaWduZWQgaW50AGxvbmcAdW5zaWduZWQgbG9uZwBmbG9hdABkb3VibGUAc3RkOjpzdHJpbmcAc3RkOjpiYXNpY19zdHJpbmc8dW5zaWduZWQgY2hhcj4Ac3RkOjp3c3RyaW5nAHN0ZDo6dTE2c3RyaW5nAHN0ZDo6dTMyc3RyaW5nAGVtc2NyaXB0ZW46OnZhbABlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxjaGFyPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxzaWduZWQgY2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dW5zaWduZWQgY2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8c2hvcnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIHNob3J0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGludD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8bG9uZz4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dW5zaWduZWQgbG9uZz4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50OF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50OF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50MTZfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50MzJfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dWludDMyX3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGZsb2F0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxkb3VibGU+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGxvbmcgZG91YmxlPgBOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0llRUUATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJZEVFAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWZFRQBOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0ltRUUATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJbEVFAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWpFRQBOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lpRUUATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJdEVFAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXNFRQBOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0loRUUATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJYUVFAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWNFRQBOMTBlbXNjcmlwdGVuM3ZhbEUATlN0M19fMjEyYmFzaWNfc3RyaW5nSURpTlNfMTFjaGFyX3RyYWl0c0lEaUVFTlNfOWFsbG9jYXRvcklEaUVFRUUATlN0M19fMjIxX19iYXNpY19zdHJpbmdfY29tbW9uSUxiMUVFRQBOU3QzX18yMTJiYXNpY19zdHJpbmdJRHNOU18xMWNoYXJfdHJhaXRzSURzRUVOU185YWxsb2NhdG9ySURzRUVFRQBOU3QzX18yMTJiYXNpY19zdHJpbmdJd05TXzExY2hhcl90cmFpdHNJd0VFTlNfOWFsbG9jYXRvckl3RUVFRQBOU3QzX18yMTJiYXNpY19zdHJpbmdJaE5TXzExY2hhcl90cmFpdHNJaEVFTlNfOWFsbG9jYXRvckloRUVFRQBOU3QzX18yMTJiYXNpY19zdHJpbmdJY05TXzExY2hhcl90cmFpdHNJY0VFTlNfOWFsbG9jYXRvckljRUVFRQAtKyAgIDBYMHgAKG51bGwpAC0wWCswWCAwWC0weCsweCAweABpbmYASU5GAG5hbgBOQU4ALgB0ZXJtaW5hdGluZyB3aXRoICVzIGV4Y2VwdGlvbiBvZiB0eXBlICVzOiAlcwB0ZXJtaW5hdGluZyB3aXRoICVzIGV4Y2VwdGlvbiBvZiB0eXBlICVzAHRlcm1pbmF0aW5nIHdpdGggJXMgZm9yZWlnbiBleGNlcHRpb24AdGVybWluYXRpbmcAdW5jYXVnaHQAU3Q5ZXhjZXB0aW9uAE4xMF9fY3h4YWJpdjExNl9fc2hpbV90eXBlX2luZm9FAFN0OXR5cGVfaW5mbwBOMTBfX2N4eGFiaXYxMjBfX3NpX2NsYXNzX3R5cGVfaW5mb0UATjEwX19jeHhhYml2MTE3X19jbGFzc190eXBlX2luZm9FAHRlcm1pbmF0ZV9oYW5kbGVyIHVuZXhwZWN0ZWRseSByZXR1cm5lZABzdGQ6OmJhZF9hbGxvYwBTdDliYWRfYWxsb2MAU3QxMWxvZ2ljX2Vycm9yAFN0MTNydW50aW1lX2Vycm9yAFN0MTJsZW5ndGhfZXJyb3IAU3QxMm91dF9vZl9yYW5nZQBOMTBfX2N4eGFiaXYxMTdfX3BiYXNlX3R5cGVfaW5mb0UATjEwX19jeHhhYml2MTE5X19wb2ludGVyX3R5cGVfaW5mb0UATjEwX19jeHhhYml2MTIwX19mdW5jdGlvbl90eXBlX2luZm9FAE4xMF9fY3h4YWJpdjEyOV9fcG9pbnRlcl90b19tZW1iZXJfdHlwZV9pbmZvRQBQdXJlIHZpcnR1YWwgZnVuY3Rpb24gY2FsbGVkIQBOMTBfX2N4eGFiaXYxMjNfX2Z1bmRhbWVudGFsX3R5cGVfaW5mb0UAdgBEbgBiAGMAaABhAHMAdABpAGoAbABtAGYAZABOMTBfX2N4eGFiaXYxMjFfX3ZtaV9jbGFzc190eXBlX2luZm9FAF9fY3hhX2d1YXJkX2FjcXVpcmUgZGV0ZWN0ZWQgcmVjdXJzaXZlIGluaXRpYWxpemF0aW9uAHN0ZDo6YmFkX2Z1bmN0aW9uX2NhbGwATlN0M19fMjE3YmFkX2Z1bmN0aW9uX2NhbGxFAE5TdDNfXzIxNF9fc2hhcmVkX2NvdW50RQBOU3QzX18yMTlfX3NoYXJlZF93ZWFrX2NvdW50RQBtdXRleCBsb2NrIGZhaWxlZABiYXNpY19zdHJpbmcAdW5zcGVjaWZpZWQgZ2VuZXJpY19jYXRlZ29yeSBlcnJvcgBVbmtub3duIGVycm9yICVkAGdlbmVyaWMATlN0M19fMjI0X19nZW5lcmljX2Vycm9yX2NhdGVnb3J5RQBOU3QzX18yMTJfX2RvX21lc3NhZ2VFAE5TdDNfXzIxNGVycm9yX2NhdGVnb3J5RQB1bnNwZWNpZmllZCBzeXN0ZW1fY2F0ZWdvcnkgZXJyb3IAc3lzdGVtAE5TdDNfXzIyM19fc3lzdGVtX2Vycm9yX2NhdGVnb3J5RQBOU3QzX18yMTJzeXN0ZW1fZXJyb3JFADogAHZlY3Rvcg=="; var tempDoublePtr = 22368; function ___cxa_allocate_exception(size) { return _malloc(size) } var ___exception_infos = {}; function ___exception_addRef(ptr) { if (!ptr) return; var info = ___exception_infos[ptr]; info.refcount++; } function ___exception_deAdjust(adjusted) { if (!adjusted || ___exception_infos[adjusted]) return adjusted; for (var key in ___exception_infos) { var ptr = +key; var adj = ___exception_infos[ptr].adjusted; var len = adj.length; for (var i = 0; i < len; i++) { if (adj[i] === adjusted) { return ptr } } } return adjusted } function ___cxa_begin_catch(ptr) { var info = ___exception_infos[ptr]; if (info && !info.caught) { info.caught = true; __ZSt18uncaught_exceptionv.uncaught_exceptions--; } if (info) info.rethrown = false; ___exception_addRef(___exception_deAdjust(ptr)); return ptr } function ___cxa_throw(ptr, type, destructor) { ___exception_infos[ptr] = { ptr: ptr, adjusted: [ptr], type: type, destructor: destructor, refcount: 0, caught: false, rethrown: false }; if (!("uncaught_exception" in __ZSt18uncaught_exceptionv)) { __ZSt18uncaught_exceptionv.uncaught_exceptions = 1; } else { __ZSt18uncaught_exceptionv.uncaught_exceptions++; } throw ptr } function ___cxa_uncaught_exceptions() { return __ZSt18uncaught_exceptionv.uncaught_exceptions } function ___gxx_personality_v0() {} function getShiftFromSize(size) { switch (size) { case 1: return 0; case 2: return 1; case 4: return 2; case 8: return 3; default: throw new TypeError("Unknown type size: " + size) } } function embind_init_charCodes() { var codes = new Array(256); for (var i = 0; i < 256; ++i) { codes[i] = String.fromCharCode(i); } embind_charCodes = codes; } var embind_charCodes = undefined; function readLatin1String(ptr) { var ret = ""; var c = ptr; while (HEAPU8[c]) { ret += embind_charCodes[HEAPU8[c++]]; } return ret } var awaitingDependencies = {}; var registeredTypes = {}; var typeDependencies = {}; var char_0 = 48; var char_9 = 57; function makeLegalFunctionName(name) { if (undefined === name) { return "_unknown" } name = name.replace(/[^a-zA-Z0-9_]/g, "$"); var f = name.charCodeAt(0); if (f >= char_0 && f <= char_9) { return "_" + name } else { return name } } function createNamedFunction(name, body) { name = makeLegalFunctionName(name); return new Function("body", "return function " + name + "() {\n" + ' "use strict";' + " return body.apply(this, arguments);\n" + "};\n")(body) } function extendError(baseErrorType, errorName) { var errorClass = createNamedFunction(errorName, function (message) { this.name = errorName; this.message = message; var stack = new Error(message).stack; if (stack !== undefined) { this.stack = this.toString() + "\n" + stack.replace(/^Error(:[^\n]*)?\n/, ""); } }); errorClass.prototype = Object.create(baseErrorType.prototype); errorClass.prototype.constructor = errorClass; errorClass.prototype.toString = function () { if (this.message === undefined) { return this.name } else { return this.name + ": " + this.message } }; return errorClass } var BindingError = undefined; function throwBindingError(message) { throw new BindingError(message) } var InternalError = undefined; function throwInternalError(message) { throw new InternalError(message) } function whenDependentTypesAreResolved(myTypes, dependentTypes, getTypeConverters) { myTypes.forEach(function (type) { typeDependencies[type] = dependentTypes; }); function onComplete(typeConverters) { var myTypeConverters = getTypeConverters(typeConverters); if (myTypeConverters.length !== myTypes.length) { throwInternalError("Mismatched type converter count"); } for (var i = 0; i < myTypes.length; ++i) { registerType(myTypes[i], myTypeConverters[i]); } } var typeConverters = new Array(dependentTypes.length); var unregisteredTypes = []; var registered = 0; dependentTypes.forEach(function (dt, i) { if (registeredTypes.hasOwnProperty(dt)) { typeConverters[i] = registeredTypes[dt]; } else { unregisteredTypes.push(dt); if (!awaitingDependencies.hasOwnProperty(dt)) { awaitingDependencies[dt] = []; } awaitingDependencies[dt].push(function () { typeConverters[i] = registeredTypes[dt]; ++registered; if (registered === unregisteredTypes.length) { onComplete(typeConverters); } }); } }); if (0 === unregisteredTypes.length) { onComplete(typeConverters); } } function registerType(rawType, registeredInstance, options) { options = options || {}; if (!("argPackAdvance" in registeredInstance)) { throw new TypeError("registerType registeredInstance requires argPackAdvance") } var name = registeredInstance.name; if (!rawType) { throwBindingError('type "' + name + '" must have a positive integer typeid pointer'); } if (registeredTypes.hasOwnProperty(rawType)) { if (options.ignoreDuplicateRegistrations) { return } else { throwBindingError("Cannot register type '" + name + "' twice"); } } registeredTypes[rawType] = registeredInstance; delete typeDependencies[rawType]; if (awaitingDependencies.hasOwnProperty(rawType)) { var callbacks = awaitingDependencies[rawType]; delete awaitingDependencies[rawType]; callbacks.forEach(function (cb) { cb(); }); } } function __embind_register_bool(rawType, name, size, trueValue, falseValue) { var shift = getShiftFromSize(size); name = readLatin1String(name); registerType(rawType, { name: name, "fromWireType": function (wt) { return !!wt }, "toWireType": function (destructors, o) { return o ? trueValue : falseValue }, "argPackAdvance": 8, "readValueFromPointer": function (pointer) { var heap; if (size === 1) { heap = HEAP8; } else if (size === 2) { heap = HEAP16; } else if (size === 4) { heap = HEAP32; } else { throw new TypeError("Unknown boolean type size: " + name) } return this["fromWireType"](heap[pointer >> shift]) }, destructorFunction: null }); } function ClassHandle_isAliasOf(other) { if (!(this instanceof ClassHandle)) { return false } if (!(other instanceof ClassHandle)) { return false } var leftClass = this.$$.ptrType.registeredClass; var left = this.$$.ptr; var rightClass = other.$$.ptrType.registeredClass; var right = other.$$.ptr; while (leftClass.baseClass) { left = leftClass.upcast(left); leftClass = leftClass.baseClass; } while (rightClass.baseClass) { right = rightClass.upcast(right); rightClass = rightClass.baseClass; } return leftClass === rightClass && left === right } function shallowCopyInternalPointer(o) { return { count: o.count, deleteScheduled: o.deleteScheduled, preservePointerOnDelete: o.preservePointerOnDelete, ptr: o.ptr, ptrType: o.ptrType, smartPtr: o.smartPtr, smartPtrType: o.smartPtrType } } function throwInstanceAlreadyDeleted(obj) { function getInstanceTypeName(handle) { return handle.$$.ptrType.registeredClass.name } throwBindingError(getInstanceTypeName(obj) + " instance already deleted"); } var finalizationGroup = false; function detachFinalizer(handle) {} function runDestructor($$) { if ($$.smartPtr) { $$.smartPtrType.rawDestructor($$.smartPtr); } else { $$.ptrType.registeredClass.rawDestructor($$.ptr); } } function releaseClassHandle($$) { $$.count.value -= 1; var toDelete = 0 === $$.count.value; if (toDelete) { runDestructor($$); } } function attachFinalizer(handle) { if ("undefined" === typeof FinalizationGroup) { attachFinalizer = function (handle) { return handle }; return handle } finalizationGroup = new FinalizationGroup(function (iter) { for (var result = iter.next(); !result.done; result = iter.next()) { var $$ = result.value; if (!$$.ptr) { console.warn("object already deleted: " + $$.ptr); } else { releaseClassHandle($$); } } }); attachFinalizer = function (handle) { finalizationGroup.register(handle, handle.$$, handle.$$); return handle }; detachFinalizer = function (handle) { finalizationGroup.unregister(handle.$$); }; return attachFinalizer(handle) } function ClassHandle_clone() { if (!this.$$.ptr) { throwInstanceAlreadyDeleted(this); } if (this.$$.preservePointerOnDelete) { this.$$.count.value += 1; return this } else { var clone = attachFinalizer(Object.create(Object.getPrototypeOf(this), { $$: { value: shallowCopyInternalPointer(this.$$) } })); clone.$$.count.value += 1; clone.$$.deleteScheduled = false; return clone } } function ClassHandle_delete() { if (!this.$$.ptr) { throwInstanceAlreadyDeleted(this); } if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) { throwBindingError("Object already scheduled for deletion"); } detachFinalizer(this); releaseClassHandle(this.$$); if (!this.$$.preservePointerOnDelete) { this.$$.smartPtr = undefined; this.$$.ptr = undefined; } } function ClassHandle_isDeleted() { return !this.$$.ptr } var delayFunction = undefined; var deletionQueue = []; function flushPendingDeletes() { while (deletionQueue.length) { var obj = deletionQueue.pop(); obj.$$.deleteScheduled = false; obj["delete"](); } } function ClassHandle_deleteLater() { if (!this.$$.ptr) { throwInstanceAlreadyDeleted(this); } if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) { throwBindingError("Object already scheduled for deletion"); } deletionQueue.push(this); if (deletionQueue.length === 1 && delayFunction) { delayFunction(flushPendingDeletes); } this.$$.deleteScheduled = true; return this } function init_ClassHandle() { ClassHandle.prototype["isAliasOf"] = ClassHandle_isAliasOf; ClassHandle.prototype["clone"] = ClassHandle_clone; ClassHandle.prototype["delete"] = ClassHandle_delete; ClassHandle.prototype["isDeleted"] = ClassHandle_isDeleted; ClassHandle.prototype["deleteLater"] = ClassHandle_deleteLater; } function ClassHandle() {} var registeredPointers = {}; function ensureOverloadTable(proto, methodName, humanName) { if (undefined === proto[methodName].overloadTable) { var prevFunc = proto[methodName]; proto[methodName] = function () { if (!proto[methodName].overloadTable.hasOwnProperty(arguments.length)) { throwBindingError("Function '" + humanName + "' called with an invalid number of arguments (" + arguments.length + ") - expects one of (" + proto[methodName].overloadTable + ")!"); } return proto[methodName].overloadTable[arguments.length].apply(this, arguments) }; proto[methodName].overloadTable = []; proto[methodName].overloadTable[prevFunc.argCount] = prevFunc; } } function exposePublicSymbol(name, value, numArguments) { if (Module.hasOwnProperty(name)) { if (undefined === numArguments || undefined !== Module[name].overloadTable && undefined !== Module[name].overloadTable[numArguments]) { throwBindingError("Cannot register public name '" + name + "' twice"); } ensureOverloadTable(Module, name, name); if (Module.hasOwnProperty(numArguments)) { throwBindingError("Cannot register multiple overloads of a function with the same number of arguments (" + numArguments + ")!"); } Module[name].overloadTable[numArguments] = value; } else { Module[name] = value; if (undefined !== numArguments) { Module[name].numArguments = numArguments; } } } function RegisteredClass(name, constructor, instancePrototype, rawDestructor, baseClass, getActualType, upcast, downcast) { this.name = name; this.constructor = constructor; this.instancePrototype = instancePrototype; this.rawDestructor = rawDestructor; this.baseClass = baseClass; this.getActualType = getActualType; this.upcast = upcast; this.downcast = downcast; this.pureVirtualFunctions = []; } function upcastPointer(ptr, ptrClass, desiredClass) { while (ptrClass !== desiredClass) { if (!ptrClass.upcast) { throwBindingError("Expected null or instance of " + desiredClass.name + ", got an instance of " + ptrClass.name); } ptr = ptrClass.upcast(ptr); ptrClass = ptrClass.baseClass; } return ptr } function constNoSmartPtrRawPointerToWireType(destructors, handle) { if (handle === null) { if (this.isReference) { throwBindingError("null is not a valid " + this.name); } return 0 } if (!handle.$$) { throwBindingError('Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name); } if (!handle.$$.ptr) { throwBindingError("Cannot pass deleted object as a pointer of type " + this.name); } var handleClass = handle.$$.ptrType.registeredClass; var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass); return ptr } function genericPointerToWireType(destructors, handle) { var ptr; if (handle === null) { if (this.isReference) { throwBindingError("null is not a valid " + this.name); } if (this.isSmartPointer) { ptr = this.rawConstructor(); if (destructors !== null) { destructors.push(this.rawDestructor, ptr); } return ptr } else { return 0 } } if (!handle.$$) { throwBindingError('Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name); } if (!handle.$$.ptr) { throwBindingError("Cannot pass deleted object as a pointer of type " + this.name); } if (!this.isConst && handle.$$.ptrType.isConst) { throwBindingError("Cannot convert argument of type " + (handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name) + " to parameter type " + this.name); } var handleClass = handle.$$.ptrType.registeredClass; ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass); if (this.isSmartPointer) { if (undefined === handle.$$.smartPtr) { throwBindingError("Passing raw pointer to smart pointer is illegal"); } switch (this.sharingPolicy) { case 0: if (handle.$$.smartPtrType === this) { ptr = handle.$$.smartPtr; } else { throwBindingError("Cannot convert argument of type " + (handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name) + " to parameter type " + this.name); } break; case 1: ptr = handle.$$.smartPtr; break; case 2: if (handle.$$.smartPtrType === this) { ptr = handle.$$.smartPtr; } else { var clonedHandle = handle["clone"](); ptr = this.rawShare(ptr, __emval_register(function () { clonedHandle["delete"](); })); if (destructors !== null) { destructors.push(this.rawDestructor, ptr); } } break; default: throwBindingError("Unsupporting sharing policy"); } } return ptr } function nonConstNoSmartPtrRawPointerToWireType(destructors, handle) { if (handle === null) { if (this.isReference) { throwBindingError("null is not a valid " + this.name); } return 0 } if (!handle.$$) { throwBindingError('Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name); } if (!handle.$$.ptr) { throwBindingError("Cannot pass deleted object as a pointer of type " + this.name); } if (handle.$$.ptrType.isConst) { throwBindingError("Cannot convert argument of type " + handle.$$.ptrType.name + " to parameter type " + this.name); } var handleClass = handle.$$.ptrType.registeredClass; var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass); return ptr } function simpleReadValueFromPointer(pointer) { return this["fromWireType"](HEAPU32[pointer >> 2]) } function RegisteredPointer_getPointee(ptr) { if (this.rawGetPointee) { ptr = this.rawGetPointee(ptr); } return ptr } function RegisteredPointer_destructor(ptr) { if (this.rawDestructor) { this.rawDestructor(ptr); } } function RegisteredPointer_deleteObject(handle) { if (handle !== null) { handle["delete"](); } } function downcastPointer(ptr, ptrClass, desiredClass) { if (ptrClass === desiredClass) { return ptr } if (undefined === desiredClass.baseClass) { return null } var rv = downcastPointer(ptr, ptrClass, desiredClass.baseClass); if (rv === null) { return null } return desiredClass.downcast(rv) } function getInheritedInstanceCount() { return Object.keys(registeredInstances).length } function getLiveInheritedInstances() { var rv = []; for (var k in registeredInstances) { if (registeredInstances.hasOwnProperty(k)) { rv.push(registeredInstances[k]); } } return rv } function setDelayFunction(fn) { delayFunction = fn; if (deletionQueue.length && delayFunction) { delayFunction(flushPendingDeletes); } } function init_embind() { Module["getInheritedInstanceCount"] = getInheritedInstanceCount; Module["getLiveInheritedInstances"] = getLiveInheritedInstances; Module["flushPendingDeletes"] = flushPendingDeletes; Module["setDelayFunction"] = setDelayFunction; } var registeredInstances = {}; function getBasestPointer(class_, ptr) { if (ptr === undefined) { throwBindingError("ptr should not be undefined"); } while (class_.baseClass) { ptr = class_.upcast(ptr); class_ = class_.baseClass; } return ptr } function getInheritedInstance(class_, ptr) { ptr = getBasestPointer(class_, ptr); return registeredInstances[ptr] } function makeClassHandle(prototype, record) { if (!record.ptrType || !record.ptr) { throwInternalError("makeClassHandle requires ptr and ptrType"); } var hasSmartPtrType = !!record.smartPtrType; var hasSmartPtr = !!record.smartPtr; if (hasSmartPtrType !== hasSmartPtr) { throwInternalError("Both smartPtrType and smartPtr must be specified"); } record.count = { value: 1 }; return attachFinalizer(Object.create(prototype, { $$: { value: record } })) } function RegisteredPointer_fromWireType(ptr) { var rawPointer = this.getPointee(ptr); if (!rawPointer) { this.destructor(ptr); return null } var registeredInstance = getInheritedInstance(this.registeredClass, rawPointer); if (undefined !== registeredInstance) { if (0 === registeredInstance.$$.count.value) { registeredInstance.$$.ptr = rawPointer; registeredInstance.$$.smartPtr = ptr; return registeredInstance["clone"]() } else { var rv = registeredInstance["clone"](); this.destructor(ptr); return rv } } function makeDefaultHandle() { if (this.isSmartPointer) { return makeClassHandle(this.registeredClass.instancePrototype, { ptrType: this.pointeeType, ptr: rawPointer, smartPtrType: this, smartPtr: ptr }) } else { return makeClassHandle(this.registeredClass.instancePrototype, { ptrType: this, ptr: ptr }) } } var actualType = this.registeredClass.getActualType(rawPointer); var registeredPointerRecord = registeredPointers[actualType]; if (!registeredPointerRecord) { return makeDefaultHandle.call(this) } var toType; if (this.isConst) { toType = registeredPointerRecord.constPointerType; } else { toType = registeredPointerRecord.pointerType; } var dp = downcastPointer(rawPointer, this.registeredClass, toType.registeredClass); if (dp === null) { return makeDefaultHandle.call(this) } if (this.isSmartPointer) { return makeClassHandle(toType.registeredClass.instancePrototype, { ptrType: toType, ptr: dp, smartPtrType: this, smartPtr: ptr }) } else { return makeClassHandle(toType.registeredClass.instancePrototype, { ptrType: toType, ptr: dp }) } } function init_RegisteredPointer() { RegisteredPointer.prototype.getPointee = RegisteredPointer_getPointee; RegisteredPointer.prototype.destructor = RegisteredPointer_destructor; RegisteredPointer.prototype["argPackAdvance"] = 8; RegisteredPointer.prototype["readValueFromPointer"] = simpleReadValueFromPointer; RegisteredPointer.prototype["deleteObject"] = RegisteredPointer_deleteObject; RegisteredPointer.prototype["fromWireType"] = RegisteredPointer_fromWireType; } function RegisteredPointer(name, registeredClass, isReference, isConst, isSmartPointer, pointeeType, sharingPolicy, rawGetPointee, rawConstructor, rawShare, rawDestructor) { this.name = name; this.registeredClass = registeredClass; this.isReference = isReference; this.isConst = isConst; this.isSmartPointer = isSmartPointer; this.pointeeType = pointeeType; this.sharingPolicy = sharingPolicy; this.rawGetPointee = rawGetPointee; this.rawConstructor = rawConstructor; this.rawShare = rawShare; this.rawDestructor = rawDestructor; if (!isSmartPointer && registeredClass.baseClass === undefined) { if (isConst) { this["toWireType"] = constNoSmartPtrRawPointerToWireType; this.destructorFunction = null; } else { this["toWireType"] = nonConstNoSmartPtrRawPointerToWireType; this.destructorFunction = null; } } else { this["toWireType"] = genericPointerToWireType; } } function replacePublicSymbol(name, value, numArguments) { if (!Module.hasOwnProperty(name)) { throwInternalError("Replacing nonexistant public symbol"); } if (undefined !== Module[name].overloadTable && undefined !== numArguments) { Module[name].overloadTable[numArguments] = value; } else { Module[name] = value; Module[name].argCount = numArguments; } } function embind__requireFunction(signature, rawFunction) { signature = readLatin1String(signature); function makeDynCaller(dynCall) { var args = []; for (var i = 1; i < signature.length; ++i) { args.push("a" + i); } var name = "dynCall_" + signature + "_" + rawFunction; var body = "return function " + name + "(" + args.join(", ") + ") {\n"; body += " return dynCall(rawFunction" + (args.length ? ", " : "") + args.join(", ") + ");\n"; body += "};\n"; return new Function("dynCall", "rawFunction", body)(dynCall, rawFunction) } var dc = Module["dynCall_" + signature]; var fp = makeDynCaller(dc); if (typeof fp !== "function") { throwBindingError("unknown function pointer with signature " + signature + ": " + rawFunction); } return fp } var UnboundTypeError = undefined; function getTypeName(type) { var ptr = ___getTypeName(type); var rv = readLatin1String(ptr); _free(ptr); return rv } function throwUnboundTypeError(message, types) { var unboundTypes = []; var seen = {}; function visit(type) { if (seen[type]) { return } if (registeredTypes[type]) { return } if (typeDependencies[type]) { typeDependencies[type].forEach(visit); return } unboundTypes.push(type); seen[type] = true; } types.forEach(visit); throw new UnboundTypeError(message + ": " + unboundTypes.map(getTypeName).join([", "])) } function __embind_register_class(rawType, rawPointerType, rawConstPointerType, baseClassRawType, getActualTypeSignature, getActualType, upcastSignature, upcast, downcastSignature, downcast, name, destructorSignature, rawDestructor) { name = readLatin1String(name); getActualType = embind__requireFunction(getActualTypeSignature, getActualType); if (upcast) { upcast = embind__requireFunction(upcastSignature, upcast); } if (downcast) { downcast = embind__requireFunction(downcastSignature, downcast); } rawDestructor = embind__requireFunction(destructorSignature, rawDestructor); var legalFunctionName = makeLegalFunctionName(name); exposePublicSymbol(legalFunctionName, function () { throwUnboundTypeError("Cannot construct " + name + " due to unbound types", [baseClassRawType]); }); whenDependentTypesAreResolved([rawType, rawPointerType, rawConstPointerType], baseClassRawType ? [baseClassRawType] : [], function (base) { base = base[0]; var baseClass; var basePrototype; if (baseClassRawType) { baseClass = base.registeredClass; basePrototype = baseClass.instancePrototype; } else { basePrototype = ClassHandle.prototype; } var constructor = createNamedFunction(legalFunctionName, function () { if (Object.getPrototypeOf(this) !== instancePrototype) { throw new BindingError("Use 'new' to construct " + name) } if (undefined === registeredClass.constructor_body) { throw new BindingError(name + " has no accessible constructor") } var body = registeredClass.constructor_body[arguments.length]; if (undefined === body) { throw new BindingError("Tried to invoke ctor of " + name + " with invalid number of parameters (" + arguments.length + ") - expected (" + Object.keys(registeredClass.constructor_body).toString() + ") parameters instead!") } return body.apply(this, arguments) }); var instancePrototype = Object.create(basePrototype, { constructor: { value: constructor } }); constructor.prototype = instancePrototype; var registeredClass = new RegisteredClass(name, constructor, instancePrototype, rawDestructor, baseClass, getActualType, upcast, downcast); var referenceConverter = new RegisteredPointer(name, registeredClass, true, false, false); var pointerConverter = new RegisteredPointer(name + "*", registeredClass, false, false, false); var constPointerConverter = new RegisteredPointer(name + " const*", registeredClass, false, true, false); registeredPointers[rawType] = { pointerType: pointerConverter, constPointerType: constPointerConverter }; replacePublicSymbol(legalFunctionName, constructor); return [referenceConverter, pointerConverter, constPointerConverter] }); } function heap32VectorToArray(count, firstElement) { var array = []; for (var i = 0; i < count; i++) { array.push(HEAP32[(firstElement >> 2) + i]); } return array } function runDestructors(destructors) { while (destructors.length) { var ptr = destructors.pop(); var del = destructors.pop(); del(ptr); } } function __embind_register_class_constructor(rawClassType, argCount, rawArgTypesAddr, invokerSignature, invoker, rawConstructor) { assert(argCount > 0); var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr); invoker = embind__requireFunction(invokerSignature, invoker); var args = [rawConstructor]; var destructors = []; whenDependentTypesAreResolved([], [rawClassType], function (classType) { classType = classType[0]; var humanName = "constructor " + classType.name; if (undefined === classType.registeredClass.constructor_body) { classType.registeredClass.constructor_body = []; } if (undefined !== classType.registeredClass.constructor_body[argCount - 1]) { throw new BindingError("Cannot register multiple constructors with identical number of parameters (" + (argCount - 1) + ") for class '" + classType.name + "'! Overload resolution is currently only performed using the parameter count, not actual type info!") } classType.registeredClass.constructor_body[argCount - 1] = function unboundTypeHandler() { throwUnboundTypeError("Cannot construct " + classType.name + " due to unbound types", rawArgTypes); }; whenDependentTypesAreResolved([], rawArgTypes, function (argTypes) { classType.registeredClass.constructor_body[argCount - 1] = function constructor_body() { if (arguments.length !== argCount - 1) { throwBindingError(humanName + " called with " + arguments.length + " arguments, expected " + (argCount - 1)); } destructors.length = 0; args.length = argCount; for (var i = 1; i < argCount; ++i) { args[i] = argTypes[i]["toWireType"](destructors, arguments[i - 1]); } var ptr = invoker.apply(null, args); runDestructors(destructors); return argTypes[0]["fromWireType"](ptr) }; return [] }); return [] }); } function new_(constructor, argumentList) { if (!(constructor instanceof Function)) { throw new TypeError("new_ called with constructor type " + typeof constructor + " which is not a function") } var dummy = createNamedFunction(constructor.name || "unknownFunctionName", function () {}); dummy.prototype = constructor.prototype; var obj = new dummy; var r = constructor.apply(obj, argumentList); return r instanceof Object ? r : obj } function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc) { var argCount = argTypes.length; if (argCount < 2) { throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!"); } var isClassMethodFunc = argTypes[1] !== null && classType !== null; var needsDestructorStack = false; for (var i = 1; i < argTypes.length; ++i) { if (argTypes[i] !== null && argTypes[i].destructorFunction === undefined) { needsDestructorStack = true; break } } var returns = argTypes[0].name !== "void"; var argsList = ""; var argsListWired = ""; for (var i = 0; i < argCount - 2; ++i) { argsList += (i !== 0 ? ", " : "") + "arg" + i; argsListWired += (i !== 0 ? ", " : "") + "arg" + i + "Wired"; } var invokerFnBody = "return function " + makeLegalFunctionName(humanName) + "(" + argsList + ") {\n" + "if (arguments.length !== " + (argCount - 2) + ") {\n" + "throwBindingError('function " + humanName + " called with ' + arguments.length + ' arguments, expected " + (argCount - 2) + " args!');\n" + "}\n"; if (needsDestructorStack) { invokerFnBody += "var destructors = [];\n"; } var dtorStack = needsDestructorStack ? "destructors" : "null"; var args1 = ["throwBindingError", "invoker", "fn", "runDestructors", "retType", "classParam"]; var args2 = [throwBindingError, cppInvokerFunc, cppTargetFunc, runDestructors, argTypes[0], argTypes[1]]; if (isClassMethodFunc) { invokerFnBody += "var thisWired = classParam.toWireType(" + dtorStack + ", this);\n"; } for (var i = 0; i < argCount - 2; ++i) { invokerFnBody += "var arg" + i + "Wired = argType" + i + ".toWireType(" + dtorStack + ", arg" + i + "); // " + argTypes[i + 2].name + "\n"; args1.push("argType" + i); args2.push(argTypes[i + 2]); } if (isClassMethodFunc) { argsListWired = "thisWired" + (argsListWired.length > 0 ? ", " : "") + argsListWired; } invokerFnBody += (returns ? "var rv = " : "") + "invoker(fn" + (argsListWired.length > 0 ? ", " : "") + argsListWired + ");\n"; if (needsDestructorStack) { invokerFnBody += "runDestructors(destructors);\n"; } else { for (var i = isClassMethodFunc ? 1 : 2; i < argTypes.length; ++i) { var paramName = i === 1 ? "thisWired" : "arg" + (i - 2) + "Wired"; if (argTypes[i].destructorFunction !== null) { invokerFnBody += paramName + "_dtor(" + paramName + "); // " + argTypes[i].name + "\n"; args1.push(paramName + "_dtor"); args2.push(argTypes[i].destructorFunction); } } } if (returns) { invokerFnBody += "var ret = retType.fromWireType(rv);\n" + "return ret;\n"; } invokerFnBody += "}\n"; args1.push(invokerFnBody); var invokerFunction = new_(Function, args1).apply(null, args2); return invokerFunction } function __embind_register_class_function(rawClassType, methodName, argCount, rawArgTypesAddr, invokerSignature, rawInvoker, context, isPureVirtual) { var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr); methodName = readLatin1String(methodName); rawInvoker = embind__requireFunction(invokerSignature, rawInvoker); whenDependentTypesAreResolved([], [rawClassType], function (classType) { classType = classType[0]; var humanName = classType.name + "." + methodName; if (isPureVirtual) { classType.registeredClass.pureVirtualFunctions.push(methodName); } function unboundTypesHandler() { throwUnboundTypeError("Cannot call " + humanName + " due to unbound types", rawArgTypes); } var proto = classType.registeredClass.instancePrototype; var method = proto[methodName]; if (undefined === method || undefined === method.overloadTable && method.className !== classType.name && method.argCount === argCount - 2) { unboundTypesHandler.argCount = argCount - 2; unboundTypesHandler.className = classType.name; proto[methodName] = unboundTypesHandler; } else { ensureOverloadTable(proto, methodName, humanName); proto[methodName].overloadTable[argCount - 2] = unboundTypesHandler; } whenDependentTypesAreResolved([], rawArgTypes, function (argTypes) { var memberFunction = craftInvokerFunction(humanName, argTypes, classType, rawInvoker, context); if (undefined === proto[methodName].overloadTable) { memberFunction.argCount = argCount - 2; proto[methodName] = memberFunction; } else { proto[methodName].overloadTable[argCount - 2] = memberFunction; } return [] }); return [] }); } var emval_free_list = []; var emval_handle_array = [{}, { value: undefined }, { value: null }, { value: true }, { value: false }]; function __emval_decref(handle) { if (handle > 4 && 0 === --emval_handle_array[handle].refcount) { emval_handle_array[handle] = undefined; emval_free_list.push(handle); } } function count_emval_handles() { var count = 0; for (var i = 5; i < emval_handle_array.length; ++i) { if (emval_handle_array[i] !== undefined) { ++count; } } return count } function get_first_emval() { for (var i = 5; i < emval_handle_array.length; ++i) { if (emval_handle_array[i] !== undefined) { return emval_handle_array[i] } } return null } function init_emval() { Module["count_emval_handles"] = count_emval_handles; Module["get_first_emval"] = get_first_emval; } function __emval_register(value) { switch (value) { case undefined: { return 1 } case null: { return 2 } case true: { return 3 } case false: { return 4 } default: { var handle = emval_free_list.length ? emval_free_list.pop() : emval_handle_array.length; emval_handle_array[handle] = { refcount: 1, value: value }; return handle } } } function __embind_register_emval(rawType, name) { name = readLatin1String(name); registerType(rawType, { name: name, "fromWireType": function (handle) { var rv = emval_handle_array[handle].value; __emval_decref(handle); return rv }, "toWireType": function (destructors, value) { return __emval_register(value) }, "argPackAdvance": 8, "readValueFromPointer": simpleReadValueFromPointer, destructorFunction: null }); } function _embind_repr(v) { if (v === null) { return "null" } var t = typeof v; if (t === "object" || t === "array" || t === "function") { return v.toString() } else { return "" + v } } function floatReadValueFromPointer(name, shift) { switch (shift) { case 2: return function (pointer) { return this["fromWireType"](HEAPF32[pointer >> 2]) }; case 3: return function (pointer) { return this["fromWireType"](HEAPF64[pointer >> 3]) }; default: throw new TypeError("Unknown float type: " + name) } } function __embind_register_float(rawType, name, size) { var shift = getShiftFromSize(size); name = readLatin1String(name); registerType(rawType, { name: name, "fromWireType": function (value) { return value }, "toWireType": function (destructors, value) { if (typeof value !== "number" && typeof value !== "boolean") { throw new TypeError('Cannot convert "' + _embind_repr(value) + '" to ' + this.name) } return value }, "argPackAdvance": 8, "readValueFromPointer": floatReadValueFromPointer(name, shift), destructorFunction: null }); } function integerReadValueFromPointer(name, shift, signed) { switch (shift) { case 0: return signed ? function readS8FromPointer(pointer) { return HEAP8[pointer] } : function readU8FromPointer(pointer) { return HEAPU8[pointer] }; case 1: return signed ? function readS16FromPointer(pointer) { return HEAP16[pointer >> 1] } : function readU16FromPointer(pointer) { return HEAPU16[pointer >> 1] }; case 2: return signed ? function readS32FromPointer(pointer) { return HEAP32[pointer >> 2] } : function readU32FromPointer(pointer) { return HEAPU32[pointer >> 2] }; default: throw new TypeError("Unknown integer type: " + name) } } function __embind_register_integer(primitiveType, name, size, minRange, maxRange) { name = readLatin1String(name); if (maxRange === -1) { maxRange = 4294967295; } var shift = getShiftFromSize(size); var fromWireType = function (value) { return value }; if (minRange === 0) { var bitshift = 32 - 8 * size; fromWireType = function (value) { return value << bitshift >>> bitshift }; } var isUnsignedType = name.indexOf("unsigned") != -1; registerType(primitiveType, { name: name, "fromWireType": fromWireType, "toWireType": function (destructors, value) { if (typeof value !== "number" && typeof value !== "boolean") { throw new TypeError('Cannot convert "' + _embind_repr(value) + '" to ' + this.name) } if (value < minRange || value > maxRange) { throw new TypeError('Passing a number "' + _embind_repr(value) + '" from JS side to C/C++ side to an argument of type "' + name + '", which is outside the valid range [' + minRange + ", " + maxRange + "]!") } return isUnsignedType ? value >>> 0 : value | 0 }, "argPackAdvance": 8, "readValueFromPointer": integerReadValueFromPointer(name, shift, minRange !== 0), destructorFunction: null }); } function __embind_register_memory_view(rawType, dataTypeIndex, name) { var typeMapping = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array]; var TA = typeMapping[dataTypeIndex]; function decodeMemoryView(handle) { handle = handle >> 2; var heap = HEAPU32; var size = heap[handle]; var data = heap[handle + 1]; return new TA(buffer, data, size) } name = readLatin1String(name); registerType(rawType, { name: name, "fromWireType": decodeMemoryView, "argPackAdvance": 8, "readValueFromPointer": decodeMemoryView }, { ignoreDuplicateRegistrations: true }); } function __embind_register_std_string(rawType, name) { name = readLatin1String(name); var stdStringIsUTF8 = name === "std::string"; registerType(rawType, { name: name, "fromWireType": function (value) { var length = HEAPU32[value >> 2]; var str; if (stdStringIsUTF8) { var decodeStartPtr = value + 4; for (var i = 0; i <= length; ++i) { var currentBytePtr = value + 4 + i; if (HEAPU8[currentBytePtr] == 0 || i == length) { var maxRead = currentBytePtr - decodeStartPtr; var stringSegment = UTF8ToString(decodeStartPtr, maxRead); if (str === undefined) { str = stringSegment; } else { str += String.fromCharCode(0); str += stringSegment; } decodeStartPtr = currentBytePtr + 1; } } } else { var a = new Array(length); for (var i = 0; i < length; ++i) { a[i] = String.fromCharCode(HEAPU8[value + 4 + i]); } str = a.join(""); } _free(value); return str }, "toWireType": function (destructors, value) { if (value instanceof ArrayBuffer) { value = new Uint8Array(value); } var getLength; var valueIsOfTypeString = typeof value === "string"; if (!(valueIsOfTypeString || value instanceof Uint8Array || value instanceof Uint8ClampedArray || value instanceof Int8Array)) { throwBindingError("Cannot pass non-string to std::string"); } if (stdStringIsUTF8 && valueIsOfTypeString) { getLength = function () { return lengthBytesUTF8(value) }; } else { getLength = function () { return value.length }; } var length = getLength(); var ptr = _malloc(4 + length + 1); HEAPU32[ptr >> 2] = length; if (stdStringIsUTF8 && valueIsOfTypeString) { stringToUTF8(value, ptr + 4, length + 1); } else { if (valueIsOfTypeString) { for (var i = 0; i < length; ++i) { var charCode = value.charCodeAt(i); if (charCode > 255) { _free(ptr); throwBindingError("String has UTF-16 code units that do not fit in 8 bits"); } HEAPU8[ptr + 4 + i] = charCode; } } else { for (var i = 0; i < length; ++i) { HEAPU8[ptr + 4 + i] = value[i]; } } } if (destructors !== null) { destructors.push(_free, ptr); } return ptr }, "argPackAdvance": 8, "readValueFromPointer": simpleReadValueFromPointer, destructorFunction: function (ptr) { _free(ptr); } }); } function __embind_register_std_wstring(rawType, charSize, name) { name = readLatin1String(name); var decodeString, encodeString, getHeap, lengthBytesUTF, shift; if (charSize === 2) { decodeString = UTF16ToString; encodeString = stringToUTF16; lengthBytesUTF = lengthBytesUTF16; getHeap = function () { return HEAPU16 }; shift = 1; } else if (charSize === 4) { decodeString = UTF32ToString; encodeString = stringToUTF32; lengthBytesUTF = lengthBytesUTF32; getHeap = function () { return HEAPU32 }; shift = 2; } registerType(rawType, { name: name, "fromWireType": function (value) { var length = HEAPU32[value >> 2]; var HEAP = getHeap(); var str; var decodeStartPtr = value + 4; for (var i = 0; i <= length; ++i) { var currentBytePtr = value + 4 + i * charSize; if (HEAP[currentBytePtr >> shift] == 0 || i == length) { var maxReadBytes = currentBytePtr - decodeStartPtr; var stringSegment = decodeString(decodeStartPtr, maxReadBytes); if (str === undefined) { str = stringSegment; } else { str += String.fromCharCode(0); str += stringSegment; } decodeStartPtr = currentBytePtr + charSize; } } _free(value); return str }, "toWireType": function (destructors, value) { if (!(typeof value === "string")) { throwBindingError("Cannot pass non-string to C++ string type " + name); } var length = lengthBytesUTF(value); var ptr = _malloc(4 + length + charSize); HEAPU32[ptr >> 2] = length >> shift; encodeString(value, ptr + 4, length + charSize); if (destructors !== null) { destructors.push(_free, ptr); } return ptr }, "argPackAdvance": 8, "readValueFromPointer": simpleReadValueFromPointer, destructorFunction: function (ptr) { _free(ptr); } }); } function __embind_register_void(rawType, name) { name = readLatin1String(name); registerType(rawType, { isVoid: true, name: name, "argPackAdvance": 0, "fromWireType": function () { return undefined }, "toWireType": function (destructors, o) { return undefined } }); } function _abort() { abort(); } function _emscripten_get_heap_size() { return HEAPU8.length } function abortOnCannotGrowMemory(requestedSize) { abort("OOM"); } function _emscripten_resize_heap(requestedSize) { abortOnCannotGrowMemory(); } function _llvm_trap() { abort("trap!"); } function _emscripten_memcpy_big(dest, src, num) { HEAPU8.copyWithin(dest, src, src + num); } embind_init_charCodes(); BindingError = Module["BindingError"] = extendError(Error, "BindingError"); InternalError = Module["InternalError"] = extendError(Error, "InternalError"); init_ClassHandle(); init_RegisteredPointer(); init_embind(); UnboundTypeError = Module["UnboundTypeError"] = extendError(Error, "UnboundTypeError"); init_emval(); function intArrayToString(array) { var ret = []; for (var i = 0; i < array.length; i++) { var chr = array[i]; if (chr > 255) { chr &= 255; } ret.push(String.fromCharCode(chr)); } return ret.join("") } var decodeBase64 = typeof atob === "function" ? atob : function (input) { var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); do { enc1 = keyStr.indexOf(input.charAt(i++)); enc2 = keyStr.indexOf(input.charAt(i++)); enc3 = keyStr.indexOf(input.charAt(i++)); enc4 = keyStr.indexOf(input.charAt(i++)); chr1 = enc1 << 2 | enc2 >> 4; chr2 = (enc2 & 15) << 4 | enc3 >> 2; chr3 = (enc3 & 3) << 6 | enc4; output = output + String.fromCharCode(chr1); if (enc3 !== 64) { output = output + String.fromCharCode(chr2); } if (enc4 !== 64) { output = output + String.fromCharCode(chr3); } } while (i < input.length); return output }; function intArrayFromBase64(s) { if (typeof ENVIRONMENT_IS_NODE === "boolean" && ENVIRONMENT_IS_NODE) { var buf; try { buf = Buffer.from(s, "base64"); } catch (_) { buf = new Buffer(s, "base64"); } return new Uint8Array(buf["buffer"], buf["byteOffset"], buf["byteLength"]) } try { var decoded = decodeBase64(s); var bytes = new Uint8Array(decoded.length); for (var i = 0; i < decoded.length; ++i) { bytes[i] = decoded.charCodeAt(i); } return bytes } catch (_) { throw new Error("Converting base64 string to bytes failed.") } } function tryParseAsDataURI(filename) { if (!isDataURI(filename)) { return } return intArrayFromBase64(filename.slice(dataURIPrefix.length)) } var asmGlobalArg = { "Math": Math, "Int8Array": Int8Array, "Int16Array": Int16Array, "Int32Array": Int32Array, "Uint8Array": Uint8Array, "Uint16Array": Uint16Array, "Float32Array": Float32Array, "Float64Array": Float64Array }; var asmLibraryArg = { "A": _emscripten_memcpy_big, "B": _emscripten_resize_heap, "C": _llvm_trap, "D": tempDoublePtr, "a": abort, "b": setTempRet0, "c": getTempRet0, "d": ___cxa_allocate_exception, "e": ___cxa_begin_catch, "f": ___cxa_throw, "g": ___cxa_uncaught_exceptions, "h": ___exception_addRef, "i": ___exception_deAdjust, "j": ___gxx_personality_v0, "k": __embind_register_bool, "l": __embind_register_class, "m": __embind_register_class_constructor, "n": __embind_register_class_function, "o": __embind_register_emval, "p": __embind_register_float, "q": __embind_register_integer, "r": __embind_register_memory_view, "s": __embind_register_std_string, "t": __embind_register_std_wstring, "u": __embind_register_void, "v": __emval_decref, "w": __emval_register, "x": _abort, "y": _embind_repr, "z": _emscripten_get_heap_size }; // EMSCRIPTEN_START_ASM var asm = ( /** @suppress {uselessCode} */ function (global, env, buffer) { "use asm"; var a = new global.Int8Array(buffer), b = new global.Int16Array(buffer), c = new global.Int32Array(buffer), d = new global.Uint8Array(buffer), e = new global.Uint16Array(buffer), f = new global.Float32Array(buffer), g = new global.Float64Array(buffer), h = env.D | 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0.0, q = global.Math.imul, r = global.Math.clz32, s = env.a, t = env.b, u = env.c, v = env.d, w = env.e, x = env.f, y = env.g, z = env.h, A = env.i, B = env.j, C = env.k, D = env.l, E = env.m, F = env.n, G = env.o, H = env.p, I = env.q, J = env.r, K = env.s, L = env.t, M = env.u, N = env.v, O = env.w, P = env.x, Q = env.y, R = env.z, S = env.A, T = env.B, U = env.C, V = 22384, W = 5265264, X = 0.0; // EMSCRIPTEN_START_FUNCS function ia() { em(); fm(); } function ja() { ka(0); return } function ka(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0; a = V; V = V + 16 | 0; b = a + 8 | 0; d = a; vk(); m = xk() | 0; g = yk() | 0; f = Ak() | 0; h = Bk() | 0; i = Ck() | 0; j = Dk() | 0; k = Jk() | 0; l = Kk() | 0; e = Kk() | 0; D(f | 0, h | 0, i | 0, j | 0, k | 0, 9, l | 0, m | 0, e | 0, g | 0, 6204, Lk() | 0, 138); Nk(1); c[d >> 2] = 5; c[d + 4 >> 2] = 0; c[b >> 2] = c[d >> 2]; c[b + 4 >> 2] = c[d + 4 >> 2]; Uk(6211, b); c[d >> 2] = 3; c[d + 4 >> 2] = 0; c[b >> 2] = c[d >> 2]; c[b + 4 >> 2] = c[d + 4 >> 2]; cl(6216, b); c[d >> 2] = 10; c[d + 4 >> 2] = 0; c[b >> 2] = c[d >> 2]; c[b + 4 >> 2] = c[d + 4 >> 2]; kl(6225, b); sl(); g = ul() | 0; e = vl() | 0; m = xl() | 0; l = yl() | 0; k = zl() | 0; j = Dk() | 0; i = Jk() | 0; h = Kk() | 0; f = Kk() | 0; D(m | 0, l | 0, k | 0, j | 0, i | 0, 11, h | 0, g | 0, f | 0, e | 0, 6234, Lk() | 0, 139); Gl(2); c[d >> 2] = 6; c[d + 4 >> 2] = 0; c[b >> 2] = c[d >> 2]; c[b + 4 >> 2] = c[d + 4 >> 2]; Nl(6211, b); c[d >> 2] = 4; c[d + 4 >> 2] = 0; c[b >> 2] = c[d >> 2]; c[b + 4 >> 2] = c[d + 4 >> 2]; Ul(6248, b); c[d >> 2] = 5; c[d + 4 >> 2] = 0; c[b >> 2] = c[d >> 2]; c[b + 4 >> 2] = c[d + 4 >> 2]; Ul(6265, b); c[d >> 2] = 6; c[d + 4 >> 2] = 0; c[b >> 2] = c[d >> 2]; c[b + 4 >> 2] = c[d + 4 >> 2]; Ul(6280, b); c[d >> 2] = 7; c[d + 4 >> 2] = 0; c[b >> 2] = c[d >> 2]; c[b + 4 >> 2] = c[d + 4 >> 2]; _l(6216, b); V = a; return } function la(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0, g = 0, h = 0, i = 0; e = V; V = V + 32 | 0; h = e + 16 | 0; f = e + 8 | 0; i = e; g = eq(20) | 0; ta(g, b, d); c[i >> 2] = 0; c[h >> 2] = c[i >> 2]; va(f, g, h); b = c[f >> 2] | 0; c[f >> 2] = c[a >> 2]; c[a >> 2] = b; b = f + 4 | 0; d = a + 4 | 0; g = c[b >> 2] | 0; c[b >> 2] = c[d >> 2]; c[d >> 2] = g; wa(f); d = eq(352) | 0; ua(d, c[a >> 2] | 0); g = a + 8 | 0; c[i >> 2] = 0; c[h >> 2] = c[i >> 2]; Fa(f, d, h); d = c[f >> 2] | 0; c[f >> 2] = c[g >> 2]; c[g >> 2] = d; g = f + 4 | 0; d = a + 12 | 0; b = c[g >> 2] | 0; c[g >> 2] = c[d >> 2]; c[d >> 2] = b; Ga(f); V = e; return } function ma(a, b) { a = a | 0; b = b | 0; dd(c[a + 8 >> 2] | 0, b); return } function na(a) { a = a | 0; a = (Qh(c[a + 8 >> 2] | 0) | 0) + 107 | 0; return d[a >> 0] | d[a + 1 >> 0] << 8 | d[a + 2 >> 0] << 16 | d[a + 3 >> 0] << 24 | 0 } function oa(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0, g = 0, h = 0, i = 0; e = V; V = V + 32 | 0; g = e + 16 | 0; f = e + 8 | 0; h = e; i = eq(12) | 0; Rh(i, b, d); c[h >> 2] = 0; c[g >> 2] = c[h >> 2]; Vh(f, i, g); i = c[f >> 2] | 0; c[f >> 2] = c[a >> 2]; c[a >> 2] = i; i = f + 4 | 0; d = a + 4 | 0; b = c[i >> 2] | 0; c[i >> 2] = c[d >> 2]; c[d >> 2] = b; Wh(f); d = a + 8 | 0; b = eq(12) | 0; Sh(b, c[a >> 2] | 0); c[h >> 2] = 0; c[g >> 2] = c[h >> 2]; ai(f, b, g); b = c[f >> 2] | 0; c[f >> 2] = c[d >> 2]; c[d >> 2] = b; b = f + 4 | 0; h = a + 12 | 0; i = c[b >> 2] | 0; c[b >> 2] = c[h >> 2]; c[h >> 2] = i; bi(f); Th(f, c[d >> 2] | 0); d = a + 16 | 0; h = c[f >> 2] | 0; i = f + 4 | 0; b = c[i >> 2] | 0; c[f >> 2] = 0; c[i >> 2] = 0; c[g >> 2] = c[d >> 2]; c[d >> 2] = h; d = a + 20 | 0; c[g + 4 >> 2] = c[d >> 2]; c[d >> 2] = b; Uh(g); Uh(f); V = e; return } function pa(a, b) { a = a | 0; b = b | 0; var d = 0; a = a + 16 | 0; d = c[a >> 2] | 0; a: do if (d | 0) switch (b | 0) { case 4: { ui(d); break a } case 8: { vi(d); vi(c[a >> 2] | 0); break a } default: break a } while (0); return } function qa(a, b) { a = a | 0; b = b | 0; var d = 0; d = a + 16 | 0; a = c[d >> 2] | 0; a: do if (a | 0) { switch (b | 0) { case 1: { hj(a); break a } case 2: { ij(a); break a } case 8: { ui(a); a = c[d >> 2] | 0; break } case 4: break; default: break a } ui(a); } while (0); return } function ra(a, b) { a = a | 0; b = b | 0; var d = 0; d = a + 16 | 0; a = c[d >> 2] | 0; a: do if (a | 0) { switch (b | 0) { case 1: { Rj(a); break a } case 2: { Sj(a); break a } case 8: { vi(a); a = c[d >> 2] | 0; break } case 4: break; default: break a } vi(a); } while (0); return } function sa(a, b) { a = a | 0; b = b | 0; a = c[a + 16 >> 2] | 0; if (a | 0) $[c[c[a >> 2] >> 2] & 63](a, b) | 0; return } function ta(b, d, e) { b = b | 0; d = d | 0; e = e | 0; c[b >> 2] = d; c[b + 4 >> 2] = e; c[b + 8 >> 2] = 0; a[b + 12 >> 0] = 0; a[b + 13 >> 0] = 0; c[b + 16 >> 2] = 0; return } function ua(a, b) { a = a | 0; b = b | 0; c[a >> 2] = b; Va(a + 4 | 0, b); Wa(a + 247 | 0); c[a + 288 >> 2] = 0; c[a + 292 >> 2] = 0; c[a + 296 >> 2] = 0; Xa(a + 300 | 0); b = a + 312 | 0; c[b >> 2] = 0; c[b + 4 >> 2] = 0; c[b + 8 >> 2] = 0; c[b + 12 >> 2] = 0; Ya(a + 328 | 0); Za(a); return } function va(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 4296; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; xa(a, e); V = d; return } function wa(a) { a = a | 0; var b = 0, d = 0; a = c[a + 4 >> 2] | 0; if (a | 0 ? (d = a + 4 | 0, b = c[d >> 2] | 0, c[d >> 2] = b + -1, (b | 0) == 0) : 0) { ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); qq(a); } return } function xa(a, b) { a = a | 0; b = b | 0; return } function ya(a) { a = a | 0; w(a | 0) | 0; lp(); } function za(a) { a = a | 0; pq(a); jp(a); return } function Aa(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) jp(a); return } function Ba(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 6407 ? a + 12 | 0 : 0) | 0 } function Ca(a) { a = a | 0; Da(a, 16); return } function Da(a, b) { a = a | 0; b = b | 0; Ea(a); return } function Ea(a) { a = a | 0; jp(a); return } function Fa(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 4324; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Ha(a, e); V = d; return } function Ga(a) { a = a | 0; var b = 0, d = 0; a = c[a + 4 >> 2] | 0; if (a | 0 ? (d = a + 4 | 0, b = c[d >> 2] | 0, c[d >> 2] = b + -1, (b | 0) == 0) : 0) { ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); qq(a); } return } function Ha(a, b) { a = a | 0; b = b | 0; return } function Ia(a) { a = a | 0; pq(a); jp(a); return } function Ja(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) { Ma(a); jp(a); } return } function Ka(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 6605 ? a + 12 | 0 : 0) | 0 } function La(a) { a = a | 0; Da(a, 16); return } function Ma(a) { a = a | 0; Na(a + 320 | 0); Oa(a + 312 | 0); Pa(a + 300 | 0); Ta(a + 288 | 0); Qa(a + 247 | 0); Ra(a + 4 | 0); return } function Na(a) { a = a | 0; var b = 0, d = 0; a = c[a + 4 >> 2] | 0; if (a | 0 ? (d = a + 4 | 0, b = c[d >> 2] | 0, c[d >> 2] = b + -1, (b | 0) == 0) : 0) { ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); qq(a); } return } function Oa(a) { a = a | 0; var b = 0, d = 0; a = c[a + 4 >> 2] | 0; if (a | 0 ? (d = a + 4 | 0, b = c[d >> 2] | 0, c[d >> 2] = b + -1, (b | 0) == 0) : 0) { ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); qq(a); } return } function Pa(a) { a = a | 0; Sa(a); return } function Qa(a) { a = a | 0; a = a + 34 | 0; a = d[a >> 0] | d[a + 1 >> 0] << 8 | d[a + 2 >> 0] << 16 | d[a + 3 >> 0] << 24; if (a | 0) gq(a); return } function Ra(a) { a = a | 0; Ua(c[a + 12 >> 2] | 0); return } function Sa(a) { a = a | 0; var b = 0, d = 0; b = c[a >> 2] | 0; d = b; if (b | 0) { c[a + 4 >> 2] = d; Da(b, (c[a + 8 >> 2] | 0) - d | 0); } return } function Ta(a) { a = a | 0; var b = 0, d = 0; b = c[a >> 2] | 0; d = b; if (b | 0) { c[a + 4 >> 2] = d; Da(b, (c[a + 8 >> 2] | 0) - d | 0); } return } function Ua(a) { a = a | 0; er(c[a + -4 >> 2] | 0); return } function Va(a, b) { a = a | 0; b = b | 0; c[a >> 2] = b; c[a + 4 >> 2] = 0; c[a + 8 >> 2] = 0; c[a + 12 >> 2] = _a(1048576) | 0; return } function Wa(b) { b = b | 0; var c = 0; c = b + 32 | 0; a[c >> 0] = 0; a[c + 1 >> 0] = 0; b = b + 34 | 0; a[b >> 0] = 0; a[b + 1 >> 0] = 0; a[b + 2 >> 0] = 0; a[b + 3 >> 0] = 0; return } function Xa(a) { a = a | 0; c[a >> 2] = 0; c[a + 4 >> 2] = 0; c[a + 8 >> 2] = 0; return } function Ya(a) { a = a | 0; c[a >> 2] = 0; c[a + 4 >> 2] = 0; c[a + 8 >> 2] = 0; c[a + 12 >> 2] = 0; a = a + 16 | 0; c[a >> 2] = -1; c[a + 4 >> 2] = -1; return } function Za(b) { b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0; i = V; V = V + 64 | 0; g = i + 32 | 0; e = i + 56 | 0; d = i + 16 | 0; h = i; $a(c[b >> 2] | 0, e, 4); mb(g, e, e + 4 | 0); e = lb(6693) | 0; f = a[g + 11 >> 0] | 0; if ((e | 0) == ((f << 24 >> 24 < 0 ? c[g + 4 >> 2] | 0 : f & 255) | 0)) { f = (Hq(g, 0, -1, 6693, e) | 0) == 0; Cq(g); if (f) { e = c[b >> 2] | 0; c[d >> 2] = 0; c[d + 4 >> 2] = 0; c[d + 8 >> 2] = 0; c[d + 12 >> 2] = 0; c[g >> 2] = c[d >> 2]; c[g + 4 >> 2] = c[d + 4 >> 2]; c[g + 8 >> 2] = c[d + 8 >> 2]; c[g + 12 >> 2] = c[d + 12 >> 2]; bb(e, g); e = b + 20 | 0; $a(c[b >> 2] | 0, e, 227); cb(b, e); f = db() | 0; d = c[f >> 2] | 0; f = c[f + 4 >> 2] | 0; if ((d | 0) != (f | 0)) do { eb(g, d); fb(g, e); gb(g); d = d + 24 | 0; } while ((d | 0) != (f | 0)); hb(b); ib(b); jb(c[b >> 2] | 0); f = c[b >> 2] | 0; d = (c[b + 116 >> 2] | 0) + 8 | 0; e = h; c[e >> 2] = 0; c[e + 4 >> 2] = 0; e = h + 8 | 0; c[e >> 2] = d; c[e + 4 >> 2] = 0; c[g >> 2] = c[h >> 2]; c[g + 4 >> 2] = c[h + 4 >> 2]; c[g + 8 >> 2] = c[h + 8 >> 2]; c[g + 12 >> 2] = c[h + 12 >> 2]; bb(f, g); kb(b + 4 | 0); V = i; return } } else Cq(g); i = v(8) | 0; ab(i); x(i | 0, 2592, 8); } function _a(a) { a = a | 0; var b = 0; b = dr(a + 68 | 0) | 0; a = b + 68 & -64; c[a + -4 >> 2] = b; return a | 0 } function $a(b, d, e) { b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0, i = 0, j = 0, k = 0; i = b + 13 | 0; if (!(a[i >> 0] | 0)) { h = b + 4 | 0; f = c[h >> 2] | 0; j = b + 8 | 0; g = c[j >> 2] | 0; k = f - g | 0; e = (k | 0) < (e | 0) ? k : e; if (e) { vr(d | 0, (c[b >> 2] | 0) + g | 0, e | 0) | 0; g = c[j >> 2] | 0; f = c[h >> 2] | 0; } k = g + e | 0; c[j >> 2] = k; c[b + 16 >> 2] = e; if ((k | 0) >= (f | 0)) a[i >> 0] = 1; } else a[b + 12 >> 0] = 1; return } function ab(a) { a = a | 0; xq(a, 6791); c[a >> 2] = 4352; return } function bb(b, d) { b = b | 0; d = d | 0; var e = 0, f = 0, g = 0; g = d + 8 | 0; d = c[g >> 2] | 0; g = c[g + 4 >> 2] | 0; e = c[b + 4 >> 2] | 0; f = ((e | 0) < 0) << 31 >> 31; if ((g | 0) < (f | 0) | (g | 0) == (f | 0) & d >>> 0 < e >>> 0) c[b + 8 >> 2] = d; else a[b + 12 >> 0] = 1; return } function cb(b, c) { b = b | 0; c = c | 0; var d = 0.0, e = 0.0, f = 0, i = 0.0, j = 0, k = 0.0, l = 0, m = 0.0, n = 0, o = 0.0; n = c + 179 | 0; a[h >> 0] = a[n >> 0]; a[h + 1 >> 0] = a[n + 1 >> 0]; a[h + 2 >> 0] = a[n + 2 >> 0]; a[h + 3 >> 0] = a[n + 3 >> 0]; a[h + 4 >> 0] = a[n + 4 >> 0]; a[h + 5 >> 0] = a[n + 5 >> 0]; a[h + 6 >> 0] = a[n + 6 >> 0]; a[h + 7 >> 0] = a[n + 7 >> 0]; m = +g[h >> 3]; j = c + 187 | 0; a[h >> 0] = a[j >> 0]; a[h + 1 >> 0] = a[j + 1 >> 0]; a[h + 2 >> 0] = a[j + 2 >> 0]; a[h + 3 >> 0] = a[j + 3 >> 0]; a[h + 4 >> 0] = a[j + 4 >> 0]; a[h + 5 >> 0] = a[j + 5 >> 0]; a[h + 6 >> 0] = a[j + 6 >> 0]; a[h + 7 >> 0] = a[j + 7 >> 0]; o = +g[h >> 3]; b = c + 195 | 0; a[h >> 0] = a[b >> 0]; a[h + 1 >> 0] = a[b + 1 >> 0]; a[h + 2 >> 0] = a[b + 2 >> 0]; a[h + 3 >> 0] = a[b + 3 >> 0]; a[h + 4 >> 0] = a[b + 4 >> 0]; a[h + 5 >> 0] = a[b + 5 >> 0]; a[h + 6 >> 0] = a[b + 6 >> 0]; a[h + 7 >> 0] = a[b + 7 >> 0]; i = +g[h >> 3]; l = c + 203 | 0; a[h >> 0] = a[l >> 0]; a[h + 1 >> 0] = a[l + 1 >> 0]; a[h + 2 >> 0] = a[l + 2 >> 0]; a[h + 3 >> 0] = a[l + 3 >> 0]; a[h + 4 >> 0] = a[l + 4 >> 0]; a[h + 5 >> 0] = a[l + 5 >> 0]; a[h + 6 >> 0] = a[l + 6 >> 0]; a[h + 7 >> 0] = a[l + 7 >> 0]; k = +g[h >> 3]; f = c + 211 | 0; a[h >> 0] = a[f >> 0]; a[h + 1 >> 0] = a[f + 1 >> 0]; a[h + 2 >> 0] = a[f + 2 >> 0]; a[h + 3 >> 0] = a[f + 3 >> 0]; a[h + 4 >> 0] = a[f + 4 >> 0]; a[h + 5 >> 0] = a[f + 5 >> 0]; a[h + 6 >> 0] = a[f + 6 >> 0]; a[h + 7 >> 0] = a[f + 7 >> 0]; d = +g[h >> 3]; c = c + 219 | 0; a[h >> 0] = a[c >> 0]; a[h + 1 >> 0] = a[c + 1 >> 0]; a[h + 2 >> 0] = a[c + 2 >> 0]; a[h + 3 >> 0] = a[c + 3 >> 0]; a[h + 4 >> 0] = a[c + 4 >> 0]; a[h + 5 >> 0] = a[c + 5 >> 0]; a[h + 6 >> 0] = a[c + 6 >> 0]; a[h + 7 >> 0] = a[c + 7 >> 0]; e = +g[h >> 3]; g[h >> 3] = o; a[n >> 0] = a[h >> 0]; a[n + 1 >> 0] = a[h + 1 >> 0]; a[n + 2 >> 0] = a[h + 2 >> 0]; a[n + 3 >> 0] = a[h + 3 >> 0]; a[n + 4 >> 0] = a[h + 4 >> 0]; a[n + 5 >> 0] = a[h + 5 >> 0]; a[n + 6 >> 0] = a[h + 6 >> 0]; a[n + 7 >> 0] = a[h + 7 >> 0]; g[h >> 3] = m; a[l >> 0] = a[h >> 0]; a[l + 1 >> 0] = a[h + 1 >> 0]; a[l + 2 >> 0] = a[h + 2 >> 0]; a[l + 3 >> 0] = a[h + 3 >> 0]; a[l + 4 >> 0] = a[h + 4 >> 0]; a[l + 5 >> 0] = a[h + 5 >> 0]; a[l + 6 >> 0] = a[h + 6 >> 0]; a[l + 7 >> 0] = a[h + 7 >> 0]; g[h >> 3] = k; a[j >> 0] = a[h >> 0]; a[j + 1 >> 0] = a[h + 1 >> 0]; a[j + 2 >> 0] = a[h + 2 >> 0]; a[j + 3 >> 0] = a[h + 3 >> 0]; a[j + 4 >> 0] = a[h + 4 >> 0]; a[j + 5 >> 0] = a[h + 5 >> 0]; a[j + 6 >> 0] = a[h + 6 >> 0]; a[j + 7 >> 0] = a[h + 7 >> 0]; g[h >> 3] = i; a[f >> 0] = a[h >> 0]; a[f + 1 >> 0] = a[h + 1 >> 0]; a[f + 2 >> 0] = a[h + 2 >> 0]; a[f + 3 >> 0] = a[h + 3 >> 0]; a[f + 4 >> 0] = a[h + 4 >> 0]; a[f + 5 >> 0] = a[h + 5 >> 0]; a[f + 6 >> 0] = a[h + 6 >> 0]; a[f + 7 >> 0] = a[h + 7 >> 0]; g[h >> 3] = e; a[b >> 0] = a[h >> 0]; a[b + 1 >> 0] = a[h + 1 >> 0]; a[b + 2 >> 0] = a[h + 2 >> 0]; a[b + 3 >> 0] = a[h + 3 >> 0]; a[b + 4 >> 0] = a[h + 4 >> 0]; a[b + 5 >> 0] = a[h + 5 >> 0]; a[b + 6 >> 0] = a[h + 6 >> 0]; a[b + 7 >> 0] = a[h + 7 >> 0]; g[h >> 3] = d; a[c >> 0] = a[h >> 0]; a[c + 1 >> 0] = a[h + 1 >> 0]; a[c + 2 >> 0] = a[h + 2 >> 0]; a[c + 3 >> 0] = a[h + 3 >> 0]; a[c + 4 >> 0] = a[h + 4 >> 0]; a[c + 5 >> 0] = a[h + 5 >> 0]; a[c + 6 >> 0] = a[h + 6 >> 0]; a[c + 7 >> 0] = a[h + 7 >> 0]; return } function db() { var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0; g = V; V = V + 48 | 0; e = g + 24 | 0; f = g; b = g + 44 | 0; if ((a[21440] | 0) == 0 ? Tp(21440) | 0 : 0) { c[5374] = 0; c[5375] = 0; c[5376] = 0; $p(21440); } if ((a[21448] | 0) == 0 ? Tp(21448) | 0 : 0) $p(21448); if ((c[5374] | 0) == (c[5375] | 0)) { rq(21508); if ((c[5374] | 0) == (c[5375] | 0)) { a[e >> 0] = a[b >> 0] | 0; pb(f, e); b = c[5375] | 0; do if (b >>> 0 >= (c[5376] | 0) >>> 0) { b = ((b - (c[5374] | 0) | 0) / 24 | 0) + 1 | 0; d = xb(21496) | 0; if (d >>> 0 < b >>> 0) cr(21496); else { h = c[5374] | 0; j = ((c[5376] | 0) - h | 0) / 24 | 0; i = j << 1; ub(e, j >>> 0 < d >>> 1 >>> 0 ? (i >>> 0 < b >>> 0 ? b : i) : d, ((c[5375] | 0) - h | 0) / 24 | 0, 21504); d = e + 8 | 0; sb(c[d >> 2] | 0, f); c[d >> 2] = (c[d >> 2] | 0) + 24; vb(21496, e); wb(e); break } } else { qb(e, 21496, 1); j = e + 4 | 0; sb(c[j >> 2] | 0, f); c[j >> 2] = (c[j >> 2] | 0) + 24; rb(e); } while (0); gb(f); } sq(21508); } V = g; return 21496 } function eb(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0; d = b + 16 | 0; e = c[d >> 2] | 0; do if (e) if ((b | 0) == (e | 0)) { e = tb(a) | 0; c[a + 16 >> 2] = e; d = c[d >> 2] | 0; da[c[(c[d >> 2] | 0) + 12 >> 2] & 15](d, e); break } else { c[a + 16 >> 2] = Z[c[(c[e >> 2] | 0) + 8 >> 2] & 15](e) | 0; break } else c[a + 16 >> 2] = 0; while (0); return } function fb(a, b) { a = a | 0; b = b | 0; a = c[a + 16 >> 2] | 0; if (!a) { b = v(4) | 0; c[b >> 2] = 0; Nb(b); x(b | 0, 4168, 131); } else { da[c[(c[a >> 2] | 0) + 24 >> 2] & 15](a, b); return } } function gb(a) { a = a | 0; var b = 0; b = c[a + 16 >> 2] | 0; if ((a | 0) != (b | 0)) { if (b | 0) ca[c[(c[b >> 2] | 0) + 20 >> 2] & 255](b); } else ca[c[(c[b >> 2] | 0) + 16 >> 2] & 255](b); return } function hb(b) { b = b | 0; var f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, q = 0; q = V; V = V + 96 | 0; i = q + 16 | 0; o = q; l = q + 72 | 0; j = c[b >> 2] | 0; m = e[b + 114 >> 1] | 0; n = o; c[n >> 2] = 0; c[n + 4 >> 2] = 0; n = o + 8 | 0; c[n >> 2] = m; c[n + 4 >> 2] = 0; c[i >> 2] = c[o >> 2]; c[i + 4 >> 2] = c[o + 4 >> 2]; c[i + 8 >> 2] = c[o + 8 >> 2]; c[i + 12 >> 2] = c[o + 12 >> 2]; bb(j, i); j = b + 120 | 0; a: do if (c[j >> 2] | 0) { k = i + 2 | 0; m = i + 16 | 0; n = i + 20 | 0; o = i + 18 | 0; g = 0; while (1) { if (!(Ob(c[b >> 2] | 0) | 0)) break a; if (Pb(c[b >> 2] | 0) | 0) break a; $a(c[b >> 2] | 0, i, 54); f = 7277; h = k; while (1) { if ((a[h >> 0] | 0) != (a[f >> 0] | 0)) break; h = h + 1 | 0; if ((h | 0) == (m | 0)) { p = 8; break } else f = f + 1 | 0; } if ((p | 0) == 8 ? (p = 0, (d[o >> 0] | d[o + 1 >> 0] << 8) << 16 >> 16 == 22204) : 0) break; Rb(c[b >> 2] | 0, (d[n >> 0] | d[n + 1 >> 0] << 8) & 65535, 0, 1); g = g + 1 | 0; if (g >>> 0 >= (c[j >> 2] | 0) >>> 0) break a } o = (d[n >> 0] | d[n + 1 >> 0] << 8) & 65535; p = fq(o) | 0; $a(c[b >> 2] | 0, p, o); Qb(b, p); jp(p); p = b + 125 | 0; Tb(l, b + 247 | 0, (d[p >> 0] | d[p + 1 >> 0] << 8) & 65535); Ub(b + 300 | 0, l) | 0; Pa(l); V = q; return } while (0); q = v(8) | 0; Sb(q); x(q | 0, 2672, 8); } function ib(a) { a = a | 0; var b = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0; n = V; V = V + 176 | 0; g = n + 40 | 0; h = n + 24 | 0; b = n + 16 | 0; f = n; k = n + 152 | 0; l = n + 136 | 0; m = n + 56 | 0; j = c[a >> 2] | 0; i = a + 116 | 0; o = c[i >> 2] | 0; e = h; c[e >> 2] = 0; c[e + 4 >> 2] = 0; e = h + 8 | 0; c[e >> 2] = o; c[e + 4 >> 2] = 0; c[g >> 2] = c[h >> 2]; c[g + 4 >> 2] = c[h + 4 >> 2]; c[g + 8 >> 2] = c[h + 8 >> 2]; c[g + 12 >> 2] = c[h + 12 >> 2]; bb(j, g); j = b; c[j >> 2] = 0; c[j + 4 >> 2] = 0; $a(c[a >> 2] | 0, b, 8); if (!(Ob(c[a >> 2] | 0) | 0)) { o = v(8) | 0; hc(o); x(o | 0, 2704, 8); } e = b; b = c[e >> 2] | 0; e = c[e + 4 >> 2] | 0; if ((b | 0) == -1 & (e | 0) == -1) { o = v(8) | 0; ic(o, 7488); x(o | 0, 2720, 8); } o = c[a >> 2] | 0; j = f; c[j >> 2] = 0; c[j + 4 >> 2] = 0; j = f + 8 | 0; c[j >> 2] = b; c[j + 4 >> 2] = e; c[g >> 2] = c[f >> 2]; c[g + 4 >> 2] = c[f + 4 >> 2]; c[g + 8 >> 2] = c[f + 8 >> 2]; c[g + 12 >> 2] = c[f + 12 >> 2]; bb(o, g); if (!(Ob(c[a >> 2] | 0) | 0)) { o = v(8) | 0; hc(o); x(o | 0, 2704, 8); } $a(c[a >> 2] | 0, g, 8); if (!(Ob(c[a >> 2] | 0) | 0)) { o = v(8) | 0; hc(o); x(o | 0, 2704, 8); } if (c[g >> 2] | 0) { o = v(8) | 0; jc(o); x(o | 0, 2736, 8); } h = a + 288 | 0; j = a + 292 | 0; c[j >> 2] = c[h >> 2]; o = a + 259 | 0; if ((d[o >> 0] | d[o + 1 >> 0] << 8 | d[o + 2 >> 0] << 16 | d[o + 3 >> 0] << 24 | 0) == -1) { o = v(8) | 0; ic(o, 7606); x(o | 0, 2720, 8); } f = g + 4 | 0; kc(h, (c[f >> 2] | 0) + 1 | 0); o = c[h >> 2] | 0; c[o >> 2] = (c[i >> 2] | 0) + 8; c[o + 4 >> 2] = 0; if ((c[f >> 2] | 0) >>> 0 > 1) { Va(k, c[a >> 2] | 0); lc(l, k); mc(m, 32, 2, 8, 0); nc(l); oc(m); if (!(c[f >> 2] | 0)) { h = c[h >> 2] | 0; e = h; } else { e = 1; do { if (e >>> 0 > 1) b = c[(c[h >> 2] | 0) + (e + -1 << 3) >> 2] | 0; else b = 0; i = pc(m, l, b, 1) | 0; b = c[h >> 2] | 0; o = b + (e << 3) | 0; c[o >> 2] = i; c[o + 4 >> 2] = ((i | 0) < 0) << 31 >> 31; e = e + 1 | 0; } while (e >>> 0 <= (c[f >> 2] | 0) >>> 0); e = b; h = b; } b = c[j >> 2] | 0; if (b - e >> 3 >>> 0 > 1) { g = b - h >> 3; f = h; b = 1; e = c[f >> 2] | 0; f = c[f + 4 >> 2] | 0; do { o = h + (b << 3) | 0; j = o; e = lr(c[j >> 2] | 0, c[j + 4 >> 2] | 0, e | 0, f | 0) | 0; f = u() | 0; c[o >> 2] = e; c[o + 4 >> 2] = f; b = b + 1 | 0; } while (b >>> 0 < g >>> 0) } qc(m); rc(l); Ra(k); } V = n; return } function jb(b) { b = b | 0; a[b + 12 >> 0] = 0; a[b + 13 >> 0] = 0; return } function kb(a) { a = a | 0; c[a + 8 >> 2] = 0; c[a + 4 >> 2] = 0; return } function lb(a) { a = a | 0; return fo(a) | 0 } function mb(b, d, e) { b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0, i = 0, j = 0, k = 0; i = V; V = V + 16 | 0; g = d; h = i; f = e - g | 0; if (f >>> 0 > 4294967279) yq(b); if (f >>> 0 < 11) a[b + 11 >> 0] = f; else { k = f + 16 & -16; j = eq(k) | 0; c[b >> 2] = j; c[b + 8 >> 2] = k | -2147483648; c[b + 4 >> 2] = f; b = j; } if ((d | 0) != (e | 0)) { g = e - g | 0; f = b; while (1) { nb(f, d); d = d + 1 | 0; if ((d | 0) == (e | 0)) break; else f = f + 1 | 0; } b = b + g | 0; } a[h >> 0] = 0; nb(b, h); V = i; return } function nb(b, c) { b = b | 0; c = c | 0; a[b >> 0] = a[c >> 0] | 0; return } function ob(a) { a = a | 0; yp(a); jp(a); return } function pb(a, b) { a = a | 0; b = b | 0; c[a >> 2] = 4372; c[a + 16 >> 2] = a; return } function qb(a, b, d) { a = a | 0; b = b | 0; d = d | 0; c[a >> 2] = b; b = c[b + 4 >> 2] | 0; c[a + 4 >> 2] = b; c[a + 8 >> 2] = b + (d * 24 | 0); return } function rb(a) { a = a | 0; c[(c[a >> 2] | 0) + 4 >> 2] = c[a + 4 >> 2]; return } function sb(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0; d = b + 16 | 0; e = c[d >> 2] | 0; do if (e) if ((b | 0) == (e | 0)) { e = tb(a) | 0; c[a + 16 >> 2] = e; d = c[d >> 2] | 0; da[c[(c[d >> 2] | 0) + 12 >> 2] & 15](d, e); break } else { c[a + 16 >> 2] = e; c[d >> 2] = 0; break } else c[a + 16 >> 2] = 0; while (0); return } function tb(a) { a = a | 0; return a | 0 } function ub(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; var f = 0; f = a + 12 | 0; c[f >> 2] = 0; c[a + 16 >> 2] = e; do if (b) if (b >>> 0 > 178956970) { f = v(8) | 0; vq(f, 6723); c[f >> 2] = 5956; x(f | 0, 3928, 123); } else { e = eq(b * 24 | 0) | 0; break } else e = 0; while (0); c[a >> 2] = e; d = e + (d * 24 | 0) | 0; c[a + 8 >> 2] = d; c[a + 4 >> 2] = d; c[f >> 2] = e + (b * 24 | 0); return } function vb(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0; i = c[a >> 2] | 0; j = a + 4 | 0; d = c[j >> 2] | 0; h = b + 4 | 0; if ((d | 0) == (i | 0)) { f = h; g = a; e = c[h >> 2] | 0; d = i; } else { e = c[h >> 2] | 0; do { d = d + -24 | 0; sb(e + -24 | 0, d); e = (c[h >> 2] | 0) + -24 | 0; c[h >> 2] = e; } while ((d | 0) != (i | 0)); f = h; g = a; d = c[a >> 2] | 0; } c[g >> 2] = e; c[f >> 2] = d; i = b + 8 | 0; h = c[j >> 2] | 0; c[j >> 2] = c[i >> 2]; c[i >> 2] = h; i = a + 8 | 0; j = b + 12 | 0; a = c[i >> 2] | 0; c[i >> 2] = c[j >> 2]; c[j >> 2] = a; c[b >> 2] = c[f >> 2]; return } function wb(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0; d = c[a + 4 >> 2] | 0; e = a + 8 | 0; b = c[e >> 2] | 0; if ((b | 0) != (d | 0)) do { f = b + -24 | 0; c[e >> 2] = f; gb(f); b = c[e >> 2] | 0; } while ((b | 0) != (d | 0)); b = c[a >> 2] | 0; if (b | 0) Da(b, (c[a + 12 >> 2] | 0) - b | 0); return } function xb(a) { a = a | 0; return 178956970 } function yb(a) { a = a | 0; jp(a); return } function zb(a) { a = a | 0; a = eq(8) | 0; c[a >> 2] = 4372; return a | 0 } function Ab(a, b) { a = a | 0; b = b | 0; c[b >> 2] = 4372; return } function Bb(a) { a = a | 0; return } function Cb(a) { a = a | 0; Da(a, 8); return } function Db(a, b) { a = a | 0; b = b | 0; Hb(a + 4 | 0, b); return } function Eb(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 7183 ? a + 4 | 0 : 0) | 0 } function Fb(a) { a = a | 0; return 2664 } function Gb(a) { a = a | 0; return } function Hb(a, b) { a = a | 0; b = b | 0; Ib(a, b); return } function Ib(b, c) { b = b | 0; c = c | 0; var e = 0, f = 0; b = c + 104 | 0; c = d[b >> 0] | 0; e = c >>> 7; f = c >>> 6 & 1; if ((e | 0) == 1 & (f | 0) != 0) { f = v(8) | 0; Jb(f); x(f | 0, 2632, 8); } if ((e | 0) == (f | 0)) { f = v(8) | 0; Kb(f); x(f | 0, 2648, 8); } else { a[b >> 0] = c & 63; return } } function Jb(a) { a = a | 0; xq(a, 7076); c[a >> 2] = 4416; return } function Kb(a) { a = a | 0; xq(a, 7144); c[a >> 2] = 4436; return } function Lb(a) { a = a | 0; yp(a); jp(a); return } function Mb(a) { a = a | 0; yp(a); jp(a); return } function Nb(a) { a = a | 0; c[a >> 2] = 6092; return } function Ob(b) { b = b | 0; var c = 0; c = b + 12 | 0; b = (a[c >> 0] | 0) == 0; a[c >> 0] = 0; return b | 0 } function Pb(b) { b = b | 0; return (a[b + 13 >> 0] | 0) != 0 | 0 } function Qb(a, b) { a = a | 0; b = b | 0; a = a + 247 | 0; Vb(a, b); if ((d[a >> 0] | d[a + 1 >> 0] << 8) << 16 >> 16 == 2) return; else { b = v(8) | 0; Wb(b); x(b | 0, 2688, 8); } } function Rb(b, d, e, f) { b = b | 0; d = d | 0; e = e | 0; f = f | 0; var g = 0, h = 0; switch (f | 0) { case 0: break; case 2: { f = c[b + 4 >> 2] | 0; d = lr(lr(d | 0, e | 0, -1, -1) | 0, u() | 0, f | 0, ((f | 0) < 0) << 31 >> 31 | 0) | 0; e = u() | 0; break } case 1: { f = c[b + 8 >> 2] | 0; d = lr(f | 0, ((f | 0) < 0) << 31 >> 31 | 0, d | 0, e | 0) | 0; e = u() | 0; break } default: { e = 0; d = 0; } } g = c[b + 4 >> 2] | 0; h = ((g | 0) < 0) << 31 >> 31; f = b + 12 | 0; if (((e | 0) < 0) | ((e | 0) > (h | 0) | (e | 0) == (h | 0) & d >>> 0 >= g >>> 0)) a[f >> 0] = 1; else { a[f >> 0] = 0; c[b + 8 >> 2] = d; } return } function Sb(a) { a = a | 0; xq(a, 7410); c[a >> 2] = 4476; return } function Tb(a, b, c) { a = a | 0; b = b | 0; c = c | 0; var e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0; h = V; V = V + 16 | 0; g = h; Xa(a); f = b + 32 | 0; if ((d[f >> 0] | d[f + 1 >> 0] << 8) << 16 >> 16) { e = b + 34 | 0; b = 0; do { j = d[e >> 0] | d[e + 1 >> 0] << 8 | d[e + 2 >> 0] << 16 | d[e + 3 >> 0] << 24; k = j + (b * 6 | 0) | 0; i = j + (b * 6 | 0) + 2 | 0; j = j + (b * 6 | 0) + 4 | 0; _b(g, (d[k >> 0] | d[k + 1 >> 0] << 8) & 65535, (d[i >> 0] | d[i + 1 >> 0] << 8) & 65535, (d[j >> 0] | d[j + 1 >> 0] << 8) & 65535); Zb(a, g); c = c - ((d[i >> 0] | d[i + 1 >> 0] << 8) & 65535) | 0; b = b + 1 | 0; } while (b >>> 0 < ((d[f >> 0] | d[f + 1 >> 0] << 8) & 65535) >>> 0) } if ((c | 0) < 0) { k = v(8) | 0; Wb(k); x(k | 0, 2688, 8); } if (c | 0) { _b(g, 0, c, 2); Zb(a, g); } V = h; return } function Ub(b, c) { b = b | 0; c = c | 0; var d = 0, e = 0; d = V; V = V + 16 | 0; e = d + 1 | 0; a[e >> 0] = a[d >> 0] | 0; fc(b, c, e); V = d; return b | 0 } function Vb(b, c) { b = b | 0; c = c | 0; var e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0; f = c + 2 | 0; h = d[c >> 0] | d[c + 1 >> 0] << 8; a[b >> 0] = h; a[b + 1 >> 0] = h >> 8; h = b + 2 | 0; f = d[f >> 0] | d[f + 1 >> 0] << 8; a[h >> 0] = f; a[h + 1 >> 0] = f >> 8; a[b + 4 >> 0] = a[c + 4 >> 0] | 0; h = c + 6 | 0; a[b + 5 >> 0] = a[c + 5 >> 0] | 0; f = c + 8 | 0; e = b + 6 | 0; h = d[h >> 0] | d[h + 1 >> 0] << 8; a[e >> 0] = h; a[e + 1 >> 0] = h >> 8; e = c + 12 | 0; h = b + 8 | 0; f = d[f >> 0] | d[f + 1 >> 0] << 8 | d[f + 2 >> 0] << 16 | d[f + 3 >> 0] << 24; a[h >> 0] = f; a[h + 1 >> 0] = f >> 8; a[h + 2 >> 0] = f >> 16; a[h + 3 >> 0] = f >> 24; h = b + 12 | 0; e = d[e >> 0] | d[e + 1 >> 0] << 8 | d[e + 2 >> 0] << 16 | d[e + 3 >> 0] << 24; a[h >> 0] = e; a[h + 1 >> 0] = e >> 8; a[h + 2 >> 0] = e >> 16; a[h + 3 >> 0] = e >> 24; h = c + 16 | 0; e = h; e = d[e >> 0] | d[e + 1 >> 0] << 8 | d[e + 2 >> 0] << 16 | d[e + 3 >> 0] << 24; h = h + 4 | 0; h = d[h >> 0] | d[h + 1 >> 0] << 8 | d[h + 2 >> 0] << 16 | d[h + 3 >> 0] << 24; f = b + 16 | 0; i = f; a[i >> 0] = e; a[i + 1 >> 0] = e >> 8; a[i + 2 >> 0] = e >> 16; a[i + 3 >> 0] = e >> 24; f = f + 4 | 0; a[f >> 0] = h; a[f + 1 >> 0] = h >> 8; a[f + 2 >> 0] = h >> 16; a[f + 3 >> 0] = h >> 24; f = c + 32 | 0; h = c + 24 | 0; i = h; i = d[i >> 0] | d[i + 1 >> 0] << 8 | d[i + 2 >> 0] << 16 | d[i + 3 >> 0] << 24; h = h + 4 | 0; h = d[h >> 0] | d[h + 1 >> 0] << 8 | d[h + 2 >> 0] << 16 | d[h + 3 >> 0] << 24; e = b + 24 | 0; g = e; a[g >> 0] = i; a[g + 1 >> 0] = i >> 8; a[g + 2 >> 0] = i >> 16; a[g + 3 >> 0] = i >> 24; e = e + 4 | 0; a[e >> 0] = h; a[e + 1 >> 0] = h >> 8; a[e + 2 >> 0] = h >> 16; a[e + 3 >> 0] = h >> 24; e = c + 34 | 0; h = b + 32 | 0; f = d[f >> 0] | d[f + 1 >> 0] << 8; a[h >> 0] = f; a[h + 1 >> 0] = f >> 8; g = b + 34 | 0; b = d[g >> 0] | d[g + 1 >> 0] << 8 | d[g + 2 >> 0] << 16 | d[g + 3 >> 0] << 24; if (!b) b = f; else { gq(b); b = d[h >> 0] | d[h + 1 >> 0] << 8; } f = fq((b & 65535) * 6 | 0) | 0; a[g >> 0] = f; a[g + 1 >> 0] = f >> 8; a[g + 2 >> 0] = f >> 16; a[g + 3 >> 0] = f >> 24; if (b << 16 >> 16 ? (b = c + 36 | 0, i = d[e >> 0] | d[e + 1 >> 0] << 8, a[f >> 0] = i, a[f + 1 >> 0] = i >> 8, c = c + 38 | 0, i = f + 2 | 0, b = d[b >> 0] | d[b + 1 >> 0] << 8, a[i >> 0] = b, a[i + 1 >> 0] = b >> 8, i = f + 4 | 0, c = d[c >> 0] | d[c + 1 >> 0] << 8, a[i >> 0] = c, a[i + 1 >> 0] = c >> 8, ((d[h >> 0] | d[h + 1 >> 0] << 8) & 65535) > 1) : 0) { b = 1; do { c = e; e = e + 6 | 0; i = d[g >> 0] | d[g + 1 >> 0] << 8 | d[g + 2 >> 0] << 16 | d[g + 3 >> 0] << 24; j = c + 8 | 0; f = i + (b * 6 | 0) | 0; k = d[e >> 0] | d[e + 1 >> 0] << 8; a[f >> 0] = k; a[f + 1 >> 0] = k >> 8; c = c + 10 | 0; f = i + (b * 6 | 0) + 2 | 0; j = d[j >> 0] | d[j + 1 >> 0] << 8; a[f >> 0] = j; a[f + 1 >> 0] = j >> 8; i = i + (b * 6 | 0) + 4 | 0; c = d[c >> 0] | d[c + 1 >> 0] << 8; a[i >> 0] = c; a[i + 1 >> 0] = c >> 8; b = b + 1 | 0; } while (b >>> 0 < ((d[h >> 0] | d[h + 1 >> 0] << 8) & 65535) >>> 0) } return } function Wb(a) { a = a | 0; xq(a, 7354); c[a >> 2] = 4456; return } function Xb(a) { a = a | 0; yp(a); jp(a); return } function Yb(a) { a = a | 0; yp(a); jp(a); return } function Zb(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0; i = V; V = V + 32 | 0; f = i; g = a + 4 | 0; d = c[g >> 2] | 0; h = a + 8 | 0; do if ((d | 0) == (c[h >> 2] | 0)) { d = ((d - (c[a >> 2] | 0) | 0) / 12 | 0) + 1 | 0; e = ec(a) | 0; if (e >>> 0 < d >>> 0) cr(a); else { j = c[a >> 2] | 0; k = ((c[h >> 2] | 0) - j | 0) / 12 | 0; h = k << 1; bc(f, k >>> 0 < e >>> 1 >>> 0 ? (h >>> 0 < d >>> 0 ? d : h) : e, ((c[g >> 2] | 0) - j | 0) / 12 | 0, a + 8 | 0); h = f + 8 | 0; g = c[h >> 2] | 0; c[g >> 2] = c[b >> 2]; c[g + 4 >> 2] = c[b + 4 >> 2]; c[g + 8 >> 2] = c[b + 8 >> 2]; c[h >> 2] = (c[h >> 2] | 0) + 12; cc(a, f); dc(f); break } } else { $b(f, a, 1); k = f + 4 | 0; j = c[k >> 2] | 0; c[j >> 2] = c[b >> 2]; c[j + 4 >> 2] = c[b + 4 >> 2]; c[j + 8 >> 2] = c[b + 8 >> 2]; c[k >> 2] = (c[k >> 2] | 0) + 12; ac(f); } while (0); V = i; return } function _b(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; c[a >> 2] = b; c[a + 4 >> 2] = d; c[a + 8 >> 2] = e; return } function $b(a, b, d) { a = a | 0; b = b | 0; d = d | 0; c[a >> 2] = b; b = c[b + 4 >> 2] | 0; c[a + 4 >> 2] = b; c[a + 8 >> 2] = b + (d * 12 | 0); return } function ac(a) { a = a | 0; c[(c[a >> 2] | 0) + 4 >> 2] = c[a + 4 >> 2]; return } function bc(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; var f = 0; f = a + 12 | 0; c[f >> 2] = 0; c[a + 16 >> 2] = e; do if (b) if (b >>> 0 > 357913941) { f = v(8) | 0; vq(f, 6723); c[f >> 2] = 5956; x(f | 0, 3928, 123); } else { e = eq(b * 12 | 0) | 0; break } else e = 0; while (0); c[a >> 2] = e; d = e + (d * 12 | 0) | 0; c[a + 8 >> 2] = d; c[a + 4 >> 2] = d; c[f >> 2] = e + (b * 12 | 0); return } function cc(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0; e = c[a >> 2] | 0; h = a + 4 | 0; g = b + 4 | 0; f = (c[h >> 2] | 0) - e | 0; d = (c[g >> 2] | 0) + (((f | 0) / -12 | 0) * 12 | 0) | 0; c[g >> 2] = d; if ((f | 0) > 0) { ur(d | 0, e | 0, f | 0) | 0; e = g; d = c[g >> 2] | 0; } else e = g; g = c[a >> 2] | 0; c[a >> 2] = d; c[e >> 2] = g; g = b + 8 | 0; f = c[h >> 2] | 0; c[h >> 2] = c[g >> 2]; c[g >> 2] = f; g = a + 8 | 0; h = b + 12 | 0; a = c[g >> 2] | 0; c[g >> 2] = c[h >> 2]; c[h >> 2] = a; c[b >> 2] = c[e >> 2]; return } function dc(a) { a = a | 0; var b = 0, d = 0, e = 0; b = c[a + 4 >> 2] | 0; d = a + 8 | 0; e = c[d >> 2] | 0; if ((e | 0) != (b | 0)) c[d >> 2] = e + (~(((e + -12 - b | 0) >>> 0) / 12 | 0) * 12 | 0); b = c[a >> 2] | 0; if (b | 0) Da(b, (c[a + 12 >> 2] | 0) - b | 0); return } function ec(a) { a = a | 0; return 357913941 } function fc(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0; gc(a); c[a >> 2] = c[b >> 2]; d = b + 4 | 0; c[a + 4 >> 2] = c[d >> 2]; e = b + 8 | 0; c[a + 8 >> 2] = c[e >> 2]; c[e >> 2] = 0; c[d >> 2] = 0; c[b >> 2] = 0; return } function gc(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0; b = c[a >> 2] | 0; d = b; if (b | 0) { e = a + 4 | 0; c[e >> 2] = d; f = a + 8 | 0; Da(b, (c[f >> 2] | 0) - d | 0); c[f >> 2] = 0; c[e >> 2] = 0; c[a >> 2] = 0; } return } function hc(a) { a = a | 0; xq(a, 7660); c[a >> 2] = 4496; return } function ic(a, b) { a = a | 0; b = b | 0; xq(a, b); c[a >> 2] = 4516; return } function jc(a) { a = a | 0; xq(a, 7704); c[a >> 2] = 4536; return } function kc(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0; d = a + 4 | 0; f = c[a >> 2] | 0; e = (c[d >> 2] | 0) - f >> 3; if (e >>> 0 >= b >>> 0) { if (e >>> 0 > b >>> 0) c[d >> 2] = f + (b << 3); } else vc(a, b - e | 0); return } function lc(a, b) { a = a | 0; b = b | 0; c[a >> 2] = b; c[a + 4 >> 2] = 0; c[a + 8 >> 2] = -1; return } function mc(a, b, d, e, f) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; f = f | 0; var g = 0; c[a + 4 >> 2] = b; c[a + 8 >> 2] = d; c[a + 12 >> 2] = e; c[a + 16 >> 2] = f; c[a + 36 >> 2] = 0; c[a + 40 >> 2] = 0; c[a + 44 >> 2] = 0; Gc(a + 48 | 0); c[a + 68 >> 2] = 0; c[a + 72 >> 2] = 0; c[a + 76 >> 2] = 0; do if (!f) { d = a + 20 | 0; if ((b + -1 | 0) >>> 0 < 31) { c[d >> 2] = b; f = 1 << b; c[a + 24 >> 2] = f; d = f >>> 1; c[a + 28 >> 2] = 0 - d; d = f + -1 - d | 0; break } else { c[d >> 2] = 32; c[a + 24 >> 2] = 0; c[a + 28 >> 2] = -2147483648; d = 2147483647; break } } else { e = a + 20 | 0; c[e >> 2] = 0; c[a + 24 >> 2] = f; d = f; g = 0; while (1) { d = d >>> 1; b = g + 1 | 0; if (!d) break; else g = b; } c[e >> 2] = (1 << g | 0) == (f | 0) ? g : b; d = f >>> 1; c[a + 28 >> 2] = 0 - d; d = f + -1 - d | 0; } while (0); c[a + 32 >> 2] = d; c[a >> 2] = 0; return } function nc(a) { a = a | 0; var b = 0; b = ((Jc(c[a >> 2] | 0) | 0) & 255) << 24; b = ((Jc(c[a >> 2] | 0) | 0) & 255) << 16 | b; b = b | ((Jc(c[a >> 2] | 0) | 0) & 255) << 8; c[a + 4 >> 2] = b | (Jc(c[a >> 2] | 0) | 0) & 255; return } function oc(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, q = 0, r = 0, s = 0, t = 0; q = V; V = V + 64 | 0; o = q + 44 | 0; p = q; k = a + 36 | 0; l = a + 40 | 0; a: do if ((c[k >> 2] | 0) == (c[l >> 2] | 0)) { m = a + 8 | 0; b: do if (!(c[m >> 2] | 0)) n = a + 20 | 0; else { f = a + 20 | 0; g = a + 44 | 0; h = o + 4 | 0; i = a + 44 | 0; j = o + 8 | 0; e = 0; while (1) { Oc(p, (c[f >> 2] | 0) + 1 | 0, 0, 0); b = c[l >> 2] | 0; if (b >>> 0 < (c[g >> 2] | 0) >>> 0) { Pc(o, k, 1); Rc(c[h >> 2] | 0, p); c[h >> 2] = (c[h >> 2] | 0) + 44; Qc(o); } else { b = ((b - (c[k >> 2] | 0) | 0) / 44 | 0) + 1 | 0; d = Vc(k) | 0; if (d >>> 0 < b >>> 0) break; r = c[k >> 2] | 0; t = ((c[g >> 2] | 0) - r | 0) / 44 | 0; s = t << 1; Sc(o, t >>> 0 < d >>> 1 >>> 0 ? (s >>> 0 < b >>> 0 ? b : s) : d, ((c[l >> 2] | 0) - r | 0) / 44 | 0, i); Rc(c[j >> 2] | 0, p); c[j >> 2] = (c[j >> 2] | 0) + 44; Tc(k, o); Uc(o); } Ic(p); e = e + 1 | 0; if (e >>> 0 >= (c[m >> 2] | 0) >>> 0) { n = f; break b } } cr(k); } while (0); if (c[n >> 2] | 0) { h = a + 12 | 0; i = a + 68 | 0; j = a + 72 | 0; k = a + 76 | 0; l = o + 4 | 0; f = a + 76 | 0; g = o + 8 | 0; e = 1; while (1) { b = c[h >> 2] | 0; Oc(p, 1 << (e >>> 0 > b >>> 0 ? b : e), 0, 0); b = c[j >> 2] | 0; if (b >>> 0 < (c[k >> 2] | 0) >>> 0) { Pc(o, i, 1); Rc(c[l >> 2] | 0, p); c[l >> 2] = (c[l >> 2] | 0) + 44; Qc(o); } else { b = ((b - (c[i >> 2] | 0) | 0) / 44 | 0) + 1 | 0; d = Vc(i) | 0; if (d >>> 0 < b >>> 0) break; t = c[i >> 2] | 0; r = ((c[k >> 2] | 0) - t | 0) / 44 | 0; s = r << 1; Sc(o, r >>> 0 < d >>> 1 >>> 0 ? (s >>> 0 < b >>> 0 ? b : s) : d, ((c[j >> 2] | 0) - t | 0) / 44 | 0, f); Rc(c[g >> 2] | 0, p); c[g >> 2] = (c[g >> 2] | 0) + 44; Tc(i, o); Uc(o); } Ic(p); e = e + 1 | 0; if (e >>> 0 > (c[n >> 2] | 0) >>> 0) break a } cr(i); } } while (0); V = q; return } function pc(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; d = (Yc(a, b, (c[a + 36 >> 2] | 0) + (e * 44 | 0) | 0) | 0) + d | 0; b = c[a + 24 >> 2] | 0; if ((d | 0) < 0) return d + b | 0; else return d - (d >>> 0 < b >>> 0 ? 0 : b) | 0; return 0 } function qc(a) { a = a | 0; Hc(a + 68 | 0); Hc(a + 36 | 0); return } function rc(a) { a = a | 0; return } function sc(a) { a = a | 0; yp(a); jp(a); return } function tc(a) { a = a | 0; yp(a); jp(a); return } function uc(a) { a = a | 0; yp(a); jp(a); return } function vc(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0; i = V; V = V + 32 | 0; f = i; g = a + 8 | 0; h = a + 4 | 0; d = c[h >> 2] | 0; do if ((c[g >> 2] | 0) - d >> 3 >>> 0 < b >>> 0) { d = (d - (c[a >> 2] | 0) >> 3) + b | 0; e = Dc(a) | 0; if (e >>> 0 < d >>> 0) cr(a); else { j = c[a >> 2] | 0; k = (c[g >> 2] | 0) - j | 0; g = k >> 2; xc(f, k >> 3 >>> 0 < e >>> 1 >>> 0 ? (g >>> 0 < d >>> 0 ? d : g) : e, (c[h >> 2] | 0) - j >> 3, a + 8 | 0); yc(f, b); zc(a, f); Ac(f); break } } else wc(a, b); while (0); V = i; return } function wc(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0; f = V; V = V + 16 | 0; e = f; Bc(e, a, b); a = e + 4 | 0; b = c[a >> 2] | 0; d = c[e + 8 >> 2] | 0; if ((b | 0) != (d | 0)) { d = d + -8 - b | 0; wr(b | 0, 0, d + 8 & -8 | 0) | 0; c[a >> 2] = b + ((d >>> 3) + 1 << 3); } Cc(e); V = f; return } function xc(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; var f = 0; f = a + 12 | 0; c[f >> 2] = 0; c[a + 16 >> 2] = e; do if (b) if (b >>> 0 > 536870911) { f = v(8) | 0; vq(f, 6723); c[f >> 2] = 5956; x(f | 0, 3928, 123); } else { e = eq(b << 3) | 0; break } else e = 0; while (0); c[a >> 2] = e; d = e + (d << 3) | 0; c[a + 8 >> 2] = d; c[a + 4 >> 2] = d; c[f >> 2] = e + (b << 3); return } function yc(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0; e = V; V = V + 16 | 0; d = e; Ec(d, a + 8 | 0, b); a = c[d >> 2] | 0; b = c[d + 4 >> 2] | 0; if ((a | 0) != (b | 0)) { b = b + -8 - a | 0; wr(a | 0, 0, b + 8 & -8 | 0) | 0; c[d >> 2] = a + ((b >>> 3) + 1 << 3); } Fc(d); V = e; return } function zc(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0; e = c[a >> 2] | 0; h = a + 4 | 0; g = b + 4 | 0; f = (c[h >> 2] | 0) - e | 0; d = (c[g >> 2] | 0) + (0 - (f >> 3) << 3) | 0; c[g >> 2] = d; if ((f | 0) > 0) { ur(d | 0, e | 0, f | 0) | 0; e = g; d = c[g >> 2] | 0; } else e = g; g = c[a >> 2] | 0; c[a >> 2] = d; c[e >> 2] = g; g = b + 8 | 0; f = c[h >> 2] | 0; c[h >> 2] = c[g >> 2]; c[g >> 2] = f; g = a + 8 | 0; h = b + 12 | 0; a = c[g >> 2] | 0; c[g >> 2] = c[h >> 2]; c[h >> 2] = a; c[b >> 2] = c[e >> 2]; return } function Ac(a) { a = a | 0; var b = 0, d = 0, e = 0; b = c[a + 4 >> 2] | 0; d = a + 8 | 0; e = c[d >> 2] | 0; if ((e | 0) != (b | 0)) c[d >> 2] = e + (~((e + -8 - b | 0) >>> 3) << 3); b = c[a >> 2] | 0; if (b | 0) Da(b, (c[a + 12 >> 2] | 0) - b | 0); return } function Bc(a, b, d) { a = a | 0; b = b | 0; d = d | 0; c[a >> 2] = b; b = c[b + 4 >> 2] | 0; c[a + 4 >> 2] = b; c[a + 8 >> 2] = b + (d << 3); return } function Cc(a) { a = a | 0; c[(c[a >> 2] | 0) + 4 >> 2] = c[a + 4 >> 2]; return } function Dc(a) { a = a | 0; return 536870911 } function Ec(a, b, d) { a = a | 0; b = b | 0; d = d | 0; c[a >> 2] = c[b >> 2]; c[a + 4 >> 2] = (c[b >> 2] | 0) + (d << 3); c[a + 8 >> 2] = b; return } function Fc(a) { a = a | 0; c[c[a + 8 >> 2] >> 2] = c[a >> 2]; return } function Gc(a) { a = a | 0; c[a + 12 >> 2] = 1; c[a + 16 >> 2] = 2; c[a + 8 >> 2] = 4096; c[a + 4 >> 2] = 4; c[a >> 2] = 4; return } function Hc(a) { a = a | 0; var b = 0, d = 0, e = 0; d = c[a >> 2] | 0; if (d | 0) { e = a + 4 | 0; b = c[e >> 2] | 0; if ((b | 0) == (d | 0)) b = d; else { do { b = b + -44 | 0; Ic(b); } while ((b | 0) != (d | 0)); b = c[a >> 2] | 0; } c[e >> 2] = d; Da(b, (c[a + 8 >> 2] | 0) - b | 0); } return } function Ic(a) { a = a | 0; var b = 0; b = c[a + 8 >> 2] | 0; if (b | 0) Ua(b); b = c[a + 12 >> 2] | 0; if (b | 0) Ua(b); b = c[a + 16 >> 2] | 0; if (b | 0) Ua(b); return } function Jc(b) { b = b | 0; var d = 0, e = 0; e = b + 4 | 0; d = c[e >> 2] | 0; if ((d | 0) >= (c[b + 8 >> 2] | 0)) { Kc(b); d = c[e >> 2] | 0; } b = c[b + 12 >> 2] | 0; c[e >> 2] = d + 1; return a[b + d >> 0] | 0 } function Kc(a) { a = a | 0; var b = 0; c[a + 4 >> 2] = 0; $a(c[a >> 2] | 0, c[a + 12 >> 2] | 0, 1048576); b = Lc(c[a >> 2] | 0) | 0; c[a + 8 >> 2] = b; if (!b) { b = v(8) | 0; Mc(b); x(b | 0, 2752, 8); } else return } function Lc(a) { a = a | 0; return c[a + 16 >> 2] | 0 } function Mc(a) { a = a | 0; xq(a, 7769); c[a >> 2] = 4556; return } function Nc(a) { a = a | 0; yp(a); jp(a); return } function Oc(b, d, e, f) { b = b | 0; d = d | 0; e = e | 0; f = f | 0; var g = 0, h = 0, i = 0; c[b >> 2] = d; a[b + 4 >> 0] = e & 1; h = b + 8 | 0; c[h >> 2] = 0; i = b + 12 | 0; c[i >> 2] = 0; g = b + 16 | 0; c[g >> 2] = 0; if ((d + -2 | 0) >>> 0 > 2046) { b = v(8) | 0; xq(b, 7789); x(b | 0, 3912, 8); } c[b + 32 >> 2] = d + -1; if (d >>> 0 > 16 & (e ^ 1)) { e = 3; while (1) if (1 << e + 2 >>> 0 < d >>> 0) e = e + 1 | 0; else break; d = 1 << e; c[b + 36 >> 2] = d; c[b + 40 >> 2] = 15 - e; c[g >> 2] = _a((d << 2) + 8 | 0) | 0; d = c[b >> 2] | 0; } else { c[g >> 2] = 0; c[b + 40 >> 2] = 0; c[b + 36 >> 2] = 0; } c[h >> 2] = _a(d << 2) | 0; g = _a(c[b >> 2] << 2) | 0; c[i >> 2] = g; c[b + 20 >> 2] = 0; d = c[b >> 2] | 0; e = b + 24 | 0; c[e >> 2] = d; d = (d | 0) != 0; if (!f) { if (d) { d = 0; do { c[g + (d << 2) >> 2] = 1; d = d + 1 | 0; } while (d >>> 0 < (c[b >> 2] | 0) >>> 0) } } else if (d) { d = 0; do { c[g + (d << 2) >> 2] = c[f + (d << 2) >> 2]; d = d + 1 | 0; } while (d >>> 0 < (c[b >> 2] | 0) >>> 0) } Xc(b); f = ((c[b >> 2] | 0) + 6 | 0) >>> 1; c[e >> 2] = f; c[b + 28 >> 2] = f; return } function Pc(a, b, d) { a = a | 0; b = b | 0; d = d | 0; c[a >> 2] = b; b = c[b + 4 >> 2] | 0; c[a + 4 >> 2] = b; c[a + 8 >> 2] = b + (d * 44 | 0); return } function Qc(a) { a = a | 0; c[(c[a >> 2] | 0) + 4 >> 2] = c[a + 4 >> 2]; return } function Rc(b, d) { b = b | 0; d = d | 0; var e = 0; c[b >> 2] = c[d >> 2]; a[b + 4 >> 0] = a[d + 4 >> 0] | 0; e = d + 8 | 0; c[b + 8 >> 2] = c[e >> 2]; c[b + 12 >> 2] = c[d + 12 >> 2]; c[b + 16 >> 2] = c[d + 16 >> 2]; c[b + 20 >> 2] = c[d + 20 >> 2]; c[b + 24 >> 2] = c[d + 24 >> 2]; c[b + 28 >> 2] = c[d + 28 >> 2]; c[b + 32 >> 2] = c[d + 32 >> 2]; c[b + 36 >> 2] = c[d + 36 >> 2]; c[b + 40 >> 2] = c[d + 40 >> 2]; c[e >> 2] = 0; c[e + 4 >> 2] = 0; c[e + 8 >> 2] = 0; return } function Sc(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; var f = 0; f = a + 12 | 0; c[f >> 2] = 0; c[a + 16 >> 2] = e; do if (b) if (b >>> 0 > 97612893) { f = v(8) | 0; vq(f, 6723); c[f >> 2] = 5956; x(f | 0, 3928, 123); } else { e = eq(b * 44 | 0) | 0; break } else e = 0; while (0); c[a >> 2] = e; d = e + (d * 44 | 0) | 0; c[a + 8 >> 2] = d; c[a + 4 >> 2] = d; c[f >> 2] = e + (b * 44 | 0); return } function Tc(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0; i = c[a >> 2] | 0; j = a + 4 | 0; d = c[j >> 2] | 0; h = b + 4 | 0; if ((d | 0) == (i | 0)) { f = h; g = a; e = c[h >> 2] | 0; d = i; } else { e = c[h >> 2] | 0; do { d = d + -44 | 0; Wc(e + -44 | 0, d); e = (c[h >> 2] | 0) + -44 | 0; c[h >> 2] = e; } while ((d | 0) != (i | 0)); f = h; g = a; d = c[a >> 2] | 0; } c[g >> 2] = e; c[f >> 2] = d; i = b + 8 | 0; h = c[j >> 2] | 0; c[j >> 2] = c[i >> 2]; c[i >> 2] = h; i = a + 8 | 0; j = b + 12 | 0; a = c[i >> 2] | 0; c[i >> 2] = c[j >> 2]; c[j >> 2] = a; c[b >> 2] = c[f >> 2]; return } function Uc(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0; d = c[a + 4 >> 2] | 0; e = a + 8 | 0; b = c[e >> 2] | 0; if ((b | 0) != (d | 0)) do { f = b + -44 | 0; c[e >> 2] = f; Ic(f); b = c[e >> 2] | 0; } while ((b | 0) != (d | 0)); b = c[a >> 2] | 0; if (b | 0) Da(b, (c[a + 12 >> 2] | 0) - b | 0); return } function Vc(a) { a = a | 0; return 97612893 } function Wc(b, d) { b = b | 0; d = d | 0; var e = 0, f = 0, g = 0, h = 0; e = c[d >> 2] | 0; c[b >> 2] = e; a[b + 4 >> 0] = a[d + 4 >> 0] | 0; c[b + 20 >> 2] = c[d + 20 >> 2]; c[b + 24 >> 2] = c[d + 24 >> 2]; c[b + 28 >> 2] = c[d + 28 >> 2]; c[b + 32 >> 2] = c[d + 32 >> 2]; h = b + 36 | 0; c[h >> 2] = c[d + 36 >> 2]; c[b + 40 >> 2] = c[d + 40 >> 2]; e = e << 2; f = _a(e) | 0; c[b + 8 >> 2] = f; g = c[b >> 2] | 0; if (g | 0) vr(f | 0, c[d + 8 >> 2] | 0, g << 2 | 0) | 0; e = _a(e) | 0; c[b + 12 >> 2] = e; f = c[b >> 2] | 0; if (f | 0) vr(e | 0, c[d + 12 >> 2] | 0, f << 2 | 0) | 0; e = c[h >> 2] | 0; if (e) { f = _a((e << 2) + 8 | 0) | 0; c[b + 16 >> 2] = f; e = (c[h >> 2] << 2) + 8 | 0; if (e | 0) vr(f | 0, c[d + 16 >> 2] | 0, e | 0) | 0; } else c[b + 16 >> 2] = 0; return } function Xc(b) { b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, r = 0; r = b + 24 | 0; g = b + 20 | 0; d = (c[g >> 2] | 0) + (c[r >> 2] | 0) | 0; c[g >> 2] = d; if (d >>> 0 > 32768) { c[g >> 2] = 0; if (!(c[b >> 2] | 0)) d = 0; else { f = c[b + 12 >> 2] | 0; e = 0; do { n = f + (e << 2) | 0; d = ((c[n >> 2] | 0) + 1 | 0) >>> 1; c[n >> 2] = d; d = (c[g >> 2] | 0) + d | 0; c[g >> 2] = d; e = e + 1 | 0; } while (e >>> 0 < (c[b >> 2] | 0) >>> 0) } } n = 2147483648 / (d >>> 0) | 0; do if ((a[b + 4 >> 0] | 0) == 0 ? (o = b + 36 | 0, (c[o >> 2] | 0) != 0) : 0) { if (c[b >> 2] | 0) { j = c[b + 8 >> 2] | 0; k = c[b + 12 >> 2] | 0; l = b + 40 | 0; m = b + 16 | 0; d = 0; h = 0; i = 0; do { e = (q(h, n) | 0) >>> 16; c[j + (i << 2) >> 2] = e; h = (c[k + (i << 2) >> 2] | 0) + h | 0; e = e >>> (c[l >> 2] | 0); if (d >>> 0 < e >>> 0) { f = i + -1 | 0; g = c[m >> 2] | 0; do { d = d + 1 | 0; c[g + (d << 2) >> 2] = f; } while ((d | 0) != (e | 0)); d = e; } i = i + 1 | 0; } while (i >>> 0 < (c[b >> 2] | 0) >>> 0); e = c[m >> 2] | 0; c[e >> 2] = 0; if (d >>> 0 > (c[o >> 2] | 0) >>> 0) { d = b; break } } else { e = c[b + 16 >> 2] | 0; c[e >> 2] = 0; d = 0; } do { d = d + 1 | 0; c[e + (d << 2) >> 2] = (c[b >> 2] | 0) + -1; } while (d >>> 0 <= (c[o >> 2] | 0) >>> 0); d = b; } else p = 7; while (0); if ((p | 0) == 7) if (!(c[b >> 2] | 0)) d = b; else { f = c[b + 8 >> 2] | 0; g = c[b + 12 >> 2] | 0; d = 0; e = 0; do { c[f + (d << 2) >> 2] = (q(e, n) | 0) >>> 16; e = (c[g + (d << 2) >> 2] | 0) + e | 0; d = d + 1 | 0; } while (d >>> 0 < (c[b >> 2] | 0) >>> 0); d = b; } p = ((c[r >> 2] | 0) * 5 | 0) >>> 2; o = (c[d >> 2] << 3) + 48 | 0; p = p >>> 0 > o >>> 0 ? o : p; c[r >> 2] = p; c[b + 28 >> 2] = p; return } function Yc(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0; d = Zc(b, d) | 0; c[a >> 2] = d; do if (d) { if (d >>> 0 >= 32) { d = c[a + 28 >> 2] | 0; break } e = c[a + 12 >> 2] | 0; if (d >>> 0 > e >>> 0) { e = d - e | 0; d = Zc(b, (c[a + 68 >> 2] | 0) + ((d + -1 | 0) * 44 | 0) | 0) | 0; e = d << e | (_c(b, e) | 0); } else e = Zc(b, (c[a + 68 >> 2] | 0) + ((d + -1 | 0) * 44 | 0) | 0) | 0; d = c[a >> 2] | 0; if ((e | 0) < (1 << d + -1 | 0)) { d = e + 1 + (-1 << d) | 0; break } else { d = e + 1 | 0; break } } else d = $c(b, a + 48 | 0) | 0; while (0); return d | 0 } function Zc(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0; n = a + 8 | 0; m = c[n >> 2] | 0; f = c[b + 16 >> 2] | 0; if (f) { e = a + 4 | 0; d = c[e >> 2] | 0; l = m >>> 15; c[n >> 2] = l; j = (d >>> 0) / (l >>> 0) | 0; i = j >>> (c[b + 40 >> 2] | 0); g = c[f + (i << 2) >> 2] | 0; i = (c[f + (i + 1 << 2) >> 2] | 0) + 1 | 0; h = g + 1 | 0; k = c[b + 8 >> 2] | 0; if (i >>> 0 > h >>> 0) { f = g; g = i; do { h = (g + f | 0) >>> 1; i = (c[k + (h << 2) >> 2] | 0) >>> 0 > j >>> 0; f = i ? f : h; g = i ? h : g; h = f + 1 | 0; } while (g >>> 0 > h >>> 0); g = f; } f = q(c[k + (g << 2) >> 2] | 0, l) | 0; if ((g | 0) == (c[b + 32 >> 2] | 0)) h = m; else h = q(c[k + (h << 2) >> 2] | 0, l) | 0; } else { k = m >>> 15; c[n >> 2] = k; i = c[b >> 2] | 0; l = c[b + 8 >> 2] | 0; e = a + 4 | 0; d = c[e >> 2] | 0; j = i >>> 1; f = 0; h = m; g = 0; do { o = q(c[l + (j << 2) >> 2] | 0, k) | 0; m = o >>> 0 > d >>> 0; h = m ? o : h; f = m ? f : o; g = m ? g : j; i = m ? j : i; j = (g + i | 0) >>> 1; } while ((j | 0) != (g | 0)) } c[e >> 2] = d - f; o = h - f | 0; c[n >> 2] = o; if (o >>> 0 < 16777216) ad(a); n = (c[b + 12 >> 2] | 0) + (g << 2) | 0; c[n >> 2] = (c[n >> 2] | 0) + 1; n = b + 28 | 0; o = (c[n >> 2] | 0) + -1 | 0; c[n >> 2] = o; if (!o) Xc(b); return g | 0 } function _c(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0; if (b >>> 0 > 19) { d = (bd(a) | 0) & 65535; return (_c(a, b + -16 | 0) | 0) << 16 | d | 0 } e = a + 4 | 0; f = c[e >> 2] | 0; g = a + 8 | 0; d = (c[g >> 2] | 0) >>> b; c[g >> 2] = d; b = (f >>> 0) / (d >>> 0) | 0; c[e >> 2] = f - (q(b, d) | 0); if (d >>> 0 < 16777216) ad(a); return b | 0 } function $c(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0; e = a + 8 | 0; f = c[e >> 2] | 0; d = q(f >>> 13, c[b + 8 >> 2] | 0) | 0; g = a + 4 | 0; h = c[g >> 2] | 0; i = h >>> 0 >= d >>> 0; if (i) { c[g >> 2] = h - d; d = f - d | 0; c[e >> 2] = d; } else { c[e >> 2] = d; h = b + 12 | 0; c[h >> 2] = (c[h >> 2] | 0) + 1; } if (d >>> 0 < 16777216) ad(a); h = b + 4 | 0; a = (c[h >> 2] | 0) + -1 | 0; c[h >> 2] = a; if (!a) cd(b); return i & 1 | 0 } function ad(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0; b = a + 4 | 0; d = a + 8 | 0; e = c[b >> 2] | 0; do { e = e << 8 | (Jc(c[a >> 2] | 0) | 0) & 255; c[b >> 2] = e; f = c[d >> 2] << 8; c[d >> 2] = f; } while (f >>> 0 < 16777216); return } function bd(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0; d = a + 4 | 0; f = c[d >> 2] | 0; b = a + 8 | 0; e = (c[b >> 2] | 0) >>> 16; c[b >> 2] = e; b = (f >>> 0) / (e >>> 0) | 0; c[d >> 2] = f - (q(b, e) | 0); ad(a); return b & 65535 | 0 } function cd(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0; f = c[a >> 2] | 0; d = a + 16 | 0; b = (c[d >> 2] | 0) + f | 0; c[d >> 2] = b; if (b >>> 0 > 8192) { e = (b + 1 | 0) >>> 1; c[d >> 2] = e; g = a + 12 | 0; b = ((c[g >> 2] | 0) + 1 | 0) >>> 1; c[g >> 2] = b; if ((b | 0) == (e | 0)) { b = e + 1 | 0; c[d >> 2] = b; d = b; b = e; } else d = e; } else { d = b; b = c[a + 12 >> 2] | 0; } c[a + 8 >> 2] = (q(b, 2147483648 / (d >>> 0) | 0) | 0) >>> 18; g = f * 5 | 0; g = g >>> 0 > 259 ? 64 : g >>> 2; c[a >> 2] = g; c[a + 4 >> 2] = g; return } function dd(a, b) { a = a | 0; b = b | 0; var e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0; m = V; V = V + 32 | 0; h = m + 16 | 0; i = m + 8 | 0; j = m; k = a + 336 | 0; f = k; g = a + 259 | 0; if (!((c[f + 4 >> 2] | 0) == 0 ? (c[f >> 2] | 0) == (d[g >> 0] | d[g + 1 >> 0] << 8 | d[g + 2 >> 0] << 16 | d[g + 3 >> 0] << 24 | 0) : 0)) { f = a + 320 | 0; e = c[f >> 2] | 0; g = e; if (!((e | 0) != 0 ? (c[a + 312 >> 2] | 0) != 0 : 0)) { e = g; l = 5; } } else { f = a + 320 | 0; e = c[a + 320 >> 2] | 0; l = 5; } if ((l | 0) == 5) { l = a + 320 | 0; c[h >> 2] = e; c[l >> 2] = 0; e = a + 324 | 0; c[h + 4 >> 2] = c[e >> 2]; c[e >> 2] = 0; Na(h); g = a + 312 | 0; c[h >> 2] = c[g >> 2]; c[g >> 2] = 0; n = a + 316 | 0; c[h + 4 >> 2] = c[n >> 2]; c[n >> 2] = 0; Oa(h); o = eq(12) | 0; lc(o, a + 4 | 0); c[j >> 2] = 0; c[h >> 2] = c[j >> 2]; fd(i, o, h); o = c[i >> 2] | 0; c[i >> 2] = c[g >> 2]; c[g >> 2] = o; o = i + 4 | 0; j = c[o >> 2] | 0; c[o >> 2] = c[n >> 2]; c[n >> 2] = j; Oa(i); ed(i, c[g >> 2] | 0, a + 300 | 0); g = c[i >> 2] | 0; n = i + 4 | 0; j = c[n >> 2] | 0; c[i >> 2] = 0; c[n >> 2] = 0; c[h >> 2] = c[l >> 2]; c[l >> 2] = g; c[h + 4 >> 2] = c[e >> 2]; c[e >> 2] = j; Na(h); Na(i); e = a + 328 | 0; j = e; j = lr(c[j >> 2] | 0, c[j + 4 >> 2] | 0, 1, 0) | 0; l = u() | 0; c[e >> 2] = j; c[e + 4 >> 2] = l; e = k; c[e >> 2] = 0; c[e + 4 >> 2] = 0; e = c[f >> 2] | 0; } $[c[c[e >> 2] >> 2] & 63](e, b) | 0; l = k; l = lr(c[l >> 2] | 0, c[l + 4 >> 2] | 0, 1, 0) | 0; n = u() | 0; o = k; c[o >> 2] = l; c[o + 4 >> 2] = n; V = m; return } function ed(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0, g = 0, h = 0; h = V; V = V + 64 | 0; e = h + 56 | 0; f = h; g = ld(d) | 0; if ((g | 0) == -1) { h = v(8) | 0; md(h); x(h | 0, 2784, 8); } d = nd(d) | 0; a: do if (!d) switch (g | 0) { case 0: { g = eq(4788) | 0; xd(g); wd(a, b, g); break a } case 1: { g = eq(5116) | 0; zd(g); yd(a, b, g); break a } case 2: { g = eq(5104) | 0; Bd(g); Ad(a, b, g); break a } case 3: { g = eq(5432) | 0; Dd(g); Cd(a, b, g); break a } default: { c[a >> 2] = 0; c[a + 4 >> 2] = 0; break a } } else { od(e, b); pd(c[e >> 2] | 0); if ((g | 2 | 0) == 3) qd(c[e >> 2] | 0); if ((g | 1 | 0) == 3) rd(c[e >> 2] | 0); g = c[e >> 2] | 0; td(f, d); sd(g, f); ud(f); c[a >> 2] = c[e >> 2]; g = e + 4 | 0; c[a + 4 >> 2] = c[g >> 2]; c[e >> 2] = 0; c[g >> 2] = 0; vd(e); } while (0); V = h; return } function fd(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 4576; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; gd(a, e); V = d; return } function gd(a, b) { a = a | 0; b = b | 0; return } function hd(a) { a = a | 0; pq(a); jp(a); return } function id(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) { rc(a); jp(a); } return } function jd(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 7983 ? a + 12 | 0 : 0) | 0 } function kd(a) { a = a | 0; Da(a, 16); return } function ld(a) { a = a | 0; var b = 0, d = 0; b = (c[a + 4 >> 2] | 0) - (c[a >> 2] | 0) | 0; a: do if (((b | 0) != 0 ? (d = ((b | 0) / 12 | 0) + (((nd(a) | 0) != 0) << 31 >> 31) | 0, (d | 0) != 0) : 0) ? (b = c[a >> 2] | 0, !(Ed(b, Fd() | 0) | 0)) : 0) { switch (d | 0) { case 1: { a = 0; break a } case 2: { if (Gd((c[a >> 2] | 0) + 12 | 0, Hd() | 0) | 0) { a = 1; break a } if (Gd((c[a >> 2] | 0) + 12 | 0, Id() | 0) | 0) { a = 2; break a } break } case 3: { if (Gd((c[a >> 2] | 0) + 12 | 0, Hd() | 0) | 0 ? (d = (c[a >> 2] | 0) + 24 | 0, Gd(d, Id() | 0) | 0) : 0) { a = 3; break a } break } default: {} } a = -1; } else a = -1; while (0); return a | 0 } function md(a) { a = a | 0; xq(a, 8131); c[a >> 2] = 4604; return } function nd(a) { a = a | 0; var b = 0, d = 0; b = c[a + 4 >> 2] | 0; if (((b | 0) != (c[a >> 2] | 0) ? (d = b, (c[d + -12 >> 2] | 0) == 0) : 0) ? (c[d + -4 >> 2] | 0) == 2 : 0) a = c[d + -8 >> 2] | 0; else a = 0; return a | 0 } function od(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0; d = V; V = V + 16 | 0; e = d + 4 | 0; g = d; f = eq(24) | 0; Kd(f, b); c[g >> 2] = 0; c[e >> 2] = c[g >> 2]; Ld(a, f, e); V = d; return } function pd(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0; j = V; V = V + 32 | 0; e = j + 12 | 0; f = j; b = j + 8 | 0; h = eq(4792) | 0; Zd(h, c[a + 4 >> 2] | 0); g = a + 8 | 0; c[b >> 2] = 0; c[e >> 2] = c[b >> 2]; _d(f, h, e); h = a + 12 | 0; b = c[h >> 2] | 0; i = a + 16 | 0; do if (b >>> 0 >= (c[i >> 2] | 0) >>> 0) { b = (b - (c[g >> 2] | 0) >> 3) + 1 | 0; d = ee(g) | 0; if (d >>> 0 < b >>> 0) cr(g); else { k = c[g >> 2] | 0; l = (c[i >> 2] | 0) - k | 0; i = l >> 2; be(e, l >> 3 >>> 0 < d >>> 1 >>> 0 ? (i >>> 0 < b >>> 0 ? b : i) : d, (c[h >> 2] | 0) - k >> 3, a + 16 | 0); i = e + 8 | 0; h = c[i >> 2] | 0; c[h >> 2] = c[f >> 2]; a = f + 4 | 0; c[h + 4 >> 2] = c[a >> 2]; c[f >> 2] = 0; c[a >> 2] = 0; c[i >> 2] = h + 8; ce(g, e); de(e); break } } else { $d(e, g, 1); l = e + 4 | 0; k = c[l >> 2] | 0; c[k >> 2] = c[f >> 2]; i = f + 4 | 0; c[k + 4 >> 2] = c[i >> 2]; c[f >> 2] = 0; c[i >> 2] = 0; c[l >> 2] = k + 8; ae(e); } while (0); Sd(f); V = j; return } function qd(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0; j = V; V = V + 32 | 0; e = j + 12 | 0; f = j; b = j + 8 | 0; h = eq(336) | 0; af(h, c[a + 4 >> 2] | 0); g = a + 8 | 0; c[b >> 2] = 0; c[e >> 2] = c[b >> 2]; bf(f, h, e); h = a + 12 | 0; b = c[h >> 2] | 0; i = a + 16 | 0; do if (b >>> 0 >= (c[i >> 2] | 0) >>> 0) { b = (b - (c[g >> 2] | 0) >> 3) + 1 | 0; d = ee(g) | 0; if (d >>> 0 < b >>> 0) cr(g); else { k = c[g >> 2] | 0; l = (c[i >> 2] | 0) - k | 0; i = l >> 2; be(e, l >> 3 >>> 0 < d >>> 1 >>> 0 ? (i >>> 0 < b >>> 0 ? b : i) : d, (c[h >> 2] | 0) - k >> 3, a + 16 | 0); i = e + 8 | 0; h = c[i >> 2] | 0; c[h >> 2] = c[f >> 2]; a = f + 4 | 0; c[h + 4 >> 2] = c[a >> 2]; c[f >> 2] = 0; c[a >> 2] = 0; c[i >> 2] = h + 8; ce(g, e); de(e); break } } else { $d(e, g, 1); l = e + 4 | 0; k = c[l >> 2] | 0; c[k >> 2] = c[f >> 2]; i = f + 4 | 0; c[k + 4 >> 2] = c[i >> 2]; c[f >> 2] = 0; c[i >> 2] = 0; c[l >> 2] = k + 8; ae(e); } while (0); Sd(f); V = j; return } function rd(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0; j = V; V = V + 32 | 0; e = j + 12 | 0; f = j; b = j + 8 | 0; h = eq(324) | 0; Af(h, c[a + 4 >> 2] | 0); g = a + 8 | 0; c[b >> 2] = 0; c[e >> 2] = c[b >> 2]; Bf(f, h, e); h = a + 12 | 0; b = c[h >> 2] | 0; i = a + 16 | 0; do if (b >>> 0 >= (c[i >> 2] | 0) >>> 0) { b = (b - (c[g >> 2] | 0) >> 3) + 1 | 0; d = ee(g) | 0; if (d >>> 0 < b >>> 0) cr(g); else { k = c[g >> 2] | 0; l = (c[i >> 2] | 0) - k | 0; i = l >> 2; be(e, l >> 3 >>> 0 < d >>> 1 >>> 0 ? (i >>> 0 < b >>> 0 ? b : i) : d, (c[h >> 2] | 0) - k >> 3, a + 16 | 0); i = e + 8 | 0; h = c[i >> 2] | 0; c[h >> 2] = c[f >> 2]; a = f + 4 | 0; c[h + 4 >> 2] = c[a >> 2]; c[f >> 2] = 0; c[a >> 2] = 0; c[i >> 2] = h + 8; ce(g, e); de(e); break } } else { $d(e, g, 1); l = e + 4 | 0; k = c[l >> 2] | 0; c[k >> 2] = c[f >> 2]; i = f + 4 | 0; c[k + 4 >> 2] = c[i >> 2]; c[f >> 2] = 0; c[i >> 2] = 0; c[l >> 2] = k + 8; ae(e); } while (0); Sd(f); V = j; return } function sd(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0; j = V; V = V + 32 | 0; h = j + 12 | 0; i = j; e = j + 8 | 0; g = eq(64) | 0; Qf(g, c[a + 4 >> 2] | 0, b); f = a + 8 | 0; c[e >> 2] = 0; c[h >> 2] = c[e >> 2]; Rf(i, g, h); g = a + 12 | 0; b = c[g >> 2] | 0; e = a + 16 | 0; do if (b >>> 0 >= (c[e >> 2] | 0) >>> 0) { b = (b - (c[f >> 2] | 0) >> 3) + 1 | 0; d = ee(f) | 0; if (d >>> 0 < b >>> 0) cr(f); else { k = c[f >> 2] | 0; l = (c[e >> 2] | 0) - k | 0; e = l >> 2; be(h, l >> 3 >>> 0 < d >>> 1 >>> 0 ? (e >>> 0 < b >>> 0 ? b : e) : d, (c[g >> 2] | 0) - k >> 3, a + 16 | 0); a = h + 8 | 0; g = c[a >> 2] | 0; c[g >> 2] = c[i >> 2]; e = i + 4 | 0; c[g + 4 >> 2] = c[e >> 2]; c[i >> 2] = 0; c[e >> 2] = 0; c[a >> 2] = g + 8; ce(f, h); de(h); break } } else { $d(h, f, 1); l = h + 4 | 0; k = c[l >> 2] | 0; c[k >> 2] = c[i >> 2]; a = i + 4 | 0; c[k + 4 >> 2] = c[a >> 2]; c[i >> 2] = 0; c[a >> 2] = 0; c[l >> 2] = k + 8; ae(h); } while (0); Sd(i); V = j; return } function td(b, d) { b = b | 0; d = d | 0; var e = 0, f = 0; e = V; V = V + 48 | 0; f = e; c[b >> 2] = d; a[b + 4 >> 0] = 0; Jg(b + 8 | 0, d); Jg(b + 20 | 0, d); Oc(f, 256, 0, 0); Kg(b + 32 | 0, d, f); Ic(f); V = e; return } function ud(a) { a = a | 0; Ng(a + 32 | 0); _f(a + 20 | 0); _f(a + 8 | 0); return } function vd(a) { a = a | 0; var b = 0, d = 0; a = c[a + 4 >> 2] | 0; if (a | 0 ? (d = a + 4 | 0, b = c[d >> 2] | 0, c[d >> 2] = b + -1, (b | 0) == 0) : 0) { ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); qq(a); } return } function wd(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0, g = 0, h = 0; e = V; V = V + 16 | 0; f = e + 4 | 0; h = e; g = eq(12) | 0; Og(g, b, d); c[h >> 2] = 0; c[f >> 2] = c[h >> 2]; Pg(a, g, f); V = e; return } function xd(a) { a = a | 0; ge(a); $g(a + 4784 | 0); return } function yd(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0, g = 0, h = 0; e = V; V = V + 16 | 0; f = e + 4 | 0; h = e; g = eq(12) | 0; ah(g, b, d); c[h >> 2] = 0; c[f >> 2] = c[h >> 2]; bh(a, g, f); V = e; return } function zd(a) { a = a | 0; ge(a); nh(a + 4784 | 0); return } function Ad(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0, g = 0, h = 0; e = V; V = V + 16 | 0; f = e + 4 | 0; h = e; g = eq(12) | 0; oh(g, b, d); c[h >> 2] = 0; c[f >> 2] = c[h >> 2]; ph(a, g, f); V = e; return } function Bd(a) { a = a | 0; ge(a); Bh(a + 4784 | 0); return } function Cd(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0, g = 0, h = 0; e = V; V = V + 16 | 0; f = e + 4 | 0; h = e; g = eq(12) | 0; Ch(g, b, d); c[h >> 2] = 0; c[f >> 2] = c[h >> 2]; Dh(a, g, f); V = e; return } function Dd(a) { a = a | 0; ge(a); Ph(a + 4784 | 0); return } function Ed(a, b) { a = a | 0; b = b | 0; return (Gd(a, b) | 0) ^ 1 | 0 } function Fd() { if ((a[21456] | 0) == 0 ? Tp(21456) | 0 : 0) { _b(21536, 6, 20, 2); $p(21456); } return 21536 } function Gd(a, b) { a = a | 0; b = b | 0; if ((c[a >> 2] | 0) == (c[b >> 2] | 0) ? (c[a + 8 >> 2] | 0) == (c[b + 8 >> 2] | 0) : 0) a = (c[a + 4 >> 2] | 0) == (c[b + 4 >> 2] | 0); else a = 0; return a | 0 } function Hd() { if ((a[21464] | 0) == 0 ? Tp(21464) | 0 : 0) { _b(21548, 7, 8, 2); $p(21464); } return 21548 } function Id() { if ((a[21472] | 0) == 0 ? Tp(21472) | 0 : 0) { _b(21560, 8, 6, 2); $p(21472); } return 21560 } function Jd(a) { a = a | 0; yp(a); jp(a); return } function Kd(b, d) { b = b | 0; d = d | 0; Md(b); c[b >> 2] = 4624; c[b + 4 >> 2] = d; c[b + 8 >> 2] = 0; c[b + 12 >> 2] = 0; c[b + 16 >> 2] = 0; a[b + 20 >> 0] = 1; return } function Ld(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 4664; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Ud(a, e); V = d; return } function Md(a) { a = a | 0; c[a >> 2] = 4644; return } function Nd(b, d) { b = b | 0; d = d | 0; var e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0; k = V; V = V + 16 | 0; h = k; e = c[b + 8 >> 2] | 0; i = c[b + 12 >> 2] | 0; if ((e | 0) != (i | 0)) { j = h + 4 | 0; do { f = c[e >> 2] | 0; c[h >> 2] = f; g = c[e + 4 >> 2] | 0; c[j >> 2] = g; if (g | 0) { g = g + 4 | 0; c[g >> 2] = (c[g >> 2] | 0) + 1; } d = $[c[(c[f >> 2] | 0) + 12 >> 2] & 63](f, d) | 0; Sd(h); e = e + 8 | 0; } while ((e | 0) != (i | 0)) } e = b + 20 | 0; if (a[e >> 0] | 0) { a[e >> 0] = 0; nc(c[b + 4 >> 2] | 0); } V = k; return d | 0 } function Od(a) { a = a | 0; c[a >> 2] = 4624; Td(a + 8 | 0); Qd(a); return } function Pd(a) { a = a | 0; Od(a); jp(a); return } function Qd(a) { a = a | 0; return } function Rd(a) { a = a | 0; U(); } function Sd(a) { a = a | 0; var b = 0, d = 0; a = c[a + 4 >> 2] | 0; if (a | 0 ? (d = a + 4 | 0, b = c[d >> 2] | 0, c[d >> 2] = b + -1, (b | 0) == 0) : 0) { ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); qq(a); } return } function Td(a) { a = a | 0; var b = 0, d = 0, e = 0; d = c[a >> 2] | 0; if (d | 0) { e = a + 4 | 0; b = c[e >> 2] | 0; if ((b | 0) == (d | 0)) b = d; else { do { b = b + -8 | 0; Sd(b); } while ((b | 0) != (d | 0)); b = c[a >> 2] | 0; } c[e >> 2] = d; Da(b, (c[a + 8 >> 2] | 0) - b | 0); } return } function Ud(a, b) { a = a | 0; b = b | 0; return } function Vd(a) { a = a | 0; pq(a); jp(a); return } function Wd(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); return } function Xd(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 8546 ? a + 12 | 0 : 0) | 0 } function Yd(a) { a = a | 0; Da(a, 16); return } function Zd(a, b) { a = a | 0; b = b | 0; fe(a); c[a >> 2] = 4692; c[a + 4 >> 2] = b; ge(a + 8 | 0); return } function _d(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 4740; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Xe(a, e); V = d; return } function $d(a, b, d) { a = a | 0; b = b | 0; d = d | 0; c[a >> 2] = b; b = c[b + 4 >> 2] | 0; c[a + 4 >> 2] = b; c[a + 8 >> 2] = b + (d << 3); return } function ae(a) { a = a | 0; c[(c[a >> 2] | 0) + 4 >> 2] = c[a + 4 >> 2]; return } function be(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; var f = 0; f = a + 12 | 0; c[f >> 2] = 0; c[a + 16 >> 2] = e; do if (b) if (b >>> 0 > 536870911) { f = v(8) | 0; vq(f, 6723); c[f >> 2] = 5956; x(f | 0, 3928, 123); } else { e = eq(b << 3) | 0; break } else e = 0; while (0); c[a >> 2] = e; d = e + (d << 3) | 0; c[a + 8 >> 2] = d; c[a + 4 >> 2] = d; c[f >> 2] = e + (b << 3); return } function ce(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0; i = c[a >> 2] | 0; j = a + 4 | 0; d = c[j >> 2] | 0; h = b + 4 | 0; if ((d | 0) == (i | 0)) { f = h; g = a; e = c[h >> 2] | 0; d = i; } else { e = c[h >> 2] | 0; do { g = d; d = d + -8 | 0; c[e + -8 >> 2] = c[d >> 2]; g = g + -4 | 0; c[e + -4 >> 2] = c[g >> 2]; c[d >> 2] = 0; c[g >> 2] = 0; e = (c[h >> 2] | 0) + -8 | 0; c[h >> 2] = e; } while ((d | 0) != (i | 0)); f = h; g = a; d = c[a >> 2] | 0; } c[g >> 2] = e; c[f >> 2] = d; i = b + 8 | 0; h = c[j >> 2] | 0; c[j >> 2] = c[i >> 2]; c[i >> 2] = h; i = a + 8 | 0; j = b + 12 | 0; a = c[i >> 2] | 0; c[i >> 2] = c[j >> 2]; c[j >> 2] = a; c[b >> 2] = c[f >> 2]; return } function de(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0; d = c[a + 4 >> 2] | 0; e = a + 8 | 0; b = c[e >> 2] | 0; if ((b | 0) != (d | 0)) do { f = b + -8 | 0; c[e >> 2] = f; Sd(f); b = c[e >> 2] | 0; } while ((b | 0) != (d | 0)); b = c[a >> 2] | 0; if (b | 0) Da(b, (c[a + 12 >> 2] | 0) - b | 0); return } function ee(a) { a = a | 0; return 536870911 } function fe(a) { a = a | 0; c[a >> 2] = 4716; return } function ge(b) { b = b | 0; oe(b); pe(b + 3980 | 0); qe(b + 4380 | 0); a[b + 4780 >> 0] = 0; a[b + 4781 >> 0] = 0; return } function he(a) { a = a | 0; c[a >> 2] = 4692; ze(a + 8 | 0); le(a); return } function ie(a) { a = a | 0; he(a); jp(a); return } function je(a, b) { a = a | 0; b = b | 0; return b | 0 } function ke(a, b) { a = a | 0; b = b | 0; return Be(a + 8 | 0, c[a + 4 >> 2] | 0, b) | 0 } function le(a) { a = a | 0; return } function me(a) { a = a | 0; le(a); jp(a); return } function ne(a, b) { a = a | 0; b = b | 0; return b | 0 } function oe(d) { d = d | 0; var e = 0, f = 0; te(d); ue(d + 52 | 0); ue(d + 436 | 0); Oc(d + 852 | 0, 64, 0, 0); a[d + 3976 >> 0] = 0; e = d + 20 | 0; f = e + 32 | 0; do { b[e >> 1] = 0; e = e + 2 | 0; } while ((e | 0) < (f | 0)); e = eq(44) | 0; Oc(e, 256, 0, 0); c[d + 896 >> 2] = e; e = eq(44) | 0; Oc(e, 256, 0, 0); c[d + 900 >> 2] = e; e = d + 820 | 0; c[e >> 2] = 0; c[e + 4 >> 2] = 0; c[e + 8 >> 2] = 0; c[e + 12 >> 2] = 0; c[e + 16 >> 2] = 0; c[e + 20 >> 2] = 0; c[e + 24 >> 2] = 0; c[e + 28 >> 2] = 0; e = 0; do { f = eq(44) | 0; Oc(f, 256, 0, 0); c[d + 904 + (e << 2) >> 2] = f; f = eq(44) | 0; Oc(f, 256, 0, 0); c[d + 1928 + (e << 2) >> 2] = f; f = eq(44) | 0; Oc(f, 256, 0, 0); c[d + 2952 + (e << 2) >> 2] = f; e = e + 1 | 0; } while (e >>> 0 < 256); return } function pe(a) { a = a | 0; xe(a, 16, 4, 8, 0); xe(a + 80 | 0, 16, 1, 8, 0); xe(a + 160 | 0, 32, 2, 8, 0); xe(a + 240 | 0, 32, 22, 8, 0); xe(a + 320 | 0, 32, 20, 8, 0); return } function qe(a) { a = a | 0; mc(a, 16, 4, 8, 0); mc(a + 80 | 0, 16, 1, 8, 0); mc(a + 160 | 0, 32, 2, 8, 0); mc(a + 240 | 0, 32, 22, 8, 0); mc(a + 320 | 0, 32, 20, 8, 0); return } function re(a) { a = a | 0; ye(a + 320 | 0); ye(a + 240 | 0); ye(a + 160 | 0); ye(a + 80 | 0); ye(a); return } function se(a) { a = a | 0; var b = 0, d = 0; b = c[a + 896 >> 2] | 0; if (b | 0) { Ic(b); jp(b); } b = c[a + 900 >> 2] | 0; if (b | 0) { Ic(b); jp(b); } d = 0; do { b = c[a + 904 + (d << 2) >> 2] | 0; if (b | 0) { Ic(b); jp(b); } b = c[a + 1928 + (d << 2) >> 2] | 0; if (b | 0) { Ic(b); jp(b); } b = c[a + 2952 + (d << 2) >> 2] | 0; if (b | 0) { Ic(b); jp(b); } d = d + 1 | 0; } while ((d | 0) != 256); Ic(a + 852 | 0); return } function te(b) { b = b | 0; var c = 0; a[b >> 0] = 0; a[b + 1 >> 0] = 0; a[b + 2 >> 0] = 0; a[b + 3 >> 0] = 0; c = b + 4 | 0; a[c >> 0] = 0; a[c + 1 >> 0] = 0; a[c + 2 >> 0] = 0; a[c + 3 >> 0] = 0; b = b + 12 | 0; c = b; a[c >> 0] = 0; a[c + 1 >> 0] = 0; a[c + 2 >> 0] = 0; a[c + 3 >> 0] = 0; b = b + 4 | 0; a[b >> 0] = 0; a[b + 1 >> 0] = 0; a[b + 2 >> 0] = 0; a[b + 3 >> 0] = 0; return } function ue(a) { a = a | 0; var b = 0; b = a + 384 | 0; do { ve(a); a = a + 24 | 0; } while ((a | 0) != (b | 0)); return } function ve(a) { a = a | 0; we(a); return } function we(b) { b = b | 0; c[b >> 2] = 0; c[b + 4 >> 2] = 0; c[b + 8 >> 2] = 0; c[b + 12 >> 2] = 0; c[b + 16 >> 2] = 0; a[b + 20 >> 0] = 1; return } function xe(a, b, d, e, f) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; f = f | 0; var g = 0; c[a + 4 >> 2] = b; c[a + 8 >> 2] = d; c[a + 12 >> 2] = e; c[a + 16 >> 2] = f; c[a + 36 >> 2] = 0; c[a + 40 >> 2] = 0; c[a + 44 >> 2] = 0; Gc(a + 48 | 0); c[a + 68 >> 2] = 0; c[a + 72 >> 2] = 0; c[a + 76 >> 2] = 0; do if (!f) { d = a + 20 | 0; if ((b + -1 | 0) >>> 0 < 31) { c[d >> 2] = b; f = 1 << b; c[a + 24 >> 2] = f; d = f >>> 1; c[a + 28 >> 2] = 0 - d; d = f + -1 - d | 0; break } else { c[d >> 2] = 32; c[a + 24 >> 2] = 0; c[a + 28 >> 2] = -2147483648; d = 2147483647; break } } else { e = a + 20 | 0; c[e >> 2] = 0; c[a + 24 >> 2] = f; d = f; g = 0; while (1) { d = d >>> 1; b = g + 1 | 0; if (!d) break; else g = b; } c[e >> 2] = (1 << g | 0) == (f | 0) ? g : b; d = f >>> 1; c[a + 28 >> 2] = 0 - d; d = f + -1 - d | 0; } while (0); c[a + 32 >> 2] = d; c[a >> 2] = 0; return } function ye(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0; g = a + 36 | 0; d = c[g >> 2] | 0; e = a + 40 | 0; b = c[e >> 2] | 0; if ((b | 0) != (d | 0)) do { b = b + -44 | 0; Ic(b); } while ((b | 0) != (d | 0)); c[e >> 2] = d; e = a + 68 | 0; f = c[e >> 2] | 0; d = a + 72 | 0; b = c[d >> 2] | 0; if ((b | 0) != (f | 0)) do { b = b + -44 | 0; Ic(b); } while ((b | 0) != (f | 0)); c[d >> 2] = f; Hc(e); Hc(g); return } function ze(a) { a = a | 0; Ae(a + 4380 | 0); re(a + 3980 | 0); se(a); return } function Ae(a) { a = a | 0; qc(a + 320 | 0); qc(a + 240 | 0); qc(a + 160 | 0); qc(a + 80 | 0); qc(a); return } function Be(f, g, h) { f = f | 0; g = g | 0; h = h | 0; var i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, q = 0; p = V; V = V + 32 | 0; o = p; i = f + 4781 | 0; if (!(a[i >> 0] | 0)) { Ce(f + 4380 | 0); a[i >> 0] = 1; } i = f + 3976 | 0; if (!(a[i >> 0] | 0)) { a[i >> 0] = 1; Ee(De(g) | 0, h, 20); Fe(o, h); k = f; i = o; j = k + 20 | 0; do { a[k >> 0] = a[i >> 0] | 0; k = k + 1 | 0; i = i + 1 | 0; } while ((k | 0) < (j | 0)); b[f + 12 >> 1] = 0; } else { m = Zc(g, f + 852 | 0) | 0; if (m) { if (m & 32 | 0) He((Zc(g, c[f + 904 + (((Ge(f) | 0) & 255) << 2) >> 2] | 0) | 0) & 255, f); n = f + 14 | 0; k = a[n >> 0] | 0; i = k & 7; k = (k & 255) >>> 3 & 7; j = d[16 + (k << 3) + i >> 0] | 0; i = d[80 + (k << 3) + i >> 0] | 0; if (!(m & 16)) l = b[f + 20 + (j << 1) >> 1] | 0; else { q = f + 20 + (j << 1) | 0; l = (pc(f + 4380 | 0, g, e[q >> 1] | 0, j >>> 0 < 3 ? j : 3) | 0) & 65535; b[q >> 1] = l; } b[f + 12 >> 1] = l; if (m & 8 | 0) { q = f + 15 | 0; a[q >> 0] = Zc(g, c[f + 1928 + (d[q >> 0] << 2) >> 2] | 0) | 0; } if (m & 4 | 0) { n = Zc(g, c[f + 896 + (((d[n >> 0] | 0) >>> 6 & 1) << 2) >> 2] | 0) | 0; q = f + 16 | 0; a[q >> 0] = Ie(n + (a[q >> 0] | 0) | 0) | 0; } if (m & 2 | 0) { q = f + 17 | 0; a[q >> 0] = Zc(g, c[f + 2952 + (d[q >> 0] << 2) >> 2] | 0) | 0; } if (m & 1) { q = f + 18 | 0; b[q >> 1] = pc(f + 4460 | 0, g, e[q >> 1] | 0, 0) | 0; } } else { q = a[f + 14 >> 0] | 0; i = q & 7; q = (q & 255) >>> 3 & 7; k = q; j = d[16 + (q << 3) + i >> 0] | 0; i = d[80 + (q << 3) + i >> 0] | 0; } l = f + 52 + (j * 24 | 0) | 0; m = f + 4540 | 0; n = (k | 0) == 1 & 1; k = pc(m, g, Je(l) | 0, n) | 0; c[o >> 2] = k; c[f >> 2] = (c[f >> 2] | 0) + k; Ke(l, o); l = f + 436 + (j * 24 | 0) | 0; k = Je(l) | 0; j = Le(m) | 0; q = f + 4620 | 0; j = pc(q, g, k, (j >>> 0 < 20 ? j & -2 : 20) | n) | 0; c[o >> 2] = j; k = f + 4 | 0; c[k >> 2] = (c[k >> 2] | 0) + j; Ke(l, o); o = Le(m) | 0; o = (Le(q) | 0) + o | 0; q = f + 820 + (i << 2) | 0; o = pc(f + 4700 | 0, g, c[q >> 2] | 0, (o >>> 0 < 36 ? o >>> 1 & 2147483646 : 18) | n) | 0; c[f + 8 >> 2] = o; c[q >> 2] = o; Me(f, h); } V = p; return h + 20 | 0 } function Ce(a) { a = a | 0; oc(a); oc(a + 80 | 0); oc(a + 160 | 0); oc(a + 240 | 0); oc(a + 320 | 0); return } function De(a) { a = a | 0; return c[a >> 2] | 0 } function Ee(b, d, e) { b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0, i = 0, j = 0, k = 0; k = b + 4 | 0; f = c[k >> 2] | 0; j = (c[b + 8 >> 2] | 0) - f | 0; j = j >>> 0 > e >>> 0 ? e : j; i = b + 12 | 0; g = (c[i >> 2] | 0) + f | 0; h = g + j | 0; if (j) { f = g; g = d; while (1) { a[g >> 0] = a[f >> 0] | 0; f = f + 1 | 0; if ((f | 0) == (h | 0)) break; else g = g + 1 | 0; } f = c[k >> 2] | 0; } c[k >> 2] = f + j; e = e - j | 0; if (e | 0) { Kc(b); g = (c[i >> 2] | 0) + (c[k >> 2] | 0) | 0; h = g + e | 0; f = d + j | 0; while (1) { a[f >> 0] = a[g >> 0] | 0; g = g + 1 | 0; if ((g | 0) == (h | 0)) break; else f = f + 1 | 0; } c[k >> 2] = (c[k >> 2] | 0) + e; } return } function Fe(d, e) { d = d | 0; e = e | 0; te(d); c[d >> 2] = Ne(e) | 0; c[d + 4 >> 2] = Ne(e + 4 | 0) | 0; c[d + 8 >> 2] = Ne(e + 8 | 0) | 0; b[d + 12 >> 1] = Oe(e + 12 | 0) | 0; He(Pe(e + 14 | 0) | 0, d); a[d + 15 >> 0] = Pe(e + 15 | 0) | 0; a[d + 16 >> 0] = Qe(e + 16 | 0) | 0; a[d + 17 >> 0] = Qe(e + 17 | 0) | 0; b[d + 18 >> 1] = Oe(e + 18 | 0) | 0; return } function Ge(b) { b = b | 0; return a[b + 14 >> 0] | 0 } function He(b, c) { b = b | 0; c = c | 0; a[c + 14 >> 0] = b; return } function Ie(a) { a = a | 0; return a & 255 | 0 } function Je(a) { a = a | 0; return c[a + 8 >> 2] | 0 } function Ke(b, d) { b = b | 0; d = d | 0; var e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0; k = b + 20 | 0; do if (!(a[k >> 0] | 0)) { j = b + 8 | 0; e = c[j >> 2] | 0; f = c[d >> 2] | 0; g = b + 4 | 0; h = c[g >> 2] | 0; if ((e | 0) >= (f | 0)) { if ((h | 0) < (f | 0)) { c[b >> 2] = h; c[g >> 2] = c[d >> 2]; } else c[b >> 2] = f; a[k >> 0] = 1; break } c[b >> 2] = h; c[g >> 2] = e; g = b + 16 | 0; h = c[g >> 2] | 0; i = c[d >> 2] | 0; e = b + 12 | 0; f = c[e >> 2] | 0; if ((h | 0) < (i | 0)) { c[j >> 2] = f; c[e >> 2] = h; c[g >> 2] = c[d >> 2]; break } if ((f | 0) < (i | 0)) { c[j >> 2] = f; c[e >> 2] = c[d >> 2]; break } else { c[j >> 2] = i; break } } else { g = c[d >> 2] | 0; i = b + 8 | 0; e = c[i >> 2] | 0; h = b + 12 | 0; f = c[h >> 2] | 0; if ((g | 0) >= (e | 0)) { e = b + 16 | 0; if ((g | 0) < (f | 0)) { c[e >> 2] = f; c[h >> 2] = c[d >> 2]; } else c[e >> 2] = g; a[k >> 0] = 0; break } c[b + 16 >> 2] = f; c[h >> 2] = e; e = c[d >> 2] | 0; f = c[b >> 2] | 0; g = b + 4 | 0; h = c[g >> 2] | 0; if ((e | 0) < (f | 0)) { c[i >> 2] = h; c[g >> 2] = f; c[b >> 2] = c[d >> 2]; break } if ((e | 0) < (h | 0)) { c[i >> 2] = h; c[g >> 2] = c[d >> 2]; break } else { c[i >> 2] = e; break } } while (0); return } function Le(a) { a = a | 0; return c[a >> 2] | 0 } function Me(b, c) { b = b | 0; c = c | 0; var e = 0; Se(d[b >> 0] | d[b + 1 >> 0] << 8 | d[b + 2 >> 0] << 16 | d[b + 3 >> 0] << 24, c); e = b + 4 | 0; Se(d[e >> 0] | d[e + 1 >> 0] << 8 | d[e + 2 >> 0] << 16 | d[e + 3 >> 0] << 24, c + 4 | 0); e = b + 8 | 0; Se(d[e >> 0] | d[e + 1 >> 0] << 8 | d[e + 2 >> 0] << 16 | d[e + 3 >> 0] << 24, c + 8 | 0); e = b + 12 | 0; Te(d[e >> 0] | d[e + 1 >> 0] << 8, c + 12 | 0); Ue(Ge(b) | 0, c + 14 | 0); Ue(a[b + 15 >> 0] | 0, c + 15 | 0); Ve(a[b + 16 >> 0] | 0, c + 16 | 0); Ve(a[b + 17 >> 0] | 0, c + 17 | 0); b = b + 18 | 0; Te(d[b >> 0] | d[b + 1 >> 0] << 8, c + 18 | 0); return } function Ne(a) { a = a | 0; return Re(a) | 0 } function Oe(b) { b = b | 0; return (a[b + 1 >> 0] << 8 | d[b >> 0]) & 65535 | 0 } function Pe(b) { b = b | 0; return a[b >> 0] | 0 } function Qe(b) { b = b | 0; return a[b >> 0] | 0 } function Re(a) { a = a | 0; return (d[a + 1 >> 0] | 0) << 8 | (d[a >> 0] | 0) | (d[a + 2 >> 0] | 0) << 16 | (d[a + 3 >> 0] | 0) << 24 | 0 } function Se(a, b) { a = a | 0; b = b | 0; We(a, b); return } function Te(b, c) { b = b | 0; c = c | 0; a[c + 1 >> 0] = (b & 65535) >>> 8; a[c >> 0] = b; return } function Ue(b, c) { b = b | 0; c = c | 0; a[c >> 0] = b; return } function Ve(b, c) { b = b | 0; c = c | 0; a[c >> 0] = b; return } function We(b, c) { b = b | 0; c = c | 0; a[c + 3 >> 0] = b >>> 24; a[c + 2 >> 0] = b >>> 16; a[c + 1 >> 0] = b >>> 8; a[c >> 0] = b; return } function Xe(a, b) { a = a | 0; b = b | 0; return } function Ye(a) { a = a | 0; pq(a); jp(a); return } function Ze(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 4 >> 2] & 255](a); return } function _e(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 9202 ? a + 12 | 0 : 0) | 0 } function $e(a) { a = a | 0; Da(a, 16); return } function af(a, b) { a = a | 0; b = b | 0; fe(a); c[a >> 2] = 4768; c[a + 4 >> 2] = b; cf(a + 8 | 0); return } function bf(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 4792; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Xe(a, e); V = d; return } function cf(b) { b = b | 0; gf(b); hf(b + 164 | 0); jf(b + 244 | 0); a[b + 324 >> 0] = 0; a[b + 325 >> 0] = 0; return } function df(a) { a = a | 0; c[a >> 2] = 4768; of (a + 8 | 0); le(a); return } function ef(a) { a = a | 0; df(a); jp(a); return } function ff(a, b) { a = a | 0; b = b | 0; return qf(a + 8 | 0, c[a + 4 >> 2] | 0, b) | 0 } function gf(b) { b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0; h = V; V = V + 16 | 0; f = h; a[b >> 0] = 0; Oc(b + 4 | 0, 516, 0, 0); Oc(b + 48 | 0, 6, 0, 0); c[b + 92 >> 2] = 0; c[b + 96 >> 2] = 0; e = b + 100 | 0; mf(e); nf(f); g = c[f >> 2] | 0; f = c[f + 4 >> 2] | 0; d = 4; while (1) { i = e; j = i; a[j >> 0] = g; a[j + 1 >> 0] = g >> 8; a[j + 2 >> 0] = g >> 16; a[j + 3 >> 0] = g >> 24; i = i + 4 | 0; a[i >> 0] = f; a[i + 1 >> 0] = f >> 8; a[i + 2 >> 0] = f >> 16; a[i + 3 >> 0] = f >> 24; d = d + -1 | 0; if (!d) break; else e = e + 8 | 0; } j = b + 132 | 0; c[j >> 2] = 0; c[j + 4 >> 2] = 0; c[j + 8 >> 2] = 0; c[j + 12 >> 2] = 0; c[j + 16 >> 2] = 0; c[j + 20 >> 2] = 0; c[j + 24 >> 2] = 0; c[j + 28 >> 2] = 0; V = h; return } function hf(a) { a = a | 0; xe(a, 32, 9, 8, 0); return } function jf(a) { a = a | 0; mc(a, 32, 9, 8, 0); return } function kf(a) { a = a | 0; ye(a); return } function lf(a) { a = a | 0; Ic(a + 48 | 0); Ic(a + 4 | 0); return } function mf(a) { a = a | 0; var b = 0; b = a + 32 | 0; do { nf(a); a = a + 8 | 0; } while ((a | 0) != (b | 0)); return } function nf(b) { b = b | 0; var c = 0; c = b; a[c >> 0] = 0; a[c + 1 >> 0] = 0; a[c + 2 >> 0] = 0; a[c + 3 >> 0] = 0; b = b + 4 | 0; a[b >> 0] = 0; a[b + 1 >> 0] = 0; a[b + 2 >> 0] = 0; a[b + 3 >> 0] = 0; return } function of (a) { a = a | 0; pf(a + 244 | 0); kf(a + 164 | 0); lf(a); return } function pf(a) { a = a | 0; qc(a); return } function qf(b, e, f) { b = b | 0; e = e | 0; f = f | 0; var g = 0, h = 0, i = 0, j = 0, k = 0; g = b + 325 | 0; if (!(a[g >> 0] | 0)) { rf(b + 244 | 0); a[g >> 0] = 1; } if (!(a[b >> 0] | 0)) { a[b >> 0] = 1; Ee(De(e) | 0, f, 8); i = sf(f) | 0; j = u() | 0; b = b + 100 | 0; e = b; a[e >> 0] = i; a[e + 1 >> 0] = i >> 8; a[e + 2 >> 0] = i >> 16; a[e + 3 >> 0] = i >> 24; b = b + 4 | 0; a[b >> 0] = j; a[b + 1 >> 0] = j >> 8; a[b + 2 >> 0] = j >> 16; a[b + 3 >> 0] = j >> 24; } else { j = b + 92 | 0; a: do if (!(c[b + 132 + (c[j >> 2] << 2) >> 2] | 0)) { g = Zc(e, b + 48 | 0) | 0; switch (g | 0) { case 1: { e = pc(b + 244 | 0, e, 0, 0) | 0; c[b + 132 + (c[j >> 2] << 2) >> 2] = e; e = c[j >> 2] | 0; k = c[b + 132 + (e << 2) >> 2] | 0; i = b + 100 + (e << 3) | 0; h = i; g = h; h = h + 4 | 0; k = lr(d[g >> 0] | d[g + 1 >> 0] << 8 | d[g + 2 >> 0] << 16 | d[g + 3 >> 0] << 24 | 0, d[h >> 0] | d[h + 1 >> 0] << 8 | d[h + 2 >> 0] << 16 | d[h + 3 >> 0] << 24 | 0, k | 0, ((k | 0) < 0) << 31 >> 31 | 0) | 0; h = u() | 0; g = i; a[g >> 0] = k; a[g + 1 >> 0] = k >> 8; a[g + 2 >> 0] = k >> 16; a[g + 3 >> 0] = k >> 24; i = i + 4 | 0; a[i >> 0] = h; a[i + 1 >> 0] = h >> 8; a[i + 2 >> 0] = h >> 16; a[i + 3 >> 0] = h >> 24; c[b + 148 + (e << 2) >> 2] = 0; break a } case 2: { k = b + 96 | 0; c[k >> 2] = (c[k >> 2] | 0) + 1 & 3; i = b + 100 + (c[j >> 2] << 3) + 4 | 0; i = pc(b + 244 | 0, e, d[i >> 0] | d[i + 1 >> 0] << 8 | d[i + 2 >> 0] << 16 | d[i + 3 >> 0] << 24, 8) | 0; g = b + 100 + (c[k >> 2] << 3) | 0; h = g; a[h >> 0] = 0; a[h + 1 >> 0] = 0; a[h + 2 >> 0] = 0; a[h + 3 >> 0] = 0; g = g + 4 | 0; a[g >> 0] = i; a[g + 1 >> 0] = i >> 8; a[g + 2 >> 0] = i >> 16; a[g + 3 >> 0] = i >> 24; g = tf(e) | 0; k = c[k >> 2] | 0; e = b + 100 + (k << 3) | 0; i = e; h = i; i = i + 4 | 0; i = d[i >> 0] | d[i + 1 >> 0] << 8 | d[i + 2 >> 0] << 16 | d[i + 3 >> 0] << 24; g = d[h >> 0] | d[h + 1 >> 0] << 8 | d[h + 2 >> 0] << 16 | d[h + 3 >> 0] << 24 | g; h = e; a[h >> 0] = g; a[h + 1 >> 0] = g >> 8; a[h + 2 >> 0] = g >> 16; a[h + 3 >> 0] = g >> 24; e = e + 4 | 0; a[e >> 0] = i; a[e + 1 >> 0] = i >> 8; a[e + 2 >> 0] = i >> 16; a[e + 3 >> 0] = i >> 24; c[j >> 2] = k; c[b + 132 + (k << 2) >> 2] = 0; c[b + 148 + (c[j >> 2] << 2) >> 2] = 0; break a } default: { if ((g | 0) <= 2) break a; c[j >> 2] = g + 2 + (c[j >> 2] | 0) & 3; qf(b, e, f) | 0; break a } } } else { i = Zc(e, b + 4 | 0) | 0; if ((i | 0) == 1) { g = pc(b + 244 | 0, e, c[b + 132 + (c[j >> 2] << 2) >> 2] | 0, 1) | 0; k = c[j >> 2] | 0; e = b + 100 + (k << 3) | 0; i = e; h = i; i = i + 4 | 0; g = lr(d[h >> 0] | d[h + 1 >> 0] << 8 | d[h + 2 >> 0] << 16 | d[h + 3 >> 0] << 24 | 0, d[i >> 0] | d[i + 1 >> 0] << 8 | d[i + 2 >> 0] << 16 | d[i + 3 >> 0] << 24 | 0, g | 0, ((g | 0) < 0) << 31 >> 31 | 0) | 0; i = u() | 0; h = e; a[h >> 0] = g; a[h + 1 >> 0] = g >> 8; a[h + 2 >> 0] = g >> 16; a[h + 3 >> 0] = g >> 24; e = e + 4 | 0; a[e >> 0] = i; a[e + 1 >> 0] = i >> 8; a[e + 2 >> 0] = i >> 16; a[e + 3 >> 0] = i >> 24; c[b + 148 + (k << 2) >> 2] = 0; break } if ((i | 0) >= 511) { if ((i | 0) == 512) { k = b + 96 | 0; c[k >> 2] = (c[k >> 2] | 0) + 1 & 3; i = b + 100 + (c[j >> 2] << 3) + 4 | 0; i = pc(b + 244 | 0, e, d[i >> 0] | d[i + 1 >> 0] << 8 | d[i + 2 >> 0] << 16 | d[i + 3 >> 0] << 24, 8) | 0; g = b + 100 + (c[k >> 2] << 3) | 0; h = g; a[h >> 0] = 0; a[h + 1 >> 0] = 0; a[h + 2 >> 0] = 0; a[h + 3 >> 0] = 0; g = g + 4 | 0; a[g >> 0] = i; a[g + 1 >> 0] = i >> 8; a[g + 2 >> 0] = i >> 16; a[g + 3 >> 0] = i >> 24; g = tf(e) | 0; k = c[k >> 2] | 0; e = b + 100 + (k << 3) | 0; i = e; h = i; i = i + 4 | 0; i = d[i >> 0] | d[i + 1 >> 0] << 8 | d[i + 2 >> 0] << 16 | d[i + 3 >> 0] << 24; g = d[h >> 0] | d[h + 1 >> 0] << 8 | d[h + 2 >> 0] << 16 | d[h + 3 >> 0] << 24 | g; h = e; a[h >> 0] = g; a[h + 1 >> 0] = g >> 8; a[h + 2 >> 0] = g >> 16; a[h + 3 >> 0] = g >> 24; e = e + 4 | 0; a[e >> 0] = i; a[e + 1 >> 0] = i >> 8; a[e + 2 >> 0] = i >> 16; a[e + 3 >> 0] = i >> 24; c[j >> 2] = k; c[b + 132 + (k << 2) >> 2] = 0; c[b + 148 + (c[j >> 2] << 2) >> 2] = 0; break } if ((i | 0) <= 511) break; c[j >> 2] = (c[j >> 2] | 0) + i & 3; qf(b, e, f) | 0; break } do if (!i) { g = pc(b + 244 | 0, e, 0, 7) | 0; h = b + 148 + (c[j >> 2] << 2) | 0; c[h >> 2] = (c[h >> 2] | 0) + 1; h = c[j >> 2] | 0; if ((c[b + 148 + (h << 2) >> 2] | 0) > 3) { c[b + 132 + (h << 2) >> 2] = g; c[b + 148 + (c[j >> 2] << 2) >> 2] = 0; } } else { if ((i | 0) < 500) { g = b + 244 | 0; h = q(c[b + 132 + (c[j >> 2] << 2) >> 2] | 0, i) | 0; if ((i | 0) < 10) { g = pc(g, e, h, 2) | 0; break } else { g = pc(g, e, h, 3) | 0; break } } if ((i | 0) == 500) { g = pc(b + 244 | 0, e, (c[b + 132 + (c[j >> 2] << 2) >> 2] | 0) * 500 | 0, 4) | 0; h = b + 148 + (c[j >> 2] << 2) | 0; c[h >> 2] = (c[h >> 2] | 0) + 1; h = c[j >> 2] | 0; if ((c[b + 148 + (h << 2) >> 2] | 0) <= 3) break; c[b + 132 + (h << 2) >> 2] = g; c[b + 148 + (c[j >> 2] << 2) >> 2] = 0; break } g = 500 - i | 0; h = b + 244 | 0; i = c[b + 132 + (c[j >> 2] << 2) >> 2] | 0; if ((g | 0) > -10) { g = pc(h, e, q(i, g) | 0, 5) | 0; break } g = pc(h, e, q(i, -10) | 0, 6) | 0; h = b + 148 + (c[j >> 2] << 2) | 0; c[h >> 2] = (c[h >> 2] | 0) + 1; h = c[j >> 2] | 0; if ((c[b + 148 + (h << 2) >> 2] | 0) > 3) { c[b + 132 + (h << 2) >> 2] = g; c[b + 148 + (c[j >> 2] << 2) >> 2] = 0; } } while (0); k = b + 100 + (c[j >> 2] << 3) | 0; h = k; e = h; h = h + 4 | 0; h = lr(d[e >> 0] | d[e + 1 >> 0] << 8 | d[e + 2 >> 0] << 16 | d[e + 3 >> 0] << 24 | 0, d[h >> 0] | d[h + 1 >> 0] << 8 | d[h + 2 >> 0] << 16 | d[h + 3 >> 0] << 24 | 0, g | 0, ((g | 0) < 0) << 31 >> 31 | 0) | 0; e = u() | 0; i = k; a[i >> 0] = h; a[i + 1 >> 0] = h >> 8; a[i + 2 >> 0] = h >> 16; a[i + 3 >> 0] = h >> 24; k = k + 4 | 0; a[k >> 0] = e; a[k + 1 >> 0] = e >> 8; a[k + 2 >> 0] = e >> 16; a[k + 3 >> 0] = e >> 24; } while (0); uf(b + 100 + (c[j >> 2] << 3) | 0, f); } return f + 8 | 0 } function rf(a) { a = a | 0; oc(a); return } function sf(a) { a = a | 0; var b = 0, d = 0, e = 0; b = V; V = V + 16 | 0; d = b; e = Re(a) | 0; vf(d, e, Re(a + 4 | 0) | 0); a = c[d >> 2] | 0; t(c[d + 4 >> 2] | 0); V = b; return a | 0 } function tf(a) { a = a | 0; var b = 0; b = (bd(a) | 0) & 65535; return ((bd(a) | 0) & 65535) << 16 | b | 0 } function uf(a, b) { a = a | 0; b = b | 0; var c = 0; c = a; We(d[c >> 0] | d[c + 1 >> 0] << 8 | d[c + 2 >> 0] << 16 | d[c + 3 >> 0] << 24, b); a = a + 4 | 0; We(d[a >> 0] | d[a + 1 >> 0] << 8 | d[a + 2 >> 0] << 16 | d[a + 3 >> 0] << 24, b + 4 | 0); return } function vf(b, c, d) { b = b | 0; c = c | 0; d = d | 0; var e = 0; e = b; a[e >> 0] = c; a[e + 1 >> 0] = c >> 8; a[e + 2 >> 0] = c >> 16; a[e + 3 >> 0] = c >> 24; c = b + 4 | 0; a[c >> 0] = d; a[c + 1 >> 0] = d >> 8; a[c + 2 >> 0] = d >> 16; a[c + 3 >> 0] = d >> 24; return } function wf(a) { a = a | 0; pq(a); jp(a); return } function xf(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 4 >> 2] & 255](a); return } function yf(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 9890 ? a + 12 | 0 : 0) | 0 } function zf(a) { a = a | 0; Da(a, 16); return } function Af(a, b) { a = a | 0; b = b | 0; fe(a); c[a >> 2] = 4820; c[a + 4 >> 2] = b; Cf(a + 8 | 0); return } function Bf(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 4844; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Xe(a, e); V = d; return } function Cf(b) { b = b | 0; a[b >> 0] = 0; Gf(b + 1 | 0); Oc(b + 8 | 0, 128, 0, 0); Oc(b + 52 | 0, 256, 0, 0); Oc(b + 96 | 0, 256, 0, 0); Oc(b + 140 | 0, 256, 0, 0); Oc(b + 184 | 0, 256, 0, 0); Oc(b + 228 | 0, 256, 0, 0); Oc(b + 272 | 0, 256, 0, 0); return } function Df(a) { a = a | 0; c[a >> 2] = 4820; Hf(a + 8 | 0); le(a); return } function Ef(a) { a = a | 0; Df(a); jp(a); return } function Ff(a, b) { a = a | 0; b = b | 0; return If(a + 8 | 0, c[a + 4 >> 2] | 0, b) | 0 } function Gf(b) { b = b | 0; var c = 0; a[b >> 0] = 0; a[b + 1 >> 0] = 0; c = b + 2 | 0; a[c >> 0] = 0; a[c + 1 >> 0] = 0; b = b + 4 | 0; a[b >> 0] = 0; a[b + 1 >> 0] = 0; return } function Hf(a) { a = a | 0; Ic(a + 272 | 0); Ic(a + 228 | 0); Ic(a + 184 | 0); Ic(a + 140 | 0); Ic(a + 96 | 0); Ic(a + 52 | 0); Ic(a + 8 | 0); return } function If(c, f, g) { c = c | 0; f = f | 0; g = g | 0; var h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0; o = V; V = V + 16 | 0; m = o; if (!(a[c >> 0] | 0)) { a[c >> 0] = 1; Ee(De(f) | 0, g, 6); Jf(m, g); n = c + 1 | 0; a[n >> 0] = a[m >> 0] | 0; a[n + 1 >> 0] = a[m + 1 >> 0] | 0; a[n + 2 >> 0] = a[m + 2 >> 0] | 0; a[n + 3 >> 0] = a[m + 3 >> 0] | 0; a[n + 4 >> 0] = a[m + 4 >> 0] | 0; a[n + 5 >> 0] = a[m + 5 >> 0] | 0; } else { n = Zc(f, c + 8 | 0) | 0; Gf(m); if (!(n & 1)) { h = c + 1 | 0; h = (d[h >> 0] | d[h + 1 >> 0] << 8) & 255; } else { l = (Zc(f, c + 52 | 0) | 0) & 255; h = c + 1 | 0; h = (Ie(l + ((d[h >> 0] | d[h + 1 >> 0] << 8) & 255) | 0) | 0) & 255; } b[m >> 1] = h; if (!(n & 2)) { l = c + 1 | 0; h = h | (d[l >> 0] | d[l + 1 >> 0] << 8) & -256; } else { h = (Zc(f, c + 96 | 0) | 0) & 255; l = c + 1 | 0; h = ((Ie((((d[l >> 0] | d[l + 1 >> 0] << 8) & 65535) >>> 8) + h | 0) | 0) & 255) << 8; h = (h | e[m >> 1]) & 65535; } b[m >> 1] = h; do if (n & 64) { k = c + 1 | 0; i = (h & 255) - ((d[k >> 0] | d[k + 1 >> 0] << 8) & 255) | 0; if (!(n & 4)) { h = c + 3 | 0; h = (d[h >> 0] | d[h + 1 >> 0] << 8) & 255; } else { h = (Zc(f, c + 140 | 0) | 0) & 255; l = c + 3 | 0; l = i + ((d[l >> 0] | d[l + 1 >> 0] << 8) & 255) | 0; h = (Ie(((l | 0) < 1 ? 0 : (l | 0) > 254 ? 255 : l & 255) + h | 0) | 0) & 255; } l = m + 2 | 0; b[l >> 1] = h; if (!(n & 16)) { h = c + 5 | 0; h = (d[h >> 0] | d[h + 1 >> 0] << 8) & 255; } else { h = Zc(f, c + 228 | 0) | 0; p = c + 3 | 0; j = c + 5 | 0; j = ((i + (b[l >> 1] & 255) - ((d[p >> 0] | d[p + 1 >> 0] << 8) & 255) | 0) / 2 | 0) + ((d[j >> 0] | d[j + 1 >> 0] << 8) & 255) | 0; h = (Ie(((j | 0) < 1 ? 0 : (j | 0) > 254 ? 255 : j & 255) + (h & 255) | 0) | 0) & 255; } j = m + 4 | 0; b[j >> 1] = h; h = ((e[m >> 1] | 0) >>> 8) - (((d[k >> 0] | d[k + 1 >> 0] << 8) & 65535) >>> 8) | 0; if (!(n & 8)) { i = c + 3 | 0; i = b[l >> 1] | (d[i >> 0] | d[i + 1 >> 0] << 8) & -256; } else { i = (Zc(f, c + 184 | 0) | 0) & 255; p = c + 3 | 0; p = (((d[p >> 0] | d[p + 1 >> 0] << 8) & 65535) >>> 8) + h | 0; i = ((Ie(((p | 0) < 1 ? 0 : (p | 0) > 254 ? 255 : p & 255) + i | 0) | 0) & 255) << 8; i = (i | e[l >> 1]) & 65535; } b[l >> 1] = i; if (!(n & 32)) { p = c + 5 | 0; b[j >> 1] = b[j >> 1] | (d[p >> 0] | d[p + 1 >> 0] << 8) & -256; break } else { p = Zc(f, c + 272 | 0) | 0; f = c + 3 | 0; n = c + 5 | 0; n = ((((e[l >> 1] | 0) >>> 8) + h - (((d[f >> 0] | d[f + 1 >> 0] << 8) & 65535) >>> 8) | 0) / 2 | 0) + (((d[n >> 0] | d[n + 1 >> 0] << 8) & 65535) >>> 8) | 0; p = ((Ie(((n | 0) < 1 ? 0 : (n | 0) > 254 ? 255 : n & 255) + (p & 255) | 0) | 0) & 255) << 8; b[j >> 1] = p | e[j >> 1]; break } } else { b[m + 2 >> 1] = h; b[m + 4 >> 1] = h; } while (0); p = c + 1 | 0; a[p >> 0] = a[m >> 0] | 0; a[p + 1 >> 0] = a[m + 1 >> 0] | 0; a[p + 2 >> 0] = a[m + 2 >> 0] | 0; a[p + 3 >> 0] = a[m + 3 >> 0] | 0; a[p + 4 >> 0] = a[m + 4 >> 0] | 0; a[p + 5 >> 0] = a[m + 5 >> 0] | 0; Kf(p, g); } V = o; return g + 6 | 0 } function Jf(a, b) { a = a | 0; b = b | 0; var c = 0, d = 0; d = Oe(b) | 0; c = Oe(b + 2 | 0) | 0; Lf(a, d, c, Oe(b + 4 | 0) | 0); return } function Kf(a, b) { a = a | 0; b = b | 0; var c = 0; Te(d[a >> 0] | d[a + 1 >> 0] << 8, b); c = a + 2 | 0; Te(d[c >> 0] | d[c + 1 >> 0] << 8, b + 2 | 0); a = a + 4 | 0; Te(d[a >> 0] | d[a + 1 >> 0] << 8, b + 4 | 0); return } function Lf(b, c, d, e) { b = b | 0; c = c | 0; d = d | 0; e = e | 0; a[b >> 0] = c; a[b + 1 >> 0] = c >> 8; c = b + 2 | 0; a[c >> 0] = d; a[c + 1 >> 0] = d >> 8; d = b + 4 | 0; a[d >> 0] = e; a[d + 1 >> 0] = e >> 8; return } function Mf(a) { a = a | 0; pq(a); jp(a); return } function Nf(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 4 >> 2] & 255](a); return } function Of(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 10570 ? a + 12 | 0 : 0) | 0 } function Pf(a) { a = a | 0; Da(a, 16); return } function Qf(a, b, d) { a = a | 0; b = b | 0; d = d | 0; fe(a); c[a >> 2] = 4872; c[a + 4 >> 2] = b; Sf(a + 8 | 0, d); return } function Rf(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 4896; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Xe(a, e); V = d; return } function Sf(b, d) { b = b | 0; d = d | 0; c[b >> 2] = c[d >> 2]; a[b + 4 >> 0] = a[d + 4 >> 0] | 0; Wf(b + 8 | 0, d + 8 | 0); Wf(b + 20 | 0, d + 20 | 0); Xf(b + 32 | 0, d + 32 | 0); return } function Tf(a) { a = a | 0; c[a >> 2] = 4872; ud(a + 8 | 0); le(a); return } function Uf(a) { a = a | 0; Tf(a); jp(a); return } function Vf(a, b) { a = a | 0; b = b | 0; return Dg(a + 8 | 0, c[a + 4 >> 2] | 0, b) | 0 } function Wf(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0; c[a >> 2] = 0; c[a + 4 >> 2] = 0; c[a + 8 >> 2] = 0; d = b + 4 | 0; e = (c[d >> 2] | 0) - (c[b >> 2] | 0) | 0; if (e | 0) { Yf(a, e); Zf(a, c[b >> 2] | 0, c[d >> 2] | 0, e); } return } function Xf(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0; d = V; V = V + 32 | 0; e = d + 24 | 0; f = d + 16 | 0; h = d + 8 | 0; g = d; c[a >> 2] = 0; c[a + 4 >> 2] = 0; c[a + 8 >> 2] = 0; c[a + 12 >> 2] = 0; c[a + 16 >> 2] = 0; c[a + 20 >> 2] = 0; zg(h, b); Ag(g, b); c[f >> 2] = c[h >> 2]; c[f + 4 >> 2] = c[h + 4 >> 2]; c[e >> 2] = c[g >> 2]; c[e + 4 >> 2] = c[g + 4 >> 2]; cg(a, f, e, 0); V = d; return } function Yf(a, b) { a = a | 0; b = b | 0; var d = 0; if (($f(a) | 0) >>> 0 < b >>> 0) cr(a); else { d = eq(b) | 0; c[a + 4 >> 2] = d; c[a >> 2] = d; c[a + 8 >> 2] = d + b; return } } function Zf(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0; g = V; V = V + 16 | 0; f = g; ag(f, a, e); e = f + 4 | 0; a = d - b | 0; if ((a | 0) > 0) { ur(c[e >> 2] | 0, b | 0, a | 0) | 0; c[e >> 2] = (c[e >> 2] | 0) + a; } bg(f); V = g; return } function _f(a) { a = a | 0; var b = 0, d = 0; b = c[a >> 2] | 0; d = b; if (b | 0) { c[a + 4 >> 2] = d; Da(b, (c[a + 8 >> 2] | 0) - d | 0); } return } function $f(a) { a = a | 0; return 2147483647 } function ag(a, b, d) { a = a | 0; b = b | 0; d = d | 0; c[a >> 2] = b; b = c[b + 4 >> 2] | 0; c[a + 4 >> 2] = b; c[a + 8 >> 2] = b + d; return } function bg(a) { a = a | 0; c[(c[a >> 2] | 0) + 4 >> 2] = c[a + 4 >> 2]; return } function cg(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, q = 0; q = V; V = V + 96 | 0; p = q + 80 | 0; m = q + 64 | 0; j = q + 48 | 0; k = q + 40 | 0; l = q + 8 | 0; i = q; n = q + 32 | 0; o = q + 16 | 0; h = b; g = c[h >> 2] | 0; h = c[h + 4 >> 2] | 0; f = d; d = c[f >> 2] | 0; f = c[f + 4 >> 2] | 0; e = g; if ((f | 0) == (h | 0)) h = 0; else h = ((f - (c[d >> 2] | 0) | 0) / 44 | 0) + ((d - g >> 2) * 93 | 0) + ((h - (c[g >> 2] | 0) | 0) / -44 | 0) | 0; d = (c[a + 8 >> 2] | 0) - (c[a + 4 >> 2] | 0) | 0; d = ((d | 0) == 0 ? 0 : ((d >> 2) * 93 | 0) + -1 | 0) - ((c[a + 20 >> 2] | 0) + (c[a + 16 >> 2] | 0)) | 0; if (h >>> 0 > d >>> 0) eg(a, h - d | 0); fg(k, a); fg(i, a); f = i; d = c[f >> 2] | 0; f = c[f + 4 >> 2] | 0; g = l; c[g >> 2] = d; c[g + 4 >> 2] = f; g = d; if (h | 0) { d = ((f - (c[d >> 2] | 0) | 0) / 44 | 0) + h | 0; if ((d | 0) > 0) { i = (d >>> 0) / 93 | 0; h = g + (i << 2) | 0; c[l >> 2] = h; d = (c[h >> 2] | 0) + ((d - (i * 93 | 0) | 0) * 44 | 0) | 0; } else { d = 92 - d | 0; i = g + (((d | 0) / -93 | 0) << 2) | 0; c[l >> 2] = i; d = (c[i >> 2] | 0) + ((92 - ((d | 0) % 93 | 0) | 0) * 44 | 0) | 0; } c[l + 4 >> 2] = d; }; c[m >> 2] = c[k >> 2]; c[m + 4 >> 2] = c[k + 4 >> 2]; c[p >> 2] = c[l >> 2]; c[p + 4 >> 2] = c[l + 4 >> 2]; gg(j, m, p); hg(p, j); ig(m, j); if (jg(p, m) | 0) { g = o + 4 | 0; h = b + 4 | 0; do { kg(n, p); lg(o, a, n); d = c[o >> 2] | 0; if ((d | 0) != (c[g >> 2] | 0)) { f = c[h >> 2] | 0; do { Wc(d, f); d = (c[o >> 2] | 0) + 44 | 0; c[o >> 2] = d; f = f + 44 | 0; c[h >> 2] = f; if ((f - (c[e >> 2] | 0) | 0) == 4092) { e = e + 4 | 0; c[b >> 2] = e; f = c[e >> 2] | 0; c[h >> 2] = f; } } while ((d | 0) != (c[g >> 2] | 0)) } mg(o); ng(p) | 0; } while (jg(p, m) | 0) } V = q; return } function dg(a) { a = a | 0; var b = 0, d = 0, e = 0; b = c[a + 4 >> 2] | 0; d = a + 8 | 0; e = c[d >> 2] | 0; if ((e | 0) != (b | 0)) c[d >> 2] = e + (~((e + -4 - b | 0) >>> 2) << 2); b = c[a >> 2] | 0; if (b | 0) Da(b, (c[a + 12 >> 2] | 0) - b | 0); return } function eg(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, r = 0, s = 0, t = 0, u = 0, v = 0, w = 0, x = 0, y = 0, z = 0, A = 0, B = 0, C = 0; B = V; V = V + 64 | 0; v = B + 52 | 0; u = B + 48 | 0; w = B + 28 | 0; x = B + 24 | 0; y = B + 20 | 0; p = B; z = a + 8 | 0; d = c[z >> 2] | 0; A = a + 4 | 0; j = c[A >> 2] | 0; s = ((d | 0) == (j | 0) & 1) + b | 0; h = (s >>> 0) / 93 | 0; h = h + ((s - (h * 93 | 0) | 0) != 0 & 1) | 0; s = a + 16 | 0; e = c[s >> 2] | 0; i = (e >>> 0) / 93 | 0; r = h >>> 0 < i >>> 0 ? h : i; b = h - r | 0; g = d; a: do if (!b) { c[s >> 2] = (q(r, -93) | 0) + e; if (r | 0) { i = a + 12 | 0; k = a + 12 | 0; l = w + 4 | 0; m = w + 8 | 0; n = w + 12 | 0; b = r; e = j; while (1) { h = c[e >> 2] | 0; g = e + 4 | 0; c[A >> 2] = g; t = c[i >> 2] | 0; e = t; do if ((d | 0) == (t | 0)) { t = c[a >> 2] | 0; d = t; if (g >>> 0 <= t >>> 0) { d = e - d | 0; d = (d | 0) == 0 ? 1 : d >> 1; qg(w, d, d >>> 2, k); c[x >> 2] = c[A >> 2]; c[y >> 2] = c[z >> 2]; c[u >> 2] = c[x >> 2]; c[v >> 2] = c[y >> 2]; ug(w, u, v); d = c[a >> 2] | 0; c[a >> 2] = c[w >> 2]; c[w >> 2] = d; d = c[A >> 2] | 0; c[A >> 2] = c[l >> 2]; c[l >> 2] = d; d = c[z >> 2] | 0; c[z >> 2] = c[m >> 2]; c[m >> 2] = d; d = c[i >> 2] | 0; c[i >> 2] = c[n >> 2]; c[n >> 2] = d; tg(w); d = c[z >> 2] | 0; break } t = g; d = ((t - d >> 2) + 1 | 0) / -2 | 0; f = g + (d << 2) | 0; e = e - t | 0; if (!e) d = f; else { vr(f | 0, g | 0, e | 0) | 0; d = (c[A >> 2] | 0) + (d << 2) | 0; } t = f + (e >> 2 << 2) | 0; c[z >> 2] = t; c[A >> 2] = d; d = t; } while (0); c[d >> 2] = h; d = (c[z >> 2] | 0) + 4 | 0; c[z >> 2] = d; b = b + -1 | 0; if (!b) break a; e = c[A >> 2] | 0; } } } else { t = a + 12 | 0; e = c[t >> 2] | 0; f = e - (c[a >> 2] | 0) | 0; d = g - j >> 2; if (b >>> 0 > ((f >> 2) - d | 0) >>> 0) { o = f >> 1; n = d + b | 0; qg(p, o >>> 0 < n >>> 0 ? n : o, d - r | 0, a + 12 | 0); do { c[v >> 2] = eq(4092) | 0; rg(p, v); b = b + -1 | 0; } while ((b | 0) != 0); if (!r) d = c[A >> 2] | 0; else { i = p + 8 | 0; j = p + 12 | 0; k = p + 4 | 0; l = p + 16 | 0; m = w + 4 | 0; n = w + 8 | 0; o = w + 12 | 0; h = r; b = c[i >> 2] | 0; d = c[A >> 2] | 0; do { g = c[j >> 2] | 0; e = g; do if ((b | 0) == (g | 0)) { f = c[k >> 2] | 0; g = c[p >> 2] | 0; b = g; if (f >>> 0 <= g >>> 0) { b = e - b | 0; b = (b | 0) == 0 ? 1 : b >> 1; qg(w, b, b >>> 2, c[l >> 2] | 0); c[x >> 2] = c[k >> 2]; c[y >> 2] = c[i >> 2]; c[u >> 2] = c[x >> 2]; c[v >> 2] = c[y >> 2]; ug(w, u, v); b = c[p >> 2] | 0; c[p >> 2] = c[w >> 2]; c[w >> 2] = b; b = c[k >> 2] | 0; c[k >> 2] = c[m >> 2]; c[m >> 2] = b; b = c[i >> 2] | 0; c[i >> 2] = c[n >> 2]; c[n >> 2] = b; b = c[j >> 2] | 0; c[j >> 2] = c[o >> 2]; c[o >> 2] = b; tg(w); b = c[i >> 2] | 0; break } C = f; b = ((C - b >> 2) + 1 | 0) / -2 | 0; g = f + (b << 2) | 0; e = e - C | 0; if (!e) b = g; else { vr(g | 0, f | 0, e | 0) | 0; b = (c[k >> 2] | 0) + (b << 2) | 0; } C = g + (e >> 2 << 2) | 0; c[i >> 2] = C; c[k >> 2] = b; b = C; } while (0); c[b >> 2] = c[d >> 2]; b = (c[i >> 2] | 0) + 4 | 0; c[i >> 2] = b; d = (c[A >> 2] | 0) + 4 | 0; c[A >> 2] = d; h = h + -1 | 0; } while ((h | 0) != 0) } b = c[z >> 2] | 0; if ((b | 0) != (d | 0)) { do { b = b + -4 | 0; sg(p, b); d = c[A >> 2] | 0; } while ((b | 0) != (d | 0)); b = c[z >> 2] | 0; } C = c[a >> 2] | 0; c[a >> 2] = c[p >> 2]; c[p >> 2] = C; C = p + 4 | 0; c[A >> 2] = c[C >> 2]; c[C >> 2] = d; C = p + 8 | 0; c[z >> 2] = c[C >> 2]; c[C >> 2] = b; C = p + 12 | 0; A = c[t >> 2] | 0; c[t >> 2] = c[C >> 2]; c[C >> 2] = A; c[s >> 2] = (c[s >> 2] | 0) + (q(r, -93) | 0); tg(p); break } else { b: do if ((e | 0) == (g | 0)) k = 18; else { while (1) { c[v >> 2] = eq(4092) | 0; og(a, v); b = b + -1 | 0; if (!b) break; if ((c[t >> 2] | 0) == (c[z >> 2] | 0)) { k = 18; break b } } d = r; b = c[s >> 2] | 0; }while (0); if ((k | 0) == 18) { e = ~(h >>> 0 > i >>> 0 ? i : h); d = b; do { c[v >> 2] = eq(4092) | 0; pg(a, v); d = d + -1 | 0; f = (((c[z >> 2] | 0) - (c[A >> 2] | 0) | 0) == 4 ? 92 : 93) + (c[s >> 2] | 0) | 0; c[s >> 2] = f; } while ((d | 0) != 0); d = b + -1 - e | 0; b = f; } c[s >> 2] = b + (q(d, -93) | 0); if (!d) break;i = a + 12 | 0;j = w + 4 | 0;k = w + 8 | 0;l = w + 12 | 0;b = c[z >> 2] | 0;do { g = c[A >> 2] | 0; h = c[g >> 2] | 0; g = g + 4 | 0; c[A >> 2] = g; C = c[t >> 2] | 0; e = C; do if ((b | 0) == (C | 0)) { C = c[a >> 2] | 0; b = C; if (g >>> 0 <= C >>> 0) { b = e - b | 0; b = (b | 0) == 0 ? 1 : b >> 1; qg(w, b, b >>> 2, i); c[x >> 2] = c[A >> 2]; c[y >> 2] = c[z >> 2]; c[u >> 2] = c[x >> 2]; c[v >> 2] = c[y >> 2]; ug(w, u, v); b = c[a >> 2] | 0; c[a >> 2] = c[w >> 2]; c[w >> 2] = b; b = c[A >> 2] | 0; c[A >> 2] = c[j >> 2]; c[j >> 2] = b; b = c[z >> 2] | 0; c[z >> 2] = c[k >> 2]; c[k >> 2] = b; b = c[t >> 2] | 0; c[t >> 2] = c[l >> 2]; c[l >> 2] = b; tg(w); b = c[z >> 2] | 0; break } C = g; b = ((C - b >> 2) + 1 | 0) / -2 | 0; f = g + (b << 2) | 0; e = e - C | 0; if (!e) b = f; else { vr(f | 0, g | 0, e | 0) | 0; b = (c[A >> 2] | 0) + (b << 2) | 0; } C = f + (e >> 2 << 2) | 0; c[z >> 2] = C; c[A >> 2] = b; b = C; } while (0); c[b >> 2] = h; b = (c[z >> 2] | 0) + 4 | 0; c[z >> 2] = b; d = d + -1 | 0; } while ((d | 0) != 0) } } while (0); V = B; return } function fg(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0; d = (c[b + 16 >> 2] | 0) + (c[b + 20 >> 2] | 0) | 0; g = c[b + 4 >> 2] | 0; e = (d >>> 0) / 93 | 0; f = g + (e << 2) | 0; if ((c[b + 8 >> 2] | 0) == (g | 0)) b = 0; else b = (c[f >> 2] | 0) + ((d - (e * 93 | 0) | 0) * 44 | 0) | 0; c[a >> 2] = f; c[a + 4 >> 2] = b; return } function gg(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; f = b; b = c[f + 4 >> 2] | 0; e = a; c[e >> 2] = c[f >> 2]; c[e + 4 >> 2] = b; e = d; b = c[e + 4 >> 2] | 0; d = a + 8 | 0; c[d >> 2] = c[e >> 2]; c[d + 4 >> 2] = b; return } function hg(a, b) { a = a | 0; b = b | 0; c[a >> 2] = c[b >> 2]; c[a + 4 >> 2] = c[b + 4 >> 2]; c[a + 8 >> 2] = c[b + 8 >> 2]; c[a + 12 >> 2] = c[b + 12 >> 2]; return } function ig(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0; d = V; V = V + 32 | 0; e = d + 24 | 0; f = d + 16 | 0; h = d + 8 | 0; g = d; i = b + 8 | 0; j = c[i >> 2] | 0; i = c[i + 4 >> 2] | 0; b = h; c[b >> 2] = j; c[b + 4 >> 2] = i; b = g; c[b >> 2] = j; c[b + 4 >> 2] = i; c[f >> 2] = c[h >> 2]; c[f + 4 >> 2] = c[h + 4 >> 2]; c[e >> 2] = c[g >> 2]; c[e + 4 >> 2] = c[g + 4 >> 2]; gg(a, f, e); V = d; return } function jg(a, b) { a = a | 0; b = b | 0; return (xg(a, b) | 0) ^ 1 | 0 } function kg(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0; d = c[b >> 2] | 0; e = c[b + 4 >> 2] | 0; if ((d | 0) == (c[b + 8 >> 2] | 0)) yg(a, e, c[b + 12 >> 2] | 0); else yg(a, e, (c[d >> 2] | 0) + 4092 | 0); return } function lg(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0; e = c[d >> 2] | 0; c[a >> 2] = e; c[a + 4 >> 2] = c[d + 4 >> 2]; c[a + 8 >> 2] = e; c[a + 12 >> 2] = b; return } function mg(a) { a = a | 0; var b = 0; b = (c[a + 12 >> 2] | 0) + 20 | 0; c[b >> 2] = (c[b >> 2] | 0) + (((c[a >> 2] | 0) - (c[a + 8 >> 2] | 0) | 0) / 44 | 0); return } function ng(a) { a = a | 0; var b = 0, d = 0, e = 0; b = c[a >> 2] | 0; d = a + 8 | 0; if ((b | 0) == (c[d >> 2] | 0)) { e = d; b = c[e + 4 >> 2] | 0; d = a; c[d >> 2] = c[e >> 2]; c[d + 4 >> 2] = b; } else { e = b + 4 | 0; c[a >> 2] = e; c[a + 4 >> 2] = c[e >> 2]; } return a | 0 } function og(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, q = 0; p = V; V = V + 48 | 0; f = p + 32 | 0; e = p + 28 | 0; i = p + 8 | 0; j = p + 4 | 0; k = p; o = a + 8 | 0; d = c[o >> 2] | 0; l = a + 12 | 0; n = c[l >> 2] | 0; g = n; do if ((d | 0) == (n | 0)) { n = a + 4 | 0; m = c[n >> 2] | 0; q = c[a >> 2] | 0; h = q; if (m >>> 0 <= q >>> 0) { d = g - h | 0; d = (d | 0) == 0 ? 1 : d >> 1; qg(i, d, d >>> 2, a + 12 | 0); c[j >> 2] = c[n >> 2]; c[k >> 2] = c[o >> 2]; c[e >> 2] = c[j >> 2]; c[f >> 2] = c[k >> 2]; ug(i, e, f); d = c[a >> 2] | 0; c[a >> 2] = c[i >> 2]; c[i >> 2] = d; d = i + 4 | 0; q = c[n >> 2] | 0; c[n >> 2] = c[d >> 2]; c[d >> 2] = q; d = i + 8 | 0; q = c[o >> 2] | 0; c[o >> 2] = c[d >> 2]; c[d >> 2] = q; d = i + 12 | 0; q = c[l >> 2] | 0; c[l >> 2] = c[d >> 2]; c[d >> 2] = q; tg(i); d = c[o >> 2] | 0; break } f = m; e = ((f - h >> 2) + 1 | 0) / -2 | 0; a = m + (e << 2) | 0; f = d - f | 0; if (!f) d = a; else { vr(a | 0, m | 0, f | 0) | 0; d = (c[n >> 2] | 0) + (e << 2) | 0; } q = a + (f >> 2 << 2) | 0; c[o >> 2] = q; c[n >> 2] = d; d = q; } while (0); c[d >> 2] = c[b >> 2]; c[o >> 2] = (c[o >> 2] | 0) + 4; V = p; return } function pg(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, q = 0; p = V; V = V + 48 | 0; e = p + 32 | 0; d = p + 28 | 0; h = p + 8 | 0; i = p + 4 | 0; j = p; o = a + 4 | 0; m = c[o >> 2] | 0; n = c[a >> 2] | 0; k = n; do if ((m | 0) == (n | 0)) { n = a + 8 | 0; l = c[n >> 2] | 0; g = a + 12 | 0; q = c[g >> 2] | 0; f = q; if (l >>> 0 >= q >>> 0) { q = f - k | 0; q = (q | 0) == 0 ? 1 : q >> 1; qg(h, q, (q + 3 | 0) >>> 2, a + 12 | 0); c[i >> 2] = c[o >> 2]; c[j >> 2] = c[n >> 2]; c[d >> 2] = c[i >> 2]; c[e >> 2] = c[j >> 2]; ug(h, d, e); d = c[a >> 2] | 0; c[a >> 2] = c[h >> 2]; c[h >> 2] = d; d = h + 4 | 0; q = c[o >> 2] | 0; c[o >> 2] = c[d >> 2]; c[d >> 2] = q; d = h + 8 | 0; q = c[n >> 2] | 0; c[n >> 2] = c[d >> 2]; c[d >> 2] = q; d = h + 12 | 0; q = c[g >> 2] | 0; c[g >> 2] = c[d >> 2]; c[d >> 2] = q; tg(h); d = c[o >> 2] | 0; break } e = l; a = ((f - e >> 2) + 1 | 0) / 2 | 0; f = l + (a << 2) | 0; e = e - m | 0; d = f + (0 - (e >> 2) << 2) | 0; if (!e) { d = f; e = f; } else { vr(d | 0, m | 0, e | 0) | 0; e = (c[n >> 2] | 0) + (a << 2) | 0; } c[o >> 2] = d; c[n >> 2] = e; } else d = m; while (0); c[d + -4 >> 2] = c[b >> 2]; c[o >> 2] = (c[o >> 2] | 0) + -4; V = p; return } function qg(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; var f = 0; f = a + 12 | 0; c[f >> 2] = 0; c[a + 16 >> 2] = e; do if (b) if (b >>> 0 > 1073741823) { f = v(8) | 0; vq(f, 6723); c[f >> 2] = 5956; x(f | 0, 3928, 123); } else { e = eq(b << 2) | 0; break } else e = 0; while (0); c[a >> 2] = e; d = e + (d << 2) | 0; c[a + 8 >> 2] = d; c[a + 4 >> 2] = d; c[f >> 2] = e + (b << 2); return } function rg(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, q = 0; p = V; V = V + 48 | 0; f = p + 32 | 0; e = p + 28 | 0; i = p + 8 | 0; j = p + 4 | 0; k = p; o = a + 8 | 0; d = c[o >> 2] | 0; l = a + 12 | 0; n = c[l >> 2] | 0; g = n; do if ((d | 0) == (n | 0)) { n = a + 4 | 0; m = c[n >> 2] | 0; q = c[a >> 2] | 0; h = q; if (m >>> 0 <= q >>> 0) { d = g - h | 0; d = (d | 0) == 0 ? 1 : d >> 1; qg(i, d, d >>> 2, c[a + 16 >> 2] | 0); c[j >> 2] = c[n >> 2]; c[k >> 2] = c[o >> 2]; c[e >> 2] = c[j >> 2]; c[f >> 2] = c[k >> 2]; ug(i, e, f); d = c[a >> 2] | 0; c[a >> 2] = c[i >> 2]; c[i >> 2] = d; d = i + 4 | 0; q = c[n >> 2] | 0; c[n >> 2] = c[d >> 2]; c[d >> 2] = q; d = i + 8 | 0; q = c[o >> 2] | 0; c[o >> 2] = c[d >> 2]; c[d >> 2] = q; d = i + 12 | 0; q = c[l >> 2] | 0; c[l >> 2] = c[d >> 2]; c[d >> 2] = q; tg(i); d = c[o >> 2] | 0; break } f = m; e = ((f - h >> 2) + 1 | 0) / -2 | 0; a = m + (e << 2) | 0; f = d - f | 0; if (!f) d = a; else { vr(a | 0, m | 0, f | 0) | 0; d = (c[n >> 2] | 0) + (e << 2) | 0; } q = a + (f >> 2 << 2) | 0; c[o >> 2] = q; c[n >> 2] = d; d = q; } while (0); c[d >> 2] = c[b >> 2]; c[o >> 2] = (c[o >> 2] | 0) + 4; V = p; return } function sg(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, q = 0; p = V; V = V + 48 | 0; e = p + 32 | 0; d = p + 28 | 0; h = p + 8 | 0; i = p + 4 | 0; j = p; o = a + 4 | 0; m = c[o >> 2] | 0; n = c[a >> 2] | 0; k = n; do if ((m | 0) == (n | 0)) { n = a + 8 | 0; l = c[n >> 2] | 0; g = a + 12 | 0; q = c[g >> 2] | 0; f = q; if (l >>> 0 >= q >>> 0) { q = f - k | 0; q = (q | 0) == 0 ? 1 : q >> 1; qg(h, q, (q + 3 | 0) >>> 2, c[a + 16 >> 2] | 0); c[i >> 2] = c[o >> 2]; c[j >> 2] = c[n >> 2]; c[d >> 2] = c[i >> 2]; c[e >> 2] = c[j >> 2]; ug(h, d, e); d = c[a >> 2] | 0; c[a >> 2] = c[h >> 2]; c[h >> 2] = d; d = h + 4 | 0; q = c[o >> 2] | 0; c[o >> 2] = c[d >> 2]; c[d >> 2] = q; d = h + 8 | 0; q = c[n >> 2] | 0; c[n >> 2] = c[d >> 2]; c[d >> 2] = q; d = h + 12 | 0; q = c[g >> 2] | 0; c[g >> 2] = c[d >> 2]; c[d >> 2] = q; tg(h); d = c[o >> 2] | 0; break } e = l; a = ((f - e >> 2) + 1 | 0) / 2 | 0; f = l + (a << 2) | 0; e = e - m | 0; d = f + (0 - (e >> 2) << 2) | 0; if (!e) { d = f; e = f; } else { vr(d | 0, m | 0, e | 0) | 0; e = (c[n >> 2] | 0) + (a << 2) | 0; } c[o >> 2] = d; c[n >> 2] = e; } else d = m; while (0); c[d + -4 >> 2] = c[b >> 2]; c[o >> 2] = (c[o >> 2] | 0) + -4; V = p; return } function tg(a) { a = a | 0; var b = 0, d = 0, e = 0; b = c[a + 4 >> 2] | 0; d = a + 8 | 0; e = c[d >> 2] | 0; if ((e | 0) != (b | 0)) c[d >> 2] = e + (~((e + -4 - b | 0) >>> 2) << 2); b = c[a >> 2] | 0; if (b | 0) Da(b, (c[a + 12 >> 2] | 0) - b | 0); return } function ug(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0, g = 0, h = 0; h = V; V = V + 16 | 0; g = h; f = c[b >> 2] | 0; vg(g, a + 8 | 0, (c[d >> 2] | 0) - f >> 2); a = c[g >> 2] | 0; e = g + 4 | 0; if ((a | 0) != (c[e >> 2] | 0)) { d = f; do { c[a >> 2] = c[d >> 2]; a = (c[g >> 2] | 0) + 4 | 0; c[g >> 2] = a; d = d + 4 | 0; } while ((a | 0) != (c[e >> 2] | 0)); c[b >> 2] = d; } wg(g); V = h; return } function vg(a, b, d) { a = a | 0; b = b | 0; d = d | 0; c[a >> 2] = c[b >> 2]; c[a + 4 >> 2] = (c[b >> 2] | 0) + (d << 2); c[a + 8 >> 2] = b; return } function wg(a) { a = a | 0; c[c[a + 8 >> 2] >> 2] = c[a >> 2]; return } function xg(a, b) { a = a | 0; b = b | 0; return (c[a + 4 >> 2] | 0) == (c[b + 4 >> 2] | 0) | 0 } function yg(a, b, d) { a = a | 0; b = b | 0; d = d | 0; c[a >> 2] = b; c[a + 4 >> 2] = d; return } function zg(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0; g = c[b + 4 >> 2] | 0; d = c[b + 16 >> 2] | 0; e = (d >>> 0) / 93 | 0; f = g + (e << 2) | 0; if ((c[b + 8 >> 2] | 0) == (g | 0)) b = 0; else b = (c[f >> 2] | 0) + ((d - (e * 93 | 0) | 0) * 44 | 0) | 0; c[a >> 2] = f; c[a + 4 >> 2] = b; return } function Ag(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0; d = (c[b + 16 >> 2] | 0) + (c[b + 20 >> 2] | 0) | 0; g = c[b + 4 >> 2] | 0; e = (d >>> 0) / 93 | 0; f = g + (e << 2) | 0; if ((c[b + 8 >> 2] | 0) == (g | 0)) b = 0; else b = (c[f >> 2] | 0) + ((d - (e * 93 | 0) | 0) * 44 | 0) | 0; c[a >> 2] = f; c[a + 4 >> 2] = b; return } function Bg(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0; i = V; V = V + 16 | 0; e = i + 8 | 0; g = i; Cg(e, a); fg(g, a); f = e + 4 | 0; b = c[f >> 2] | 0; g = g + 4 | 0; if ((b | 0) != (c[g >> 2] | 0)) do { Ic(b); b = (c[f >> 2] | 0) + 44 | 0; c[f >> 2] = b; d = c[e >> 2] | 0; if ((b - (c[d >> 2] | 0) | 0) == 4092) { b = d + 4 | 0; c[e >> 2] = b; b = c[b >> 2] | 0; c[f >> 2] = b; } } while ((b | 0) != (c[g >> 2] | 0)); c[a + 20 >> 2] = 0; f = a + 8 | 0; e = a + 4 | 0; d = c[e >> 2] | 0; b = (c[f >> 2] | 0) - d >> 2; if (b >>> 0 > 2) do { Da(c[d >> 2] | 0, 4092); d = (c[e >> 2] | 0) + 4 | 0; c[e >> 2] = d; b = (c[f >> 2] | 0) - d >> 2; } while (b >>> 0 > 2); switch (b | 0) { case 1: { b = 46; h = 11; break } case 2: { b = 93; h = 11; break } default: {} } if ((h | 0) == 11) c[a + 16 >> 2] = b; V = i; return } function Cg(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0; g = c[b + 4 >> 2] | 0; d = c[b + 16 >> 2] | 0; e = (d >>> 0) / 93 | 0; f = g + (e << 2) | 0; if ((c[b + 8 >> 2] | 0) == (g | 0)) b = 0; else b = (c[f >> 2] | 0) + ((d - (e * 93 | 0) | 0) * 44 | 0) | 0; c[a >> 2] = f; c[a + 4 >> 2] = b; return } function Dg(b, e, f) { b = b | 0; e = e | 0; f = f | 0; var g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0; m = V; V = V + 16 | 0; l = m; j = b + 4 | 0; if (!(a[j >> 0] | 0)) { l = De(e) | 0; Ee(l, f, c[b >> 2] | 0); l = c[b >> 2] | 0; i = f + l | 0; if (!l) g = 0; else { g = f; h = c[b + 8 >> 2] | 0; while (1) { a[h >> 0] = a[g >> 0] | 0; g = g + 1 | 0; if ((g | 0) == (i | 0)) break; else h = h + 1 | 0; } g = c[b >> 2] | 0; } a[j >> 0] = 1; f = f + g | 0; } else { h = c[b + 20 >> 2] | 0; g = c[b + 8 >> 2] | 0; Cg(l, b + 32 | 0); b = b + 12 | 0; if ((g | 0) != (c[b >> 2] | 0)) { k = l + 4 | 0; j = g; i = h; g = c[k >> 2] | 0; while (1) { h = d[j >> 0] | 0; h = Eg((Zc(e, g) | 0) + h | 0) | 0; a[i >> 0] = h; a[f >> 0] = h; a[j >> 0] = h; j = j + 1 | 0; f = f + 1 | 0; h = c[l >> 2] | 0; g = (c[k >> 2] | 0) + 44 | 0; c[k >> 2] = g; if ((g - (c[h >> 2] | 0) | 0) == 4092) { g = h + 4 | 0; c[l >> 2] = g; g = c[g >> 2] | 0; c[k >> 2] = g; } if ((j | 0) == (c[b >> 2] | 0)) break; else i = i + 1 | 0; } } } V = m; return f | 0 } function Eg(a) { a = a | 0; return a & 255 | 0 } function Fg(a) { a = a | 0; pq(a); jp(a); return } function Gg(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 4 >> 2] & 255](a); return } function Hg(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 11262 ? a + 12 | 0 : 0) | 0 } function Ig(a) { a = a | 0; Da(a, 16); return } function Jg(a, b) { a = a | 0; b = b | 0; c[a >> 2] = 0; c[a + 4 >> 2] = 0; c[a + 8 >> 2] = 0; if (b | 0) { Yf(a, b); Lg(a, b); } return } function Kg(a, b, d) { a = a | 0; b = b | 0; d = d | 0; c[a >> 2] = 0; c[a + 4 >> 2] = 0; c[a + 8 >> 2] = 0; c[a + 12 >> 2] = 0; c[a + 16 >> 2] = 0; c[a + 20 >> 2] = 0; if (b | 0) Mg(a, b, d); return } function Lg(b, d) { b = b | 0; d = d | 0; var e = 0, f = 0, g = 0; g = V; V = V + 16 | 0; f = g; ag(f, b, d); d = f + 4 | 0; b = c[d >> 2] | 0; e = f + 8 | 0; if ((b | 0) != (c[e >> 2] | 0)) do { a[b >> 0] = 0; b = (c[d >> 2] | 0) + 1 | 0; c[d >> 2] = b; } while ((b | 0) != (c[e >> 2] | 0)); bg(f); V = g; return } function Mg(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0; o = V; V = V + 96 | 0; n = o + 80 | 0; k = o + 64 | 0; h = o + 48 | 0; i = o + 40 | 0; j = o + 8 | 0; f = o; l = o + 32 | 0; m = o + 16 | 0; e = (c[a + 8 >> 2] | 0) - (c[a + 4 >> 2] | 0) | 0; e = ((e | 0) == 0 ? 0 : ((e >> 2) * 93 | 0) + -1 | 0) - ((c[a + 20 >> 2] | 0) + (c[a + 16 >> 2] | 0)) | 0; if (e >>> 0 < b >>> 0) eg(a, b - e | 0); fg(i, a); fg(f, a); e = c[f >> 2] | 0; f = c[f + 4 >> 2] | 0; g = j; c[g >> 2] = e; c[g + 4 >> 2] = f; g = e; if (b | 0) { e = ((f - (c[e >> 2] | 0) | 0) / 44 | 0) + b | 0; if ((e | 0) > 0) { b = (e >>> 0) / 93 | 0; g = g + (b << 2) | 0; c[j >> 2] = g; e = (c[g >> 2] | 0) + ((e - (b * 93 | 0) | 0) * 44 | 0) | 0; } else { e = 92 - e | 0; b = g + (((e | 0) / -93 | 0) << 2) | 0; c[j >> 2] = b; e = (c[b >> 2] | 0) + ((92 - ((e | 0) % 93 | 0) | 0) * 44 | 0) | 0; } c[j + 4 >> 2] = e; }; c[k >> 2] = c[i >> 2]; c[k + 4 >> 2] = c[i + 4 >> 2]; c[n >> 2] = c[j >> 2]; c[n + 4 >> 2] = c[j + 4 >> 2]; gg(h, k, n); hg(n, h); ig(k, h); if (jg(n, k) | 0) { f = m + 4 | 0; do { kg(l, n); lg(m, a, l); e = c[m >> 2] | 0; if ((e | 0) != (c[f >> 2] | 0)) do { Wc(e, d); e = (c[m >> 2] | 0) + 44 | 0; c[m >> 2] = e; } while ((e | 0) != (c[f >> 2] | 0)); mg(m); ng(n) | 0; } while (jg(n, k) | 0) } V = o; return } function Ng(a) { a = a | 0; var b = 0, d = 0; Bg(a); b = c[a + 4 >> 2] | 0; d = c[a + 8 >> 2] | 0; if ((b | 0) != (d | 0)) do { Da(c[b >> 2] | 0, 4092); b = b + 4 | 0; } while ((b | 0) != (d | 0)); dg(a); return } function Og(a, b, d) { a = a | 0; b = b | 0; d = d | 0; Md(a); c[a >> 2] = 4924; c[a + 4 >> 2] = b; c[a + 8 >> 2] = d; return } function Pg(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 4944; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Wg(a, e); V = d; return } function Qg(a, b) { a = a | 0; b = b | 0; return Tg(c[a + 8 >> 2] | 0, c[a + 4 >> 2] | 0, b) | 0 } function Rg(a) { a = a | 0; var b = 0, d = 0; c[a >> 2] = 4924; d = a + 8 | 0; b = c[d >> 2] | 0; c[d >> 2] = 0; if (b | 0) { Vg(b); jp(b); } Qd(a); return } function Sg(a) { a = a | 0; Rg(a); jp(a); return } function Tg(a, b, c) { a = a | 0; b = b | 0; c = c | 0; return Ug(a + 4784 | 0, b, Be(a, b, c) | 0) | 0 } function Ug(b, c, d) { b = b | 0; c = c | 0; d = d | 0; if (a[b >> 0] | 0) { nc(c); a[b >> 0] = 0; } return d | 0 } function Vg(a) { a = a | 0; ze(a); return } function Wg(a, b) { a = a | 0; b = b | 0; return } function Xg(a) { a = a | 0; pq(a); jp(a); return } function Yg(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); return } function Zg(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 12004 ? a + 12 | 0 : 0) | 0 } function _g(a) { a = a | 0; Da(a, 16); return } function $g(b) { b = b | 0; a[b >> 0] = 1; return } function ah(a, b, d) { a = a | 0; b = b | 0; d = d | 0; Md(a); c[a >> 2] = 4972; c[a + 4 >> 2] = b; c[a + 8 >> 2] = d; return } function bh(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 4992; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Wg(a, e); V = d; return } function ch(a, b) { a = a | 0; b = b | 0; return fh(c[a + 8 >> 2] | 0, c[a + 4 >> 2] | 0, b) | 0 } function dh(a) { a = a | 0; var b = 0, d = 0; c[a >> 2] = 4972; d = a + 8 | 0; b = c[d >> 2] | 0; c[d >> 2] = 0; if (b | 0) { hh(b); jp(b); } Qd(a); return } function eh(a) { a = a | 0; dh(a); jp(a); return } function fh(a, b, c) { a = a | 0; b = b | 0; c = c | 0; return gh(a + 4784 | 0, b, Be(a, b, c) | 0) | 0 } function gh(a, b, c) { a = a | 0; b = b | 0; c = c | 0; return Ug(a + 328 | 0, b, qf(a, b, c) | 0) | 0 } function hh(a) { a = a | 0; ih(a + 4784 | 0); ze(a); return } function ih(a) { a = a | 0; of (a); return } function jh(a) { a = a | 0; pq(a); jp(a); return } function kh(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); return } function lh(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 12827 ? a + 12 | 0 : 0) | 0 } function mh(a) { a = a | 0; Da(a, 16); return } function nh(a) { a = a | 0; cf(a); $g(a + 328 | 0); return } function oh(a, b, d) { a = a | 0; b = b | 0; d = d | 0; Md(a); c[a >> 2] = 5020; c[a + 4 >> 2] = b; c[a + 8 >> 2] = d; return } function ph(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 5040; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Wg(a, e); V = d; return } function qh(a, b) { a = a | 0; b = b | 0; return th(c[a + 8 >> 2] | 0, c[a + 4 >> 2] | 0, b) | 0 } function rh(a) { a = a | 0; var b = 0, d = 0; c[a >> 2] = 5020; d = a + 8 | 0; b = c[d >> 2] | 0; c[d >> 2] = 0; if (b | 0) { vh(b); jp(b); } Qd(a); return } function sh(a) { a = a | 0; rh(a); jp(a); return } function th(a, b, c) { a = a | 0; b = b | 0; c = c | 0; return uh(a + 4784 | 0, b, Be(a, b, c) | 0) | 0 } function uh(a, b, c) { a = a | 0; b = b | 0; c = c | 0; return Ug(a + 316 | 0, b, If(a, b, c) | 0) | 0 } function vh(a) { a = a | 0; wh(a + 4784 | 0); ze(a); return } function wh(a) { a = a | 0; Hf(a); return } function xh(a) { a = a | 0; pq(a); jp(a); return } function yh(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); return } function zh(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 13672 ? a + 12 | 0 : 0) | 0 } function Ah(a) { a = a | 0; Da(a, 16); return } function Bh(a) { a = a | 0; Cf(a); $g(a + 316 | 0); return } function Ch(a, b, d) { a = a | 0; b = b | 0; d = d | 0; Md(a); c[a >> 2] = 5068; c[a + 4 >> 2] = b; c[a + 8 >> 2] = d; return } function Dh(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 5088; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Wg(a, e); V = d; return } function Eh(a, b) { a = a | 0; b = b | 0; return Hh(c[a + 8 >> 2] | 0, c[a + 4 >> 2] | 0, b) | 0 } function Fh(a) { a = a | 0; var b = 0, d = 0; c[a >> 2] = 5068; d = a + 8 | 0; b = c[d >> 2] | 0; c[d >> 2] = 0; if (b | 0) { Jh(b); jp(b); } Qd(a); return } function Gh(a) { a = a | 0; Fh(a); jp(a); return } function Hh(a, b, c) { a = a | 0; b = b | 0; c = c | 0; return Ih(a + 4784 | 0, b, Be(a, b, c) | 0) | 0 } function Ih(a, b, c) { a = a | 0; b = b | 0; c = c | 0; return uh(a + 328 | 0, b, qf(a, b, c) | 0) | 0 } function Jh(a) { a = a | 0; Kh(a + 4784 | 0); ze(a); return } function Kh(a) { a = a | 0; wh(a + 328 | 0); of (a); return } function Lh(a) { a = a | 0; pq(a); jp(a); return } function Mh(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); return } function Nh(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 14573 ? a + 12 | 0 : 0) | 0 } function Oh(a) { a = a | 0; Da(a, 16); return } function Ph(a) { a = a | 0; cf(a); Bh(a + 328 | 0); return } function Qh(a) { a = a | 0; return a + 20 | 0 } function Rh(a, b, d) { a = a | 0; b = b | 0; d = d | 0; c[a >> 2] = b; c[a + 4 >> 2] = d; c[a + 8 >> 2] = 0; return } function Sh(a, b) { a = a | 0; b = b | 0; c[a >> 2] = b; c[a + 4 >> 2] = 0; c[a + 8 >> 2] = -1; return } function Th(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0; d = V; V = V + 16 | 0; e = d + 4 | 0; g = d; f = eq(24) | 0; ii(f, b); c[g >> 2] = 0; c[e >> 2] = c[g >> 2]; ji(a, f, e); V = d; return } function Uh(a) { a = a | 0; var b = 0, d = 0; a = c[a + 4 >> 2] | 0; if (a | 0 ? (d = a + 4 | 0, b = c[d >> 2] | 0, c[d >> 2] = b + -1, (b | 0) == 0) : 0) { ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); qq(a); } return } function Vh(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 5116; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Xh(a, e); V = d; return } function Wh(a) { a = a | 0; var b = 0, d = 0; a = c[a + 4 >> 2] | 0; if (a | 0 ? (d = a + 4 | 0, b = c[d >> 2] | 0, c[d >> 2] = b + -1, (b | 0) == 0) : 0) { ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); qq(a); } return } function Xh(a, b) { a = a | 0; b = b | 0; return } function Yh(a) { a = a | 0; pq(a); jp(a); return } function Zh(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) jp(a); return } function _h(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 14966 ? a + 12 | 0 : 0) | 0 } function $h(a) { a = a | 0; Da(a, 16); return } function ai(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 5144; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; ci(a, e); V = d; return } function bi(a) { a = a | 0; var b = 0, d = 0; a = c[a + 4 >> 2] | 0; if (a | 0 ? (d = a + 4 | 0, b = c[d >> 2] | 0, c[d >> 2] = b + -1, (b | 0) == 0) : 0) { ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); qq(a); } return } function ci(a, b) { a = a | 0; b = b | 0; return } function di(a) { a = a | 0; pq(a); jp(a); return } function ei(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) { hi(a); jp(a); } return } function fi(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 15127 ? a + 12 | 0 : 0) | 0 } function gi(a) { a = a | 0; Da(a, 16); return } function hi(a) { a = a | 0; return } function ii(b, d) { b = b | 0; d = d | 0; Md(b); c[b >> 2] = 5172; c[b + 4 >> 2] = d; c[b + 8 >> 2] = 0; c[b + 12 >> 2] = 0; c[b + 16 >> 2] = 0; a[b + 20 >> 0] = 1; return } function ji(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 5192; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; pi(a, e); V = d; return } function ki(b, d) { b = b | 0; d = d | 0; var e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0; k = V; V = V + 16 | 0; h = k; e = c[b + 8 >> 2] | 0; i = c[b + 12 >> 2] | 0; if ((e | 0) != (i | 0)) { j = h + 4 | 0; do { f = c[e >> 2] | 0; c[h >> 2] = f; g = c[e + 4 >> 2] | 0; c[j >> 2] = g; if (g | 0) { g = g + 4 | 0; c[g >> 2] = (c[g >> 2] | 0) + 1; } d = $[c[(c[f >> 2] | 0) + 12 >> 2] & 63](f, d) | 0; Sd(h); e = e + 8 | 0; } while ((e | 0) != (i | 0)) } e = b + 20 | 0; if (a[e >> 0] | 0) { a[e >> 0] = 0; ni(c[b + 4 >> 2] | 0); } V = k; return d | 0 } function li(a) { a = a | 0; c[a >> 2] = 5172; Td(a + 8 | 0); Qd(a); return } function mi(a) { a = a | 0; li(a); jp(a); return } function ni(a) { a = a | 0; var b = 0; b = ((oi(c[a >> 2] | 0) | 0) & 255) << 24; b = ((oi(c[a >> 2] | 0) | 0) & 255) << 16 | b; b = b | ((oi(c[a >> 2] | 0) | 0) & 255) << 8; c[a + 4 >> 2] = b | (oi(c[a >> 2] | 0) | 0) & 255; return } function oi(b) { b = b | 0; var d = 0, e = 0; d = c[b >> 2] | 0; e = b + 8 | 0; b = c[e >> 2] | 0; c[e >> 2] = b + 1; return a[d + b >> 0] | 0 } function pi(a, b) { a = a | 0; b = b | 0; return } function qi(a) { a = a | 0; pq(a); jp(a); return } function ri(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 8 >> 2] & 255](a); return } function si(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 15450 ? a + 12 | 0 : 0) | 0 } function ti(a) { a = a | 0; Da(a, 16); return } function ui(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0; j = V; V = V + 32 | 0; e = j + 12 | 0; f = j; b = j + 8 | 0; h = eq(180) | 0; wi(h, c[a + 4 >> 2] | 0); g = a + 8 | 0; c[b >> 2] = 0; c[e >> 2] = c[b >> 2]; xi(f, h, e); h = a + 12 | 0; b = c[h >> 2] | 0; i = a + 16 | 0; do if (b >>> 0 >= (c[i >> 2] | 0) >>> 0) { b = (b - (c[g >> 2] | 0) >> 3) + 1 | 0; d = ee(g) | 0; if (d >>> 0 < b >>> 0) cr(g); else { k = c[g >> 2] | 0; l = (c[i >> 2] | 0) - k | 0; i = l >> 2; be(e, l >> 3 >>> 0 < d >>> 1 >>> 0 ? (i >>> 0 < b >>> 0 ? b : i) : d, (c[h >> 2] | 0) - k >> 3, a + 16 | 0); i = e + 8 | 0; h = c[i >> 2] | 0; c[h >> 2] = c[f >> 2]; a = f + 4 | 0; c[h + 4 >> 2] = c[a >> 2]; c[f >> 2] = 0; c[a >> 2] = 0; c[i >> 2] = h + 8; ce(g, e); de(e); break } } else { $d(e, g, 1); l = e + 4 | 0; k = c[l >> 2] | 0; c[k >> 2] = c[f >> 2]; i = f + 4 | 0; c[k + 4 >> 2] = c[i >> 2]; c[f >> 2] = 0; c[i >> 2] = 0; c[l >> 2] = k + 8; ae(e); } while (0); Sd(f); V = j; return } function vi(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0; j = V; V = V + 32 | 0; e = j + 12 | 0; f = j; b = j + 8 | 0; h = eq(180) | 0; Ui(h, c[a + 4 >> 2] | 0); g = a + 8 | 0; c[b >> 2] = 0; c[e >> 2] = c[b >> 2]; Vi(f, h, e); h = a + 12 | 0; b = c[h >> 2] | 0; i = a + 16 | 0; do if (b >>> 0 >= (c[i >> 2] | 0) >>> 0) { b = (b - (c[g >> 2] | 0) >> 3) + 1 | 0; d = ee(g) | 0; if (d >>> 0 < b >>> 0) cr(g); else { k = c[g >> 2] | 0; l = (c[i >> 2] | 0) - k | 0; i = l >> 2; be(e, l >> 3 >>> 0 < d >>> 1 >>> 0 ? (i >>> 0 < b >>> 0 ? b : i) : d, (c[h >> 2] | 0) - k >> 3, a + 16 | 0); i = e + 8 | 0; h = c[i >> 2] | 0; c[h >> 2] = c[f >> 2]; a = f + 4 | 0; c[h + 4 >> 2] = c[a >> 2]; c[f >> 2] = 0; c[a >> 2] = 0; c[i >> 2] = h + 8; ce(g, e); de(e); break } } else { $d(e, g, 1); l = e + 4 | 0; k = c[l >> 2] | 0; c[k >> 2] = c[f >> 2]; i = f + 4 | 0; c[k + 4 >> 2] = c[i >> 2]; c[f >> 2] = 0; c[i >> 2] = 0; c[l >> 2] = k + 8; ae(e); } while (0); Sd(f); V = j; return } function wi(a, b) { a = a | 0; b = b | 0; fe(a); c[a >> 2] = 5220; c[a + 4 >> 2] = b; yi(a + 8 | 0); return } function xi(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 5244; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Xe(a, e); V = d; return } function yi(b) { b = b | 0; xe(b, 32, 1, 8, 0); mc(b + 80 | 0, 32, 1, 8, 0); a[b + 160 >> 0] = 0; a[b + 161 >> 0] = 0; Ci(b + 164 | 0); return } function zi(a) { a = a | 0; c[a >> 2] = 5220; Di(a + 8 | 0); le(a); return } function Ai(a) { a = a | 0; zi(a); jp(a); return } function Bi(a, b) { a = a | 0; b = b | 0; return Ei(a + 8 | 0, c[a + 4 >> 2] | 0, b) | 0 } function Ci(b) { b = b | 0; a[b + 4 >> 0] = 0; return } function Di(a) { a = a | 0; qc(a + 80 | 0); ye(a); return } function Ei(b, d, e) { b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0; h = V; V = V + 16 | 0; f = h; if (!(a[b + 161 >> 0] | 0)) oc(b + 80 | 0); g = b + 164 | 0; if (Fi(g) | 0) { d = Gi(b + 80 | 0, d, c[g >> 2] | 0, 0) | 0; c[f >> 2] = d; Se(d, e); } else { Ii(Hi(d) | 0, e, 4); c[f >> 2] = Ne(e) | 0; } Ji(g, f); V = h; return e + 4 | 0 } function Fi(b) { b = b | 0; return (a[b + 4 >> 0] | 0) != 0 | 0 } function Gi(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; d = (Ki(a, b, (c[a + 36 >> 2] | 0) + (e * 44 | 0) | 0) | 0) + d | 0; b = c[a + 24 >> 2] | 0; if ((d | 0) < 0) return d + b | 0; else return d - (d >>> 0 < b >>> 0 ? 0 : b) | 0; return 0 } function Hi(a) { a = a | 0; return c[a >> 2] | 0 } function Ii(b, c, d) { b = b | 0; c = c | 0; d = d | 0; var e = 0; if ((d | 0) > 0) { e = 0; do { a[c + e >> 0] = oi(b) | 0; e = e + 1 | 0; } while ((e | 0) != (d | 0)) } return } function Ji(b, d) { b = b | 0; d = d | 0; var e = 0; e = b + 4 | 0; if (!(a[e >> 0] | 0)) a[e >> 0] = 1; c[b >> 2] = c[d >> 2]; return } function Ki(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0; d = Li(b, d) | 0; c[a >> 2] = d; do if (d) { if (d >>> 0 >= 32) { d = c[a + 28 >> 2] | 0; break } e = c[a + 12 >> 2] | 0; if (d >>> 0 > e >>> 0) { e = d - e | 0; d = Li(b, (c[a + 68 >> 2] | 0) + ((d + -1 | 0) * 44 | 0) | 0) | 0; e = d << e | (Mi(b, e) | 0); } else e = Li(b, (c[a + 68 >> 2] | 0) + ((d + -1 | 0) * 44 | 0) | 0) | 0; d = c[a >> 2] | 0; if ((e | 0) < (1 << d + -1 | 0)) { d = e + 1 + (-1 << d) | 0; break } else { d = e + 1 | 0; break } } else d = Ni(b, a + 48 | 0) | 0; while (0); return d | 0 } function Li(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0; n = a + 8 | 0; m = c[n >> 2] | 0; f = c[b + 16 >> 2] | 0; if (f) { e = a + 4 | 0; d = c[e >> 2] | 0; l = m >>> 15; c[n >> 2] = l; j = (d >>> 0) / (l >>> 0) | 0; i = j >>> (c[b + 40 >> 2] | 0); g = c[f + (i << 2) >> 2] | 0; i = (c[f + (i + 1 << 2) >> 2] | 0) + 1 | 0; h = g + 1 | 0; k = c[b + 8 >> 2] | 0; if (i >>> 0 > h >>> 0) { f = g; g = i; do { h = (g + f | 0) >>> 1; i = (c[k + (h << 2) >> 2] | 0) >>> 0 > j >>> 0; f = i ? f : h; g = i ? h : g; h = f + 1 | 0; } while (g >>> 0 > h >>> 0); g = f; } f = q(c[k + (g << 2) >> 2] | 0, l) | 0; if ((g | 0) == (c[b + 32 >> 2] | 0)) h = m; else h = q(c[k + (h << 2) >> 2] | 0, l) | 0; } else { k = m >>> 15; c[n >> 2] = k; i = c[b >> 2] | 0; l = c[b + 8 >> 2] | 0; e = a + 4 | 0; d = c[e >> 2] | 0; j = i >>> 1; f = 0; h = m; g = 0; do { o = q(c[l + (j << 2) >> 2] | 0, k) | 0; m = o >>> 0 > d >>> 0; h = m ? o : h; f = m ? f : o; g = m ? g : j; i = m ? j : i; j = (g + i | 0) >>> 1; } while ((j | 0) != (g | 0)) } c[e >> 2] = d - f; o = h - f | 0; c[n >> 2] = o; if (o >>> 0 < 16777216) Oi(a); n = (c[b + 12 >> 2] | 0) + (g << 2) | 0; c[n >> 2] = (c[n >> 2] | 0) + 1; n = b + 28 | 0; o = (c[n >> 2] | 0) + -1 | 0; c[n >> 2] = o; if (!o) Xc(b); return g | 0 } function Mi(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0; if (b >>> 0 > 19) { d = (Pi(a) | 0) & 65535; return (Mi(a, b + -16 | 0) | 0) << 16 | d | 0 } e = a + 4 | 0; f = c[e >> 2] | 0; g = a + 8 | 0; d = (c[g >> 2] | 0) >>> b; c[g >> 2] = d; b = (f >>> 0) / (d >>> 0) | 0; c[e >> 2] = f - (q(b, d) | 0); if (d >>> 0 < 16777216) Oi(a); return b | 0 } function Ni(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0; e = a + 8 | 0; f = c[e >> 2] | 0; d = q(f >>> 13, c[b + 8 >> 2] | 0) | 0; g = a + 4 | 0; h = c[g >> 2] | 0; i = h >>> 0 >= d >>> 0; if (i) { c[g >> 2] = h - d; d = f - d | 0; c[e >> 2] = d; } else { c[e >> 2] = d; h = b + 12 | 0; c[h >> 2] = (c[h >> 2] | 0) + 1; } if (d >>> 0 < 16777216) Oi(a); h = b + 4 | 0; a = (c[h >> 2] | 0) + -1 | 0; c[h >> 2] = a; if (!a) cd(b); return i & 1 | 0 } function Oi(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0; b = a + 4 | 0; d = a + 8 | 0; e = c[b >> 2] | 0; do { e = e << 8 | (oi(c[a >> 2] | 0) | 0) & 255; c[b >> 2] = e; f = c[d >> 2] << 8; c[d >> 2] = f; } while (f >>> 0 < 16777216); return } function Pi(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0; d = a + 4 | 0; f = c[d >> 2] | 0; b = a + 8 | 0; e = (c[b >> 2] | 0) >>> 16; c[b >> 2] = e; b = (f >>> 0) / (e >>> 0) | 0; c[d >> 2] = f - (q(b, e) | 0); Oi(a); return b & 65535 | 0 } function Qi(a) { a = a | 0; pq(a); jp(a); return } function Ri(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 4 >> 2] & 255](a); return } function Si(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 15904 ? a + 12 | 0 : 0) | 0 } function Ti(a) { a = a | 0; Da(a, 16); return } function Ui(a, b) { a = a | 0; b = b | 0; fe(a); c[a >> 2] = 5272; c[a + 4 >> 2] = b; Wi(a + 8 | 0); return } function Vi(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 5296; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Xe(a, e); V = d; return } function Wi(b) { b = b | 0; xe(b, 32, 1, 8, 0); mc(b + 80 | 0, 32, 1, 8, 0); a[b + 160 >> 0] = 0; a[b + 161 >> 0] = 0; _i(b + 164 | 0); return } function Xi(a) { a = a | 0; c[a >> 2] = 5272; $i(a + 8 | 0); le(a); return } function Yi(a) { a = a | 0; Xi(a); jp(a); return } function Zi(a, b) { a = a | 0; b = b | 0; return aj(a + 8 | 0, c[a + 4 >> 2] | 0, b) | 0 } function _i(b) { b = b | 0; a[b + 4 >> 0] = 0; return } function $i(a) { a = a | 0; qc(a + 80 | 0); ye(a); return } function aj(b, d, e) { b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0; h = V; V = V + 16 | 0; f = h; if (!(a[b + 161 >> 0] | 0)) oc(b + 80 | 0); g = b + 164 | 0; if (bj(g) | 0) { d = Gi(b + 80 | 0, d, c[g >> 2] | 0, 0) | 0; c[f >> 2] = d; We(d, e); } else { Ii(Hi(d) | 0, e, 4); c[f >> 2] = Re(e) | 0; } cj(g, f); V = h; return e + 4 | 0 } function bj(b) { b = b | 0; return (a[b + 4 >> 0] | 0) != 0 | 0 } function cj(b, d) { b = b | 0; d = d | 0; var e = 0; e = b + 4 | 0; if (!(a[e >> 0] | 0)) a[e >> 0] = 1; c[b >> 2] = c[d >> 2]; return } function dj(a) { a = a | 0; pq(a); jp(a); return } function ej(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 4 >> 2] & 255](a); return } function fj(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 16402 ? a + 12 | 0 : 0) | 0 } function gj(a) { a = a | 0; Da(a, 16); return } function hj(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0; j = V; V = V + 32 | 0; e = j + 12 | 0; f = j; b = j + 8 | 0; h = eq(172) | 0; jj(h, c[a + 4 >> 2] | 0); g = a + 8 | 0; c[b >> 2] = 0; c[e >> 2] = c[b >> 2]; kj(f, h, e); h = a + 12 | 0; b = c[h >> 2] | 0; i = a + 16 | 0; do if (b >>> 0 >= (c[i >> 2] | 0) >>> 0) { b = (b - (c[g >> 2] | 0) >> 3) + 1 | 0; d = ee(g) | 0; if (d >>> 0 < b >>> 0) cr(g); else { k = c[g >> 2] | 0; l = (c[i >> 2] | 0) - k | 0; i = l >> 2; be(e, l >> 3 >>> 0 < d >>> 1 >>> 0 ? (i >>> 0 < b >>> 0 ? b : i) : d, (c[h >> 2] | 0) - k >> 3, a + 16 | 0); i = e + 8 | 0; h = c[i >> 2] | 0; c[h >> 2] = c[f >> 2]; a = f + 4 | 0; c[h + 4 >> 2] = c[a >> 2]; c[f >> 2] = 0; c[a >> 2] = 0; c[i >> 2] = h + 8; ce(g, e); de(e); break } } else { $d(e, g, 1); l = e + 4 | 0; k = c[l >> 2] | 0; c[k >> 2] = c[f >> 2]; i = f + 4 | 0; c[k + 4 >> 2] = c[i >> 2]; c[f >> 2] = 0; c[i >> 2] = 0; c[l >> 2] = k + 8; ae(e); } while (0); Sd(f); V = j; return } function ij(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0; j = V; V = V + 32 | 0; e = j + 12 | 0; f = j; b = j + 8 | 0; h = eq(176) | 0; Aj(h, c[a + 4 >> 2] | 0); g = a + 8 | 0; c[b >> 2] = 0; c[e >> 2] = c[b >> 2]; Bj(f, h, e); h = a + 12 | 0; b = c[h >> 2] | 0; i = a + 16 | 0; do if (b >>> 0 >= (c[i >> 2] | 0) >>> 0) { b = (b - (c[g >> 2] | 0) >> 3) + 1 | 0; d = ee(g) | 0; if (d >>> 0 < b >>> 0) cr(g); else { k = c[g >> 2] | 0; l = (c[i >> 2] | 0) - k | 0; i = l >> 2; be(e, l >> 3 >>> 0 < d >>> 1 >>> 0 ? (i >>> 0 < b >>> 0 ? b : i) : d, (c[h >> 2] | 0) - k >> 3, a + 16 | 0); i = e + 8 | 0; h = c[i >> 2] | 0; c[h >> 2] = c[f >> 2]; a = f + 4 | 0; c[h + 4 >> 2] = c[a >> 2]; c[f >> 2] = 0; c[a >> 2] = 0; c[i >> 2] = h + 8; ce(g, e); de(e); break } } else { $d(e, g, 1); l = e + 4 | 0; k = c[l >> 2] | 0; c[k >> 2] = c[f >> 2]; i = f + 4 | 0; c[k + 4 >> 2] = c[i >> 2]; c[f >> 2] = 0; c[i >> 2] = 0; c[l >> 2] = k + 8; ae(e); } while (0); Sd(f); V = j; return } function jj(a, b) { a = a | 0; b = b | 0; fe(a); c[a >> 2] = 5324; c[a + 4 >> 2] = b; lj(a + 8 | 0); return } function kj(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 5348; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Xe(a, e); V = d; return } function lj(b) { b = b | 0; xe(b, 8, 1, 8, 0); mc(b + 80 | 0, 8, 1, 8, 0); a[b + 160 >> 0] = 0; a[b + 161 >> 0] = 0; pj(b + 162 | 0); return } function mj(a) { a = a | 0; c[a >> 2] = 5324; qj(a + 8 | 0); le(a); return } function nj(a) { a = a | 0; mj(a); jp(a); return } function oj(a, b) { a = a | 0; b = b | 0; return rj(a + 8 | 0, c[a + 4 >> 2] | 0, b) | 0 } function pj(b) { b = b | 0; a[b + 1 >> 0] = 0; return } function qj(a) { a = a | 0; qc(a + 80 | 0); ye(a); return } function rj(b, c, d) { b = b | 0; c = c | 0; d = d | 0; var e = 0, f = 0, g = 0; g = V; V = V + 16 | 0; e = g; if (!(a[b + 161 >> 0] | 0)) oc(b + 80 | 0); f = b + 162 | 0; if (sj(f) | 0) { c = (Gi(b + 80 | 0, c, a[f >> 0] | 0, 0) | 0) & 255; a[e >> 0] = c; tj(c, d); } else { Ii(Hi(c) | 0, d, 1); a[e >> 0] = uj(d) | 0; } vj(f, e); V = g; return d + 1 | 0 } function sj(b) { b = b | 0; return (a[b + 1 >> 0] | 0) != 0 | 0 } function tj(b, c) { b = b | 0; c = c | 0; a[c >> 0] = b; return } function uj(b) { b = b | 0; return a[b >> 0] | 0 } function vj(b, c) { b = b | 0; c = c | 0; var d = 0; d = b + 1 | 0; if (!(a[d >> 0] | 0)) a[d >> 0] = 1; a[b >> 0] = a[c >> 0] | 0; return } function wj(a) { a = a | 0; pq(a); jp(a); return } function xj(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 4 >> 2] & 255](a); return } function yj(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 16900 ? a + 12 | 0 : 0) | 0 } function zj(a) { a = a | 0; Da(a, 16); return } function Aj(a, b) { a = a | 0; b = b | 0; fe(a); c[a >> 2] = 5376; c[a + 4 >> 2] = b; Cj(a + 8 | 0); return } function Bj(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 5400; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Xe(a, e); V = d; return } function Cj(b) { b = b | 0; xe(b, 16, 1, 8, 0); mc(b + 80 | 0, 16, 1, 8, 0); a[b + 160 >> 0] = 0; a[b + 161 >> 0] = 0; Gj(b + 162 | 0); return } function Dj(a) { a = a | 0; c[a >> 2] = 5376; Hj(a + 8 | 0); le(a); return } function Ej(a) { a = a | 0; Dj(a); jp(a); return } function Fj(a, b) { a = a | 0; b = b | 0; return Ij(a + 8 | 0, c[a + 4 >> 2] | 0, b) | 0 } function Gj(b) { b = b | 0; a[b + 2 >> 0] = 0; return } function Hj(a) { a = a | 0; qc(a + 80 | 0); ye(a); return } function Ij(c, d, e) { c = c | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0; h = V; V = V + 16 | 0; f = h; if (!(a[c + 161 >> 0] | 0)) oc(c + 80 | 0); g = c + 162 | 0; if (Jj(g) | 0) { d = (Gi(c + 80 | 0, d, b[g >> 1] | 0, 0) | 0) & 65535; b[f >> 1] = d; Kj(d, e); } else { Ii(Hi(d) | 0, e, 2); b[f >> 1] = Lj(e) | 0; } Mj(g, f); V = h; return e + 2 | 0 } function Jj(b) { b = b | 0; return (a[b + 2 >> 0] | 0) != 0 | 0 } function Kj(a, b) { a = a | 0; b = b | 0; Te(a, b); return } function Lj(a) { a = a | 0; return Oe(a) | 0 } function Mj(c, d) { c = c | 0; d = d | 0; var e = 0; e = c + 2 | 0; if (!(a[e >> 0] | 0)) a[e >> 0] = 1; b[c >> 1] = b[d >> 1] | 0; return } function Nj(a) { a = a | 0; pq(a); jp(a); return } function Oj(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 4 >> 2] & 255](a); return } function Pj(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 17398 ? a + 12 | 0 : 0) | 0 } function Qj(a) { a = a | 0; Da(a, 16); return } function Rj(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0; j = V; V = V + 32 | 0; e = j + 12 | 0; f = j; b = j + 8 | 0; h = eq(172) | 0; Tj(h, c[a + 4 >> 2] | 0); g = a + 8 | 0; c[b >> 2] = 0; c[e >> 2] = c[b >> 2]; Uj(f, h, e); h = a + 12 | 0; b = c[h >> 2] | 0; i = a + 16 | 0; do if (b >>> 0 >= (c[i >> 2] | 0) >>> 0) { b = (b - (c[g >> 2] | 0) >> 3) + 1 | 0; d = ee(g) | 0; if (d >>> 0 < b >>> 0) cr(g); else { k = c[g >> 2] | 0; l = (c[i >> 2] | 0) - k | 0; i = l >> 2; be(e, l >> 3 >>> 0 < d >>> 1 >>> 0 ? (i >>> 0 < b >>> 0 ? b : i) : d, (c[h >> 2] | 0) - k >> 3, a + 16 | 0); i = e + 8 | 0; h = c[i >> 2] | 0; c[h >> 2] = c[f >> 2]; a = f + 4 | 0; c[h + 4 >> 2] = c[a >> 2]; c[f >> 2] = 0; c[a >> 2] = 0; c[i >> 2] = h + 8; ce(g, e); de(e); break } } else { $d(e, g, 1); l = e + 4 | 0; k = c[l >> 2] | 0; c[k >> 2] = c[f >> 2]; i = f + 4 | 0; c[k + 4 >> 2] = c[i >> 2]; c[f >> 2] = 0; c[i >> 2] = 0; c[l >> 2] = k + 8; ae(e); } while (0); Sd(f); V = j; return } function Sj(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0; j = V; V = V + 32 | 0; e = j + 12 | 0; f = j; b = j + 8 | 0; h = eq(176) | 0; gk(h, c[a + 4 >> 2] | 0); g = a + 8 | 0; c[b >> 2] = 0; c[e >> 2] = c[b >> 2]; hk(f, h, e); h = a + 12 | 0; b = c[h >> 2] | 0; i = a + 16 | 0; do if (b >>> 0 >= (c[i >> 2] | 0) >>> 0) { b = (b - (c[g >> 2] | 0) >> 3) + 1 | 0; d = ee(g) | 0; if (d >>> 0 < b >>> 0) cr(g); else { k = c[g >> 2] | 0; l = (c[i >> 2] | 0) - k | 0; i = l >> 2; be(e, l >> 3 >>> 0 < d >>> 1 >>> 0 ? (i >>> 0 < b >>> 0 ? b : i) : d, (c[h >> 2] | 0) - k >> 3, a + 16 | 0); i = e + 8 | 0; h = c[i >> 2] | 0; c[h >> 2] = c[f >> 2]; a = f + 4 | 0; c[h + 4 >> 2] = c[a >> 2]; c[f >> 2] = 0; c[a >> 2] = 0; c[i >> 2] = h + 8; ce(g, e); de(e); break } } else { $d(e, g, 1); l = e + 4 | 0; k = c[l >> 2] | 0; c[k >> 2] = c[f >> 2]; i = f + 4 | 0; c[k + 4 >> 2] = c[i >> 2]; c[f >> 2] = 0; c[i >> 2] = 0; c[l >> 2] = k + 8; ae(e); } while (0); Sd(f); V = j; return } function Tj(a, b) { a = a | 0; b = b | 0; fe(a); c[a >> 2] = 5428; c[a + 4 >> 2] = b; Vj(a + 8 | 0); return } function Uj(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 5452; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Xe(a, e); V = d; return } function Vj(b) { b = b | 0; xe(b, 8, 1, 8, 0); mc(b + 80 | 0, 8, 1, 8, 0); a[b + 160 >> 0] = 0; a[b + 161 >> 0] = 0; Zj(b + 162 | 0); return } function Wj(a) { a = a | 0; c[a >> 2] = 5428; _j(a + 8 | 0); le(a); return } function Xj(a) { a = a | 0; Wj(a); jp(a); return } function Yj(a, b) { a = a | 0; b = b | 0; return $j(a + 8 | 0, c[a + 4 >> 2] | 0, b) | 0 } function Zj(b) { b = b | 0; a[b + 1 >> 0] = 0; return } function _j(a) { a = a | 0; qc(a + 80 | 0); ye(a); return } function $j(b, c, e) { b = b | 0; c = c | 0; e = e | 0; var f = 0, g = 0, h = 0; h = V; V = V + 16 | 0; f = h; if (!(a[b + 161 >> 0] | 0)) oc(b + 80 | 0); g = b + 162 | 0; if (ak(g) | 0) { c = (Gi(b + 80 | 0, c, d[g >> 0] | 0, 0) | 0) & 255; a[f >> 0] = c; Ue(c, e); } else { Ii(Hi(c) | 0, e, 1); a[f >> 0] = Pe(e) | 0; } bk(g, f); V = h; return e + 1 | 0 } function ak(b) { b = b | 0; return (a[b + 1 >> 0] | 0) != 0 | 0 } function bk(b, c) { b = b | 0; c = c | 0; var d = 0; d = b + 1 | 0; if (!(a[d >> 0] | 0)) a[d >> 0] = 1; a[b >> 0] = a[c >> 0] | 0; return } function ck(a) { a = a | 0; pq(a); jp(a); return } function dk(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 4 >> 2] & 255](a); return } function ek(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 17896 ? a + 12 | 0 : 0) | 0 } function fk(a) { a = a | 0; Da(a, 16); return } function gk(a, b) { a = a | 0; b = b | 0; fe(a); c[a >> 2] = 5480; c[a + 4 >> 2] = b; ik(a + 8 | 0); return } function hk(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; d = V; V = V + 16 | 0; e = d; c[a >> 2] = b; f = eq(16) | 0; c[f + 4 >> 2] = 0; c[f + 8 >> 2] = 0; c[f >> 2] = 5504; c[f + 12 >> 2] = b; c[a + 4 >> 2] = f; c[e >> 2] = b; c[e + 4 >> 2] = b; Xe(a, e); V = d; return } function ik(b) { b = b | 0; xe(b, 16, 1, 8, 0); mc(b + 80 | 0, 16, 1, 8, 0); a[b + 160 >> 0] = 0; a[b + 161 >> 0] = 0; mk(b + 162 | 0); return } function jk(a) { a = a | 0; c[a >> 2] = 5480; nk(a + 8 | 0); le(a); return } function kk(a) { a = a | 0; jk(a); jp(a); return } function lk(a, b) { a = a | 0; b = b | 0; return ok(a + 8 | 0, c[a + 4 >> 2] | 0, b) | 0 } function mk(b) { b = b | 0; a[b + 2 >> 0] = 0; return } function nk(a) { a = a | 0; qc(a + 80 | 0); ye(a); return } function ok(c, d, f) { c = c | 0; d = d | 0; f = f | 0; var g = 0, h = 0, i = 0; i = V; V = V + 16 | 0; g = i; if (!(a[c + 161 >> 0] | 0)) oc(c + 80 | 0); h = c + 162 | 0; if (pk(h) | 0) { d = (Gi(c + 80 | 0, d, e[h >> 1] | 0, 0) | 0) & 65535; b[g >> 1] = d; Te(d, f); } else { Ii(Hi(d) | 0, f, 2); b[g >> 1] = Oe(f) | 0; } qk(h, g); V = i; return f + 2 | 0 } function pk(b) { b = b | 0; return (a[b + 2 >> 0] | 0) != 0 | 0 } function qk(c, d) { c = c | 0; d = d | 0; var e = 0; e = c + 2 | 0; if (!(a[e >> 0] | 0)) a[e >> 0] = 1; b[c >> 1] = b[d >> 1] | 0; return } function rk(a) { a = a | 0; pq(a); jp(a); return } function sk(a) { a = a | 0; a = c[a + 12 >> 2] | 0; if (a | 0) ca[c[(c[a >> 2] | 0) + 4 >> 2] & 255](a); return } function tk(a, b) { a = a | 0; b = b | 0; return ((c[b + 4 >> 2] | 0) == 18394 ? a + 12 | 0 : 0) | 0 } function uk(a) { a = a | 0; Da(a, 16); return } function vk() { return } function wk(a) { a = a | 0; return Ek(a) | 0 } function xk() { return 0 } function yk() { return 0 } function zk(a) { a = a | 0; if (a | 0) { Fk(a); jp(a); } return } function Ak() { return Gk() | 0 } function Bk() { return Hk() | 0 } function Ck() { return Ik() | 0 } function Dk() { return 0 } function Ek(a) { a = a | 0; return 3360 } function Fk(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0; b = V; V = V + 16 | 0; e = b; c[e >> 2] = c[a >> 2]; c[a >> 2] = 0; d = a + 4 | 0; c[e + 4 >> 2] = c[d >> 2]; c[d >> 2] = 0; wa(e); d = a + 8 | 0; c[e >> 2] = c[d >> 2]; c[d >> 2] = 0; f = a + 12 | 0; c[e + 4 >> 2] = c[f >> 2]; c[f >> 2] = 0; Ga(e); Ga(d); wa(a); V = b; return } function Gk() { return 3360 } function Hk() { return 3368 } function Ik() { return 3384 } function Jk() { return 18579 } function Kk() { return 18582 } function Lk() { return 18584 } function Mk() { var a = 0; a = eq(16) | 0; Tk(a); return a | 0 } function Nk(a) { a = a | 0; var b = 0, c = 0, d = 0, e = 0; b = V; V = V + 16 | 0; c = b; e = Ak() | 0; d = Pk(c) | 0; c = Qk(c) | 0; E(e | 0, d | 0, c | 0, Jk() | 0, 12, a | 0); V = b; return } function Ok(a) { a = a | 0; return Rk(Y[a & 3]() | 0) | 0 } function Pk(a) { a = a | 0; return 1 } function Qk(a) { a = a | 0; return Sk() | 0 } function Rk(a) { a = a | 0; return a | 0 } function Sk() { return 5524 } function Tk(a) { a = a | 0; c[a >> 2] = 0; c[a + 4 >> 2] = 0; c[a + 8 >> 2] = 0; c[a + 12 >> 2] = 0; return } function Uk(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0; d = V; V = V + 16 | 0; e = d; f = d + 8 | 0; h = c[b + 4 >> 2] | 0; c[e >> 2] = c[b >> 2]; c[e + 4 >> 2] = h; h = Ak() | 0; g = Wk(f) | 0; f = Xk(f) | 0; b = bl() | 0; F(h | 0, a | 0, g | 0, f | 0, b | 0, 4, Yk(e) | 0, 0); V = d; return } function Vk(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0; g = Zk(b) | 0; b = c[a >> 2] | 0; f = c[a + 4 >> 2] | 0; a = g + (f >> 1) | 0; if (f & 1) b = c[(c[a >> 2] | 0) + b >> 2] | 0; f = _k(d) | 0; g = $k(e) | 0; ea[b & 15](a, f, g); return } function Wk(a) { a = a | 0; return 4 } function Xk(a) { a = a | 0; return al() | 0 } function Yk(a) { a = a | 0; var b = 0, d = 0; b = eq(8) | 0; d = c[a + 4 >> 2] | 0; c[b >> 2] = c[a >> 2]; c[b + 4 >> 2] = d; return b | 0 } function Zk(a) { a = a | 0; return a | 0 } function _k(a) { a = a | 0; return a | 0 } function $k(a) { a = a | 0; return a | 0 } function al() { return 144 } function bl() { return 18587 } function cl(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0; d = V; V = V + 16 | 0; e = d; f = d + 8 | 0; h = c[b + 4 >> 2] | 0; c[e >> 2] = c[b >> 2]; c[e + 4 >> 2] = h; h = Ak() | 0; g = el(f) | 0; f = fl(f) | 0; b = jl() | 0; F(h | 0, a | 0, g | 0, f | 0, b | 0, 7, gl(e) | 0, 0); V = d; return } function dl(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; f = Zk(b) | 0; b = c[a >> 2] | 0; e = c[a + 4 >> 2] | 0; a = f + (e >> 1) | 0; if (e & 1) b = c[(c[a >> 2] | 0) + b >> 2] | 0; f = hl(d) | 0; da[b & 15](a, f); return } function el(a) { a = a | 0; return 3 } function fl(a) { a = a | 0; return il() | 0 } function gl(a) { a = a | 0; var b = 0, d = 0; b = eq(8) | 0; d = c[a + 4 >> 2] | 0; c[b >> 2] = c[a >> 2]; c[b + 4 >> 2] = d; return b | 0 } function hl(a) { a = a | 0; return a | 0 } function il() { return 5528 } function jl() { return 18593 } function kl(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0; d = V; V = V + 16 | 0; e = d; f = d + 8 | 0; h = c[b + 4 >> 2] | 0; c[e >> 2] = c[b >> 2]; c[e + 4 >> 2] = h; h = Ak() | 0; g = ml(f) | 0; f = nl(f) | 0; b = rl() | 0; F(h | 0, a | 0, g | 0, f | 0, b | 0, 41, ol(e) | 0, 0); V = d; return } function ll(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0; e = V; V = V + 16 | 0; d = e; g = Zk(b) | 0; b = c[a >> 2] | 0; f = c[a + 4 >> 2] | 0; a = g + (f >> 1) | 0; if (f & 1) b = c[(c[a >> 2] | 0) + b >> 2] | 0; c[d >> 2] = Z[b & 15](a) | 0; g = pl(d) | 0; V = e; return g | 0 } function ml(a) { a = a | 0; return 2 } function nl(a) { a = a | 0; return ql() | 0 } function ol(a) { a = a | 0; var b = 0, d = 0; b = eq(8) | 0; d = c[a + 4 >> 2] | 0; c[b >> 2] = c[a >> 2]; c[b + 4 >> 2] = d; return b | 0 } function pl(a) { a = a | 0; return c[a >> 2] | 0 } function ql() { return 5540 } function rl() { return 18598 } function sl() { return } function tl(a) { a = a | 0; return Al(a) | 0 } function ul() { return 0 } function vl() { return 0 } function wl(a) { a = a | 0; if (a | 0) { Bl(a); jp(a); } return } function xl() { return Cl() | 0 } function yl() { return Dl() | 0 } function zl() { return El() | 0 } function Al(a) { a = a | 0; return 3400 } function Bl(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0; b = V; V = V + 16 | 0; e = b; c[e >> 2] = c[a >> 2]; c[a >> 2] = 0; d = a + 4 | 0; c[e + 4 >> 2] = c[d >> 2]; c[d >> 2] = 0; Wh(e); d = a + 16 | 0; c[e >> 2] = c[d >> 2]; c[d >> 2] = 0; f = a + 20 | 0; c[e + 4 >> 2] = c[f >> 2]; c[f >> 2] = 0; Uh(e); c[e >> 2] = c[d >> 2]; c[d >> 2] = 0; c[e + 4 >> 2] = c[f >> 2]; c[f >> 2] = 0; Uh(e); Uh(d); bi(a + 8 | 0); Wh(a); V = b; return } function Cl() { return 3400 } function Dl() { return 3408 } function El() { return 3424 } function Fl() { var a = 0; a = eq(24) | 0; Ml(a); return a | 0 } function Gl(a) { a = a | 0; var b = 0, c = 0, d = 0, e = 0; b = V; V = V + 16 | 0; c = b; e = xl() | 0; d = Il(c) | 0; c = Jl(c) | 0; E(e | 0, d | 0, c | 0, Jk() | 0, 13, a | 0); V = b; return } function Hl(a) { a = a | 0; return Kl(Y[a & 3]() | 0) | 0 } function Il(a) { a = a | 0; return 1 } function Jl(a) { a = a | 0; return Ll() | 0 } function Kl(a) { a = a | 0; return a | 0 } function Ll() { return 5548 } function Ml(a) { a = a | 0; c[a >> 2] = 0; c[a + 4 >> 2] = 0; c[a + 8 >> 2] = 0; c[a + 12 >> 2] = 0; c[a + 16 >> 2] = 0; c[a + 20 >> 2] = 0; return } function Nl(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0; d = V; V = V + 16 | 0; e = d; f = d + 8 | 0; h = c[b + 4 >> 2] | 0; c[e >> 2] = c[b >> 2]; c[e + 4 >> 2] = h; h = xl() | 0; g = Pl(f) | 0; f = Ql(f) | 0; b = bl() | 0; F(h | 0, a | 0, g | 0, f | 0, b | 0, 5, Rl(e) | 0, 0); V = d; return } function Ol(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0; g = Sl(b) | 0; b = c[a >> 2] | 0; f = c[a + 4 >> 2] | 0; a = g + (f >> 1) | 0; if (f & 1) b = c[(c[a >> 2] | 0) + b >> 2] | 0; f = _k(d) | 0; g = $k(e) | 0; ea[b & 15](a, f, g); return } function Pl(a) { a = a | 0; return 4 } function Ql(a) { a = a | 0; return Tl() | 0 } function Rl(a) { a = a | 0; var b = 0, d = 0; b = eq(8) | 0; d = c[a + 4 >> 2] | 0; c[b >> 2] = c[a >> 2]; c[b + 4 >> 2] = d; return b | 0 } function Sl(a) { a = a | 0; return a | 0 } function Tl() { return 160 } function Ul(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0; d = V; V = V + 16 | 0; e = d; f = d + 8 | 0; h = c[b + 4 >> 2] | 0; c[e >> 2] = c[b >> 2]; c[e + 4 >> 2] = h; h = xl() | 0; g = Wl(f) | 0; f = Xl(f) | 0; b = jl() | 0; F(h | 0, a | 0, g | 0, f | 0, b | 0, 8, Yl(e) | 0, 0); V = d; return } function Vl(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; f = Sl(b) | 0; b = c[a >> 2] | 0; e = c[a + 4 >> 2] | 0; a = f + (e >> 1) | 0; if (e & 1) b = c[(c[a >> 2] | 0) + b >> 2] | 0; f = $k(d) | 0; da[b & 15](a, f); return } function Wl(a) { a = a | 0; return 3 } function Xl(a) { a = a | 0; return Zl() | 0 } function Yl(a) { a = a | 0; var b = 0, d = 0; b = eq(8) | 0; d = c[a + 4 >> 2] | 0; c[b >> 2] = c[a >> 2]; c[b + 4 >> 2] = d; return b | 0 } function Zl() { return 5552 } function _l(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0; d = V; V = V + 16 | 0; e = d; f = d + 8 | 0; h = c[b + 4 >> 2] | 0; c[e >> 2] = c[b >> 2]; c[e + 4 >> 2] = h; h = xl() | 0; g = am(f) | 0; f = bm(f) | 0; b = jl() | 0; F(h | 0, a | 0, g | 0, f | 0, b | 0, 9, cm(e) | 0, 0); V = d; return } function $l(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; f = Sl(b) | 0; b = c[a >> 2] | 0; e = c[a + 4 >> 2] | 0; a = f + (e >> 1) | 0; if (e & 1) b = c[(c[a >> 2] | 0) + b >> 2] | 0; f = hl(d) | 0; da[b & 15](a, f); return } function am(a) { a = a | 0; return 3 } function bm(a) { a = a | 0; return dm() | 0 } function cm(a) { a = a | 0; var b = 0, d = 0; b = eq(8) | 0; d = c[a + 4 >> 2] | 0; c[b >> 2] = c[a >> 2]; c[b + 4 >> 2] = d; return b | 0 } function dm() { return 5564 } function em() { ja(); return } function fm() { gm(); return } function gm() { hm(22144); return } function hm(a) { a = a | 0; var b = 0; b = V; V = V + 16 | 0; c[b >> 2] = a; im(); V = b; return } function im() { M(jm() | 0, 18653); C(km() | 0, 18658, 1, 1, 0); lm(18663); mm(18668); nm(18680); om(18694); pm(18700); qm(18715); rm(18719); sm(18732); tm(18737); um(18751); vm(18757); K(wm() | 0, 18764); K(xm() | 0, 18776); L(ym() | 0, 4, 18809); L(zm() | 0, 2, 18822); L(Am() | 0, 4, 18837); G(Bm() | 0, 18852); Cm(18868); Dm(18898); Em(18935); Fm(18974); Gm(19005); Hm(19045); Im(19074); Jm(19112); Km(19142); Dm(19181); Em(19213); Fm(19246); Gm(19279); Hm(19313); Im(19346); Lm(19380); Mm(19411); Nm(19443); return } function jm() { return _n() | 0 } function km() { return Zn() | 0 } function lm(a) { a = a | 0; var b = 0, d = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; a = Xn() | 0; I(a | 0, c[d >> 2] | 0, 1, -128 << 24 >> 24 | 0, 127 << 24 >> 24 | 0); V = b; return } function mm(a) { a = a | 0; var b = 0, d = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; a = Vn() | 0; I(a | 0, c[d >> 2] | 0, 1, -128 << 24 >> 24 | 0, 127 << 24 >> 24 | 0); V = b; return } function nm(a) { a = a | 0; var b = 0, d = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; a = Tn() | 0; I(a | 0, c[d >> 2] | 0, 1, 0, 255); V = b; return } function om(a) { a = a | 0; var b = 0, d = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; a = Rn() | 0; I(a | 0, c[d >> 2] | 0, 2, -32768 << 16 >> 16 | 0, 32767 << 16 >> 16 | 0); V = b; return } function pm(a) { a = a | 0; var b = 0, d = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; a = Pn() | 0; I(a | 0, c[d >> 2] | 0, 2, 0, 65535); V = b; return } function qm(a) { a = a | 0; var b = 0, d = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; a = Nn() | 0; I(a | 0, c[d >> 2] | 0, 4, -2147483648, 2147483647); V = b; return } function rm(a) { a = a | 0; var b = 0, d = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; a = Ln() | 0; I(a | 0, c[d >> 2] | 0, 4, 0, -1); V = b; return } function sm(a) { a = a | 0; var b = 0, d = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; a = Jn() | 0; I(a | 0, c[d >> 2] | 0, 4, -2147483648, 2147483647); V = b; return } function tm(a) { a = a | 0; var b = 0, d = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; a = Hn() | 0; I(a | 0, c[d >> 2] | 0, 4, 0, -1); V = b; return } function um(a) { a = a | 0; var b = 0, d = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; a = Fn() | 0; H(a | 0, c[d >> 2] | 0, 4); V = b; return } function vm(a) { a = a | 0; var b = 0, d = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; a = Dn() | 0; H(a | 0, c[d >> 2] | 0, 8); V = b; return } function wm() { return Cn() | 0 } function xm() { return Bn() | 0 } function ym() { return An() | 0 } function zm() { return zn() | 0 } function Am() { return yn() | 0 } function Bm() { return xn() | 0 } function Cm(a) { a = a | 0; var b = 0, d = 0, e = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; e = un() | 0; a = vn() | 0; J(e | 0, a | 0, c[d >> 2] | 0); V = b; return } function Dm(a) { a = a | 0; var b = 0, d = 0, e = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; e = rn() | 0; a = sn() | 0; J(e | 0, a | 0, c[d >> 2] | 0); V = b; return } function Em(a) { a = a | 0; var b = 0, d = 0, e = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; e = on() | 0; a = pn() | 0; J(e | 0, a | 0, c[d >> 2] | 0); V = b; return } function Fm(a) { a = a | 0; var b = 0, d = 0, e = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; e = ln() | 0; a = mn() | 0; J(e | 0, a | 0, c[d >> 2] | 0); V = b; return } function Gm(a) { a = a | 0; var b = 0, d = 0, e = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; e = hn() | 0; a = jn() | 0; J(e | 0, a | 0, c[d >> 2] | 0); V = b; return } function Hm(a) { a = a | 0; var b = 0, d = 0, e = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; e = en() | 0; a = fn() | 0; J(e | 0, a | 0, c[d >> 2] | 0); V = b; return } function Im(a) { a = a | 0; var b = 0, d = 0, e = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; e = bn() | 0; a = cn() | 0; J(e | 0, a | 0, c[d >> 2] | 0); V = b; return } function Jm(a) { a = a | 0; var b = 0, d = 0, e = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; e = _m() | 0; a = $m() | 0; J(e | 0, a | 0, c[d >> 2] | 0); V = b; return } function Km(a) { a = a | 0; var b = 0, d = 0, e = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; e = Xm() | 0; a = Ym() | 0; J(e | 0, a | 0, c[d >> 2] | 0); V = b; return } function Lm(a) { a = a | 0; var b = 0, d = 0, e = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; e = Um() | 0; a = Vm() | 0; J(e | 0, a | 0, c[d >> 2] | 0); V = b; return } function Mm(a) { a = a | 0; var b = 0, d = 0, e = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; e = Rm() | 0; a = Sm() | 0; J(e | 0, a | 0, c[d >> 2] | 0); V = b; return } function Nm(a) { a = a | 0; var b = 0, d = 0, e = 0; b = V; V = V + 16 | 0; d = b; c[d >> 2] = a; e = Om() | 0; a = Pm() | 0; J(e | 0, a | 0, c[d >> 2] | 0); V = b; return } function Om() { return Qm() | 0 } function Pm() { return 7 } function Qm() { return 3440 } function Rm() { return Tm() | 0 } function Sm() { return 7 } function Tm() { return 3448 } function Um() { return Wm() | 0 } function Vm() { return 6 } function Wm() { return 3456 } function Xm() { return Zm() | 0 } function Ym() { return 5 } function Zm() { return 3464 } function _m() { return an() | 0 } function $m() { return 4 } function an() { return 3472 } function bn() { return dn() | 0 } function cn() { return 5 } function dn() { return 3480 } function en() { return gn() | 0 } function fn() { return 4 } function gn() { return 3488 } function hn() { return kn() | 0 } function jn() { return 3 } function kn() { return 3496 } function ln() { return nn() | 0 } function mn() { return 2 } function nn() { return 3504 } function on() { return qn() | 0 } function pn() { return 1 } function qn() { return 3512 } function rn() { return tn() | 0 } function sn() { return 0 } function tn() { return 3520 } function un() { return wn() | 0 } function vn() { return 0 } function wn() { return 3528 } function xn() { return 3536 } function yn() { return 3544 } function zn() { return 3576 } function An() { return 3600 } function Bn() { return 3624 } function Cn() { return 3648 } function Dn() { return En() | 0 } function En() { return 4144 } function Fn() { return Gn() | 0 } function Gn() { return 4136 } function Hn() { return In() | 0 } function In() { return 4128 } function Jn() { return Kn() | 0 } function Kn() { return 4120 } function Ln() { return Mn() | 0 } function Mn() { return 4112 } function Nn() { return On() | 0 } function On() { return 4104 } function Pn() { return Qn() | 0 } function Qn() { return 4096 } function Rn() { return Sn() | 0 } function Sn() { return 4088 } function Tn() { return Un() | 0 } function Un() { return 4072 } function Vn() { return Wn() | 0 } function Wn() { return 4080 } function Xn() { return Yn() | 0 } function Yn() { return 4064 } function Zn() { return 4056 } function _n() { return 4040 } function $n(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0; b = V; V = V + 16 | 0; d = b + 8 | 0; e = b + 4 | 0; f = b; c[f >> 2] = a; c[e >> 2] = c[f >> 2]; c[d >> 2] = c[(c[e >> 2] | 0) + 4 >> 2]; a = Jo(c[d >> 2] | 0) | 0; V = b; return a | 0 } function ao() { return 21636 } function bo(a) { a = a | 0; return (a + -48 | 0) >>> 0 < 10 | 0 } function co() { return 5576 } function eo(b, c) { b = b | 0; c = c | 0; var d = 0, e = 0; d = a[b >> 0] | 0; e = a[c >> 0] | 0; if (d << 24 >> 24 == 0 ? 1 : d << 24 >> 24 != e << 24 >> 24) b = e; else { do { b = b + 1 | 0; c = c + 1 | 0; d = a[b >> 0] | 0; e = a[c >> 0] | 0; } while (!(d << 24 >> 24 == 0 ? 1 : d << 24 >> 24 != e << 24 >> 24)); b = e; } return (d & 255) - (b & 255) | 0 } function fo(b) { b = b | 0; var d = 0, e = 0, f = 0; f = b; a: do if (!(f & 3)) e = 5; else { d = f; while (1) { if (!(a[b >> 0] | 0)) { b = d; break a } b = b + 1 | 0; d = b; if (!(d & 3)) { e = 5; break } } } while (0); if ((e | 0) == 5) { while (1) { d = c[b >> 2] | 0; if (!((d & -2139062144 ^ -2139062144) & d + -16843009)) b = b + 4 | 0; else break } if ((d & 255) << 24 >> 24) do b = b + 1 | 0; while ((a[b >> 0] | 0) != 0) } return b - f | 0 } function go(a) { a = a | 0; return } function ho(a) { a = a | 0; return 1 } function io(b) { b = b | 0; var d = 0, e = 0; d = b + 74 | 0; e = a[d >> 0] | 0; a[d >> 0] = e + 255 | e; d = c[b >> 2] | 0; if (!(d & 8)) { c[b + 8 >> 2] = 0; c[b + 4 >> 2] = 0; e = c[b + 44 >> 2] | 0; c[b + 28 >> 2] = e; c[b + 20 >> 2] = e; c[b + 16 >> 2] = e + (c[b + 48 >> 2] | 0); b = 0; } else { c[b >> 2] = d | 32; b = -1; } return b | 0 } function jo(b, d, e) { b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0, i = 0, j = 0; f = e + 16 | 0; g = c[f >> 2] | 0; if (!g) if (!(io(e) | 0)) { g = c[f >> 2] | 0; h = 5; } else f = 0; else h = 5; a: do if ((h | 0) == 5) { j = e + 20 | 0; i = c[j >> 2] | 0; f = i; if ((g - i | 0) >>> 0 < d >>> 0) { f = aa[c[e + 36 >> 2] & 7](e, b, d) | 0; break } b: do if ((a[e + 75 >> 0] | 0) < 0 | (d | 0) == 0) { h = 0; g = b; } else { i = d; while (1) { g = i + -1 | 0; if ((a[b + g >> 0] | 0) == 10) break; if (!g) { h = 0; g = b; break b } else i = g; } f = aa[c[e + 36 >> 2] & 7](e, b, i) | 0; if (f >>> 0 < i >>> 0) break a; h = i; g = b + i | 0; d = d - i | 0; f = c[j >> 2] | 0; } while (0); ur(f | 0, g | 0, d | 0) | 0; c[j >> 2] = (c[j >> 2] | 0) + d; f = h + d | 0; } while (0); return f | 0 } function ko(a, b) { a = a | 0; b = b | 0; if (!b) b = 0; else b = lo(c[b >> 2] | 0, c[b + 4 >> 2] | 0, a) | 0; return ((b | 0) == 0 ? a : b) | 0 } function lo(b, d, e) { b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0; o = (c[b >> 2] | 0) + 1794895138 | 0; h = mo(c[b + 8 >> 2] | 0, o) | 0; f = mo(c[b + 12 >> 2] | 0, o) | 0; g = mo(c[b + 16 >> 2] | 0, o) | 0; a: do if ((h >>> 0 < d >>> 2 >>> 0 ? (n = d - (h << 2) | 0, f >>> 0 < n >>> 0 & g >>> 0 < n >>> 0) : 0) ? ((g | f) & 3 | 0) == 0 : 0) { n = f >>> 2; m = g >>> 2; l = 0; while (1) { j = h >>> 1; k = l + j | 0; i = k << 1; g = i + n | 0; f = mo(c[b + (g << 2) >> 2] | 0, o) | 0; g = mo(c[b + (g + 1 << 2) >> 2] | 0, o) | 0; if (!(g >>> 0 < d >>> 0 & f >>> 0 < (d - g | 0) >>> 0)) { f = 0; break a } if (a[b + (g + f) >> 0] | 0) { f = 0; break a } f = eo(e, b + g | 0) | 0; if (!f) break; f = (f | 0) < 0; if ((h | 0) == 1) { f = 0; break a } l = f ? l : k; h = f ? j : h - j | 0; } f = i + m | 0; g = mo(c[b + (f << 2) >> 2] | 0, o) | 0; f = mo(c[b + (f + 1 << 2) >> 2] | 0, o) | 0; if (f >>> 0 < d >>> 0 & g >>> 0 < (d - f | 0) >>> 0) f = (a[b + (f + g) >> 0] | 0) == 0 ? b + f | 0 : 0; else f = 0; } else f = 0; while (0); return f | 0 } function mo(a, b) { a = a | 0; b = b | 0; var c = 0; c = tr(a | 0) | 0; return ((b | 0) == 0 ? a : c) | 0 } function no(b, d, e) { b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0; h = d & 255; f = (e | 0) != 0; a: do if (f & (b & 3 | 0) != 0) { g = d & 255; while (1) { if ((a[b >> 0] | 0) == g << 24 >> 24) { g = 6; break a } b = b + 1 | 0; e = e + -1 | 0; f = (e | 0) != 0; if (!(f & (b & 3 | 0) != 0)) { g = 5; break } } } else g = 5; while (0); if ((g | 0) == 5) if (f) g = 6; else b = 0; b: do if ((g | 0) == 6) { if ((a[b >> 0] | 0) != (d & 255) << 24 >> 24) { f = q(h, 16843009) | 0; c: do if (e >>> 0 > 3) do { h = c[b >> 2] ^ f; if ((h & -2139062144 ^ -2139062144) & h + -16843009 | 0) break c; b = b + 4 | 0; e = e + -4 | 0; } while (e >>> 0 > 3); while (0) } if (!e) b = 0; else { f = d & 255; while (1) { if ((a[b >> 0] | 0) == f << 24 >> 24) break b; e = e + -1 | 0; if (!e) { b = 0; break } else b = b + 1 | 0; } } } while (0); return b | 0 } function oo(a, b, c) { a = a | 0; b = b | 0; c = c | 0; return ro(a, b, c, 1, 8) | 0 } function po(b, e, f, g, h, i) { b = b | 0; e = +e; f = f | 0; g = g | 0; h = h | 0; i = i | 0; var j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, r = 0.0, s = 0, t = 0, v = 0, w = 0, x = 0, y = 0, z = 0, A = 0, B = 0, C = 0, D = 0, E = 0, F = 0, G = 0, H = 0; H = V; V = V + 560 | 0; l = H + 32 | 0; w = H + 536 | 0; G = H; F = G; m = H + 540 | 0; c[w >> 2] = 0; E = m + 12 | 0; Do(e) | 0; j = u() | 0; if ((j | 0) < 0) { e = -e; Do(e) | 0; D = 1; C = 20247; j = u() | 0; } else { D = (h & 2049 | 0) != 0 & 1; C = (h & 2048 | 0) == 0 ? ((h & 1 | 0) == 0 ? 20248 : 20253) : 20250; } do if (0 == 0 & (j & 2146435072 | 0) == 2146435072) { G = (i & 32 | 0) != 0; j = D + 3 | 0; zo(b, 32, f, j, h & -65537); to(b, C, D); to(b, e != e | 0.0 != 0.0 ? (G ? 20274 : 20278) : G ? 20266 : 20270, 3); zo(b, 32, f, j, h ^ 8192); } else { r = +Eo(e, w) * 2.0; j = r != 0.0; if (j) c[w >> 2] = (c[w >> 2] | 0) + -1; v = i | 32; if ((v | 0) == 97) { o = i & 32; s = (o | 0) == 0 ? C : C + 9 | 0; p = D | 2; j = 12 - g | 0; do if (!(g >>> 0 > 11 | (j | 0) == 0)) { e = 8.0; do { j = j + -1 | 0; e = e * 16.0; } while ((j | 0) != 0); if ((a[s >> 0] | 0) == 45) { e = -(e + (-r - e)); break } else { e = r + e - e; break } } else e = r; while (0); k = c[w >> 2] | 0; j = (k | 0) < 0 ? 0 - k | 0 : k; j = yo(j, ((j | 0) < 0) << 31 >> 31, E) | 0; if ((j | 0) == (E | 0)) { j = m + 11 | 0; a[j >> 0] = 48; } a[j + -1 >> 0] = (k >> 31 & 2) + 43; n = j + -2 | 0; a[n >> 0] = i + 15; k = (g | 0) < 1; l = (h & 8 | 0) == 0; m = G; do { D = ~~e; j = m + 1 | 0; a[m >> 0] = o | d[640 + D >> 0]; e = (e - +(D | 0)) * 16.0; if ((j - F | 0) == 1 ? !(l & (k & e == 0.0)) : 0) { a[j >> 0] = 46; m = m + 2 | 0; } else m = j; } while (e != 0.0); if ((g | 0) != 0 ? (-2 - F + m | 0) < (g | 0) : 0) { k = E; l = n; j = g + 2 + k - l | 0; } else { k = E; l = n; j = k - F - l + m | 0; } E = j + p | 0; zo(b, 32, f, E, h); to(b, s, p); zo(b, 48, f, E, h ^ 65536); F = m - F | 0; to(b, G, F); G = k - l | 0; zo(b, 48, j - (F + G) | 0, 0, 0); to(b, n, G); zo(b, 32, f, E, h ^ 8192); j = E; break } k = (g | 0) < 0 ? 6 : g; if (j) { j = (c[w >> 2] | 0) + -28 | 0; c[w >> 2] = j; e = r * 268435456.0; } else { e = r; j = c[w >> 2] | 0; } B = (j | 0) < 0 ? l : l + 288 | 0; l = B; do { z = ~~e >>> 0; c[l >> 2] = z; l = l + 4 | 0; e = (e - +(z >>> 0)) * 1.0e9; } while (e != 0.0); z = B; if ((j | 0) > 0) { o = B; while (1) { n = (j | 0) < 29 ? j : 29; j = l + -4 | 0; if (j >>> 0 >= o >>> 0) { m = 0; do { t = rr(c[j >> 2] | 0, 0, n | 0) | 0; t = lr(t | 0, u() | 0, m | 0, 0) | 0; x = u() | 0; m = pr(t | 0, x | 0, 1e9, 0) | 0; y = kr(m | 0, u() | 0, 1e9, 0) | 0; y = mr(t | 0, x | 0, y | 0, u() | 0) | 0; u() | 0; c[j >> 2] = y; j = j + -4 | 0; } while (j >>> 0 >= o >>> 0); if (m) { y = o + -4 | 0; c[y >> 2] = m; m = y; } else m = o; } else m = o; a: do if (l >>> 0 > m >>> 0) { j = l; while (1) { l = j + -4 | 0; if (c[l >> 2] | 0) { l = j; break a } if (l >>> 0 > m >>> 0) j = l; else break } } while (0); j = (c[w >> 2] | 0) - n | 0; c[w >> 2] = j; if ((j | 0) > 0) o = m; else break } } else m = B; if ((j | 0) < 0) { g = ((k + 25 | 0) / 9 | 0) + 1 | 0; t = (v | 0) == 102; do { s = 0 - j | 0; s = (s | 0) < 9 ? s : 9; if (m >>> 0 < l >>> 0) { n = (1 << s) + -1 | 0; o = 1e9 >>> s; p = 0; j = m; do { y = c[j >> 2] | 0; c[j >> 2] = (y >>> s) + p; p = q(y & n, o) | 0; j = j + 4 | 0; } while (j >>> 0 < l >>> 0); m = (c[m >> 2] | 0) == 0 ? m + 4 | 0 : m; if (p) { c[l >> 2] = p; l = l + 4 | 0; } } else m = (c[m >> 2] | 0) == 0 ? m + 4 | 0 : m; j = t ? B : m; l = (l - j >> 2 | 0) > (g | 0) ? j + (g << 2) | 0 : l; j = (c[w >> 2] | 0) + s | 0; c[w >> 2] = j; } while ((j | 0) < 0); t = m; } else t = m; if (t >>> 0 < l >>> 0) { j = (z - t >> 2) * 9 | 0; n = c[t >> 2] | 0; if (n >>> 0 >= 10) { m = 10; do { m = m * 10 | 0; j = j + 1 | 0; } while (n >>> 0 >= m >>> 0) } } else j = 0; x = (v | 0) == 103; y = (k | 0) != 0; m = k - ((v | 0) == 102 ? 0 : j) + ((y & x) << 31 >> 31) | 0; if ((m | 0) < (((l - z >> 2) * 9 | 0) + -9 | 0)) { w = m + 9216 | 0; m = (w | 0) / 9 | 0; g = B + 4 + (m + -1024 << 2) | 0; m = w - (m * 9 | 0) | 0; if ((m | 0) < 8) { n = 10; while (1) { n = n * 10 | 0; if ((m | 0) < 7) m = m + 1 | 0; else break } } else n = 10; p = c[g >> 2] | 0; m = (p >>> 0) / (n >>> 0) | 0; s = p - (q(m, n) | 0) | 0; o = (g + 4 | 0) == (l | 0); if (!(o & (s | 0) == 0)) { r = (m & 1 | 0) == 0 ? 9007199254740992.0 : 9007199254740994.0; w = n >>> 1; e = s >>> 0 < w >>> 0 ? .5 : o & (s | 0) == (w | 0) ? 1.0 : 1.5; if (D) { w = (a[C >> 0] | 0) == 45; e = w ? -e : e; r = w ? -r : r; } m = p - s | 0; c[g >> 2] = m; if (r + e != r) { w = m + n | 0; c[g >> 2] = w; if (w >>> 0 > 999999999) { n = g; j = t; while (1) { m = n + -4 | 0; c[n >> 2] = 0; if (m >>> 0 < j >>> 0) { j = j + -4 | 0; c[j >> 2] = 0; } w = (c[m >> 2] | 0) + 1 | 0; c[m >> 2] = w; if (w >>> 0 > 999999999) n = m; else { n = j; break } } } else { m = g; n = t; } j = (z - n >> 2) * 9 | 0; p = c[n >> 2] | 0; if (p >>> 0 >= 10) { o = 10; do { o = o * 10 | 0; j = j + 1 | 0; } while (p >>> 0 >= o >>> 0) } } else { m = g; n = t; } } else { m = g; n = t; } w = m + 4 | 0; l = l >>> 0 > w >>> 0 ? w : l; } else n = t; g = 0 - j | 0; b: do if (l >>> 0 > n >>> 0) while (1) { m = l + -4 | 0; if (c[m >> 2] | 0) { w = l; v = 1; break b } if (m >>> 0 > n >>> 0) l = m; else { w = m; v = 0; break } } else { w = l; v = 0; } while (0); do if (x) { k = k + ((y ^ 1) & 1) | 0; if ((k | 0) > (j | 0) & (j | 0) > -5) { o = i + -1 | 0; k = k + -1 - j | 0; } else { o = i + -2 | 0; k = k + -1 | 0; } if (!(h & 8)) { if (v ? (A = c[w + -4 >> 2] | 0, (A | 0) != 0) : 0) if (!((A >>> 0) % 10 | 0)) { m = 0; l = 10; do { l = l * 10 | 0; m = m + 1 | 0; } while (!((A >>> 0) % (l >>> 0) | 0 | 0)) } else m = 0; else m = 9; l = ((w - z >> 2) * 9 | 0) + -9 | 0; if ((o | 32 | 0) == 102) { i = l - m | 0; i = (i | 0) > 0 ? i : 0; k = (k | 0) < (i | 0) ? k : i; break } else { i = l + j - m | 0; i = (i | 0) > 0 ? i : 0; k = (k | 0) < (i | 0) ? k : i; break } } } else o = i; while (0); t = (k | 0) != 0; p = t ? 1 : h >>> 3 & 1; s = (o | 32 | 0) == 102; if (s) { x = 0; j = (j | 0) > 0 ? j : 0; } else { l = (j | 0) < 0 ? g : j; l = yo(l, ((l | 0) < 0) << 31 >> 31, E) | 0; m = E; if ((m - l | 0) < 2) do { l = l + -1 | 0; a[l >> 0] = 48; } while ((m - l | 0) < 2); a[l + -1 >> 0] = (j >> 31 & 2) + 43; j = l + -2 | 0; a[j >> 0] = o; x = j; j = m - j | 0; } j = D + 1 + k + p + j | 0; zo(b, 32, f, j, h); to(b, C, D); zo(b, 48, f, j, h ^ 65536); if (s) { p = n >>> 0 > B >>> 0 ? B : n; s = G + 9 | 0; n = s; o = G + 8 | 0; m = p; do { l = yo(c[m >> 2] | 0, 0, s) | 0; if ((m | 0) == (p | 0)) { if ((l | 0) == (s | 0)) { a[o >> 0] = 48; l = o; } } else if (l >>> 0 > G >>> 0) { wr(G | 0, 48, l - F | 0) | 0; do l = l + -1 | 0; while (l >>> 0 > G >>> 0) } to(b, l, n - l | 0); m = m + 4 | 0; } while (m >>> 0 <= B >>> 0); if (!((h & 8 | 0) == 0 & (t ^ 1))) to(b, 20282, 1); if (m >>> 0 < w >>> 0 & (k | 0) > 0) while (1) { l = yo(c[m >> 2] | 0, 0, s) | 0; if (l >>> 0 > G >>> 0) { wr(G | 0, 48, l - F | 0) | 0; do l = l + -1 | 0; while (l >>> 0 > G >>> 0) } to(b, l, (k | 0) < 9 ? k : 9); m = m + 4 | 0; l = k + -9 | 0; if (!(m >>> 0 < w >>> 0 & (k | 0) > 9)) { k = l; break } else k = l; } zo(b, 48, k + 9 | 0, 9, 0); } else { w = v ? w : n + 4 | 0; if (n >>> 0 < w >>> 0 & (k | 0) > -1) { g = G + 9 | 0; t = (h & 8 | 0) == 0; v = g; p = 0 - F | 0; s = G + 8 | 0; o = n; do { l = yo(c[o >> 2] | 0, 0, g) | 0; if ((l | 0) == (g | 0)) { a[s >> 0] = 48; l = s; } do if ((o | 0) == (n | 0)) { m = l + 1 | 0; to(b, l, 1); if (t & (k | 0) < 1) { l = m; break } to(b, 20282, 1); l = m; } else { if (l >>> 0 <= G >>> 0) break; wr(G | 0, 48, l + p | 0) | 0; do l = l + -1 | 0; while (l >>> 0 > G >>> 0) } while (0); F = v - l | 0; to(b, l, (k | 0) > (F | 0) ? F : k); k = k - F | 0; o = o + 4 | 0; } while (o >>> 0 < w >>> 0 & (k | 0) > -1) } zo(b, 48, k + 18 | 0, 18, 0); to(b, x, E - x | 0); } zo(b, 32, f, j, h ^ 8192); } while (0); V = H; return ((j | 0) < (f | 0) ? f : j) | 0 } function qo(a, b) { a = a | 0; b = b | 0; var d = 0.0, e = 0; e = (c[b >> 2] | 0) + (8 - 1) & ~(8 - 1); d = +g[e >> 3]; c[b >> 2] = e + 8; g[a >> 3] = d; return } function ro(b, d, e, f, g) { b = b | 0; d = d | 0; e = e | 0; f = f | 0; g = g | 0; var h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, q = 0, r = 0, s = 0, t = 0; t = V; V = V + 224 | 0; p = t + 208 | 0; q = t + 160 | 0; r = t + 80 | 0; s = t; h = q; i = h + 40 | 0; do { c[h >> 2] = 0; h = h + 4 | 0; } while ((h | 0) < (i | 0)); c[p >> 2] = c[e >> 2]; if ((so(0, d, p, r, q, f, g) | 0) < 0) e = -1; else { if ((c[b + 76 >> 2] | 0) > -1) o = ho(b) | 0; else o = 0; e = c[b >> 2] | 0; n = e & 32; if ((a[b + 74 >> 0] | 0) < 1) c[b >> 2] = e & -33; h = b + 48 | 0; if (!(c[h >> 2] | 0)) { i = b + 44 | 0; j = c[i >> 2] | 0; c[i >> 2] = s; k = b + 28 | 0; c[k >> 2] = s; l = b + 20 | 0; c[l >> 2] = s; c[h >> 2] = 80; m = b + 16 | 0; c[m >> 2] = s + 80; e = so(b, d, p, r, q, f, g) | 0; if (j) { aa[c[b + 36 >> 2] & 7](b, 0, 0) | 0; e = (c[l >> 2] | 0) == 0 ? -1 : e; c[i >> 2] = j; c[h >> 2] = 0; c[m >> 2] = 0; c[k >> 2] = 0; c[l >> 2] = 0; } } else e = so(b, d, p, r, q, f, g) | 0; h = c[b >> 2] | 0; c[b >> 2] = h | n; if (o | 0) go(b); e = (h & 32 | 0) == 0 ? e : -1; } V = t; return e | 0 } function so(d, e, f, h, i, j, k) { d = d | 0; e = e | 0; f = f | 0; h = h | 0; i = i | 0; j = j | 0; k = k | 0; var l = 0, m = 0, n = 0, o = 0, p = 0, q = 0, r = 0, s = 0, t = 0, v = 0, w = 0, x = 0, y = 0, z = 0, A = 0, B = 0, C = 0, D = 0, E = 0, F = 0, G = 0, H = 0, I = 0, J = 0, K = 0; J = V; V = V + 64 | 0; G = J + 56 | 0; I = J + 40 | 0; B = J; D = J + 48 | 0; E = J + 60 | 0; c[G >> 2] = e; y = (d | 0) != 0; z = B + 40 | 0; A = z; B = B + 39 | 0; C = D + 4 | 0; l = 0; e = 0; n = 0; a: while (1) { do { do if ((e | 0) > -1) if ((l | 0) > (2147483647 - e | 0)) { c[(ao() | 0) >> 2] = 61; e = -1; break } else { e = l + e | 0; break } while (0); r = c[G >> 2] | 0; l = a[r >> 0] | 0; if (!(l << 24 >> 24)) { x = 92; break a } m = r; b: while (1) { switch (l << 24 >> 24) { case 37: { x = 10; break b } case 0: { l = m; break b } default: {} } w = m + 1 | 0; c[G >> 2] = w; l = a[w >> 0] | 0; m = w; } c: do if ((x | 0) == 10) { x = 0; l = m; do { if ((a[m + 1 >> 0] | 0) != 37) break c; l = l + 1 | 0; m = m + 2 | 0; c[G >> 2] = m; } while ((a[m >> 0] | 0) == 37) } while (0); l = l - r | 0; if (y) to(d, r, l); } while ((l | 0) != 0); w = (bo(a[(c[G >> 2] | 0) + 1 >> 0] | 0) | 0) == 0; m = c[G >> 2] | 0; if (!w ? (a[m + 2 >> 0] | 0) == 36 : 0) { t = (a[m + 1 >> 0] | 0) + -48 | 0; p = 1; l = 3; } else { t = -1; p = n; l = 1; } l = m + l | 0; c[G >> 2] = l; m = a[l >> 0] | 0; n = (m << 24 >> 24) + -32 | 0; if (n >>> 0 > 31 | (1 << n & 75913 | 0) == 0) o = 0; else { o = 0; do { o = 1 << n | o; l = l + 1 | 0; c[G >> 2] = l; m = a[l >> 0] | 0; n = (m << 24 >> 24) + -32 | 0; } while (!(n >>> 0 > 31 | (1 << n & 75913 | 0) == 0)) } if (m << 24 >> 24 == 42) { if ((bo(a[l + 1 >> 0] | 0) | 0) != 0 ? (H = c[G >> 2] | 0, (a[H + 2 >> 0] | 0) == 36) : 0) { l = H + 1 | 0; c[i + ((a[l >> 0] | 0) + -48 << 2) >> 2] = 10; l = c[h + ((a[l >> 0] | 0) + -48 << 3) >> 2] | 0; n = 1; m = H + 3 | 0; } else { if (p | 0) { e = -1; break } if (y) { w = (c[f >> 2] | 0) + (4 - 1) & ~(4 - 1); l = c[w >> 2] | 0; c[f >> 2] = w + 4; } else l = 0; n = 0; m = (c[G >> 2] | 0) + 1 | 0; } c[G >> 2] = m; w = (l | 0) < 0; v = w ? 0 - l | 0 : l; o = w ? o | 8192 : o; w = n; } else { l = uo(G) | 0; if ((l | 0) < 0) { e = -1; break } v = l; w = p; m = c[G >> 2] | 0; } do if ((a[m >> 0] | 0) == 46) { l = m + 1 | 0; if ((a[l >> 0] | 0) != 42) { c[G >> 2] = l; l = uo(G) | 0; m = c[G >> 2] | 0; break } if (bo(a[m + 2 >> 0] | 0) | 0 ? (F = c[G >> 2] | 0, (a[F + 3 >> 0] | 0) == 36) : 0) { l = F + 2 | 0; c[i + ((a[l >> 0] | 0) + -48 << 2) >> 2] = 10; l = c[h + ((a[l >> 0] | 0) + -48 << 3) >> 2] | 0; m = F + 4 | 0; c[G >> 2] = m; break } if (w | 0) { e = -1; break a } if (y) { s = (c[f >> 2] | 0) + (4 - 1) & ~(4 - 1); l = c[s >> 2] | 0; c[f >> 2] = s + 4; } else l = 0; m = (c[G >> 2] | 0) + 2 | 0; c[G >> 2] = m; } else l = -1; while (0); s = 0; while (1) { if (((a[m >> 0] | 0) + -65 | 0) >>> 0 > 57) { e = -1; break a } n = m; m = m + 1 | 0; c[G >> 2] = m; n = a[(a[n >> 0] | 0) + -65 + (176 + (s * 58 | 0)) >> 0] | 0; p = n & 255; if ((p + -1 | 0) >>> 0 >= 8) break; else s = p; } if (!(n << 24 >> 24)) { e = -1; break } q = (t | 0) > -1; do if (n << 24 >> 24 == 19) if (q) { e = -1; break a } else x = 54; else { if (q) { c[i + (t << 2) >> 2] = p; q = h + (t << 3) | 0; t = c[q + 4 >> 2] | 0; x = I; c[x >> 2] = c[q >> 2]; c[x + 4 >> 2] = t; x = 54; break } if (!y) { e = 0; break a } vo(I, p, f, k); m = c[G >> 2] | 0; x = 55; } while (0); if ((x | 0) == 54) { x = 0; if (y) x = 55; else l = 0; } d: do if ((x | 0) == 55) { x = 0; m = a[m + -1 >> 0] | 0; m = (s | 0) != 0 & (m & 15 | 0) == 3 ? m & -33 : m; n = o & -65537; t = (o & 8192 | 0) == 0 ? o : n; e: do switch (m | 0) { case 110: switch ((s & 255) << 24 >> 24) { case 0: { c[c[I >> 2] >> 2] = e; l = 0; break d } case 1: { c[c[I >> 2] >> 2] = e; l = 0; break d } case 2: { l = c[I >> 2] | 0; c[l >> 2] = e; c[l + 4 >> 2] = ((e | 0) < 0) << 31 >> 31; l = 0; break d } case 3: { b[c[I >> 2] >> 1] = e; l = 0; break d } case 4: { a[c[I >> 2] >> 0] = e; l = 0; break d } case 6: { c[c[I >> 2] >> 2] = e; l = 0; break d } case 7: { l = c[I >> 2] | 0; c[l >> 2] = e; c[l + 4 >> 2] = ((e | 0) < 0) << 31 >> 31; l = 0; break d } default: { l = 0; break d } } case 112: { m = 120; l = l >>> 0 > 8 ? l : 8; n = t | 8; x = 67; break } case 88: case 120: { n = t; x = 67; break } case 111: { q = I; q = xo(c[q >> 2] | 0, c[q + 4 >> 2] | 0, z) | 0; n = A - q | 0; o = 0; p = 20230; l = (t & 8 | 0) == 0 | (l | 0) > (n | 0) ? l : n + 1 | 0; n = t; x = 73; break } case 105: case 100: { n = I; m = c[n >> 2] | 0; n = c[n + 4 >> 2] | 0; if ((n | 0) < 0) { m = mr(0, 0, m | 0, n | 0) | 0; n = u() | 0; o = I; c[o >> 2] = m; c[o + 4 >> 2] = n; o = 1; p = 20230; x = 72; break e } else { o = (t & 2049 | 0) != 0 & 1; p = (t & 2048 | 0) == 0 ? ((t & 1 | 0) == 0 ? 20230 : 20232) : 20231; x = 72; break e } } case 117: { n = I; o = 0; p = 20230; m = c[n >> 2] | 0; n = c[n + 4 >> 2] | 0; x = 72; break } case 99: { a[B >> 0] = c[I >> 2]; r = B; o = 0; p = 20230; q = 1; m = n; l = A; break } case 115: { s = c[I >> 2] | 0; s = (s | 0) == 0 ? 20240 : s; t = no(s, 0, l) | 0; K = (t | 0) == 0; r = s; o = 0; p = 20230; q = K ? l : t - s | 0; m = n; l = K ? s + l | 0 : t; break } case 67: { c[D >> 2] = c[I >> 2]; c[C >> 2] = 0; c[I >> 2] = D; p = -1; x = 79; break } case 83: { if (!l) { zo(d, 32, v, 0, t); l = 0; x = 89; } else { p = l; x = 79; } break } case 65: case 71: case 70: case 69: case 97: case 103: case 102: case 101: { l = _[j & 1](d, +g[I >> 3], v, l, t, m) | 0; break d } default: { o = 0; p = 20230; q = l; m = t; l = A; } } while (0); f: do if ((x | 0) == 67) { q = I; q = wo(c[q >> 2] | 0, c[q + 4 >> 2] | 0, z, m & 32) | 0; p = I; p = (n & 8 | 0) == 0 | (c[p >> 2] | 0) == 0 & (c[p + 4 >> 2] | 0) == 0; o = p ? 0 : 2; p = p ? 20230 : 20230 + (m >>> 4) | 0; x = 73; } else if ((x | 0) == 72) { q = yo(m, n, z) | 0; n = t; x = 73; } else if ((x | 0) == 79) { x = 0; o = c[I >> 2] | 0; l = 0; while (1) { m = c[o >> 2] | 0; if (!m) break; m = Ao(E, m) | 0; n = (m | 0) < 0; if (n | m >>> 0 > (p - l | 0) >>> 0) { x = 83; break } l = m + l | 0; if (p >>> 0 > l >>> 0) o = o + 4 | 0; else break } if ((x | 0) == 83) { x = 0; if (n) { e = -1; break a } } zo(d, 32, v, l, t); if (!l) { l = 0; x = 89; } else { n = c[I >> 2] | 0; o = 0; while (1) { m = c[n >> 2] | 0; if (!m) { x = 89; break f } m = Ao(E, m) | 0; o = m + o | 0; if ((o | 0) > (l | 0)) { x = 89; break f } to(d, E, m); if (o >>> 0 >= l >>> 0) { x = 89; break } else n = n + 4 | 0; } } } while (0); if ((x | 0) == 73) { x = 0; m = I; m = (c[m >> 2] | 0) != 0 | (c[m + 4 >> 2] | 0) != 0; K = (l | 0) != 0 | m; m = A - q + ((m ^ 1) & 1) | 0; r = K ? q : z; q = K ? ((l | 0) > (m | 0) ? l : m) : 0; m = (l | 0) > -1 ? n & -65537 : n; l = A; } else if ((x | 0) == 89) { x = 0; zo(d, 32, v, l, t ^ 8192); l = (v | 0) > (l | 0) ? v : l; break } t = l - r | 0; s = (q | 0) < (t | 0) ? t : q; K = s + o | 0; l = (v | 0) < (K | 0) ? K : v; zo(d, 32, l, K, m); to(d, p, o); zo(d, 48, l, K, m ^ 65536); zo(d, 48, s, t, 0); to(d, r, t); zo(d, 32, l, K, m ^ 8192); } while (0); n = w; } g: do if ((x | 0) == 92) if (!d) if (!n) e = 0; else { e = 1; while (1) { l = c[i + (e << 2) >> 2] | 0; if (!l) break; vo(h + (e << 3) | 0, l, f, k); e = e + 1 | 0; if (e >>> 0 >= 10) { e = 1; break g } } while (1) { if (c[i + (e << 2) >> 2] | 0) { e = -1; break g } e = e + 1 | 0; if (e >>> 0 >= 10) { e = 1; break } } } while (0); V = J; return e | 0 } function to(a, b, d) { a = a | 0; b = b | 0; d = d | 0; if (!(c[a >> 2] & 32)) jo(b, d, a) | 0; return } function uo(b) { b = b | 0; var d = 0, e = 0; if (!(bo(a[c[b >> 2] >> 0] | 0) | 0)) d = 0; else { d = 0; do { e = c[b >> 2] | 0; d = (d * 10 | 0) + -48 + (a[e >> 0] | 0) | 0; e = e + 1 | 0; c[b >> 2] = e; } while ((bo(a[e >> 0] | 0) | 0) != 0) } return d | 0 } function vo(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; var f = 0, h = 0.0; a: do if (b >>> 0 <= 20) do switch (b | 0) { case 9: { b = (c[d >> 2] | 0) + (4 - 1) & ~(4 - 1); e = c[b >> 2] | 0; c[d >> 2] = b + 4; c[a >> 2] = e; break a } case 10: { e = (c[d >> 2] | 0) + (4 - 1) & ~(4 - 1); b = c[e >> 2] | 0; c[d >> 2] = e + 4; e = a; c[e >> 2] = b; c[e + 4 >> 2] = ((b | 0) < 0) << 31 >> 31; break a } case 11: { e = (c[d >> 2] | 0) + (4 - 1) & ~(4 - 1); b = c[e >> 2] | 0; c[d >> 2] = e + 4; e = a; c[e >> 2] = b; c[e + 4 >> 2] = 0; break a } case 12: { e = (c[d >> 2] | 0) + (8 - 1) & ~(8 - 1); b = e; f = c[b >> 2] | 0; b = c[b + 4 >> 2] | 0; c[d >> 2] = e + 8; e = a; c[e >> 2] = f; c[e + 4 >> 2] = b; break a } case 13: { f = (c[d >> 2] | 0) + (4 - 1) & ~(4 - 1); e = c[f >> 2] | 0; c[d >> 2] = f + 4; e = (e & 65535) << 16 >> 16; f = a; c[f >> 2] = e; c[f + 4 >> 2] = ((e | 0) < 0) << 31 >> 31; break a } case 14: { f = (c[d >> 2] | 0) + (4 - 1) & ~(4 - 1); e = c[f >> 2] | 0; c[d >> 2] = f + 4; f = a; c[f >> 2] = e & 65535; c[f + 4 >> 2] = 0; break a } case 15: { f = (c[d >> 2] | 0) + (4 - 1) & ~(4 - 1); e = c[f >> 2] | 0; c[d >> 2] = f + 4; e = (e & 255) << 24 >> 24; f = a; c[f >> 2] = e; c[f + 4 >> 2] = ((e | 0) < 0) << 31 >> 31; break a } case 16: { f = (c[d >> 2] | 0) + (4 - 1) & ~(4 - 1); e = c[f >> 2] | 0; c[d >> 2] = f + 4; f = a; c[f >> 2] = e & 255; c[f + 4 >> 2] = 0; break a } case 17: { f = (c[d >> 2] | 0) + (8 - 1) & ~(8 - 1); h = +g[f >> 3]; c[d >> 2] = f + 8; g[a >> 3] = h; break a } case 18: { da[e & 15](a, d); break a } default: break a } while (0); while (0); return } function wo(b, c, e, f) { b = b | 0; c = c | 0; e = e | 0; f = f | 0; if (!((b | 0) == 0 & (c | 0) == 0)) do { e = e + -1 | 0; a[e >> 0] = d[640 + (b & 15) >> 0] | 0 | f; b = qr(b | 0, c | 0, 4) | 0; c = u() | 0; } while (!((b | 0) == 0 & (c | 0) == 0)); return e | 0 } function xo(b, c, d) { b = b | 0; c = c | 0; d = d | 0; if (!((b | 0) == 0 & (c | 0) == 0)) do { d = d + -1 | 0; a[d >> 0] = b & 7 | 48; b = qr(b | 0, c | 0, 3) | 0; c = u() | 0; } while (!((b | 0) == 0 & (c | 0) == 0)); return d | 0 } function yo(b, c, d) { b = b | 0; c = c | 0; d = d | 0; var e = 0, f = 0, g = 0; if (c >>> 0 > 0 | (c | 0) == 0 & b >>> 0 > 4294967295) { do { e = b; b = pr(b | 0, c | 0, 10, 0) | 0; f = c; c = u() | 0; g = kr(b | 0, c | 0, 10, 0) | 0; g = mr(e | 0, f | 0, g | 0, u() | 0) | 0; u() | 0; d = d + -1 | 0; a[d >> 0] = g & 255 | 48; } while (f >>> 0 > 9 | (f | 0) == 9 & e >>> 0 > 4294967295); c = b; } else c = b; if (c) do { g = c; c = (c >>> 0) / 10 | 0; d = d + -1 | 0; a[d >> 0] = g - (c * 10 | 0) | 48; } while (g >>> 0 >= 10); return d | 0 } function zo(a, b, c, d, e) { a = a | 0; b = b | 0; c = c | 0; d = d | 0; e = e | 0; var f = 0, g = 0; g = V; V = V + 256 | 0; f = g; if ((c | 0) > (d | 0) & (e & 73728 | 0) == 0) { e = c - d | 0; wr(f | 0, b << 24 >> 24 | 0, (e >>> 0 < 256 ? e : 256) | 0) | 0; if (e >>> 0 > 255) { b = c - d | 0; do { to(a, f, 256); e = e + -256 | 0; } while (e >>> 0 > 255); e = b & 255; } to(a, f, e); } V = g; return } function Ao(a, b) { a = a | 0; b = b | 0; if (!a) a = 0; else a = Bo(a, b, 0) | 0; return a | 0 } function Bo(b, d, e) { b = b | 0; d = d | 0; e = e | 0; do if (b) { if (d >>> 0 < 128) { a[b >> 0] = d; b = 1; break } if (!(c[c[(Co() | 0) + 176 >> 2] >> 2] | 0)) if ((d & -128 | 0) == 57216) { a[b >> 0] = d; b = 1; break } else { c[(ao() | 0) >> 2] = 25; b = -1; break } if (d >>> 0 < 2048) { a[b >> 0] = d >>> 6 | 192; a[b + 1 >> 0] = d & 63 | 128; b = 2; break } if (d >>> 0 < 55296 | (d & -8192 | 0) == 57344) { a[b >> 0] = d >>> 12 | 224; a[b + 1 >> 0] = d >>> 6 & 63 | 128; a[b + 2 >> 0] = d & 63 | 128; b = 3; break } if ((d + -65536 | 0) >>> 0 < 1048576) { a[b >> 0] = d >>> 18 | 240; a[b + 1 >> 0] = d >>> 12 & 63 | 128; a[b + 2 >> 0] = d >>> 6 & 63 | 128; a[b + 3 >> 0] = d & 63 | 128; b = 4; break } else { c[(ao() | 0) >> 2] = 25; b = -1; break } } else b = 1; while (0); return b | 0 } function Co() { return co() | 0 } function Do(a) { a = +a; var b = 0; g[h >> 3] = a; b = c[h >> 2] | 0; t(c[h + 4 >> 2] | 0); return b | 0 } function Eo(a, b) { a = +a; b = b | 0; var d = 0, e = 0, f = 0; g[h >> 3] = a; d = c[h >> 2] | 0; e = c[h + 4 >> 2] | 0; f = qr(d | 0, e | 0, 52) | 0; u() | 0; switch (f & 2047) { case 0: { if (a != 0.0) { a = +Eo(a * 18446744073709551616.0, b); d = (c[b >> 2] | 0) + -64 | 0; } else d = 0; c[b >> 2] = d; break } case 2047: break; default: { c[b >> 2] = (f & 2047) + -1022; c[h >> 2] = d; c[h + 4 >> 2] = e & -2146435073 | 1071644672; a = +g[h >> 3]; } } return +a } function Fo(b, c, d) { b = b | 0; c = c | 0; d = d | 0; var e = 0, f = 0; a: do if (!d) b = 0; else { while (1) { e = a[b >> 0] | 0; f = a[c >> 0] | 0; if (e << 24 >> 24 != f << 24 >> 24) break; d = d + -1 | 0; if (!d) { b = 0; break a } else { b = b + 1 | 0; c = c + 1 | 0; } } b = (e & 255) - (f & 255) | 0; } while (0); return b | 0 } function Go(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0; f = V; V = V + 16 | 0; g = f; c[g >> 2] = e; e = Ho(a, b, d, g) | 0; V = f; return e | 0 } function Ho(b, d, e, f) { b = b | 0; d = d | 0; e = e | 0; f = f | 0; var g = 0, h = 0, i = 0, j = 0; j = V; V = V + 160 | 0; g = j + 144 | 0; i = j; ur(i | 0, 3672, 144) | 0; if ((d + -1 | 0) >>> 0 > 2147483646) if (!d) { b = g; d = 1; h = 4; } else { c[(ao() | 0) >> 2] = 61; d = -1; } else h = 4; if ((h | 0) == 4) { h = -2 - b | 0; h = d >>> 0 > h >>> 0 ? h : d; c[i + 48 >> 2] = h; g = i + 20 | 0; c[g >> 2] = b; c[i + 44 >> 2] = b; d = b + h | 0; b = i + 16 | 0; c[b >> 2] = d; c[i + 28 >> 2] = d; d = oo(i, e, f) | 0; if (h) { i = c[g >> 2] | 0; a[i + (((i | 0) == (c[b >> 2] | 0)) << 31 >> 31) >> 0] = 0; } } V = j; return d | 0 } function Io(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; e = a + 20 | 0; f = c[e >> 2] | 0; a = (c[a + 16 >> 2] | 0) - f | 0; a = a >>> 0 > d >>> 0 ? d : a; ur(f | 0, b | 0, a | 0) | 0; c[e >> 2] = (c[e >> 2] | 0) + a; return d | 0 } function Jo(a) { a = a | 0; var b = 0, c = 0; b = (fo(a) | 0) + 1 | 0; c = dr(b) | 0; if (!c) a = 0; else a = ur(c | 0, a | 0, b | 0) | 0; return a | 0 } function Ko(b, e) { b = b | 0; e = e | 0; var f = 0, g = 0; f = 0; while (1) { if ((d[656 + f >> 0] | 0) == (b | 0)) { g = 4; break } f = f + 1 | 0; if ((f | 0) == 87) { b = 87; g = 5; break } } if ((g | 0) == 4) if (!f) f = 752; else { b = f; g = 5; } if ((g | 0) == 5) { f = 752; do { do { g = f; f = f + 1 | 0; } while ((a[g >> 0] | 0) != 0); b = b + -1 | 0; } while ((b | 0) != 0) } return Lo(f, c[e + 20 >> 2] | 0) | 0 } function Lo(a, b) { a = a | 0; b = b | 0; return ko(a, b) | 0 } function Mo(a) { a = a | 0; return Ko(a, c[(No() | 0) + 176 >> 2] | 0) | 0 } function No() { return co() | 0 } function Oo(b, c, d) { b = b | 0; c = c | 0; d = d | 0; var e = 0; e = Mo(b) | 0; b = fo(e) | 0; if (b >>> 0 >= d >>> 0) { b = d + -1 | 0; if (!d) b = 68; else { ur(c | 0, e | 0, b | 0) | 0; a[c + b >> 0] = 0; b = 68; } } else { ur(c | 0, e | 0, b + 1 | 0) | 0; b = 0; } return b | 0 } function Po() { var a = 0, b = 0, d = 0, e = 0, f = 0, g = 0, h = 0; e = V; V = V + 48 | 0; g = e + 32 | 0; b = e + 24 | 0; h = e + 16 | 0; f = e; e = e + 36 | 0; a = Qo() | 0; if (a | 0 ? (d = c[a >> 2] | 0, d | 0) : 0) { a = d + 48 | 0; if (!(Ro(a) | 0)) { c[b >> 2] = 20420; To(20370, b); } b = So(a) | 0; if ((b | 0) == 1126902529 & (u() | 0) == 1129074247) a = c[d + 44 >> 2] | 0; else a = d + 80 | 0; c[e >> 2] = a; d = c[d >> 2] | 0; a = c[d + 4 >> 2] | 0; if (aa[c[(c[954] | 0) + 16 >> 2] & 7](3816, d, e) | 0) { h = c[e >> 2] | 0; h = Z[c[(c[h >> 2] | 0) + 8 >> 2] & 15](h) | 0; c[f >> 2] = 20420; c[f + 4 >> 2] = a; c[f + 8 >> 2] = h; To(20284, f); } else { c[h >> 2] = 20420; c[h + 4 >> 2] = a; To(20329, h); } } To(20408, g); } function Qo() { return 21640 } function Ro(a) { a = a | 0; a = So(a) | 0; return (a & -256 | 0) == 1126902528 & (u() | 0) == 1129074247 | 0 } function So(a) { a = a | 0; var b = 0; b = a; a = c[b >> 2] | 0; t(c[b + 4 >> 2] | 0); return a | 0 } function To(a, b) { a = a | 0; b = b | 0; U(); } function Uo(a) { a = a | 0; return } function Vo(a) { a = a | 0; Uo(a); jp(a); return } function Wo(a) { a = a | 0; return } function Xo(a) { a = a | 0; return } function Yo(d, e, f) { d = d | 0; e = e | 0; f = f | 0; var g = 0, h = 0, i = 0, j = 0, k = 0, l = 0; l = V; V = V + 64 | 0; j = l; if (!(ap(d, e, 0) | 0)) if ((e | 0) != 0 ? (k = ep(e, 3840, 3824, 0) | 0, (k | 0) != 0) : 0) { c[j >> 2] = k; c[j + 4 >> 2] = 0; c[j + 8 >> 2] = d; c[j + 12 >> 2] = -1; d = j + 16 | 0; e = j + 24 | 0; g = j + 48 | 0; h = d; i = h + 36 | 0; do { c[h >> 2] = 0; h = h + 4 | 0; } while ((h | 0) < (i | 0)); b[d + 36 >> 1] = 0; a[d + 38 >> 0] = 0; c[g >> 2] = 1; fa[c[(c[k >> 2] | 0) + 28 >> 2] & 7](k, j, c[f >> 2] | 0, 1); if ((c[e >> 2] | 0) == 1) { c[f >> 2] = c[d >> 2]; d = 1; } else d = 0; } else d = 0; else d = 1; V = l; return d | 0 } function Zo(a, b, d, e, f, g) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; f = f | 0; g = g | 0; if (ap(a, c[b + 8 >> 2] | 0, g) | 0) dp(0, b, d, e, f); return } function _o(b, d, e, f, g) { b = b | 0; d = d | 0; e = e | 0; f = f | 0; g = g | 0; var h = 0; do if (!(ap(b, c[d + 8 >> 2] | 0, g) | 0)) { if (ap(b, c[d >> 2] | 0, g) | 0) { if ((c[d + 16 >> 2] | 0) != (e | 0) ? (h = d + 20 | 0, (c[h >> 2] | 0) != (e | 0)) : 0) { c[d + 32 >> 2] = f; c[h >> 2] = e; g = d + 40 | 0; c[g >> 2] = (c[g >> 2] | 0) + 1; if ((c[d + 36 >> 2] | 0) == 1 ? (c[d + 24 >> 2] | 0) == 2 : 0) a[d + 54 >> 0] = 1; c[d + 44 >> 2] = 4; break } if ((f | 0) == 1) c[d + 32 >> 2] = 1; } } else cp(0, d, e, f); while (0); return } function $o(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; if (ap(a, c[b + 8 >> 2] | 0, 0) | 0) bp(0, b, d, e); return } function ap(a, b, d) { a = a | 0; b = b | 0; d = d | 0; if (d) if ((a | 0) == (b | 0)) a = 1; else a = (eo(c[a + 4 >> 2] | 0, c[b + 4 >> 2] | 0) | 0) == 0; else a = (c[a + 4 >> 2] | 0) == (c[b + 4 >> 2] | 0); return a | 0 } function bp(b, d, e, f) { b = b | 0; d = d | 0; e = e | 0; f = f | 0; var g = 0; b = d + 16 | 0; g = c[b >> 2] | 0; do if (g) { if ((g | 0) != (e | 0)) { f = d + 36 | 0; c[f >> 2] = (c[f >> 2] | 0) + 1; c[d + 24 >> 2] = 2; a[d + 54 >> 0] = 1; break } b = d + 24 | 0; if ((c[b >> 2] | 0) == 2) c[b >> 2] = f; } else { c[b >> 2] = e; c[d + 24 >> 2] = f; c[d + 36 >> 2] = 1; } while (0); return } function cp(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; var f = 0; if ((c[b + 4 >> 2] | 0) == (d | 0) ? (f = b + 28 | 0, (c[f >> 2] | 0) != 1) : 0) c[f >> 2] = e; return } function dp(b, d, e, f, g) { b = b | 0; d = d | 0; e = e | 0; f = f | 0; g = g | 0; a[d + 53 >> 0] = 1; do if ((c[d + 4 >> 2] | 0) == (f | 0)) { a[d + 52 >> 0] = 1; b = d + 16 | 0; f = c[b >> 2] | 0; if (!f) { c[b >> 2] = e; c[d + 24 >> 2] = g; c[d + 36 >> 2] = 1; if (!((g | 0) == 1 ? (c[d + 48 >> 2] | 0) == 1 : 0)) break; a[d + 54 >> 0] = 1; break } if ((f | 0) != (e | 0)) { g = d + 36 | 0; c[g >> 2] = (c[g >> 2] | 0) + 1; a[d + 54 >> 0] = 1; break } f = d + 24 | 0; b = c[f >> 2] | 0; if ((b | 0) == 2) { c[f >> 2] = g; b = g; } if ((b | 0) == 1 ? (c[d + 48 >> 2] | 0) == 1 : 0) a[d + 54 >> 0] = 1; } while (0); return } function ep(d, e, f, g) { d = d | 0; e = e | 0; f = f | 0; g = g | 0; var h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0; p = V; V = V + 64 | 0; n = p; m = c[d >> 2] | 0; o = d + (c[m + -8 >> 2] | 0) | 0; m = c[m + -4 >> 2] | 0; c[n >> 2] = f; c[n + 4 >> 2] = d; c[n + 8 >> 2] = e; c[n + 12 >> 2] = g; d = n + 16 | 0; e = n + 20 | 0; g = n + 24 | 0; h = n + 28 | 0; i = n + 32 | 0; j = n + 40 | 0; k = d; l = k + 36 | 0; do { c[k >> 2] = 0; k = k + 4 | 0; } while ((k | 0) < (l | 0)); b[d + 36 >> 1] = 0; a[d + 38 >> 0] = 0; a: do if (ap(m, f, 0) | 0) { c[n + 48 >> 2] = 1; ha[c[(c[m >> 2] | 0) + 20 >> 2] & 3](m, n, o, o, 1, 0); d = (c[g >> 2] | 0) == 1 ? o : 0; } else { ga[c[(c[m >> 2] | 0) + 24 >> 2] & 3](m, n, o, 1, 0); switch (c[n + 36 >> 2] | 0) { case 0: { d = (c[j >> 2] | 0) == 1 & (c[h >> 2] | 0) == 1 & (c[i >> 2] | 0) == 1 ? c[e >> 2] | 0 : 0; break a } case 1: break; default: { d = 0; break a } } if ((c[g >> 2] | 0) != 1 ? !((c[j >> 2] | 0) == 0 & (c[h >> 2] | 0) == 1 & (c[i >> 2] | 0) == 1) : 0) { d = 0; break } d = c[d >> 2] | 0; } while (0); V = p; return d | 0 } function fp(a) { a = a | 0; Uo(a); jp(a); return } function gp(a, b, d, e, f, g) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; f = f | 0; g = g | 0; if (ap(a, c[b + 8 >> 2] | 0, g) | 0) dp(0, b, d, e, f); else { a = c[a + 8 >> 2] | 0; ha[c[(c[a >> 2] | 0) + 20 >> 2] & 3](a, b, d, e, f, g); } return } function hp(b, d, e, f, g) { b = b | 0; d = d | 0; e = e | 0; f = f | 0; g = g | 0; var h = 0, i = 0, j = 0; a: do if (!(ap(b, c[d + 8 >> 2] | 0, g) | 0)) { if (!(ap(b, c[d >> 2] | 0, g) | 0)) { i = c[b + 8 >> 2] | 0; ga[c[(c[i >> 2] | 0) + 24 >> 2] & 3](i, d, e, f, g); break } if ((c[d + 16 >> 2] | 0) != (e | 0) ? (i = d + 20 | 0, (c[i >> 2] | 0) != (e | 0)) : 0) { c[d + 32 >> 2] = f; f = d + 44 | 0; do if ((c[f >> 2] | 0) != 4) { h = d + 52 | 0; a[h >> 0] = 0; j = d + 53 | 0; a[j >> 0] = 0; b = c[b + 8 >> 2] | 0; ha[c[(c[b >> 2] | 0) + 20 >> 2] & 3](b, d, e, e, 1, g); if (a[j >> 0] | 0) { j = (a[h >> 0] | 0) == 0; c[f >> 2] = 3; if (j) break; else break a } else { c[f >> 2] = 4; break } } while (0); c[i >> 2] = e; j = d + 40 | 0; c[j >> 2] = (c[j >> 2] | 0) + 1; if ((c[d + 36 >> 2] | 0) != 1) break; if ((c[d + 24 >> 2] | 0) != 2) break; a[d + 54 >> 0] = 1; break } if ((f | 0) == 1) c[d + 32 >> 2] = 1; } else cp(0, d, e, f); while (0); return } function ip(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; if (ap(a, c[b + 8 >> 2] | 0, 0) | 0) bp(0, b, d, e); else { a = c[a + 8 >> 2] | 0; fa[c[(c[a >> 2] | 0) + 28 >> 2] & 7](a, b, d, e); } return } function jp(a) { a = a | 0; er(a); return } function kp(a) { a = a | 0; return } function lp() { var a = 0, b = 0; a = Qo() | 0; if ((a | 0 ? (b = c[a >> 2] | 0, b | 0) : 0) ? Ro(b + 48 | 0) | 0 : 0) mp(c[b + 12 >> 2] | 0); mp(np() | 0); } function mp(a) { a = a | 0; var b = 0; b = V; V = V + 16 | 0; ba[a & 3](); To(20559, b); } function np() { return 2 } function op(a) { a = a | 0; return } function pp(a) { a = a | 0; jp(a); return } function qp(a) { a = a | 0; return 20599 } function rp(a) { a = a | 0; c[a >> 2] = 5916; vp(a + 4 | 0); return } function sp(a) { a = a | 0; rp(a); jp(a); return } function tp(a) { a = a | 0; return up(a + 4 | 0) | 0 } function up(a) { a = a | 0; return c[a >> 2] | 0 } function vp(a) { a = a | 0; var b = 0, d = 0; if (wp(a) | 0 ? (b = xp(c[a >> 2] | 0) | 0, d = b + 8 | 0, a = c[d >> 2] | 0, c[d >> 2] = a + -1, (a | 0) < 1) : 0) jp(b); return } function wp(a) { a = a | 0; return 1 } function xp(a) { a = a | 0; return a + -12 | 0 } function yp(a) { a = a | 0; c[a >> 2] = 5936; vp(a + 4 | 0); return } function zp(a) { a = a | 0; yp(a); jp(a); return } function Ap(a) { a = a | 0; return up(a + 4 | 0) | 0 } function Bp(a) { a = a | 0; rp(a); jp(a); return } function Cp(a) { a = a | 0; rp(a); jp(a); return } function Dp() { var a = 0; a = V; V = V + 16 | 0; To(20848, a); } function Ep(a) { a = a | 0; Uo(a); jp(a); return } function Fp(a, b, c) { a = a | 0; b = b | 0; c = c | 0; return ap(a, b, 0) | 0 } function Gp(a) { a = a | 0; Uo(a); jp(a); return } function Hp(d, e, f) { d = d | 0; e = e | 0; f = f | 0; var g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0; n = V; V = V + 64 | 0; l = n; do if (!(ap(e, 4048, 0) | 0)) { if (Ip(d, e, 0) | 0) { e = c[f >> 2] | 0; if (!e) { e = 1; break } c[f >> 2] = c[e >> 2]; e = 1; break } if ((e | 0) != 0 ? (g = ep(e, 3840, 3976, 0) | 0, (g | 0) != 0) : 0) { e = c[f >> 2] | 0; if (e | 0) c[f >> 2] = c[e >> 2]; e = c[g + 8 >> 2] | 0; i = d + 8 | 0; h = c[i >> 2] | 0; if ((e & 7 & (h ^ 7) | 0) == 0 ? ((e & 96 ^ 96) & h | 0) == 0 : 0) { h = d + 12 | 0; d = c[h >> 2] | 0; g = g + 12 | 0; e = c[g >> 2] | 0; if (!(ap(d, e, 0) | 0)) { if (ap(d, 4040, 0) | 0) { if (!e) { e = 1; break } e = (ep(e, 3840, 3992, 0) | 0) == 0; break } if (d) { e = ep(d, 3840, 3976, 0) | 0; if (e | 0) { if (!(c[i >> 2] & 1)) { e = 0; break } e = Jp(e, c[g >> 2] | 0) | 0; break } e = c[h >> 2] | 0; if (e) { e = ep(e, 3840, 4008, 0) | 0; if (e | 0) { if (!(c[i >> 2] & 1)) { e = 0; break } e = Kp(e, c[g >> 2] | 0) | 0; break } e = c[h >> 2] | 0; if ((((e | 0) != 0 ? (j = ep(e, 3840, 3824, 0) | 0, (j | 0) != 0) : 0) ? (k = c[g >> 2] | 0, (k | 0) != 0) : 0) ? (m = ep(k, 3840, 3824, 0) | 0, (m | 0) != 0) : 0) { c[l >> 2] = m; c[l + 4 >> 2] = 0; c[l + 8 >> 2] = j; c[l + 12 >> 2] = -1; e = l + 16 | 0; d = l + 24 | 0; g = l + 48 | 0; h = e; i = h + 36 | 0; do { c[h >> 2] = 0; h = h + 4 | 0; } while ((h | 0) < (i | 0)); b[e + 36 >> 1] = 0; a[e + 38 >> 0] = 0; c[g >> 2] = 1; fa[c[(c[m >> 2] | 0) + 28 >> 2] & 7](m, l, c[f >> 2] | 0, 1); do if ((c[d >> 2] | 0) == 1) { if (!(c[f >> 2] | 0)) { e = 1; break } c[f >> 2] = c[e >> 2]; e = 1; } else e = 0; while (0) } else e = 0; } else e = 0; } else e = 0; } else e = 1; } else e = 0; } else e = 0; } else { c[f >> 2] = 0; e = 1; } while (0); V = n; return e | 0 } function Ip(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; if (!(c[a + 8 >> 2] & 24)) if ((b | 0) != 0 ? (e = ep(b, 3840, 3960, 0) | 0, (e | 0) != 0) : 0) { d = (c[e + 8 >> 2] & 24 | 0) != 0; f = 5; } else d = 0; else { d = 1; f = 5; } if ((f | 0) == 5) d = ap(a, b, d) | 0; return d | 0 } function Jp(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0, g = 0, h = 0; while (1) { if (!b) { b = 0; break } d = ep(b, 3840, 3976, 0) | 0; if (!d) { b = 0; break } f = c[a + 8 >> 2] | 0; if (c[d + 8 >> 2] & ~f | 0) { b = 0; break } e = a + 12 | 0; b = c[e >> 2] | 0; d = d + 12 | 0; if (ap(b, c[d >> 2] | 0, 0) | 0) { b = 1; break } if ((f & 1 | 0) == 0 | (b | 0) == 0) { b = 0; break } a = ep(b, 3840, 3976, 0) | 0; if (!a) { h = 9; break } b = c[d >> 2] | 0; } if ((h | 0) == 9) { b = c[e >> 2] | 0; if ((b | 0) != 0 ? (g = ep(b, 3840, 4008, 0) | 0, (g | 0) != 0) : 0) b = Kp(g, c[d >> 2] | 0) | 0; else b = 0; } return b | 0 } function Kp(a, b) { a = a | 0; b = b | 0; var d = 0; if ((((b | 0) != 0 ? (d = ep(b, 3840, 4008, 0) | 0, (d | 0) != 0) : 0) ? (c[d + 8 >> 2] & ~c[a + 8 >> 2] | 0) == 0 : 0) ? ap(c[a + 12 >> 2] | 0, c[d + 12 >> 2] | 0, 0) | 0 : 0) a = ap(c[a + 16 >> 2] | 0, c[d + 16 >> 2] | 0, 0) | 0; else a = 0; return a | 0 } function Lp(a) { a = a | 0; Uo(a); jp(a); return } function Mp(b, d, e, f, g, h) { b = b | 0; d = d | 0; e = e | 0; f = f | 0; g = g | 0; h = h | 0; var i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, q = 0, r = 0; if (ap(b, c[d + 8 >> 2] | 0, h) | 0) dp(0, d, e, f, g); else { r = d + 52 | 0; j = a[r >> 0] | 0; q = d + 53 | 0; i = a[q >> 0] | 0; p = c[b + 12 >> 2] | 0; m = b + 16 + (p << 3) | 0; a[r >> 0] = 0; a[q >> 0] = 0; Qp(b + 16 | 0, d, e, f, g, h); k = a[r >> 0] | 0; j = k | j; l = a[q >> 0] | 0; i = l | i; a: do if ((p | 0) > 1) { n = d + 24 | 0; o = b + 8 | 0; p = d + 54 | 0; b = b + 24 | 0; do { i = i & 1; j = j & 1; if (a[p >> 0] | 0) break a; if (!(k << 24 >> 24)) { if (l << 24 >> 24 ? (c[o >> 2] & 1 | 0) == 0 : 0) break a } else { if ((c[n >> 2] | 0) == 1) break a; if (!(c[o >> 2] & 2)) break a } a[r >> 0] = 0; a[q >> 0] = 0; Qp(b, d, e, f, g, h); k = a[r >> 0] | 0; j = k | j; l = a[q >> 0] | 0; i = l | i; b = b + 8 | 0; } while (b >>> 0 < m >>> 0) } while (0); a[r >> 0] = j << 24 >> 24 != 0 & 1; a[q >> 0] = i << 24 >> 24 != 0 & 1; } return } function Np(b, d, e, f, g) { b = b | 0; d = d | 0; e = e | 0; f = f | 0; g = g | 0; var h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0; a: do if (!(ap(b, c[d + 8 >> 2] | 0, g) | 0)) { if (!(ap(b, c[d >> 2] | 0, g) | 0)) { p = c[b + 12 >> 2] | 0; k = b + 16 + (p << 3) | 0; Rp(b + 16 | 0, d, e, f, g); h = b + 24 | 0; if ((p | 0) <= 1) break; b = c[b + 8 >> 2] | 0; if ((b & 2 | 0) == 0 ? (j = d + 36 | 0, (c[j >> 2] | 0) != 1) : 0) { if (!(b & 1)) { b = d + 54 | 0; while (1) { if (a[b >> 0] | 0) break a; if ((c[j >> 2] | 0) == 1) break a; Rp(h, d, e, f, g); h = h + 8 | 0; if (h >>> 0 >= k >>> 0) break a } } b = d + 24 | 0; i = d + 54 | 0; while (1) { if (a[i >> 0] | 0) break a; if ((c[j >> 2] | 0) == 1 ? (c[b >> 2] | 0) == 1 : 0) break a; Rp(h, d, e, f, g); h = h + 8 | 0; if (h >>> 0 >= k >>> 0) break a } } b = d + 54 | 0; while (1) { if (a[b >> 0] | 0) break a; Rp(h, d, e, f, g); h = h + 8 | 0; if (h >>> 0 >= k >>> 0) break a } } if ((c[d + 16 >> 2] | 0) != (e | 0) ? (p = d + 20 | 0, (c[p >> 2] | 0) != (e | 0)) : 0) { c[d + 32 >> 2] = f; o = d + 44 | 0; if ((c[o >> 2] | 0) != 4) { j = b + 16 + (c[b + 12 >> 2] << 3) | 0; k = d + 52 | 0; f = d + 53 | 0; l = d + 54 | 0; m = b + 8 | 0; n = d + 24 | 0; h = 0; i = b + 16 | 0; b = 0; b: while (1) { if (i >>> 0 >= j >>> 0) { i = 18; break } a[k >> 0] = 0; a[f >> 0] = 0; Qp(i, d, e, e, 1, g); if (a[l >> 0] | 0) { i = 18; break } do if (a[f >> 0] | 0) { if (!(a[k >> 0] | 0)) if (!(c[m >> 2] & 1)) { i = 19; break b } else { b = 1; break } if ((c[n >> 2] | 0) == 1) { h = 1; i = 19; break b } if (!(c[m >> 2] & 2)) { h = 1; i = 19; break b } else { h = 1; b = 1; } } while (0); i = i + 8 | 0; } if ((i | 0) == 18) if (b) i = 19; else b = 4; if ((i | 0) == 19) b = 3; c[o >> 2] = b; if (h & 1) break } c[p >> 2] = e; e = d + 40 | 0; c[e >> 2] = (c[e >> 2] | 0) + 1; if ((c[d + 36 >> 2] | 0) != 1) break; if ((c[d + 24 >> 2] | 0) != 2) break; a[d + 54 >> 0] = 1; break } if ((f | 0) == 1) c[d + 32 >> 2] = 1; } else cp(0, d, e, f); while (0); return } function Op(b, d, e, f) { b = b | 0; d = d | 0; e = e | 0; f = f | 0; var g = 0, h = 0; a: do if (!(ap(b, c[d + 8 >> 2] | 0, 0) | 0)) { h = c[b + 12 >> 2] | 0; g = b + 16 + (h << 3) | 0; Pp(b + 16 | 0, d, e, f); if ((h | 0) > 1) { h = d + 54 | 0; b = b + 24 | 0; do { Pp(b, d, e, f); if (a[h >> 0] | 0) break a; b = b + 8 | 0; } while (b >>> 0 < g >>> 0) } } else bp(0, d, e, f); while (0); return } function Pp(a, b, d, e) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0; g = c[a + 4 >> 2] | 0; if (d) { f = g >> 8; if (g & 1) f = c[(c[d >> 2] | 0) + f >> 2] | 0; } else f = 0; a = c[a >> 2] | 0; fa[c[(c[a >> 2] | 0) + 28 >> 2] & 7](a, b, d + f | 0, (g & 2 | 0) == 0 ? 2 : e); return } function Qp(a, b, d, e, f, g) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; f = f | 0; g = g | 0; var h = 0, i = 0; i = c[a + 4 >> 2] | 0; h = i >> 8; if (i & 1) h = c[(c[e >> 2] | 0) + h >> 2] | 0; a = c[a >> 2] | 0; ha[c[(c[a >> 2] | 0) + 20 >> 2] & 3](a, b, d, e + h | 0, (i & 2 | 0) == 0 ? 2 : f, g); return } function Rp(a, b, d, e, f) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; f = f | 0; var g = 0, h = 0; h = c[a + 4 >> 2] | 0; g = h >> 8; if (h & 1) g = c[(c[d >> 2] | 0) + g >> 2] | 0; a = c[a >> 2] | 0; ga[c[(c[a >> 2] | 0) + 24 >> 2] & 3](a, b, d + g | 0, (h & 2 | 0) == 0 ? 2 : e, f); return } function Sp(a) { a = a | 0; c[a >> 2] = 5896; return } function Tp(a) { a = a | 0; var b = 0, c = 0; b = V; V = V + 16 | 0; c = b; Up(c, a); a = Vp(c) | 0; V = b; return a | 0 } function Up(a, b) { a = a | 0; b = b | 0; _p(a, b); return } function Vp(a) { a = a | 0; var b = 0, d = 0; b = V; V = V + 16 | 0; d = b; Wp(d, c[a + 4 >> 2] | 0); if (!((Xp(d) | 0) << 24 >> 24)) a = Zp(Yp(a) | 0) | 0; else a = 0; V = b; return a | 0 } function Wp(a, b) { a = a | 0; b = b | 0; c[a >> 2] = b; return } function Xp(b) { b = b | 0; return a[c[b >> 2] >> 0] | 0 } function Yp(a) { a = a | 0; return a | 0 } function Zp(b) { b = b | 0; var d = 0, e = 0, f = 0, g = 0; g = V; V = V + 16 | 0; f = g; b = c[b + 8 >> 2] | 0; d = a[b >> 0] | 0; do if (d << 24 >> 24 != 1) if (!(d & 2)) { a[b >> 0] = 2; e = 1; break } else To(20985, f); else e = 0; while (0); V = g; return e | 0 } function _p(a, b) { a = a | 0; b = b | 0; c[a >> 2] = b; c[a + 4 >> 2] = b; c[a + 8 >> 2] = b + 1; c[a + 12 >> 2] = 0; return } function $p(a) { a = a | 0; var b = 0, c = 0; b = V; V = V + 16 | 0; c = b; Up(c, a); aq(c); V = b; return } function aq(a) { a = a | 0; var b = 0, d = 0; b = V; V = V + 16 | 0; d = b; Wp(d, c[a + 4 >> 2] | 0); bq(d); cq(Yp(a) | 0); V = b; return } function bq(b) { b = b | 0; a[c[b >> 2] >> 0] = 1; return } function cq(b) { b = b | 0; a[c[b + 8 >> 2] >> 0] = 1; return } function dq() { return 0 } function eq(a) { a = a | 0; var b = 0, c = 0; c = (a | 0) == 0 ? 1 : a; while (1) { b = dr(c) | 0; if (b | 0) { a = 6; break } a = dq() | 0; if (!a) { a = 5; break } ba[a & 3](); } if ((a | 0) == 5) { c = v(4) | 0; Sp(c); x(c | 0, 3880, 121); } else if ((a | 0) == 6) return b | 0; return 0 } function fq(a) { a = a | 0; return eq(a) | 0 } function gq(a) { a = a | 0; jp(a); return } function hq(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; f = V; V = V + 16 | 0; e = f; c[e >> 2] = c[d >> 2]; a = aa[c[(c[a >> 2] | 0) + 16 >> 2] & 7](a, b, e) | 0; if (a) c[d >> 2] = c[e >> 2]; V = f; return a & 1 | 0 } function iq(a) { a = a | 0; if (!a) a = 0; else a = (ep(a, 3840, 3976, 0) | 0) != 0 & 1; return a | 0 } function jq(a) { a = a | 0; return 0 } function kq() { return (lq() | 0) > 0 | 0 } function lq() { return y() | 0 } function mq(a) { a = a | 0; return } function nq(a) { a = a | 0; mq(a); jp(a); return } function oq(a) { a = a | 0; return 21039 } function pq(a) { a = a | 0; return } function qq(a) { a = a | 0; var b = 0, d = 0; b = a + 8 | 0; if (!((c[b >> 2] | 0) != 0 ? (d = c[b >> 2] | 0, c[b >> 2] = d + -1, (d | 0) != 0) : 0)) ca[c[(c[a >> 2] | 0) + 16 >> 2] & 255](a); return } function rq(a) { a = a | 0; a = jq(a) | 0; if (!a) return; else br(a, 21145); } function sq(a) { a = a | 0; return } function tq(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0; e = fo(b) | 0; d = eq(e + 13 | 0) | 0; c[d >> 2] = e; c[d + 4 >> 2] = e; c[d + 8 >> 2] = 0; d = uq(d) | 0; ur(d | 0, b | 0, e + 1 | 0) | 0; c[a >> 2] = d; return } function uq(a) { a = a | 0; return a + 12 | 0 } function vq(a, b) { a = a | 0; b = b | 0; c[a >> 2] = 5916; tq(a + 4 | 0, b); return } function wq(b, d) { b = b | 0; d = d | 0; c[b >> 2] = 5936; tq(b + 4 | 0, (a[d + 11 >> 0] | 0) < 0 ? c[d >> 2] | 0 : d); return } function xq(a, b) { a = a | 0; b = b | 0; c[a >> 2] = 5936; tq(a + 4 | 0, b); return } function yq(a) { a = a | 0; a = v(8) | 0; vq(a, 21163); c[a >> 2] = 5956; x(a | 0, 3928, 123); } function zq(a) { a = a | 0; a = v(8) | 0; vq(a, 21163); c[a >> 2] = 5976; x(a | 0, 3944, 123); } function Aq(b, d, e) { b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0, i = 0; g = V; V = V + 16 | 0; f = g; if (e >>> 0 > 4294967279) yq(b); if (e >>> 0 < 11) a[b + 11 >> 0] = e; else { i = e + 16 & -16; h = eq(i) | 0; c[b >> 2] = h; c[b + 8 >> 2] = i | -2147483648; c[b + 4 >> 2] = e; b = h; } Bq(b, d, e) | 0; a[f >> 0] = 0; nb(b + e | 0, f); V = g; return } function Bq(a, b, c) { a = a | 0; b = b | 0; c = c | 0; if (c | 0) ur(a | 0, b | 0, c | 0) | 0; return a | 0 } function Cq(b) { b = b | 0; if ((a[b + 11 >> 0] | 0) < 0) Da(c[b >> 2] | 0, c[b + 8 >> 2] & 2147483647); return } function Dq(b, d, e, f, g, h, i, j) { b = b | 0; d = d | 0; e = e | 0; f = f | 0; g = g | 0; h = h | 0; i = i | 0; j = j | 0; var k = 0, l = 0, m = 0, n = 0, o = 0; o = V; V = V + 16 | 0; n = o; if ((-18 - d | 0) >>> 0 < e >>> 0) yq(b); if ((a[b + 11 >> 0] | 0) < 0) m = c[b >> 2] | 0; else m = b; if (d >>> 0 < 2147483623) { k = e + d | 0; l = d << 1; k = k >>> 0 < l >>> 0 ? l : k; k = k >>> 0 < 11 ? 11 : k + 16 & -16; } else k = -17; l = eq(k) | 0; if (g | 0) Bq(l, m, g) | 0; if (i | 0) Bq(l + g | 0, j, i) | 0; f = f - h | 0; e = f - g | 0; if (e | 0) Bq(l + g + i | 0, m + g + h | 0, e) | 0; e = d + 1 | 0; if ((e | 0) != 11) Da(m, e); c[b >> 2] = l; c[b + 8 >> 2] = k | -2147483648; i = f + i | 0; c[b + 4 >> 2] = i; a[n >> 0] = 0; nb(l + i | 0, n); V = o; return } function Eq(b, d, e) { b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0, i = 0, j = 0, k = 0; k = V; V = V + 16 | 0; i = k; j = b + 11 | 0; f = a[j >> 0] | 0; h = f << 24 >> 24 < 0; if (h) { g = (c[b + 8 >> 2] & 2147483647) + -1 | 0; f = c[b + 4 >> 2] | 0; } else { g = 10; f = f & 255; } if ((g - f | 0) >>> 0 >= e >>> 0) { if (e | 0) { if (h) g = c[b >> 2] | 0; else g = b; Bq(g + f | 0, d, e) | 0; f = f + e | 0; if ((a[j >> 0] | 0) < 0) c[b + 4 >> 2] = f; else a[j >> 0] = f; a[i >> 0] = 0; nb(g + f | 0, i); } } else Dq(b, g, f + e - g | 0, f, f, 0, e, d); V = k; return b | 0 } function Fq(a, b) { a = a | 0; b = b | 0; return Eq(a, b, lb(b) | 0) | 0 } function Gq(a, b, c) { a = a | 0; b = b | 0; c = c | 0; if (!c) a = 0; else a = Fo(a, b, c) | 0; return a | 0 } function Hq(b, d, e, f, g) { b = b | 0; d = d | 0; e = e | 0; f = f | 0; g = g | 0; var h = 0, i = 0; h = a[b + 11 >> 0] | 0; i = h << 24 >> 24 < 0; if (i) h = c[b + 4 >> 2] | 0; else h = h & 255; if ((g | 0) == -1 | h >>> 0 < d >>> 0) zq(b); h = h - d | 0; e = h >>> 0 < e >>> 0 ? h : e; if (i) b = c[b >> 2] | 0; h = e >>> 0 > g >>> 0; b = Gq(b + d | 0, f, h ? g : e) | 0; if (!b) return (e >>> 0 < g >>> 0 ? -1 : h & 1) | 0; else return b | 0; return 0 } function Iq(a) { a = a | 0; return } function Jq(a) { a = a | 0; jp(a); return } function Kq(a) { a = a | 0; return 21228 } function Lq(a, b, d) { a = a | 0; b = b | 0; d = d | 0; c[a >> 2] = d; c[a + 4 >> 2] = b; return } function Mq(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0; f = V; V = V + 16 | 0; e = f; ea[c[(c[a >> 2] | 0) + 12 >> 2] & 15](e, a, b); if ((c[e + 4 >> 2] | 0) == (c[d + 4 >> 2] | 0)) a = (c[e >> 2] | 0) == (c[d >> 2] | 0); else a = 0; V = f; return a | 0 } function Nq(a, b, d) { a = a | 0; b = b | 0; d = d | 0; return ((c[b >> 2] | 0) == (d | 0) ? (c[b + 4 >> 2] | 0) == (a | 0) : 0) | 0 } function Oq(a, b, c) { a = a | 0; b = b | 0; c = c | 0; if ((c | 0) > 256) Aq(a, 21176, lb(21176) | 0); else Pq(a, 0, c); return } function Pq(a, b, c) { a = a | 0; b = b | 0; c = c | 0; Qq(a, c); return } function Qq(b, d) { b = b | 0; d = d | 0; var e = 0, f = 0, g = 0, h = 0, i = 0; i = V; V = V + 1040 | 0; g = i + 1024 | 0; e = i; h = c[(ao() | 0) >> 2] | 0; f = Rq(Oo(d, e, 1024) | 0, e) | 0; if (!(a[f >> 0] | 0)) { c[g >> 2] = d; Go(e, 1024, 21211, g) | 0; } else e = f; c[(ao() | 0) >> 2] = h; Aq(b, e, lb(e) | 0); V = i; return } function Rq(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0; switch (a | 0) { case 0: { d = b; break } case -1: { a = c[(ao() | 0) >> 2] | 0; e = 3; break } default: e = 3; } if ((e | 0) == 3) if ((a | 0) == 28) d = 22145; else P(); return d | 0 } function Sq(a) { a = a | 0; jp(a); return } function Tq(a) { a = a | 0; return 21353 } function Uq(a, b, d) { a = a | 0; b = b | 0; d = d | 0; if ((d | 0) > 256) { Wq() | 0; b = 6180; } else { Xq() | 0; b = 6176; } c[a >> 2] = d; c[a + 4 >> 2] = b; return } function Vq(a, b, c) { a = a | 0; b = b | 0; c = c | 0; if ((c | 0) > 256) Aq(a, 21319, lb(21319) | 0); else Pq(a, 0, c); return } function Wq() { if ((a[21488] | 0) == 0 ? Tp(21488) | 0 : 0) $p(21488); return 6180 } function Xq() { if ((a[21480] | 0) == 0 ? Tp(21480) | 0 : 0) $p(21480); return 6176 } function Yq(a) { a = a | 0; yp(a); return } function Zq(a) { a = a | 0; Yq(a); jp(a); return } function _q(a, b) { a = a | 0; b = b | 0; var d = 0; d = c[b + 4 >> 2] | 0; ea[c[(c[d >> 2] | 0) + 24 >> 2] & 15](a, d, c[b >> 2] | 0); return } function $q(b, d, e) { b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0; h = V; V = V + 16 | 0; g = h; if (c[d >> 2] | 0) { f = a[e + 11 >> 0] | 0; if (f << 24 >> 24 < 0) f = c[e + 4 >> 2] | 0; else f = f & 255; if (f | 0) Fq(e, 21417) | 0; _q(g, d); d = a[g + 11 >> 0] | 0; f = d << 24 >> 24 < 0; Eq(e, f ? c[g >> 2] | 0 : g, f ? c[g + 4 >> 2] | 0 : d & 255) | 0; Cq(g); }; c[b >> 2] = c[e >> 2]; c[b + 4 >> 2] = c[e + 4 >> 2]; c[b + 8 >> 2] = c[e + 8 >> 2]; f = 0; while (1) { if ((f | 0) == 3) break; c[e + (f << 2) >> 2] = 0; f = f + 1 | 0; } V = h; return } function ar(a, b, d) { a = a | 0; b = b | 0; d = d | 0; var e = 0, f = 0, g = 0; e = V; V = V + 32 | 0; g = e + 12 | 0; f = e; Aq(f, d, lb(d) | 0); $q(g, b, f); wq(a, g); Cq(g); Cq(f); c[a >> 2] = 6192; f = b; b = c[f + 4 >> 2] | 0; d = a + 8 | 0; c[d >> 2] = c[f >> 2]; c[d + 4 >> 2] = b; V = e; return } function br(a, b) { a = a | 0; b = b | 0; var d = 0, e = 0, f = 0; f = V; V = V + 16 | 0; e = f + 8 | 0; d = v(16) | 0; Wq() | 0; c[f >> 2] = a; c[f + 4 >> 2] = 6180; c[e >> 2] = c[f >> 2]; c[e + 4 >> 2] = c[f + 4 >> 2]; ar(d, e, b); x(d | 0, 4272, 136); } function cr(a) { a = a | 0; a = v(8) | 0; vq(a, 21420); c[a >> 2] = 5956; x(a | 0, 3928, 123); } function dr(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, q = 0, r = 0, s = 0, t = 0, u = 0, v = 0, w = 0; w = V; V = V + 16 | 0; n = w; do if (a >>> 0 < 245) { k = a >>> 0 < 11 ? 16 : a + 11 & -8; a = k >>> 3; m = c[5412] | 0; d = m >>> a; if (d & 3 | 0) { b = (d & 1 ^ 1) + a | 0; a = 21688 + (b << 1 << 2) | 0; d = a + 8 | 0; e = c[d >> 2] | 0; f = e + 8 | 0; g = c[f >> 2] | 0; if ((g | 0) == (a | 0)) c[5412] = m & ~(1 << b); else { c[g + 12 >> 2] = a; c[d >> 2] = g; } v = b << 3; c[e + 4 >> 2] = v | 3; v = e + v + 4 | 0; c[v >> 2] = c[v >> 2] | 1; v = f; V = w; return v | 0 } l = c[5414] | 0; if (k >>> 0 > l >>> 0) { if (d | 0) { b = 2 << a; b = d << a & (b | 0 - b); b = (b & 0 - b) + -1 | 0; i = b >>> 12 & 16; b = b >>> i; d = b >>> 5 & 8; b = b >>> d; g = b >>> 2 & 4; b = b >>> g; a = b >>> 1 & 2; b = b >>> a; e = b >>> 1 & 1; e = (d | i | g | a | e) + (b >>> e) | 0; b = 21688 + (e << 1 << 2) | 0; a = b + 8 | 0; g = c[a >> 2] | 0; i = g + 8 | 0; d = c[i >> 2] | 0; if ((d | 0) == (b | 0)) { a = m & ~(1 << e); c[5412] = a; } else { c[d + 12 >> 2] = b; c[a >> 2] = d; a = m; } v = e << 3; h = v - k | 0; c[g + 4 >> 2] = k | 3; f = g + k | 0; c[f + 4 >> 2] = h | 1; c[g + v >> 2] = h; if (l | 0) { e = c[5417] | 0; b = l >>> 3; d = 21688 + (b << 1 << 2) | 0; b = 1 << b; if (!(a & b)) { c[5412] = a | b; b = d; a = d + 8 | 0; } else { a = d + 8 | 0; b = c[a >> 2] | 0; } c[a >> 2] = e; c[b + 12 >> 2] = e; c[e + 8 >> 2] = b; c[e + 12 >> 2] = d; } c[5414] = h; c[5417] = f; v = i; V = w; return v | 0 } g = c[5413] | 0; if (g) { d = (g & 0 - g) + -1 | 0; f = d >>> 12 & 16; d = d >>> f; e = d >>> 5 & 8; d = d >>> e; h = d >>> 2 & 4; d = d >>> h; i = d >>> 1 & 2; d = d >>> i; j = d >>> 1 & 1; j = c[21952 + ((e | f | h | i | j) + (d >>> j) << 2) >> 2] | 0; d = j; i = j; j = (c[j + 4 >> 2] & -8) - k | 0; while (1) { a = c[d + 16 >> 2] | 0; if (!a) { a = c[d + 20 >> 2] | 0; if (!a) break } h = (c[a + 4 >> 2] & -8) - k | 0; f = h >>> 0 < j >>> 0; d = a; i = f ? a : i; j = f ? h : j; } h = i + k | 0; if (h >>> 0 > i >>> 0) { f = c[i + 24 >> 2] | 0; b = c[i + 12 >> 2] | 0; do if ((b | 0) == (i | 0)) { a = i + 20 | 0; b = c[a >> 2] | 0; if (!b) { a = i + 16 | 0; b = c[a >> 2] | 0; if (!b) { d = 0; break } } while (1) { e = b + 20 | 0; d = c[e >> 2] | 0; if (!d) { e = b + 16 | 0; d = c[e >> 2] | 0; if (!d) break; else { b = d; a = e; } } else { b = d; a = e; } } c[a >> 2] = 0; d = b; } else { d = c[i + 8 >> 2] | 0; c[d + 12 >> 2] = b; c[b + 8 >> 2] = d; d = b; } while (0); do if (f | 0) { b = c[i + 28 >> 2] | 0; a = 21952 + (b << 2) | 0; if ((i | 0) == (c[a >> 2] | 0)) { c[a >> 2] = d; if (!d) { c[5413] = g & ~(1 << b); break } } else { v = f + 16 | 0; c[((c[v >> 2] | 0) == (i | 0) ? v : f + 20 | 0) >> 2] = d; if (!d) break } c[d + 24 >> 2] = f; b = c[i + 16 >> 2] | 0; if (b | 0) { c[d + 16 >> 2] = b; c[b + 24 >> 2] = d; } b = c[i + 20 >> 2] | 0; if (b | 0) { c[d + 20 >> 2] = b; c[b + 24 >> 2] = d; } } while (0); if (j >>> 0 < 16) { v = j + k | 0; c[i + 4 >> 2] = v | 3; v = i + v + 4 | 0; c[v >> 2] = c[v >> 2] | 1; } else { c[i + 4 >> 2] = k | 3; c[h + 4 >> 2] = j | 1; c[h + j >> 2] = j; if (l | 0) { e = c[5417] | 0; b = l >>> 3; d = 21688 + (b << 1 << 2) | 0; b = 1 << b; if (!(b & m)) { c[5412] = b | m; b = d; a = d + 8 | 0; } else { a = d + 8 | 0; b = c[a >> 2] | 0; } c[a >> 2] = e; c[b + 12 >> 2] = e; c[e + 8 >> 2] = b; c[e + 12 >> 2] = d; } c[5414] = j; c[5417] = h; } v = i + 8 | 0; V = w; return v | 0 } else m = k; } else m = k; } else m = k; } else if (a >>> 0 <= 4294967231) { a = a + 11 | 0; k = a & -8; e = c[5413] | 0; if (e) { f = 0 - k | 0; a = a >>> 8; if (a) if (k >>> 0 > 16777215) j = 31; else { m = (a + 1048320 | 0) >>> 16 & 8; q = a << m; i = (q + 520192 | 0) >>> 16 & 4; q = q << i; j = (q + 245760 | 0) >>> 16 & 2; j = 14 - (i | m | j) + (q << j >>> 15) | 0; j = k >>> (j + 7 | 0) & 1 | j << 1; } else j = 0; d = c[21952 + (j << 2) >> 2] | 0; a: do if (!d) { d = 0; a = 0; q = 61; } else { a = 0; i = k << ((j | 0) == 31 ? 0 : 25 - (j >>> 1) | 0); g = 0; while (1) { h = (c[d + 4 >> 2] & -8) - k | 0; if (h >>> 0 < f >>> 0) if (!h) { a = d; f = 0; q = 65; break a } else { a = d; f = h; } q = c[d + 20 >> 2] | 0; d = c[d + 16 + (i >>> 31 << 2) >> 2] | 0; g = (q | 0) == 0 | (q | 0) == (d | 0) ? g : q; if (!d) { d = g; q = 61; break } else i = i << 1; } } while (0); if ((q | 0) == 61) { if ((d | 0) == 0 & (a | 0) == 0) { a = 2 << j; a = (a | 0 - a) & e; if (!a) { m = k; break } m = (a & 0 - a) + -1 | 0; h = m >>> 12 & 16; m = m >>> h; g = m >>> 5 & 8; m = m >>> g; i = m >>> 2 & 4; m = m >>> i; j = m >>> 1 & 2; m = m >>> j; d = m >>> 1 & 1; a = 0; d = c[21952 + ((g | h | i | j | d) + (m >>> d) << 2) >> 2] | 0; } if (!d) { i = a; h = f; } else q = 65; } if ((q | 0) == 65) { g = d; while (1) { m = (c[g + 4 >> 2] & -8) - k | 0; d = m >>> 0 < f >>> 0; f = d ? m : f; a = d ? g : a; d = c[g + 16 >> 2] | 0; if (!d) d = c[g + 20 >> 2] | 0; if (!d) { i = a; h = f; break } else g = d; } } if (((i | 0) != 0 ? h >>> 0 < ((c[5414] | 0) - k | 0) >>> 0 : 0) ? (l = i + k | 0, l >>> 0 > i >>> 0) : 0) { g = c[i + 24 >> 2] | 0; b = c[i + 12 >> 2] | 0; do if ((b | 0) == (i | 0)) { a = i + 20 | 0; b = c[a >> 2] | 0; if (!b) { a = i + 16 | 0; b = c[a >> 2] | 0; if (!b) { b = 0; break } } while (1) { f = b + 20 | 0; d = c[f >> 2] | 0; if (!d) { f = b + 16 | 0; d = c[f >> 2] | 0; if (!d) break; else { b = d; a = f; } } else { b = d; a = f; } } c[a >> 2] = 0; } else { v = c[i + 8 >> 2] | 0; c[v + 12 >> 2] = b; c[b + 8 >> 2] = v; } while (0); do if (g) { a = c[i + 28 >> 2] | 0; d = 21952 + (a << 2) | 0; if ((i | 0) == (c[d >> 2] | 0)) { c[d >> 2] = b; if (!b) { e = e & ~(1 << a); c[5413] = e; break } } else { v = g + 16 | 0; c[((c[v >> 2] | 0) == (i | 0) ? v : g + 20 | 0) >> 2] = b; if (!b) break } c[b + 24 >> 2] = g; a = c[i + 16 >> 2] | 0; if (a | 0) { c[b + 16 >> 2] = a; c[a + 24 >> 2] = b; } a = c[i + 20 >> 2] | 0; if (a) { c[b + 20 >> 2] = a; c[a + 24 >> 2] = b; } } while (0); b: do if (h >>> 0 < 16) { v = h + k | 0; c[i + 4 >> 2] = v | 3; v = i + v + 4 | 0; c[v >> 2] = c[v >> 2] | 1; } else { c[i + 4 >> 2] = k | 3; c[l + 4 >> 2] = h | 1; c[l + h >> 2] = h; b = h >>> 3; if (h >>> 0 < 256) { d = 21688 + (b << 1 << 2) | 0; a = c[5412] | 0; b = 1 << b; if (!(a & b)) { c[5412] = a | b; b = d; a = d + 8 | 0; } else { a = d + 8 | 0; b = c[a >> 2] | 0; } c[a >> 2] = l; c[b + 12 >> 2] = l; c[l + 8 >> 2] = b; c[l + 12 >> 2] = d; break } b = h >>> 8; if (b) if (h >>> 0 > 16777215) d = 31; else { u = (b + 1048320 | 0) >>> 16 & 8; v = b << u; t = (v + 520192 | 0) >>> 16 & 4; v = v << t; d = (v + 245760 | 0) >>> 16 & 2; d = 14 - (t | u | d) + (v << d >>> 15) | 0; d = h >>> (d + 7 | 0) & 1 | d << 1; } else d = 0; b = 21952 + (d << 2) | 0; c[l + 28 >> 2] = d; a = l + 16 | 0; c[a + 4 >> 2] = 0; c[a >> 2] = 0; a = 1 << d; if (!(e & a)) { c[5413] = e | a; c[b >> 2] = l; c[l + 24 >> 2] = b; c[l + 12 >> 2] = l; c[l + 8 >> 2] = l; break } b = c[b >> 2] | 0; c: do if ((c[b + 4 >> 2] & -8 | 0) != (h | 0)) { e = h << ((d | 0) == 31 ? 0 : 25 - (d >>> 1) | 0); while (1) { d = b + 16 + (e >>> 31 << 2) | 0; a = c[d >> 2] | 0; if (!a) break; if ((c[a + 4 >> 2] & -8 | 0) == (h | 0)) { b = a; break c } else { e = e << 1; b = a; } } c[d >> 2] = l; c[l + 24 >> 2] = b; c[l + 12 >> 2] = l; c[l + 8 >> 2] = l; break b } while (0); u = b + 8 | 0; v = c[u >> 2] | 0; c[v + 12 >> 2] = l; c[u >> 2] = l; c[l + 8 >> 2] = v; c[l + 12 >> 2] = b; c[l + 24 >> 2] = 0; } while (0); v = i + 8 | 0; V = w; return v | 0 } else m = k; } else m = k; } else m = -1; while (0); d = c[5414] | 0; if (d >>> 0 >= m >>> 0) { b = d - m | 0; a = c[5417] | 0; if (b >>> 0 > 15) { v = a + m | 0; c[5417] = v; c[5414] = b; c[v + 4 >> 2] = b | 1; c[a + d >> 2] = b; c[a + 4 >> 2] = m | 3; } else { c[5414] = 0; c[5417] = 0; c[a + 4 >> 2] = d | 3; v = a + d + 4 | 0; c[v >> 2] = c[v >> 2] | 1; } v = a + 8 | 0; V = w; return v | 0 } h = c[5415] | 0; if (h >>> 0 > m >>> 0) { t = h - m | 0; c[5415] = t; v = c[5418] | 0; u = v + m | 0; c[5418] = u; c[u + 4 >> 2] = t | 1; c[v + 4 >> 2] = m | 3; v = v + 8 | 0; V = w; return v | 0 } if (!(c[5530] | 0)) { c[5532] = 4096; c[5531] = 4096; c[5533] = -1; c[5534] = -1; c[5535] = 0; c[5523] = 0; c[5530] = n & -16 ^ 1431655768; a = 4096; } else a = c[5532] | 0; i = m + 48 | 0; j = m + 47 | 0; g = a + j | 0; f = 0 - a | 0; k = g & f; if (k >>> 0 <= m >>> 0) { v = 0; V = w; return v | 0 } a = c[5522] | 0; if (a | 0 ? (l = c[5520] | 0, n = l + k | 0, n >>> 0 <= l >>> 0 | n >>> 0 > a >>> 0) : 0) { v = 0; V = w; return v | 0 } d: do if (!(c[5523] & 4)) { d = c[5418] | 0; e: do if (d) { e = 22096; while (1) { n = c[e >> 2] | 0; if (n >>> 0 <= d >>> 0 ? (n + (c[e + 4 >> 2] | 0) | 0) >>> 0 > d >>> 0 : 0) break; a = c[e + 8 >> 2] | 0; if (!a) { q = 128; break e } else e = a; } b = g - h & f; if (b >>> 0 < 2147483647) { a = fr(b) | 0; if ((a | 0) == ((c[e >> 2] | 0) + (c[e + 4 >> 2] | 0) | 0)) { if ((a | 0) != (-1 | 0)) { h = b; g = a; q = 145; break d } } else { e = a; q = 136; } } else b = 0; } else q = 128; while (0); do if ((q | 0) == 128) { d = fr(0) | 0; if ((d | 0) != (-1 | 0) ? (b = d, o = c[5531] | 0, p = o + -1 | 0, b = ((p & b | 0) == 0 ? 0 : (p + b & 0 - o) - b | 0) + k | 0, o = c[5520] | 0, p = b + o | 0, b >>> 0 > m >>> 0 & b >>> 0 < 2147483647) : 0) { n = c[5522] | 0; if (n | 0 ? p >>> 0 <= o >>> 0 | p >>> 0 > n >>> 0 : 0) { b = 0; break } a = fr(b) | 0; if ((a | 0) == (d | 0)) { h = b; g = d; q = 145; break d } else { e = a; q = 136; } } else b = 0; } while (0); do if ((q | 0) == 136) { d = 0 - b | 0; if (!(i >>> 0 > b >>> 0 & (b >>> 0 < 2147483647 & (e | 0) != (-1 | 0)))) if ((e | 0) == (-1 | 0)) { b = 0; break } else { h = b; g = e; q = 145; break d } a = c[5532] | 0; a = j - b + a & 0 - a; if (a >>> 0 >= 2147483647) { h = b; g = e; q = 145; break d } if ((fr(a) | 0) == (-1 | 0)) { fr(d) | 0; b = 0; break } else { h = a + b | 0; g = e; q = 145; break d } } while (0); c[5523] = c[5523] | 4; q = 143; } else { b = 0; q = 143; } while (0); if (((q | 0) == 143 ? k >>> 0 < 2147483647 : 0) ? (t = fr(k) | 0, p = fr(0) | 0, r = p - t | 0, s = r >>> 0 > (m + 40 | 0) >>> 0, !((t | 0) == (-1 | 0) | s ^ 1 | t >>> 0 < p >>> 0 & ((t | 0) != (-1 | 0) & (p | 0) != (-1 | 0)) ^ 1)) : 0) { h = s ? r : b; g = t; q = 145; } if ((q | 0) == 145) { b = (c[5520] | 0) + h | 0; c[5520] = b; if (b >>> 0 > (c[5521] | 0) >>> 0) c[5521] = b; j = c[5418] | 0; f: do if (j) { b = 22096; while (1) { a = c[b >> 2] | 0; d = c[b + 4 >> 2] | 0; if ((g | 0) == (a + d | 0)) { q = 154; break } e = c[b + 8 >> 2] | 0; if (!e) break; else b = e; } if (((q | 0) == 154 ? (u = b + 4 | 0, (c[b + 12 >> 2] & 8 | 0) == 0) : 0) ? g >>> 0 > j >>> 0 & a >>> 0 <= j >>> 0 : 0) { c[u >> 2] = d + h; v = (c[5415] | 0) + h | 0; t = j + 8 | 0; t = (t & 7 | 0) == 0 ? 0 : 0 - t & 7; u = j + t | 0; t = v - t | 0; c[5418] = u; c[5415] = t; c[u + 4 >> 2] = t | 1; c[j + v + 4 >> 2] = 40; c[5419] = c[5534]; break } if (g >>> 0 < (c[5416] | 0) >>> 0) c[5416] = g; d = g + h | 0; b = 22096; while (1) { if ((c[b >> 2] | 0) == (d | 0)) { q = 162; break } a = c[b + 8 >> 2] | 0; if (!a) break; else b = a; } if ((q | 0) == 162 ? (c[b + 12 >> 2] & 8 | 0) == 0 : 0) { c[b >> 2] = g; l = b + 4 | 0; c[l >> 2] = (c[l >> 2] | 0) + h; l = g + 8 | 0; l = g + ((l & 7 | 0) == 0 ? 0 : 0 - l & 7) | 0; b = d + 8 | 0; b = d + ((b & 7 | 0) == 0 ? 0 : 0 - b & 7) | 0; k = l + m | 0; i = b - l - m | 0; c[l + 4 >> 2] = m | 3; g: do if ((j | 0) == (b | 0)) { v = (c[5415] | 0) + i | 0; c[5415] = v; c[5418] = k; c[k + 4 >> 2] = v | 1; } else { if ((c[5417] | 0) == (b | 0)) { v = (c[5414] | 0) + i | 0; c[5414] = v; c[5417] = k; c[k + 4 >> 2] = v | 1; c[k + v >> 2] = v; break } a = c[b + 4 >> 2] | 0; if ((a & 3 | 0) == 1) { h = a & -8; e = a >>> 3; h: do if (a >>> 0 < 256) { a = c[b + 8 >> 2] | 0; d = c[b + 12 >> 2] | 0; if ((d | 0) == (a | 0)) { c[5412] = c[5412] & ~(1 << e); break } else { c[a + 12 >> 2] = d; c[d + 8 >> 2] = a; break } } else { g = c[b + 24 >> 2] | 0; a = c[b + 12 >> 2] | 0; do if ((a | 0) == (b | 0)) { d = b + 16 | 0; e = d + 4 | 0; a = c[e >> 2] | 0; if (!a) { a = c[d >> 2] | 0; if (!a) { a = 0; break } } else d = e; while (1) { f = a + 20 | 0; e = c[f >> 2] | 0; if (!e) { f = a + 16 | 0; e = c[f >> 2] | 0; if (!e) break; else { a = e; d = f; } } else { a = e; d = f; } } c[d >> 2] = 0; } else { v = c[b + 8 >> 2] | 0; c[v + 12 >> 2] = a; c[a + 8 >> 2] = v; } while (0); if (!g) break; d = c[b + 28 >> 2] | 0; e = 21952 + (d << 2) | 0; do if ((c[e >> 2] | 0) != (b | 0)) { v = g + 16 | 0; c[((c[v >> 2] | 0) == (b | 0) ? v : g + 20 | 0) >> 2] = a; if (!a) break h } else { c[e >> 2] = a; if (a | 0) break; c[5413] = c[5413] & ~(1 << d); break h } while (0); c[a + 24 >> 2] = g; d = b + 16 | 0; e = c[d >> 2] | 0; if (e | 0) { c[a + 16 >> 2] = e; c[e + 24 >> 2] = a; } d = c[d + 4 >> 2] | 0; if (!d) break; c[a + 20 >> 2] = d; c[d + 24 >> 2] = a; } while (0); b = b + h | 0; f = h + i | 0; } else f = i; b = b + 4 | 0; c[b >> 2] = c[b >> 2] & -2; c[k + 4 >> 2] = f | 1; c[k + f >> 2] = f; b = f >>> 3; if (f >>> 0 < 256) { d = 21688 + (b << 1 << 2) | 0; a = c[5412] | 0; b = 1 << b; if (!(a & b)) { c[5412] = a | b; b = d; a = d + 8 | 0; } else { a = d + 8 | 0; b = c[a >> 2] | 0; } c[a >> 2] = k; c[b + 12 >> 2] = k; c[k + 8 >> 2] = b; c[k + 12 >> 2] = d; break } b = f >>> 8; do if (!b) e = 0; else { if (f >>> 0 > 16777215) { e = 31; break } u = (b + 1048320 | 0) >>> 16 & 8; v = b << u; t = (v + 520192 | 0) >>> 16 & 4; v = v << t; e = (v + 245760 | 0) >>> 16 & 2; e = 14 - (t | u | e) + (v << e >>> 15) | 0; e = f >>> (e + 7 | 0) & 1 | e << 1; } while (0); b = 21952 + (e << 2) | 0; c[k + 28 >> 2] = e; a = k + 16 | 0; c[a + 4 >> 2] = 0; c[a >> 2] = 0; a = c[5413] | 0; d = 1 << e; if (!(a & d)) { c[5413] = a | d; c[b >> 2] = k; c[k + 24 >> 2] = b; c[k + 12 >> 2] = k; c[k + 8 >> 2] = k; break } b = c[b >> 2] | 0; i: do if ((c[b + 4 >> 2] & -8 | 0) != (f | 0)) { e = f << ((e | 0) == 31 ? 0 : 25 - (e >>> 1) | 0); while (1) { d = b + 16 + (e >>> 31 << 2) | 0; a = c[d >> 2] | 0; if (!a) break; if ((c[a + 4 >> 2] & -8 | 0) == (f | 0)) { b = a; break i } else { e = e << 1; b = a; } } c[d >> 2] = k; c[k + 24 >> 2] = b; c[k + 12 >> 2] = k; c[k + 8 >> 2] = k; break g } while (0); u = b + 8 | 0; v = c[u >> 2] | 0; c[v + 12 >> 2] = k; c[u >> 2] = k; c[k + 8 >> 2] = v; c[k + 12 >> 2] = b; c[k + 24 >> 2] = 0; } while (0); v = l + 8 | 0; V = w; return v | 0 } b = 22096; while (1) { a = c[b >> 2] | 0; if (a >>> 0 <= j >>> 0 ? (v = a + (c[b + 4 >> 2] | 0) | 0, v >>> 0 > j >>> 0) : 0) break; b = c[b + 8 >> 2] | 0; } f = v + -47 | 0; a = f + 8 | 0; a = f + ((a & 7 | 0) == 0 ? 0 : 0 - a & 7) | 0; f = j + 16 | 0; a = a >>> 0 < f >>> 0 ? j : a; b = a + 8 | 0; d = h + -40 | 0; t = g + 8 | 0; t = (t & 7 | 0) == 0 ? 0 : 0 - t & 7; u = g + t | 0; t = d - t | 0; c[5418] = u; c[5415] = t; c[u + 4 >> 2] = t | 1; c[g + d + 4 >> 2] = 40; c[5419] = c[5534]; d = a + 4 | 0; c[d >> 2] = 27; c[b >> 2] = c[5524]; c[b + 4 >> 2] = c[5525]; c[b + 8 >> 2] = c[5526]; c[b + 12 >> 2] = c[5527]; c[5524] = g; c[5525] = h; c[5527] = 0; c[5526] = b; b = a + 24 | 0; do { u = b; b = b + 4 | 0; c[b >> 2] = 7; } while ((u + 8 | 0) >>> 0 < v >>> 0); if ((a | 0) != (j | 0)) { g = a - j | 0; c[d >> 2] = c[d >> 2] & -2; c[j + 4 >> 2] = g | 1; c[a >> 2] = g; b = g >>> 3; if (g >>> 0 < 256) { d = 21688 + (b << 1 << 2) | 0; a = c[5412] | 0; b = 1 << b; if (!(a & b)) { c[5412] = a | b; b = d; a = d + 8 | 0; } else { a = d + 8 | 0; b = c[a >> 2] | 0; } c[a >> 2] = j; c[b + 12 >> 2] = j; c[j + 8 >> 2] = b; c[j + 12 >> 2] = d; break } b = g >>> 8; if (b) if (g >>> 0 > 16777215) e = 31; else { u = (b + 1048320 | 0) >>> 16 & 8; v = b << u; t = (v + 520192 | 0) >>> 16 & 4; v = v << t; e = (v + 245760 | 0) >>> 16 & 2; e = 14 - (t | u | e) + (v << e >>> 15) | 0; e = g >>> (e + 7 | 0) & 1 | e << 1; } else e = 0; d = 21952 + (e << 2) | 0; c[j + 28 >> 2] = e; c[j + 20 >> 2] = 0; c[f >> 2] = 0; b = c[5413] | 0; a = 1 << e; if (!(b & a)) { c[5413] = b | a; c[d >> 2] = j; c[j + 24 >> 2] = d; c[j + 12 >> 2] = j; c[j + 8 >> 2] = j; break } b = c[d >> 2] | 0; j: do if ((c[b + 4 >> 2] & -8 | 0) != (g | 0)) { e = g << ((e | 0) == 31 ? 0 : 25 - (e >>> 1) | 0); while (1) { d = b + 16 + (e >>> 31 << 2) | 0; a = c[d >> 2] | 0; if (!a) break; if ((c[a + 4 >> 2] & -8 | 0) == (g | 0)) { b = a; break j } else { e = e << 1; b = a; } } c[d >> 2] = j; c[j + 24 >> 2] = b; c[j + 12 >> 2] = j; c[j + 8 >> 2] = j; break f } while (0); u = b + 8 | 0; v = c[u >> 2] | 0; c[v + 12 >> 2] = j; c[u >> 2] = j; c[j + 8 >> 2] = v; c[j + 12 >> 2] = b; c[j + 24 >> 2] = 0; } } else { v = c[5416] | 0; if ((v | 0) == 0 | g >>> 0 < v >>> 0) c[5416] = g; c[5524] = g; c[5525] = h; c[5527] = 0; c[5421] = c[5530]; c[5420] = -1; c[5425] = 21688; c[5424] = 21688; c[5427] = 21696; c[5426] = 21696; c[5429] = 21704; c[5428] = 21704; c[5431] = 21712; c[5430] = 21712; c[5433] = 21720; c[5432] = 21720; c[5435] = 21728; c[5434] = 21728; c[5437] = 21736; c[5436] = 21736; c[5439] = 21744; c[5438] = 21744; c[5441] = 21752; c[5440] = 21752; c[5443] = 21760; c[5442] = 21760; c[5445] = 21768; c[5444] = 21768; c[5447] = 21776; c[5446] = 21776; c[5449] = 21784; c[5448] = 21784; c[5451] = 21792; c[5450] = 21792; c[5453] = 21800; c[5452] = 21800; c[5455] = 21808; c[5454] = 21808; c[5457] = 21816; c[5456] = 21816; c[5459] = 21824; c[5458] = 21824; c[5461] = 21832; c[5460] = 21832; c[5463] = 21840; c[5462] = 21840; c[5465] = 21848; c[5464] = 21848; c[5467] = 21856; c[5466] = 21856; c[5469] = 21864; c[5468] = 21864; c[5471] = 21872; c[5470] = 21872; c[5473] = 21880; c[5472] = 21880; c[5475] = 21888; c[5474] = 21888; c[5477] = 21896; c[5476] = 21896; c[5479] = 21904; c[5478] = 21904; c[5481] = 21912; c[5480] = 21912; c[5483] = 21920; c[5482] = 21920; c[5485] = 21928; c[5484] = 21928; c[5487] = 21936; c[5486] = 21936; v = h + -40 | 0; t = g + 8 | 0; t = (t & 7 | 0) == 0 ? 0 : 0 - t & 7; u = g + t | 0; t = v - t | 0; c[5418] = u; c[5415] = t; c[u + 4 >> 2] = t | 1; c[g + v + 4 >> 2] = 40; c[5419] = c[5534]; } while (0); b = c[5415] | 0; if (b >>> 0 > m >>> 0) { t = b - m | 0; c[5415] = t; v = c[5418] | 0; u = v + m | 0; c[5418] = u; c[u + 4 >> 2] = t | 1; c[v + 4 >> 2] = m | 3; v = v + 8 | 0; V = w; return v | 0 } } c[(ao() | 0) >> 2] = 48; v = 0; V = w; return v | 0 } function er(a) { a = a | 0; var b = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0; if (!a) return; d = a + -8 | 0; f = c[5416] | 0; a = c[a + -4 >> 2] | 0; b = a & -8; j = d + b | 0; do if (!(a & 1)) { e = c[d >> 2] | 0; if (!(a & 3)) return; h = d + (0 - e) | 0; g = e + b | 0; if (h >>> 0 < f >>> 0) return; if ((c[5417] | 0) == (h | 0)) { a = j + 4 | 0; b = c[a >> 2] | 0; if ((b & 3 | 0) != 3) { i = h; b = g; break } c[5414] = g; c[a >> 2] = b & -2; c[h + 4 >> 2] = g | 1; c[h + g >> 2] = g; return } d = e >>> 3; if (e >>> 0 < 256) { a = c[h + 8 >> 2] | 0; b = c[h + 12 >> 2] | 0; if ((b | 0) == (a | 0)) { c[5412] = c[5412] & ~(1 << d); i = h; b = g; break } else { c[a + 12 >> 2] = b; c[b + 8 >> 2] = a; i = h; b = g; break } } f = c[h + 24 >> 2] | 0; a = c[h + 12 >> 2] | 0; do if ((a | 0) == (h | 0)) { b = h + 16 | 0; d = b + 4 | 0; a = c[d >> 2] | 0; if (!a) { a = c[b >> 2] | 0; if (!a) { a = 0; break } } else b = d; while (1) { e = a + 20 | 0; d = c[e >> 2] | 0; if (!d) { e = a + 16 | 0; d = c[e >> 2] | 0; if (!d) break; else { a = d; b = e; } } else { a = d; b = e; } } c[b >> 2] = 0; } else { i = c[h + 8 >> 2] | 0; c[i + 12 >> 2] = a; c[a + 8 >> 2] = i; } while (0); if (f) { b = c[h + 28 >> 2] | 0; d = 21952 + (b << 2) | 0; if ((c[d >> 2] | 0) == (h | 0)) { c[d >> 2] = a; if (!a) { c[5413] = c[5413] & ~(1 << b); i = h; b = g; break } } else { i = f + 16 | 0; c[((c[i >> 2] | 0) == (h | 0) ? i : f + 20 | 0) >> 2] = a; if (!a) { i = h; b = g; break } } c[a + 24 >> 2] = f; b = h + 16 | 0; d = c[b >> 2] | 0; if (d | 0) { c[a + 16 >> 2] = d; c[d + 24 >> 2] = a; } b = c[b + 4 >> 2] | 0; if (b) { c[a + 20 >> 2] = b; c[b + 24 >> 2] = a; i = h; b = g; } else { i = h; b = g; } } else { i = h; b = g; } } else { i = d; h = d; } while (0); if (h >>> 0 >= j >>> 0) return; a = j + 4 | 0; e = c[a >> 2] | 0; if (!(e & 1)) return; if (!(e & 2)) { if ((c[5418] | 0) == (j | 0)) { j = (c[5415] | 0) + b | 0; c[5415] = j; c[5418] = i; c[i + 4 >> 2] = j | 1; if ((i | 0) != (c[5417] | 0)) return; c[5417] = 0; c[5414] = 0; return } if ((c[5417] | 0) == (j | 0)) { j = (c[5414] | 0) + b | 0; c[5414] = j; c[5417] = h; c[i + 4 >> 2] = j | 1; c[h + j >> 2] = j; return } f = (e & -8) + b | 0; d = e >>> 3; do if (e >>> 0 < 256) { b = c[j + 8 >> 2] | 0; a = c[j + 12 >> 2] | 0; if ((a | 0) == (b | 0)) { c[5412] = c[5412] & ~(1 << d); break } else { c[b + 12 >> 2] = a; c[a + 8 >> 2] = b; break } } else { g = c[j + 24 >> 2] | 0; a = c[j + 12 >> 2] | 0; do if ((a | 0) == (j | 0)) { b = j + 16 | 0; d = b + 4 | 0; a = c[d >> 2] | 0; if (!a) { a = c[b >> 2] | 0; if (!a) { d = 0; break } } else b = d; while (1) { e = a + 20 | 0; d = c[e >> 2] | 0; if (!d) { e = a + 16 | 0; d = c[e >> 2] | 0; if (!d) break; else { a = d; b = e; } } else { a = d; b = e; } } c[b >> 2] = 0; d = a; } else { d = c[j + 8 >> 2] | 0; c[d + 12 >> 2] = a; c[a + 8 >> 2] = d; d = a; } while (0); if (g | 0) { a = c[j + 28 >> 2] | 0; b = 21952 + (a << 2) | 0; if ((c[b >> 2] | 0) == (j | 0)) { c[b >> 2] = d; if (!d) { c[5413] = c[5413] & ~(1 << a); break } } else { e = g + 16 | 0; c[((c[e >> 2] | 0) == (j | 0) ? e : g + 20 | 0) >> 2] = d; if (!d) break } c[d + 24 >> 2] = g; a = j + 16 | 0; b = c[a >> 2] | 0; if (b | 0) { c[d + 16 >> 2] = b; c[b + 24 >> 2] = d; } a = c[a + 4 >> 2] | 0; if (a | 0) { c[d + 20 >> 2] = a; c[a + 24 >> 2] = d; } } } while (0); c[i + 4 >> 2] = f | 1; c[h + f >> 2] = f; if ((i | 0) == (c[5417] | 0)) { c[5414] = f; return } } else { c[a >> 2] = e & -2; c[i + 4 >> 2] = b | 1; c[h + b >> 2] = b; f = b; } a = f >>> 3; if (f >>> 0 < 256) { d = 21688 + (a << 1 << 2) | 0; b = c[5412] | 0; a = 1 << a; if (!(b & a)) { c[5412] = b | a; a = d; b = d + 8 | 0; } else { b = d + 8 | 0; a = c[b >> 2] | 0; } c[b >> 2] = i; c[a + 12 >> 2] = i; c[i + 8 >> 2] = a; c[i + 12 >> 2] = d; return } a = f >>> 8; if (a) if (f >>> 0 > 16777215) e = 31; else { h = (a + 1048320 | 0) >>> 16 & 8; j = a << h; g = (j + 520192 | 0) >>> 16 & 4; j = j << g; e = (j + 245760 | 0) >>> 16 & 2; e = 14 - (g | h | e) + (j << e >>> 15) | 0; e = f >>> (e + 7 | 0) & 1 | e << 1; } else e = 0; a = 21952 + (e << 2) | 0; c[i + 28 >> 2] = e; c[i + 20 >> 2] = 0; c[i + 16 >> 2] = 0; b = c[5413] | 0; d = 1 << e; a: do if (!(b & d)) { c[5413] = b | d; c[a >> 2] = i; c[i + 24 >> 2] = a; c[i + 12 >> 2] = i; c[i + 8 >> 2] = i; } else { a = c[a >> 2] | 0; b: do if ((c[a + 4 >> 2] & -8 | 0) != (f | 0)) { e = f << ((e | 0) == 31 ? 0 : 25 - (e >>> 1) | 0); while (1) { d = a + 16 + (e >>> 31 << 2) | 0; b = c[d >> 2] | 0; if (!b) break; if ((c[b + 4 >> 2] & -8 | 0) == (f | 0)) { a = b; break b } else { e = e << 1; a = b; } } c[d >> 2] = i; c[i + 24 >> 2] = a; c[i + 12 >> 2] = i; c[i + 8 >> 2] = i; break a } while (0); h = a + 8 | 0; j = c[h >> 2] | 0; c[j + 12 >> 2] = i; c[h >> 2] = i; c[i + 8 >> 2] = j; c[i + 12 >> 2] = a; c[i + 24 >> 2] = 0; } while (0); j = (c[5420] | 0) + -1 | 0; c[5420] = j; if (j | 0) return; a = 22104; while (1) { a = c[a >> 2] | 0; if (!a) break; else a = a + 8 | 0; } c[5420] = -1; return } function fr(a) { a = a | 0; var b = 0, d = 0, e = 0; e = a + 3 & -4; a = sr() | 0; b = c[a >> 2] | 0; d = b + e | 0; do if ((e | 0) < 1 | d >>> 0 > b >>> 0) { if (d >>> 0 > (R() | 0) >>> 0 ? (T(d | 0) | 0) == 0 : 0) break; c[a >> 2] = d; e = b; return e | 0 } while (0); c[(ao() | 0) >> 2] = 48; e = -1; return e | 0 } function gr(a) { a = a | 0; var b = 0; b = V; V = V + a | 0; V = V + 15 & -16; return b | 0 } function hr(a) { a = a | 0; V = a; } function ir() { return V | 0 } function jr(a, b) { a = a | 0; b = b | 0; var c = 0, d = 0, e = 0, f = 0; f = a & 65535; e = b & 65535; c = q(e, f) | 0; d = a >>> 16; a = (c >>> 16) + (q(e, d) | 0) | 0; e = b >>> 16; b = q(e, f) | 0; return (t((a >>> 16) + (q(e, d) | 0) + (((a & 65535) + b | 0) >>> 16) | 0), a + b << 16 | c & 65535 | 0) | 0 } function kr(a, b, c, d) { a = a | 0; b = b | 0; c = c | 0; d = d | 0; var e = 0, f = 0; e = a; f = c; c = jr(e, f) | 0; a = u() | 0; return (t((q(b, f) | 0) + (q(d, e) | 0) + a | a & 0 | 0), c | 0 | 0) | 0 } function lr(a, b, c, d) { a = a | 0; b = b | 0; c = c | 0; d = d | 0; c = a + c >>> 0; return (t(b + d + (c >>> 0 < a >>> 0 | 0) >>> 0 | 0), c | 0) | 0 } function mr(a, b, c, d) { a = a | 0; b = b | 0; c = c | 0; d = d | 0; d = b - d - (c >>> 0 > a >>> 0 | 0) >>> 0; return (t(d | 0), a - c >>> 0 | 0) | 0 } function nr(a) { a = a | 0; return (a ? 31 - (r(a ^ a - 1) | 0) | 0 : 32) | 0 } function or(a, b, d, e, f) { a = a | 0; b = b | 0; d = d | 0; e = e | 0; f = f | 0; var g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0; l = a; j = b; k = j; h = d; n = e; i = n; if (!k) { g = (f | 0) != 0; if (!i) { if (g) { c[f >> 2] = (l >>> 0) % (h >>> 0); c[f + 4 >> 2] = 0; } n = 0; f = (l >>> 0) / (h >>> 0) >>> 0; return (t(n | 0), f) | 0 } else { if (!g) { n = 0; f = 0; return (t(n | 0), f) | 0 } c[f >> 2] = a | 0; c[f + 4 >> 2] = b & 0; n = 0; f = 0; return (t(n | 0), f) | 0 } } g = (i | 0) == 0; do if (h) { if (!g) { g = (r(i | 0) | 0) - (r(k | 0) | 0) | 0; if (g >>> 0 <= 31) { m = g + 1 | 0; i = 31 - g | 0; b = g - 31 >> 31; h = m; a = l >>> (m >>> 0) & b | k << i; b = k >>> (m >>> 0) & b; g = 0; i = l << i; break } if (!f) { n = 0; f = 0; return (t(n | 0), f) | 0 } c[f >> 2] = a | 0; c[f + 4 >> 2] = j | b & 0; n = 0; f = 0; return (t(n | 0), f) | 0 } g = h - 1 | 0; if (g & h | 0) { i = (r(h | 0) | 0) + 33 - (r(k | 0) | 0) | 0; p = 64 - i | 0; m = 32 - i | 0; j = m >> 31; o = i - 32 | 0; b = o >> 31; h = i; a = m - 1 >> 31 & k >>> (o >>> 0) | (k << m | l >>> (i >>> 0)) & b; b = b & k >>> (i >>> 0); g = l << p & j; i = (k << p | l >>> (o >>> 0)) & j | l << m & i - 33 >> 31; break } if (f | 0) { c[f >> 2] = g & l; c[f + 4 >> 2] = 0; } if ((h | 0) == 1) { o = j | b & 0; p = a | 0 | 0; return (t(o | 0), p) | 0 } else { p = nr(h | 0) | 0; o = k >>> (p >>> 0) | 0; p = k << 32 - p | l >>> (p >>> 0) | 0; return (t(o | 0), p) | 0 } } else { if (g) { if (f | 0) { c[f >> 2] = (k >>> 0) % (h >>> 0); c[f + 4 >> 2] = 0; } o = 0; p = (k >>> 0) / (h >>> 0) >>> 0; return (t(o | 0), p) | 0 } if (!l) { if (f | 0) { c[f >> 2] = 0; c[f + 4 >> 2] = (k >>> 0) % (i >>> 0); } o = 0; p = (k >>> 0) / (i >>> 0) >>> 0; return (t(o | 0), p) | 0 } g = i - 1 | 0; if (!(g & i)) { if (f | 0) { c[f >> 2] = a | 0; c[f + 4 >> 2] = g & k | b & 0; } o = 0; p = k >>> ((nr(i | 0) | 0) >>> 0); return (t(o | 0), p) | 0 } g = (r(i | 0) | 0) - (r(k | 0) | 0) | 0; if (g >>> 0 <= 30) { b = g + 1 | 0; i = 31 - g | 0; h = b; a = k << i | l >>> (b >>> 0); b = k >>> (b >>> 0); g = 0; i = l << i; break } if (!f) { o = 0; p = 0; return (t(o | 0), p) | 0 } c[f >> 2] = a | 0; c[f + 4 >> 2] = j | b & 0; o = 0; p = 0; return (t(o | 0), p) | 0 } while (0); if (!h) { k = i; j = 0; i = 0; } else { m = d | 0 | 0; l = n | e & 0; k = lr(m | 0, l | 0, -1, -1) | 0; d = u() | 0; j = i; i = 0; do { e = j; j = g >>> 31 | j << 1; g = i | g << 1; e = a << 1 | e >>> 31 | 0; n = a >>> 31 | b << 1 | 0; mr(k | 0, d | 0, e | 0, n | 0) | 0; p = u() | 0; o = p >> 31 | ((p | 0) < 0 ? -1 : 0) << 1; i = o & 1; a = mr(e | 0, n | 0, o & m | 0, (((p | 0) < 0 ? -1 : 0) >> 31 | ((p | 0) < 0 ? -1 : 0) << 1) & l | 0) | 0; b = u() | 0; h = h - 1 | 0; } while ((h | 0) != 0); k = j; j = 0; } h = 0; if (f | 0) { c[f >> 2] = a; c[f + 4 >> 2] = b; } o = (g | 0) >>> 31 | (k | h) << 1 | (h << 1 | g >>> 31) & 0 | j; p = (g << 1 | 0 >>> 31) & -2 | i; return (t(o | 0), p) | 0 } function pr(a, b, c, d) { a = a | 0; b = b | 0; c = c | 0; d = d | 0; return or(a, b, c, d, 0) | 0 } function qr(a, b, c) { a = a | 0; b = b | 0; c = c | 0; if ((c | 0) < 32) { t(b >>> c | 0); return a >>> c | (b & (1 << c) - 1) << 32 - c } t(0); return b >>> c - 32 | 0 } function rr(a, b, c) { a = a | 0; b = b | 0; c = c | 0; if ((c | 0) < 32) { t(b << c | (a & (1 << c) - 1 << 32 - c) >>> 32 - c | 0); return a << c } t(a << c - 32 | 0); return 0 } function sr() { return 22176 } function tr(a) { a = a | 0; return (a & 255) << 24 | (a >> 8 & 255) << 16 | (a >> 16 & 255) << 8 | a >>> 24 | 0 } function ur(b, d, e) { b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0; if ((e | 0) >= 512) { S(b | 0, d | 0, e | 0) | 0; return b | 0 } h = b | 0; g = b + e | 0; if ((b & 3) == (d & 3)) { while (b & 3) { if (!e) return h | 0; a[b >> 0] = a[d >> 0] | 0; b = b + 1 | 0; d = d + 1 | 0; e = e - 1 | 0; } e = g & -4 | 0; f = e - 64 | 0; while ((b | 0) <= (f | 0)) { c[b >> 2] = c[d >> 2]; c[b + 4 >> 2] = c[d + 4 >> 2]; c[b + 8 >> 2] = c[d + 8 >> 2]; c[b + 12 >> 2] = c[d + 12 >> 2]; c[b + 16 >> 2] = c[d + 16 >> 2]; c[b + 20 >> 2] = c[d + 20 >> 2]; c[b + 24 >> 2] = c[d + 24 >> 2]; c[b + 28 >> 2] = c[d + 28 >> 2]; c[b + 32 >> 2] = c[d + 32 >> 2]; c[b + 36 >> 2] = c[d + 36 >> 2]; c[b + 40 >> 2] = c[d + 40 >> 2]; c[b + 44 >> 2] = c[d + 44 >> 2]; c[b + 48 >> 2] = c[d + 48 >> 2]; c[b + 52 >> 2] = c[d + 52 >> 2]; c[b + 56 >> 2] = c[d + 56 >> 2]; c[b + 60 >> 2] = c[d + 60 >> 2]; b = b + 64 | 0; d = d + 64 | 0; } while ((b | 0) < (e | 0)) { c[b >> 2] = c[d >> 2]; b = b + 4 | 0; d = d + 4 | 0; } } else { e = g - 4 | 0; while ((b | 0) < (e | 0)) { a[b >> 0] = a[d >> 0] | 0; a[b + 1 >> 0] = a[d + 1 >> 0] | 0; a[b + 2 >> 0] = a[d + 2 >> 0] | 0; a[b + 3 >> 0] = a[d + 3 >> 0] | 0; b = b + 4 | 0; d = d + 4 | 0; } } while ((b | 0) < (g | 0)) { a[b >> 0] = a[d >> 0] | 0; b = b + 1 | 0; d = d + 1 | 0; } return h | 0 } function vr(b, c, d) { b = b | 0; c = c | 0; d = d | 0; var e = 0; if ((c | 0) < (b | 0) & (b | 0) < (c + d | 0)) { e = b; c = c + d | 0; b = b + d | 0; while ((d | 0) > 0) { b = b - 1 | 0; c = c - 1 | 0; d = d - 1 | 0; a[b >> 0] = a[c >> 0] | 0; } b = e; } else ur(b, c, d) | 0; return b | 0 } function wr(b, d, e) { b = b | 0; d = d | 0; e = e | 0; var f = 0, g = 0, h = 0, i = 0; h = b + e | 0; d = d & 255; if ((e | 0) >= 67) { while (b & 3) { a[b >> 0] = d; b = b + 1 | 0; } f = h & -4 | 0; i = d | d << 8 | d << 16 | d << 24; g = f - 64 | 0; while ((b | 0) <= (g | 0)) { c[b >> 2] = i; c[b + 4 >> 2] = i; c[b + 8 >> 2] = i; c[b + 12 >> 2] = i; c[b + 16 >> 2] = i; c[b + 20 >> 2] = i; c[b + 24 >> 2] = i; c[b + 28 >> 2] = i; c[b + 32 >> 2] = i; c[b + 36 >> 2] = i; c[b + 40 >> 2] = i; c[b + 44 >> 2] = i; c[b + 48 >> 2] = i; c[b + 52 >> 2] = i; c[b + 56 >> 2] = i; c[b + 60 >> 2] = i; b = b + 64 | 0; } while ((b | 0) < (f | 0)) { c[b >> 2] = i; b = b + 4 | 0; } } while ((b | 0) < (h | 0)) { a[b >> 0] = d; b = b + 1 | 0; } return h - e | 0 } function xr(a) { a = a | 0; return Y[a & 3]() | 0 } function yr(a, b) { a = a | 0; b = b | 0; return Z[a & 15](b | 0) | 0 } function zr(a, b, c, d, e, f, g) { a = a | 0; b = b | 0; c = +c; d = d | 0; e = e | 0; f = f | 0; g = g | 0; return _[a & 1](b | 0, +c, d | 0, e | 0, f | 0, g | 0) | 0 } function Ar(a, b, c) { a = a | 0; b = b | 0; c = c | 0; return $[a & 63](b | 0, c | 0) | 0 } function Br(a, b, c, d) { a = a | 0; b = b | 0; c = c | 0; d = d | 0; return aa[a & 7](b | 0, c | 0, d | 0) | 0 } function Cr(a) { a = a | 0; ba[a & 3](); } function Dr(a, b) { a = a | 0; b = b | 0; ca[a & 255](b | 0); } function Er(a, b, c) { a = a | 0; b = b | 0; c = c | 0; da[a & 15](b | 0, c | 0); } function Fr(a, b, c, d) { a = a | 0; b = b | 0; c = c | 0; d = d | 0; ea[a & 15](b | 0, c | 0, d | 0); } function Gr(a, b, c, d, e) { a = a | 0; b = b | 0; c = c | 0; d = d | 0; e = e | 0; fa[a & 7](b | 0, c | 0, d | 0, e | 0); } function Hr(a, b, c, d, e, f) { a = a | 0; b = b | 0; c = c | 0; d = d | 0; e = e | 0; f = f | 0; ga[a & 3](b | 0, c | 0, d | 0, e | 0, f | 0); } function Ir(a, b, c, d, e, f, g) { a = a | 0; b = b | 0; c = c | 0; d = d | 0; e = e | 0; f = f | 0; g = g | 0; ha[a & 3](b | 0, c | 0, d | 0, e | 0, f | 0, g | 0); } function Jr() { s(0); return 0 } function Kr(a) { a = a | 0; s(1); return 0 } function Lr(a, b, c, d, e, f) { a = a | 0; b = +b; c = c | 0; d = d | 0; e = e | 0; f = f | 0; s(2); return 0 } function Mr(a, b) { a = a | 0; b = b | 0; s(3); return 0 } function Nr(a, b, c) { a = a | 0; b = b | 0; c = c | 0; s(4); return 0 } function Or() { s(5); } function Pr(a) { a = a | 0; s(6); } function Qr(a, b) { a = a | 0; b = b | 0; s(7); } function Rr(a, b, c) { a = a | 0; b = b | 0; c = c | 0; s(8); } function Sr(a, b, c, d) { a = a | 0; b = b | 0; c = c | 0; d = d | 0; s(9); } function Tr(a, b, c, d, e) { a = a | 0; b = b | 0; c = c | 0; d = d | 0; e = e | 0; s(10); } function Ur(a, b, c, d, e, f) { a = a | 0; b = b | 0; c = c | 0; d = d | 0; e = e | 0; f = f | 0; s(11); } // EMSCRIPTEN_END_FUNCS var Y = [Jr, Mk, Fl, Jr]; var Z = [Kr, Ap, zb, Fb, qp, tp, oq, Kq, Tq, wk, na, tl, Ok, Hl, Kr, Kr]; var _ = [Lr, po]; var $ = [Mr, Ba, Ka, Eb, jd, Nd, Xd, je, ke, ne, _e, ff, yf, Ff, Of, Vf, Hg, Qg, Zg, ch, lh, qh, zh, Eh, Nh, _h, fi, ki, si, Bi, Si, Zi, fj, oj, yj, Fj, Pj, Yj, ek, lk, tk, ll, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr, Mr]; var aa = [Nr, Io, Yo, Fp, Hp, Mq, Nq, Nr]; var ba = [Or, Dp, Po, Or]; var ca = [Pr, pq, za, Aa, Ca, Ia, Ja, La, yp, ob, Gb, yb, Bb, Cb, Lb, Mb, Xb, Yb, sc, tc, uc, Nc, hd, id, kd, Jd, Od, Pd, Qd, Rd, Vd, Wd, Yd, he, ie, le, me, Ye, Ze, $e, df, ef, wf, xf, zf, Df, Ef, Mf, Nf, Pf, Tf, Uf, Fg, Gg, Ig, Rg, Sg, Xg, Yg, _g, dh, eh, jh, kh, mh, rh, sh, xh, yh, Ah, Fh, Gh, Lh, Mh, Oh, Yh, Zh, $h, di, ei, gi, li, mi, qi, ri, ti, zi, Ai, Qi, Ri, Ti, Xi, Yi, dj, ej, gj, mj, nj, wj, xj, zj, Dj, Ej, Nj, Oj, Qj, Wj, Xj, ck, dk, fk, jk, kk, rk, sk, uk, Uo, Vo, Wo, Xo, fp, op, pp, rp, sp, zp, Bp, Cp, Ep, Gp, Lp, mq, nq, Iq, Jq, Sq, Yq, Zq, zk, wl, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr, Pr]; var da = [Qr, Ab, Db, ma, pa, qa, ra, sa, qo, Qr, Qr, Qr, Qr, Qr, Qr, Qr]; var ea = [Rr, Lq, Oq, Uq, Vq, la, oa, dl, Vl, $l, Rr, Rr, Rr, Rr, Rr, Rr]; var fa = [Sr, $o, ip, Op, Vk, Ol, Sr, Sr]; var ga = [Tr, _o, hp, Np]; var ha = [Ur, Zo, gp, Mp]; return { __ZSt18uncaught_exceptionv: kq, ___cxa_can_catch: hq, ___cxa_is_pointer_type: iq, ___embind_register_native_and_builtin_types: im, ___errno_location: ao, ___getTypeName: $n, ___muldi3: kr, ___udivdi3: pr, _bitshift64Lshr: qr, _bitshift64Shl: rr, _emscripten_get_sbrk_ptr: sr, _free: er, _i64Add: lr, _i64Subtract: mr, _llvm_bswap_i32: tr, _malloc: dr, _memcpy: ur, _memmove: vr, _memset: wr, dynCall_i: xr, dynCall_ii: yr, dynCall_iidiiii: zr, dynCall_iii: Ar, dynCall_iiii: Br, dynCall_v: Cr, dynCall_vi: Dr, dynCall_vii: Er, dynCall_viii: Fr, dynCall_viiii: Gr, dynCall_viiiii: Hr, dynCall_viiiiii: Ir, globalCtors: ia, stackAlloc: gr, stackRestore: hr, stackSave: ir } }) // EMSCRIPTEN_END_ASM (asmGlobalArg, asmLibraryArg, buffer); var __ZSt18uncaught_exceptionv = Module["__ZSt18uncaught_exceptionv"] = asm["__ZSt18uncaught_exceptionv"]; var ___cxa_can_catch = Module["___cxa_can_catch"] = asm["___cxa_can_catch"]; var ___cxa_is_pointer_type = Module["___cxa_is_pointer_type"] = asm["___cxa_is_pointer_type"]; var ___embind_register_native_and_builtin_types = Module["___embind_register_native_and_builtin_types"] = asm["___embind_register_native_and_builtin_types"]; var ___errno_location = Module["___errno_location"] = asm["___errno_location"]; var ___getTypeName = Module["___getTypeName"] = asm["___getTypeName"]; var ___muldi3 = Module["___muldi3"] = asm["___muldi3"]; var ___udivdi3 = Module["___udivdi3"] = asm["___udivdi3"]; var _bitshift64Lshr = Module["_bitshift64Lshr"] = asm["_bitshift64Lshr"]; var _bitshift64Shl = Module["_bitshift64Shl"] = asm["_bitshift64Shl"]; var _emscripten_get_sbrk_ptr = Module["_emscripten_get_sbrk_ptr"] = asm["_emscripten_get_sbrk_ptr"]; var _free = Module["_free"] = asm["_free"]; var _i64Add = Module["_i64Add"] = asm["_i64Add"]; var _i64Subtract = Module["_i64Subtract"] = asm["_i64Subtract"]; var _llvm_bswap_i32 = Module["_llvm_bswap_i32"] = asm["_llvm_bswap_i32"]; var _malloc = Module["_malloc"] = asm["_malloc"]; var _memcpy = Module["_memcpy"] = asm["_memcpy"]; var _memmove = Module["_memmove"] = asm["_memmove"]; var _memset = Module["_memset"] = asm["_memset"]; var globalCtors = Module["globalCtors"] = asm["globalCtors"]; var stackAlloc = Module["stackAlloc"] = asm["stackAlloc"]; var stackRestore = Module["stackRestore"] = asm["stackRestore"]; var stackSave = Module["stackSave"] = asm["stackSave"]; var dynCall_i = Module["dynCall_i"] = asm["dynCall_i"]; var dynCall_ii = Module["dynCall_ii"] = asm["dynCall_ii"]; var dynCall_iidiiii = Module["dynCall_iidiiii"] = asm["dynCall_iidiiii"]; var dynCall_iii = Module["dynCall_iii"] = asm["dynCall_iii"]; var dynCall_iiii = Module["dynCall_iiii"] = asm["dynCall_iiii"]; var dynCall_v = Module["dynCall_v"] = asm["dynCall_v"]; var dynCall_vi = Module["dynCall_vi"] = asm["dynCall_vi"]; var dynCall_vii = Module["dynCall_vii"] = asm["dynCall_vii"]; var dynCall_viii = Module["dynCall_viii"] = asm["dynCall_viii"]; var dynCall_viiii = Module["dynCall_viiii"] = asm["dynCall_viiii"]; var dynCall_viiiii = Module["dynCall_viiiii"] = asm["dynCall_viiiii"]; var dynCall_viiiiii = Module["dynCall_viiiiii"] = asm["dynCall_viiiiii"]; Module["asm"] = asm; if (memoryInitializer) { if (!isDataURI(memoryInitializer)) { memoryInitializer = locateFile(memoryInitializer); } if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) { var data = readBinary(memoryInitializer); HEAPU8.set(data, GLOBAL_BASE); } else { addRunDependency(); var applyMemoryInitializer = function (data) { if (data.byteLength) data = new Uint8Array(data); HEAPU8.set(data, GLOBAL_BASE); if (Module["memoryInitializerRequest"]) delete Module["memoryInitializerRequest"].response; removeRunDependency(); }; var doBrowserLoad = function () { readAsync(memoryInitializer, applyMemoryInitializer, function () { var e = new Error("could not load memory initializer " + memoryInitializer); throw e }); }; var memoryInitializerBytes = tryParseAsDataURI(memoryInitializer); if (memoryInitializerBytes) { applyMemoryInitializer(memoryInitializerBytes.buffer); } else if (Module["memoryInitializerRequest"]) { var useRequest = function () { var request = Module["memoryInitializerRequest"]; var response = request.response; if (request.status !== 200 && request.status !== 0) { var data = tryParseAsDataURI(Module["memoryInitializerRequestURL"]); if (data) { response = data.buffer; } else { console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: " + request.status + ", retrying " + memoryInitializer); doBrowserLoad(); return } } applyMemoryInitializer(response); }; if (Module["memoryInitializerRequest"].response) { setTimeout(useRequest, 0); } else { Module["memoryInitializerRequest"].addEventListener("load", useRequest); } } else { doBrowserLoad(); } } } var calledRun; function ExitStatus(status) { this.name = "ExitStatus"; this.message = "Program terminated with exit(" + status + ")"; this.status = status; } dependenciesFulfilled = function runCaller() { if (!calledRun) run(); if (!calledRun) dependenciesFulfilled = runCaller; }; function run(args) { if (runDependencies > 0) { return } preRun(); if (runDependencies > 0) return; function doRun() { if (calledRun) return; calledRun = true; Module["calledRun"] = true; if (ABORT) return; initRuntime(); preMain(); if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); postRun(); } if (Module["setStatus"]) { Module["setStatus"]("Running..."); setTimeout(function () { setTimeout(function () { Module["setStatus"](""); }, 1); doRun(); }, 1); } else { doRun(); } } Module["run"] = run; if (Module["preInit"]) { if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; while (Module["preInit"].length > 0) { Module["preInit"].pop()(); } } run(); return Module; }; }); var Module = null; var POINT_FORMAT_READERS = { 0: function _(dv) { return { position: [dv.getInt32(0, true), dv.getInt32(4, true), dv.getInt32(8, true)], intensity: dv.getUint16(12, true), classification: dv.getUint8(15, true) }; }, 1: function _(dv) { return { position: [dv.getInt32(0, true), dv.getInt32(4, true), dv.getInt32(8, true)], intensity: dv.getUint16(12, true), classification: dv.getUint8(15, true) }; }, 2: function _(dv) { return { position: [dv.getInt32(0, true), dv.getInt32(4, true), dv.getInt32(8, true)], intensity: dv.getUint16(12, true), classification: dv.getUint8(15, true), color: [dv.getUint16(20, true), dv.getUint16(22, true), dv.getUint16(24, true)] }; }, 3: function _(dv) { return { position: [dv.getInt32(0, true), dv.getInt32(4, true), dv.getInt32(8, true)], intensity: dv.getUint16(12, true), classification: dv.getUint8(15, true), color: [dv.getUint16(28, true), dv.getUint16(30, true), dv.getUint16(32, true)] }; } }; function readAs(buf, Type, offset, count) { count = count === undefined || count === 0 ? 1 : count; var sub = buf.slice(offset, offset + Type.BYTES_PER_ELEMENT * count); var r = new Type(sub); if (count === 1) { return r[0]; } var ret = []; for (var i = 0; i < count; i++) { ret.push(r[i]); } return ret; } function parseLASHeader(arraybuffer) { var o = {}; o.pointsOffset = readAs(arraybuffer, Uint32Array, 32 * 3); o.pointsFormatId = readAs(arraybuffer, Uint8Array, 32 * 3 + 8); o.pointsStructSize = readAs(arraybuffer, Uint16Array, 32 * 3 + 8 + 1); o.pointsCount = readAs(arraybuffer, Uint32Array, 32 * 3 + 11); var start = 32 * 3 + 35; o.scale = readAs(arraybuffer, Float64Array, start, 3); start += 24; o.offset = readAs(arraybuffer, Float64Array, start, 3); start += 24; var bounds = readAs(arraybuffer, Float64Array, start, 6); start += 48; o.maxs = [bounds[0], bounds[2], bounds[4]]; o.mins = [bounds[1], bounds[3], bounds[5]]; return o; } var LASLoader = function () { function LASLoader(arraybuffer) { _classCallCheck(this, LASLoader); this.arraybuffer = arraybuffer; } _createClass(LASLoader, [{ key: "open", value: function open() { this.readOffset = 0; return true; } }, { key: "getHeader", value: function getHeader() { this.header = parseLASHeader(this.arraybuffer); return this.header; } }, { key: "readData", value: function readData(count, offset, skip) { var header = this.header, arraybuffer = this.arraybuffer; if (!header) { throw new Error('Cannot start reading data till a header request is issued'); } var readOffset = this.readOffset; var start; if (skip <= 1) { count = Math.min(count, header.pointsCount - readOffset); start = header.pointsOffset + readOffset * header.pointsStructSize; var end = start + count * header.pointsStructSize; readOffset += count; this.readOffset = readOffset; return { buffer: arraybuffer.slice(start, end), count: count, hasMoreData: readOffset < header.pointsCount }; } var pointsToRead = Math.min(count * skip, header.pointsCount - readOffset); var bufferSize = Math.ceil(pointsToRead / skip); var pointsRead = 0; var buf = new Uint8Array(bufferSize * header.pointsStructSize); for (var i = 0; i < pointsToRead; i++) { if (i % skip === 0) { start = header.pointsOffset + readOffset * header.pointsStructSize; var src = new Uint8Array(arraybuffer, start, header.pointsStructSize); buf.set(src, pointsRead * header.pointsStructSize); pointsRead++; } readOffset++; } this.readOffset = readOffset; return { buffer: buf.buffer, count: pointsRead, hasMoreData: readOffset < header.pointsCount }; } }, { key: "close", value: function close() { this.arraybuffer = null; return true; } }]); return LASLoader; }(); var LAZLoader = function () { function LAZLoader(arraybuffer) { _classCallCheck(this, LAZLoader); this.arraybuffer = arraybuffer; this.instance = null; if (!Module) { Module = lazPerf(); } } _createClass(LAZLoader, [{ key: "open", value: function open() { try { var arraybuffer = this.arraybuffer; this.instance = new Module.LASZip(); var abInt = new Uint8Array(arraybuffer); var buf = Module._malloc(arraybuffer.byteLength); this.instance.arraybuffer = arraybuffer; this.instance.buf = buf; Module.HEAPU8.set(abInt, buf); this.instance.open(buf, arraybuffer.byteLength); this.instance.readOffset = 0; return true; } catch (e) { throw new Error("Failed to open file: ".concat(e.message)); } } }, { key: "getHeader", value: function getHeader() { if (!this.instance) { throw new Error('You need to open the file before trying to read header'); } try { var header = parseLASHeader(this.instance.arraybuffer); header.pointsFormatId &= 0x3f; this.header = header; return header; } catch (e) { throw new Error("Failed to get header: ".concat(e.message)); } } }, { key: "readData", value: function readData(count, offset, skip) { if (!this.instance) { throw new Error('You need to open the file before trying to read stuff'); } var header = this.header, instance = this.instance; if (!header) { throw new Error('You need to query header before reading, I maintain state that way, sorry :('); } try { var pointsToRead = Math.min(count * skip, header.pointsCount - instance.readOffset); var bufferSize = Math.ceil(pointsToRead / skip); var pointsRead = 0; var thisBuf = new Uint8Array(bufferSize * header.pointsStructSize); var bufRead = Module._malloc(header.pointsStructSize); for (var i = 0; i < pointsToRead; i++) { instance.getPoint(bufRead); if (i % skip === 0) { var a = new Uint8Array(Module.HEAPU8.buffer, bufRead, header.pointsStructSize); thisBuf.set(a, pointsRead * header.pointsStructSize); pointsRead++; } instance.readOffset++; } return { buffer: thisBuf.buffer, count: pointsRead, hasMoreData: instance.readOffset < header.pointsCount }; } catch (e) { throw new Error("Failed to read data: ".concat(e.message)); } } }, { key: "close", value: function close() { try { if (this.instance !== null) { this.instance["delete"](); this.instance = null; } return true; } catch (e) { throw new Error("Failed to close file: ".concat(e.message)); } } }]); return LAZLoader; }(); var LASDecoder = function () { function LASDecoder(buffer, len, header) { _classCallCheck(this, LASDecoder); this.arrayb = buffer; this.decoder = POINT_FORMAT_READERS[header.pointsFormatId]; this.pointsCount = len; this.pointSize = header.pointsStructSize; this.scale = header.scale; this.offset = header.offset; this.mins = header.mins; this.maxs = header.maxs; } _createClass(LASDecoder, [{ key: "getPoint", value: function getPoint(index) { if (index < 0 || index >= this.pointsCount) { throw new Error('Point index out of range'); } var dv = new DataView(this.arrayb, index * this.pointSize, this.pointSize); return this.decoder(dv); } }]); return LASDecoder; }(); var LASFile = function () { function LASFile(arraybuffer) { _classCallCheck(this, LASFile); this.arraybuffer = arraybuffer; if (this.determineVersion() > 13) { throw new Error('Only file versions <= 1.3 are supported at this time'); } this.determineFormat(); if (POINT_FORMAT_READERS[this.formatId] === undefined) { throw new Error('The point format ID is not supported'); } this.loader = this.isCompressed ? new LAZLoader(this.arraybuffer) : new LASLoader(this.arraybuffer); } _createClass(LASFile, [{ key: "determineFormat", value: function determineFormat() { var formatId = readAs(this.arraybuffer, Uint8Array, 32 * 3 + 8); var bit7 = (formatId & 0x80) >> 7; var bit6 = (formatId & 0x40) >> 6; if (bit7 === 1 && bit6 === 1) { throw new Error('Old style compression not supported'); } this.formatId = formatId & 0x3f; this.isCompressed = bit7 === 1 || bit6 === 1; } }, { key: "determineVersion", value: function determineVersion() { var ver = new Int8Array(this.arraybuffer, 24, 2); this.version = ver[0] * 10 + ver[1]; this.versionAsString = "".concat(ver[0], ".").concat(ver[1]); return this.version; } }, { key: "open", value: function open() { if (this.loader.open()) { this.isOpen = true; } } }, { key: "getHeader", value: function getHeader() { return this.loader.getHeader(); } }, { key: "readData", value: function readData(count, start, skip) { return this.loader.readData(count, start, skip); } }, { key: "close", value: function close() { if (this.loader.close()) { this.isOpen = false; } } }, { key: "getUnpacker", value: function getUnpacker() { return LASDecoder; } }]); return LASFile; }(); function detectTwoByteColors(colorDepth, decoder, batchSize) { var twoByteColor; switch (colorDepth) { case 8: twoByteColor = false; break; case 16: twoByteColor = true; break; case 'auto': if (decoder.getPoint(0).color) { for (var i = 0; i < batchSize; i++) { var _decoder$getPoint = decoder.getPoint(i), color = _decoder$getPoint.color; if (color[0] > 255 || color[1] > 255 || color[2] > 255) { twoByteColor = true; } } } break; default: console.warn('las: illegal value for options.las.colorDepth'); break; } return twoByteColor; } function parseLAS(arraybuffer) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var pointIndex = 0; var positions; var colors; var intensities; var classifications; var originalHeader; var result = {}; var onProgress = options.onProgress; var _ref = options.las || {}, skip = _ref.skip, colorDepth = _ref.colorDepth, fp64 = _ref.fp64; parseLASChunked(arraybuffer, skip, function (decoder, header) { if (!originalHeader) { originalHeader = header; var total = header.totalToRead; var PositionsType = fp64 ? Float64Array : Float32Array; positions = new PositionsType(total * 3); colors = header.pointsFormatId >= 2 ? new Uint8Array(total * 4) : null; intensities = new Uint16Array(total); classifications = new Uint8Array(total); Object.assign(result, { loaderData: { header: header }, mode: 0, attributes: { POSITION: { value: positions, size: 3 }, intensity: { value: intensities, size: 1 }, classification: { value: classifications, size: 1 } } }); if (colors) { result.attributes.COLOR_0 = { value: colors, size: 4 }; } } var batchSize = decoder.pointsCount; var _header$scale = _slicedToArray(header.scale, 3), scaleX = _header$scale[0], scaleY = _header$scale[1], scaleZ = _header$scale[2], _header$offset = _slicedToArray(header.offset, 3), offsetX = _header$offset[0], offsetY = _header$offset[1], offsetZ = _header$offset[2]; var twoByteColor = detectTwoByteColors(colorDepth, decoder, batchSize); for (var i = 0; i < batchSize; i++) { var _decoder$getPoint2 = decoder.getPoint(i), position = _decoder$getPoint2.position, color = _decoder$getPoint2.color, intensity = _decoder$getPoint2.intensity, classification = _decoder$getPoint2.classification; positions[pointIndex * 3] = position[0] * scaleX + offsetX; positions[pointIndex * 3 + 1] = position[1] * scaleY + offsetY; positions[pointIndex * 3 + 2] = position[2] * scaleZ + offsetZ; if (color) { if (twoByteColor) { colors[pointIndex * 4] = color[0] / 256; colors[pointIndex * 4 + 1] = color[1] / 256; colors[pointIndex * 4 + 2] = color[2] / 256; } else { colors[pointIndex * 4] = color[0]; colors[pointIndex * 4 + 1] = color[1]; colors[pointIndex * 4 + 2] = color[2]; } colors[pointIndex * 4 + 3] = 255; } intensities[pointIndex] = intensity; classifications[pointIndex] = classification; pointIndex++; } if (onProgress) { onProgress(Object.assign({ header: { vertexCount: header.totalRead }, progress: header.totalRead / header.totalToRead }, result)); } }); result.header = { vertexCount: originalHeader.totalToRead, boundingBox: getMeshBoundingBox(result.attributes) }; return result; } function parseLASChunked(rawData, skip, onParseData) { var dataHandler = new LASFile(rawData); try { dataHandler.open(); var header = dataHandler.getHeader(); var Unpacker = dataHandler.getUnpacker(); var totalToRead = Math.ceil(header.pointsCount / Math.max(1, skip)); header.totalToRead = totalToRead; var totalRead = 0; while (true) { var chunk = dataHandler.readData(1000 * 100, 0, skip); totalRead += chunk.count; header.totalRead = totalRead; header.versionAsString = chunk.versionAsString; header.isCompressed = chunk.isCompressed; var unpacker = new Unpacker(chunk.buffer, chunk.count, header); onParseData(unpacker, header); if (!chunk.hasMoreData || totalRead >= totalToRead) { break; } } } catch (e) { throw e; } finally { dataHandler.close(); } } function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$4(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } var VERSION$2 = "2.3.13" ; var LASWorkerLoader = { id: 'las', name: 'LAS', version: VERSION$2, extensions: ['las', 'laz'], mimeTypes: ['application/octet-stream'], text: true, binary: true, tests: ['LAS'], options: { las: { workerUrl: "https://unpkg.com/@loaders.gl/las@".concat(VERSION$2, "/dist/las-loader.worker.js"), fp64: false, skip: 1, colorDepth: 8 } } }; var LASLoader$1 = _objectSpread$4(_objectSpread$4({}, LASWorkerLoader), {}, { parse: function () { var _parse = _asyncToGenerator(regenerator.mark(function _callee(arrayBuffer, options) { return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: return _context.abrupt("return", parseLAS(arrayBuffer, options)); case 1: case "end": return _context.stop(); } } }, _callee); })); function parse(_x, _x2) { return _parse.apply(this, arguments); } return parse; }(), parseSync: parseLAS }); /** * @desc Parses LAS and LAZ point cloud data into an {@link XKTModel}. * * This parser handles both the LASER file format (LAS) and its compressed version (LAZ), * a public format for the interchange of 3-dimensional point cloud data data, developed * for LIDAR mapping purposes. * * ## Usage * * In the example below we'll create an {@link XKTModel}, then load an LAZ point cloud model into it. * * ````javascript * utils.loadArraybuffer("./models/laz/autzen.laz", async (data) => { * * const xktModel = new XKTModel(); * * await parseLASIntoXKTModel({ * data, * xktModel, * log: (msg) => { console.log(msg); } * }).then(()=>{ * xktModel.finalize(); * }, * (msg) => { * console.error(msg); * }); * }); * ```` * * @param {Object} params Parsing params. * @param {ArrayBuffer} params.data LAS/LAZ file data. * @param {XKTModel} params.xktModel XKTModel to parse into. * @param {Boolean} [params.rotateX=true] Whether to rotate the model 90 degrees about the X axis to make the Y axis "up", if necessary. * @param {Object} [params.stats] Collects statistics. * @param {function} [params.log] Logging callback. */ async function parseLASIntoXKTModel({data, xktModel, rotateX = true, stats, log}) { if (!data) { throw "Argument expected: data"; } if (!xktModel) { throw "Argument expected: xktModel"; } if (log) { log("Converting LAZ/LAS"); } let parsedData; try { parsedData = await parse(data, LASLoader$1); } catch (e) { if (log) { log("Error: " + e); } return; } const attributes = parsedData.attributes; const positionsValue = attributes.POSITION.value; const colorsValue = attributes.COLOR_0.value; if (rotateX) { if (log) { log("Rotating model about X-axis"); } if (positionsValue) { for (let i = 0, len = positionsValue.length; i < len; i += 3) { const temp = positionsValue[i + 1]; positionsValue[i + 1] = positionsValue[i + 2]; positionsValue[i + 2] = temp; } } } xktModel.createGeometry({ geometryId: "pointsGeometry", primitiveType: "points", positions: positionsValue, colorsCompressed: colorsValue }); xktModel.createMesh({ meshId: "pointsMesh", geometryId: "pointsGeometry" }); const entityId = math.createUUID(); xktModel.createEntity({ entityId: entityId, meshIds: ["pointsMesh"] }); const rootMetaObjectId = math.createUUID(); xktModel.createMetaObject({ metaObjectId: rootMetaObjectId, metaObjectType: "Model", metaObjectName: "Model" }); xktModel.createMetaObject({ metaObjectId: entityId, metaObjectType: "PointCloud", metaObjectName: "PointCloud (LAZ)", parentMetaObjectId: rootMetaObjectId }); if (stats) { stats.sourceFormat = "LAS"; stats.schemaVersion = ""; stats.title = ""; stats.author = ""; stats.created = ""; stats.numMetaObjects = 2; stats.numPropertySets = 0; stats.numObjects = 1; stats.numGeometries = 1; stats.numVertices = positionsValue.length / 3; } } /** * @desc Parses PCD point cloud data into an {@link XKTModel}. * * ## Usage * * In the example below we'll create an {@link XKTModel}, then load an LAZ point cloud model into it. * * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#parsers_PCD_Test)] * * ````javascript * utils.loadArraybuffer(""./models/pcd/ism_test_cat.pcd"", async (data) => { * * const xktModel = new XKTModel(); * * await parsePCDIntoXKTModel({ * data, * xktModel, * log: (msg) => { console.log(msg); } * }).then(()=>{ * xktModel.finalize(); * }, * (msg) => { * console.error(msg); * }); * }); * ```` * * @param {Object} params Parsing params. * @param {ArrayBuffer} params.data PCD file data. * @param {Boolean} [params.littleEndian=true] Whether PCD binary data is Little-Endian or Big-Endian. * @param {XKTModel} params.xktModel XKTModel to parse into. * @param {Object} [params.stats] Collects statistics. * @param {function} [params.log] Logging callback. * @returns {Promise} */ function parsePCDIntoXKTModel({data, xktModel, littleEndian = true, stats, log}) { return new Promise(function(resolve, reject) { const textData = decodeText(new Uint8Array(data)); const header = parseHeader(textData); const positions = []; const colors = []; if (header.data === 'ascii') { const offset = header.offset; const data = textData.substr(header.headerLen); const lines = data.split('\n'); for (let i = 0, l = lines.length; i < l; i++) { if (lines[i] === '') { continue; } const line = lines[i].split(' '); if (offset.x !== undefined) { positions.push(parseFloat(line[offset.x])); positions.push(parseFloat(line[offset.y])); positions.push(parseFloat(line[offset.z])); } if (offset.rgb !== undefined) { const rgb = parseFloat(line[offset.rgb]); const r = (rgb >> 16) & 0x0000ff; const g = (rgb >> 8) & 0x0000ff; const b = (rgb >> 0) & 0x0000ff; colors.push(r, g, b, 255); } else { colors.push(255); colors.push(255); colors.push(255); } } } if (header.data === 'binary_compressed') { const sizes = new Uint32Array(data.slice(header.headerLen, header.headerLen + 8)); const compressedSize = sizes[0]; const decompressedSize = sizes[1]; const decompressed = decompressLZF(new Uint8Array(data, header.headerLen + 8, compressedSize), decompressedSize); const dataview = new DataView(decompressed.buffer); const offset = header.offset; for (let i = 0; i < header.points; i++) { if (offset.x !== undefined) { positions.push(dataview.getFloat32((header.points * offset.x) + header.size[0] * i, littleEndian)); positions.push(dataview.getFloat32((header.points * offset.y) + header.size[1] * i, littleEndian)); positions.push(dataview.getFloat32((header.points * offset.z) + header.size[2] * i, littleEndian)); } if (offset.rgb !== undefined) { colors.push(dataview.getUint8((header.points * offset.rgb) + header.size[3] * i + 0)); colors.push(dataview.getUint8((header.points * offset.rgb) + header.size[3] * i + 1)); colors.push(dataview.getUint8((header.points * offset.rgb) + header.size[3] * i + 2)); // colors.push(255); } else { colors.push(1); colors.push(1); colors.push(1); } } } if (header.data === 'binary') { const dataview = new DataView(data, header.headerLen); const offset = header.offset; for (let i = 0, row = 0; i < header.points; i++, row += header.rowSize) { if (offset.x !== undefined) { positions.push(dataview.getFloat32(row + offset.x, littleEndian)); positions.push(dataview.getFloat32(row + offset.y, littleEndian)); positions.push(dataview.getFloat32(row + offset.z, littleEndian)); } if (offset.rgb !== undefined) { colors.push(dataview.getUint8(row + offset.rgb + 2)); colors.push(dataview.getUint8(row + offset.rgb + 1)); colors.push(dataview.getUint8(row + offset.rgb + 0)); } else { colors.push(255); colors.push(255); colors.push(255); } } } xktModel.createGeometry({ geometryId: "pointsGeometry", primitiveType: "points", positions: positions, colors: colors && colors.length > 0 ? colors : null }); xktModel.createMesh({ meshId: "pointsMesh", geometryId: "pointsGeometry" }); xktModel.createEntity({ entityId: "geometries", meshIds: ["pointsMesh"] }); if (log) { log("Converted drawable objects: 1"); log("Converted geometries: 1"); log("Converted vertices: " + positions.length / 3); } if (stats) { stats.sourceFormat = "PCD"; stats.schemaVersion = ""; stats.title = ""; stats.author = ""; stats.created = ""; stats.numObjects = 1; stats.numGeometries = 1; stats.numVertices = positions.length / 3; } resolve(); }); } function parseHeader(data) { const header = {}; const result1 = data.search(/[\r\n]DATA\s(\S*)\s/i); const result2 = /[\r\n]DATA\s(\S*)\s/i.exec(data.substr(result1 - 1)); header.data = result2[1]; header.headerLen = result2[0].length + result1; header.str = data.substr(0, header.headerLen); header.str = header.str.replace(/\#.*/gi, ''); // Strip comments header.version = /VERSION (.*)/i.exec(header.str); // Parse header.fields = /FIELDS (.*)/i.exec(header.str); header.size = /SIZE (.*)/i.exec(header.str); header.type = /TYPE (.*)/i.exec(header.str); header.count = /COUNT (.*)/i.exec(header.str); header.width = /WIDTH (.*)/i.exec(header.str); header.height = /HEIGHT (.*)/i.exec(header.str); header.viewpoint = /VIEWPOINT (.*)/i.exec(header.str); header.points = /POINTS (.*)/i.exec(header.str); if (header.version !== null) { header.version = parseFloat(header.version[1]); } if (header.fields !== null) { header.fields = header.fields[1].split(' '); } if (header.type !== null) { header.type = header.type[1].split(' '); } if (header.width !== null) { header.width = parseInt(header.width[1]); } if (header.height !== null) { header.height = parseInt(header.height[1]); } if (header.viewpoint !== null) { header.viewpoint = header.viewpoint[1]; } if (header.points !== null) { header.points = parseInt(header.points[1], 10); } if (header.points === null) { header.points = header.width * header.height; } if (header.size !== null) { header.size = header.size[1].split(' ').map(function (x) { return parseInt(x, 10); }); } if (header.count !== null) { header.count = header.count[1].split(' ').map(function (x) { return parseInt(x, 10); }); } else { header.count = []; for (let i = 0, l = header.fields.length; i < l; i++) { header.count.push(1); } } header.offset = {}; let sizeSum = 0; for (let i = 0, l = header.fields.length; i < l; i++) { if (header.data === 'ascii') { header.offset[header.fields[i]] = i; } else { header.offset[header.fields[i]] = sizeSum; sizeSum += header.size[i] * header.count[i]; } } header.rowSize = sizeSum; // For binary only return header; } function decodeText(array) { if (typeof TextDecoder !== 'undefined') { return new TextDecoder().decode(array); } let s = ''; for (let i = 0, il = array.length; i < il; i++) { s += String.fromCharCode(array[i]); } try { return decodeURIComponent(escape(s)); } catch (e) { return s; } } function decompressLZF(inData, outLength) { // https://gitlab.com/taketwo/three-pcd-loader/blob/master/decompress-lzf.js const inLength = inData.length; const outData = new Uint8Array(outLength); let inPtr = 0; let outPtr = 0; let ctrl; let len; let ref; do { ctrl = inData[inPtr++]; if (ctrl < (1 << 5)) { ctrl++; if (outPtr + ctrl > outLength) throw new Error('Output buffer is not large enough'); if (inPtr + ctrl > inLength) throw new Error('Invalid compressed data'); do { outData[outPtr++] = inData[inPtr++]; } while (--ctrl); } else { len = ctrl >> 5; ref = outPtr - ((ctrl & 0x1f) << 8) - 1; if (inPtr >= inLength) throw new Error('Invalid compressed data'); if (len === 7) { len += inData[inPtr++]; if (inPtr >= inLength) throw new Error('Invalid compressed data'); } ref -= inData[inPtr++]; if (outPtr + len + 2 > outLength) throw new Error('Output buffer is not large enough'); if (ref < 0) throw new Error('Invalid compressed data'); if (ref >= outPtr) throw new Error('Invalid compressed data'); do { outData[outPtr++] = outData[ref++]; } while (--len + 2); } } while (inPtr < inLength); return outData; } function normalizePLY(header, attributes, options) { var normalizedAttributes = normalizeAttributes(attributes); var result = { loaderData: { header: header }, header: { vertexCount: attributes.indices.length || attributes.vertices.length / 3, boundingBox: getMeshBoundingBox(normalizedAttributes) }, mode: attributes.indices && attributes.indices.length > 0 ? 4 : 0, attributes: normalizedAttributes }; if (attributes.indices && attributes.indices.length > 0) { result.indices = { value: new Uint32Array(attributes.indices), size: 1 }; } return result; } function normalizeAttributes(attributes) { var accessors = {}; accessors.POSITION = { value: new Float32Array(attributes.vertices), size: 3 }; if (attributes.normals.length > 0) { accessors.NORMAL = { value: new Float32Array(attributes.normals), size: 3 }; } if (attributes.uvs.length > 0) { accessors.TEXCOORD_0 = { value: new Float32Array(attributes.uvs), size: 2 }; } if (attributes.colors.length > 0) { accessors.COLOR_0 = { value: new Uint8Array(attributes.colors), size: 3, normalized: true }; } return accessors; } function parsePLY(data) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var header; var attributes; if (data instanceof ArrayBuffer) { var text = new TextDecoder().decode(data); header = parseHeader$1(text, options); attributes = header.format === 'ascii' ? parseASCII(text, header) : parseBinary(data, header); } else { header = parseHeader$1(data, options); attributes = parseASCII(data, header); } return normalizePLY(header, attributes); } function parseHeader$1(data, options) { var PLY_HEADER_PATTERN = /ply([\s\S]*)end_header\s/; var headerText = ''; var headerLength = 0; var result = PLY_HEADER_PATTERN.exec(data); if (result !== null) { headerText = result[1]; headerLength = result[0].length; } var header = { comments: [], elements: [], headerLength: headerLength }; var lines = headerText.split('\n'); var currentElement; var lineType; var lineValues; for (var i = 0; i < lines.length; i++) { var line = lines[i]; line = line.trim(); if (line === '') { continue; } lineValues = line.split(/\s+/); lineType = lineValues.shift(); line = lineValues.join(' '); switch (lineType) { case 'format': header.format = lineValues[0]; header.version = lineValues[1]; break; case 'comment': header.comments.push(line); break; case 'element': if (currentElement !== undefined) { header.elements.push(currentElement); } currentElement = { name: lineValues[0], count: parseInt(lineValues[1], 10), properties: [] }; break; case 'property': currentElement.properties.push(makePLYElementProperty(lineValues, options.propertyNameMapping)); break; default: console.log('unhandled', lineType, lineValues); } } if (currentElement !== undefined) { header.elements.push(currentElement); } return header; } function makePLYElementProperty(propertValues, propertyNameMapping) { var property = { type: propertValues[0] }; if (property.type === 'list') { property.name = propertValues[3]; property.countType = propertValues[1]; property.itemType = propertValues[2]; } else { property.name = propertValues[1]; } if (propertyNameMapping && property.name in propertyNameMapping) { property.name = propertyNameMapping[property.name]; } return property; } function parseASCIINumber(n, type) { switch (type) { case 'char': case 'uchar': case 'short': case 'ushort': case 'int': case 'uint': case 'int8': case 'uint8': case 'int16': case 'uint16': case 'int32': case 'uint32': return parseInt(n, 10); case 'float': case 'double': case 'float32': case 'float64': return parseFloat(n); default: throw new Error(type); } } function parseASCIIElement(properties, line) { var values = line.split(/\s+/); var element = {}; for (var i = 0; i < properties.length; i++) { if (properties[i].type === 'list') { var list = []; var n = parseASCIINumber(values.shift(), properties[i].countType); for (var j = 0; j < n; j++) { list.push(parseASCIINumber(values.shift(), properties[i].itemType)); } element[properties[i].name] = list; } else { element[properties[i].name] = parseASCIINumber(values.shift(), properties[i].type); } } return element; } function parseASCII(data, header) { var attributes = { indices: [], vertices: [], normals: [], uvs: [], colors: [] }; var result; var patternBody = /end_header\s([\s\S]*)$/; var body = ''; if ((result = patternBody.exec(data)) !== null) { body = result[1]; } var lines = body.split('\n'); var currentElement = 0; var currentElementCount = 0; for (var i = 0; i < lines.length; i++) { var line = lines[i]; line = line.trim(); if (line !== '') { if (currentElementCount >= header.elements[currentElement].count) { currentElement++; currentElementCount = 0; } var element = parseASCIIElement(header.elements[currentElement].properties, line); handleElement(attributes, header.elements[currentElement].name, element); currentElementCount++; } } return attributes; } function handleElement(buffer, elementName, element) { if (elementName === 'vertex') { buffer.vertices.push(element.x, element.y, element.z); if ('nx' in element && 'ny' in element && 'nz' in element) { buffer.normals.push(element.nx, element.ny, element.nz); } if ('s' in element && 't' in element) { buffer.uvs.push(element.s, element.t); } if ('red' in element && 'green' in element && 'blue' in element) { buffer.colors.push(element.red, element.green, element.blue); } } else if (elementName === 'face') { var vertexIndices = element.vertex_indices || element.vertex_index; if (vertexIndices.length === 3) { buffer.indices.push(vertexIndices[0], vertexIndices[1], vertexIndices[2]); } else if (vertexIndices.length === 4) { buffer.indices.push(vertexIndices[0], vertexIndices[1], vertexIndices[3]); buffer.indices.push(vertexIndices[1], vertexIndices[2], vertexIndices[3]); } } } function binaryRead(dataview, at, type, littleEndian) { switch (type) { case 'int8': case 'char': return [dataview.getInt8(at), 1]; case 'uint8': case 'uchar': return [dataview.getUint8(at), 1]; case 'int16': case 'short': return [dataview.getInt16(at, littleEndian), 2]; case 'uint16': case 'ushort': return [dataview.getUint16(at, littleEndian), 2]; case 'int32': case 'int': return [dataview.getInt32(at, littleEndian), 4]; case 'uint32': case 'uint': return [dataview.getUint32(at, littleEndian), 4]; case 'float32': case 'float': return [dataview.getFloat32(at, littleEndian), 4]; case 'float64': case 'double': return [dataview.getFloat64(at, littleEndian), 8]; default: throw new Error(type); } } function binaryReadElement(dataview, at, properties, littleEndian) { var element = {}; var result; var read = 0; for (var i = 0; i < properties.length; i++) { if (properties[i].type === 'list') { var list = []; result = binaryRead(dataview, at + read, properties[i].countType, littleEndian); var n = result[0]; read += result[1]; for (var j = 0; j < n; j++) { result = binaryRead(dataview, at + read, properties[i].itemType, littleEndian); list.push(result[0]); read += result[1]; } element[properties[i].name] = list; } else { result = binaryRead(dataview, at + read, properties[i].type, littleEndian); element[properties[i].name] = result[0]; read += result[1]; } } return [element, read]; } function parseBinary(data, header) { var attributes = { indices: [], vertices: [], normals: [], uvs: [], colors: [] }; var littleEndian = header.format === 'binary_little_endian'; var body = new DataView(data, header.headerLength); var result; var loc = 0; for (var currentElement = 0; currentElement < header.elements.length; currentElement++) { var count = header.elements[currentElement].count; for (var currentElementCount = 0; currentElementCount < count; currentElementCount++) { result = binaryReadElement(body, loc, header.elements[currentElement].properties, littleEndian); loc += result[1]; var element = result[0]; handleElement(attributes, header.elements[currentElement].name, element); } } return attributes; } function parsePLYInBatches(_x) { return _parsePLYInBatches.apply(this, arguments); } function _parsePLYInBatches() { _parsePLYInBatches = _wrapAsyncGenerator(regenerator.mark(function _callee(iterator) { var options, lineIterator, header, attributes, _args = arguments; return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; lineIterator = makeLineIterator(makeTextDecoderIterator(iterator)); _context.next = 4; return _awaitAsyncGenerator(parseHeader$2(lineIterator, options)); case 4: header = _context.sent; _context.t0 = header.format; _context.next = _context.t0 === 'ascii' ? 8 : 12; break; case 8: _context.next = 10; return _awaitAsyncGenerator(parseASCII$1(lineIterator, header)); case 10: attributes = _context.sent; return _context.abrupt("break", 13); case 12: throw new Error('Binary PLY can not yet be parsed in streaming mode'); case 13: _context.next = 15; return normalizePLY(header, attributes); case 15: case "end": return _context.stop(); } } }, _callee); })); return _parsePLYInBatches.apply(this, arguments); } function parseHeader$2(_x2, _x3) { return _parseHeader.apply(this, arguments); } function _parseHeader() { _parseHeader = _asyncToGenerator(regenerator.mark(function _callee2(lineIterator, options) { var header, currentElement; return regenerator.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: header = { comments: [], elements: [] }; _context2.next = 3; return forEach(lineIterator, function (line) { line = line.trim(); if (line === 'end_header') { return true; } if (line === '') { return false; } var lineValues = line.split(/\s+/); var lineType = lineValues.shift(); line = lineValues.join(' '); switch (lineType) { case 'ply': break; case 'format': header.format = lineValues[0]; header.version = lineValues[1]; break; case 'comment': header.comments.push(line); break; case 'element': if (currentElement) { header.elements.push(currentElement); } currentElement = { name: lineValues[0], count: parseInt(lineValues[1], 10), properties: [] }; break; case 'property': var property = makePLYElementProperty$1(lineValues, options.propertyNameMapping); currentElement.properties.push(property); break; default: console.log('unhandled', lineType, lineValues); } return false; }); case 3: if (currentElement) { header.elements.push(currentElement); } return _context2.abrupt("return", header); case 5: case "end": return _context2.stop(); } } }, _callee2); })); return _parseHeader.apply(this, arguments); } function makePLYElementProperty$1(propertValues, propertyNameMapping) { var property = { type: propertValues[0] }; if (property.type === 'list') { property.name = propertValues[3]; property.countType = propertValues[1]; property.itemType = propertValues[2]; } else { property.name = propertValues[1]; } if (propertyNameMapping && property.name in propertyNameMapping) { property.name = propertyNameMapping[property.name]; } return property; } function parseASCII$1(_x4, _x5) { return _parseASCII.apply(this, arguments); } function _parseASCII() { _parseASCII = _asyncToGenerator(regenerator.mark(function _callee3(lineIterator, header) { var attributes, currentElement, currentElementCount, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, line, element; return regenerator.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: attributes = { indices: [], vertices: [], normals: [], uvs: [], colors: [] }; currentElement = 0; currentElementCount = 0; _iteratorNormalCompletion = true; _didIteratorError = false; _context3.prev = 5; _iterator = _asyncIterator(lineIterator); case 7: _context3.next = 9; return _iterator.next(); case 9: _step = _context3.sent; _iteratorNormalCompletion = _step.done; _context3.next = 13; return _step.value; case 13: _value = _context3.sent; if (_iteratorNormalCompletion) { _context3.next = 21; break; } line = _value; line = line.trim(); if (line !== '') { if (currentElementCount >= header.elements[currentElement].count) { currentElement++; currentElementCount = 0; } element = parseASCIIElement$1(header.elements[currentElement].properties, line); handleElement$1(attributes, header.elements[currentElement].name, element); currentElementCount++; } case 18: _iteratorNormalCompletion = true; _context3.next = 7; break; case 21: _context3.next = 27; break; case 23: _context3.prev = 23; _context3.t0 = _context3["catch"](5); _didIteratorError = true; _iteratorError = _context3.t0; case 27: _context3.prev = 27; _context3.prev = 28; if (!(!_iteratorNormalCompletion && _iterator["return"] != null)) { _context3.next = 32; break; } _context3.next = 32; return _iterator["return"](); case 32: _context3.prev = 32; if (!_didIteratorError) { _context3.next = 35; break; } throw _iteratorError; case 35: return _context3.finish(32); case 36: return _context3.finish(27); case 37: return _context3.abrupt("return", attributes); case 38: case "end": return _context3.stop(); } } }, _callee3, null, [[5, 23, 27, 37], [28,, 32, 36]]); })); return _parseASCII.apply(this, arguments); } function parseASCIINumber$1(n, type) { switch (type) { case 'char': case 'uchar': case 'short': case 'ushort': case 'int': case 'uint': case 'int8': case 'uint8': case 'int16': case 'uint16': case 'int32': case 'uint32': return parseInt(n, 10); case 'float': case 'double': case 'float32': case 'float64': return parseFloat(n); default: throw new Error(type); } } function parseASCIIElement$1(properties, line) { var values = line.split(/\s+/); var element = {}; for (var i = 0; i < properties.length; i++) { if (properties[i].type === 'list') { var list = []; var n = parseASCIINumber$1(values.shift(), properties[i].countType); for (var j = 0; j < n; j++) { list.push(parseASCIINumber$1(values.shift(), properties[i].itemType)); } element[properties[i].name] = list; } else { element[properties[i].name] = parseASCIINumber$1(values.shift(), properties[i].type); } } return element; } function handleElement$1(buffer, elementName, element) { switch (elementName) { case 'vertex': buffer.vertices.push(element.x, element.y, element.z); if ('nx' in element && 'ny' in element && 'nz' in element) { buffer.normals.push(element.nx, element.ny, element.nz); } if ('s' in element && 't' in element) { buffer.uvs.push(element.s, element.t); } if ('red' in element && 'green' in element && 'blue' in element) { buffer.colors.push(element.red / 255.0, element.green / 255.0, element.blue / 255.0); } break; case 'face': var vertexIndices = element.vertex_indices || element.vertex_index; if (vertexIndices.length === 3) { buffer.indices.push(vertexIndices[0], vertexIndices[1], vertexIndices[2]); } else if (vertexIndices.length === 4) { buffer.indices.push(vertexIndices[0], vertexIndices[1], vertexIndices[3]); buffer.indices.push(vertexIndices[1], vertexIndices[2], vertexIndices[3]); } break; } } function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$5(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } var VERSION$3 = "2.3.13" ; var PLYWorkerLoader = { id: 'ply', name: 'PLY', version: VERSION$3, extensions: ['ply'], mimeTypes: ['text/plain', 'application/octet-stream'], text: true, binary: true, tests: ['ply'], options: { ply: { workerUrl: "https://unpkg.com/@loaders.gl/ply@".concat(VERSION$3, "/dist/ply-loader.worker.js") } } }; var PLYLoader = _objectSpread$5(_objectSpread$5({}, PLYWorkerLoader), {}, { parse: function () { var _parse = _asyncToGenerator(regenerator.mark(function _callee(arrayBuffer, options) { return regenerator.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: return _context.abrupt("return", parsePLY(arrayBuffer, options)); case 1: case "end": return _context.stop(); } } }, _callee); })); function parse(_x, _x2) { return _parse.apply(this, arguments); } return parse; }(), parseTextSync: parsePLY, parseSync: parsePLY, parseInBatches: parsePLYInBatches }); /** * @desc Parses PLY file data into an {@link XKTModel}. * * ## Usage * * In the example below we'll create an {@link XKTModel}, then load a PLY model into it. * * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#parsers_PLY_Test)] * * ````javascript * utils.loadArraybuffer("./models/ply/test.ply", async (data) => { * * const xktModel = new XKTModel(); * * parsePLYIntoXKTModel({data, xktModel}).then(()=>{ * xktModel.finalize(); * }, * (msg) => { * console.error(msg); * }); * }); * ```` * * @param {Object} params Parsing params. * @param {ArrayBuffer} params.data PLY file data. * @param {XKTModel} params.xktModel XKTModel to parse into. * @param {Object} [params.stats] Collects statistics. * @param {function} [params.log] Logging callback. * @returns {Promise} */ function parsePLYIntoXKTModel({data, xktModel, stats, log}) { return new Promise(function (resolve, reject) { if (!data) { reject("Argument expected: data"); return; } if (!xktModel) { reject("Argument expected: xktModel"); return; } let parsedData; try { parsedData = parse(data, PLYLoader); } catch (e) { reject("Parsing error: " + e); return; } const attributes = parsedData.attributes; const colorsValue = attributes.COLOR_0.value; const colorsCompressed = []; for (let i = 0, len = colorsValue.length; i < len; i += 4) { colorsCompressed.push(colorsValue[i]); colorsCompressed.push(colorsValue[i + 1]); colorsCompressed.push(colorsValue[i + 2]); } xktModel.createGeometry({ geometryId: "plyGeometry", primitiveType: "triangles", positions: attributes.POSITION.value, colorsCompressed: colorsCompressed }); xktModel.createMesh({ meshId: "plyMesh", geometryId: "plyGeometry" }); xktModel.createEntity({ entityId: "ply", meshIds: ["plyMesh"] }); if (stats) { stats.sourceFormat = "PLY"; stats.schemaVersion = ""; stats.title = ""; stats.author = ""; stats.created = ""; stats.numMetaObjects = 2; stats.numPropertySets = 0; stats.numObjects = 1; stats.numGeometries = 1; stats.numVertices = attributes.POSITION.value.length / 3; } resolve(); }); } /** * Converts surface-perpendicular face normals to vertex normals. Assumes that the mesh contains disjoint triangles * that don't share vertex array elements. Works by finding groups of vertices that have the same location and * averaging their normal vectors. * * @returns {{positions: Array, normals: *}} * @private */ function faceToVertexNormals(positions, normals, options = {}) { const smoothNormalsAngleThreshold = options.smoothNormalsAngleThreshold || 20; const vertexMap = {}; const vertexNormals = []; const vertexNormalAccum = {}; let acc; let vx; let vy; let vz; let key; const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001 const precision = 10 ** precisionPoints; let posi; let i; let j; let len; let a; let b; for (i = 0, len = positions.length; i < len; i += 3) { posi = i / 3; vx = positions[i]; vy = positions[i + 1]; vz = positions[i + 2]; key = `${Math.round(vx * precision)}_${Math.round(vy * precision)}_${Math.round(vz * precision)}`; if (vertexMap[key] === undefined) { vertexMap[key] = [posi]; } else { vertexMap[key].push(posi); } const normal = math.normalizeVec3([normals[i], normals[i + 1], normals[i + 2]]); vertexNormals[posi] = normal; acc = math.vec4([normal[0], normal[1], normal[2], 1]); vertexNormalAccum[posi] = acc; } for (key in vertexMap) { if (vertexMap.hasOwnProperty(key)) { const vertices = vertexMap[key]; const numVerts = vertices.length; for (i = 0; i < numVerts; i++) { const ii = vertices[i]; acc = vertexNormalAccum[ii]; for (j = 0; j < numVerts; j++) { if (i === j) { continue; } const jj = vertices[j]; a = vertexNormals[ii]; b = vertexNormals[jj]; const angle = Math.abs(math.angleVec3(a, b) / math.DEGTORAD); if (angle < smoothNormalsAngleThreshold) { acc[0] += b[0]; acc[1] += b[1]; acc[2] += b[2]; acc[3] += 1.0; } } } } } for (i = 0, len = normals.length; i < len; i += 3) { acc = vertexNormalAccum[i / 3]; normals[i + 0] = acc[0] / acc[3]; normals[i + 1] = acc[1] / acc[3]; normals[i + 2] = acc[2] / acc[3]; } } /** * @desc Parses STL file data into an {@link XKTModel}. * * * Supports binary and ASCII STL formats. * * Option to create a separate {@link XKTEntity} for each group of faces that share the same vertex colors. * * Option to smooth face-aligned normals loaded from STL. * * Option to reduce XKT file size by ignoring STL normals and relying on xeokit to auto-generate them. * * ## Usage * * In the example below we'll create an {@link XKTModel}, then load an STL model into it. * * ````javascript * utils.loadArraybuffer("./models/stl/binary/spurGear.stl", async (data) => { * * const xktModel = new XKTModel(); * * parseSTLIntoXKTModel({data, xktModel}); * * xktModel.finalize(); * }); * ```` * * @param {Object} params Parsing params. * @param {ArrayBuffer|String} [params.data] STL file data. Can be binary or string. * @param {Boolean} [params.autoNormals=false] When true, the parser will ignore the STL geometry normals, and the STL * data will rely on the xeokit ````Viewer```` to automatically generate them. This has the limitation that the * normals will be face-aligned, and therefore the ````Viewer```` will only be able to render a flat-shaded representation * of the STL. * Overrides ````smoothNormals```` when ````true````. This ignores the normals in the STL, and loads no * normals from the STL into the {@link XKTModel}, resulting in the XKT file storing no normals for the STL model. The * xeokit-sdk will then automatically generate the normals within its shaders. The disadvantages are that auto-normals * may slow rendering down a little bit, and that the normals can only be face-aligned (and thus rendered using flat * shading). The advantages, however, are a smaller XKT file size, and the ability to apply certain geometry optimizations * during parsing, such as removing duplicated STL vertex positions, that are not possible when normals are loaded * for the STL vertices. * @param {Boolean} [params.smoothNormals=true] When true, automatically converts face-oriented STL normals to vertex normals, for a smooth appearance. Ignored if ````autoNormals```` is ````true````. * @param {Number} [params.smoothNormalsAngleThreshold=20] This is the threshold angle between normals of adjacent triangles, below which their shared wireframe edge is not drawn. * @param {Boolean} [params.splitMeshes=true] When true, creates a separate {@link XKTEntity} for each group of faces that share the same vertex colors. Only works with binary STL (ie. when ````data```` is an ArrayBuffer). * @param {XKTModel} [params.xktModel] XKTModel to parse into. * @param {Object} [params.stats] Collects statistics. * @param {function} [params.log] Logging callback. * @returns {Promise} */ async function parseSTLIntoXKTModel({ data, splitMeshes, autoNormals, smoothNormals, smoothNormalsAngleThreshold, xktModel, stats, log }) { return new Promise(function (resolve, reject) { if (!data) { reject("Argument expected: data"); return; } if (!xktModel) { reject("Argument expected: xktModel"); return; } const rootMetaObjectId = math.createUUID(); const rootMetaObject = xktModel.createMetaObject({ metaObjectId: rootMetaObjectId, metaObjectType: "Model", metaObjectName: "Model" }); const ctx = { data, splitMeshes, autoNormals, smoothNormals, smoothNormalsAngleThreshold, xktModel, rootMetaObject, nextId: 0, log: (log || function (msg) { }), stats: { numObjects: 0, numGeometries: 0, numTriangles: 0, numVertices: 0 } }; const binData = ensureBinary(data); if (isBinary(binData)) { parseBinary$1(ctx, binData); } else { parseASCII$2(ctx, ensureString(data)); } if (stats) { stats.sourceFormat = "STL"; stats.schemaVersion = ""; stats.title = ""; stats.author = ""; stats.created = ""; stats.numMetaObjects = 2; stats.numPropertySets = 0; stats.numObjects = 1; stats.numGeometries = 1; stats.numTriangles = ctx.stats.numTriangles; stats.numVertices = ctx.stats.numVertices; } resolve(); }); } function isBinary(data) { const reader = new DataView(data); const numFaces = reader.getUint32(80, true); const faceSize = (32 / 8 * 3) + ((32 / 8 * 3) * 3) + (16 / 8); const numExpectedBytes = 80 + (32 / 8) + (numFaces * faceSize); if (numExpectedBytes === reader.byteLength) { return true; } const solid = [115, 111, 108, 105, 100]; for (let i = 0; i < 5; i++) { if (solid[i] !== reader.getUint8(i, false)) { return true; } } return false; } function parseBinary$1(ctx, data) { const reader = new DataView(data); const faces = reader.getUint32(80, true); let r; let g; let b; let hasColors = false; let colors; let defaultR; let defaultG; let defaultB; let lastR = null; let lastG = null; let lastB = null; let newMesh = false; let alpha; for (let index = 0; index < 80 - 10; index++) { if ((reader.getUint32(index, false) === 0x434F4C4F /*COLO*/) && (reader.getUint8(index + 4) === 0x52 /*'R'*/) && (reader.getUint8(index + 5) === 0x3D /*'='*/)) { hasColors = true; colors = []; defaultR = reader.getUint8(index + 6) / 255; defaultG = reader.getUint8(index + 7) / 255; defaultB = reader.getUint8(index + 8) / 255; alpha = reader.getUint8(index + 9) / 255; } } let dataOffset = 84; let faceLength = 12 * 4 + 2; let positions = []; let normals = []; let splitMeshes = ctx.splitMeshes; for (let face = 0; face < faces; face++) { let start = dataOffset + face * faceLength; let normalX = reader.getFloat32(start, true); let normalY = reader.getFloat32(start + 4, true); let normalZ = reader.getFloat32(start + 8, true); if (hasColors) { let packedColor = reader.getUint16(start + 48, true); if ((packedColor & 0x8000) === 0) { r = (packedColor & 0x1F) / 31; g = ((packedColor >> 5) & 0x1F) / 31; b = ((packedColor >> 10) & 0x1F) / 31; } else { r = defaultR; g = defaultG; b = defaultB; } if (splitMeshes && r !== lastR || g !== lastG || b !== lastB) { if (lastR !== null) { newMesh = true; } lastR = r; lastG = g; lastB = b; } } for (let i = 1; i <= 3; i++) { let vertexstart = start + i * 12; positions.push(reader.getFloat32(vertexstart, true)); positions.push(reader.getFloat32(vertexstart + 4, true)); positions.push(reader.getFloat32(vertexstart + 8, true)); if (!ctx.autoNormals) { normals.push(normalX, normalY, normalZ); } if (hasColors) { colors.push(r, g, b, 1); // TODO: handle alpha } } if (splitMeshes && newMesh) { addMesh(ctx, positions, normals, colors); positions = []; normals = []; colors = colors ? [] : null; newMesh = false; } } if (positions.length > 0) { addMesh(ctx, positions, normals, colors); } } function parseASCII$2(ctx, data) { const faceRegex = /facet([\s\S]*?)endfacet/g; let faceCounter = 0; const floatRegex = /[\s]+([+-]?(?:\d+.\d+|\d+.|\d+|.\d+)(?:[eE][+-]?\d+)?)/.source; const vertexRegex = new RegExp('vertex' + floatRegex + floatRegex + floatRegex, 'g'); const normalRegex = new RegExp('normal' + floatRegex + floatRegex + floatRegex, 'g'); const positions = []; const normals = []; const colors = null; let normalx; let normaly; let normalz; let result; let verticesPerFace; let normalsPerFace; let text; while ((result = faceRegex.exec(data)) !== null) { verticesPerFace = 0; normalsPerFace = 0; text = result[0]; while ((result = normalRegex.exec(text)) !== null) { normalx = parseFloat(result[1]); normaly = parseFloat(result[2]); normalz = parseFloat(result[3]); normalsPerFace++; } while ((result = vertexRegex.exec(text)) !== null) { positions.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3])); normals.push(normalx, normaly, normalz); verticesPerFace++; } if (normalsPerFace !== 1) { ctx.log("Error in normal of face " + faceCounter); return -1; } if (verticesPerFace !== 3) { ctx.log("Error in positions of face " + faceCounter); return -1; } faceCounter++; } addMesh(ctx, positions, normals, colors); } let nextGeometryId = 0; function addMesh(ctx, positions, normals, colors) { const indices = new Int32Array(positions.length / 3); for (let ni = 0, len = indices.length; ni < len; ni++) { indices[ni] = ni; } normals = normals && normals.length > 0 ? normals : null; colors = colors && colors.length > 0 ? colors : null; if (!ctx.autoNormals && ctx.smoothNormals) { faceToVertexNormals(positions, normals, {smoothNormalsAngleThreshold: ctx.smoothNormalsAngleThreshold}); } const geometryId = "" + nextGeometryId++; const meshId = "" + nextGeometryId++; const entityId = "" + nextGeometryId++; ctx.xktModel.createGeometry({ geometryId: geometryId, primitiveType: "triangles", positions: positions, normals: (!ctx.autoNormals) ? normals : null, colors: colors, indices: indices }); ctx.xktModel.createMesh({ meshId: meshId, geometryId: geometryId, color: colors ? null : [1, 1, 1], metallic: 0.9, roughness: 0.1 }); ctx.xktModel.createEntity({ entityId: entityId, meshIds: [meshId] }); ctx.xktModel.createMetaObject({ metaObjectId: entityId, metaObjectType: "Default", metaObjectName: "STL Mesh", parentMetaObjectId: ctx.rootMetaObject.metaObjectId }); ctx.stats.numGeometries++; ctx.stats.numObjects++; ctx.stats.numVertices += positions.length / 3; ctx.stats.numTriangles += indices.length / 3; } function ensureString(buffer) { if (typeof buffer !== 'string') { return decodeText$1(new Uint8Array(buffer)); } return buffer; } function ensureBinary(buffer) { if (typeof buffer === 'string') { const arrayBuffer = new Uint8Array(buffer.length); for (let i = 0; i < buffer.length; i++) { arrayBuffer[i] = buffer.charCodeAt(i) & 0xff; // implicitly assumes little-endian } return arrayBuffer.buffer || arrayBuffer; } else { return buffer; } } function decodeText$1(array) { if (typeof TextDecoder !== 'undefined') { return new TextDecoder().decode(array); } let s = ''; for (let i = 0, il = array.length; i < il; i++) { s += String.fromCharCode(array[i]); // Implicitly assumes little-endian. } return decodeURIComponent(escape(s)); } var jszip_min = createCommonjsModule(function (module, exports) { /*! JSZip v3.6.0 - A JavaScript class for generating and reading zip files (c) 2009-2016 Stuart Knightley Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown. JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/master/LICENSE */ !function(e){module.exports=e();}(function(){return function s(a,o,u){function h(r,e){if(!o[r]){if(!a[r]){var t="function"==typeof commonjsRequire&&commonjsRequire;if(!e&&t)return t(r,!0);if(f)return f(r,!0);var n=new Error("Cannot find module '"+r+"'");throw n.code="MODULE_NOT_FOUND",n}var i=o[r]={exports:{}};a[r][0].call(i.exports,function(e){var t=a[r][1][e];return h(t||e)},i,i.exports,s,a,o,u);}return o[r].exports}for(var f="function"==typeof commonjsRequire&&commonjsRequire,e=0;e>2,s=(3&t)<<4|r>>4,a=1>6:64,o=2>4,r=(15&i)<<4|(s=p.indexOf(e.charAt(o++)))>>2,n=(3&s)<<6|(a=p.indexOf(e.charAt(o++))),h[u++]=t,64!==s&&(h[u++]=r),64!==a&&(h[u++]=n);return h};},{"./support":30,"./utils":32}],2:[function(e,t,r){var n=e("./external"),i=e("./stream/DataWorker"),s=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function o(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i;}o.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new a("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=o;},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(e){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate");},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){var n=e("./utils"),a=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e;}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r){var n=a,i=0+r;e^=-1;for(var s=0;s>>8^n[255&(e^t[s])];return -1^e}(0|t,e,e.length):function(e,t,r){var n=a,i=0+r;e^=-1;for(var s=0;s>>8^n[255&(e^t.charCodeAt(s))];return -1^e}(0|t,e,e.length):0};},{"./utils":32}],5:[function(e,t,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null;},{}],6:[function(e,t,r){var n;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n};},{lie:37}],7:[function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),s=e("./utils"),a=e("./stream/GenericWorker"),o=n?"uint8array":"array";function u(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={};}r.magic="\b\0",s.inherits(u,a),u.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(o,e.data),!1);},u.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0);},u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null;},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta});};},r.compressWorker=function(e){return new u("Deflate",e)},r.uncompressWorker=function(){return new u("Inflate",{})};},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){function I(e,t){var r,n="";for(r=0;r>>=8;return n}function i(e,t,r,n,i,s){var a,o,u=e.file,h=e.compression,f=s!==B.utf8encode,l=O.transformTo("string",s(u.name)),d=O.transformTo("string",B.utf8encode(u.name)),c=u.comment,p=O.transformTo("string",s(c)),m=O.transformTo("string",B.utf8encode(c)),_=d.length!==u.name.length,g=m.length!==c.length,v="",b="",w="",y=u.dir,k=u.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),f||!_&&!g||(S|=2048);var z,E=0,C=0;y&&(E|=16),"UNIX"===i?(C=798,E|=((z=u.unixPermissions)||(z=y?16893:33204),(65535&z)<<16)):(C=20,E|=63&(u.dosPermissions||0)),a=k.getUTCHours(),a<<=6,a|=k.getUTCMinutes(),a<<=5,a|=k.getUTCSeconds()/2,o=k.getUTCFullYear()-1980,o<<=4,o|=k.getUTCMonth()+1,o<<=5,o|=k.getUTCDate(),_&&(v+="up"+I((b=I(1,1)+I(T(l),4)+d).length,2)+b),g&&(v+="uc"+I((w=I(1,1)+I(T(p),4)+m).length,2)+w);var A="";return A+="\n\0",A+=I(S,2),A+=h.magic,A+=I(a,2),A+=I(o,2),A+=I(x.crc32,4),A+=I(x.compressedSize,4),A+=I(x.uncompressedSize,4),A+=I(l.length,2),A+=I(v.length,2),{fileRecord:R.LOCAL_FILE_HEADER+A+l+v,dirRecord:R.CENTRAL_FILE_HEADER+I(C,2)+A+I(p.length,2)+"\0\0\0\0"+I(E,4)+I(n,4)+l+v+p}}var O=e("../utils"),s=e("../stream/GenericWorker"),B=e("../utf8"),T=e("../crc32"),R=e("../signature");function n(e,t,r,n){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[];}O.inherits(n,s),n.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}));},n.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}});}else this.accumulate=!0;},n.prototype.closedSource=function(e){this.accumulate=!1;var t,r=this.streamFiles&&!e.file.dir,n=i(e,r,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),r)this.push({data:(t=e,R.DATA_DESCRIPTOR+I(t.crc32,4)+I(t.compressedSize,4)+I(t.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null;},n.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i;},{"../utils":32}],19:[function(e,t,r){var n=e("./Uint8ArrayReader");function i(e){n.call(this,e);}e("../utils").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i;},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){var n=e("./DataReader");function i(e){n.call(this,e);}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i;},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){var n=e("./ArrayReader");function i(e){n.call(this,e);}e("../utils").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i;},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){var n=e("../utils"),i=e("../support"),s=e("./ArrayReader"),a=e("./StringReader"),o=e("./NodeBufferReader"),u=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new o(e):i.uint8array?new u(n.transformTo("uint8array",e)):new s(n.transformTo("array",e)):new a(e)};},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b";},{}],24:[function(e,t,r){var n=e("./GenericWorker"),i=e("../utils");function s(e){n.call(this,"ConvertWorker to "+e),this.destType=e;}i.inherits(s,n),s.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta});},t.exports=s;},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){var n=e("./GenericWorker"),i=e("../crc32");function s(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0);}e("../utils").inherits(s,n),s.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e);},t.exports=s;},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function s(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0);}n.inherits(s,i),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length;}i.prototype.processChunk.call(this,e);},t.exports=s;},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function s(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat();},function(e){t.error(e);});}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null;},s.prototype.resume=function(){return !!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0));},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return !1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t);}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s;},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null;}n.prototype={push:function(e){this.emit("data",e);},end:function(){if(this.isFinished)return !1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0;}catch(e){this.emit("error",e);}return !0},error:function(e){return !this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[];},emit:function(e,t){if(this._listeners[e])for(var r=0;r "+e:e}},t.exports=n;},{}],29:[function(e,t,r){var h=e("../utils"),i=e("./ConvertWorker"),s=e("./GenericWorker"),f=e("../base64"),n=e("../support"),a=e("../external"),o=null;if(n.nodestream)try{o=e("../nodejs/NodejsStreamOutputAdapter");}catch(e){}function u(e,t,r){var n=t;switch(t){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string";}try{this._internalType=n,this._outputType=t,this._mimeType=r,h.checkSupport(n),this._worker=e.pipe(new i(n)),e.lock();}catch(e){this._worker=new s("error"),this._worker.error(e);}}u.prototype={accumulate:function(e){return o=this,u=e,new a.Promise(function(t,r){var n=[],i=o._internalType,s=o._outputType,a=o._mimeType;o.on("data",function(e,t){n.push(e),u&&u(t);}).on("error",function(e){n=[],r(e);}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return h.newBlob(h.transformTo("arraybuffer",t),r);case"base64":return f.encode(t);default:return h.transformTo(e,t)}}(s,function(e,t){var r,n=0,i=null,s=0;for(r=0;r>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},s.utf8decode=function(e){return u.nodebuffer?o.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,n,i,s=e.length,a=new Array(2*s);for(t=r=0;t>10&1023,a[r++]=56320|1023&n);}return a.length!==r&&(a.subarray?a=a.subarray(0,r):a.length=r),o.applyFromCharCode(a)}(e=o.transformTo(u.uint8array?"uint8array":"array",e))},o.inherits(a,n),a.prototype.processChunk=function(e){var t=o.transformTo(u.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(u.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),t.set(r,this.leftOver.length);}else t=this.leftOver.concat(t);this.leftOver=null;}var n=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+h[e[r]]>t?r:t}(t),i=t;n!==t.length&&(u.uint8array?(i=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(i=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:s.utf8decode(i),meta:e.meta});},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null);},s.Utf8DecodeWorker=a,o.inherits(f,n),f.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta});},s.Utf8EncodeWorker=f;},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,o){var u=e("./support"),h=e("./base64"),r=e("./nodejsUtils"),n=e("set-immediate-shim"),f=e("./external");function i(e){return e}function l(e,t){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0);},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4));}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return f(e,e.length)},r.binstring2buf=function(e){for(var t=new u.Buf8(e.length),r=0,n=t.length;r>10&1023,o[n++]=56320|1023&i);}return f(o,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+h[e[r]]>t?r:t};},{"./common":41}],43:[function(e,t,r){t.exports=function(e,t,r,n){for(var i=65535&e|0,s=e>>>16&65535|0,a=0;0!==r;){for(r-=a=2e3>>1:e>>>1;t[r]=e;}return t}();t.exports=function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t[a])];return -1^e};},{}],46:[function(e,t,r){var u,d=e("../utils/common"),h=e("./trees"),c=e("./adler32"),p=e("./crc32"),n=e("./messages"),f=0,l=0,m=-2,i=2,_=8,s=286,a=30,o=19,g=2*s+1,v=15,b=3,w=258,y=w+b+1,k=42,x=113;function S(e,t){return e.msg=n[t],t}function z(e){return (e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(d.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0));}function A(e,t){h._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,C(e.strm);}function I(e,t){e.pending_buf[e.pending++]=t;}function O(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t;}function B(e,t){var r,n,i=e.max_chain_length,s=e.strstart,a=e.prev_length,o=e.nice_match,u=e.strstart>e.w_size-y?e.strstart-(e.w_size-y):0,h=e.window,f=e.w_mask,l=e.prev,d=e.strstart+w,c=h[s+a-1],p=h[s+a];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(h[(r=t)+a]===p&&h[r+a-1]===c&&h[r]===h[s]&&h[++r]===h[s+1]){s+=2,r++;do{}while(h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&su&&0!=--i);return a<=e.lookahead?a:e.lookahead}function T(e){var t,r,n,i,s,a,o,u,h,f,l=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=l+(l-y)){for(d.arraySet(e.window,e.window,l,l,0),e.match_start-=l,e.strstart-=l,e.block_start-=l,t=r=e.hash_size;n=e.head[--t],e.head[t]=l<=n?n-l:0,--r;);for(t=r=l;n=e.prev[--t],e.prev[t]=l<=n?n-l:0,--r;);i+=l;}if(0===e.strm.avail_in)break;if(a=e.strm,o=e.window,u=e.strstart+e.lookahead,f=void 0,(h=i)<(f=a.avail_in)&&(f=h),r=0===f?0:(a.avail_in-=f,d.arraySet(o,a.input,a.next_in,f,u),1===a.state.wrap?a.adler=c(a.adler,o,f,u):2===a.state.wrap&&(a.adler=p(a.adler,o,f,u)),a.next_in+=f,a.total_in+=f,f),e.lookahead+=r,e.lookahead+e.insert>=b)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=b&&(e.ins_h=(e.ins_h<=b)if(n=h._tr_tally(e,e.strstart-e.match_start,e.match_length-b),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=b){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=b&&(e.ins_h=(e.ins_h<=b&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-b,n=h._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-b),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(T(e),0===e.lookahead&&t===f)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,A(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-y&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(A(e,!1),e.strm.avail_out),1)}),new F(4,4,8,4,R),new F(4,5,16,8,R),new F(4,6,32,32,R),new F(4,4,16,16,D),new F(8,16,32,32,D),new F(8,16,128,128,D),new F(8,32,128,256,D),new F(32,128,258,1024,D),new F(32,258,258,4096,D)],r.deflateInit=function(e,t){return L(e,t,_,15,8,0)},r.deflateInit2=L,r.deflateReset=P,r.deflateResetKeep=U,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?m:(e.state.gzhead=t,l):m},r.deflate=function(e,t){var r,n,i,s;if(!e||!e.state||5>8&255),I(n,n.gzhead.time>>16&255),I(n,n.gzhead.time>>24&255),I(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),I(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(I(n,255&n.gzhead.extra.length),I(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=p(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(I(n,0),I(n,0),I(n,0),I(n,0),I(n,0),I(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),I(n,3),n.status=x);else {var a=_+(n.w_bits-8<<4)<<8;a|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=32),a+=31-a%31,n.status=x,O(n,a),0!==n.strstart&&(O(n,e.adler>>>16),O(n,65535&e.adler)),e.adler=1;}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending!==n.pending_buf_size));)I(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73);}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.gzindex=0,n.status=91);}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.status=103);}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&C(e),n.pending+2<=n.pending_buf_size&&(I(n,255&e.adler),I(n,e.adler>>8&255),e.adler=0,n.status=x)):n.status=x),0!==n.pending){if(C(e),0===e.avail_out)return n.last_flush=-1,l}else if(0===e.avail_in&&z(t)<=z(r)&&4!==t)return S(e,-5);if(666===n.status&&0!==e.avail_in)return S(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==f&&666!==n.status){var o=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(T(e),0===e.lookahead)){if(t===f)return 1;break}if(e.match_length=0,r=h._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(A(e,!1),0===e.strm.avail_out)?1:2}(n,t):3===n.strategy?function(e,t){for(var r,n,i,s,a=e.window;;){if(e.lookahead<=w){if(T(e),e.lookahead<=w&&t===f)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=b&&0e.lookahead&&(e.match_length=e.lookahead);}if(e.match_length>=b?(r=h._tr_tally(e,1,e.match_length-b),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=h._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(A(e,!1),0===e.strm.avail_out)?1:2}(n,t):u[n.level].func(n,t);if(3!==o&&4!==o||(n.status=666),1===o||3===o)return 0===e.avail_out&&(n.last_flush=-1),l;if(2===o&&(1===t?h._tr_align(n):5!==t&&(h._tr_stored_block(n,0,0,!1),3===t&&(E(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),C(e),0===e.avail_out))return n.last_flush=-1,l}return 4!==t?l:n.wrap<=0?1:(2===n.wrap?(I(n,255&e.adler),I(n,e.adler>>8&255),I(n,e.adler>>16&255),I(n,e.adler>>24&255),I(n,255&e.total_in),I(n,e.total_in>>8&255),I(n,e.total_in>>16&255),I(n,e.total_in>>24&255)):(O(n,e.adler>>>16),O(n,65535&e.adler)),C(e),0=r.w_size&&(0===s&&(E(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new d.Buf8(r.w_size),d.arraySet(h,t,f-r.w_size,r.w_size,0),t=h,f=r.w_size),a=e.avail_in,o=e.next_in,u=e.input,e.avail_in=f,e.next_in=0,e.input=t,T(r);r.lookahead>=b;){for(n=r.strstart,i=r.lookahead-(b-1);r.ins_h=(r.ins_h<>>=w=b>>>24,p-=w,0==(w=b>>>16&255))E[s++]=65535&b;else {if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(c&(1<>>=w,p-=w),p<15&&(c+=z[n++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=_[(65535&b)+(c&(1<>>=w,p-=w,(w=s-a)>3,c&=(1<<(p-=y<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new I.Buf16(320),this.work=new I.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0;}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=P,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new I.Buf32(n),t.distcode=t.distdyn=new I.Buf32(i),t.sane=1,t.back=-1,N):U}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):U}function u(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=s.wsize?(I.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n<(i=s.wsize-s.wnext)&&(i=n),I.arraySet(s.window,t,r-n,i,s.wnext),(n-=i)?(I.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=B(r.check,C,2,0),f=h=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&h)){e.msg="unknown compression method",r.mode=30;break}if(f-=4,k=8+(15&(h>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(C[0]=255&h,C[1]=h>>>8&255,r.check=B(r.check,C,2,0)),f=h=0,r.mode=3;case 3:for(;f<32;){if(0===o)break e;o--,h+=n[s++]<>>8&255,C[2]=h>>>16&255,C[3]=h>>>24&255,r.check=B(r.check,C,4,0)),f=h=0,r.mode=4;case 4:for(;f<16;){if(0===o)break e;o--,h+=n[s++]<>8),512&r.flags&&(C[0]=255&h,C[1]=h>>>8&255,r.check=B(r.check,C,2,0)),f=h=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===o)break e;o--,h+=n[s++]<>>8&255,r.check=B(r.check,C,2,0)),f=h=0;}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(o<(c=r.length)&&(c=o),c&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),I.arraySet(r.head.extra,n,s,c,k)),512&r.flags&&(r.check=B(r.check,n,c,s)),o-=c,s+=c,r.length-=c),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break e;for(c=0;k=n[s+c++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&c>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===o)break e;o--,h+=n[s++]<>>=7&f,f-=7&f,r.mode=27;break}for(;f<3;){if(0===o)break e;o--,h+=n[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==t)break;h>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30;}h>>>=2,f-=2;break;case 14:for(h>>>=7&f,f-=7&f;f<32;){if(0===o)break e;o--,h+=n[s++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&h,f=h=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(c=r.length){if(o>>=5,f-=5,r.ndist=1+(31&h),h>>>=5,f-=5,r.ncode=4+(15&h),h>>>=4,f-=4,286>>=3,f-=3;}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=R(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,v=65535&E,!((_=E>>>24)<=f);){if(0===o)break e;o--,h+=n[s++]<>>=_,f-=_,r.lens[r.have++]=v;else {if(16===v){for(z=_+2;f>>=_,f-=_,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],c=3+(3&h),h>>>=2,f-=2;}else if(17===v){for(z=_+3;f>>=_)),h>>>=3,f-=3;}else {for(z=_+7;f>>=_)),h>>>=7,f-=7;}if(r.have+c>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;c--;)r.lens[r.have++]=k;}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=R(D,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=R(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=o&&258<=u){e.next_out=a,e.avail_out=u,e.next_in=s,e.avail_in=o,r.hold=h,r.bits=f,T(e,d),a=e.next_out,i=e.output,u=e.avail_out,s=e.next_in,n=e.input,o=e.avail_in,h=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;g=(E=r.lencode[h&(1<>>16&255,v=65535&E,!((_=E>>>24)<=f);){if(0===o)break e;o--,h+=n[s++]<>b)])>>>16&255,v=65535&E,!(b+(_=E>>>24)<=f);){if(0===o)break e;o--,h+=n[s++]<>>=b,f-=b,r.back+=b;}if(h>>>=_,f-=_,r.back+=_,r.length=v,0===g){r.mode=26;break}if(32&g){r.back=-1,r.mode=12;break}if(64&g){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&g,r.mode=22;case 22:if(r.extra){for(z=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra;}r.was=r.length,r.mode=23;case 23:for(;g=(E=r.distcode[h&(1<>>16&255,v=65535&E,!((_=E>>>24)<=f);){if(0===o)break e;o--,h+=n[s++]<>b)])>>>16&255,v=65535&E,!(b+(_=E>>>24)<=f);){if(0===o)break e;o--,h+=n[s++]<>>=b,f-=b,r.back+=b;}if(h>>>=_,f-=_,r.back+=_,64&g){e.msg="invalid distance code",r.mode=30;break}r.offset=v,r.extra=15&g,r.mode=24;case 24:if(r.extra){for(z=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra;}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===u)break e;if(c=d-u,r.offset>c){if((c=r.offset-c)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}p=c>r.wnext?(c-=r.wnext,r.wsize-c):r.wnext-c,c>r.length&&(c=r.length),m=r.window;}else m=i,p=a-r.offset,c=r.length;for(uc?(m=T[R+a[b]],A[I+a[b]]):(m=96,0),u=1<>S)+(h-=u)]=p<<24|m<<16|_|0,0!==h;);for(u=1<>=1;if(0!==u?(C&=u-1,C+=u):C=0,b++,0==--O[v]){if(v===y)break;v=t[r+a[b]];}if(k>>7)]}function x(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255;}function S(e,t,r){e.bi_valid>i-r?(e.bi_buf|=t<>i-e.bi_valid,e.bi_valid+=r-i):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function C(e,t,r){var n,i,s=new Array(_+1),a=0;for(n=1;n<=_;n++)s[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var o=e[2*i+1];0!==o&&(e[2*i]=E(s[o]++,o));}}function A(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0;}function I(e){8>1;1<=r;r--)B(e,s,r);for(i=u;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],B(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,B(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,a,o,u=t.dyn_tree,h=t.max_code,f=t.stat_desc.static_tree,l=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,c=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(s=0;s<=_;s++)e.bl_count[s]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)p<(s=u[2*u[2*(n=e.heap[r])+1]+1]+1)&&(s=p,m++),u[2*n+1]=s,h>=7;n<30;n++)for(w[n]=i<<7,e=0;e<1<>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),R(e,e.l_desc),R(e,e.d_desc),a=function(e){var t;for(D(e,e.dyn_ltree,e.l_desc.max_code),D(e,e.dyn_dtree,e.d_desc.max_code),R(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*f[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?U(e,t,r,n):4===e.strategy||s===i?(S(e,2+(n?1:0),3),T(e,l,d)):(S(e,4+(n?1:0),3),function(e,t,r,n){var i;for(S(e,t-257,5),S(e,r-1,5),S(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(p[r]+256+1)]++,e.dyn_dtree[2*k(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;S(e,2,3),z(e,256,l),16===(t=e).bi_valid?(x(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8);};},{"../utils/common":41}],53:[function(e,t,r){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0;};},{}],54:[function(e,t,r){t.exports="function"==typeof setImmediate?setImmediate:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e);};},{}]},{},[10])(10)});}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{}]},{},[1])(1)});}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{}]},{},[1])(1)});}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{}]},{},[1])(1)});}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{}]},{},[1])(1)});}).call(this,"undefined"!=typeof commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{}]},{},[1])(1)}); }); /** * @private */ class ZIPArchive { constructor(domParser) { this._zip = new jszip_min(); this._domParser = domParser; } init(blob) { return this._zip.loadAsync(blob); } async getFile(src) { const fileText = await this._zip.file(src).async("string"); if (!fileText) { const errMsg = "ZIP entry not found: " + src; console.error(errMsg); return; } const xmlDoc = this._domParser.parseFromString(fileText, "text/xml"); const json = xmlToJSON(xmlDoc, {}); return {xmlDoc, json}; } destroy() { } } function xmlToJSON(node, attributeRenamer) { if (node.nodeType === node.TEXT_NODE) { const v = node.nodeValue; if (v.match(/^\s+$/) === null) { return v; } } else if (node.nodeType === node.ELEMENT_NODE || node.nodeType === node.DOCUMENT_NODE) { const json = {type: node.nodeName, children: []}; if (node.nodeType === node.ELEMENT_NODE) { for (let i = 0, len = node.attributes.length; i < len; i++) { const attribute = node.attributes[i]; const nm = attributeRenamer[attribute.nodeName] || attribute.nodeName; json[nm] = attribute.nodeValue; } } for (let i = 0, len = node.childNodes.length; i < len; i++) { const item = node.childNodes[i]; const jsonPortion = xmlToJSON(item, attributeRenamer); if (jsonPortion) { json.children.push(jsonPortion); } } return json; } } const supportedSchemas = ["4.2"]; /** * @desc Loads 3DXML into an {@link XKTModel}. * * Supports 3DXML Schema 4.2. * * @param {Object} params Parsing parameters. * @param {ArrayBuffer} params.data 3DXML BLOB data. * @param {DOMParser} params.domParser A DOMParser implementation (eg. ````xmldom````), required when * we're not running in a browser and ````window.DOMParser```` is not available. * @param {XKTModel} params.xktModel XKTModel to parse into. * @param {Boolean} [params.autoNormals=false] When true, the parser will ignore the 3DXML geometry normals, and the 3DXML * data will rely on the xeokit ````Viewer```` to automatically generate them. This has the limitation that the * normals will be face-aligned, and therefore the ````Viewer```` will only be able to render a flat-shaded representation * of the 3DXML model. This is ````false```` by default because CAD models tend to prefer smooth shading. * @param {Object} [params.stats] Collects statistics. * @param {function} [params.log] Logging callback. */ function parse3DXMLIntoXKTModel({data, domParser, xktModel, autoNormals = false, stats = {}, log}) { return new Promise(function (resolve, reject) { const isBrowser = (typeof window !== 'undefined'); if (isBrowser) { domParser = new DOMParser(); } else if (!domParser) { reject("Config expected: domParser (needed when running in node.js)"); return; } if (!data) { reject("Config expected: data"); return; } if (!xktModel) { reject("Config expected: xktModel"); return; } const zipArchive = new ZIPArchive(domParser); zipArchive.init(data).then(() => { const rootMetaObjectId = math.createUUID(); xktModel.createMetaObject({ metaObjectId: rootMetaObjectId, metaObjectType: "Model", metaObjectName: "Model" }); const modelMetaObjectId = math.createUUID(); xktModel.createMetaObject({ metaObjectId: modelMetaObjectId, metaObjectType: "3DXML", metaObjectName: "3DXML", parentMetaObjectId: rootMetaObjectId }); const ctx = { rootMetaObjectId: modelMetaObjectId, zipArchive: zipArchive, edgeThreshold: 10, xktModel: xktModel, autoNormals: autoNormals, info: { references: {} }, log: (msg) => { if (log) { log(msg); } }, warn: (msg) => { if (log) { log("Warning: " + msg); } }, error: (msg) => { if (log) { log("Error: " + msg); } }, nextId: 0, materials: {}, stats: { numObjects: 0, numGeometries: 0, numTriangles: 0, numVertices: 0, sourceFormat: "3DXML", schemaVersion: "", title: "", author: "", created: "" } }; parseDocument(ctx).then(() => { ctx.log("Converted drawable objects: " + ctx.stats.numObjects); ctx.log("Converted geometries: " + ctx.stats.numGeometries); ctx.log("Converted triangles: " + ctx.stats.numTriangles); ctx.log("Converted vertices: " + ctx.stats.numVertices); if (stats) { stats.numTriangles = ctx.stats.numTriangles; stats.numVertices = ctx.stats.numVertices; stats.numObjects = ctx.stats.numObjects; stats.numGeometries = ctx.stats.numGeometries; } resolve(); }); }, (errMsg) => { reject(errMsg); }); }); } async function parseDocument(ctx) { const files = await ctx.zipArchive.getFile("Manifest.xml"); const node = files.json; const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "Manifest": await parseManifest(ctx, child); break; } } } async function parseManifest(ctx, manifest) { const children = manifest.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "Root": const rootFileSrc = child.children[0]; const files = await ctx.zipArchive.getFile(rootFileSrc); const json = files.json; await parseRoot(ctx, json); break; } } } async function parseRoot(ctx, node) { const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "Model_3dxml": await parseModel(ctx, child); break; } } } async function parseModel(ctx, node) { const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "Header": parseHeader$3(ctx, child); break; case "ProductStructure": await parseProductStructure(ctx, child); break; case "DefaultView": parseDefaultView(ctx, child); break; } } } function parseHeader$3(ctx, node) { const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "SchemaVersion": ctx.stats.schemaVersion = child.children[0]; if (!isSchemaVersionSupported(ctx, ctx.stats.schemaVersion)) { ctx.error("3DXML schema version not supported: " + ctx.stats.schemaVersion + " - supported versions are: " + supportedSchemas.join(",")); } else { ctx.log("Parsing 3DXML schema version: " + ctx.stats.schemaVersion); } break; case "Title": ctx.stats.title = child.children[0]; break; case "Author": ctx.stats.author = child.children[0]; break; case "Created": ctx.stats.created = child.children[0]; break; } } } function isSchemaVersionSupported(ctx, schemaVersion) { for (let i = 0, len = supportedSchemas.length; i < len; i++) { if (schemaVersion === supportedSchemas[i]) { return true; } } return false; } async function parseProductStructure(ctx, productStructureNode) { const referenceReps = await parseReferenceReps(ctx, productStructureNode); // Parse out an intermediate scene DAG representation, that we can then // recursive descend through to build the XKTModel. const children = productStructureNode.children; const reference3Ds = {}; const instanceReps = {}; const instance3Ds = {}; // Map all the elements for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; let isAggregatedBy; let isInstanceOf; let relativeMatrix; switch (child.type) { case "Reference3D": reference3Ds[child.id] = { type: "Reference3D", id: child.id, name: child.name, instance3Ds: {}, instanceReps: {} }; break; case "InstanceRep": for (let j = 0, lenj = child.children.length; j < lenj; j++) { const child2 = child.children[j]; switch (child2.type) { case "IsAggregatedBy": isAggregatedBy = child2.children[0]; break; case "IsInstanceOf": isInstanceOf = child2.children[0]; break; } } instanceReps[child.id] = { type: "InstanceRep", id: child.id, name: child.name, isAggregatedBy: isAggregatedBy, isInstanceOf: isInstanceOf, referenceReps: {} }; break; case "Instance3D": for (let j = 0, lenj = child.children.length; j < lenj; j++) { const child2 = child.children[j]; switch (child2.type) { case "IsAggregatedBy": isAggregatedBy = child2.children[0]; break; case "IsInstanceOf": isInstanceOf = child2.children[0]; break; case "RelativeMatrix": relativeMatrix = child2.children[0]; break; } } instance3Ds[child.id] = { type: "Instance3D", id: child.id, name: child.name, isAggregatedBy: isAggregatedBy, isInstanceOf: isInstanceOf, relativeMatrix: relativeMatrix, reference3Ds: {} }; break; } } // Connect Reference3Ds to the Instance3Ds they aggregate for (let id in instance3Ds) { const instance3D = instance3Ds[id]; const reference3D = reference3Ds[instance3D.isAggregatedBy]; if (reference3D) { reference3D.instance3Ds[instance3D.id] = instance3D; } } // Connect Instance3Ds to the Reference3Ds they instantiate for (let id in instance3Ds) { const instance3D = instance3Ds[id]; const reference3D = reference3Ds[instance3D.isInstanceOf]; instance3D.reference3Ds[reference3D.id] = reference3D; reference3D.instance3D = instance3D; } // Connect InstanceReps to the ReferenceReps they instantiate for (let id in instanceReps) { const instanceRep = instanceReps[id]; const referenceRep = referenceReps[instanceRep.isInstanceOf]; if (referenceRep) { instanceRep.referenceReps[referenceRep.id] = referenceRep; } } // Connect Reference3Ds to the InstanceReps they aggregate for (let id in instanceReps) { const instanceRep = instanceReps[id]; const reference3D = reference3Ds[instanceRep.isAggregatedBy]; if (reference3D) { reference3D.instanceReps[instanceRep.id] = instanceRep; } } // Find the root Reference3D const parentMatrix = math.identityMat4(); for (let id in reference3Ds) { const reference3D = reference3Ds[id]; if (!reference3D.instance3D) { parseReference3D(ctx, reference3D, ctx.rootMetaObjectId, parentMatrix); return; } } ctx.error("No root Reference3D element found in this modelNode - can't load 3DXML file."); } function parseInstance3D(ctx, instance3D, parentMetaObjectId, parentMatrix) { const objectId = ctx.nextId++; const rotationMatrix = math.identityMat4(); const translationMatrix = math.identityMat4(); const localMatrix = math.identityMat4(); const worldMatrix = math.identityMat4(); if (instance3D.relativeMatrix) { const relativeMatrix = parseFloatArray(instance3D.relativeMatrix, 12); const translate = [relativeMatrix[9], relativeMatrix[10], relativeMatrix[11]]; math.translationMat4v(translate, translationMatrix); math.mat3ToMat4(relativeMatrix.slice(0, 9), rotationMatrix); math.mulMat4(rotationMatrix, translationMatrix, localMatrix); math.mulMat4(parentMatrix, localMatrix, worldMatrix); ctx.xktModel.createMetaObject({ metaObjectId: objectId, metaObjectType: "Default", metaObjectName: instance3D.name, parentMetaObjectId: parentMetaObjectId }); for (let id in instance3D.reference3Ds) { parseReference3D(ctx, instance3D.reference3Ds[id], objectId, worldMatrix); } } else { ctx.xktModel.createMetaObject({ metaObjectId: objectId, metaObjectType: "Default", metaObjectName: instance3D.name, parentMetaObjectId: parentMetaObjectId }); for (let id in instance3D.reference3Ds) { parseReference3D(ctx, instance3D.reference3Ds[id], objectId, parentMatrix); } } } function parseReference3D(ctx, reference3D, parentMetaObjectId, parentMatrix) { for (let id in reference3D.instance3Ds) { parseInstance3D(ctx, reference3D.instance3Ds[id], parentMetaObjectId, parentMatrix); } for (let id in reference3D.instanceReps) { parseInstanceRep(ctx, reference3D.instanceReps[id], parentMetaObjectId, parentMatrix); } } function parseInstanceRep(ctx, instanceRep, parentMetaObjectId, parentMatrix) { if (instanceRep.referenceReps) { for (let id in instanceRep.referenceReps) { const referenceRep = instanceRep.referenceReps[id]; for (let id2 in referenceRep) { if (id2 === "id") { continue; // HACK } const meshCfg = referenceRep[id2]; const colorize = meshCfg.color; const meshId = "" + ctx.nextId++; const entityId = "" + ctx.nextId++; ctx.xktModel.createMesh({ meshId: meshId, geometryId: meshCfg.geometryId, matrix: parentMatrix, color: colorize }); ctx.xktModel.createEntity({ entityId: entityId, meshIds: [meshId] }); ctx.stats.numObjects++; ctx.xktModel.createMetaObject({ metaObjectId: entityId, metaObjectType: "Default", metaObjectName: instanceRep.name, parentMetaObjectId: parentMetaObjectId }); } } } } async function parseReferenceReps(ctx, node) { const referenceReps = {}; const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "ReferenceRep": if (child.associatedFile) { const src = stripURN(child.associatedFile); const childId = child.id; const file = await ctx.zipArchive.getFile(src); const materialIds = file.xmlDoc.getElementsByTagName("MaterialId"); await loadCATMaterialRefDocuments(ctx, materialIds); const referenceRep = { id: childId }; parse3DRepDocument(ctx, file.json, referenceRep); referenceReps[childId] = referenceRep; } break; } } return referenceReps; } function parseDefaultView(ctx, node) { const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "Viewpoint": const children2 = child.children; ctx.viewpoint = {}; for (let i2 = 0, len2 = children2.length; i2 < len2; i2++) { const child2 = children2[i]; switch (child2.type) { case "Position": ctx.viewpoint.eye = parseFloatArray(child2.children[0], 3); break; case "Sight": ctx.viewpoint.look = parseFloatArray(child2.children[0], 3); break; case "Up": ctx.viewpoint.up = parseFloatArray(child2.children[0], 3); break; } } break; } } } function parse3DRepDocument(ctx, node, result) { const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "XMLRepresentation": parseXMLRepresentation(ctx, child, result); break; } } } function parseXMLRepresentation(ctx, node, result) { const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "Root": parse3DRepRoot(ctx, child, result); break; } } } function parse3DRepRoot(ctx, node, result) { switch (node["xsi:type"]) { } const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "Rep": parse3DRepRep(ctx, child, result); break; } } } function parse3DRepRep(ctx, node, result) { switch (node["xsi:type"]) { } const meshesResult = {}; const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "Rep": parse3DRepRep(ctx, child, result); break; case "Edges": // Ignoring edges because we auto-generate them break; case "Faces": meshesResult.primitive = "triangles"; parseFaces(ctx, child, meshesResult); break; case "VertexBuffer": parseVertexBuffer(ctx, child, meshesResult); break; case "SurfaceAttributes": parseSurfaceAttributes(ctx, child, meshesResult); break; } } if (meshesResult.positions) { const geometryId = "" + ctx.nextId++; ctx.xktModel.createGeometry({ geometryId: geometryId, primitiveType: meshesResult.primitive, positions: meshesResult.positions, normals: meshesResult.normals, indices: meshesResult.indices, }); result[geometryId] = { geometryId: geometryId, color: meshesResult.color || [1.0, 1.0, 1.0, 1.0], materialId: meshesResult.materialId }; ctx.stats.numGeometries++; ctx.stats.numVertices += meshesResult.positions ? meshesResult.positions.length / 3 : 0; ctx.stats.numTriangles += meshesResult.indices ? meshesResult.indices.length / 3 : 0; } } function parseFaces(ctx, node, result) { const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "Face": parseFace(ctx, child, result); break; } } } function parseFace(ctx, node, result) { const strips = node.strips; if (strips) { const arrays = parseIntArrays(strips); if (arrays.length > 0) { result.primitive = "triangles"; const indices = []; for (let i = 0, len = arrays.length; i < len; i++) { const array = convertTriangleStrip(arrays[i]); for (let j = 0, lenj = array.length; j < lenj; j++) { indices.push(array[j]); } } result.indices = indices; // TODO } } else { const triangles = node.triangles; if (triangles) { result.primitive = "triangles"; result.indices = parseIntArray(triangles); } } const children = node.children; // Material for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "SurfaceAttributes": parseSurfaceAttributes(ctx, child, result); break; } } } function convertTriangleStrip(indices) { const indices2 = []; for (let i = 0, len = indices.length; i < len - 2; i++) { { if (i & 1) { // indices2.push(indices[i]); indices2.push(indices[i + 2]); indices2.push(indices[i + 1]); } else { indices2.push(indices[i]); indices2.push(indices[i + 1]); indices2.push(indices[i + 2]); } } } return indices2; } function parseVertexBuffer(ctx, node, result) { const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "Positions": result.positions = parseFloatArray(child.children[0], 3); break; case "Normals": if (!ctx.autoNormals) { result.normals = parseFloatArray(child.children[0], 3); } break; case "TextureCoordinates": // TODO: Support dimension and channel? result.uv = parseFloatArray(child.children[0], 2); break; } } } function parseIntArrays(str) { const coordStrings = str.split(","); const array = []; for (let i = 0, len = coordStrings.length; i < len; i++) { const coordStr = coordStrings[i].trim(); if (coordStr.length > 0) { const elemStrings = coordStr.trim().split(" "); const arr = new Int16Array(elemStrings.length); let arrIdx = 0; for (let j = 0, lenj = elemStrings.length; j < lenj; j++) { if (elemStrings[j] !== "") { arr[arrIdx++] = parseInt(elemStrings[j]); } } array.push(arr); } } return array; } function parseFloatArray(str, numElems) { str = str.split(","); const arr = new Float64Array(str.length * numElems); let arrIdx = 0; for (let i = 0, len = str.length; i < len; i++) { const value = str[i].split(" "); for (let j = 0, lenj = value.length; j < lenj; j++) { if (value[j] !== "") { arr[arrIdx++] = parseFloat(value[j]); } } } return arr; } function parseIntArray(str) { str = str.trim().split(" "); const arr = new Int32Array(str.length); let arrIdx = 0; for (let i = 0, len = str.length; i < len; i++) { const value = str[i]; arr[arrIdx++] = parseInt(value); } return arr; } function parseSurfaceAttributes(ctx, node, result) { result.color = [1, 1, 1, 1]; const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "Color": result.color[0] = child.red; result.color[1] = child.green; result.color[2] = child.blue; result.color[3] = child.alpha; break; case "MaterialApplication": const children2 = child.children; for (let j = 0, lenj = children2.length; j < lenj; j++) { const child2 = children2[j]; switch (child2.type) { case "MaterialId": const materialId = getIDFromURI(child2.id); const material = ctx.materials[materialId]; if (!material) { ctx.error("material not found: " + materialId); } result.materialId = materialId; break; } } break; } } } async function loadCATMaterialRefDocuments(ctx, materialIds) { const loaded = {}; async function load(i) { if (i >= materialIds.length) { return; } const materialId = materialIds[i]; const colonIdx = src.lastIndexOf(":"); let src = materialId.id; if (colonIdx > 0) { src = src.substring(colonIdx + 1); } const hashIdx = src.lastIndexOf("#"); if (hashIdx > 0) { src = src.substring(0, hashIdx); } if (!loaded[src]) { await loadCATMaterialRefDocument(ctx, src); loaded[src] = true; await load(i + 1); } else { await load(i + 1); } } await load(0); } async function loadCATMaterialRefDocument(ctx, src) { // Loads CATMaterialRef.3dxml const fileData = await ctx.zipArchive.getFile(src); await parseCATMaterialRefDocument(ctx, fileData.json); } async function parseCATMaterialRefDocument(ctx, node) { // Parse CATMaterialRef.3dxml const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; if (child.type === "Model_3dxml") { await parseModel_3dxml(ctx, child); } } } async function parseModel_3dxml(ctx, node) { // Parse CATMaterialRef.3dxml const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; if (child.type === "CATMaterialRef") { await parseCATMaterialRef(ctx, child); } } } async function parseCATMaterialRef(ctx, node) { const domainToReferenceMap = {}; const children = node.children; for (let j = 0, lenj = children.length; j < lenj; j++) { const child2 = children[j]; switch (child2.type) { case "MaterialDomainInstance": let isAggregatedBy; let isInstanceOf; for (let k = 0, lenk = child2.children.length; k < lenk; k++) { const child3 = child2.children[k]; switch (child3.type) { case "IsAggregatedBy": isAggregatedBy = child3.children[0]; break; case "IsInstanceOf": isInstanceOf = child3.children[0]; break; } } domainToReferenceMap[isInstanceOf] = isAggregatedBy; break; } } for (let j = 0, lenj = children.length; j < lenj; j++) { const child2 = children[j]; switch (child2.type) { case "MaterialDomain": if (child2.associatedFile) { const childId = child2.id; const src = stripURN(child2.associatedFile); const fileData = await ctx.zipArchive.getFile(src); ctx.materials[domainToReferenceMap[childId]] = parseMaterialDefDocument(ctx, fileData.json); } } } } function parseMaterialDefDocument(ctx, node) { const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "Osm": return parseMaterialDefDocumentOsm(ctx, child); } } return {}; } function parseMaterialDefDocumentOsm(ctx, node) { const materialCfg = {}; const children = node.children; for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; switch (child.type) { case "RenderingRootFeature": break; case "Feature": if (child.Alias === "RenderingFeature") { // Parse the coefficients, then parse the colors, scaling those by their coefficients. const coeffs = {}; const children2 = child.children; for (let j = 0, lenj = children2.length; j < lenj; j++) { const child2 = children2[j]; switch (child2.Name) { case "AmbientCoef": coeffs.ambient = parseFloat(child2.Value); break; case "DiffuseCoef": coeffs.diffuse = parseFloat(child2.Value); break; case "EmissiveCoef": coeffs.emissive = parseFloat(child2.Value); break; case "SpecularExponent": coeffs.specular = parseFloat(child2.Value); break; } } for (let j = 0, lenj = children2.length; j < lenj; j++) { const child2 = children2[j]; switch (child2.Name) { case "AmbientColor": materialCfg.ambient = parseRGB(child2.Value, coeffs.ambient); break; case "DiffuseColor": materialCfg.diffuse = parseRGB(child2.Value, coeffs.diffuse); break; case "EmissiveColor": materialCfg.emissive = parseRGB(child2.Value, coeffs.emissive); break; case "SpecularColor": materialCfg.specular = parseRGB(child2.Value, coeffs.specular); break; case "Transparency": const alpha = 1.0 - parseFloat(child2.Value); // Degree of transparency, not degree of opacity if (alpha < 1.0) { materialCfg.alpha = alpha; materialCfg.alphaMode = "blend"; } break; } } } break; } } return materialCfg; } function parseRGB(str, coeff) { coeff = (coeff !== undefined) ? coeff : 0.5; const openBracketIndex = str.indexOf("["); const closeBracketIndex = str.indexOf("]"); str = str.substring(openBracketIndex + 1, closeBracketIndex - openBracketIndex); str = str.split(","); const arr = new Float32Array(str.length); let arrIdx = 0; for (let i = 0, len = str.length; i < len; i++) { const value = str[i].trim().split(" "); for (let j = 0, lenj = value.length; j < lenj; j++) { if (value[j] !== "") { arr[arrIdx++] = parseFloat(value[j]) * coeff; } } } return arr; } function stripURN(str) { const subStr = "urn:3DXML:"; return (str.indexOf(subStr) === 0) ? str.substring(subStr.length) : str; } function getIDFromURI(str) { const hashIdx = str.lastIndexOf("#"); return hashIdx !== -1 ? str.substring(hashIdx + 1) : str; } function createCommonjsModule$1(fn, basedir, module) { return module = { path: basedir, exports: {}, require: function (path, base) { return commonjsRequire$1(path, (base === undefined || base === null) ? module.path : base); } }, fn(module, module.exports), module.exports; } function commonjsRequire$1 () { throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs'); } var pako = createCommonjsModule$1(function (module, exports) { /* pako 1.0.10 nodeca/pako */(function(f){{module.exports=f();}})(function(){return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof commonjsRequire$1&&commonjsRequire$1;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t);}return n[i].exports}for(var u="function"==typeof commonjsRequire$1&&commonjsRequire$1,i=0;i Array * * Chunks of output data, if [[Deflate#onData]] not overridden. **/ /** * Deflate.result -> Uint8Array|Array * * Compressed result, generated by default [[Deflate#onData]] * and [[Deflate#onEnd]] handlers. Filled after you push last chunk * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you * push a chunk with explicit flush (call [[Deflate#push]] with * `Z_SYNC_FLUSH` param). **/ /** * Deflate.err -> Number * * Error code after deflate finished. 0 (Z_OK) on success. * You will not need it in real life, because deflate errors * are possible only on wrong options or bad `onData` / `onEnd` * custom handlers. **/ /** * Deflate.msg -> String * * Error message, if [[Deflate.err]] != 0 **/ /** * new Deflate(options) * - options (Object): zlib deflate options. * * Creates new deflator instance with specified params. Throws exception * on bad params. Supported options: * * - `level` * - `windowBits` * - `memLevel` * - `strategy` * - `dictionary` * * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) * for more information on these. * * Additional options, for internal needs: * * - `chunkSize` - size of generated data chunks (16K by default) * - `raw` (Boolean) - do raw deflate * - `gzip` (Boolean) - create gzip wrapper * - `to` (String) - if equal to 'string', then result will be "binary string" * (each char code [0..255]) * - `header` (Object) - custom header for gzip * - `text` (Boolean) - true if compressed data believed to be text * - `time` (Number) - modification time, unix timestamp * - `os` (Number) - operation system code * - `extra` (Array) - array of bytes with extra data (max 65536) * - `name` (String) - file name (binary string) * - `comment` (String) - comment (binary string) * - `hcrc` (Boolean) - true if header crc should be added * * ##### Example: * * ```javascript * var pako = require('pako') * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); * * var deflate = new pako.Deflate({ level: 3}); * * deflate.push(chunk1, false); * deflate.push(chunk2, true); // true -> last chunk * * if (deflate.err) { throw new Error(deflate.err); } * * console.log(deflate.result); * ``` **/ function Deflate(options) { if (!(this instanceof Deflate)) return new Deflate(options); this.options = utils.assign({ level: Z_DEFAULT_COMPRESSION, method: Z_DEFLATED, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: Z_DEFAULT_STRATEGY, to: '' }, options || {}); var opt = this.options; if (opt.raw && (opt.windowBits > 0)) { opt.windowBits = -opt.windowBits; } else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) { opt.windowBits += 16; } this.err = 0; // error code, if happens (0 = Z_OK) this.msg = ''; // error message this.ended = false; // used to avoid multiple onEnd() calls this.chunks = []; // chunks of compressed data this.strm = new ZStream(); this.strm.avail_out = 0; var status = zlib_deflate.deflateInit2( this.strm, opt.level, opt.method, opt.windowBits, opt.memLevel, opt.strategy ); if (status !== Z_OK) { throw new Error(msg[status]); } if (opt.header) { zlib_deflate.deflateSetHeader(this.strm, opt.header); } if (opt.dictionary) { var dict; // Convert data if needed if (typeof opt.dictionary === 'string') { // If we need to compress text, change encoding to utf8. dict = strings.string2buf(opt.dictionary); } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { dict = new Uint8Array(opt.dictionary); } else { dict = opt.dictionary; } status = zlib_deflate.deflateSetDictionary(this.strm, dict); if (status !== Z_OK) { throw new Error(msg[status]); } this._dict_set = true; } } /** * Deflate#push(data[, mode]) -> Boolean * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be * converted to utf8 byte sequence. * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. * * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with * new compressed chunks. Returns `true` on success. The last data block must have * mode Z_FINISH (or `true`). That will flush internal pending buffers and call * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you * can use mode Z_SYNC_FLUSH, keeping the compression context. * * On fail call [[Deflate#onEnd]] with error code and return false. * * We strongly recommend to use `Uint8Array` on input for best speed (output * array format is detected automatically). Also, don't skip last param and always * use the same type in your code (boolean or number). That will improve JS speed. * * For regular `Array`-s make sure all elements are [0..255]. * * ##### Example * * ```javascript * push(chunk, false); // push one of data chunks * ... * push(chunk, true); // push last chunk * ``` **/ Deflate.prototype.push = function (data, mode) { var strm = this.strm; var chunkSize = this.options.chunkSize; var status, _mode; if (this.ended) { return false; } _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH); // Convert data if needed if (typeof data === 'string') { // If we need to compress text, change encoding to utf8. strm.input = strings.string2buf(data); } else if (toString.call(data) === '[object ArrayBuffer]') { strm.input = new Uint8Array(data); } else { strm.input = data; } strm.next_in = 0; strm.avail_in = strm.input.length; do { if (strm.avail_out === 0) { strm.output = new utils.Buf8(chunkSize); strm.next_out = 0; strm.avail_out = chunkSize; } status = zlib_deflate.deflate(strm, _mode); /* no bad return value */ if (status !== Z_STREAM_END && status !== Z_OK) { this.onEnd(status); this.ended = true; return false; } if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) { if (this.options.to === 'string') { this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); } else { this.onData(utils.shrinkBuf(strm.output, strm.next_out)); } } } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END); // Finalize on the last chunk. if (_mode === Z_FINISH) { status = zlib_deflate.deflateEnd(this.strm); this.onEnd(status); this.ended = true; return status === Z_OK; } // callback interim results if Z_SYNC_FLUSH. if (_mode === Z_SYNC_FLUSH) { this.onEnd(Z_OK); strm.avail_out = 0; return true; } return true; }; /** * Deflate#onData(chunk) -> Void * - chunk (Uint8Array|Array|String): output data. Type of array depends * on js engine support. When string output requested, each chunk * will be string. * * By default, stores data blocks in `chunks[]` property and glue * those in `onEnd`. Override this handler, if you need another behaviour. **/ Deflate.prototype.onData = function (chunk) { this.chunks.push(chunk); }; /** * Deflate#onEnd(status) -> Void * - status (Number): deflate status. 0 (Z_OK) on success, * other if not. * * Called once after you tell deflate that the input stream is * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) * or if an error happened. By default - join collected chunks, * free memory and fill `results` / `err` properties. **/ Deflate.prototype.onEnd = function (status) { // On success - join if (status === Z_OK) { if (this.options.to === 'string') { this.result = this.chunks.join(''); } else { this.result = utils.flattenChunks(this.chunks); } } this.chunks = []; this.err = status; this.msg = this.strm.msg; }; /** * deflate(data[, options]) -> Uint8Array|Array|String * - data (Uint8Array|Array|String): input data to compress. * - options (Object): zlib deflate options. * * Compress `data` with deflate algorithm and `options`. * * Supported options are: * * - level * - windowBits * - memLevel * - strategy * - dictionary * * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) * for more information on these. * * Sugar (options): * * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify * negative windowBits implicitly. * - `to` (String) - if equal to 'string', then result will be "binary string" * (each char code [0..255]) * * ##### Example: * * ```javascript * var pako = require('pako') * , data = Uint8Array([1,2,3,4,5,6,7,8,9]); * * console.log(pako.deflate(data)); * ``` **/ function deflate(input, options) { var deflator = new Deflate(options); deflator.push(input, true); // That will never happens, if you don't cheat with options :) if (deflator.err) { throw deflator.msg || msg[deflator.err]; } return deflator.result; } /** * deflateRaw(data[, options]) -> Uint8Array|Array|String * - data (Uint8Array|Array|String): input data to compress. * - options (Object): zlib deflate options. * * The same as [[deflate]], but creates raw data, without wrapper * (header and adler32 crc). **/ function deflateRaw(input, options) { options = options || {}; options.raw = true; return deflate(input, options); } /** * gzip(data[, options]) -> Uint8Array|Array|String * - data (Uint8Array|Array|String): input data to compress. * - options (Object): zlib deflate options. * * The same as [[deflate]], but create gzip wrapper instead of * deflate one. **/ function gzip(input, options) { options = options || {}; options.gzip = true; return deflate(input, options); } exports.Deflate = Deflate; exports.deflate = deflate; exports.deflateRaw = deflateRaw; exports.gzip = gzip; },{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(require,module,exports){ var zlib_inflate = require('./zlib/inflate'); var utils = require('./utils/common'); var strings = require('./utils/strings'); var c = require('./zlib/constants'); var msg = require('./zlib/messages'); var ZStream = require('./zlib/zstream'); var GZheader = require('./zlib/gzheader'); var toString = Object.prototype.toString; /** * class Inflate * * Generic JS-style wrapper for zlib calls. If you don't need * streaming behaviour - use more simple functions: [[inflate]] * and [[inflateRaw]]. **/ /* internal * inflate.chunks -> Array * * Chunks of output data, if [[Inflate#onData]] not overridden. **/ /** * Inflate.result -> Uint8Array|Array|String * * Uncompressed result, generated by default [[Inflate#onData]] * and [[Inflate#onEnd]] handlers. Filled after you push last chunk * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you * push a chunk with explicit flush (call [[Inflate#push]] with * `Z_SYNC_FLUSH` param). **/ /** * Inflate.err -> Number * * Error code after inflate finished. 0 (Z_OK) on success. * Should be checked if broken data possible. **/ /** * Inflate.msg -> String * * Error message, if [[Inflate.err]] != 0 **/ /** * new Inflate(options) * - options (Object): zlib inflate options. * * Creates new inflator instance with specified params. Throws exception * on bad params. Supported options: * * - `windowBits` * - `dictionary` * * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) * for more information on these. * * Additional options, for internal needs: * * - `chunkSize` - size of generated data chunks (16K by default) * - `raw` (Boolean) - do raw inflate * - `to` (String) - if equal to 'string', then result will be converted * from utf8 to utf16 (javascript) string. When string output requested, * chunk length can differ from `chunkSize`, depending on content. * * By default, when no options set, autodetect deflate/gzip data format via * wrapper header. * * ##### Example: * * ```javascript * var pako = require('pako') * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); * * var inflate = new pako.Inflate({ level: 3}); * * inflate.push(chunk1, false); * inflate.push(chunk2, true); // true -> last chunk * * if (inflate.err) { throw new Error(inflate.err); } * * console.log(inflate.result); * ``` **/ function Inflate(options) { if (!(this instanceof Inflate)) return new Inflate(options); this.options = utils.assign({ chunkSize: 16384, windowBits: 0, to: '' }, options || {}); var opt = this.options; // Force window size for `raw` data, if not set directly, // because we have no header for autodetect. if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) { opt.windowBits = -opt.windowBits; if (opt.windowBits === 0) { opt.windowBits = -15; } } // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate if ((opt.windowBits >= 0) && (opt.windowBits < 16) && !(options && options.windowBits)) { opt.windowBits += 32; } // Gzip header has no info about windows size, we can do autodetect only // for deflate. So, if window size not set, force it to max when gzip possible if ((opt.windowBits > 15) && (opt.windowBits < 48)) { // bit 3 (16) -> gzipped data // bit 4 (32) -> autodetect gzip/deflate if ((opt.windowBits & 15) === 0) { opt.windowBits |= 15; } } this.err = 0; // error code, if happens (0 = Z_OK) this.msg = ''; // error message this.ended = false; // used to avoid multiple onEnd() calls this.chunks = []; // chunks of compressed data this.strm = new ZStream(); this.strm.avail_out = 0; var status = zlib_inflate.inflateInit2( this.strm, opt.windowBits ); if (status !== c.Z_OK) { throw new Error(msg[status]); } this.header = new GZheader(); zlib_inflate.inflateGetHeader(this.strm, this.header); // Setup dictionary if (opt.dictionary) { // Convert data if needed if (typeof opt.dictionary === 'string') { opt.dictionary = strings.string2buf(opt.dictionary); } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { opt.dictionary = new Uint8Array(opt.dictionary); } if (opt.raw) { //In raw mode we need to set the dictionary early status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary); if (status !== c.Z_OK) { throw new Error(msg[status]); } } } } /** * Inflate#push(data[, mode]) -> Boolean * - data (Uint8Array|Array|ArrayBuffer|String): input data * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. * * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with * new output chunks. Returns `true` on success. The last data block must have * mode Z_FINISH (or `true`). That will flush internal pending buffers and call * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you * can use mode Z_SYNC_FLUSH, keeping the decompression context. * * On fail call [[Inflate#onEnd]] with error code and return false. * * We strongly recommend to use `Uint8Array` on input for best speed (output * format is detected automatically). Also, don't skip last param and always * use the same type in your code (boolean or number). That will improve JS speed. * * For regular `Array`-s make sure all elements are [0..255]. * * ##### Example * * ```javascript * push(chunk, false); // push one of data chunks * ... * push(chunk, true); // push last chunk * ``` **/ Inflate.prototype.push = function (data, mode) { var strm = this.strm; var chunkSize = this.options.chunkSize; var dictionary = this.options.dictionary; var status, _mode; var next_out_utf8, tail, utf8str; // Flag to properly process Z_BUF_ERROR on testing inflate call // when we check that all output data was flushed. var allowBufError = false; if (this.ended) { return false; } _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH); // Convert data if needed if (typeof data === 'string') { // Only binary strings can be decompressed on practice strm.input = strings.binstring2buf(data); } else if (toString.call(data) === '[object ArrayBuffer]') { strm.input = new Uint8Array(data); } else { strm.input = data; } strm.next_in = 0; strm.avail_in = strm.input.length; do { if (strm.avail_out === 0) { strm.output = new utils.Buf8(chunkSize); strm.next_out = 0; strm.avail_out = chunkSize; } status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */ if (status === c.Z_NEED_DICT && dictionary) { status = zlib_inflate.inflateSetDictionary(this.strm, dictionary); } if (status === c.Z_BUF_ERROR && allowBufError === true) { status = c.Z_OK; allowBufError = false; } if (status !== c.Z_STREAM_END && status !== c.Z_OK) { this.onEnd(status); this.ended = true; return false; } if (strm.next_out) { if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) { if (this.options.to === 'string') { next_out_utf8 = strings.utf8border(strm.output, strm.next_out); tail = strm.next_out - next_out_utf8; utf8str = strings.buf2string(strm.output, next_out_utf8); // move tail strm.next_out = tail; strm.avail_out = chunkSize - tail; if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); } this.onData(utf8str); } else { this.onData(utils.shrinkBuf(strm.output, strm.next_out)); } } } // When no more input data, we should check that internal inflate buffers // are flushed. The only way to do it when avail_out = 0 - run one more // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR. // Here we set flag to process this error properly. // // NOTE. Deflate does not return error in this case and does not needs such // logic. if (strm.avail_in === 0 && strm.avail_out === 0) { allowBufError = true; } } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END); if (status === c.Z_STREAM_END) { _mode = c.Z_FINISH; } // Finalize on the last chunk. if (_mode === c.Z_FINISH) { status = zlib_inflate.inflateEnd(this.strm); this.onEnd(status); this.ended = true; return status === c.Z_OK; } // callback interim results if Z_SYNC_FLUSH. if (_mode === c.Z_SYNC_FLUSH) { this.onEnd(c.Z_OK); strm.avail_out = 0; return true; } return true; }; /** * Inflate#onData(chunk) -> Void * - chunk (Uint8Array|Array|String): output data. Type of array depends * on js engine support. When string output requested, each chunk * will be string. * * By default, stores data blocks in `chunks[]` property and glue * those in `onEnd`. Override this handler, if you need another behaviour. **/ Inflate.prototype.onData = function (chunk) { this.chunks.push(chunk); }; /** * Inflate#onEnd(status) -> Void * - status (Number): inflate status. 0 (Z_OK) on success, * other if not. * * Called either after you tell inflate that the input stream is * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) * or if an error happened. By default - join collected chunks, * free memory and fill `results` / `err` properties. **/ Inflate.prototype.onEnd = function (status) { // On success - join if (status === c.Z_OK) { if (this.options.to === 'string') { // Glue & convert here, until we teach pako to send // utf8 aligned strings to onData this.result = this.chunks.join(''); } else { this.result = utils.flattenChunks(this.chunks); } } this.chunks = []; this.err = status; this.msg = this.strm.msg; }; /** * inflate(data[, options]) -> Uint8Array|Array|String * - data (Uint8Array|Array|String): input data to decompress. * - options (Object): zlib inflate options. * * Decompress `data` with inflate/ungzip and `options`. Autodetect * format via wrapper header by default. That's why we don't provide * separate `ungzip` method. * * Supported options are: * * - windowBits * * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) * for more information. * * Sugar (options): * * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify * negative windowBits implicitly. * - `to` (String) - if equal to 'string', then result will be converted * from utf8 to utf16 (javascript) string. When string output requested, * chunk length can differ from `chunkSize`, depending on content. * * * ##### Example: * * ```javascript * var pako = require('pako') * , input = pako.deflate([1,2,3,4,5,6,7,8,9]) * , output; * * try { * output = pako.inflate(input); * } catch (err) * console.log(err); * } * ``` **/ function inflate(input, options) { var inflator = new Inflate(options); inflator.push(input, true); // That will never happens, if you don't cheat with options :) if (inflator.err) { throw inflator.msg || msg[inflator.err]; } return inflator.result; } /** * inflateRaw(data[, options]) -> Uint8Array|Array|String * - data (Uint8Array|Array|String): input data to decompress. * - options (Object): zlib inflate options. * * The same as [[inflate]], but creates raw data, without wrapper * (header and adler32 crc). **/ function inflateRaw(input, options) { options = options || {}; options.raw = true; return inflate(input, options); } /** * ungzip(data[, options]) -> Uint8Array|Array|String * - data (Uint8Array|Array|String): input data to decompress. * - options (Object): zlib inflate options. * * Just shortcut to [[inflate]], because it autodetects format * by header.content. Done for convenience. **/ exports.Inflate = Inflate; exports.inflate = inflate; exports.inflateRaw = inflateRaw; exports.ungzip = inflate; },{"./utils/common":3,"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(require,module,exports){ var TYPED_OK = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Int32Array !== 'undefined'); function _has(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key); } exports.assign = function (obj /*from1, from2, from3, ...*/) { var sources = Array.prototype.slice.call(arguments, 1); while (sources.length) { var source = sources.shift(); if (!source) { continue; } if (typeof source !== 'object') { throw new TypeError(source + 'must be non-object'); } for (var p in source) { if (_has(source, p)) { obj[p] = source[p]; } } } return obj; }; // reduce buffer size, avoiding mem copy exports.shrinkBuf = function (buf, size) { if (buf.length === size) { return buf; } if (buf.subarray) { return buf.subarray(0, size); } buf.length = size; return buf; }; var fnTyped = { arraySet: function (dest, src, src_offs, len, dest_offs) { if (src.subarray && dest.subarray) { dest.set(src.subarray(src_offs, src_offs + len), dest_offs); return; } // Fallback to ordinary array for (var i = 0; i < len; i++) { dest[dest_offs + i] = src[src_offs + i]; } }, // Join array of chunks to single array. flattenChunks: function (chunks) { var i, l, len, pos, chunk, result; // calculate data length len = 0; for (i = 0, l = chunks.length; i < l; i++) { len += chunks[i].length; } // join chunks result = new Uint8Array(len); pos = 0; for (i = 0, l = chunks.length; i < l; i++) { chunk = chunks[i]; result.set(chunk, pos); pos += chunk.length; } return result; } }; var fnUntyped = { arraySet: function (dest, src, src_offs, len, dest_offs) { for (var i = 0; i < len; i++) { dest[dest_offs + i] = src[src_offs + i]; } }, // Join array of chunks to single array. flattenChunks: function (chunks) { return [].concat.apply([], chunks); } }; // Enable/Disable typed arrays use, for testing // exports.setTyped = function (on) { if (on) { exports.Buf8 = Uint8Array; exports.Buf16 = Uint16Array; exports.Buf32 = Int32Array; exports.assign(exports, fnTyped); } else { exports.Buf8 = Array; exports.Buf16 = Array; exports.Buf32 = Array; exports.assign(exports, fnUntyped); } }; exports.setTyped(TYPED_OK); },{}],4:[function(require,module,exports){ var utils = require('./common'); // Quick check if we can use fast array to bin string conversion // // - apply(Array) can fail on Android 2.2 // - apply(Uint8Array) can fail on iOS 5.1 Safari // var STR_APPLY_OK = true; var STR_APPLY_UIA_OK = true; try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; } try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; } // Table with utf8 lengths (calculated by first byte of sequence) // Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS, // because max possible codepoint is 0x10ffff var _utf8len = new utils.Buf8(256); for (var q = 0; q < 256; q++) { _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); } _utf8len[254] = _utf8len[254] = 1; // Invalid sequence start // convert string to array (typed, when possible) exports.string2buf = function (str) { var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; // count binary size for (m_pos = 0; m_pos < str_len; m_pos++) { c = str.charCodeAt(m_pos); if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { c2 = str.charCodeAt(m_pos + 1); if ((c2 & 0xfc00) === 0xdc00) { c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); m_pos++; } } buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; } // allocate buffer buf = new utils.Buf8(buf_len); // convert for (i = 0, m_pos = 0; i < buf_len; m_pos++) { c = str.charCodeAt(m_pos); if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { c2 = str.charCodeAt(m_pos + 1); if ((c2 & 0xfc00) === 0xdc00) { c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); m_pos++; } } if (c < 0x80) { /* one byte */ buf[i++] = c; } else if (c < 0x800) { /* two bytes */ buf[i++] = 0xC0 | (c >>> 6); buf[i++] = 0x80 | (c & 0x3f); } else if (c < 0x10000) { /* three bytes */ buf[i++] = 0xE0 | (c >>> 12); buf[i++] = 0x80 | (c >>> 6 & 0x3f); buf[i++] = 0x80 | (c & 0x3f); } else { /* four bytes */ buf[i++] = 0xf0 | (c >>> 18); buf[i++] = 0x80 | (c >>> 12 & 0x3f); buf[i++] = 0x80 | (c >>> 6 & 0x3f); buf[i++] = 0x80 | (c & 0x3f); } } return buf; }; // Helper (used in 2 places) function buf2binstring(buf, len) { // On Chrome, the arguments in a function call that are allowed is `65534`. // If the length of the buffer is smaller than that, we can use this optimization, // otherwise we will take a slower path. if (len < 65534) { if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); } } var result = ''; for (var i = 0; i < len; i++) { result += String.fromCharCode(buf[i]); } return result; } // Convert byte array to binary string exports.buf2binstring = function (buf) { return buf2binstring(buf, buf.length); }; // Convert binary string (typed, when possible) exports.binstring2buf = function (str) { var buf = new utils.Buf8(str.length); for (var i = 0, len = buf.length; i < len; i++) { buf[i] = str.charCodeAt(i); } return buf; }; // convert array to string exports.buf2string = function (buf, max) { var i, out, c, c_len; var len = max || buf.length; // Reserve max possible length (2 words per char) // NB: by unknown reasons, Array is significantly faster for // String.fromCharCode.apply than Uint16Array. var utf16buf = new Array(len * 2); for (out = 0, i = 0; i < len;) { c = buf[i++]; // quick process ascii if (c < 0x80) { utf16buf[out++] = c; continue; } c_len = _utf8len[c]; // skip 5 & 6 byte codes if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } // apply mask on first byte c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; // join the rest while (c_len > 1 && i < len) { c = (c << 6) | (buf[i++] & 0x3f); c_len--; } // terminated by end of string? if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } if (c < 0x10000) { utf16buf[out++] = c; } else { c -= 0x10000; utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); utf16buf[out++] = 0xdc00 | (c & 0x3ff); } } return buf2binstring(utf16buf, out); }; // Calculate max possible position in utf8 buffer, // that will not break sequence. If that's not possible // - (very small limits) return max size as is. // // buf[] - utf8 bytes array // max - length limit (mandatory); exports.utf8border = function (buf, max) { var pos; max = max || buf.length; if (max > buf.length) { max = buf.length; } // go back from last position, until start of sequence found pos = max - 1; while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } // Very small and broken sequence, // return max, because we should return something anyway. if (pos < 0) { return max; } // If we came to start of buffer - that means buffer is too small, // return max too. if (pos === 0) { return max; } return (pos + _utf8len[buf[pos]] > max) ? pos : max; }; },{"./common":3}],5:[function(require,module,exports){ // Note: adler32 takes 12% for level 0 and 2% for level 6. // It isn't worth it to make additional optimizations as in original. // Small size is preferable. // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. function adler32(adler, buf, len, pos) { var s1 = (adler & 0xffff) |0, s2 = ((adler >>> 16) & 0xffff) |0, n = 0; while (len !== 0) { // Set limit ~ twice less than 5552, to keep // s2 in 31-bits, because we force signed ints. // in other case %= will fail. n = len > 2000 ? 2000 : len; len -= n; do { s1 = (s1 + buf[pos++]) |0; s2 = (s2 + s1) |0; } while (--n); s1 %= 65521; s2 %= 65521; } return (s1 | (s2 << 16)) |0; } module.exports = adler32; },{}],6:[function(require,module,exports){ // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. module.exports = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, //Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, //Z_VERSION_ERROR: -6, /* compression levels */ Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, /* Possible values of the data_type field (though see inflate()) */ Z_BINARY: 0, Z_TEXT: 1, //Z_ASCII: 1, // = Z_TEXT (deprecated) Z_UNKNOWN: 2, /* The deflate compression method */ Z_DEFLATED: 8 //Z_NULL: null // Use -1 or null inline, depending on var type }; },{}],7:[function(require,module,exports){ // Note: we can't get significant speed boost here. // So write code to minimize size - no pregenerated tables // and array tools dependencies. // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. // Use ordinary array, since untyped makes no boost here function makeTable() { var c, table = []; for (var n = 0; n < 256; n++) { c = n; for (var k = 0; k < 8; k++) { c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); } table[n] = c; } return table; } // Create table on load. Just 255 signed longs. Not a problem. var crcTable = makeTable(); function crc32(crc, buf, len, pos) { var t = crcTable, end = pos + len; crc ^= -1; for (var i = pos; i < end; i++) { crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; } return (crc ^ (-1)); // >>> 0; } module.exports = crc32; },{}],8:[function(require,module,exports){ // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. var utils = require('../utils/common'); var trees = require('./trees'); var adler32 = require('./adler32'); var crc32 = require('./crc32'); var msg = require('./messages'); /* Public constants ==========================================================*/ /* ===========================================================================*/ /* Allowed flush values; see deflate() and inflate() below for details */ var Z_NO_FLUSH = 0; var Z_PARTIAL_FLUSH = 1; //var Z_SYNC_FLUSH = 2; var Z_FULL_FLUSH = 3; var Z_FINISH = 4; var Z_BLOCK = 5; //var Z_TREES = 6; /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ var Z_OK = 0; var Z_STREAM_END = 1; //var Z_NEED_DICT = 2; //var Z_ERRNO = -1; var Z_STREAM_ERROR = -2; var Z_DATA_ERROR = -3; //var Z_MEM_ERROR = -4; var Z_BUF_ERROR = -5; //var Z_VERSION_ERROR = -6; /* compression levels */ //var Z_NO_COMPRESSION = 0; //var Z_BEST_SPEED = 1; //var Z_BEST_COMPRESSION = 9; var Z_DEFAULT_COMPRESSION = -1; var Z_FILTERED = 1; var Z_HUFFMAN_ONLY = 2; var Z_RLE = 3; var Z_FIXED = 4; var Z_DEFAULT_STRATEGY = 0; /* Possible values of the data_type field (though see inflate()) */ //var Z_BINARY = 0; //var Z_TEXT = 1; //var Z_ASCII = 1; // = Z_TEXT var Z_UNKNOWN = 2; /* The deflate compression method */ var Z_DEFLATED = 8; /*============================================================================*/ var MAX_MEM_LEVEL = 9; /* Maximum value for memLevel in deflateInit2 */ var MAX_WBITS = 15; /* 32K LZ77 window */ var DEF_MEM_LEVEL = 8; var LENGTH_CODES = 29; /* number of length codes, not counting the special END_BLOCK code */ var LITERALS = 256; /* number of literal bytes 0..255 */ var L_CODES = LITERALS + 1 + LENGTH_CODES; /* number of Literal or Length codes, including the END_BLOCK code */ var D_CODES = 30; /* number of distance codes */ var BL_CODES = 19; /* number of codes used to transfer the bit lengths */ var HEAP_SIZE = 2 * L_CODES + 1; /* maximum heap size */ var MAX_BITS = 15; /* All codes must not exceed MAX_BITS bits */ var MIN_MATCH = 3; var MAX_MATCH = 258; var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); var PRESET_DICT = 0x20; var INIT_STATE = 42; var EXTRA_STATE = 69; var NAME_STATE = 73; var COMMENT_STATE = 91; var HCRC_STATE = 103; var BUSY_STATE = 113; var FINISH_STATE = 666; var BS_NEED_MORE = 1; /* block not completed, need more input or more output */ var BS_BLOCK_DONE = 2; /* block flush performed */ var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */ var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */ var OS_CODE = 0x03; // Unix :) . Don't detect, use this default. function err(strm, errorCode) { strm.msg = msg[errorCode]; return errorCode; } function rank(f) { return ((f) << 1) - ((f) > 4 ? 9 : 0); } function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } /* ========================================================================= * Flush as much pending output as possible. All deflate() output goes * through this function so some applications may wish to modify it * to avoid allocating a large strm->output buffer and copying into it. * (See also read_buf()). */ function flush_pending(strm) { var s = strm.state; //_tr_flush_bits(s); var len = s.pending; if (len > strm.avail_out) { len = strm.avail_out; } if (len === 0) { return; } utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); strm.next_out += len; s.pending_out += len; strm.total_out += len; strm.avail_out -= len; s.pending -= len; if (s.pending === 0) { s.pending_out = 0; } } function flush_block_only(s, last) { trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); s.block_start = s.strstart; flush_pending(s.strm); } function put_byte(s, b) { s.pending_buf[s.pending++] = b; } /* ========================================================================= * Put a short in the pending buffer. The 16-bit value is put in MSB order. * IN assertion: the stream state is correct and there is enough room in * pending_buf. */ function putShortMSB(s, b) { // put_byte(s, (Byte)(b >> 8)); // put_byte(s, (Byte)(b & 0xff)); s.pending_buf[s.pending++] = (b >>> 8) & 0xff; s.pending_buf[s.pending++] = b & 0xff; } /* =========================================================================== * Read a new buffer from the current input stream, update the adler32 * and total number of bytes read. All deflate() input goes through * this function so some applications may wish to modify it to avoid * allocating a large strm->input buffer and copying from it. * (See also flush_pending()). */ function read_buf(strm, buf, start, size) { var len = strm.avail_in; if (len > size) { len = size; } if (len === 0) { return 0; } strm.avail_in -= len; // zmemcpy(buf, strm->next_in, len); utils.arraySet(buf, strm.input, strm.next_in, len, start); if (strm.state.wrap === 1) { strm.adler = adler32(strm.adler, buf, len, start); } else if (strm.state.wrap === 2) { strm.adler = crc32(strm.adler, buf, len, start); } strm.next_in += len; strm.total_in += len; return len; } /* =========================================================================== * Set match_start to the longest match starting at the given string and * return its length. Matches shorter or equal to prev_length are discarded, * in which case the result is equal to prev_length and match_start is * garbage. * IN assertions: cur_match is the head of the hash chain for the current * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 * OUT assertion: the match length is not greater than s->lookahead. */ function longest_match(s, cur_match) { var chain_length = s.max_chain_length; /* max hash chain length */ var scan = s.strstart; /* current string */ var match; /* matched string */ var len; /* length of current match */ var best_len = s.prev_length; /* best match length so far */ var nice_match = s.nice_match; /* stop if match long enough */ var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/; var _win = s.window; // shortcut var wmask = s.w_mask; var prev = s.prev; /* Stop when cur_match becomes <= limit. To simplify the code, * we prevent matches with the string of window index 0. */ var strend = s.strstart + MAX_MATCH; var scan_end1 = _win[scan + best_len - 1]; var scan_end = _win[scan + best_len]; /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. * It is easy to get rid of this optimization if necessary. */ // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); /* Do not waste too much time if we already have a good match: */ if (s.prev_length >= s.good_match) { chain_length >>= 2; } /* Do not look for matches beyond the end of the input. This is necessary * to make deflate deterministic. */ if (nice_match > s.lookahead) { nice_match = s.lookahead; } // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); do { // Assert(cur_match < s->strstart, "no future"); match = cur_match; /* Skip to next match if the match length cannot increase * or if the match length is less than 2. Note that the checks below * for insufficient lookahead only occur occasionally for performance * reasons. Therefore uninitialized memory will be accessed, and * conditional jumps will be made that depend on those values. * However the length of the match is limited to the lookahead, so * the output of deflate is not affected by the uninitialized values. */ if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) { continue; } /* The check at best_len-1 can be removed because it will be made * again later. (This heuristic is not always a win.) * It is not necessary to compare scan[2] and match[2] since they * are always equal when the other bytes match, given that * the hash keys are equal and that HASH_BITS >= 8. */ scan += 2; match++; // Assert(*scan == *match, "match[2]?"); /* We check for insufficient lookahead only every 8th comparison; * the 256th check will be made at strstart+258. */ do { /*jshint noempty:false*/ } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend); // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); len = MAX_MATCH - (strend - scan); scan = strend - MAX_MATCH; if (len > best_len) { s.match_start = cur_match; best_len = len; if (len >= nice_match) { break; } scan_end1 = _win[scan + best_len - 1]; scan_end = _win[scan + best_len]; } } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); if (best_len <= s.lookahead) { return best_len; } return s.lookahead; } /* =========================================================================== * Fill the window when the lookahead becomes insufficient. * Updates strstart and lookahead. * * IN assertion: lookahead < MIN_LOOKAHEAD * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD * At least one byte has been read, or avail_in == 0; reads are * performed for at least two bytes (required for the zip translate_eol * option -- not supported here). */ function fill_window(s) { var _w_size = s.w_size; var p, n, m, more, str; //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); do { more = s.window_size - s.lookahead - s.strstart; // JS ints have 32 bit, block below not needed /* Deal with !@#$% 64K limit: */ //if (sizeof(int) <= 2) { // if (more == 0 && s->strstart == 0 && s->lookahead == 0) { // more = wsize; // // } else if (more == (unsigned)(-1)) { // /* Very unlikely, but possible on 16 bit machine if // * strstart == 0 && lookahead == 1 (input done a byte at time) // */ // more--; // } //} /* If the window is almost full and there is insufficient lookahead, * move the upper half to the lower one to make room in the upper half. */ if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { utils.arraySet(s.window, s.window, _w_size, _w_size, 0); s.match_start -= _w_size; s.strstart -= _w_size; /* we now have strstart >= MAX_DIST */ s.block_start -= _w_size; /* Slide the hash table (could be avoided with 32 bit values at the expense of memory usage). We slide even when level == 0 to keep the hash table consistent if we switch back to level > 0 later. (Using level 0 permanently is not an optimal usage of zlib, so we don't care about this pathological case.) */ n = s.hash_size; p = n; do { m = s.head[--p]; s.head[p] = (m >= _w_size ? m - _w_size : 0); } while (--n); n = _w_size; p = n; do { m = s.prev[--p]; s.prev[p] = (m >= _w_size ? m - _w_size : 0); /* If n is not on any hash chain, prev[n] is garbage but * its value will never be used. */ } while (--n); more += _w_size; } if (s.strm.avail_in === 0) { break; } /* If there was no sliding: * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && * more == window_size - lookahead - strstart * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) * => more >= window_size - 2*WSIZE + 2 * In the BIG_MEM or MMAP case (not yet supported), * window_size == input_size + MIN_LOOKAHEAD && * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. * Otherwise, window_size == 2*WSIZE so more >= 2. * If there was sliding, more >= WSIZE. So in all cases, more >= 2. */ //Assert(more >= 2, "more < 2"); n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); s.lookahead += n; /* Initialize the hash value now that we have some input: */ if (s.lookahead + s.insert >= MIN_MATCH) { str = s.strstart - s.insert; s.ins_h = s.window[str]; /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask; //#if MIN_MATCH != 3 // Call update_hash() MIN_MATCH-3 more times //#endif while (s.insert) { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; s.prev[str & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = str; str++; s.insert--; if (s.lookahead + s.insert < MIN_MATCH) { break; } } } /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, * but this is not important since only literal bytes will be emitted. */ } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); /* If the WIN_INIT bytes after the end of the current data have never been * written, then zero those bytes in order to avoid memory check reports of * the use of uninitialized (or uninitialised as Julian writes) bytes by * the longest match routines. Update the high water mark for the next * time through here. WIN_INIT is set to MAX_MATCH since the longest match * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. */ // if (s.high_water < s.window_size) { // var curr = s.strstart + s.lookahead; // var init = 0; // // if (s.high_water < curr) { // /* Previous high water mark below current data -- zero WIN_INIT // * bytes or up to end of window, whichever is less. // */ // init = s.window_size - curr; // if (init > WIN_INIT) // init = WIN_INIT; // zmemzero(s->window + curr, (unsigned)init); // s->high_water = curr + init; // } // else if (s->high_water < (ulg)curr + WIN_INIT) { // /* High water mark at or above current data, but below current data // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up // * to end of window, whichever is less. // */ // init = (ulg)curr + WIN_INIT - s->high_water; // if (init > s->window_size - s->high_water) // init = s->window_size - s->high_water; // zmemzero(s->window + s->high_water, (unsigned)init); // s->high_water += init; // } // } // // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, // "not enough room for search"); } /* =========================================================================== * Copy without compression as much as possible from the input stream, return * the current block state. * This function does not insert new strings in the dictionary since * uncompressible data is probably not useful. This function is used * only for the level=0 compression option. * NOTE: this function should be optimized to avoid extra copying from * window to pending_buf. */ function deflate_stored(s, flush) { /* Stored blocks are limited to 0xffff bytes, pending_buf is limited * to pending_buf_size, and each stored block has a 5 byte header: */ var max_block_size = 0xffff; if (max_block_size > s.pending_buf_size - 5) { max_block_size = s.pending_buf_size - 5; } /* Copy as much as possible from input to output: */ for (;;) { /* Fill the window as much as possible: */ if (s.lookahead <= 1) { //Assert(s->strstart < s->w_size+MAX_DIST(s) || // s->block_start >= (long)s->w_size, "slide too late"); // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) || // s.block_start >= s.w_size)) { // throw new Error("slide too late"); // } fill_window(s); if (s.lookahead === 0 && flush === Z_NO_FLUSH) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ } //Assert(s->block_start >= 0L, "block gone"); // if (s.block_start < 0) throw new Error("block gone"); s.strstart += s.lookahead; s.lookahead = 0; /* Emit a stored block if pending_buf will be full: */ var max_start = s.block_start + max_block_size; if (s.strstart === 0 || s.strstart >= max_start) { /* strstart == 0 is possible when wraparound on 16-bit machine */ s.lookahead = s.strstart - max_start; s.strstart = max_start; /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } /* Flush if we may have to slide, otherwise block_start may become * negative and the data will be gone: */ if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } } s.insert = 0; if (flush === Z_FINISH) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } /***/ return BS_FINISH_DONE; } if (s.strstart > s.block_start) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } return BS_NEED_MORE; } /* =========================================================================== * Compress as much as possible from the input stream, return the current * block state. * This function does not perform lazy evaluation of matches and inserts * new strings in the dictionary only for unmatched strings or for short * matches. It is used only for the fast compression options. */ function deflate_fast(s, flush) { var hash_head; /* head of the hash chain */ var bflush; /* set if current block must be flushed */ for (;;) { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the next match, plus MIN_MATCH bytes to insert the * string following the next match. */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; /* flush the current block */ } } /* Insert the string window[strstart .. strstart+2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/*NIL*/; if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ } /* Find the longest match, discarding those <= prev_length. * At this point we have always match_length < MIN_MATCH */ if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) { /* To simplify the code, we prevent matches with the string * of window index 0 (in particular we have to avoid a match * of the string with itself at the start of the input file). */ s.match_length = longest_match(s, hash_head); /* longest_match() sets match_start */ } if (s.match_length >= MIN_MATCH) { // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only /*** _tr_tally_dist(s, s.strstart - s.match_start, s.match_length - MIN_MATCH, bflush); ***/ bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; /* Insert new strings in the hash table only if the match length * is not too large. This saves time but degrades compression. */ if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { s.match_length--; /* string at strstart already in table */ do { s.strstart++; /*** INSERT_STRING(s, s.strstart, hash_head); ***/ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ /* strstart never exceeds WSIZE-MAX_MATCH, so there are * always MIN_MATCH bytes ahead. */ } while (--s.match_length !== 0); s.strstart++; } else { s.strstart += s.match_length; s.match_length = 0; s.ins_h = s.window[s.strstart]; /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask; //#if MIN_MATCH != 3 // Call UPDATE_HASH() MIN_MATCH-3 more times //#endif /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not * matter since it will be recomputed at next deflate call. */ } } else { /* No match, output a literal byte */ //Tracevv((stderr,"%c", s.window[s.strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; } if (bflush) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } } s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); if (flush === Z_FINISH) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } /***/ return BS_FINISH_DONE; } if (s.last_lit) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } return BS_BLOCK_DONE; } /* =========================================================================== * Same as above, but achieves better compression. We use a lazy * evaluation for matches: a match is finally adopted only if there is * no better match at the next window position. */ function deflate_slow(s, flush) { var hash_head; /* head of hash chain */ var bflush; /* set if current block must be flushed */ var max_insert; /* Process the input block. */ for (;;) { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the next match, plus MIN_MATCH bytes to insert the * string following the next match. */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ } /* Insert the string window[strstart .. strstart+2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/*NIL*/; if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ } /* Find the longest match, discarding those <= prev_length. */ s.prev_length = s.match_length; s.prev_match = s.match_start; s.match_length = MIN_MATCH - 1; if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { /* To simplify the code, we prevent matches with the string * of window index 0 (in particular we have to avoid a match * of the string with itself at the start of the input file). */ s.match_length = longest_match(s, hash_head); /* longest_match() sets match_start */ if (s.match_length <= 5 && (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { /* If prev_match is also MIN_MATCH, match_start is garbage * but we will ignore the current match anyway. */ s.match_length = MIN_MATCH - 1; } } /* If there was a match at the previous step and the current * match is not better, output the previous match: */ if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { max_insert = s.strstart + s.lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ //check_match(s, s.strstart-1, s.prev_match, s.prev_length); /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH, bflush);***/ bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); /* Insert in hash table all strings up to the end of the match. * strstart-1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in * the hash table. */ s.lookahead -= s.prev_length - 1; s.prev_length -= 2; do { if (++s.strstart <= max_insert) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ } } while (--s.prev_length !== 0); s.match_available = 0; s.match_length = MIN_MATCH - 1; s.strstart++; if (bflush) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } } else if (s.match_available) { /* If there was no match at the previous position, output a * single literal. If there was a match but the current match * is longer, truncate the previous match to a single literal. */ //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); if (bflush) { /*** FLUSH_BLOCK_ONLY(s, 0) ***/ flush_block_only(s, false); /***/ } s.strstart++; s.lookahead--; if (s.strm.avail_out === 0) { return BS_NEED_MORE; } } else { /* There is no previous match to compare with, wait for * the next step to decide. */ s.match_available = 1; s.strstart++; s.lookahead--; } } //Assert (flush != Z_NO_FLUSH, "no flush?"); if (s.match_available) { //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); s.match_available = 0; } s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; if (flush === Z_FINISH) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } /***/ return BS_FINISH_DONE; } if (s.last_lit) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } return BS_BLOCK_DONE; } /* =========================================================================== * For Z_RLE, simply look for runs of bytes, generate matches only of distance * one. Do not maintain a hash table. (It will be regenerated if this run of * deflate switches away from Z_RLE.) */ function deflate_rle(s, flush) { var bflush; /* set if current block must be flushed */ var prev; /* byte at distance one to match */ var scan, strend; /* scan goes up to strend for length of run */ var _win = s.window; for (;;) { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the longest run, plus one for the unrolled loop. */ if (s.lookahead <= MAX_MATCH) { fill_window(s); if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ } /* See how many times the previous byte repeats */ s.match_length = 0; if (s.lookahead >= MIN_MATCH && s.strstart > 0) { scan = s.strstart - 1; prev = _win[scan]; if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { strend = s.strstart + MAX_MATCH; do { /*jshint noempty:false*/ } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); s.match_length = MAX_MATCH - (strend - scan); if (s.match_length > s.lookahead) { s.match_length = s.lookahead; } } //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ if (s.match_length >= MIN_MATCH) { //check_match(s, s.strstart, s.strstart - 1, s.match_length); /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; s.strstart += s.match_length; s.match_length = 0; } else { /* No match, output a literal byte */ //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; } if (bflush) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } } s.insert = 0; if (flush === Z_FINISH) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } /***/ return BS_FINISH_DONE; } if (s.last_lit) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } return BS_BLOCK_DONE; } /* =========================================================================== * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. * (It will be regenerated if this run of deflate switches away from Huffman.) */ function deflate_huff(s, flush) { var bflush; /* set if current block must be flushed */ for (;;) { /* Make sure that we have a literal to write. */ if (s.lookahead === 0) { fill_window(s); if (s.lookahead === 0) { if (flush === Z_NO_FLUSH) { return BS_NEED_MORE; } break; /* flush the current block */ } } /* Output a literal byte */ s.match_length = 0; //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; if (bflush) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } } s.insert = 0; if (flush === Z_FINISH) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } /***/ return BS_FINISH_DONE; } if (s.last_lit) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } return BS_BLOCK_DONE; } /* Values for max_lazy_match, good_match and max_chain_length, depending on * the desired pack level (0..9). The values given below have been tuned to * exclude worst case performance for pathological files. Better values may be * found for specific files. */ function Config(good_length, max_lazy, nice_length, max_chain, func) { this.good_length = good_length; this.max_lazy = max_lazy; this.nice_length = nice_length; this.max_chain = max_chain; this.func = func; } var configuration_table; configuration_table = [ /* good lazy nice chain */ new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */ new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */ new Config(4, 5, 16, 8, deflate_fast), /* 2 */ new Config(4, 6, 32, 32, deflate_fast), /* 3 */ new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */ new Config(8, 16, 32, 32, deflate_slow), /* 5 */ new Config(8, 16, 128, 128, deflate_slow), /* 6 */ new Config(8, 32, 128, 256, deflate_slow), /* 7 */ new Config(32, 128, 258, 1024, deflate_slow), /* 8 */ new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */ ]; /* =========================================================================== * Initialize the "longest match" routines for a new zlib stream */ function lm_init(s) { s.window_size = 2 * s.w_size; /*** CLEAR_HASH(s); ***/ zero(s.head); // Fill with NIL (= 0); /* Set the default configuration parameters: */ s.max_lazy_match = configuration_table[s.level].max_lazy; s.good_match = configuration_table[s.level].good_length; s.nice_match = configuration_table[s.level].nice_length; s.max_chain_length = configuration_table[s.level].max_chain; s.strstart = 0; s.block_start = 0; s.lookahead = 0; s.insert = 0; s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; s.ins_h = 0; } function DeflateState() { this.strm = null; /* pointer back to this zlib stream */ this.status = 0; /* as the name implies */ this.pending_buf = null; /* output still pending */ this.pending_buf_size = 0; /* size of pending_buf */ this.pending_out = 0; /* next pending byte to output to the stream */ this.pending = 0; /* nb of bytes in the pending buffer */ this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ this.gzhead = null; /* gzip header information to write */ this.gzindex = 0; /* where in extra, name, or comment */ this.method = Z_DEFLATED; /* can only be DEFLATED */ this.last_flush = -1; /* value of flush param for previous deflate call */ this.w_size = 0; /* LZ77 window size (32K by default) */ this.w_bits = 0; /* log2(w_size) (8..16) */ this.w_mask = 0; /* w_size - 1 */ this.window = null; /* Sliding window. Input bytes are read into the second half of the window, * and move to the first half later to keep a dictionary of at least wSize * bytes. With this organization, matches are limited to a distance of * wSize-MAX_MATCH bytes, but this ensures that IO is always * performed with a length multiple of the block size. */ this.window_size = 0; /* Actual size of window: 2*wSize, except when the user input buffer * is directly used as sliding window. */ this.prev = null; /* Link to older string with same hash index. To limit the size of this * array to 64K, this link is maintained only for the last 32K strings. * An index in this array is thus a window index modulo 32K. */ this.head = null; /* Heads of the hash chains or NIL. */ this.ins_h = 0; /* hash index of string to be inserted */ this.hash_size = 0; /* number of elements in hash table */ this.hash_bits = 0; /* log2(hash_size) */ this.hash_mask = 0; /* hash_size-1 */ this.hash_shift = 0; /* Number of bits by which ins_h must be shifted at each input * step. It must be such that after MIN_MATCH steps, the oldest * byte no longer takes part in the hash key, that is: * hash_shift * MIN_MATCH >= hash_bits */ this.block_start = 0; /* Window position at the beginning of the current output block. Gets * negative when the window is moved backwards. */ this.match_length = 0; /* length of best match */ this.prev_match = 0; /* previous match */ this.match_available = 0; /* set if previous match exists */ this.strstart = 0; /* start of string to insert */ this.match_start = 0; /* start of matching string */ this.lookahead = 0; /* number of valid bytes ahead in window */ this.prev_length = 0; /* Length of the best match at previous step. Matches not greater than this * are discarded. This is used in the lazy match evaluation. */ this.max_chain_length = 0; /* To speed up deflation, hash chains are never searched beyond this * length. A higher limit improves compression ratio but degrades the * speed. */ this.max_lazy_match = 0; /* Attempt to find a better match only when the current match is strictly * smaller than this value. This mechanism is used only for compression * levels >= 4. */ // That's alias to max_lazy_match, don't use directly //this.max_insert_length = 0; /* Insert new strings in the hash table only if the match length is not * greater than this length. This saves time but degrades compression. * max_insert_length is used only for compression levels <= 3. */ this.level = 0; /* compression level (1..9) */ this.strategy = 0; /* favor or force Huffman coding*/ this.good_match = 0; /* Use a faster search when the previous match is longer than this */ this.nice_match = 0; /* Stop searching when current match exceeds this */ /* used by trees.c: */ /* Didn't use ct_data typedef below to suppress compiler warning */ // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ // Use flat array of DOUBLE size, with interleaved fata, // because JS does not support effective this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); zero(this.dyn_ltree); zero(this.dyn_dtree); zero(this.bl_tree); this.l_desc = null; /* desc. for literal tree */ this.d_desc = null; /* desc. for distance tree */ this.bl_desc = null; /* desc. for bit length tree */ //ush bl_count[MAX_BITS+1]; this.bl_count = new utils.Buf16(MAX_BITS + 1); /* number of codes at each bit length for an optimal tree */ //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */ zero(this.heap); this.heap_len = 0; /* number of elements in the heap */ this.heap_max = 0; /* element of largest frequency */ /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. * The same heap array is used to build all trees. */ this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; zero(this.depth); /* Depth of each subtree used as tie breaker for trees of equal frequency */ this.l_buf = 0; /* buffer index for literals or lengths */ this.lit_bufsize = 0; /* Size of match buffer for literals/lengths. There are 4 reasons for * limiting lit_bufsize to 64K: * - frequencies can be kept in 16 bit counters * - if compression is not successful for the first block, all input * data is still in the window so we can still emit a stored block even * when input comes from standard input. (This can also be done for * all blocks if lit_bufsize is not greater than 32K.) * - if compression is not successful for a file smaller than 64K, we can * even emit a stored file instead of a stored block (saving 5 bytes). * This is applicable only for zip (not gzip or zlib). * - creating new Huffman trees less frequently may not provide fast * adaptation to changes in the input data statistics. (Take for * example a binary file with poorly compressible code followed by * a highly compressible string table.) Smaller buffer sizes give * fast adaptation but have of course the overhead of transmitting * trees more frequently. * - I can't count above 4 */ this.last_lit = 0; /* running index in l_buf */ this.d_buf = 0; /* Buffer index for distances. To simplify the code, d_buf and l_buf have * the same number of elements. To use different lengths, an extra flag * array would be necessary. */ this.opt_len = 0; /* bit length of current block with optimal trees */ this.static_len = 0; /* bit length of current block with static trees */ this.matches = 0; /* number of string matches in current block */ this.insert = 0; /* bytes at end of window left to insert */ this.bi_buf = 0; /* Output buffer. bits are inserted starting at the bottom (least * significant bits). */ this.bi_valid = 0; /* Number of valid bits in bi_buf. All bits above the last valid bit * are always zero. */ // Used for window memory init. We safely ignore it for JS. That makes // sense only for pointers and memory check tools. //this.high_water = 0; /* High water mark offset in window for initialized bytes -- bytes above * this are set to zero in order to avoid memory check warnings when * longest match routines access bytes past the input. This is then * updated to the new high water mark. */ } function deflateResetKeep(strm) { var s; if (!strm || !strm.state) { return err(strm, Z_STREAM_ERROR); } strm.total_in = strm.total_out = 0; strm.data_type = Z_UNKNOWN; s = strm.state; s.pending = 0; s.pending_out = 0; if (s.wrap < 0) { s.wrap = -s.wrap; /* was made negative by deflate(..., Z_FINISH); */ } s.status = (s.wrap ? INIT_STATE : BUSY_STATE); strm.adler = (s.wrap === 2) ? 0 // crc32(0, Z_NULL, 0) : 1; // adler32(0, Z_NULL, 0) s.last_flush = Z_NO_FLUSH; trees._tr_init(s); return Z_OK; } function deflateReset(strm) { var ret = deflateResetKeep(strm); if (ret === Z_OK) { lm_init(strm.state); } return ret; } function deflateSetHeader(strm, head) { if (!strm || !strm.state) { return Z_STREAM_ERROR; } if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } strm.state.gzhead = head; return Z_OK; } function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { if (!strm) { // === Z_NULL return Z_STREAM_ERROR; } var wrap = 1; if (level === Z_DEFAULT_COMPRESSION) { level = 6; } if (windowBits < 0) { /* suppress zlib wrapper */ wrap = 0; windowBits = -windowBits; } else if (windowBits > 15) { wrap = 2; /* write gzip wrapper instead */ windowBits -= 16; } if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { return err(strm, Z_STREAM_ERROR); } if (windowBits === 8) { windowBits = 9; } /* until 256-byte window bug fixed */ var s = new DeflateState(); strm.state = s; s.strm = strm; s.wrap = wrap; s.gzhead = null; s.w_bits = windowBits; s.w_size = 1 << s.w_bits; s.w_mask = s.w_size - 1; s.hash_bits = memLevel + 7; s.hash_size = 1 << s.hash_bits; s.hash_mask = s.hash_size - 1; s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); s.window = new utils.Buf8(s.w_size * 2); s.head = new utils.Buf16(s.hash_size); s.prev = new utils.Buf16(s.w_size); // Don't need mem init magic for JS. //s.high_water = 0; /* nothing written to s->window yet */ s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ s.pending_buf_size = s.lit_bufsize * 4; //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); //s->pending_buf = (uchf *) overlay; s.pending_buf = new utils.Buf8(s.pending_buf_size); // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`) //s->d_buf = overlay + s->lit_bufsize/sizeof(ush); s.d_buf = 1 * s.lit_bufsize; //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; s.l_buf = (1 + 2) * s.lit_bufsize; s.level = level; s.strategy = strategy; s.method = method; return deflateReset(strm); } function deflateInit(strm, level) { return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); } function deflate(strm, flush) { var old_flush, s; var beg, val; // for gzip header write only if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) { return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; } s = strm.state; if (!strm.output || (!strm.input && strm.avail_in !== 0) || (s.status === FINISH_STATE && flush !== Z_FINISH)) { return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); } s.strm = strm; /* just in case */ old_flush = s.last_flush; s.last_flush = flush; /* Write the header */ if (s.status === INIT_STATE) { if (s.wrap === 2) { // GZIP header strm.adler = 0; //crc32(0L, Z_NULL, 0); put_byte(s, 31); put_byte(s, 139); put_byte(s, 8); if (!s.gzhead) { // s->gzhead == Z_NULL put_byte(s, 0); put_byte(s, 0); put_byte(s, 0); put_byte(s, 0); put_byte(s, 0); put_byte(s, s.level === 9 ? 2 : (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0)); put_byte(s, OS_CODE); s.status = BUSY_STATE; } else { put_byte(s, (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16) ); put_byte(s, s.gzhead.time & 0xff); put_byte(s, (s.gzhead.time >> 8) & 0xff); put_byte(s, (s.gzhead.time >> 16) & 0xff); put_byte(s, (s.gzhead.time >> 24) & 0xff); put_byte(s, s.level === 9 ? 2 : (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0)); put_byte(s, s.gzhead.os & 0xff); if (s.gzhead.extra && s.gzhead.extra.length) { put_byte(s, s.gzhead.extra.length & 0xff); put_byte(s, (s.gzhead.extra.length >> 8) & 0xff); } if (s.gzhead.hcrc) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0); } s.gzindex = 0; s.status = EXTRA_STATE; } } else // DEFLATE header { var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; var level_flags = -1; if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { level_flags = 0; } else if (s.level < 6) { level_flags = 1; } else if (s.level === 6) { level_flags = 2; } else { level_flags = 3; } header |= (level_flags << 6); if (s.strstart !== 0) { header |= PRESET_DICT; } header += 31 - (header % 31); s.status = BUSY_STATE; putShortMSB(s, header); /* Save the adler32 of the preset dictionary: */ if (s.strstart !== 0) { putShortMSB(s, strm.adler >>> 16); putShortMSB(s, strm.adler & 0xffff); } strm.adler = 1; // adler32(0L, Z_NULL, 0); } } //#ifdef GZIP if (s.status === EXTRA_STATE) { if (s.gzhead.extra/* != Z_NULL*/) { beg = s.pending; /* start of bytes to update crc */ while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { if (s.pending === s.pending_buf_size) { if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); } flush_pending(strm); beg = s.pending; if (s.pending === s.pending_buf_size) { break; } } put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); s.gzindex++; } if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); } if (s.gzindex === s.gzhead.extra.length) { s.gzindex = 0; s.status = NAME_STATE; } } else { s.status = NAME_STATE; } } if (s.status === NAME_STATE) { if (s.gzhead.name/* != Z_NULL*/) { beg = s.pending; /* start of bytes to update crc */ //int val; do { if (s.pending === s.pending_buf_size) { if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); } flush_pending(strm); beg = s.pending; if (s.pending === s.pending_buf_size) { val = 1; break; } } // JS specific: little magic to add zero terminator to end of string if (s.gzindex < s.gzhead.name.length) { val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; } else { val = 0; } put_byte(s, val); } while (val !== 0); if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); } if (val === 0) { s.gzindex = 0; s.status = COMMENT_STATE; } } else { s.status = COMMENT_STATE; } } if (s.status === COMMENT_STATE) { if (s.gzhead.comment/* != Z_NULL*/) { beg = s.pending; /* start of bytes to update crc */ //int val; do { if (s.pending === s.pending_buf_size) { if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); } flush_pending(strm); beg = s.pending; if (s.pending === s.pending_buf_size) { val = 1; break; } } // JS specific: little magic to add zero terminator to end of string if (s.gzindex < s.gzhead.comment.length) { val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; } else { val = 0; } put_byte(s, val); } while (val !== 0); if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); } if (val === 0) { s.status = HCRC_STATE; } } else { s.status = HCRC_STATE; } } if (s.status === HCRC_STATE) { if (s.gzhead.hcrc) { if (s.pending + 2 > s.pending_buf_size) { flush_pending(strm); } if (s.pending + 2 <= s.pending_buf_size) { put_byte(s, strm.adler & 0xff); put_byte(s, (strm.adler >> 8) & 0xff); strm.adler = 0; //crc32(0L, Z_NULL, 0); s.status = BUSY_STATE; } } else { s.status = BUSY_STATE; } } //#endif /* Flush as much pending output as possible */ if (s.pending !== 0) { flush_pending(strm); if (strm.avail_out === 0) { /* Since avail_out is 0, deflate will be called again with * more output space, but possibly with both pending and * avail_in equal to zero. There won't be anything to do, * but this is not an error situation so make sure we * return OK instead of BUF_ERROR at next call of deflate: */ s.last_flush = -1; return Z_OK; } /* Make sure there is something to do and avoid duplicate consecutive * flushes. For repeated and useless calls with Z_FINISH, we keep * returning Z_STREAM_END instead of Z_BUF_ERROR. */ } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH) { return err(strm, Z_BUF_ERROR); } /* User must not provide more input after the first FINISH: */ if (s.status === FINISH_STATE && strm.avail_in !== 0) { return err(strm, Z_BUF_ERROR); } /* Start a new block or continue the current one. */ if (strm.avail_in !== 0 || s.lookahead !== 0 || (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : (s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush)); if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { s.status = FINISH_STATE; } if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { if (strm.avail_out === 0) { s.last_flush = -1; /* avoid BUF_ERROR next call, see above */ } return Z_OK; /* If flush != Z_NO_FLUSH && avail_out == 0, the next call * of deflate should use the same flush parameter to make sure * that the flush is complete. So we don't have to output an * empty block here, this will be done at next call. This also * ensures that for a very small output buffer, we emit at most * one empty block. */ } if (bstate === BS_BLOCK_DONE) { if (flush === Z_PARTIAL_FLUSH) { trees._tr_align(s); } else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ trees._tr_stored_block(s, 0, 0, false); /* For a full flush, this empty block will be recognized * as a special marker by inflate_sync(). */ if (flush === Z_FULL_FLUSH) { /*** CLEAR_HASH(s); ***/ /* forget history */ zero(s.head); // Fill with NIL (= 0); if (s.lookahead === 0) { s.strstart = 0; s.block_start = 0; s.insert = 0; } } } flush_pending(strm); if (strm.avail_out === 0) { s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ return Z_OK; } } } //Assert(strm->avail_out > 0, "bug2"); //if (strm.avail_out <= 0) { throw new Error("bug2");} if (flush !== Z_FINISH) { return Z_OK; } if (s.wrap <= 0) { return Z_STREAM_END; } /* Write the trailer */ if (s.wrap === 2) { put_byte(s, strm.adler & 0xff); put_byte(s, (strm.adler >> 8) & 0xff); put_byte(s, (strm.adler >> 16) & 0xff); put_byte(s, (strm.adler >> 24) & 0xff); put_byte(s, strm.total_in & 0xff); put_byte(s, (strm.total_in >> 8) & 0xff); put_byte(s, (strm.total_in >> 16) & 0xff); put_byte(s, (strm.total_in >> 24) & 0xff); } else { putShortMSB(s, strm.adler >>> 16); putShortMSB(s, strm.adler & 0xffff); } flush_pending(strm); /* If avail_out is zero, the application will call deflate again * to flush the rest. */ if (s.wrap > 0) { s.wrap = -s.wrap; } /* write the trailer only once! */ return s.pending !== 0 ? Z_OK : Z_STREAM_END; } function deflateEnd(strm) { var status; if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { return Z_STREAM_ERROR; } status = strm.state.status; if (status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE ) { return err(strm, Z_STREAM_ERROR); } strm.state = null; return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; } /* ========================================================================= * Initializes the compression dictionary from the given byte * sequence without producing any compressed output. */ function deflateSetDictionary(strm, dictionary) { var dictLength = dictionary.length; var s; var str, n; var wrap; var avail; var next; var input; var tmpDict; if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { return Z_STREAM_ERROR; } s = strm.state; wrap = s.wrap; if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { return Z_STREAM_ERROR; } /* when using zlib wrappers, compute Adler-32 for provided dictionary */ if (wrap === 1) { /* adler32(strm->adler, dictionary, dictLength); */ strm.adler = adler32(strm.adler, dictionary, dictLength, 0); } s.wrap = 0; /* avoid computing Adler-32 in read_buf */ /* if dictionary would fill window, just replace the history */ if (dictLength >= s.w_size) { if (wrap === 0) { /* already empty otherwise */ /*** CLEAR_HASH(s); ***/ zero(s.head); // Fill with NIL (= 0); s.strstart = 0; s.block_start = 0; s.insert = 0; } /* use the tail */ // dictionary = dictionary.slice(dictLength - s.w_size); tmpDict = new utils.Buf8(s.w_size); utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0); dictionary = tmpDict; dictLength = s.w_size; } /* insert dictionary into window and hash */ avail = strm.avail_in; next = strm.next_in; input = strm.input; strm.avail_in = dictLength; strm.next_in = 0; strm.input = dictionary; fill_window(s); while (s.lookahead >= MIN_MATCH) { str = s.strstart; n = s.lookahead - (MIN_MATCH - 1); do { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; s.prev[str & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = str; str++; } while (--n); s.strstart = str; s.lookahead = MIN_MATCH - 1; fill_window(s); } s.strstart += s.lookahead; s.block_start = s.strstart; s.insert = s.lookahead; s.lookahead = 0; s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; strm.next_in = next; strm.input = input; strm.avail_in = avail; s.wrap = wrap; return Z_OK; } exports.deflateInit = deflateInit; exports.deflateInit2 = deflateInit2; exports.deflateReset = deflateReset; exports.deflateResetKeep = deflateResetKeep; exports.deflateSetHeader = deflateSetHeader; exports.deflate = deflate; exports.deflateEnd = deflateEnd; exports.deflateSetDictionary = deflateSetDictionary; exports.deflateInfo = 'pako deflate (from Nodeca project)'; /* Not implemented exports.deflateBound = deflateBound; exports.deflateCopy = deflateCopy; exports.deflateParams = deflateParams; exports.deflatePending = deflatePending; exports.deflatePrime = deflatePrime; exports.deflateTune = deflateTune; */ },{"../utils/common":3,"./adler32":5,"./crc32":7,"./messages":13,"./trees":14}],9:[function(require,module,exports){ // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. function GZheader() { /* true if compressed data believed to be text */ this.text = 0; /* modification time */ this.time = 0; /* extra flags (not used when writing a gzip file) */ this.xflags = 0; /* operating system */ this.os = 0; /* pointer to extra field or Z_NULL if none */ this.extra = null; /* extra field length (valid if extra != Z_NULL) */ this.extra_len = 0; // Actually, we don't need it in JS, // but leave for few code modifications // // Setup limits is not necessary because in js we should not preallocate memory // for inflate use constant limit in 65536 bytes // /* space at extra (only when reading header) */ // this.extra_max = 0; /* pointer to zero-terminated file name or Z_NULL */ this.name = ''; /* space at name (only when reading header) */ // this.name_max = 0; /* pointer to zero-terminated comment or Z_NULL */ this.comment = ''; /* space at comment (only when reading header) */ // this.comm_max = 0; /* true if there was or will be a header crc */ this.hcrc = 0; /* true when done reading gzip header (not used when writing a gzip file) */ this.done = false; } module.exports = GZheader; },{}],10:[function(require,module,exports){ // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. // See state defs from inflate.js var BAD = 30; /* got a data error -- remain here until reset */ var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ /* Decode literal, length, and distance codes and write out the resulting literal and match bytes until either not enough input or output is available, an end-of-block is encountered, or a data error is encountered. When large enough input and output buffers are supplied to inflate(), for example, a 16K input buffer and a 64K output buffer, more than 95% of the inflate execution time is spent in this routine. Entry assumptions: state.mode === LEN strm.avail_in >= 6 strm.avail_out >= 258 start >= strm.avail_out state.bits < 8 On return, state.mode is one of: LEN -- ran out of enough output space or enough available input TYPE -- reached end of block code, inflate() to interpret next block BAD -- error in block data Notes: - The maximum input bits used by a length/distance pair is 15 bits for the length code, 5 bits for the length extra, 15 bits for the distance code, and 13 bits for the distance extra. This totals 48 bits, or six bytes. Therefore if strm.avail_in >= 6, then there is enough input to avoid checking for available input while decoding. - The maximum bytes that a single length/distance pair can output is 258 bytes, which is the maximum length that can be coded. inflate_fast() requires strm.avail_out >= 258 for each loop to avoid checking for output space. */ module.exports = function inflate_fast(strm, start) { var state; var _in; /* local strm.input */ var last; /* have enough input while in < last */ var _out; /* local strm.output */ var beg; /* inflate()'s initial strm.output */ var end; /* while out < end, enough space available */ //#ifdef INFLATE_STRICT var dmax; /* maximum distance from zlib header */ //#endif var wsize; /* window size or zero if not using window */ var whave; /* valid bytes in the window */ var wnext; /* window write index */ // Use `s_window` instead `window`, avoid conflict with instrumentation tools var s_window; /* allocated sliding window, if wsize != 0 */ var hold; /* local strm.hold */ var bits; /* local strm.bits */ var lcode; /* local strm.lencode */ var dcode; /* local strm.distcode */ var lmask; /* mask for first level of length codes */ var dmask; /* mask for first level of distance codes */ var here; /* retrieved table entry */ var op; /* code bits, operation, extra bits, or */ /* window position, window bytes to copy */ var len; /* match length, unused bytes */ var dist; /* match distance */ var from; /* where to copy match from */ var from_source; var input, output; // JS specific, because we have no pointers /* copy state to local variables */ state = strm.state; //here = state.here; _in = strm.next_in; input = strm.input; last = _in + (strm.avail_in - 5); _out = strm.next_out; output = strm.output; beg = _out - (start - strm.avail_out); end = _out + (strm.avail_out - 257); //#ifdef INFLATE_STRICT dmax = state.dmax; //#endif wsize = state.wsize; whave = state.whave; wnext = state.wnext; s_window = state.window; hold = state.hold; bits = state.bits; lcode = state.lencode; dcode = state.distcode; lmask = (1 << state.lenbits) - 1; dmask = (1 << state.distbits) - 1; /* decode literals and length/distances until end-of-block or not enough input data or output space */ top: do { if (bits < 15) { hold += input[_in++] << bits; bits += 8; hold += input[_in++] << bits; bits += 8; } here = lcode[hold & lmask]; dolen: for (;;) { // Goto emulation op = here >>> 24/*here.bits*/; hold >>>= op; bits -= op; op = (here >>> 16) & 0xff/*here.op*/; if (op === 0) { /* literal */ //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? // "inflate: literal '%c'\n" : // "inflate: literal 0x%02x\n", here.val)); output[_out++] = here & 0xffff/*here.val*/; } else if (op & 16) { /* length base */ len = here & 0xffff/*here.val*/; op &= 15; /* number of extra bits */ if (op) { if (bits < op) { hold += input[_in++] << bits; bits += 8; } len += hold & ((1 << op) - 1); hold >>>= op; bits -= op; } //Tracevv((stderr, "inflate: length %u\n", len)); if (bits < 15) { hold += input[_in++] << bits; bits += 8; hold += input[_in++] << bits; bits += 8; } here = dcode[hold & dmask]; dodist: for (;;) { // goto emulation op = here >>> 24/*here.bits*/; hold >>>= op; bits -= op; op = (here >>> 16) & 0xff/*here.op*/; if (op & 16) { /* distance base */ dist = here & 0xffff/*here.val*/; op &= 15; /* number of extra bits */ if (bits < op) { hold += input[_in++] << bits; bits += 8; if (bits < op) { hold += input[_in++] << bits; bits += 8; } } dist += hold & ((1 << op) - 1); //#ifdef INFLATE_STRICT if (dist > dmax) { strm.msg = 'invalid distance too far back'; state.mode = BAD; break top; } //#endif hold >>>= op; bits -= op; //Tracevv((stderr, "inflate: distance %u\n", dist)); op = _out - beg; /* max distance in output */ if (dist > op) { /* see if copy from window */ op = dist - op; /* distance back in window */ if (op > whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; state.mode = BAD; break top; } // (!) This block is disabled in zlib defaults, // don't enable it for binary compatibility //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR // if (len <= op - whave) { // do { // output[_out++] = 0; // } while (--len); // continue top; // } // len -= op - whave; // do { // output[_out++] = 0; // } while (--op > whave); // if (op === 0) { // from = _out - dist; // do { // output[_out++] = output[from++]; // } while (--len); // continue top; // } //#endif } from = 0; // window index from_source = s_window; if (wnext === 0) { /* very common case */ from += wsize - op; if (op < len) { /* some from window */ len -= op; do { output[_out++] = s_window[from++]; } while (--op); from = _out - dist; /* rest from output */ from_source = output; } } else if (wnext < op) { /* wrap around window */ from += wsize + wnext - op; op -= wnext; if (op < len) { /* some from end of window */ len -= op; do { output[_out++] = s_window[from++]; } while (--op); from = 0; if (wnext < len) { /* some from start of window */ op = wnext; len -= op; do { output[_out++] = s_window[from++]; } while (--op); from = _out - dist; /* rest from output */ from_source = output; } } } else { /* contiguous in window */ from += wnext - op; if (op < len) { /* some from window */ len -= op; do { output[_out++] = s_window[from++]; } while (--op); from = _out - dist; /* rest from output */ from_source = output; } } while (len > 2) { output[_out++] = from_source[from++]; output[_out++] = from_source[from++]; output[_out++] = from_source[from++]; len -= 3; } if (len) { output[_out++] = from_source[from++]; if (len > 1) { output[_out++] = from_source[from++]; } } } else { from = _out - dist; /* copy direct from output */ do { /* minimum length is three */ output[_out++] = output[from++]; output[_out++] = output[from++]; output[_out++] = output[from++]; len -= 3; } while (len > 2); if (len) { output[_out++] = output[from++]; if (len > 1) { output[_out++] = output[from++]; } } } } else if ((op & 64) === 0) { /* 2nd level distance code */ here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; continue dodist; } else { strm.msg = 'invalid distance code'; state.mode = BAD; break top; } break; // need to emulate goto via "continue" } } else if ((op & 64) === 0) { /* 2nd level length code */ here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; continue dolen; } else if (op & 32) { /* end-of-block */ //Tracevv((stderr, "inflate: end of block\n")); state.mode = TYPE; break top; } else { strm.msg = 'invalid literal/length code'; state.mode = BAD; break top; } break; // need to emulate goto via "continue" } } while (_in < last && _out < end); /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ len = bits >> 3; _in -= len; bits -= len << 3; hold &= (1 << bits) - 1; /* update state and return */ strm.next_in = _in; strm.next_out = _out; strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last)); strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end)); state.hold = hold; state.bits = bits; return; }; },{}],11:[function(require,module,exports){ // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. var utils = require('../utils/common'); var adler32 = require('./adler32'); var crc32 = require('./crc32'); var inflate_fast = require('./inffast'); var inflate_table = require('./inftrees'); var CODES = 0; var LENS = 1; var DISTS = 2; /* Public constants ==========================================================*/ /* ===========================================================================*/ /* Allowed flush values; see deflate() and inflate() below for details */ //var Z_NO_FLUSH = 0; //var Z_PARTIAL_FLUSH = 1; //var Z_SYNC_FLUSH = 2; //var Z_FULL_FLUSH = 3; var Z_FINISH = 4; var Z_BLOCK = 5; var Z_TREES = 6; /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ var Z_OK = 0; var Z_STREAM_END = 1; var Z_NEED_DICT = 2; //var Z_ERRNO = -1; var Z_STREAM_ERROR = -2; var Z_DATA_ERROR = -3; var Z_MEM_ERROR = -4; var Z_BUF_ERROR = -5; //var Z_VERSION_ERROR = -6; /* The deflate compression method */ var Z_DEFLATED = 8; /* STATES ====================================================================*/ /* ===========================================================================*/ var HEAD = 1; /* i: waiting for magic header */ var FLAGS = 2; /* i: waiting for method and flags (gzip) */ var TIME = 3; /* i: waiting for modification time (gzip) */ var OS = 4; /* i: waiting for extra flags and operating system (gzip) */ var EXLEN = 5; /* i: waiting for extra length (gzip) */ var EXTRA = 6; /* i: waiting for extra bytes (gzip) */ var NAME = 7; /* i: waiting for end of file name (gzip) */ var COMMENT = 8; /* i: waiting for end of comment (gzip) */ var HCRC = 9; /* i: waiting for header crc (gzip) */ var DICTID = 10; /* i: waiting for dictionary check value */ var DICT = 11; /* waiting for inflateSetDictionary() call */ var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ var STORED = 14; /* i: waiting for stored size (length and complement) */ var COPY_ = 15; /* i/o: same as COPY below, but only first time in */ var COPY = 16; /* i/o: waiting for input or output to copy stored block */ var TABLE = 17; /* i: waiting for dynamic block table lengths */ var LENLENS = 18; /* i: waiting for code length code lengths */ var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */ var LEN_ = 20; /* i: same as LEN below, but only first time in */ var LEN = 21; /* i: waiting for length/lit/eob code */ var LENEXT = 22; /* i: waiting for length extra bits */ var DIST = 23; /* i: waiting for distance code */ var DISTEXT = 24; /* i: waiting for distance extra bits */ var MATCH = 25; /* o: waiting for output space to copy string */ var LIT = 26; /* o: waiting for output space to write literal */ var CHECK = 27; /* i: waiting for 32-bit check value */ var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ var DONE = 29; /* finished check, done -- remain here until reset */ var BAD = 30; /* got a data error -- remain here until reset */ var MEM = 31; /* got an inflate() memory error -- remain here until reset */ var SYNC = 32; /* looking for synchronization bytes to restart inflate() */ /* ===========================================================================*/ var ENOUGH_LENS = 852; var ENOUGH_DISTS = 592; //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); var MAX_WBITS = 15; /* 32K LZ77 window */ var DEF_WBITS = MAX_WBITS; function zswap32(q) { return (((q >>> 24) & 0xff) + ((q >>> 8) & 0xff00) + ((q & 0xff00) << 8) + ((q & 0xff) << 24)); } function InflateState() { this.mode = 0; /* current inflate mode */ this.last = false; /* true if processing last block */ this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ this.havedict = false; /* true if dictionary provided */ this.flags = 0; /* gzip header method and flags (0 if zlib) */ this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */ this.check = 0; /* protected copy of check value */ this.total = 0; /* protected copy of output count */ // TODO: may be {} this.head = null; /* where to save gzip header information */ /* sliding window */ this.wbits = 0; /* log base 2 of requested window size */ this.wsize = 0; /* window size or zero if not using window */ this.whave = 0; /* valid bytes in the window */ this.wnext = 0; /* window write index */ this.window = null; /* allocated sliding window, if needed */ /* bit accumulator */ this.hold = 0; /* input bit accumulator */ this.bits = 0; /* number of bits in "in" */ /* for string and stored block copying */ this.length = 0; /* literal or length of data to copy */ this.offset = 0; /* distance back to copy string from */ /* for table and code decoding */ this.extra = 0; /* extra bits needed */ /* fixed and dynamic code tables */ this.lencode = null; /* starting table for length/literal codes */ this.distcode = null; /* starting table for distance codes */ this.lenbits = 0; /* index bits for lencode */ this.distbits = 0; /* index bits for distcode */ /* dynamic table building */ this.ncode = 0; /* number of code length code lengths */ this.nlen = 0; /* number of length code lengths */ this.ndist = 0; /* number of distance code lengths */ this.have = 0; /* number of code lengths in lens[] */ this.next = null; /* next available space in codes[] */ this.lens = new utils.Buf16(320); /* temporary storage for code lengths */ this.work = new utils.Buf16(288); /* work area for code table building */ /* because we don't have pointers in js, we use lencode and distcode directly as buffers so we don't need codes */ //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */ this.distdyn = null; /* dynamic table for distance codes (JS specific) */ this.sane = 0; /* if false, allow invalid distance too far */ this.back = 0; /* bits back of last unprocessed length/lit */ this.was = 0; /* initial length of match */ } function inflateResetKeep(strm) { var state; if (!strm || !strm.state) { return Z_STREAM_ERROR; } state = strm.state; strm.total_in = strm.total_out = state.total = 0; strm.msg = ''; /*Z_NULL*/ if (state.wrap) { /* to support ill-conceived Java test suite */ strm.adler = state.wrap & 1; } state.mode = HEAD; state.last = 0; state.havedict = 0; state.dmax = 32768; state.head = null/*Z_NULL*/; state.hold = 0; state.bits = 0; //state.lencode = state.distcode = state.next = state.codes; state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); state.sane = 1; state.back = -1; //Tracev((stderr, "inflate: reset\n")); return Z_OK; } function inflateReset(strm) { var state; if (!strm || !strm.state) { return Z_STREAM_ERROR; } state = strm.state; state.wsize = 0; state.whave = 0; state.wnext = 0; return inflateResetKeep(strm); } function inflateReset2(strm, windowBits) { var wrap; var state; /* get the state */ if (!strm || !strm.state) { return Z_STREAM_ERROR; } state = strm.state; /* extract wrap request from windowBits parameter */ if (windowBits < 0) { wrap = 0; windowBits = -windowBits; } else { wrap = (windowBits >> 4) + 1; if (windowBits < 48) { windowBits &= 15; } } /* set number of window bits, free window if different */ if (windowBits && (windowBits < 8 || windowBits > 15)) { return Z_STREAM_ERROR; } if (state.window !== null && state.wbits !== windowBits) { state.window = null; } /* update state and reset the rest of it */ state.wrap = wrap; state.wbits = windowBits; return inflateReset(strm); } function inflateInit2(strm, windowBits) { var ret; var state; if (!strm) { return Z_STREAM_ERROR; } //strm.msg = Z_NULL; /* in case we return an error */ state = new InflateState(); //if (state === Z_NULL) return Z_MEM_ERROR; //Tracev((stderr, "inflate: allocated\n")); strm.state = state; state.window = null/*Z_NULL*/; ret = inflateReset2(strm, windowBits); if (ret !== Z_OK) { strm.state = null/*Z_NULL*/; } return ret; } function inflateInit(strm) { return inflateInit2(strm, DEF_WBITS); } /* Return state with length and distance decoding tables and index sizes set to fixed code decoding. Normally this returns fixed tables from inffixed.h. If BUILDFIXED is defined, then instead this routine builds the tables the first time it's called, and returns those tables the first time and thereafter. This reduces the size of the code by about 2K bytes, in exchange for a little execution time. However, BUILDFIXED should not be used for threaded applications, since the rewriting of the tables and virgin may not be thread-safe. */ var virgin = true; var lenfix, distfix; // We have no pointers in JS, so keep tables separate function fixedtables(state) { /* build fixed huffman tables if first call (may not be thread safe) */ if (virgin) { var sym; lenfix = new utils.Buf32(512); distfix = new utils.Buf32(32); /* literal/length table */ sym = 0; while (sym < 144) { state.lens[sym++] = 8; } while (sym < 256) { state.lens[sym++] = 9; } while (sym < 280) { state.lens[sym++] = 7; } while (sym < 288) { state.lens[sym++] = 8; } inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); /* distance table */ sym = 0; while (sym < 32) { state.lens[sym++] = 5; } inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); /* do this just once */ virgin = false; } state.lencode = lenfix; state.lenbits = 9; state.distcode = distfix; state.distbits = 5; } /* Update the window with the last wsize (normally 32K) bytes written before returning. If window does not exist yet, create it. This is only called when a window is already in use, or when output has been written during this inflate call, but the end of the deflate stream has not been reached yet. It is also called to create a window for dictionary data when a dictionary is loaded. Providing output buffers larger than 32K to inflate() should provide a speed advantage, since only the last 32K of output is copied to the sliding window upon return from inflate(), and since all distances after the first 32K of output will fall in the output data, making match copies simpler and faster. The advantage may be dependent on the size of the processor's data caches. */ function updatewindow(strm, src, end, copy) { var dist; var state = strm.state; /* if it hasn't been done already, allocate space for the window */ if (state.window === null) { state.wsize = 1 << state.wbits; state.wnext = 0; state.whave = 0; state.window = new utils.Buf8(state.wsize); } /* copy state->wsize or less output bytes into the circular window */ if (copy >= state.wsize) { utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); state.wnext = 0; state.whave = state.wsize; } else { dist = state.wsize - state.wnext; if (dist > copy) { dist = copy; } //zmemcpy(state->window + state->wnext, end - copy, dist); utils.arraySet(state.window, src, end - copy, dist, state.wnext); copy -= dist; if (copy) { //zmemcpy(state->window, end - copy, copy); utils.arraySet(state.window, src, end - copy, copy, 0); state.wnext = copy; state.whave = state.wsize; } else { state.wnext += dist; if (state.wnext === state.wsize) { state.wnext = 0; } if (state.whave < state.wsize) { state.whave += dist; } } } return 0; } function inflate(strm, flush) { var state; var input, output; // input/output buffers var next; /* next input INDEX */ var put; /* next output INDEX */ var have, left; /* available input and output */ var hold; /* bit buffer */ var bits; /* bits in bit buffer */ var _in, _out; /* save starting available input and output */ var copy; /* number of stored or match bytes to copy */ var from; /* where to copy match bytes from */ var from_source; var here = 0; /* current decoding table entry */ var here_bits, here_op, here_val; // paked "here" denormalized (JS specific) //var last; /* parent table entry */ var last_bits, last_op, last_val; // paked "last" denormalized (JS specific) var len; /* length to copy for repeats, bits to drop */ var ret; /* return code */ var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */ var opts; var n; // temporary var for NEED_BITS var order = /* permutation of code lengths */ [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]; if (!strm || !strm.state || !strm.output || (!strm.input && strm.avail_in !== 0)) { return Z_STREAM_ERROR; } state = strm.state; if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ //--- LOAD() --- put = strm.next_out; output = strm.output; left = strm.avail_out; next = strm.next_in; input = strm.input; have = strm.avail_in; hold = state.hold; bits = state.bits; //--- _in = have; _out = left; ret = Z_OK; inf_leave: // goto emulation for (;;) { switch (state.mode) { case HEAD: if (state.wrap === 0) { state.mode = TYPEDO; break; } //=== NEEDBITS(16); while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */ state.check = 0/*crc32(0L, Z_NULL, 0)*/; //=== CRC2(state.check, hold); hbuf[0] = hold & 0xff; hbuf[1] = (hold >>> 8) & 0xff; state.check = crc32(state.check, hbuf, 2, 0); //===// //=== INITBITS(); hold = 0; bits = 0; //===// state.mode = FLAGS; break; } state.flags = 0; /* expect zlib header */ if (state.head) { state.head.done = false; } if (!(state.wrap & 1) || /* check if zlib header allowed */ (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { strm.msg = 'incorrect header check'; state.mode = BAD; break; } if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { strm.msg = 'unknown compression method'; state.mode = BAD; break; } //--- DROPBITS(4) ---// hold >>>= 4; bits -= 4; //---// len = (hold & 0x0f)/*BITS(4)*/ + 8; if (state.wbits === 0) { state.wbits = len; } else if (len > state.wbits) { strm.msg = 'invalid window size'; state.mode = BAD; break; } state.dmax = 1 << len; //Tracev((stderr, "inflate: zlib header ok\n")); strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; state.mode = hold & 0x200 ? DICTID : TYPE; //=== INITBITS(); hold = 0; bits = 0; //===// break; case FLAGS: //=== NEEDBITS(16); */ while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// state.flags = hold; if ((state.flags & 0xff) !== Z_DEFLATED) { strm.msg = 'unknown compression method'; state.mode = BAD; break; } if (state.flags & 0xe000) { strm.msg = 'unknown header flags set'; state.mode = BAD; break; } if (state.head) { state.head.text = ((hold >> 8) & 1); } if (state.flags & 0x0200) { //=== CRC2(state.check, hold); hbuf[0] = hold & 0xff; hbuf[1] = (hold >>> 8) & 0xff; state.check = crc32(state.check, hbuf, 2, 0); //===// } //=== INITBITS(); hold = 0; bits = 0; //===// state.mode = TIME; /* falls through */ case TIME: //=== NEEDBITS(32); */ while (bits < 32) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// if (state.head) { state.head.time = hold; } if (state.flags & 0x0200) { //=== CRC4(state.check, hold) hbuf[0] = hold & 0xff; hbuf[1] = (hold >>> 8) & 0xff; hbuf[2] = (hold >>> 16) & 0xff; hbuf[3] = (hold >>> 24) & 0xff; state.check = crc32(state.check, hbuf, 4, 0); //=== } //=== INITBITS(); hold = 0; bits = 0; //===// state.mode = OS; /* falls through */ case OS: //=== NEEDBITS(16); */ while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// if (state.head) { state.head.xflags = (hold & 0xff); state.head.os = (hold >> 8); } if (state.flags & 0x0200) { //=== CRC2(state.check, hold); hbuf[0] = hold & 0xff; hbuf[1] = (hold >>> 8) & 0xff; state.check = crc32(state.check, hbuf, 2, 0); //===// } //=== INITBITS(); hold = 0; bits = 0; //===// state.mode = EXLEN; /* falls through */ case EXLEN: if (state.flags & 0x0400) { //=== NEEDBITS(16); */ while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// state.length = hold; if (state.head) { state.head.extra_len = hold; } if (state.flags & 0x0200) { //=== CRC2(state.check, hold); hbuf[0] = hold & 0xff; hbuf[1] = (hold >>> 8) & 0xff; state.check = crc32(state.check, hbuf, 2, 0); //===// } //=== INITBITS(); hold = 0; bits = 0; //===// } else if (state.head) { state.head.extra = null/*Z_NULL*/; } state.mode = EXTRA; /* falls through */ case EXTRA: if (state.flags & 0x0400) { copy = state.length; if (copy > have) { copy = have; } if (copy) { if (state.head) { len = state.head.extra_len - state.length; if (!state.head.extra) { // Use untyped array for more convenient processing later state.head.extra = new Array(state.head.extra_len); } utils.arraySet( state.head.extra, input, next, // extra field is limited to 65536 bytes // - no need for additional size check copy, /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ len ); //zmemcpy(state.head.extra + len, next, // len + copy > state.head.extra_max ? // state.head.extra_max - len : copy); } if (state.flags & 0x0200) { state.check = crc32(state.check, input, copy, next); } have -= copy; next += copy; state.length -= copy; } if (state.length) { break inf_leave; } } state.length = 0; state.mode = NAME; /* falls through */ case NAME: if (state.flags & 0x0800) { if (have === 0) { break inf_leave; } copy = 0; do { // TODO: 2 or 1 bytes? len = input[next + copy++]; /* use constant limit because in js we should not preallocate memory */ if (state.head && len && (state.length < 65536 /*state.head.name_max*/)) { state.head.name += String.fromCharCode(len); } } while (len && copy < have); if (state.flags & 0x0200) { state.check = crc32(state.check, input, copy, next); } have -= copy; next += copy; if (len) { break inf_leave; } } else if (state.head) { state.head.name = null; } state.length = 0; state.mode = COMMENT; /* falls through */ case COMMENT: if (state.flags & 0x1000) { if (have === 0) { break inf_leave; } copy = 0; do { len = input[next + copy++]; /* use constant limit because in js we should not preallocate memory */ if (state.head && len && (state.length < 65536 /*state.head.comm_max*/)) { state.head.comment += String.fromCharCode(len); } } while (len && copy < have); if (state.flags & 0x0200) { state.check = crc32(state.check, input, copy, next); } have -= copy; next += copy; if (len) { break inf_leave; } } else if (state.head) { state.head.comment = null; } state.mode = HCRC; /* falls through */ case HCRC: if (state.flags & 0x0200) { //=== NEEDBITS(16); */ while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// if (hold !== (state.check & 0xffff)) { strm.msg = 'header crc mismatch'; state.mode = BAD; break; } //=== INITBITS(); hold = 0; bits = 0; //===// } if (state.head) { state.head.hcrc = ((state.flags >> 9) & 1); state.head.done = true; } strm.adler = state.check = 0; state.mode = TYPE; break; case DICTID: //=== NEEDBITS(32); */ while (bits < 32) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// strm.adler = state.check = zswap32(hold); //=== INITBITS(); hold = 0; bits = 0; //===// state.mode = DICT; /* falls through */ case DICT: if (state.havedict === 0) { //--- RESTORE() --- strm.next_out = put; strm.avail_out = left; strm.next_in = next; strm.avail_in = have; state.hold = hold; state.bits = bits; //--- return Z_NEED_DICT; } strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; state.mode = TYPE; /* falls through */ case TYPE: if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } /* falls through */ case TYPEDO: if (state.last) { //--- BYTEBITS() ---// hold >>>= bits & 7; bits -= bits & 7; //---// state.mode = CHECK; break; } //=== NEEDBITS(3); */ while (bits < 3) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// state.last = (hold & 0x01)/*BITS(1)*/; //--- DROPBITS(1) ---// hold >>>= 1; bits -= 1; //---// switch ((hold & 0x03)/*BITS(2)*/) { case 0: /* stored block */ //Tracev((stderr, "inflate: stored block%s\n", // state.last ? " (last)" : "")); state.mode = STORED; break; case 1: /* fixed block */ fixedtables(state); //Tracev((stderr, "inflate: fixed codes block%s\n", // state.last ? " (last)" : "")); state.mode = LEN_; /* decode codes */ if (flush === Z_TREES) { //--- DROPBITS(2) ---// hold >>>= 2; bits -= 2; //---// break inf_leave; } break; case 2: /* dynamic block */ //Tracev((stderr, "inflate: dynamic codes block%s\n", // state.last ? " (last)" : "")); state.mode = TABLE; break; case 3: strm.msg = 'invalid block type'; state.mode = BAD; } //--- DROPBITS(2) ---// hold >>>= 2; bits -= 2; //---// break; case STORED: //--- BYTEBITS() ---// /* go to byte boundary */ hold >>>= bits & 7; bits -= bits & 7; //---// //=== NEEDBITS(32); */ while (bits < 32) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { strm.msg = 'invalid stored block lengths'; state.mode = BAD; break; } state.length = hold & 0xffff; //Tracev((stderr, "inflate: stored length %u\n", // state.length)); //=== INITBITS(); hold = 0; bits = 0; //===// state.mode = COPY_; if (flush === Z_TREES) { break inf_leave; } /* falls through */ case COPY_: state.mode = COPY; /* falls through */ case COPY: copy = state.length; if (copy) { if (copy > have) { copy = have; } if (copy > left) { copy = left; } if (copy === 0) { break inf_leave; } //--- zmemcpy(put, next, copy); --- utils.arraySet(output, input, next, copy, put); //---// have -= copy; next += copy; left -= copy; put += copy; state.length -= copy; break; } //Tracev((stderr, "inflate: stored end\n")); state.mode = TYPE; break; case TABLE: //=== NEEDBITS(14); */ while (bits < 14) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257; //--- DROPBITS(5) ---// hold >>>= 5; bits -= 5; //---// state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1; //--- DROPBITS(5) ---// hold >>>= 5; bits -= 5; //---// state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4; //--- DROPBITS(4) ---// hold >>>= 4; bits -= 4; //---// //#ifndef PKZIP_BUG_WORKAROUND if (state.nlen > 286 || state.ndist > 30) { strm.msg = 'too many length or distance symbols'; state.mode = BAD; break; } //#endif //Tracev((stderr, "inflate: table sizes ok\n")); state.have = 0; state.mode = LENLENS; /* falls through */ case LENLENS: while (state.have < state.ncode) { //=== NEEDBITS(3); while (bits < 3) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// state.lens[order[state.have++]] = (hold & 0x07);//BITS(3); //--- DROPBITS(3) ---// hold >>>= 3; bits -= 3; //---// } while (state.have < 19) { state.lens[order[state.have++]] = 0; } // We have separate tables & no pointers. 2 commented lines below not needed. //state.next = state.codes; //state.lencode = state.next; // Switch to use dynamic table state.lencode = state.lendyn; state.lenbits = 7; opts = { bits: state.lenbits }; ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); state.lenbits = opts.bits; if (ret) { strm.msg = 'invalid code lengths set'; state.mode = BAD; break; } //Tracev((stderr, "inflate: code lengths ok\n")); state.have = 0; state.mode = CODELENS; /* falls through */ case CODELENS: while (state.have < state.nlen + state.ndist) { for (;;) { here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/ here_bits = here >>> 24; here_op = (here >>> 16) & 0xff; here_val = here & 0xffff; if ((here_bits) <= bits) { break; } //--- PULLBYTE() ---// if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; //---// } if (here_val < 16) { //--- DROPBITS(here.bits) ---// hold >>>= here_bits; bits -= here_bits; //---// state.lens[state.have++] = here_val; } else { if (here_val === 16) { //=== NEEDBITS(here.bits + 2); n = here_bits + 2; while (bits < n) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// //--- DROPBITS(here.bits) ---// hold >>>= here_bits; bits -= here_bits; //---// if (state.have === 0) { strm.msg = 'invalid bit length repeat'; state.mode = BAD; break; } len = state.lens[state.have - 1]; copy = 3 + (hold & 0x03);//BITS(2); //--- DROPBITS(2) ---// hold >>>= 2; bits -= 2; //---// } else if (here_val === 17) { //=== NEEDBITS(here.bits + 3); n = here_bits + 3; while (bits < n) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// //--- DROPBITS(here.bits) ---// hold >>>= here_bits; bits -= here_bits; //---// len = 0; copy = 3 + (hold & 0x07);//BITS(3); //--- DROPBITS(3) ---// hold >>>= 3; bits -= 3; //---// } else { //=== NEEDBITS(here.bits + 7); n = here_bits + 7; while (bits < n) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// //--- DROPBITS(here.bits) ---// hold >>>= here_bits; bits -= here_bits; //---// len = 0; copy = 11 + (hold & 0x7f);//BITS(7); //--- DROPBITS(7) ---// hold >>>= 7; bits -= 7; //---// } if (state.have + copy > state.nlen + state.ndist) { strm.msg = 'invalid bit length repeat'; state.mode = BAD; break; } while (copy--) { state.lens[state.have++] = len; } } } /* handle error breaks in while */ if (state.mode === BAD) { break; } /* check for end-of-block code (better have one) */ if (state.lens[256] === 0) { strm.msg = 'invalid code -- missing end-of-block'; state.mode = BAD; break; } /* build code tables -- note: do not change the lenbits or distbits values here (9 and 6) without reading the comments in inftrees.h concerning the ENOUGH constants, which depend on those values */ state.lenbits = 9; opts = { bits: state.lenbits }; ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.lenbits = opts.bits; // state.lencode = state.next; if (ret) { strm.msg = 'invalid literal/lengths set'; state.mode = BAD; break; } state.distbits = 6; //state.distcode.copy(state.codes); // Switch to use dynamic table state.distcode = state.distdyn; opts = { bits: state.distbits }; ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.distbits = opts.bits; // state.distcode = state.next; if (ret) { strm.msg = 'invalid distances set'; state.mode = BAD; break; } //Tracev((stderr, 'inflate: codes ok\n')); state.mode = LEN_; if (flush === Z_TREES) { break inf_leave; } /* falls through */ case LEN_: state.mode = LEN; /* falls through */ case LEN: if (have >= 6 && left >= 258) { //--- RESTORE() --- strm.next_out = put; strm.avail_out = left; strm.next_in = next; strm.avail_in = have; state.hold = hold; state.bits = bits; //--- inflate_fast(strm, _out); //--- LOAD() --- put = strm.next_out; output = strm.output; left = strm.avail_out; next = strm.next_in; input = strm.input; have = strm.avail_in; hold = state.hold; bits = state.bits; //--- if (state.mode === TYPE) { state.back = -1; } break; } state.back = 0; for (;;) { here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/ here_bits = here >>> 24; here_op = (here >>> 16) & 0xff; here_val = here & 0xffff; if (here_bits <= bits) { break; } //--- PULLBYTE() ---// if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; //---// } if (here_op && (here_op & 0xf0) === 0) { last_bits = here_bits; last_op = here_op; last_val = here_val; for (;;) { here = state.lencode[last_val + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; here_bits = here >>> 24; here_op = (here >>> 16) & 0xff; here_val = here & 0xffff; if ((last_bits + here_bits) <= bits) { break; } //--- PULLBYTE() ---// if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; //---// } //--- DROPBITS(last.bits) ---// hold >>>= last_bits; bits -= last_bits; //---// state.back += last_bits; } //--- DROPBITS(here.bits) ---// hold >>>= here_bits; bits -= here_bits; //---// state.back += here_bits; state.length = here_val; if (here_op === 0) { //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? // "inflate: literal '%c'\n" : // "inflate: literal 0x%02x\n", here.val)); state.mode = LIT; break; } if (here_op & 32) { //Tracevv((stderr, "inflate: end of block\n")); state.back = -1; state.mode = TYPE; break; } if (here_op & 64) { strm.msg = 'invalid literal/length code'; state.mode = BAD; break; } state.extra = here_op & 15; state.mode = LENEXT; /* falls through */ case LENEXT: if (state.extra) { //=== NEEDBITS(state.extra); n = state.extra; while (bits < n) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; //--- DROPBITS(state.extra) ---// hold >>>= state.extra; bits -= state.extra; //---// state.back += state.extra; } //Tracevv((stderr, "inflate: length %u\n", state.length)); state.was = state.length; state.mode = DIST; /* falls through */ case DIST: for (;;) { here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/ here_bits = here >>> 24; here_op = (here >>> 16) & 0xff; here_val = here & 0xffff; if ((here_bits) <= bits) { break; } //--- PULLBYTE() ---// if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; //---// } if ((here_op & 0xf0) === 0) { last_bits = here_bits; last_op = here_op; last_val = here_val; for (;;) { here = state.distcode[last_val + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; here_bits = here >>> 24; here_op = (here >>> 16) & 0xff; here_val = here & 0xffff; if ((last_bits + here_bits) <= bits) { break; } //--- PULLBYTE() ---// if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; //---// } //--- DROPBITS(last.bits) ---// hold >>>= last_bits; bits -= last_bits; //---// state.back += last_bits; } //--- DROPBITS(here.bits) ---// hold >>>= here_bits; bits -= here_bits; //---// state.back += here_bits; if (here_op & 64) { strm.msg = 'invalid distance code'; state.mode = BAD; break; } state.offset = here_val; state.extra = (here_op) & 15; state.mode = DISTEXT; /* falls through */ case DISTEXT: if (state.extra) { //=== NEEDBITS(state.extra); n = state.extra; while (bits < n) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; //--- DROPBITS(state.extra) ---// hold >>>= state.extra; bits -= state.extra; //---// state.back += state.extra; } //#ifdef INFLATE_STRICT if (state.offset > state.dmax) { strm.msg = 'invalid distance too far back'; state.mode = BAD; break; } //#endif //Tracevv((stderr, "inflate: distance %u\n", state.offset)); state.mode = MATCH; /* falls through */ case MATCH: if (left === 0) { break inf_leave; } copy = _out - left; if (state.offset > copy) { /* copy from window */ copy = state.offset - copy; if (copy > state.whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; state.mode = BAD; break; } // (!) This block is disabled in zlib defaults, // don't enable it for binary compatibility //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR // Trace((stderr, "inflate.c too far\n")); // copy -= state.whave; // if (copy > state.length) { copy = state.length; } // if (copy > left) { copy = left; } // left -= copy; // state.length -= copy; // do { // output[put++] = 0; // } while (--copy); // if (state.length === 0) { state.mode = LEN; } // break; //#endif } if (copy > state.wnext) { copy -= state.wnext; from = state.wsize - copy; } else { from = state.wnext - copy; } if (copy > state.length) { copy = state.length; } from_source = state.window; } else { /* copy from output */ from_source = output; from = put - state.offset; copy = state.length; } if (copy > left) { copy = left; } left -= copy; state.length -= copy; do { output[put++] = from_source[from++]; } while (--copy); if (state.length === 0) { state.mode = LEN; } break; case LIT: if (left === 0) { break inf_leave; } output[put++] = state.length; left--; state.mode = LEN; break; case CHECK: if (state.wrap) { //=== NEEDBITS(32); while (bits < 32) { if (have === 0) { break inf_leave; } have--; // Use '|' instead of '+' to make sure that result is signed hold |= input[next++] << bits; bits += 8; } //===// _out -= left; strm.total_out += _out; state.total += _out; if (_out) { strm.adler = state.check = /*UPDATE(state.check, put - _out, _out);*/ (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out)); } _out = left; // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too if ((state.flags ? hold : zswap32(hold)) !== state.check) { strm.msg = 'incorrect data check'; state.mode = BAD; break; } //=== INITBITS(); hold = 0; bits = 0; //===// //Tracev((stderr, "inflate: check matches trailer\n")); } state.mode = LENGTH; /* falls through */ case LENGTH: if (state.wrap && state.flags) { //=== NEEDBITS(32); while (bits < 32) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } //===// if (hold !== (state.total & 0xffffffff)) { strm.msg = 'incorrect length check'; state.mode = BAD; break; } //=== INITBITS(); hold = 0; bits = 0; //===// //Tracev((stderr, "inflate: length matches trailer\n")); } state.mode = DONE; /* falls through */ case DONE: ret = Z_STREAM_END; break inf_leave; case BAD: ret = Z_DATA_ERROR; break inf_leave; case MEM: return Z_MEM_ERROR; case SYNC: /* falls through */ default: return Z_STREAM_ERROR; } } // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" /* Return from inflate(), updating the total counts and the check value. If there was no progress during the inflate() call, return a buffer error. Call updatewindow() to create and/or update the window state. Note: a memory error from inflate() is non-recoverable. */ //--- RESTORE() --- strm.next_out = put; strm.avail_out = left; strm.next_in = next; strm.avail_in = have; state.hold = hold; state.bits = bits; //--- if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH))) { if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) ; } _in -= strm.avail_in; _out -= strm.avail_out; strm.total_in += _in; strm.total_out += _out; state.total += _out; if (state.wrap && _out) { strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out)); } strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { ret = Z_BUF_ERROR; } return ret; } function inflateEnd(strm) { if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) { return Z_STREAM_ERROR; } var state = strm.state; if (state.window) { state.window = null; } strm.state = null; return Z_OK; } function inflateGetHeader(strm, head) { var state; /* check state */ if (!strm || !strm.state) { return Z_STREAM_ERROR; } state = strm.state; if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } /* save header structure */ state.head = head; head.done = false; return Z_OK; } function inflateSetDictionary(strm, dictionary) { var dictLength = dictionary.length; var state; var dictid; var ret; /* check state */ if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; } state = strm.state; if (state.wrap !== 0 && state.mode !== DICT) { return Z_STREAM_ERROR; } /* check for correct dictionary identifier */ if (state.mode === DICT) { dictid = 1; /* adler32(0, null, 0)*/ /* dictid = adler32(dictid, dictionary, dictLength); */ dictid = adler32(dictid, dictionary, dictLength, 0); if (dictid !== state.check) { return Z_DATA_ERROR; } } /* copy dictionary to window using updatewindow(), which will amend the existing dictionary if appropriate */ ret = updatewindow(strm, dictionary, dictLength, dictLength); if (ret) { state.mode = MEM; return Z_MEM_ERROR; } state.havedict = 1; // Tracev((stderr, "inflate: dictionary set\n")); return Z_OK; } exports.inflateReset = inflateReset; exports.inflateReset2 = inflateReset2; exports.inflateResetKeep = inflateResetKeep; exports.inflateInit = inflateInit; exports.inflateInit2 = inflateInit2; exports.inflate = inflate; exports.inflateEnd = inflateEnd; exports.inflateGetHeader = inflateGetHeader; exports.inflateSetDictionary = inflateSetDictionary; exports.inflateInfo = 'pako inflate (from Nodeca project)'; /* Not implemented exports.inflateCopy = inflateCopy; exports.inflateGetDictionary = inflateGetDictionary; exports.inflateMark = inflateMark; exports.inflatePrime = inflatePrime; exports.inflateSync = inflateSync; exports.inflateSyncPoint = inflateSyncPoint; exports.inflateUndermine = inflateUndermine; */ },{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(require,module,exports){ // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. var utils = require('../utils/common'); var MAXBITS = 15; var ENOUGH_LENS = 852; var ENOUGH_DISTS = 592; //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); var CODES = 0; var LENS = 1; var DISTS = 2; var lbase = [ /* Length codes 257..285 base */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 ]; var lext = [ /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 ]; var dbase = [ /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0 ]; var dext = [ /* Distance codes 0..29 extra */ 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64 ]; module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) { var bits = opts.bits; //here = opts.here; /* table entry for duplication */ var len = 0; /* a code's length in bits */ var sym = 0; /* index of code symbols */ var min = 0, max = 0; /* minimum and maximum code lengths */ var root = 0; /* number of index bits for root table */ var curr = 0; /* number of index bits for current table */ var drop = 0; /* code bits to drop for sub-table */ var left = 0; /* number of prefix codes available */ var used = 0; /* code entries in table used */ var huff = 0; /* Huffman code */ var incr; /* for incrementing code, index */ var fill; /* index for replicating entries */ var low; /* low bits for current root entry */ var mask; /* mask for low root bits */ var next; /* next available space in table */ var base = null; /* base value table to use */ var base_index = 0; // var shoextra; /* extra bits table to use */ var end; /* use base and extra for symbol > end */ var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */ var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */ var extra = null; var extra_index = 0; var here_bits, here_op, here_val; /* Process a set of code lengths to create a canonical Huffman code. The code lengths are lens[0..codes-1]. Each length corresponds to the symbols 0..codes-1. The Huffman code is generated by first sorting the symbols by length from short to long, and retaining the symbol order for codes with equal lengths. Then the code starts with all zero bits for the first code of the shortest length, and the codes are integer increments for the same length, and zeros are appended as the length increases. For the deflate format, these bits are stored backwards from their more natural integer increment ordering, and so when the decoding tables are built in the large loop below, the integer codes are incremented backwards. This routine assumes, but does not check, that all of the entries in lens[] are in the range 0..MAXBITS. The caller must assure this. 1..MAXBITS is interpreted as that code length. zero means that that symbol does not occur in this code. The codes are sorted by computing a count of codes for each length, creating from that a table of starting indices for each length in the sorted table, and then entering the symbols in order in the sorted table. The sorted table is work[], with that space being provided by the caller. The length counts are used for other purposes as well, i.e. finding the minimum and maximum length codes, determining if there are any codes at all, checking for a valid set of lengths, and looking ahead at length counts to determine sub-table sizes when building the decoding tables. */ /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ for (len = 0; len <= MAXBITS; len++) { count[len] = 0; } for (sym = 0; sym < codes; sym++) { count[lens[lens_index + sym]]++; } /* bound code lengths, force root to be within code lengths */ root = bits; for (max = MAXBITS; max >= 1; max--) { if (count[max] !== 0) { break; } } if (root > max) { root = max; } if (max === 0) { /* no symbols to code at all */ //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ //table.bits[opts.table_index] = 1; //here.bits = (var char)1; //table.val[opts.table_index++] = 0; //here.val = (var short)0; table[table_index++] = (1 << 24) | (64 << 16) | 0; //table.op[opts.table_index] = 64; //table.bits[opts.table_index] = 1; //table.val[opts.table_index++] = 0; table[table_index++] = (1 << 24) | (64 << 16) | 0; opts.bits = 1; return 0; /* no symbols, but wait for decoding to report error */ } for (min = 1; min < max; min++) { if (count[min] !== 0) { break; } } if (root < min) { root = min; } /* check for an over-subscribed or incomplete set of lengths */ left = 1; for (len = 1; len <= MAXBITS; len++) { left <<= 1; left -= count[len]; if (left < 0) { return -1; } /* over-subscribed */ } if (left > 0 && (type === CODES || max !== 1)) { return -1; /* incomplete set */ } /* generate offsets into symbol table for each length for sorting */ offs[1] = 0; for (len = 1; len < MAXBITS; len++) { offs[len + 1] = offs[len] + count[len]; } /* sort symbols by length, by symbol order within each length */ for (sym = 0; sym < codes; sym++) { if (lens[lens_index + sym] !== 0) { work[offs[lens[lens_index + sym]]++] = sym; } } /* Create and fill in decoding tables. In this loop, the table being filled is at next and has curr index bits. The code being used is huff with length len. That code is converted to an index by dropping drop bits off of the bottom. For codes where len is less than drop + curr, those top drop + curr - len bits are incremented through all values to fill the table with replicated entries. root is the number of index bits for the root table. When len exceeds root, sub-tables are created pointed to by the root entry with an index of the low root bits of huff. This is saved in low to check for when a new sub-table should be started. drop is zero when the root table is being filled, and drop is root when sub-tables are being filled. When a new sub-table is needed, it is necessary to look ahead in the code lengths to determine what size sub-table is needed. The length counts are used for this, and so count[] is decremented as codes are entered in the tables. used keeps track of how many table entries have been allocated from the provided *table space. It is checked for LENS and DIST tables against the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in the initial root table size constants. See the comments in inftrees.h for more information. sym increments through all symbols, and the loop terminates when all codes of length max, i.e. all codes, have been processed. This routine permits incomplete codes, so another loop after this one fills in the rest of the decoding tables with invalid code markers. */ /* set up for code type */ // poor man optimization - use if-else instead of switch, // to avoid deopts in old v8 if (type === CODES) { base = extra = work; /* dummy value--not used */ end = 19; } else if (type === LENS) { base = lbase; base_index -= 257; extra = lext; extra_index -= 257; end = 256; } else { /* DISTS */ base = dbase; extra = dext; end = -1; } /* initialize opts for loop */ huff = 0; /* starting code */ sym = 0; /* starting code symbol */ len = min; /* starting code length */ next = table_index; /* current table to fill in */ curr = root; /* current table index bits */ drop = 0; /* current bits to drop from code for index */ low = -1; /* trigger new sub-table when len > root */ used = 1 << root; /* use root table entries */ mask = used - 1; /* mask for comparing low */ /* check available table space */ if ((type === LENS && used > ENOUGH_LENS) || (type === DISTS && used > ENOUGH_DISTS)) { return 1; } /* process all codes and make table entries */ for (;;) { /* create table entry */ here_bits = len - drop; if (work[sym] < end) { here_op = 0; here_val = work[sym]; } else if (work[sym] > end) { here_op = extra[extra_index + work[sym]]; here_val = base[base_index + work[sym]]; } else { here_op = 32 + 64; /* end of block */ here_val = 0; } /* replicate for those indices with low len bits equal to huff */ incr = 1 << (len - drop); fill = 1 << curr; min = fill; /* save offset to next table */ do { fill -= incr; table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0; } while (fill !== 0); /* backwards increment the len-bit code huff */ incr = 1 << (len - 1); while (huff & incr) { incr >>= 1; } if (incr !== 0) { huff &= incr - 1; huff += incr; } else { huff = 0; } /* go to next symbol, update count, len */ sym++; if (--count[len] === 0) { if (len === max) { break; } len = lens[lens_index + work[sym]]; } /* create new sub-table if needed */ if (len > root && (huff & mask) !== low) { /* if first time, transition to sub-tables */ if (drop === 0) { drop = root; } /* increment past last table */ next += min; /* here min is 1 << curr */ /* determine length of next table */ curr = len - drop; left = 1 << curr; while (curr + drop < max) { left -= count[curr + drop]; if (left <= 0) { break; } curr++; left <<= 1; } /* check for enough space */ used += 1 << curr; if ((type === LENS && used > ENOUGH_LENS) || (type === DISTS && used > ENOUGH_DISTS)) { return 1; } /* point entry in root table to sub-table */ low = huff & mask; /*table.op[low] = curr; table.bits[low] = root; table.val[low] = next - opts.table_index;*/ table[low] = (root << 24) | (curr << 16) | (next - table_index) |0; } } /* fill in remaining table entry if code is incomplete (guaranteed to have at most one remaining entry, since if the code is incomplete, the maximum code length that was allowed to get this far is one bit) */ if (huff !== 0) { //table.op[next + huff] = 64; /* invalid code marker */ //table.bits[next + huff] = len - drop; //table.val[next + huff] = 0; table[next + huff] = ((len - drop) << 24) | (64 << 16) |0; } /* set return parameters */ //opts.table_index += used; opts.bits = root; return 0; }; },{"../utils/common":3}],13:[function(require,module,exports){ // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. module.exports = { 2: 'need dictionary', /* Z_NEED_DICT 2 */ 1: 'stream end', /* Z_STREAM_END 1 */ 0: '', /* Z_OK 0 */ '-1': 'file error', /* Z_ERRNO (-1) */ '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ '-3': 'data error', /* Z_DATA_ERROR (-3) */ '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ }; },{}],14:[function(require,module,exports){ // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. /* eslint-disable space-unary-ops */ var utils = require('../utils/common'); /* Public constants ==========================================================*/ /* ===========================================================================*/ //var Z_FILTERED = 1; //var Z_HUFFMAN_ONLY = 2; //var Z_RLE = 3; var Z_FIXED = 4; //var Z_DEFAULT_STRATEGY = 0; /* Possible values of the data_type field (though see inflate()) */ var Z_BINARY = 0; var Z_TEXT = 1; //var Z_ASCII = 1; // = Z_TEXT var Z_UNKNOWN = 2; /*============================================================================*/ function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } // From zutil.h var STORED_BLOCK = 0; var STATIC_TREES = 1; var DYN_TREES = 2; /* The three kinds of block type */ var MIN_MATCH = 3; var MAX_MATCH = 258; /* The minimum and maximum match lengths */ // From deflate.h /* =========================================================================== * Internal compression state. */ var LENGTH_CODES = 29; /* number of length codes, not counting the special END_BLOCK code */ var LITERALS = 256; /* number of literal bytes 0..255 */ var L_CODES = LITERALS + 1 + LENGTH_CODES; /* number of Literal or Length codes, including the END_BLOCK code */ var D_CODES = 30; /* number of distance codes */ var BL_CODES = 19; /* number of codes used to transfer the bit lengths */ var HEAP_SIZE = 2 * L_CODES + 1; /* maximum heap size */ var MAX_BITS = 15; /* All codes must not exceed MAX_BITS bits */ var Buf_size = 16; /* size of bit buffer in bi_buf */ /* =========================================================================== * Constants */ var MAX_BL_BITS = 7; /* Bit length codes must not exceed MAX_BL_BITS bits */ var END_BLOCK = 256; /* end of block literal code */ var REP_3_6 = 16; /* repeat previous bit length 3-6 times (2 bits of repeat count) */ var REPZ_3_10 = 17; /* repeat a zero length 3-10 times (3 bits of repeat count) */ var REPZ_11_138 = 18; /* repeat a zero length 11-138 times (7 bits of repeat count) */ /* eslint-disable comma-spacing,array-bracket-spacing */ var extra_lbits = /* extra bits for each length code */ [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]; var extra_dbits = /* extra bits for each distance code */ [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]; var extra_blbits = /* extra bits for each bit length code */ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]; var bl_order = [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]; /* eslint-enable comma-spacing,array-bracket-spacing */ /* The lengths of the bit length codes are sent in order of decreasing * probability, to avoid transmitting the lengths for unused bit length codes. */ /* =========================================================================== * Local data. These are initialized only once. */ // We pre-fill arrays with 0 to avoid uninitialized gaps var DIST_CODE_LEN = 512; /* see definition of array dist_code below */ // !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 var static_ltree = new Array((L_CODES + 2) * 2); zero(static_ltree); /* The static literal tree. Since the bit lengths are imposed, there is no * need for the L_CODES extra codes used during heap construction. However * The codes 286 and 287 are needed to build a canonical tree (see _tr_init * below). */ var static_dtree = new Array(D_CODES * 2); zero(static_dtree); /* The static distance tree. (Actually a trivial tree since all codes use * 5 bits.) */ var _dist_code = new Array(DIST_CODE_LEN); zero(_dist_code); /* Distance codes. The first 256 values correspond to the distances * 3 .. 258, the last 256 values correspond to the top 8 bits of * the 15 bit distances. */ var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); zero(_length_code); /* length code for each normalized match length (0 == MIN_MATCH) */ var base_length = new Array(LENGTH_CODES); zero(base_length); /* First normalized length for each code (0 = MIN_MATCH) */ var base_dist = new Array(D_CODES); zero(base_dist); /* First normalized distance for each code (0 = distance of 1) */ function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { this.static_tree = static_tree; /* static tree or NULL */ this.extra_bits = extra_bits; /* extra bits for each code or NULL */ this.extra_base = extra_base; /* base index for extra_bits */ this.elems = elems; /* max number of elements in the tree */ this.max_length = max_length; /* max bit length for the codes */ // show if `static_tree` has data or dummy - needed for monomorphic objects this.has_stree = static_tree && static_tree.length; } var static_l_desc; var static_d_desc; var static_bl_desc; function TreeDesc(dyn_tree, stat_desc) { this.dyn_tree = dyn_tree; /* the dynamic tree */ this.max_code = 0; /* largest code with non zero frequency */ this.stat_desc = stat_desc; /* the corresponding static tree */ } function d_code(dist) { return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; } /* =========================================================================== * Output a short LSB first on the stream. * IN assertion: there is enough room in pendingBuf. */ function put_short(s, w) { // put_byte(s, (uch)((w) & 0xff)); // put_byte(s, (uch)((ush)(w) >> 8)); s.pending_buf[s.pending++] = (w) & 0xff; s.pending_buf[s.pending++] = (w >>> 8) & 0xff; } /* =========================================================================== * Send a value on a given number of bits. * IN assertion: length <= 16 and value fits in length bits. */ function send_bits(s, value, length) { if (s.bi_valid > (Buf_size - length)) { s.bi_buf |= (value << s.bi_valid) & 0xffff; put_short(s, s.bi_buf); s.bi_buf = value >> (Buf_size - s.bi_valid); s.bi_valid += length - Buf_size; } else { s.bi_buf |= (value << s.bi_valid) & 0xffff; s.bi_valid += length; } } function send_code(s, c, tree) { send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/); } /* =========================================================================== * Reverse the first len bits of a code, using straightforward code (a faster * method would use a table) * IN assertion: 1 <= len <= 15 */ function bi_reverse(code, len) { var res = 0; do { res |= code & 1; code >>>= 1; res <<= 1; } while (--len > 0); return res >>> 1; } /* =========================================================================== * Flush the bit buffer, keeping at most 7 bits in it. */ function bi_flush(s) { if (s.bi_valid === 16) { put_short(s, s.bi_buf); s.bi_buf = 0; s.bi_valid = 0; } else if (s.bi_valid >= 8) { s.pending_buf[s.pending++] = s.bi_buf & 0xff; s.bi_buf >>= 8; s.bi_valid -= 8; } } /* =========================================================================== * Compute the optimal bit lengths for a tree and update the total bit length * for the current block. * IN assertion: the fields freq and dad are set, heap[heap_max] and * above are the tree nodes sorted by increasing frequency. * OUT assertions: the field len is set to the optimal bit length, the * array bl_count contains the frequencies for each bit length. * The length opt_len is updated; static_len is also updated if stree is * not null. */ function gen_bitlen(s, desc) // deflate_state *s; // tree_desc *desc; /* the tree descriptor */ { var tree = desc.dyn_tree; var max_code = desc.max_code; var stree = desc.stat_desc.static_tree; var has_stree = desc.stat_desc.has_stree; var extra = desc.stat_desc.extra_bits; var base = desc.stat_desc.extra_base; var max_length = desc.stat_desc.max_length; var h; /* heap index */ var n, m; /* iterate over the tree elements */ var bits; /* bit length */ var xbits; /* extra bits */ var f; /* frequency */ var overflow = 0; /* number of elements with bit length too large */ for (bits = 0; bits <= MAX_BITS; bits++) { s.bl_count[bits] = 0; } /* In a first pass, compute the optimal bit lengths (which may * overflow in the case of the bit length tree). */ tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { n = s.heap[h]; bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; if (bits > max_length) { bits = max_length; overflow++; } tree[n * 2 + 1]/*.Len*/ = bits; /* We overwrite tree[n].Dad which is no longer needed */ if (n > max_code) { continue; } /* not a leaf node */ s.bl_count[bits]++; xbits = 0; if (n >= base) { xbits = extra[n - base]; } f = tree[n * 2]/*.Freq*/; s.opt_len += f * (bits + xbits); if (has_stree) { s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits); } } if (overflow === 0) { return; } // Trace((stderr,"\nbit length overflow\n")); /* This happens for example on obj2 and pic of the Calgary corpus */ /* Find the first bit length which could increase: */ do { bits = max_length - 1; while (s.bl_count[bits] === 0) { bits--; } s.bl_count[bits]--; /* move one leaf down the tree */ s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */ s.bl_count[max_length]--; /* The brother of the overflow item also moves one step up, * but this does not affect bl_count[max_length] */ overflow -= 2; } while (overflow > 0); /* Now recompute all bit lengths, scanning in increasing frequency. * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all * lengths instead of fixing only the wrong ones. This idea is taken * from 'ar' written by Haruhiko Okumura.) */ for (bits = max_length; bits !== 0; bits--) { n = s.bl_count[bits]; while (n !== 0) { m = s.heap[--h]; if (m > max_code) { continue; } if (tree[m * 2 + 1]/*.Len*/ !== bits) { // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/; tree[m * 2 + 1]/*.Len*/ = bits; } n--; } } } /* =========================================================================== * Generate the codes for a given tree and bit counts (which need not be * optimal). * IN assertion: the array bl_count contains the bit length statistics for * the given tree and the field len is set for all tree elements. * OUT assertion: the field code is set for all tree elements of non * zero code length. */ function gen_codes(tree, max_code, bl_count) // ct_data *tree; /* the tree to decorate */ // int max_code; /* largest code with non zero frequency */ // ushf *bl_count; /* number of codes at each bit length */ { var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ var code = 0; /* running code value */ var bits; /* bit index */ var n; /* code index */ /* The distribution counts are first used to generate the code values * without bit reversal. */ for (bits = 1; bits <= MAX_BITS; bits++) { next_code[bits] = code = (code + bl_count[bits - 1]) << 1; } /* Check that the bit counts in bl_count are consistent. The last code * must be all ones. */ //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */ length = 0; for (code = 0; code < LENGTH_CODES - 1; code++) { base_length[code] = length; for (n = 0; n < (1 << extra_lbits[code]); n++) { _length_code[length++] = code; } } //Assert (length == 256, "tr_static_init: length != 256"); /* Note that the length 255 (match length 258) can be represented * in two different ways: code 284 + 5 bits or code 285, so we * overwrite length_code[255] to use the best encoding: */ _length_code[length - 1] = code; /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ dist = 0; for (code = 0; code < 16; code++) { base_dist[code] = dist; for (n = 0; n < (1 << extra_dbits[code]); n++) { _dist_code[dist++] = code; } } //Assert (dist == 256, "tr_static_init: dist != 256"); dist >>= 7; /* from now on, all distances are divided by 128 */ for (; code < D_CODES; code++) { base_dist[code] = dist << 7; for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { _dist_code[256 + dist++] = code; } } //Assert (dist == 256, "tr_static_init: 256+dist != 512"); /* Construct the codes of the static literal tree */ for (bits = 0; bits <= MAX_BITS; bits++) { bl_count[bits] = 0; } n = 0; while (n <= 143) { static_ltree[n * 2 + 1]/*.Len*/ = 8; n++; bl_count[8]++; } while (n <= 255) { static_ltree[n * 2 + 1]/*.Len*/ = 9; n++; bl_count[9]++; } while (n <= 279) { static_ltree[n * 2 + 1]/*.Len*/ = 7; n++; bl_count[7]++; } while (n <= 287) { static_ltree[n * 2 + 1]/*.Len*/ = 8; n++; bl_count[8]++; } /* Codes 286 and 287 do not exist, but we must include them in the * tree construction to get a canonical Huffman tree (longest code * all ones) */ gen_codes(static_ltree, L_CODES + 1, bl_count); /* The static distance tree is trivial: */ for (n = 0; n < D_CODES; n++) { static_dtree[n * 2 + 1]/*.Len*/ = 5; static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); } // Now data ready and we can init static trees static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); //static_init_done = true; } /* =========================================================================== * Initialize a new block. */ function init_block(s) { var n; /* iterates over tree elements */ /* Initialize the trees. */ for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; s.opt_len = s.static_len = 0; s.last_lit = s.matches = 0; } /* =========================================================================== * Flush the bit buffer and align the output on a byte boundary */ function bi_windup(s) { if (s.bi_valid > 8) { put_short(s, s.bi_buf); } else if (s.bi_valid > 0) { //put_byte(s, (Byte)s->bi_buf); s.pending_buf[s.pending++] = s.bi_buf; } s.bi_buf = 0; s.bi_valid = 0; } /* =========================================================================== * Copy a stored block, storing first the length and its * one's complement if requested. */ function copy_block(s, buf, len, header) //DeflateState *s; //charf *buf; /* the input data */ //unsigned len; /* its length */ //int header; /* true if block header must be written */ { bi_windup(s); /* align on byte boundary */ if (header) { put_short(s, len); put_short(s, ~len); } // while (len--) { // put_byte(s, *buf++); // } utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); s.pending += len; } /* =========================================================================== * Compares to subtrees, using the tree depth as tie breaker when * the subtrees have equal frequency. This minimizes the worst case length. */ function smaller(tree, n, m, depth) { var _n2 = n * 2; var _m2 = m * 2; return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ || (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m])); } /* =========================================================================== * Restore the heap property by moving down the tree starting at node k, * exchanging a node with the smallest of its two sons if necessary, stopping * when the heap property is re-established (each father smaller than its * two sons). */ function pqdownheap(s, tree, k) // deflate_state *s; // ct_data *tree; /* the tree to restore */ // int k; /* node to move down */ { var v = s.heap[k]; var j = k << 1; /* left son of k */ while (j <= s.heap_len) { /* Set j to the smallest of the two sons: */ if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { j++; } /* Exit if v is smaller than both sons */ if (smaller(tree, v, s.heap[j], s.depth)) { break; } /* Exchange v with the smallest son */ s.heap[k] = s.heap[j]; k = j; /* And continue down the tree, setting j to the left son of k */ j <<= 1; } s.heap[k] = v; } // inlined manually // var SMALLEST = 1; /* =========================================================================== * Send the block data compressed using the given Huffman trees */ function compress_block(s, ltree, dtree) // deflate_state *s; // const ct_data *ltree; /* literal tree */ // const ct_data *dtree; /* distance tree */ { var dist; /* distance of matched string */ var lc; /* match length or unmatched char (if dist == 0) */ var lx = 0; /* running index in l_buf */ var code; /* the code to send */ var extra; /* number of extra bits to send */ if (s.last_lit !== 0) { do { dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]); lc = s.pending_buf[s.l_buf + lx]; lx++; if (dist === 0) { send_code(s, lc, ltree); /* send a literal byte */ //Tracecv(isgraph(lc), (stderr," '%c' ", lc)); } else { /* Here, lc is the match length - MIN_MATCH */ code = _length_code[lc]; send_code(s, code + LITERALS + 1, ltree); /* send the length code */ extra = extra_lbits[code]; if (extra !== 0) { lc -= base_length[code]; send_bits(s, lc, extra); /* send the extra length bits */ } dist--; /* dist is now the match distance - 1 */ code = d_code(dist); //Assert (code < D_CODES, "bad d_code"); send_code(s, code, dtree); /* send the distance code */ extra = extra_dbits[code]; if (extra !== 0) { dist -= base_dist[code]; send_bits(s, dist, extra); /* send the extra distance bits */ } } /* literal or match pair ? */ /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, // "pendingBuf overflow"); } while (lx < s.last_lit); } send_code(s, END_BLOCK, ltree); } /* =========================================================================== * Construct one Huffman tree and assigns the code bit strings and lengths. * Update the total bit length for the current block. * IN assertion: the field freq is set for all tree elements. * OUT assertions: the fields len and code are set to the optimal bit length * and corresponding code. The length opt_len is updated; static_len is * also updated if stree is not null. The field max_code is set. */ function build_tree(s, desc) // deflate_state *s; // tree_desc *desc; /* the tree descriptor */ { var tree = desc.dyn_tree; var stree = desc.stat_desc.static_tree; var has_stree = desc.stat_desc.has_stree; var elems = desc.stat_desc.elems; var n, m; /* iterate over heap elements */ var max_code = -1; /* largest code with non zero frequency */ var node; /* new node being created */ /* Construct the initial heap, with least frequent element in * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. * heap[0] is not used. */ s.heap_len = 0; s.heap_max = HEAP_SIZE; for (n = 0; n < elems; n++) { if (tree[n * 2]/*.Freq*/ !== 0) { s.heap[++s.heap_len] = max_code = n; s.depth[n] = 0; } else { tree[n * 2 + 1]/*.Len*/ = 0; } } /* The pkzip format requires that at least one distance code exists, * and that at least one bit should be sent even if there is only one * possible code. So to avoid special checks later on we force at least * two codes of non zero frequency. */ while (s.heap_len < 2) { node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0); tree[node * 2]/*.Freq*/ = 1; s.depth[node] = 0; s.opt_len--; if (has_stree) { s.static_len -= stree[node * 2 + 1]/*.Len*/; } /* node is 0 or 1 so it does not have extra bits */ } desc.max_code = max_code; /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, * establish sub-heaps of increasing lengths: */ for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); } /* Construct the Huffman tree by repeatedly combining the least two * frequent nodes. */ node = elems; /* next internal node of the tree */ do { //pqremove(s, tree, n); /* n = node of least frequency */ /*** pqremove ***/ n = s.heap[1/*SMALLEST*/]; s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--]; pqdownheap(s, tree, 1/*SMALLEST*/); /***/ m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */ s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */ s.heap[--s.heap_max] = m; /* Create a new node father of n and m */ tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/; s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node; /* and insert the new node in the heap */ s.heap[1/*SMALLEST*/] = node++; pqdownheap(s, tree, 1/*SMALLEST*/); } while (s.heap_len >= 2); s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/]; /* At this point, the fields freq and dad are set. We can now * generate the bit lengths. */ gen_bitlen(s, desc); /* The field len is now set, we can generate the bit codes */ gen_codes(tree, max_code, s.bl_count); } /* =========================================================================== * Scan a literal or distance tree to determine the frequencies of the codes * in the bit length tree. */ function scan_tree(s, tree, max_code) // deflate_state *s; // ct_data *tree; /* the tree to be scanned */ // int max_code; /* and its largest code of non zero frequency */ { var n; /* iterates over all tree elements */ var prevlen = -1; /* last emitted length */ var curlen; /* length of current code */ var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ var count = 0; /* repeat count of the current code */ var max_count = 7; /* max repeat count */ var min_count = 4; /* min repeat count */ if (nextlen === 0) { max_count = 138; min_count = 3; } tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */ for (n = 0; n <= max_code; n++) { curlen = nextlen; nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; if (++count < max_count && curlen === nextlen) { continue; } else if (count < min_count) { s.bl_tree[curlen * 2]/*.Freq*/ += count; } else if (curlen !== 0) { if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; } s.bl_tree[REP_3_6 * 2]/*.Freq*/++; } else if (count <= 10) { s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++; } else { s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++; } count = 0; prevlen = curlen; if (nextlen === 0) { max_count = 138; min_count = 3; } else if (curlen === nextlen) { max_count = 6; min_count = 3; } else { max_count = 7; min_count = 4; } } } /* =========================================================================== * Send a literal or distance tree in compressed form, using the codes in * bl_tree. */ function send_tree(s, tree, max_code) // deflate_state *s; // ct_data *tree; /* the tree to be scanned */ // int max_code; /* and its largest code of non zero frequency */ { var n; /* iterates over all tree elements */ var prevlen = -1; /* last emitted length */ var curlen; /* length of current code */ var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ var count = 0; /* repeat count of the current code */ var max_count = 7; /* max repeat count */ var min_count = 4; /* min repeat count */ /* tree[max_code+1].Len = -1; */ /* guard already set */ if (nextlen === 0) { max_count = 138; min_count = 3; } for (n = 0; n <= max_code; n++) { curlen = nextlen; nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; if (++count < max_count && curlen === nextlen) { continue; } else if (count < min_count) { do { send_code(s, curlen, s.bl_tree); } while (--count !== 0); } else if (curlen !== 0) { if (curlen !== prevlen) { send_code(s, curlen, s.bl_tree); count--; } //Assert(count >= 3 && count <= 6, " 3_6?"); send_code(s, REP_3_6, s.bl_tree); send_bits(s, count - 3, 2); } else if (count <= 10) { send_code(s, REPZ_3_10, s.bl_tree); send_bits(s, count - 3, 3); } else { send_code(s, REPZ_11_138, s.bl_tree); send_bits(s, count - 11, 7); } count = 0; prevlen = curlen; if (nextlen === 0) { max_count = 138; min_count = 3; } else if (curlen === nextlen) { max_count = 6; min_count = 3; } else { max_count = 7; min_count = 4; } } } /* =========================================================================== * Construct the Huffman tree for the bit lengths and return the index in * bl_order of the last bit length code to send. */ function build_bl_tree(s) { var max_blindex; /* index of last bit length code of non zero freq */ /* Determine the bit length frequencies for literal and distance trees */ scan_tree(s, s.dyn_ltree, s.l_desc.max_code); scan_tree(s, s.dyn_dtree, s.d_desc.max_code); /* Build the bit length tree: */ build_tree(s, s.bl_desc); /* opt_len now includes the length of the tree representations, except * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. */ /* Determine the number of bit length codes to send. The pkzip format * requires that at least 4 bit length codes be sent. (appnote.txt says * 3 but the actual value used is 4.) */ for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { break; } } /* Update opt_len to include the bit length tree and counts */ s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", // s->opt_len, s->static_len)); return max_blindex; } /* =========================================================================== * Send the header for a block using dynamic Huffman trees: the counts, the * lengths of the bit length codes, the literal tree and the distance tree. * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. */ function send_all_trees(s, lcodes, dcodes, blcodes) // deflate_state *s; // int lcodes, dcodes, blcodes; /* number of codes for each tree */ { var rank; /* index in bl_order */ //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, // "too many codes"); //Tracev((stderr, "\nbl counts: ")); send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */ send_bits(s, dcodes - 1, 5); send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */ for (rank = 0; rank < blcodes; rank++) { //Tracev((stderr, "\nbl code %2d ", bl_order[rank])); send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3); } //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */ //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */ //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); } /* =========================================================================== * Check if the data type is TEXT or BINARY, using the following algorithm: * - TEXT if the two conditions below are satisfied: * a) There are no non-portable control characters belonging to the * "black list" (0..6, 14..25, 28..31). * b) There is at least one printable character belonging to the * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). * - BINARY otherwise. * - The following partially-portable control characters form a * "gray list" that is ignored in this detection algorithm: * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). * IN assertion: the fields Freq of dyn_ltree are set. */ function detect_data_type(s) { /* black_mask is the bit mask of black-listed bytes * set bits 0..6, 14..25, and 28..31 * 0xf3ffc07f = binary 11110011111111111100000001111111 */ var black_mask = 0xf3ffc07f; var n; /* Check for non-textual ("black-listed") bytes. */ for (n = 0; n <= 31; n++, black_mask >>>= 1) { if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) { return Z_BINARY; } } /* Check for textual ("white-listed") bytes. */ if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { return Z_TEXT; } for (n = 32; n < LITERALS; n++) { if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { return Z_TEXT; } } /* There are no "black-listed" or "white-listed" bytes: * this stream either is empty or has tolerated ("gray-listed") bytes only. */ return Z_BINARY; } var static_init_done = false; /* =========================================================================== * Initialize the tree data structures for a new zlib stream. */ function _tr_init(s) { if (!static_init_done) { tr_static_init(); static_init_done = true; } s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); s.bi_buf = 0; s.bi_valid = 0; /* Initialize the first block of the first file: */ init_block(s); } /* =========================================================================== * Send a stored block */ function _tr_stored_block(s, buf, stored_len, last) //DeflateState *s; //charf *buf; /* input block */ //ulg stored_len; /* length of input block */ //int last; /* one if this is the last block for a file */ { send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */ copy_block(s, buf, stored_len, true); /* with header */ } /* =========================================================================== * Send one empty static block to give enough lookahead for inflate. * This takes 10 bits, of which 7 may remain in the bit buffer. */ function _tr_align(s) { send_bits(s, STATIC_TREES << 1, 3); send_code(s, END_BLOCK, static_ltree); bi_flush(s); } /* =========================================================================== * Determine the best encoding for the current block: dynamic trees, static * trees or store, and output the encoded block to the zip file. */ function _tr_flush_block(s, buf, stored_len, last) //DeflateState *s; //charf *buf; /* input block, or NULL if too old */ //ulg stored_len; /* length of input block */ //int last; /* one if this is the last block for a file */ { var opt_lenb, static_lenb; /* opt_len and static_len in bytes */ var max_blindex = 0; /* index of last bit length code of non zero freq */ /* Build the Huffman trees unless a stored block is forced */ if (s.level > 0) { /* Check if the file is binary or text */ if (s.strm.data_type === Z_UNKNOWN) { s.strm.data_type = detect_data_type(s); } /* Construct the literal and distance trees */ build_tree(s, s.l_desc); // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, // s->static_len)); build_tree(s, s.d_desc); // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, // s->static_len)); /* At this point, opt_len and static_len are the total bit lengths of * the compressed block data, excluding the tree representations. */ /* Build the bit length tree for the above two trees, and get the index * in bl_order of the last bit length code to send. */ max_blindex = build_bl_tree(s); /* Determine the best encoding. Compute the block lengths in bytes. */ opt_lenb = (s.opt_len + 3 + 7) >>> 3; static_lenb = (s.static_len + 3 + 7) >>> 3; // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, // s->last_lit)); if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; } } else { // Assert(buf != (char*)0, "lost buf"); opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ } if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) { /* 4: two words for the lengths */ /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. * Otherwise we can't have processed more than WSIZE input bytes since * the last block flush, because compression would have been * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to * transform a block into a stored block. */ _tr_stored_block(s, buf, stored_len, last); } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); compress_block(s, static_ltree, static_dtree); } else { send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3); send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); compress_block(s, s.dyn_ltree, s.dyn_dtree); } // Assert (s->compressed_len == s->bits_sent, "bad compressed size"); /* The above check is made mod 2^32, for files larger than 512 MB * and uLong implemented on 32 bits. */ init_block(s); if (last) { bi_windup(s); } // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, // s->compressed_len-7*last)); } /* =========================================================================== * Save the match info and tally the frequency counts. Return true if * the current block must be flushed. */ function _tr_tally(s, dist, lc) // deflate_state *s; // unsigned dist; /* distance of matched string */ // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ { //var out_length, in_length, dcode; s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff; s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff; s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff; s.last_lit++; if (dist === 0) { /* lc is the unmatched char */ s.dyn_ltree[lc * 2]/*.Freq*/++; } else { s.matches++; /* Here, lc is the match length - MIN_MATCH */ dist--; /* dist = match distance - 1 */ //Assert((ush)dist < (ush)MAX_DIST(s) && // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; } // (!) This block is disabled in zlib defaults, // don't enable it for binary compatibility //#ifdef TRUNCATE_BLOCK // /* Try to guess if it is profitable to stop the current block here */ // if ((s.last_lit & 0x1fff) === 0 && s.level > 2) { // /* Compute an upper bound for the compressed length */ // out_length = s.last_lit*8; // in_length = s.strstart - s.block_start; // // for (dcode = 0; dcode < D_CODES; dcode++) { // out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]); // } // out_length >>>= 3; // //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", // // s->last_lit, in_length, out_length, // // 100L - out_length*100L/in_length)); // if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) { // return true; // } // } //#endif return (s.last_lit === s.lit_bufsize - 1); /* We avoid equality with lit_bufsize because of wraparound at 64K * on 16 bit machines and because stored blocks are restricted to * 64K-1 bytes. */ } exports._tr_init = _tr_init; exports._tr_stored_block = _tr_stored_block; exports._tr_flush_block = _tr_flush_block; exports._tr_tally = _tr_tally; exports._tr_align = _tr_align; },{"../utils/common":3}],15:[function(require,module,exports){ // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. function ZStream() { /* next input byte */ this.input = null; // JS specific, because we have no pointers this.next_in = 0; /* number of bytes available at input */ this.avail_in = 0; /* total number of input bytes read so far */ this.total_in = 0; /* next output byte should be put there */ this.output = null; // JS specific, because we have no pointers this.next_out = 0; /* remaining free space at output */ this.avail_out = 0; /* total number of bytes output so far */ this.total_out = 0; /* last error message, NULL if no error */ this.msg = ''/*Z_NULL*/; /* not visible by applications */ this.state = null; /* best guess about the data type: binary or text */ this.data_type = 2/*Z_UNKNOWN*/; /* adler32 value of the uncompressed data */ this.adler = 0; } module.exports = ZStream; },{}],"/":[function(require,module,exports){ var assign = require('./lib/utils/common').assign; var deflate = require('./lib/deflate'); var inflate = require('./lib/inflate'); var constants = require('./lib/zlib/constants'); var pako = {}; assign(pako, deflate, inflate, constants); module.exports = pako; },{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/") }); }); var p = /*#__PURE__*/Object.freeze({ __proto__: null, 'default': pako, __moduleExports: pako }); let pako$1 = p; if (!pako$1.inflate) { // See https://github.com/nodeca/pako/issues/97 pako$1 = pako$1.default; } const XKT_VERSION = 9; // XKT format version /** * Writes an {@link XKTModel} to an {@link ArrayBuffer}. * * @param {XKTModel} xktModel The {@link XKTModel}. * @returns {ArrayBuffer} The {@link ArrayBuffer}. */ function writeXKTModelToArrayBuffer(xktModel) { const data = getModelData(xktModel); const deflatedData = deflateData(data); const arrayBuffer = createArrayBuffer(deflatedData); return arrayBuffer; } function getModelData(xktModel) { //------------------------------------------------------------------------------------------------------------------ // Allocate data //------------------------------------------------------------------------------------------------------------------ const propertySetsList = xktModel.propertySetsList; const metaObjectsList = xktModel.metaObjectsList; const geometriesList = xktModel.geometriesList; const meshesList = xktModel.meshesList; const entitiesList = xktModel.entitiesList; const tilesList = xktModel.tilesList; const numPropertySets = propertySetsList.length; const numMetaObjects = metaObjectsList.length; const numGeometries = geometriesList.length; const numMeshes = meshesList.length; const numEntities = entitiesList.length; const numTiles = tilesList.length; let lenPositions = 0; let lenNormals = 0; let lenColors = 0; let lenIndices = 0; let lenEdgeIndices = 0; let lenMatrices = 0; for (let geometryIndex = 0; geometryIndex < numGeometries; geometryIndex++) { const geometry = geometriesList [geometryIndex]; if (geometry.positionsQuantized) { lenPositions += geometry.positionsQuantized.length; } if (geometry.normalsOctEncoded) { lenNormals += geometry.normalsOctEncoded.length; } if (geometry.colorsCompressed) { lenColors += geometry.colorsCompressed.length; } if (geometry.indices) { lenIndices += geometry.indices.length; } if (geometry.edgeIndices) { lenEdgeIndices += geometry.edgeIndices.length; } } for (let meshIndex = 0; meshIndex < numMeshes; meshIndex++) { const mesh = meshesList[meshIndex]; if (mesh.geometry.numInstances > 1) { lenMatrices += 16; } } const data = { // Metadata metadata: {}, // Geometry data - vertex attributes and indices positions: new Uint16Array(lenPositions), // All geometry arrays normals: new Int8Array(lenNormals), colors: new Uint8Array(lenColors), indices: new Uint32Array(lenIndices), edgeIndices: new Uint32Array(lenEdgeIndices), // Transform matrices shared by meshes matrices: new Float32Array(lenMatrices), // Modeling matrices for entities that share geometries. Each entity either shares all it's geometries, or owns all its geometries exclusively. Exclusively-owned geometries are pre-transformed into World-space, and so their entities don't have modeling matrices in this array. // De-quantization matrix shared by all rused geometries reusedGeometriesDecodeMatrix: new Float32Array(xktModel.reusedGeometriesDecodeMatrix), // A single, global vertex position de-quantization matrix for all reused geometries. Reused geometries are quantized to their collective Local-space AABB, and this matrix is derived from that AABB. // Geometries eachGeometryPrimitiveType: new Uint8Array(numGeometries), // Primitive type for each geometry (0=solid triangles, 1=surface triangles, 2=lines, 3=points) eachGeometryPositionsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.positions. Every primitive type has positions. eachGeometryNormalsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.normals. If the next geometry has the same index, then this geometry has no normals. eachGeometryColorsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.colors. If the next geometry has the same index, then this geometry has no colors. eachGeometryIndicesPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.indices. If the next geometry has the same index, then this geometry has no indices. eachGeometryEdgeIndicesPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.edgeIndices. If the next geometry has the same index, then this geometry has no edge indices. // Meshes are grouped in runs that are shared by the same entities. // We duplicate materials for meshes, rather than reusing them, because each material is only 6 bytes and an index // into a common materials array would be 4 bytes, so it's hardly worth reusing materials, as long as they are that compact. eachMeshGeometriesPortion: new Uint32Array(numMeshes), // For each mesh, an index into the eachGeometry* arrays eachMeshMatricesPortion: new Uint32Array(numMeshes), // For each mesh that shares its geometry, an index to its first element in data.matrices, to indicate the modeling matrix that transforms the shared geometry Local-space vertex positions. This is ignored for meshes that don't share geometries, because the vertex positions of non-shared geometries are pre-transformed into World-space. eachMeshMaterial: new Uint8Array(numMeshes * 6), // For each mesh, an RGBA integer color of format [0..255, 0..255, 0..255, 0..255], and PBR metallic and roughness factors, of format [0..255, 0..255] // Entity elements in the following arrays are grouped in runs that are shared by the same tiles eachEntityId: [], // For each entity, an ID string eachEntityMeshesPortion: new Uint32Array(numEntities), // For each entity, the index of the first element of meshes used by the entity eachTileAABB: new Float64Array(numTiles * 6), // For each tile, an axis-aligned bounding box eachTileEntitiesPortion: new Uint32Array(numTiles) // For each tile, the index of the the first element of eachEntityId, eachEntityMeshesPortion and eachEntityMatricesPortion used by the tile }; //------------------------------------------------------------------------------------------------------------------ // Populate the data //------------------------------------------------------------------------------------------------------------------ let countPositions = 0; let countNormals = 0; let countColors = 0; let countIndices = 0; let countEdgeIndices = 0; let countMeshColors = 0; // Metadata data.metadata = { id: xktModel.modelId, projectId: xktModel.projectId, revisionId: xktModel.revisionId, author: xktModel.author, createdAt: xktModel.createdAt, creatingApplication: xktModel.creatingApplication, schema: xktModel.schema, propertySets: [], metaObjects: [] }; for (let propertySetsIndex = 0; propertySetsIndex < numPropertySets; propertySetsIndex++) { const propertySet = propertySetsList[propertySetsIndex]; const propertySetJSON = { id: "" + propertySet.propertySetId, name: propertySet.propertySetName, type: propertySet.propertySetType, properties: propertySet.properties }; data.metadata.propertySets.push(propertySetJSON); } for (let metaObjectsIndex = 0; metaObjectsIndex < numMetaObjects; metaObjectsIndex++) { const metaObject = metaObjectsList[metaObjectsIndex]; const metaObjectJSON = { name: metaObject.metaObjectName, type: metaObject.metaObjectType, id: "" + metaObject.metaObjectId }; if (metaObject.parentMetaObjectId !== undefined && metaObject.parentMetaObjectId !== null) { metaObjectJSON.parent = "" + metaObject.parentMetaObjectId; } if (metaObject.propertySetIds && metaObject.propertySetIds.length > 0) { metaObjectJSON.propertySetIds = metaObject.propertySetIds; } data.metadata.metaObjects.push(metaObjectJSON); } // console.log(JSON.stringify(data.metadata, null, "\t")) // Geometries let matricesIndex = 0; for (let geometryIndex = 0; geometryIndex < numGeometries; geometryIndex++) { const geometry = geometriesList [geometryIndex]; const primitiveType = (geometry.primitiveType === "triangles") ? (geometry.solid ? 0 : 1) : (geometry.primitiveType === "points" ? 2 : 3); data.eachGeometryPrimitiveType [geometryIndex] = primitiveType; data.eachGeometryPositionsPortion [geometryIndex] = countPositions; data.eachGeometryNormalsPortion [geometryIndex] = countNormals; data.eachGeometryColorsPortion [geometryIndex] = countColors; data.eachGeometryIndicesPortion [geometryIndex] = countIndices; data.eachGeometryEdgeIndicesPortion [geometryIndex] = countEdgeIndices; if (geometry.positionsQuantized) { data.positions.set(geometry.positionsQuantized, countPositions); countPositions += geometry.positionsQuantized.length; } if (geometry.normalsOctEncoded) { data.normals.set(geometry.normalsOctEncoded, countNormals); countNormals += geometry.normalsOctEncoded.length; } if (geometry.colorsCompressed) { data.colors.set(geometry.colorsCompressed, countColors); countColors += geometry.colorsCompressed.length; } if (geometry.indices) { data.indices.set(geometry.indices, countIndices); countIndices += geometry.indices.length; } if (geometry.edgeIndices) { data.edgeIndices.set(geometry.edgeIndices, countEdgeIndices); countEdgeIndices += geometry.edgeIndices.length; } } // Meshes for (let meshIndex = 0; meshIndex < numMeshes; meshIndex++) { const mesh = meshesList [meshIndex]; if (mesh.geometry.numInstances > 1) { data.matrices.set(mesh.matrix, matricesIndex); data.eachMeshMatricesPortion [meshIndex] = matricesIndex; matricesIndex += 16; } data.eachMeshMaterial[countMeshColors + 0] = Math.floor(mesh.color[0] * 255); data.eachMeshMaterial[countMeshColors + 1] = Math.floor(mesh.color[1] * 255); data.eachMeshMaterial[countMeshColors + 2] = Math.floor(mesh.color[2] * 255); data.eachMeshMaterial[countMeshColors + 3] = Math.floor(mesh.opacity * 255); data.eachMeshMaterial[countMeshColors + 4] = Math.floor(mesh.metallic * 255); data.eachMeshMaterial[countMeshColors + 5] = Math.floor(mesh.roughness * 255); countMeshColors += 6; } // Entities, geometry instances, and tiles let entityIndex = 0; let countEntityMeshesPortion = 0; for (let tileIndex = 0; tileIndex < numTiles; tileIndex++) { const tile = tilesList [tileIndex]; const tileEntities = tile.entities; const numTileEntities = tileEntities.length; if (numTileEntities === 0) { continue; } data.eachTileEntitiesPortion[tileIndex] = entityIndex; const tileAABB = tile.aabb; for (let j = 0; j < numTileEntities; j++) { const entity = tileEntities[j]; const entityMeshes = entity.meshes; const numEntityMeshes = entityMeshes.length; for (let k = 0; k < numEntityMeshes; k++) { const mesh = entityMeshes[k]; const geometry = mesh.geometry; const geometryIndex = geometry.geometryIndex; data.eachMeshGeometriesPortion [countEntityMeshesPortion + k] = geometryIndex; } data.eachEntityId [entityIndex] = entity.entityId; data.eachEntityMeshesPortion[entityIndex] = countEntityMeshesPortion; // <<<<<<<<<<<<<<<<<<<< Error here? Order/value of countEntityMeshesPortion correct? entityIndex++; countEntityMeshesPortion += numEntityMeshes; } const tileAABBIndex = tileIndex * 6; data.eachTileAABB.set(tileAABB, tileAABBIndex); } return data; } function deflateData(data) { return { metadata: pako$1.deflate(deflateJSON(data.metadata)), positions: pako$1.deflate(data.positions.buffer), normals: pako$1.deflate(data.normals.buffer), colors: pako$1.deflate(data.colors.buffer), indices: pako$1.deflate(data.indices.buffer), edgeIndices: pako$1.deflate(data.edgeIndices.buffer), matrices: pako$1.deflate(data.matrices.buffer), reusedGeometriesDecodeMatrix: pako$1.deflate(data.reusedGeometriesDecodeMatrix.buffer), eachGeometryPrimitiveType: pako$1.deflate(data.eachGeometryPrimitiveType.buffer), eachGeometryPositionsPortion: pako$1.deflate(data.eachGeometryPositionsPortion.buffer), eachGeometryNormalsPortion: pako$1.deflate(data.eachGeometryNormalsPortion.buffer), eachGeometryColorsPortion: pako$1.deflate(data.eachGeometryColorsPortion.buffer), eachGeometryIndicesPortion: pako$1.deflate(data.eachGeometryIndicesPortion.buffer), eachGeometryEdgeIndicesPortion: pako$1.deflate(data.eachGeometryEdgeIndicesPortion.buffer), eachMeshGeometriesPortion: pako$1.deflate(data.eachMeshGeometriesPortion.buffer), eachMeshMatricesPortion: pako$1.deflate(data.eachMeshMatricesPortion.buffer), eachMeshMaterial: pako$1.deflate(data.eachMeshMaterial.buffer), eachEntityId: pako$1.deflate(JSON.stringify(data.eachEntityId) .replace(/[\u007F-\uFFFF]/g, function (chr) { // Produce only ASCII-chars, so that the data can be inflated later return "\\u" + ("0000" + chr.charCodeAt(0).toString(16)).substr(-4) })), eachEntityMeshesPortion: pako$1.deflate(data.eachEntityMeshesPortion.buffer), eachTileAABB: pako$1.deflate(data.eachTileAABB.buffer), eachTileEntitiesPortion: pako$1.deflate(data.eachTileEntitiesPortion.buffer) }; } function deflateJSON(strings) { return JSON.stringify(strings) .replace(/[\u007F-\uFFFF]/g, function (chr) { // Produce only ASCII-chars, so that the data can be inflated later return "\\u" + ("0000" + chr.charCodeAt(0).toString(16)).substr(-4) }); } function createArrayBuffer(deflatedData) { return toArrayBuffer$1([ deflatedData.metadata, deflatedData.positions, deflatedData.normals, deflatedData.colors, deflatedData.indices, deflatedData.edgeIndices, deflatedData.matrices, deflatedData.reusedGeometriesDecodeMatrix, deflatedData.eachGeometryPrimitiveType, deflatedData.eachGeometryPositionsPortion, deflatedData.eachGeometryNormalsPortion, deflatedData.eachGeometryColorsPortion, deflatedData.eachGeometryIndicesPortion, deflatedData.eachGeometryEdgeIndicesPortion, deflatedData.eachMeshGeometriesPortion, deflatedData.eachMeshMatricesPortion, deflatedData.eachMeshMaterial, deflatedData.eachEntityId, deflatedData.eachEntityMeshesPortion, deflatedData.eachTileAABB, deflatedData.eachTileEntitiesPortion ]); } function toArrayBuffer$1(elements) { const indexData = new Uint32Array(elements.length + 2); indexData[0] = XKT_VERSION; indexData [1] = elements.length; // Stored Data 1.1: number of stored elements let dataLen = 0; // Stored Data 1.2: length of stored elements for (let i = 0, len = elements.length; i < len; i++) { const element = elements[i]; const elementsize = element.length; indexData[i + 2] = elementsize; dataLen += elementsize; } const indexBuf = new Uint8Array(indexData.buffer); const dataArray = new Uint8Array(indexBuf.length + dataLen); dataArray.set(indexBuf); let offset = indexBuf.length; for (let i = 0, len = elements.length; i < len; i++) { // Stored Data 2: the elements themselves const element = elements[i]; dataArray.set(element, offset); offset += element.length; } return dataArray.buffer; } function quantizePositions (positions, lenPositions, aabb, quantizedPositions) { const xmin = aabb[0]; const ymin = aabb[1]; const zmin = aabb[2]; const xwid = aabb[3] - xmin; const ywid = aabb[4] - ymin; const zwid = aabb[5] - zmin; const maxInt = 65535; const xMultiplier = maxInt / xwid; const yMultiplier = maxInt / ywid; const zMultiplier = maxInt / zwid; const verify = (num) => num >= 0 ? num : 0; for (let i = 0; i < lenPositions; i += 3) { quantizedPositions[i + 0] = Math.floor(verify(positions[i + 0] - xmin) * xMultiplier); quantizedPositions[i + 1] = Math.floor(verify(positions[i + 1] - ymin) * yMultiplier); quantizedPositions[i + 2] = Math.floor(verify(positions[i + 2] - zmin) * zMultiplier); } } var createPositionsDecodeMatrix = (function () { const translate = math.mat4(); const scale = math.mat4(); return function (aabb, positionsDecodeMatrix) { positionsDecodeMatrix = positionsDecodeMatrix || math.mat4(); const xmin = aabb[0]; const ymin = aabb[1]; const zmin = aabb[2]; const xwid = aabb[3] - xmin; const ywid = aabb[4] - ymin; const zwid = aabb[5] - zmin; const maxInt = 65535; math.identityMat4(translate); math.translationMat4v(aabb, translate); math.identityMat4(scale); math.scalingMat4v([xwid / maxInt, ywid / maxInt, zwid / maxInt], scale); math.mulMat4(translate, scale, positionsDecodeMatrix); return positionsDecodeMatrix; }; })(); function transformAndOctEncodeNormals(modelNormalMatrix, normals, lenNormals, compressedNormals, lenCompressedNormals) { // http://jcgt.org/published/0003/02/01/ let oct, dec, best, currentCos, bestCos; let i; let localNormal = math.vec3(); let worldNormal = math.vec3(); for (i = 0; i < lenNormals; i += 3) { localNormal[0] = normals[i]; localNormal[1] = normals[i + 1]; localNormal[2] = normals[i + 2]; math.transformVec3(modelNormalMatrix, localNormal, worldNormal); math.normalizeVec3(worldNormal, worldNormal); // Test various combinations of ceil and floor to minimize rounding errors best = oct = octEncodeVec3(worldNormal, 0, "floor", "floor"); dec = octDecodeVec2(oct); currentCos = bestCos = dot(worldNormal, 0, dec); oct = octEncodeVec3(worldNormal, 0, "ceil", "floor"); dec = octDecodeVec2(oct); currentCos = dot(worldNormal, 0, dec); if (currentCos > bestCos) { best = oct; bestCos = currentCos; } oct = octEncodeVec3(worldNormal, 0, "floor", "ceil"); dec = octDecodeVec2(oct); currentCos = dot(worldNormal, 0, dec); if (currentCos > bestCos) { best = oct; bestCos = currentCos; } oct = octEncodeVec3(worldNormal, 0, "ceil", "ceil"); dec = octDecodeVec2(oct); currentCos = dot(worldNormal, 0, dec); if (currentCos > bestCos) { best = oct; bestCos = currentCos; } compressedNormals[lenCompressedNormals + i + 0] = best[0]; compressedNormals[lenCompressedNormals + i + 1] = best[1]; compressedNormals[lenCompressedNormals + i + 2] = 0.0; // Unused } lenCompressedNormals += lenNormals; return lenCompressedNormals; } function octEncodeNormals(normals, lenNormals, compressedNormals, lenCompressedNormals) { // http://jcgt.org/published/0003/02/01/ let oct, dec, best, currentCos, bestCos; for (let i = 0; i < lenNormals; i += 3) { // Test various combinations of ceil and floor to minimize rounding errors best = oct = octEncodeVec3(normals, i, "floor", "floor"); dec = octDecodeVec2(oct); currentCos = bestCos = dot(normals, i, dec); oct = octEncodeVec3(normals, i, "ceil", "floor"); dec = octDecodeVec2(oct); currentCos = dot(normals, i, dec); if (currentCos > bestCos) { best = oct; bestCos = currentCos; } oct = octEncodeVec3(normals, i, "floor", "ceil"); dec = octDecodeVec2(oct); currentCos = dot(normals, i, dec); if (currentCos > bestCos) { best = oct; bestCos = currentCos; } oct = octEncodeVec3(normals, i, "ceil", "ceil"); dec = octDecodeVec2(oct); currentCos = dot(normals, i, dec); if (currentCos > bestCos) { best = oct; bestCos = currentCos; } compressedNormals[lenCompressedNormals + i + 0] = best[0]; compressedNormals[lenCompressedNormals + i + 1] = best[1]; compressedNormals[lenCompressedNormals + i + 2] = 0.0; // Unused } lenCompressedNormals += lenNormals; return lenCompressedNormals; } /** * @private */ function octEncodeVec3(array, i, xfunc, yfunc) { // Oct-encode single normal vector in 2 bytes let x = array[i] / (Math.abs(array[i]) + Math.abs(array[i + 1]) + Math.abs(array[i + 2])); let y = array[i + 1] / (Math.abs(array[i]) + Math.abs(array[i + 1]) + Math.abs(array[i + 2])); if (array[i + 2] < 0) { let tempx = (1 - Math.abs(y)) * (x >= 0 ? 1 : -1); let tempy = (1 - Math.abs(x)) * (y >= 0 ? 1 : -1); x = tempx; y = tempy; } return new Int8Array([ Math[xfunc](x * 127.5 + (x < 0 ? -1 : 0)), Math[yfunc](y * 127.5 + (y < 0 ? -1 : 0)) ]); } /** * Decode an oct-encoded normal */ function octDecodeVec2(oct) { let x = oct[0]; let y = oct[1]; x /= x < 0 ? 127 : 128; y /= y < 0 ? 127 : 128; const z = 1 - Math.abs(x) - Math.abs(y); if (z < 0) { x = (1 - Math.abs(y)) * (x >= 0 ? 1 : -1); y = (1 - Math.abs(x)) * (y >= 0 ? 1 : -1); } const length = Math.sqrt(x * x + y * y + z * z); return [ x / length, y / length, z / length ]; } /** * Dot product of a normal in an array against a candidate decoding * @private */ function dot(array, i, vec3) { return array[i] * vec3[0] + array[i + 1] * vec3[1] + array[i + 2] * vec3[2]; } /** * @private */ const geometryCompression = { quantizePositions, createPositionsDecodeMatrix, transformAndOctEncodeNormals, octEncodeNormals, }; //const math = require('./math'); /** * @private */ const buildEdgeIndices = (function () { const uniquePositions = []; const indicesLookup = []; const indicesReverseLookup = []; const weldedIndices = []; // TODO: Optimize with caching, but need to cater to both compressed and uncompressed positions const faces = []; let numFaces = 0; const compa = new Uint16Array(3); const compb = new Uint16Array(3); const compc = new Uint16Array(3); const a = math.vec3(); const b = math.vec3(); const c = math.vec3(); const cb = math.vec3(); const ab = math.vec3(); const cross = math.vec3(); const normal = math.vec3(); function weldVertices(positions, indices) { const positionsMap = {}; // Hashmap for looking up vertices by position coordinates (and making sure they are unique) let vx; let vy; let vz; let key; const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001 const precision = Math.pow(10, precisionPoints); let i; let len; let lenUniquePositions = 0; for (i = 0, len = positions.length; i < len; i += 3) { vx = positions[i]; vy = positions[i + 1]; vz = positions[i + 2]; key = Math.round(vx * precision) + '_' + Math.round(vy * precision) + '_' + Math.round(vz * precision); if (positionsMap[key] === undefined) { positionsMap[key] = lenUniquePositions / 3; uniquePositions[lenUniquePositions++] = vx; uniquePositions[lenUniquePositions++] = vy; uniquePositions[lenUniquePositions++] = vz; } indicesLookup[i / 3] = positionsMap[key]; } for (i = 0, len = indices.length; i < len; i++) { weldedIndices[i] = indicesLookup[indices[i]]; indicesReverseLookup[weldedIndices[i]] = indices[i]; } } function buildFaces(numIndices, positionsDecodeMatrix) { numFaces = 0; for (let i = 0, len = numIndices; i < len; i += 3) { const ia = ((weldedIndices[i]) * 3); const ib = ((weldedIndices[i + 1]) * 3); const ic = ((weldedIndices[i + 2]) * 3); if (positionsDecodeMatrix) { compa[0] = uniquePositions[ia]; compa[1] = uniquePositions[ia + 1]; compa[2] = uniquePositions[ia + 2]; compb[0] = uniquePositions[ib]; compb[1] = uniquePositions[ib + 1]; compb[2] = uniquePositions[ib + 2]; compc[0] = uniquePositions[ic]; compc[1] = uniquePositions[ic + 1]; compc[2] = uniquePositions[ic + 2]; // Decode math.decompressPosition(compa, positionsDecodeMatrix, a); math.decompressPosition(compb, positionsDecodeMatrix, b); math.decompressPosition(compc, positionsDecodeMatrix, c); } else { a[0] = uniquePositions[ia]; a[1] = uniquePositions[ia + 1]; a[2] = uniquePositions[ia + 2]; b[0] = uniquePositions[ib]; b[1] = uniquePositions[ib + 1]; b[2] = uniquePositions[ib + 2]; c[0] = uniquePositions[ic]; c[1] = uniquePositions[ic + 1]; c[2] = uniquePositions[ic + 2]; } math.subVec3(c, b, cb); math.subVec3(a, b, ab); math.cross3Vec3(cb, ab, cross); math.normalizeVec3(cross, normal); const face = faces[numFaces] || (faces[numFaces] = {normal: math.vec3()}); face.normal[0] = normal[0]; face.normal[1] = normal[1]; face.normal[2] = normal[2]; numFaces++; } } return function (positions, indices, positionsDecodeMatrix, edgeThreshold) { weldVertices(positions, indices); buildFaces(indices.length, positionsDecodeMatrix); const edgeIndices = []; const thresholdDot = Math.cos(math.DEGTORAD * edgeThreshold); const edges = {}; let edge1; let edge2; let index1; let index2; let key; let largeIndex = false; let edge; let normal1; let normal2; let dot; let ia; let ib; for (let i = 0, len = indices.length; i < len; i += 3) { const faceIndex = i / 3; for (let j = 0; j < 3; j++) { edge1 = weldedIndices[i + j]; edge2 = weldedIndices[i + ((j + 1) % 3)]; index1 = Math.min(edge1, edge2); index2 = Math.max(edge1, edge2); key = index1 + ',' + index2; if (edges[key] === undefined) { edges[key] = { index1: index1, index2: index2, face1: faceIndex, face2: undefined, }; } else { edges[key].face2 = faceIndex; } } } for (key in edges) { edge = edges[key]; // an edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree. if (edge.face2 !== undefined) { normal1 = faces[edge.face1].normal; normal2 = faces[edge.face2].normal; dot = math.dotVec3(normal1, normal2); if (dot > thresholdDot) { continue; } } ia = indicesReverseLookup[edge.index1]; ib = indicesReverseLookup[edge.index2]; if (!largeIndex && ia > 65535 || ib > 65535) { largeIndex = true; } edgeIndices.push(ia); edgeIndices.push(ib); } return (largeIndex) ? new Uint32Array(edgeIndices) : new Uint16Array(edgeIndices); }; })(); /** * Uses edge adjacency counts to identify if the given triangle mesh can be rendered with backface culling enabled. * * If all edges are connected to exactly two triangles, then the mesh will likely be a closed solid, and we can safely * render it with backface culling enabled. * * Otherwise, the mesh is a surface, and we must render it with backface culling disabled. * * @private */ const isTriangleMeshSolid = (indices, positions) => { let numPositions = 0; const positionToAdjustedIndex = {}; const adjustedIndices = []; const edgeAdjCounts = {}; for (let i = 0, len = indices.length; i < len; i++) { const index = indices[i]; const x = positions[index * 3]; const y = positions[index * 3 + 1]; const z = positions[index * 3 + 2]; const positionHash = ("" + x + "," + y + "," + z); let adjustedIndex = positionToAdjustedIndex[positionHash]; if (adjustedIndex === undefined) { adjustedIndex = numPositions++; } adjustedIndices[i] = adjustedIndex; positionToAdjustedIndex[positionHash] = adjustedIndex; } for (let i = 0, len = adjustedIndices.length; i < len; i += 3) { const a = adjustedIndices[i]; const b = adjustedIndices[i + 1]; const c = adjustedIndices[i + 2]; let a2 = a; let b2 = b; let c2 = c; if (a > b && a > c) { if (b > c) { a2 = a; b2 = b; c2 = c; } else { a2 = a; b2 = c; c2 = b; } } else if (b > a && b > c) { if (a > c) { a2 = b; b2 = a; c2 = c; } else { a2 = b; b2 = c; c2 = a; } } else if (c > a && c > b) { if (a > b) { a2 = c; b2 = a; c2 = b; } else { a2 = c; b2 = b; c2 = a; } } let edgeHash = "" + a2 + "-" + b2; let edgeAdjCount = edgeAdjCounts[edgeHash]; edgeAdjCounts[edgeHash] = (edgeAdjCount === undefined) ? 1 : edgeAdjCount + 1; edgeHash = "" + b2 + "-" + c2; edgeAdjCount = edgeAdjCounts[edgeHash]; edgeAdjCounts[edgeHash] = (edgeAdjCount === undefined) ? 1 : edgeAdjCount + 1; if (a2 > c2) { const temp = c2; c2 = a2; a2 = temp; } edgeHash = "" + c2 + "-" + a2; edgeAdjCount = edgeAdjCounts[edgeHash]; edgeAdjCounts[edgeHash] = (edgeAdjCount === undefined) ? 1 : edgeAdjCount + 1; } for (let edgeHash in edgeAdjCounts) { if (edgeAdjCounts[edgeHash] !== 2) { // Surface return false; } } return true; // Watertight }; /** * Represents the usage of a {@link XKTGeometry} by an {@link XKTEntity}. * * * Created by {@link XKTModel#createEntity} * * Stored in {@link XKTEntity#meshes} and {@link XKTModel#meshesList} * * Specifies color and opacity * * @class XKTMesh */ class XKTMesh { /** * @private */ constructor(cfg) { /** * Unique ID of this XKTMesh in {@link XKTModel#meshes}. * * @type {Number} */ this.meshId = cfg.meshId; /** * Index of this XKTMesh in {@link XKTModel#meshesList}; * * @type {Number} */ this.meshIndex = cfg.meshIndex; /** * The 4x4 modeling transform matrix. * * Transform is relative to the center of the {@link XKTTile} that contains this XKTMesh's {@link XKTEntity}, * which is given in {@link XKTMesh#entity}. * * When the ````XKTEntity```` shares its {@link XKTGeometry}s with other ````XKTEntity````s, this matrix is used * to transform this XKTMesh's XKTGeometry into World-space. When this XKTMesh does not share its ````XKTGeometry````, * then this matrix is ignored. * * @type {Number[]} */ this.matrix = cfg.matrix; /** * The instanced {@link XKTGeometry}. * * @type {XKTGeometry} */ this.geometry = cfg.geometry; /** * RGB color of this XKTMesh. * * @type {Uint8Array} */ this.color = cfg.color || new Uint8Array(3); /** * PBR metallness of this XKTMesh. * * @type {Number} */ this.metallic = (cfg.metallic !== null && cfg.metallic !== undefined) ? cfg.metallic : 0; /** * PBR roughness of this XKTMesh. * * @type {Number} */ this.roughness = (cfg.roughness !== null && cfg.roughness !== undefined) ? cfg.roughness : 1; /** * Opacity of this XKTMesh. * * @type {Number} */ this.opacity = (cfg.opacity !== undefined && cfg.opacity !== null) ? cfg.opacity : 1.0; /** * The owner {@link XKTEntity}. * * Set by {@link XKTModel#createEntity}. * * @type {XKTEntity} */ this.entity = null; // Set after instantiation, when the Entity is known } } /** * An element of reusable geometry within an {@link XKTModel}. * * * Created by {@link XKTModel#createGeometry} * * Stored in {@link XKTModel#geometries} and {@link XKTModel#geometriesList} * * Referenced by {@link XKTMesh}s, which belong to {@link XKTEntity}s * * @class XKTGeometry */ class XKTGeometry { /** * @private * @param {*} cfg Configuration for the XKTGeometry. * @param {Number} cfg.geometryId Unique ID of the geometry in {@link XKTModel#geometries}. * @param {String} cfg.primitiveType Type of this geometry - "triangles", "points" or "lines" so far. * @param {Number} cfg.geometryIndex Index of this XKTGeometry in {@link XKTModel#geometriesList}. * @param {Float64Array} cfg.positions Non-quantized 3D vertex positions. * @param {Float32Array} cfg.normals Non-compressed vertex normals. * @param {Uint8Array} cfg.colorsCompressed Integer RGBA vertex colors. * @param {Uint32Array} cfg.indices Indices to organize the vertex positions and normals into triangles. * @param {Uint32Array} cfg.edgeIndices Indices to organize the vertex positions into edges. */ constructor(cfg) { /** * Unique ID of this XKTGeometry in {@link XKTModel#geometries}. * * @type {Number} */ this.geometryId = cfg.geometryId; /** * The type of primitive - "triangles" | "points" | "lines". * * @type {String} */ this.primitiveType = cfg.primitiveType; /** * Index of this XKTGeometry in {@link XKTModel#geometriesList}. * * @type {Number} */ this.geometryIndex = cfg.geometryIndex; /** * The number of {@link XKTMesh}s that reference this XKTGeometry. * * @type {Number} */ this.numInstances = 0; /** * Non-quantized 3D vertex positions. * * Defined for all primitive types. * * @type {Float64Array} */ this.positions = cfg.positions; /** * Quantized vertex positions. * * Defined for all primitive types. * * This array is later created from {@link XKTGeometry#positions} by {@link XKTModel#finalize}. * * @type {Uint16Array} */ this.positionsQuantized = new Uint16Array(cfg.positions.length); /** * Non-compressed 3D vertex normals. * * Defined only for triangle primitives. Can be null if we want xeokit to auto-generate them. Ignored for points and lines. * * @type {Float32Array} */ this.normals = cfg.normals; /** * Compressed vertex normals. * * Defined only for triangle primitives. Ignored for points and lines. * * This array is later created from {@link XKTGeometry#normals} by {@link XKTModel#finalize}. * * Will be null if {@link XKTGeometry#normals} is also null. * * @type {Int8Array} */ this.normalsOctEncoded = null; /** * Compressed RGBA vertex colors. * * Defined only for point primitives. Ignored for triangles and lines. * * @type {Float32Array} */ this.colorsCompressed = cfg.colorsCompressed; /** * Indices that organize the vertex positions and normals as triangles. * * Defined only for triangle and lines primitives. Ignored for points. * * @type {Uint32Array} */ this.indices = cfg.indices; /** * Indices that organize the vertex positions as edges. * * Defined only for triangle primitives. Ignored for points and lines. * * @type {Uint32Array} */ this.edgeIndices = cfg.edgeIndices; /** * When {@link XKTGeometry#primitiveType} is "triangles", this is ````true```` when this geometry is a watertight mesh. * * Defined only for triangle primitives. Ignored for points and lines. * * Set by {@link XKTModel#finalize}. * * @type {boolean} */ this.solid = false; } /** * Convenience property that is ````true```` when {@link XKTGeometry#numInstances} is greater that one. * @returns {boolean} */ get reused() { return (this.numInstances > 1); } } /** * An object within an {@link XKTModel}. * * * Created by {@link XKTModel#createEntity} * * Stored in {@link XKTModel#entities} and {@link XKTModel#entitiesList} * * Has one or more {@link XKTMesh}s, each having an {@link XKTGeometry} * * @class XKTEntity */ class XKTEntity { /** * @private * @param entityId * @param meshes */ constructor(entityId, meshes) { /** * Unique ID of this ````XKTEntity```` in {@link XKTModel#entities}. * * For a BIM model, this will be an IFC product ID. * * We can also use {@link XKTModel#createMetaObject} to create an {@link XKTMetaObject} to specify metadata for * this ````XKTEntity````. To associate the {@link XKTMetaObject} with our {@link XKTEntity}, we give * {@link XKTMetaObject#metaObjectId} the same value as {@link XKTEntity#entityId}. * * @type {String} */ this.entityId = entityId; /** * Index of this ````XKTEntity```` in {@link XKTModel#entitiesList}. * * Set by {@link XKTModel#finalize}. * * @type {Number} */ this.entityIndex = null; /** * A list of {@link XKTMesh}s that indicate which {@link XKTGeometry}s are used by this Entity. * * @type {XKTMesh[]} */ this.meshes = meshes; /** * World-space axis-aligned bounding box (AABB) that encloses the {@link XKTGeometry#positions} of * the {@link XKTGeometry}s that are used by this ````XKTEntity````. * * Set by {@link XKTModel#finalize}. * * @type {Float32Array} */ this.aabb = math.AABB3(); /** * Indicates if this ````XKTEntity```` shares {@link XKTGeometry}s with other {@link XKTEntity}'s. * * Set by {@link XKTModel#finalize}. * * Note that when an ````XKTEntity```` shares ````XKTGeometrys````, it shares **all** of its ````XKTGeometrys````. An ````XKTEntity```` * never shares only some of its ````XKTGeometrys```` - it always shares either the whole set or none at all. * * @type {Boolean} */ this.hasReusedGeometries = false; } } /** * @desc A box-shaped 3D region within an {@link XKTModel} that contains {@link XKTEntity}s. * * * Created by {@link XKTModel#finalize} * * Stored in {@link XKTModel#tilesList} * * @class XKTTile */ class XKTTile { /** * Creates a new XKTTile. * * @private * @param aabb * @param entities */ constructor(aabb, entities) { /** * Axis-aligned World-space bounding box that encloses the {@link XKTEntity}'s within this Tile. * * @type {Float64Array} */ this.aabb = aabb; /** * The {@link XKTEntity}'s within this XKTTile. * * @type {XKTEntity[]} */ this.entities = entities; } } /** * A kd-Tree node, used internally by {@link XKTModel}. * * @private */ class KDNode { /** * Create a KDNode with an axis-aligned 3D World-space boundary. */ constructor(aabb) { /** * The axis-aligned 3D World-space boundary of this KDNode. * * @type {Float64Array} */ this.aabb = aabb; /** * The {@link XKTEntity}s within this KDNode. */ this.entities = null; /** * The left child KDNode. */ this.left = null; /** * The right child KDNode. */ this.right = null; } } /** * A meta object within an {@link XKTModel}. * * These are plugged together into a parent-child hierarchy to represent structural * metadata for the {@link XKTModel}. * * The leaf XKTMetaObjects are usually associated with * an {@link XKTEntity}, which they do so by sharing the same ID, * ie. where {@link XKTMetaObject#metaObjectId} == {@link XKTEntity#entityId}. * * * Created by {@link XKTModel#createMetaObject} * * Stored in {@link XKTModel#metaObjects} and {@link XKTModel#metaObjectsList} * * Has an ID, a type, and a human-readable name * * May have a parent {@link XKTMetaObject} * * When no children, is usually associated with an {@link XKTEntity} * * @class XKTMetaObject */ class XKTMetaObject { /** * @private * @param metaObjectId * @param propertySetIds * @param metaObjectType * @param metaObjectName * @param parentMetaObjectId */ constructor(metaObjectId, propertySetIds, metaObjectType, metaObjectName, parentMetaObjectId) { /** * Unique ID of this ````XKTMetaObject```` in {@link XKTModel#metaObjects}. * * For a BIM model, this will be an IFC product ID. * * If this is a leaf XKTMetaObject, where it is not a parent to any other XKTMetaObject, * then this will be equal to the ID of an {@link XKTEntity} in {@link XKTModel#entities}, * ie. where {@link XKTMetaObject#metaObjectId} == {@link XKTEntity#entityId}. * * @type {String} */ this.metaObjectId = metaObjectId; /** * Unique ID of one or more property sets that contains additional metadata about this * {@link XKTMetaObject}. The property sets can be stored in an external system, or * within the {@link XKTModel}, as {@link XKTPropertySet}s within {@link XKTModel#propertySets}. * * @type {String[]} */ this.propertySetIds = propertySetIds; /** * Indicates the XKTMetaObject meta object type. * * This defaults to "default". * * @type {string} */ this.metaObjectType = metaObjectType; /** * Indicates the XKTMetaObject meta object name. * * This defaults to {@link XKTMetaObject#metaObjectId}. * * @type {string} */ this.metaObjectName = metaObjectName; /** * The parent XKTMetaObject, if any. * * Will be null if there is no parent. * * @type {String} */ this.parentMetaObjectId = parentMetaObjectId; } } /** * A property set within an {@link XKTModel}. * * These are shared among {@link XKTMetaObject}s. * * * Created by {@link XKTModel#createPropertySet} * * Stored in {@link XKTModel#propertySets} and {@link XKTModel#propertySetsList} * * Has an ID, a type, and a human-readable name * * @class XKTPropertySet */ class XKTPropertySet { /** * @private */ constructor(propertySetId, propertySetType, propertySetName, properties) { /** * Unique ID of this ````XKTPropertySet```` in {@link XKTModel#propertySets}. * * @type {String} */ this.propertySetId = propertySetId; /** * Indicates the ````XKTPropertySet````'s type. * * This defaults to "default". * * @type {string} */ this.propertySetType = propertySetType; /** * Indicates the XKTPropertySet meta object name. * * This defaults to {@link XKTPropertySet#propertySetId}. * * @type {string} */ this.propertySetName = propertySetName; /** * The properties within this ````XKTPropertySet````. * * @type {*[]} */ this.properties = properties; } } /** * Given geometry defined as an array of positions, optional normals, option uv and an array of indices, returns * modified arrays that have duplicate vertices removed. * * @private */ function mergeVertices(positions, indices, mergedPositions, mergedIndices) { const positionsMap = {}; const indicesLookup = []; const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001 const precision = 10 ** precisionPoints; for (let i = 0, len = positions.length; i < len; i += 3) { const vx = positions[i]; const vy = positions[i + 1]; const vz = positions[i + 2]; const key = `${Math.round(vx * precision)}_${Math.round(vy * precision)}_${Math.round(vz * precision)}`; if (positionsMap[key] === undefined) { positionsMap[key] = mergedPositions.length / 3; mergedPositions.push(vx); mergedPositions.push(vy); mergedPositions.push(vz); } indicesLookup[i / 3] = positionsMap[key]; } for (let i = 0, len = indices.length; i < len; i++) { mergedIndices[i] = indicesLookup[indices[i]]; } } const tempVec4a = math.vec4([0, 0, 0, 1]); const tempVec4b = math.vec4([0, 0, 0, 1]); const tempMat4 = math.mat4(); const tempMat4b = math.mat4(); const MIN_TILE_DIAG = 10000; const kdTreeDimLength = new Float64Array(3); /** * A document model that represents the contents of an .XKT file. * * * An XKTModel contains {@link XKTTile}s, which spatially subdivide the model into axis-aligned, box-shaped regions. * * Each {@link XKTTile} contains {@link XKTEntity}s, which represent the objects within its region. * * Each {@link XKTEntity} has {@link XKTMesh}s, which each have a {@link XKTGeometry}. Each {@link XKTGeometry} can be shared by multiple {@link XKTMesh}s. * * Import models into an XKTModel using {@link parseGLTFIntoXKTModel}, {@link parseIFCIntoXKTModel}, {@link parse3DXMLIntoXKTModel}, {@link parseCityJSONIntoXKTModel} etc. * * Build an XKTModel programmatically using {@link XKTModel#createGeometry}, {@link XKTModel#createMesh} and {@link XKTModel#createEntity}. * * Serialize an XKTModel to an ArrayBuffer using {@link writeXKTModelToArrayBuffer}. * * ## Usage * * See [main docs page](/docs/#javascript-api) for usage examples. * * @class XKTModel */ class XKTModel { /** * Constructs a new XKTModel. * * @param {*} [cfg] Configuration * @param {Number} [cfg.edgeThreshold=10] */ constructor(cfg = {}) { /** * The model's ID, if available. * * Will be "default" by default. * * @type {String} */ this.modelId = cfg.modelId || "default"; /** * The project ID, if available. * * Will be an empty string by default. * * @type {String} */ this.projectId = cfg.projectId || ""; /** * The revision ID, if available. * * Will be an empty string by default. * * @type {String} */ this.revisionId = cfg.revisionId || ""; /** * The model author, if available. * * Will be an empty string by default. * * @property author * @type {String} */ this.author = cfg.author || ""; /** * The date the model was created, if available. * * Will be an empty string by default. * * @property createdAt * @type {String} */ this.createdAt = cfg.createdAt || ""; /** * The application that created the model, if available. * * Will be an empty string by default. * * @property creatingApplication * @type {String} */ this.creatingApplication = cfg.creatingApplication || ""; /** * The model schema version, if available. * * In the case of IFC, this could be "IFC2x3" or "IFC4", for example. * * Will be an empty string by default. * * @property schema * @type {String} */ this.schema = cfg.schema || ""; /** * * @type {Number|number} */ this.edgeThreshold = cfg.edgeThreshold || 10; /** * Map of {@link XKTPropertySet}s within this XKTModel, each mapped to {@link XKTPropertySet#propertySetId}. * * Created by {@link XKTModel#createPropertySet}. * * @type {{String:XKTPropertySet}} */ this.propertySets = {}; /** * {@link XKTPropertySet}s within this XKTModel. * * Each XKTPropertySet holds its position in this list in {@link XKTPropertySet#propertySetIndex}. * * Created by {@link XKTModel#finalize}. * * @type {XKTPropertySet[]} */ this.propertySetsList = []; /** * Map of {@link XKTMetaObject}s within this XKTModel, each mapped to {@link XKTMetaObject#metaObjectId}. * * Created by {@link XKTModel#createMetaObject}. * * @type {{String:XKTMetaObject}} */ this.metaObjects = {}; /** * {@link XKTMetaObject}s within this XKTModel. * * Each XKTMetaObject holds its position in this list in {@link XKTMetaObject#metaObjectIndex}. * * Created by {@link XKTModel#finalize}. * * @type {XKTMetaObject[]} */ this.metaObjectsList = []; /** * The positions of all shared {@link XKTGeometry}s are de-quantized using this singular * de-quantization matrix. * * This de-quantization matrix is generated from the collective Local-space boundary of the * positions of all shared {@link XKTGeometry}s. * * @type {Float32Array} */ this.reusedGeometriesDecodeMatrix = new Float32Array(16); /** * Map of {@link XKTGeometry}s within this XKTModel, each mapped to {@link XKTGeometry#geometryId}. * * Created by {@link XKTModel#createGeometry}. * * @type {{Number:XKTGeometry}} */ this.geometries = {}; /** * List of {@link XKTGeometry}s within this XKTModel, in the order they were created. * * Each XKTGeometry holds its position in this list in {@link XKTGeometry#geometryIndex}. * * Created by {@link XKTModel#finalize}. * * @type {XKTGeometry[]} */ this.geometriesList = []; /** * Map of {@link XKTMesh}s within this XKTModel, each mapped to {@link XKTMesh#meshId}. * * Created by {@link XKTModel#createMesh}. * * @type {{Number:XKTMesh}} */ this.meshes = {}; /** * List of {@link XKTMesh}s within this XKTModel, in the order they were created. * * Each XKTMesh holds its position in this list in {@link XKTMesh#meshIndex}. * * Created by {@link XKTModel#finalize}. * * @type {XKTMesh[]} */ this.meshesList = []; /** * Map of {@link XKTEntity}s within this XKTModel, each mapped to {@link XKTEntity#entityId}. * * Created by {@link XKTModel#createEntity}. * * @type {{String:XKTEntity}} */ this.entities = {}; /** * {@link XKTEntity}s within this XKTModel. * * Each XKTEntity holds its position in this list in {@link XKTEntity#entityIndex}. * * Created by {@link XKTModel#finalize}. * * @type {XKTEntity[]} */ this.entitiesList = []; /** * {@link XKTTile}s within this XKTModel. * * Created by {@link XKTModel#finalize}. * * @type {XKTTile[]} */ this.tilesList = []; /** * The axis-aligned 3D World-space boundary of this XKTModel. * * Created by {@link XKTModel#finalize}. * * @type {Float64Array} */ this.aabb = math.AABB3(); /** * Indicates if this XKTModel has been finalized. * * Set ````true```` by {@link XKTModel#finalize}. * * @type {boolean} */ this.finalized = false; } /** * Creates an {@link XKTPropertySet} within this XKTModel. * * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}). * * @param {*} params Method parameters. * @param {String} params.propertySetId Unique ID for the {@link XKTPropertySet}. * @param {String} [params.propertySetType="default"] A meta type for the {@link XKTPropertySet}. * @param {String} [params.propertySetName] Human-readable name for the {@link XKTPropertySet}. Defaults to the ````propertySetId```` parameter. * @param {String[]} params.properties Properties for the {@link XKTPropertySet}. * @returns {XKTPropertySet} The new {@link XKTPropertySet}. */ createPropertySet(params) { if (!params) { throw "Parameters expected: params"; } if (params.propertySetId === null || params.propertySetId === undefined) { throw "Parameter expected: params.propertySetId"; } if (params.properties === null || params.properties === undefined) { throw "Parameter expected: params.properties"; } if (this.finalized) { console.error("XKTModel has been finalized, can't add more property sets"); return; } if (this.propertySets[params.propertySetId]) { // console.error("XKTPropertySet already exists with this ID: " + params.propertySetId); return; } const propertySetId = params.propertySetId; const propertySetType = params.propertySetType || "Default"; const propertySetName = params.propertySetName || params.propertySetId; const properties = params.properties || []; const propertySet = new XKTPropertySet(propertySetId, propertySetType, propertySetName, properties); this.propertySets[propertySetId] = propertySet; this.propertySetsList.push(propertySet); return propertySet; } /** * Creates an {@link XKTMetaObject} within this XKTModel. * * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}). * * @param {*} params Method parameters. * @param {String} params.metaObjectId Unique ID for the {@link XKTMetaObject}. * @param {String} params.propertySetIds ID of one or more property sets that contains additional metadata about * this {@link XKTMetaObject}. The property sets could be stored externally (ie not managed at all by the XKT file), * or could be {@link XKTPropertySet}s within {@link XKTModel#propertySets}. * @param {String} [params.metaObjectType="default"] A meta type for the {@link XKTMetaObject}. Can be anything, * but is usually an IFC type, such as "IfcSite" or "IfcWall". * @param {String} [params.metaObjectName] Human-readable name for the {@link XKTMetaObject}. Defaults to the ````metaObjectId```` parameter. * @param {String} [params.parentMetaObjectId] ID of the parent {@link XKTMetaObject}, if any. Defaults to the ````metaObjectId```` parameter. * @returns {XKTMetaObject} The new {@link XKTMetaObject}. */ createMetaObject(params) { if (!params) { throw "Parameters expected: params"; } if (params.metaObjectId === null || params.metaObjectId === undefined) { throw "Parameter expected: params.metaObjectId"; } if (this.finalized) { console.error("XKTModel has been finalized, can't add more meta objects"); return; } if (this.metaObjects[params.metaObjectId]) { // console.error("XKTMetaObject already exists with this ID: " + params.metaObjectId); return; } const metaObjectId = params.metaObjectId; const propertySetIds = params.propertySetIds; const metaObjectType = params.metaObjectType || "Default"; const metaObjectName = params.metaObjectName || params.metaObjectId; const parentMetaObjectId = params.parentMetaObjectId; const metaObject = new XKTMetaObject(metaObjectId, propertySetIds, metaObjectType, metaObjectName, parentMetaObjectId); this.metaObjects[metaObjectId] = metaObject; this.metaObjectsList.push(metaObject); if (!parentMetaObjectId) { if (!this._rootMetaObject) { this._rootMetaObject = metaObject; } } return metaObject; } /** * Creates an {@link XKTGeometry} within this XKTModel. * * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}). * * @param {*} params Method parameters. * @param {Number} params.geometryId Unique ID for the {@link XKTGeometry}. * @param {String} params.primitiveType The type of {@link XKTGeometry}: "triangles", "lines" or "points". * @param {Float64Array} params.positions Floating-point Local-space vertex positions for the {@link XKTGeometry}. Required for all primitive types. * @param {Number[]} [params.normals] Floating-point vertex normals for the {@link XKTGeometry}. Only used with triangles primitives. Ignored for points and lines. * @param {Number[]} [params.colors] Floating-point RGBA vertex colors for the {@link XKTGeometry}. Required for points primitives. Ignored for lines and triangles. * @param {Number[]} [params.colorsCompressed] Integer RGBA vertex colors for the {@link XKTGeometry}. Required for points primitives. Ignored for lines and triangles. * @param {Uint32Array} [params.indices] Indices for the {@link XKTGeometry}. Required for triangles and lines primitives. Ignored for points. * @param {Number} [params.edgeThreshold=10] * @returns {XKTGeometry} The new {@link XKTGeometry}. */ createGeometry(params) { if (!params) { throw "Parameters expected: params"; } if (params.geometryId === null || params.geometryId === undefined) { throw "Parameter expected: params.geometryId"; } if (!params.primitiveType) { throw "Parameter expected: params.primitiveType"; } if (!params.positions) { throw "Parameter expected: params.positions"; } const triangles = params.primitiveType === "triangles"; const points = params.primitiveType === "points"; const lines = params.primitiveType === "lines"; if (!triangles && !points && !lines) { throw "Unsupported value for params.primitiveType: " + params.primitiveType + "' - supported values are 'triangles', 'points' and 'lines'"; } if (triangles) { if (!params.indices) { throw "Parameter expected for 'triangles' primitive: params.indices"; } } if (points) { if (!params.colors && !params.colorsCompressed) { throw "Parameter expected for 'points' primitive: params.colors or params.colorsCompressed"; } } if (lines) { if (!params.indices) { throw "Parameter expected for 'lines' primitive: params.indices"; } } if (this.finalized) { console.error("XKTModel has been finalized, can't add more geometries"); return; } if (this.geometries[params.geometryId]) { console.error("XKTGeometry already exists with this ID: " + params.geometryId); return; } const geometryId = params.geometryId; const primitiveType = params.primitiveType; const positions = new Float64Array(params.positions); // May modify in #finalize const xktGeometryCfg = { geometryId: geometryId, geometryIndex: this.geometriesList.length, primitiveType: primitiveType, positions: positions }; if (triangles) { if (params.normals) { xktGeometryCfg.normals = new Float32Array(params.normals); } xktGeometryCfg.indices = params.indices; } if (points) { if (params.colorsCompressed) { xktGeometryCfg.colorsCompressed = new Uint8Array(params.colorsCompressed); } else { const colors = params.colors; const colorsCompressed = new Uint8Array(colors.length); for (let i = 0, len = colors.length; i < len; i++) { colorsCompressed[i] = Math.floor(colors[i] * 255); } xktGeometryCfg.colorsCompressed = colorsCompressed; } } if (lines) { xktGeometryCfg.indices = params.indices; } if (triangles) { if (!params.normals) { // Building models often duplicate positions to allow face-aligned vertex normals; when we're not // providing normals for a geometry, it becomes possible to merge duplicate vertex positions within it. // TODO: Make vertex merging also merge normals? const mergedPositions = []; const mergedIndices = []; mergeVertices(xktGeometryCfg.positions, xktGeometryCfg.indices, mergedPositions, mergedIndices); xktGeometryCfg.positions = new Float64Array(mergedPositions); xktGeometryCfg.indices = mergedIndices; } xktGeometryCfg.edgeIndices = buildEdgeIndices(xktGeometryCfg.positions, xktGeometryCfg.indices, null, params.edgeThreshold || this.edgeThreshold || 10); } const geometry = new XKTGeometry(xktGeometryCfg); this.geometries[geometryId] = geometry; this.geometriesList.push(geometry); return geometry; } /** * Creates an {@link XKTMesh} within this XKTModel. * * An {@link XKTMesh} can be owned by one {@link XKTEntity}, which can own multiple {@link XKTMesh}es. * * @param {*} params Method parameters. * @param {Number} params.meshId Unique ID for the {@link XKTMesh}. * @param {Number} params.geometryId ID of an existing {@link XKTGeometry} in {@link XKTModel#geometries}. * @param {Uint8Array} params.color RGB color for the {@link XKTMesh}, with each color component in range [0..1]. * @param {Number} [params.metallic=0] How metallic the {@link XKTMesh} is, in range [0..1]. A value of ````0```` indicates fully dielectric material, while ````1```` indicates fully metallic. * @param {Number} [params.roughness=1] How rough the {@link XKTMesh} is, in range [0..1]. A value of ````0```` indicates fully smooth, while ````1```` indicates fully rough. * @param {Number} params.opacity Opacity factor for the {@link XKTMesh}, in range [0..1]. * @param {Float64Array} [params.matrix] Modeling matrix for the {@link XKTMesh}. Overrides ````position````, ````scale```` and ````rotation```` parameters. * @param {Number[]} [params.position=[0,0,0]] Position of the {@link XKTMesh}. Overridden by the ````matrix```` parameter. * @param {Number[]} [params.scale=[1,1,1]] Scale of the {@link XKTMesh}. Overridden by the ````matrix```` parameter. * @param {Number[]} [params.rotation=[0,0,0]] Rotation of the {@link XKTMesh} as Euler angles given in degrees, for each of the X, Y and Z axis. Overridden by the ````matrix```` parameter. * @returns {XKTMesh} The new {@link XKTMesh}. */ createMesh(params) { if (params.meshId === null || params.meshId === undefined) { throw "Parameter expected: params.meshId"; } if (params.geometryId === null || params.geometryId === undefined) { throw "Parameter expected: params.geometryId"; } if (this.finalized) { throw "XKTModel has been finalized, can't add more meshes"; } if (this.meshes[params.meshId]) { console.error("XKTMesh already exists with this ID: " + params.meshId); return; } const geometry = this.geometries[params.geometryId]; if (!geometry) { console.error("XKTGeometry not found: " + params.geometryId); return; } geometry.numInstances++; let matrix = params.matrix; if (!matrix) { const position = params.position; const scale = params.scale; const rotation = params.rotation; if (position || scale || rotation) { matrix = math.identityMat4(); const quaternion = math.eulerToQuaternion(rotation || [0, 0, 0], "XYZ", math.identityQuaternion()); math.composeMat4(position || [0, 0, 0], quaternion, scale || [1, 1, 1], matrix); } else { matrix = math.identityMat4(); } } const meshIndex = this.meshesList.length; const mesh = new XKTMesh({ meshId: params.meshId, meshIndex: meshIndex, matrix: matrix, geometry: geometry, color: params.color, metallic: params.metallic, roughness: params.roughness, opacity: params.opacity }); this.meshes[mesh.meshId] = mesh; this.meshesList.push(mesh); return mesh; } /** * Creates an {@link XKTEntity} within this XKTModel. * * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}). * * @param {*} params Method parameters. * @param {String} params.entityId Unique ID for the {@link XKTEntity}. * @param {String[]} params.meshIds IDs of {@link XKTMesh}es used by the {@link XKTEntity}. Note that each {@link XKTMesh} can only be used by one {@link XKTEntity}. * @returns {XKTEntity} The new {@link XKTEntity}. */ createEntity(params) { if (!params) { throw "Parameters expected: params"; } if (params.entityId === null || params.entityId === undefined) { throw "Parameter expected: params.entityId"; } if (!params.meshIds) { throw "Parameter expected: params.meshIds"; } if (this.finalized) { console.error("XKTModel has been finalized, can't add more entities"); return; } if (params.meshIds.length === 0) { console.warn("XKTEntity has no meshes - won't create: " + params.entityId); return; } if (this.entities[params.entityId]) { console.error("XKTEntity already exists with this ID: " + params.entityId); return; } const entityId = params.entityId; const meshIds = params.meshIds; const meshes = []; for (let meshIdIdx = 0, meshIdLen = meshIds.length; meshIdIdx < meshIdLen; meshIdIdx++) { const meshId = meshIds[meshIdIdx]; const mesh = this.meshes[meshId]; if (!mesh) { console.error("XKTMesh found: " + meshId); continue; } if (mesh.entity) { console.error("XKTMesh " + meshId + " already used by XKTEntity " + mesh.entity.entityId); continue; } meshes.push(mesh); } const entity = new XKTEntity(entityId, meshes); for (let i = 0, len = meshes.length; i < len; i++) { const mesh = meshes[i]; mesh.entity = entity; } this.entities[entityId] = entity; this.entitiesList.push(entity); return entity; } /** * Creates a default {@link XKTMetaObject} for each {@link XKTEntity} that does not already have one. */ createDefaultMetaObjects() { for (let i = 0, len = this.entitiesList.length; i < len; i++) { const entity = this.entitiesList[i]; const metaObjectId = entity.entityId; const metaObject = this.metaObjects[metaObjectId]; if (!metaObject) { if (!this._rootMetaObject) { this._rootMetaObject = this.createMetaObject({ metaObjectId: this.modelId, metaObjectType: "Default", metaObjectName: this.modelId }); } this.createMetaObject({ metaObjectId: metaObjectId, metaObjectType: "Default", metaObjectName: "" + metaObjectId, parentMetaObjectId: this._rootMetaObject.metaObjectId }); } } } /** * Finalizes this XKTModel. * * After finalizing, we may then serialize the model to an array buffer using {@link writeXKTModelToArrayBuffer}. * * Logs error and does nothing if this XKTModel has already been finalized. * * Internally, this method: * * * for each {@link XKTEntity} that doesn't already have a {@link XKTMetaObject}, creates one with {@link XKTMetaObject#metaObjectType} set to "default" * * sets each {@link XKTEntity}'s {@link XKTEntity#hasReusedGeometries} true if it shares its {@link XKTGeometry}s with other {@link XKTEntity}s, * * creates each {@link XKTEntity}'s {@link XKTEntity#aabb}, * * creates {@link XKTTile}s in {@link XKTModel#tilesList}, and * * sets {@link XKTModel#finalized} ````true````. */ finalize() { if (this.finalized) { console.log("XKTModel already finalized"); return; } this._bakeSingleUseGeometryPositions(); this._bakeAndOctEncodeNormals(); this._createEntityAABBs(); const rootKDNode = this._createKDTree(); this.entitiesList = []; this._createTilesFromKDTree(rootKDNode); this._createReusedGeometriesDecodeMatrix(); this._flagSolidGeometries(); this.aabb.set(rootKDNode.aabb); this.finalized = true; } _bakeSingleUseGeometryPositions() { for (let j = 0, lenj = this.meshesList.length; j < lenj; j++) { const mesh = this.meshesList[j]; const geometry = mesh.geometry; if (geometry.numInstances === 1) { const matrix = mesh.matrix; if (matrix && (!math.isIdentityMat4(matrix))) { const positions = geometry.positions; for (let i = 0, len = positions.length; i < len; i += 3) { tempVec4a[0] = positions[i + 0]; tempVec4a[1] = positions[i + 1]; tempVec4a[2] = positions[i + 2]; tempVec4a[3] = 1; math.transformPoint4(matrix, tempVec4a, tempVec4b); positions[i + 0] = tempVec4b[0]; positions[i + 1] = tempVec4b[1]; positions[i + 2] = tempVec4b[2]; } } } } } _bakeAndOctEncodeNormals() { for (let i = 0, len = this.meshesList.length; i < len; i++) { const mesh = this.meshesList[i]; const geometry = mesh.geometry; if (geometry.normals && !geometry.normalsOctEncoded) { geometry.normalsOctEncoded = new Int8Array(geometry.normals.length); if (geometry.numInstances > 1) { geometryCompression.octEncodeNormals(geometry.normals, geometry.normals.length, geometry.normalsOctEncoded, 0); } else { const modelNormalMatrix = math.inverseMat4(math.transposeMat4(mesh.matrix, tempMat4), tempMat4b); geometryCompression.transformAndOctEncodeNormals(modelNormalMatrix, geometry.normals, geometry.normals.length, geometry.normalsOctEncoded, 0); } } } } _createEntityAABBs() { for (let i = 0, len = this.entitiesList.length; i < len; i++) { const entity = this.entitiesList[i]; const entityAABB = entity.aabb; const meshes = entity.meshes; math.collapseAABB3(entityAABB); for (let j = 0, lenj = meshes.length; j < lenj; j++) { const mesh = meshes[j]; const geometry = mesh.geometry; const matrix = mesh.matrix; if (geometry.numInstances > 1) { const positions = geometry.positions; for (let i = 0, len = positions.length; i < len; i += 3) { tempVec4a[0] = positions[i + 0]; tempVec4a[1] = positions[i + 1]; tempVec4a[2] = positions[i + 2]; tempVec4a[3] = 1; math.transformPoint4(matrix, tempVec4a, tempVec4b); math.expandAABB3Point3(entityAABB, tempVec4b); } } else { const positions = geometry.positions; for (let i = 0, len = positions.length; i < len; i += 3) { tempVec4a[0] = positions[i + 0]; tempVec4a[1] = positions[i + 1]; tempVec4a[2] = positions[i + 2]; math.expandAABB3Point3(entityAABB, tempVec4a); } } } } } _createKDTree() { const aabb = math.collapseAABB3(); for (let i = 0, len = this.entitiesList.length; i < len; i++) { const entity = this.entitiesList[i]; math.expandAABB3(aabb, entity.aabb); } const rootKDNode = new KDNode(aabb); for (let i = 0, len = this.entitiesList.length; i < len; i++) { const entity = this.entitiesList[i]; this._insertEntityIntoKDTree(rootKDNode, entity); } return rootKDNode; } _insertEntityIntoKDTree(kdNode, entity) { const nodeAABB = kdNode.aabb; const entityAABB = entity.aabb; const nodeAABBDiag = math.getAABB3Diag(nodeAABB); if (nodeAABBDiag < MIN_TILE_DIAG) { kdNode.entities = kdNode.entities || []; kdNode.entities.push(entity); math.expandAABB3(nodeAABB, entityAABB); return; } if (kdNode.left) { if (math.containsAABB3(kdNode.left.aabb, entityAABB)) { this._insertEntityIntoKDTree(kdNode.left, entity); return; } } if (kdNode.right) { if (math.containsAABB3(kdNode.right.aabb, entityAABB)) { this._insertEntityIntoKDTree(kdNode.right, entity); return; } } kdTreeDimLength[0] = nodeAABB[3] - nodeAABB[0]; kdTreeDimLength[1] = nodeAABB[4] - nodeAABB[1]; kdTreeDimLength[2] = nodeAABB[5] - nodeAABB[2]; let dim = 0; if (kdTreeDimLength[1] > kdTreeDimLength[dim]) { dim = 1; } if (kdTreeDimLength[2] > kdTreeDimLength[dim]) { dim = 2; } if (!kdNode.left) { const aabbLeft = nodeAABB.slice(); aabbLeft[dim + 3] = ((nodeAABB[dim] + nodeAABB[dim + 3]) / 2.0); kdNode.left = new KDNode(aabbLeft); if (math.containsAABB3(aabbLeft, entityAABB)) { this._insertEntityIntoKDTree(kdNode.left, entity); return; } } if (!kdNode.right) { const aabbRight = nodeAABB.slice(); aabbRight[dim] = ((nodeAABB[dim] + nodeAABB[dim + 3]) / 2.0); kdNode.right = new KDNode(aabbRight); if (math.containsAABB3(aabbRight, entityAABB)) { this._insertEntityIntoKDTree(kdNode.right, entity); return; } } kdNode.entities = kdNode.entities || []; kdNode.entities.push(entity); math.expandAABB3(nodeAABB, entityAABB); } _createTilesFromKDTree(rootKDNode) { this._createTilesFromKDNode(rootKDNode); } _createTilesFromKDNode(kdNode) { if (kdNode.entities && kdNode.entities.length > 0) { this._createTileFromEntities(kdNode.entities); } if (kdNode.left) { this._createTilesFromKDNode(kdNode.left); } if (kdNode.right) { this._createTilesFromKDNode(kdNode.right); } } /** * Creates a tile from the given entities. * * For each single-use {@link XKTGeometry}, this method centers {@link XKTGeometry#positions} to make them relative to the * tile's center, then quantizes the positions to unsigned 16-bit integers, relative to the tile's boundary. * * @param entities */ _createTileFromEntities(entities) { const tileAABB = math.AABB3(); // A tighter World-space AABB around the entities math.collapseAABB3(tileAABB); for (let i = 0; i < entities.length; i++) { const entity = entities [i]; math.expandAABB3(tileAABB, entity.aabb); } const tileCenter = math.getAABB3Center(tileAABB); const tileCenterNeg = math.mulVec3Scalar(tileCenter, -1, math.vec3()); const rtcAABB = math.AABB3(); // AABB centered at the RTC origin rtcAABB[0] = tileAABB[0] - tileCenter[0]; rtcAABB[1] = tileAABB[1] - tileCenter[1]; rtcAABB[2] = tileAABB[2] - tileCenter[2]; rtcAABB[3] = tileAABB[3] - tileCenter[0]; rtcAABB[4] = tileAABB[4] - tileCenter[1]; rtcAABB[5] = tileAABB[5] - tileCenter[2]; for (let i = 0; i < entities.length; i++) { const entity = entities [i]; const meshes = entity.meshes; for (let j = 0, lenj = meshes.length; j < lenj; j++) { const mesh = meshes[j]; const geometry = mesh.geometry; if (!geometry.reused) { const positions = geometry.positions; // Center positions relative to their tile's World-space center for (let k = 0, lenk = positions.length; k < lenk; k += 3) { positions[k + 0] -= tileCenter[0]; positions[k + 1] -= tileCenter[1]; positions[k + 2] -= tileCenter[2]; } // Quantize positions relative to tile's RTC-space boundary geometryCompression.quantizePositions(positions, positions.length, rtcAABB, geometry.positionsQuantized); } else { // Post-multiply a translation to the mesh's modeling matrix // to center the entity's geometry instances to the tile RTC center math.translateMat4v(tileCenterNeg, mesh.matrix); } } entity.entityIndex = this.entitiesList.length; this.entitiesList.push(entity); } const tile = new XKTTile(tileAABB, entities); this.tilesList.push(tile); } _createReusedGeometriesDecodeMatrix() { const tempVec3a = math.vec3(); const reusedGeometriesAABB = math.collapseAABB3(math.AABB3()); let countReusedGeometries = 0; for (let geometryIndex = 0, numGeometries = this.geometriesList.length; geometryIndex < numGeometries; geometryIndex++) { const geometry = this.geometriesList [geometryIndex]; if (geometry.reused) { const positions = geometry.positions; for (let i = 0, len = positions.length; i < len; i += 3) { tempVec3a[0] = positions[i]; tempVec3a[1] = positions[i + 1]; tempVec3a[2] = positions[i + 2]; math.expandAABB3Point3(reusedGeometriesAABB, tempVec3a); } countReusedGeometries++; } } if (countReusedGeometries > 0) { geometryCompression.createPositionsDecodeMatrix(reusedGeometriesAABB, this.reusedGeometriesDecodeMatrix); for (let geometryIndex = 0, numGeometries = this.geometriesList.length; geometryIndex < numGeometries; geometryIndex++) { const geometry = this.geometriesList [geometryIndex]; if (geometry.reused) { geometryCompression.quantizePositions(geometry.positions, geometry.positions.length, reusedGeometriesAABB, geometry.positionsQuantized); } } } else { math.identityMat4(this.reusedGeometriesDecodeMatrix); // No need for this matrix, but we'll be tidy and set it to identity } } _flagSolidGeometries() { for (let i = 0, len = this.geometriesList.length; i < len; i++) { const geometry = this.geometriesList[i]; if (geometry.primitiveType === "triangles") { geometry.solid = isTriangleMeshSolid(geometry.indices, geometry.positionsQuantized); // Better memory/cpu performance with quantized values } } } } const fs = require('fs'); const DOMParser$1 = require('xmldom').DOMParser; /** * Converts model files into xeokit's native XKT format. * * Supported source formats are: IFC, CityJSON, 3DXML, glTF, LAZ and LAS. * * @param {Object} params Conversion parameters. * @param {String} [params.source] Path to source file. Alternative to ````sourceData````. * @param {ArrayBuffer|JSON} [params.sourceData] Source file data. Alternative to ````source````. * @param {String} [params.sourceFormat] Format of source file/data. Always needed with ````sourceData````, but not normally needed with ````source````, because convert2xkt will determine the format automatically from the file extension of ````source````. * @param {ArrayBuffer|JSON} [params.metaModelData] Source file data. Overrides metadata from ````metaModelSource````, ````sourceData```` and ````source````. * @param {String} [params.metaModelSource] Path to source metaModel file. Overrides metadata from ````sourceData```` and ````source````. Overridden by ````metaModelData````. * @param {String} [params.output] Path to destination XKT file. Directories on this path are automatically created if not existing. * @param {Function} [params.outputXKTModel] Callback to collect the ````XKTModel```` that is internally build by this method. * @param {Function} [params.outputXKT] Callback to collect XKT file data. * @param {String[]} [params.includeTypes] Option to only convert objects of these types. * @param {String[]} [params.excludeTypes] Option to never convert objects of these types. * @param {Object} [stats] Collects conversion statistics. Statistics are attached to this object if provided. * @param {Function} [params.outputStats] Callback to collect statistics. * @param {Boolean} [params.rotateX=true] Whether to rotate the model 90 degrees about the X axis to make the Y axis "up", if necessary. Applies to CityJSON and LAS/LAZ models. * @param {Function} [params.log] Logging callback. * @return {Promise} */ function convert2xkt({ source, sourceData, sourceFormat, metaModelSource, metaModelData, output, outputXKTModel, outputXKT, includeTypes, excludeTypes, stats = {}, outputStats, rotateX, log = (msg) => { } }) { stats.sourceFormat = ""; stats.schemaVersion = ""; stats.title = ""; stats.author = ""; stats.created = ""; stats.numMetaObjects = 0; stats.numPropertySets = 0; stats.numTriangles = 0; stats.numVertices = 0; stats.numObjects = 0; stats.numGeometries = 0; stats.sourceSize = 0; stats.xktSize = 0; stats.compressionRatio = 0; stats.conversionTime = 0; stats.aabb = null; return new Promise(function (resolve, reject) { const _log = log; log = (msg) => { _log("[convert2xkt] " + msg); }; if (!source && !sourceData) { reject("Argument expected: source or sourceData"); return; } if (!sourceFormat && sourceData) { reject("Argument expected: sourceFormat is required with sourceData"); return; } if (!output && !outputXKTModel && !outputXKT) { reject("Argument expected: output, outputXKTModel or outputXKT"); return; } if (source) { log('Reading input file: ' + source); } const startTime = new Date(); const ext = sourceFormat || source.split('.').pop(); if (!sourceData) { try { sourceData = fs.readFileSync(source); } catch (err) { reject(err); return; } } const sourceFileSizeBytes = sourceData.byteLength; log("Input file size: " + (sourceFileSizeBytes / 1000).toFixed(2) + " kB"); if (!metaModelData && metaModelSource) { try { const metaModelFileData = fs.readFileSync(metaModelSource); metaModelData = JSON.parse(metaModelFileData); } catch (err) { reject(err); return; } } log("Converting..."); const xktModel = new XKTModel(); if (metaModelData) { parseMetaModelIntoXKTModel({metaModelData, xktModel}).then( () => { convertForFormat(); }, (errMsg) => { reject(errMsg); }); } else { convertForFormat(); } function convertForFormat() { switch (ext) { case "json": convert(parseCityJSONIntoXKTModel, { data: JSON.parse(sourceData), xktModel, stats, rotateX, log }); break; case "gltf": const gltfBasePath = source ? getBasePath(source) : ""; convert(parseGLTFIntoXKTModel, { data: JSON.parse(sourceData), xktModel, getAttachment: async (name) => { return fs.readFileSync(gltfBasePath + name); }, stats, log }); break; case "ifc": convert(parseIFCIntoXKTModel, { data: sourceData, xktModel, wasmPath: "./", includeTypes, excludeTypes, stats, log }); break; case "laz": convert(parseLASIntoXKTModel, { data: sourceData, xktModel, stats, rotateX, log }); break; case "las": convert(parseLASIntoXKTModel, { data: sourceData, xktModel, stats, log }); break; case "pcd": convert(parsePCDIntoXKTModel, { data: sourceData, xktModel, stats, log }); break; case "ply": convert(parsePLYIntoXKTModel, { data: sourceData, xktModel, stats, log }); break; case "stl": convert(parseSTLIntoXKTModel, { data: sourceData, xktModel, stats, log }); break; case "3dxml": const domParser = new DOMParser$1(); convert(parse3DXMLIntoXKTModel, { data: sourceData, domParser, xktModel, stats, log }); break; default: reject('Error: unsupported source format: "${ext}".'); return; } } function convert(parser, converterParams) { parser(converterParams).then(() => { xktModel.createDefaultMetaObjects(); xktModel.finalize(); const xktArrayBuffer = writeXKTModelToArrayBuffer(xktModel); const xktContent = Buffer.from(xktArrayBuffer); const targetFileSizeBytes = xktArrayBuffer.byteLength; stats.sourceSize = (sourceFileSizeBytes / 1000).toFixed(2); stats.xktSize = (targetFileSizeBytes / 1000).toFixed(2); stats.compressionRatio = (sourceFileSizeBytes / targetFileSizeBytes).toFixed(2); stats.conversionTime = ((new Date() - startTime) / 1000.0).toFixed(2); stats.aabb = xktModel.aabb; log("Converted to: XKT v9"); if (includeTypes) { log("Include types: " + (includeTypes ? includeTypes : "(include all)")); } if (excludeTypes) { log("Exclude types: " + (excludeTypes ? excludeTypes : "(exclude none)")); } log("XKT size: " + stats.xktSize + " kB"); log("Compression ratio: " + stats.compressionRatio); log("Conversion time: " + stats.conversionTime + " s"); log("Converted metaobjects: " + stats.numMetaObjects); log("Converted property sets: " + stats.numPropertySets); log("Converted drawable objects: " + stats.numObjects); log("Converted geometries: " + stats.numGeometries); log("Converted triangles: " + stats.numTriangles); log("Converted vertices: " + stats.numVertices); if (output) { const outputDir = getBasePath(output).trim(); if (outputDir !== "" && !fs.existsSync(outputDir)) { fs.mkdirSync(outputDir, {recursive: true}); } log('Writing XKT file: ' + output); fs.writeFileSync(output, xktContent); } if (outputXKTModel) { outputXKTModel(xktModel); } if (outputXKT) { outputXKT(xktContent); } if (outputStats) { outputStats(stats); } resolve(); }, (err) => { reject(err); }); } }); } function getBasePath(src) { const i = src.lastIndexOf("/"); return (i !== 0) ? src.substring(0, i + 1) : ""; } module.exports = convert2xkt;