@vertexvis/viewer 0.12.0-canary.2 → 0.12.0-canary.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.
@@ -1098,6 +1098,15 @@ class BaseInteractionHandler {
1098
1098
  if (this.keyboardControls && event.metaKey && event.shiftKey) {
1099
1099
  this.currentInteraction = this.rotatePointInteraction;
1100
1100
  }
1101
+ else if (this.keyboardControls && event.shiftKey) {
1102
+ this.currentInteraction = this.zoomInteraction;
1103
+ }
1104
+ else if (this.keyboardControls && (event.metaKey || event.ctrlKey)) {
1105
+ this.currentInteraction = this.panInteraction;
1106
+ }
1107
+ else if (this.keyboardControls && event.altKey) {
1108
+ this.currentInteraction = this.rotateInteraction;
1109
+ }
1101
1110
  if (event.buttons === 1) {
1102
1111
  this.draggingInteraction =
1103
1112
  this.currentInteraction || this.primaryInteraction;
@@ -146,6 +146,15 @@ export class BaseInteractionHandler {
146
146
  if (this.keyboardControls && event.metaKey && event.shiftKey) {
147
147
  this.currentInteraction = this.rotatePointInteraction;
148
148
  }
149
+ else if (this.keyboardControls && event.shiftKey) {
150
+ this.currentInteraction = this.zoomInteraction;
151
+ }
152
+ else if (this.keyboardControls && (event.metaKey || event.ctrlKey)) {
153
+ this.currentInteraction = this.panInteraction;
154
+ }
155
+ else if (this.keyboardControls && event.altKey) {
156
+ this.currentInteraction = this.rotateInteraction;
157
+ }
149
158
  if (event.buttons === 1) {
150
159
  this.draggingInteraction =
151
160
  this.currentInteraction || this.primaryInteraction;
@@ -243,4 +252,4 @@ export class BaseInteractionHandler {
243
252
  : false;
244
253
  }
245
254
  }
246
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZUludGVyYWN0aW9uSGFuZGxlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvaW50ZXJhY3Rpb25zL2Jhc2VJbnRlcmFjdGlvbkhhb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Q0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDLFdBQVcsQ0FBQztLQUNqQztJQUNELDhFQUE4RTtJQUM5RSxPQUFPLE1BQU0sQ0FBQztFQUNoQixDQUFDO0VBRVMsaUJBQWlCLENBQUMsS0FBZ0I7O0lBQzFDLE1BQU0sWUFBWSxHQUFHLE1BQUEsSUFBSSxDQUFDLE9BQU8sMENBQUUscUJBQXFCLEVBQUUsQ0FBQztJQUMzRCxNQUFNLFlBQVksR0FDaEIsWUFBWSxJQUFJLElBQUk7TUFDbEIsQ0FBQyxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsWUFBWSxDQUFDLElBQUksRUFBRSxZQUFZLENBQUMsR0FBRyxDQUFDO01BQ25ELENBQUMsQ0FBQyxTQUFTLENBQUM7SUFFaEIsT0FBTyxZQUFZLElBQUksSUFBSTtNQUN6QixDQUFDLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxPQUFPLEVBQUUsS0FBSyxDQUFDLE9BQU8sQ0FBQyxFQUFFLFlBQVksQ0FBQztNQUMxRSxDQUFDLENBQUMsU0FBUyxDQUFDO0VBQ2hCLENBQUM7RUFFUyxPQUFPLENBQUMsS0FBZ0I7SUFDaEMsT0FBTyxNQUFNLENBQUMsWUFBWSxJQUFJLElBQUksSUFBSSxLQUFLLFlBQVksWUFBWTtNQUNqRSxDQUFDLENBQUMsS0FBSyxDQUFDLFdBQVcsS0FBSyxPQUFPO01BQy9CLENBQUMsQ0FBQyxLQUFLLENBQUM7RUFDWixDQUFDO0NBQ0YifQ==
@@ -92522,6 +92522,15 @@ class BaseInteractionHandler {
92522
92522
  if (this.keyboardControls && event.metaKey && event.shiftKey) {
92523
92523
  this.currentInteraction = this.rotatePointInteraction;
92524
92524
  }
92525
+ else if (this.keyboardControls && event.shiftKey) {
92526
+ this.currentInteraction = this.zoomInteraction;
92527
+ }
92528
+ else if (this.keyboardControls && (event.metaKey || event.ctrlKey)) {
92529
+ this.currentInteraction = this.panInteraction;
92530
+ }
92531
+ else if (this.keyboardControls && event.altKey) {
92532
+ this.currentInteraction = this.rotateInteraction;
92533
+ }
92525
92534
  if (event.buttons === 1) {
92526
92535
  this.draggingInteraction =
92527
92536
  this.currentInteraction || this.primaryInteraction;
@@ -1094,6 +1094,15 @@ class BaseInteractionHandler {
1094
1094
  if (this.keyboardControls && event.metaKey && event.shiftKey) {
1095
1095
  this.currentInteraction = this.rotatePointInteraction;
1096
1096
  }
1097
+ else if (this.keyboardControls && event.shiftKey) {
1098
+ this.currentInteraction = this.zoomInteraction;
1099
+ }
1100
+ else if (this.keyboardControls && (event.metaKey || event.ctrlKey)) {
1101
+ this.currentInteraction = this.panInteraction;
1102
+ }
1103
+ else if (this.keyboardControls && event.altKey) {
1104
+ this.currentInteraction = this.rotateInteraction;
1105
+ }
1097
1106
  if (event.buttons === 1) {
1098
1107
  this.draggingInteraction =
1099
1108
  this.currentInteraction || this.primaryInteraction;
@@ -0,0 +1,4 @@
1
+ /**!
2
+ * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
+ */
4
+ import{r as t,c as i,h as s,H as n,g as e}from"./p-8e6a7bc0.js";import{p as h}from"./p-f49c0e61.js";import{v as o,l as r,p as a,h as l,r as u,e as c,n as d,f}from"./p-18e55391.js";import{c as v}from"./p-f482325b.js";import{u as w,E as m,o as p,b as g,m as y}from"./p-81c679f1.js";import{I as b,t as C,b as T,p as P,d as x,W as E,e as I,f as S,V as D,C as z,g as k,h as O,a as M,i as R,j as F,k as j,m as A,S as B}from"./p-ddcf41a6.js";import{S as L,g as K,h as $,t as N}from"./p-c3c75a47.js";import{V as U}from"./p-7b0bcbc6.js";import{g as V,c as W}from"./p-80c7425f.js";import{a as q,g as H}from"./p-639996da.js";import{C as G}from"./p-3ceae26d.js";import"./p-112455b1.js";var J,_=[],X="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(J||(J={}));var Y,Q=function(t){return Object.freeze(t)},Z=function(t,i){this.inlineSize=t,this.blockSize=i,Q(this)},tt=function(){function t(t,i,s,n){return this.x=t,this.y=i,this.width=s,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Q(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(i){return new t(i.x,i.y,i.width,i.height)},t}(),it=function(t){return t instanceof SVGElement&&"getBBox"in t},st=function(t){if(it(t)){var i=t.getBBox();return!i.width&&!i.height}return!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},nt=function(t){var i,s;if(t instanceof Element)return!0;var n=null===(s=null===(i=t)||void 0===i?void 0:i.ownerDocument)||void 0===s?void 0:s.defaultView;return!!(n&&t instanceof n.Element)},et="undefined"!=typeof window?window:{},ht=new WeakMap,ot=/auto|scroll/,rt=/^tb|vertical/,at=/msie|trident/i.test(et.navigator&&et.navigator.userAgent),lt=function(t){return parseFloat(t||"0")},ut=function(t,i,s){return void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=!1),new Z((s?i:t)||0,(s?t:i)||0)},ct=Q({devicePixelContentBoxSize:ut(),borderBoxSize:ut(),contentBoxSize:ut(),contentRect:new tt(0,0,0,0)}),dt=function(t,i){if(void 0===i&&(i=!1),ht.has(t)&&!i)return ht.get(t);if(st(t))return ht.set(t,ct),ct;var s=getComputedStyle(t),n=it(t)&&t.ownerSVGElement&&t.getBBox(),e=!at&&"border-box"===s.boxSizing,h=rt.test(s.writingMode||""),o=!n&&ot.test(s.overflowY||""),r=!n&&ot.test(s.overflowX||""),a=n?0:lt(s.paddingTop),l=n?0:lt(s.paddingRight),u=n?0:lt(s.paddingBottom),c=n?0:lt(s.paddingLeft),d=n?0:lt(s.borderTopWidth),f=n?0:lt(s.borderRightWidth),v=n?0:lt(s.borderBottomWidth),w=c+l,m=a+u,p=(n?0:lt(s.borderLeftWidth))+f,g=d+v,y=r?t.offsetHeight-g-t.clientHeight:0,b=o?t.offsetWidth-p-t.clientWidth:0,C=e?w+p:0,T=e?m+g:0,P=n?n.width:lt(s.width)-C-b,x=n?n.height:lt(s.height)-T-y,E=P+w+b+p,I=x+m+y+g,S=Q({devicePixelContentBoxSize:ut(Math.round(P*devicePixelRatio),Math.round(x*devicePixelRatio),h),borderBoxSize:ut(E,I,h),contentBoxSize:ut(P,x,h),contentRect:new tt(c,a,P,x)});return ht.set(t,S),S},ft=function(t,i,s){var n=dt(t,s),e=n.borderBoxSize,h=n.contentBoxSize,o=n.devicePixelContentBoxSize;switch(i){case J.DEVICE_PIXEL_CONTENT_BOX:return o;case J.BORDER_BOX:return e;default:return h}},vt=function(t){var i=dt(t);this.target=t,this.contentRect=i.contentRect,this.borderBoxSize=Q([i.borderBoxSize]),this.contentBoxSize=Q([i.contentBoxSize]),this.devicePixelContentBoxSize=Q([i.devicePixelContentBoxSize])},wt=function(t){if(st(t))return 1/0;for(var i=0,s=t.parentNode;s;)i+=1,s=s.parentNode;return i},mt=function(){var t=1/0,i=[];_.forEach((function(s){if(0!==s.activeTargets.length){var n=[];s.activeTargets.forEach((function(i){var s=new vt(i.target),e=wt(i.target);n.push(s),i.lastReportedSize=ft(i.target,i.observedBox),e<t&&(t=e)})),i.push((function(){s.callback.call(s.observer,n,s.observer)})),s.activeTargets.splice(0,s.activeTargets.length)}}));for(var s=0,n=i;s<n.length;s++)(0,n[s])();return t},pt=function(t){_.forEach((function(i){i.activeTargets.splice(0,i.activeTargets.length),i.skippedTargets.splice(0,i.skippedTargets.length),i.observationTargets.forEach((function(s){s.isActive()&&(wt(s.target)>t?i.activeTargets.push(s):i.skippedTargets.push(s))}))}))},gt=[],yt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ct=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Tt=function(t){return void 0===t&&(t=0),Date.now()+t},Pt=!1,xt=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var i=this;if(void 0===t&&(t=250),!Pt){Pt=!0;var s,n=Tt(t);s=function(){var s=!1;try{s=function(){var t,i=0;for(pt(i);_.some((function(t){return t.activeTargets.length>0}));)i=mt(),pt(i);return _.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),i>0}()}finally{if(Pt=!1,t=n-Tt(),!yt)return;s?i.run(1e3):t>0?i.run(t):i.start()}},function(t){if(!Y){var i=0,s=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(s,{characterData:!0}),Y=function(){s.textContent=""+(i?i--:i++)}}gt.push(t),Y()}((function(){requestAnimationFrame(s)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,i=function(){return t.observer&&t.observer.observe(document.body,bt)};document.body?i():et.addEventListener("DOMContentLoaded",i)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ct.forEach((function(i){return et.addEventListener(i,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ct.forEach((function(i){return et.removeEventListener(i,t.listener,!0)})),this.stopped=!0)},t}()),Et=function(t){!yt&&t>0&&xt.start(),!(yt+=t)&&xt.stop()},It=function(){function t(t,i){this.target=t,this.observedBox=i||J.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,i=ft(this.target,this.observedBox,!0);return it(t=this.target)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=i),this.lastReportedSize.inlineSize!==i.inlineSize||this.lastReportedSize.blockSize!==i.blockSize},t}(),St=function(t,i){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=i},Dt=new WeakMap,zt=function(t,i){for(var s=0;s<t.length;s+=1)if(t[s].target===i)return s;return-1},kt=function(){function t(){}return t.connect=function(t,i){var s=new St(t,i);Dt.set(t,s)},t.observe=function(t,i,s){var n=Dt.get(t),e=0===n.observationTargets.length;zt(n.observationTargets,i)<0&&(e&&_.push(n),n.observationTargets.push(new It(i,s&&s.box)),Et(1),xt.schedule())},t.unobserve=function(t,i){var s=Dt.get(t),n=zt(s.observationTargets,i);n>=0&&(1===s.observationTargets.length&&_.splice(_.indexOf(s),1),s.observationTargets.splice(n,1),Et(-1))},t.disconnect=function(t){var i=this,s=Dt.get(t);s.observationTargets.slice().forEach((function(s){return i.unobserve(t,s.target)})),s.activeTargets.splice(0,s.activeTargets.length)},t}(),Ot=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");kt.connect(this,t)}return t.prototype.observe=function(t,i){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!nt(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");kt.observe(this,t,i)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!nt(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");kt.unobserve(this,t)},t.prototype.disconnect=function(){kt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();class Mt{constructor(t,i){this.stream=t,this.configProvider=i,this.commands={}}register(t,i,s){return this.commands[t]={factory:i,thisArg:s},{dispose:()=>delete this.commands[t]}}execute(t,...i){const s=this.getCommandDefinition(t);if(null!=s){const t=s.factory.apply(s.thisArg,i);return new Promise((i=>{i(t({stream:this.stream,config:this.configProvider()}))}))}throw new Error(`Command not registered for \`${t}\``)}getCommandDefinition(t){return this.commands[t]}}class Rt{constructor(t,i,s,n,e,h,o,r,a,l){this.stream=t,this.getConfig=i,this.getScene=s,this.getFrame=n,this.getViewport=e,this.tapEmitter=h,this.doubleTapEmitter=o,this.longPressEmitter=r,this.interactionStartedEmitter=a,this.interactionFinishedEmitter=l,this.tap=this.tap.bind(this),this.doubleTap=this.doubleTap.bind(this),this.longPress=this.longPress.bind(this),this.emitTapEvent=this.emitTapEvent.bind(this)}getRayFromPoint(t){const i=this.getViewport(),s=this.getFrame();if(null!=s)return i.transformPointToRay(t,s.image,s.scene.camera);throw new Error("Cannot get camera. Frame is undefined.")}async tap(t,i={},s=0){this.emitTapEvent(this.tapEmitter.emit,t,i,s)}async doubleTap(t,i={},s=0){this.emitTapEvent(this.doubleTapEmitter.emit,t,i,s)}async longPress(t,i={},s=0){this.emitTapEvent(this.longPressEmitter.emit,t,i,s)}async beginInteraction(){this.isInteracting()||(this.interactionStartedEmitter.emit(),this.currentCamera=this.getScene().camera(),await this.stream.beginInteraction())}async transformCamera(t){var i;if(this.isInteracting()){const s=this.getScene(),n=this.getViewport(),e=this.getFrame(),h=await(null==e?void 0:e.depthBuffer());this.currentCamera=null!=this.currentCamera&&null!=n&&null!=e?t({camera:this.currentCamera,viewport:n,scale:s.scale(),boundingBox:s.boundingBox(),frame:e,depthBuffer:h}):void 0,await(null===(i=this.currentCamera)||void 0===i?void 0:i.render())}}async twistCamera(...t){return this.transformCamera((({camera:i,viewport:s})=>{const n=o.normalize(o.subtract(i.lookAt,i.position));if(1===t.length&&"number"==typeof t[0]){const s=r.toRadians(-t[0]);return i.rotateAroundAxis(s,n)}if(1===t.length){const n=a.create(s.width/2,s.height/2),e=r.fromPointsInDegrees(n,t[0]),h=null!=this.lastAngle?e-this.lastAngle:0;this.lastAngle=e;const l=o.normalize(o.subtract(i.lookAt,i.position)),u=r.toRadians(-h);return i.rotateAroundAxis(u,l)}return i}))}async panCameraToScreenPoint(t){return this.transformCamera((({camera:i,frame:s,viewport:n,depthBuffer:e})=>{if(null==this.panData){const h=i.toFrameCamera(),o=h.direction,r=n.transformPointToRay(t,s.image,h),a=l.fromNormalAndCoplanarPoint(o,i.lookAt),c=u.intersectPlane(r,a);if(null==c)return console.warn("Cannot determine fallback for pan. Ray does not intersect plane."),i;const d=null!=e?this.getWorldPoint(t,e,c):c,f=l.fromNormalAndCoplanarPoint(o,d);this.panData={hitPt:d,hitPlane:f,startingCamera:h}}if(null!=this.panData){const{hitPt:e,hitPlane:h,startingCamera:r}=this.panData,a=n.transformPointToRay(t,s.image,r),l=u.intersectPlane(a,h);if(null!=l){const t=o.subtract(e,l);return i.update(r).moveBy(t)}}return i}))}async panCameraByDelta(t){return this.transformCamera((({camera:i,viewport:s})=>{const n=i.viewVector(),e=o.normalize(i.up),h=o.normalize(n),r=o.magnitude(n)*Math.tan(i.fovY),a=t.x*r/s.width,l=t.y/s.width*r,u=o.cross(e,h),c=o.cross(h,u),d=o.add(o.scale(a,u),o.scale(l,c));return i.moveBy(d)}))}async rotateCamera(t){return this.transformCamera((({camera:i,viewport:s})=>{const n=o.normalize(i.up),e=o.normalize(o.subtract(i.lookAt,i.position)),h=o.cross(n,e),r=o.cross(e,h),a=o.normalize({x:t.x*h.x+t.y*r.x,y:t.x*h.y+t.y*r.y,z:t.x*h.z+t.y*r.z}),l=o.cross(a,e),u=3*Math.PI*t.x/s.width,c=3*Math.PI*t.y/s.height,d=Math.abs(u)+Math.abs(c);return i.rotateAroundAxis(d,l)}))}async rotateCameraAtPoint(t,i){return this.transformCamera((({camera:s,viewport:n,boundingBox:e,depthBuffer:h})=>{if(null==this.worldRotationPoint){const t=c.center(e);this.worldRotationPoint=null!=h?this.getWorldPoint(i,h,t):s.lookAt}const r=o.normalize(s.up),a=o.normalize(o.subtract(s.lookAt,s.position)),l=o.cross(r,a),u=o.cross(a,l),d=o.normalize({x:t.x*l.x+t.y*u.x,y:t.x*l.y+t.y*u.y,z:t.x*l.z+t.y*u.z}),f=o.cross(d,a),v=3*Math.PI*t.x/n.width,w=3*Math.PI*t.y/n.height,m=Math.abs(v)+Math.abs(w),p=s.rotateAroundAxisAtPoint(m,this.worldRotationPoint,f);return p.update({lookAt:o.add(o.scale(s.distanceToBoundingBoxCenter()/o.magnitude(p.viewVector()),p.viewVector()),p.position)})}))}async zoomCamera(t){return this.transformCamera((({camera:i,viewport:s})=>{const n=i.viewVector(),e=o.normalize(n),h=o.magnitude(n),r=o.add(i.position,o.scale(3*h*t/s.height,e));return i.update({position:r})}))}async zoomCameraToPoint(t,i){return this.transformCamera((({camera:s,viewport:n,frame:e,depthBuffer:h})=>{const r=e.scene.camera,a=r.direction,c=s.toFrameCamera(),d=n.transformPointToRay(t,e.image,c);if(null==this.zoomData){const i=l.fromNormalAndCoplanarPoint(a,r.lookAt),n=u.intersectPlane(d,i);if(null==n)return console.warn("Cannot determine fallback point for zoom. Ray does not intersect plane."),s;const e=null!=h?this.getWorldPoint(t,h,n):n,o=l.fromNormalAndCoplanarPoint(a,e);this.zoomData={hitPt:e,hitPlane:o}}if(null!=this.zoomData){const{hitPt:t,hitPlane:e}=this.zoomData,h=o.distance(s.position,t),r=u.at(d,6*h*i/n.height),a=l.projectPoint(e,r),c=s.update({position:r,lookAt:a});if(o.distance(r,a)>=c.near)return c}return s}))}async endInteraction(){this.isInteracting()&&(this.currentCamera=void 0,this.worldRotationPoint=void 0,this.panData=void 0,this.zoomData=void 0,this.resetLastAngle(),this.interactionFinishedEmitter.emit(),await this.stream.endInteraction())}resetLastAngle(){this.lastAngle=void 0}isInteracting(){return null!=this.currentCamera}pixelThreshold(t){return(this.isCoarseInputDevice(t)?this.getConfig().coarsePointerThreshold:this.getConfig().finePointerThreshold)*window.devicePixelRatio}async hitItems(t){var i;const s=await this.getScene().raycaster().hitItems(t);return null!==(i=null==s?void 0:s.hits)&&void 0!==i?i:[]}emitTapEvent(t,i,s={},n=0){const{altKey:e=!1,ctrlKey:h=!1,metaKey:o=!1,shiftKey:r=!1}=s;t({position:i,altKey:e,ctrlKey:h,metaKey:o,shiftKey:r,buttons:n})}isCoarseInputDevice(t){return t||window.matchMedia("(pointer: coarse)").matches}getWorldPoint(t,i,s){const n=this.getViewport(),e=n.transformPointToFrame(t,i);return i.isDepthAtFarPlane(e)?n.transformPointToWorldSpace(t,i):s}}const Ft=[.2,.15,.25,.25,.15];class jt{constructor(t,i,s,n,e,h,o,r,a){this.downEvent=t,this.upEvent=i,this.moveEvent=s,this.rotateInteraction=n,this.rotatePointInteraction=e,this.zoomInteraction=h,this.panInteraction=o,this.twistInteraction=r,this.getConfig=a,this.primaryInteraction=this.rotateInteraction,this.isDragging=!1,this.keyboardControls=!1,this.disableIndividualInteractions=!1,this.primaryInteractionTypeChange=new m,this.handleDownEvent=this.handleDownEvent.bind(this),this.handleMouseWheel=this.handleMouseWheel.bind(this),this.handleWindowMove=this.handleWindowMove.bind(this),this.handleWindowUp=this.handleWindowUp.bind(this)}initialize(t,i){this.element=t,this.interactionApi=i,t.addEventListener(this.downEvent,this.handleDownEvent),t.addEventListener("wheel",this.handleMouseWheel)}dispose(){var t,i;null===(t=this.element)||void 0===t||t.removeEventListener(this.downEvent,this.handleDownEvent),null===(i=this.element)||void 0===i||i.removeEventListener("wheel",this.handleMouseWheel),this.element=void 0}onPrimaryInteractionTypeChange(t){return this.primaryInteractionTypeChange.on(t)}setCurrentInteractionType(t){var i;switch(t){case"rotate":this.currentInteraction=this.rotateInteraction;break;case"zoom":this.currentInteraction=this.zoomInteraction;break;case"pan":this.currentInteraction=this.panInteraction;break;case"twist":this.currentInteraction=this.twistInteraction;break;case"rotate-point":this.currentInteraction=this.rotatePointInteraction;break;default:this.currentInteraction=void 0}if(this.draggingInteraction){const t=this.draggingInteraction.getPosition();this.draggingInteraction=this.currentInteraction||this.primaryInteraction,null===(i=this.interactionApi)||void 0===i||i.resetLastAngle(),this.draggingInteraction.setPosition(t)}}getPrimaryInteractionType(){return this.primaryInteraction.getType()}getCurrentInteractionType(){return(this.currentInteraction||this.primaryInteraction).getType()}setPrimaryInteractionType(t){switch(t){case"rotate":this.primaryInteraction=this.rotateInteraction;break;case"rotate-point":this.primaryInteraction=this.rotatePointInteraction;break;case"zoom":this.primaryInteraction=this.zoomInteraction;break;case"pan":this.primaryInteraction=this.panInteraction}this.primaryInteractionTypeChange.emit()}setDefaultKeyboardControls(t){this.keyboardControls=t}handleDownEvent(t){this.interactionTimer=window.setTimeout((()=>{this.downPosition=a.create(t.screenX,t.screenY),this.downPositionCanvas=this.getCanvasPosition(t),this.interactionTimer=void 0,null!=this.lastMoveEvent&&this.handleWindowMove(this.lastMoveEvent)}),this.getConfig().interactions.interactionDelay),window.addEventListener(this.moveEvent,this.handleWindowMove),window.addEventListener(this.upEvent,this.handleWindowUp)}handleWindowMove(t){if(null==this.interactionTimer){if(this.disableIndividualInteractions)return;const i=a.create(t.screenX,t.screenY),s=null!=this.interactionApi?this.interactionApi.pixelThreshold(this.isTouch(t)):2;null!=this.downPosition&&a.distance(i,this.downPosition)>=s&&!this.isDragging&&(this.beginDrag(t),this.isDragging=!0),this.isDragging&&this.drag(t)}this.lastMoveEvent=t}async handleWindowUp(t){this.isDragging&&(this.endDrag(t),this.isDragging=!1),null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0),window.removeEventListener(this.moveEvent,this.handleWindowMove),window.removeEventListener(this.upEvent,this.handleWindowUp),this.lastMoveEvent=void 0}beginDrag(t){this.keyboardControls&&t.metaKey&&t.shiftKey?this.currentInteraction=this.rotatePointInteraction:this.keyboardControls&&t.shiftKey?this.currentInteraction=this.zoomInteraction:this.keyboardControls&&(t.metaKey||t.ctrlKey)?this.currentInteraction=this.panInteraction:this.keyboardControls&&t.altKey&&(this.currentInteraction=this.rotateInteraction),1===t.buttons?this.draggingInteraction=this.currentInteraction||this.primaryInteraction:2===t.buttons&&(this.draggingInteraction=this.panInteraction),null!=this.draggingInteraction&&null!=this.interactionApi&&null!=this.element&&(this.zoomInteraction.endDrag(t,this.interactionApi),this.draggingInteraction.beginDrag(t,this.downPositionCanvas||a.create(t.clientX,t.clientY),this.interactionApi,this.element))}drag(t){this.currentInteraction=this.keyboardControls&&t.altKey&&t.shiftKey?this.twistInteraction:void 0,this.draggingInteraction=this.currentInteraction||this.draggingInteraction||this.primaryInteraction,null!=this.draggingInteraction&&null!=this.interactionApi&&this.draggingInteraction.drag(t,this.interactionApi)}endDrag(t){null!=this.draggingInteraction&&null!=this.interactionApi&&(this.draggingInteraction.endDrag(t,this.interactionApi),this.draggingInteraction=void 0)}handleMouseWheel(t){if(t.preventDefault(),null!=this.element&&null!=this.interactionApi){const i=-this.wheelDeltaToPixels(t.deltaY,t.deltaMode)/10,s=this.element.getBoundingClientRect(),n=V(t,s);Ft.forEach(((t,s)=>{window.setTimeout((()=>{null!=this.interactionApi&&this.zoomInteraction.zoomToPoint(n,i*t,this.interactionApi)}),2*s)}))}}wheelDeltaToPixels(t,i){null==this.computedBodyStyle&&(this.computedBodyStyle=window.getComputedStyle(document.body));const s=null==this.computedBodyStyle.fontSize||""===this.computedBodyStyle.fontSize||isNaN(parseFloat(this.computedBodyStyle.fontSize))?19.2:1.2*parseFloat(this.computedBodyStyle.fontSize);return 1===i?null==this.computedBodyStyle.lineHeight||""===this.computedBodyStyle.lineHeight||isNaN(parseFloat(this.computedBodyStyle.lineHeight))?t*s:t*parseFloat(this.computedBodyStyle.lineHeight):2===i?null==this.computedBodyStyle.height||""===this.computedBodyStyle.height||isNaN(parseFloat(this.computedBodyStyle.height))?t*window.innerHeight:t*parseFloat(this.computedBodyStyle.height):t}getCanvasPosition(t){var i;const s=null===(i=this.element)||void 0===i?void 0:i.getBoundingClientRect(),n=null!=s?a.create(s.left,s.top):void 0;return null!=n?a.subtract(a.create(t.clientX,t.clientY),n):void 0}isTouch(t){return null!=window.PointerEvent&&t instanceof PointerEvent&&"touch"===t.pointerType}}class At{setPosition(t){this.currentPosition=t}getPosition(){return this.currentPosition}getType(){return this.type}beginDrag(t,i,s,n){}drag(t,i){}endDrag(t,i){null!=this.currentPosition&&(i.endInteraction(),this.currentPosition=void 0)}zoom(t,i){}}class Bt extends At{constructor(){super(...arguments),this.type="rotate"}beginDrag(t,i,s){null==this.currentPosition&&(this.currentPosition=a.create(t.screenX,t.screenY),s.beginInteraction())}drag(t,i){if(null!=this.currentPosition){const s=a.create(t.screenX,t.screenY),n=a.subtract(s,this.currentPosition);i.rotateCamera(n),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class Lt extends At{constructor(){super(...arguments),this.type="rotate-point"}beginDrag(t,i,s){null==this.currentPosition&&(this.currentPosition=a.create(t.screenX,t.screenY),this.startingPosition=i,s.beginInteraction())}drag(t,i){if(null!=this.currentPosition&&null!=this.startingPosition){const s=a.create(t.screenX,t.screenY),n=a.subtract(s,this.currentPosition);i.rotateCameraAtPoint(n,this.startingPosition),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class Kt extends At{constructor(t=1e3){super(),this.interactionTimeout=t,this.type="zoom",this.didTransformBegin=!1}beginDrag(t,i,s,n){if(null==this.currentPosition){this.currentPosition=a.create(t.clientX,t.clientY);const i=n.getBoundingClientRect(),e=V(t,i);this.startPt=e,s.beginInteraction()}}drag(t,i){if(null!=this.currentPosition){const s=a.create(t.clientX,t.clientY),n=a.subtract(s,this.currentPosition);null!=this.startPt&&(i.zoomCameraToPoint(this.startPt,n.y),this.currentPosition=s)}}endDrag(t,i){super.endDrag(t,i),this.stopInteractionTimer(),this.didTransformBegin=!1,this.startPt=void 0}zoom(t,i){this.operateWithTimer(i,(()=>i.zoomCamera(t)))}zoomToPoint(t,i,s){this.operateWithTimer(s,(()=>s.zoomCameraToPoint(t,i)))}beginInteraction(t){this.didTransformBegin=!0,t.beginInteraction()}endInteraction(t){this.didTransformBegin=!1,t.endInteraction()}resetInteractionTimer(t){this.stopInteractionTimer(),this.startInteractionTimer(t)}startInteractionTimer(t){this.interactionTimer=window.setTimeout((()=>{this.interactionTimer=void 0,this.endInteraction(t)}),this.interactionTimeout)}stopInteractionTimer(){null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0)}operateWithTimer(t,i){this.didTransformBegin||this.beginInteraction(t),this.resetInteractionTimer(t),i()}}class $t extends At{constructor(){super(...arguments),this.type="pan"}beginDrag(t,i,s,n){null==this.currentPosition&&(this.currentPosition=a.create(t.screenX,t.screenY),this.canvasRect=n.getBoundingClientRect(),s.beginInteraction())}drag(t,i){if(null!=this.currentPosition&&null!=this.canvasRect){const s=V(t,this.canvasRect);i.panCameraToScreenPoint(s),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class Nt extends At{constructor(){super(...arguments),this.type="twist"}beginDrag(t,i,s){this.currentPosition=a.create(t.screenX,t.screenY),s.beginInteraction()}drag(t,i){const s=a.create(t.screenX,t.screenY);this.currentPosition=s,i.twistCamera(s)}endDrag(t,i){super.endDrag(t,i)}}class Ut extends jt{constructor(t,i=new Bt,s=new Lt,n=new Kt,e=new $t,h=new Nt){super("mousedown","mouseup","mousemove",i,s,n,e,h,t)}}class Vt{initialize(t,i){this.element=t,this.interactionApi=i}dispose(){this.element=void 0}handleTwoPointTouchMove(t,i){var s,n,e,h;if(null!=this.currentPosition1&&null!=this.currentPosition2){const o=a.scale(a.add(a.subtract(t,this.currentPosition1),a.subtract(i,this.currentPosition2)),.25,.25),l=.5*(a.distance(t,i)-a.distance(this.currentPosition1,this.currentPosition2)),u=d.create(a.subtract(this.currentPosition1,this.currentPosition2),a.subtract(t,i)),c=r.toDegrees(Math.atan2(d.determinant(u),d.dot(u)));null===(s=this.interactionApi)||void 0===s||s.beginInteraction(),null===(n=this.interactionApi)||void 0===n||n.zoomCamera(l),null===(e=this.interactionApi)||void 0===e||e.panCameraByDelta(o),null===(h=this.interactionApi)||void 0===h||h.twistCamera(c)}this.currentPosition1=t,this.currentPosition2=i}}class Wt extends Vt{constructor(){super(),this.touchPoints={},this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this)}dispose(){var t;null===(t=this.element)||void 0===t||t.removeEventListener("pointerdown",this.handlePointerDown),super.dispose()}initialize(t,i){super.initialize(t,i),t.addEventListener("pointerdown",this.handlePointerDown)}handlePointerDown(t){const i=a.create(t.screenX,t.screenY);this.touchPoints=Object.assign(Object.assign({},this.touchPoints),{[t.pointerId]:i}),1===Object.keys(this.touchPoints).length&&(window.addEventListener("pointermove",this.handlePointerMove),window.addEventListener("pointerup",this.handlePointerUp))}handlePointerMove(t){null!=this.touchPoints[t.pointerId]&&(this.touchPoints[t.pointerId]=a.create(t.screenX,t.screenY));const i=Object.keys(this.touchPoints);2===i.length&&this.handleTwoPointTouchMove(this.touchPoints[i[0]],this.touchPoints[i[1]])}handlePointerUp(t){var i;delete this.touchPoints[t.pointerId];const s=Object.keys(this.touchPoints);1===s.length&&(null===(i=this.interactionApi)||void 0===i||i.endInteraction(),this.currentPosition1=void 0,this.currentPosition2=void 0),0===s.length&&(window.removeEventListener("pointermove",this.handlePointerMove),window.removeEventListener("pointerup",this.handlePointerUp))}}class qt extends jt{constructor(t){super("pointerdown","pointerup","pointermove",new Bt,new Lt,new Kt,new $t,new Nt,t),this.touchPoints=new Set,this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this)}initialize(t,i){super.initialize(t,i),t.addEventListener("pointerdown",this.handlePointerDown)}handlePointerDown(t){this.downPosition=a.create(t.screenX,t.screenY),this.touchPoints.add(t.pointerId),1===this.touchPoints.size&&window.addEventListener("pointerup",this.handlePointerUp),2===this.touchPoints.size&&(this.disableIndividualInteractions=!0)}handlePointerUp(t){this.touchPoints.delete(t.pointerId),this.touchPoints.size<2&&(this.disableIndividualInteractions=!1),0===this.touchPoints.size&&window.removeEventListener("pointerup",this.handlePointerUp)}}class Ht extends Vt{constructor(){super(),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}dispose(){var t;null===(t=this.element)||void 0===t||t.removeEventListener("touchstart",this.handleTouchStart),super.dispose()}initialize(t,i){super.initialize(t,i),t.addEventListener("touchstart",this.handleTouchStart)}handleTouchStart(t){if(t.touches.length>=1){const i=t.touches[0],s=t.touches[1];this.currentPosition1=a.create(i.screenX,i.screenY),this.currentPosition2=null!=s?a.create(s.screenX,s.screenY):void 0,window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),window.addEventListener("touchend",this.handleTouchEnd)}}handleTouchMove(t){if(1===t.touches.length)this.handleOnePointTouchMove(t.touches[0]);else if(2===t.touches.length){const i=a.create(t.touches[0].clientX,t.touches[0].clientY),s=a.create(t.touches[1].clientX,t.touches[1].clientY);this.handleTwoPointTouchMove(i,s)}}handleTouchEnd(t){var i;null===(i=this.interactionApi)||void 0===i||i.endInteraction(),this.isInteracting=!1,window.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchEnd)}handleOnePointTouchMove(t){var i,s,n;const e=a.create(t.screenX,t.screenY);if(null!=this.currentPosition1){const t=a.subtract(e,this.currentPosition1),h=(null===(i=this.interactionApi)||void 0===i?void 0:i.pixelThreshold(!0))||2;(a.distance(e,this.currentPosition1)>=h||this.isInteracting)&&(null===(s=this.interactionApi)||void 0===s||s.beginInteraction(),null===(n=this.interactionApi)||void 0===n||n.rotateCamera(t),this.isInteracting=!0)}this.currentPosition1=e}}class Gt{constructor(t,i,s,n){this.downEvent=t,this.upEvent=i,this.moveEvent=s,this.getConfig=n,this.handleDown=this.handleDown.bind(this),this.handleUp=this.handleUp.bind(this),this.handleMove=this.handleMove.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerEnd=this.handlePointerEnd.bind(this),this.clearPositions=this.clearPositions.bind(this),this.restartDoubleTapTimer=this.restartDoubleTapTimer.bind(this),this.clearDoubleTapTimer=this.clearDoubleTapTimer.bind(this),this.restartLongPressTimer=this.restartLongPressTimer.bind(this),this.clearLongPressTimer=this.clearLongPressTimer.bind(this),this.setPointerPositions=this.setPointerPositions.bind(this),this.emit=this.emit.bind(this)}dispose(){var t,i;null===(t=this.element)||void 0===t||t.removeEventListener(this.downEvent,this.handleDown),null===(i=this.element)||void 0===i||i.removeEventListener("touchstart",this.handleTouchStart),this.element=void 0,this.clearDoubleTapTimer(),this.clearLongPressTimer()}initialize(t,i){this.element=t,this.interactionApi=i,t.addEventListener(this.downEvent,this.handleDown),t.addEventListener("touchstart",this.handleTouchStart)}handleTouchStart(t){1===t.touches.length&&(this.setPointerPositions(a.create(t.touches[0].clientX,t.touches[0].clientY)),this.restartLongPressTimer(),window.addEventListener("touchend",this.handleTouchEnd),window.addEventListener("touchmove",this.handleTouchMove))}handleTouchMove(t){t.touches.length>0&&this.handlePointerMove(a.create(t.touches[0].clientX,t.touches[0].clientY),!0)}handleTouchEnd(t){null!=this.pointerDownPosition&&(window.removeEventListener("touchend",this.handleTouchEnd),window.removeEventListener("touchmove",this.handleTouchMove)),this.handlePointerEnd(this.pointerDownPosition)}handleDown(t){this.setPointerPositions(a.create(t.clientX,t.clientY)),this.buttons=t.buttons,this.restartLongPressTimer({altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}),window.addEventListener(this.upEvent,this.handleUp),window.addEventListener(this.moveEvent,this.handleMove)}handleMove(t){this.handlePointerMove(a.create(t.clientX,t.clientY),this.isTouch(t))}handleUp(t){null!=this.pointerDownPosition&&(window.removeEventListener(this.upEvent,this.handleUp),window.removeEventListener(this.moveEvent,this.handleMove)),this.handlePointerEnd(a.create(t.clientX,t.clientY),{altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey},this.buttons,this.isTouch(t)),this.buttons=void 0}handlePointerMove(t,i){var s;const n=(null===(s=this.interactionApi)||void 0===s?void 0:s.pixelThreshold(i))||2;null!=this.pointerDownPosition&&a.distance(t,this.pointerDownPosition)>=n&&null==this.interactionTimer&&this.clearPositions()}handlePointerEnd(t,i={},s=0,n=!1){var e,h;null!=t&&(null!=this.longPressTimer&&this.emit(null===(e=this.interactionApi)||void 0===e?void 0:e.tap)(t,i,s),null!=this.doubleTapTimer&&null!=this.secondPointerDownPosition&&(this.emit(null===(h=this.interactionApi)||void 0===h?void 0:h.doubleTap)(t,i,s,this.secondPointerDownPosition),this.clearDoubleTapTimer())),this.pointerDownPosition=void 0,this.clearLongPressTimer()}emit(t){return(i,s={},n=0,e,h=!1)=>{var o;const r=e||this.pointerDownPosition,l=(null===(o=this.interactionApi)||void 0===o?void 0:o.pixelThreshold(h))||1;let u;null!=this.interactionTimer?u=this.getCanvasPosition(r||i):null!=r&&a.distance(r,i)<=l&&(u=this.getCanvasPosition(i)),null!=u&&null!=t&&t(u,s,n)}}getCanvasPosition(t){var i;const s=null===(i=this.element)||void 0===i?void 0:i.getBoundingClientRect(),n=null!=s?a.create(s.left,s.top):void 0;return null!=n?a.subtract(a.create(t.x,t.y),n):void 0}clearPositions(){this.pointerDownPosition=void 0,this.firstPointerDownPosition=void 0,this.secondPointerDownPosition=void 0,this.clearDoubleTapTimer(),this.clearLongPressTimer(),this.clearInteractionTimer()}clearDoubleTapTimer(){null!=this.doubleTapTimer&&window.clearTimeout(this.doubleTapTimer),this.doubleTapTimer=void 0,this.firstPointerDownPosition=void 0,this.secondPointerDownPosition=void 0}restartDoubleTapTimer(){this.clearDoubleTapTimer(),this.doubleTapTimer=window.setTimeout((()=>this.clearDoubleTapTimer()),this.getConfig().events.doubleTapThreshold)}clearLongPressTimer(){null!=this.longPressTimer&&window.clearTimeout(this.longPressTimer),this.longPressTimer=void 0}restartLongPressTimer(t={}){this.clearLongPressTimer(),this.longPressTimer=window.setTimeout((()=>{var i;this.pointerDownPosition&&this.emit(null===(i=this.interactionApi)||void 0===i?void 0:i.longPress)(this.pointerDownPosition,t,this.buttons),this.clearLongPressTimer()}),this.getConfig().events.longPressThreshold)}restartInteractionTimer(){this.clearInteractionTimer(),this.interactionTimer=window.setTimeout((()=>{this.interactionTimer=void 0}),this.getConfig().interactions.interactionDelay)}clearInteractionTimer(){null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0)}setPointerPositions(t){this.pointerDownPosition=t,this.restartInteractionTimer(),null==this.firstPointerDownPosition?(this.restartDoubleTapTimer(),this.firstPointerDownPosition=t):this.secondPointerDownPosition=t}isTouch(t){return null!=window.PointerEvent&&t instanceof PointerEvent&&"touch"===t.pointerType}}class Jt{constructor(t,i,s){this.stream=t,this.configProvider=i,this.imageScaleProvider=s}predicate(t){return!!t.altKey}async fn(t){var i;const s=this.imageScaleProvider(),n=await this.stream.hitItems({point:a.scale(t.position,(null==s?void 0:s.x)||1,(null==s?void 0:s.y)||1)},!0);null!=(null===(i=n.hitItems)||void 0===i?void 0:i.hits)&&n.hitItems.hits.length>0?await this.stream.flyTo({itemId:n.hitItems.hits[0].itemId,animation:{duration:C(this.configProvider().animation.durationMs)}}):console.debug(`No hit results found for fly to part [position={x: ${t.position.x}, y: ${t.position.y}}]`)}}function _t(t,i,s,n,e=1e3){let h,o,r=0,a=[];return s&&setInterval((()=>{if(null!=o){5===a.length?a=[...a.slice(1),o]:a.push(o);const t=a.reduce(((t,i)=>t+i))/a.length;console.debug(`Paint rate: ${o}fps`),console.debug(`Paint rate (avg): ${t}`),o=void 0}}),1e3),s=>(r++,null==h&&(h=window.setInterval((()=>{!function(t,i){const s=t.takeMeasurements();s.length>0&&i(s)}(t,n),0===r&&null!=h&&(window.clearInterval(h),h=void 0)}),e)),t.measure((async()=>{const t=await i(s);return o=null==o?1:o+1,t})).finally((()=>{r--})))}const Xt=new class{constructor(t,i=window.performance){this.name=t,this.perf=i,this.measures=new Set,this.nextId=0}clearMeasurements(){this.perf.clearMeasures(this.name)}measure(t){if(null!=(i=t)&&i.then instanceof Function&&i.catch instanceof Function&&i.finally instanceof Function){const i=this.begin();return t.finally((()=>this.end(i)))}if("function"==typeof t){const i=this.begin(),s=t();return this.end(i),s}throw new Error("Input must be a function or Promise");var i}takeMeasurements(){const t=this.perf.getEntriesByName(this.name);return this.clearMeasurements(),t}takeLastMeasurement(){const t=this.takeMeasurements();return t[t.length-1]}begin(){const t=`${this.name}-${this.nextId++}`;return this.measures.add(t),this.perf.mark(t),t}end(t){this.perf.measure(this.name,t),this.perf.clearMarks(t),this.measures.delete(t)}}("paint_time");class Yt extends x{constructor(t=new E,i=!1,s=75e3,n=3e4){super(t,i),this.uninteractiveThreshold=s,this.offlineThreshold=n,this.handleOffline=this.handleOffline.bind(this),this.handleOnline=this.handleOnline.bind(this)}async connect(t,i={}){return window.addEventListener("offline",this.handleOffline),window.addEventListener("online",this.handleOnline),super.onRequest((()=>this.restartUninteractiveTimeout())),super.onResponse((()=>this.restartUninteractiveTimeout())),this.restartUninteractiveTimeout(),super.connect(t,i)}dispose(){window.removeEventListener("offline",this.handleOffline),window.removeEventListener("online",this.handleOnline),this.clearUninteractiveTimeout(),this.uninteractiveTimeout=void 0,this.clearOfflineTimeout(),this.offlineTimeout=void 0,super.dispose()}handleOffline(){this.restartOfflineTimeout()}handleOnline(){this.clearOfflineTimeout()}restartOfflineTimeout(){this.clearOfflineTimeout(),this.offlineTimeout=setTimeout((()=>{super.log("Disposing of StreamApi due to loss of network connection."),this.dispose()}),this.offlineThreshold)}clearOfflineTimeout(){null!=this.offlineTimeout&&clearTimeout(this.offlineTimeout)}restartUninteractiveTimeout(){this.clearUninteractiveTimeout(),this.uninteractiveTimeout=setTimeout((()=>{super.log("Disposing of StreamApi due to lack of interactivity."),this.dispose()}),this.uninteractiveThreshold)}clearUninteractiveTimeout(){null!=this.uninteractiveTimeout&&clearTimeout(this.uninteractiveTimeout)}}const Qt=[0,1e3,1e3,5e3],Zt=class{constructor(s){t(this,s),this.tap=i(this,"tap",7),this.doubletap=i(this,"doubletap",7),this.longpress=i(this,"longpress",7),this.frameReceived=i(this,"frameReceived",7),this.frameDrawn=i(this,"frameDrawn",7),this.tokenExpired=i(this,"tokenExpired",7),this.connectionChange=i(this,"connectionChange",7),this.sceneReady=i(this,"sceneReady",7),this.sceneChanged=i(this,"sceneChanged",7),this.interactionStarted=i(this,"interactionStarted",7),this.interactionFinished=i(this,"interactionFinished",7),this.sessionidchange=i(this,"sessionidchange",7),this.dimensionschange=i(this,"dimensionschange",7),this.configEnv="platprod",this.cameraControls=!0,this.keyboardControls=!0,this.rotateAroundTapPoint=!0,this.experimentalGhostingOpacity=0,this.selectionMaterial=I,this.stencilBuffer=new L(this.hostElement),this.stateMap={cursorManager:new G},this.interactionHandlers=[],this.tapKeyInteractions=[],this.isStreamStarted=!1,this.internalFrameDrawnDispatcher=new m,this.handleElementResize=this.handleElementResize.bind(this),this.streamSessionId=this.sessionId}componentWillLoad(){this.updateResolvedConfig(),this.calculateComponentDimensions(),this.resizeObserver=new Ot(this.handleElementResize),this.registerSlotChangeListeners();const t=new E;if(t.onClose((()=>this.handleWebSocketClose())),this.stream=new Yt(t,this.getResolvedConfig().flags.logWsMessages),this.setupStreamListeners(),this.commands=new Mt(this.stream,(()=>this.getResolvedConfig())),this.commands.register("stream.connect",(t=>function({clientId:t,sessionId:i,resource:s}){return({stream:n,config:e})=>{if("stream-key"===s.type){const h=function(t,i,s,n){return w.appendPath(null!=s?w.toString(w.parseAndAddParams("/ws",{clientId:s,sessionId:n})):`/stream-keys/${i.id}/session`,w.parse(t.network.renderingHost))}(e,s,t,i),o={url:w.toString(h),protocols:["ws.vertexvis.com"]},r={EXPERIMENTAL_frameDelivery:Object.assign(Object.assign({},e.EXPERIMENTAL_frameDelivery),{rateLimitingEnabled:e.flags.throttleFrameDelivery}),EXPERIMENTAL_adaptiveRendering:Object.assign(Object.assign({},e.EXPERIMENTAL_adaptiveRendering),{enabled:e.flags.adaptiveRendering}),EXPERIMENTAL_qualityOfService:Object.assign({},e.EXPERIMENTAL_qualityOfService)};return n.connect(o,r)}throw new b(`Cannot load resource. Invalid type ${s.type}`)}}(t))),this.streamSessionId=this.sessionId,null==this.streamSessionId)try{this.streamSessionId=function(t,i){const s=window.localStorage.getItem("vertexvis:stream-sessions");if(null!=s)return i(JSON.parse(s))}(0,(t=>this.clientId?t[this.clientId]:void 0))}catch(t){}this.updateStreamAttributes(),this.stateMap.cursorManager.onChanged.on((()=>this.handleCursorChanged()))}componentDidLoad(){var t,i;if(this.interactionApi=this.createInteractionApi(),null!=this.src&&this.load(this.src),this.cameraControls)if(null!=window.PointerEvent){const t=new Gt("pointerdown","pointerup","pointermove",(()=>this.getResolvedConfig()));this.baseInteractionHandler=new qt((()=>this.getResolvedConfig())),this.registerInteractionHandler(this.baseInteractionHandler),this.registerInteractionHandler(new Wt),this.registerInteractionHandler(t)}else{const t=new Gt("mousedown","mouseup","mousemove",(()=>this.getResolvedConfig()));this.baseInteractionHandler=new Ut((()=>this.getResolvedConfig())),this.registerInteractionHandler(this.baseInteractionHandler),this.registerInteractionHandler(new Ht),this.registerInteractionHandler(t)}this.keyboardControls&&null!=this.stream&&(null===(t=this.baseInteractionHandler)||void 0===t||t.setDefaultKeyboardControls(this.keyboardControls),this.registerTapKeyInteraction(new Jt(this.stream,(()=>this.getResolvedConfig()),(()=>this.getImageScale())))),this.rotateAroundTapPoint&&(null===(i=this.baseInteractionHandler)||void 0===i||i.setPrimaryInteractionType("rotate-point")),this.injectViewerApi()}render(){var t;const i=this.getCanvasDimensions();return s(n,null,s("div",{class:"viewer-container",style:{cursor:W(null!==(t=this.cursor)&&void 0!==t?t:"")},onContextMenu:t=>t.preventDefault()},s("div",{ref:t=>this.containerElement=t,class:v("canvas-container",{"enable-pointer-events ":null!=window.PointerEvent})},s("canvas",{ref:t=>{this.canvasElement=t,this.stateMap.interactionTarget=t},class:"canvas",width:null!=i?i.width:0,height:null!=i?i.height:0}),null!=this.errorMessage?s("div",{class:"error-message"},this.errorMessage):null),s("slot",null)))}async registerCommand(t,i,s){return this.commands.register(t,i,s)}async dispatchFrameDrawn(t){this.lastFrame=t,this.frame=t,this.internalFrameDrawnDispatcher.emit(t),this.frameDrawn.emit(t)}async registerInteractionHandler(t){return this.interactionHandlers.push(t),this.initializeInteractionHandler(t),{dispose:()=>{const i=this.interactionHandlers.indexOf(t);-1!==i&&(this.interactionHandlers[i].dispose(),this.interactionHandlers.splice(i,1))}}}async registerTapKeyInteraction(t){this.tapKeyInteractions=[...this.tapKeyInteractions,t]}async getInteractionTarget(){if(null!=this.stateMap.interactionTarget)return this.stateMap.interactionTarget;throw new Error("Interaction target is undefined.")}async addCursor(t,i){return this.stateMap.cursorManager.add(t,i)}async getInteractionHandlers(){return this.interactionHandlers}async getBaseInteractionHandler(){return this.baseInteractionHandler}async getJwt(){return this.jwt}handleSrcChanged(t){null!=t?this.load(t):this.unload()}handleRotateAboutTapPointChanged(){var t,i;this.updateStreamAttributes(),this.rotateAroundTapPoint?null===(t=this.baseInteractionHandler)||void 0===t||t.setPrimaryInteractionType("rotate-point"):null===(i=this.baseInteractionHandler)||void 0===i||i.setPrimaryInteractionType("rotate")}handleDepthBuffersChanged(){this.updateStreamAttributes()}handleExperimentalGhostingOpacityChanged(){this.updateStreamAttributes()}handleFeatureLinesChanged(){this.updateStreamAttributes()}handleFeatureHighlightingChanged(){this.updateStreamAttributes()}handleConfigChanged(){this.updateResolvedConfig()}handleConfigEnvChanged(){this.updateResolvedConfig()}async load(t){if(null==this.commands||null==this.dimensions)throw new D("Cannot load scene. Viewer has not been initialized.");{const{resource:i,queries:s}=null!=this.urn?S(this.urn):{},{resource:n,queries:e}=S(t),h=!p.isEqual(i,n),o=!p.isEqual(s,e),r=null!=e[0],a=await this.isSceneReady();if(this.urn=t,h||!a&&o)this.unload(),await this.connectStreamingClient(n,e[0]);else if(a&&o&&r){const t=await this.scene();await t.applySceneViewState(e[0].id)}}}async unload(){if(null!=this.streamDisposable&&(this.isStreamStarted=!1,this.streamId=void 0,this.streamDisposable.dispose(),this.lastFrame=void 0,this.frame=void 0,this.sceneViewId=void 0,this.clock=void 0,this.errorMessage=void 0,this.urn=void 0,this.stateMap.streamWorldOrientation=void 0),null!=this.canvasElement){const t=this.canvasElement.getContext("2d");null!=t&&t.clearRect(0,0,this.canvasElement.width,this.canvasElement.height)}}async scene(){return this.createScene()}async isSceneReady(){return null!=this.lastFrame&&null!=this.sceneViewId}async handleTapEvent(t){this.tapKeyInteractions.filter((i=>i.predicate(t.detail))).forEach((i=>i.fn(t.detail)))}async handleWebSocketClose(){if(this.isStreamStarted&&(this.isStreamStarted=!1,null!=this.streamId&&null!=this.urn&&!this.isReconnecting)){const{resource:t}=S(this.urn);await this.reconnectWebSocket(t,this.streamId)}}async connectStreamingClient(t,i){try{this.streamDisposable=await this.connectStream(t),this.calculateComponentDimensions();const{startStream:s}=await this.getStream().startStream(Object.assign({streamKey:{value:t.id},dimensions:this.dimensions,frameBackgroundColor:this.getBackgroundColor(),streamAttributes:this.getStreamAttributes()},"scene-view-state"===(null==i?void 0:i.type)&&{sceneViewStateId:{hex:i.id}})),{streamId:n,sessionId:e,sceneViewId:h,jwt:o,worldOrientation:r}=s||{};if(this.jwt=o||void 0,this.emitConnectionChange({status:"connected",jwt:this.jwt||""}),null!=this.clientId&&null!=(null==e?void 0:e.hex)){this.streamSessionId=e.hex,this.sessionidchange.emit(this.streamSessionId);try{!function(t,i){const s=window.localStorage,n=s.getItem(t);if(null!=n){const e=Object.assign(Object.assign({},JSON.parse(n)),i);s.setItem(t,JSON.stringify(e))}else s.setItem(t,JSON.stringify(i))}("vertexvis:stream-sessions",{[this.clientId]:this.streamSessionId})}catch(t){}}null!=(null==h?void 0:h.hex)&&(this.sceneViewId=h.hex,this.isStreamStarted=!0),null!=(null==n?void 0:n.hex)&&(this.streamId=n.hex),this.stateMap.streamWorldOrientation=K(r),console.debug(`Stream connected [stream-id=${this.streamId}, scene-view-id=${this.sceneViewId}]`),await this.waitNextDrawnFrame(15e3),this.sceneReady.emit()}catch(t){if(this.emitConnectionChange({status:"disconnected"}),t instanceof z)throw t;if(null==this.lastFrame)throw this.errorMessage="Unable to establish connection to Vertex.",console.error("Failed to establish WS connection",t),new k(this.errorMessage,t instanceof Error?t:void 0)}}async connectStream(t){var i;null==this.clientId&&console.warn("Client ID not provided, using legacy path. A Client ID will be required in an upcoming release.");const s=await this.commands.execute("stream.connect",{clientId:this.clientId,sessionId:this.sessionId||this.streamSessionId,resource:t});return this.synchronizeTime(),this.canvasRenderer=_t(Xt,function(){let t;return async i=>{const s=i.frame.sequenceNumber,n=await(e=i.frame.image.imageBytes,null!=window.createImageBitmap?async function(t){const i=new Blob([t]),s=await window.createImageBitmap(i);return{image:s,dispose:()=>s.close()}}(e):(h=e,new Promise(((t,i)=>{const s=new Blob([h]),n=URL.createObjectURL(s),e=new Image;e.addEventListener("load",(()=>{t({image:e,dispose:()=>{}}),URL.revokeObjectURL(n)})),e.addEventListener("error",(()=>{i(new T("Failed to load image data")),URL.revokeObjectURL(n)})),e.src=n}))));var e,h;return(null==t||s>t)&&(t=s,function(t,i){const s=i.viewport.calculateDrawRect(i.frame.image);i.canvas.clearRect(0,0,i.dimensions.width,i.dimensions.height),i.canvas.drawImage(t.image,s.x,s.y,s.width,s.height)}(n,i)),n.dispose(),i.frame}}(),this.getResolvedConfig().flags.logFrameRate,(t=>this.reportPerformance(t))),null!=this.containerElement&&(null===(i=this.resizeObserver)||void 0===i||i.observe(this.containerElement)),s}async synchronizeTime(){var t;try{const i=await this.getStream().syncTime({requestTime:O()});if(null!=(null===(t=i.syncTime)||void 0===t?void 0:t.replyTime)){const t=P(i.syncTime.replyTime);null!=t&&(this.clock=new M(t),console.debug(`Synchronized time [local-time=${this.clock.knownLocalTime.toISOString()}, remote-time=${this.clock.knownRemoteTime.toISOString()}]`))}}catch(t){console.error("Failed to synchronize clock",t)}}async reconnectStreamingClient(t,i,s=!1){var n,e;try{null===(n=this.streamDisposable)||void 0===n||n.dispose(),this.clock=void 0,this.emitConnectionChange({status:"connecting"}),this.streamDisposable=await this.connectStream(t);const s=await this.getStream().reconnect({streamId:{hex:i},dimensions:this.dimensions,frameBackgroundColor:this.getBackgroundColor(),streamAttributes:this.getStreamAttributes()});this.isStreamStarted=!0,this.isReconnecting=!1,this.jwt=(null===(e=s.reconnect)||void 0===e?void 0:e.jwt)||void 0,this.emitConnectionChange({status:"connected",jwt:this.jwt||""}),console.debug(`Stream reconnected [stream-id=${this.streamId}, scene-view-id=${this.sceneViewId}]`)}catch(t){if(this.emitConnectionChange({status:"disconnected"}),t instanceof z)throw t;const i="Unable to establish connection to Vertex.";throw s||(this.errorMessage=this.errorMessage||i,console.error("Failed to establish WS connection",t)),new k(i,t instanceof Error?t:void 0)}}async reconnectWebSocket(t,i,s=0){try{await this.reconnectStreamingClient(t,i,!0)}catch(n){setTimeout((()=>this.reconnectWebSocket(t,i,s+1)),Qt[Math.min(s,Qt.length-1)])}}emitConnectionChange(t){this.connectionChange.emit(t)}handleElementResize(t){t.length>=0&&null!=this.dimensions&&!f.isEqual(t[0].contentRect,this.dimensions)&&!this.isResizing&&(this.isResizing=!0,window.requestAnimationFrame((()=>this.recalculateComponentDimensions())))}registerSlotChangeListeners(){this.mutationObserver=new MutationObserver((()=>this.injectViewerApi())),this.mutationObserver.observe(this.hostElement,{childList:!0,subtree:!0})}injectViewerApi(){function t(t){return Array.from(t.querySelectorAll("*"))}t(this.hostElement).filter((t=>t.nodeName.startsWith("VERTEX-"))).reduce(((i,s)=>[...i,s,...t(s)]),[]).forEach((t=>{t.viewer=this.hostElement}))}async handleStreamRequest(t){null!=t.drawFrame?this.handleFrame(t.drawFrame):null!=t.gracefulReconnection&&this.handleGracefulReconnect(t.gracefulReconnection)}handleGracefulReconnect(t){var i;if(null!=(null===(i=t.streamId)||void 0===i?void 0:i.hex)&&null!=this.urn){const{resource:i}=S(this.urn);this.isReconnecting=!0,this.reconnectStreamingClient(i,t.streamId.hex)}}async handleFrame(t){const i=this.getCanvasDimensions(),s=this.stateMap.streamWorldOrientation;if(null!=this.canvasElement&&null!=i&&null!=s){const n=this.canvasElement.getContext("2d");if(null!=n){this.frame=$(s)(t);const e={canvas:n,dimensions:i,frame:this.frame,viewport:U.fromDimensions(this.getCanvasDimensions()||f.create(0,0))};this.frameReceived.emit(this.frame),this.frame.scene.hasChanged&&this.sceneChanged.emit();const h=await this.canvasRenderer(e);this.dispatchFrameDrawn(h)}}}waitNextDrawnFrame(t){const i=new Promise((t=>{const i=this.internalFrameDrawnDispatcher.on((s=>{t(s),i.dispose()}))}));return null!=t?g.timeout(t,i):i}calculateComponentDimensions(){const t=this.getBounds();if(null!=(null==t?void 0:t.width)&&null!=(null==t?void 0:t.height)){const i=f.create(t.width,t.height),s=f.scaleFit(2073600,i);this.hostDimensions=i,this.dimensions=null!=s?f.create(s.width,s.height):void 0}}recalculateComponentDimensions(){this.isResizing&&(this.calculateComponentDimensions(),this.isResizing=!1,this.dimensionschange.emit(this.dimensions),this.isStreamStarted&&this.getStream().updateDimensions({dimensions:this.dimensions}))}reportPerformance(t){if(this.isStreamStarted){const i={timings:t.map((t=>({receiveToPaintDuration:C(t.duration)})))};this.getStream().recordPerformance(i,!1)}}setupStreamListeners(){this.getStream().onRequest((t=>this.handleStreamRequest(t.request))),this.getStream().onRequest(function(t,i){const s=function(t){let i=!1;return s=>{const n=t();if(null!=n){const t=n.remoteTime(new Date(Date.now())),e=C(s,t);return P(e).getTime()>=0?e:void(i||(console.warn(`Possible erroneous send to receive timing. Muting for 60s. [sent-at=${s.toISOString()}, received-at=${t.toISOString()}, remote-time=${n.knownRemoteTime.toISOString()}]`),i=!0,setTimeout((()=>i=!1),6e4)))}}}(i);return n=i=>{return n=()=>n=>{const e=P(n.sentAtTime);null!=e&&t.replyResult(i,{drawFrame:{sendToReceiveDuration:s(e)}})},t=>{const{drawFrame:i}=t.request;null!=i&&n()(t)};var n},t=>{var i;const s=null===(i=t.request.requestId)||void 0===i?void 0:i.value;null!=s&&n(s)(t)};var n}(this.getStream(),(()=>this.clock)))}initializeInteractionHandler(t){if(null==this.stateMap.interactionTarget)throw new R("Cannot initialize interaction handler. Interaction target is undefined.");if(null==this.interactionApi)throw new R("Cannot initialize interaction handler. Interaction APi is undefined.");t.initialize(this.stateMap.interactionTarget,this.interactionApi)}createInteractionApi(){if(null==this.stream)throw new F("Cannot create interaction API. Component has not been initialized.");return new Rt(this.stream,(()=>this.getResolvedConfig().interactions),(()=>this.createScene()),(()=>this.frame),(()=>U.fromDimensions(this.getCanvasDimensions()||f.create(0,0))),this.tap,this.doubletap,this.longpress,this.interactionStarted,this.interactionFinished)}handleCursorChanged(){window.requestAnimationFrame((()=>{this.cursor=this.stateMap.cursorManager.getActiveCursor()}))}createScene(){if(null==this.frame||null==this.sceneViewId||null==this.stateMap.streamWorldOrientation)throw new j("Cannot create scene. Frame has not been rendered or stream not initialized.");const t="string"==typeof this.selectionMaterial?A(this.selectionMaterial):this.selectionMaterial;return new B(this.getStream(),this.frame,$(this.stateMap.streamWorldOrientation),(()=>this.getImageScale()),this.sceneViewId,t)}getBackgroundColor(){if(null!=this.containerElement)return q(this.containerElement)}getBounds(){return H(this.hostElement)}getCanvasDimensions(){return this.getResolvedConfig().flags.letterboxFrames?this.dimensions:this.hostDimensions}getImageScale(){const t=this.getCanvasDimensions();if(null!=this.dimensions&&null!=t)return a.create(this.dimensions.width/t.width,this.dimensions.height/t.height)}getStreamAttributes(){const t={depthBuffers:this.getDepthBufferStreamAttributesValue(),experimentalGhosting:this.experimentalGhostingOpacity,featureLines:this.featureLines,featureHighlighting:this.featureHighlighting};return y.ifInvalidThrow(N)(t)}updateStreamAttributes(){if(this.isStreamStarted){const t=this.getStreamAttributes();this.getStream().updateStream({streamAttributes:t})}}getDepthBufferStreamAttributesValue(){var t;return null!==(t=this.depthBuffers)&&void 0!==t?t:this.rotateAroundTapPoint?"final":void 0}updateResolvedConfig(){this.resolvedConfig=h(this.configEnv,this.config)}getResolvedConfig(){return ti("Resolved config is undefined",(()=>this.resolvedConfig))}getStream(){return ti("Stream is undefined",(()=>this.stream))}get hostElement(){return e(this)}static get watchers(){return{src:["handleSrcChanged"],rotateAroundTapPoint:["handleRotateAboutTapPointChanged"],depthBuffers:["handleDepthBuffersChanged"],experimentalGhostingOpacity:["handleExperimentalGhostingOpacityChanged"],featureLines:["handleFeatureLinesChanged"],featureHighlighting:["handleFeatureHighlightingChanged"],config:["handleConfigChanged"],configEnv:["handleConfigEnvChanged"]}}};function ti(t,i){const s=i();if(null!=s)return s;throw new Error(t)}Zt.style=":host{--image-background:var(--image-background);--viewer-background:var(--viewer-background);display:block;position:relative;width:300px;height:300px}.canvas-container{display:flex;justify-content:center;align-items:center;width:100%;height:100%;position:relative;background:var(--image-background, var(--viewer-background, #ffffff))}.enable-pointer-events{touch-action:none}.viewer-container{width:100%;height:100%;overflow:hidden;background:var(--viewer-background, #ffffff)}.error-message{position:absolute;top:50%;width:100%;transform:translateY(-50%);text-align:center}";export{Zt as vertex_viewer}
@@ -1,4 +1,4 @@
1
1
  /**!
2
2
  * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{d as e,N as t,w as a,p as n,b as r}from"./p-8e6a7bc0.js";(()=>{const r=Array.from(e.querySelectorAll("script")).find((e=>new RegExp(`/${t}(\\.esm)?\\.js($|\\?|#)`).test(e.src)||e.getAttribute("data-stencil-namespace")===t)),i={};return i.resourcesUrl=new URL(".",new URL(r.getAttribute("data-resources-url")||r.src,a.location.href)).href,((n,r)=>{const i=`__sc_import_${t.replace(/\s|-/g,"_")}`;try{a[i]=new Function("w",`return import(w);//${Math.random()}`)}catch(t){const o=new Map;a[i]=t=>{const s=new URL(t,n).href;let d=o.get(s);if(!d){const t=e.createElement("script");t.type="module",t.crossOrigin=r.crossOrigin,t.src=URL.createObjectURL(new Blob([`import * as m from '${s}'; window.${i}.m = m;`],{type:"application/javascript"})),d=new Promise((e=>{t.onload=()=>{e(a[i].m),t.remove()}})),o.set(s,d),e.head.appendChild(t)}return d}}})(i.resourcesUrl,r),a.customElements?n(i):__sc_import_viewer("./p-db46d0d3.js").then((()=>i))})().then((e=>r([["p-00723a72",[[1,"vertex-viewer-default-toolbar",{viewer:[16],placement:[1],direction:[1],animationsDisabled:[4,"animations-disabled"],animationMs:[2,"animation-ms"]}]]],["p-f36499b1",[[1,"vertex-scene-tree",{overScanCount:[2,"over-scan-count"],viewerSelector:[1,"viewer-selector"],viewer:[1040],rowData:[16],config:[16],configEnv:[1,"config-env"],controller:[1040],metadataKeys:[16],isComputingRowHeight:[32],rows:[32],totalRows:[32],scrollTop:[32],computedRowHeight:[32],stateMap:[32],connectionErrorDetails:[32],invalidateRows:[64],scrollToIndex:[64],scrollToItem:[64],expandAll:[64],collapseAll:[64],expandItem:[64],collapseItem:[64],toggleExpandItem:[64],toggleItemVisibility:[64],hideItem:[64],showItem:[64],selectItem:[64],deselectItem:[64],getRowAtIndex:[64],getRowForEvent:[64],getRowAtClientY:[64],filterItems:[64],fetchMetadataKeys:[64]},[[0,"search","handleSearch"]]]]],["p-3085d6bb",[[1,"vertex-viewer-markup",{arrowTemplateId:[1,"arrow-template-id"],circleTemplateId:[1,"circle-template-id"],freeformTemplateId:[1,"freeform-template-id"],tool:[1],disabled:[4],viewer:[16],selectedMarkupId:[1025,"selected-markup-id"],addMarkup:[64],removeMarkup:[64],getMarkupElements:[64],getMarkupElement:[64]},[[0,"markupEnd","handleMarkupEnd"],[0,"markupEditCancel","handleMarkupEditCancel"],[1,"pointerdown","handleMarkupPointerDown"]]]]],["p-d16e145b",[[1,"vertex-viewer-markup-tool",{arrowTemplateId:[1,"arrow-template-id"],circleTemplateId:[1,"circle-template-id"],freeformTemplateId:[1,"freeform-template-id"],tool:[1],disabled:[4],viewer:[16],stateMap:[32]}]]],["p-790252d6",[[1,"vertex-viewer-measurement-tool",{distanceTemplateId:[1,"distance-template-id"],tool:[1],units:[1],fractionalDigits:[2,"fractional-digits"],disabled:[4],viewer:[16],isMeasuring:[1540,"is-measuring"],snapDistance:[2,"snap-distance"],stateMap:[32]}]]],["p-cabd7a04",[[1,"vertex-viewer-view-cube",{xPositiveLabel:[1,"x-positive-label"],xNegativeLabel:[1,"x-negative-label"],yPositiveLabel:[1,"y-positive-label"],yNegativeLabel:[1,"y-negative-label"],zPositiveLabel:[1,"z-positive-label"],zNegativeLabel:[1,"z-negative-label"],standardViewsOff:[4,"standard-views-off"],animationDuration:[2,"animation-duration"],triadOff:[4,"triad-off"],worldOrientation:[1040],camera:[1040],viewer:[16],boxLength:[32],triadPosition:[32]}]]],["p-2655348f",[[1,"vertex-viewer-measurements",{distanceTemplateId:[1,"distance-template-id"],tool:[1],units:[1],fractionalDigits:[2,"fractional-digits"],disabled:[4],viewer:[16],selectedMeasurementId:[1025,"selected-measurement-id"],snapDistance:[2,"snap-distance"],addMeasurement:[64],removeMeasurement:[64],getMeasurementElement:[64],getMeasurementElements:[64]},[[0,"measureEnd","handleMeasureEnd"],[1,"pointerdown","handleMeasurementPointerDown"]]]]],["p-0e7fbbcf",[[1,"vertex-scene-tree-row",{node:[16],tree:[16],interactionsDisabled:[4,"interactions-disabled"],recurseParentSelectionDisabled:[4,"recurse-parent-selection-disabled"]}]]],["p-427b1b31",[[1,"vertex-scene-tree-toolbar-group"]]],["p-6ebafd8e",[[1,"vertex-viewer",{src:[1],clientId:[1,"client-id"],sessionId:[1,"session-id"],config:[1],configEnv:[1,"config-env"],resolvedConfig:[1040],cameraControls:[4,"camera-controls"],keyboardControls:[4,"keyboard-controls"],rotateAroundTapPoint:[4,"rotate-around-tap-point"],depthBuffers:[1,"depth-buffers"],experimentalGhostingOpacity:[2,"experimental-ghosting-opacity"],featureLines:[16],featureHighlighting:[16],selectionMaterial:[1,"selection-material"],frame:[1040],stream:[1040],stencilBuffer:[1040],dimensions:[32],hostDimensions:[32],errorMessage:[32],cursor:[32],stateMap:[32],registerCommand:[64],dispatchFrameDrawn:[64],registerInteractionHandler:[64],registerTapKeyInteraction:[64],getInteractionTarget:[64],addCursor:[64],getInteractionHandlers:[64],getBaseInteractionHandler:[64],getJwt:[64],load:[64],unload:[64],scene:[64],isSceneReady:[64],handleWebSocketClose:[64]},[[0,"tap","handleTapEvent"]]]]],["p-8de87d78",[[1,"vertex-viewer-measurement-details",{measurementModel:[16],distanceUnits:[1,"distance-units"],angleUnits:[1,"angle-units"],fractionalDigits:[2,"fractional-digits"],distanceFormatter:[16],angleFormatter:[16],hiddenDetails:[1040],hiddenDetailsJson:[1,"hidden-details"],results:[1040],summary:[1040],visibleSummary:[1040]}]]],["p-8ff4369f",[[1,"vertex-viewer-measurement-precise",{measurementModel:[16],measurementController:[1040],viewer:[16],configEnv:[1,"config-env"],config:[16],entities:[32]}]]],["p-669263ba",[[1,"vertex-scene-tree-search",{debounce:[2],disabled:[4],placeholder:[1],value:[1025],focused:[32],setFocus:[64]}],[1,"vertex-scene-tree-toolbar"]]],["p-8ebe0117",[[1,"vertex-viewer-toolbar",{placement:[1],direction:[1]}],[1,"vertex-viewer-button"],[1,"vertex-viewer-toolbar-group",{direction:[1]}]]],["p-8920a385",[[1,"vertex-viewer-dom-element",{position:[1040],positionJson:[1,"position"],rotation:[1040],rotationJson:[1,"rotation"],quaternion:[1040],quaternionJson:[1,"quaternion"],scale:[1040],scaleJson:[1,"scale"],matrix:[1040],occlusionOff:[4,"occlusion-off"],occluded:[516],billboardOff:[4,"billboard-off"],interactionsOff:[516,"interactions-off"]}],[1,"vertex-viewer-dom-group",{position:[1040],positionJson:[1,"position"],rotation:[1040],rotationJson:[1,"rotation"],quaternion:[1040],quaternionJson:[1,"quaternion"],scale:[1040],scaleJson:[1,"scale"],matrix:[1040]}],[1,"vertex-viewer-dom-renderer",{drawMode:[1,"draw-mode"],viewer:[16],camera:[1040],depthBuffer:[1040],viewport:[32],invalidateFrameCounter:[32]},[[0,"propertyChange","handlePropertyChange"]]]]],["p-3e02c716",[[1,"vertex-viewer-icon",{name:[1],size:[1]}]]],["p-6881f51b",[[1,"vertex-viewer-layer",{stretchOff:[516,"stretch-off"]}]]],["p-db9e6074",[[1,"vertex-viewer-measurement-distance",{start:[1040],startJson:[1,"start"],end:[1040],endJson:[1,"end"],distance:[1026],snapDistance:[2,"snap-distance"],units:[1],fractionalDigits:[2,"fractional-digits"],labelFormatter:[16],anchorLabelOffset:[2,"anchor-label-offset"],lineCapLength:[2,"line-cap-length"],mode:[513],interactingAnchor:[1537,"interacting-anchor"],invalid:[1540],camera:[16],depthBuffer:[16],viewer:[16],line:[32],viewport:[32],elementBounds:[32],interactionCount:[32],internalCamera:[32],internalDepthBuffer:[32],invalidateStateCounter:[32],interactiveStartPoint:[32],interactiveEndPoint:[32],stateMap:[32],computeElementMetrics:[64]}],[1,"vertex-viewer-measurement-line",{start:[16],end:[16],capLength:[2,"cap-length"],pointerEvents:[1,"pointer-events"]}]]],["p-ea7b162f",[[1,"vertex-viewer-markup-arrow",{start:[1040],startJson:[1,"start"],end:[1040],endJson:[1,"end"],mode:[513],viewer:[16],elementBounds:[32],editAnchor:[32],dispose:[64]}],[1,"vertex-viewer-markup-circle",{bounds:[1040],boundsJson:[1,"bounds"],mode:[513],viewer:[16],elementBounds:[32],startPosition:[32],editAnchor:[32],resizeBounds:[32],dispose:[64]}],[1,"vertex-viewer-markup-freeform",{points:[1040],pointsJson:[1,"points"],bounds:[1040],boundsJson:[1,"bounds"],mode:[513],viewer:[16],elementBounds:[32],resizeStartPosition:[32],editAnchor:[32],resizeBounds:[32],resizePoints:[32],screenPoints:[32],dispose:[64]}]]]],e)));
4
+ import{d as e,N as t,w as a,p as n,b as r}from"./p-8e6a7bc0.js";(()=>{const r=Array.from(e.querySelectorAll("script")).find((e=>new RegExp(`/${t}(\\.esm)?\\.js($|\\?|#)`).test(e.src)||e.getAttribute("data-stencil-namespace")===t)),i={};return i.resourcesUrl=new URL(".",new URL(r.getAttribute("data-resources-url")||r.src,a.location.href)).href,((n,r)=>{const i=`__sc_import_${t.replace(/\s|-/g,"_")}`;try{a[i]=new Function("w",`return import(w);//${Math.random()}`)}catch(t){const o=new Map;a[i]=t=>{const s=new URL(t,n).href;let d=o.get(s);if(!d){const t=e.createElement("script");t.type="module",t.crossOrigin=r.crossOrigin,t.src=URL.createObjectURL(new Blob([`import * as m from '${s}'; window.${i}.m = m;`],{type:"application/javascript"})),d=new Promise((e=>{t.onload=()=>{e(a[i].m),t.remove()}})),o.set(s,d),e.head.appendChild(t)}return d}}})(i.resourcesUrl,r),a.customElements?n(i):__sc_import_viewer("./p-db46d0d3.js").then((()=>i))})().then((e=>r([["p-00723a72",[[1,"vertex-viewer-default-toolbar",{viewer:[16],placement:[1],direction:[1],animationsDisabled:[4,"animations-disabled"],animationMs:[2,"animation-ms"]}]]],["p-f36499b1",[[1,"vertex-scene-tree",{overScanCount:[2,"over-scan-count"],viewerSelector:[1,"viewer-selector"],viewer:[1040],rowData:[16],config:[16],configEnv:[1,"config-env"],controller:[1040],metadataKeys:[16],isComputingRowHeight:[32],rows:[32],totalRows:[32],scrollTop:[32],computedRowHeight:[32],stateMap:[32],connectionErrorDetails:[32],invalidateRows:[64],scrollToIndex:[64],scrollToItem:[64],expandAll:[64],collapseAll:[64],expandItem:[64],collapseItem:[64],toggleExpandItem:[64],toggleItemVisibility:[64],hideItem:[64],showItem:[64],selectItem:[64],deselectItem:[64],getRowAtIndex:[64],getRowForEvent:[64],getRowAtClientY:[64],filterItems:[64],fetchMetadataKeys:[64]},[[0,"search","handleSearch"]]]]],["p-3085d6bb",[[1,"vertex-viewer-markup",{arrowTemplateId:[1,"arrow-template-id"],circleTemplateId:[1,"circle-template-id"],freeformTemplateId:[1,"freeform-template-id"],tool:[1],disabled:[4],viewer:[16],selectedMarkupId:[1025,"selected-markup-id"],addMarkup:[64],removeMarkup:[64],getMarkupElements:[64],getMarkupElement:[64]},[[0,"markupEnd","handleMarkupEnd"],[0,"markupEditCancel","handleMarkupEditCancel"],[1,"pointerdown","handleMarkupPointerDown"]]]]],["p-d16e145b",[[1,"vertex-viewer-markup-tool",{arrowTemplateId:[1,"arrow-template-id"],circleTemplateId:[1,"circle-template-id"],freeformTemplateId:[1,"freeform-template-id"],tool:[1],disabled:[4],viewer:[16],stateMap:[32]}]]],["p-790252d6",[[1,"vertex-viewer-measurement-tool",{distanceTemplateId:[1,"distance-template-id"],tool:[1],units:[1],fractionalDigits:[2,"fractional-digits"],disabled:[4],viewer:[16],isMeasuring:[1540,"is-measuring"],snapDistance:[2,"snap-distance"],stateMap:[32]}]]],["p-cabd7a04",[[1,"vertex-viewer-view-cube",{xPositiveLabel:[1,"x-positive-label"],xNegativeLabel:[1,"x-negative-label"],yPositiveLabel:[1,"y-positive-label"],yNegativeLabel:[1,"y-negative-label"],zPositiveLabel:[1,"z-positive-label"],zNegativeLabel:[1,"z-negative-label"],standardViewsOff:[4,"standard-views-off"],animationDuration:[2,"animation-duration"],triadOff:[4,"triad-off"],worldOrientation:[1040],camera:[1040],viewer:[16],boxLength:[32],triadPosition:[32]}]]],["p-2655348f",[[1,"vertex-viewer-measurements",{distanceTemplateId:[1,"distance-template-id"],tool:[1],units:[1],fractionalDigits:[2,"fractional-digits"],disabled:[4],viewer:[16],selectedMeasurementId:[1025,"selected-measurement-id"],snapDistance:[2,"snap-distance"],addMeasurement:[64],removeMeasurement:[64],getMeasurementElement:[64],getMeasurementElements:[64]},[[0,"measureEnd","handleMeasureEnd"],[1,"pointerdown","handleMeasurementPointerDown"]]]]],["p-0e7fbbcf",[[1,"vertex-scene-tree-row",{node:[16],tree:[16],interactionsDisabled:[4,"interactions-disabled"],recurseParentSelectionDisabled:[4,"recurse-parent-selection-disabled"]}]]],["p-427b1b31",[[1,"vertex-scene-tree-toolbar-group"]]],["p-282b5e38",[[1,"vertex-viewer",{src:[1],clientId:[1,"client-id"],sessionId:[1,"session-id"],config:[1],configEnv:[1,"config-env"],resolvedConfig:[1040],cameraControls:[4,"camera-controls"],keyboardControls:[4,"keyboard-controls"],rotateAroundTapPoint:[4,"rotate-around-tap-point"],depthBuffers:[1,"depth-buffers"],experimentalGhostingOpacity:[2,"experimental-ghosting-opacity"],featureLines:[16],featureHighlighting:[16],selectionMaterial:[1,"selection-material"],frame:[1040],stream:[1040],stencilBuffer:[1040],dimensions:[32],hostDimensions:[32],errorMessage:[32],cursor:[32],stateMap:[32],registerCommand:[64],dispatchFrameDrawn:[64],registerInteractionHandler:[64],registerTapKeyInteraction:[64],getInteractionTarget:[64],addCursor:[64],getInteractionHandlers:[64],getBaseInteractionHandler:[64],getJwt:[64],load:[64],unload:[64],scene:[64],isSceneReady:[64],handleWebSocketClose:[64]},[[0,"tap","handleTapEvent"]]]]],["p-8de87d78",[[1,"vertex-viewer-measurement-details",{measurementModel:[16],distanceUnits:[1,"distance-units"],angleUnits:[1,"angle-units"],fractionalDigits:[2,"fractional-digits"],distanceFormatter:[16],angleFormatter:[16],hiddenDetails:[1040],hiddenDetailsJson:[1,"hidden-details"],results:[1040],summary:[1040],visibleSummary:[1040]}]]],["p-8ff4369f",[[1,"vertex-viewer-measurement-precise",{measurementModel:[16],measurementController:[1040],viewer:[16],configEnv:[1,"config-env"],config:[16],entities:[32]}]]],["p-669263ba",[[1,"vertex-scene-tree-search",{debounce:[2],disabled:[4],placeholder:[1],value:[1025],focused:[32],setFocus:[64]}],[1,"vertex-scene-tree-toolbar"]]],["p-8ebe0117",[[1,"vertex-viewer-toolbar",{placement:[1],direction:[1]}],[1,"vertex-viewer-button"],[1,"vertex-viewer-toolbar-group",{direction:[1]}]]],["p-8920a385",[[1,"vertex-viewer-dom-element",{position:[1040],positionJson:[1,"position"],rotation:[1040],rotationJson:[1,"rotation"],quaternion:[1040],quaternionJson:[1,"quaternion"],scale:[1040],scaleJson:[1,"scale"],matrix:[1040],occlusionOff:[4,"occlusion-off"],occluded:[516],billboardOff:[4,"billboard-off"],interactionsOff:[516,"interactions-off"]}],[1,"vertex-viewer-dom-group",{position:[1040],positionJson:[1,"position"],rotation:[1040],rotationJson:[1,"rotation"],quaternion:[1040],quaternionJson:[1,"quaternion"],scale:[1040],scaleJson:[1,"scale"],matrix:[1040]}],[1,"vertex-viewer-dom-renderer",{drawMode:[1,"draw-mode"],viewer:[16],camera:[1040],depthBuffer:[1040],viewport:[32],invalidateFrameCounter:[32]},[[0,"propertyChange","handlePropertyChange"]]]]],["p-3e02c716",[[1,"vertex-viewer-icon",{name:[1],size:[1]}]]],["p-6881f51b",[[1,"vertex-viewer-layer",{stretchOff:[516,"stretch-off"]}]]],["p-db9e6074",[[1,"vertex-viewer-measurement-distance",{start:[1040],startJson:[1,"start"],end:[1040],endJson:[1,"end"],distance:[1026],snapDistance:[2,"snap-distance"],units:[1],fractionalDigits:[2,"fractional-digits"],labelFormatter:[16],anchorLabelOffset:[2,"anchor-label-offset"],lineCapLength:[2,"line-cap-length"],mode:[513],interactingAnchor:[1537,"interacting-anchor"],invalid:[1540],camera:[16],depthBuffer:[16],viewer:[16],line:[32],viewport:[32],elementBounds:[32],interactionCount:[32],internalCamera:[32],internalDepthBuffer:[32],invalidateStateCounter:[32],interactiveStartPoint:[32],interactiveEndPoint:[32],stateMap:[32],computeElementMetrics:[64]}],[1,"vertex-viewer-measurement-line",{start:[16],end:[16],capLength:[2,"cap-length"],pointerEvents:[1,"pointer-events"]}]]],["p-ea7b162f",[[1,"vertex-viewer-markup-arrow",{start:[1040],startJson:[1,"start"],end:[1040],endJson:[1,"end"],mode:[513],viewer:[16],elementBounds:[32],editAnchor:[32],dispose:[64]}],[1,"vertex-viewer-markup-circle",{bounds:[1040],boundsJson:[1,"bounds"],mode:[513],viewer:[16],elementBounds:[32],startPosition:[32],editAnchor:[32],resizeBounds:[32],dispose:[64]}],[1,"vertex-viewer-markup-freeform",{points:[1040],pointsJson:[1,"points"],bounds:[1040],boundsJson:[1,"bounds"],mode:[513],viewer:[16],elementBounds:[32],resizeStartPosition:[32],editAnchor:[32],resizeBounds:[32],resizePoints:[32],screenPoints:[32],dispose:[64]}]]]],e)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertexvis/viewer",
3
- "version": "0.12.0-canary.2",
3
+ "version": "0.12.0-canary.3",
4
4
  "description": "The Vertex SDK for viewing models.",
5
5
  "license": "MIT",
6
6
  "author": "Vertex Developers <support@vertexvis.com> (https://developer.vertexvis.com)",
@@ -50,11 +50,11 @@
50
50
  "@stencil/core": "^2.4.0",
51
51
  "@types/classnames": "^2.3.1",
52
52
  "@vertexvis/frame-streaming-protos": "^0.6.5",
53
- "@vertexvis/geometry": "^0.12.0-canary.2",
53
+ "@vertexvis/geometry": "^0.12.0-canary.3",
54
54
  "@vertexvis/scene-tree-protos": "^0.1.7",
55
55
  "@vertexvis/scene-view-protos": "^0.1.6",
56
- "@vertexvis/stream-api": "^0.12.0-canary.2",
57
- "@vertexvis/utils": "^0.12.0-canary.2",
56
+ "@vertexvis/stream-api": "^0.12.0-canary.3",
57
+ "@vertexvis/utils": "^0.12.0-canary.3",
58
58
  "@vertexvis/web-workers": "^0.1.0",
59
59
  "camel-case": "^4.1.2",
60
60
  "classnames": "^2.3.1",
@@ -76,7 +76,7 @@
76
76
  "@vertexvis/rollup-plugin-vertexvis-copyright": "^0.4.0",
77
77
  "@vertexvis/rollup-plugin-web-workers": "^0.1.0",
78
78
  "@vertexvis/typescript-config-vertexvis": "1.1.0",
79
- "@vertexwebsdk/build": "^0.12.0-canary.2",
79
+ "@vertexwebsdk/build": "^0.12.0-canary.3",
80
80
  "chance": "^1.1.8",
81
81
  "eslint": "^7.20.0",
82
82
  "eslint-plugin-react": "^7.26.1",
@@ -90,5 +90,5 @@
90
90
  "typedoc": "^0.22.6",
91
91
  "typescript": "^4.4.4"
92
92
  },
93
- "gitHead": "19a414195dd68baf4e626c32b01524edb599a977"
93
+ "gitHead": "4990214890e1f267ee351229ac279c27065b3b14"
94
94
  }
@@ -1,4 +0,0 @@
1
- /**!
2
- * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
- */
4
- import{r as t,c as i,h as s,H as n,g as e}from"./p-8e6a7bc0.js";import{p as h}from"./p-f49c0e61.js";import{v as o,l as r,p as a,h as l,r as u,e as c,n as d,f}from"./p-18e55391.js";import{c as v}from"./p-f482325b.js";import{u as w,E as m,o as p,b as g,m as y}from"./p-81c679f1.js";import{I as b,t as C,b as T,p as P,d as x,W as E,e as I,f as S,V as D,C as z,g as k,h as O,a as M,i as R,j as F,k as j,m as A,S as B}from"./p-ddcf41a6.js";import{S as L,g as K,h as $,t as N}from"./p-c3c75a47.js";import{V as U}from"./p-7b0bcbc6.js";import{g as V,c as W}from"./p-80c7425f.js";import{a as q,g as H}from"./p-639996da.js";import{C as G}from"./p-3ceae26d.js";import"./p-112455b1.js";var J,_=[],X="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(J||(J={}));var Y,Q=function(t){return Object.freeze(t)},Z=function(t,i){this.inlineSize=t,this.blockSize=i,Q(this)},tt=function(){function t(t,i,s,n){return this.x=t,this.y=i,this.width=s,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Q(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(i){return new t(i.x,i.y,i.width,i.height)},t}(),it=function(t){return t instanceof SVGElement&&"getBBox"in t},st=function(t){if(it(t)){var i=t.getBBox();return!i.width&&!i.height}return!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},nt=function(t){var i,s;if(t instanceof Element)return!0;var n=null===(s=null===(i=t)||void 0===i?void 0:i.ownerDocument)||void 0===s?void 0:s.defaultView;return!!(n&&t instanceof n.Element)},et="undefined"!=typeof window?window:{},ht=new WeakMap,ot=/auto|scroll/,rt=/^tb|vertical/,at=/msie|trident/i.test(et.navigator&&et.navigator.userAgent),lt=function(t){return parseFloat(t||"0")},ut=function(t,i,s){return void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=!1),new Z((s?i:t)||0,(s?t:i)||0)},ct=Q({devicePixelContentBoxSize:ut(),borderBoxSize:ut(),contentBoxSize:ut(),contentRect:new tt(0,0,0,0)}),dt=function(t,i){if(void 0===i&&(i=!1),ht.has(t)&&!i)return ht.get(t);if(st(t))return ht.set(t,ct),ct;var s=getComputedStyle(t),n=it(t)&&t.ownerSVGElement&&t.getBBox(),e=!at&&"border-box"===s.boxSizing,h=rt.test(s.writingMode||""),o=!n&&ot.test(s.overflowY||""),r=!n&&ot.test(s.overflowX||""),a=n?0:lt(s.paddingTop),l=n?0:lt(s.paddingRight),u=n?0:lt(s.paddingBottom),c=n?0:lt(s.paddingLeft),d=n?0:lt(s.borderTopWidth),f=n?0:lt(s.borderRightWidth),v=n?0:lt(s.borderBottomWidth),w=c+l,m=a+u,p=(n?0:lt(s.borderLeftWidth))+f,g=d+v,y=r?t.offsetHeight-g-t.clientHeight:0,b=o?t.offsetWidth-p-t.clientWidth:0,C=e?w+p:0,T=e?m+g:0,P=n?n.width:lt(s.width)-C-b,x=n?n.height:lt(s.height)-T-y,E=P+w+b+p,I=x+m+y+g,S=Q({devicePixelContentBoxSize:ut(Math.round(P*devicePixelRatio),Math.round(x*devicePixelRatio),h),borderBoxSize:ut(E,I,h),contentBoxSize:ut(P,x,h),contentRect:new tt(c,a,P,x)});return ht.set(t,S),S},ft=function(t,i,s){var n=dt(t,s),e=n.borderBoxSize,h=n.contentBoxSize,o=n.devicePixelContentBoxSize;switch(i){case J.DEVICE_PIXEL_CONTENT_BOX:return o;case J.BORDER_BOX:return e;default:return h}},vt=function(t){var i=dt(t);this.target=t,this.contentRect=i.contentRect,this.borderBoxSize=Q([i.borderBoxSize]),this.contentBoxSize=Q([i.contentBoxSize]),this.devicePixelContentBoxSize=Q([i.devicePixelContentBoxSize])},wt=function(t){if(st(t))return 1/0;for(var i=0,s=t.parentNode;s;)i+=1,s=s.parentNode;return i},mt=function(){var t=1/0,i=[];_.forEach((function(s){if(0!==s.activeTargets.length){var n=[];s.activeTargets.forEach((function(i){var s=new vt(i.target),e=wt(i.target);n.push(s),i.lastReportedSize=ft(i.target,i.observedBox),e<t&&(t=e)})),i.push((function(){s.callback.call(s.observer,n,s.observer)})),s.activeTargets.splice(0,s.activeTargets.length)}}));for(var s=0,n=i;s<n.length;s++)(0,n[s])();return t},pt=function(t){_.forEach((function(i){i.activeTargets.splice(0,i.activeTargets.length),i.skippedTargets.splice(0,i.skippedTargets.length),i.observationTargets.forEach((function(s){s.isActive()&&(wt(s.target)>t?i.activeTargets.push(s):i.skippedTargets.push(s))}))}))},gt=[],yt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ct=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Tt=function(t){return void 0===t&&(t=0),Date.now()+t},Pt=!1,xt=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var i=this;if(void 0===t&&(t=250),!Pt){Pt=!0;var s,n=Tt(t);s=function(){var s=!1;try{s=function(){var t,i=0;for(pt(i);_.some((function(t){return t.activeTargets.length>0}));)i=mt(),pt(i);return _.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),i>0}()}finally{if(Pt=!1,t=n-Tt(),!yt)return;s?i.run(1e3):t>0?i.run(t):i.start()}},function(t){if(!Y){var i=0,s=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(s,{characterData:!0}),Y=function(){s.textContent=""+(i?i--:i++)}}gt.push(t),Y()}((function(){requestAnimationFrame(s)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,i=function(){return t.observer&&t.observer.observe(document.body,bt)};document.body?i():et.addEventListener("DOMContentLoaded",i)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ct.forEach((function(i){return et.addEventListener(i,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ct.forEach((function(i){return et.removeEventListener(i,t.listener,!0)})),this.stopped=!0)},t}()),Et=function(t){!yt&&t>0&&xt.start(),!(yt+=t)&&xt.stop()},It=function(){function t(t,i){this.target=t,this.observedBox=i||J.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,i=ft(this.target,this.observedBox,!0);return it(t=this.target)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=i),this.lastReportedSize.inlineSize!==i.inlineSize||this.lastReportedSize.blockSize!==i.blockSize},t}(),St=function(t,i){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=i},Dt=new WeakMap,zt=function(t,i){for(var s=0;s<t.length;s+=1)if(t[s].target===i)return s;return-1},kt=function(){function t(){}return t.connect=function(t,i){var s=new St(t,i);Dt.set(t,s)},t.observe=function(t,i,s){var n=Dt.get(t),e=0===n.observationTargets.length;zt(n.observationTargets,i)<0&&(e&&_.push(n),n.observationTargets.push(new It(i,s&&s.box)),Et(1),xt.schedule())},t.unobserve=function(t,i){var s=Dt.get(t),n=zt(s.observationTargets,i);n>=0&&(1===s.observationTargets.length&&_.splice(_.indexOf(s),1),s.observationTargets.splice(n,1),Et(-1))},t.disconnect=function(t){var i=this,s=Dt.get(t);s.observationTargets.slice().forEach((function(s){return i.unobserve(t,s.target)})),s.activeTargets.splice(0,s.activeTargets.length)},t}(),Ot=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");kt.connect(this,t)}return t.prototype.observe=function(t,i){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!nt(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");kt.observe(this,t,i)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!nt(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");kt.unobserve(this,t)},t.prototype.disconnect=function(){kt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();class Mt{constructor(t,i){this.stream=t,this.configProvider=i,this.commands={}}register(t,i,s){return this.commands[t]={factory:i,thisArg:s},{dispose:()=>delete this.commands[t]}}execute(t,...i){const s=this.getCommandDefinition(t);if(null!=s){const t=s.factory.apply(s.thisArg,i);return new Promise((i=>{i(t({stream:this.stream,config:this.configProvider()}))}))}throw new Error(`Command not registered for \`${t}\``)}getCommandDefinition(t){return this.commands[t]}}class Rt{constructor(t,i,s,n,e,h,o,r,a,l){this.stream=t,this.getConfig=i,this.getScene=s,this.getFrame=n,this.getViewport=e,this.tapEmitter=h,this.doubleTapEmitter=o,this.longPressEmitter=r,this.interactionStartedEmitter=a,this.interactionFinishedEmitter=l,this.tap=this.tap.bind(this),this.doubleTap=this.doubleTap.bind(this),this.longPress=this.longPress.bind(this),this.emitTapEvent=this.emitTapEvent.bind(this)}getRayFromPoint(t){const i=this.getViewport(),s=this.getFrame();if(null!=s)return i.transformPointToRay(t,s.image,s.scene.camera);throw new Error("Cannot get camera. Frame is undefined.")}async tap(t,i={},s=0){this.emitTapEvent(this.tapEmitter.emit,t,i,s)}async doubleTap(t,i={},s=0){this.emitTapEvent(this.doubleTapEmitter.emit,t,i,s)}async longPress(t,i={},s=0){this.emitTapEvent(this.longPressEmitter.emit,t,i,s)}async beginInteraction(){this.isInteracting()||(this.interactionStartedEmitter.emit(),this.currentCamera=this.getScene().camera(),await this.stream.beginInteraction())}async transformCamera(t){var i;if(this.isInteracting()){const s=this.getScene(),n=this.getViewport(),e=this.getFrame(),h=await(null==e?void 0:e.depthBuffer());this.currentCamera=null!=this.currentCamera&&null!=n&&null!=e?t({camera:this.currentCamera,viewport:n,scale:s.scale(),boundingBox:s.boundingBox(),frame:e,depthBuffer:h}):void 0,await(null===(i=this.currentCamera)||void 0===i?void 0:i.render())}}async twistCamera(...t){return this.transformCamera((({camera:i,viewport:s})=>{const n=o.normalize(o.subtract(i.lookAt,i.position));if(1===t.length&&"number"==typeof t[0]){const s=r.toRadians(-t[0]);return i.rotateAroundAxis(s,n)}if(1===t.length){const n=a.create(s.width/2,s.height/2),e=r.fromPointsInDegrees(n,t[0]),h=null!=this.lastAngle?e-this.lastAngle:0;this.lastAngle=e;const l=o.normalize(o.subtract(i.lookAt,i.position)),u=r.toRadians(-h);return i.rotateAroundAxis(u,l)}return i}))}async panCameraToScreenPoint(t){return this.transformCamera((({camera:i,frame:s,viewport:n,depthBuffer:e})=>{if(null==this.panData){const h=i.toFrameCamera(),o=h.direction,r=n.transformPointToRay(t,s.image,h),a=l.fromNormalAndCoplanarPoint(o,i.lookAt),c=u.intersectPlane(r,a);if(null==c)return console.warn("Cannot determine fallback for pan. Ray does not intersect plane."),i;const d=null!=e?this.getWorldPoint(t,e,c):c,f=l.fromNormalAndCoplanarPoint(o,d);this.panData={hitPt:d,hitPlane:f,startingCamera:h}}if(null!=this.panData){const{hitPt:e,hitPlane:h,startingCamera:r}=this.panData,a=n.transformPointToRay(t,s.image,r),l=u.intersectPlane(a,h);if(null!=l){const t=o.subtract(e,l);return i.update(r).moveBy(t)}}return i}))}async panCameraByDelta(t){return this.transformCamera((({camera:i,viewport:s})=>{const n=i.viewVector(),e=o.normalize(i.up),h=o.normalize(n),r=o.magnitude(n)*Math.tan(i.fovY),a=t.x*r/s.width,l=t.y/s.width*r,u=o.cross(e,h),c=o.cross(h,u),d=o.add(o.scale(a,u),o.scale(l,c));return i.moveBy(d)}))}async rotateCamera(t){return this.transformCamera((({camera:i,viewport:s})=>{const n=o.normalize(i.up),e=o.normalize(o.subtract(i.lookAt,i.position)),h=o.cross(n,e),r=o.cross(e,h),a=o.normalize({x:t.x*h.x+t.y*r.x,y:t.x*h.y+t.y*r.y,z:t.x*h.z+t.y*r.z}),l=o.cross(a,e),u=3*Math.PI*t.x/s.width,c=3*Math.PI*t.y/s.height,d=Math.abs(u)+Math.abs(c);return i.rotateAroundAxis(d,l)}))}async rotateCameraAtPoint(t,i){return this.transformCamera((({camera:s,viewport:n,boundingBox:e,depthBuffer:h})=>{if(null==this.worldRotationPoint){const t=c.center(e);this.worldRotationPoint=null!=h?this.getWorldPoint(i,h,t):s.lookAt}const r=o.normalize(s.up),a=o.normalize(o.subtract(s.lookAt,s.position)),l=o.cross(r,a),u=o.cross(a,l),d=o.normalize({x:t.x*l.x+t.y*u.x,y:t.x*l.y+t.y*u.y,z:t.x*l.z+t.y*u.z}),f=o.cross(d,a),v=3*Math.PI*t.x/n.width,w=3*Math.PI*t.y/n.height,m=Math.abs(v)+Math.abs(w),p=s.rotateAroundAxisAtPoint(m,this.worldRotationPoint,f);return p.update({lookAt:o.add(o.scale(s.distanceToBoundingBoxCenter()/o.magnitude(p.viewVector()),p.viewVector()),p.position)})}))}async zoomCamera(t){return this.transformCamera((({camera:i,viewport:s})=>{const n=i.viewVector(),e=o.normalize(n),h=o.magnitude(n),r=o.add(i.position,o.scale(3*h*t/s.height,e));return i.update({position:r})}))}async zoomCameraToPoint(t,i){return this.transformCamera((({camera:s,viewport:n,frame:e,depthBuffer:h})=>{const r=e.scene.camera,a=r.direction,c=s.toFrameCamera(),d=n.transformPointToRay(t,e.image,c);if(null==this.zoomData){const i=l.fromNormalAndCoplanarPoint(a,r.lookAt),n=u.intersectPlane(d,i);if(null==n)return console.warn("Cannot determine fallback point for zoom. Ray does not intersect plane."),s;const e=null!=h?this.getWorldPoint(t,h,n):n,o=l.fromNormalAndCoplanarPoint(a,e);this.zoomData={hitPt:e,hitPlane:o}}if(null!=this.zoomData){const{hitPt:t,hitPlane:e}=this.zoomData,h=o.distance(s.position,t),r=u.at(d,6*h*i/n.height),a=l.projectPoint(e,r),c=s.update({position:r,lookAt:a});if(o.distance(r,a)>=c.near)return c}return s}))}async endInteraction(){this.isInteracting()&&(this.currentCamera=void 0,this.worldRotationPoint=void 0,this.panData=void 0,this.zoomData=void 0,this.resetLastAngle(),this.interactionFinishedEmitter.emit(),await this.stream.endInteraction())}resetLastAngle(){this.lastAngle=void 0}isInteracting(){return null!=this.currentCamera}pixelThreshold(t){return(this.isCoarseInputDevice(t)?this.getConfig().coarsePointerThreshold:this.getConfig().finePointerThreshold)*window.devicePixelRatio}async hitItems(t){var i;const s=await this.getScene().raycaster().hitItems(t);return null!==(i=null==s?void 0:s.hits)&&void 0!==i?i:[]}emitTapEvent(t,i,s={},n=0){const{altKey:e=!1,ctrlKey:h=!1,metaKey:o=!1,shiftKey:r=!1}=s;t({position:i,altKey:e,ctrlKey:h,metaKey:o,shiftKey:r,buttons:n})}isCoarseInputDevice(t){return t||window.matchMedia("(pointer: coarse)").matches}getWorldPoint(t,i,s){const n=this.getViewport(),e=n.transformPointToFrame(t,i);return i.isDepthAtFarPlane(e)?n.transformPointToWorldSpace(t,i):s}}const Ft=[.2,.15,.25,.25,.15];class jt{constructor(t,i,s,n,e,h,o,r,a){this.downEvent=t,this.upEvent=i,this.moveEvent=s,this.rotateInteraction=n,this.rotatePointInteraction=e,this.zoomInteraction=h,this.panInteraction=o,this.twistInteraction=r,this.getConfig=a,this.primaryInteraction=this.rotateInteraction,this.isDragging=!1,this.keyboardControls=!1,this.disableIndividualInteractions=!1,this.primaryInteractionTypeChange=new m,this.handleDownEvent=this.handleDownEvent.bind(this),this.handleMouseWheel=this.handleMouseWheel.bind(this),this.handleWindowMove=this.handleWindowMove.bind(this),this.handleWindowUp=this.handleWindowUp.bind(this)}initialize(t,i){this.element=t,this.interactionApi=i,t.addEventListener(this.downEvent,this.handleDownEvent),t.addEventListener("wheel",this.handleMouseWheel)}dispose(){var t,i;null===(t=this.element)||void 0===t||t.removeEventListener(this.downEvent,this.handleDownEvent),null===(i=this.element)||void 0===i||i.removeEventListener("wheel",this.handleMouseWheel),this.element=void 0}onPrimaryInteractionTypeChange(t){return this.primaryInteractionTypeChange.on(t)}setCurrentInteractionType(t){var i;switch(t){case"rotate":this.currentInteraction=this.rotateInteraction;break;case"zoom":this.currentInteraction=this.zoomInteraction;break;case"pan":this.currentInteraction=this.panInteraction;break;case"twist":this.currentInteraction=this.twistInteraction;break;case"rotate-point":this.currentInteraction=this.rotatePointInteraction;break;default:this.currentInteraction=void 0}if(this.draggingInteraction){const t=this.draggingInteraction.getPosition();this.draggingInteraction=this.currentInteraction||this.primaryInteraction,null===(i=this.interactionApi)||void 0===i||i.resetLastAngle(),this.draggingInteraction.setPosition(t)}}getPrimaryInteractionType(){return this.primaryInteraction.getType()}getCurrentInteractionType(){return(this.currentInteraction||this.primaryInteraction).getType()}setPrimaryInteractionType(t){switch(t){case"rotate":this.primaryInteraction=this.rotateInteraction;break;case"rotate-point":this.primaryInteraction=this.rotatePointInteraction;break;case"zoom":this.primaryInteraction=this.zoomInteraction;break;case"pan":this.primaryInteraction=this.panInteraction}this.primaryInteractionTypeChange.emit()}setDefaultKeyboardControls(t){this.keyboardControls=t}handleDownEvent(t){this.interactionTimer=window.setTimeout((()=>{this.downPosition=a.create(t.screenX,t.screenY),this.downPositionCanvas=this.getCanvasPosition(t),this.interactionTimer=void 0,null!=this.lastMoveEvent&&this.handleWindowMove(this.lastMoveEvent)}),this.getConfig().interactions.interactionDelay),window.addEventListener(this.moveEvent,this.handleWindowMove),window.addEventListener(this.upEvent,this.handleWindowUp)}handleWindowMove(t){if(null==this.interactionTimer){if(this.disableIndividualInteractions)return;const i=a.create(t.screenX,t.screenY),s=null!=this.interactionApi?this.interactionApi.pixelThreshold(this.isTouch(t)):2;null!=this.downPosition&&a.distance(i,this.downPosition)>=s&&!this.isDragging&&(this.beginDrag(t),this.isDragging=!0),this.isDragging&&this.drag(t)}this.lastMoveEvent=t}async handleWindowUp(t){this.isDragging&&(this.endDrag(t),this.isDragging=!1),null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0),window.removeEventListener(this.moveEvent,this.handleWindowMove),window.removeEventListener(this.upEvent,this.handleWindowUp),this.lastMoveEvent=void 0}beginDrag(t){this.keyboardControls&&t.metaKey&&t.shiftKey&&(this.currentInteraction=this.rotatePointInteraction),1===t.buttons?this.draggingInteraction=this.currentInteraction||this.primaryInteraction:2===t.buttons&&(this.draggingInteraction=this.panInteraction),null!=this.draggingInteraction&&null!=this.interactionApi&&null!=this.element&&(this.zoomInteraction.endDrag(t,this.interactionApi),this.draggingInteraction.beginDrag(t,this.downPositionCanvas||a.create(t.clientX,t.clientY),this.interactionApi,this.element))}drag(t){this.currentInteraction=this.keyboardControls&&t.altKey&&t.shiftKey?this.twistInteraction:void 0,this.draggingInteraction=this.currentInteraction||this.draggingInteraction||this.primaryInteraction,null!=this.draggingInteraction&&null!=this.interactionApi&&this.draggingInteraction.drag(t,this.interactionApi)}endDrag(t){null!=this.draggingInteraction&&null!=this.interactionApi&&(this.draggingInteraction.endDrag(t,this.interactionApi),this.draggingInteraction=void 0)}handleMouseWheel(t){if(t.preventDefault(),null!=this.element&&null!=this.interactionApi){const i=-this.wheelDeltaToPixels(t.deltaY,t.deltaMode)/10,s=this.element.getBoundingClientRect(),n=V(t,s);Ft.forEach(((t,s)=>{window.setTimeout((()=>{null!=this.interactionApi&&this.zoomInteraction.zoomToPoint(n,i*t,this.interactionApi)}),2*s)}))}}wheelDeltaToPixels(t,i){null==this.computedBodyStyle&&(this.computedBodyStyle=window.getComputedStyle(document.body));const s=null==this.computedBodyStyle.fontSize||""===this.computedBodyStyle.fontSize||isNaN(parseFloat(this.computedBodyStyle.fontSize))?19.2:1.2*parseFloat(this.computedBodyStyle.fontSize);return 1===i?null==this.computedBodyStyle.lineHeight||""===this.computedBodyStyle.lineHeight||isNaN(parseFloat(this.computedBodyStyle.lineHeight))?t*s:t*parseFloat(this.computedBodyStyle.lineHeight):2===i?null==this.computedBodyStyle.height||""===this.computedBodyStyle.height||isNaN(parseFloat(this.computedBodyStyle.height))?t*window.innerHeight:t*parseFloat(this.computedBodyStyle.height):t}getCanvasPosition(t){var i;const s=null===(i=this.element)||void 0===i?void 0:i.getBoundingClientRect(),n=null!=s?a.create(s.left,s.top):void 0;return null!=n?a.subtract(a.create(t.clientX,t.clientY),n):void 0}isTouch(t){return null!=window.PointerEvent&&t instanceof PointerEvent&&"touch"===t.pointerType}}class At{setPosition(t){this.currentPosition=t}getPosition(){return this.currentPosition}getType(){return this.type}beginDrag(t,i,s,n){}drag(t,i){}endDrag(t,i){null!=this.currentPosition&&(i.endInteraction(),this.currentPosition=void 0)}zoom(t,i){}}class Bt extends At{constructor(){super(...arguments),this.type="rotate"}beginDrag(t,i,s){null==this.currentPosition&&(this.currentPosition=a.create(t.screenX,t.screenY),s.beginInteraction())}drag(t,i){if(null!=this.currentPosition){const s=a.create(t.screenX,t.screenY),n=a.subtract(s,this.currentPosition);i.rotateCamera(n),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class Lt extends At{constructor(){super(...arguments),this.type="rotate-point"}beginDrag(t,i,s){null==this.currentPosition&&(this.currentPosition=a.create(t.screenX,t.screenY),this.startingPosition=i,s.beginInteraction())}drag(t,i){if(null!=this.currentPosition&&null!=this.startingPosition){const s=a.create(t.screenX,t.screenY),n=a.subtract(s,this.currentPosition);i.rotateCameraAtPoint(n,this.startingPosition),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class Kt extends At{constructor(t=1e3){super(),this.interactionTimeout=t,this.type="zoom",this.didTransformBegin=!1}beginDrag(t,i,s,n){if(null==this.currentPosition){this.currentPosition=a.create(t.clientX,t.clientY);const i=n.getBoundingClientRect(),e=V(t,i);this.startPt=e,s.beginInteraction()}}drag(t,i){if(null!=this.currentPosition){const s=a.create(t.clientX,t.clientY),n=a.subtract(s,this.currentPosition);null!=this.startPt&&(i.zoomCameraToPoint(this.startPt,n.y),this.currentPosition=s)}}endDrag(t,i){super.endDrag(t,i),this.stopInteractionTimer(),this.didTransformBegin=!1,this.startPt=void 0}zoom(t,i){this.operateWithTimer(i,(()=>i.zoomCamera(t)))}zoomToPoint(t,i,s){this.operateWithTimer(s,(()=>s.zoomCameraToPoint(t,i)))}beginInteraction(t){this.didTransformBegin=!0,t.beginInteraction()}endInteraction(t){this.didTransformBegin=!1,t.endInteraction()}resetInteractionTimer(t){this.stopInteractionTimer(),this.startInteractionTimer(t)}startInteractionTimer(t){this.interactionTimer=window.setTimeout((()=>{this.interactionTimer=void 0,this.endInteraction(t)}),this.interactionTimeout)}stopInteractionTimer(){null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0)}operateWithTimer(t,i){this.didTransformBegin||this.beginInteraction(t),this.resetInteractionTimer(t),i()}}class $t extends At{constructor(){super(...arguments),this.type="pan"}beginDrag(t,i,s,n){null==this.currentPosition&&(this.currentPosition=a.create(t.screenX,t.screenY),this.canvasRect=n.getBoundingClientRect(),s.beginInteraction())}drag(t,i){if(null!=this.currentPosition&&null!=this.canvasRect){const s=V(t,this.canvasRect);i.panCameraToScreenPoint(s),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class Nt extends At{constructor(){super(...arguments),this.type="twist"}beginDrag(t,i,s){this.currentPosition=a.create(t.screenX,t.screenY),s.beginInteraction()}drag(t,i){const s=a.create(t.screenX,t.screenY);this.currentPosition=s,i.twistCamera(s)}endDrag(t,i){super.endDrag(t,i)}}class Ut extends jt{constructor(t,i=new Bt,s=new Lt,n=new Kt,e=new $t,h=new Nt){super("mousedown","mouseup","mousemove",i,s,n,e,h,t)}}class Vt{initialize(t,i){this.element=t,this.interactionApi=i}dispose(){this.element=void 0}handleTwoPointTouchMove(t,i){var s,n,e,h;if(null!=this.currentPosition1&&null!=this.currentPosition2){const o=a.scale(a.add(a.subtract(t,this.currentPosition1),a.subtract(i,this.currentPosition2)),.25,.25),l=.5*(a.distance(t,i)-a.distance(this.currentPosition1,this.currentPosition2)),u=d.create(a.subtract(this.currentPosition1,this.currentPosition2),a.subtract(t,i)),c=r.toDegrees(Math.atan2(d.determinant(u),d.dot(u)));null===(s=this.interactionApi)||void 0===s||s.beginInteraction(),null===(n=this.interactionApi)||void 0===n||n.zoomCamera(l),null===(e=this.interactionApi)||void 0===e||e.panCameraByDelta(o),null===(h=this.interactionApi)||void 0===h||h.twistCamera(c)}this.currentPosition1=t,this.currentPosition2=i}}class Wt extends Vt{constructor(){super(),this.touchPoints={},this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this)}dispose(){var t;null===(t=this.element)||void 0===t||t.removeEventListener("pointerdown",this.handlePointerDown),super.dispose()}initialize(t,i){super.initialize(t,i),t.addEventListener("pointerdown",this.handlePointerDown)}handlePointerDown(t){const i=a.create(t.screenX,t.screenY);this.touchPoints=Object.assign(Object.assign({},this.touchPoints),{[t.pointerId]:i}),1===Object.keys(this.touchPoints).length&&(window.addEventListener("pointermove",this.handlePointerMove),window.addEventListener("pointerup",this.handlePointerUp))}handlePointerMove(t){null!=this.touchPoints[t.pointerId]&&(this.touchPoints[t.pointerId]=a.create(t.screenX,t.screenY));const i=Object.keys(this.touchPoints);2===i.length&&this.handleTwoPointTouchMove(this.touchPoints[i[0]],this.touchPoints[i[1]])}handlePointerUp(t){var i;delete this.touchPoints[t.pointerId];const s=Object.keys(this.touchPoints);1===s.length&&(null===(i=this.interactionApi)||void 0===i||i.endInteraction(),this.currentPosition1=void 0,this.currentPosition2=void 0),0===s.length&&(window.removeEventListener("pointermove",this.handlePointerMove),window.removeEventListener("pointerup",this.handlePointerUp))}}class qt extends jt{constructor(t){super("pointerdown","pointerup","pointermove",new Bt,new Lt,new Kt,new $t,new Nt,t),this.touchPoints=new Set,this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this)}initialize(t,i){super.initialize(t,i),t.addEventListener("pointerdown",this.handlePointerDown)}handlePointerDown(t){this.downPosition=a.create(t.screenX,t.screenY),this.touchPoints.add(t.pointerId),1===this.touchPoints.size&&window.addEventListener("pointerup",this.handlePointerUp),2===this.touchPoints.size&&(this.disableIndividualInteractions=!0)}handlePointerUp(t){this.touchPoints.delete(t.pointerId),this.touchPoints.size<2&&(this.disableIndividualInteractions=!1),0===this.touchPoints.size&&window.removeEventListener("pointerup",this.handlePointerUp)}}class Ht extends Vt{constructor(){super(),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}dispose(){var t;null===(t=this.element)||void 0===t||t.removeEventListener("touchstart",this.handleTouchStart),super.dispose()}initialize(t,i){super.initialize(t,i),t.addEventListener("touchstart",this.handleTouchStart)}handleTouchStart(t){if(t.touches.length>=1){const i=t.touches[0],s=t.touches[1];this.currentPosition1=a.create(i.screenX,i.screenY),this.currentPosition2=null!=s?a.create(s.screenX,s.screenY):void 0,window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),window.addEventListener("touchend",this.handleTouchEnd)}}handleTouchMove(t){if(1===t.touches.length)this.handleOnePointTouchMove(t.touches[0]);else if(2===t.touches.length){const i=a.create(t.touches[0].clientX,t.touches[0].clientY),s=a.create(t.touches[1].clientX,t.touches[1].clientY);this.handleTwoPointTouchMove(i,s)}}handleTouchEnd(t){var i;null===(i=this.interactionApi)||void 0===i||i.endInteraction(),this.isInteracting=!1,window.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchEnd)}handleOnePointTouchMove(t){var i,s,n;const e=a.create(t.screenX,t.screenY);if(null!=this.currentPosition1){const t=a.subtract(e,this.currentPosition1),h=(null===(i=this.interactionApi)||void 0===i?void 0:i.pixelThreshold(!0))||2;(a.distance(e,this.currentPosition1)>=h||this.isInteracting)&&(null===(s=this.interactionApi)||void 0===s||s.beginInteraction(),null===(n=this.interactionApi)||void 0===n||n.rotateCamera(t),this.isInteracting=!0)}this.currentPosition1=e}}class Gt{constructor(t,i,s,n){this.downEvent=t,this.upEvent=i,this.moveEvent=s,this.getConfig=n,this.handleDown=this.handleDown.bind(this),this.handleUp=this.handleUp.bind(this),this.handleMove=this.handleMove.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerEnd=this.handlePointerEnd.bind(this),this.clearPositions=this.clearPositions.bind(this),this.restartDoubleTapTimer=this.restartDoubleTapTimer.bind(this),this.clearDoubleTapTimer=this.clearDoubleTapTimer.bind(this),this.restartLongPressTimer=this.restartLongPressTimer.bind(this),this.clearLongPressTimer=this.clearLongPressTimer.bind(this),this.setPointerPositions=this.setPointerPositions.bind(this),this.emit=this.emit.bind(this)}dispose(){var t,i;null===(t=this.element)||void 0===t||t.removeEventListener(this.downEvent,this.handleDown),null===(i=this.element)||void 0===i||i.removeEventListener("touchstart",this.handleTouchStart),this.element=void 0,this.clearDoubleTapTimer(),this.clearLongPressTimer()}initialize(t,i){this.element=t,this.interactionApi=i,t.addEventListener(this.downEvent,this.handleDown),t.addEventListener("touchstart",this.handleTouchStart)}handleTouchStart(t){1===t.touches.length&&(this.setPointerPositions(a.create(t.touches[0].clientX,t.touches[0].clientY)),this.restartLongPressTimer(),window.addEventListener("touchend",this.handleTouchEnd),window.addEventListener("touchmove",this.handleTouchMove))}handleTouchMove(t){t.touches.length>0&&this.handlePointerMove(a.create(t.touches[0].clientX,t.touches[0].clientY),!0)}handleTouchEnd(t){null!=this.pointerDownPosition&&(window.removeEventListener("touchend",this.handleTouchEnd),window.removeEventListener("touchmove",this.handleTouchMove)),this.handlePointerEnd(this.pointerDownPosition)}handleDown(t){this.setPointerPositions(a.create(t.clientX,t.clientY)),this.buttons=t.buttons,this.restartLongPressTimer({altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}),window.addEventListener(this.upEvent,this.handleUp),window.addEventListener(this.moveEvent,this.handleMove)}handleMove(t){this.handlePointerMove(a.create(t.clientX,t.clientY),this.isTouch(t))}handleUp(t){null!=this.pointerDownPosition&&(window.removeEventListener(this.upEvent,this.handleUp),window.removeEventListener(this.moveEvent,this.handleMove)),this.handlePointerEnd(a.create(t.clientX,t.clientY),{altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey},this.buttons,this.isTouch(t)),this.buttons=void 0}handlePointerMove(t,i){var s;const n=(null===(s=this.interactionApi)||void 0===s?void 0:s.pixelThreshold(i))||2;null!=this.pointerDownPosition&&a.distance(t,this.pointerDownPosition)>=n&&null==this.interactionTimer&&this.clearPositions()}handlePointerEnd(t,i={},s=0,n=!1){var e,h;null!=t&&(null!=this.longPressTimer&&this.emit(null===(e=this.interactionApi)||void 0===e?void 0:e.tap)(t,i,s),null!=this.doubleTapTimer&&null!=this.secondPointerDownPosition&&(this.emit(null===(h=this.interactionApi)||void 0===h?void 0:h.doubleTap)(t,i,s,this.secondPointerDownPosition),this.clearDoubleTapTimer())),this.pointerDownPosition=void 0,this.clearLongPressTimer()}emit(t){return(i,s={},n=0,e,h=!1)=>{var o;const r=e||this.pointerDownPosition,l=(null===(o=this.interactionApi)||void 0===o?void 0:o.pixelThreshold(h))||1;let u;null!=this.interactionTimer?u=this.getCanvasPosition(r||i):null!=r&&a.distance(r,i)<=l&&(u=this.getCanvasPosition(i)),null!=u&&null!=t&&t(u,s,n)}}getCanvasPosition(t){var i;const s=null===(i=this.element)||void 0===i?void 0:i.getBoundingClientRect(),n=null!=s?a.create(s.left,s.top):void 0;return null!=n?a.subtract(a.create(t.x,t.y),n):void 0}clearPositions(){this.pointerDownPosition=void 0,this.firstPointerDownPosition=void 0,this.secondPointerDownPosition=void 0,this.clearDoubleTapTimer(),this.clearLongPressTimer(),this.clearInteractionTimer()}clearDoubleTapTimer(){null!=this.doubleTapTimer&&window.clearTimeout(this.doubleTapTimer),this.doubleTapTimer=void 0,this.firstPointerDownPosition=void 0,this.secondPointerDownPosition=void 0}restartDoubleTapTimer(){this.clearDoubleTapTimer(),this.doubleTapTimer=window.setTimeout((()=>this.clearDoubleTapTimer()),this.getConfig().events.doubleTapThreshold)}clearLongPressTimer(){null!=this.longPressTimer&&window.clearTimeout(this.longPressTimer),this.longPressTimer=void 0}restartLongPressTimer(t={}){this.clearLongPressTimer(),this.longPressTimer=window.setTimeout((()=>{var i;this.pointerDownPosition&&this.emit(null===(i=this.interactionApi)||void 0===i?void 0:i.longPress)(this.pointerDownPosition,t,this.buttons),this.clearLongPressTimer()}),this.getConfig().events.longPressThreshold)}restartInteractionTimer(){this.clearInteractionTimer(),this.interactionTimer=window.setTimeout((()=>{this.interactionTimer=void 0}),this.getConfig().interactions.interactionDelay)}clearInteractionTimer(){null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0)}setPointerPositions(t){this.pointerDownPosition=t,this.restartInteractionTimer(),null==this.firstPointerDownPosition?(this.restartDoubleTapTimer(),this.firstPointerDownPosition=t):this.secondPointerDownPosition=t}isTouch(t){return null!=window.PointerEvent&&t instanceof PointerEvent&&"touch"===t.pointerType}}class Jt{constructor(t,i,s){this.stream=t,this.configProvider=i,this.imageScaleProvider=s}predicate(t){return!!t.altKey}async fn(t){var i;const s=this.imageScaleProvider(),n=await this.stream.hitItems({point:a.scale(t.position,(null==s?void 0:s.x)||1,(null==s?void 0:s.y)||1)},!0);null!=(null===(i=n.hitItems)||void 0===i?void 0:i.hits)&&n.hitItems.hits.length>0?await this.stream.flyTo({itemId:n.hitItems.hits[0].itemId,animation:{duration:C(this.configProvider().animation.durationMs)}}):console.debug(`No hit results found for fly to part [position={x: ${t.position.x}, y: ${t.position.y}}]`)}}function _t(t,i,s,n,e=1e3){let h,o,r=0,a=[];return s&&setInterval((()=>{if(null!=o){5===a.length?a=[...a.slice(1),o]:a.push(o);const t=a.reduce(((t,i)=>t+i))/a.length;console.debug(`Paint rate: ${o}fps`),console.debug(`Paint rate (avg): ${t}`),o=void 0}}),1e3),s=>(r++,null==h&&(h=window.setInterval((()=>{!function(t,i){const s=t.takeMeasurements();s.length>0&&i(s)}(t,n),0===r&&null!=h&&(window.clearInterval(h),h=void 0)}),e)),t.measure((async()=>{const t=await i(s);return o=null==o?1:o+1,t})).finally((()=>{r--})))}const Xt=new class{constructor(t,i=window.performance){this.name=t,this.perf=i,this.measures=new Set,this.nextId=0}clearMeasurements(){this.perf.clearMeasures(this.name)}measure(t){if(null!=(i=t)&&i.then instanceof Function&&i.catch instanceof Function&&i.finally instanceof Function){const i=this.begin();return t.finally((()=>this.end(i)))}if("function"==typeof t){const i=this.begin(),s=t();return this.end(i),s}throw new Error("Input must be a function or Promise");var i}takeMeasurements(){const t=this.perf.getEntriesByName(this.name);return this.clearMeasurements(),t}takeLastMeasurement(){const t=this.takeMeasurements();return t[t.length-1]}begin(){const t=`${this.name}-${this.nextId++}`;return this.measures.add(t),this.perf.mark(t),t}end(t){this.perf.measure(this.name,t),this.perf.clearMarks(t),this.measures.delete(t)}}("paint_time");class Yt extends x{constructor(t=new E,i=!1,s=75e3,n=3e4){super(t,i),this.uninteractiveThreshold=s,this.offlineThreshold=n,this.handleOffline=this.handleOffline.bind(this),this.handleOnline=this.handleOnline.bind(this)}async connect(t,i={}){return window.addEventListener("offline",this.handleOffline),window.addEventListener("online",this.handleOnline),super.onRequest((()=>this.restartUninteractiveTimeout())),super.onResponse((()=>this.restartUninteractiveTimeout())),this.restartUninteractiveTimeout(),super.connect(t,i)}dispose(){window.removeEventListener("offline",this.handleOffline),window.removeEventListener("online",this.handleOnline),this.clearUninteractiveTimeout(),this.uninteractiveTimeout=void 0,this.clearOfflineTimeout(),this.offlineTimeout=void 0,super.dispose()}handleOffline(){this.restartOfflineTimeout()}handleOnline(){this.clearOfflineTimeout()}restartOfflineTimeout(){this.clearOfflineTimeout(),this.offlineTimeout=setTimeout((()=>{super.log("Disposing of StreamApi due to loss of network connection."),this.dispose()}),this.offlineThreshold)}clearOfflineTimeout(){null!=this.offlineTimeout&&clearTimeout(this.offlineTimeout)}restartUninteractiveTimeout(){this.clearUninteractiveTimeout(),this.uninteractiveTimeout=setTimeout((()=>{super.log("Disposing of StreamApi due to lack of interactivity."),this.dispose()}),this.uninteractiveThreshold)}clearUninteractiveTimeout(){null!=this.uninteractiveTimeout&&clearTimeout(this.uninteractiveTimeout)}}const Qt=[0,1e3,1e3,5e3],Zt=class{constructor(s){t(this,s),this.tap=i(this,"tap",7),this.doubletap=i(this,"doubletap",7),this.longpress=i(this,"longpress",7),this.frameReceived=i(this,"frameReceived",7),this.frameDrawn=i(this,"frameDrawn",7),this.tokenExpired=i(this,"tokenExpired",7),this.connectionChange=i(this,"connectionChange",7),this.sceneReady=i(this,"sceneReady",7),this.sceneChanged=i(this,"sceneChanged",7),this.interactionStarted=i(this,"interactionStarted",7),this.interactionFinished=i(this,"interactionFinished",7),this.sessionidchange=i(this,"sessionidchange",7),this.dimensionschange=i(this,"dimensionschange",7),this.configEnv="platprod",this.cameraControls=!0,this.keyboardControls=!0,this.rotateAroundTapPoint=!0,this.experimentalGhostingOpacity=0,this.selectionMaterial=I,this.stencilBuffer=new L(this.hostElement),this.stateMap={cursorManager:new G},this.interactionHandlers=[],this.tapKeyInteractions=[],this.isStreamStarted=!1,this.internalFrameDrawnDispatcher=new m,this.handleElementResize=this.handleElementResize.bind(this),this.streamSessionId=this.sessionId}componentWillLoad(){this.updateResolvedConfig(),this.calculateComponentDimensions(),this.resizeObserver=new Ot(this.handleElementResize),this.registerSlotChangeListeners();const t=new E;if(t.onClose((()=>this.handleWebSocketClose())),this.stream=new Yt(t,this.getResolvedConfig().flags.logWsMessages),this.setupStreamListeners(),this.commands=new Mt(this.stream,(()=>this.getResolvedConfig())),this.commands.register("stream.connect",(t=>function({clientId:t,sessionId:i,resource:s}){return({stream:n,config:e})=>{if("stream-key"===s.type){const h=function(t,i,s,n){return w.appendPath(null!=s?w.toString(w.parseAndAddParams("/ws",{clientId:s,sessionId:n})):`/stream-keys/${i.id}/session`,w.parse(t.network.renderingHost))}(e,s,t,i),o={url:w.toString(h),protocols:["ws.vertexvis.com"]},r={EXPERIMENTAL_frameDelivery:Object.assign(Object.assign({},e.EXPERIMENTAL_frameDelivery),{rateLimitingEnabled:e.flags.throttleFrameDelivery}),EXPERIMENTAL_adaptiveRendering:Object.assign(Object.assign({},e.EXPERIMENTAL_adaptiveRendering),{enabled:e.flags.adaptiveRendering}),EXPERIMENTAL_qualityOfService:Object.assign({},e.EXPERIMENTAL_qualityOfService)};return n.connect(o,r)}throw new b(`Cannot load resource. Invalid type ${s.type}`)}}(t))),this.streamSessionId=this.sessionId,null==this.streamSessionId)try{this.streamSessionId=function(t,i){const s=window.localStorage.getItem("vertexvis:stream-sessions");if(null!=s)return i(JSON.parse(s))}(0,(t=>this.clientId?t[this.clientId]:void 0))}catch(t){}this.updateStreamAttributes(),this.stateMap.cursorManager.onChanged.on((()=>this.handleCursorChanged()))}componentDidLoad(){var t,i;if(this.interactionApi=this.createInteractionApi(),null!=this.src&&this.load(this.src),this.cameraControls)if(null!=window.PointerEvent){const t=new Gt("pointerdown","pointerup","pointermove",(()=>this.getResolvedConfig()));this.baseInteractionHandler=new qt((()=>this.getResolvedConfig())),this.registerInteractionHandler(this.baseInteractionHandler),this.registerInteractionHandler(new Wt),this.registerInteractionHandler(t)}else{const t=new Gt("mousedown","mouseup","mousemove",(()=>this.getResolvedConfig()));this.baseInteractionHandler=new Ut((()=>this.getResolvedConfig())),this.registerInteractionHandler(this.baseInteractionHandler),this.registerInteractionHandler(new Ht),this.registerInteractionHandler(t)}this.keyboardControls&&null!=this.stream&&(null===(t=this.baseInteractionHandler)||void 0===t||t.setDefaultKeyboardControls(this.keyboardControls),this.registerTapKeyInteraction(new Jt(this.stream,(()=>this.getResolvedConfig()),(()=>this.getImageScale())))),this.rotateAroundTapPoint&&(null===(i=this.baseInteractionHandler)||void 0===i||i.setPrimaryInteractionType("rotate-point")),this.injectViewerApi()}render(){var t;const i=this.getCanvasDimensions();return s(n,null,s("div",{class:"viewer-container",style:{cursor:W(null!==(t=this.cursor)&&void 0!==t?t:"")},onContextMenu:t=>t.preventDefault()},s("div",{ref:t=>this.containerElement=t,class:v("canvas-container",{"enable-pointer-events ":null!=window.PointerEvent})},s("canvas",{ref:t=>{this.canvasElement=t,this.stateMap.interactionTarget=t},class:"canvas",width:null!=i?i.width:0,height:null!=i?i.height:0}),null!=this.errorMessage?s("div",{class:"error-message"},this.errorMessage):null),s("slot",null)))}async registerCommand(t,i,s){return this.commands.register(t,i,s)}async dispatchFrameDrawn(t){this.lastFrame=t,this.frame=t,this.internalFrameDrawnDispatcher.emit(t),this.frameDrawn.emit(t)}async registerInteractionHandler(t){return this.interactionHandlers.push(t),this.initializeInteractionHandler(t),{dispose:()=>{const i=this.interactionHandlers.indexOf(t);-1!==i&&(this.interactionHandlers[i].dispose(),this.interactionHandlers.splice(i,1))}}}async registerTapKeyInteraction(t){this.tapKeyInteractions=[...this.tapKeyInteractions,t]}async getInteractionTarget(){if(null!=this.stateMap.interactionTarget)return this.stateMap.interactionTarget;throw new Error("Interaction target is undefined.")}async addCursor(t,i){return this.stateMap.cursorManager.add(t,i)}async getInteractionHandlers(){return this.interactionHandlers}async getBaseInteractionHandler(){return this.baseInteractionHandler}async getJwt(){return this.jwt}handleSrcChanged(t){null!=t?this.load(t):this.unload()}handleRotateAboutTapPointChanged(){var t,i;this.updateStreamAttributes(),this.rotateAroundTapPoint?null===(t=this.baseInteractionHandler)||void 0===t||t.setPrimaryInteractionType("rotate-point"):null===(i=this.baseInteractionHandler)||void 0===i||i.setPrimaryInteractionType("rotate")}handleDepthBuffersChanged(){this.updateStreamAttributes()}handleExperimentalGhostingOpacityChanged(){this.updateStreamAttributes()}handleFeatureLinesChanged(){this.updateStreamAttributes()}handleFeatureHighlightingChanged(){this.updateStreamAttributes()}handleConfigChanged(){this.updateResolvedConfig()}handleConfigEnvChanged(){this.updateResolvedConfig()}async load(t){if(null==this.commands||null==this.dimensions)throw new D("Cannot load scene. Viewer has not been initialized.");{const{resource:i,queries:s}=null!=this.urn?S(this.urn):{},{resource:n,queries:e}=S(t),h=!p.isEqual(i,n),o=!p.isEqual(s,e),r=null!=e[0],a=await this.isSceneReady();if(this.urn=t,h||!a&&o)this.unload(),await this.connectStreamingClient(n,e[0]);else if(a&&o&&r){const t=await this.scene();await t.applySceneViewState(e[0].id)}}}async unload(){if(null!=this.streamDisposable&&(this.isStreamStarted=!1,this.streamId=void 0,this.streamDisposable.dispose(),this.lastFrame=void 0,this.frame=void 0,this.sceneViewId=void 0,this.clock=void 0,this.errorMessage=void 0,this.urn=void 0,this.stateMap.streamWorldOrientation=void 0),null!=this.canvasElement){const t=this.canvasElement.getContext("2d");null!=t&&t.clearRect(0,0,this.canvasElement.width,this.canvasElement.height)}}async scene(){return this.createScene()}async isSceneReady(){return null!=this.lastFrame&&null!=this.sceneViewId}async handleTapEvent(t){this.tapKeyInteractions.filter((i=>i.predicate(t.detail))).forEach((i=>i.fn(t.detail)))}async handleWebSocketClose(){if(this.isStreamStarted&&(this.isStreamStarted=!1,null!=this.streamId&&null!=this.urn&&!this.isReconnecting)){const{resource:t}=S(this.urn);await this.reconnectWebSocket(t,this.streamId)}}async connectStreamingClient(t,i){try{this.streamDisposable=await this.connectStream(t),this.calculateComponentDimensions();const{startStream:s}=await this.getStream().startStream(Object.assign({streamKey:{value:t.id},dimensions:this.dimensions,frameBackgroundColor:this.getBackgroundColor(),streamAttributes:this.getStreamAttributes()},"scene-view-state"===(null==i?void 0:i.type)&&{sceneViewStateId:{hex:i.id}})),{streamId:n,sessionId:e,sceneViewId:h,jwt:o,worldOrientation:r}=s||{};if(this.jwt=o||void 0,this.emitConnectionChange({status:"connected",jwt:this.jwt||""}),null!=this.clientId&&null!=(null==e?void 0:e.hex)){this.streamSessionId=e.hex,this.sessionidchange.emit(this.streamSessionId);try{!function(t,i){const s=window.localStorage,n=s.getItem(t);if(null!=n){const e=Object.assign(Object.assign({},JSON.parse(n)),i);s.setItem(t,JSON.stringify(e))}else s.setItem(t,JSON.stringify(i))}("vertexvis:stream-sessions",{[this.clientId]:this.streamSessionId})}catch(t){}}null!=(null==h?void 0:h.hex)&&(this.sceneViewId=h.hex,this.isStreamStarted=!0),null!=(null==n?void 0:n.hex)&&(this.streamId=n.hex),this.stateMap.streamWorldOrientation=K(r),console.debug(`Stream connected [stream-id=${this.streamId}, scene-view-id=${this.sceneViewId}]`),await this.waitNextDrawnFrame(15e3),this.sceneReady.emit()}catch(t){if(this.emitConnectionChange({status:"disconnected"}),t instanceof z)throw t;if(null==this.lastFrame)throw this.errorMessage="Unable to establish connection to Vertex.",console.error("Failed to establish WS connection",t),new k(this.errorMessage,t instanceof Error?t:void 0)}}async connectStream(t){var i;null==this.clientId&&console.warn("Client ID not provided, using legacy path. A Client ID will be required in an upcoming release.");const s=await this.commands.execute("stream.connect",{clientId:this.clientId,sessionId:this.sessionId||this.streamSessionId,resource:t});return this.synchronizeTime(),this.canvasRenderer=_t(Xt,function(){let t;return async i=>{const s=i.frame.sequenceNumber,n=await(e=i.frame.image.imageBytes,null!=window.createImageBitmap?async function(t){const i=new Blob([t]),s=await window.createImageBitmap(i);return{image:s,dispose:()=>s.close()}}(e):(h=e,new Promise(((t,i)=>{const s=new Blob([h]),n=URL.createObjectURL(s),e=new Image;e.addEventListener("load",(()=>{t({image:e,dispose:()=>{}}),URL.revokeObjectURL(n)})),e.addEventListener("error",(()=>{i(new T("Failed to load image data")),URL.revokeObjectURL(n)})),e.src=n}))));var e,h;return(null==t||s>t)&&(t=s,function(t,i){const s=i.viewport.calculateDrawRect(i.frame.image);i.canvas.clearRect(0,0,i.dimensions.width,i.dimensions.height),i.canvas.drawImage(t.image,s.x,s.y,s.width,s.height)}(n,i)),n.dispose(),i.frame}}(),this.getResolvedConfig().flags.logFrameRate,(t=>this.reportPerformance(t))),null!=this.containerElement&&(null===(i=this.resizeObserver)||void 0===i||i.observe(this.containerElement)),s}async synchronizeTime(){var t;try{const i=await this.getStream().syncTime({requestTime:O()});if(null!=(null===(t=i.syncTime)||void 0===t?void 0:t.replyTime)){const t=P(i.syncTime.replyTime);null!=t&&(this.clock=new M(t),console.debug(`Synchronized time [local-time=${this.clock.knownLocalTime.toISOString()}, remote-time=${this.clock.knownRemoteTime.toISOString()}]`))}}catch(t){console.error("Failed to synchronize clock",t)}}async reconnectStreamingClient(t,i,s=!1){var n,e;try{null===(n=this.streamDisposable)||void 0===n||n.dispose(),this.clock=void 0,this.emitConnectionChange({status:"connecting"}),this.streamDisposable=await this.connectStream(t);const s=await this.getStream().reconnect({streamId:{hex:i},dimensions:this.dimensions,frameBackgroundColor:this.getBackgroundColor(),streamAttributes:this.getStreamAttributes()});this.isStreamStarted=!0,this.isReconnecting=!1,this.jwt=(null===(e=s.reconnect)||void 0===e?void 0:e.jwt)||void 0,this.emitConnectionChange({status:"connected",jwt:this.jwt||""}),console.debug(`Stream reconnected [stream-id=${this.streamId}, scene-view-id=${this.sceneViewId}]`)}catch(t){if(this.emitConnectionChange({status:"disconnected"}),t instanceof z)throw t;const i="Unable to establish connection to Vertex.";throw s||(this.errorMessage=this.errorMessage||i,console.error("Failed to establish WS connection",t)),new k(i,t instanceof Error?t:void 0)}}async reconnectWebSocket(t,i,s=0){try{await this.reconnectStreamingClient(t,i,!0)}catch(n){setTimeout((()=>this.reconnectWebSocket(t,i,s+1)),Qt[Math.min(s,Qt.length-1)])}}emitConnectionChange(t){this.connectionChange.emit(t)}handleElementResize(t){t.length>=0&&null!=this.dimensions&&!f.isEqual(t[0].contentRect,this.dimensions)&&!this.isResizing&&(this.isResizing=!0,window.requestAnimationFrame((()=>this.recalculateComponentDimensions())))}registerSlotChangeListeners(){this.mutationObserver=new MutationObserver((()=>this.injectViewerApi())),this.mutationObserver.observe(this.hostElement,{childList:!0,subtree:!0})}injectViewerApi(){function t(t){return Array.from(t.querySelectorAll("*"))}t(this.hostElement).filter((t=>t.nodeName.startsWith("VERTEX-"))).reduce(((i,s)=>[...i,s,...t(s)]),[]).forEach((t=>{t.viewer=this.hostElement}))}async handleStreamRequest(t){null!=t.drawFrame?this.handleFrame(t.drawFrame):null!=t.gracefulReconnection&&this.handleGracefulReconnect(t.gracefulReconnection)}handleGracefulReconnect(t){var i;if(null!=(null===(i=t.streamId)||void 0===i?void 0:i.hex)&&null!=this.urn){const{resource:i}=S(this.urn);this.isReconnecting=!0,this.reconnectStreamingClient(i,t.streamId.hex)}}async handleFrame(t){const i=this.getCanvasDimensions(),s=this.stateMap.streamWorldOrientation;if(null!=this.canvasElement&&null!=i&&null!=s){const n=this.canvasElement.getContext("2d");if(null!=n){this.frame=$(s)(t);const e={canvas:n,dimensions:i,frame:this.frame,viewport:U.fromDimensions(this.getCanvasDimensions()||f.create(0,0))};this.frameReceived.emit(this.frame),this.frame.scene.hasChanged&&this.sceneChanged.emit();const h=await this.canvasRenderer(e);this.dispatchFrameDrawn(h)}}}waitNextDrawnFrame(t){const i=new Promise((t=>{const i=this.internalFrameDrawnDispatcher.on((s=>{t(s),i.dispose()}))}));return null!=t?g.timeout(t,i):i}calculateComponentDimensions(){const t=this.getBounds();if(null!=(null==t?void 0:t.width)&&null!=(null==t?void 0:t.height)){const i=f.create(t.width,t.height),s=f.scaleFit(2073600,i);this.hostDimensions=i,this.dimensions=null!=s?f.create(s.width,s.height):void 0}}recalculateComponentDimensions(){this.isResizing&&(this.calculateComponentDimensions(),this.isResizing=!1,this.dimensionschange.emit(this.dimensions),this.isStreamStarted&&this.getStream().updateDimensions({dimensions:this.dimensions}))}reportPerformance(t){if(this.isStreamStarted){const i={timings:t.map((t=>({receiveToPaintDuration:C(t.duration)})))};this.getStream().recordPerformance(i,!1)}}setupStreamListeners(){this.getStream().onRequest((t=>this.handleStreamRequest(t.request))),this.getStream().onRequest(function(t,i){const s=function(t){let i=!1;return s=>{const n=t();if(null!=n){const t=n.remoteTime(new Date(Date.now())),e=C(s,t);return P(e).getTime()>=0?e:void(i||(console.warn(`Possible erroneous send to receive timing. Muting for 60s. [sent-at=${s.toISOString()}, received-at=${t.toISOString()}, remote-time=${n.knownRemoteTime.toISOString()}]`),i=!0,setTimeout((()=>i=!1),6e4)))}}}(i);return n=i=>{return n=()=>n=>{const e=P(n.sentAtTime);null!=e&&t.replyResult(i,{drawFrame:{sendToReceiveDuration:s(e)}})},t=>{const{drawFrame:i}=t.request;null!=i&&n()(t)};var n},t=>{var i;const s=null===(i=t.request.requestId)||void 0===i?void 0:i.value;null!=s&&n(s)(t)};var n}(this.getStream(),(()=>this.clock)))}initializeInteractionHandler(t){if(null==this.stateMap.interactionTarget)throw new R("Cannot initialize interaction handler. Interaction target is undefined.");if(null==this.interactionApi)throw new R("Cannot initialize interaction handler. Interaction APi is undefined.");t.initialize(this.stateMap.interactionTarget,this.interactionApi)}createInteractionApi(){if(null==this.stream)throw new F("Cannot create interaction API. Component has not been initialized.");return new Rt(this.stream,(()=>this.getResolvedConfig().interactions),(()=>this.createScene()),(()=>this.frame),(()=>U.fromDimensions(this.getCanvasDimensions()||f.create(0,0))),this.tap,this.doubletap,this.longpress,this.interactionStarted,this.interactionFinished)}handleCursorChanged(){window.requestAnimationFrame((()=>{this.cursor=this.stateMap.cursorManager.getActiveCursor()}))}createScene(){if(null==this.frame||null==this.sceneViewId||null==this.stateMap.streamWorldOrientation)throw new j("Cannot create scene. Frame has not been rendered or stream not initialized.");const t="string"==typeof this.selectionMaterial?A(this.selectionMaterial):this.selectionMaterial;return new B(this.getStream(),this.frame,$(this.stateMap.streamWorldOrientation),(()=>this.getImageScale()),this.sceneViewId,t)}getBackgroundColor(){if(null!=this.containerElement)return q(this.containerElement)}getBounds(){return H(this.hostElement)}getCanvasDimensions(){return this.getResolvedConfig().flags.letterboxFrames?this.dimensions:this.hostDimensions}getImageScale(){const t=this.getCanvasDimensions();if(null!=this.dimensions&&null!=t)return a.create(this.dimensions.width/t.width,this.dimensions.height/t.height)}getStreamAttributes(){const t={depthBuffers:this.getDepthBufferStreamAttributesValue(),experimentalGhosting:this.experimentalGhostingOpacity,featureLines:this.featureLines,featureHighlighting:this.featureHighlighting};return y.ifInvalidThrow(N)(t)}updateStreamAttributes(){if(this.isStreamStarted){const t=this.getStreamAttributes();this.getStream().updateStream({streamAttributes:t})}}getDepthBufferStreamAttributesValue(){var t;return null!==(t=this.depthBuffers)&&void 0!==t?t:this.rotateAroundTapPoint?"final":void 0}updateResolvedConfig(){this.resolvedConfig=h(this.configEnv,this.config)}getResolvedConfig(){return ti("Resolved config is undefined",(()=>this.resolvedConfig))}getStream(){return ti("Stream is undefined",(()=>this.stream))}get hostElement(){return e(this)}static get watchers(){return{src:["handleSrcChanged"],rotateAroundTapPoint:["handleRotateAboutTapPointChanged"],depthBuffers:["handleDepthBuffersChanged"],experimentalGhostingOpacity:["handleExperimentalGhostingOpacityChanged"],featureLines:["handleFeatureLinesChanged"],featureHighlighting:["handleFeatureHighlightingChanged"],config:["handleConfigChanged"],configEnv:["handleConfigEnvChanged"]}}};function ti(t,i){const s=i();if(null!=s)return s;throw new Error(t)}Zt.style=":host{--image-background:var(--image-background);--viewer-background:var(--viewer-background);display:block;position:relative;width:300px;height:300px}.canvas-container{display:flex;justify-content:center;align-items:center;width:100%;height:100%;position:relative;background:var(--image-background, var(--viewer-background, #ffffff))}.enable-pointer-events{touch-action:none}.viewer-container{width:100%;height:100%;overflow:hidden;background:var(--viewer-background, #ffffff)}.error-message{position:absolute;top:50%;width:100%;transform:translateY(-50%);text-align:center}";export{Zt as vertex_viewer}