@sketch-hq/sketch-web-renderer 3.1.0 → 3.1.3
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 +20 -0
- package/dist/featureFlags.d.ts +1 -0
- package/dist/featureFlags.d.ts.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- 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-076a12afe5f111b57e6c.chunk.js +1 -0
- package/dist/static/js/web-renderer-148f39e38ee433dd320b.chunk.js +1 -0
- package/dist/static/js/web-renderer-c958f2d136a8510882fe.chunk.js +1 -0
- package/dist/ts/Manager.d.ts +4 -1
- package/dist/ts/Manager.d.ts.map +1 -1
- package/dist/ts/SketchWeb.d.ts +5 -4
- package/dist/ts/SketchWeb.d.ts.map +1 -1
- package/dist/ts/react/SketchWebReact.d.ts +1 -1
- package/dist/ts/react/SketchWebReact.d.ts.map +1 -1
- package/dist/ts/types/WASM.d.ts +3 -4
- package/dist/ts/types/WASM.d.ts.map +1 -1
- package/dist/ts/utils/GestureManager/GestureManager.d.ts +1 -0
- package/dist/ts/utils/GestureManager/GestureManager.d.ts.map +1 -1
- package/dist/ts/utils/misc.d.ts +5 -0
- package/dist/ts/utils/misc.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/static/js/web-renderer-0436efc4f1a295e21917.chunk.js +0 -1
- package/dist/static/js/web-renderer-2e332139ad6362ca8caf.chunk.js +0 -1
- package/dist/static/js/web-renderer-cb6fadbffa1500a435d4.chunk.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @sketch-hq/sketch-web-renderer
|
|
2
2
|
|
|
3
|
+
## 3.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- de01e61: Both touch and mouse events listeners are attached, so mouse inputs can continue to work on devices having both a touchscreen and mouse
|
|
8
|
+
|
|
9
|
+
## 3.1.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 9376f7f: Correctly calculate cache budget
|
|
14
|
+
- 5d3ed4e: Start using new tiling system. Now the canvas should look sharper.
|
|
15
|
+
- 8f522ed: Allow to change feature flags during initialisation
|
|
16
|
+
|
|
17
|
+
## 3.1.1
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- fd7739c: Touch events are not captured anymore and touchmove is not prevented
|
|
22
|
+
|
|
3
23
|
## 3.1.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
package/dist/featureFlags.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featureFlags.d.ts","sourceRoot":"","sources":["../src/featureFlags.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,QAAA,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"featureFlags.d.ts","sourceRoot":"","sources":["../src/featureFlags.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,QAAA,MAAM,YAAY;;;;;;CAQjB,CAAA;AAED,eAAe,YAAY,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { Manager } from './ts/Manager';
|
|
2
2
|
export default Manager;
|
|
3
|
+
export declare const DefaultFeatureFlags: {
|
|
4
|
+
delayedDraw: boolean;
|
|
5
|
+
useNewTiledRenderer: boolean;
|
|
6
|
+
offscreenCanvas: boolean;
|
|
7
|
+
safariWebGL2: boolean;
|
|
8
|
+
pageBoundariesLimit: boolean;
|
|
9
|
+
};
|
|
3
10
|
export * from './ts/SketchWeb';
|
|
4
11
|
export * from './ts/types/Events';
|
|
5
12
|
export * from './ts/types/Status';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,eAAe,OAAO,CAAA;AACtB,eAAO,MAAM,mBAAmB;;;;;;CAAe,CAAA;AAE/C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("react-dom"),require("styled-components"));else if("function"==typeof define&&define.amd)define(["react","react-dom","styled-components"],t);else{var n="object"==typeof exports?t(require("react"),require("react-dom"),require("styled-components")):t(e.react,e["react-dom"],e["styled-components"]);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,(function(e,t,n){return(()=>{var o,r,i,a,s={519:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={delayedDraw:!0,offscreenCanvas:!1,safariWebGL2:!1,pageBoundariesLimit:!1}},946:(e,t,n)=>{"use strict";n.d(t,{d:()=>B});var o,r=n(354),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,zooming:!1,pinchToZoomLastDistance:0,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.emitZoomStartEvent())},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.emitZoomEvent(t,o.state.zoomCenter,!1),o.cameraMoveTracker.handleCameraMoveEvent()}},o.handleGestureEnd=function(e){e.preventDefault(),o.emitZoomEndEvent()},o.handlePointerDown=function(e){(e instanceof MouseEvent&&0===e.button||(0,a.z6)(e))&&(e.preventDefault(),o.updateMousePosition(e),o.handlePanStart(),o.handleTouchPinchToZoomStart(e),o.emit("mousedown"))},o.handlePanStart=function(){o.state.panning=!0,o.state.lastPan.x=o.state.mouse.x,o.state.lastPan.y=o.state.mouse.y},o.handleTouchPinchToZoomStart=function(e){var t;if(e.touches&&!((null===(t=e.touches)||void 0===t?void 0:t.length)<2)){o.emitZoomStartEvent();var n=e.touches[0],r=e.touches[1];o.state.pinchToZoomLastDistance=Math.hypot(n.clientX-r.clientX,n.clientY-r.clientY)}},o.handlePointerMove=function(e){(0,a.z6)(e)&&o.handleTouchPinchToZoomChange(e),o.state.panning||o.updateMousePosition(e)},o.handleTouchPinchToZoomChange=function(e){var t;if(e.touches&&!((null===(t=e.touches)||void 0===t?void 0:t.length)<2)){var n=e.touches[0],r=e.touches[1],i=Math.hypot(n.clientX-r.clientX,n.clientY-r.clientY),a={x:(n.clientX+r.clientX)/2,y:(n.clientY+r.clientY)/2},s=i/Math.max(o.state.pinchToZoomLastDistance,1);o.state.pinchToZoomLastDistance=i,o.emitZoomEvent(s,a,!1)}},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){var t;o.handleTouchPinchToZoomEnd(e),(null===(t=e.touches)||void 0===t?void 0:t.length)>1||o.emit("mouseup")},o.handleTouchPinchToZoomEnd=function(e){var t;(null===(t=e.touches)||void 0===t?void 0:t.length)>2||o.emitZoomEndEvent()},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.emitZoomEvent(r,o.state.zoomCenter)}else o.emit("panChange",-e.deltaX,-e.deltaY);o.cameraMoveTracker.handleCameraMoveEvent()}},o.emitZoomEndEvent=(0,a.Ds)((function(){o.state.zooming&&(o.state.zooming=!1,o.emit("zoomEnd"))}),90),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(){(0,a.b1)()?this.addTouchEventListeners():this.addMouseEventListeners(),this.addSafariGesturesEventListeners()},t.prototype.addMouseEventListeners=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)},t.prototype.addTouchEventListeners=function(){this.listenersCollector.add(this.target,"touchstart",this.handlePointerDown,{capture:!0}),this.listenersCollector.add(document,"touchmove",this.handlePanMove,{capture:!0,passive:!0}),this.listenersCollector.add(this.target,"touchmove",this.handlePointerMove,{capture:!0,passive:!0}),this.listenersCollector.add(this.target,"touchend",this.handlePointerUp,{capture:!0}),this.listenersCollector.add(this.target,"touchcancel",this.handlePointerUp,{capture:!0}),this.listenersCollector.add(document,"touchend",this.handlePanEnd,{capture:!0}),this.listenersCollector.add(this.target,"touchend",this.handleDoubleClick,{capture:!0})},t.prototype.addSafariGesturesEventListeners=function(){(0,a.b1)()||(this.listenersCollector.add(this.target,"gesturestart",this.handleGestureStart,{capture:!0}),this.listenersCollector.add(this.target,"gesturechange",this.handleGestureChange,{capture:!0}),this.listenersCollector.add(this.target,"gestureend",this.handleGestureEnd,{capture:!0}))},t.prototype.getCorrectPointerPosition=function(e){var t,n=(0,a.MP)(e);if((null===(t=e.touches)||void 0===t?void 0:t.length)>1){var o=e,r=o.touches[0],i=o.touches[1],s={x:(r.clientX+i.clientX)/2,y:(r.clientY+i.clientY)/2};n.x=s.x,n.y=s.y}var u={x:0,y:0};return u.x=(0,a.uZ)(n.x-this.targetBounds.x,0,this.target.clientWidth),u.y=(0,a.uZ)(n.y-this.targetBounds.y,0,this.target.clientHeight),u},t.prototype.updateMousePosition=function(e){this.state.mouse=this.getCorrectPointerPosition(e),this.emit("mousemove",this.state.mouse.x,this.state.mouse.y)},t.prototype.emitZoomEvent=function(e,t,n){void 0===n&&(n=!0),n&&this.emitZoomStartEvent(),this.emit("zoomChange",e,t),n&&this.emitZoomEndEvent()},t.prototype.emitZoomStartEvent=function(){this.state.zooming||(this.state.zooming=!0,this.emit("zoomStart"))},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"),g=e=>"object"==typeof e&&null!==e||"function"==typeof e,b=new Map([["proxy",{canHandle:e=>g(e)&&e[f],serialize(e){const{port1:t,port2:n}=new MessageChannel;return y(e,t),[n,[n]]},deserialize:e=>(e.start(),C(e))}],["throw",{canHandle:e=>g(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(L);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]]=L(o.data.value),u=!0;break;case"APPLY":u=n.apply(t,s);break;case"CONSTRUCT":u=M(new n(...s));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;y(e,n),u=W(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]=S(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 C(e,t){return P(e,[],t)}function k(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(k(o),i===p)return()=>O(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=O(e,{type:"GET",path:t.map((e=>e.toString()))}).then(L);return n.then.bind(n)}return P(e,[...t,i])},set(n,r,i){k(o);const[a,s]=S(i);return O(e,{type:"SET",path:[...t,r].map((e=>e.toString())),value:a},s).then(L)},apply(n,r,i){k(o);const a=t[t.length-1];if(a===v)return O(e,{type:"ENDPOINT"}).then(L);if("bind"===a)return P(e,t.slice(0,-1));const[s,u]=E(i);return O(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:s},u).then(L)},construct(n,r){k(o);const[i,a]=E(r);return O(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:i},a).then(L)}});return r}function E(e){const t=e.map(S);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const x=new WeakMap;function W(e,t){return x.set(e,t),e}function M(e){return Object.assign(e,{[f]:!0})}function S(e){for(const[t,n]of b)if(n.canHandle(e)){const[o,r]=n.serialize(e);return[{type:"HANDLER",name:t,value:o},r]}return[{type:"RAW",value:e},x.get(e)||[]]}function L(e){switch(e.type){case"HANDLER":return b.get(e.name).deserialize(e.value);case"RAW":return e.value}}function O(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,Z=n(849),D=n(519),T=n(332),z=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)}}(),j=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 z(t,e),t.prototype.addListeners=function(){this.listenersCollector.add(this.target,"keyup",this.handleKeyUp)},t.prototype.dispose=function(){this.listenersCollector.dispose()},t}(r.v),_=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)},A=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 B=function(e){function t(t){var n=e.call(this)||this;return n.listenersCollector=new i,n.handleZoomStart=function(){n.emit("zoomStart")},n.handleZoomEnd=function(){n.emit("zoomEnd")},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 A(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 A(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.handleCanvasResizeObserver=function(e){n.resizeCanvas(e[0].contentRect)},n.resizeCanvas=function(e){var t=e.width,o=e.height;window.requestAnimationFrame((function(){var e,r;n.setCanvasSize(t,o),n.gestureManager.updateTargetBounds(),null===(e=n.sketchWeb)||void 0===e||e.setPixelRatio(n.getDevicePixelRatio()),null===(r=n.sketchWeb)||void 0===r||r.setSize(t*n.getDevicePixelRatio(),o*n.getDevicePixelRatio())}))},n.settings=t,n.canvas=t.canvas,n.gestureManager=new l(n.settings.container,{minimumZoomLevel:t.minimumZoomLevel,maximumZoomLevel:t.maximumZoomLevel}),n.keyboardManager=new j(document.body),Z.Z.active=t.mode===T.p.debug,n.init(),n}return _(t,e),t.prototype.init=function(){var e;return A(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 A(this,void 0,void 0,(function(){var e,t,o,r,i;return G(this,(function(a){switch(a.label){case 0:return e=D.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,Z.Z.debug("Using offscreen canvas"),this.offscreenCanvas=this.canvas.transferControlToOffscreen(),this.worker=new Worker(new URL(n.p+n.u(285),n.b),{type:void 0}),o=C(this.worker),r=this,[4,new o(W(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,Z.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("fileReady",this.forwardEvent("fileReady")),i.on("metric",this.forwardEvent("metric")),i.on("warnings",this.forwardEvent("warnings")),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?M(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.handleCanvasResizeObserver),this.canvasResizeObserver.observe(this.settings.container),this.listenersCollector.add(window,"orientationchange",this.handleDeviceOrientationChange),this.gestureManager.on("panChange",this.handlePanChange),this.gestureManager.on("mousemove",this.handleMouseChange),this.gestureManager.on("zoomChange",this.handleZoomChange),this.gestureManager.on("zoomStart",this.handleZoomStart),this.gestureManager.on("zoomEnd",this.handleZoomEnd),this.gestureManager.on("cameraMoveStart",this.handleCameraMoveStart),this.gestureManager.on("cameraMoveEnd",this.handleCameraMoveEnd)},t.prototype.emitPanEvent=function(){var e;return A(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 A(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.handleDeviceOrientationChange=function(){this.resizeCanvas({width:this.settings.container.clientWidth,height:this.settings.container.clientHeight})},t.prototype.zoomToFit=function(){return A(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 A(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 A(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.getDocument=function(){var e;return null===(e=this.sketchWeb)||void 0===e?void 0:e.getDocument()},t.prototype.getArtboardAtPosition=function(e,t){var n;return A(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 A(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 A(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 A(this,void 0,void 0,(function(){return G(this,(function(r){switch(r.label){case 0:return this.gestureManager.dispose(),this.keyboardManager.dispose(),this.listenersCollector.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:()=>p});var o,r=n(419),i=n(519),a=n(354),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(){return(d=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)},f=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())}))},v=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])}}},p=(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,g=t.mode,b=t.showTilesBorders,y=void 0!==b&&b,w=t.minimumZoomLevel,C=t.maximumZoomLevel,k=t.preserveDrawingBuffer,P=void 0!==k&&k,E=t.panBoundariesPadding,x=void 0===E?40:E,W=e.call(this)||this;return W.status={type:"INIT"},W.handleWebGLContextLost=function(){W.setStatus({type:"WEBGL_CONTEXT_LOST"})},W.debouncedFullDraw=(0,r.Ds)((function(){return W.draw(!0)}),60),W.canvas=n,W.locateFile=o,W.filePath=i,W.imagesURLFormat=a,W.imagesURLMap=c,W.backgroundColor=d,W.highlightColor=v,W.size=p,W.pixelRatio=m,W.mode=g,W.showTilesBorders=y,W.currentWebGLVersion=(0,r.wX)(),W.zoomLevels={min:w,max:C},W.preserveDrawingBuffer=P,W.panBoundariesPadding=x,u.Z.active=g===l.p.debug,W.traceFirstPaint=new s.S("FirstPaint"),W}return h(t,e),t.prototype.init=function(){return f(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,5,,6]),[4,this.initSketchWebWasm()];case 2:return t.sent(),[4,this.setFile(this.filePath)];case 3:return t.sent(),[4,this.preloadImages()];case 4:return t.sent(),[3,6];case 5:return e=t.sent(),[2,this.fail(e instanceof c.k?e:new c.k("ERROR","Unexpected exception initializing the web renderer",e))];case 6:return[2]}}))}))},t.prototype.preloadImages=function(){var e=this;return new Promise((function(t){var n;null===(n=e.sketchWebWasm)||void 0===n||n.preloadImages((function(){t()}))}))},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),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 f(this,void 0,void 0,(function(){var e,t,o,r,a,h,d,f=this;return v(this,(function(v){switch(v.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=v.sent(),[3,4];case 2:return[4,n.e(816).then(n.t.bind(n,816,23))];case 3:t=v.sent(),v.label=4;case 4:o=t.default,v.label=5;case 5:return v.trys.push([5,7,,8]),r=this,[4,o({FeatureFlags:i.Z,currentWebGLVersion:this.currentWebGLVersion,locateFile:function(e){return f.locateFile.replace("{file}",e)},bridge:this.createJSBridge()})];case 6:return r.wasmModule=v.sent(),[3,8];case 7:throw a=v.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 f(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 f(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,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"}),t.emit("fileReady",t.getDocument()),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.getDocument=function(){if(!this.sketchWebWasm)return null;if(!this.cachedDocumentInfo||this.cachedDocumentInfo.filePath!==this.filePath){var e=this.sketchWebWasm.getPRFile();this.cachedDocumentInfo={filePath:this.filePath,document:d(d({},e),{artboards:(0,r.gi)(e.artboards)})}}return this.cachedDocumentInfo.document},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.dispose=function(){var e,t;try{null===(e=this.sketchWebWasm)||void 0===e||e.stopRenderLoop(),null===(t=this.sketchWebWasm)||void 0===t||t.delete(),this.looseWebGLContext(),this.sketchWebWasm=null,this.wasmModule=null}catch(e){this.fail(new c.k("ERROR","Unexpected exception while disposing the SketchWebWasm object",e))}},t}(a.v))},550:(e,t,n)=>{"use strict";n.d(t,{j4:()=>Te,aV:()=>ke,z0:()=>me,oW:()=>oe,jr:()=>O,tm:()=>_,ky:()=>M,zX:()=>Y,ex:()=>F,Jw:()=>B,m_:()=>U,Yy:()=>j,d6:()=>Z,aP:()=>R,EY:()=>N,pt:()=>G,od:()=>L,ph:()=>I,lt:()=>z,$z:()=>W,BO:()=>S,us:()=>A});var o=n(297),r=n.n(o),i=n(332),a=n(849),s=(0,o.createContext)(void 0),u=function(){var e=(0,o.useContext)(s);if(void 0===e)throw Error("useSketchWebInternalContext must be used within a SketchWebProvider");return e},c=n(419),l=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},h=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a.Z.debug.apply(a.Z,l(["SketchWebReact"],e))};function d(e){return(0,c.b1)()?{onTouchEnd:e}:{onClick:e}}var f,v,p,m,g,b,y=(0,o.createContext)(void 0),w=(0,o.createContext)(void 0),C=(0,o.createContext)(void 0),k=(0,o.createContext)(void 0),P=(0,o.createContext)(void 0),E=(0,o.createContext)(void 0),x=(0,o.createContext)(void 0),W=function(){var e=(0,o.useContext)(y);if(void 0===e)throw Error("useStatus must be used within a SketchWebProvider");return e},M=function(){var e=(0,o.useContext)(w);if(void 0===e)throw Error("useDocument must be used within a SketchWebProvider");return e},S=function(){var e=(0,o.useContext)(C);if(void 0===e)throw Error("useZoom must be used within a SketchWebProvider");return e},L=function(){var e=(0,o.useContext)(E);if(void 0===e)throw Error("usePan must be used within a SketchWebProvider");return e},O=function(){var e=(0,o.useContext)(x);if(void 0===e)throw Error("useCursor must be used within a SketchWebProvider");return e},R=function(){var e=(0,o.useContext)(k);if(void 0===status)throw Error("useIsCameraZooming must be used within a SketchWebProvider");return e},Z=function(){var e=(0,o.useContext)(P);if(void 0===status)throw Error("useIsCameraMoving must be used within a SketchWebProvider");return e},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())}))},T=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])}}},z=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t){h("setZoom",t),console.log(e),null==e||e.setZoom(t)}),[e])},j=function(){var e=z(),t=S();return(0,o.useCallback)((function(){var n;h("incrementZoom"),"number"==typeof t&&(n=t>=1?Math.round(2*t):t>.5?1:2*t,e(n))}),[e,t])},_=function(){var e=z(),t=S();return(0,o.useCallback)((function(){h("decrementZoom"),"number"==typeof t&&e(t/2)}),[e,t])},I=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t){var n=t.x,o=t.y,r=t.centerPointInViewport;h("setPan",n,o,"centerPointInViewport",r),null==e||e.setPan(n,o,r)}),[e])},A=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(){h("zoomToFit"),null==e||e.zoomToFit()}),[e])},G=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(){h("looseWebGLContext"),null==e||e.looseWebGLContext()}),[e])},F=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(){return D(void 0,void 0,void 0,(function(){return T(this,(function(t){switch(t.label){case 0:return h("generateDocumentPNG"),[4,null==e?void 0:e.generateDocumentPNG()];case 1:return[2,t.sent()]}}))}))}),[e])},B=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t,n){return D(void 0,void 0,void 0,(function(){return T(this,(function(o){switch(o.label){case 0:return h("getArtboardAtPosition",t,n),[4,null==e?void 0:e.getArtboardAtPosition(t,n)];case 1:return[2,o.sent()||null]}}))}))}),[e])},U=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t,n){return D(void 0,void 0,void 0,(function(){return T(this,(function(o){switch(o.label){case 0:return h("getPanAtPosition",t,n),[4,null==e?void 0:e.getPanAtPosition(t,n)];case 1:return[2,o.sent()||null]}}))}))}),[e])},N=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t){h("setIsCameraLocked",t),null==e||e.gestureManager.setIsCameraLocked(t)}),[e])},Y=function(e,t){var n=(0,u().getManager)();(0,o.useEffect)((function(){return null==n||n.on(e,t),function(){null==n||n.off(e,t)}}),[e,n,t])},X=n(268),H=n.n(X),V=n(914),q=n.n(V),J=(0,V.createGlobalStyle)(f||(p=["\n *:where(:not(iframe, canvas, img, svg, video):not(svg *, symbol *)) {\n all: unset;\n display: revert;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n"],m=["\n *:where(:not(iframe, canvas, img, svg, video):not(svg *, symbol *)) {\n all: unset;\n display: revert;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n"],Object.defineProperty?Object.defineProperty(p,"raw",{value:m}):p.raw=m,f=p)),K=function(){return(K=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)},$=(0,V.createGlobalStyle)(v||(v=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n ","\n"],["\n ","\n"])),(function(e){return e.injectedStyles})),Q=function(e){var t=e.children,n=e.injectedStyles,i=(0,o.useRef)(null),a=(0,o.useState)(null),s=a[0],u=a[1];return r().createElement("div",{ref:function(e){e&&(i.current=e,e.shadowRoot||u(e.attachShadow({mode:"open",delegatesFocus:!0})))},style:{position:"relative",width:"100%",height:"100%"}},s&&H().createPortal(r().createElement(V.StyleSheetManager,{target:s},r().createElement(r().Fragment,null,r().createElement(J,null),n&&r().createElement($,{injectedStyles:n}),t)),s))},ee=function(){return(ee=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)},te={position:"relative",width:"100%",height:"100%",touchAction:"manipulation"},ne={position:"absolute",top:0,left:0},oe=(g=function(e){a.Z.active=e.mode===i.p.debug;var t=e.filePath,n=e.locateFile,s=e.imagesURLFormat,c=e.imagesURLMap,l=e.backgroundColor,h=e.highlightColor,d=e.mode,f=e.showTilesBorders,v=e.minimumZoomLevel,p=e.maximumZoomLevel,m=e.preserveDrawingBuffer,g=e.panBoundariesPadding,b=e.initialPan,y=e.initialZoom,w=e.children,C=e.containerProps,k=void 0===C?{}:C,P=e.canvasProps,E=void 0===P?{}:P,x=(0,o.useRef)(null),M=(0,o.useRef)(null),S=(0,o.useState)(!1),L=S[0],R=S[1],Z=(0,o.useCallback)((function(){return R(!0)}),[]),D=u(),T=D.dispose,z=D.init,j=D.setSettings,_=O(),I=W();Y("allImagesReady",Z),(0,o.useEffect)((function(){j({locateFile:n,imagesURLFormat:s,imagesURLMap:c,backgroundColor:l,highlightColor:h,mode:d,showTilesBorders:f,minimumZoomLevel:v,maximumZoomLevel:p,preserveDrawingBuffer:m,panBoundariesPadding:g,initialPan:b,initialZoom:y})}),[j,n,s,c,l,h,d,f,v,p,m,g,b,y]),(0,o.useEffect)((function(){if(t)return z(t,x.current,M.current),function(){T()}}),[T,z,t]);var A=(0,o.useMemo)((function(){var t;return null!==(t=e.cursor)&&void 0!==t?t:_}),[e.cursor,_]),G=(0,o.useMemo)((function(){return ee(ee({},te),{cursor:A})}),[A]);return r().createElement("div",ee({},k,{ref:M,style:G}),t&&r().createElement("canvas",ee({},E,{key:t,ref:x,"data-sketchweb-all-images-ready":L,"data-testid":"sketchweb-canvas","data-sketchweb-status":"sketchweb-status-"+((null==I?void 0:I.type.toLowerCase())||"null"),style:ne})),"READY"===(null==I?void 0:I.type)&&w)},function(e){var t=e.injectedStyles,n=e.useShadowRoot,o=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["injectedStyles","useShadowRoot"]);return n?r().createElement(Q,{injectedStyles:t},r().createElement(g,K({},o))):r().createElement(g,K({},o))}),re=n(946);!function(e){e.Draggable="grab",e.Dragging="grabbing",e.Hover="pointer",e.Default="auto"}(b||(b={}));var ie,ae,se,ue,ce,le,he,de,fe=function(){return(fe=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)},ve=function(e,t){switch(h('dispatched: "'+t.type+'"',t),t.type){case"on-status":return fe(fe({},e),{status:t.status});case"on-file-ready":return fe(fe({},e),{document:t.document});case"on-zoom":return fe(fe({},e),{zoom:t.zoom});case"on-pan":return fe(fe({},e),{pan:t.pan});case"dispose":return fe(fe({},e),{status:null,zoom:null,pan:null,cursor:b.Default});case"post-init":return fe(fe({},e),{status:t.status,zoom:t.zoom});case"on-camera-zoom-start":return fe(fe({},e),{isCameraZooming:!0});case"on-camera-zoom-end":return fe(fe({},e),{isCameraZooming:!1});case"on-camera-move-start":return fe(fe({},e),{cursor:e.isMouseDown?b.Dragging:b.Draggable,isCameraMoving:!0});case"on-camera-move-end":return fe(fe({},e),{isCameraMoving:!1});case"on-mouse-down":return fe(fe({},e),{cursor:b.Dragging,isMouseDown:!0});case"on-mouse-up":return fe(fe({},e),{cursor:b.Draggable,isMouseDown:!1});default:return e}},pe=function(){return(pe=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)},me=function(e){var t=e.children,n=(0,o.useRef)(null),i=(0,o.useRef)(null),a=(0,o.useReducer)(ve,{pan:null,zoom:null,status:null,document:null,isCameraZooming:!1,isCameraMoving:!1,cursor:b.Default,isMouseDown:!1}),u=a[0],c=u.status,l=u.document,d=u.zoom,f=u.pan,v=u.isCameraZooming,p=u.isCameraMoving,m=u.cursor,g=a[1],W=(0,o.useCallback)((function(e){return g({type:"on-zoom",zoom:e})}),[]),M=(0,o.useCallback)((function(e,t){return g({type:"on-pan",pan:{x:e,y:t}})}),[]),S=(0,o.useCallback)((function(e){g({type:"on-status",status:e})}),[]),L=(0,o.useCallback)((function(e){g({type:"on-file-ready",document:e})}),[]),O=(0,o.useCallback)((function(){return g({type:"on-mouse-down"})}),[]),R=(0,o.useCallback)((function(){return g({type:"on-mouse-up"})}),[]),Z=(0,o.useCallback)((function(){return g({type:"on-camera-zoom-start"})}),[]),D=(0,o.useCallback)((function(){return g({type:"on-camera-zoom-end"})}),[]),T=(0,o.useCallback)((function(){return g({type:"on-camera-move-start"})}),[]),z=(0,o.useCallback)((function(){return g({type:"on-camera-move-end"})}),[]),j=(0,o.useCallback)((function(){var e=n.current;e&&(h("dispose"),e.off("status",S),e.off("fileReady",L),e.off("zoom",W),e.off("pan",M),e.gestureManager.off("mousedown",O),e.gestureManager.off("mouseup",R),e.gestureManager.off("zoomStart",Z),e.gestureManager.off("zoomEnd",D),e.gestureManager.off("cameraMoveStart",T),e.gestureManager.off("cameraMoveEnd",z),e.dispose(),n.current=null,g({type:"dispose"}))}),[S,L,M,W,R,O,Z,D,T,z]),_=(0,o.useCallback)((function(e,t,o){if(""!==e&&t&&o&&i.current){h("init");var r=new re.d(pe(pe({},i.current),{filePath:e,container:o,canvas:t}));r.on("status",S),r.on("fileReady",L),r.on("zoom",W),r.on("pan",M),r.gestureManager.on("mousedown",O),r.gestureManager.on("mouseup",R),r.gestureManager.on("zoomStart",Z),r.gestureManager.on("zoomEnd",D),r.gestureManager.on("cameraMoveStart",T),r.gestureManager.on("cameraMoveEnd",z),a=void 0,s=void 0,c=function(){var e,t;return 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])}}}(this,(function(n){switch(n.label){case 0:return e=g,t={type:"post-init"},[4,r.getZoom()];case 1:return t.zoom=n.sent()||null,[4,r.getStatus()];case 2:return t.status=n.sent()||null,[4,r.getPan()];case 3:return e.apply(void 0,[(t.pan=n.sent()||null,t)]),[2]}}))},new((u=void 0)||(u=Promise))((function(e,t){function n(e){try{r(c.next(e))}catch(e){t(e)}}function o(e){try{r(c.throw(e))}catch(e){t(e)}}function r(t){var r;t.done?e(t.value):(r=t.value,r instanceof u?r:new u((function(e){e(r)}))).then(n,o)}r((c=c.apply(a,s||[])).next())})),n.current=r}var a,s,u,c}),[S,L,W,M,O,R,Z,D,T,z]),I=(0,o.useCallback)((function(e){h("setSettings",e),i.current=e}),[]),A=(0,o.useCallback)((function(){return n.current}),[]),G=(0,o.useMemo)((function(){return{dispose:j,init:_,setSettings:I,getManager:A,dispatch:g}}),[j,_,I,A]);return r().createElement(s.Provider,{value:G},r().createElement(y.Provider,{value:c},r().createElement(w.Provider,{value:l},r().createElement(C.Provider,{value:d},r().createElement(E.Provider,{value:f},r().createElement(k.Provider,{value:v},r().createElement(P.Provider,{value:p},r().createElement(x.Provider,{value:m},t))))))))},ge=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},be=q().div(ie||(ie=ge(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n"]))),ye=q().div(ae||(ae=ge(["\n position: absolute;\n top: 0;\n left: 0;\n transform-origin: top left;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n transform-origin: top left;\n"]))),we=function(e){var t=e.document,n=e.children,o=L()||{x:0,y:0},i=S()||1,a=Z(),s=R();return r().createElement(ye,{style:{willChange:a?"transform, width, height":"",pointerEvents:a?"none":"auto",width:t.bounds.width*i+"px",height:t.bounds.height*i+"px",transform:"translate3d("+o.x*i+"px, "+o.y*i+"px, 0)",display:s?"none":"block"}},n)},Ce=function(){return(Ce=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)},ke=function(e){var t=e.children,n=e.onClick,o=M();return o?r().createElement(be,Ce({},d(n)),r().createElement(we,{document:o},t)):null},Pe=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Ee=q().div(se||(se=Pe(["\n position: absolute;\n box-sizing: border-box;\n cursor: pointer;\n\n // Just some default font styles\n font-size: 12px;\n font-style: normal;\n font-family: sans-serif;\n\n font: ",";\n\n ","\n"],["\n position: absolute;\n box-sizing: border-box;\n cursor: pointer;\n\n // Just some default font styles\n font-size: 12px;\n font-style: normal;\n font-family: sans-serif;\n\n font: ",";\n\n ","\n"])),(function(e){return e.font}),(function(e){return e.selected?"box-shadow: 0 0 0 4px "+e.outlineColor+";":"\n &:hover {\n box-shadow: 0 0 0 2px "+e.outlineColor+";\n }\n "})),xe=q().div(ue||(ue=Pe(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: auto;\n padding: 0 0 6px 0;\n transform: translateY(-100%);\n display: flex;\n pointer-events: none;\n visibility: ",";\n align-items: center;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: auto;\n padding: 0 0 6px 0;\n transform: translateY(-100%);\n display: flex;\n pointer-events: none;\n visibility: ",";\n align-items: center;\n"])),(function(e){return e.visible?"visible":"hidden"})),We=q().span(ce||(ce=Pe(["\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n user-select: none;\n pointer-events: auto;\n color: ",";\n"],["\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n user-select: none;\n pointer-events: auto;\n color: ",";\n"])),(function(e){return e.textColor})),Me=q().button(le||(le=Pe(["\n position: relative;\n white-space: nowrap;\n margin-right: 0;\n margin-left: auto;\n align-items: center;\n pointer-events: auto;\n display: ",";\n font: inherit;\n"],["\n position: relative;\n white-space: nowrap;\n margin-right: 0;\n margin-left: auto;\n align-items: center;\n pointer-events: auto;\n display: ",";\n font: inherit;\n"])),(function(e){return e.visible?"flex":"none"})),Se=q().span(he||(he=Pe(["\n color: ",";\n display: ",";\n font: inherit;\n"],["\n color: ",";\n display: ",";\n font: inherit;\n"])),(function(e){return e.textColor}),(function(e){return e.visible?"initial":"none"})),Le=q().span(de||(de=Pe(["\n position: relative;\n width: 14px;\n height: 14px;\n margin-left: 4px;\n"],["\n position: relative;\n width: 14px;\n height: 14px;\n margin-left: 4px;\n"])));function Oe(){return r().createElement(Le,null,r().createElement("svg",{viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},r().createElement("g",{fill:"none",fillRule:"evenodd"},r().createElement("path",{d:"M6.755 0h.49c1.55 0 2.708.278 3.686.801a5.452 5.452 0 0 1 2.268 2.268c.523.978.801 2.136.801 3.686v.49c0 1.55-.278 2.708-.801 3.686a5.452 5.452 0 0 1-2.268 2.268c-.978.523-2.136.801-3.686.801h-.49c-1.55 0-2.708-.278-3.686-.801A5.452 5.452 0 0 1 .801 10.93C.278 9.953 0 8.795 0 7.245v-.49c0-1.55.278-2.708.801-3.686A5.452 5.452 0 0 1 3.07.801C4.047.278 5.205 0 6.755 0Z",fillOpacity:".083",fill:"#000",fillRule:"nonzero"}),r().createElement("path",{strokeOpacity:".55",stroke:"#000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 9.5 10 7 7.5 4.5M8.5 7H4"}))))}var Re=function(){return(Re=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)},Ze=r().forwardRef((function(e,t){var n,i=e.document,a=e.artboard,s=e.selected,u=e.onClick,c=e.onDoubleClick,l=e.onCTAClick,h=e.font,f=e.outlineColor,v=e.nameTextColor,p=e.ctaTextColor,m=e.ctaText,g=null!==(n=S())&&void 0!==n?n:1,b=a.bounds.width*g,y=b>100,w=b>160,C=(0,o.useMemo)((function(){var e=a.bounds,t=i.bounds;return{x:(e.x-t.x)/t.width*100,y:(e.y-t.y)/t.height*100,width:e.width/t.width*100,height:e.height/t.height*100}}),[a.bounds,i.bounds]),k=C.x,P=C.y,E=C.width,x=C.height;return r().createElement(Ee,Re({ref:t,selected:s,font:h,outlineColor:f},d((function(e){null==u||u(a,e)})),{onDoubleClick:function(e){null==c||c(a,e)},style:{left:k+"%",top:P+"%",width:E+"%",height:x+"%"}}),r().createElement(xe,{visible:y},r().createElement(We,{textColor:v},a.name),r().createElement(Me,Re({visible:s},d((function(e){null==l||l(a,e)}))),r().createElement(Se,{textColor:p,visible:w},m),r().createElement(Oe,null))))}));Ze.displayName="Artboard";var De=function(){return(De=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)},Te=function(e){var t=e.artboardStyle,n=e.onGoToArtboard,i=M(),a=(0,o.useState)(null),s=a[0],u=a[1],c=(0,o.useRef)({});function l(e,t){u(e.objectId)}function h(e){null==n||n(e.objectId,"doubleClick")}function d(e){null==n||n(e.objectId,"CTA")}return(0,o.useEffect)((function(){function e(e){"Enter"===e.key&&s&&(null==n||n(s,"keyPressEnter"))}return window.document.body.addEventListener("keypress",e),function(){window.document.body.removeEventListener("keypress",e)}}),[n,s]),i?r().createElement(ke,{onClick:function(e){var t;for(var n in c.current)if(null===(t=c.current[n])||void 0===t?void 0:t.contains(e.target))return;u(null)}},i.artboards.map((function(e){return r().createElement(Ze,De({ref:function(t){return c.current[e.objectId]=t},key:e.objectId,selected:s===e.objectId,onClick:l,onDoubleClick:h,onCTAClick:d,artboard:e,document:i},t))}))):null}},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:()=>{},650:()=>{},312:()=>{},552:(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}()},354:(e,t,n)=>{"use strict";n.d(t,{v:()=>o.v});var o=n(552)},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,gi:()=>o.gi,Ds:()=>o.Ds,wX:()=>o.wX,b1:()=>o.b1});var o=n(388)},388:(e,t,n)=>{"use strict";n.d(t,{Ds:()=>i,MP:()=>a,uZ:()=>s,wX:()=>u,gi:()=>c,b1:()=>l,z6:()=>h});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,o,r,i,a,s,u;return{x:null!==(r=null!==(t=e.pageX)&&void 0!==t?t:null===(o=null===(n=e.touches)||void 0===n?void 0:n[0])||void 0===o?void 0:o.pageX)&&void 0!==r?r:e.clientX,y:null!==(u=null!==(i=e.pageY)&&void 0!==i?i:null===(s=null===(a=e.touches)||void 0===a?void 0:a[0])||void 0===s?void 0:s.pageY)&&void 0!==u?u: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}function c(e){for(var t=e.size(),n=[],o=0;o<t;++o){var r=e.get(o);n.push(r)}return n}function l(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function h(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent||void 0!==e.touches||void 0!==e.targetTouches||void 0!==e.changedTouches}},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},268:e=>{"use strict";e.exports=t},914:e=>{"use strict";e.exports=n}},u={};function c(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return s[e](n,n.exports,c),n.exports}c.m=s,c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);c.r(n);var i={};o=o||[null,r({}),r([]),r(r)];for(var a=2&t&&e;"object"==typeof a&&!~o.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,c.d(n,i),n},c.d=(e,t)=>{for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce(((t,n)=>(c.f[n](e,t),t)),[])),c.u=e=>"static/js/web-renderer-"+{285:"0436efc4f1a295e21917",425:"2e332139ad6362ca8caf",816:"cb6fadbffa1500a435d4"}[e]+".chunk.js",c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},a="@sketch-hq/sketch-web-renderer:",c.l=(e,t,n,o)=>{if(i[e])i[e].push(t);else{var r,s;if(void 0!==n)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var h=u[l];if(h.getAttribute("src")==e||h.getAttribute("data-webpack")==a+n){r=h;break}}r||(s=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,c.nc&&r.setAttribute("nonce",c.nc),r.setAttribute("data-webpack",a+n),r.src=e),i[e]=[t];var d=(t,n)=>{r.onerror=r.onload=null,clearTimeout(f);var o=i[e];if(delete i[e],r.parentNode&&r.parentNode.removeChild(r),o&&o.forEach((e=>e(n))),t)return t(n)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=d.bind(null,r.onerror),r.onload=d.bind(null,r.onload),s&&document.head.appendChild(r)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.p="/",(()=>{c.b=document.baseURI||self.location.href;var e={826:0};c.f.j=(t,n)=>{var o=c.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=c.p+c.u(t),a=new Error;c.l(i,(n=>{if(c.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,s]=n,u=0;if(i.some((t=>0!==e[t]))){for(o in a)c.o(a,o)&&(c.m[o]=a[o]);s&&s(c)}for(t&&t(n);u<i.length;u++)r=i[u],c.o(e,r)&&e[r]&&e[r][0](),e[i[u]]=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 l={};return(()=>{"use strict";c.r(l),c.d(l,{default:()=>f,SketchWeb:()=>t.U,SketchWebMode:()=>i.p,SketchWebError:()=>s.k,ArtboardsInfoOverlay:()=>d.j4,Overlay:()=>d.aV,SketchWebProvider:()=>d.z0,SketchWebReact:()=>d.oW,useCursor:()=>d.jr,useDecrementZoom:()=>d.tm,useDocument:()=>d.ky,useEvent:()=>d.zX,useGenerateDocumentPNG:()=>d.ex,useGetArtboardAtPosititon:()=>d.Jw,useGetPanAtPosition:()=>d.m_,useIncrementZoom:()=>d.Yy,useIsCameraMoving:()=>d.d6,useIsCameraZooming:()=>d.aP,useLockCamera:()=>d.EY,useLooseWebGLContext:()=>d.pt,usePan:()=>d.od,useSetPan:()=>d.ph,useSetZoom:()=>d.lt,useStatus:()=>d.$z,useZoom:()=>d.BO,useZoomToFit:()=>d.us});var e=c(946),t=c(475),n=c(18),o={};for(const e in n)["default","SketchWeb"].indexOf(e)<0&&(o[e]=()=>n[e]);c.d(l,o);var r=c(119);o={};for(const e in r)["default","SketchWeb"].indexOf(e)<0&&(o[e]=()=>r[e]);c.d(l,o);var i=c(332),a=c(312);o={};for(const e in a)["default","SketchWeb","SketchWebMode"].indexOf(e)<0&&(o[e]=()=>a[e]);c.d(l,o);var s=c(758),u=c(689);o={};for(const e in u)["default","SketchWeb","SketchWebMode","SketchWebError"].indexOf(e)<0&&(o[e]=()=>u[e]);c.d(l,o);var h=c(650);o={};for(const e in h)["default","SketchWeb","SketchWebMode","SketchWebError"].indexOf(e)<0&&(o[e]=()=>h[e]);c.d(l,o);var d=c(550);const f=e.d})(),l})()}));
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("react-dom"),require("styled-components"));else if("function"==typeof define&&define.amd)define(["react","react-dom","styled-components"],t);else{var n="object"==typeof exports?t(require("react"),require("react-dom"),require("styled-components")):t(e.react,e["react-dom"],e["styled-components"]);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,(function(e,t,n){return(()=>{var o,r,i,a,s={519:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={delayedDraw:!0,useNewTiledRenderer:!0,offscreenCanvas:!1,safariWebGL2:!1,pageBoundariesLimit:!1}},946:(e,t,n)=>{"use strict";n.d(t,{d:()=>B});var o,r=n(354),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,zooming:!1,pinchToZoomLastDistance:0,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.emitZoomStartEvent())},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.emitZoomEvent(t,o.state.zoomCenter,!1),o.cameraMoveTracker.handleCameraMoveEvent()}},o.handleGestureEnd=function(e){e.preventDefault(),o.emitZoomEndEvent()},o.handlePointerDown=function(e){(e instanceof MouseEvent&&0===e.button||(0,a.z6)(e))&&(e.preventDefault(),o.updateMousePosition(e),o.handlePanStart(),o.handleTouchPinchToZoomStart(e),o.emit("mousedown"))},o.handlePanStart=function(){o.state.panning=!0,o.state.lastPan.x=o.state.mouse.x,o.state.lastPan.y=o.state.mouse.y},o.handleTouchPinchToZoomStart=function(e){var t;if(e.touches&&!((null===(t=e.touches)||void 0===t?void 0:t.length)<2)){o.emitZoomStartEvent();var n=e.touches[0],r=e.touches[1];o.state.pinchToZoomLastDistance=Math.hypot(n.clientX-r.clientX,n.clientY-r.clientY)}},o.handlePointerMove=function(e){(0,a.z6)(e)&&o.handleTouchPinchToZoomChange(e),o.state.panning||o.updateMousePosition(e)},o.handleTouchPinchToZoomChange=function(e){var t;if(e.touches&&!((null===(t=e.touches)||void 0===t?void 0:t.length)<2)){var n=e.touches[0],r=e.touches[1],i=Math.hypot(n.clientX-r.clientX,n.clientY-r.clientY),a=o.clampPointerToTargetBounds({x:(n.clientX+r.clientX)/2,y:(n.clientY+r.clientY)/2}),s=i/Math.max(o.state.pinchToZoomLastDistance,1);o.state.pinchToZoomLastDistance=i,o.emitZoomEvent(s,a,!1)}},o.handlePanMove=function(e){if(o.state.panning&&!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){var t;o.handleTouchPinchToZoomEnd(e),(null===(t=e.touches)||void 0===t?void 0:t.length)>1||o.emit("mouseup")},o.handleTouchPinchToZoomEnd=function(e){var t;(null===(t=e.touches)||void 0===t?void 0:t.length)>2||o.emitZoomEndEvent()},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.emitZoomEvent(r,o.state.zoomCenter)}else o.emit("panChange",-e.deltaX,-e.deltaY);o.cameraMoveTracker.handleCameraMoveEvent()}},o.emitZoomEndEvent=(0,a.Ds)((function(){o.state.zooming&&(o.state.zooming=!1,o.emit("zoomEnd"))}),90),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.addTouchEventListeners(),this.addMouseEventListeners(),this.addSafariGesturesEventListeners()},t.prototype.addMouseEventListeners=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)},t.prototype.addTouchEventListeners=function(){this.listenersCollector.add(this.target,"touchstart",this.handlePointerDown),this.listenersCollector.add(document,"touchmove",this.handlePanMove,{passive:!0}),this.listenersCollector.add(this.target,"touchmove",this.handlePointerMove,{passive:!0}),this.listenersCollector.add(this.target,"touchend",this.handlePointerUp),this.listenersCollector.add(this.target,"touchcancel",this.handlePointerUp),this.listenersCollector.add(document,"touchend",this.handlePanEnd),this.listenersCollector.add(this.target,"touchend",this.handleDoubleClick)},t.prototype.addSafariGesturesEventListeners=function(){(0,a.b1)()||(this.listenersCollector.add(this.target,"gesturestart",this.handleGestureStart,{capture:!0}),this.listenersCollector.add(this.target,"gesturechange",this.handleGestureChange,{capture:!0}),this.listenersCollector.add(this.target,"gestureend",this.handleGestureEnd,{capture:!0}))},t.prototype.clampPointerToTargetBounds=function(e){return{x:(0,a.uZ)(e.x-this.targetBounds.x,0,this.target.clientWidth),y:(0,a.uZ)(e.y-this.targetBounds.y,0,this.target.clientHeight)}},t.prototype.getCorrectPointerPosition=function(e){var t,n={x:0,y:0};if((null===(t=e.touches)||void 0===t?void 0:t.length)>1){var o=e,r=o.touches[0],i=o.touches[1];n={x:(r.clientX+i.clientX)/2,y:(r.clientY+i.clientY)/2}}else n=(0,a.MP)(e);return this.clampPointerToTargetBounds(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.emitZoomEvent=function(e,t,n){void 0===n&&(n=!0),n&&this.emitZoomStartEvent(),this.emit("zoomChange",e,t),n&&this.emitZoomEndEvent()},t.prototype.emitZoomStartEvent=function(){this.state.zooming||(this.state.zooming=!0,this.emit("zoomStart"))},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"),g=e=>"object"==typeof e&&null!==e||"function"==typeof e,b=new Map([["proxy",{canHandle:e=>g(e)&&e[f],serialize(e){const{port1:t,port2:n}=new MessageChannel;return y(e,t),[n,[n]]},deserialize:e=>(e.start(),C(e))}],["throw",{canHandle:e=>g(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(L);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]]=L(o.data.value),u=!0;break;case"APPLY":u=n.apply(t,s);break;case"CONSTRUCT":u=S(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]=W(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 C(e,t){return P(e,[],t)}function k(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(k(o),i===p)return()=>O(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=O(e,{type:"GET",path:t.map((e=>e.toString()))}).then(L);return n.then.bind(n)}return P(e,[...t,i])},set(n,r,i){k(o);const[a,s]=W(i);return O(e,{type:"SET",path:[...t,r].map((e=>e.toString())),value:a},s).then(L)},apply(n,r,i){k(o);const a=t[t.length-1];if(a===v)return O(e,{type:"ENDPOINT"}).then(L);if("bind"===a)return P(e,t.slice(0,-1));const[s,u]=E(i);return O(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:s},u).then(L)},construct(n,r){k(o);const[i,a]=E(r);return O(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:i},a).then(L)}});return r}function E(e){const t=e.map(W);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const x=new WeakMap;function M(e,t){return x.set(e,t),e}function S(e){return Object.assign(e,{[f]:!0})}function W(e){for(const[t,n]of b)if(n.canHandle(e)){const[o,r]=n.serialize(e);return[{type:"HANDLER",name:t,value:o},r]}return[{type:"RAW",value:e},x.get(e)||[]]}function L(e){switch(e.type){case"HANDLER":return b.get(e.name).deserialize(e.value);case"RAW":return e.value}}function O(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 D,Z=n(849),R=n(519),T=n(332),z=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)}}(),j=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 z(t,e),t.prototype.addListeners=function(){this.listenersCollector.add(this.target,"keyup",this.handleKeyUp)},t.prototype.dispose=function(){this.listenersCollector.dispose()},t}(r.v),_=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)},F=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())}))},A=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])}}},G=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"}(D||(D={}));var B=function(e){function t(t){var n,o=e.call(this)||this;o.listenersCollector=new i,o.handleZoomStart=function(){o.emit("zoomStart")},o.handleZoomEnd=function(){o.emit("zoomEnd")},o.handleCameraMoveStart=function(){var e;null===(e=o.sketchWeb)||void 0===e||e.setIsCameraMoving(!0)},o.handleCameraMoveEnd=function(){var e;null===(e=o.sketchWeb)||void 0===e||e.setIsCameraMoving(!1)},o.handleMouseChange=function(e,t){var n;null===(n=o.sketchWeb)||void 0===n||n.setMouse(e,t)},o.handlePanChange=function(e,t){return F(o,void 0,void 0,(function(){var n;return A(this,(function(o){return null===(n=this.sketchWeb)||void 0===n||n.addPan(e,t),this.emitPanEvent(),[2]}))}))},o.handleZoomChange=function(e,t){return F(o,void 0,void 0,(function(){var n;return A(this,(function(o){return null===(n=this.sketchWeb)||void 0===n||n.addZoom(e,t),this.emitZoomEvent(),this.emitPanEvent(),[2]}))}))},o.handleCanvasResizeObserver=function(e){o.resizeCanvas(e[0].contentRect)},o.resizeCanvas=function(e){var t=e.width,n=e.height;window.requestAnimationFrame((function(){var e;o.setCanvasSize(t,n),o.gestureManager.updateTargetBounds(),null===(e=o.sketchWeb)||void 0===e||e.setSize(t,n,o.getDevicePixelRatio())}))};var r=null!==(n=t.featureFlags)&&void 0!==n?n:{};return o.featureFlags=I(I({},R.Z),r),o.settings=t,o.canvas=t.canvas,o.gestureManager=new l(o.settings.container,{minimumZoomLevel:t.minimumZoomLevel,maximumZoomLevel:t.maximumZoomLevel}),o.keyboardManager=new j(document.body),Z.Z.active=t.mode===T.p.debug,o.init(),o}return _(t,e),t.prototype.init=function(){var e;return F(this,void 0,void 0,(function(){var t,n,o;return A(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 F(this,void 0,void 0,(function(){var e,t,o,r,i;return A(this,(function(a){switch(a.label){case 0:return e=this.featureFlags.offscreenCanvas&&"function"==typeof this.canvas.transferControlToOffscreen,t=I(I({},this.settings),{size:{width:this.canvas.width,height:this.canvas.height},pixelRatio:this.getDevicePixelRatio(),featureFlags:this.featureFlags}),e?(this.environment=D.worker,Z.Z.debug("Using offscreen canvas"),this.offscreenCanvas=this.canvas.transferControlToOffscreen(),this.worker=new Worker(new URL(n.p+n.u(285),n.b),{type:void 0}),o=C(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=D.browser,Z.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("fileReady",this.forwardEvent("fileReady")),i.on("metric",this.forwardEvent("metric")),i.on("warnings",this.forwardEvent("warnings")),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,G([e],n))};return this.environment===D.worker?S(n):n},t.prototype.isRunningInsideWorker=function(){return this.environment===D.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.handleCanvasResizeObserver),this.canvasResizeObserver.observe(this.settings.container),this.listenersCollector.add(window,"orientationchange",this.handleDeviceOrientationChange),this.gestureManager.on("panChange",this.handlePanChange),this.gestureManager.on("mousemove",this.handleMouseChange),this.gestureManager.on("zoomChange",this.handleZoomChange),this.gestureManager.on("zoomStart",this.handleZoomStart),this.gestureManager.on("zoomEnd",this.handleZoomEnd),this.gestureManager.on("cameraMoveStart",this.handleCameraMoveStart),this.gestureManager.on("cameraMoveEnd",this.handleCameraMoveEnd)},t.prototype.emitPanEvent=function(){var e;return F(this,void 0,void 0,(function(){var t;return A(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 F(this,void 0,void 0,(function(){var t;return A(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.handleDeviceOrientationChange=function(){this.resizeCanvas({width:this.settings.container.clientWidth,height:this.settings.container.clientHeight})},t.prototype.zoomToFit=function(){return F(this,void 0,void 0,(function(){return A(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 F(this,void 0,void 0,(function(){return A(this,(function(t){return[2,null===(e=this.sketchWeb)||void 0===e?void 0:e.getStatus()]}))}))},t.prototype.generateDocumentPNG=function(){var e;return F(this,void 0,void 0,(function(){return A(this,(function(t){return[2,null===(e=this.sketchWeb)||void 0===e?void 0:e.generateDocumentPNG()]}))}))},t.prototype.getDocument=function(){var e;return null===(e=this.sketchWeb)||void 0===e?void 0:e.getDocument()},t.prototype.getArtboardAtPosition=function(e,t){var n;return F(this,void 0,void 0,(function(){return A(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 F(this,void 0,void 0,(function(){return A(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 F(this,void 0,void 0,(function(){var o;return A(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 F(this,void 0,void 0,(function(){return A(this,(function(r){switch(r.label){case 0:return this.gestureManager.dispose(),this.keyboardManager.dispose(),this.listenersCollector.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:()=>p});var o,r=n(419),i=n(519),a=n(354),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(){return(d=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)},f=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())}))},v=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])}}},p=(globalThis.indexedDB,function(e){function t(t){var n=t.canvas,o=t.locateFile,a=t.filePath,c=t.imagesURLFormat,h=t.imagesURLMap,f=t.backgroundColor,v=void 0===f?{r:1,g:1,b:1,a:1}:f,p=t.size,m=t.pixelRatio,g=t.mode,b=t.showTilesBorders,y=void 0!==b&&b,w=t.minimumZoomLevel,C=t.maximumZoomLevel,k=t.preserveDrawingBuffer,P=void 0!==k&&k,E=t.panBoundariesPadding,x=void 0===E?40:E,M=t.featureFlags,S=void 0===M?{}:M,W=e.call(this)||this;return W.status={type:"INIT"},W.handleWebGLContextLost=function(){W.setStatus({type:"WEBGL_CONTEXT_LOST"})},W.debouncedFullDraw=(0,r.Ds)((function(){return W.draw(!0)}),60),W.canvas=n,W.locateFile=o,W.filePath=a,W.imagesURLFormat=c,W.imagesURLMap=h,W.backgroundColor=v,W.size=p,W.pixelRatio=m,W.mode=g,W.showTilesBorders=y,W.currentWebGLVersion=(0,r.wX)(),W.zoomLevels={min:w,max:C},W.preserveDrawingBuffer=P,W.panBoundariesPadding=x,W.featureFlags=d(d({},i.Z),S),u.Z.active=g===l.p.debug,W.traceFirstPaint=new s.S("FirstPaint"),W}return h(t,e),t.prototype.init=function(){return f(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,5,,6]),[4,this.initSketchWebWasm()];case 2:return t.sent(),[4,this.setFile(this.filePath)];case 3:return t.sent(),[4,this.preloadImages()];case 4:return t.sent(),[3,6];case 5:return e=t.sent(),[2,this.fail(e instanceof c.k?e:new c.k("ERROR","Unexpected exception initializing the web renderer",e))];case 6:return[2]}}))}))},t.prototype.preloadImages=function(){var e=this;return new Promise((function(t){var n;null===(n=e.sketchWebWasm)||void 0===n||n.preloadImages((function(){t()}))}))},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),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 f(this,void 0,void 0,(function(){var e,t,o,r,i,a,h,d=this;return v(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:this.featureFlags,currentWebGLVersion:this.currentWebGLVersion,locateFile:function(e){return d.locateFile.replace("{file}",e)},bridge:this.createJSBridge()})];case 6:return r.wasmModule=f.sent(),[3,8];case 7:throw i=f.sent(),new c.k("WASM_ERROR","An error occurred while trying to create the wasm module.",i);case 8:if(e.printMeasurement(),this.emit("metric",e.measure()),a={majorVersion:this.currentWebGLVersion,antialias:!1,alpha:!1,stencil:!1,depth:!1,powerPreference:"high-performance",preserveDrawingBuffer:this.preserveDrawingBuffer},u.Z.debug("Using WebGL "+a.majorVersion),!(h=this.wasmModule.GL.createContext(this.canvas,a)))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=h;try{this.sketchWebWasm=this.wasmModule.SketchWeb.MakeGL(this.webglCtxHandle,this.canvas.width,this.size.height,this.pixelRatio,{showTilesBorders:this.showTilesBorders})}catch(e){throw new c.k("WASM_ERROR","An error occurred while trying to create the SketchWebWasm object.",e)}return this.sketchWebWasm.setBackgroundColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),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 f(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 f(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,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"}),t.emit("fileReady",t.getDocument()),n()}),(function(){return o(new c.k("FILE_ERROR","Error encountered while fetching and parsing the file"))}))}))]}))}))},t.prototype.delayedDraw=function(){if(!this.featureFlags.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){this.pixelRatio=e,this.setSize(this.size.width*this.pixelRatio,this.size.height*this.pixelRatio,this.pixelRatio),this.delayedDraw()},t.prototype.setSize=function(e,t,n){var o;this.size.width=e*n,this.size.height=t*n,this.canvas.width=e*n,this.canvas.height=t*n,null===(o=this.sketchWebWasm)||void 0===o||o.resize(e,t,n)},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.getDocument=function(){if(!this.sketchWebWasm)return null;if(!this.cachedDocumentInfo||this.cachedDocumentInfo.filePath!==this.filePath){var e=this.sketchWebWasm.getPRFile();this.cachedDocumentInfo={filePath:this.filePath,document:d(d({},e),{artboards:(0,r.gi)(e.artboards)})}}return this.cachedDocumentInfo.document},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.dispose=function(){var e,t;try{null===(e=this.sketchWebWasm)||void 0===e||e.stopRenderLoop(),null===(t=this.sketchWebWasm)||void 0===t||t.delete(),this.looseWebGLContext(),this.sketchWebWasm=null,this.wasmModule=null}catch(e){this.fail(new c.k("ERROR","Unexpected exception while disposing the SketchWebWasm object",e))}},t}(a.v))},550:(e,t,n)=>{"use strict";n.d(t,{j4:()=>Te,aV:()=>ke,z0:()=>me,oW:()=>oe,jr:()=>O,tm:()=>_,ky:()=>S,zX:()=>Y,ex:()=>G,Jw:()=>B,m_:()=>U,Yy:()=>j,d6:()=>Z,aP:()=>D,EY:()=>N,pt:()=>A,od:()=>L,ph:()=>I,lt:()=>z,$z:()=>M,BO:()=>W,us:()=>F});var o=n(297),r=n.n(o),i=n(332),a=n(849),s=(0,o.createContext)(void 0),u=function(){var e=(0,o.useContext)(s);if(void 0===e)throw Error("useSketchWebInternalContext must be used within a SketchWebProvider");return e},c=n(419),l=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},h=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a.Z.debug.apply(a.Z,l(["SketchWebReact"],e))};function d(e){return(0,c.b1)()?{onTouchEnd:e}:{onClick:e}}var f,v,p,m,g,b,y=(0,o.createContext)(void 0),w=(0,o.createContext)(void 0),C=(0,o.createContext)(void 0),k=(0,o.createContext)(void 0),P=(0,o.createContext)(void 0),E=(0,o.createContext)(void 0),x=(0,o.createContext)(void 0),M=function(){var e=(0,o.useContext)(y);if(void 0===e)throw Error("useStatus must be used within a SketchWebProvider");return e},S=function(){var e=(0,o.useContext)(w);if(void 0===e)throw Error("useDocument must be used within a SketchWebProvider");return e},W=function(){var e=(0,o.useContext)(C);if(void 0===e)throw Error("useZoom must be used within a SketchWebProvider");return e},L=function(){var e=(0,o.useContext)(E);if(void 0===e)throw Error("usePan must be used within a SketchWebProvider");return e},O=function(){var e=(0,o.useContext)(x);if(void 0===e)throw Error("useCursor must be used within a SketchWebProvider");return e},D=function(){var e=(0,o.useContext)(k);if(void 0===status)throw Error("useIsCameraZooming must be used within a SketchWebProvider");return e},Z=function(){var e=(0,o.useContext)(P);if(void 0===status)throw Error("useIsCameraMoving must be used within a SketchWebProvider");return e},R=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())}))},T=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])}}},z=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t){h("setZoom",t),console.log(e),null==e||e.setZoom(t)}),[e])},j=function(){var e=z(),t=W();return(0,o.useCallback)((function(){var n;h("incrementZoom"),"number"==typeof t&&(n=t>=1?Math.round(2*t):t>.5?1:2*t,e(n))}),[e,t])},_=function(){var e=z(),t=W();return(0,o.useCallback)((function(){h("decrementZoom"),"number"==typeof t&&e(t/2)}),[e,t])},I=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t){var n=t.x,o=t.y,r=t.centerPointInViewport;h("setPan",n,o,"centerPointInViewport",r),null==e||e.setPan(n,o,r)}),[e])},F=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(){h("zoomToFit"),null==e||e.zoomToFit()}),[e])},A=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(){h("looseWebGLContext"),null==e||e.looseWebGLContext()}),[e])},G=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(){return R(void 0,void 0,void 0,(function(){return T(this,(function(t){switch(t.label){case 0:return h("generateDocumentPNG"),[4,null==e?void 0:e.generateDocumentPNG()];case 1:return[2,t.sent()]}}))}))}),[e])},B=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t,n){return R(void 0,void 0,void 0,(function(){return T(this,(function(o){switch(o.label){case 0:return h("getArtboardAtPosition",t,n),[4,null==e?void 0:e.getArtboardAtPosition(t,n)];case 1:return[2,o.sent()||null]}}))}))}),[e])},U=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t,n){return R(void 0,void 0,void 0,(function(){return T(this,(function(o){switch(o.label){case 0:return h("getPanAtPosition",t,n),[4,null==e?void 0:e.getPanAtPosition(t,n)];case 1:return[2,o.sent()||null]}}))}))}),[e])},N=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t){h("setIsCameraLocked",t),null==e||e.gestureManager.setIsCameraLocked(t)}),[e])},Y=function(e,t){var n=(0,u().getManager)();(0,o.useEffect)((function(){return null==n||n.on(e,t),function(){null==n||n.off(e,t)}}),[e,n,t])},X=n(268),H=n.n(X),V=n(914),q=n.n(V),J=(0,V.createGlobalStyle)(f||(p=["\n *:where(:not(iframe, canvas, img, svg, video):not(svg *, symbol *)) {\n all: unset;\n display: revert;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n"],m=["\n *:where(:not(iframe, canvas, img, svg, video):not(svg *, symbol *)) {\n all: unset;\n display: revert;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n"],Object.defineProperty?Object.defineProperty(p,"raw",{value:m}):p.raw=m,f=p)),K=function(){return(K=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)},$=(0,V.createGlobalStyle)(v||(v=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n ","\n"],["\n ","\n"])),(function(e){return e.injectedStyles})),Q=function(e){var t=e.children,n=e.injectedStyles,i=(0,o.useRef)(null),a=(0,o.useState)(null),s=a[0],u=a[1];return r().createElement("div",{ref:function(e){e&&(i.current=e,e.shadowRoot||u(e.attachShadow({mode:"open",delegatesFocus:!0})))},style:{position:"relative",width:"100%",height:"100%"}},s&&H().createPortal(r().createElement(V.StyleSheetManager,{target:s},r().createElement(r().Fragment,null,r().createElement(J,null),n&&r().createElement($,{injectedStyles:n}),t)),s))},ee=function(){return(ee=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)},te={position:"relative",width:"100%",height:"100%",touchAction:"manipulation"},ne={position:"absolute",top:0,left:0},oe=(g=function(e){a.Z.active=e.mode===i.p.debug;var t=e.filePath,n=e.locateFile,s=e.imagesURLFormat,c=e.imagesURLMap,l=e.backgroundColor,h=e.mode,d=e.showTilesBorders,f=e.minimumZoomLevel,v=e.maximumZoomLevel,p=e.preserveDrawingBuffer,m=e.panBoundariesPadding,g=e.initialPan,b=e.initialZoom,y=e.children,w=e.containerProps,C=void 0===w?{}:w,k=e.canvasProps,P=void 0===k?{}:k,E=e.featureFlags,x=void 0===E?{}:E,S=(0,o.useRef)(null),W=(0,o.useRef)(null),L=(0,o.useState)(!1),D=L[0],Z=L[1],R=(0,o.useCallback)((function(){return Z(!0)}),[]),T=u(),z=T.dispose,j=T.init,_=T.setSettings,I=O(),F=M();Y("allImagesReady",R),(0,o.useEffect)((function(){_({locateFile:n,imagesURLFormat:s,imagesURLMap:c,backgroundColor:l,mode:h,showTilesBorders:d,minimumZoomLevel:f,maximumZoomLevel:v,preserveDrawingBuffer:p,panBoundariesPadding:m,initialPan:g,initialZoom:b,featureFlags:x})}),[_,n,s,c,l,h,d,f,v,p,m,g,b,x]),(0,o.useEffect)((function(){if(t)return j(t,S.current,W.current),function(){z()}}),[z,j,t]);var A=(0,o.useMemo)((function(){var t;return null!==(t=e.cursor)&&void 0!==t?t:I}),[e.cursor,I]),G=(0,o.useMemo)((function(){return ee(ee({},te),{cursor:A})}),[A]);return r().createElement("div",ee({},C,{ref:W,style:G}),t&&r().createElement("canvas",ee({},P,{key:t,ref:S,"data-sketchweb-all-images-ready":D,"data-testid":"sketchweb-canvas","data-sketchweb-status":"sketchweb-status-"+((null==F?void 0:F.type.toLowerCase())||"null"),style:ne})),"READY"===(null==F?void 0:F.type)&&y)},function(e){var t=e.injectedStyles,n=e.useShadowRoot,o=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["injectedStyles","useShadowRoot"]);return n?r().createElement(Q,{injectedStyles:t},r().createElement(g,K({},o))):r().createElement(g,K({},o))}),re=n(946);!function(e){e.Draggable="grab",e.Dragging="grabbing",e.Hover="pointer",e.Default="auto"}(b||(b={}));var ie,ae,se,ue,ce,le,he,de,fe=function(){return(fe=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)},ve=function(e,t){switch(h('dispatched: "'+t.type+'"',t),t.type){case"on-status":return fe(fe({},e),{status:t.status});case"on-file-ready":return fe(fe({},e),{document:t.document});case"on-zoom":return fe(fe({},e),{zoom:t.zoom});case"on-pan":return fe(fe({},e),{pan:t.pan});case"dispose":return fe(fe({},e),{status:null,zoom:null,pan:null,cursor:b.Default});case"post-init":return fe(fe({},e),{status:t.status,zoom:t.zoom});case"on-camera-zoom-start":return fe(fe({},e),{isCameraZooming:!0});case"on-camera-zoom-end":return fe(fe({},e),{isCameraZooming:!1});case"on-camera-move-start":return fe(fe({},e),{cursor:e.isMouseDown?b.Dragging:b.Draggable,isCameraMoving:!0});case"on-camera-move-end":return fe(fe({},e),{isCameraMoving:!1});case"on-mouse-down":return fe(fe({},e),{cursor:b.Dragging,isMouseDown:!0});case"on-mouse-up":return fe(fe({},e),{cursor:b.Draggable,isMouseDown:!1});default:return e}},pe=function(){return(pe=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)},me=function(e){var t=e.children,n=(0,o.useRef)(null),i=(0,o.useRef)(null),a=(0,o.useReducer)(ve,{pan:null,zoom:null,status:null,document:null,isCameraZooming:!1,isCameraMoving:!1,cursor:b.Default,isMouseDown:!1}),u=a[0],c=u.status,l=u.document,d=u.zoom,f=u.pan,v=u.isCameraZooming,p=u.isCameraMoving,m=u.cursor,g=a[1],M=(0,o.useCallback)((function(e){return g({type:"on-zoom",zoom:e})}),[]),S=(0,o.useCallback)((function(e,t){return g({type:"on-pan",pan:{x:e,y:t}})}),[]),W=(0,o.useCallback)((function(e){g({type:"on-status",status:e})}),[]),L=(0,o.useCallback)((function(e){g({type:"on-file-ready",document:e})}),[]),O=(0,o.useCallback)((function(){return g({type:"on-mouse-down"})}),[]),D=(0,o.useCallback)((function(){return g({type:"on-mouse-up"})}),[]),Z=(0,o.useCallback)((function(){return g({type:"on-camera-zoom-start"})}),[]),R=(0,o.useCallback)((function(){return g({type:"on-camera-zoom-end"})}),[]),T=(0,o.useCallback)((function(){return g({type:"on-camera-move-start"})}),[]),z=(0,o.useCallback)((function(){return g({type:"on-camera-move-end"})}),[]),j=(0,o.useCallback)((function(){var e=n.current;e&&(h("dispose"),e.off("status",W),e.off("fileReady",L),e.off("zoom",M),e.off("pan",S),e.gestureManager.off("mousedown",O),e.gestureManager.off("mouseup",D),e.gestureManager.off("zoomStart",Z),e.gestureManager.off("zoomEnd",R),e.gestureManager.off("cameraMoveStart",T),e.gestureManager.off("cameraMoveEnd",z),e.dispose(),n.current=null,g({type:"dispose"}))}),[W,L,S,M,D,O,Z,R,T,z]),_=(0,o.useCallback)((function(e,t,o){if(""!==e&&t&&o&&i.current){h("init");var r=new re.d(pe(pe({},i.current),{filePath:e,container:o,canvas:t}));r.on("status",W),r.on("fileReady",L),r.on("zoom",M),r.on("pan",S),r.gestureManager.on("mousedown",O),r.gestureManager.on("mouseup",D),r.gestureManager.on("zoomStart",Z),r.gestureManager.on("zoomEnd",R),r.gestureManager.on("cameraMoveStart",T),r.gestureManager.on("cameraMoveEnd",z),a=void 0,s=void 0,c=function(){var e,t;return 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])}}}(this,(function(n){switch(n.label){case 0:return e=g,t={type:"post-init"},[4,r.getZoom()];case 1:return t.zoom=n.sent()||null,[4,r.getStatus()];case 2:return t.status=n.sent()||null,[4,r.getPan()];case 3:return e.apply(void 0,[(t.pan=n.sent()||null,t)]),[2]}}))},new((u=void 0)||(u=Promise))((function(e,t){function n(e){try{r(c.next(e))}catch(e){t(e)}}function o(e){try{r(c.throw(e))}catch(e){t(e)}}function r(t){var r;t.done?e(t.value):(r=t.value,r instanceof u?r:new u((function(e){e(r)}))).then(n,o)}r((c=c.apply(a,s||[])).next())})),n.current=r}var a,s,u,c}),[W,L,M,S,O,D,Z,R,T,z]),I=(0,o.useCallback)((function(e){h("setSettings",e),i.current=e}),[]),F=(0,o.useCallback)((function(){return n.current}),[]),A=(0,o.useMemo)((function(){return{dispose:j,init:_,setSettings:I,getManager:F,dispatch:g}}),[j,_,I,F]);return r().createElement(s.Provider,{value:A},r().createElement(y.Provider,{value:c},r().createElement(w.Provider,{value:l},r().createElement(C.Provider,{value:d},r().createElement(E.Provider,{value:f},r().createElement(k.Provider,{value:v},r().createElement(P.Provider,{value:p},r().createElement(x.Provider,{value:m},t))))))))},ge=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},be=q().div(ie||(ie=ge(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n"]))),ye=q().div(ae||(ae=ge(["\n position: absolute;\n top: 0;\n left: 0;\n transform-origin: top left;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n transform-origin: top left;\n"]))),we=function(e){var t=e.document,n=e.children,o=L()||{x:0,y:0},i=W()||1,a=Z(),s=D();return r().createElement(ye,{style:{willChange:a?"transform, width, height":"",pointerEvents:a?"none":"auto",width:t.bounds.width*i+"px",height:t.bounds.height*i+"px",transform:"translate3d("+o.x*i+"px, "+o.y*i+"px, 0)",display:s?"none":"block"}},n)},Ce=function(){return(Ce=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)},ke=function(e){var t=e.children,n=e.onClick,o=S();return o?r().createElement(be,Ce({},d(n)),r().createElement(we,{document:o},t)):null},Pe=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Ee=q().div(se||(se=Pe(["\n position: absolute;\n box-sizing: border-box;\n cursor: pointer;\n\n // Just some default font styles\n font-size: 12px;\n font-style: normal;\n font-family: sans-serif;\n\n font: ",";\n\n ","\n"],["\n position: absolute;\n box-sizing: border-box;\n cursor: pointer;\n\n // Just some default font styles\n font-size: 12px;\n font-style: normal;\n font-family: sans-serif;\n\n font: ",";\n\n ","\n"])),(function(e){return e.font}),(function(e){return e.selected?"box-shadow: 0 0 0 4px "+e.outlineColor+";":"\n &:hover {\n box-shadow: 0 0 0 2px "+e.outlineColor+";\n }\n "})),xe=q().div(ue||(ue=Pe(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: auto;\n padding: 0 0 6px 0;\n transform: translateY(-100%);\n display: flex;\n pointer-events: none;\n visibility: ",";\n align-items: center;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: auto;\n padding: 0 0 6px 0;\n transform: translateY(-100%);\n display: flex;\n pointer-events: none;\n visibility: ",";\n align-items: center;\n"])),(function(e){return e.visible?"visible":"hidden"})),Me=q().span(ce||(ce=Pe(["\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n user-select: none;\n pointer-events: auto;\n color: ",";\n"],["\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n user-select: none;\n pointer-events: auto;\n color: ",";\n"])),(function(e){return e.textColor})),Se=q().button(le||(le=Pe(["\n position: relative;\n white-space: nowrap;\n margin-right: 0;\n margin-left: auto;\n align-items: center;\n pointer-events: auto;\n display: ",";\n font: inherit;\n"],["\n position: relative;\n white-space: nowrap;\n margin-right: 0;\n margin-left: auto;\n align-items: center;\n pointer-events: auto;\n display: ",";\n font: inherit;\n"])),(function(e){return e.visible?"flex":"none"})),We=q().span(he||(he=Pe(["\n color: ",";\n display: ",";\n font: inherit;\n"],["\n color: ",";\n display: ",";\n font: inherit;\n"])),(function(e){return e.textColor}),(function(e){return e.visible?"initial":"none"})),Le=q().span(de||(de=Pe(["\n position: relative;\n width: 14px;\n height: 14px;\n margin-left: 4px;\n"],["\n position: relative;\n width: 14px;\n height: 14px;\n margin-left: 4px;\n"])));function Oe(){return r().createElement(Le,null,r().createElement("svg",{viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},r().createElement("g",{fill:"none",fillRule:"evenodd"},r().createElement("path",{d:"M6.755 0h.49c1.55 0 2.708.278 3.686.801a5.452 5.452 0 0 1 2.268 2.268c.523.978.801 2.136.801 3.686v.49c0 1.55-.278 2.708-.801 3.686a5.452 5.452 0 0 1-2.268 2.268c-.978.523-2.136.801-3.686.801h-.49c-1.55 0-2.708-.278-3.686-.801A5.452 5.452 0 0 1 .801 10.93C.278 9.953 0 8.795 0 7.245v-.49c0-1.55.278-2.708.801-3.686A5.452 5.452 0 0 1 3.07.801C4.047.278 5.205 0 6.755 0Z",fillOpacity:".083",fill:"#000",fillRule:"nonzero"}),r().createElement("path",{strokeOpacity:".55",stroke:"#000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 9.5 10 7 7.5 4.5M8.5 7H4"}))))}var De=function(){return(De=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)},Ze=r().forwardRef((function(e,t){var n,i=e.document,a=e.artboard,s=e.selected,u=e.onClick,c=e.onDoubleClick,l=e.onCTAClick,h=e.font,f=e.outlineColor,v=e.nameTextColor,p=e.ctaTextColor,m=e.ctaText,g=null!==(n=W())&&void 0!==n?n:1,b=a.bounds.width*g,y=b>100,w=b>160,C=(0,o.useMemo)((function(){var e=a.bounds,t=i.bounds;return{x:(e.x-t.x)/t.width*100,y:(e.y-t.y)/t.height*100,width:e.width/t.width*100,height:e.height/t.height*100}}),[a.bounds,i.bounds]),k=C.x,P=C.y,E=C.width,x=C.height;return r().createElement(Ee,De({ref:t,selected:s,font:h,outlineColor:f},d((function(e){null==u||u(a,e)})),{onDoubleClick:function(e){null==c||c(a,e)},style:{left:k+"%",top:P+"%",width:E+"%",height:x+"%"}}),r().createElement(xe,{visible:y},r().createElement(Me,{textColor:v},a.name),r().createElement(Se,De({visible:s},d((function(e){null==l||l(a,e)}))),r().createElement(We,{textColor:p,visible:w},m),r().createElement(Oe,null))))}));Ze.displayName="Artboard";var Re=function(){return(Re=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)},Te=function(e){var t=e.artboardStyle,n=e.onGoToArtboard,i=S(),a=(0,o.useState)(null),s=a[0],u=a[1],c=(0,o.useRef)({});function l(e,t){u(e.objectId)}function h(e){null==n||n(e.objectId,"doubleClick")}function d(e){null==n||n(e.objectId,"CTA")}return(0,o.useEffect)((function(){function e(e){"Enter"===e.key&&s&&(null==n||n(s,"keyPressEnter"))}return window.document.body.addEventListener("keypress",e),function(){window.document.body.removeEventListener("keypress",e)}}),[n,s]),i?r().createElement(ke,{onClick:function(e){var t;for(var n in c.current)if(null===(t=c.current[n])||void 0===t?void 0:t.contains(e.target))return;u(null)}},i.artboards.map((function(e){return r().createElement(Ze,Re({ref:function(t){return c.current[e.objectId]=t},key:e.objectId,selected:s===e.objectId,onClick:l,onDoubleClick:h,onCTAClick:d,artboard:e,document:i},t))}))):null}},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:()=>{},650:()=>{},312:()=>{},552:(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}()},354:(e,t,n)=>{"use strict";n.d(t,{v:()=>o.v});var o=n(552)},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,gi:()=>o.gi,Ds:()=>o.Ds,wX:()=>o.wX,b1:()=>o.b1});var o=n(388)},388:(e,t,n)=>{"use strict";n.d(t,{Ds:()=>i,MP:()=>a,uZ:()=>s,wX:()=>u,gi:()=>c,b1:()=>l,z6:()=>h});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,o,r,i,a,s,u;return{x:null!==(r=null!==(t=e.pageX)&&void 0!==t?t:null===(o=null===(n=e.touches)||void 0===n?void 0:n[0])||void 0===o?void 0:o.pageX)&&void 0!==r?r:e.clientX,y:null!==(u=null!==(i=e.pageY)&&void 0!==i?i:null===(s=null===(a=e.touches)||void 0===a?void 0:a[0])||void 0===s?void 0:s.pageY)&&void 0!==u?u: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}function c(e){for(var t=e.size(),n=[],o=0;o<t;++o){var r=e.get(o);n.push(r)}return n}function l(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function h(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent||void 0!==e.touches||void 0!==e.targetTouches||void 0!==e.changedTouches}},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},268:e=>{"use strict";e.exports=t},914:e=>{"use strict";e.exports=n}},u={};function c(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return s[e](n,n.exports,c),n.exports}c.m=s,c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);c.r(n);var i={};o=o||[null,r({}),r([]),r(r)];for(var a=2&t&&e;"object"==typeof a&&!~o.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,c.d(n,i),n},c.d=(e,t)=>{for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce(((t,n)=>(c.f[n](e,t),t)),[])),c.u=e=>"static/js/web-renderer-"+{285:"c958f2d136a8510882fe",425:"148f39e38ee433dd320b",816:"076a12afe5f111b57e6c"}[e]+".chunk.js",c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},a="@sketch-hq/sketch-web-renderer:",c.l=(e,t,n,o)=>{if(i[e])i[e].push(t);else{var r,s;if(void 0!==n)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var h=u[l];if(h.getAttribute("src")==e||h.getAttribute("data-webpack")==a+n){r=h;break}}r||(s=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,c.nc&&r.setAttribute("nonce",c.nc),r.setAttribute("data-webpack",a+n),r.src=e),i[e]=[t];var d=(t,n)=>{r.onerror=r.onload=null,clearTimeout(f);var o=i[e];if(delete i[e],r.parentNode&&r.parentNode.removeChild(r),o&&o.forEach((e=>e(n))),t)return t(n)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=d.bind(null,r.onerror),r.onload=d.bind(null,r.onload),s&&document.head.appendChild(r)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.p="/",(()=>{c.b=document.baseURI||self.location.href;var e={826:0};c.f.j=(t,n)=>{var o=c.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=c.p+c.u(t),a=new Error;c.l(i,(n=>{if(c.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,s]=n,u=0;if(i.some((t=>0!==e[t]))){for(o in a)c.o(a,o)&&(c.m[o]=a[o]);s&&s(c)}for(t&&t(n);u<i.length;u++)r=i[u],c.o(e,r)&&e[r]&&e[r][0](),e[i[u]]=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 l={};return(()=>{"use strict";c.r(l),c.d(l,{default:()=>v,DefaultFeatureFlags:()=>p,SketchWeb:()=>n.U,SketchWebMode:()=>a.p,SketchWebError:()=>u.k,ArtboardsInfoOverlay:()=>f.j4,Overlay:()=>f.aV,SketchWebProvider:()=>f.z0,SketchWebReact:()=>f.oW,useCursor:()=>f.jr,useDecrementZoom:()=>f.tm,useDocument:()=>f.ky,useEvent:()=>f.zX,useGenerateDocumentPNG:()=>f.ex,useGetArtboardAtPosititon:()=>f.Jw,useGetPanAtPosition:()=>f.m_,useIncrementZoom:()=>f.Yy,useIsCameraMoving:()=>f.d6,useIsCameraZooming:()=>f.aP,useLockCamera:()=>f.EY,useLooseWebGLContext:()=>f.pt,usePan:()=>f.od,useSetPan:()=>f.ph,useSetZoom:()=>f.lt,useStatus:()=>f.$z,useZoom:()=>f.BO,useZoomToFit:()=>f.us});var e=c(946),t=c(519),n=c(475),o=c(18),r={};for(const e in o)["default","DefaultFeatureFlags","SketchWeb"].indexOf(e)<0&&(r[e]=()=>o[e]);c.d(l,r);var i=c(119);r={};for(const e in i)["default","DefaultFeatureFlags","SketchWeb"].indexOf(e)<0&&(r[e]=()=>i[e]);c.d(l,r);var a=c(332),s=c(312);r={};for(const e in s)["default","DefaultFeatureFlags","SketchWeb","SketchWebMode"].indexOf(e)<0&&(r[e]=()=>s[e]);c.d(l,r);var u=c(758),h=c(689);r={};for(const e in h)["default","DefaultFeatureFlags","SketchWeb","SketchWebMode","SketchWebError"].indexOf(e)<0&&(r[e]=()=>h[e]);c.d(l,r);var d=c(650);r={};for(const e in d)["default","DefaultFeatureFlags","SketchWeb","SketchWebMode","SketchWebError"].indexOf(e)<0&&(r[e]=()=>d[e]);c.d(l,r);var f=c(550);const v=e.d;var p=t.Z})(),l})()}));
|
package/dist/module-debug.wasm
CHANGED
|
Binary file
|
package/dist/module-release.wasm
CHANGED
|
Binary file
|
|
@@ -0,0 +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=Object.assign({},a),o=[],u="./this.program",s=(e,r)=>{throw r},c="";"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),r&&(c=r),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var f=a.print||console.log.bind(console),l=a.printErr||console.warn.bind(console);Object.assign(a,i),i=null,a.arguments&&(o=a.arguments),a.thisProgram&&(u=a.thisProgram),a.quit&&(s=a.quit);var d,v,m=0;a.wasmBinary&&(d=a.wasmBinary),a.noExitRuntime,"object"!=typeof WebAssembly&&X("no native wasm support detected");var p,y=!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.buffer&&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 b(e,r){return e?g(P,e,r):""}function w(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 x(e,r,t){return w(e,P,r,t)}function C(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 _,E,P,T,A,S,$,I,k,F="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function j(e,r){for(var t=e,n=t>>1,a=n+r/2;!(n>=a)&&A[n];)++n;if((t=n<<1)-e>32&&F)return F.decode(P.subarray(e,t));for(var i="",o=0;!(o>=r/2);++o){var u=T[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);T[r>>1]=o,r+=2}return T[r>>1]=0,r-n}function L(e){return 2*e.length}function B(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 W(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 M(e){_=e,a.HEAP8=E=new Int8Array(e),a.HEAP16=T=new Int16Array(e),a.HEAP32=S=new Int32Array(e),a.HEAPU8=P=new Uint8Array(e),a.HEAPU16=A=new Uint16Array(e),a.HEAPU32=$=new Uint32Array(e),a.HEAPF32=I=new Float32Array(e),a.HEAPF64=k=new Float64Array(e)}a.INITIAL_MEMORY;var R,U,V,N=[],G=[],H=[],Y=0,z=null,q=null;function J(e){Y++,a.monitorRunDependencies&&a.monitorRunDependencies(Y)}function K(e){if(Y--,a.monitorRunDependencies&&a.monitorRunDependencies(Y),0==Y&&(null!==z&&(clearInterval(z),z=null),q)){var r=q;q=null,r()}}function X(e){a.onAbort&&a.onAbort(e),l(e="Aborted("+e+")"),y=!0,p=1,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw n(r),r}function Q(e){return e.startsWith("data:application/octet-stream;base64,")}function Z(e){try{if(e==U&&d)return new Uint8Array(d);throw"both async and sync fetching of the wasm failed"}catch(e){X(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?re(t)():re(t)(r.arg):t(void 0===r.arg?null:r.arg)}else r(a)}}function re(e){return R.get(e)}Q(U="module-release.wasm")||(V=U,U=a.locateFile?a.locateFile(V,c):c+V);var te={};function ne(e){for(;e.length;){var r=e.pop();e.pop()(r)}}function ae(e){return this.fromWireType($[e>>2])}var ie={},oe={},ue={};function se(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 ce(e,r){return e=se(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(r)}function fe(e,r){var t=ce(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 le=void 0;function de(e){throw new le(e)}function ve(e,r,t){function n(r){var n=t(r);n.length!==e.length&&de("Mismatched type converter count");for(var a=0;a<e.length;++a)be(e[a],n[a])}e.forEach((function(e){ue[e]=r}));var a=new Array(r.length),i=[],o=0;r.forEach(((e,r)=>{oe.hasOwnProperty(e)?a[r]=oe[e]:(i.push(e),ie.hasOwnProperty(e)||(ie[e]=[]),ie[e].push((()=>{a[r]=oe[e],++o===i.length&&n(a)})))})),0===i.length&&n(a)}function me(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 pe=void 0;function ye(e){for(var r="",t=e;P[t];)r+=pe[P[t++]];return r}var he=void 0;function ge(e){throw new he(e)}function be(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=r.name;if(e||ge('type "'+n+'" must have a positive integer typeid pointer'),oe.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;ge("Cannot register type '"+n+"' twice")}if(oe[e]=r,delete ue[e],ie.hasOwnProperty(e)){var a=ie[e];delete ie[e],a.forEach((e=>e()))}}function we(e){ge(e.$$.ptrType.registeredClass.name+" instance already deleted")}var xe=!1;function Ce(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 Ee(e,r,t){if(r===t)return e;if(void 0===t.baseClass)return null;var n=Ee(e,r,t.baseClass);return null===n?null:t.downcast(n)}var Pe={};var Te=[];function Ae(){for(;Te.length;){var e=Te.pop();e.$$.deleteScheduled=!1,e.delete()}}var Se=void 0;var $e={};function Ie(e,r){return r.ptrType&&r.ptr||de("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&de("Both smartPtrType and smartPtr must be specified"),r.count={value:1},ke(Object.create(e,{$$:{value:r}}))}function ke(e){return"undefined"==typeof FinalizationRegistry?(ke=e=>e,e):(xe=new FinalizationRegistry((e=>{_e(e.$$)})),Ce=e=>xe.unregister(e),(ke=e=>{var r=e.$$;if(r.smartPtr){var t={$$:r};xe.register(e,t,e)}return e})(e))}function Fe(){}function je(e,r,t){if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||ge("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 De(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 Le(e,r,t){for(;r!==t;)r.upcast||ge("Expected null or instance of "+t.name+", got an instance of "+r.name),e=r.upcast(e),r=r.baseClass;return e}function Be(e,r){if(null===r)return this.isReference&&ge("null is not a valid "+this.name),0;r.$$||ge('Cannot pass "'+Qe(r)+'" as a '+this.name),r.$$.ptr||ge("Cannot pass deleted object as a pointer of type "+this.name);var t=r.$$.ptrType.registeredClass;return Le(r.$$.ptr,t,this.registeredClass)}function Oe(e,r){var t;if(null===r)return this.isReference&&ge("null is not a valid "+this.name),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r.$$||ge('Cannot pass "'+Qe(r)+'" as a '+this.name),r.$$.ptr||ge("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&r.$$.ptrType.isConst&&ge("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=Le(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&ge("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:ge("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.toHandle((function(){a.delete()}))),null!==e&&e.push(this.rawDestructor,t)}break;default:ge("Unsupporting sharing policy")}return t}function We(e,r){if(null===r)return this.isReference&&ge("null is not a valid "+this.name),0;r.$$||ge('Cannot pass "'+Qe(r)+'" as a '+this.name),r.$$.ptr||ge("Cannot pass deleted object as a pointer of type "+this.name),r.$$.ptrType.isConst&&ge("Cannot convert argument of type "+r.$$.ptrType.name+" to parameter type "+this.name);var t=r.$$.ptrType.registeredClass;return Le(r.$$.ptr,t,this.registeredClass)}function Me(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=Oe:n?(this.toWireType=Be,this.destructorFunction=null):(this.toWireType=We,this.destructorFunction=null)}function Re(e,r,t){return e.includes("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):re(r).apply(null,t)}function Ue(e,r){var t,n,a,i=(e=ye(e)).includes("j")?(t=e,n=r,a=[],function(){return a.length=0,Object.assign(a,arguments),Re(t,n,a)}):re(r);return"function"!=typeof i&&ge("unknown function pointer with signature "+e+": "+r),i}var Ve=void 0;function Ne(e){var r=Vr(e),t=ye(r);return Ur(r),t}function Ge(e,r){var t=[],n={};throw r.forEach((function e(r){n[r]||oe[r]||(ue[r]?ue[r].forEach(e):(t.push(r),n[r]=!0))})),new Ve(e+": "+t.map(Ne).join([", "]))}function He(e,r){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var t=ce(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,r,t,n,a){var i=r.length;i<2&&ge("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 "+se(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 v=u?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],p=[ge,n,a,ne,r[0],r[1]];for(o&&(d+="var thisWired = classParam.toWireType("+v+", this);\n"),s=0;s<i-2;++s)d+="var arg"+s+"Wired = argType"+s+".toWireType("+v+", arg"+s+"); // "+r[s+2].name+"\n",m.push("argType"+s),p.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 y=1===s?"thisWired":"arg"+(s-2)+"Wired";null!==r[s].destructorFunction&&(d+=y+"_dtor("+y+"); // "+r[s].name+"\n",m.push(y+"_dtor"),p.push(r[s].destructorFunction))}return c&&(d+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),d+="}\n",m.push(d),He(Function,m).apply(null,p)}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))}var Xe={toValue:e=>(e||ge("Cannot use deleted val. handle = "+e),Je[e].value),toHandle: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(I[e>>2])};case 3:return function(e){return this.fromWireType(k[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function er(e,r,t){switch(r){case 0:return t?function(e){return E[e]}:function(e){return P[e]};case 1:return t?function(e){return T[e>>1]}:function(e){return A[e>>1]};case 2:return t?function(e){return S[e>>2]}:function(e){return $[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}function rr(e,r){var t=oe[e];return void 0===t&&ge(r+" has unknown type "+Ne(e)),t}function tr(e,r){for(var t=new Array(e),n=0;n<e;++n)t[n]=rr(S[(r>>2)+n],"parameter "+n);return t}var nr={};function ar(e){var r=nr[e];return void 0===r?ye(e):r}var ir=[];function or(){return"object"==typeof globalThis?globalThis:Function("return this")()}var ur,sr=[];ur=()=>performance.now();var cr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],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+=b(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=Fr=cr.currentContext&&cr.currentContext.GLctx,!(e&&!Fr)},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),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),function(e){e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")}(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}};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=Fr[t](),o=i&&cr.getNewId(n);i?(i.name=o,n[o]=i):cr.recordError(1282),S[r+4*a>>2]=o}}function vr(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=Fr.getParameter(34467);i=o?o.length:0;break;case 33309:if(cr.currentContext.version<2)return void cr.recordError(1282);i=2*(Fr.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=Fr.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:I[r+4*s>>2]=u[s];break;case 4:E[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,$[(n=r)>>2]=a,$[n+4>>2]=(a-$[n>>2])/4294967296;break;case 0:S[r>>2]=i;break;case 2:I[r>>2]=i;break;case 4:E[r>>0]=i?1:0}}else cr.recordError(1281)}function mr(e){var r=C(e)+1,t=Rr(r);return x(e,t,r),t}function pr(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function yr(e){return 0==(e-=5120)?E:1==e?P:2==e?T:4==e?S:6==e?I:5==e||28922==e||28520==e||30779==e||30782==e?$:A}function hr(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function gr(e,r,t,n,a,i){var o=yr(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)}function br(e){var r=Fr.currentProgram;if(r){var t=r.uniformLocsById[e];return"number"==typeof t&&(r.uniformLocsById[e]=t=Fr.getUniformLocation(r,r.uniformArrayNamesById[e]+(t>0?"["+t+"]":""))),t}cr.recordError(1282)}var wr=[],xr=[];function Cr(e){try{return v.grow(e-_.byteLength+65535>>>16),M(v.buffer),1}catch(e){}}var _r={xhrs:[],setu64:function(e,r){$[e>>2]=r,$[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=e=>{var r=e.target.result;r.objectStoreNames.contains("FILES")&&r.deleteObjectStore("FILES"),r.createObjectStore("FILES")},a.onsuccess=e=>t(e.target.result),a.onerror=e=>n(e)},staticInit:function(){_r.openDatabase("emscripten_filesystem",1,(e=>{_r.dbInstance=e,K()}),(()=>{_r.dbInstance=!1,K()})),"undefined"!=typeof ENVIRONMENT_IS_FETCH_WORKER&&ENVIRONMENT_IS_FETCH_WORKER||J()}};function Er(e,r,t,n,a){var i=$[e+8>>2];if(i){var o=b(i),u=e+112,s=b(u);s||(s="GET"),$[e+4>>2];var c=$[u+52>>2],f=$[u+56>>2],l=!!$[u+60>>2],d=($[u+64>>2],$[u+68>>2]),v=$[u+72>>2],m=$[u+76>>2],p=$[u+80>>2],y=$[u+84>>2],h=$[u+88>>2],g=!!(1&c),w=!!(2&c),C=!!(64&c),_=d?b(d):void 0,E=v?b(v):void 0,T=new XMLHttpRequest;if(T.withCredentials=l,T.open(s,o,!C,_,E),C||(T.timeout=f),T.url_=o,T.responseType="arraybuffer",p){var S=b(p);T.overrideMimeType(S)}if(m)for(;;){var I=$[m>>2];if(!I)break;var k=$[m+4>>2];if(!k)break;m+=8;var F=b(I),j=b(k);T.setRequestHeader(F,j)}_r.xhrs.push(T);var D=_r.xhrs.length;$[e+0>>2]=D;var L=y&&h?P.slice(y,y+h):null;T.onload=n=>{B(g&&!w);var a=T.response?T.response.byteLength:0;_r.setu64(e+24,0),a&&_r.setu64(e+32,a),A[e+40>>1]=T.readyState,A[e+42>>1]=T.status,T.statusText&&x(T.statusText,e+44,64),T.status>=200&&T.status<300?r&&r(e,T,n):t&&t(e,T,n)},T.onerror=r=>{B(g);var n=T.status;_r.setu64(e+24,0),_r.setu64(e+32,T.response?T.response.byteLength:0),A[e+40>>1]=T.readyState,A[e+42>>1]=n,t&&t(e,T,r)},T.ontimeout=r=>{t&&t(e,T,r)},T.onprogress=r=>{var t=g&&w&&T.response?T.response.byteLength:0,a=0;g&&w&&(a=Rr(t),P.set(new Uint8Array(T.response),a)),$[e+12>>2]=a,_r.setu64(e+16,t),_r.setu64(e+24,r.loaded-t),_r.setu64(e+32,r.total),A[e+40>>1]=T.readyState,T.readyState>=3&&0===T.status&&r.loaded>0&&(T.status=200),A[e+42>>1]=T.status,T.statusText&&x(T.statusText,e+44,64),n&&n(e,T,r),a&&Ur(a)},T.onreadystatechange=r=>{A[e+40>>1]=T.readyState,T.readyState>=2&&(A[e+42>>1]=T.status),a&&a(e,T,r)};try{T.send(L)}catch(r){t&&t(e,T,r)}}else t(e,0,"no url specified!");function B(r){var t=0,n=0;r&&(n=T.response?T.response.byteLength:0,t=Rr(n),P.set(new Uint8Array(T.response),t)),$[e+12>>2]=t,_r.setu64(e+16,n)}}function Pr(e,r){if(!y)if(r)e();else try{e()}catch(e){!function(e){if(e instanceof Yr||"unwind"==e)return p;s(1,e)}(e)}}function Tr(e,r,t,n,a){if(e){var i=$[r+112+64>>2];i||(i=$[r+8>>2]);var o=b(i);try{var u=e.transaction(["FILES"],"readwrite").objectStore("FILES").put(t,o);u.onsuccess=e=>{A[r+40>>1]=4,A[r+42>>1]=200,x("OK",r+44,64),n(r,0,o)},u.onerror=e=>{A[r+40>>1]=4,A[r+42>>1]=413,x("Payload Too Large",r+44,64),a(r,0,e)}}catch(e){a(r,0,e)}}else a(r,0,"IndexedDB not available!")}var Ar={};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",_:u||"./this.program"};for(var r in Ar)void 0===Ar[r]?delete e[r]:e[r]=Ar[r];var t=[];for(var r in e)t.push(r+"="+e[r]);Sr.strings=t}return Sr.strings}var $r=[null,[],[]];function Ir(e,r){var t=$r[e];0===r||10===r?((1===e?f:l)(g(t,0)),t.length=0):t.push(r)}function kr(e){return e%4==0&&(e%100!=0||e%400==0)}var Fr,jr=[31,29,31,30,31,30,31,31,30,31,30,31],Dr=[31,28,31,30,31,30,31,31,30,31,30,31];le=a.InternalError=fe(Error,"InternalError"),function(){for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);pe=e}(),he=a.BindingError=fe(Error,"BindingError"),Fe.prototype.isAliasOf=function(e){if(!(this instanceof Fe))return!1;if(!(e instanceof Fe))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},Fe.prototype.clone=function(){if(this.$$.ptr||we(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=ke(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},Fe.prototype.delete=function(){this.$$.ptr||we(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ge("Object already scheduled for deletion"),Ce(this),_e(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},Fe.prototype.isDeleted=function(){return!this.$$.ptr},Fe.prototype.deleteLater=function(){return this.$$.ptr||we(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ge("Object already scheduled for deletion"),Te.push(this),1===Te.length&&Se&&Se(Ae),this.$$.deleteScheduled=!0,this},a.getInheritedInstanceCount=function(){return Object.keys($e).length},a.getLiveInheritedInstances=function(){var e=[];for(var r in $e)$e.hasOwnProperty(r)&&e.push($e[r]);return e},a.flushPendingDeletes=Ae,a.setDelayFunction=function(e){Se=e,Te.length&&Se&&Se(Ae)},Me.prototype.getPointee=function(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},Me.prototype.destructor=function(e){this.rawDestructor&&this.rawDestructor(e)},Me.prototype.argPackAdvance=8,Me.prototype.readValueFromPointer=ae,Me.prototype.deleteObject=function(e){null!==e&&e.delete()},Me.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&&ge("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r}(e,r),$e[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?Ie(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Ie(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,o=this.registeredClass.getActualType(r),u=Pe[o];if(!u)return a.call(this);i=this.isConst?u.constPointerType:u.pointerType;var s=Ee(r,this.registeredClass,i.registeredClass);return null===s?a.call(this):this.isSmartPointer?Ie(i.registeredClass.instancePrototype,{ptrType:i,ptr:s,smartPtrType:this,smartPtr:e}):Ie(i.registeredClass.instancePrototype,{ptrType:i,ptr:s})},Ve=a.UnboundTypeError=fe(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 Lr=0;Lr<32;++Lr)lr.push(new Array(Lr));var Br=new Float32Array(288);for(Lr=0;Lr<288;++Lr)wr[Lr]=Br.subarray(0,Lr+1);var Or=new Int32Array(288);for(Lr=0;Lr<288;++Lr)xr[Lr]=Or.subarray(0,Lr+1);_r.staticInit();var Wr,Mr={d:function(e,r,t,n){X("Assertion failed: "+b(e)+", at: "+[r?b(r):"unknown filename",t,n?b(n):"unknown function"])},p:function(e){var r=te[e];delete te[e];var t=r.rawConstructor,n=r.rawDestructor,a=r.fields;ve([e],a.map((e=>e.getterReturnType)).concat(a.map((e=>e.setterArgumentType))),(e=>{var i={};return a.forEach(((r,t)=>{var n=r.fieldName,o=e[t],u=r.getter,s=r.getterContext,c=e[t+a.length],f=r.setter,l=r.setterContext;i[n]={read:e=>o.fromWireType(u(s,e)),write:(e,r)=>{var t=[];f(l,e,c.toWireType(t,r)),ne(t)}}})),[{name:r.name,fromWireType:function(e){var r={};for(var t in i)r[t]=i[t].read(e);return n(e),r},toWireType:function(e,r){for(var a in i)if(!(a in r))throw new TypeError('Missing field: "'+a+'"');var o=t();for(a in i)i[a].write(o,r[a]);return null!==e&&e.push(n,o),o},argPackAdvance:8,readValueFromPointer:ae,destructorFunction:n}]}))},bb:function(e,r,t,n,a){},ob:function(e,r,t,n,a){var i=me(t);be(e,{name:r=ye(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=E;else if(2===t)n=T;else{if(4!==t)throw new TypeError("Unknown boolean type size: "+r);n=S}return this.fromWireType(n[e>>i])},destructorFunction:null})},H:function(e,r,t,n,i,o,u,s,c,f,l,d,v){l=ye(l),o=Ue(i,o),s&&(s=Ue(u,s)),f&&(f=Ue(c,f)),v=Ue(d,v);var m=se(l);!function(e,r,t){a.hasOwnProperty(e)?(ge("Cannot register public name '"+e+"' twice"),je(a,e,e),a.hasOwnProperty(t)&&ge("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),a[e].overloadTable[void 0]=r):a[e]=r}(m,(function(){Ge("Cannot construct "+l+" due to unbound types",[n])})),ve([e,r,t],n?[n]:[],(function(r){var t,i;r=r[0],i=n?(t=r.registeredClass).instancePrototype:Fe.prototype;var u=ce(m,(function(){if(Object.getPrototypeOf(this)!==c)throw new he("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new he(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new he("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 De(l,u,c,v,t,o,s,f),p=new Me(l,d,!0,!1,!1),y=new Me(l+"*",d,!1,!1,!1),h=new Me(l+" const*",d,!1,!0,!1);return Pe[e]={pointerType:y,constPointerType:h},function(e,r,t){a.hasOwnProperty(e)||de("Replacing nonexistant public symbol"),a[e].overloadTable,a[e]=r,a[e].argCount=t}(m,u),[p,y,h]}))},mb:function(e,r,t,n,a,i,o){var u=ze(t,n);r=ye(r),i=Ue(a,i),ve([],[e],(function(e){var n=(e=e[0]).name+"."+r;function a(){Ge("Cannot call "+n+" due to unbound types",u)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var s=e.registeredClass.constructor;return void 0===s[r]?(a.argCount=t-1,s[r]=a):(je(s,r,n),s[r].overloadTable[t-1]=a),ve([],u,(function(e){var a=[e[0],null].concat(e.slice(1)),u=Ye(n,a,null,i,o);return void 0===s[r].overloadTable?(u.argCount=t-1,s[r]=u):s[r].overloadTable[t-1]=u,[]})),[]}))},ka:function(e,r,t,n,a,i){r>0||X(undefined);var o=ze(r,t);a=Ue(n,a),ve([],[e],(function(e){var t="constructor "+(e=e[0]).name;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new he("Cannot register multiple constructors with identical number of parameters ("+(r-1)+") for class '"+e.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return e.registeredClass.constructor_body[r-1]=()=>{Ge("Cannot construct "+e.name+" due to unbound types",o)},ve([],o,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=Ye(t,n,null,a,i),[]})),[]}))},e:function(e,r,t,n,a,i,o,u){var s=ze(t,n);r=ye(r),i=Ue(a,i),ve([],[e],(function(e){var n=(e=e[0]).name+"."+r;function a(){Ge("Cannot call "+n+" due to unbound types",s)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),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):(je(c,r,n),c[r].overloadTable[t-2]=a),ve([],s,(function(a){var u=Ye(n,a,e,i,o);return void 0===c[r].overloadTable?(u.argCount=t-2,c[r]=u):c[r].overloadTable[t-2]=u,[]})),[]}))},nb:function(e,r){be(e,{name:r=ye(r),fromWireType:function(e){var r=Xe.toValue(e);return Ke(e),r},toWireType:function(e,r){return Xe.toHandle(r)},argPackAdvance:8,readValueFromPointer:ae,destructorFunction:null})},D:function(e,r,t){var n=me(t);be(e,{name:r=ye(r),fromWireType:function(e){return e},toWireType:function(e,r){return r},argPackAdvance:8,readValueFromPointer:Ze(r,n),destructorFunction:null})},j:function(e,r,t,n,a){r=ye(r),-1===a&&(a=4294967295);var i=me(t),o=e=>e;if(0===n){var u=32-8*t;o=e=>e<<u>>>u}var s=r.includes("unsigned");be(e,{name:r,fromWireType:o,toWireType:s?function(e,r){return this.name,r>>>0}:function(e,r){return this.name,r},argPackAdvance:8,readValueFromPointer:er(r,i,0!==n),destructorFunction:null})},h:function(e,r,t){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function a(e){var r=$,t=r[e>>=2],a=r[e+1];return new n(_,a,t)}be(e,{name:t=ye(t),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},Xc:function(e,r,t,n,a,i,o,u,s,c,f,l){t=ye(t),i=Ue(a,i),u=Ue(o,u),c=Ue(s,c),l=Ue(f,l),ve([e],[r],(function(e){return e=e[0],[new Me(t,e.registeredClass,!1,!1,!0,e,n,i,u,c,l)]}))},C:function(e,r){var t="std::string"===(r=ye(r));be(e,{name:r,fromWireType:function(e){var r,n=$[e>>2];if(t)for(var a=e+4,i=0;i<=n;++i){var o=e+4+i;if(i==n||0==P[o]){var u=b(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(P[e+4+i]);r=s.join("")}return Ur(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||ge("Cannot pass non-string to std::string");var a=(t&&n?()=>C(r):()=>r.length)(),i=Rr(4+a+1);if($[i>>2]=a,t&&n)x(r,i+4,a+1);else if(n)for(var o=0;o<a;++o){var u=r.charCodeAt(o);u>255&&(Ur(i),ge("String has UTF-16 code units that do not fit in 8 bits")),P[i+4+o]=u}else for(o=0;o<a;++o)P[i+4+o]=r[o];return null!==e&&e.push(Ur,i),i},argPackAdvance:8,readValueFromPointer:ae,destructorFunction:function(e){Ur(e)}})},u:function(e,r,t){var n,a,i,o,u;t=ye(t),2===r?(n=j,a=D,o=L,i=()=>A,u=1):4===r&&(n=B,a=O,o=W,i=()=>$,u=2),be(e,{name:t,fromWireType:function(e){for(var t,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 Ur(e),t},toWireType:function(e,n){"string"!=typeof n&&ge("Cannot pass non-string to C++ string type "+t);var i=o(n),s=Rr(4+i+r);return $[s>>2]=i>>u,a(n,s+4,i+r),null!==e&&e.push(Ur,s),s},argPackAdvance:8,readValueFromPointer:ae,destructorFunction:function(e){Ur(e)}})},q:function(e,r,t,n,a,i){te[e]={name:ye(r),rawConstructor:Ue(t,n),rawDestructor:Ue(a,i),fields:[]}},m:function(e,r,t,n,a,i,o,u,s,c){te[e].fields.push({fieldName:ye(r),getterReturnType:t,getter:Ue(n,a),getterContext:i,setterArgumentType:o,setter:Ue(u,s),setterContext:c})},pb:function(e,r){be(e,{isVoid:!0,name:r=ye(r),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,r){}})},kb:function(){return Date.now()},qb:function(e){delete _r.xhrs[e-1]},jb:function(){return!0},eb:function(){throw 1/0},t:function(e,r,t){e=Xe.toValue(e),r=rr(r,"emval::as");var n=[],a=Xe.toHandle(n);return S[t>>2]=a,r.toWireType(n,e)},Cc:function(e,r,t,n){e=Xe.toValue(e);for(var a=tr(r,t),i=new Array(r),o=0;o<r;++o){var u=a[o];i[o]=u.readValueFromPointer(n),n+=u.argPackAdvance}var s=e.apply(void 0,i);return Xe.toHandle(s)},v:function(e,r,t,n,a){return(e=ir[e])(r=Xe.toValue(r),t=ar(t),function(e){var r=[];return S[e>>2]=Xe.toHandle(r),r}(n),a)},A:function(e,r,t,n){(e=ir[e])(r=Xe.toValue(r),t=ar(t),null,n)},G:Ke,Ya:function(e){return 0===e?Xe.toHandle(or()):(e=ar(e),Xe.toHandle(or()[e]))},n:function(e,r){var t=tr(e,r),n=t[0],a=n.name+"_$"+t.slice(1).map((function(e){return e.name})).join("_")+"$",i=sr[a];if(void 0!==i)return i;for(var o=["retType"],u=[n],s="",c=0;c<e-1;++c)s+=(0!==c?", ":"")+"arg"+c,o.push("argType"+c),u.push(t[1+c]);var f,l,d="return function "+se("methodCaller_"+a)+"(handle, name, destructors, args) {\n",v=0;for(c=0;c<e-1;++c)d+=" var arg"+c+" = argType"+c+".readValueFromPointer(args"+(v?"+"+v:"")+");\n",v+=t[c+1].argPackAdvance;for(d+=" var rv = handle[name]("+s+");\n",c=0;c<e-1;++c)t[c+1].deleteObject&&(d+=" argType"+c+".deleteObject(arg"+c+");\n");return n.isVoid||(d+=" return retType.toWireType(destructors, rv);\n"),d+="};\n",o.push(d),f=He(Function,o).apply(null,u),l=ir.length,ir.push(f),i=l,sr[a]=i,i},wb:function(e){return e=ar(e),Xe.toHandle(a[e])},z:function(e,r){return e=Xe.toValue(e),r=Xe.toValue(r),Xe.toHandle(e[r])},w:function(e){e>4&&(Je[e].refcount+=1)},$a:function(){return Xe.toHandle([])},_a:function(e){return Xe.toHandle(ar(e))},hc:function(){return Xe.toHandle({})},cb:function(e){ne(Xe.toValue(e)),Ke(e)},Yb:function(e,r,t){e=Xe.toValue(e),r=Xe.toValue(r),t=Xe.toValue(t),e[r]=t},s:function(e,r){var t=(e=rr(e,"_emval_take_value")).readValueFromPointer(r);return Xe.toHandle(t)},Za:function(e){return e=Xe.toValue(e),Xe.toHandle(typeof e)},a:function(){X("")},Db:function(e){cancelAnimationFrame(e)},ib:ur,Rc:function(e){Fr.activeTexture(e)},Sc:function(e,r){Fr.attachShader(cr.programs[e],cr.shaders[r])},Tc:function(e,r,t){Fr.bindAttribLocation(cr.programs[e],r,b(t))},Uc:function(e,r){35051==e?Fr.currentPixelPackBufferBinding=r:35052==e&&(Fr.currentPixelUnpackBufferBinding=r),Fr.bindBuffer(e,cr.buffers[r])},Rb:function(e,r){Fr.bindFramebuffer(e,cr.framebuffers[r])},Sb:function(e,r){Fr.bindRenderbuffer(e,cr.renderbuffers[r])},Bb:function(e,r){Fr.bindSampler(e,cr.samplers[r])},Vc:function(e,r){Fr.bindTexture(e,cr.textures[r])},mc:function(e){Fr.bindVertexArray(cr.vaos[e])},qc:function(e){Fr.bindVertexArray(cr.vaos[e])},Wc:function(e,r,t,n){Fr.blendColor(e,r,t,n)},I:function(e){Fr.blendEquation(e)},J:function(e,r){Fr.blendFunc(e,r)},Kb:function(e,r,t,n,a,i,o,u,s,c){Fr.blitFramebuffer(e,r,t,n,a,i,o,u,s,c)},K:function(e,r,t,n){cr.currentContext.version>=2?t&&r?Fr.bufferData(e,P,n,t,r):Fr.bufferData(e,r,n):Fr.bufferData(e,t?P.subarray(t,t+r):r,n)},L:function(e,r,t,n){cr.currentContext.version>=2?t&&Fr.bufferSubData(e,r,P,n,t):Fr.bufferSubData(e,r,P.subarray(n,n+t))},Tb:function(e){return Fr.checkFramebufferStatus(e)},M:function(e){Fr.clear(e)},N:function(e,r,t,n){Fr.clearColor(e,r,t,n)},O:function(e){Fr.clearStencil(e)},Ra:function(e,r,t,n){return Fr.clientWaitSync(cr.syncs[e],r,fr(t,n))},P:function(e,r,t,n){Fr.colorMask(!!e,!!r,!!t,!!n)},Q:function(e){Fr.compileShader(cr.shaders[e])},R:function(e,r,t,n,a,i,o,u){cr.currentContext.version>=2?Fr.currentPixelUnpackBufferBinding||!o?Fr.compressedTexImage2D(e,r,t,n,a,i,o,u):Fr.compressedTexImage2D(e,r,t,n,a,i,P,u,o):Fr.compressedTexImage2D(e,r,t,n,a,i,u?P.subarray(u,u+o):null)},S:function(e,r,t,n,a,i,o,u,s){cr.currentContext.version>=2?Fr.currentPixelUnpackBufferBinding||!u?Fr.compressedTexSubImage2D(e,r,t,n,a,i,o,u,s):Fr.compressedTexSubImage2D(e,r,t,n,a,i,o,P,s,u):Fr.compressedTexSubImage2D(e,r,t,n,a,i,o,s?P.subarray(s,s+u):null)},T:function(e,r,t,n,a,i,o,u){Fr.copyTexSubImage2D(e,r,t,n,a,i,o,u)},U:function(){var e=cr.getNewId(cr.programs),r=Fr.createProgram();return r.name=e,r.maxUniformLength=r.maxAttributeLength=r.maxUniformBlockNameLength=0,r.uniformIdCounter=1,cr.programs[e]=r,e},V:function(e){var r=cr.getNewId(cr.shaders);return cr.shaders[r]=Fr.createShader(e),r},W:function(e){Fr.cullFace(e)},X:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2],a=cr.buffers[n];a&&(Fr.deleteBuffer(a),a.name=0,cr.buffers[n]=null,n==Fr.currentPixelPackBufferBinding&&(Fr.currentPixelPackBufferBinding=0),n==Fr.currentPixelUnpackBufferBinding&&(Fr.currentPixelUnpackBufferBinding=0))}},Ub:function(e,r){for(var t=0;t<e;++t){var n=S[r+4*t>>2],a=cr.framebuffers[n];a&&(Fr.deleteFramebuffer(a),a.name=0,cr.framebuffers[n]=null)}},Y:function(e){if(e){var r=cr.programs[e];r?(Fr.deleteProgram(r),r.name=0,cr.programs[e]=null):cr.recordError(1281)}},Vb:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2],a=cr.renderbuffers[n];a&&(Fr.deleteRenderbuffer(a),a.name=0,cr.renderbuffers[n]=null)}},Cb:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2],a=cr.samplers[n];a&&(Fr.deleteSampler(a),a.name=0,cr.samplers[n]=null)}},Z:function(e){if(e){var r=cr.shaders[e];r?(Fr.deleteShader(r),cr.shaders[e]=null):cr.recordError(1281)}},Mb:function(e){if(e){var r=cr.syncs[e];r?(Fr.deleteSync(r),r.name=0,cr.syncs[e]=null):cr.recordError(1281)}},_:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2],a=cr.textures[n];a&&(Fr.deleteTexture(a),a.name=0,cr.textures[n]=null)}},nc:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2];Fr.deleteVertexArray(cr.vaos[n]),cr.vaos[n]=null}},rc:function(e,r){for(var t=0;t<e;t++){var n=S[r+4*t>>2];Fr.deleteVertexArray(cr.vaos[n]),cr.vaos[n]=null}},$:function(e){Fr.depthMask(!!e)},aa:function(e){Fr.disable(e)},ba:function(e){Fr.disableVertexAttribArray(e)},ca:function(e,r,t){Fr.drawArrays(e,r,t)},lc:function(e,r,t,n){Fr.drawArraysInstanced(e,r,t,n)},ic:function(e,r,t,n,a){Fr.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,r,t,n,a)},fc:function(e,r){for(var t=lr[e],n=0;n<e;n++)t[n]=S[r+4*n>>2];Fr.drawBuffers(t)},da:function(e,r,t,n){Fr.drawElements(e,r,t,n)},kc:function(e,r,t,n,a){Fr.drawElementsInstanced(e,r,t,n,a)},jc:function(e,r,t,n,a,i,o){Fr.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,r,t,n,a,i,o)},$b:function(e,r,t,n,a,i){!function(e,r,t,n){Fr.drawElements(e,r,t,n)}(e,n,a,i)},ea:function(e){Fr.enable(e)},fa:function(e){Fr.enableVertexAttribArray(e)},Ib:function(e,r){var t=Fr.fenceSync(e,r);if(t){var n=cr.getNewId(cr.syncs);return t.name=n,cr.syncs[n]=t,n}return 0},ga:function(){Fr.finish()},ha:function(){Fr.flush()},Wb:function(e,r,t,n){Fr.framebufferRenderbuffer(e,r,t,cr.renderbuffers[n])},Xb:function(e,r,t,n,a){Fr.framebufferTexture2D(e,r,t,cr.textures[n],a)},ia:function(e){Fr.frontFace(e)},ja:function(e,r){dr(e,r,"createBuffer",cr.buffers)},Zb:function(e,r){dr(e,r,"createFramebuffer",cr.framebuffers)},_b:function(e,r){dr(e,r,"createRenderbuffer",cr.renderbuffers)},Eb:function(e,r){dr(e,r,"createSampler",cr.samplers)},la:function(e,r){dr(e,r,"createTexture",cr.textures)},oc:function(e,r){dr(e,r,"createVertexArray",cr.vaos)},pc:function(e,r){dr(e,r,"createVertexArray",cr.vaos)},Nb:function(e){Fr.generateMipmap(e)},ma:function(e,r,t){t?S[t>>2]=Fr.getBufferParameter(e,r):cr.recordError(1281)},na:function(){var e=Fr.getError()||cr.lastError;return cr.lastError=0,e},oa:function(e,r){vr(e,r,2)},Ob:function(e,r,t,n){var a=Fr.getFramebufferAttachmentParameter(e,r,t);(a instanceof WebGLRenderbuffer||a instanceof WebGLTexture)&&(a=0|a.name),S[n>>2]=a},Pa:function(e,r){vr(e,r,0)},pa:function(e,r,t,n){var a=Fr.getProgramInfoLog(cr.programs[e]);null===a&&(a="(unknown error)");var i=r>0&&n?x(a,n,r):0;t&&(S[t>>2]=i)},qa:function(e,r,t){if(t)if(e>=cr.counter)cr.recordError(1281);else if(e=cr.programs[e],35716==r){var n=Fr.getProgramInfoLog(e);null===n&&(n="(unknown error)"),S[t>>2]=n.length+1}else if(35719==r){if(!e.maxUniformLength)for(var a=0;a<Fr.getProgramParameter(e,35718);++a)e.maxUniformLength=Math.max(e.maxUniformLength,Fr.getActiveUniform(e,a).name.length+1);S[t>>2]=e.maxUniformLength}else if(35722==r){if(!e.maxAttributeLength)for(a=0;a<Fr.getProgramParameter(e,35721);++a)e.maxAttributeLength=Math.max(e.maxAttributeLength,Fr.getActiveAttrib(e,a).name.length+1);S[t>>2]=e.maxAttributeLength}else if(35381==r){if(!e.maxUniformBlockNameLength)for(a=0;a<Fr.getProgramParameter(e,35382);++a)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,Fr.getActiveUniformBlockName(e,a).length+1);S[t>>2]=e.maxUniformBlockNameLength}else S[t>>2]=Fr.getProgramParameter(e,r);else cr.recordError(1281)},Pb:function(e,r,t){t?S[t>>2]=Fr.getRenderbufferParameter(e,r):cr.recordError(1281)},ra:function(e,r,t,n){var a=Fr.getShaderInfoLog(cr.shaders[e]);null===a&&(a="(unknown error)");var i=r>0&&n?x(a,n,r):0;t&&(S[t>>2]=i)},yb:function(e,r,t,n){var a=Fr.getShaderPrecisionFormat(e,r);S[t>>2]=a.rangeMin,S[t+4>>2]=a.rangeMax,S[n>>2]=a.precision},sa:function(e,r,t){if(t)if(35716==r){var n=Fr.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=Fr.getShaderSource(cr.shaders[e]),o=i?i.length+1:0;S[t>>2]=o}else S[t>>2]=Fr.getShaderParameter(cr.shaders[e],r);else cr.recordError(1281)},x:function(e){var r=cr.stringCache[e];if(!r){switch(e){case 7939:var t=Fr.getSupportedExtensions()||[];r=mr((t=t.concat(t.map((function(e){return"GL_"+e})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=Fr.getParameter(e);n||cr.recordError(1280),r=n&&mr(n);break;case 7938:var a=Fr.getParameter(7938);r=mr(a=cr.currentContext.version>=2?"OpenGL ES 3.0 ("+a+")":"OpenGL ES 2.0 ("+a+")");break;case 35724:var i=Fr.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=mr(i);break;default:cr.recordError(1280)}cr.stringCache[e]=r}return r},Qa: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=Fr.getSupportedExtensions()||[];return n=(n=n.concat(n.map((function(e){return"GL_"+e})))).map((function(e){return mr(e)})),t=cr.stringiCache[e]=n,r<0||r>=t.length?(cr.recordError(1281),0):t[r];default:return cr.recordError(1280),0}},ta:function(e,r){if(r=b(r),e=cr.programs[e]){!function(e){var r,t,n=e.uniformLocsById,a=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},r=0;r<Fr.getProgramParameter(e,35718);++r){var i=Fr.getActiveUniform(e,r),o=i.name,u=i.size,s=pr(o),c=s>0?o.slice(0,s):o,f=e.uniformIdCounter;for(e.uniformIdCounter+=u,a[c]=[u,f],t=0;t<u;++t)n[f]=t,e.uniformArrayNamesById[f++]=c}}(e);var t=e.uniformLocsById,n=0,a=r,i=pr(r);i>0&&(u=r.slice(i+1),n=parseInt(u)>>>0,a=r.slice(0,i));var o=e.uniformSizeAndIdsByName[a];if(o&&n<o[0]&&(t[n+=o[1]]=t[n]||Fr.getUniformLocation(e,r)))return n}else cr.recordError(1281);var u;return-1},zb:function(e,r,t){for(var n=lr[r],a=0;a<r;a++)n[a]=S[t+4*a>>2];Fr.invalidateFramebuffer(e,n)},Ab: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];Fr.invalidateSubFramebuffer(e,u,n,a,i,o)},Jb:function(e){return Fr.isSync(cr.syncs[e])},ua:function(e){var r=cr.textures[e];return r?Fr.isTexture(r):0},va:function(e){Fr.lineWidth(e)},wa:function(e){e=cr.programs[e],Fr.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},dc:function(e,r,t,n,a,i){Fr.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,S,r>>2,S,t>>2,S,n>>2,$,a>>2,i)},ec:function(e,r,t,n,a,i,o,u){Fr.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,S,r>>2,t,S,n>>2,S,a>>2,S,i>>2,$,o>>2,u)},xa:function(e,r){3317==e&&(cr.unpackAlignment=r),Fr.pixelStorei(e,r)},gc:function(e){Fr.readBuffer(e)},ya:function(e,r,t,n,a,i,o){if(cr.currentContext.version>=2)if(Fr.currentPixelPackBufferBinding)Fr.readPixels(e,r,t,n,a,i,o);else{var u=yr(i);Fr.readPixels(e,r,t,n,a,i,u,o>>hr(u))}else{var s=gr(i,a,t,n,o);s?Fr.readPixels(e,r,t,n,a,i,s):cr.recordError(1280)}},Qb:function(e,r,t,n){Fr.renderbufferStorage(e,r,t,n)},Lb:function(e,r,t,n,a){Fr.renderbufferStorageMultisample(e,r,t,n,a)},Fb:function(e,r,t){Fr.samplerParameterf(cr.samplers[e],r,t)},Gb:function(e,r,t){Fr.samplerParameteri(cr.samplers[e],r,t)},Hb:function(e,r,t){var n=S[t>>2];Fr.samplerParameteri(cr.samplers[e],r,n)},za:function(e,r,t,n){Fr.scissor(e,r,t,n)},Aa:function(e,r,t,n){var a=cr.getSource(e,r,t,n);Fr.shaderSource(cr.shaders[e],a)},Ba:function(e,r,t){Fr.stencilFunc(e,r,t)},Ca:function(e,r,t,n){Fr.stencilFuncSeparate(e,r,t,n)},Da:function(e){Fr.stencilMask(e)},Ea:function(e,r){Fr.stencilMaskSeparate(e,r)},Fa:function(e,r,t){Fr.stencilOp(e,r,t)},Ga:function(e,r,t,n){Fr.stencilOpSeparate(e,r,t,n)},Ha:function(e,r,t,n,a,i,o,u,s){if(cr.currentContext.version>=2)if(Fr.currentPixelUnpackBufferBinding)Fr.texImage2D(e,r,t,n,a,i,o,u,s);else if(s){var c=yr(u);Fr.texImage2D(e,r,t,n,a,i,o,u,c,s>>hr(c))}else Fr.texImage2D(e,r,t,n,a,i,o,u,null);else Fr.texImage2D(e,r,t,n,a,i,o,u,s?gr(u,o,n,a,s):null)},Ia:function(e,r,t){Fr.texParameterf(e,r,t)},Ja:function(e,r,t){var n=I[t>>2];Fr.texParameterf(e,r,n)},Ka:function(e,r,t){Fr.texParameteri(e,r,t)},La:function(e,r,t){var n=S[t>>2];Fr.texParameteri(e,r,n)},ac:function(e,r,t,n,a){Fr.texStorage2D(e,r,t,n,a)},Ma:function(e,r,t,n,a,i,o,u,s){if(cr.currentContext.version>=2)if(Fr.currentPixelUnpackBufferBinding)Fr.texSubImage2D(e,r,t,n,a,i,o,u,s);else if(s){var c=yr(u);Fr.texSubImage2D(e,r,t,n,a,i,o,u,c,s>>hr(c))}else Fr.texSubImage2D(e,r,t,n,a,i,o,u,null);else{var f=null;s&&(f=gr(u,o,a,i,s)),Fr.texSubImage2D(e,r,t,n,a,i,o,u,f)}},Na:function(e,r){Fr.uniform1f(br(e),r)},Oa:function(e,r,t){if(cr.currentContext.version>=2)r&&Fr.uniform1fv(br(e),I,t>>2,r);else{if(r<=288)for(var n=wr[r-1],a=0;a<r;++a)n[a]=I[t+4*a>>2];else n=I.subarray(t>>2,t+4*r>>2);Fr.uniform1fv(br(e),n)}},Nc:function(e,r){Fr.uniform1i(br(e),r)},Oc:function(e,r,t){if(cr.currentContext.version>=2)r&&Fr.uniform1iv(br(e),S,t>>2,r);else{if(r<=288)for(var n=xr[r-1],a=0;a<r;++a)n[a]=S[t+4*a>>2];else n=S.subarray(t>>2,t+4*r>>2);Fr.uniform1iv(br(e),n)}},Pc:function(e,r,t){Fr.uniform2f(br(e),r,t)},Qc:function(e,r,t){if(cr.currentContext.version>=2)r&&Fr.uniform2fv(br(e),I,t>>2,2*r);else{if(r<=144)for(var n=wr[2*r-1],a=0;a<2*r;a+=2)n[a]=I[t+4*a>>2],n[a+1]=I[t+(4*a+4)>>2];else n=I.subarray(t>>2,t+8*r>>2);Fr.uniform2fv(br(e),n)}},Mc:function(e,r,t){Fr.uniform2i(br(e),r,t)},Lc:function(e,r,t){if(cr.currentContext.version>=2)r&&Fr.uniform2iv(br(e),S,t>>2,2*r);else{if(r<=144)for(var n=xr[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);Fr.uniform2iv(br(e),n)}},Kc:function(e,r,t,n){Fr.uniform3f(br(e),r,t,n)},Jc:function(e,r,t){if(cr.currentContext.version>=2)r&&Fr.uniform3fv(br(e),I,t>>2,3*r);else{if(r<=96)for(var n=wr[3*r-1],a=0;a<3*r;a+=3)n[a]=I[t+4*a>>2],n[a+1]=I[t+(4*a+4)>>2],n[a+2]=I[t+(4*a+8)>>2];else n=I.subarray(t>>2,t+12*r>>2);Fr.uniform3fv(br(e),n)}},Ic:function(e,r,t,n){Fr.uniform3i(br(e),r,t,n)},Hc:function(e,r,t){if(cr.currentContext.version>=2)r&&Fr.uniform3iv(br(e),S,t>>2,3*r);else{if(r<=96)for(var n=xr[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);Fr.uniform3iv(br(e),n)}},Gc:function(e,r,t,n,a){Fr.uniform4f(br(e),r,t,n,a)},Fc:function(e,r,t){if(cr.currentContext.version>=2)r&&Fr.uniform4fv(br(e),I,t>>2,4*r);else{if(r<=72){var n=wr[4*r-1],a=I;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=I.subarray(t>>2,t+16*r>>2);Fr.uniform4fv(br(e),n)}},sc:function(e,r,t,n,a){Fr.uniform4i(br(e),r,t,n,a)},tc:function(e,r,t){if(cr.currentContext.version>=2)r&&Fr.uniform4iv(br(e),S,t>>2,4*r);else{if(r<=72)for(var n=xr[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);Fr.uniform4iv(br(e),n)}},uc:function(e,r,t,n){if(cr.currentContext.version>=2)r&&Fr.uniformMatrix2fv(br(e),!!t,I,n>>2,4*r);else{if(r<=72)for(var a=wr[4*r-1],i=0;i<4*r;i+=4)a[i]=I[n+4*i>>2],a[i+1]=I[n+(4*i+4)>>2],a[i+2]=I[n+(4*i+8)>>2],a[i+3]=I[n+(4*i+12)>>2];else a=I.subarray(n>>2,n+16*r>>2);Fr.uniformMatrix2fv(br(e),!!t,a)}},vc:function(e,r,t,n){if(cr.currentContext.version>=2)r&&Fr.uniformMatrix3fv(br(e),!!t,I,n>>2,9*r);else{if(r<=32)for(var a=wr[9*r-1],i=0;i<9*r;i+=9)a[i]=I[n+4*i>>2],a[i+1]=I[n+(4*i+4)>>2],a[i+2]=I[n+(4*i+8)>>2],a[i+3]=I[n+(4*i+12)>>2],a[i+4]=I[n+(4*i+16)>>2],a[i+5]=I[n+(4*i+20)>>2],a[i+6]=I[n+(4*i+24)>>2],a[i+7]=I[n+(4*i+28)>>2],a[i+8]=I[n+(4*i+32)>>2];else a=I.subarray(n>>2,n+36*r>>2);Fr.uniformMatrix3fv(br(e),!!t,a)}},wc:function(e,r,t,n){if(cr.currentContext.version>=2)r&&Fr.uniformMatrix4fv(br(e),!!t,I,n>>2,16*r);else{if(r<=18){var a=wr[16*r-1],i=I;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=I.subarray(n>>2,n+64*r>>2);Fr.uniformMatrix4fv(br(e),!!t,a)}},xc:function(e){e=cr.programs[e],Fr.useProgram(e),Fr.currentProgram=e},yc:function(e,r){Fr.vertexAttrib1f(e,r)},zc:function(e,r){Fr.vertexAttrib2f(e,I[r>>2],I[r+4>>2])},Ac:function(e,r){Fr.vertexAttrib3f(e,I[r>>2],I[r+4>>2],I[r+8>>2])},Bc:function(e,r){Fr.vertexAttrib4f(e,I[r>>2],I[r+4>>2],I[r+8>>2],I[r+12>>2])},bc:function(e,r){Fr.vertexAttribDivisor(e,r)},cc:function(e,r,t,n,a){Fr.vertexAttribIPointer(e,r,t,n,a)},Dc:function(e,r,t,n,a,i){Fr.vertexAttribPointer(e,r,t,!!n,a,i)},Ec:function(e,r,t,n){Fr.viewport(e,r,t,n)},Sa:function(e,r,t,n){Fr.waitSync(cr.syncs[e],r,fr(t,n))},sb:function(){return!0},F:function(e,r){return requestAnimationFrame((function(t){re(e)(t,r)}))},fb:function(e){var r,t=P.length,n=2147483648;if((e>>>=0)>n)return!1;for(var a=1;a<=4;a*=2){var i=t*(1+.2/a);if(i=Math.min(i,e+100663296),Cr(Math.min(n,(r=Math.max(e,i))+(65536-r%65536)%65536)))return!0}return!1},rb:function(e,r,t,n,a){var i=e+112,o=b(i),u=$[i+36>>2],s=$[i+40>>2],c=$[i+44>>2],f=$[i+48>>2],l=$[i+52>>2],d=!!(4&l),v=!!(32&l),m=!!(16&l),p=!!(64&l),y=(e,t,n)=>{Pr((()=>{u?re(u)(e):r&&r(e)}),p)},h=(e,r,t)=>{Pr((()=>{c?re(c)(e):n&&n(e)}),p)},g=(e,r,n)=>{Pr((()=>{s?re(s)(e):t&&t(e)}),p)},w=(e,r,t)=>{Pr((()=>{f?re(f)(e):a&&a(e)}),p)},C=(e,t,n)=>{Tr(_r.dbInstance,e,t.response,((e,t,n)=>{Pr((()=>{u?re(u)(e):r&&r(e)}),p)}),((e,t,n)=>{Pr((()=>{u?re(u)(e):r&&r(e)}),p)}))};if("EM_IDB_STORE"===o){var _=$[i+84>>2];Tr(_r.dbInstance,e,P.slice(_,_+$[i+88>>2]),y,g)}else if("EM_IDB_DELETE"===o)!function(e,r,t,n){if(e){var a=$[r+112+64>>2];a||(a=$[r+8>>2]);var i=b(a);try{var o=e.transaction(["FILES"],"readwrite").objectStore("FILES").delete(i);o.onsuccess=e=>{var n=e.target.result;$[r+12>>2]=0,_r.setu64(r+16,0),_r.setu64(r+24,0),_r.setu64(r+32,0),A[r+40>>1]=4,A[r+42>>1]=200,x("OK",r+44,64),t(r,0,n)},o.onerror=e=>{A[r+40>>1]=4,A[r+42>>1]=404,x("Not Found",r+44,64),n(r,0,e)}}catch(e){n(r,0,e)}}else n(r,0,"IndexedDB not available!")}(_r.dbInstance,e,y,g);else if(m){if(v)return 0;Er(e,d?C:y,g,h,w)}else!function(e,r,t,n){if(e){var a=$[r+112+64>>2];a||(a=$[r+8>>2]);var i=b(a);try{var o=e.transaction(["FILES"],"readonly").objectStore("FILES").get(i);o.onsuccess=e=>{if(e.target.result){var a=e.target.result,i=a.byteLength||a.length,o=Rr(i);P.set(new Uint8Array(a),o),$[r+12>>2]=o,_r.setu64(r+16,i),_r.setu64(r+24,0),_r.setu64(r+32,i),A[r+40>>1]=4,A[r+42>>1]=200,x("OK",r+44,64),t(r,0,a)}else A[r+40>>1]=4,A[r+42>>1]=404,x("Not Found",r+44,64),n(r,0,"no data")},o.onerror=e=>{A[r+40>>1]=4,A[r+42>>1]=404,x("Not Found",r+44,64),n(r,0,e)}}catch(e){n(r,0,e)}}else n(r,0,"IndexedDB not available!")}(_r.dbInstance,e,y,v?g:d?(e,r,t)=>{Er(e,C,g,h,w)}:(e,r,t)=>{Er(e,y,g,h,w)});return e},Xa:function(e){return cr.makeContextCurrent(e)?0:-5},gb: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)E[r++>>0]=e.charCodeAt(n);E[r>>0]=0}(n,i),t+=n.length+1})),0},hb: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},lb:function(e){return 52},ab:function(e,r,t,n,a){return 70},B:function(e,r,t,n){for(var a=0,i=0;i<t;i++){var o=$[r>>2],u=$[r+4>>2];r+=8;for(var s=0;s<u;s++)Ir(e,P[o+s]);a+=u}return S[n>>2]=a,0},b:function(){return m},Wa:function(e,r){Fr.bindFramebuffer(e,cr.framebuffers[r])},Ta:function(e){Fr.clear(e)},Va:function(e,r,t,n){Fr.clearColor(e,r,t,n)},Ua:function(e){Fr.clearStencil(e)},y:function(e,r){vr(e,r,0)},f:function(e,r){var t=Gr();try{return re(e)(r)}catch(e){if(Hr(t),e!==e+0)throw e;Nr(1,0)}},o:function(e,r,t){var n=Gr();try{return re(e)(r,t)}catch(e){if(Hr(n),e!==e+0)throw e;Nr(1,0)}},g:function(e,r,t,n){var a=Gr();try{return re(e)(r,t,n)}catch(e){if(Hr(a),e!==e+0)throw e;Nr(1,0)}},E:function(e,r,t,n,a){var i=Gr();try{return re(e)(r,t,n,a)}catch(e){if(Hr(i),e!==e+0)throw e;Nr(1,0)}},ub:function(e){var r=Gr();try{re(e)()}catch(e){if(Hr(r),e!==e+0)throw e;Nr(1,0)}},r:function(e,r){var t=Gr();try{re(e)(r)}catch(e){if(Hr(t),e!==e+0)throw e;Nr(1,0)}},l:function(e,r,t){var n=Gr();try{re(e)(r,t)}catch(e){if(Hr(n),e!==e+0)throw e;Nr(1,0)}},k:function(e,r,t,n){var a=Gr();try{re(e)(r,t,n)}catch(e){if(Hr(a),e!==e+0)throw e;Nr(1,0)}},i:function(e,r,t,n,a){var i=Gr();try{re(e)(r,t,n,a)}catch(e){if(Hr(i),e!==e+0)throw e;Nr(1,0)}},xb:function(e,r,t,n,a,i){var o=Gr();try{re(e)(r,t,n,a,i)}catch(e){if(Hr(o),e!==e+0)throw e;Nr(1,0)}},tb:function(e,r,t,n,a,i,o){var u=Gr();try{re(e)(r,t,n,a,i,o)}catch(e){if(Hr(u),e!==e+0)throw e;Nr(1,0)}},vb:function(e,r,t,n,a,i,o,u,s,c){var f=Gr();try{re(e)(r,t,n,a,i,o,u,s,c)}catch(e){if(Hr(f),e!==e+0)throw e;Nr(1,0)}},c:function(e){m=e},db: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?b(a):""},o=b(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 v(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 m(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 p(e){var r=function(e,r){for(var t=new Date(e.getTime());r>0;){var n=kr(t.getFullYear()),a=t.getMonth(),i=(n?jr:Dr)[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}(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=m(t),i=m(n);return v(a,r)<=0?v(i,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var y={"%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 p(e).toString().substring(2)},"%G":function(e){return p(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+function(e,r){for(var t=0,n=0;n<=r;t+=e[n++]);return t}(kr(e.tm_year+1900)?jr:Dr,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=e.tm_yday+7-e.tm_wday;return d(Math.floor(r/7),2)},"%V":function(e){var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&kr(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&kr(e.tm_year%400-1))&&r++}return d(r,2)},"%w":function(e){return e.tm_wday},"%W":function(e){var r=e.tm_yday+7-(e.tm_wday+6)%7;return d(Math.floor(r/7),2)},"%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 o=o.replace(/%%/g,"\0\0"),y)o.includes(s)&&(o=o.replace(new RegExp(s,"g"),y[s](i)));var h,g,x,_=(g=C(h=o=o.replace(/\0\0/g,"%"))+1,w(h,x=new Array(g),0,x.length),x);return _.length>r?0:(function(e,r){E.set(e,r)}(_,e),_.length-1)}(e,r,t,n)}},Rr=(function(){var e={a:Mr};function r(e,r){var t,n=e.exports;a.asm=n,M((v=a.asm.Yc).buffer),R=a.asm.$c,t=a.asm.Zc,G.unshift(t),K()}function t(e){r(e.instance)}function i(r){return(d||"function"!=typeof fetch?Promise.resolve().then((function(){return Z(U)})):fetch(U,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+U+"'";return e.arrayBuffer()})).catch((function(){return Z(U)}))).then((function(r){return WebAssembly.instantiate(r,e)})).then((function(e){return e})).then(r,(function(e){l("failed to asynchronously prepare wasm: "+e),X(e)}))}if(J(),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||Q(U)||"function"!=typeof fetch?i(t):fetch(U,{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.Zc).apply(null,arguments)},a._malloc=function(){return(Rr=a._malloc=a.asm._c).apply(null,arguments)}),Ur=a._free=function(){return(Ur=a._free=a.asm.ad).apply(null,arguments)},Vr=a.___getTypeName=function(){return(Vr=a.___getTypeName=a.asm.bd).apply(null,arguments)},Nr=(a.___embind_register_native_and_builtin_types=function(){return(a.___embind_register_native_and_builtin_types=a.asm.cd).apply(null,arguments)},a._setThrew=function(){return(Nr=a._setThrew=a.asm.dd).apply(null,arguments)}),Gr=a.stackSave=function(){return(Gr=a.stackSave=a.asm.ed).apply(null,arguments)},Hr=a.stackRestore=function(){return(Hr=a.stackRestore=a.asm.fd).apply(null,arguments)};function Yr(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function zr(e){function r(){Wr||(Wr=!0,a.calledRun=!0,y||(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(),H.unshift(e);var e;ee(H)}()))}e=e||o,Y>0||(function(){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)e=a.preRun.shift(),N.unshift(e);var e;ee(N)}(),Y>0||(a.setStatus?(a.setStatus("Running..."),setTimeout((function(){setTimeout((function(){a.setStatus("")}),1),r()}),1)):r()))}if(a.dynCall_viji=function(){return(a.dynCall_viji=a.asm.gd).apply(null,arguments)},a.dynCall_vijiii=function(){return(a.dynCall_vijiii=a.asm.hd).apply(null,arguments)},a.dynCall_viiiiij=function(){return(a.dynCall_viiiiij=a.asm.id).apply(null,arguments)},a.dynCall_jii=function(){return(a.dynCall_jii=a.asm.jd).apply(null,arguments)},a.dynCall_vij=function(){return(a.dynCall_vij=a.asm.kd).apply(null,arguments)},a.dynCall_iiij=function(){return(a.dynCall_iiij=a.asm.ld).apply(null,arguments)},a.dynCall_iiiij=function(){return(a.dynCall_iiiij=a.asm.md).apply(null,arguments)},a.dynCall_viij=function(){return(a.dynCall_viij=a.asm.nd).apply(null,arguments)},a.dynCall_viiij=function(){return(a.dynCall_viiij=a.asm.od).apply(null,arguments)},a.dynCall_ji=function(){return(a.dynCall_ji=a.asm.pd).apply(null,arguments)},a.dynCall_iij=function(){return(a.dynCall_iij=a.asm.qd).apply(null,arguments)},a.dynCall_jiiiiii=function(){return(a.dynCall_jiiiiii=a.asm.rd).apply(null,arguments)},a.dynCall_jiiiiji=function(){return(a.dynCall_jiiiiji=a.asm.sd).apply(null,arguments)},a.dynCall_iijj=function(){return(a.dynCall_iijj=a.asm.td).apply(null,arguments)},a.dynCall_jiji=function(){return(a.dynCall_jiji=a.asm.ud).apply(null,arguments)},a.dynCall_viijii=function(){return(a.dynCall_viijii=a.asm.vd).apply(null,arguments)},a.dynCall_iiiiij=function(){return(a.dynCall_iiiiij=a.asm.wd).apply(null,arguments)},a.dynCall_iiiiijj=function(){return(a.dynCall_iiiiijj=a.asm.xd).apply(null,arguments)},a.dynCall_iiiiiijj=function(){return(a.dynCall_iiiiiijj=a.asm.yd).apply(null,arguments)},a.GL=cr,q=function e(){Wr||zr(),Wr||(q=e)},a.run=zr,a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);a.preInit.length>0;)a.preInit.pop()();return zr(),e.ready});e.exports=t}}]);
|