@mindfiredigital/pivothead
Version:
PivotHead is a powerful and flexible library for creating interactive pivot tables in JavaScript applications. It provides a core engine for data manipulation and, in the future, will be compatible with wrappers for React, Vue, Svelte, and Angular, making
2 lines (1 loc) • 6.09 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=-8,j=-4,$=1,d=2,ct=1,E=2,p=4,st=6,Z=2048,H=4096,ut=16384,ft=0,N=4,k=8,lt=12,X=12,_t=16,yt="Operation requires compiling with --exportTable",At="Operation requires compiling with --exportRuntime",U=()=>{throw Error(At)},gt=typeof BigUint64Array<"u",F=Symbol(),wt=192,q=1024,bt=new TextDecoder("utf-16le",{fatal:!0});Object.hasOwn=Object.hasOwn||function(t,s){return Object.prototype.hasOwnProperty.call(t,s)};function z(t,s){let o=new Uint32Array(t)[s+j>>>2]>>>1;const r=new Uint16Array(t,s,o);if(o<=wt)return String.fromCharCode(...r);try{return bt.decode(r)}catch{let a="",u=0;for(;o-u>q;)a+=String.fromCharCode(...r.subarray(u,u+=q));return a+String.fromCharCode(...r.subarray(u))}}function L(t){const s={};function o(a,u){return a?z(a.buffer,u):"<yet unknown>"}const r=t.env=t.env||{};return r.abort=r.abort||function(u,f,l,w){const y=s.memory||r.memory;throw Error(`abort: ${o(y,u)} at ${o(y,f)}:${l}:${w}`)},r.trace=r.trace||function(u,f,...l){const w=s.memory||r.memory;console.log(`trace: ${o(w,u)}${f?" ":""}${l.slice(0,f).join(", ")}`)},r.seed=r.seed||Date.now,t.Math=t.Math||Math,t.Date=t.Date||Date,s}function V(t,s){const o=s.exports,r=o.memory,a=o.table,u=o.__new||U,f=o.__pin||U,l=o.__unpin||U,w=o.__collect||U,y=o.__rtti_base,m=y?n=>n[y>>>2]:U;t.__new=u,t.__pin=f,t.__unpin=l,t.__collect=w;function A(n){const e=new Uint32Array(r.buffer);if((n>>>=0)>=m(e))throw Error(`invalid id: ${n}`);return e[(y+4>>>2)+n]}function g(n){const e=A(n);if(!(e&(ct|E|p)))throw Error(`not an array: ${n}, flags=${e}`);return e}function I(n){return 31-Math.clz32(n>>>st&31)}function x(n){if(n==null)return 0;const e=n.length,c=u(e<<1,d),i=new Uint16Array(r.buffer);for(let _=0,b=c>>>1;_<e;++_)i[b+_]=n.charCodeAt(_);return c}t.__newString=x;function tt(n){if(n==null)return 0;const e=new Uint8Array(n),c=u(e.length,$);return new Uint8Array(r.buffer).set(e,c),c}t.__newArrayBuffer=tt;function nt(n){if(!n)return null;const e=r.buffer;if(new Uint32Array(e)[n+G>>>2]!==d)throw Error(`not a string: ${n}`);return z(e,n)}t.__getString=nt;function Y(n,e,c){const i=r.buffer;if(c)switch(n){case 2:return new Float32Array(i);case 3:return new Float64Array(i)}else switch(n){case 0:return new(e?Int8Array:Uint8Array)(i);case 1:return new(e?Int16Array:Uint16Array)(i);case 2:return new(e?Int32Array:Uint32Array)(i);case 3:return new(e?BigInt64Array:BigUint64Array)(i)}throw Error(`unsupported align: ${n}`)}function et(n,e=0){const c=e,i=g(n),_=I(i),b=typeof c!="number",O=b?c.length:c,S=u(O<<_,i&p?n:$);let B;if(i&p)B=S;else{f(S);const h=u(i&E?_t:lt,n);l(S);const R=new Uint32Array(r.buffer);R[h+ft>>>2]=S,R[h+N>>>2]=S,R[h+k>>>2]=O<<_,i&E&&(R[h+X>>>2]=O),B=h}if(b){const h=Y(_,i&Z,i&H),R=S>>>_;if(i&ut)for(let T=0;T<O;++T)h[R+T]=c[T];else h.set(c,R)}return B}t.__newArray=et;function C(n){const e=new Uint32Array(r.buffer),c=e[n+G>>>2],i=g(c),_=I(i);let b=i&p?n:e[n+N>>>2];const O=i&E?e[n+X>>>2]:e[b+j>>>2]>>>_;return Y(_,i&Z,i&H).subarray(b>>>=_,b+O)}t.__getArrayView=C;function rt(n){const e=C(n),c=e.length,i=new Array(c);for(let _=0;_<c;_++)i[_]=e[_];return i}t.__getArray=rt;function it(n){const e=r.buffer,c=new Uint32Array(e)[n+j>>>2];return e.slice(n,n+c)}t.__getArrayBuffer=it;function ot(n){if(!a)throw Error(yt);const e=new Uint32Array(r.buffer)[n>>>2];return a.get(e)}t.__getFunction=ot;function at(n,e,c){return new n(P(n,e,c))}function P(n,e,c){const i=r.buffer,_=new Uint32Array(i);return new n(i,_[c+N>>>2],_[c+k>>>2]>>>e)}function v(n,e,c){t[`__get${e}`]=at.bind(null,n,c),t[`__get${e}View`]=P.bind(null,n,c)}return[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array].forEach(n=>{v(n,n.name,31-Math.clz32(n.BYTES_PER_ELEMENT))}),gt&&[BigUint64Array,BigInt64Array].forEach(n=>{v(n,n.name.slice(3),3)}),t.memory=t.memory||r,t.table=t.table||a,W(o,t)}function K(t){return typeof Response<"u"&&t instanceof Response}function J(t){return t instanceof WebAssembly.Module}async function M(t,s={}){if(K(t=await t))return D(t,s);const o=J(t)?t:await WebAssembly.compile(t),r=L(s),a=await WebAssembly.instantiate(o,s),u=V(r,a);return{module:o,instance:a,exports:u}}function Q(t,s={}){const o=J(t)?t:new WebAssembly.Module(t),r=L(s),a=new WebAssembly.Instance(o,s),u=V(r,a);return{module:o,instance:a,exports:u}}async function D(t,s={}){if(!WebAssembly.instantiateStreaming)return M(K(t=await t)?t.arrayBuffer():t,s);const o=L(s),r=await WebAssembly.instantiateStreaming(t,s),a=V(o,r.instance);return{...r,exports:a}}function W(t,s={}){const o=t.__argumentsLength?r=>{t.__argumentsLength.value=r}:t.__setArgumentsLength||t.__setargc||(()=>{});for(let r of Object.keys(t)){const a=t[r];let u=r.split("."),f=s;for(;u.length>1;){let y=u.shift();Object.hasOwn(f,y)||(f[y]={}),f=f[y]}let l=u[0],w=l.indexOf("#");if(w>=0){const y=l.substring(0,w),m=f[y];if(typeof m>"u"||!m.prototype){const A=function(...g){return A.wrap(A.prototype.constructor(0,...g))};A.prototype={valueOf(){return this[F]}},A.wrap=function(g){return Object.create(A.prototype,{[F]:{value:g,writable:!1}})},m&&Object.getOwnPropertyNames(m).forEach(g=>Object.defineProperty(A,g,Object.getOwnPropertyDescriptor(m,g))),f[y]=A}if(l=l.substring(w+1),f=f[y].prototype,/^(get|set):/.test(l)){if(!Object.hasOwn(f,l=l.substring(4))){let A=t[r.replace("set:","get:")],g=t[r.replace("get:","set:")];Object.defineProperty(f,l,{get(){return A(this[F])},set(I){g(this[F],I)},enumerable:!0})}}else l==="constructor"?(f[l]=function(...A){return o(A.length),a(...A)}).original=a:(f[l]=function(...A){return o(A.length),a(this[F],...A)}).original=a}else/^(get|set):/.test(l)?Object.hasOwn(f,l=l.substring(4))||Object.defineProperty(f,l,{get:t[r.replace("set:","get:")],set:t[r.replace("get:","set:")],enumerable:!0}):typeof a=="function"&&a!==o?(f[l]=(...y)=>(o(y.length),a(...y))).original=a:f[l]=a}return s}const ht={instantiate:M,instantiateSync:Q,instantiateStreaming:D,demangle:W};exports.default=ht;exports.demangle=W;exports.instantiate=M;exports.instantiateStreaming=D;exports.instantiateSync=Q;