@sketch-hq/sketch-web-renderer 0.10.2 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.js +1 -1
- package/dist/module-debug.wasm +0 -0
- package/dist/module-release.wasm +0 -0
- package/dist/static/js/{web-renderer-07b28f3cdd6034926378.chunk.js → web-renderer-757e587f3dfc5ed5ee9d.chunk.js} +1 -1
- package/dist/static/js/{web-renderer-f04ca78328f96a575c42.chunk.js → web-renderer-8526d667c341405f97bb.chunk.js} +1 -1
- package/dist/ts/react/SketchWebContext.d.ts +1 -0
- package/dist/ts/react/SketchWebContext.d.ts.map +1 -1
- package/dist/ts/react/SketchWebReact.d.ts.map +1 -1
- package/dist/ts/utils/GestureManager.d.ts +1 -0
- package/dist/ts/utils/GestureManager.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var n="object"==typeof exports?t(require("react")):t(e.react);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,(function(e){return(()=>{var t,n,o,r,i={519:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={delayedDraw:!0,offscreenCanvas:!1,safariWebGL2:!1,pageBoundariesLimit:!1}},933:(e,t,n)=>{"use strict";n.d(t,{d:()=>j});var o,r=n(480),i=function(){function e(){this.removeListenerCallbacks=[]}return e.prototype.add=function(e,t,n,o){e.addEventListener(t,n,o);var r=function(){e.removeEventListener(t,n,o)};return this.removeListenerCallbacks.push(r),r},e.prototype.dispose=function(){this.removeListenerCallbacks.forEach((function(e){return e()}))},e}(),a=n(388),s=function(){function e(e,t){var n=this;this.cameraMoveState={status:"inactive"},this.endInteractionDebounced=(0,a.Ds)((function(){"inactive"!==n.cameraMoveState.status&&("moving"===n.cameraMoveState.status&&n.onCameraMoveEnd(),n.setCameraMoveStatus("inactive"))}),100),this.onCameraMoveStart=e,this.onCameraMoveEnd=t}return e.prototype.dispose=function(){this.endInteractionDebounced.cancel(),this.cameraMoveState={status:"inactive"}},e.prototype.handleCameraMoveEvent=function(){var e;this.endInteractionDebounced(),"inactive"===this.cameraMoveState.status&&this.setCameraMoveStatus("uncertain"),"uncertain"===this.cameraMoveState.status&&(e=this.cameraMoveState,Date.now()-e.interactionStartTimestamp>=20)&&(this.onCameraMoveStart(),this.setCameraMoveStatus("moving"))},e.prototype.setCameraMoveStatus=function(e){this.cameraMoveState="uncertain"===e?{status:"uncertain",interactionStartTimestamp:Date.now()}:{status:e}},e}(),u=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),c=function(){return(c=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},l=function(e){function t(t,n){var o=e.call(this)||this;return o.listenersCollector=new i,o.state={panning:!1,lastPan:{x:0,y:0},zoomCenter:{x:0,y:0},lastGestureScale:1,mouse:{x:0,y:0},isWaitingForSecondClick:!1,lastMouseClickPosition:{x:0,y:0}},o.handleGestureStart=function(e){e.preventDefault(),o.state.lastGestureScale=e.scale},o.handleGestureChange=function(e){e.preventDefault(),o.state.zoomCenter=o.getCorrectPointerPosition(e);var t=e.scale/o.state.lastGestureScale;o.state.lastGestureScale=e.scale,o.emit("zoomChange",t,o.state.zoomCenter),o.cameraMoveTracker.handleCameraMoveEvent()},o.handleGestureEnd=function(e){e.preventDefault()},o.handlePointerDown=function(e){var t=e instanceof MouseEvent&&0===e.button,n="undefined"!=typeof TouchEvent&&e instanceof TouchEvent;(t||n)&&(e.preventDefault(),o.updateMousePosition(e),o.state.panning=!0,o.state.lastPan.x=o.state.mouse.x,o.state.lastPan.y=o.state.mouse.y,o.emit("mousedown"))},o.handlePointerMove=function(e){o.state.panning||o.updateMousePosition(e)},o.handlePanMove=function(e){if(o.state.panning){e.preventDefault();var t=o.getCorrectPointerPosition(e),n=o.state.lastPan.x-t.x,r=o.state.lastPan.y-t.y;o.state.lastPan.x=t.x,o.state.lastPan.y=t.y,o.emit("panChange",-n,-r),o.cameraMoveTracker.handleCameraMoveEvent()}},o.handleDoubleClick=function(e){if(!("undefined"!=typeof TouchEvent&&e instanceof TouchEvent&&e.touches.length>0)){var t=o.getCorrectPointerPosition(e),n=Math.hypot(o.state.lastMouseClickPosition.x-t.x,o.state.lastMouseClickPosition.y-t.y)>("undefined"!=typeof TouchEvent&&e instanceof TouchEvent?15:0);if(!o.state.isWaitingForSecondClick||n)return o.state.isWaitingForSecondClick=!0,o.state.lastMouseClickPosition=o.getCorrectPointerPosition(e),void o.resetDoubleClick();o.state.isWaitingForSecondClick=!1,o.emit("doubleClick")}},o.resetDoubleClick=(0,a.Ds)((function(){o.state.isWaitingForSecondClick=!1}),500),o.handlePanEnd=function(){o.state.panning=!1},o.handlePointerUp=function(e){"undefined"!=typeof TouchEvent&&e instanceof TouchEvent&&e.touches.length>0||o.emit("mouseup")},o.handleMouseWheel=function(e){e.preventDefault();var t=e.metaKey||e.ctrlKey;if(o.updateMousePosition(e),t){var n=e.ctrlKey?-1:1;o.state.zoomCenter=o.getCorrectPointerPosition(e);var r=1+.01*e.deltaY*n;o.emit("zoomChange",r,o.state.zoomCenter)}else o.emit("panChange",-e.deltaX,-e.deltaY);o.cameraMoveTracker.handleCameraMoveEvent()},o.handleCameraMoveStart=function(){o.emit("cameraMoveStart")},o.handleCameraMoveEnd=function(){o.emit("cameraMoveEnd")},o.target=t,o.settings=n,o.targetBounds=t.getBoundingClientRect(),o.addListeners(),o.cameraMoveTracker=new s(o.handleCameraMoveStart,o.handleCameraMoveEnd),o}return u(t,e),t.prototype.updateTargetBounds=function(){this.targetBounds=this.target.getBoundingClientRect()},t.prototype.addListeners=function(){this.listenersCollector.add(this.target,"mousedown",this.handlePointerDown),this.listenersCollector.add(this.target,"mousemove",this.handlePointerMove),this.listenersCollector.add(document,"mousemove",this.handlePanMove),this.listenersCollector.add(this.target,"mouseup",this.handlePointerUp),this.listenersCollector.add(document,"mouseup",this.handlePanEnd),this.listenersCollector.add(this.target,"wheel",this.handleMouseWheel),this.listenersCollector.add(this.target,"mouseup",this.handleDoubleClick),this.listenersCollector.add(this.target,"touchstart",this.handlePointerDown),this.listenersCollector.add(document,"touchmove",this.handlePanMove),this.listenersCollector.add(this.target,"touchmove",this.handlePointerMove),this.listenersCollector.add(this.target,"touchend",this.handlePointerUp),this.listenersCollector.add(document,"touchend",this.handlePanEnd),this.listenersCollector.add(this.target,"touchend",this.handleDoubleClick),this.listenersCollector.add(this.target,"gesturestart",this.handleGestureStart),this.listenersCollector.add(this.target,"gesturechange",this.handleGestureChange),this.listenersCollector.add(this.target,"gestureend",this.handleGestureEnd)},t.prototype.getCorrectPointerPosition=function(e){var t=(0,a.MP)(e),n={x:0,y:0};return n.x=(0,a.uZ)(t.x-this.targetBounds.x,0,this.target.clientWidth),n.y=(0,a.uZ)(t.y-this.targetBounds.y,0,this.target.clientHeight),n},t.prototype.updateMousePosition=function(e){this.state.mouse=this.getCorrectPointerPosition(e),this.emit("mousemove",this.state.mouse.x,this.state.mouse.y)},t.prototype.getMouse=function(){return c({},this.state.mouse)},t.prototype.setMouse=function(e,t){this.state.mouse.x=e,this.state.mouse.y=t,this.emit("mousemove",this.state.mouse.x,this.state.mouse.y)},t.prototype.getMinZoomLevel=function(){return this.settings.minimumZoomLevel},t.prototype.getMaxZoomLevel=function(){return this.settings.maximumZoomLevel},t.prototype.dispose=function(){this.listenersCollector.dispose(),this.cameraMoveTracker.dispose()},t}(r.v),h=n(475),d=n(419);const f=Symbol("Comlink.proxy"),v=Symbol("Comlink.endpoint"),p=Symbol("Comlink.releaseProxy"),m=Symbol("Comlink.thrown"),b=e=>"object"==typeof e&&null!==e||"function"==typeof e,g=new Map([["proxy",{canHandle:e=>b(e)&&e[f],serialize(e){const{port1:t,port2:n}=new MessageChannel;return y(e,t),[n,[n]]},deserialize:e=>(e.start(),k(e))}],["throw",{canHandle:e=>b(e)&&m in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function y(e,t=self){t.addEventListener("message",(function n(o){if(!o||!o.data)return;const{id:r,type:i,path:a}=Object.assign({path:[]},o.data),s=(o.data.argumentList||[]).map(D);let u;try{const t=a.slice(0,-1).reduce(((e,t)=>e[t]),e),n=a.reduce(((e,t)=>e[t]),e);switch(i){case"GET":u=n;break;case"SET":t[a.slice(-1)[0]]=D(o.data.value),u=!0;break;case"APPLY":u=n.apply(t,s);break;case"CONSTRUCT":u=E(new n(...s));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;y(e,n),u=M(t,[t])}break;case"RELEASE":u=void 0;break;default:return}}catch(e){u={value:e,[m]:0}}Promise.resolve(u).catch((e=>({value:e,[m]:0}))).then((e=>{const[o,a]=x(e);t.postMessage(Object.assign(Object.assign({},o),{id:r}),a),"RELEASE"===i&&(t.removeEventListener("message",n),w(t))}))})),t.start&&t.start()}function w(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function k(e,t){return P(e,[],t)}function C(e){if(e)throw new Error("Proxy has been released and is not useable")}function P(e,t=[],n=function(){}){let o=!1;const r=new Proxy(n,{get(n,i){if(C(o),i===p)return()=>L(e,{type:"RELEASE",path:t.map((e=>e.toString()))}).then((()=>{w(e),o=!0}));if("then"===i){if(0===t.length)return{then:()=>r};const n=L(e,{type:"GET",path:t.map((e=>e.toString()))}).then(D);return n.then.bind(n)}return P(e,[...t,i])},set(n,r,i){C(o);const[a,s]=x(i);return L(e,{type:"SET",path:[...t,r].map((e=>e.toString())),value:a},s).then(D)},apply(n,r,i){C(o);const a=t[t.length-1];if(a===v)return L(e,{type:"ENDPOINT"}).then(D);if("bind"===a)return P(e,t.slice(0,-1));const[s,u]=W(i);return L(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:s},u).then(D)},construct(n,r){C(o);const[i,a]=W(r);return L(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:i},a).then(D)}});return r}function W(e){const t=e.map(x);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const S=new WeakMap;function M(e,t){return S.set(e,t),e}function E(e){return Object.assign(e,{[f]:!0})}function x(e){for(const[t,n]of g)if(n.canHandle(e)){const[o,r]=n.serialize(e);return[{type:"HANDLER",name:t,value:o},r]}return[{type:"RAW",value:e},S.get(e)||[]]}function D(e){switch(e.type){case"HANDLER":return g.get(e.name).deserialize(e.value);case"RAW":return e.value}}function L(e,t,n){return new Promise((o=>{const r=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(n){n.data&&n.data.id&&n.data.id===r&&(e.removeEventListener("message",t),o(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:r},t),n)}))}var R,A=n(849),Z=n(519),U=n(332),_=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),O=function(e){function t(t){var n=e.call(this)||this;return n.listenersCollector=new i,n.handleKeyUp=function(e){n.emit("keyUp",e.code)},n.target=t,n.addListeners(),n}return _(t,e),t.prototype.addListeners=function(){this.listenersCollector.add(this.target,"keyup",this.handleKeyUp)},t.prototype.dispose=function(){this.listenersCollector.dispose()},t}(r.v),T=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),I=function(){return(I=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},z=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},G=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},F=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o};!function(e){e[e.browser=0]="browser",e[e.worker=1]="worker"}(R||(R={}));var j=function(e){function t(t){var n=e.call(this)||this;return n.handleKeyUp=function(e){var t;null===(t=n.sketchWeb)||void 0===t||t.keyUp(e)},n.handleMouseDoubleClick=function(){var e;null===(e=n.sketchWeb)||void 0===e||e.mouseDoubleClick()},n.handleCameraMoveStart=function(){var e;null===(e=n.sketchWeb)||void 0===e||e.setIsCameraMoving(!0)},n.handleCameraMoveEnd=function(){var e;null===(e=n.sketchWeb)||void 0===e||e.setIsCameraMoving(!1)},n.handleMouseChange=function(e,t){var o;null===(o=n.sketchWeb)||void 0===o||o.setMouse(e,t)},n.handlePanChange=function(e,t){return z(n,void 0,void 0,(function(){var n;return G(this,(function(o){return null===(n=this.sketchWeb)||void 0===n||n.addPan(e,t),this.emitPanEvent(),[2]}))}))},n.handleZoomChange=function(e,t){return z(n,void 0,void 0,(function(){var n;return G(this,(function(o){return null===(n=this.sketchWeb)||void 0===n||n.addZoom(e,t),this.emitZoomEvent(),this.emitPanEvent(),[2]}))}))},n.handleMouseDown=function(){var e;null===(e=n.sketchWeb)||void 0===e||e.mouseDown()},n.handleMouseUp=function(){var e;null===(e=n.sketchWeb)||void 0===e||e.mouseUp()},n.handleCanvasResize=function(e){window.requestAnimationFrame((function(){var t,o,r=e[0].contentRect,i=r.width,a=r.height;n.setCanvasSize(i,a),n.gestureManager.updateTargetBounds(),null===(t=n.sketchWeb)||void 0===t||t.setPixelRatio(n.getDevicePixelRatio()),null===(o=n.sketchWeb)||void 0===o||o.setSize(i*n.getDevicePixelRatio(),a*n.getDevicePixelRatio())}))},n.settings=t,n.canvas=t.canvas,n.gestureManager=new l(n.canvas,{minimumZoomLevel:t.minimumZoomLevel,maximumZoomLevel:t.maximumZoomLevel}),n.keyboardManager=new O(document.body),A.Z.active=t.mode===U.p.debug,n.init(),n}return T(t,e),t.prototype.init=function(){var e;return z(this,void 0,void 0,(function(){var t,n,o;return G(this,(function(r){switch(r.label){case 0:return this.setCanvasSize(this.settings.container.clientWidth,this.settings.container.clientHeight),[4,this.initSketchWeb()];case 1:return r.sent(),[4,null===(e=this.sketchWeb)||void 0===e?void 0:e.getStatus()];case 2:return"FILE_READY"!==(null==(t=r.sent())?void 0:t.type)?[2]:(n=void 0!==this.settings.initialZoom,o=void 0!==this.settings.initialPan,n||o?n?[4,this.setZoom(this.settings.initialZoom)]:[3,4]:[3,7]);case 3:r.sent(),r.label=4;case 4:return o?[4,this.setPan(this.settings.initialPan.x,this.settings.initialPan.y,this.settings.initialPan.centerPointInViewport)]:[3,6];case 5:r.sent(),r.label=6;case 6:return[3,9];case 7:return[4,this.zoomToFit()];case 8:r.sent(),r.label=9;case 9:return this.sketchWeb.startRendering(),this.addListeners(),[2]}}))}))},t.prototype.initSketchWeb=function(){return z(this,void 0,void 0,(function(){var e,t,o,r,i;return G(this,(function(a){switch(a.label){case 0:return e=Z.Z.offscreenCanvas&&"function"==typeof this.canvas.transferControlToOffscreen,t=I(I({},this.settings),{size:{width:this.canvas.width,height:this.canvas.height},pixelRatio:this.getDevicePixelRatio()}),e?(this.environment=R.worker,A.Z.debug("Using offscreen canvas"),this.offscreenCanvas=this.canvas.transferControlToOffscreen(),this.worker=new Worker(new URL(n.p+n.u(509),n.b),{type:void 0}),o=k(this.worker),r=this,[4,new o(M(I(I({},t),{canvas:this.offscreenCanvas}),[this.offscreenCanvas]))]):[3,2];case 1:return r.sketchWeb=a.sent(),[3,3];case 2:this.environment=R.browser,A.Z.debug("Using normal canvas"),this.sketchWeb=new h.U(t),a.label=3;case 3:return(i=this.sketchWeb).on("status",this.forwardEvent("status")),i.on("metric",this.forwardEvent("metric")),i.on("warnings",this.forwardEvent("warnings")),i.on("artboardSelected",this.forwardEvent("artboardSelected")),i.on("artboardDeselected",this.forwardEvent("artboardDeselected")),i.on("artboardMouseEnter",this.forwardEvent("artboardMouseEnter")),i.on("artboardMouseLeave",this.forwardEvent("artboardMouseLeave")),i.on("goToArtboard",this.forwardEvent("goToArtboard")),i.on("allImagesReady",this.forwardEvent("allImagesReady")),[4,this.sketchWeb.init()];case 4:return a.sent(),[2]}}))}))},t.prototype.forwardEvent=function(e){var t=this,n=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];t.emit.apply(t,F([e],n))};return this.environment===R.worker?E(n):n},t.prototype.isRunningInsideWorker=function(){return this.environment===R.worker},t.prototype.looseWebGLContext=function(){var e;null===(e=this.sketchWeb)||void 0===e||e.looseWebGLContext()},t.prototype.addListeners=function(){this.canvasResizeObserver=new ResizeObserver(this.handleCanvasResize),this.canvasResizeObserver.observe(this.settings.container),this.gestureManager.on("panChange",this.handlePanChange),this.gestureManager.on("mousemove",this.handleMouseChange),this.gestureManager.on("mousedown",this.handleMouseDown),this.gestureManager.on("mouseup",this.handleMouseUp),this.gestureManager.on("doubleClick",this.handleMouseDoubleClick),this.gestureManager.on("zoomChange",this.handleZoomChange),this.gestureManager.on("cameraMoveStart",this.handleCameraMoveStart),this.gestureManager.on("cameraMoveEnd",this.handleCameraMoveEnd),this.keyboardManager.on("keyUp",this.handleKeyUp)},t.prototype.emitPanEvent=function(){var e;return z(this,void 0,void 0,(function(){var t;return G(this,(function(n){switch(n.label){case 0:return[4,null===(e=this.sketchWeb)||void 0===e?void 0:e.getPan()];case 1:return(t=n.sent())?(this.emit("pan",t.x,t.y),[2]):[2]}}))}))},t.prototype.emitZoomEvent=function(){var e;return z(this,void 0,void 0,(function(){var t;return G(this,(function(n){switch(n.label){case 0:return[4,null===(e=this.sketchWeb)||void 0===e?void 0:e.getZoom()];case 1:return void 0===(t=n.sent())||this.emit("zoom",t),[2]}}))}))},t.prototype.getDevicePixelRatio=function(){return(0,d.uZ)(window.devicePixelRatio,1,2)},t.prototype.setCanvasSize=function(e,t){this.canvas.style.width=e+"px",this.canvas.style.height=t+"px",this.canvas.width=e*this.getDevicePixelRatio(),this.canvas.height=t*this.getDevicePixelRatio()},t.prototype.zoomToFit=function(){return z(this,void 0,void 0,(function(){return G(this,(function(e){switch(e.label){case 0:return[4,this.sketchWeb.scaleDocumentToFit()];case 1:return e.sent(),this.emitZoomEvent(),this.emitPanEvent(),[2]}}))}))},t.prototype.getStatus=function(){var e;return z(this,void 0,void 0,(function(){return G(this,(function(t){return[2,null===(e=this.sketchWeb)||void 0===e?void 0:e.getStatus()]}))}))},t.prototype.generateDocumentPNG=function(){var e;return z(this,void 0,void 0,(function(){return G(this,(function(t){return[2,null===(e=this.sketchWeb)||void 0===e?void 0:e.generateDocumentPNG()]}))}))},t.prototype.getArtboardAtPosition=function(e,t){var n;return z(this,void 0,void 0,(function(){return G(this,(function(o){switch(o.label){case 0:return[4,null===(n=this.sketchWeb)||void 0===n?void 0:n.getArtboardAtPosition(e,t)];case 1:return[2,o.sent()||null]}}))}))},t.prototype.getPanAtPosition=function(e,t){var n;return null===(n=this.sketchWeb)||void 0===n?void 0:n.getPanAtPosition(e,t)},t.prototype.setPan=function(e,t,n){var o;return z(this,void 0,void 0,(function(){return G(this,(function(r){switch(r.label){case 0:return[4,null===(o=this.sketchWeb)||void 0===o?void 0:o.setPan(e,t,Boolean(n))];case 1:return r.sent(),this.emitPanEvent(),[2]}}))}))},t.prototype.setZoom=function(e,t){var n;return z(this,void 0,void 0,(function(){var o;return G(this,(function(r){return o=null!=t?t:this.getCanvasCenterPoint(),null===(n=this.sketchWeb)||void 0===n||n.setZoom(e,o),this.emitZoomEvent(),this.emitPanEvent(),[2]}))}))},t.prototype.getCanvasCenterPoint=function(){var e=this.canvas.getBoundingClientRect();return{x:e.width/2+e.x,y:e.height/2+e.y}},t.prototype.getZoom=function(){var e;return null===(e=this.sketchWeb)||void 0===e?void 0:e.getZoom()},t.prototype.getPan=function(){var e;return null===(e=this.sketchWeb)||void 0===e?void 0:e.getPan()},t.prototype.dispose=function(){var e,t,n,o;return z(this,void 0,void 0,(function(){return G(this,(function(r){switch(r.label){case 0:return this.gestureManager.dispose(),this.keyboardManager.dispose(),null===(e=this.canvasResizeObserver)||void 0===e||e.disconnect(),this.isRunningInsideWorker()?[4,null===(t=this.sketchWeb)||void 0===t?void 0:t.dispose()]:[3,2];case 1:return r.sent(),null===(n=this.worker)||void 0===n||n.terminate(),[3,3];case 2:null===(o=this.sketchWeb)||void 0===o||o.dispose(),r.label=3;case 3:return[2]}}))}))},t}(r.v)},475:(e,t,n)=>{"use strict";n.d(t,{U:()=>v});var o,r=n(419),i=n(519),a=n(480),s=n(108),u=n(849),c=n(758),l=n(332),h=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),d=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},f=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},v=(globalThis.indexedDB,function(e){function t(t){var n=t.canvas,o=t.locateFile,i=t.filePath,a=t.imagesURLFormat,c=t.imagesURLMap,h=t.backgroundColor,d=void 0===h?{r:1,g:1,b:1,a:1}:h,f=t.highlightColor,v=void 0===f?{r:0,g:0,b:0,a:1}:f,p=t.size,m=t.pixelRatio,b=t.mode,g=t.showTilesBorders,y=void 0!==g&&g,w=t.minimumZoomLevel,k=t.maximumZoomLevel,C=t.preserveDrawingBuffer,P=void 0!==C&&C,W=t.panBoundariesPadding,S=void 0===W?40:W,M=e.call(this)||this;return M.status={type:"INIT"},M.handleWebGLContextLost=function(){M.setStatus({type:"WEBGL_CONTEXT_LOST"})},M.debouncedFullDraw=(0,r.Ds)((function(){return M.draw(!0)}),200),M.canvas=n,M.locateFile=o,M.filePath=i,M.imagesURLFormat=a,M.imagesURLMap=c,M.backgroundColor=d,M.highlightColor=v,M.size=p,M.pixelRatio=m,M.mode=b,M.showTilesBorders=y,M.currentWebGLVersion=(0,r.wX)(),M.zoomLevels={min:w,max:k},M.preserveDrawingBuffer=P,M.panBoundariesPadding=S,u.Z.active=b===l.p.debug,M.traceFirstPaint=new s.S("FirstPaint"),M}return h(t,e),t.prototype.init=function(){return d(this,void 0,void 0,(function(){var e;return f(this,(function(t){switch(t.label){case 0:this.setStatus({type:"INIT"}),t.label=1;case 1:return t.trys.push([1,4,,5]),[4,this.initSketchWebWasm()];case 2:return t.sent(),[4,this.setFile(this.filePath)];case 3:return t.sent(),[3,5];case 4:return e=t.sent(),[2,this.fail(e instanceof c.k?e:new c.k("ERROR","Unexpected exception initializing the web renderer",e))];case 5:return[2]}}))}))},t.prototype.startRendering=function(){this.traceInitialRender=new s.S("InitialRender"),this.setStatus({type:"DRAWING_FILE"}),this.draw(!0,!1),this.sketchWebWasm.startRenderLoop()},t.prototype.createJSBridge=function(){var e=this;return{logDebug:function(e){u.Z.debug("[C++] "+e)},logWarning:function(e){u.Z.warning("[C++] "+e)},logError:function(e){u.Z.error("[C++] "+e)},emitMetric:function(t,n,o,r){e.emit("metric",{id:t,start:n,end:o,duration:r})},resolveImageUrl:function(t){return e.imagesURLFormat?e.imagesURLFormat.replace(":imageId",t):e.imagesURLMap&&e.imagesURLMap[t]?e.imagesURLMap[t]:(u.Z.warning("Not able to resolve the url for the image with UUID: "+t),"")},onDrawComplete:this.handleDrawComplete.bind(this),onArtboardMouseEnter:function(t){e.emit("artboardMouseEnter",t)},onArtboardMouseLeave:function(t){e.emit("artboardMouseLeave",t)},onArtboardSelected:function(t){e.emit("artboardSelected",t)},onArtboardDeselected:function(t){e.emit("artboardDeselected",t)},onGoToArtboard:function(t,n){e.emit("goToArtboard",t,n)},onAllImagesReady:function(){e.emit("allImagesReady")}}},t.prototype.downloadImages=function(){var e=this;return new Promise((function(t){var n,o=new s.S("ImagesDownload");null===(n=e.sketchWebWasm)||void 0===n||n.downloadImages((function(){o.printMeasurement(),e.emit("metric",o.measure()),u.Z.debug("Images downloaded"),t()}))}))},t.prototype.initSketchWebWasm=function(){return d(this,void 0,void 0,(function(){var e,t,o,r,a,h,d,v=this;return f(this,(function(f){switch(f.label){case 0:return e=new s.S("WasmModuleDownload"),this.mode!==l.p.debug?[3,2]:[4,n.e(425).then(n.t.bind(n,425,23))];case 1:return t=f.sent(),[3,4];case 2:return[4,n.e(816).then(n.t.bind(n,816,23))];case 3:t=f.sent(),f.label=4;case 4:o=t.default,f.label=5;case 5:return f.trys.push([5,7,,8]),r=this,[4,o({FeatureFlags:i.Z,currentWebGLVersion:this.currentWebGLVersion,locateFile:function(e){return v.locateFile.replace("{file}",e)},bridge:this.createJSBridge()})];case 6:return r.wasmModule=f.sent(),[3,8];case 7:throw a=f.sent(),new c.k("WASM_ERROR","An error occurred while trying to create the wasm module.",a);case 8:if(e.printMeasurement(),this.emit("metric",e.measure()),h={antialias:!1,majorVersion:this.currentWebGLVersion,alpha:!0,powerPreference:"high-performance",preserveDrawingBuffer:this.preserveDrawingBuffer},u.Z.debug("Using WebGL "+h.majorVersion),!(d=this.wasmModule.GL.createContext(this.canvas,h)))throw new c.k("WEBGL_ERROR","Unable to create WebGL context. WebGL might be unsupported, disabled, or this device is not able to run WebGL correctly.");this.webglCtxHandle=d;try{this.sketchWebWasm=this.wasmModule.SketchWeb.MakeGL(this.webglCtxHandle,this.canvas.width,this.size.height)}catch(e){throw new c.k("WASM_ERROR","An error occurred while trying to create the SketchWebWasm object.",e)}return this.sketchWebWasm.setPixelRatio(this.pixelRatio),this.sketchWebWasm.setBackgroundColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),this.sketchWebWasm.setHighlightColor(this.highlightColor.r,this.highlightColor.g,this.highlightColor.b,this.highlightColor.a),this.sketchWebWasm.setRendererConfiguration({showTilesBorders:this.showTilesBorders}),this.sketchWebWasm.setZoomLevels(this.zoomLevels.min,this.zoomLevels.max),this.sketchWebWasm.setPanBoundariesPadding(this.panBoundariesPadding),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLost),[2]}}))}))},t.prototype.generateDocumentPNG=function(){return d(this,void 0,void 0,(function(){return f(this,(function(e){switch(e.label){case 0:return[4,this.downloadImages()];case 1:return e.sent(),[2,this.sketchWebWasm.generateDocumentPNG()]}}))}))},t.prototype.handleDrawComplete=function(){"DRAWING_FILE"===this.status.type&&(this.traceInitialRender.printMeasurement(),this.emit("metric",this.traceInitialRender.measure()),this.traceFirstPaint.printMeasurement(),this.emit("metric",this.traceFirstPaint.measure()),this.setStatus({type:"READY"}),this.downloadImages())},t.prototype.looseWebGLContext=function(){var e=this.wasmModule.GL.getContext(this.webglCtxHandle);if(e){var t=e.GLctx.getExtension("WEBGL_lose_context");t?t.loseContext():console.warn("Unable to retrieve WEBGL_lose_context extension")}else console.warn("Unable to loose context. WebGL rendering context not found")},t.prototype.scaleDocumentToFit=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.scaleDocumentToFit(),this.delayedDraw()},t.prototype.setFile=function(e){return d(this,void 0,void 0,(function(){var t=this;return f(this,(function(n){return this.setStatus({type:"LOADING_FILE"}),[2,new Promise((function(n,o){t.sketchWebWasm.setFile(e,(function(e){if(void 0===e&&(e=[]),e.length){u.Z.debug("Parser warnings: "+e);var o=e.map((function(e){return{key:e}}));t.emit("warnings",o)}t.setStatus({type:"FILE_READY"}),n()}),(function(){return o(new c.k("FILE_ERROR","Error encountered while fetching and parsing the file"))}))}))]}))}))},t.prototype.delayedDraw=function(){if(!i.Z.delayedDraw)return this.draw(!0);this.draw(),this.debouncedFullDraw()},t.prototype.draw=function(e,t){var n;void 0===e&&(e=!1),void 0===t&&(t=!1),null===(n=this.sketchWebWasm)||void 0===n||n.setNeedsUpdate(e,t)},t.prototype.fail=function(e){this.setStatus({type:"FAILURE",code:e.code,message:e.toString()+(e.cause?"\nWrapped Error: "+e.cause.toString():"")}),u.Z.error(e),e.cause&&u.Z.error(e.cause)},t.prototype.setPixelRatio=function(e){var t;this.pixelRatio=e,null===(t=this.sketchWebWasm)||void 0===t||t.setPixelRatio(e),this.delayedDraw()},t.prototype.setSize=function(e,t){var n;this.size.width=e,this.size.height=t,this.canvas.width=e,this.canvas.height=t,null===(n=this.sketchWebWasm)||void 0===n||n.resize(e,t)},t.prototype.setStatus=function(e){"FAILURE"!==this.status.type&&(u.Z.debug("Status transition "+this.status.type+" => "+e.type+"}"),this.status=e,this.emit("status",e))},t.prototype.getArtboardAtPosition=function(e,t){var n;return null===(n=this.sketchWebWasm)||void 0===n?void 0:n.getArtboardAtPosition(e,t)},t.prototype.getPanAtPosition=function(e,t){var n;return null===(n=this.sketchWebWasm)||void 0===n?void 0:n.getPanAtPosition(e,t)},t.prototype.getStatus=function(){return this.status},t.prototype.setZoom=function(e,t){var n,o;null===(n=this.sketchWebWasm)||void 0===n||n.setZoomCenter(t.x,t.y),null===(o=this.sketchWebWasm)||void 0===o||o.setZoom(e),this.delayedDraw()},t.prototype.addZoom=function(e,t){var n,o;null===(n=this.sketchWebWasm)||void 0===n||n.setZoomCenter(t.x,t.y),null===(o=this.sketchWebWasm)||void 0===o||o.addZoom(e),this.delayedDraw()},t.prototype.setPan=function(e,t,n){var o;void 0===n&&(n=!1),null===(o=this.sketchWebWasm)||void 0===o||o.setPan(e,t,n),this.delayedDraw()},t.prototype.addPan=function(e,t){var n;null===(n=this.sketchWebWasm)||void 0===n||n.addPan(e,t),this.delayedDraw()},t.prototype.getPan=function(){if(this.sketchWebWasm)return this.sketchWebWasm.getPan()},t.prototype.getZoom=function(){var e;return null===(e=this.sketchWebWasm)||void 0===e?void 0:e.getZoom()},t.prototype.setMouse=function(e,t){var n;null===(n=this.sketchWebWasm)||void 0===n||n.setMouse(e,t)},t.prototype.setIsCameraMoving=function(e){var t;null===(t=this.sketchWebWasm)||void 0===t||t.setIsCameraMoving(e)},t.prototype.mouseDown=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.mouseDown()},t.prototype.mouseUp=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.mouseUp()},t.prototype.mouseDoubleClick=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.mouseDoubleClick()},t.prototype.keyUp=function(e){var t;null===(t=this.sketchWebWasm)||void 0===t||t.keyUp(e)},t.prototype.dispose=function(){var e,t;try{null===(e=this.sketchWebWasm)||void 0===e||e.stopRenderLoop(),null===(t=this.sketchWebWasm)||void 0===t||t.delete()}catch(e){this.fail(new c.k("ERROR","Unexpected exception while disposing the SketchWebWasm object",e))}this.sketchWebWasm=null},t}(a.v))},948:(e,t,n)=>{"use strict";n.d(t,{z0:()=>U,oW:()=>O,JB:()=>m,qX:()=>E,SC:()=>D,zB:()=>R,GC:()=>W,xH:()=>v,z7:()=>A,rR:()=>C,JU:()=>M,vN:()=>g,Y6:()=>L,$5:()=>w});var o,r=n(297),i=n.n(r),a=n(933),s=n(849),u=function(){return(u=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},c=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},l=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},h=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o},d=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.Z.debug.apply(s.Z,h(["SketchWebContext"],e))};!function(e){e.Draggable="grab",e.Dragging="grabbing",e.Hover="pointer",e.Default="auto"}(o||(o={}));var f=(0,r.createContext)(void 0),v=function(){var e=(0,r.useContext)(f);if(void 0===e)throw Error("useSketchWebManager must be used within a SketchWebProvider");return e},p=(0,r.createContext)(void 0),m=function(){var e=(0,r.useContext)(p);if(void 0===e)throw Error("useSketchWebActions must be used within a SketchWebProvider");return e},b=(0,r.createContext)(void 0),g=function(){var e=(0,r.useContext)(b);if(void 0===e)throw Error("useSketchWebStatus must be used within a SketchWebProvider");return e},y=(0,r.createContext)(void 0),w=function(){var e=(0,r.useContext)(y);if(void 0===e)throw Error("useSketchWebZoom must be used within a SketchWebProvider");return e},k=(0,r.createContext)(void 0),C=function(){var e=(0,r.useContext)(k);if(void 0===e)throw Error("useSketchWebPan must be used within a SketchWebProvider");return e},P=(0,r.createContext)(void 0),W=function(){var e=(0,r.useContext)(P);if(void 0===e)throw Error("useSketchWebHoveredArtboardUUID must be used within a SketchWebProvider");return e},S=(0,r.createContext)(void 0),M=function(){var e=(0,r.useContext)(S);if(void 0===e)throw Error("useSketchWebSelectedArtboardUUID must be used within a SketchWebProvider");return e},E=function(e){var t=v();(0,r.useEffect)((function(){return null==t||t.on("allImagesReady",e),function(){null==t||t.off("allImagesReady",e)}}),[t,e])},x=(0,r.createContext)(void 0),D=function(){var e=(0,r.useContext)(x);if(void 0===e)throw Error("useSketchWebCursor must be used within a SketchWebProvider");return e},L=function(e){var t=v();(0,r.useEffect)((function(){return null==t||t.on("warnings",e),function(){null==t||t.off("warnings",e)}}),[t,e])},R=function(e){var t=v();(0,r.useEffect)((function(){return null==t||t.on("goToArtboard",e),function(){null==t||t.off("goToArtboard",e)}}),[t,e])},A=function(e){var t=v();(0,r.useEffect)((function(){return null==t||t.on("metric",e),function(){null==t||t.off("metric",e)}}),[t,e])},Z=function(e,t){switch(d('dispatched: "'+t.type+'"',t),t.type){case"on-status":return u(u({},e),{status:t.status});case"on-zoom":return u(u({},e),{zoom:t.zoom});case"on-pan":return u(u({},e),{pan:t.pan});case"dispose":return u(u({},e),{status:null,filePath:null,selectedArtboardUUID:null,hoveredArtboardUUID:null,zoom:null,pan:null,cursor:o.Default});case"post-init":return u(u({},e),{status:t.status,zoom:t.zoom});case"set-file-path":return u(u({},e),{filePath:t.filePath});case"on-artboard-mouse-enter":return u(u({},e),{hoveredArtboardUUID:t.uuid,cursor:o.Hover});case"on-artboard-mouse-leave":return u(u({},e),{hoveredArtboardUUID:null,cursor:e.isMouseDown?o.Dragging:o.Draggable});case"on-artboard-selected":return u(u({},e),{selectedArtboardUUID:t.uuid});case"on-artboard-deselected":return u(u({},e),{selectedArtboardUUID:null});case"on-mouse-down":return u(u({},e),{cursor:o.Dragging,isMouseDown:!0});case"on-mouse-up":return u(u({},e),{cursor:e.hoveredArtboardUUID?o.Hover:o.Draggable,isMouseDown:!1});default:return e}},U=function(e){var t=e.children,n=(0,r.useRef)(null),s=(0,r.useRef)(null),h=(0,r.useReducer)(Z,{pan:null,zoom:null,status:null,filePath:null,hoveredArtboardUUID:null,selectedArtboardUUID:null,cursor:o.Default,isMouseDown:!1}),v=h[0],m=v.status,g=v.zoom,w=v.pan,C=v.hoveredArtboardUUID,W=v.selectedArtboardUUID,M=v.cursor,E=h[1],D=(0,r.useCallback)((function(e){return E({type:"on-zoom",zoom:e})}),[]),L=(0,r.useCallback)((function(e,t){return E({type:"on-pan",pan:{x:e,y:t}})}),[]),R=(0,r.useCallback)((function(e){E({type:"on-status",status:e})}),[]),A=(0,r.useCallback)((function(e){return E({type:"on-artboard-mouse-enter",uuid:e})}),[]),U=(0,r.useCallback)((function(){return E({type:"on-artboard-mouse-leave"})}),[]),_=(0,r.useCallback)((function(e){E({type:"on-artboard-selected",uuid:e})}),[]),O=(0,r.useCallback)((function(){return E({type:"on-artboard-deselected"})}),[]),T=(0,r.useCallback)((function(){return E({type:"on-mouse-down"})}),[]),I=(0,r.useCallback)((function(){return E({type:"on-mouse-up"})}),[]),z=(0,r.useCallback)((function(){n.current&&(d("dispose"),n.current.off("status",R),n.current.off("artboardMouseEnter",A),n.current.off("artboardMouseLeave",U),n.current.off("artboardSelected",_),n.current.off("artboardDeselected",O),n.current.off("zoom",D),n.current.off("pan",L),n.current.gestureManager.off("mousedown",T),n.current.gestureManager.off("mouseup",I),n.current.dispose(),n.current=null,E({type:"dispose"}))}),[R,L,D,A,U,_,O,I,T]),G=(0,r.useCallback)((function(e){e&&!n.current&&s.current&&(d("init"),E({type:"set-file-path",filePath:e}),n.current=new a.d(u(u({},s.current),{filePath:e})),n.current.on("status",R),n.current.on("artboardMouseEnter",A),n.current.on("artboardMouseLeave",U),n.current.on("artboardSelected",_),n.current.on("artboardDeselected",O),n.current.on("zoom",D),n.current.on("pan",L),n.current.gestureManager.on("mousedown",T),n.current.gestureManager.on("mouseup",I),c(void 0,void 0,void 0,(function(){var e,t,o,r,i,a;return l(this,(function(s){switch(s.label){case 0:return[4,null===(r=n.current)||void 0===r?void 0:r.getPan()];case 1:return e=s.sent()||null,t=E,o={type:"post-init"},[4,null===(i=n.current)||void 0===i?void 0:i.getZoom()];case 2:return o.zoom=s.sent()||null,[4,null===(a=n.current)||void 0===a?void 0:a.getStatus()];case 3:return t.apply(void 0,[(o.status=s.sent()||null,o.pan=null!=e?e:null,o)]),[2]}}))})))}),[R,D,L,A,U,_,O,T,I]),F=(0,r.useCallback)((function(e){d("setSettings",e),s.current=e}),[]),j=(0,r.useCallback)((function(e){var t;d("setZoom",e),null===(t=n.current)||void 0===t||t.setZoom(e)}),[]),B=(0,r.useCallback)((function(){var e,t;d("incrementZoom"),"number"==typeof g&&(t=g>=1?Math.round(2*g):g>.5?1:2*g,null===(e=n.current)||void 0===e||e.setZoom(t))}),[g]),N=(0,r.useCallback)((function(){var e;d("decrementZoom"),"number"==typeof g&&(null===(e=n.current)||void 0===e||e.setZoom(g/2))}),[g]),H=(0,r.useCallback)((function(e){var t,o=e.x,r=e.y,i=e.centerPointInViewport;d("setPan",o,r,"centerPointInViewport",i),null===(t=n.current)||void 0===t||t.setPan(o,r,i)}),[]),X=(0,r.useCallback)((function(){var e;d("zoomToFit"),null===(e=n.current)||void 0===e||e.zoomToFit()}),[]),Y=(0,r.useCallback)((function(){var e;d("looseWebGLContext"),null===(e=n.current)||void 0===e||e.looseWebGLContext()}),[]),V=(0,r.useCallback)((function(){return c(void 0,void 0,void 0,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return d("generateDocumentPNG"),[4,null===(e=n.current)||void 0===e?void 0:e.generateDocumentPNG()];case 1:return[2,t.sent()]}}))}))}),[]),q=(0,r.useCallback)((function(e,t){return c(void 0,void 0,void 0,(function(){var o;return l(this,(function(r){switch(r.label){case 0:return d("getArtboardAtPosition",e,t),[4,null===(o=n.current)||void 0===o?void 0:o.getArtboardAtPosition(e,t)];case 1:return[2,r.sent()||null]}}))}))}),[]),K=(0,r.useCallback)((function(e,t){return c(void 0,void 0,void 0,(function(){var o;return l(this,(function(r){switch(r.label){case 0:return d("invoked: getPanAtPosition",e,t),[4,null===(o=n.current)||void 0===o?void 0:o.getPanAtPosition(e,t)];case 1:return[2,r.sent()||null]}}))}))}),[]),J=(0,r.useMemo)((function(){return{setSettings:F,init:G,dispose:z,setZoom:j,incrementZoom:B,decrementZoom:N,setPan:H,zoomToFit:X,looseWebGLContext:Y,generateDocumentPNG:V,getArtboardAtPosition:q,getPanAtPosition:K}}),[F,G,z,j,B,N,H,X,Y,V,q,K]);return i().createElement(f.Provider,{value:n.current},i().createElement(p.Provider,{value:J},i().createElement(b.Provider,{value:m},i().createElement(y.Provider,{value:g},i().createElement(k.Provider,{value:w},i().createElement(S.Provider,{value:W},i().createElement(P.Provider,{value:C},i().createElement(x.Provider,{value:M},t))))))))},_=n(332),O=function(e){s.Z.active=e.mode===_.p.debug;var t=e.filePath,n=e.locateFile,o=e.imagesURLFormat,a=e.imagesURLMap,u=e.backgroundColor,c=e.highlightColor,l=e.mode,h=e.showTilesBorders,d=e.minimumZoomLevel,f=e.maximumZoomLevel,v=e.preserveDrawingBuffer,p=e.panBoundariesPadding,b=e.initialPan,y=e.initialZoom,w=e.onCanvasClick,k=e.onCanvasContextMenu,C=(0,r.useState)(null),P=C[0],W=C[1],S=(0,r.useState)(null),M=S[0],x=S[1],L=(0,r.useState)(!1),R=L[0],A=L[1],Z=m(),U=Z.dispose,O=Z.setSettings,T=Z.init,I=D(),z=g();return E((function(){A(!0)})),(0,r.useEffect)((function(){M&&P&&O({locateFile:n,imagesURLFormat:o,imagesURLMap:a,backgroundColor:u,highlightColor:c,mode:l,showTilesBorders:h,minimumZoomLevel:d,maximumZoomLevel:f,preserveDrawingBuffer:v,panBoundariesPadding:p,initialPan:b,initialZoom:y,container:M,canvas:P})}),[O,n,o,a,u,c,l,h,d,f,v,p,b,y,M,P]),(0,r.useEffect)((function(){if(t&&P&&M)return T(t),function(){return U()}}),[U,T,t,P,M]),i().createElement("div",{ref:function(e){return x(e)},style:{position:"relative",width:"100%",height:"100%"}},i().createElement("canvas",{onClick:w,onContextMenu:k,ref:function(e){return W(e)},"data-sketchweb-all-images-ready":R,"data-testid":"sketchweb-canvas","data-sketchweb-status":"sketchweb-status-"+((null==z?void 0:z.type.toLowerCase())||"null"),style:{position:"absolute",inset:"0",cursor:I}}))}},758:(e,t,n)=>{"use strict";n.d(t,{k:()=>i});var o,r=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(n,o,r){var i=this.constructor,a=e.call(this,"("+n+") "+o)||this;return a.code=n,a.cause=r,a.name=t.name,Object.setPrototypeOf(a,i.prototype),a}return r(t,e),t}(Error)},18:()=>{},689:()=>{},332:(e,t,n)=>{"use strict";var o;n.d(t,{p:()=>o}),function(e){e.debug="debug",e.release="release"}(o||(o={}))},119:()=>{},312:()=>{},480:(e,t,n)=>{"use strict";n.d(t,{v:()=>o});var o=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){var n,o;this.listeners[e]=null!==(n=this.listeners[e])&&void 0!==n?n:new Set,null===(o=this.listeners[e])||void 0===o||o.add(t)},e.prototype.off=function(e,t){var n;null===(n=this.listeners[e])||void 0===n||n.delete(t)},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=this.listeners[e];(null==o?void 0:o.size)&&o.forEach((function(e){Promise.resolve().then((function(){e.apply(void 0,t)}))}))},e}()},849:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o};const r=new(function(){function e(){this.active=!0}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.active&&console.debug.apply(console,o(["[SketchWeb] [Debug]"],e))},e.prototype.warning=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.active&&console.warn.apply(console,o(["[SketchWeb] [Warn]"],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,o(["[SketchWeb] [Error]"],e))},e}())},108:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var o=n(849),r=function(){function e(e){this.label=e,this.startTime=performance.now(),this.startTimestamp=Date.now(),o.Z.debug("[Performance] Start: "+this.label)}return e.prototype.measure=function(){var e=performance.now()-this.startTime;return{duration:e,end:this.startTimestamp+e,start:this.startTimestamp,id:this.label}},e.prototype.printMeasurement=function(){var e=this.measure().duration;if(e<1e3){var t=e.toFixed(2);o.Z.debug("[Performance] End: "+this.label+" -> "+t+" ms")}else{var n=(e/1e3).toFixed(2);o.Z.debug("[Performance] End: "+this.label+" -> "+n+" s")}},e}()},419:(e,t,n)=>{"use strict";n.d(t,{uZ:()=>o.uZ,Ds:()=>o.Ds,wX:()=>o.wX});var o=n(388)},388:(e,t,n)=>{"use strict";n.d(t,{Ds:()=>i,MP:()=>a,uZ:()=>s,wX:()=>u});var o=n(519),r=n(66);function i(e,t){var n;function o(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];clearTimeout(n),n=setTimeout((function(){e.apply(void 0,o)}),t)}return o.cancel=function(){n&&clearTimeout(n)},o}function a(e){var t,n;return{x:null!==(t=e.pageX)&&void 0!==t?t:e.clientX,y:null!==(n=e.pageY)&&void 0!==n?n:e.clientY}}function s(e,t,n){return Math.max(t,Math.min(n,e))}function u(){return(0,r.t)()&&!o.Z.safariWebGL2?1:"undefined"!=typeof WebGL2RenderingContext?2:1}},66:(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=/(iPhone|Macintosh|iPad)(.*)(Version)\/(0|[1-9]\d*)\.(0|[1-9]\d*)\.?(0|[1-9]\d*)?/,r=function(e){if(void 0===e&&(e=window.navigator.userAgent),e.includes("Chrome/")||e.includes("Chromium/")||e.includes("Opera/")||e.includes("Firefox/"))return null;var t=e.match(o);if(!t)return null;var n=t[1];return"Macintosh"!==n&&"iPad"!==n&&"iPhone"!==n?null:{hardware:n,version:{major:parseInt(t[4])||0,minor:parseInt(t[5])||0,patch:parseInt(t[6])||0}}}},297:t=>{"use strict";t.exports=e}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return i[e](n,n.exports,s),n.exports}s.m=i,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var r=Object.create(null);s.r(r);var i={};t=t||[null,n({}),n([]),n(n)];for(var a=2&o&&e;"object"==typeof a&&!~t.indexOf(a);a=n(a))Object.getOwnPropertyNames(a).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,s.d(r,i),r},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"static/js/web-renderer-"+{425:"3effe72d4cf4931fc6e0",509:"07b28f3cdd6034926378",816:"f04ca78328f96a575c42"}[e]+".chunk.js",s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},r="@sketch-hq/sketch-web-renderer:",s.l=(e,t,n,i)=>{if(o[e])o[e].push(t);else{var a,u;if(void 0!==n)for(var c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var h=c[l];if(h.getAttribute("src")==e||h.getAttribute("data-webpack")==r+n){a=h;break}}a||(u=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",r+n),a.src=e),o[e]=[t];var d=(t,n)=>{a.onerror=a.onload=null,clearTimeout(f);var r=o[e];if(delete o[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((e=>e(n))),t)return t(n)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),u&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.p="/",(()=>{s.b=document.baseURI||self.location.href;var e={826:0};s.f.j=(t,n)=>{var o=s.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise(((n,r)=>o=e[t]=[n,r]));n.push(o[2]=r);var i=s.p+s.u(t),a=new Error;s.l(i,(n=>{if(s.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+r+": "+i+")",a.name="ChunkLoadError",a.type=r,a.request=i,o[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var o,r,[i,a,u]=n,c=0;if(i.some((t=>0!==e[t]))){for(o in a)s.o(a,o)&&(s.m[o]=a[o]);u&&u(s)}for(t&&t(n);c<i.length;c++)r=i[c],s.o(e,r)&&e[r]&&e[r][0](),e[i[c]]=0},n=self.webpackChunk_sketch_hq_sketch_web_renderer=self.webpackChunk_sketch_hq_sketch_web_renderer||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var u={};return(()=>{"use strict";s.r(u),s.d(u,{default:()=>d,SketchWeb:()=>t.U,SketchWebMode:()=>i.p,SketchWebError:()=>c.k,SketchWebProvider:()=>h.z0,SketchWebReact:()=>h.oW,useSketchWebActions:()=>h.JB,useSketchWebAllImagesReadyEvent:()=>h.qX,useSketchWebCursor:()=>h.SC,useSketchWebGoToArtboardEvent:()=>h.zB,useSketchWebHoveredArtboardUUID:()=>h.GC,useSketchWebManager:()=>h.xH,useSketchWebMetricEvent:()=>h.z7,useSketchWebPan:()=>h.rR,useSketchWebSelectedArtboardUUID:()=>h.JU,useSketchWebStatus:()=>h.vN,useSketchWebWarningsEvent:()=>h.Y6,useSketchWebZoom:()=>h.$5});var e=s(933),t=s(475),n=s(18),o={};for(const e in n)["default","SketchWeb"].indexOf(e)<0&&(o[e]=()=>n[e]);s.d(u,o);var r=s(119);o={};for(const e in r)["default","SketchWeb"].indexOf(e)<0&&(o[e]=()=>r[e]);s.d(u,o);var i=s(332),a=s(312);o={};for(const e in a)["default","SketchWeb","SketchWebMode"].indexOf(e)<0&&(o[e]=()=>a[e]);s.d(u,o);var c=s(758),l=s(689);o={};for(const e in l)["default","SketchWeb","SketchWebMode","SketchWebError"].indexOf(e)<0&&(o[e]=()=>l[e]);s.d(u,o);var h=s(948);const d=e.d})(),u})()}));
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var n="object"==typeof exports?t(require("react")):t(e.react);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,(function(e){return(()=>{var t,n,o,r,i={519:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={delayedDraw:!0,offscreenCanvas:!1,safariWebGL2:!1,pageBoundariesLimit:!1}},933:(e,t,n)=>{"use strict";n.d(t,{d:()=>j});var o,r=n(480),i=function(){function e(){this.removeListenerCallbacks=[]}return e.prototype.add=function(e,t,n,o){e.addEventListener(t,n,o);var r=function(){e.removeEventListener(t,n,o)};return this.removeListenerCallbacks.push(r),r},e.prototype.dispose=function(){this.removeListenerCallbacks.forEach((function(e){return e()}))},e}(),a=n(388),s=function(){function e(e,t){var n=this;this.cameraMoveState={status:"inactive"},this.endInteractionDebounced=(0,a.Ds)((function(){"inactive"!==n.cameraMoveState.status&&("moving"===n.cameraMoveState.status&&n.onCameraMoveEnd(),n.setCameraMoveStatus("inactive"))}),100),this.onCameraMoveStart=e,this.onCameraMoveEnd=t}return e.prototype.dispose=function(){this.endInteractionDebounced.cancel(),this.cameraMoveState={status:"inactive"}},e.prototype.handleCameraMoveEvent=function(){var e;this.endInteractionDebounced(),"inactive"===this.cameraMoveState.status&&this.setCameraMoveStatus("uncertain"),"uncertain"===this.cameraMoveState.status&&(e=this.cameraMoveState,Date.now()-e.interactionStartTimestamp>=20)&&(this.onCameraMoveStart(),this.setCameraMoveStatus("moving"))},e.prototype.setCameraMoveStatus=function(e){this.cameraMoveState="uncertain"===e?{status:"uncertain",interactionStartTimestamp:Date.now()}:{status:e}},e}(),u=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),c=function(){return(c=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},l=function(e){function t(t,n){var o=e.call(this)||this;return o.listenersCollector=new i,o.state={panning:!1,lastPan:{x:0,y:0},zoomCenter:{x:0,y:0},lastGestureScale:1,mouse:{x:0,y:0},isCameraLocked:!1,isWaitingForSecondClick:!1,lastMouseClickPosition:{x:0,y:0}},o.handleGestureStart=function(e){e.preventDefault(),o.state.isCameraLocked||(o.state.lastGestureScale=e.scale)},o.handleGestureChange=function(e){if(e.preventDefault(),!o.state.isCameraLocked){o.state.zoomCenter=o.getCorrectPointerPosition(e);var t=e.scale/o.state.lastGestureScale;o.state.lastGestureScale=e.scale,o.emit("zoomChange",t,o.state.zoomCenter),o.cameraMoveTracker.handleCameraMoveEvent()}},o.handleGestureEnd=function(e){e.preventDefault()},o.handlePointerDown=function(e){var t=e instanceof MouseEvent&&0===e.button,n="undefined"!=typeof TouchEvent&&e instanceof TouchEvent;(t||n)&&(e.preventDefault(),o.updateMousePosition(e),o.state.panning=!0,o.state.lastPan.x=o.state.mouse.x,o.state.lastPan.y=o.state.mouse.y,o.emit("mousedown"))},o.handlePointerMove=function(e){o.state.panning||o.updateMousePosition(e)},o.handlePanMove=function(e){if(o.state.panning&&(e.preventDefault(),!o.state.isCameraLocked)){var t=o.getCorrectPointerPosition(e),n=o.state.lastPan.x-t.x,r=o.state.lastPan.y-t.y;o.state.lastPan.x=t.x,o.state.lastPan.y=t.y,o.emit("panChange",-n,-r),o.cameraMoveTracker.handleCameraMoveEvent()}},o.handleDoubleClick=function(e){if(!("undefined"!=typeof TouchEvent&&e instanceof TouchEvent&&e.touches.length>0)){var t=o.getCorrectPointerPosition(e),n=Math.hypot(o.state.lastMouseClickPosition.x-t.x,o.state.lastMouseClickPosition.y-t.y)>("undefined"!=typeof TouchEvent&&e instanceof TouchEvent?15:0);if(!o.state.isWaitingForSecondClick||n)return o.state.isWaitingForSecondClick=!0,o.state.lastMouseClickPosition=o.getCorrectPointerPosition(e),void o.resetDoubleClick();o.state.isWaitingForSecondClick=!1,o.emit("doubleClick")}},o.resetDoubleClick=(0,a.Ds)((function(){o.state.isWaitingForSecondClick=!1}),500),o.handlePanEnd=function(){o.state.panning=!1},o.handlePointerUp=function(e){"undefined"!=typeof TouchEvent&&e instanceof TouchEvent&&e.touches.length>0||o.emit("mouseup")},o.handleMouseWheel=function(e){if(e.preventDefault(),!o.state.isCameraLocked){var t=e.metaKey||e.ctrlKey;if(o.updateMousePosition(e),t){var n=e.ctrlKey?-1:1;o.state.zoomCenter=o.getCorrectPointerPosition(e);var r=1+.01*e.deltaY*n;o.emit("zoomChange",r,o.state.zoomCenter)}else o.emit("panChange",-e.deltaX,-e.deltaY);o.cameraMoveTracker.handleCameraMoveEvent()}},o.handleCameraMoveStart=function(){o.emit("cameraMoveStart")},o.handleCameraMoveEnd=function(){o.emit("cameraMoveEnd")},o.target=t,o.settings=n,o.targetBounds=t.getBoundingClientRect(),o.addListeners(),o.cameraMoveTracker=new s(o.handleCameraMoveStart,o.handleCameraMoveEnd),o}return u(t,e),t.prototype.updateTargetBounds=function(){this.targetBounds=this.target.getBoundingClientRect()},t.prototype.addListeners=function(){this.listenersCollector.add(this.target,"mousedown",this.handlePointerDown),this.listenersCollector.add(this.target,"mousemove",this.handlePointerMove),this.listenersCollector.add(document,"mousemove",this.handlePanMove),this.listenersCollector.add(this.target,"mouseup",this.handlePointerUp),this.listenersCollector.add(document,"mouseup",this.handlePanEnd),this.listenersCollector.add(this.target,"wheel",this.handleMouseWheel),this.listenersCollector.add(this.target,"mouseup",this.handleDoubleClick),this.listenersCollector.add(this.target,"touchstart",this.handlePointerDown),this.listenersCollector.add(document,"touchmove",this.handlePanMove),this.listenersCollector.add(this.target,"touchmove",this.handlePointerMove),this.listenersCollector.add(this.target,"touchend",this.handlePointerUp),this.listenersCollector.add(document,"touchend",this.handlePanEnd),this.listenersCollector.add(this.target,"touchend",this.handleDoubleClick),this.listenersCollector.add(this.target,"gesturestart",this.handleGestureStart),this.listenersCollector.add(this.target,"gesturechange",this.handleGestureChange),this.listenersCollector.add(this.target,"gestureend",this.handleGestureEnd)},t.prototype.getCorrectPointerPosition=function(e){var t=(0,a.MP)(e),n={x:0,y:0};return n.x=(0,a.uZ)(t.x-this.targetBounds.x,0,this.target.clientWidth),n.y=(0,a.uZ)(t.y-this.targetBounds.y,0,this.target.clientHeight),n},t.prototype.updateMousePosition=function(e){this.state.mouse=this.getCorrectPointerPosition(e),this.emit("mousemove",this.state.mouse.x,this.state.mouse.y)},t.prototype.getMouse=function(){return c({},this.state.mouse)},t.prototype.setMouse=function(e,t){this.state.mouse.x=e,this.state.mouse.y=t,this.emit("mousemove",this.state.mouse.x,this.state.mouse.y)},t.prototype.setIsCameraLocked=function(e){this.state.isCameraLocked=e},t.prototype.getMinZoomLevel=function(){return this.settings.minimumZoomLevel},t.prototype.getMaxZoomLevel=function(){return this.settings.maximumZoomLevel},t.prototype.dispose=function(){this.listenersCollector.dispose(),this.cameraMoveTracker.dispose()},t}(r.v),h=n(475),d=n(419);const f=Symbol("Comlink.proxy"),v=Symbol("Comlink.endpoint"),p=Symbol("Comlink.releaseProxy"),m=Symbol("Comlink.thrown"),b=e=>"object"==typeof e&&null!==e||"function"==typeof e,g=new Map([["proxy",{canHandle:e=>b(e)&&e[f],serialize(e){const{port1:t,port2:n}=new MessageChannel;return y(e,t),[n,[n]]},deserialize:e=>(e.start(),k(e))}],["throw",{canHandle:e=>b(e)&&m in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function y(e,t=self){t.addEventListener("message",(function n(o){if(!o||!o.data)return;const{id:r,type:i,path:a}=Object.assign({path:[]},o.data),s=(o.data.argumentList||[]).map(D);let u;try{const t=a.slice(0,-1).reduce(((e,t)=>e[t]),e),n=a.reduce(((e,t)=>e[t]),e);switch(i){case"GET":u=n;break;case"SET":t[a.slice(-1)[0]]=D(o.data.value),u=!0;break;case"APPLY":u=n.apply(t,s);break;case"CONSTRUCT":u=E(new n(...s));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;y(e,n),u=M(t,[t])}break;case"RELEASE":u=void 0;break;default:return}}catch(e){u={value:e,[m]:0}}Promise.resolve(u).catch((e=>({value:e,[m]:0}))).then((e=>{const[o,a]=x(e);t.postMessage(Object.assign(Object.assign({},o),{id:r}),a),"RELEASE"===i&&(t.removeEventListener("message",n),w(t))}))})),t.start&&t.start()}function w(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function k(e,t){return P(e,[],t)}function C(e){if(e)throw new Error("Proxy has been released and is not useable")}function P(e,t=[],n=function(){}){let o=!1;const r=new Proxy(n,{get(n,i){if(C(o),i===p)return()=>L(e,{type:"RELEASE",path:t.map((e=>e.toString()))}).then((()=>{w(e),o=!0}));if("then"===i){if(0===t.length)return{then:()=>r};const n=L(e,{type:"GET",path:t.map((e=>e.toString()))}).then(D);return n.then.bind(n)}return P(e,[...t,i])},set(n,r,i){C(o);const[a,s]=x(i);return L(e,{type:"SET",path:[...t,r].map((e=>e.toString())),value:a},s).then(D)},apply(n,r,i){C(o);const a=t[t.length-1];if(a===v)return L(e,{type:"ENDPOINT"}).then(D);if("bind"===a)return P(e,t.slice(0,-1));const[s,u]=W(i);return L(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:s},u).then(D)},construct(n,r){C(o);const[i,a]=W(r);return L(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:i},a).then(D)}});return r}function W(e){const t=e.map(x);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const S=new WeakMap;function M(e,t){return S.set(e,t),e}function E(e){return Object.assign(e,{[f]:!0})}function x(e){for(const[t,n]of g)if(n.canHandle(e)){const[o,r]=n.serialize(e);return[{type:"HANDLER",name:t,value:o},r]}return[{type:"RAW",value:e},S.get(e)||[]]}function D(e){switch(e.type){case"HANDLER":return g.get(e.name).deserialize(e.value);case"RAW":return e.value}}function L(e,t,n){return new Promise((o=>{const r=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(n){n.data&&n.data.id&&n.data.id===r&&(e.removeEventListener("message",t),o(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:r},t),n)}))}var R,A=n(849),Z=n(519),U=n(332),_=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),O=function(e){function t(t){var n=e.call(this)||this;return n.listenersCollector=new i,n.handleKeyUp=function(e){n.emit("keyUp",e.code)},n.target=t,n.addListeners(),n}return _(t,e),t.prototype.addListeners=function(){this.listenersCollector.add(this.target,"keyup",this.handleKeyUp)},t.prototype.dispose=function(){this.listenersCollector.dispose()},t}(r.v),I=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),T=function(){return(T=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},z=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},G=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},F=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o};!function(e){e[e.browser=0]="browser",e[e.worker=1]="worker"}(R||(R={}));var j=function(e){function t(t){var n=e.call(this)||this;return n.handleKeyUp=function(e){var t;null===(t=n.sketchWeb)||void 0===t||t.keyUp(e)},n.handleMouseDoubleClick=function(){var e;null===(e=n.sketchWeb)||void 0===e||e.mouseDoubleClick()},n.handleCameraMoveStart=function(){var e;null===(e=n.sketchWeb)||void 0===e||e.setIsCameraMoving(!0)},n.handleCameraMoveEnd=function(){var e;null===(e=n.sketchWeb)||void 0===e||e.setIsCameraMoving(!1)},n.handleMouseChange=function(e,t){var o;null===(o=n.sketchWeb)||void 0===o||o.setMouse(e,t)},n.handlePanChange=function(e,t){return z(n,void 0,void 0,(function(){var n;return G(this,(function(o){return null===(n=this.sketchWeb)||void 0===n||n.addPan(e,t),this.emitPanEvent(),[2]}))}))},n.handleZoomChange=function(e,t){return z(n,void 0,void 0,(function(){var n;return G(this,(function(o){return null===(n=this.sketchWeb)||void 0===n||n.addZoom(e,t),this.emitZoomEvent(),this.emitPanEvent(),[2]}))}))},n.handleMouseDown=function(){var e;null===(e=n.sketchWeb)||void 0===e||e.mouseDown()},n.handleMouseUp=function(){var e;null===(e=n.sketchWeb)||void 0===e||e.mouseUp()},n.handleCanvasResize=function(e){window.requestAnimationFrame((function(){var t,o,r=e[0].contentRect,i=r.width,a=r.height;n.setCanvasSize(i,a),n.gestureManager.updateTargetBounds(),null===(t=n.sketchWeb)||void 0===t||t.setPixelRatio(n.getDevicePixelRatio()),null===(o=n.sketchWeb)||void 0===o||o.setSize(i*n.getDevicePixelRatio(),a*n.getDevicePixelRatio())}))},n.settings=t,n.canvas=t.canvas,n.gestureManager=new l(n.canvas,{minimumZoomLevel:t.minimumZoomLevel,maximumZoomLevel:t.maximumZoomLevel}),n.keyboardManager=new O(document.body),A.Z.active=t.mode===U.p.debug,n.init(),n}return I(t,e),t.prototype.init=function(){var e;return z(this,void 0,void 0,(function(){var t,n,o;return G(this,(function(r){switch(r.label){case 0:return this.setCanvasSize(this.settings.container.clientWidth,this.settings.container.clientHeight),[4,this.initSketchWeb()];case 1:return r.sent(),[4,null===(e=this.sketchWeb)||void 0===e?void 0:e.getStatus()];case 2:return"FILE_READY"!==(null==(t=r.sent())?void 0:t.type)?[2]:(n=void 0!==this.settings.initialZoom,o=void 0!==this.settings.initialPan,n||o?n?[4,this.setZoom(this.settings.initialZoom)]:[3,4]:[3,7]);case 3:r.sent(),r.label=4;case 4:return o?[4,this.setPan(this.settings.initialPan.x,this.settings.initialPan.y,this.settings.initialPan.centerPointInViewport)]:[3,6];case 5:r.sent(),r.label=6;case 6:return[3,9];case 7:return[4,this.zoomToFit()];case 8:r.sent(),r.label=9;case 9:return this.sketchWeb.startRendering(),this.addListeners(),[2]}}))}))},t.prototype.initSketchWeb=function(){return z(this,void 0,void 0,(function(){var e,t,o,r,i;return G(this,(function(a){switch(a.label){case 0:return e=Z.Z.offscreenCanvas&&"function"==typeof this.canvas.transferControlToOffscreen,t=T(T({},this.settings),{size:{width:this.canvas.width,height:this.canvas.height},pixelRatio:this.getDevicePixelRatio()}),e?(this.environment=R.worker,A.Z.debug("Using offscreen canvas"),this.offscreenCanvas=this.canvas.transferControlToOffscreen(),this.worker=new Worker(new URL(n.p+n.u(509),n.b),{type:void 0}),o=k(this.worker),r=this,[4,new o(M(T(T({},t),{canvas:this.offscreenCanvas}),[this.offscreenCanvas]))]):[3,2];case 1:return r.sketchWeb=a.sent(),[3,3];case 2:this.environment=R.browser,A.Z.debug("Using normal canvas"),this.sketchWeb=new h.U(t),a.label=3;case 3:return(i=this.sketchWeb).on("status",this.forwardEvent("status")),i.on("metric",this.forwardEvent("metric")),i.on("warnings",this.forwardEvent("warnings")),i.on("artboardSelected",this.forwardEvent("artboardSelected")),i.on("artboardDeselected",this.forwardEvent("artboardDeselected")),i.on("artboardMouseEnter",this.forwardEvent("artboardMouseEnter")),i.on("artboardMouseLeave",this.forwardEvent("artboardMouseLeave")),i.on("goToArtboard",this.forwardEvent("goToArtboard")),i.on("allImagesReady",this.forwardEvent("allImagesReady")),[4,this.sketchWeb.init()];case 4:return a.sent(),[2]}}))}))},t.prototype.forwardEvent=function(e){var t=this,n=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];t.emit.apply(t,F([e],n))};return this.environment===R.worker?E(n):n},t.prototype.isRunningInsideWorker=function(){return this.environment===R.worker},t.prototype.looseWebGLContext=function(){var e;null===(e=this.sketchWeb)||void 0===e||e.looseWebGLContext()},t.prototype.addListeners=function(){this.canvasResizeObserver=new ResizeObserver(this.handleCanvasResize),this.canvasResizeObserver.observe(this.settings.container),this.gestureManager.on("panChange",this.handlePanChange),this.gestureManager.on("mousemove",this.handleMouseChange),this.gestureManager.on("mousedown",this.handleMouseDown),this.gestureManager.on("mouseup",this.handleMouseUp),this.gestureManager.on("doubleClick",this.handleMouseDoubleClick),this.gestureManager.on("zoomChange",this.handleZoomChange),this.gestureManager.on("cameraMoveStart",this.handleCameraMoveStart),this.gestureManager.on("cameraMoveEnd",this.handleCameraMoveEnd),this.keyboardManager.on("keyUp",this.handleKeyUp)},t.prototype.emitPanEvent=function(){var e;return z(this,void 0,void 0,(function(){var t;return G(this,(function(n){switch(n.label){case 0:return[4,null===(e=this.sketchWeb)||void 0===e?void 0:e.getPan()];case 1:return(t=n.sent())?(this.emit("pan",t.x,t.y),[2]):[2]}}))}))},t.prototype.emitZoomEvent=function(){var e;return z(this,void 0,void 0,(function(){var t;return G(this,(function(n){switch(n.label){case 0:return[4,null===(e=this.sketchWeb)||void 0===e?void 0:e.getZoom()];case 1:return void 0===(t=n.sent())||this.emit("zoom",t),[2]}}))}))},t.prototype.getDevicePixelRatio=function(){return(0,d.uZ)(window.devicePixelRatio,1,2)},t.prototype.setCanvasSize=function(e,t){this.canvas.style.width=e+"px",this.canvas.style.height=t+"px",this.canvas.width=e*this.getDevicePixelRatio(),this.canvas.height=t*this.getDevicePixelRatio()},t.prototype.zoomToFit=function(){return z(this,void 0,void 0,(function(){return G(this,(function(e){switch(e.label){case 0:return[4,this.sketchWeb.scaleDocumentToFit()];case 1:return e.sent(),this.emitZoomEvent(),this.emitPanEvent(),[2]}}))}))},t.prototype.getStatus=function(){var e;return z(this,void 0,void 0,(function(){return G(this,(function(t){return[2,null===(e=this.sketchWeb)||void 0===e?void 0:e.getStatus()]}))}))},t.prototype.generateDocumentPNG=function(){var e;return z(this,void 0,void 0,(function(){return G(this,(function(t){return[2,null===(e=this.sketchWeb)||void 0===e?void 0:e.generateDocumentPNG()]}))}))},t.prototype.getArtboardAtPosition=function(e,t){var n;return z(this,void 0,void 0,(function(){return G(this,(function(o){switch(o.label){case 0:return[4,null===(n=this.sketchWeb)||void 0===n?void 0:n.getArtboardAtPosition(e,t)];case 1:return[2,o.sent()||null]}}))}))},t.prototype.getPanAtPosition=function(e,t){var n;return null===(n=this.sketchWeb)||void 0===n?void 0:n.getPanAtPosition(e,t)},t.prototype.setPan=function(e,t,n){var o;return z(this,void 0,void 0,(function(){return G(this,(function(r){switch(r.label){case 0:return[4,null===(o=this.sketchWeb)||void 0===o?void 0:o.setPan(e,t,Boolean(n))];case 1:return r.sent(),this.emitPanEvent(),[2]}}))}))},t.prototype.setZoom=function(e,t){var n;return z(this,void 0,void 0,(function(){var o;return G(this,(function(r){return o=null!=t?t:this.getCanvasCenterPoint(),null===(n=this.sketchWeb)||void 0===n||n.setZoom(e,o),this.emitZoomEvent(),this.emitPanEvent(),[2]}))}))},t.prototype.getCanvasCenterPoint=function(){var e=this.canvas.getBoundingClientRect();return{x:e.width/2+e.x,y:e.height/2+e.y}},t.prototype.getZoom=function(){var e;return null===(e=this.sketchWeb)||void 0===e?void 0:e.getZoom()},t.prototype.getPan=function(){var e;return null===(e=this.sketchWeb)||void 0===e?void 0:e.getPan()},t.prototype.dispose=function(){var e,t,n,o;return z(this,void 0,void 0,(function(){return G(this,(function(r){switch(r.label){case 0:return this.gestureManager.dispose(),this.keyboardManager.dispose(),null===(e=this.canvasResizeObserver)||void 0===e||e.disconnect(),this.isRunningInsideWorker()?[4,null===(t=this.sketchWeb)||void 0===t?void 0:t.dispose()]:[3,2];case 1:return r.sent(),null===(n=this.worker)||void 0===n||n.terminate(),[3,3];case 2:null===(o=this.sketchWeb)||void 0===o||o.dispose(),r.label=3;case 3:return[2]}}))}))},t}(r.v)},475:(e,t,n)=>{"use strict";n.d(t,{U:()=>v});var o,r=n(419),i=n(519),a=n(480),s=n(108),u=n(849),c=n(758),l=n(332),h=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),d=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},f=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},v=(globalThis.indexedDB,function(e){function t(t){var n=t.canvas,o=t.locateFile,i=t.filePath,a=t.imagesURLFormat,c=t.imagesURLMap,h=t.backgroundColor,d=void 0===h?{r:1,g:1,b:1,a:1}:h,f=t.highlightColor,v=void 0===f?{r:0,g:0,b:0,a:1}:f,p=t.size,m=t.pixelRatio,b=t.mode,g=t.showTilesBorders,y=void 0!==g&&g,w=t.minimumZoomLevel,k=t.maximumZoomLevel,C=t.preserveDrawingBuffer,P=void 0!==C&&C,W=t.panBoundariesPadding,S=void 0===W?40:W,M=e.call(this)||this;return M.status={type:"INIT"},M.handleWebGLContextLost=function(){M.setStatus({type:"WEBGL_CONTEXT_LOST"})},M.debouncedFullDraw=(0,r.Ds)((function(){return M.draw(!0)}),200),M.canvas=n,M.locateFile=o,M.filePath=i,M.imagesURLFormat=a,M.imagesURLMap=c,M.backgroundColor=d,M.highlightColor=v,M.size=p,M.pixelRatio=m,M.mode=b,M.showTilesBorders=y,M.currentWebGLVersion=(0,r.wX)(),M.zoomLevels={min:w,max:k},M.preserveDrawingBuffer=P,M.panBoundariesPadding=S,u.Z.active=b===l.p.debug,M.traceFirstPaint=new s.S("FirstPaint"),M}return h(t,e),t.prototype.init=function(){return d(this,void 0,void 0,(function(){var e;return f(this,(function(t){switch(t.label){case 0:this.setStatus({type:"INIT"}),t.label=1;case 1:return t.trys.push([1,4,,5]),[4,this.initSketchWebWasm()];case 2:return t.sent(),[4,this.setFile(this.filePath)];case 3:return t.sent(),[3,5];case 4:return e=t.sent(),[2,this.fail(e instanceof c.k?e:new c.k("ERROR","Unexpected exception initializing the web renderer",e))];case 5:return[2]}}))}))},t.prototype.startRendering=function(){this.traceInitialRender=new s.S("InitialRender"),this.setStatus({type:"DRAWING_FILE"}),this.draw(!0,!1),this.sketchWebWasm.startRenderLoop()},t.prototype.createJSBridge=function(){var e=this;return{logDebug:function(e){u.Z.debug("[C++] "+e)},logWarning:function(e){u.Z.warning("[C++] "+e)},logError:function(e){u.Z.error("[C++] "+e)},emitMetric:function(t,n,o,r){e.emit("metric",{id:t,start:n,end:o,duration:r})},resolveImageUrl:function(t){return e.imagesURLFormat?e.imagesURLFormat.replace(":imageId",t):e.imagesURLMap&&e.imagesURLMap[t]?e.imagesURLMap[t]:(u.Z.warning("Not able to resolve the url for the image with UUID: "+t),"")},onDrawComplete:this.handleDrawComplete.bind(this),onArtboardMouseEnter:function(t){e.emit("artboardMouseEnter",t)},onArtboardMouseLeave:function(t){e.emit("artboardMouseLeave",t)},onArtboardSelected:function(t){e.emit("artboardSelected",t)},onArtboardDeselected:function(t){e.emit("artboardDeselected",t)},onGoToArtboard:function(t,n){e.emit("goToArtboard",t,n)},onAllImagesReady:function(){e.emit("allImagesReady")}}},t.prototype.downloadImages=function(){var e=this;return new Promise((function(t){var n,o=new s.S("ImagesDownload");null===(n=e.sketchWebWasm)||void 0===n||n.downloadImages((function(){o.printMeasurement(),e.emit("metric",o.measure()),u.Z.debug("Images downloaded"),t()}))}))},t.prototype.initSketchWebWasm=function(){return d(this,void 0,void 0,(function(){var e,t,o,r,a,h,d,v=this;return f(this,(function(f){switch(f.label){case 0:return e=new s.S("WasmModuleDownload"),this.mode!==l.p.debug?[3,2]:[4,n.e(425).then(n.t.bind(n,425,23))];case 1:return t=f.sent(),[3,4];case 2:return[4,n.e(816).then(n.t.bind(n,816,23))];case 3:t=f.sent(),f.label=4;case 4:o=t.default,f.label=5;case 5:return f.trys.push([5,7,,8]),r=this,[4,o({FeatureFlags:i.Z,currentWebGLVersion:this.currentWebGLVersion,locateFile:function(e){return v.locateFile.replace("{file}",e)},bridge:this.createJSBridge()})];case 6:return r.wasmModule=f.sent(),[3,8];case 7:throw a=f.sent(),new c.k("WASM_ERROR","An error occurred while trying to create the wasm module.",a);case 8:if(e.printMeasurement(),this.emit("metric",e.measure()),h={antialias:!1,majorVersion:this.currentWebGLVersion,alpha:!0,powerPreference:"high-performance",preserveDrawingBuffer:this.preserveDrawingBuffer},u.Z.debug("Using WebGL "+h.majorVersion),!(d=this.wasmModule.GL.createContext(this.canvas,h)))throw new c.k("WEBGL_ERROR","Unable to create WebGL context. WebGL might be unsupported, disabled, or this device is not able to run WebGL correctly.");this.webglCtxHandle=d;try{this.sketchWebWasm=this.wasmModule.SketchWeb.MakeGL(this.webglCtxHandle,this.canvas.width,this.size.height)}catch(e){throw new c.k("WASM_ERROR","An error occurred while trying to create the SketchWebWasm object.",e)}return this.sketchWebWasm.setPixelRatio(this.pixelRatio),this.sketchWebWasm.setBackgroundColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),this.sketchWebWasm.setHighlightColor(this.highlightColor.r,this.highlightColor.g,this.highlightColor.b,this.highlightColor.a),this.sketchWebWasm.setRendererConfiguration({showTilesBorders:this.showTilesBorders}),this.sketchWebWasm.setZoomLevels(this.zoomLevels.min,this.zoomLevels.max),this.sketchWebWasm.setPanBoundariesPadding(this.panBoundariesPadding),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLost),[2]}}))}))},t.prototype.generateDocumentPNG=function(){return d(this,void 0,void 0,(function(){return f(this,(function(e){switch(e.label){case 0:return[4,this.downloadImages()];case 1:return e.sent(),[2,this.sketchWebWasm.generateDocumentPNG()]}}))}))},t.prototype.handleDrawComplete=function(){"DRAWING_FILE"===this.status.type&&(this.traceInitialRender.printMeasurement(),this.emit("metric",this.traceInitialRender.measure()),this.traceFirstPaint.printMeasurement(),this.emit("metric",this.traceFirstPaint.measure()),this.setStatus({type:"READY"}),this.downloadImages())},t.prototype.looseWebGLContext=function(){var e=this.wasmModule.GL.getContext(this.webglCtxHandle);if(e){var t=e.GLctx.getExtension("WEBGL_lose_context");t?t.loseContext():console.warn("Unable to retrieve WEBGL_lose_context extension")}else console.warn("Unable to loose context. WebGL rendering context not found")},t.prototype.scaleDocumentToFit=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.scaleDocumentToFit(),this.delayedDraw()},t.prototype.setFile=function(e){return d(this,void 0,void 0,(function(){var t=this;return f(this,(function(n){return this.setStatus({type:"LOADING_FILE"}),[2,new Promise((function(n,o){t.sketchWebWasm.setFile(e,(function(e){if(void 0===e&&(e=[]),e.length){u.Z.debug("Parser warnings: "+e);var o=e.map((function(e){return{key:e}}));t.emit("warnings",o)}t.setStatus({type:"FILE_READY"}),n()}),(function(){return o(new c.k("FILE_ERROR","Error encountered while fetching and parsing the file"))}))}))]}))}))},t.prototype.delayedDraw=function(){if(!i.Z.delayedDraw)return this.draw(!0);this.draw(),this.debouncedFullDraw()},t.prototype.draw=function(e,t){var n;void 0===e&&(e=!1),void 0===t&&(t=!1),null===(n=this.sketchWebWasm)||void 0===n||n.setNeedsUpdate(e,t)},t.prototype.fail=function(e){this.setStatus({type:"FAILURE",code:e.code,message:e.toString()+(e.cause?"\nWrapped Error: "+e.cause.toString():"")}),u.Z.error(e),e.cause&&u.Z.error(e.cause)},t.prototype.setPixelRatio=function(e){var t;this.pixelRatio=e,null===(t=this.sketchWebWasm)||void 0===t||t.setPixelRatio(e),this.delayedDraw()},t.prototype.setSize=function(e,t){var n;this.size.width=e,this.size.height=t,this.canvas.width=e,this.canvas.height=t,null===(n=this.sketchWebWasm)||void 0===n||n.resize(e,t)},t.prototype.setStatus=function(e){"FAILURE"!==this.status.type&&(u.Z.debug("Status transition "+this.status.type+" => "+e.type+"}"),this.status=e,this.emit("status",e))},t.prototype.getArtboardAtPosition=function(e,t){var n;return null===(n=this.sketchWebWasm)||void 0===n?void 0:n.getArtboardAtPosition(e,t)},t.prototype.getPanAtPosition=function(e,t){var n;return null===(n=this.sketchWebWasm)||void 0===n?void 0:n.getPanAtPosition(e,t)},t.prototype.getStatus=function(){return this.status},t.prototype.setZoom=function(e,t){var n,o;null===(n=this.sketchWebWasm)||void 0===n||n.setZoomCenter(t.x,t.y),null===(o=this.sketchWebWasm)||void 0===o||o.setZoom(e),this.delayedDraw()},t.prototype.addZoom=function(e,t){var n,o;null===(n=this.sketchWebWasm)||void 0===n||n.setZoomCenter(t.x,t.y),null===(o=this.sketchWebWasm)||void 0===o||o.addZoom(e),this.delayedDraw()},t.prototype.setPan=function(e,t,n){var o;void 0===n&&(n=!1),null===(o=this.sketchWebWasm)||void 0===o||o.setPan(e,t,n),this.delayedDraw()},t.prototype.addPan=function(e,t){var n;null===(n=this.sketchWebWasm)||void 0===n||n.addPan(e,t),this.delayedDraw()},t.prototype.getPan=function(){if(this.sketchWebWasm)return this.sketchWebWasm.getPan()},t.prototype.getZoom=function(){var e;return null===(e=this.sketchWebWasm)||void 0===e?void 0:e.getZoom()},t.prototype.setMouse=function(e,t){var n;null===(n=this.sketchWebWasm)||void 0===n||n.setMouse(e,t)},t.prototype.setIsCameraMoving=function(e){var t;null===(t=this.sketchWebWasm)||void 0===t||t.setIsCameraMoving(e)},t.prototype.mouseDown=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.mouseDown()},t.prototype.mouseUp=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.mouseUp()},t.prototype.mouseDoubleClick=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.mouseDoubleClick()},t.prototype.keyUp=function(e){var t;null===(t=this.sketchWebWasm)||void 0===t||t.keyUp(e)},t.prototype.dispose=function(){var e,t;try{null===(e=this.sketchWebWasm)||void 0===e||e.stopRenderLoop(),null===(t=this.sketchWebWasm)||void 0===t||t.delete()}catch(e){this.fail(new c.k("ERROR","Unexpected exception while disposing the SketchWebWasm object",e))}this.sketchWebWasm=null},t}(a.v))},948:(e,t,n)=>{"use strict";n.d(t,{z0:()=>U,oW:()=>O,JB:()=>m,qX:()=>E,SC:()=>D,zB:()=>R,GC:()=>W,xH:()=>v,z7:()=>A,rR:()=>C,JU:()=>M,vN:()=>g,Y6:()=>L,$5:()=>w});var o,r=n(297),i=n.n(r),a=n(933),s=n(849),u=function(){return(u=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},c=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},l=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},h=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o},d=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.Z.debug.apply(s.Z,h(["SketchWebContext"],e))};!function(e){e.Draggable="grab",e.Dragging="grabbing",e.Hover="pointer",e.Default="auto"}(o||(o={}));var f=(0,r.createContext)(void 0),v=function(){var e=(0,r.useContext)(f);if(void 0===e)throw Error("useSketchWebManager must be used within a SketchWebProvider");return e},p=(0,r.createContext)(void 0),m=function(){var e=(0,r.useContext)(p);if(void 0===e)throw Error("useSketchWebActions must be used within a SketchWebProvider");return e},b=(0,r.createContext)(void 0),g=function(){var e=(0,r.useContext)(b);if(void 0===e)throw Error("useSketchWebStatus must be used within a SketchWebProvider");return e},y=(0,r.createContext)(void 0),w=function(){var e=(0,r.useContext)(y);if(void 0===e)throw Error("useSketchWebZoom must be used within a SketchWebProvider");return e},k=(0,r.createContext)(void 0),C=function(){var e=(0,r.useContext)(k);if(void 0===e)throw Error("useSketchWebPan must be used within a SketchWebProvider");return e},P=(0,r.createContext)(void 0),W=function(){var e=(0,r.useContext)(P);if(void 0===e)throw Error("useSketchWebHoveredArtboardUUID must be used within a SketchWebProvider");return e},S=(0,r.createContext)(void 0),M=function(){var e=(0,r.useContext)(S);if(void 0===e)throw Error("useSketchWebSelectedArtboardUUID must be used within a SketchWebProvider");return e},E=function(e){var t=v();(0,r.useEffect)((function(){return null==t||t.on("allImagesReady",e),function(){null==t||t.off("allImagesReady",e)}}),[t,e])},x=(0,r.createContext)(void 0),D=function(){var e=(0,r.useContext)(x);if(void 0===e)throw Error("useSketchWebCursor must be used within a SketchWebProvider");return e},L=function(e){var t=v();(0,r.useEffect)((function(){return null==t||t.on("warnings",e),function(){null==t||t.off("warnings",e)}}),[t,e])},R=function(e){var t=v();(0,r.useEffect)((function(){return null==t||t.on("goToArtboard",e),function(){null==t||t.off("goToArtboard",e)}}),[t,e])},A=function(e){var t=v();(0,r.useEffect)((function(){return null==t||t.on("metric",e),function(){null==t||t.off("metric",e)}}),[t,e])},Z=function(e,t){switch(d('dispatched: "'+t.type+'"',t),t.type){case"on-status":return u(u({},e),{status:t.status});case"on-zoom":return u(u({},e),{zoom:t.zoom});case"on-pan":return u(u({},e),{pan:t.pan});case"dispose":return u(u({},e),{status:null,filePath:null,selectedArtboardUUID:null,hoveredArtboardUUID:null,zoom:null,pan:null,cursor:o.Default});case"post-init":return u(u({},e),{status:t.status,zoom:t.zoom});case"set-file-path":return u(u({},e),{filePath:t.filePath});case"on-artboard-mouse-enter":return u(u({},e),{hoveredArtboardUUID:t.uuid,cursor:o.Hover});case"on-artboard-mouse-leave":return u(u({},e),{hoveredArtboardUUID:null,cursor:e.isMouseDown?o.Dragging:o.Draggable});case"on-artboard-selected":return u(u({},e),{selectedArtboardUUID:t.uuid});case"on-artboard-deselected":return u(u({},e),{selectedArtboardUUID:null});case"on-mouse-down":return u(u({},e),{cursor:o.Dragging,isMouseDown:!0});case"on-mouse-up":return u(u({},e),{cursor:e.hoveredArtboardUUID?o.Hover:o.Draggable,isMouseDown:!1});default:return e}},U=function(e){var t=e.children,n=(0,r.useRef)(null),s=(0,r.useRef)(null),h=(0,r.useReducer)(Z,{pan:null,zoom:null,status:null,filePath:null,hoveredArtboardUUID:null,selectedArtboardUUID:null,cursor:o.Default,isMouseDown:!1}),v=h[0],m=v.status,g=v.zoom,w=v.pan,C=v.hoveredArtboardUUID,W=v.selectedArtboardUUID,M=v.cursor,E=h[1],D=(0,r.useCallback)((function(e){return E({type:"on-zoom",zoom:e})}),[]),L=(0,r.useCallback)((function(e,t){return E({type:"on-pan",pan:{x:e,y:t}})}),[]),R=(0,r.useCallback)((function(e){E({type:"on-status",status:e})}),[]),A=(0,r.useCallback)((function(e){return E({type:"on-artboard-mouse-enter",uuid:e})}),[]),U=(0,r.useCallback)((function(){return E({type:"on-artboard-mouse-leave"})}),[]),_=(0,r.useCallback)((function(e){E({type:"on-artboard-selected",uuid:e})}),[]),O=(0,r.useCallback)((function(){return E({type:"on-artboard-deselected"})}),[]),I=(0,r.useCallback)((function(){return E({type:"on-mouse-down"})}),[]),T=(0,r.useCallback)((function(){return E({type:"on-mouse-up"})}),[]),z=(0,r.useCallback)((function(){n.current&&(d("dispose"),n.current.off("status",R),n.current.off("artboardMouseEnter",A),n.current.off("artboardMouseLeave",U),n.current.off("artboardSelected",_),n.current.off("artboardDeselected",O),n.current.off("zoom",D),n.current.off("pan",L),n.current.gestureManager.off("mousedown",I),n.current.gestureManager.off("mouseup",T),n.current.dispose(),n.current=null,E({type:"dispose"}))}),[R,L,D,A,U,_,O,T,I]),G=(0,r.useCallback)((function(e){e&&!n.current&&s.current&&(d("init"),E({type:"set-file-path",filePath:e}),n.current=new a.d(u(u({},s.current),{filePath:e})),n.current.on("status",R),n.current.on("artboardMouseEnter",A),n.current.on("artboardMouseLeave",U),n.current.on("artboardSelected",_),n.current.on("artboardDeselected",O),n.current.on("zoom",D),n.current.on("pan",L),n.current.gestureManager.on("mousedown",I),n.current.gestureManager.on("mouseup",T),c(void 0,void 0,void 0,(function(){var e,t,o,r,i,a;return l(this,(function(s){switch(s.label){case 0:return[4,null===(r=n.current)||void 0===r?void 0:r.getPan()];case 1:return e=s.sent()||null,t=E,o={type:"post-init"},[4,null===(i=n.current)||void 0===i?void 0:i.getZoom()];case 2:return o.zoom=s.sent()||null,[4,null===(a=n.current)||void 0===a?void 0:a.getStatus()];case 3:return t.apply(void 0,[(o.status=s.sent()||null,o.pan=null!=e?e:null,o)]),[2]}}))})))}),[R,D,L,A,U,_,O,I,T]),F=(0,r.useCallback)((function(e){d("setSettings",e),s.current=e}),[]),j=(0,r.useCallback)((function(e){var t;d("setZoom",e),null===(t=n.current)||void 0===t||t.setZoom(e)}),[]),B=(0,r.useCallback)((function(){var e,t;d("incrementZoom"),"number"==typeof g&&(t=g>=1?Math.round(2*g):g>.5?1:2*g,null===(e=n.current)||void 0===e||e.setZoom(t))}),[g]),N=(0,r.useCallback)((function(){var e;d("decrementZoom"),"number"==typeof g&&(null===(e=n.current)||void 0===e||e.setZoom(g/2))}),[g]),H=(0,r.useCallback)((function(e){var t,o=e.x,r=e.y,i=e.centerPointInViewport;d("setPan",o,r,"centerPointInViewport",i),null===(t=n.current)||void 0===t||t.setPan(o,r,i)}),[]),X=(0,r.useCallback)((function(){var e;d("zoomToFit"),null===(e=n.current)||void 0===e||e.zoomToFit()}),[]),Y=(0,r.useCallback)((function(){var e;d("looseWebGLContext"),null===(e=n.current)||void 0===e||e.looseWebGLContext()}),[]),V=(0,r.useCallback)((function(){return c(void 0,void 0,void 0,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return d("generateDocumentPNG"),[4,null===(e=n.current)||void 0===e?void 0:e.generateDocumentPNG()];case 1:return[2,t.sent()]}}))}))}),[]),q=(0,r.useCallback)((function(e,t){return c(void 0,void 0,void 0,(function(){var o;return l(this,(function(r){switch(r.label){case 0:return d("getArtboardAtPosition",e,t),[4,null===(o=n.current)||void 0===o?void 0:o.getArtboardAtPosition(e,t)];case 1:return[2,r.sent()||null]}}))}))}),[]),K=(0,r.useCallback)((function(e,t){return c(void 0,void 0,void 0,(function(){var o;return l(this,(function(r){switch(r.label){case 0:return d("invoked: getPanAtPosition",e,t),[4,null===(o=n.current)||void 0===o?void 0:o.getPanAtPosition(e,t)];case 1:return[2,r.sent()||null]}}))}))}),[]),J=(0,r.useCallback)((function(e){var t;d("setIsCameraLocked",e),null===(t=n.current)||void 0===t||t.gestureManager.setIsCameraLocked(e)}),[]),$=(0,r.useMemo)((function(){return{setSettings:F,init:G,dispose:z,setZoom:j,incrementZoom:B,decrementZoom:N,setPan:H,zoomToFit:X,looseWebGLContext:Y,generateDocumentPNG:V,getArtboardAtPosition:q,getPanAtPosition:K,setIsCameraLocked:J}}),[F,G,z,j,B,N,H,X,Y,V,q,K,J]);return i().createElement(f.Provider,{value:n.current},i().createElement(p.Provider,{value:$},i().createElement(b.Provider,{value:m},i().createElement(y.Provider,{value:g},i().createElement(k.Provider,{value:w},i().createElement(S.Provider,{value:W},i().createElement(P.Provider,{value:C},i().createElement(x.Provider,{value:M},t))))))))},_=n(332),O=function(e){s.Z.active=e.mode===_.p.debug;var t=e.filePath,n=e.locateFile,o=e.imagesURLFormat,a=e.imagesURLMap,u=e.backgroundColor,c=e.highlightColor,l=e.mode,h=e.showTilesBorders,d=e.minimumZoomLevel,f=e.maximumZoomLevel,v=e.preserveDrawingBuffer,p=e.panBoundariesPadding,b=e.initialPan,y=e.initialZoom,w=e.onCanvasClick,k=e.onCanvasContextMenu,C=(0,r.useState)(null),P=C[0],W=C[1],S=(0,r.useState)(null),M=S[0],x=S[1],L=(0,r.useState)(!1),R=L[0],A=L[1],Z=m(),U=Z.dispose,O=Z.setSettings,I=Z.init,T=D(),z=g();return E((function(){A(!0)})),(0,r.useEffect)((function(){M&&P&&O({locateFile:n,imagesURLFormat:o,imagesURLMap:a,backgroundColor:u,highlightColor:c,mode:l,showTilesBorders:h,minimumZoomLevel:d,maximumZoomLevel:f,preserveDrawingBuffer:v,panBoundariesPadding:p,initialPan:b,initialZoom:y,container:M,canvas:P})}),[O,n,o,a,u,c,l,h,d,f,v,p,b,y,M,P]),(0,r.useEffect)((function(){if(t&&P&&M)return I(t),function(){return U()}}),[U,I,t,P,M]),i().createElement("div",{ref:function(e){return x(e)},style:{position:"relative",width:"100%",height:"100%"}},i().createElement("canvas",{onClick:w,onContextMenu:k,ref:function(e){return W(e)},"data-sketchweb-all-images-ready":R,"data-testid":"sketchweb-canvas","data-sketchweb-status":"sketchweb-status-"+((null==z?void 0:z.type.toLowerCase())||"null"),style:{position:"absolute",inset:"0",cursor:T}}))}},758:(e,t,n)=>{"use strict";n.d(t,{k:()=>i});var o,r=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(n,o,r){var i=this.constructor,a=e.call(this,"("+n+") "+o)||this;return a.code=n,a.cause=r,a.name=t.name,Object.setPrototypeOf(a,i.prototype),a}return r(t,e),t}(Error)},18:()=>{},689:()=>{},332:(e,t,n)=>{"use strict";var o;n.d(t,{p:()=>o}),function(e){e.debug="debug",e.release="release"}(o||(o={}))},119:()=>{},312:()=>{},480:(e,t,n)=>{"use strict";n.d(t,{v:()=>o});var o=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){var n,o;this.listeners[e]=null!==(n=this.listeners[e])&&void 0!==n?n:new Set,null===(o=this.listeners[e])||void 0===o||o.add(t)},e.prototype.off=function(e,t){var n;null===(n=this.listeners[e])||void 0===n||n.delete(t)},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=this.listeners[e];(null==o?void 0:o.size)&&o.forEach((function(e){Promise.resolve().then((function(){e.apply(void 0,t)}))}))},e}()},849:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o};const r=new(function(){function e(){this.active=!0}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.active&&console.debug.apply(console,o(["[SketchWeb] [Debug]"],e))},e.prototype.warning=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.active&&console.warn.apply(console,o(["[SketchWeb] [Warn]"],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,o(["[SketchWeb] [Error]"],e))},e}())},108:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var o=n(849),r=function(){function e(e){this.label=e,this.startTime=performance.now(),this.startTimestamp=Date.now(),o.Z.debug("[Performance] Start: "+this.label)}return e.prototype.measure=function(){var e=performance.now()-this.startTime;return{duration:e,end:this.startTimestamp+e,start:this.startTimestamp,id:this.label}},e.prototype.printMeasurement=function(){var e=this.measure().duration;if(e<1e3){var t=e.toFixed(2);o.Z.debug("[Performance] End: "+this.label+" -> "+t+" ms")}else{var n=(e/1e3).toFixed(2);o.Z.debug("[Performance] End: "+this.label+" -> "+n+" s")}},e}()},419:(e,t,n)=>{"use strict";n.d(t,{uZ:()=>o.uZ,Ds:()=>o.Ds,wX:()=>o.wX});var o=n(388)},388:(e,t,n)=>{"use strict";n.d(t,{Ds:()=>i,MP:()=>a,uZ:()=>s,wX:()=>u});var o=n(519),r=n(66);function i(e,t){var n;function o(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];clearTimeout(n),n=setTimeout((function(){e.apply(void 0,o)}),t)}return o.cancel=function(){n&&clearTimeout(n)},o}function a(e){var t,n;return{x:null!==(t=e.pageX)&&void 0!==t?t:e.clientX,y:null!==(n=e.pageY)&&void 0!==n?n:e.clientY}}function s(e,t,n){return Math.max(t,Math.min(n,e))}function u(){return(0,r.t)()&&!o.Z.safariWebGL2?1:"undefined"!=typeof WebGL2RenderingContext?2:1}},66:(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=/(iPhone|Macintosh|iPad)(.*)(Version)\/(0|[1-9]\d*)\.(0|[1-9]\d*)\.?(0|[1-9]\d*)?/,r=function(e){if(void 0===e&&(e=window.navigator.userAgent),e.includes("Chrome/")||e.includes("Chromium/")||e.includes("Opera/")||e.includes("Firefox/"))return null;var t=e.match(o);if(!t)return null;var n=t[1];return"Macintosh"!==n&&"iPad"!==n&&"iPhone"!==n?null:{hardware:n,version:{major:parseInt(t[4])||0,minor:parseInt(t[5])||0,patch:parseInt(t[6])||0}}}},297:t=>{"use strict";t.exports=e}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return i[e](n,n.exports,s),n.exports}s.m=i,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var r=Object.create(null);s.r(r);var i={};t=t||[null,n({}),n([]),n(n)];for(var a=2&o&&e;"object"==typeof a&&!~t.indexOf(a);a=n(a))Object.getOwnPropertyNames(a).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,s.d(r,i),r},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"static/js/web-renderer-"+{425:"3effe72d4cf4931fc6e0",509:"757e587f3dfc5ed5ee9d",816:"8526d667c341405f97bb"}[e]+".chunk.js",s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},r="@sketch-hq/sketch-web-renderer:",s.l=(e,t,n,i)=>{if(o[e])o[e].push(t);else{var a,u;if(void 0!==n)for(var c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var h=c[l];if(h.getAttribute("src")==e||h.getAttribute("data-webpack")==r+n){a=h;break}}a||(u=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",r+n),a.src=e),o[e]=[t];var d=(t,n)=>{a.onerror=a.onload=null,clearTimeout(f);var r=o[e];if(delete o[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((e=>e(n))),t)return t(n)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),u&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.p="/",(()=>{s.b=document.baseURI||self.location.href;var e={826:0};s.f.j=(t,n)=>{var o=s.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise(((n,r)=>o=e[t]=[n,r]));n.push(o[2]=r);var i=s.p+s.u(t),a=new Error;s.l(i,(n=>{if(s.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+r+": "+i+")",a.name="ChunkLoadError",a.type=r,a.request=i,o[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var o,r,[i,a,u]=n,c=0;if(i.some((t=>0!==e[t]))){for(o in a)s.o(a,o)&&(s.m[o]=a[o]);u&&u(s)}for(t&&t(n);c<i.length;c++)r=i[c],s.o(e,r)&&e[r]&&e[r][0](),e[i[c]]=0},n=self.webpackChunk_sketch_hq_sketch_web_renderer=self.webpackChunk_sketch_hq_sketch_web_renderer||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var u={};return(()=>{"use strict";s.r(u),s.d(u,{default:()=>d,SketchWeb:()=>t.U,SketchWebMode:()=>i.p,SketchWebError:()=>c.k,SketchWebProvider:()=>h.z0,SketchWebReact:()=>h.oW,useSketchWebActions:()=>h.JB,useSketchWebAllImagesReadyEvent:()=>h.qX,useSketchWebCursor:()=>h.SC,useSketchWebGoToArtboardEvent:()=>h.zB,useSketchWebHoveredArtboardUUID:()=>h.GC,useSketchWebManager:()=>h.xH,useSketchWebMetricEvent:()=>h.z7,useSketchWebPan:()=>h.rR,useSketchWebSelectedArtboardUUID:()=>h.JU,useSketchWebStatus:()=>h.vN,useSketchWebWarningsEvent:()=>h.Y6,useSketchWebZoom:()=>h.$5});var e=s(933),t=s(475),n=s(18),o={};for(const e in n)["default","SketchWeb"].indexOf(e)<0&&(o[e]=()=>n[e]);s.d(u,o);var r=s(119);o={};for(const e in r)["default","SketchWeb"].indexOf(e)<0&&(o[e]=()=>r[e]);s.d(u,o);var i=s(332),a=s(312);o={};for(const e in a)["default","SketchWeb","SketchWebMode"].indexOf(e)<0&&(o[e]=()=>a[e]);s.d(u,o);var c=s(758),l=s(689);o={};for(const e in l)["default","SketchWeb","SketchWebMode","SketchWebError"].indexOf(e)<0&&(o[e]=()=>l[e]);s.d(u,o);var h=s(948);const d=e.d})(),u})()}));
|
package/dist/module-debug.wasm
CHANGED
|
Binary file
|
package/dist/module-release.wasm
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(function(){return(()=>{"use strict";var e,t,n={},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.m=n,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>s[e]=()=>n[e]));return s.default=()=>n,o.d(i,s),i},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,n)=>(o.f[n](e,t),t)),[])),o.u=e=>"static/js/web-renderer-"+{425:"3effe72d4cf4931fc6e0",816:"f04ca78328f96a575c42"}[e]+".chunk.js",o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.p="/",(()=>{var e={509:1};o.f.i=(t,n)=>{e[t]||importScripts(o.p+o.u(t))};var t=self.webpackChunk_sketch_hq_sketch_web_renderer=self.webpackChunk_sketch_hq_sketch_web_renderer||[],n=t.push.bind(t);t.push=t=>{var[r,i,s]=t;for(var a in i)o.o(i,a)&&(o.m[a]=i[a]);for(s&&s(o);r.length;)e[r.pop()]=1;n(t)}})();const i={delayedDraw:!0,offscreenCanvas:!1,safariWebGL2:!1,pageBoundariesLimit:!1};var s=/(iPhone|Macintosh|iPad)(.*)(Version)\/(0|[1-9]\d*)\.(0|[1-9]\d*)\.?(0|[1-9]\d*)?/;var a=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){var n,r;this.listeners[e]=null!==(n=this.listeners[e])&&void 0!==n?n:new Set,null===(r=this.listeners[e])||void 0===r||r.add(t)},e.prototype.off=function(e,t){var n;null===(n=this.listeners[e])||void 0===n||n.delete(t)},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this.listeners[e];(null==r?void 0:r.size)&&r.forEach((function(e){Promise.resolve().then((function(){e.apply(void 0,t)}))}))},e}(),c=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r};const u=new(function(){function e(){this.active=!0}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.active&&console.debug.apply(console,c(["[SketchWeb] [Debug]"],e))},e.prototype.warning=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.active&&console.warn.apply(console,c(["[SketchWeb] [Warn]"],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,c(["[SketchWeb] [Error]"],e))},e}());var l,h,d=function(){function e(e){this.label=e,this.startTime=performance.now(),this.startTimestamp=Date.now(),u.debug("[Performance] Start: "+this.label)}return e.prototype.measure=function(){var e=performance.now()-this.startTime;return{duration:e,end:this.startTimestamp+e,start:this.startTimestamp,id:this.label}},e.prototype.printMeasurement=function(){var e=this.measure().duration;if(e<1e3){var t=e.toFixed(2);u.debug("[Performance] End: "+this.label+" -> "+t+" ms")}else{var n=(e/1e3).toFixed(2);u.debug("[Performance] End: "+this.label+" -> "+n+" s")}},e}(),p=(l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),f=function(e){function t(n,r,o){var i=this.constructor,s=e.call(this,"("+n+") "+r)||this;return s.code=n,s.cause=o,s.name=t.name,Object.setPrototypeOf(s,i.prototype),s}return p(t,e),t}(Error);!function(e){e.debug="debug",e.release="release"}(h||(h={}));var m=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},v=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},g=(globalThis.indexedDB,function(e){function t(t){var n=t.canvas,r=t.locateFile,o=t.filePath,a=t.imagesURLFormat,c=t.imagesURLMap,l=t.backgroundColor,p=void 0===l?{r:1,g:1,b:1,a:1}:l,f=t.highlightColor,m=void 0===f?{r:0,g:0,b:0,a:1}:f,b=t.size,v=t.pixelRatio,g=t.mode,y=t.showTilesBorders,w=void 0!==y&&y,W=t.minimumZoomLevel,k=t.maximumZoomLevel,L=t.preserveDrawingBuffer,P=void 0!==L&&L,E=t.panBoundariesPadding,R=void 0===E?40:E,x=e.call(this)||this;return x.status={type:"INIT"},x.handleWebGLContextLost=function(){x.setStatus({type:"WEBGL_CONTEXT_LOST"})},x.debouncedFullDraw=function(e,t){var n;function r(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];clearTimeout(n),n=setTimeout((function(){e.apply(void 0,t)}),200)}return r.cancel=function(){n&&clearTimeout(n)},r}((function(){return x.draw(!0)})),x.canvas=n,x.locateFile=r,x.filePath=o,x.imagesURLFormat=a,x.imagesURLMap=c,x.backgroundColor=p,x.highlightColor=m,x.size=b,x.pixelRatio=v,x.mode=g,x.showTilesBorders=w,x.currentWebGLVersion=function(e){if(void 0===e&&(e=window.navigator.userAgent),e.includes("Chrome/")||e.includes("Chromium/")||e.includes("Opera/")||e.includes("Firefox/"))return null;var t=e.match(s);if(!t)return null;var n=t[1];return"Macintosh"!==n&&"iPad"!==n&&"iPhone"!==n?null:{hardware:n,version:{major:parseInt(t[4])||0,minor:parseInt(t[5])||0,patch:parseInt(t[6])||0}}}()&&!i.safariWebGL2?1:"undefined"!=typeof WebGL2RenderingContext?2:1,x.zoomLevels={min:W,max:k},x.preserveDrawingBuffer=P,x.panBoundariesPadding=R,u.active=g===h.debug,x.traceFirstPaint=new d("FirstPaint"),x}return m(t,e),t.prototype.init=function(){return b(this,void 0,void 0,(function(){var e;return v(this,(function(t){switch(t.label){case 0:this.setStatus({type:"INIT"}),t.label=1;case 1:return t.trys.push([1,4,,5]),[4,this.initSketchWebWasm()];case 2:return t.sent(),[4,this.setFile(this.filePath)];case 3:return t.sent(),[3,5];case 4:return e=t.sent(),[2,this.fail(e instanceof f?e:new f("ERROR","Unexpected exception initializing the web renderer",e))];case 5:return[2]}}))}))},t.prototype.startRendering=function(){this.traceInitialRender=new d("InitialRender"),this.setStatus({type:"DRAWING_FILE"}),this.draw(!0,!1),this.sketchWebWasm.startRenderLoop()},t.prototype.createJSBridge=function(){var e=this;return{logDebug:function(e){u.debug("[C++] "+e)},logWarning:function(e){u.warning("[C++] "+e)},logError:function(e){u.error("[C++] "+e)},emitMetric:function(t,n,r,o){e.emit("metric",{id:t,start:n,end:r,duration:o})},resolveImageUrl:function(t){return e.imagesURLFormat?e.imagesURLFormat.replace(":imageId",t):e.imagesURLMap&&e.imagesURLMap[t]?e.imagesURLMap[t]:(u.warning("Not able to resolve the url for the image with UUID: "+t),"")},onDrawComplete:this.handleDrawComplete.bind(this),onArtboardMouseEnter:function(t){e.emit("artboardMouseEnter",t)},onArtboardMouseLeave:function(t){e.emit("artboardMouseLeave",t)},onArtboardSelected:function(t){e.emit("artboardSelected",t)},onArtboardDeselected:function(t){e.emit("artboardDeselected",t)},onGoToArtboard:function(t,n){e.emit("goToArtboard",t,n)},onAllImagesReady:function(){e.emit("allImagesReady")}}},t.prototype.downloadImages=function(){var e=this;return new Promise((function(t){var n,r=new d("ImagesDownload");null===(n=e.sketchWebWasm)||void 0===n||n.downloadImages((function(){r.printMeasurement(),e.emit("metric",r.measure()),u.debug("Images downloaded"),t()}))}))},t.prototype.initSketchWebWasm=function(){return b(this,void 0,void 0,(function(){var e,t,n,r,s,a,c,l=this;return v(this,(function(p){switch(p.label){case 0:return e=new d("WasmModuleDownload"),this.mode!==h.debug?[3,2]:[4,o.e(425).then(o.t.bind(o,425,23))];case 1:return t=p.sent(),[3,4];case 2:return[4,o.e(816).then(o.t.bind(o,816,23))];case 3:t=p.sent(),p.label=4;case 4:n=t.default,p.label=5;case 5:return p.trys.push([5,7,,8]),r=this,[4,n({FeatureFlags:i,currentWebGLVersion:this.currentWebGLVersion,locateFile:function(e){return l.locateFile.replace("{file}",e)},bridge:this.createJSBridge()})];case 6:return r.wasmModule=p.sent(),[3,8];case 7:throw s=p.sent(),new f("WASM_ERROR","An error occurred while trying to create the wasm module.",s);case 8:if(e.printMeasurement(),this.emit("metric",e.measure()),a={antialias:!1,majorVersion:this.currentWebGLVersion,alpha:!0,powerPreference:"high-performance",preserveDrawingBuffer:this.preserveDrawingBuffer},u.debug("Using WebGL "+a.majorVersion),!(c=this.wasmModule.GL.createContext(this.canvas,a)))throw new f("WEBGL_ERROR","Unable to create WebGL context. WebGL might be unsupported, disabled, or this device is not able to run WebGL correctly.");this.webglCtxHandle=c;try{this.sketchWebWasm=this.wasmModule.SketchWeb.MakeGL(this.webglCtxHandle,this.canvas.width,this.size.height)}catch(e){throw new f("WASM_ERROR","An error occurred while trying to create the SketchWebWasm object.",e)}return this.sketchWebWasm.setPixelRatio(this.pixelRatio),this.sketchWebWasm.setBackgroundColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),this.sketchWebWasm.setHighlightColor(this.highlightColor.r,this.highlightColor.g,this.highlightColor.b,this.highlightColor.a),this.sketchWebWasm.setRendererConfiguration({showTilesBorders:this.showTilesBorders}),this.sketchWebWasm.setZoomLevels(this.zoomLevels.min,this.zoomLevels.max),this.sketchWebWasm.setPanBoundariesPadding(this.panBoundariesPadding),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLost),[2]}}))}))},t.prototype.generateDocumentPNG=function(){return b(this,void 0,void 0,(function(){return v(this,(function(e){switch(e.label){case 0:return[4,this.downloadImages()];case 1:return e.sent(),[2,this.sketchWebWasm.generateDocumentPNG()]}}))}))},t.prototype.handleDrawComplete=function(){"DRAWING_FILE"===this.status.type&&(this.traceInitialRender.printMeasurement(),this.emit("metric",this.traceInitialRender.measure()),this.traceFirstPaint.printMeasurement(),this.emit("metric",this.traceFirstPaint.measure()),this.setStatus({type:"READY"}),this.downloadImages())},t.prototype.looseWebGLContext=function(){var e=this.wasmModule.GL.getContext(this.webglCtxHandle);if(e){var t=e.GLctx.getExtension("WEBGL_lose_context");t?t.loseContext():console.warn("Unable to retrieve WEBGL_lose_context extension")}else console.warn("Unable to loose context. WebGL rendering context not found")},t.prototype.scaleDocumentToFit=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.scaleDocumentToFit(),this.delayedDraw()},t.prototype.setFile=function(e){return b(this,void 0,void 0,(function(){var t=this;return v(this,(function(n){return this.setStatus({type:"LOADING_FILE"}),[2,new Promise((function(n,r){t.sketchWebWasm.setFile(e,(function(e){if(void 0===e&&(e=[]),e.length){u.debug("Parser warnings: "+e);var r=e.map((function(e){return{key:e}}));t.emit("warnings",r)}t.setStatus({type:"FILE_READY"}),n()}),(function(){return r(new f("FILE_ERROR","Error encountered while fetching and parsing the file"))}))}))]}))}))},t.prototype.delayedDraw=function(){if(!i.delayedDraw)return this.draw(!0);this.draw(),this.debouncedFullDraw()},t.prototype.draw=function(e,t){var n;void 0===e&&(e=!1),void 0===t&&(t=!1),null===(n=this.sketchWebWasm)||void 0===n||n.setNeedsUpdate(e,t)},t.prototype.fail=function(e){this.setStatus({type:"FAILURE",code:e.code,message:e.toString()+(e.cause?"\nWrapped Error: "+e.cause.toString():"")}),u.error(e),e.cause&&u.error(e.cause)},t.prototype.setPixelRatio=function(e){var t;this.pixelRatio=e,null===(t=this.sketchWebWasm)||void 0===t||t.setPixelRatio(e),this.delayedDraw()},t.prototype.setSize=function(e,t){var n;this.size.width=e,this.size.height=t,this.canvas.width=e,this.canvas.height=t,null===(n=this.sketchWebWasm)||void 0===n||n.resize(e,t)},t.prototype.setStatus=function(e){"FAILURE"!==this.status.type&&(u.debug("Status transition "+this.status.type+" => "+e.type+"}"),this.status=e,this.emit("status",e))},t.prototype.getArtboardAtPosition=function(e,t){var n;return null===(n=this.sketchWebWasm)||void 0===n?void 0:n.getArtboardAtPosition(e,t)},t.prototype.getPanAtPosition=function(e,t){var n;return null===(n=this.sketchWebWasm)||void 0===n?void 0:n.getPanAtPosition(e,t)},t.prototype.getStatus=function(){return this.status},t.prototype.setZoom=function(e,t){var n,r;null===(n=this.sketchWebWasm)||void 0===n||n.setZoomCenter(t.x,t.y),null===(r=this.sketchWebWasm)||void 0===r||r.setZoom(e),this.delayedDraw()},t.prototype.addZoom=function(e,t){var n,r;null===(n=this.sketchWebWasm)||void 0===n||n.setZoomCenter(t.x,t.y),null===(r=this.sketchWebWasm)||void 0===r||r.addZoom(e),this.delayedDraw()},t.prototype.setPan=function(e,t,n){var r;void 0===n&&(n=!1),null===(r=this.sketchWebWasm)||void 0===r||r.setPan(e,t,n),this.delayedDraw()},t.prototype.addPan=function(e,t){var n;null===(n=this.sketchWebWasm)||void 0===n||n.addPan(e,t),this.delayedDraw()},t.prototype.getPan=function(){if(this.sketchWebWasm)return this.sketchWebWasm.getPan()},t.prototype.getZoom=function(){var e;return null===(e=this.sketchWebWasm)||void 0===e?void 0:e.getZoom()},t.prototype.setMouse=function(e,t){var n;null===(n=this.sketchWebWasm)||void 0===n||n.setMouse(e,t)},t.prototype.setIsCameraMoving=function(e){var t;null===(t=this.sketchWebWasm)||void 0===t||t.setIsCameraMoving(e)},t.prototype.mouseDown=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.mouseDown()},t.prototype.mouseUp=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.mouseUp()},t.prototype.mouseDoubleClick=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.mouseDoubleClick()},t.prototype.keyUp=function(e){var t;null===(t=this.sketchWebWasm)||void 0===t||t.keyUp(e)},t.prototype.dispose=function(){var e,t;try{null===(e=this.sketchWebWasm)||void 0===e||e.stopRenderLoop(),null===(t=this.sketchWebWasm)||void 0===t||t.delete()}catch(e){this.fail(new f("ERROR","Unexpected exception while disposing the SketchWebWasm object",e))}this.sketchWebWasm=null},t}(a));const y=Symbol("Comlink.proxy"),w=Symbol("Comlink.endpoint"),W=Symbol("Comlink.releaseProxy"),k=Symbol("Comlink.thrown"),L=e=>"object"==typeof e&&null!==e||"function"==typeof e,P=new Map([["proxy",{canHandle:e=>L(e)&&e[y],serialize(e){const{port1:t,port2:n}=new MessageChannel;return E(e,t),[n,[n]]},deserialize:e=>(e.start(),S(e,[],undefined))}],["throw",{canHandle:e=>L(e)&&k in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function E(e,t=self){t.addEventListener("message",(function n(r){if(!r||!r.data)return;const{id:o,type:i,path:s}=Object.assign({path:[]},r.data),a=(r.data.argumentList||[]).map(O);let c;try{const t=s.slice(0,-1).reduce(((e,t)=>e[t]),e),n=s.reduce(((e,t)=>e[t]),e);switch(i){case"GET":c=n;break;case"SET":t[s.slice(-1)[0]]=O(r.data.value),c=!0;break;case"APPLY":c=n.apply(t,a);break;case"CONSTRUCT":c=function(e){return Object.assign(e,{[y]:!0})}(new n(...a));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;E(e,n),c=function(e,t){return _.set(e,t),e}(t,[t])}break;case"RELEASE":c=void 0;break;default:return}}catch(e){c={value:e,[k]:0}}Promise.resolve(c).catch((e=>({value:e,[k]:0}))).then((e=>{const[r,s]=D(e);t.postMessage(Object.assign(Object.assign({},r),{id:o}),s),"RELEASE"===i&&(t.removeEventListener("message",n),R(t))}))})),t.start&&t.start()}function R(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function x(e){if(e)throw new Error("Proxy has been released and is not useable")}function S(e,t=[],n=function(){}){let r=!1;const o=new Proxy(n,{get(n,i){if(x(r),i===W)return()=>M(e,{type:"RELEASE",path:t.map((e=>e.toString()))}).then((()=>{R(e),r=!0}));if("then"===i){if(0===t.length)return{then:()=>o};const n=M(e,{type:"GET",path:t.map((e=>e.toString()))}).then(O);return n.then.bind(n)}return S(e,[...t,i])},set(n,o,i){x(r);const[s,a]=D(i);return M(e,{type:"SET",path:[...t,o].map((e=>e.toString())),value:s},a).then(O)},apply(n,o,i){x(r);const s=t[t.length-1];if(s===w)return M(e,{type:"ENDPOINT"}).then(O);if("bind"===s)return S(e,t.slice(0,-1));const[a,c]=C(i);return M(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:a},c).then(O)},construct(n,o){x(r);const[i,s]=C(o);return M(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:i},s).then(O)}});return o}function C(e){const t=e.map(D);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const _=new WeakMap;function D(e){for(const[t,n]of P)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},_.get(e)||[]]}function O(e){switch(e.type){case"HANDLER":return P.get(e.name).deserialize(e.value);case"RAW":return e.value}}function M(e,t,n){return new Promise((r=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(n){n.data&&n.data.id&&n.data.id===o&&(e.removeEventListener("message",t),r(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)}))}return E(g),{}})()}));
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(function(){return(()=>{"use strict";var e,t,n={},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.m=n,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>s[e]=()=>n[e]));return s.default=()=>n,o.d(i,s),i},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,n)=>(o.f[n](e,t),t)),[])),o.u=e=>"static/js/web-renderer-"+{425:"3effe72d4cf4931fc6e0",816:"8526d667c341405f97bb"}[e]+".chunk.js",o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.p="/",(()=>{var e={509:1};o.f.i=(t,n)=>{e[t]||importScripts(o.p+o.u(t))};var t=self.webpackChunk_sketch_hq_sketch_web_renderer=self.webpackChunk_sketch_hq_sketch_web_renderer||[],n=t.push.bind(t);t.push=t=>{var[r,i,s]=t;for(var a in i)o.o(i,a)&&(o.m[a]=i[a]);for(s&&s(o);r.length;)e[r.pop()]=1;n(t)}})();const i={delayedDraw:!0,offscreenCanvas:!1,safariWebGL2:!1,pageBoundariesLimit:!1};var s=/(iPhone|Macintosh|iPad)(.*)(Version)\/(0|[1-9]\d*)\.(0|[1-9]\d*)\.?(0|[1-9]\d*)?/;var a=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){var n,r;this.listeners[e]=null!==(n=this.listeners[e])&&void 0!==n?n:new Set,null===(r=this.listeners[e])||void 0===r||r.add(t)},e.prototype.off=function(e,t){var n;null===(n=this.listeners[e])||void 0===n||n.delete(t)},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this.listeners[e];(null==r?void 0:r.size)&&r.forEach((function(e){Promise.resolve().then((function(){e.apply(void 0,t)}))}))},e}(),c=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r};const u=new(function(){function e(){this.active=!0}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.active&&console.debug.apply(console,c(["[SketchWeb] [Debug]"],e))},e.prototype.warning=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.active&&console.warn.apply(console,c(["[SketchWeb] [Warn]"],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,c(["[SketchWeb] [Error]"],e))},e}());var l,h,d=function(){function e(e){this.label=e,this.startTime=performance.now(),this.startTimestamp=Date.now(),u.debug("[Performance] Start: "+this.label)}return e.prototype.measure=function(){var e=performance.now()-this.startTime;return{duration:e,end:this.startTimestamp+e,start:this.startTimestamp,id:this.label}},e.prototype.printMeasurement=function(){var e=this.measure().duration;if(e<1e3){var t=e.toFixed(2);u.debug("[Performance] End: "+this.label+" -> "+t+" ms")}else{var n=(e/1e3).toFixed(2);u.debug("[Performance] End: "+this.label+" -> "+n+" s")}},e}(),p=(l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),f=function(e){function t(n,r,o){var i=this.constructor,s=e.call(this,"("+n+") "+r)||this;return s.code=n,s.cause=o,s.name=t.name,Object.setPrototypeOf(s,i.prototype),s}return p(t,e),t}(Error);!function(e){e.debug="debug",e.release="release"}(h||(h={}));var m=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},v=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},g=(globalThis.indexedDB,function(e){function t(t){var n=t.canvas,r=t.locateFile,o=t.filePath,a=t.imagesURLFormat,c=t.imagesURLMap,l=t.backgroundColor,p=void 0===l?{r:1,g:1,b:1,a:1}:l,f=t.highlightColor,m=void 0===f?{r:0,g:0,b:0,a:1}:f,b=t.size,v=t.pixelRatio,g=t.mode,y=t.showTilesBorders,w=void 0!==y&&y,W=t.minimumZoomLevel,k=t.maximumZoomLevel,L=t.preserveDrawingBuffer,P=void 0!==L&&L,E=t.panBoundariesPadding,R=void 0===E?40:E,x=e.call(this)||this;return x.status={type:"INIT"},x.handleWebGLContextLost=function(){x.setStatus({type:"WEBGL_CONTEXT_LOST"})},x.debouncedFullDraw=function(e,t){var n;function r(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];clearTimeout(n),n=setTimeout((function(){e.apply(void 0,t)}),200)}return r.cancel=function(){n&&clearTimeout(n)},r}((function(){return x.draw(!0)})),x.canvas=n,x.locateFile=r,x.filePath=o,x.imagesURLFormat=a,x.imagesURLMap=c,x.backgroundColor=p,x.highlightColor=m,x.size=b,x.pixelRatio=v,x.mode=g,x.showTilesBorders=w,x.currentWebGLVersion=function(e){if(void 0===e&&(e=window.navigator.userAgent),e.includes("Chrome/")||e.includes("Chromium/")||e.includes("Opera/")||e.includes("Firefox/"))return null;var t=e.match(s);if(!t)return null;var n=t[1];return"Macintosh"!==n&&"iPad"!==n&&"iPhone"!==n?null:{hardware:n,version:{major:parseInt(t[4])||0,minor:parseInt(t[5])||0,patch:parseInt(t[6])||0}}}()&&!i.safariWebGL2?1:"undefined"!=typeof WebGL2RenderingContext?2:1,x.zoomLevels={min:W,max:k},x.preserveDrawingBuffer=P,x.panBoundariesPadding=R,u.active=g===h.debug,x.traceFirstPaint=new d("FirstPaint"),x}return m(t,e),t.prototype.init=function(){return b(this,void 0,void 0,(function(){var e;return v(this,(function(t){switch(t.label){case 0:this.setStatus({type:"INIT"}),t.label=1;case 1:return t.trys.push([1,4,,5]),[4,this.initSketchWebWasm()];case 2:return t.sent(),[4,this.setFile(this.filePath)];case 3:return t.sent(),[3,5];case 4:return e=t.sent(),[2,this.fail(e instanceof f?e:new f("ERROR","Unexpected exception initializing the web renderer",e))];case 5:return[2]}}))}))},t.prototype.startRendering=function(){this.traceInitialRender=new d("InitialRender"),this.setStatus({type:"DRAWING_FILE"}),this.draw(!0,!1),this.sketchWebWasm.startRenderLoop()},t.prototype.createJSBridge=function(){var e=this;return{logDebug:function(e){u.debug("[C++] "+e)},logWarning:function(e){u.warning("[C++] "+e)},logError:function(e){u.error("[C++] "+e)},emitMetric:function(t,n,r,o){e.emit("metric",{id:t,start:n,end:r,duration:o})},resolveImageUrl:function(t){return e.imagesURLFormat?e.imagesURLFormat.replace(":imageId",t):e.imagesURLMap&&e.imagesURLMap[t]?e.imagesURLMap[t]:(u.warning("Not able to resolve the url for the image with UUID: "+t),"")},onDrawComplete:this.handleDrawComplete.bind(this),onArtboardMouseEnter:function(t){e.emit("artboardMouseEnter",t)},onArtboardMouseLeave:function(t){e.emit("artboardMouseLeave",t)},onArtboardSelected:function(t){e.emit("artboardSelected",t)},onArtboardDeselected:function(t){e.emit("artboardDeselected",t)},onGoToArtboard:function(t,n){e.emit("goToArtboard",t,n)},onAllImagesReady:function(){e.emit("allImagesReady")}}},t.prototype.downloadImages=function(){var e=this;return new Promise((function(t){var n,r=new d("ImagesDownload");null===(n=e.sketchWebWasm)||void 0===n||n.downloadImages((function(){r.printMeasurement(),e.emit("metric",r.measure()),u.debug("Images downloaded"),t()}))}))},t.prototype.initSketchWebWasm=function(){return b(this,void 0,void 0,(function(){var e,t,n,r,s,a,c,l=this;return v(this,(function(p){switch(p.label){case 0:return e=new d("WasmModuleDownload"),this.mode!==h.debug?[3,2]:[4,o.e(425).then(o.t.bind(o,425,23))];case 1:return t=p.sent(),[3,4];case 2:return[4,o.e(816).then(o.t.bind(o,816,23))];case 3:t=p.sent(),p.label=4;case 4:n=t.default,p.label=5;case 5:return p.trys.push([5,7,,8]),r=this,[4,n({FeatureFlags:i,currentWebGLVersion:this.currentWebGLVersion,locateFile:function(e){return l.locateFile.replace("{file}",e)},bridge:this.createJSBridge()})];case 6:return r.wasmModule=p.sent(),[3,8];case 7:throw s=p.sent(),new f("WASM_ERROR","An error occurred while trying to create the wasm module.",s);case 8:if(e.printMeasurement(),this.emit("metric",e.measure()),a={antialias:!1,majorVersion:this.currentWebGLVersion,alpha:!0,powerPreference:"high-performance",preserveDrawingBuffer:this.preserveDrawingBuffer},u.debug("Using WebGL "+a.majorVersion),!(c=this.wasmModule.GL.createContext(this.canvas,a)))throw new f("WEBGL_ERROR","Unable to create WebGL context. WebGL might be unsupported, disabled, or this device is not able to run WebGL correctly.");this.webglCtxHandle=c;try{this.sketchWebWasm=this.wasmModule.SketchWeb.MakeGL(this.webglCtxHandle,this.canvas.width,this.size.height)}catch(e){throw new f("WASM_ERROR","An error occurred while trying to create the SketchWebWasm object.",e)}return this.sketchWebWasm.setPixelRatio(this.pixelRatio),this.sketchWebWasm.setBackgroundColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),this.sketchWebWasm.setHighlightColor(this.highlightColor.r,this.highlightColor.g,this.highlightColor.b,this.highlightColor.a),this.sketchWebWasm.setRendererConfiguration({showTilesBorders:this.showTilesBorders}),this.sketchWebWasm.setZoomLevels(this.zoomLevels.min,this.zoomLevels.max),this.sketchWebWasm.setPanBoundariesPadding(this.panBoundariesPadding),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLost),[2]}}))}))},t.prototype.generateDocumentPNG=function(){return b(this,void 0,void 0,(function(){return v(this,(function(e){switch(e.label){case 0:return[4,this.downloadImages()];case 1:return e.sent(),[2,this.sketchWebWasm.generateDocumentPNG()]}}))}))},t.prototype.handleDrawComplete=function(){"DRAWING_FILE"===this.status.type&&(this.traceInitialRender.printMeasurement(),this.emit("metric",this.traceInitialRender.measure()),this.traceFirstPaint.printMeasurement(),this.emit("metric",this.traceFirstPaint.measure()),this.setStatus({type:"READY"}),this.downloadImages())},t.prototype.looseWebGLContext=function(){var e=this.wasmModule.GL.getContext(this.webglCtxHandle);if(e){var t=e.GLctx.getExtension("WEBGL_lose_context");t?t.loseContext():console.warn("Unable to retrieve WEBGL_lose_context extension")}else console.warn("Unable to loose context. WebGL rendering context not found")},t.prototype.scaleDocumentToFit=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.scaleDocumentToFit(),this.delayedDraw()},t.prototype.setFile=function(e){return b(this,void 0,void 0,(function(){var t=this;return v(this,(function(n){return this.setStatus({type:"LOADING_FILE"}),[2,new Promise((function(n,r){t.sketchWebWasm.setFile(e,(function(e){if(void 0===e&&(e=[]),e.length){u.debug("Parser warnings: "+e);var r=e.map((function(e){return{key:e}}));t.emit("warnings",r)}t.setStatus({type:"FILE_READY"}),n()}),(function(){return r(new f("FILE_ERROR","Error encountered while fetching and parsing the file"))}))}))]}))}))},t.prototype.delayedDraw=function(){if(!i.delayedDraw)return this.draw(!0);this.draw(),this.debouncedFullDraw()},t.prototype.draw=function(e,t){var n;void 0===e&&(e=!1),void 0===t&&(t=!1),null===(n=this.sketchWebWasm)||void 0===n||n.setNeedsUpdate(e,t)},t.prototype.fail=function(e){this.setStatus({type:"FAILURE",code:e.code,message:e.toString()+(e.cause?"\nWrapped Error: "+e.cause.toString():"")}),u.error(e),e.cause&&u.error(e.cause)},t.prototype.setPixelRatio=function(e){var t;this.pixelRatio=e,null===(t=this.sketchWebWasm)||void 0===t||t.setPixelRatio(e),this.delayedDraw()},t.prototype.setSize=function(e,t){var n;this.size.width=e,this.size.height=t,this.canvas.width=e,this.canvas.height=t,null===(n=this.sketchWebWasm)||void 0===n||n.resize(e,t)},t.prototype.setStatus=function(e){"FAILURE"!==this.status.type&&(u.debug("Status transition "+this.status.type+" => "+e.type+"}"),this.status=e,this.emit("status",e))},t.prototype.getArtboardAtPosition=function(e,t){var n;return null===(n=this.sketchWebWasm)||void 0===n?void 0:n.getArtboardAtPosition(e,t)},t.prototype.getPanAtPosition=function(e,t){var n;return null===(n=this.sketchWebWasm)||void 0===n?void 0:n.getPanAtPosition(e,t)},t.prototype.getStatus=function(){return this.status},t.prototype.setZoom=function(e,t){var n,r;null===(n=this.sketchWebWasm)||void 0===n||n.setZoomCenter(t.x,t.y),null===(r=this.sketchWebWasm)||void 0===r||r.setZoom(e),this.delayedDraw()},t.prototype.addZoom=function(e,t){var n,r;null===(n=this.sketchWebWasm)||void 0===n||n.setZoomCenter(t.x,t.y),null===(r=this.sketchWebWasm)||void 0===r||r.addZoom(e),this.delayedDraw()},t.prototype.setPan=function(e,t,n){var r;void 0===n&&(n=!1),null===(r=this.sketchWebWasm)||void 0===r||r.setPan(e,t,n),this.delayedDraw()},t.prototype.addPan=function(e,t){var n;null===(n=this.sketchWebWasm)||void 0===n||n.addPan(e,t),this.delayedDraw()},t.prototype.getPan=function(){if(this.sketchWebWasm)return this.sketchWebWasm.getPan()},t.prototype.getZoom=function(){var e;return null===(e=this.sketchWebWasm)||void 0===e?void 0:e.getZoom()},t.prototype.setMouse=function(e,t){var n;null===(n=this.sketchWebWasm)||void 0===n||n.setMouse(e,t)},t.prototype.setIsCameraMoving=function(e){var t;null===(t=this.sketchWebWasm)||void 0===t||t.setIsCameraMoving(e)},t.prototype.mouseDown=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.mouseDown()},t.prototype.mouseUp=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.mouseUp()},t.prototype.mouseDoubleClick=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.mouseDoubleClick()},t.prototype.keyUp=function(e){var t;null===(t=this.sketchWebWasm)||void 0===t||t.keyUp(e)},t.prototype.dispose=function(){var e,t;try{null===(e=this.sketchWebWasm)||void 0===e||e.stopRenderLoop(),null===(t=this.sketchWebWasm)||void 0===t||t.delete()}catch(e){this.fail(new f("ERROR","Unexpected exception while disposing the SketchWebWasm object",e))}this.sketchWebWasm=null},t}(a));const y=Symbol("Comlink.proxy"),w=Symbol("Comlink.endpoint"),W=Symbol("Comlink.releaseProxy"),k=Symbol("Comlink.thrown"),L=e=>"object"==typeof e&&null!==e||"function"==typeof e,P=new Map([["proxy",{canHandle:e=>L(e)&&e[y],serialize(e){const{port1:t,port2:n}=new MessageChannel;return E(e,t),[n,[n]]},deserialize:e=>(e.start(),S(e,[],undefined))}],["throw",{canHandle:e=>L(e)&&k in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function E(e,t=self){t.addEventListener("message",(function n(r){if(!r||!r.data)return;const{id:o,type:i,path:s}=Object.assign({path:[]},r.data),a=(r.data.argumentList||[]).map(O);let c;try{const t=s.slice(0,-1).reduce(((e,t)=>e[t]),e),n=s.reduce(((e,t)=>e[t]),e);switch(i){case"GET":c=n;break;case"SET":t[s.slice(-1)[0]]=O(r.data.value),c=!0;break;case"APPLY":c=n.apply(t,a);break;case"CONSTRUCT":c=function(e){return Object.assign(e,{[y]:!0})}(new n(...a));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;E(e,n),c=function(e,t){return _.set(e,t),e}(t,[t])}break;case"RELEASE":c=void 0;break;default:return}}catch(e){c={value:e,[k]:0}}Promise.resolve(c).catch((e=>({value:e,[k]:0}))).then((e=>{const[r,s]=D(e);t.postMessage(Object.assign(Object.assign({},r),{id:o}),s),"RELEASE"===i&&(t.removeEventListener("message",n),R(t))}))})),t.start&&t.start()}function R(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function x(e){if(e)throw new Error("Proxy has been released and is not useable")}function S(e,t=[],n=function(){}){let r=!1;const o=new Proxy(n,{get(n,i){if(x(r),i===W)return()=>M(e,{type:"RELEASE",path:t.map((e=>e.toString()))}).then((()=>{R(e),r=!0}));if("then"===i){if(0===t.length)return{then:()=>o};const n=M(e,{type:"GET",path:t.map((e=>e.toString()))}).then(O);return n.then.bind(n)}return S(e,[...t,i])},set(n,o,i){x(r);const[s,a]=D(i);return M(e,{type:"SET",path:[...t,o].map((e=>e.toString())),value:s},a).then(O)},apply(n,o,i){x(r);const s=t[t.length-1];if(s===w)return M(e,{type:"ENDPOINT"}).then(O);if("bind"===s)return S(e,t.slice(0,-1));const[a,c]=C(i);return M(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:a},c).then(O)},construct(n,o){x(r);const[i,s]=C(o);return M(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:i},s).then(O)}});return o}function C(e){const t=e.map(D);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const _=new WeakMap;function D(e){for(const[t,n]of P)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},_.get(e)||[]]}function O(e){switch(e.type){case"HANDLER":return P.get(e.name).deserialize(e.value);case"RAW":return e.value}}function M(e,t,n){return new Promise((r=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(n){n.data&&n.data.id&&n.data.id===o&&(e.removeEventListener("message",t),r(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)}))}return E(g),{}})()}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_sketch_hq_sketch_web_renderer=self.webpackChunk_sketch_hq_sketch_web_renderer||[]).push([[816],{816:e=>{var r,t=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var t,n,a=void 0!==(e=e||{})?e:{};a.ready=new Promise((function(e,r){t=e,n=r}));var i,o={};for(i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);var u=[],s="./this.program",c="";"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),r&&(c=r),c=0!==c.indexOf("blob:")?c.substr(0,c.lastIndexOf("/")+1):"";var f=a.print||console.log.bind(console),l=a.printErr||console.warn.bind(console);for(i in o)o.hasOwnProperty(i)&&(a[i]=o[i]);o=null,a.arguments&&(u=a.arguments),a.thisProgram&&(s=a.thisProgram),a.quit&&a.quit;var d,m,p=0;a.wasmBinary&&(d=a.wasmBinary),a.noExitRuntime,"object"!=typeof WebAssembly&&J("no native wasm support detected");var v=!1,h="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function g(e,r,t){for(var n=r+t,a=r;e[a]&&!(a>=n);)++a;if(a-r>16&&e.subarray&&h)return h.decode(e.subarray(r,a));for(var i="";r<a;){var o=e[r++];if(128&o){var u=63&e[r++];if(192!=(224&o)){var s=63&e[r++];if((o=224==(240&o)?(15&o)<<12|u<<6|s:(7&o)<<18|u<<12|s<<6|63&e[r++])<65536)i+=String.fromCharCode(o);else{var c=o-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&o)<<6|u)}else i+=String.fromCharCode(o)}return i}function y(e,r){return e?g(E,e,r):""}function b(e,r,t,n){if(!(n>0))return 0;for(var a=t,i=t+n-1,o=0;o<e.length;++o){var u=e.charCodeAt(o);if(u>=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&e.charCodeAt(++o)),u<=127){if(t>=i)break;r[t++]=u}else if(u<=2047){if(t+1>=i)break;r[t++]=192|u>>6,r[t++]=128|63&u}else if(u<=65535){if(t+2>=i)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|63&u}else{if(t+3>=i)break;r[t++]=240|u>>18,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|63&u}}return r[t]=0,t-a}function w(e,r,t){return b(e,E,r,t)}function _(e){for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++t)),n<=127?++r:r+=n<=2047?2:n<=65535?3:4}return r}var x,C,E,P,T,S,A,j,$,I="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function k(e,r){for(var t=e,n=t>>1,a=n+r/2;!(n>=a)&&T[n];)++n;if((t=n<<1)-e>32&&I)return I.decode(E.subarray(e,t));for(var i="",o=0;!(o>=r/2);++o){var u=P[e+2*o>>1];if(0==u)break;i+=String.fromCharCode(u)}return i}function D(e,r,t){if(void 0===t&&(t=2147483647),t<2)return 0;for(var n=r,a=(t-=2)<2*e.length?t/2:e.length,i=0;i<a;++i){var o=e.charCodeAt(i);P[r>>1]=o,r+=2}return P[r>>1]=0,r-n}function F(e){return 2*e.length}function L(e,r){for(var t=0,n="";!(t>=r/4);){var a=S[e+4*t>>2];if(0==a)break;if(++t,a>=65536){var i=a-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(a)}return n}function O(e,r,t){if(void 0===t&&(t=2147483647),t<4)return 0;for(var n=r,a=n+t-4,i=0;i<e.length;++i){var o=e.charCodeAt(i);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),S[r>>2]=o,(r+=4)+4>a)break}return S[r>>2]=0,r-n}function B(e){for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r}function W(e){x=e,a.HEAP8=C=new Int8Array(e),a.HEAP16=P=new Int16Array(e),a.HEAP32=S=new Int32Array(e),a.HEAPU8=E=new Uint8Array(e),a.HEAPU16=T=new Uint16Array(e),a.HEAPU32=A=new Uint32Array(e),a.HEAPF32=j=new Float32Array(e),a.HEAPF64=$=new Float64Array(e)}a.INITIAL_MEMORY;var M,U=[],R=[],G=[],N=[],V=0,Y=null,H=null;function z(e){V++,a.monitorRunDependencies&&a.monitorRunDependencies(V)}function q(e){if(V--,a.monitorRunDependencies&&a.monitorRunDependencies(V),0==V&&(null!==Y&&(clearInterval(Y),Y=null),H)){var r=H;H=null,r()}}function J(e){a.onAbort&&a.onAbort(e),l(e+=""),v=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var r=new WebAssembly.RuntimeError(e);throw n(r),r}function K(e){return r=e,t="data:application/octet-stream;base64,",String.prototype.startsWith?r.startsWith(t):0===r.indexOf(t);var r,t}a.preloadedImages={},a.preloadedAudios={};var X,Q="module-release.wasm";function Z(e){try{if(e==Q&&d)return new Uint8Array(d);throw"both async and sync fetching of the wasm failed"}catch(e){J(e)}}function ee(e){for(;e.length>0;){var r=e.shift();if("function"!=typeof r){var t=r.func;"number"==typeof t?void 0===r.arg?M.get(t)():M.get(t)(r.arg):t(void 0===r.arg?null:r.arg)}else r(a)}}K(Q)||(X=Q,Q=a.locateFile?a.locateFile(X,c):c+X);function re(e){this.excPtr=e,this.ptr=e-16,this.set_type=function(e){S[this.ptr+8>>2]=e},this.get_type=function(){return S[this.ptr+8>>2]},this.set_destructor=function(e){S[this.ptr+0>>2]=e},this.get_destructor=function(){return S[this.ptr+0>>2]},this.set_refcount=function(e){S[this.ptr+4>>2]=e},this.set_caught=function(e){e=e?1:0,C[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=C[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,C[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=C[this.ptr+13>>0]},this.init=function(e,r){this.set_type(e),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=S[this.ptr+4>>2];S[this.ptr+4>>2]=e+1},this.release_ref=function(){var e=S[this.ptr+4>>2];return S[this.ptr+4>>2]=e-1,1===e}}var te={mappings:{},buffers:[null,[],[]],printChar:function(e,r){var t=te.buffers[e];0===r||10===r?((1===e?f:l)(g(t,0)),t.length=0):t.push(r)},varargs:void 0,get:function(){return te.varargs+=4,S[te.varargs-4>>2]},getStr:function(e){return y(e)},get64:function(e,r){return e}};function ne(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}var ae=void 0;function ie(e){for(var r="",t=e;E[t];)r+=ae[E[t++]];return r}var oe={},ue={},se={};function ce(e){if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?"_"+e:e}function fe(e,r){return e=ce(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(r)}function le(e,r){var t=fe(r,(function(e){this.name=r,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}));return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},t}var de=void 0;function me(e){throw new de(e)}var pe=void 0;function ve(e){throw new pe(e)}function he(e,r,t){function n(r){var n=t(r);n.length!==e.length&&ve("Mismatched type converter count");for(var a=0;a<e.length;++a)ge(e[a],n[a])}e.forEach((function(e){se[e]=r}));var a=new Array(r.length),i=[],o=0;r.forEach((function(e,r){ue.hasOwnProperty(e)?a[r]=ue[e]:(i.push(e),oe.hasOwnProperty(e)||(oe[e]=[]),oe[e].push((function(){a[r]=ue[e],++o===i.length&&n(a)})))})),0===i.length&&n(a)}function ge(e,r,t){if(t=t||{},!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=r.name;if(e||me('type "'+n+'" must have a positive integer typeid pointer'),ue.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;me("Cannot register type '"+n+"' twice")}if(ue[e]=r,delete se[e],oe.hasOwnProperty(e)){var a=oe[e];delete oe[e],a.forEach((function(e){e()}))}}function ye(e){me(e.$$.ptrType.registeredClass.name+" instance already deleted")}var be=!1;function we(e){}function _e(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function xe(e){return"undefined"==typeof FinalizationGroup?(xe=function(e){return e},e):(be=new FinalizationGroup((function(e){for(var r=e.next();!r.done;r=e.next()){var t=r.value;t.ptr?_e(t):console.warn("object already deleted: "+t.ptr)}})),we=function(e){be.unregister(e.$$)},(xe=function(e){return be.register(e,e.$$,e.$$),e})(e))}var Ce=void 0,Ee=[];function Pe(){for(;Ee.length;){var e=Ee.pop();e.$$.deleteScheduled=!1,e.delete()}}function Te(){}var Se={};function Ae(e,r,t){if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||me("Function '"+t+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[r].overloadTable+")!"),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}}function je(e,r,t,n,a,i,o,u){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=a,this.getActualType=i,this.upcast=o,this.downcast=u,this.pureVirtualFunctions=[]}function $e(e,r,t){for(;r!==t;)r.upcast||me("Expected null or instance of "+t.name+", got an instance of "+r.name),e=r.upcast(e),r=r.baseClass;return e}function Ie(e,r){if(null===r)return this.isReference&&me("null is not a valid "+this.name),0;r.$$||me('Cannot pass "'+Qe(r)+'" as a '+this.name),r.$$.ptr||me("Cannot pass deleted object as a pointer of type "+this.name);var t=r.$$.ptrType.registeredClass;return $e(r.$$.ptr,t,this.registeredClass)}function ke(e,r){var t;if(null===r)return this.isReference&&me("null is not a valid "+this.name),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r.$$||me('Cannot pass "'+Qe(r)+'" as a '+this.name),r.$$.ptr||me("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&r.$$.ptrType.isConst&&me("Cannot convert argument of type "+(r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name)+" to parameter type "+this.name);var n=r.$$.ptrType.registeredClass;if(t=$e(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&me("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:me("Cannot convert argument of type "+(r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var a=r.clone();t=this.rawShare(t,Xe((function(){a.delete()}))),null!==e&&e.push(this.rawDestructor,t)}break;default:me("Unsupporting sharing policy")}return t}function De(e,r){if(null===r)return this.isReference&&me("null is not a valid "+this.name),0;r.$$||me('Cannot pass "'+Qe(r)+'" as a '+this.name),r.$$.ptr||me("Cannot pass deleted object as a pointer of type "+this.name),r.$$.ptrType.isConst&&me("Cannot convert argument of type "+r.$$.ptrType.name+" to parameter type "+this.name);var t=r.$$.ptrType.registeredClass;return $e(r.$$.ptr,t,this.registeredClass)}function Fe(e){return this.fromWireType(A[e>>2])}function Le(e,r,t){if(r===t)return e;if(void 0===t.baseClass)return null;var n=Le(e,r,t.baseClass);return null===n?null:t.downcast(n)}var Oe={};function Be(e,r){return r.ptrType&&r.ptr||ve("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&ve("Both smartPtrType and smartPtr must be specified"),r.count={value:1},xe(Object.create(e,{$$:{value:r}}))}function We(e,r,t,n,a,i,o,u,s,c,f){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=a,this.pointeeType=i,this.sharingPolicy=o,this.rawGetPointee=u,this.rawConstructor=s,this.rawShare=c,this.rawDestructor=f,a||void 0!==r.baseClass?this.toWireType=ke:n?(this.toWireType=Ie,this.destructorFunction=null):(this.toWireType=De,this.destructorFunction=null)}function Me(e,r,t){return-1!=e.indexOf("j")?function(e,r,t){var n=a["dynCall_"+e];return t&&t.length?n.apply(null,[r].concat(t)):n.call(null,r)}(e,r,t):M.get(r).apply(null,t)}function Ue(e,r){var t,n,a,i=-1!=(e=ie(e)).indexOf("j")?(t=e,n=r,a=[],function(){a.length=arguments.length;for(var e=0;e<arguments.length;e++)a[e]=arguments[e];return Me(t,n,a)}):M.get(r);return"function"!=typeof i&&me("unknown function pointer with signature "+e+": "+r),i}var Re=void 0;function Ge(e){var r=Nr(e),t=ie(r);return Rr(r),t}function Ne(e,r){var t=[],n={};throw r.forEach((function e(r){n[r]||ue[r]||(se[r]?se[r].forEach(e):(t.push(r),n[r]=!0))})),new Re(e+": "+t.map(Ge).join([", "]))}function Ve(e,r){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var t=fe(e.name||"unknownFunctionName",(function(){}));t.prototype=e.prototype;var n=new t,a=e.apply(n,r);return a instanceof Object?a:n}function Ye(e){for(;e.length;){var r=e.pop();e.pop()(r)}}function He(e,r,t,n,a){var i=r.length;i<2&&me("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var o=null!==r[1]&&null!==t,u=!1,s=1;s<r.length;++s)if(null!==r[s]&&void 0===r[s].destructorFunction){u=!0;break}var c="void"!==r[0].name,f="",l="";for(s=0;s<i-2;++s)f+=(0!==s?", ":"")+"arg"+s,l+=(0!==s?", ":"")+"arg"+s+"Wired";var d="return function "+ce(e)+"("+f+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";u&&(d+="var destructors = [];\n");var m=u?"destructors":"null",p=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],v=[me,n,a,Ye,r[0],r[1]];for(o&&(d+="var thisWired = classParam.toWireType("+m+", this);\n"),s=0;s<i-2;++s)d+="var arg"+s+"Wired = argType"+s+".toWireType("+m+", arg"+s+"); // "+r[s+2].name+"\n",p.push("argType"+s),v.push(r[s+2]);if(o&&(l="thisWired"+(l.length>0?", ":"")+l),d+=(c?"var rv = ":"")+"invoker(fn"+(l.length>0?", ":"")+l+");\n",u)d+="runDestructors(destructors);\n";else for(s=o?1:2;s<r.length;++s){var h=1===s?"thisWired":"arg"+(s-2)+"Wired";null!==r[s].destructorFunction&&(d+=h+"_dtor("+h+"); // "+r[s].name+"\n",p.push(h+"_dtor"),v.push(r[s].destructorFunction))}return c&&(d+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),d+="}\n",p.push(d),Ve(Function,p).apply(null,v)}function ze(e,r){for(var t=[],n=0;n<e;n++)t.push(S[(r>>2)+n]);return t}var qe=[],Je=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Ke(e){e>4&&0==--Je[e].refcount&&(Je[e]=void 0,qe.push(e))}function Xe(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var r=qe.length?qe.pop():Je.length;return Je[r]={refcount:1,value:e},r}}function Qe(e){if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e}function Ze(e,r){switch(r){case 2:return function(e){return this.fromWireType(j[e>>2])};case 3:return function(e){return this.fromWireType($[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function er(e,r,t){switch(r){case 0:return t?function(e){return C[e]}:function(e){return E[e]};case 1:return t?function(e){return P[e>>1]}:function(e){return T[e>>1]};case 2:return t?function(e){return S[e>>2]}:function(e){return A[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}function rr(e){return e||me("Cannot use deleted val. handle = "+e),Je[e].value}function tr(e,r){var t=ue[e];return void 0===t&&me(r+" has unknown type "+Ge(e)),t}function nr(e,r){for(var t=new Array(e),n=0;n<e;++n)t[n]=tr(S[(r>>2)+n],"parameter "+n);return t}var ar={};function ir(e){var r=ar[e];return void 0===r?ie(e):r}var or,ur=[];function sr(){return"object"==typeof globalThis?globalThis:Function("return this")()}or=function(){return performance.now()};var cr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},timerQueriesEXT:[],queries:[],samplers:[],transformFeedbacks:[],syncs:[],programInfos:{},stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){cr.lastError||(cr.lastError=e)},getNewId:function(e){for(var r=cr.counter++,t=e.length;t<r;t++)e[t]=null;return r},getSource:function(e,r,t,n){for(var a="",i=0;i<r;++i){var o=n?S[n+4*i>>2]:-1;a+=y(S[t+4*i>>2],o<0?void 0:o)}return a},createContext:function(e,r){e.getContextSafariWebGL2Fixed||(e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=function(r,t){var n=e.getContextSafariWebGL2Fixed(r,t);return"webgl"==r==n instanceof WebGLRenderingContext?n:null});var t=r.majorVersion>1?e.getContext("webgl2",r):e.getContext("webgl",r);return t?cr.registerContext(t,r):0},registerContext:function(e,r){var t=cr.getNewId(cr.contexts),n={handle:t,attributes:r,version:r.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),cr.contexts[t]=n,(void 0===r.enableExtensionsByDefault||r.enableExtensionsByDefault)&&cr.initExtensions(n),t},makeContextCurrent:function(e){return cr.currentContext=cr.contexts[e],a.ctx=$r=cr.currentContext&&cr.currentContext.GLctx,!(e&&!$r)},getContext:function(e){return cr.contexts[e]},deleteContext:function(e){cr.currentContext===cr.contexts[e]&&(cr.currentContext=null),"object"==typeof JSEvents&&JSEvents.removeAllHandlersOnTarget(cr.contexts[e].GLctx.canvas),cr.contexts[e]&&cr.contexts[e].GLctx.canvas&&(cr.contexts[e].GLctx.canvas.GLctxObject=void 0),cr.contexts[e]=null},initExtensions:function(e){if(e||(e=cr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var r,t=e.GLctx;!function(e){var r=e.getExtension("ANGLE_instanced_arrays");r&&(e.vertexAttribDivisor=function(e,t){r.vertexAttribDivisorANGLE(e,t)},e.drawArraysInstanced=function(e,t,n,a){r.drawArraysInstancedANGLE(e,t,n,a)},e.drawElementsInstanced=function(e,t,n,a,i){r.drawElementsInstancedANGLE(e,t,n,a,i)})}(t),function(e){var r=e.getExtension("OES_vertex_array_object");r&&(e.createVertexArray=function(){return r.createVertexArrayOES()},e.deleteVertexArray=function(e){r.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){r.bindVertexArrayOES(e)},e.isVertexArray=function(e){return r.isVertexArrayOES(e)})}(t),function(e){var r=e.getExtension("WEBGL_draw_buffers");r&&(e.drawBuffers=function(e,t){r.drawBuffersWEBGL(e,t)})}(t),(r=t).dibvbi=r.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"),function(e){e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")}(t),t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query"),function(e){e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")}(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.indexOf("lose_context")<0&&e.indexOf("debug")<0&&t.getExtension(e)}))}},populateUniformTable:function(e){for(var r=cr.programs[e],t=cr.programInfos[e]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1},n=t.uniforms,a=$r.getProgramParameter(r,35718),i=0;i<a;++i){var o=$r.getActiveUniform(r,i),u=o.name;t.maxUniformLength=Math.max(t.maxUniformLength,u.length+1),"]"==u.slice(-1)&&(u=u.slice(0,u.lastIndexOf("[")));var s=$r.getUniformLocation(r,u);if(s){var c=cr.getNewId(cr.uniforms);n[u]=[o.size,c],cr.uniforms[c]=s;for(var f=1;f<o.size;++f){var l=u+"["+f+"]";s=$r.getUniformLocation(r,l),c=cr.getNewId(cr.uniforms),cr.uniforms[c]=s}}}}};function fr(e,r){return(e>>>0)+4294967296*r}var lr=[];function dr(e,r,t,n){for(var a=0;a<e;a++){var i=$r[t](),o=i&&cr.getNewId(n);i?(i.name=o,n[o]=i):cr.recordError(1282),S[r+4*a>>2]=o}}function mr(e,r,t){if(r){var n,a,i=void 0;switch(e){case 36346:i=1;break;case 36344:return void(0!=t&&1!=t&&cr.recordError(1280));case 34814:case 36345:i=0;break;case 34466:var o=$r.getParameter(34467);i=o?o.length:0;break;case 33309:if(cr.currentContext.version<2)return void cr.recordError(1282);i=2*($r.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(cr.currentContext.version<2)return void cr.recordError(1280);i=33307==e?3:0}if(void 0===i){var u=$r.getParameter(e);switch(typeof u){case"number":i=u;break;case"boolean":i=u?1:0;break;case"string":return void cr.recordError(1280);case"object":if(null===u)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:i=0;break;default:return void cr.recordError(1280)}else{if(u instanceof Float32Array||u instanceof Uint32Array||u instanceof Int32Array||u instanceof Array){for(var s=0;s<u.length;++s)switch(t){case 0:S[r+4*s>>2]=u[s];break;case 2:j[r+4*s>>2]=u[s];break;case 4:C[r+s>>0]=u[s]?1:0}return}try{i=0|u.name}catch(r){return cr.recordError(1280),void l("GL_INVALID_ENUM in glGet"+t+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+r+")")}}break;default:return cr.recordError(1280),void l("GL_INVALID_ENUM in glGet"+t+"v: Native code calling glGet"+t+"v("+e+") and it returns "+u+" of type "+typeof u+"!")}}switch(t){case 1:a=i,A[(n=r)>>2]=a,A[n+4>>2]=(a-A[n>>2])/4294967296;break;case 0:S[r>>2]=i;break;case 2:j[r>>2]=i;break;case 4:C[r>>0]=i?1:0}}else cr.recordError(1281)}function pr(e){var r=_(e)+1,t=Mr(r);return w(e,t,r),t}function vr(e){return 0==(e-=5120)?C:1==e?E:2==e?P:4==e?S:6==e?j:5==e||28922==e||28520==e||30779==e||30782==e?A:T}function hr(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function gr(e,r,t,n,a,i){var o=vr(e),u=hr(o),s=1<<u,c=function(e,r,t,n){var a;return r*(e*t+(a=n)-1&-a)}(t,n,function(e){return{5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1}(r)*s,cr.unpackAlignment);return o.subarray(a>>u,a+c>>u)}var yr=[],br=[];function wr(){return!0}function _r(e){try{return m.grow(e-x.byteLength+65535>>>16),W(m.buffer),1}catch(e){}}a._emscripten_is_main_browser_thread=wr;var xr={xhrs:[],setu64:function(e,r){A[e>>2]=r,A[e+4>>2]=r/4294967296|0},openDatabase:function(e,r,t,n){try{var a=indexedDB.open(e,r)}catch(e){return n(e)}a.onupgradeneeded=function(e){var r=e.target.result;r.objectStoreNames.contains("FILES")&&r.deleteObjectStore("FILES"),r.createObjectStore("FILES")},a.onsuccess=function(e){t(e.target.result)},a.onerror=function(e){n(e)}},staticInit:function(){xr.openDatabase("emscripten_filesystem",1,(function(e){xr.dbInstance=e,q()}),(function(){xr.dbInstance=!1,q()})),"undefined"!=typeof ENVIRONMENT_IS_FETCH_WORKER&&ENVIRONMENT_IS_FETCH_WORKER||z()}};function Cr(e,r,t,n,a){var i=A[e+8>>2];if(i){var o=y(i),u=e+112,s=y(u);s||(s="GET"),A[e+4>>2];var c=A[u+52>>2],f=A[u+56>>2],l=!!A[u+60>>2],d=(A[u+64>>2],A[u+68>>2]),m=A[u+72>>2],p=A[u+76>>2],v=A[u+80>>2],h=A[u+84>>2],g=A[u+88>>2],b=!!(1&c),_=!!(2&c),x=!!(64&c),C=d?y(d):void 0,P=m?y(m):void 0,S=v?y(v):void 0,j=new XMLHttpRequest;if(j.withCredentials=l,j.open(s,o,!x,C,P),x||(j.timeout=f),j.url_=o,j.responseType="arraybuffer",v&&j.overrideMimeType(S),p)for(;;){var $=A[p>>2];if(!$)break;var I=A[p+4>>2];if(!I)break;p+=8;var k=y($),D=y(I);j.setRequestHeader(k,D)}xr.xhrs.push(j);var F=xr.xhrs.length;A[e+0>>2]=F;var L=h&&g?E.slice(h,h+g):null;j.onload=function(n){O(b&&!_);var a=j.response?j.response.byteLength:0;xr.setu64(e+24,0),a&&xr.setu64(e+32,a),T[e+40>>1]=j.readyState,T[e+42>>1]=j.status,j.statusText&&w(j.statusText,e+44,64),j.status>=200&&j.status<300?r&&r(e,j,n):t&&t(e,j,n)},j.onerror=function(r){O(b);var n=j.status;xr.setu64(e+24,0),xr.setu64(e+32,j.response?j.response.byteLength:0),T[e+40>>1]=j.readyState,T[e+42>>1]=n,t&&t(e,j,r)},j.ontimeout=function(r){t&&t(e,j,r)},j.onprogress=function(r){var t=b&&_&&j.response?j.response.byteLength:0,a=0;b&&_&&(a=Mr(t),E.set(new Uint8Array(j.response),a)),A[e+12>>2]=a,xr.setu64(e+16,t),xr.setu64(e+24,r.loaded-t),xr.setu64(e+32,r.total),T[e+40>>1]=j.readyState,j.readyState>=3&&0===j.status&&r.loaded>0&&(j.status=200),T[e+42>>1]=j.status,j.statusText&&w(j.statusText,e+44,64),n&&n(e,j,r),a&&Rr(a)},j.onreadystatechange=function(r){T[e+40>>1]=j.readyState,j.readyState>=2&&(T[e+42>>1]=j.status),a&&a(e,j,r)};try{j.send(L)}catch(r){t&&t(e,j,r)}}else t(e,0,"no url specified!");function O(r){var t=0,n=0;r&&(n=j.response?j.response.byteLength:0,t=Mr(n),E.set(new Uint8Array(j.response),t)),A[e+12>>2]=t,xr.setu64(e+16,n)}}function Er(e){try{e()}catch(e){if(e instanceof qr)return;if("unwind"!==e)throw e&&"object"==typeof e&&e.stack&&l("exception thrown: "+[e,e.stack]),e}}function Pr(e,r,t,n,a){if(e){var i=A[r+112+64>>2];i||(i=A[r+8>>2]);var o=y(i);try{var u=e.transaction(["FILES"],"readwrite").objectStore("FILES").put(t,o);u.onsuccess=function(e){T[r+40>>1]=4,T[r+42>>1]=200,w("OK",r+44,64),n(r,0,o)},u.onerror=function(e){T[r+40>>1]=4,T[r+42>>1]=413,w("Payload Too Large",r+44,64),a(r,0,e)}}catch(e){a(r,0,e)}}else a(r,0,"IndexedDB not available!")}var Tr={};function Sr(){if(!Sr.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",_:s||"./this.program"};for(var r in Tr)e[r]=Tr[r];var t=[];for(var r in e)t.push(r+"="+e[r]);Sr.strings=t}return Sr.strings}function Ar(e){return e%4==0&&(e%100!=0||e%400==0)}function jr(e,r){for(var t=0,n=0;n<=r;t+=e[n++]);return t}var $r,Ir=[31,29,31,30,31,30,31,31,30,31,30,31],kr=[31,28,31,30,31,30,31,31,30,31,30,31];function Dr(e,r){for(var t=new Date(e.getTime());r>0;){var n=Ar(t.getFullYear()),a=t.getMonth(),i=(n?Ir:kr)[a];if(!(r>i-t.getDate()))return t.setDate(t.getDate()+r),t;r-=i-t.getDate()+1,t.setDate(1),a<11?t.setMonth(a+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t}!function(){for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);ae=e}(),de=a.BindingError=le(Error,"BindingError"),pe=a.InternalError=le(Error,"InternalError"),Te.prototype.isAliasOf=function(e){if(!(this instanceof Te))return!1;if(!(e instanceof Te))return!1;for(var r=this.$$.ptrType.registeredClass,t=this.$$.ptr,n=e.$$.ptrType.registeredClass,a=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return r===n&&t===a},Te.prototype.clone=function(){if(this.$$.ptr||ye(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=xe(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 r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},Te.prototype.delete=function(){this.$$.ptr||ye(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&me("Object already scheduled for deletion"),we(this),_e(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},Te.prototype.isDeleted=function(){return!this.$$.ptr},Te.prototype.deleteLater=function(){return this.$$.ptr||ye(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&me("Object already scheduled for deletion"),Ee.push(this),1===Ee.length&&Ce&&Ce(Pe),this.$$.deleteScheduled=!0,this},We.prototype.getPointee=function(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},We.prototype.destructor=function(e){this.rawDestructor&&this.rawDestructor(e)},We.prototype.argPackAdvance=8,We.prototype.readValueFromPointer=Fe,We.prototype.deleteObject=function(e){null!==e&&e.delete()},We.prototype.fromWireType=function(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=function(e,r){return r=function(e,r){for(void 0===r&&me("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r}(e,r),Oe[r]}(this.registeredClass,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?Be(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Be(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,o=this.registeredClass.getActualType(r),u=Se[o];if(!u)return a.call(this);i=this.isConst?u.constPointerType:u.pointerType;var s=Le(r,this.registeredClass,i.registeredClass);return null===s?a.call(this):this.isSmartPointer?Be(i.registeredClass.instancePrototype,{ptrType:i,ptr:s,smartPtrType:this,smartPtr:e}):Be(i.registeredClass.instancePrototype,{ptrType:i,ptr:s})},a.getInheritedInstanceCount=function(){return Object.keys(Oe).length},a.getLiveInheritedInstances=function(){var e=[];for(var r in Oe)Oe.hasOwnProperty(r)&&e.push(Oe[r]);return e},a.flushPendingDeletes=Pe,a.setDelayFunction=function(e){Ce=e,Ee.length&&Ce&&Ce(Pe)},Re=a.UnboundTypeError=le(Error,"UnboundTypeError"),a.count_emval_handles=function(){for(var e=0,r=5;r<Je.length;++r)void 0!==Je[r]&&++e;return e},a.get_first_emval=function(){for(var e=5;e<Je.length;++e)if(void 0!==Je[e])return Je[e];return null};for(var Fr=0;Fr<32;++Fr)lr.push(new Array(Fr));var Lr=new Float32Array(288);for(Fr=0;Fr<288;++Fr)yr[Fr]=Lr.subarray(0,Fr+1);var Or=new Int32Array(288);for(Fr=0;Fr<288;++Fr)br[Fr]=Or.subarray(0,Fr+1);xr.staticInit();var Br,Wr={u:function(e,r,t,n){J("Assertion failed: "+y(e)+", at: "+[r?y(r):"unknown filename",t,n?y(n):"unknown function"])},g:function(e){return Mr(e+16)+16},f:function(e,r,t){throw new re(e).init(r,t),e},G:function(e,r,t){return te.varargs=t,0},ub:function(e,r){},rb:function(e,r,t){return te.varargs=t,0},sb:function(e,r,t,n,a,i){return function(e,r,t,n,a,i){var o;i<<=12;var u=!1;return 0!=(16&n)&&e%16384!=0?-28:0==(32&n)?-52:(o=zr(16384,r))?(Ur(o,0,r),u=!0,te.mappings[o]={malloc:o,len:r,allocated:u,fd:a,prot:t,flags:n,offset:i},o):-48}(e,r,t,n,a,i)},tb:function(e,r){return function(e,r){if(-1==(0|e)||0===r)return-28;var t=te.mappings[e];return t?(r===t.len&&(te.mappings[e]=null,t.allocated&&Rr(t.malloc)),0):0}(e,r)},I:function(e,r,t){te.varargs=t},H:function(e,r){},yb:function(e,r,t,n,a){var i=ne(t);ge(e,{name:r=ie(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?n:a},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===t)n=C;else if(2===t)n=P;else{if(4!==t)throw new TypeError("Unknown boolean type size: "+r);n=S}return this.fromWireType(n[e>>i])},destructorFunction:null})},ob:function(e,r,t,n,i,o,u,s,c,f,l,d,m){l=ie(l),o=Ue(i,o),s&&(s=Ue(u,s)),f&&(f=Ue(c,f)),m=Ue(d,m);var p=ce(l);!function(e,r,t){a.hasOwnProperty(e)?(me("Cannot register public name '"+e+"' twice"),Ae(a,e,e),a.hasOwnProperty(t)&&me("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),a[e].overloadTable[void 0]=r):a[e]=r}(p,(function(){Ne("Cannot construct "+l+" due to unbound types",[n])})),he([e,r,t],n?[n]:[],(function(r){var t,i;r=r[0],i=n?(t=r.registeredClass).instancePrototype:Te.prototype;var u=fe(p,(function(){if(Object.getPrototypeOf(this)!==c)throw new de("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new de(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new de("Tried to invoke ctor of "+l+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(d.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),c=Object.create(i,{constructor:{value:u}});u.prototype=c;var d=new je(l,u,c,m,t,o,s,f),v=new We(l,d,!0,!1,!1),h=new We(l+"*",d,!1,!1,!1),g=new We(l+" const*",d,!1,!0,!1);return Se[e]={pointerType:h,constPointerType:g},function(e,r,t){a.hasOwnProperty(e)||ve("Replacing nonexistant public symbol"),a[e].overloadTable,a[e]=r,a[e].argCount=t}(p,u),[v,h,g]}))},D:function(e,r,t,n,a,i,o){var u=ze(t,n);r=ie(r),i=Ue(a,i),he([],[e],(function(e){var n=(e=e[0]).name+"."+r;function a(){Ne("Cannot call "+n+" due to unbound types",u)}var s=e.registeredClass.constructor;return void 0===s[r]?(a.argCount=t-1,s[r]=a):(Ae(s,r,n),s[r].overloadTable[t-1]=a),he([],u,(function(e){var a=[e[0],null].concat(e.slice(1)),u=He(n,a,null,i,o);return void 0===s[r].overloadTable?(u.argCount=t-1,s[r]=u):s[r].overloadTable[t-1]=u,[]})),[]}))},i:function(e,r,t,n,a,i,o,u){var s=ze(t,n);r=ie(r),i=Ue(a,i),he([],[e],(function(e){var n=(e=e[0]).name+"."+r;function a(){Ne("Cannot call "+n+" due to unbound types",s)}u&&e.registeredClass.pureVirtualFunctions.push(r);var c=e.registeredClass.instancePrototype,f=c[r];return void 0===f||void 0===f.overloadTable&&f.className!==e.name&&f.argCount===t-2?(a.argCount=t-2,a.className=e.name,c[r]=a):(Ae(c,r,n),c[r].overloadTable[t-2]=a),he([],s,(function(a){var u=He(n,a,e,i,o);return void 0===c[r].overloadTable?(u.argCount=t-2,c[r]=u):c[r].overloadTable[t-2]=u,[]})),[]}))},xb:function(e,r){ge(e,{name:r=ie(r),fromWireType:function(e){var r=Je[e].value;return Ke(e),r},toWireType:function(e,r){return Xe(r)},argPackAdvance:8,readValueFromPointer:Fe,destructorFunction:null})},J:function(e,r,t){var n=ne(t);ge(e,{name:r=ie(r),fromWireType:function(e){return e},toWireType:function(e,r){if("number"!=typeof r&&"boolean"!=typeof r)throw new TypeError('Cannot convert "'+Qe(r)+'" to '+this.name);return r},argPackAdvance:8,readValueFromPointer:Ze(r,n),destructorFunction:null})},o:function(e,r,t,n,a){r=ie(r),-1===a&&(a=4294967295);var i=ne(t),o=function(e){return e};if(0===n){var u=32-8*t;o=function(e){return e<<u>>>u}}var s=-1!=r.indexOf("unsigned");ge(e,{name:r,fromWireType:o,toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+Qe(t)+'" to '+this.name);if(t<n||t>a)throw new TypeError('Passing a number "'+Qe(t)+'" from JS side to C/C++ side to an argument of type "'+r+'", which is outside the valid range ['+n+", "+a+"]!");return s?t>>>0:0|t},argPackAdvance:8,readValueFromPointer:er(r,i,0!==n),destructorFunction:null})},n:function(e,r,t){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function a(e){var r=A,t=r[e>>=2],a=r[e+1];return new n(x,a,t)}ge(e,{name:t=ie(t),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},gb:function(e,r,t,n,a,i,o,u,s,c,f,l){t=ie(t),i=Ue(a,i),u=Ue(o,u),c=Ue(s,c),l=Ue(f,l),he([e],[r],(function(e){return e=e[0],[new We(t,e.registeredClass,!1,!1,!0,e,n,i,u,c,l)]}))},K:function(e,r){var t="std::string"===(r=ie(r));ge(e,{name:r,fromWireType:function(e){var r,n=A[e>>2];if(t)for(var a=e+4,i=0;i<=n;++i){var o=e+4+i;if(i==n||0==E[o]){var u=y(a,o-a);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),a=o+1}}else{var s=new Array(n);for(i=0;i<n;++i)s[i]=String.fromCharCode(E[e+4+i]);r=s.join("")}return Rr(e),r},toWireType:function(e,r){r instanceof ArrayBuffer&&(r=new Uint8Array(r));var n="string"==typeof r;n||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||me("Cannot pass non-string to std::string");var a=(t&&n?function(){return _(r)}:function(){return r.length})(),i=Mr(4+a+1);if(A[i>>2]=a,t&&n)w(r,i+4,a+1);else if(n)for(var o=0;o<a;++o){var u=r.charCodeAt(o);u>255&&(Rr(i),me("String has UTF-16 code units that do not fit in 8 bits")),E[i+4+o]=u}else for(o=0;o<a;++o)E[i+4+o]=r[o];return null!==e&&e.push(Rr,i),i},argPackAdvance:8,readValueFromPointer:Fe,destructorFunction:function(e){Rr(e)}})},w:function(e,r,t){var n,a,i,o,u;t=ie(t),2===r?(n=k,a=D,o=F,i=function(){return T},u=1):4===r&&(n=L,a=O,o=B,i=function(){return A},u=2),ge(e,{name:t,fromWireType:function(e){for(var t,a=A[e>>2],o=i(),s=e+4,c=0;c<=a;++c){var f=e+4+c*r;if(c==a||0==o[f>>u]){var l=n(s,f-s);void 0===t?t=l:(t+=String.fromCharCode(0),t+=l),s=f+r}}return Rr(e),t},toWireType:function(e,n){"string"!=typeof n&&me("Cannot pass non-string to C++ string type "+t);var i=o(n),s=Mr(4+i+r);return A[s>>2]=i>>u,a(n,s+4,i+r),null!==e&&e.push(Rr,s),s},argPackAdvance:8,readValueFromPointer:Fe,destructorFunction:function(e){Rr(e)}})},zb:function(e,r){ge(e,{isVoid:!0,name:r=ie(r),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,r){}})},Ab:function(e){delete xr.xhrs[e-1]},t:function(e,r,t){e=rr(e),r=tr(r,"emval::as");var n=[],a=Xe(n);return S[t>>2]=a,r.toWireType(n,e)},Jb:function(e,r,t,n){e=rr(e);for(var a=nr(r,t),i=new Array(r),o=0;o<r;++o){var u=a[o];i[o]=u.readValueFromPointer(n),n+=u.argPackAdvance}return Xe(e.apply(void 0,i))},s:function(e,r,t,n,a){return(e=ur[e])(r=rr(r),t=ir(t),function(e){var r=[];return S[e>>2]=Xe(r),r}(n),a)},L:function(e,r,t,n){(e=ur[e])(r=rr(r),t=ir(t),null,n)},C:Ke,nc:function(e){return 0===e?Xe(sr()):(e=ir(e),Xe(sr()[e]))},q:function(e,r){for(var t=nr(e,r),n=t[0],a=n.name+"_$"+t.slice(1).map((function(e){return e.name})).join("_")+"$",i=["retType"],o=[n],u="",s=0;s<e-1;++s)u+=(0!==s?", ":"")+"arg"+s,i.push("argType"+s),o.push(t[1+s]);var c,f,l="return function "+ce("methodCaller_"+a)+"(handle, name, destructors, args) {\n",d=0;for(s=0;s<e-1;++s)l+=" var arg"+s+" = argType"+s+".readValueFromPointer(args"+(d?"+"+d:"")+");\n",d+=t[s+1].argPackAdvance;for(l+=" var rv = handle[name]("+u+");\n",s=0;s<e-1;++s)t[s+1].deleteObject&&(l+=" argType"+s+".deleteObject(arg"+s+");\n");return n.isVoid||(l+=" return retType.toWireType(destructors, rv);\n"),l+="};\n",i.push(l),c=Ve(Function,i).apply(null,o),f=ur.length,ur.push(c),f},ha:function(e){return e=ir(e),Xe(a[e])},z:function(e,r){return Xe((e=rr(e))[r=rr(r)])},O:function(e){e>4&&(Je[e].refcount+=1)},Gb:function(){return Xe([])},cc:function(e){return Xe(ir(e))},bd:function(){return Xe({})},ad:function(e){Ye(Je[e].value),Ke(e)},wb:function(e,r,t){e=rr(e),r=rr(r),t=rr(t),e[r]=t},x:function(e,r){return Xe((e=tr(e,"_emval_take_value")).readValueFromPointer(r))},vb:function(e){return Xe(typeof(e=rr(e)))},c:function(){J()},E:function(e,r){var t;if(0===e)t=Date.now();else{if(1!==e&&4!==e)return 28,S[Gr()>>2]=28,-1;t=or()}return S[r>>2]=t/1e3|0,S[r+4>>2]=t%1e3*1e3*1e3|0,0},sa:function(e){cancelAnimationFrame(e)},Zc:function(e){$r.activeTexture(e)},_c:function(e,r){$r.attachShader(cr.programs[e],cr.shaders[r])},$c:function(e,r,t){$r.bindAttribLocation(cr.programs[e],r,y(t))},P:function(e,r){35051==e?$r.currentPixelPackBufferBinding=r:35052==e&&($r.currentPixelUnpackBufferBinding=r),$r.bindBuffer(e,cr.buffers[r])},_b:function(e,r){$r.bindFramebuffer(e,cr.framebuffers[r])},$b:function(e,r){$r.bindRenderbuffer(e,cr.renderbuffers[r])},Mb:function(e,r){$r.bindSampler(e,cr.samplers[r])},Q:function(e,r){$r.bindTexture(e,cr.textures[r])},vc:function(e){$r.bindVertexArray(cr.vaos[e])},yc:function(e){$r.bindVertexArray(cr.vaos[e])},R:function(e,r,t,n){$r.blendColor(e,r,t,n)},S:function(e){$r.blendEquation(e)},T:function(e,r){$r.blendFunc(e,r)},Tb:function(e,r,t,n,a,i,o,u,s,c){$r.blitFramebuffer(e,r,t,n,a,i,o,u,s,c)},U:function(e,r,t,n){cr.currentContext.version>=2?t?$r.bufferData(e,E,n,t,r):$r.bufferData(e,r,n):$r.bufferData(e,t?E.subarray(t,t+r):r,n)},V:function(e,r,t,n){cr.currentContext.version>=2?$r.bufferSubData(e,r,E,n,t):$r.bufferSubData(e,r,E.subarray(n,n+t))},ac:function(e){return $r.checkFramebufferStatus(e)},W:function(e){$r.clear(e)},X:function(e,r,t,n){$r.clearColor(e,r,t,n)},Y:function(e){$r.clearStencil(e)},$a:function(e,r,t,n){return $r.clientWaitSync(cr.syncs[e],r,fr(t,n))},Z:function(e,r,t,n){$r.colorMask(!!e,!!r,!!t,!!n)},_:function(e){$r.compileShader(cr.shaders[e])},$:function(e,r,t,n,a,i,o,u){cr.currentContext.version>=2?$r.currentPixelUnpackBufferBinding?$r.compressedTexImage2D(e,r,t,n,a,i,o,u):$r.compressedTexImage2D(e,r,t,n,a,i,E,u,o):$r.compressedTexImage2D(e,r,t,n,a,i,u?E.subarray(u,u+o):null)},aa:function(e,r,t,n,a,i,o,u,s){cr.currentContext.version>=2?$r.currentPixelUnpackBufferBinding?$r.compressedTexSubImage2D(e,r,t,n,a,i,o,u,s):$r.compressedTexSubImage2D(e,r,t,n,a,i,o,E,s,u):$r.compressedTexSubImage2D(e,r,t,n,a,i,o,s?E.subarray(s,s+u):null)},ba:function(e,r,t,n,a,i,o,u){$r.copyTexSubImage2D(e,r,t,n,a,i,o,u)},ca:function(){var e=cr.getNewId(cr.programs),r=$r.createProgram();return r.name=e,cr.programs[e]=r,e},da:function(e){var r=cr.getNewId(cr.shaders);return cr.shaders[r]=$r.createShader(e),r},ea:function(e){$r.cullFace(e)},fa:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2],a=cr.buffers[n];a&&($r.deleteBuffer(a),a.name=0,cr.buffers[n]=null,n==$r.currentPixelPackBufferBinding&&($r.currentPixelPackBufferBinding=0),n==$r.currentPixelUnpackBufferBinding&&($r.currentPixelUnpackBufferBinding=0))}},bc:function(e,r){for(var t=0;t<e;++t){var n=S[r+4*t>>2],a=cr.framebuffers[n];a&&($r.deleteFramebuffer(a),a.name=0,cr.framebuffers[n]=null)}},ga:function(e){if(e){var r=cr.programs[e];r?($r.deleteProgram(r),r.name=0,cr.programs[e]=null,cr.programInfos[e]=null):cr.recordError(1281)}},dc:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2],a=cr.renderbuffers[n];a&&($r.deleteRenderbuffer(a),a.name=0,cr.renderbuffers[n]=null)}},Nb:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2],a=cr.samplers[n];a&&($r.deleteSampler(a),a.name=0,cr.samplers[n]=null)}},ia:function(e){if(e){var r=cr.shaders[e];r?($r.deleteShader(r),cr.shaders[e]=null):cr.recordError(1281)}},Vb:function(e){if(e){var r=cr.syncs[e];r?($r.deleteSync(r),r.name=0,cr.syncs[e]=null):cr.recordError(1281)}},ja:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2],a=cr.textures[n];a&&($r.deleteTexture(a),a.name=0,cr.textures[n]=null)}},wc:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2];$r.deleteVertexArray(cr.vaos[n]),cr.vaos[n]=null}},zc:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2];$r.deleteVertexArray(cr.vaos[n]),cr.vaos[n]=null}},ka:function(e){$r.depthMask(!!e)},la:function(e){$r.disable(e)},ma:function(e){$r.disableVertexAttribArray(e)},na:function(e,r,t){$r.drawArrays(e,r,t)},tc:function(e,r,t,n){$r.drawArraysInstanced(e,r,t,n)},rc:function(e,r,t,n,a){$r.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,r,t,n,a)},pc:function(e,r){for(var t=lr[e],n=0;n<e;n++)t[n]=S[r+4*n>>2];$r.drawBuffers(t)},oa:function(e,r,t,n){$r.drawElements(e,r,t,n)},uc:function(e,r,t,n,a){$r.drawElementsInstanced(e,r,t,n,a)},sc:function(e,r,t,n,a,i,o){$r.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,r,t,n,a,i,o)},ic:function(e,r,t,n,a,i){!function(e,r,t,n){$r.drawElements(e,r,t,n)}(e,n,a,i)},pa:function(e){$r.enable(e)},qa:function(e){$r.enableVertexAttribArray(e)},Rb:function(e,r){var t=$r.fenceSync(e,r);if(t){var n=cr.getNewId(cr.syncs);return t.name=n,cr.syncs[n]=t,n}return 0},ra:function(){$r.finish()},ta:function(){$r.flush()},ec:function(e,r,t,n){$r.framebufferRenderbuffer(e,r,t,cr.renderbuffers[n])},fc:function(e,r,t,n,a){$r.framebufferTexture2D(e,r,t,cr.textures[n],a)},ua:function(e){$r.frontFace(e)},va:function(e,r){dr(e,r,"createBuffer",cr.buffers)},gc:function(e,r){dr(e,r,"createFramebuffer",cr.framebuffers)},hc:function(e,r){dr(e,r,"createRenderbuffer",cr.renderbuffers)},Ob:function(e,r){dr(e,r,"createSampler",cr.samplers)},wa:function(e,r){dr(e,r,"createTexture",cr.textures)},xc:function(e,r){dr(e,r,"createVertexArray",cr.vaos)},Ac:function(e,r){dr(e,r,"createVertexArray",cr.vaos)},Wb:function(e){$r.generateMipmap(e)},xa:function(e,r,t){t?S[t>>2]=$r.getBufferParameter(e,r):cr.recordError(1281)},ya:function(){var e=$r.getError()||cr.lastError;return cr.lastError=0,e},Xb:function(e,r,t,n){var a=$r.getFramebufferAttachmentParameter(e,r,t);(a instanceof WebGLRenderbuffer||a instanceof WebGLTexture)&&(a=0|a.name),S[n>>2]=a},Za:function(e,r){mr(e,r,0)},za:function(e,r,t,n){var a=$r.getProgramInfoLog(cr.programs[e]);null===a&&(a="(unknown error)");var i=r>0&&n?w(a,n,r):0;t&&(S[t>>2]=i)},Aa:function(e,r,t){if(t)if(e>=cr.counter)cr.recordError(1281);else{var n=cr.programInfos[e];if(n)if(35716==r){var a=$r.getProgramInfoLog(cr.programs[e]);null===a&&(a="(unknown error)"),S[t>>2]=a.length+1}else if(35719==r)S[t>>2]=n.maxUniformLength;else if(35722==r){if(-1==n.maxAttributeLength){e=cr.programs[e];var i=$r.getProgramParameter(e,35721);n.maxAttributeLength=0;for(var o=0;o<i;++o){var u=$r.getActiveAttrib(e,o);n.maxAttributeLength=Math.max(n.maxAttributeLength,u.name.length+1)}}S[t>>2]=n.maxAttributeLength}else if(35381==r){if(-1==n.maxUniformBlockNameLength){e=cr.programs[e];var s=$r.getProgramParameter(e,35382);for(n.maxUniformBlockNameLength=0,o=0;o<s;++o){var c=$r.getActiveUniformBlockName(e,o);n.maxUniformBlockNameLength=Math.max(n.maxUniformBlockNameLength,c.length+1)}}S[t>>2]=n.maxUniformBlockNameLength}else S[t>>2]=$r.getProgramParameter(cr.programs[e],r);else cr.recordError(1282)}else cr.recordError(1281)},Yb:function(e,r,t){t?S[t>>2]=$r.getRenderbufferParameter(e,r):cr.recordError(1281)},Ba:function(e,r,t,n){var a=$r.getShaderInfoLog(cr.shaders[e]);null===a&&(a="(unknown error)");var i=r>0&&n?w(a,n,r):0;t&&(S[t>>2]=i)},Ib:function(e,r,t,n){var a=$r.getShaderPrecisionFormat(e,r);S[t>>2]=a.rangeMin,S[t+4>>2]=a.rangeMax,S[n>>2]=a.precision},Ca:function(e,r,t){if(t)if(35716==r){var n=$r.getShaderInfoLog(cr.shaders[e]);null===n&&(n="(unknown error)");var a=n?n.length+1:0;S[t>>2]=a}else if(35720==r){var i=$r.getShaderSource(cr.shaders[e]),o=i?i.length+1:0;S[t>>2]=o}else S[t>>2]=$r.getShaderParameter(cr.shaders[e],r);else cr.recordError(1281)},A:function(e){if(cr.stringCache[e])return cr.stringCache[e];var r;switch(e){case 7939:var t=$r.getSupportedExtensions()||[];r=pr((t=t.concat(t.map((function(e){return"GL_"+e})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=$r.getParameter(e);n||cr.recordError(1280),r=pr(n);break;case 7938:var a=$r.getParameter(7938);r=pr(a=cr.currentContext.version>=2?"OpenGL ES 3.0 ("+a+")":"OpenGL ES 2.0 ("+a+")");break;case 35724:var i=$r.getParameter(35724),o=i.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==o&&(3==o[1].length&&(o[1]=o[1]+"0"),i="OpenGL ES GLSL ES "+o[1]+" ("+i+")"),r=pr(i);break;default:return cr.recordError(1280),0}return cr.stringCache[e]=r,r},_a:function(e,r){if(cr.currentContext.version<2)return cr.recordError(1282),0;var t=cr.stringiCache[e];if(t)return r<0||r>=t.length?(cr.recordError(1281),0):t[r];switch(e){case 7939:var n=$r.getSupportedExtensions()||[];return n=(n=n.concat(n.map((function(e){return"GL_"+e})))).map((function(e){return pr(e)})),t=cr.stringiCache[e]=n,r<0||r>=t.length?(cr.recordError(1281),0):t[r];default:return cr.recordError(1280),0}},Da:function(e,r){var t,n=0;if("]"==(r=y(r))[r.length-1]){var a=r.lastIndexOf("[");n="]"!=r[a+1]?(t=r.slice(a+1),parseInt(t)):0,r=r.slice(0,a)}var i=cr.programInfos[e]&&cr.programInfos[e].uniforms[r];return i&&n>=0&&n<i[0]?i[1]+n:-1},Kb:function(e,r,t){for(var n=lr[r],a=0;a<r;a++)n[a]=S[t+4*a>>2];$r.invalidateFramebuffer(e,n)},Lb:function(e,r,t,n,a,i,o){for(var u=lr[r],s=0;s<r;s++)u[s]=S[t+4*s>>2];$r.invalidateSubFramebuffer(e,u,n,a,i,o)},Sb:function(e){return $r.isSync(cr.syncs[e])},Ea:function(e){var r=cr.textures[e];return r?$r.isTexture(r):0},Fa:function(e){$r.lineWidth(e)},Ga:function(e){$r.linkProgram(cr.programs[e]),cr.populateUniformTable(e)},mc:function(e,r,t,n,a,i){$r.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,S,r>>2,S,t>>2,S,n>>2,A,a>>2,i)},oc:function(e,r,t,n,a,i,o,u){$r.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,S,r>>2,t,S,n>>2,S,a>>2,S,i>>2,A,o>>2,u)},Ha:function(e,r){3317==e&&(cr.unpackAlignment=r),$r.pixelStorei(e,r)},qc:function(e){$r.readBuffer(e)},Ia:function(e,r,t,n,a,i,o){if(cr.currentContext.version>=2)if($r.currentPixelPackBufferBinding)$r.readPixels(e,r,t,n,a,i,o);else{var u=vr(i);$r.readPixels(e,r,t,n,a,i,u,o>>hr(u))}else{var s=gr(i,a,t,n,o);s?$r.readPixels(e,r,t,n,a,i,s):cr.recordError(1280)}},Zb:function(e,r,t,n){$r.renderbufferStorage(e,r,t,n)},Ub:function(e,r,t,n,a){$r.renderbufferStorageMultisample(e,r,t,n,a)},Pb:function(e,r,t){$r.samplerParameteri(cr.samplers[e],r,t)},Qb:function(e,r,t){var n=S[t>>2];$r.samplerParameteri(cr.samplers[e],r,n)},Ja:function(e,r,t,n){$r.scissor(e,r,t,n)},Ka:function(e,r,t,n){var a=cr.getSource(e,r,t,n);$r.shaderSource(cr.shaders[e],a)},La:function(e,r,t){$r.stencilFunc(e,r,t)},Ma:function(e,r,t,n){$r.stencilFuncSeparate(e,r,t,n)},Na:function(e){$r.stencilMask(e)},Oa:function(e,r){$r.stencilMaskSeparate(e,r)},Pa:function(e,r,t){$r.stencilOp(e,r,t)},Qa:function(e,r,t,n){$r.stencilOpSeparate(e,r,t,n)},Ra:function(e,r,t,n,a,i,o,u,s){if(cr.currentContext.version>=2)if($r.currentPixelUnpackBufferBinding)$r.texImage2D(e,r,t,n,a,i,o,u,s);else if(s){var c=vr(u);$r.texImage2D(e,r,t,n,a,i,o,u,c,s>>hr(c))}else $r.texImage2D(e,r,t,n,a,i,o,u,null);else $r.texImage2D(e,r,t,n,a,i,o,u,s?gr(u,o,n,a,s):null)},Sa:function(e,r,t){$r.texParameterf(e,r,t)},Ta:function(e,r,t){var n=j[t>>2];$r.texParameterf(e,r,n)},Ua:function(e,r,t){$r.texParameteri(e,r,t)},Va:function(e,r,t){var n=S[t>>2];$r.texParameteri(e,r,n)},jc:function(e,r,t,n,a){$r.texStorage2D(e,r,t,n,a)},Wa:function(e,r,t,n,a,i,o,u,s){if(cr.currentContext.version>=2)if($r.currentPixelUnpackBufferBinding)$r.texSubImage2D(e,r,t,n,a,i,o,u,s);else if(s){var c=vr(u);$r.texSubImage2D(e,r,t,n,a,i,o,u,c,s>>hr(c))}else $r.texSubImage2D(e,r,t,n,a,i,o,u,null);else{var f=null;s&&(f=gr(u,o,a,i,s)),$r.texSubImage2D(e,r,t,n,a,i,o,u,f)}},Xa:function(e,r){$r.uniform1f(cr.uniforms[e],r)},Ya:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform1fv(cr.uniforms[e],j,t>>2,r);else{if(r<=288)for(var n=yr[r-1],a=0;a<r;++a)n[a]=j[t+4*a>>2];else n=j.subarray(t>>2,t+4*r>>2);$r.uniform1fv(cr.uniforms[e],n)}},Vc:function(e,r){$r.uniform1i(cr.uniforms[e],r)},Wc:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform1iv(cr.uniforms[e],S,t>>2,r);else{if(r<=288)for(var n=br[r-1],a=0;a<r;++a)n[a]=S[t+4*a>>2];else n=S.subarray(t>>2,t+4*r>>2);$r.uniform1iv(cr.uniforms[e],n)}},Xc:function(e,r,t){$r.uniform2f(cr.uniforms[e],r,t)},Yc:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform2fv(cr.uniforms[e],j,t>>2,2*r);else{if(r<=144)for(var n=yr[2*r-1],a=0;a<2*r;a+=2)n[a]=j[t+4*a>>2],n[a+1]=j[t+(4*a+4)>>2];else n=j.subarray(t>>2,t+8*r>>2);$r.uniform2fv(cr.uniforms[e],n)}},Uc:function(e,r,t){$r.uniform2i(cr.uniforms[e],r,t)},Tc:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform2iv(cr.uniforms[e],S,t>>2,2*r);else{if(r<=144)for(var n=br[2*r-1],a=0;a<2*r;a+=2)n[a]=S[t+4*a>>2],n[a+1]=S[t+(4*a+4)>>2];else n=S.subarray(t>>2,t+8*r>>2);$r.uniform2iv(cr.uniforms[e],n)}},Sc:function(e,r,t,n){$r.uniform3f(cr.uniforms[e],r,t,n)},Rc:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform3fv(cr.uniforms[e],j,t>>2,3*r);else{if(r<=96)for(var n=yr[3*r-1],a=0;a<3*r;a+=3)n[a]=j[t+4*a>>2],n[a+1]=j[t+(4*a+4)>>2],n[a+2]=j[t+(4*a+8)>>2];else n=j.subarray(t>>2,t+12*r>>2);$r.uniform3fv(cr.uniforms[e],n)}},Qc:function(e,r,t,n){$r.uniform3i(cr.uniforms[e],r,t,n)},Pc:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform3iv(cr.uniforms[e],S,t>>2,3*r);else{if(r<=96)for(var n=br[3*r-1],a=0;a<3*r;a+=3)n[a]=S[t+4*a>>2],n[a+1]=S[t+(4*a+4)>>2],n[a+2]=S[t+(4*a+8)>>2];else n=S.subarray(t>>2,t+12*r>>2);$r.uniform3iv(cr.uniforms[e],n)}},Oc:function(e,r,t,n,a){$r.uniform4f(cr.uniforms[e],r,t,n,a)},Nc:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform4fv(cr.uniforms[e],j,t>>2,4*r);else{if(r<=72){var n=yr[4*r-1],a=j;t>>=2;for(var i=0;i<4*r;i+=4){var o=t+i;n[i]=a[o],n[i+1]=a[o+1],n[i+2]=a[o+2],n[i+3]=a[o+3]}}else n=j.subarray(t>>2,t+16*r>>2);$r.uniform4fv(cr.uniforms[e],n)}},Bc:function(e,r,t,n,a){$r.uniform4i(cr.uniforms[e],r,t,n,a)},Cc:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform4iv(cr.uniforms[e],S,t>>2,4*r);else{if(r<=72)for(var n=br[4*r-1],a=0;a<4*r;a+=4)n[a]=S[t+4*a>>2],n[a+1]=S[t+(4*a+4)>>2],n[a+2]=S[t+(4*a+8)>>2],n[a+3]=S[t+(4*a+12)>>2];else n=S.subarray(t>>2,t+16*r>>2);$r.uniform4iv(cr.uniforms[e],n)}},Dc:function(e,r,t,n){if(cr.currentContext.version>=2)$r.uniformMatrix2fv(cr.uniforms[e],!!t,j,n>>2,4*r);else{if(r<=72)for(var a=yr[4*r-1],i=0;i<4*r;i+=4)a[i]=j[n+4*i>>2],a[i+1]=j[n+(4*i+4)>>2],a[i+2]=j[n+(4*i+8)>>2],a[i+3]=j[n+(4*i+12)>>2];else a=j.subarray(n>>2,n+16*r>>2);$r.uniformMatrix2fv(cr.uniforms[e],!!t,a)}},Ec:function(e,r,t,n){if(cr.currentContext.version>=2)$r.uniformMatrix3fv(cr.uniforms[e],!!t,j,n>>2,9*r);else{if(r<=32)for(var a=yr[9*r-1],i=0;i<9*r;i+=9)a[i]=j[n+4*i>>2],a[i+1]=j[n+(4*i+4)>>2],a[i+2]=j[n+(4*i+8)>>2],a[i+3]=j[n+(4*i+12)>>2],a[i+4]=j[n+(4*i+16)>>2],a[i+5]=j[n+(4*i+20)>>2],a[i+6]=j[n+(4*i+24)>>2],a[i+7]=j[n+(4*i+28)>>2],a[i+8]=j[n+(4*i+32)>>2];else a=j.subarray(n>>2,n+36*r>>2);$r.uniformMatrix3fv(cr.uniforms[e],!!t,a)}},Fc:function(e,r,t,n){if(cr.currentContext.version>=2)$r.uniformMatrix4fv(cr.uniforms[e],!!t,j,n>>2,16*r);else{if(r<=18){var a=yr[16*r-1],i=j;n>>=2;for(var o=0;o<16*r;o+=16){var u=n+o;a[o]=i[u],a[o+1]=i[u+1],a[o+2]=i[u+2],a[o+3]=i[u+3],a[o+4]=i[u+4],a[o+5]=i[u+5],a[o+6]=i[u+6],a[o+7]=i[u+7],a[o+8]=i[u+8],a[o+9]=i[u+9],a[o+10]=i[u+10],a[o+11]=i[u+11],a[o+12]=i[u+12],a[o+13]=i[u+13],a[o+14]=i[u+14],a[o+15]=i[u+15]}}else a=j.subarray(n>>2,n+64*r>>2);$r.uniformMatrix4fv(cr.uniforms[e],!!t,a)}},Gc:function(e){$r.useProgram(cr.programs[e])},Hc:function(e,r){$r.vertexAttrib1f(e,r)},Ic:function(e,r){$r.vertexAttrib2f(e,j[r>>2],j[r+4>>2])},Jc:function(e,r){$r.vertexAttrib3f(e,j[r>>2],j[r+4>>2],j[r+8>>2])},Kc:function(e,r){$r.vertexAttrib4f(e,j[r>>2],j[r+4>>2],j[r+8>>2],j[r+12>>2])},kc:function(e,r){$r.vertexAttribDivisor(e,r)},lc:function(e,r,t,n,a){$r.vertexAttribIPointer(e,r,t,n,a)},Lc:function(e,r,t,n,a,i){$r.vertexAttribPointer(e,r,t,!!n,a,i)},Mc:function(e,r,t,n){$r.viewport(e,r,t,n)},ab:function(e,r,t,n){$r.waitSync(cr.syncs[e],r,fr(t,n))},Cb:wr,d:function(e,r){return function(e,r){throw Hr(e,r||1),"longjmp"}(e,r)},jb:function(e,r,t){E.copyWithin(e,r,r+t)},y:function(e,r){return requestAnimationFrame((function(t){M.get(e)(t,r)}))},kb:function(e){var r,t=E.length,n=2147483648;if(e>n)return!1;for(var a=1;a<=4;a*=2){var i=t*(1+.2/a);if(i=Math.min(i,e+100663296),_r(Math.min(n,((r=Math.max(e,i))%65536>0&&(r+=65536-r%65536),r))))return!0}return!1},Bb:function(e,r,t,n,a){var i=e+112,o=y(i),u=A[i+36>>2],s=A[i+40>>2],c=A[i+44>>2],f=A[i+48>>2],l=A[i+52>>2],d=!!(4&l),m=!!(32&l),p=!!(16&l),v=function(e,t,n){Er((function(){u?M.get(u)(e):r&&r(e)}))},h=function(e,r,t){Er((function(){c?M.get(c)(e):n&&n(e)}))},g=function(e,r,n){Er((function(){s?M.get(s)(e):t&&t(e)}))},b=function(e,r,t){Er((function(){f?M.get(f)(e):a&&a(e)}))},_=function(e,t,n){Pr(xr.dbInstance,e,t.response,(function(e,t,n){Er((function(){u?M.get(u)(e):r&&r(e)}))}),(function(e,t,n){Er((function(){u?M.get(u)(e):r&&r(e)}))}))};if("EM_IDB_STORE"===o){var x=A[i+84>>2];Pr(xr.dbInstance,e,E.slice(x,x+A[i+88>>2]),v,g)}else if("EM_IDB_DELETE"===o)!function(e,r,t,n){if(e){var a=A[r+112+64>>2];a||(a=A[r+8>>2]);var i=y(a);try{var o=e.transaction(["FILES"],"readwrite").objectStore("FILES").delete(i);o.onsuccess=function(e){var n=e.target.result;A[r+12>>2]=0,xr.setu64(r+16,0),xr.setu64(r+24,0),xr.setu64(r+32,0),T[r+40>>1]=4,T[r+42>>1]=200,w("OK",r+44,64),t(r,0,n)},o.onerror=function(e){T[r+40>>1]=4,T[r+42>>1]=404,w("Not Found",r+44,64),n(r,0,e)}}catch(e){n(r,0,e)}}else n(r,0,"IndexedDB not available!")}(xr.dbInstance,e,v,g);else if(p){if(m)return 0;Cr(e,d?_:v,g,h,b)}else!function(e,r,t,n){if(e){var a=A[r+112+64>>2];a||(a=A[r+8>>2]);var i=y(a);try{var o=e.transaction(["FILES"],"readonly").objectStore("FILES").get(i);o.onsuccess=function(e){if(e.target.result){var a=e.target.result,i=a.byteLength||a.length,o=Mr(i);E.set(new Uint8Array(a),o),A[r+12>>2]=o,xr.setu64(r+16,i),xr.setu64(r+24,0),xr.setu64(r+32,i),T[r+40>>1]=4,T[r+42>>1]=200,w("OK",r+44,64),t(r,0,a)}else T[r+40>>1]=4,T[r+42>>1]=404,w("Not Found",r+44,64),n(r,0,"no data")},o.onerror=function(e){T[r+40>>1]=4,T[r+42>>1]=404,w("Not Found",r+44,64),n(r,0,e)}}catch(e){n(r,0,e)}}else n(r,0,"IndexedDB not available!")}(xr.dbInstance,e,v,m?g:d?function(e,r,t){Cr(e,_,g,h,b)}:function(e,r,t){Cr(e,v,g,h,b)});return e},fb:function(e){return cr.makeContextCurrent(e)?0:-5},nb:function(e,r){var t=0;return Sr().forEach((function(n,a){var i=r+t;S[e+4*a>>2]=i,function(e,r,t){for(var n=0;n<e.length;++n)C[r++>>0]=e.charCodeAt(n);C[r>>0]=0}(n,i),t+=n.length+1})),0},pb:function(e,r){var t=Sr();S[e>>2]=t.length;var n=0;return t.forEach((function(e){n+=e.length+1})),S[r>>2]=n,0},v:function(e){return 0},mb:function(e,r){var t=1==e||2==e?2:J();return C[r>>0]=t,0},ib:function(e,r,t,n,a,i){var o=te.getStreamFromFD(e),u=te.doReadv(o,r,t,n);return S[i>>2]=u,0},qb:function(e,r,t,n){var a=te.getStreamFromFD(e),i=te.doReadv(a,r,t);return S[n>>2]=i,0},hb:function(e,r,t,n,a){},F:function(e,r,t,n){for(var a=0,i=0;i<t;i++){for(var o=S[r+8*i>>2],u=S[r+(8*i+4)>>2],s=0;s<u;s++)te.printChar(e,E[o+s]);a+=u}return S[n>>2]=a,0},a:function(){return 0|p},eb:function(e,r){$r.bindFramebuffer(e,cr.framebuffers[r])},bb:function(e){$r.clear(e)},db:function(e,r,t,n){$r.clearColor(e,r,t,n)},cb:function(e){$r.clearStencil(e)},B:function(e,r){mr(e,r,0)},h:function(e,r){var t=Vr();try{return M.get(e)(r)}catch(e){if(Yr(t),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},p:function(e,r,t){var n=Vr();try{return M.get(e)(r,t)}catch(e){if(Yr(n),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},e:function(e,r,t,n){var a=Vr();try{return M.get(e)(r,t,n)}catch(e){if(Yr(a),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},r:function(e,r,t,n,a){var i=Vr();try{return M.get(e)(r,t,n,a)}catch(e){if(Yr(i),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},Db:function(e,r,t,n,a,i,o){var u=Vr();try{return M.get(e)(r,t,n,a,i,o)}catch(e){if(Yr(u),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},N:function(e,r,t,n,a,i,o,u,s,c){var f=Vr();try{return M.get(e)(r,t,n,a,i,o,u,s,c)}catch(e){if(Yr(f),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},M:function(e){var r=Vr();try{M.get(e)()}catch(e){if(Yr(r),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},m:function(e,r){var t=Vr();try{M.get(e)(r)}catch(e){if(Yr(t),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},k:function(e,r,t){var n=Vr();try{M.get(e)(r,t)}catch(e){if(Yr(n),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},j:function(e,r,t,n){var a=Vr();try{M.get(e)(r,t,n)}catch(e){if(Yr(a),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},l:function(e,r,t,n,a){var i=Vr();try{M.get(e)(r,t,n,a)}catch(e){if(Yr(i),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},Hb:function(e,r,t,n,a,i){var o=Vr();try{M.get(e)(r,t,n,a,i)}catch(e){if(Yr(o),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},Eb:function(e,r,t,n,a,i,o){var u=Vr();try{M.get(e)(r,t,n,a,i,o)}catch(e){if(Yr(u),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},Fb:function(e,r,t,n,a,i,o,u,s,c){var f=Vr();try{M.get(e)(r,t,n,a,i,o,u,s,c)}catch(e){if(Yr(f),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},b:function(e){p=0|e},lb:function(e,r,t,n){return function(e,r,t,n){var a=S[n+40>>2],i={tm_sec:S[n>>2],tm_min:S[n+4>>2],tm_hour:S[n+8>>2],tm_mday:S[n+12>>2],tm_mon:S[n+16>>2],tm_year:S[n+20>>2],tm_wday:S[n+24>>2],tm_yday:S[n+28>>2],tm_isdst:S[n+32>>2],tm_gmtoff:S[n+36>>2],tm_zone:a?y(a):""},o=y(t),u={"%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 s in u)o=o.replace(new RegExp(s,"g"),u[s]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function l(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length<r;)n=t[0]+n;return n}function d(e,r){return l(e,r,"0")}function m(e,r){function t(e){return e<0?-1:e>0?1:0}var n;return 0===(n=t(e.getFullYear()-r.getFullYear()))&&0===(n=t(e.getMonth()-r.getMonth()))&&(n=t(e.getDate()-r.getDate())),n}function p(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function v(e){var r=Dr(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),a=p(t),i=p(n);return m(a,r)<=0?m(i,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var h={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return f[e.tm_mon].substring(0,3)},"%B":function(e){return f[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return l(e.tm_mday,2," ")},"%g":function(e){return v(e).toString().substring(2)},"%G":function(e){return v(e)},"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),d(r,2)},"%j":function(e){return d(e.tm_mday+jr(Ar(e.tm_year+1900)?Ir:kr,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var r=new Date(e.tm_year+1900,0,1),t=0===r.getDay()?r:Dr(r,7-r.getDay()),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(m(t,n)<0){var a=jr(Ar(n.getFullYear())?Ir:kr,n.getMonth()-1)-31,i=31-t.getDate()+a+n.getDate();return d(Math.ceil(i/7),2)}return 0===m(t,r)?"01":"00"},"%V":function(e){var r,t=new Date(e.tm_year+1900,0,4),n=new Date(e.tm_year+1901,0,4),a=p(t),i=p(n),o=Dr(new Date(e.tm_year+1900,0,1),e.tm_yday);return m(o,a)<0?"53":m(i,o)<=0?"01":(r=a.getFullYear()<e.tm_year+1900?e.tm_yday+32-a.getDate():e.tm_yday+1-a.getDate(),d(Math.ceil(r/7),2))},"%w":function(e){return e.tm_wday},"%W":function(e){var r=new Date(e.tm_year,0,1),t=1===r.getDay()?r:Dr(r,0===r.getDay()?1:7-r.getDay()+1),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(m(t,n)<0){var a=jr(Ar(n.getFullYear())?Ir:kr,n.getMonth()-1)-31,i=31-t.getDate()+a+n.getDate();return d(Math.ceil(i/7),2)}return 0===m(t,r)?"01":"00"},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var r=e.tm_gmtoff,t=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(t?"+":"-")+String("0000"+r).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var s in h)o.indexOf(s)>=0&&(o=o.replace(new RegExp(s,"g"),h[s](i)));var g,w,x,E=(w=_(g=o)+1,b(g,x=new Array(w),0,x.length),x);return E.length>r?0:(function(e,r){C.set(e,r)}(E,e),E.length-1)}(e,r,t,n)}},Mr=(function(){var e={a:Wr};function r(e,r){var t,n=e.exports;a.asm=n,W((m=a.asm.cd).buffer),M=a.asm.fd,t=a.asm.dd,R.unshift(t),q()}function t(e){r(e.instance)}function i(r){return(d||"function"!=typeof fetch?Promise.resolve().then((function(){return Z(Q)})):fetch(Q,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+Q+"'";return e.arrayBuffer()})).catch((function(){return Z(Q)}))).then((function(r){return WebAssembly.instantiate(r,e)})).then(r,(function(e){l("failed to asynchronously prepare wasm: "+e),J(e)}))}if(z(),a.instantiateWasm)try{return a.instantiateWasm(e,r)}catch(e){return l("Module.instantiateWasm callback failed with error: "+e),!1}(d||"function"!=typeof WebAssembly.instantiateStreaming||K(Q)||"function"!=typeof fetch?i(t):fetch(Q,{credentials:"same-origin"}).then((function(r){return WebAssembly.instantiateStreaming(r,e).then(t,(function(e){return l("wasm streaming compile failed: "+e),l("falling back to ArrayBuffer instantiation"),i(t)}))}))).catch(n)}(),a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.dd).apply(null,arguments)},a._malloc=function(){return(Mr=a._malloc=a.asm.ed).apply(null,arguments)}),Ur=a._memset=function(){return(Ur=a._memset=a.asm.gd).apply(null,arguments)},Rr=a._free=function(){return(Rr=a._free=a.asm.hd).apply(null,arguments)},Gr=a.___errno_location=function(){return(Gr=a.___errno_location=a.asm.id).apply(null,arguments)},Nr=a.___getTypeName=function(){return(Nr=a.___getTypeName=a.asm.jd).apply(null,arguments)},Vr=(a.___embind_register_native_and_builtin_types=function(){return(a.___embind_register_native_and_builtin_types=a.asm.kd).apply(null,arguments)},a.stackSave=function(){return(Vr=a.stackSave=a.asm.ld).apply(null,arguments)}),Yr=a.stackRestore=function(){return(Yr=a.stackRestore=a.asm.md).apply(null,arguments)},Hr=a._setThrew=function(){return(Hr=a._setThrew=a.asm.nd).apply(null,arguments)},zr=a._memalign=function(){return(zr=a._memalign=a.asm.od).apply(null,arguments)};function qr(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Jr(e){function r(){Br||(Br=!0,a.calledRun=!0,v||(ee(R),ee(G),t(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),function(){if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)e=a.postRun.shift(),N.unshift(e);var e;ee(N)}()))}e=e||u,V>0||(function(){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)e=a.preRun.shift(),U.unshift(e);var e;ee(U)}(),V>0||(a.setStatus?(a.setStatus("Running..."),setTimeout((function(){setTimeout((function(){a.setStatus("")}),1),r()}),1)):r()))}if(a.dynCall_ji=function(){return(a.dynCall_ji=a.asm.pd).apply(null,arguments)},a.dynCall_iiji=function(){return(a.dynCall_iiji=a.asm.qd).apply(null,arguments)},a.dynCall_iijjiii=function(){return(a.dynCall_iijjiii=a.asm.rd).apply(null,arguments)},a.dynCall_iij=function(){return(a.dynCall_iij=a.asm.sd).apply(null,arguments)},a.dynCall_vijjjii=function(){return(a.dynCall_vijjjii=a.asm.td).apply(null,arguments)},a.dynCall_iiiji=function(){return(a.dynCall_iiiji=a.asm.ud).apply(null,arguments)},a.dynCall_viji=function(){return(a.dynCall_viji=a.asm.vd).apply(null,arguments)},a.dynCall_vijiii=function(){return(a.dynCall_vijiii=a.asm.wd).apply(null,arguments)},a.dynCall_viiiiij=function(){return(a.dynCall_viiiiij=a.asm.xd).apply(null,arguments)},a.dynCall_viijii=function(){return(a.dynCall_viijii=a.asm.yd).apply(null,arguments)},a.dynCall_jii=function(){return(a.dynCall_jii=a.asm.zd).apply(null,arguments)},a.dynCall_iiij=function(){return(a.dynCall_iiij=a.asm.Ad).apply(null,arguments)},a.dynCall_iiiij=function(){return(a.dynCall_iiiij=a.asm.Bd).apply(null,arguments)},a.dynCall_viij=function(){return(a.dynCall_viij=a.asm.Cd).apply(null,arguments)},a.dynCall_viiij=function(){return(a.dynCall_viiij=a.asm.Dd).apply(null,arguments)},a.dynCall_vij=function(){return(a.dynCall_vij=a.asm.Ed).apply(null,arguments)},a.dynCall_jiiiiji=function(){return(a.dynCall_jiiiiji=a.asm.Fd).apply(null,arguments)},a.dynCall_jiiiiii=function(){return(a.dynCall_jiiiiii=a.asm.Gd).apply(null,arguments)},a.dynCall_iijj=function(){return(a.dynCall_iijj=a.asm.Hd).apply(null,arguments)},a.dynCall_jiji=function(){return(a.dynCall_jiji=a.asm.Id).apply(null,arguments)},a.dynCall_iiiiij=function(){return(a.dynCall_iiiiij=a.asm.Jd).apply(null,arguments)},a.dynCall_iiiiijj=function(){return(a.dynCall_iiiiijj=a.asm.Kd).apply(null,arguments)},a.dynCall_iiiiiijj=function(){return(a.dynCall_iiiiiijj=a.asm.Ld).apply(null,arguments)},a.GL=cr,H=function e(){Br||Jr(),Br||(H=e)},a.run=Jr,a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);a.preInit.length>0;)a.preInit.pop()();return Jr(),e.ready});e.exports=t}}]);
|
|
1
|
+
(self.webpackChunk_sketch_hq_sketch_web_renderer=self.webpackChunk_sketch_hq_sketch_web_renderer||[]).push([[816],{816:e=>{var r,t=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var t,n,a=void 0!==(e=e||{})?e:{};a.ready=new Promise((function(e,r){t=e,n=r}));var i,o={};for(i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);var u=[],s="./this.program",c="";"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),r&&(c=r),c=0!==c.indexOf("blob:")?c.substr(0,c.lastIndexOf("/")+1):"";var f=a.print||console.log.bind(console),l=a.printErr||console.warn.bind(console);for(i in o)o.hasOwnProperty(i)&&(a[i]=o[i]);o=null,a.arguments&&(u=a.arguments),a.thisProgram&&(s=a.thisProgram),a.quit&&a.quit;var d,m,p=0;a.wasmBinary&&(d=a.wasmBinary),a.noExitRuntime,"object"!=typeof WebAssembly&&J("no native wasm support detected");var v=!1,h="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function g(e,r,t){for(var n=r+t,a=r;e[a]&&!(a>=n);)++a;if(a-r>16&&e.subarray&&h)return h.decode(e.subarray(r,a));for(var i="";r<a;){var o=e[r++];if(128&o){var u=63&e[r++];if(192!=(224&o)){var s=63&e[r++];if((o=224==(240&o)?(15&o)<<12|u<<6|s:(7&o)<<18|u<<12|s<<6|63&e[r++])<65536)i+=String.fromCharCode(o);else{var c=o-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&o)<<6|u)}else i+=String.fromCharCode(o)}return i}function y(e,r){return e?g(E,e,r):""}function b(e,r,t,n){if(!(n>0))return 0;for(var a=t,i=t+n-1,o=0;o<e.length;++o){var u=e.charCodeAt(o);if(u>=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&e.charCodeAt(++o)),u<=127){if(t>=i)break;r[t++]=u}else if(u<=2047){if(t+1>=i)break;r[t++]=192|u>>6,r[t++]=128|63&u}else if(u<=65535){if(t+2>=i)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|63&u}else{if(t+3>=i)break;r[t++]=240|u>>18,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|63&u}}return r[t]=0,t-a}function w(e,r,t){return b(e,E,r,t)}function _(e){for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++t)),n<=127?++r:r+=n<=2047?2:n<=65535?3:4}return r}var x,C,E,P,T,S,A,j,$,I="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function k(e,r){for(var t=e,n=t>>1,a=n+r/2;!(n>=a)&&T[n];)++n;if((t=n<<1)-e>32&&I)return I.decode(E.subarray(e,t));for(var i="",o=0;!(o>=r/2);++o){var u=P[e+2*o>>1];if(0==u)break;i+=String.fromCharCode(u)}return i}function D(e,r,t){if(void 0===t&&(t=2147483647),t<2)return 0;for(var n=r,a=(t-=2)<2*e.length?t/2:e.length,i=0;i<a;++i){var o=e.charCodeAt(i);P[r>>1]=o,r+=2}return P[r>>1]=0,r-n}function F(e){return 2*e.length}function L(e,r){for(var t=0,n="";!(t>=r/4);){var a=S[e+4*t>>2];if(0==a)break;if(++t,a>=65536){var i=a-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(a)}return n}function O(e,r,t){if(void 0===t&&(t=2147483647),t<4)return 0;for(var n=r,a=n+t-4,i=0;i<e.length;++i){var o=e.charCodeAt(i);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),S[r>>2]=o,(r+=4)+4>a)break}return S[r>>2]=0,r-n}function B(e){for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r}function W(e){x=e,a.HEAP8=C=new Int8Array(e),a.HEAP16=P=new Int16Array(e),a.HEAP32=S=new Int32Array(e),a.HEAPU8=E=new Uint8Array(e),a.HEAPU16=T=new Uint16Array(e),a.HEAPU32=A=new Uint32Array(e),a.HEAPF32=j=new Float32Array(e),a.HEAPF64=$=new Float64Array(e)}a.INITIAL_MEMORY;var M,U=[],R=[],G=[],N=[],V=0,Y=null,H=null;function z(e){V++,a.monitorRunDependencies&&a.monitorRunDependencies(V)}function q(e){if(V--,a.monitorRunDependencies&&a.monitorRunDependencies(V),0==V&&(null!==Y&&(clearInterval(Y),Y=null),H)){var r=H;H=null,r()}}function J(e){a.onAbort&&a.onAbort(e),l(e+=""),v=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var r=new WebAssembly.RuntimeError(e);throw n(r),r}function K(e){return r=e,t="data:application/octet-stream;base64,",String.prototype.startsWith?r.startsWith(t):0===r.indexOf(t);var r,t}a.preloadedImages={},a.preloadedAudios={};var X,Q="module-release.wasm";function Z(e){try{if(e==Q&&d)return new Uint8Array(d);throw"both async and sync fetching of the wasm failed"}catch(e){J(e)}}function ee(e){for(;e.length>0;){var r=e.shift();if("function"!=typeof r){var t=r.func;"number"==typeof t?void 0===r.arg?M.get(t)():M.get(t)(r.arg):t(void 0===r.arg?null:r.arg)}else r(a)}}K(Q)||(X=Q,Q=a.locateFile?a.locateFile(X,c):c+X);function re(e){this.excPtr=e,this.ptr=e-16,this.set_type=function(e){S[this.ptr+8>>2]=e},this.get_type=function(){return S[this.ptr+8>>2]},this.set_destructor=function(e){S[this.ptr+0>>2]=e},this.get_destructor=function(){return S[this.ptr+0>>2]},this.set_refcount=function(e){S[this.ptr+4>>2]=e},this.set_caught=function(e){e=e?1:0,C[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=C[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,C[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=C[this.ptr+13>>0]},this.init=function(e,r){this.set_type(e),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=S[this.ptr+4>>2];S[this.ptr+4>>2]=e+1},this.release_ref=function(){var e=S[this.ptr+4>>2];return S[this.ptr+4>>2]=e-1,1===e}}var te={mappings:{},buffers:[null,[],[]],printChar:function(e,r){var t=te.buffers[e];0===r||10===r?((1===e?f:l)(g(t,0)),t.length=0):t.push(r)},varargs:void 0,get:function(){return te.varargs+=4,S[te.varargs-4>>2]},getStr:function(e){return y(e)},get64:function(e,r){return e}};function ne(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}var ae=void 0;function ie(e){for(var r="",t=e;E[t];)r+=ae[E[t++]];return r}var oe={},ue={},se={};function ce(e){if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?"_"+e:e}function fe(e,r){return e=ce(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(r)}function le(e,r){var t=fe(r,(function(e){this.name=r,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}));return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},t}var de=void 0;function me(e){throw new de(e)}var pe=void 0;function ve(e){throw new pe(e)}function he(e,r,t){function n(r){var n=t(r);n.length!==e.length&&ve("Mismatched type converter count");for(var a=0;a<e.length;++a)ge(e[a],n[a])}e.forEach((function(e){se[e]=r}));var a=new Array(r.length),i=[],o=0;r.forEach((function(e,r){ue.hasOwnProperty(e)?a[r]=ue[e]:(i.push(e),oe.hasOwnProperty(e)||(oe[e]=[]),oe[e].push((function(){a[r]=ue[e],++o===i.length&&n(a)})))})),0===i.length&&n(a)}function ge(e,r,t){if(t=t||{},!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=r.name;if(e||me('type "'+n+'" must have a positive integer typeid pointer'),ue.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;me("Cannot register type '"+n+"' twice")}if(ue[e]=r,delete se[e],oe.hasOwnProperty(e)){var a=oe[e];delete oe[e],a.forEach((function(e){e()}))}}function ye(e){me(e.$$.ptrType.registeredClass.name+" instance already deleted")}var be=!1;function we(e){}function _e(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function xe(e){return"undefined"==typeof FinalizationGroup?(xe=function(e){return e},e):(be=new FinalizationGroup((function(e){for(var r=e.next();!r.done;r=e.next()){var t=r.value;t.ptr?_e(t):console.warn("object already deleted: "+t.ptr)}})),we=function(e){be.unregister(e.$$)},(xe=function(e){return be.register(e,e.$$,e.$$),e})(e))}var Ce=void 0,Ee=[];function Pe(){for(;Ee.length;){var e=Ee.pop();e.$$.deleteScheduled=!1,e.delete()}}function Te(){}var Se={};function Ae(e,r,t){if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||me("Function '"+t+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[r].overloadTable+")!"),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}}function je(e,r,t,n,a,i,o,u){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=a,this.getActualType=i,this.upcast=o,this.downcast=u,this.pureVirtualFunctions=[]}function $e(e,r,t){for(;r!==t;)r.upcast||me("Expected null or instance of "+t.name+", got an instance of "+r.name),e=r.upcast(e),r=r.baseClass;return e}function Ie(e,r){if(null===r)return this.isReference&&me("null is not a valid "+this.name),0;r.$$||me('Cannot pass "'+Qe(r)+'" as a '+this.name),r.$$.ptr||me("Cannot pass deleted object as a pointer of type "+this.name);var t=r.$$.ptrType.registeredClass;return $e(r.$$.ptr,t,this.registeredClass)}function ke(e,r){var t;if(null===r)return this.isReference&&me("null is not a valid "+this.name),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r.$$||me('Cannot pass "'+Qe(r)+'" as a '+this.name),r.$$.ptr||me("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&r.$$.ptrType.isConst&&me("Cannot convert argument of type "+(r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name)+" to parameter type "+this.name);var n=r.$$.ptrType.registeredClass;if(t=$e(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&me("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:me("Cannot convert argument of type "+(r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var a=r.clone();t=this.rawShare(t,Xe((function(){a.delete()}))),null!==e&&e.push(this.rawDestructor,t)}break;default:me("Unsupporting sharing policy")}return t}function De(e,r){if(null===r)return this.isReference&&me("null is not a valid "+this.name),0;r.$$||me('Cannot pass "'+Qe(r)+'" as a '+this.name),r.$$.ptr||me("Cannot pass deleted object as a pointer of type "+this.name),r.$$.ptrType.isConst&&me("Cannot convert argument of type "+r.$$.ptrType.name+" to parameter type "+this.name);var t=r.$$.ptrType.registeredClass;return $e(r.$$.ptr,t,this.registeredClass)}function Fe(e){return this.fromWireType(A[e>>2])}function Le(e,r,t){if(r===t)return e;if(void 0===t.baseClass)return null;var n=Le(e,r,t.baseClass);return null===n?null:t.downcast(n)}var Oe={};function Be(e,r){return r.ptrType&&r.ptr||ve("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&ve("Both smartPtrType and smartPtr must be specified"),r.count={value:1},xe(Object.create(e,{$$:{value:r}}))}function We(e,r,t,n,a,i,o,u,s,c,f){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=a,this.pointeeType=i,this.sharingPolicy=o,this.rawGetPointee=u,this.rawConstructor=s,this.rawShare=c,this.rawDestructor=f,a||void 0!==r.baseClass?this.toWireType=ke:n?(this.toWireType=Ie,this.destructorFunction=null):(this.toWireType=De,this.destructorFunction=null)}function Me(e,r,t){return-1!=e.indexOf("j")?function(e,r,t){var n=a["dynCall_"+e];return t&&t.length?n.apply(null,[r].concat(t)):n.call(null,r)}(e,r,t):M.get(r).apply(null,t)}function Ue(e,r){var t,n,a,i=-1!=(e=ie(e)).indexOf("j")?(t=e,n=r,a=[],function(){a.length=arguments.length;for(var e=0;e<arguments.length;e++)a[e]=arguments[e];return Me(t,n,a)}):M.get(r);return"function"!=typeof i&&me("unknown function pointer with signature "+e+": "+r),i}var Re=void 0;function Ge(e){var r=Nr(e),t=ie(r);return Rr(r),t}function Ne(e,r){var t=[],n={};throw r.forEach((function e(r){n[r]||ue[r]||(se[r]?se[r].forEach(e):(t.push(r),n[r]=!0))})),new Re(e+": "+t.map(Ge).join([", "]))}function Ve(e,r){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var t=fe(e.name||"unknownFunctionName",(function(){}));t.prototype=e.prototype;var n=new t,a=e.apply(n,r);return a instanceof Object?a:n}function Ye(e){for(;e.length;){var r=e.pop();e.pop()(r)}}function He(e,r,t,n,a){var i=r.length;i<2&&me("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var o=null!==r[1]&&null!==t,u=!1,s=1;s<r.length;++s)if(null!==r[s]&&void 0===r[s].destructorFunction){u=!0;break}var c="void"!==r[0].name,f="",l="";for(s=0;s<i-2;++s)f+=(0!==s?", ":"")+"arg"+s,l+=(0!==s?", ":"")+"arg"+s+"Wired";var d="return function "+ce(e)+"("+f+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";u&&(d+="var destructors = [];\n");var m=u?"destructors":"null",p=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],v=[me,n,a,Ye,r[0],r[1]];for(o&&(d+="var thisWired = classParam.toWireType("+m+", this);\n"),s=0;s<i-2;++s)d+="var arg"+s+"Wired = argType"+s+".toWireType("+m+", arg"+s+"); // "+r[s+2].name+"\n",p.push("argType"+s),v.push(r[s+2]);if(o&&(l="thisWired"+(l.length>0?", ":"")+l),d+=(c?"var rv = ":"")+"invoker(fn"+(l.length>0?", ":"")+l+");\n",u)d+="runDestructors(destructors);\n";else for(s=o?1:2;s<r.length;++s){var h=1===s?"thisWired":"arg"+(s-2)+"Wired";null!==r[s].destructorFunction&&(d+=h+"_dtor("+h+"); // "+r[s].name+"\n",p.push(h+"_dtor"),v.push(r[s].destructorFunction))}return c&&(d+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),d+="}\n",p.push(d),Ve(Function,p).apply(null,v)}function ze(e,r){for(var t=[],n=0;n<e;n++)t.push(S[(r>>2)+n]);return t}var qe=[],Je=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Ke(e){e>4&&0==--Je[e].refcount&&(Je[e]=void 0,qe.push(e))}function Xe(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var r=qe.length?qe.pop():Je.length;return Je[r]={refcount:1,value:e},r}}function Qe(e){if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e}function Ze(e,r){switch(r){case 2:return function(e){return this.fromWireType(j[e>>2])};case 3:return function(e){return this.fromWireType($[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function er(e,r,t){switch(r){case 0:return t?function(e){return C[e]}:function(e){return E[e]};case 1:return t?function(e){return P[e>>1]}:function(e){return T[e>>1]};case 2:return t?function(e){return S[e>>2]}:function(e){return A[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}function rr(e){return e||me("Cannot use deleted val. handle = "+e),Je[e].value}function tr(e,r){var t=ue[e];return void 0===t&&me(r+" has unknown type "+Ge(e)),t}function nr(e,r){for(var t=new Array(e),n=0;n<e;++n)t[n]=tr(S[(r>>2)+n],"parameter "+n);return t}var ar={};function ir(e){var r=ar[e];return void 0===r?ie(e):r}var or,ur=[];function sr(){return"object"==typeof globalThis?globalThis:Function("return this")()}or=function(){return performance.now()};var cr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},timerQueriesEXT:[],queries:[],samplers:[],transformFeedbacks:[],syncs:[],programInfos:{},stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){cr.lastError||(cr.lastError=e)},getNewId:function(e){for(var r=cr.counter++,t=e.length;t<r;t++)e[t]=null;return r},getSource:function(e,r,t,n){for(var a="",i=0;i<r;++i){var o=n?S[n+4*i>>2]:-1;a+=y(S[t+4*i>>2],o<0?void 0:o)}return a},createContext:function(e,r){e.getContextSafariWebGL2Fixed||(e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=function(r,t){var n=e.getContextSafariWebGL2Fixed(r,t);return"webgl"==r==n instanceof WebGLRenderingContext?n:null});var t=r.majorVersion>1?e.getContext("webgl2",r):e.getContext("webgl",r);return t?cr.registerContext(t,r):0},registerContext:function(e,r){var t=cr.getNewId(cr.contexts),n={handle:t,attributes:r,version:r.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),cr.contexts[t]=n,(void 0===r.enableExtensionsByDefault||r.enableExtensionsByDefault)&&cr.initExtensions(n),t},makeContextCurrent:function(e){return cr.currentContext=cr.contexts[e],a.ctx=$r=cr.currentContext&&cr.currentContext.GLctx,!(e&&!$r)},getContext:function(e){return cr.contexts[e]},deleteContext:function(e){cr.currentContext===cr.contexts[e]&&(cr.currentContext=null),"object"==typeof JSEvents&&JSEvents.removeAllHandlersOnTarget(cr.contexts[e].GLctx.canvas),cr.contexts[e]&&cr.contexts[e].GLctx.canvas&&(cr.contexts[e].GLctx.canvas.GLctxObject=void 0),cr.contexts[e]=null},initExtensions:function(e){if(e||(e=cr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var r,t=e.GLctx;!function(e){var r=e.getExtension("ANGLE_instanced_arrays");r&&(e.vertexAttribDivisor=function(e,t){r.vertexAttribDivisorANGLE(e,t)},e.drawArraysInstanced=function(e,t,n,a){r.drawArraysInstancedANGLE(e,t,n,a)},e.drawElementsInstanced=function(e,t,n,a,i){r.drawElementsInstancedANGLE(e,t,n,a,i)})}(t),function(e){var r=e.getExtension("OES_vertex_array_object");r&&(e.createVertexArray=function(){return r.createVertexArrayOES()},e.deleteVertexArray=function(e){r.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){r.bindVertexArrayOES(e)},e.isVertexArray=function(e){return r.isVertexArrayOES(e)})}(t),function(e){var r=e.getExtension("WEBGL_draw_buffers");r&&(e.drawBuffers=function(e,t){r.drawBuffersWEBGL(e,t)})}(t),(r=t).dibvbi=r.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"),function(e){e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")}(t),t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query"),function(e){e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")}(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.indexOf("lose_context")<0&&e.indexOf("debug")<0&&t.getExtension(e)}))}},populateUniformTable:function(e){for(var r=cr.programs[e],t=cr.programInfos[e]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1},n=t.uniforms,a=$r.getProgramParameter(r,35718),i=0;i<a;++i){var o=$r.getActiveUniform(r,i),u=o.name;t.maxUniformLength=Math.max(t.maxUniformLength,u.length+1),"]"==u.slice(-1)&&(u=u.slice(0,u.lastIndexOf("[")));var s=$r.getUniformLocation(r,u);if(s){var c=cr.getNewId(cr.uniforms);n[u]=[o.size,c],cr.uniforms[c]=s;for(var f=1;f<o.size;++f){var l=u+"["+f+"]";s=$r.getUniformLocation(r,l),c=cr.getNewId(cr.uniforms),cr.uniforms[c]=s}}}}};function fr(e,r){return(e>>>0)+4294967296*r}var lr=[];function dr(e,r,t,n){for(var a=0;a<e;a++){var i=$r[t](),o=i&&cr.getNewId(n);i?(i.name=o,n[o]=i):cr.recordError(1282),S[r+4*a>>2]=o}}function mr(e,r,t){if(r){var n,a,i=void 0;switch(e){case 36346:i=1;break;case 36344:return void(0!=t&&1!=t&&cr.recordError(1280));case 34814:case 36345:i=0;break;case 34466:var o=$r.getParameter(34467);i=o?o.length:0;break;case 33309:if(cr.currentContext.version<2)return void cr.recordError(1282);i=2*($r.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(cr.currentContext.version<2)return void cr.recordError(1280);i=33307==e?3:0}if(void 0===i){var u=$r.getParameter(e);switch(typeof u){case"number":i=u;break;case"boolean":i=u?1:0;break;case"string":return void cr.recordError(1280);case"object":if(null===u)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:i=0;break;default:return void cr.recordError(1280)}else{if(u instanceof Float32Array||u instanceof Uint32Array||u instanceof Int32Array||u instanceof Array){for(var s=0;s<u.length;++s)switch(t){case 0:S[r+4*s>>2]=u[s];break;case 2:j[r+4*s>>2]=u[s];break;case 4:C[r+s>>0]=u[s]?1:0}return}try{i=0|u.name}catch(r){return cr.recordError(1280),void l("GL_INVALID_ENUM in glGet"+t+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+r+")")}}break;default:return cr.recordError(1280),void l("GL_INVALID_ENUM in glGet"+t+"v: Native code calling glGet"+t+"v("+e+") and it returns "+u+" of type "+typeof u+"!")}}switch(t){case 1:a=i,A[(n=r)>>2]=a,A[n+4>>2]=(a-A[n>>2])/4294967296;break;case 0:S[r>>2]=i;break;case 2:j[r>>2]=i;break;case 4:C[r>>0]=i?1:0}}else cr.recordError(1281)}function pr(e){var r=_(e)+1,t=Mr(r);return w(e,t,r),t}function vr(e){return 0==(e-=5120)?C:1==e?E:2==e?P:4==e?S:6==e?j:5==e||28922==e||28520==e||30779==e||30782==e?A:T}function hr(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function gr(e,r,t,n,a,i){var o=vr(e),u=hr(o),s=1<<u,c=function(e,r,t,n){var a;return r*(e*t+(a=n)-1&-a)}(t,n,function(e){return{5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1}(r)*s,cr.unpackAlignment);return o.subarray(a>>u,a+c>>u)}var yr=[],br=[];function wr(){return!0}function _r(e){try{return m.grow(e-x.byteLength+65535>>>16),W(m.buffer),1}catch(e){}}a._emscripten_is_main_browser_thread=wr;var xr={xhrs:[],setu64:function(e,r){A[e>>2]=r,A[e+4>>2]=r/4294967296|0},openDatabase:function(e,r,t,n){try{var a=indexedDB.open(e,r)}catch(e){return n(e)}a.onupgradeneeded=function(e){var r=e.target.result;r.objectStoreNames.contains("FILES")&&r.deleteObjectStore("FILES"),r.createObjectStore("FILES")},a.onsuccess=function(e){t(e.target.result)},a.onerror=function(e){n(e)}},staticInit:function(){xr.openDatabase("emscripten_filesystem",1,(function(e){xr.dbInstance=e,q()}),(function(){xr.dbInstance=!1,q()})),"undefined"!=typeof ENVIRONMENT_IS_FETCH_WORKER&&ENVIRONMENT_IS_FETCH_WORKER||z()}};function Cr(e,r,t,n,a){var i=A[e+8>>2];if(i){var o=y(i),u=e+112,s=y(u);s||(s="GET"),A[e+4>>2];var c=A[u+52>>2],f=A[u+56>>2],l=!!A[u+60>>2],d=(A[u+64>>2],A[u+68>>2]),m=A[u+72>>2],p=A[u+76>>2],v=A[u+80>>2],h=A[u+84>>2],g=A[u+88>>2],b=!!(1&c),_=!!(2&c),x=!!(64&c),C=d?y(d):void 0,P=m?y(m):void 0,S=v?y(v):void 0,j=new XMLHttpRequest;if(j.withCredentials=l,j.open(s,o,!x,C,P),x||(j.timeout=f),j.url_=o,j.responseType="arraybuffer",v&&j.overrideMimeType(S),p)for(;;){var $=A[p>>2];if(!$)break;var I=A[p+4>>2];if(!I)break;p+=8;var k=y($),D=y(I);j.setRequestHeader(k,D)}xr.xhrs.push(j);var F=xr.xhrs.length;A[e+0>>2]=F;var L=h&&g?E.slice(h,h+g):null;j.onload=function(n){O(b&&!_);var a=j.response?j.response.byteLength:0;xr.setu64(e+24,0),a&&xr.setu64(e+32,a),T[e+40>>1]=j.readyState,T[e+42>>1]=j.status,j.statusText&&w(j.statusText,e+44,64),j.status>=200&&j.status<300?r&&r(e,j,n):t&&t(e,j,n)},j.onerror=function(r){O(b);var n=j.status;xr.setu64(e+24,0),xr.setu64(e+32,j.response?j.response.byteLength:0),T[e+40>>1]=j.readyState,T[e+42>>1]=n,t&&t(e,j,r)},j.ontimeout=function(r){t&&t(e,j,r)},j.onprogress=function(r){var t=b&&_&&j.response?j.response.byteLength:0,a=0;b&&_&&(a=Mr(t),E.set(new Uint8Array(j.response),a)),A[e+12>>2]=a,xr.setu64(e+16,t),xr.setu64(e+24,r.loaded-t),xr.setu64(e+32,r.total),T[e+40>>1]=j.readyState,j.readyState>=3&&0===j.status&&r.loaded>0&&(j.status=200),T[e+42>>1]=j.status,j.statusText&&w(j.statusText,e+44,64),n&&n(e,j,r),a&&Rr(a)},j.onreadystatechange=function(r){T[e+40>>1]=j.readyState,j.readyState>=2&&(T[e+42>>1]=j.status),a&&a(e,j,r)};try{j.send(L)}catch(r){t&&t(e,j,r)}}else t(e,0,"no url specified!");function O(r){var t=0,n=0;r&&(n=j.response?j.response.byteLength:0,t=Mr(n),E.set(new Uint8Array(j.response),t)),A[e+12>>2]=t,xr.setu64(e+16,n)}}function Er(e){try{e()}catch(e){if(e instanceof qr)return;if("unwind"!==e)throw e&&"object"==typeof e&&e.stack&&l("exception thrown: "+[e,e.stack]),e}}function Pr(e,r,t,n,a){if(e){var i=A[r+112+64>>2];i||(i=A[r+8>>2]);var o=y(i);try{var u=e.transaction(["FILES"],"readwrite").objectStore("FILES").put(t,o);u.onsuccess=function(e){T[r+40>>1]=4,T[r+42>>1]=200,w("OK",r+44,64),n(r,0,o)},u.onerror=function(e){T[r+40>>1]=4,T[r+42>>1]=413,w("Payload Too Large",r+44,64),a(r,0,e)}}catch(e){a(r,0,e)}}else a(r,0,"IndexedDB not available!")}var Tr={};function Sr(){if(!Sr.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",_:s||"./this.program"};for(var r in Tr)e[r]=Tr[r];var t=[];for(var r in e)t.push(r+"="+e[r]);Sr.strings=t}return Sr.strings}function Ar(e){return e%4==0&&(e%100!=0||e%400==0)}function jr(e,r){for(var t=0,n=0;n<=r;t+=e[n++]);return t}var $r,Ir=[31,29,31,30,31,30,31,31,30,31,30,31],kr=[31,28,31,30,31,30,31,31,30,31,30,31];function Dr(e,r){for(var t=new Date(e.getTime());r>0;){var n=Ar(t.getFullYear()),a=t.getMonth(),i=(n?Ir:kr)[a];if(!(r>i-t.getDate()))return t.setDate(t.getDate()+r),t;r-=i-t.getDate()+1,t.setDate(1),a<11?t.setMonth(a+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t}!function(){for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);ae=e}(),de=a.BindingError=le(Error,"BindingError"),pe=a.InternalError=le(Error,"InternalError"),Te.prototype.isAliasOf=function(e){if(!(this instanceof Te))return!1;if(!(e instanceof Te))return!1;for(var r=this.$$.ptrType.registeredClass,t=this.$$.ptr,n=e.$$.ptrType.registeredClass,a=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return r===n&&t===a},Te.prototype.clone=function(){if(this.$$.ptr||ye(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=xe(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 r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},Te.prototype.delete=function(){this.$$.ptr||ye(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&me("Object already scheduled for deletion"),we(this),_e(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},Te.prototype.isDeleted=function(){return!this.$$.ptr},Te.prototype.deleteLater=function(){return this.$$.ptr||ye(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&me("Object already scheduled for deletion"),Ee.push(this),1===Ee.length&&Ce&&Ce(Pe),this.$$.deleteScheduled=!0,this},We.prototype.getPointee=function(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},We.prototype.destructor=function(e){this.rawDestructor&&this.rawDestructor(e)},We.prototype.argPackAdvance=8,We.prototype.readValueFromPointer=Fe,We.prototype.deleteObject=function(e){null!==e&&e.delete()},We.prototype.fromWireType=function(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=function(e,r){return r=function(e,r){for(void 0===r&&me("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r}(e,r),Oe[r]}(this.registeredClass,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?Be(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Be(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,o=this.registeredClass.getActualType(r),u=Se[o];if(!u)return a.call(this);i=this.isConst?u.constPointerType:u.pointerType;var s=Le(r,this.registeredClass,i.registeredClass);return null===s?a.call(this):this.isSmartPointer?Be(i.registeredClass.instancePrototype,{ptrType:i,ptr:s,smartPtrType:this,smartPtr:e}):Be(i.registeredClass.instancePrototype,{ptrType:i,ptr:s})},a.getInheritedInstanceCount=function(){return Object.keys(Oe).length},a.getLiveInheritedInstances=function(){var e=[];for(var r in Oe)Oe.hasOwnProperty(r)&&e.push(Oe[r]);return e},a.flushPendingDeletes=Pe,a.setDelayFunction=function(e){Ce=e,Ee.length&&Ce&&Ce(Pe)},Re=a.UnboundTypeError=le(Error,"UnboundTypeError"),a.count_emval_handles=function(){for(var e=0,r=5;r<Je.length;++r)void 0!==Je[r]&&++e;return e},a.get_first_emval=function(){for(var e=5;e<Je.length;++e)if(void 0!==Je[e])return Je[e];return null};for(var Fr=0;Fr<32;++Fr)lr.push(new Array(Fr));var Lr=new Float32Array(288);for(Fr=0;Fr<288;++Fr)yr[Fr]=Lr.subarray(0,Fr+1);var Or=new Int32Array(288);for(Fr=0;Fr<288;++Fr)br[Fr]=Or.subarray(0,Fr+1);xr.staticInit();var Br,Wr={u:function(e,r,t,n){J("Assertion failed: "+y(e)+", at: "+[r?y(r):"unknown filename",t,n?y(n):"unknown function"])},g:function(e){return Mr(e+16)+16},f:function(e,r,t){throw new re(e).init(r,t),e},G:function(e,r,t){return te.varargs=t,0},ub:function(e,r){},rb:function(e,r,t){return te.varargs=t,0},sb:function(e,r,t,n,a,i){return function(e,r,t,n,a,i){var o;i<<=12;var u=!1;return 0!=(16&n)&&e%16384!=0?-28:0==(32&n)?-52:(o=zr(16384,r))?(Ur(o,0,r),u=!0,te.mappings[o]={malloc:o,len:r,allocated:u,fd:a,prot:t,flags:n,offset:i},o):-48}(e,r,t,n,a,i)},tb:function(e,r){return function(e,r){if(-1==(0|e)||0===r)return-28;var t=te.mappings[e];return t?(r===t.len&&(te.mappings[e]=null,t.allocated&&Rr(t.malloc)),0):0}(e,r)},I:function(e,r,t){te.varargs=t},H:function(e,r){},Bb:function(e,r,t,n,a){var i=ne(t);ge(e,{name:r=ie(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?n:a},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===t)n=C;else if(2===t)n=P;else{if(4!==t)throw new TypeError("Unknown boolean type size: "+r);n=S}return this.fromWireType(n[e>>i])},destructorFunction:null})},ob:function(e,r,t,n,i,o,u,s,c,f,l,d,m){l=ie(l),o=Ue(i,o),s&&(s=Ue(u,s)),f&&(f=Ue(c,f)),m=Ue(d,m);var p=ce(l);!function(e,r,t){a.hasOwnProperty(e)?(me("Cannot register public name '"+e+"' twice"),Ae(a,e,e),a.hasOwnProperty(t)&&me("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),a[e].overloadTable[void 0]=r):a[e]=r}(p,(function(){Ne("Cannot construct "+l+" due to unbound types",[n])})),he([e,r,t],n?[n]:[],(function(r){var t,i;r=r[0],i=n?(t=r.registeredClass).instancePrototype:Te.prototype;var u=fe(p,(function(){if(Object.getPrototypeOf(this)!==c)throw new de("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new de(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new de("Tried to invoke ctor of "+l+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(d.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),c=Object.create(i,{constructor:{value:u}});u.prototype=c;var d=new je(l,u,c,m,t,o,s,f),v=new We(l,d,!0,!1,!1),h=new We(l+"*",d,!1,!1,!1),g=new We(l+" const*",d,!1,!0,!1);return Se[e]={pointerType:h,constPointerType:g},function(e,r,t){a.hasOwnProperty(e)||ve("Replacing nonexistant public symbol"),a[e].overloadTable,a[e]=r,a[e].argCount=t}(p,u),[v,h,g]}))},D:function(e,r,t,n,a,i,o){var u=ze(t,n);r=ie(r),i=Ue(a,i),he([],[e],(function(e){var n=(e=e[0]).name+"."+r;function a(){Ne("Cannot call "+n+" due to unbound types",u)}var s=e.registeredClass.constructor;return void 0===s[r]?(a.argCount=t-1,s[r]=a):(Ae(s,r,n),s[r].overloadTable[t-1]=a),he([],u,(function(e){var a=[e[0],null].concat(e.slice(1)),u=He(n,a,null,i,o);return void 0===s[r].overloadTable?(u.argCount=t-1,s[r]=u):s[r].overloadTable[t-1]=u,[]})),[]}))},i:function(e,r,t,n,a,i,o,u){var s=ze(t,n);r=ie(r),i=Ue(a,i),he([],[e],(function(e){var n=(e=e[0]).name+"."+r;function a(){Ne("Cannot call "+n+" due to unbound types",s)}u&&e.registeredClass.pureVirtualFunctions.push(r);var c=e.registeredClass.instancePrototype,f=c[r];return void 0===f||void 0===f.overloadTable&&f.className!==e.name&&f.argCount===t-2?(a.argCount=t-2,a.className=e.name,c[r]=a):(Ae(c,r,n),c[r].overloadTable[t-2]=a),he([],s,(function(a){var u=He(n,a,e,i,o);return void 0===c[r].overloadTable?(u.argCount=t-2,c[r]=u):c[r].overloadTable[t-2]=u,[]})),[]}))},Ab:function(e,r){ge(e,{name:r=ie(r),fromWireType:function(e){var r=Je[e].value;return Ke(e),r},toWireType:function(e,r){return Xe(r)},argPackAdvance:8,readValueFromPointer:Fe,destructorFunction:null})},J:function(e,r,t){var n=ne(t);ge(e,{name:r=ie(r),fromWireType:function(e){return e},toWireType:function(e,r){if("number"!=typeof r&&"boolean"!=typeof r)throw new TypeError('Cannot convert "'+Qe(r)+'" to '+this.name);return r},argPackAdvance:8,readValueFromPointer:Ze(r,n),destructorFunction:null})},o:function(e,r,t,n,a){r=ie(r),-1===a&&(a=4294967295);var i=ne(t),o=function(e){return e};if(0===n){var u=32-8*t;o=function(e){return e<<u>>>u}}var s=-1!=r.indexOf("unsigned");ge(e,{name:r,fromWireType:o,toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+Qe(t)+'" to '+this.name);if(t<n||t>a)throw new TypeError('Passing a number "'+Qe(t)+'" from JS side to C/C++ side to an argument of type "'+r+'", which is outside the valid range ['+n+", "+a+"]!");return s?t>>>0:0|t},argPackAdvance:8,readValueFromPointer:er(r,i,0!==n),destructorFunction:null})},n:function(e,r,t){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function a(e){var r=A,t=r[e>>=2],a=r[e+1];return new n(x,a,t)}ge(e,{name:t=ie(t),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},gb:function(e,r,t,n,a,i,o,u,s,c,f,l){t=ie(t),i=Ue(a,i),u=Ue(o,u),c=Ue(s,c),l=Ue(f,l),he([e],[r],(function(e){return e=e[0],[new We(t,e.registeredClass,!1,!1,!0,e,n,i,u,c,l)]}))},K:function(e,r){var t="std::string"===(r=ie(r));ge(e,{name:r,fromWireType:function(e){var r,n=A[e>>2];if(t)for(var a=e+4,i=0;i<=n;++i){var o=e+4+i;if(i==n||0==E[o]){var u=y(a,o-a);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),a=o+1}}else{var s=new Array(n);for(i=0;i<n;++i)s[i]=String.fromCharCode(E[e+4+i]);r=s.join("")}return Rr(e),r},toWireType:function(e,r){r instanceof ArrayBuffer&&(r=new Uint8Array(r));var n="string"==typeof r;n||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||me("Cannot pass non-string to std::string");var a=(t&&n?function(){return _(r)}:function(){return r.length})(),i=Mr(4+a+1);if(A[i>>2]=a,t&&n)w(r,i+4,a+1);else if(n)for(var o=0;o<a;++o){var u=r.charCodeAt(o);u>255&&(Rr(i),me("String has UTF-16 code units that do not fit in 8 bits")),E[i+4+o]=u}else for(o=0;o<a;++o)E[i+4+o]=r[o];return null!==e&&e.push(Rr,i),i},argPackAdvance:8,readValueFromPointer:Fe,destructorFunction:function(e){Rr(e)}})},w:function(e,r,t){var n,a,i,o,u;t=ie(t),2===r?(n=k,a=D,o=F,i=function(){return T},u=1):4===r&&(n=L,a=O,o=B,i=function(){return A},u=2),ge(e,{name:t,fromWireType:function(e){for(var t,a=A[e>>2],o=i(),s=e+4,c=0;c<=a;++c){var f=e+4+c*r;if(c==a||0==o[f>>u]){var l=n(s,f-s);void 0===t?t=l:(t+=String.fromCharCode(0),t+=l),s=f+r}}return Rr(e),t},toWireType:function(e,n){"string"!=typeof n&&me("Cannot pass non-string to C++ string type "+t);var i=o(n),s=Mr(4+i+r);return A[s>>2]=i>>u,a(n,s+4,i+r),null!==e&&e.push(Rr,s),s},argPackAdvance:8,readValueFromPointer:Fe,destructorFunction:function(e){Rr(e)}})},Cb:function(e,r){ge(e,{isVoid:!0,name:r=ie(r),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,r){}})},xb:function(e){delete xr.xhrs[e-1]},t:function(e,r,t){e=rr(e),r=tr(r,"emval::as");var n=[],a=Xe(n);return S[t>>2]=a,r.toWireType(n,e)},Jb:function(e,r,t,n){e=rr(e);for(var a=nr(r,t),i=new Array(r),o=0;o<r;++o){var u=a[o];i[o]=u.readValueFromPointer(n),n+=u.argPackAdvance}return Xe(e.apply(void 0,i))},s:function(e,r,t,n,a){return(e=ur[e])(r=rr(r),t=ir(t),function(e){var r=[];return S[e>>2]=Xe(r),r}(n),a)},L:function(e,r,t,n){(e=ur[e])(r=rr(r),t=ir(t),null,n)},C:Ke,nc:function(e){return 0===e?Xe(sr()):(e=ir(e),Xe(sr()[e]))},q:function(e,r){for(var t=nr(e,r),n=t[0],a=n.name+"_$"+t.slice(1).map((function(e){return e.name})).join("_")+"$",i=["retType"],o=[n],u="",s=0;s<e-1;++s)u+=(0!==s?", ":"")+"arg"+s,i.push("argType"+s),o.push(t[1+s]);var c,f,l="return function "+ce("methodCaller_"+a)+"(handle, name, destructors, args) {\n",d=0;for(s=0;s<e-1;++s)l+=" var arg"+s+" = argType"+s+".readValueFromPointer(args"+(d?"+"+d:"")+");\n",d+=t[s+1].argPackAdvance;for(l+=" var rv = handle[name]("+u+");\n",s=0;s<e-1;++s)t[s+1].deleteObject&&(l+=" argType"+s+".deleteObject(arg"+s+");\n");return n.isVoid||(l+=" return retType.toWireType(destructors, rv);\n"),l+="};\n",i.push(l),c=Ve(Function,i).apply(null,o),f=ur.length,ur.push(c),f},ha:function(e){return e=ir(e),Xe(a[e])},z:function(e,r){return Xe((e=rr(e))[r=rr(r)])},O:function(e){e>4&&(Je[e].refcount+=1)},Gb:function(){return Xe([])},cc:function(e){return Xe(ir(e))},bd:function(){return Xe({})},ad:function(e){Ye(Je[e].value),Ke(e)},wb:function(e,r,t){e=rr(e),r=rr(r),t=rr(t),e[r]=t},x:function(e,r){return Xe((e=tr(e,"_emval_take_value")).readValueFromPointer(r))},vb:function(e){return Xe(typeof(e=rr(e)))},c:function(){J()},E:function(e,r){var t;if(0===e)t=Date.now();else{if(1!==e&&4!==e)return 28,S[Gr()>>2]=28,-1;t=or()}return S[r>>2]=t/1e3|0,S[r+4>>2]=t%1e3*1e3*1e3|0,0},sa:function(e){cancelAnimationFrame(e)},Zc:function(e){$r.activeTexture(e)},_c:function(e,r){$r.attachShader(cr.programs[e],cr.shaders[r])},$c:function(e,r,t){$r.bindAttribLocation(cr.programs[e],r,y(t))},P:function(e,r){35051==e?$r.currentPixelPackBufferBinding=r:35052==e&&($r.currentPixelUnpackBufferBinding=r),$r.bindBuffer(e,cr.buffers[r])},_b:function(e,r){$r.bindFramebuffer(e,cr.framebuffers[r])},$b:function(e,r){$r.bindRenderbuffer(e,cr.renderbuffers[r])},Mb:function(e,r){$r.bindSampler(e,cr.samplers[r])},Q:function(e,r){$r.bindTexture(e,cr.textures[r])},vc:function(e){$r.bindVertexArray(cr.vaos[e])},yc:function(e){$r.bindVertexArray(cr.vaos[e])},R:function(e,r,t,n){$r.blendColor(e,r,t,n)},S:function(e){$r.blendEquation(e)},T:function(e,r){$r.blendFunc(e,r)},Tb:function(e,r,t,n,a,i,o,u,s,c){$r.blitFramebuffer(e,r,t,n,a,i,o,u,s,c)},U:function(e,r,t,n){cr.currentContext.version>=2?t?$r.bufferData(e,E,n,t,r):$r.bufferData(e,r,n):$r.bufferData(e,t?E.subarray(t,t+r):r,n)},V:function(e,r,t,n){cr.currentContext.version>=2?$r.bufferSubData(e,r,E,n,t):$r.bufferSubData(e,r,E.subarray(n,n+t))},ac:function(e){return $r.checkFramebufferStatus(e)},W:function(e){$r.clear(e)},X:function(e,r,t,n){$r.clearColor(e,r,t,n)},Y:function(e){$r.clearStencil(e)},$a:function(e,r,t,n){return $r.clientWaitSync(cr.syncs[e],r,fr(t,n))},Z:function(e,r,t,n){$r.colorMask(!!e,!!r,!!t,!!n)},_:function(e){$r.compileShader(cr.shaders[e])},$:function(e,r,t,n,a,i,o,u){cr.currentContext.version>=2?$r.currentPixelUnpackBufferBinding?$r.compressedTexImage2D(e,r,t,n,a,i,o,u):$r.compressedTexImage2D(e,r,t,n,a,i,E,u,o):$r.compressedTexImage2D(e,r,t,n,a,i,u?E.subarray(u,u+o):null)},aa:function(e,r,t,n,a,i,o,u,s){cr.currentContext.version>=2?$r.currentPixelUnpackBufferBinding?$r.compressedTexSubImage2D(e,r,t,n,a,i,o,u,s):$r.compressedTexSubImage2D(e,r,t,n,a,i,o,E,s,u):$r.compressedTexSubImage2D(e,r,t,n,a,i,o,s?E.subarray(s,s+u):null)},ba:function(e,r,t,n,a,i,o,u){$r.copyTexSubImage2D(e,r,t,n,a,i,o,u)},ca:function(){var e=cr.getNewId(cr.programs),r=$r.createProgram();return r.name=e,cr.programs[e]=r,e},da:function(e){var r=cr.getNewId(cr.shaders);return cr.shaders[r]=$r.createShader(e),r},ea:function(e){$r.cullFace(e)},fa:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2],a=cr.buffers[n];a&&($r.deleteBuffer(a),a.name=0,cr.buffers[n]=null,n==$r.currentPixelPackBufferBinding&&($r.currentPixelPackBufferBinding=0),n==$r.currentPixelUnpackBufferBinding&&($r.currentPixelUnpackBufferBinding=0))}},bc:function(e,r){for(var t=0;t<e;++t){var n=S[r+4*t>>2],a=cr.framebuffers[n];a&&($r.deleteFramebuffer(a),a.name=0,cr.framebuffers[n]=null)}},ga:function(e){if(e){var r=cr.programs[e];r?($r.deleteProgram(r),r.name=0,cr.programs[e]=null,cr.programInfos[e]=null):cr.recordError(1281)}},dc:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2],a=cr.renderbuffers[n];a&&($r.deleteRenderbuffer(a),a.name=0,cr.renderbuffers[n]=null)}},Nb:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2],a=cr.samplers[n];a&&($r.deleteSampler(a),a.name=0,cr.samplers[n]=null)}},ia:function(e){if(e){var r=cr.shaders[e];r?($r.deleteShader(r),cr.shaders[e]=null):cr.recordError(1281)}},Vb:function(e){if(e){var r=cr.syncs[e];r?($r.deleteSync(r),r.name=0,cr.syncs[e]=null):cr.recordError(1281)}},ja:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2],a=cr.textures[n];a&&($r.deleteTexture(a),a.name=0,cr.textures[n]=null)}},wc:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2];$r.deleteVertexArray(cr.vaos[n]),cr.vaos[n]=null}},zc:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2];$r.deleteVertexArray(cr.vaos[n]),cr.vaos[n]=null}},ka:function(e){$r.depthMask(!!e)},la:function(e){$r.disable(e)},ma:function(e){$r.disableVertexAttribArray(e)},na:function(e,r,t){$r.drawArrays(e,r,t)},tc:function(e,r,t,n){$r.drawArraysInstanced(e,r,t,n)},rc:function(e,r,t,n,a){$r.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,r,t,n,a)},pc:function(e,r){for(var t=lr[e],n=0;n<e;n++)t[n]=S[r+4*n>>2];$r.drawBuffers(t)},oa:function(e,r,t,n){$r.drawElements(e,r,t,n)},uc:function(e,r,t,n,a){$r.drawElementsInstanced(e,r,t,n,a)},sc:function(e,r,t,n,a,i,o){$r.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,r,t,n,a,i,o)},ic:function(e,r,t,n,a,i){!function(e,r,t,n){$r.drawElements(e,r,t,n)}(e,n,a,i)},pa:function(e){$r.enable(e)},qa:function(e){$r.enableVertexAttribArray(e)},Rb:function(e,r){var t=$r.fenceSync(e,r);if(t){var n=cr.getNewId(cr.syncs);return t.name=n,cr.syncs[n]=t,n}return 0},ra:function(){$r.finish()},ta:function(){$r.flush()},ec:function(e,r,t,n){$r.framebufferRenderbuffer(e,r,t,cr.renderbuffers[n])},fc:function(e,r,t,n,a){$r.framebufferTexture2D(e,r,t,cr.textures[n],a)},ua:function(e){$r.frontFace(e)},va:function(e,r){dr(e,r,"createBuffer",cr.buffers)},gc:function(e,r){dr(e,r,"createFramebuffer",cr.framebuffers)},hc:function(e,r){dr(e,r,"createRenderbuffer",cr.renderbuffers)},Ob:function(e,r){dr(e,r,"createSampler",cr.samplers)},wa:function(e,r){dr(e,r,"createTexture",cr.textures)},xc:function(e,r){dr(e,r,"createVertexArray",cr.vaos)},Ac:function(e,r){dr(e,r,"createVertexArray",cr.vaos)},Wb:function(e){$r.generateMipmap(e)},xa:function(e,r,t){t?S[t>>2]=$r.getBufferParameter(e,r):cr.recordError(1281)},ya:function(){var e=$r.getError()||cr.lastError;return cr.lastError=0,e},Xb:function(e,r,t,n){var a=$r.getFramebufferAttachmentParameter(e,r,t);(a instanceof WebGLRenderbuffer||a instanceof WebGLTexture)&&(a=0|a.name),S[n>>2]=a},Za:function(e,r){mr(e,r,0)},za:function(e,r,t,n){var a=$r.getProgramInfoLog(cr.programs[e]);null===a&&(a="(unknown error)");var i=r>0&&n?w(a,n,r):0;t&&(S[t>>2]=i)},Aa:function(e,r,t){if(t)if(e>=cr.counter)cr.recordError(1281);else{var n=cr.programInfos[e];if(n)if(35716==r){var a=$r.getProgramInfoLog(cr.programs[e]);null===a&&(a="(unknown error)"),S[t>>2]=a.length+1}else if(35719==r)S[t>>2]=n.maxUniformLength;else if(35722==r){if(-1==n.maxAttributeLength){e=cr.programs[e];var i=$r.getProgramParameter(e,35721);n.maxAttributeLength=0;for(var o=0;o<i;++o){var u=$r.getActiveAttrib(e,o);n.maxAttributeLength=Math.max(n.maxAttributeLength,u.name.length+1)}}S[t>>2]=n.maxAttributeLength}else if(35381==r){if(-1==n.maxUniformBlockNameLength){e=cr.programs[e];var s=$r.getProgramParameter(e,35382);for(n.maxUniformBlockNameLength=0,o=0;o<s;++o){var c=$r.getActiveUniformBlockName(e,o);n.maxUniformBlockNameLength=Math.max(n.maxUniformBlockNameLength,c.length+1)}}S[t>>2]=n.maxUniformBlockNameLength}else S[t>>2]=$r.getProgramParameter(cr.programs[e],r);else cr.recordError(1282)}else cr.recordError(1281)},Yb:function(e,r,t){t?S[t>>2]=$r.getRenderbufferParameter(e,r):cr.recordError(1281)},Ba:function(e,r,t,n){var a=$r.getShaderInfoLog(cr.shaders[e]);null===a&&(a="(unknown error)");var i=r>0&&n?w(a,n,r):0;t&&(S[t>>2]=i)},Ib:function(e,r,t,n){var a=$r.getShaderPrecisionFormat(e,r);S[t>>2]=a.rangeMin,S[t+4>>2]=a.rangeMax,S[n>>2]=a.precision},Ca:function(e,r,t){if(t)if(35716==r){var n=$r.getShaderInfoLog(cr.shaders[e]);null===n&&(n="(unknown error)");var a=n?n.length+1:0;S[t>>2]=a}else if(35720==r){var i=$r.getShaderSource(cr.shaders[e]),o=i?i.length+1:0;S[t>>2]=o}else S[t>>2]=$r.getShaderParameter(cr.shaders[e],r);else cr.recordError(1281)},A:function(e){if(cr.stringCache[e])return cr.stringCache[e];var r;switch(e){case 7939:var t=$r.getSupportedExtensions()||[];r=pr((t=t.concat(t.map((function(e){return"GL_"+e})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=$r.getParameter(e);n||cr.recordError(1280),r=pr(n);break;case 7938:var a=$r.getParameter(7938);r=pr(a=cr.currentContext.version>=2?"OpenGL ES 3.0 ("+a+")":"OpenGL ES 2.0 ("+a+")");break;case 35724:var i=$r.getParameter(35724),o=i.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==o&&(3==o[1].length&&(o[1]=o[1]+"0"),i="OpenGL ES GLSL ES "+o[1]+" ("+i+")"),r=pr(i);break;default:return cr.recordError(1280),0}return cr.stringCache[e]=r,r},_a:function(e,r){if(cr.currentContext.version<2)return cr.recordError(1282),0;var t=cr.stringiCache[e];if(t)return r<0||r>=t.length?(cr.recordError(1281),0):t[r];switch(e){case 7939:var n=$r.getSupportedExtensions()||[];return n=(n=n.concat(n.map((function(e){return"GL_"+e})))).map((function(e){return pr(e)})),t=cr.stringiCache[e]=n,r<0||r>=t.length?(cr.recordError(1281),0):t[r];default:return cr.recordError(1280),0}},Da:function(e,r){var t,n=0;if("]"==(r=y(r))[r.length-1]){var a=r.lastIndexOf("[");n="]"!=r[a+1]?(t=r.slice(a+1),parseInt(t)):0,r=r.slice(0,a)}var i=cr.programInfos[e]&&cr.programInfos[e].uniforms[r];return i&&n>=0&&n<i[0]?i[1]+n:-1},Kb:function(e,r,t){for(var n=lr[r],a=0;a<r;a++)n[a]=S[t+4*a>>2];$r.invalidateFramebuffer(e,n)},Lb:function(e,r,t,n,a,i,o){for(var u=lr[r],s=0;s<r;s++)u[s]=S[t+4*s>>2];$r.invalidateSubFramebuffer(e,u,n,a,i,o)},Sb:function(e){return $r.isSync(cr.syncs[e])},Ea:function(e){var r=cr.textures[e];return r?$r.isTexture(r):0},Fa:function(e){$r.lineWidth(e)},Ga:function(e){$r.linkProgram(cr.programs[e]),cr.populateUniformTable(e)},mc:function(e,r,t,n,a,i){$r.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,S,r>>2,S,t>>2,S,n>>2,A,a>>2,i)},oc:function(e,r,t,n,a,i,o,u){$r.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,S,r>>2,t,S,n>>2,S,a>>2,S,i>>2,A,o>>2,u)},Ha:function(e,r){3317==e&&(cr.unpackAlignment=r),$r.pixelStorei(e,r)},qc:function(e){$r.readBuffer(e)},Ia:function(e,r,t,n,a,i,o){if(cr.currentContext.version>=2)if($r.currentPixelPackBufferBinding)$r.readPixels(e,r,t,n,a,i,o);else{var u=vr(i);$r.readPixels(e,r,t,n,a,i,u,o>>hr(u))}else{var s=gr(i,a,t,n,o);s?$r.readPixels(e,r,t,n,a,i,s):cr.recordError(1280)}},Zb:function(e,r,t,n){$r.renderbufferStorage(e,r,t,n)},Ub:function(e,r,t,n,a){$r.renderbufferStorageMultisample(e,r,t,n,a)},Pb:function(e,r,t){$r.samplerParameteri(cr.samplers[e],r,t)},Qb:function(e,r,t){var n=S[t>>2];$r.samplerParameteri(cr.samplers[e],r,n)},Ja:function(e,r,t,n){$r.scissor(e,r,t,n)},Ka:function(e,r,t,n){var a=cr.getSource(e,r,t,n);$r.shaderSource(cr.shaders[e],a)},La:function(e,r,t){$r.stencilFunc(e,r,t)},Ma:function(e,r,t,n){$r.stencilFuncSeparate(e,r,t,n)},Na:function(e){$r.stencilMask(e)},Oa:function(e,r){$r.stencilMaskSeparate(e,r)},Pa:function(e,r,t){$r.stencilOp(e,r,t)},Qa:function(e,r,t,n){$r.stencilOpSeparate(e,r,t,n)},Ra:function(e,r,t,n,a,i,o,u,s){if(cr.currentContext.version>=2)if($r.currentPixelUnpackBufferBinding)$r.texImage2D(e,r,t,n,a,i,o,u,s);else if(s){var c=vr(u);$r.texImage2D(e,r,t,n,a,i,o,u,c,s>>hr(c))}else $r.texImage2D(e,r,t,n,a,i,o,u,null);else $r.texImage2D(e,r,t,n,a,i,o,u,s?gr(u,o,n,a,s):null)},Sa:function(e,r,t){$r.texParameterf(e,r,t)},Ta:function(e,r,t){var n=j[t>>2];$r.texParameterf(e,r,n)},Ua:function(e,r,t){$r.texParameteri(e,r,t)},Va:function(e,r,t){var n=S[t>>2];$r.texParameteri(e,r,n)},jc:function(e,r,t,n,a){$r.texStorage2D(e,r,t,n,a)},Wa:function(e,r,t,n,a,i,o,u,s){if(cr.currentContext.version>=2)if($r.currentPixelUnpackBufferBinding)$r.texSubImage2D(e,r,t,n,a,i,o,u,s);else if(s){var c=vr(u);$r.texSubImage2D(e,r,t,n,a,i,o,u,c,s>>hr(c))}else $r.texSubImage2D(e,r,t,n,a,i,o,u,null);else{var f=null;s&&(f=gr(u,o,a,i,s)),$r.texSubImage2D(e,r,t,n,a,i,o,u,f)}},Xa:function(e,r){$r.uniform1f(cr.uniforms[e],r)},Ya:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform1fv(cr.uniforms[e],j,t>>2,r);else{if(r<=288)for(var n=yr[r-1],a=0;a<r;++a)n[a]=j[t+4*a>>2];else n=j.subarray(t>>2,t+4*r>>2);$r.uniform1fv(cr.uniforms[e],n)}},Vc:function(e,r){$r.uniform1i(cr.uniforms[e],r)},Wc:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform1iv(cr.uniforms[e],S,t>>2,r);else{if(r<=288)for(var n=br[r-1],a=0;a<r;++a)n[a]=S[t+4*a>>2];else n=S.subarray(t>>2,t+4*r>>2);$r.uniform1iv(cr.uniforms[e],n)}},Xc:function(e,r,t){$r.uniform2f(cr.uniforms[e],r,t)},Yc:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform2fv(cr.uniforms[e],j,t>>2,2*r);else{if(r<=144)for(var n=yr[2*r-1],a=0;a<2*r;a+=2)n[a]=j[t+4*a>>2],n[a+1]=j[t+(4*a+4)>>2];else n=j.subarray(t>>2,t+8*r>>2);$r.uniform2fv(cr.uniforms[e],n)}},Uc:function(e,r,t){$r.uniform2i(cr.uniforms[e],r,t)},Tc:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform2iv(cr.uniforms[e],S,t>>2,2*r);else{if(r<=144)for(var n=br[2*r-1],a=0;a<2*r;a+=2)n[a]=S[t+4*a>>2],n[a+1]=S[t+(4*a+4)>>2];else n=S.subarray(t>>2,t+8*r>>2);$r.uniform2iv(cr.uniforms[e],n)}},Sc:function(e,r,t,n){$r.uniform3f(cr.uniforms[e],r,t,n)},Rc:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform3fv(cr.uniforms[e],j,t>>2,3*r);else{if(r<=96)for(var n=yr[3*r-1],a=0;a<3*r;a+=3)n[a]=j[t+4*a>>2],n[a+1]=j[t+(4*a+4)>>2],n[a+2]=j[t+(4*a+8)>>2];else n=j.subarray(t>>2,t+12*r>>2);$r.uniform3fv(cr.uniforms[e],n)}},Qc:function(e,r,t,n){$r.uniform3i(cr.uniforms[e],r,t,n)},Pc:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform3iv(cr.uniforms[e],S,t>>2,3*r);else{if(r<=96)for(var n=br[3*r-1],a=0;a<3*r;a+=3)n[a]=S[t+4*a>>2],n[a+1]=S[t+(4*a+4)>>2],n[a+2]=S[t+(4*a+8)>>2];else n=S.subarray(t>>2,t+12*r>>2);$r.uniform3iv(cr.uniforms[e],n)}},Oc:function(e,r,t,n,a){$r.uniform4f(cr.uniforms[e],r,t,n,a)},Nc:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform4fv(cr.uniforms[e],j,t>>2,4*r);else{if(r<=72){var n=yr[4*r-1],a=j;t>>=2;for(var i=0;i<4*r;i+=4){var o=t+i;n[i]=a[o],n[i+1]=a[o+1],n[i+2]=a[o+2],n[i+3]=a[o+3]}}else n=j.subarray(t>>2,t+16*r>>2);$r.uniform4fv(cr.uniforms[e],n)}},Bc:function(e,r,t,n,a){$r.uniform4i(cr.uniforms[e],r,t,n,a)},Cc:function(e,r,t){if(cr.currentContext.version>=2)$r.uniform4iv(cr.uniforms[e],S,t>>2,4*r);else{if(r<=72)for(var n=br[4*r-1],a=0;a<4*r;a+=4)n[a]=S[t+4*a>>2],n[a+1]=S[t+(4*a+4)>>2],n[a+2]=S[t+(4*a+8)>>2],n[a+3]=S[t+(4*a+12)>>2];else n=S.subarray(t>>2,t+16*r>>2);$r.uniform4iv(cr.uniforms[e],n)}},Dc:function(e,r,t,n){if(cr.currentContext.version>=2)$r.uniformMatrix2fv(cr.uniforms[e],!!t,j,n>>2,4*r);else{if(r<=72)for(var a=yr[4*r-1],i=0;i<4*r;i+=4)a[i]=j[n+4*i>>2],a[i+1]=j[n+(4*i+4)>>2],a[i+2]=j[n+(4*i+8)>>2],a[i+3]=j[n+(4*i+12)>>2];else a=j.subarray(n>>2,n+16*r>>2);$r.uniformMatrix2fv(cr.uniforms[e],!!t,a)}},Ec:function(e,r,t,n){if(cr.currentContext.version>=2)$r.uniformMatrix3fv(cr.uniforms[e],!!t,j,n>>2,9*r);else{if(r<=32)for(var a=yr[9*r-1],i=0;i<9*r;i+=9)a[i]=j[n+4*i>>2],a[i+1]=j[n+(4*i+4)>>2],a[i+2]=j[n+(4*i+8)>>2],a[i+3]=j[n+(4*i+12)>>2],a[i+4]=j[n+(4*i+16)>>2],a[i+5]=j[n+(4*i+20)>>2],a[i+6]=j[n+(4*i+24)>>2],a[i+7]=j[n+(4*i+28)>>2],a[i+8]=j[n+(4*i+32)>>2];else a=j.subarray(n>>2,n+36*r>>2);$r.uniformMatrix3fv(cr.uniforms[e],!!t,a)}},Fc:function(e,r,t,n){if(cr.currentContext.version>=2)$r.uniformMatrix4fv(cr.uniforms[e],!!t,j,n>>2,16*r);else{if(r<=18){var a=yr[16*r-1],i=j;n>>=2;for(var o=0;o<16*r;o+=16){var u=n+o;a[o]=i[u],a[o+1]=i[u+1],a[o+2]=i[u+2],a[o+3]=i[u+3],a[o+4]=i[u+4],a[o+5]=i[u+5],a[o+6]=i[u+6],a[o+7]=i[u+7],a[o+8]=i[u+8],a[o+9]=i[u+9],a[o+10]=i[u+10],a[o+11]=i[u+11],a[o+12]=i[u+12],a[o+13]=i[u+13],a[o+14]=i[u+14],a[o+15]=i[u+15]}}else a=j.subarray(n>>2,n+64*r>>2);$r.uniformMatrix4fv(cr.uniforms[e],!!t,a)}},Gc:function(e){$r.useProgram(cr.programs[e])},Hc:function(e,r){$r.vertexAttrib1f(e,r)},Ic:function(e,r){$r.vertexAttrib2f(e,j[r>>2],j[r+4>>2])},Jc:function(e,r){$r.vertexAttrib3f(e,j[r>>2],j[r+4>>2],j[r+8>>2])},Kc:function(e,r){$r.vertexAttrib4f(e,j[r>>2],j[r+4>>2],j[r+8>>2],j[r+12>>2])},kc:function(e,r){$r.vertexAttribDivisor(e,r)},lc:function(e,r,t,n,a){$r.vertexAttribIPointer(e,r,t,n,a)},Lc:function(e,r,t,n,a,i){$r.vertexAttribPointer(e,r,t,!!n,a,i)},Mc:function(e,r,t,n){$r.viewport(e,r,t,n)},ab:function(e,r,t,n){$r.waitSync(cr.syncs[e],r,fr(t,n))},zb:wr,d:function(e,r){return function(e,r){throw Hr(e,r||1),"longjmp"}(e,r)},jb:function(e,r,t){E.copyWithin(e,r,r+t)},y:function(e,r){return requestAnimationFrame((function(t){M.get(e)(t,r)}))},kb:function(e){var r,t=E.length,n=2147483648;if(e>n)return!1;for(var a=1;a<=4;a*=2){var i=t*(1+.2/a);if(i=Math.min(i,e+100663296),_r(Math.min(n,((r=Math.max(e,i))%65536>0&&(r+=65536-r%65536),r))))return!0}return!1},yb:function(e,r,t,n,a){var i=e+112,o=y(i),u=A[i+36>>2],s=A[i+40>>2],c=A[i+44>>2],f=A[i+48>>2],l=A[i+52>>2],d=!!(4&l),m=!!(32&l),p=!!(16&l),v=function(e,t,n){Er((function(){u?M.get(u)(e):r&&r(e)}))},h=function(e,r,t){Er((function(){c?M.get(c)(e):n&&n(e)}))},g=function(e,r,n){Er((function(){s?M.get(s)(e):t&&t(e)}))},b=function(e,r,t){Er((function(){f?M.get(f)(e):a&&a(e)}))},_=function(e,t,n){Pr(xr.dbInstance,e,t.response,(function(e,t,n){Er((function(){u?M.get(u)(e):r&&r(e)}))}),(function(e,t,n){Er((function(){u?M.get(u)(e):r&&r(e)}))}))};if("EM_IDB_STORE"===o){var x=A[i+84>>2];Pr(xr.dbInstance,e,E.slice(x,x+A[i+88>>2]),v,g)}else if("EM_IDB_DELETE"===o)!function(e,r,t,n){if(e){var a=A[r+112+64>>2];a||(a=A[r+8>>2]);var i=y(a);try{var o=e.transaction(["FILES"],"readwrite").objectStore("FILES").delete(i);o.onsuccess=function(e){var n=e.target.result;A[r+12>>2]=0,xr.setu64(r+16,0),xr.setu64(r+24,0),xr.setu64(r+32,0),T[r+40>>1]=4,T[r+42>>1]=200,w("OK",r+44,64),t(r,0,n)},o.onerror=function(e){T[r+40>>1]=4,T[r+42>>1]=404,w("Not Found",r+44,64),n(r,0,e)}}catch(e){n(r,0,e)}}else n(r,0,"IndexedDB not available!")}(xr.dbInstance,e,v,g);else if(p){if(m)return 0;Cr(e,d?_:v,g,h,b)}else!function(e,r,t,n){if(e){var a=A[r+112+64>>2];a||(a=A[r+8>>2]);var i=y(a);try{var o=e.transaction(["FILES"],"readonly").objectStore("FILES").get(i);o.onsuccess=function(e){if(e.target.result){var a=e.target.result,i=a.byteLength||a.length,o=Mr(i);E.set(new Uint8Array(a),o),A[r+12>>2]=o,xr.setu64(r+16,i),xr.setu64(r+24,0),xr.setu64(r+32,i),T[r+40>>1]=4,T[r+42>>1]=200,w("OK",r+44,64),t(r,0,a)}else T[r+40>>1]=4,T[r+42>>1]=404,w("Not Found",r+44,64),n(r,0,"no data")},o.onerror=function(e){T[r+40>>1]=4,T[r+42>>1]=404,w("Not Found",r+44,64),n(r,0,e)}}catch(e){n(r,0,e)}}else n(r,0,"IndexedDB not available!")}(xr.dbInstance,e,v,m?g:d?function(e,r,t){Cr(e,_,g,h,b)}:function(e,r,t){Cr(e,v,g,h,b)});return e},fb:function(e){return cr.makeContextCurrent(e)?0:-5},nb:function(e,r){var t=0;return Sr().forEach((function(n,a){var i=r+t;S[e+4*a>>2]=i,function(e,r,t){for(var n=0;n<e.length;++n)C[r++>>0]=e.charCodeAt(n);C[r>>0]=0}(n,i),t+=n.length+1})),0},pb:function(e,r){var t=Sr();S[e>>2]=t.length;var n=0;return t.forEach((function(e){n+=e.length+1})),S[r>>2]=n,0},v:function(e){return 0},mb:function(e,r){var t=1==e||2==e?2:J();return C[r>>0]=t,0},ib:function(e,r,t,n,a,i){var o=te.getStreamFromFD(e),u=te.doReadv(o,r,t,n);return S[i>>2]=u,0},qb:function(e,r,t,n){var a=te.getStreamFromFD(e),i=te.doReadv(a,r,t);return S[n>>2]=i,0},hb:function(e,r,t,n,a){},F:function(e,r,t,n){for(var a=0,i=0;i<t;i++){for(var o=S[r+8*i>>2],u=S[r+(8*i+4)>>2],s=0;s<u;s++)te.printChar(e,E[o+s]);a+=u}return S[n>>2]=a,0},a:function(){return 0|p},eb:function(e,r){$r.bindFramebuffer(e,cr.framebuffers[r])},bb:function(e){$r.clear(e)},db:function(e,r,t,n){$r.clearColor(e,r,t,n)},cb:function(e){$r.clearStencil(e)},B:function(e,r){mr(e,r,0)},h:function(e,r){var t=Vr();try{return M.get(e)(r)}catch(e){if(Yr(t),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},p:function(e,r,t){var n=Vr();try{return M.get(e)(r,t)}catch(e){if(Yr(n),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},e:function(e,r,t,n){var a=Vr();try{return M.get(e)(r,t,n)}catch(e){if(Yr(a),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},r:function(e,r,t,n,a){var i=Vr();try{return M.get(e)(r,t,n,a)}catch(e){if(Yr(i),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},Db:function(e,r,t,n,a,i,o){var u=Vr();try{return M.get(e)(r,t,n,a,i,o)}catch(e){if(Yr(u),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},N:function(e,r,t,n,a,i,o,u,s,c){var f=Vr();try{return M.get(e)(r,t,n,a,i,o,u,s,c)}catch(e){if(Yr(f),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},M:function(e){var r=Vr();try{M.get(e)()}catch(e){if(Yr(r),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},m:function(e,r){var t=Vr();try{M.get(e)(r)}catch(e){if(Yr(t),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},k:function(e,r,t){var n=Vr();try{M.get(e)(r,t)}catch(e){if(Yr(n),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},j:function(e,r,t,n){var a=Vr();try{M.get(e)(r,t,n)}catch(e){if(Yr(a),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},l:function(e,r,t,n,a){var i=Vr();try{M.get(e)(r,t,n,a)}catch(e){if(Yr(i),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},Hb:function(e,r,t,n,a,i){var o=Vr();try{M.get(e)(r,t,n,a,i)}catch(e){if(Yr(o),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},Eb:function(e,r,t,n,a,i,o){var u=Vr();try{M.get(e)(r,t,n,a,i,o)}catch(e){if(Yr(u),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},Fb:function(e,r,t,n,a,i,o,u,s,c){var f=Vr();try{M.get(e)(r,t,n,a,i,o,u,s,c)}catch(e){if(Yr(f),e!==e+0&&"longjmp"!==e)throw e;Hr(1,0)}},b:function(e){p=0|e},lb:function(e,r,t,n){return function(e,r,t,n){var a=S[n+40>>2],i={tm_sec:S[n>>2],tm_min:S[n+4>>2],tm_hour:S[n+8>>2],tm_mday:S[n+12>>2],tm_mon:S[n+16>>2],tm_year:S[n+20>>2],tm_wday:S[n+24>>2],tm_yday:S[n+28>>2],tm_isdst:S[n+32>>2],tm_gmtoff:S[n+36>>2],tm_zone:a?y(a):""},o=y(t),u={"%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 s in u)o=o.replace(new RegExp(s,"g"),u[s]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function l(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length<r;)n=t[0]+n;return n}function d(e,r){return l(e,r,"0")}function m(e,r){function t(e){return e<0?-1:e>0?1:0}var n;return 0===(n=t(e.getFullYear()-r.getFullYear()))&&0===(n=t(e.getMonth()-r.getMonth()))&&(n=t(e.getDate()-r.getDate())),n}function p(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function v(e){var r=Dr(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),a=p(t),i=p(n);return m(a,r)<=0?m(i,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var h={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return f[e.tm_mon].substring(0,3)},"%B":function(e){return f[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return l(e.tm_mday,2," ")},"%g":function(e){return v(e).toString().substring(2)},"%G":function(e){return v(e)},"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),d(r,2)},"%j":function(e){return d(e.tm_mday+jr(Ar(e.tm_year+1900)?Ir:kr,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var r=new Date(e.tm_year+1900,0,1),t=0===r.getDay()?r:Dr(r,7-r.getDay()),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(m(t,n)<0){var a=jr(Ar(n.getFullYear())?Ir:kr,n.getMonth()-1)-31,i=31-t.getDate()+a+n.getDate();return d(Math.ceil(i/7),2)}return 0===m(t,r)?"01":"00"},"%V":function(e){var r,t=new Date(e.tm_year+1900,0,4),n=new Date(e.tm_year+1901,0,4),a=p(t),i=p(n),o=Dr(new Date(e.tm_year+1900,0,1),e.tm_yday);return m(o,a)<0?"53":m(i,o)<=0?"01":(r=a.getFullYear()<e.tm_year+1900?e.tm_yday+32-a.getDate():e.tm_yday+1-a.getDate(),d(Math.ceil(r/7),2))},"%w":function(e){return e.tm_wday},"%W":function(e){var r=new Date(e.tm_year,0,1),t=1===r.getDay()?r:Dr(r,0===r.getDay()?1:7-r.getDay()+1),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(m(t,n)<0){var a=jr(Ar(n.getFullYear())?Ir:kr,n.getMonth()-1)-31,i=31-t.getDate()+a+n.getDate();return d(Math.ceil(i/7),2)}return 0===m(t,r)?"01":"00"},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var r=e.tm_gmtoff,t=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(t?"+":"-")+String("0000"+r).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var s in h)o.indexOf(s)>=0&&(o=o.replace(new RegExp(s,"g"),h[s](i)));var g,w,x,E=(w=_(g=o)+1,b(g,x=new Array(w),0,x.length),x);return E.length>r?0:(function(e,r){C.set(e,r)}(E,e),E.length-1)}(e,r,t,n)}},Mr=(function(){var e={a:Wr};function r(e,r){var t,n=e.exports;a.asm=n,W((m=a.asm.cd).buffer),M=a.asm.fd,t=a.asm.dd,R.unshift(t),q()}function t(e){r(e.instance)}function i(r){return(d||"function"!=typeof fetch?Promise.resolve().then((function(){return Z(Q)})):fetch(Q,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+Q+"'";return e.arrayBuffer()})).catch((function(){return Z(Q)}))).then((function(r){return WebAssembly.instantiate(r,e)})).then(r,(function(e){l("failed to asynchronously prepare wasm: "+e),J(e)}))}if(z(),a.instantiateWasm)try{return a.instantiateWasm(e,r)}catch(e){return l("Module.instantiateWasm callback failed with error: "+e),!1}(d||"function"!=typeof WebAssembly.instantiateStreaming||K(Q)||"function"!=typeof fetch?i(t):fetch(Q,{credentials:"same-origin"}).then((function(r){return WebAssembly.instantiateStreaming(r,e).then(t,(function(e){return l("wasm streaming compile failed: "+e),l("falling back to ArrayBuffer instantiation"),i(t)}))}))).catch(n)}(),a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.dd).apply(null,arguments)},a._malloc=function(){return(Mr=a._malloc=a.asm.ed).apply(null,arguments)}),Ur=a._memset=function(){return(Ur=a._memset=a.asm.gd).apply(null,arguments)},Rr=a._free=function(){return(Rr=a._free=a.asm.hd).apply(null,arguments)},Gr=a.___errno_location=function(){return(Gr=a.___errno_location=a.asm.id).apply(null,arguments)},Nr=a.___getTypeName=function(){return(Nr=a.___getTypeName=a.asm.jd).apply(null,arguments)},Vr=(a.___embind_register_native_and_builtin_types=function(){return(a.___embind_register_native_and_builtin_types=a.asm.kd).apply(null,arguments)},a.stackSave=function(){return(Vr=a.stackSave=a.asm.ld).apply(null,arguments)}),Yr=a.stackRestore=function(){return(Yr=a.stackRestore=a.asm.md).apply(null,arguments)},Hr=a._setThrew=function(){return(Hr=a._setThrew=a.asm.nd).apply(null,arguments)},zr=a._memalign=function(){return(zr=a._memalign=a.asm.od).apply(null,arguments)};function qr(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Jr(e){function r(){Br||(Br=!0,a.calledRun=!0,v||(ee(R),ee(G),t(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),function(){if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)e=a.postRun.shift(),N.unshift(e);var e;ee(N)}()))}e=e||u,V>0||(function(){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)e=a.preRun.shift(),U.unshift(e);var e;ee(U)}(),V>0||(a.setStatus?(a.setStatus("Running..."),setTimeout((function(){setTimeout((function(){a.setStatus("")}),1),r()}),1)):r()))}if(a.dynCall_ji=function(){return(a.dynCall_ji=a.asm.pd).apply(null,arguments)},a.dynCall_iiji=function(){return(a.dynCall_iiji=a.asm.qd).apply(null,arguments)},a.dynCall_iijjiii=function(){return(a.dynCall_iijjiii=a.asm.rd).apply(null,arguments)},a.dynCall_iij=function(){return(a.dynCall_iij=a.asm.sd).apply(null,arguments)},a.dynCall_vijjjii=function(){return(a.dynCall_vijjjii=a.asm.td).apply(null,arguments)},a.dynCall_iiiji=function(){return(a.dynCall_iiiji=a.asm.ud).apply(null,arguments)},a.dynCall_viji=function(){return(a.dynCall_viji=a.asm.vd).apply(null,arguments)},a.dynCall_vijiii=function(){return(a.dynCall_vijiii=a.asm.wd).apply(null,arguments)},a.dynCall_viiiiij=function(){return(a.dynCall_viiiiij=a.asm.xd).apply(null,arguments)},a.dynCall_viijii=function(){return(a.dynCall_viijii=a.asm.yd).apply(null,arguments)},a.dynCall_jii=function(){return(a.dynCall_jii=a.asm.zd).apply(null,arguments)},a.dynCall_iiij=function(){return(a.dynCall_iiij=a.asm.Ad).apply(null,arguments)},a.dynCall_iiiij=function(){return(a.dynCall_iiiij=a.asm.Bd).apply(null,arguments)},a.dynCall_viij=function(){return(a.dynCall_viij=a.asm.Cd).apply(null,arguments)},a.dynCall_viiij=function(){return(a.dynCall_viiij=a.asm.Dd).apply(null,arguments)},a.dynCall_vij=function(){return(a.dynCall_vij=a.asm.Ed).apply(null,arguments)},a.dynCall_jiiiiji=function(){return(a.dynCall_jiiiiji=a.asm.Fd).apply(null,arguments)},a.dynCall_jiiiiii=function(){return(a.dynCall_jiiiiii=a.asm.Gd).apply(null,arguments)},a.dynCall_iijj=function(){return(a.dynCall_iijj=a.asm.Hd).apply(null,arguments)},a.dynCall_jiji=function(){return(a.dynCall_jiji=a.asm.Id).apply(null,arguments)},a.dynCall_iiiiij=function(){return(a.dynCall_iiiiij=a.asm.Jd).apply(null,arguments)},a.dynCall_iiiiijj=function(){return(a.dynCall_iiiiijj=a.asm.Kd).apply(null,arguments)},a.dynCall_iiiiiijj=function(){return(a.dynCall_iiiiiijj=a.asm.Ld).apply(null,arguments)},a.GL=cr,H=function e(){Br||Jr(),Br||(H=e)},a.run=Jr,a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);a.preInit.length>0;)a.preInit.pop()();return Jr(),e.ready});e.exports=t}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SketchWebContext.d.ts","sourceRoot":"","sources":["../../../src/ts/react/SketchWebContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACrD,OAAc,EAEZ,EAAE,EAOH,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAA;AAI7D,aAAK,QAAQ,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAA;AAajD,eAAO,MAAM,mBAAmB,sBAQ/B,CAAA;
|
|
1
|
+
{"version":3,"file":"SketchWebContext.d.ts","sourceRoot":"","sources":["../../../src/ts/react/SketchWebContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACrD,OAAc,EAEZ,EAAE,EAOH,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAA;AAI7D,aAAK,QAAQ,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAA;AAajD,eAAO,MAAM,mBAAmB,sBAQ/B,CAAA;AA4BD,eAAO,MAAM,mBAAmB;4BAxBF,QAAQ,KAAK,IAAI;qBACxB,MAAM,KAAK,IAAI;aACvB,MAAM,IAAI;oBACH,MAAM,KAAK,IAAI;mBAChB,MAAM,IAAI;mBACV,MAAM,IAAI;kBACX;QACZ,CAAC,EAAE,MAAM,CAAA;QACT,CAAC,EAAE,MAAM,CAAA;QACT,qBAAqB,CAAC,EAAE,OAAO,CAAA;KAChC,KAAK,IAAI;eACC,MAAM,IAAI;uBACF,MAAM,IAAI;yBACR,MAAM,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;+BAC/B,MAAM,KAAK,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;0BAElE,MAAM,KACN,MAAM;WACO,MAAM;WAAK,MAAM;;wCACC,OAAO,KAAK,IAAI;CAazD,CAAA;AAMD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;QAQ9B,CAAA;AAID,eAAO,MAAM,gBAAgB,qBAQ5B,CAAA;AAMD,eAAO,MAAM,eAAe;OAHrB,MAAM;OAAK,MAAM;QAWvB,CAAA;AAMD,eAAO,MAAM,+BAA+B,qBAU3C,CAAA;AAMD,eAAO,MAAM,gCAAgC,qBAU5C,CAAA;AAED,eAAO,MAAM,+BAA+B,aAAc,MAAM,IAAI,SASnE,CAAA;AAMD,eAAO,MAAM,kBAAkB,gDAQ9B,CAAA;AAED,eAAO,MAAM,yBAAyB,wBACf,gBAAgB,EAAE,KAAK,IAAI,SAUjD,CAAA;AAED,eAAO,MAAM,6BAA6B,oBACvB,MAAM,QAAQ,2BAA2B,KAAK,IAAI,SAUpE,CAAA;AAED,eAAO,MAAM,uBAAuB,sBAAuB,MAAM,KAAK,IAAI,SASzE,CAAA;AAuHD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB,EAAE,EA4Q/B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SketchWebReact.d.ts","sourceRoot":"","sources":["../../../src/ts/react/SketchWebReact.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAA;AAOtD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAI5C,aAAK,cAAc,GAAG,IAAI,CACxB,eAAe,EACf,UAAU,GAAG,WAAW,GAAG,QAAQ,CACpC,GACC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,GAAG;IAC3C,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAA;IAC5E,mBAAmB,CAAC,EAAE,CACpB,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAC/C,IAAI,CAAA;CACV,CAAA;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"SketchWebReact.d.ts","sourceRoot":"","sources":["../../../src/ts/react/SketchWebReact.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAA;AAOtD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAI5C,aAAK,cAAc,GAAG,IAAI,CACxB,eAAe,EACf,UAAU,GAAG,WAAW,GAAG,QAAQ,CACpC,GACC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,GAAG;IAC3C,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAA;IAC5E,mBAAmB,CAAC,EAAE,CACpB,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAC/C,IAAI,CAAA;CACV,CAAA;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,cAAc,CAkG7C,CAAA"}
|
|
@@ -60,6 +60,7 @@ export declare class GestureManager extends EventEmitter<GestureManagerEvents> {
|
|
|
60
60
|
y: number;
|
|
61
61
|
};
|
|
62
62
|
setMouse(x: number, y: number): void;
|
|
63
|
+
setIsCameraLocked(lockCamera: boolean): void;
|
|
63
64
|
getMinZoomLevel(): number;
|
|
64
65
|
getMaxZoomLevel(): number;
|
|
65
66
|
dispose(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GestureManager.d.ts","sourceRoot":"","sources":["../../../src/ts/utils/GestureManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAK7C,UAAU,oBAAoB;IAC5B,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IACrE,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACnD,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,WAAW,EAAE,MAAM,IAAI,CAAA;CACxB;AAMD,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED,qBAAa,cAAe,SAAQ,YAAY,CAAC,oBAAoB,CAAC;IACpE,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,kBAAkB,CAA2B;IACrD,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,iBAAiB,CAAmB;IAE5C,OAAO,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"GestureManager.d.ts","sourceRoot":"","sources":["../../../src/ts/utils/GestureManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAK7C,UAAU,oBAAoB;IAC5B,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IACrE,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACnD,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,WAAW,EAAE,MAAM,IAAI,CAAA;CACxB;AAMD,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED,qBAAa,cAAe,SAAQ,YAAY,CAAC,oBAAoB,CAAC;IACpE,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,kBAAkB,CAA2B;IACrD,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,iBAAiB,CAAmB;IAE5C,OAAO,CAAC,KAAK,CAWZ;gBAEW,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,sBAAsB;IAajE,kBAAkB;IAIlB,YAAY;IAoFZ,OAAO,CAAC,kBAAkB,CAMzB;IAED,OAAO,CAAC,mBAAmB,CAgB1B;IAED,OAAO,CAAC,gBAAgB,CAEvB;IAED;;;OAGG;IACH,yBAAyB,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG;QACrD,CAAC,EAAE,MAAM,CAAA;QACT,CAAC,EAAE,MAAM,CAAA;KACV;IAqBD;;OAEG;IACH,mBAAmB,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU;IAM9C,OAAO,CAAC,iBAAiB,CAoBxB;IAED,OAAO,CAAC,iBAAiB,CAIxB;IAED,OAAO,CAAC,aAAa,CA4BpB;IAED;;;OAGG;IACH,OAAO,CAAC,iBAAiB,CAsCxB;IAED,OAAO,CAAC,gBAAgB,CAEC;IAEzB,OAAO,CAAC,YAAY,CAEnB;IAED,OAAO,CAAC,eAAe,CAYtB;IAED,OAAO,CAAC,gBAAgB,CA2BvB;IAED,OAAO,CAAC,qBAAqB,CAE5B;IAED,OAAO,CAAC,mBAAmB,CAE1B;IAEM,QAAQ;;;;IAIR,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAM7B,iBAAiB,CAAC,UAAU,EAAE,OAAO;IAIrC,eAAe,IAAI,MAAM;IAIzB,eAAe,IAAI,MAAM;IAIzB,OAAO;CAIf"}
|