@wasm-fmt/clang-format
Version:
A wasm based clang-format
1 lines • 26.1 kB
JavaScript
let e;export default async function t(t){if(void 0!==e)return e;void 0===t&&(t=new URL("clang-format.wasm",import.meta.url)),("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t)),e=await async function(e){if("function"==typeof Response&&e instanceof Response){if("compileStreaming"in WebAssembly)try{return await WebAssembly.compileStreaming(e)}catch(t){if("application/wasm"==e.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.compileStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t)}return e.arrayBuffer()}return e}(await t).then((e=>a({wasm:e}))),r=()=>{}}function r(){throw new Error("uninit")}export function version(){return r(),e.version()}export function set_fallback_style(t){r(),e.set_fallback_style(t)}export function set_sort_includes(t){r(),e.set_sort_includes(t)}function n(e){const{error:t,content:r}=e;if(t)throw Error(r);return r}export function format(t,a="<stdin>",o="LLVM"){return r(),n(e.format(t,a,o))}export function format_line_range(t,a,o="<stdin>",s="LLVM"){r();const i=new e.RangeList;for(const[e,t]of a){if(e<1)throw Error("start line should be at least 1");if(e>t)throw Error("start line should not exceed end line");i.push_back(e),i.push_back(t)}const u=e.format_line(t,o,s,i);return i.delete(),n(u)}export function format_byte_range(t,a,o="<stdin>",s="LLVM"){r();const i=new e.RangeList;if(1===a.length&&1===a[0].length)i.push_back(a[0][0]);else for(const[e,t]of a){if(e<0)throw Error("start offset should be at least 0");if(t<0)throw Error("length should be at least 0");i.push_back(e),i.push_back(t)}const u=e.format_byte(t,o,s,i);return i.delete(),n(u)}export function dump_config({style:t="file",filename:a="<stdin>",code:o=""}={}){return r(),n(e.dump_config(t,a,o))}export{format_byte_range as formatByteRange,format_line_range as formatLineRange};var a=function(e={}){var t,r,n,a,o,s,i,u,l,c,p=e,h=new Promise(((e,r)=>{t=e})),f=e=>console.log(e),d=e=>console.error(e);function v(){var e=c.buffer;r=new Int8Array(e),n=new Int16Array(e),o=new Uint8Array(e),s=new Uint16Array(e),a=new Int32Array(e),i=new Uint32Array(e),u=new Float32Array(e),l=new Float64Array(e)}if(p.wasmMemory)c=p.wasmMemory;else{var m=p.INITIAL_MEMORY||16777216;c=new WebAssembly.Memory({initial:m/65536,maximum:32768})}v(),p.noExitRuntime;var g,y=e=>g.get(e);class ${constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){i[this.ptr+4>>2]=e}get_type(){return i[this.ptr+4>>2]}set_destructor(e){i[this.ptr+8>>2]=e}get_destructor(){return i[this.ptr+8>>2]}set_caught(e){e=e?1:0,r[this.ptr+12]=e}get_caught(){return 0!=r[this.ptr+12]}set_rethrown(e){e=e?1:0,r[this.ptr+13]=e}get_rethrown(){return 0!=r[this.ptr+13]}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){i[this.ptr+16>>2]=e}get_adjusted_ptr(){return i[this.ptr+16>>2]}}var b=(e,t,r)=>((e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,s=0;s<e.length;++s){var i=e.charCodeAt(s);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++s)),i<=127){if(r>=o)break;t[r++]=i}else if(i<=2047){if(r+1>=o)break;t[r++]=192|i>>6,t[r++]=128|63&i}else if(i<=65535){if(r+2>=o)break;t[r++]=224|i>>12,t[r++]=128|i>>6&63,t[r++]=128|63&i}else{if(r+3>=o)break;t[r++]=240|i>>18,t[r++]=128|i>>12&63,t[r++]=128|i>>6&63,t[r++]=128|63&i}}return t[r]=0,r-a})(e,o,t,r),w="undefined"!=typeof TextDecoder?new TextDecoder:void 0,C=(e,t=0,r=NaN)=>{for(var n=t+r,a=t;e[a]&&!(a>=n);)++a;if(a-t>16&&e.buffer&&w)return w.decode(e.subarray(t,a));for(var o="";t<a;){var s=e[t++];if(128&s){var i=63&e[t++];if(192!=(224&s)){var u=63&e[t++];if((s=224==(240&s)?(15&s)<<12|i<<6|u:(7&s)<<18|i<<12|u<<6|63&e[t++])<65536)o+=String.fromCharCode(s);else{var l=s-65536;o+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else o+=String.fromCharCode((31&s)<<6|i)}else o+=String.fromCharCode(s)}return o},T=(e,t)=>e?C(o,e,t):"",P={varargs:void 0,getStr:e=>T(e)},_={},A=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function D(e){return this.fromWireType(i[e>>2])}var O,F,S,W={},k={},E={},M=e=>{throw new O(e)},x=(e,t,r)=>{function n(t){var n=r(t);n.length!==e.length&&M("Mismatched type converter count");for(var a=0;a<e.length;++a)R(e[a],n[a])}e.forEach((e=>E[e]=t));var a=new Array(t.length),o=[],s=0;t.forEach(((e,t)=>{k.hasOwnProperty(e)?a[t]=k[e]:(o.push(e),W.hasOwnProperty(e)||(W[e]=[]),W[e].push((()=>{a[t]=k[e],++s===o.length&&n(a)})))})),0===o.length&&n(a)},U=e=>{for(var t="",r=e;o[r];)t+=F[o[r++]];return t},j=e=>{throw new S(e)};function R(e,t,r={}){return function(e,t,r={}){var n=t.name;if(e||j(`type "${n}" must have a positive integer typeid pointer`),k.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;j(`Cannot register type '${n}' twice`)}if(k[e]=t,delete E[e],W.hasOwnProperty(e)){var a=W[e];delete W[e],a.forEach((e=>e()))}}(e,t,r)}var I=e=>{j(e.$$.ptrType.registeredClass.name+" instance already deleted")},V=!1,L=e=>{},N=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},z=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var n=z(e,t,r.baseClass);return null===n?null:r.downcast(n)},H={},Y={},B=(e,t)=>(t.ptrType&&t.ptr||M("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&M("Both smartPtrType and smartPtr must be specified"),t.count={value:1},G(Object.create(e,{$$:{value:t,writable:!0}})));var G=e=>"undefined"==typeof FinalizationRegistry?(G=e=>e,e):(V=new FinalizationRegistry((e=>{N(e.$$)})),G=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};V.register(e,r,e)}return e},L=e=>V.unregister(e),G(e)),q=[];function Z(){}var J=(e,t)=>Object.defineProperty(t,"name",{value:e}),K=(e,t,r)=>{if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(...n){return e[t].overloadTable.hasOwnProperty(n.length)||j(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[n.length].apply(this,n)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},Q=(e,t,r)=>{p.hasOwnProperty(e)?((void 0===r||void 0!==p[e].overloadTable&&void 0!==p[e].overloadTable[r])&&j(`Cannot register public name '${e}' twice`),K(p,e,e),p[e].overloadTable.hasOwnProperty(r)&&j(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),p[e].overloadTable[r]=t):(p[e]=t,p[e].argCount=r)};function X(e,t,r,n,a,o,s,i){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=i,this.pureVirtualFunctions=[]}var ee=(e,t,r)=>{for(;t!==r;)t.upcast||j(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function te(e,t){if(null===t)return this.isReference&&j(`null is not a valid ${this.name}`),0;t.$$||j(`Cannot pass "${_e(t)}" as a ${this.name}`),t.$$.ptr||j(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ee(t.$$.ptr,r,this.registeredClass)}function re(e,t){var r;if(null===t)return this.isReference&&j(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t&&t.$$||j(`Cannot pass "${_e(t)}" as a ${this.name}`),t.$$.ptr||j(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&j(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=ee(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&j("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:j(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var a=t.clone();r=this.rawShare(r,Te.toHandle((()=>a.delete()))),null!==e&&e.push(this.rawDestructor,r)}break;default:j("Unsupporting sharing policy")}return r}function ne(e,t){if(null===t)return this.isReference&&j(`null is not a valid ${this.name}`),0;t.$$||j(`Cannot pass "${_e(t)}" as a ${this.name}`),t.$$.ptr||j(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&j(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ee(t.$$.ptr,r,this.registeredClass)}function ae(e,t,r,n,a,o,s,i,u,l,c){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=i,this.rawConstructor=u,this.rawShare=l,this.rawDestructor=c,a||void 0!==t.baseClass?this.toWireType=re:n?(this.toWireType=te,this.destructorFunction=null):(this.toWireType=ne,this.destructorFunction=null)}var oe,se=(e,t,r)=>{p.hasOwnProperty(e)||M("Replacing nonexistent public symbol"),void 0!==p[e].overloadTable&&void 0!==r?p[e].overloadTable[r]=t:(p[e]=t,p[e].argCount=r)},ie={},ue=(e,t)=>{var r,n,a=(e=U(e)).includes("j")?(r=e,n=t,(...e)=>((e,t,r=[])=>e.includes("j")?((e,t,r)=>(e=e.replace(/p/g,"i"),(0,ie[e])(t,...r)))(e,t,r):y(t)(...r))(r,n,e)):y(t);return"function"!=typeof a&&j(`unknown function pointer with signature ${e}: ${t}`),a},le=e=>{var t=ye(e),r=U(t);return ve(t),r},ce=(e,t)=>{var r=[],n={};throw t.forEach((function e(t){n[t]||k[t]||(E[t]?E[t].forEach(e):(r.push(t),n[t]=!0))})),new oe(`${e}: `+r.map(le).join([", "]))},pe=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(i[t+4*n>>2]);return r};function he(e,t,r,n,a,o){var s=t.length;s<2&&j("argTypes array size mismatch! Must at least get return value and 'this' types!");var i=null!==t[1]&&null!==r,u=function(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].destructorFunction)return!0;return!1}(t),l="void"!==t[0].name,c=s-2,p=new Array(c),h=[],f=[];return J(e,(function(...e){var r;f.length=0,h.length=i?2:1,h[0]=a,i&&(r=t[1].toWireType(f,this),h[1]=r);for(var o=0;o<c;++o)p[o]=t[o+2].toWireType(f,e[o]),h.push(p[o]);return function(e){if(u)A(f);else for(var n=i?1:2;n<t.length;n++){var a=1===n?r:p[n-2];null!==t[n].destructorFunction&&t[n].destructorFunction(a)}if(l)return t[0].fromWireType(e)}(n(...h))}))}var fe,de,ve,me,ge,ye,$e,be=e=>{const t=(e=e.trim()).indexOf("(");return-1!==t?e.substr(0,t):e},we=[],Ce=[],Te={toValue:e=>(e||j("Cannot use deleted val. handle = "+e),Ce[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const t=we.pop()||Ce.length;return Ce[t]=e,Ce[t+1]=1,t}}}},Pe={name:"emscripten::val",fromWireType:e=>{var t=Te.toValue(e);return(e=>{e>9&&0==--Ce[e+1]&&(Ce[e]=void 0,we.push(e))})(e),t},toWireType:(e,t)=>Te.toHandle(t),argPackAdvance:8,readValueFromPointer:D,destructorFunction:null},_e=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Ae=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(u[e>>2])};case 8:return function(e){return this.fromWireType(l[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},De=(e,t,u)=>{switch(t){case 1:return u?e=>r[e]:e=>o[e];case 2:return u?e=>n[e>>1]:e=>s[e>>1];case 4:return u?e=>a[e>>2]:e=>i[e>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Oe=Object.assign({optional:!0},Pe),Fe="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Se=(e,t)=>{for(var r=e,a=r>>1,i=a+t/2;!(a>=i)&&s[a];)++a;if((r=a<<1)-e>32&&Fe)return Fe.decode(o.subarray(e,r));for(var u="",l=0;!(l>=t/2);++l){var c=n[e+2*l>>1];if(0==c)break;u+=String.fromCharCode(c)}return u},We=(e,t,r)=>{if(r??=2147483647,r<2)return 0;for(var a=t,o=(r-=2)<2*e.length?r/2:e.length,s=0;s<o;++s){var i=e.charCodeAt(s);n[t>>1]=i,t+=2}return n[t>>1]=0,t-a},ke=e=>2*e.length,Ee=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=a[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var s=o-65536;n+=String.fromCharCode(55296|s>>10,56320|1023&s)}else n+=String.fromCharCode(o)}return n},Me=(e,t,r)=>{if(r??=2147483647,r<4)return 0;for(var n=t,o=n+r-4,s=0;s<e.length;++s){var i=e.charCodeAt(s);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++s)),a[t>>2]=i,(t+=4)+4>o)break}return a[t>>2]=0,t-n},xe=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},Ue=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN,je=[0,31,60,91,121,152,182,213,244,274,305,335],Re=[0,31,59,90,120,151,181,212,243,273,304,334],Ie={},Ve=e=>{var t=(e-c.buffer.byteLength+65535)/65536|0;try{return c.grow(t),v(),1}catch(e){}},Le={},Ne=()=>{if(!Ne.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:"./this.program"};for(var t in Le)void 0===Le[t]?delete e[t]:e[t]=Le[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);Ne.strings=r}return Ne.strings},ze=e=>{throw`exit(${e})`},He=ze,Ye=[null,[],[]],Be=(e,t)=>{var r=Ye[e];0===t||10===t?((1===e?f:d)(C(r)),r.length=0):r.push(t)};O=p.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);F=e})(),S=p.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Object.assign(Z.prototype,{isAliasOf(e){if(!(this instanceof Z))return!1;if(!(e instanceof Z))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,a=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return t===n&&r===a},clone(){if(this.$$.ptr||I(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=G(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||I(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&j("Object already scheduled for deletion"),L(this),N(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||I(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&j("Object already scheduled for deletion"),q.push(this),q.length,this.$$.deleteScheduled=!0,this}}),Object.assign(ae.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:8,readValueFromPointer:D,fromWireType:function(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=((e,t)=>(t=((e,t)=>{for(void 0===t&&j("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),Y[t]))(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?B(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):B(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o,s=this.registeredClass.getActualType(t),i=H[s];if(!i)return a.call(this);o=this.isConst?i.constPointerType:i.pointerType;var u=z(t,this.registeredClass,o.registeredClass);return null===u?a.call(this):this.isSmartPointer?B(o.registeredClass.instancePrototype,{ptrType:o,ptr:u,smartPtrType:this,smartPtr:e}):B(o.registeredClass.instancePrototype,{ptrType:o,ptr:u})}}),oe=p.UnboundTypeError=(fe=Error,(de=J("UnboundTypeError",(function(e){this.name="UnboundTypeError",this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(fe.prototype),de.prototype.constructor=de,de.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},de),Ce.push(0,1,void 0,1,null,1,!0,1,!1,1),p.count_emval_handles=()=>Ce.length/2-5-we.length;var Ge={a:{F:(e,t)=>y(e)(t),k:(e,t,r)=>{throw new $(e).init(t,r),e},R:e=>{},S:(e,t,r,n)=>{},O:(e,t)=>{},K:(e,t)=>{},D:(e,t,r)=>{},L:(e,t)=>{},M:(e,t,r,n)=>{},H:function(e,t,r,n){P.varargs=n},B:(e,t,r,n)=>{},N:(e,t)=>{},y:(e,t,r)=>{},A:(e,t,r)=>{},T:()=>{!function(){throw""}()},W:e=>{var t=_[e];delete _[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,o=a.map((e=>e.getterReturnType)).concat(a.map((e=>e.setterArgumentType)));x([e],o,(e=>{var o={};return a.forEach(((t,r)=>{var n=t.fieldName,s=e[r],i=t.getter,u=t.getterContext,l=e[r+a.length],c=t.setter,p=t.setterContext;o[n]={read:e=>s.fromWireType(i(u,e)),write:(e,t)=>{var r=[];c(p,e,l.toWireType(r,t)),A(r)}}})),[{name:t.name,fromWireType:e=>{var t={};for(var r in o)t[r]=o[r].read(e);return n(e),t},toWireType:(e,t)=>{for(var a in o)if(!(a in t))throw new TypeError(`Missing field: "${a}"`);var s=r();for(a in o)o[a].write(s,t[a]);return null!==e&&e.push(n,s),s},argPackAdvance:8,readValueFromPointer:D,destructorFunction:n}]}))},u:(e,t,r,n,a)=>{},_:(e,t,r,n)=>{R(e,{name:t=U(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(o[e])},destructorFunction:null})},r:(e,t,r,n,a,o,s,i,u,l,c,p,h)=>{c=U(c),o=ue(a,o),i&&=ue(s,i),l&&=ue(u,l),h=ue(p,h);var f=(e=>{var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e})(c);Q(f,(function(){ce(`Cannot construct ${c} due to unbound types`,[n])})),x([e,t,r],n?[n]:[],(t=>{var r,a;t=t[0],a=n?(r=t.registeredClass).instancePrototype:Z.prototype;var s=J(c,(function(...e){if(Object.getPrototypeOf(this)!==u)throw new S("Use 'new' to construct "+c);if(void 0===p.constructor_body)throw new S(c+" has no accessible constructor");var t=p.constructor_body[e.length];if(void 0===t)throw new S(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(p.constructor_body).toString()}) parameters instead!`);return t.apply(this,e)})),u=Object.create(a,{constructor:{value:s}});s.prototype=u;var p=new X(c,s,u,h,r,o,i,l);p.baseClass&&(p.baseClass.__derivedClasses??=[],p.baseClass.__derivedClasses.push(p));var d=new ae(c,p,!0,!1,!1),v=new ae(c+"*",p,!1,!1,!1),m=new ae(c+" const*",p,!1,!0,!1);return H[e]={pointerType:v,constPointerType:m},se(f,s),[d,v,m]}))},m:(e,t,r,n,a,o)=>{var s=pe(t,r);a=ue(n,a),x([],[e],(e=>{var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new S(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{ce(`Cannot construct ${e.name} due to unbound types`,s)},x([],s,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=he(r,n,null,a,o),[]))),[]}))},e:(e,t,r,n,a,o,s,i,u,l)=>{var c=pe(r,n);t=U(t),t=be(t),o=ue(a,o),x([],[e],(e=>{var n=`${(e=e[0]).name}.${t}`;function a(){ce(`Cannot call ${n} due to unbound types`,c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),i&&e.registeredClass.pureVirtualFunctions.push(t);var u=e.registeredClass.instancePrototype,l=u[t];return void 0===l||void 0===l.overloadTable&&l.className!==e.name&&l.argCount===r-2?(a.argCount=r-2,a.className=e.name,u[t]=a):(K(u,t,n),u[t].overloadTable[r-2]=a),x([],c,(a=>{var i=he(n,a,e,o,s);return void 0===u[t].overloadTable?(i.argCount=r-2,u[t]=i):u[t].overloadTable[r-2]=i,[]})),[]}))},Z:e=>R(e,Pe),j:(e,t,r)=>{R(e,{name:t=U(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:8,readValueFromPointer:Ae(t,r),destructorFunction:null})},d:(e,t,r,n,a,o,s,i)=>{var u=pe(t,r);e=U(e),e=be(e),a=ue(n,a),Q(e,(function(){ce(`Cannot call ${e} due to unbound types`,u)}),t-1),x([],u,(r=>{var n=[r[0],null].concat(r.slice(1));return se(e,he(e,n,null,a,o),t-1),[]}))},c:(e,t,r,n,a)=>{t=U(t),-1===a&&(a=4294967295);var o=e=>e;if(0===n){var s=32-8*r;o=e=>e<<s>>>s}var i=t.includes("unsigned");R(e,{name:t,fromWireType:o,toWireType:i?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:De(t,r,0!==n),destructorFunction:null})},b:(e,t,n)=>{var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=i[e>>2],n=i[e+4>>2];return new a(r.buffer,n,t)}R(e,{name:n=U(n),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},C:(e,t)=>{R(e,Oe)},i:(e,t)=>{var r="std::string"===(t=U(t));R(e,{name:t,fromWireType(e){var t,n=i[e>>2],a=e+4;if(r)for(var s=a,u=0;u<=n;++u){var l=a+u;if(u==n||0==o[l]){var c=T(s,l-s);void 0===t?t=c:(t+=String.fromCharCode(0),t+=c),s=l+1}}else{var p=new Array(n);for(u=0;u<n;++u)p[u]=String.fromCharCode(o[a+u]);t=p.join("")}return ve(e),t},toWireType(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var a="string"==typeof t;a||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||j("Cannot pass non-string to std::string"),n=r&&a?(e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t})(t):t.length;var s=me(4+n+1),u=s+4;if(i[s>>2]=n,r&&a)b(t,u,n+1);else if(a)for(var l=0;l<n;++l){var c=t.charCodeAt(l);c>255&&(ve(u),j("String has UTF-16 code units that do not fit in 8 bits")),o[u+l]=c}else for(l=0;l<n;++l)o[u+l]=t[l];return null!==e&&e.push(ve,s),s},argPackAdvance:8,readValueFromPointer:D,destructorFunction(e){ve(e)}})},f:(e,t,r)=>{var n,a,o,u;r=U(r),2===t?(n=Se,a=We,u=ke,o=e=>s[e>>1]):4===t&&(n=Ee,a=Me,u=xe,o=e=>i[e>>2]),R(e,{name:r,fromWireType:e=>{for(var r,a=i[e>>2],s=e+4,u=0;u<=a;++u){var l=e+4+u*t;if(u==a||0==o(l)){var c=n(s,l-s);void 0===r?r=c:(r+=String.fromCharCode(0),r+=c),s=l+t}}return ve(e),r},toWireType:(e,n)=>{"string"!=typeof n&&j(`Cannot pass non-string to C++ string type ${r}`);var o=u(n),s=me(4+o+t);return i[s>>2]=o/t,a(n,s+4,o+t),null!==e&&e.push(ve,s),s},argPackAdvance:8,readValueFromPointer:D,destructorFunction(e){ve(e)}})},aa:(e,t,r,n,a,o)=>{_[e]={name:U(t),rawConstructor:ue(r,n),rawDestructor:ue(a,o),fields:[]}},g:(e,t,r,n,a,o,s,i,u,l)=>{_[e].fields.push({fieldName:U(t),getterReturnType:r,getter:ue(n,a),getterContext:o,setterArgumentType:s,setter:ue(i,u),setterContext:l})},$:(e,t)=>{R(e,{isVoid:!0,name:t=U(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},Q:(e,t,r)=>o.copyWithin(e,t,t+r),G:()=>{},l:(e,t)=>{var r,n;void 0===(n=k[r=e])&&j(`_emval_take_value has unknown type ${le(r)}`);var a=(e=n).readValueFromPointer(t);return Te.toHandle(a)},q:function(e,t,r){var n=Ue(e,t),o=new Date(1e3*n);a[r>>2]=o.getUTCSeconds(),a[r+4>>2]=o.getUTCMinutes(),a[r+8>>2]=o.getUTCHours(),a[r+12>>2]=o.getUTCDate(),a[r+16>>2]=o.getUTCMonth(),a[r+20>>2]=o.getUTCFullYear()-1900,a[r+24>>2]=o.getUTCDay();var s=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),i=(o.getTime()-s)/864e5|0;a[r+28>>2]=i},s:function(e,t,r){var n=Ue(e,t),o=new Date(1e3*n);a[r>>2]=o.getSeconds(),a[r+4>>2]=o.getMinutes(),a[r+8>>2]=o.getHours(),a[r+12>>2]=o.getDate(),a[r+16>>2]=o.getMonth(),a[r+20>>2]=o.getFullYear()-1900,a[r+24>>2]=o.getDay();var s=0|(e=>{var t;return((t=e.getFullYear())%4!=0||t%100==0&&t%400!=0?Re:je)[e.getMonth()]+e.getDate()-1})(o);a[r+28>>2]=s,a[r+36>>2]=-60*o.getTimezoneOffset();var i=new Date(o.getFullYear(),0,1),u=new Date(o.getFullYear(),6,1).getTimezoneOffset(),l=i.getTimezoneOffset(),c=0|(u!=l&&o.getTimezoneOffset()==Math.min(l,u));a[r+32>>2]=c},o:function(e,t,r,n,a,o,s,i){return Ue(a,o),-52},p:function(e,t,r,n,a,o,s){Ue(o,s)},z:(e,t)=>{if(Ie[e]&&(clearTimeout(Ie[e].id),delete Ie[e]),!t)return 0;var r=setTimeout((()=>{delete Ie[e],$e(e,performance.now())}),t);return Ie[e]={id:r,timeout_ms:t},0},I:(e,t,r,n)=>{var o=(new Date).getFullYear(),s=new Date(o,0,1),u=new Date(o,6,1),l=s.getTimezoneOffset(),c=u.getTimezoneOffset(),p=Math.max(l,c);i[e>>2]=60*p,a[t>>2]=Number(l!=c);var h=e=>{var t=e>=0?"-":"+",r=Math.abs(e);return`UTC${t}${String(Math.floor(r/60)).padStart(2,"0")}${String(r%60).padStart(2,"0")}`},f=h(l),d=h(c);c<l?(b(f,r,17),b(d,n,17)):(b(f,n,17),b(d,r,17))},P:()=>Date.now(),w:()=>2147483648,v:e=>{var t,r=o.length,n=2147483648;if((e>>>=0)>n)return!1;for(var a=1;a<=4;a*=2){var s=r*(1+.2/a);s=Math.min(s,e+100663296);var i=Math.min(n,(t=Math.max(e,s),65536*Math.ceil(t/65536)));if(Ve(i))return!0}return!1},U:(e,t)=>{var n=0;return Ne().forEach(((a,o)=>{var s=t+n;i[e+4*o>>2]=s,((e,t)=>{for(var n=0;n<e.length;++n)r[t++]=e.charCodeAt(n);r[t]=0})(a,s),n+=a.length+1})),0},V:(e,t)=>{var r=Ne();i[e>>2]=r.length;var n=0;return r.forEach((e=>n+=e.length+1)),i[t>>2]=n,0},Y:He,h:e=>52,J:(e,t)=>{var o=0;return 0==e?o=2:1!=e&&2!=e||(o=64),r[t]=2,n[t+2>>1]=1,tempI64=[o>>>0,(tempDouble=o,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],a[t+8>>2]=tempI64[0],a[t+12>>2]=tempI64[1],tempI64=[0,(tempDouble=0,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],a[t+16>>2]=tempI64[0],a[t+20>>2]=tempI64[1],0},n:function(e,t,r,n,a,o){return Ue(n,a),52},E:(e,t,r,n)=>52,t:function(e,t,r,n,a){return Ue(t,r),70},x:(e,t,r,n)=>{for(var a=0,s=0;s<r;s++){var u=i[t>>2],l=i[t+4>>2];t+=8;for(var c=0;c<l;c++)Be(e,o[u+c]);a+=l}return i[n>>2]=a,0},a:c,X:ze}};return WebAssembly.instantiate(p.wasm,Ge).then((e=>{var r=(e.instance||e).exports;ve=r.da,me=r.ea,ge=r.fa,ye=r.ga,$e=r.ha,r.ia,r.ja,r.ka,r.la,r.ma,r.na,r.oa,r.pa,r.qa,r.ra,r.sa,r.ta,r.ua,g=r.ca,function(e){e.ba()}(r),t(p),ge()})),h};