@vertexvis/viewer 1.0.2-canary.7 → 1.0.2-testing.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/cjs/{config-BsqvZSt9.js → config-20ozv4y8.js} +3 -3
  2. package/dist/cjs/{config-BsqvZSt9.js.map → config-20ozv4y8.js.map} +1 -1
  3. package/dist/cjs/{entities-ByDO45G0.js → entities-D6kgGria.js} +4 -4
  4. package/dist/cjs/{entities-ByDO45G0.js.map → entities-D6kgGria.js.map} +1 -1
  5. package/dist/cjs/{geometry_pb-CuOYGIHT.js → geometry_pb-BTko2Wi0.js} +3 -3
  6. package/dist/cjs/{geometry_pb-CuOYGIHT.js.map → geometry_pb-BTko2Wi0.js.map} +1 -1
  7. package/dist/cjs/index.cjs.js +5 -5
  8. package/dist/cjs/{png-decoder-3NSToOjc.js → png-decoder-CJbE7UJh.js} +112 -112
  9. package/dist/cjs/png-decoder-CJbE7UJh.js.map +1 -0
  10. package/dist/cjs/{queries-CwDJxlsL.js → queries-Da9I-xMf.js} +4 -4
  11. package/dist/cjs/{queries-CwDJxlsL.js.map → queries-Da9I-xMf.js.map} +1 -1
  12. package/dist/cjs/{regl-component-DTvmpYVa.js → regl-component-HhKCyGQ3.js} +3 -3
  13. package/dist/cjs/{regl-component-DTvmpYVa.js.map → regl-component-HhKCyGQ3.js.map} +1 -1
  14. package/dist/cjs/{representation_pb-BU8a5Ico.js → representation_pb-CrCGjlyP.js} +3 -3
  15. package/dist/cjs/{representation_pb-BU8a5Ico.js.map → representation_pb-CrCGjlyP.js.map} +1 -1
  16. package/dist/cjs/{streamAttributes-BVp1vEp3.js → streamAttributes-D_J-W8-2.js} +3 -3
  17. package/dist/cjs/{streamAttributes-BVp1vEp3.js.map → streamAttributes-D_J-W8-2.js.map} +1 -1
  18. package/dist/cjs/vertex-scene-tree-table-cell.cjs.entry.js +1 -1
  19. package/dist/cjs/vertex-scene-tree.cjs.entry.js +2 -2
  20. package/dist/cjs/vertex-viewer-dom-element_2.cjs.entry.js +1 -1
  21. package/dist/cjs/vertex-viewer-hit-result-indicator.cjs.entry.js +2 -2
  22. package/dist/cjs/vertex-viewer-measurement-details.cjs.entry.js +2 -2
  23. package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js +2 -2
  24. package/dist/cjs/vertex-viewer-measurement-line_2.cjs.entry.js +2 -2
  25. package/dist/cjs/vertex-viewer-measurement-precise.cjs.entry.js +4 -4
  26. package/dist/cjs/vertex-viewer-pin-group.cjs.entry.js +3 -3
  27. package/dist/cjs/vertex-viewer-transform-widget.cjs.entry.js +2 -2
  28. package/dist/cjs/vertex-viewer-view-cube.cjs.entry.js +1 -1
  29. package/dist/cjs/vertex-viewer.cjs.entry.js +4 -4
  30. package/dist/components/index.js +1 -1
  31. package/dist/components/{p-BfAW7IWG.js → p-B9R0QWr4.js} +2 -2
  32. package/dist/components/{p-CmtoXwYo.js → p-BCOD9yfw.js} +2 -2
  33. package/dist/components/{p-ux26QLbe.js → p-BOJJZ1cN.js} +2 -2
  34. package/dist/components/{p-C7GhKZ4q.js → p-CAugdB_8.js} +2 -2
  35. package/dist/components/{p-C9y2eVBq.js → p-CZCXdo3t.js} +2 -2
  36. package/dist/components/p-CycTYKAk.js +5 -0
  37. package/dist/components/{p-BnIeyVZl.js.map → p-CycTYKAk.js.map} +1 -1
  38. package/dist/components/{p-DTDKqbV2.js → p-D12q-fpW.js} +2 -2
  39. package/dist/components/{p-kVbpvDF1.js → p-DF4kEsJU.js} +2 -2
  40. package/dist/components/{p-D9oqIZ3P.js → p-DRnMrHWY.js} +2 -2
  41. package/dist/components/{p-B6mpmA2-.js → p-abSJ29r7.js} +2 -2
  42. package/dist/components/{p-CCPuHP2m.js → p-ahjMltGJ.js} +2 -2
  43. package/dist/components/vertex-scene-tree-table-cell.js +1 -1
  44. package/dist/components/vertex-scene-tree.js +1 -1
  45. package/dist/components/vertex-viewer-dom-renderer.js +1 -1
  46. package/dist/components/vertex-viewer-hit-result-indicator.js +1 -1
  47. package/dist/components/vertex-viewer-measurement-details.js +1 -1
  48. package/dist/components/vertex-viewer-measurement-distance.js +1 -1
  49. package/dist/components/vertex-viewer-measurement-overlays.js +1 -1
  50. package/dist/components/vertex-viewer-measurement-precise.js +1 -1
  51. package/dist/components/vertex-viewer-pin-group.js +1 -1
  52. package/dist/components/vertex-viewer-pin-tool.js +1 -1
  53. package/dist/components/vertex-viewer-transform-widget.js +1 -1
  54. package/dist/components/vertex-viewer-view-cube.js +1 -1
  55. package/dist/components/vertex-viewer.js +1 -1
  56. package/dist/esm/{config-SMudJna8.js → config-lglER3mU.js} +3 -3
  57. package/dist/esm/{config-SMudJna8.js.map → config-lglER3mU.js.map} +1 -1
  58. package/dist/esm/{entities-uAlr5vlE.js → entities-zRken6VS.js} +4 -4
  59. package/dist/esm/{entities-uAlr5vlE.js.map → entities-zRken6VS.js.map} +1 -1
  60. package/dist/esm/{geometry_pb-CMlgBITt.js → geometry_pb-BiZRfctN.js} +3 -3
  61. package/dist/esm/{geometry_pb-CMlgBITt.js.map → geometry_pb-BiZRfctN.js.map} +1 -1
  62. package/dist/esm/index.js +5 -5
  63. package/dist/esm/index.mjs +5 -5
  64. package/dist/esm/{png-decoder-Bjioht9N.js → png-decoder-CiunTuhu.js} +112 -112
  65. package/dist/esm/png-decoder-CiunTuhu.js.map +1 -0
  66. package/dist/esm/{queries-CgeSF7hf.js → queries-DEzCmbTD.js} +4 -4
  67. package/dist/esm/{queries-CgeSF7hf.js.map → queries-DEzCmbTD.js.map} +1 -1
  68. package/dist/esm/{regl-component-WqWCp9d-.js → regl-component-DmkowWhg.js} +3 -3
  69. package/dist/esm/{regl-component-WqWCp9d-.js.map → regl-component-DmkowWhg.js.map} +1 -1
  70. package/dist/esm/{representation_pb-BXvH1L33.js → representation_pb-g4f0WC4k.js} +3 -3
  71. package/dist/esm/{representation_pb-BXvH1L33.js.map → representation_pb-g4f0WC4k.js.map} +1 -1
  72. package/dist/esm/{streamAttributes-6asiWDkT.js → streamAttributes-Cp8PEH9A.js} +3 -3
  73. package/dist/esm/{streamAttributes-6asiWDkT.js.map → streamAttributes-Cp8PEH9A.js.map} +1 -1
  74. package/dist/esm/vertex-scene-tree-table-cell.entry.js +1 -1
  75. package/dist/esm/vertex-scene-tree.entry.js +2 -2
  76. package/dist/esm/vertex-viewer-dom-element_2.entry.js +1 -1
  77. package/dist/esm/vertex-viewer-hit-result-indicator.entry.js +2 -2
  78. package/dist/esm/vertex-viewer-measurement-details.entry.js +2 -2
  79. package/dist/esm/vertex-viewer-measurement-distance.entry.js +2 -2
  80. package/dist/esm/vertex-viewer-measurement-line_2.entry.js +2 -2
  81. package/dist/esm/vertex-viewer-measurement-precise.entry.js +4 -4
  82. package/dist/esm/vertex-viewer-pin-group.entry.js +3 -3
  83. package/dist/esm/vertex-viewer-transform-widget.entry.js +2 -2
  84. package/dist/esm/vertex-viewer-view-cube.entry.js +1 -1
  85. package/dist/esm/vertex-viewer.entry.js +4 -4
  86. package/dist/viewer/index.esm.js +1 -1
  87. package/dist/viewer/p-051b5154.entry.js +5 -0
  88. package/dist/viewer/{p-a5ed36cd.entry.js.map → p-051b5154.entry.js.map} +1 -1
  89. package/dist/viewer/{p-4dbad46f.entry.js → p-11cf755a.entry.js} +2 -2
  90. package/dist/viewer/{p-833d698b.entry.js → p-16775f7d.entry.js} +2 -2
  91. package/dist/viewer/{p-a866cbdb.entry.js → p-1eb636f8.entry.js} +2 -2
  92. package/dist/viewer/{p-bb18c218.entry.js → p-33f44cc1.entry.js} +2 -2
  93. package/dist/viewer/{p-9556c963.entry.js → p-35601c85.entry.js} +2 -2
  94. package/dist/viewer/{p-40dba623.entry.js → p-8c369777.entry.js} +2 -2
  95. package/dist/viewer/{p-Dx_kRMQd.js → p-BDvACHun.js} +2 -2
  96. package/dist/viewer/{p-Dx_kRMQd.js.map → p-BDvACHun.js.map} +1 -1
  97. package/dist/viewer/p-CZXGNc0T.js +5 -0
  98. package/dist/viewer/p-CZXGNc0T.js.map +1 -0
  99. package/dist/viewer/{p-B7IxKAst.js → p-ChqXy0cG.js} +2 -2
  100. package/dist/viewer/{p-B7IxKAst.js.map → p-ChqXy0cG.js.map} +1 -1
  101. package/dist/viewer/{p-BYm9621A.js → p-CyGlYje2.js} +2 -2
  102. package/dist/viewer/{p-BYm9621A.js.map → p-CyGlYje2.js.map} +1 -1
  103. package/dist/viewer/{p-DNam7E02.js → p-D6eJC1q4.js} +2 -2
  104. package/dist/viewer/{p-DNam7E02.js.map → p-D6eJC1q4.js.map} +1 -1
  105. package/dist/viewer/{p-BJm7oO2_.js → p-Dp56p_jX.js} +2 -2
  106. package/dist/viewer/{p-BJm7oO2_.js.map → p-Dp56p_jX.js.map} +1 -1
  107. package/dist/viewer/{p-Chfn1uMz.js → p-F8e15or2.js} +2 -2
  108. package/dist/viewer/{p-Chfn1uMz.js.map → p-F8e15or2.js.map} +1 -1
  109. package/dist/viewer/{p-CvVOQvMo.js → p-WPRMWirY.js} +2 -2
  110. package/dist/viewer/{p-CvVOQvMo.js.map → p-WPRMWirY.js.map} +1 -1
  111. package/dist/viewer/{p-04ebf937.entry.js → p-a8a81cba.entry.js} +2 -2
  112. package/dist/viewer/{p-4d5c68b4.entry.js → p-c7e62d66.entry.js} +2 -2
  113. package/dist/viewer/{p-578409b2.entry.js → p-e9b83dae.entry.js} +2 -2
  114. package/dist/viewer/{p-69aeb12a.entry.js → p-f271dc4a.entry.js} +2 -2
  115. package/dist/viewer/{p-9161d8c7.entry.js → p-f65c0769.entry.js} +2 -2
  116. package/dist/viewer/viewer.esm.js +1 -1
  117. package/package.json +10 -10
  118. package/dist/cjs/png-decoder-3NSToOjc.js.map +0 -1
  119. package/dist/components/p-BnIeyVZl.js +0 -5
  120. package/dist/esm/png-decoder-Bjioht9N.js.map +0 -1
  121. package/dist/types/web-workers.d.ts +0 -1
  122. package/dist/viewer/p-CmW2ZNHt.js +0 -5
  123. package/dist/viewer/p-CmW2ZNHt.js.map +0 -1
  124. package/dist/viewer/p-a5ed36cd.entry.js +0 -5
  125. /package/dist/components/{p-BfAW7IWG.js.map → p-B9R0QWr4.js.map} +0 -0
  126. /package/dist/components/{p-CmtoXwYo.js.map → p-BCOD9yfw.js.map} +0 -0
  127. /package/dist/components/{p-ux26QLbe.js.map → p-BOJJZ1cN.js.map} +0 -0
  128. /package/dist/components/{p-C7GhKZ4q.js.map → p-CAugdB_8.js.map} +0 -0
  129. /package/dist/components/{p-C9y2eVBq.js.map → p-CZCXdo3t.js.map} +0 -0
  130. /package/dist/components/{p-DTDKqbV2.js.map → p-D12q-fpW.js.map} +0 -0
  131. /package/dist/components/{p-kVbpvDF1.js.map → p-DF4kEsJU.js.map} +0 -0
  132. /package/dist/components/{p-D9oqIZ3P.js.map → p-DRnMrHWY.js.map} +0 -0
  133. /package/dist/components/{p-B6mpmA2-.js.map → p-abSJ29r7.js.map} +0 -0
  134. /package/dist/components/{p-CCPuHP2m.js.map → p-ahjMltGJ.js.map} +0 -0
  135. /package/dist/viewer/{p-4dbad46f.entry.js.map → p-11cf755a.entry.js.map} +0 -0
  136. /package/dist/viewer/{p-833d698b.entry.js.map → p-16775f7d.entry.js.map} +0 -0
  137. /package/dist/viewer/{p-a866cbdb.entry.js.map → p-1eb636f8.entry.js.map} +0 -0
  138. /package/dist/viewer/{p-bb18c218.entry.js.map → p-33f44cc1.entry.js.map} +0 -0
  139. /package/dist/viewer/{p-9556c963.entry.js.map → p-35601c85.entry.js.map} +0 -0
  140. /package/dist/viewer/{p-40dba623.entry.js.map → p-8c369777.entry.js.map} +0 -0
  141. /package/dist/viewer/{p-04ebf937.entry.js.map → p-a8a81cba.entry.js.map} +0 -0
  142. /package/dist/viewer/{p-4d5c68b4.entry.js.map → p-c7e62d66.entry.js.map} +0 -0
  143. /package/dist/viewer/{p-578409b2.entry.js.map → p-e9b83dae.entry.js.map} +0 -0
  144. /package/dist/viewer/{p-69aeb12a.entry.js.map → p-f271dc4a.entry.js.map} +0 -0
  145. /package/dist/viewer/{p-9161d8c7.entry.js.map → p-f65c0769.entry.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{h as i,t,p as s,H as n,d as o,e as l}from"./p-Bb32XUUS.js";import{p as e,v as h,r as a,b as r,a as d,m as u,h as v,g as c,q as f,e as w,c as p}from"./p-DDQcM-So.js";import{c as g}from"./p-C6gMOKYg.js";import{w as x,r as y}from"./p-Cd7kap5W.js";import{T as b}from"./p-D33gVA2W.js";import{A as m,D as z}from"./p-BfAW7IWG.js";import{E as T}from"./p-CHdoymO5.js";import{d as D,T as C,R,e as P,r as S,s as E,x as A,A as I,b as U,y as H,z as F,f as N,g as O,h as M,i as k,j as $}from"./p-B6mpmA2-.js";function j(i){if(window.document.activeElement!==i){i.focus();i.setSelectionRange(i.value.length,i.value.length)}}function B(i,t){return t!=null?e.create(i.x-t.left,i.y-t.top):undefined}function X(i,t,s,n){const o=n!=null?h.fromMatrixPosition(n):undefined;if(i!=null&&t!=null&&s!=null&&o!=null){const n=s.transformPointToRay(i,t.image,t.scene.camera);if(t.scene.camera.isOrthographic()){const i=a.at(a.create({origin:o,direction:t.scene.camera.direction}),h.magnitude(t.scene.camera.viewVector)*2);return a.intersectPlane(n,r.fromNormalAndCoplanarPoint(t.scene.camera.direction,i))}else{return a.intersectPlane(n,r.fromNormalAndCoplanarPoint(t.scene.camera.direction,o))}}return undefined}function _(i,t,s,n,o,l){return u.multiply(i,q(t,s,n,o,l))}function q(i,t,s,n,o){const l=new z(n);const e=new m(o);const a=()=>e.convertFrom(t-s);const r=()=>l.convertRealValueToWorld(t-s);switch(i){case"x-translate":return u.makeTranslation(h.create(r(),0,0));case"y-translate":return u.makeTranslation(h.create(0,r(),0));case"z-translate":return u.makeTranslation(h.create(0,0,r()));case"x-rotate":return u.makeRotation(f.fromAxisAngle(h.left(),a()));case"y-rotate":return u.makeRotation(f.fromAxisAngle(h.down(),a()));case"z-rotate":return u.makeRotation(f.fromAxisAngle(h.forward(),a()));default:return u.makeIdentity()}}function J(i){switch(i){case"x-rotate":return"xyz";case"y-rotate":return"yzx";case"z-rotate":return"zxy";default:return"xyz"}}function K(i,t,s,n,o){const l=new z(n);const e=new m(o);const a=()=>u.makeRotation(f.fromMatrixRotation(t));const r=()=>u.multiply(t,u.invert(s));const c=()=>h.transformMatrix(h.fromMatrixPosition(r()),u.invert(a()));const w=()=>v.fromRotationMatrix(u.multiply(u.invert(a()),s),J(i));switch(i){case"x-translate":return l.convertWorldValueToReal(c().x);case"y-translate":return l.convertWorldValueToReal(c().y);case"z-translate":return l.convertWorldValueToReal(c().z);case"x-rotate":return e.convertTo(d.normalizeRadians(w().x));case"y-rotate":return e.convertTo(d.normalizeRadians(w().y));case"z-rotate":return e.convertTo(d.normalizeRadians(w().z));default:return 0}}function L(i,t,s,n,o,l){return V(i,h.subtract(s,t),n,o,l)}function V(i,t,s,n,o){switch(o){case"x-translate":return Z(i,t,h.right());case"y-translate":return Z(i,t,h.up());case"z-translate":return Z(i,t,h.back());case"xy-translate":return G(i,t,h.create(0,0,1));case"xz-translate":return G(i,t,h.create(0,1,0));case"yz-translate":return G(i,t,h.create(1,0,0));case"x-rotate":return W(i,s,h.right(),n);case"y-rotate":return W(i,s,h.up(),n);case"z-rotate":return W(i,s,h.forward(),n);default:return i}}function W(i,t,s,n){const o=Y(i,t,s);const l=f.fromAxisAngle(o,n);const e=u.makeRotation(l);return u.multiply(i,e)}function Y(i,t,s){const n=u.makeRotation(f.fromMatrixRotation(i));const o=h.transformMatrix(s,n);const l=h.transformMatrix(h.negate(s),n);return h.dot(t,o)>h.dot(t,l)?s:h.negate(s)}function Z(i,t,s){const n=h.normalize(s);const o=u.makeRotation(f.fromMatrixRotation(i));const l=h.transformMatrix(n,o);const e=h.project(t,l);const a=u.makeTranslation(e);return u.multiply(a,i)}function G(i,t,s){const n=h.normalize(s);const o=u.makeRotation(f.fromMatrixRotation(i));const l=h.transformMatrix(n,o);const e=h.fromMatrixPosition(i);const a=r.fromNormalAndCoplanarPoint(l,e);const d=r.projectPoint(a,t);const v=h.add(d,h.scale(a.constant,a.normal));const c=u.makeTranslation(v);return u.multiply(c,i)}function Q(i,t,s){if(s.length===0){throw new Error("Unable to compute input position. At least one shape point must be provided.")}const n=c.pad(t,5);const o=s.map((t=>i.transformNdcPointToViewport(t)));const l=c.topLeft(n);const h=e.add(l,e.create(n.width,0));const a=c.bottomRight(n);const r=e.subtract(a,e.create(n.width,0));const d=e.scale(o.reduce(((i,t)=>e.add(i,t)),e.create()),1/o.length,1/o.length);const u=[h,r,a].reduce(((i,t)=>e.distance(d,t)<e.distance(d,i)?t:i),l);switch(u){case l:return{point:u,placement:"top-left"};case h:return{point:u,placement:"top-right"};case r:return{point:u,placement:"bottom-left"};default:return{point:u,placement:"bottom-right"}}}function ii(i,t,s,n,o,l){const e=t==="alt"&&i.altKey||t==="ctrl"&&i.ctrlKey||t==="meta"&&i.metaKey||t==="shift"&&i.shiftKey;if(e&&l!=null&&l>0&&Number.isInteger(l)){const i=s-n;const t=d.toDegrees(i);const e=Math.round(t/l)*l;if(o!=null){const i=Math.round(o/l)*l;const t=o-i;const s=e-t;const h=d.toRadians(s);return h+n}else{const i=d.toRadians(e);return i+n}}else{return s}}const ti=({ref:t,bounds:s,viewport:n,point:o,placement:l,displayUnit:e},h)=>{const a=oi(n,s!==null&&s!==void 0?s:w.create(0,0),o,l);return i("div",{ref:t,class:"widget-input wrapper",style:{...a,height:(s===null||s===void 0?void 0:s.height)!=null?`${s.height}px`:undefined}},h,i("div",{class:"widget-input units"},e.unit.abbreviatedName))};const si=({ref:t,identifier:s,disabled:n,onChange:o,onIncrement:l,onDecrement:e,onBlur:h,onUndo:a})=>{const r=i=>{if(i.target!=null){const t=parseFloat(i.target.value);if(!isNaN(t)){o===null||o===void 0?void 0:o(parseFloat(i.target.value))}}};const d=i=>{const t=i.ctrlKey||i.metaKey;if(i.key==="ArrowUp"){l===null||l===void 0?void 0:l()}else if(i.key==="ArrowDown"){e===null||e===void 0?void 0:e()}else if(i.key==="z"&&t&&a){i.preventDefault();a()}};return i("input",{ref:t,disabled:n,class:`widget-input ${s}`,type:"text",onChange:r,onKeyDown:d,onBlur:h})};function ni(i,t){return Math.min(i,Math.max(0,t))}function oi(i,t,s,n,o=5){const{width:l,height:e}=i.dimensions;const h=t.width+o;const a=t.height+o;function r(i){return`${i}px`}switch(n){case"top-left":return{right:r(ni(l-h,l-s.x)),bottom:r(ni(e-a,e-s.y))};case"top-right":return{left:r(ni(l-h,s.x)),bottom:r(ni(e-a,e-s.y))};case"bottom-left":return{right:r(ni(l-h,l-s.x)),top:r(ni(e-a,s.y))};case"bottom-right":default:return{left:r(ni(l-h,s.x)),top:r(ni(e-a,s.y))}}}function li(i,t,s=3,n=1,o=1){return ai(i,t,h.back(),h.up(),s,n,o)}function ei(i,t,s=3,n=1,o=1){return ai(i,t,h.right(),h.back(),s,n,o)}function hi(i,t,s=3,n=1,o=1){return ai(i,t,h.right(),h.up(),s,n,o)}function ai(i,t,s,n,o,l=1,e=1){const r=h.transformMatrix(h.add(s,n),u.makeRotation(f.fromMatrixRotation(i)));const v=h.transformMatrix(s,u.makeRotation(f.fromMatrixRotation(i)));const c=h.transformMatrix(n,u.makeRotation(f.fromMatrixRotation(i)));const w=10*e**.25;const p=h.fromMatrixPosition(i);const g=h.add(p,h.scale(o*w,r));const x=a.create({origin:g,direction:v});const y=a.create({origin:g,direction:c});const b=h.cross(v,c);const m=h.rotateAboutAxis(d.toRadians(45),a.at(y,-(o*l)),b,g);const z=h.rotateAboutAxis(d.toRadians(45),a.at(x,o*l),b,g);const T=h.rotateAboutAxis(d.toRadians(45),a.at(y,o*l),b,g);const C=h.rotateAboutAxis(d.toRadians(45),a.at(x,-(o*l)),b,g);return new D(h.dot(v,t.direction)!==-1&&h.dot(c,t.direction)!==-1,m,C,z,T,h.transformMatrix(m,t.projectionViewMatrix),h.transformMatrix(C,t.projectionViewMatrix),h.transformMatrix(z,t.projectionViewMatrix),h.transformMatrix(T,t.projectionViewMatrix))}function ri(i,t,s,n){if(i instanceof C){return di(i,t,s,n)}return false}function di(i,t,s,n){return ui([i.points.worldLeft,i.points.worldRight,i.points.worldTip],t,s,n)||ui([i.points.worldLeft,i.points.worldRight,i.points.worldBase],t,s,n)}function ui(i,t,s,n){var o;if(i.length===3){const l=s.transformPointToRay(n,t.image,t.scene.camera);const e=h.subtract(i[1],i[0]);const a=h.subtract(i[2],i[0]);const r=p.epsilon((o=p.fromVectors([l.direction,l.origin,e,a]))!==null&&o!==void 0?o:p.create(e,a));const d=h.cross(l.direction,a);const u=h.dot(e,d);if(!(Math.abs(u)>=r)){return false}const v=h.subtract(l.origin,i[0]);const c=h.dot(v,d)/u;if(c<0||c>1){return false}const f=h.cross(v,e);const w=h.dot(l.direction,f)/u;if(w<0||c+w>1){return false}const g=h.dot(a,f)/u;return!isNaN(g)&&(g>0||t.scene.camera.isOrthographic())}return false}class vi extends R{constructor(i,t={},s={}){var n,o,l,e,h,a,r,d,u,v,c,f,w,p;super(i);this.customization=t;this.disabledAxis={xTranslation:false,yTranslation:false,zTranslation:false,xyTranslation:false,xzTranslation:false,yzTranslation:false,xRotation:false,yRotation:false,zRotation:false};this.axisLines=[];this.rotationLines=[];this.translationMeshes=[];this.rotationMeshes=[];this.hoveredChanged=new T;this.xArrowFillColor=(n=t.colors)===null||n===void 0?void 0:n.xArrow;this.yArrowFillColor=(o=t.colors)===null||o===void 0?void 0:o.yArrow;this.zArrowFillColor=(l=t.colors)===null||l===void 0?void 0:l.zArrow;this.hoveredArrowFillColor=(e=t.colors)===null||e===void 0?void 0:e.hovered;this.outlineColor=(h=t.colors)===null||h===void 0?void 0:h.outline;this.disabledAxis.xTranslation=(a=s.xTranslation)!==null&&a!==void 0?a:false;this.disabledAxis.yTranslation=(r=s.yTranslation)!==null&&r!==void 0?r:false;this.disabledAxis.zTranslation=(d=s.zTranslation)!==null&&d!==void 0?d:false;this.disabledAxis.xyTranslation=(u=s.xyTranslation)!==null&&u!==void 0?u:false;this.disabledAxis.xzTranslation=(v=s.xzTranslation)!==null&&v!==void 0?v:false;this.disabledAxis.yzTranslation=(c=s.yzTranslation)!==null&&c!==void 0?c:false;this.disabledAxis.xRotation=(f=s.xRotation)!==null&&f!==void 0?f:false;this.disabledAxis.yRotation=(w=s.yRotation)!==null&&w!==void 0?w:false;this.disabledAxis.zRotation=(p=s.zRotation)!==null&&p!==void 0?p:false}dispose(){var i;(i=this.reglFrameDisposable)===null||i===void 0?void 0:i.cancel()}getDrawableElements(){return this.drawableElements}getFullBounds(){return this.fullBounds}boundsContainsPoint(i){return this.interactiveBounds!=null&&this.frame!=null&&c.containsPoints(this.interactiveBounds,i)}updateDisabledAxis(i){this.disabledAxis={...this.disabledAxis,...i};this.updateDisabledOnDrawables()}updateCursor(i){this.cursor=i;if(i!=null&&this.frame!=null){this.updateHovered()}else{this.clearHovered()}}updateTransform(i){var t;this.transform=i;if(i!=null&&this.frame!=null){this.updateAndDraw()}else{this.clear();(t=this.reglFrameDisposable)===null||t===void 0?void 0:t.cancel();this.reglFrameDisposable=undefined}}updateColors(i={}){var t,s,n,o,l,e,h,a,r,d,u,v,c,f,w,p;this.xArrowFillColor=(t=i.xArrow)!==null&&t!==void 0?t:this.xArrowFillColor;this.yArrowFillColor=(s=i.yArrow)!==null&&s!==void 0?s:this.yArrowFillColor;this.zArrowFillColor=(n=i.zArrow)!==null&&n!==void 0?n:this.zArrowFillColor;this.twoAxesSquareFillColor=(o=i.twoAxesSquare)!==null&&o!==void 0?o:this.twoAxesSquareFillColor;this.hoveredArrowFillColor=(l=i.hovered)!==null&&l!==void 0?l:this.hoveredArrowFillColor;this.outlineColor=(e=i.outline)!==null&&e!==void 0?e:this.outlineColor;(h=this.xArrow)===null||h===void 0?void 0:h.updateFillColor(this.getXTranslationColor(),true);(a=this.yArrow)===null||a===void 0?void 0:a.updateFillColor(this.getYTranslationColor(),true);(r=this.zArrow)===null||r===void 0?void 0:r.updateFillColor(this.getZTranslationColor(),true);(d=this.xRotation)===null||d===void 0?void 0:d.updateFillColor(this.getXRotationColor(),true);(u=this.yRotation)===null||u===void 0?void 0:u.updateFillColor(this.getYRotationColor(),true);(v=this.zRotation)===null||v===void 0?void 0:v.updateFillColor(this.getZRotationColor(),true);(c=this.xyTranslation)===null||c===void 0?void 0:c.updateFillColor(this.getTwoAxesTranslationColor(),true);(f=this.xzTranslation)===null||f===void 0?void 0:f.updateFillColor(this.getTwoAxesTranslationColor(),true);(w=this.yzTranslation)===null||w===void 0?void 0:w.updateFillColor(this.getTwoAxesTranslationColor(),true);(p=this.hoveredElement)===null||p===void 0?void 0:p.updateFillColor(this.hoveredArrowFillColor)}updateScalars(i){this.customization={...this.customization,scalars:i};if(this.transform!=null&&this.frame!=null){this.updateElements(this.transform,this.frame)}}onHoveredChanged(i){return this.hoveredChanged.on(i)}updateDisabledOnDrawables(){var i,t,s,n,o,l,e,h,a,r,d,u,v,c,f;(i=this.xRotation)===null||i===void 0?void 0:i.setDisabled(this.disabledAxis.xRotation);(t=this.xyRotationLine)===null||t===void 0?void 0:t.setDisabled(this.disabledAxis.xRotation);(s=this.xzRotationLine)===null||s===void 0?void 0:s.setDisabled(this.disabledAxis.xRotation);(n=this.yRotation)===null||n===void 0?void 0:n.setDisabled(this.disabledAxis.yRotation);(o=this.yzRotationLine)===null||o===void 0?void 0:o.setDisabled(this.disabledAxis.yRotation);(l=this.yxRotationLine)===null||l===void 0?void 0:l.setDisabled(this.disabledAxis.yRotation);(e=this.zRotation)===null||e===void 0?void 0:e.setDisabled(this.disabledAxis.zRotation);(h=this.zxRotationLine)===null||h===void 0?void 0:h.setDisabled(this.disabledAxis.zRotation);(a=this.zyRotationLine)===null||a===void 0?void 0:a.setDisabled(this.disabledAxis.zRotation);(r=this.xArrow)===null||r===void 0?void 0:r.setDisabled(this.disabledAxis.xTranslation);(d=this.yArrow)===null||d===void 0?void 0:d.setDisabled(this.disabledAxis.yTranslation);(u=this.zArrow)===null||u===void 0?void 0:u.setDisabled(this.disabledAxis.zTranslation);(v=this.xyTranslation)===null||v===void 0?void 0:v.setDisabled(this.disabledAxis.xyTranslation);(c=this.xzTranslation)===null||c===void 0?void 0:c.setDisabled(this.disabledAxis.xzTranslation);(f=this.yzTranslation)===null||f===void 0?void 0:f.setDisabled(this.disabledAxis.yzTranslation);this.updateColors()}updateHovered(){var i,t,s,n,o,l,e,h,a,r;const d=this.hoveredElement;const u=this.frame;if(u!=null){this.hoveredElement=[...this.translationMeshes,...this.rotationMeshes].filter((i=>i.points.valid&&!i.isDisabled())).find((i=>this.cursor!=null?ri(i,u,this.viewport,this.cursor):false));if(this.hoveredElement!==d){this.hoveredChanged.emit(this.hoveredElement);(i=this.hoveredElement)===null||i===void 0?void 0:i.updateFillColor(this.hoveredArrowFillColor);this.clearFillColorOfPreviouslyHovered(d);if(((t=this.hoveredElement)===null||t===void 0?void 0:t.identifier)==="xy-translate"){(s=this.xArrow)===null||s===void 0?void 0:s.updateFillColor(this.hoveredArrowFillColor);(n=this.yArrow)===null||n===void 0?void 0:n.updateFillColor(this.hoveredArrowFillColor)}else if(((o=this.hoveredElement)===null||o===void 0?void 0:o.identifier)==="xz-translate"){(l=this.xArrow)===null||l===void 0?void 0:l.updateFillColor(this.hoveredArrowFillColor);(e=this.zArrow)===null||e===void 0?void 0:e.updateFillColor(this.hoveredArrowFillColor)}else if(((h=this.hoveredElement)===null||h===void 0?void 0:h.identifier)==="yz-translate"){(a=this.yArrow)===null||a===void 0?void 0:a.updateFillColor(this.hoveredArrowFillColor);(r=this.zArrow)===null||r===void 0?void 0:r.updateFillColor(this.hoveredArrowFillColor)}}}}clearHovered(){const i=this.hoveredElement;this.hoveredElement=undefined;if(this.hoveredElement!==i){this.hoveredChanged.emit(this.hoveredElement);this.clearFillColorOfPreviouslyHovered(i)}}clearFillColorOfPreviouslyHovered(i){var t,s,n,o,l,e,h,a,r,d,u,v;i===null||i===void 0?void 0:i.updateFillColor(i===null||i===void 0?void 0:i.initialFillColor);if((i===null||i===void 0?void 0:i.identifier)==="xy-translate"){(t=this.xArrow)===null||t===void 0?void 0:t.updateFillColor((s=this.xArrow)===null||s===void 0?void 0:s.initialFillColor);(n=this.yArrow)===null||n===void 0?void 0:n.updateFillColor((o=this.yArrow)===null||o===void 0?void 0:o.initialFillColor)}else if((i===null||i===void 0?void 0:i.identifier)==="xz-translate"){(l=this.xArrow)===null||l===void 0?void 0:l.updateFillColor((e=this.xArrow)===null||e===void 0?void 0:e.initialFillColor);(h=this.zArrow)===null||h===void 0?void 0:h.updateFillColor((a=this.zArrow)===null||a===void 0?void 0:a.initialFillColor)}else if((i===null||i===void 0?void 0:i.identifier)==="yz-translate"){(r=this.yArrow)===null||r===void 0?void 0:r.updateFillColor((d=this.yArrow)===null||d===void 0?void 0:d.initialFillColor);(u=this.zArrow)===null||u===void 0?void 0:u.updateFillColor((v=this.zArrow)===null||v===void 0?void 0:v.initialFillColor)}}hasData(){return this.transform!=null}createOrUpdateElements(){if(this.transform!=null&&this.frame!=null){if(this.xArrow==null||this.yArrow==null||this.zArrow==null){this.createElements(this.transform,this.frame)}else{this.updateElements(this.transform,this.frame)}this.interactiveBounds=P(this.viewport,...this.rotationMeshes,...this.translationMeshes);this.fullBounds=P(this.viewport,...this.rotationMeshes,...this.translationMeshes,...this.axisLines)}}createElements(i,t){var s,n,o,l,e,a,r,d,u,v,c,f;this.reglCommand=S({canvas:this.canvasElement,extensions:"angle_instanced_arrays"});const{createShape:w}=E(this.reglCommand);const p=this.computeTriangleSize(h.fromMatrixPosition(i),t);this.xArrow=new C(w,"x-translate",A(i,t.scene.camera,p,(s=this.customization.scalars)===null||s===void 0?void 0:s.xTranslation),this.outlineColor,this.getXTranslationColor());this.xRotation=new C(w,"x-rotate",li(i,t.scene.camera,p,(n=this.customization.scalars)===null||n===void 0?void 0:n.xRotation,(o=this.customization.scalars)===null||o===void 0?void 0:o.xTranslation),this.outlineColor,this.getXRotationColor());this.xAxis=new I(w,"x-axis",U(i,t.scene.camera,this.xArrow),this.outlineColor,this.getXTranslationColor());this.yArrow=new C(w,"y-translate",H(i,t.scene.camera,p,(l=this.customization.scalars)===null||l===void 0?void 0:l.yTranslation),this.outlineColor,this.getYTranslationColor());this.yRotation=new C(w,"y-rotate",ei(i,t.scene.camera,p,(e=this.customization.scalars)===null||e===void 0?void 0:e.yRotation,(a=this.customization.scalars)===null||a===void 0?void 0:a.yTranslation),this.outlineColor,this.getYRotationColor());this.yAxis=new I(w,"y-axis",U(i,t.scene.camera,this.yArrow),this.outlineColor,this.getYTranslationColor());this.zArrow=new C(w,"z-translate",F(i,t.scene.camera,p,(r=this.customization.scalars)===null||r===void 0?void 0:r.zTranslation),this.outlineColor,this.getZTranslationColor());this.zAxis=new I(w,"z-axis",U(i,t.scene.camera,this.zArrow),this.outlineColor,this.getZTranslationColor());this.zRotation=new C(w,"z-rotate",hi(i,t.scene.camera,p,(d=this.customization.scalars)===null||d===void 0?void 0:d.zRotation,(u=this.customization.scalars)===null||u===void 0?void 0:u.zTranslation),this.outlineColor,this.getZRotationColor());this.xyTranslation=new C(w,"xy-translate",N(i,t.scene.camera,p,(v=this.customization.scalars)===null||v===void 0?void 0:v.xyTranslation),this.outlineColor,this.getTwoAxesTranslationColor());this.xzTranslation=new C(w,"xz-translate",O(i,t.scene.camera,p,(c=this.customization.scalars)===null||c===void 0?void 0:c.xzTranslation),this.outlineColor,this.getTwoAxesTranslationColor());this.yzTranslation=new C(w,"yz-translate",M(i,t.scene.camera,p,(f=this.customization.scalars)===null||f===void 0?void 0:f.yzTranslation),this.outlineColor,this.getTwoAxesTranslationColor());this.createRotationLines(w,i,t);this.axisLines=[this.xAxis,this.yAxis,this.zAxis];this.translationMeshes=[this.xArrow,this.yArrow,this.zArrow,this.xyTranslation,this.xzTranslation,this.yzTranslation];this.rotationMeshes=[this.xRotation,this.yRotation,this.zRotation];this.updateDisabledOnDrawables();this.availableElements=[...this.axisLines,...this.rotationLines,...this.translationMeshes,...this.rotationMeshes]}getXRotationColor(){return this.xArrowFillColor}getYRotationColor(){return this.yArrowFillColor}getZRotationColor(){return this.zArrowFillColor}getXTranslationColor(){return this.xArrowFillColor}getYTranslationColor(){return this.yArrowFillColor}getZTranslationColor(){return this.zArrowFillColor}getTwoAxesTranslationColor(){return this.twoAxesSquareFillColor}createRotationLines(i,t,s){var n,o,l,e,a,r;const d=this.computeTriangleSize(h.fromMatrixPosition(t),s);const u=k(s.scene.camera,this.xRotation,(n=this.yArrow)===null||n===void 0?void 0:n.points.worldTip,d);const v=k(s.scene.camera,this.xRotation,(o=this.zArrow)===null||o===void 0?void 0:o.points.worldTip,d);const c=k(s.scene.camera,this.yRotation,(l=this.xArrow)===null||l===void 0?void 0:l.points.worldTip,d);const f=k(s.scene.camera,this.yRotation,(e=this.zArrow)===null||e===void 0?void 0:e.points.worldTip,d);const w=k(s.scene.camera,this.zRotation,(a=this.xArrow)===null||a===void 0?void 0:a.points.worldTip,d);const p=k(s.scene.camera,this.zRotation,(r=this.yArrow)===null||r===void 0?void 0:r.points.worldTip,d);if(u!=null){this.xyRotationLine=new $(i,"xy-rotation-line",u,this.outlineColor)}if(v!=null){this.xzRotationLine=new $(i,"xz-rotation-line",v,this.outlineColor)}if(c!=null){this.yxRotationLine=new $(i,"yx-rotation-line",c,this.outlineColor)}if(f!=null){this.yzRotationLine=new $(i,"yz-rotation-line",f,this.outlineColor)}if(w!=null){this.zxRotationLine=new $(i,"zx-rotation-line",w,this.outlineColor)}if(p!=null){this.zyRotationLine=new $(i,"zy-rotation-line",p,this.outlineColor)}this.rotationLines=[this.xyRotationLine,this.xzRotationLine,this.yxRotationLine,this.yzRotationLine,this.zxRotationLine,this.zyRotationLine].filter((i=>i!=null))}updateElements(i,t){var s,n,o,l,e,a,r,d,u,v,c,f,w,p,g,x,y,b,m,z,T,D,C,R,P,S,E,I,$,j;const B=this.computeTriangleSize(h.fromMatrixPosition(i),t);if(this.xArrow!=null){this.xArrow.updatePoints(A(i,t.scene.camera,B,(s=this.customization.scalars)===null||s===void 0?void 0:s.xTranslation));(n=this.xAxis)===null||n===void 0?void 0:n.updatePoints(U(i,t.scene.camera,this.xArrow))}(o=this.xRotation)===null||o===void 0?void 0:o.updatePoints(li(i,t.scene.camera,B,(l=this.customization.scalars)===null||l===void 0?void 0:l.xRotation,(e=this.customization.scalars)===null||e===void 0?void 0:e.xTranslation));if(this.yArrow!=null){this.yArrow.updatePoints(H(i,t.scene.camera,B,(a=this.customization.scalars)===null||a===void 0?void 0:a.yTranslation));(r=this.yAxis)===null||r===void 0?void 0:r.updatePoints(U(i,t.scene.camera,this.yArrow))}(d=this.yRotation)===null||d===void 0?void 0:d.updatePoints(ei(i,t.scene.camera,B,(u=this.customization.scalars)===null||u===void 0?void 0:u.yRotation,(v=this.customization.scalars)===null||v===void 0?void 0:v.yTranslation));if(this.zArrow!=null){this.zArrow.updatePoints(F(i,t.scene.camera,B,(c=this.customization.scalars)===null||c===void 0?void 0:c.zTranslation));(f=this.zAxis)===null||f===void 0?void 0:f.updatePoints(U(i,t.scene.camera,this.zArrow))}(w=this.zRotation)===null||w===void 0?void 0:w.updatePoints(hi(i,t.scene.camera,B,(p=this.customization.scalars)===null||p===void 0?void 0:p.zRotation,(g=this.customization.scalars)===null||g===void 0?void 0:g.zTranslation));(x=this.xyRotationLine)===null||x===void 0?void 0:x.updatePoints(k(t.scene.camera,this.xRotation,(y=this.yArrow)===null||y===void 0?void 0:y.points.worldTip,B));(b=this.xzRotationLine)===null||b===void 0?void 0:b.updatePoints(k(t.scene.camera,this.xRotation,(m=this.zArrow)===null||m===void 0?void 0:m.points.worldTip,B));(z=this.yxRotationLine)===null||z===void 0?void 0:z.updatePoints(k(t.scene.camera,this.yRotation,(T=this.xArrow)===null||T===void 0?void 0:T.points.worldTip,B));(D=this.yzRotationLine)===null||D===void 0?void 0:D.updatePoints(k(t.scene.camera,this.yRotation,(C=this.zArrow)===null||C===void 0?void 0:C.points.worldTip,B));(R=this.zxRotationLine)===null||R===void 0?void 0:R.updatePoints(k(t.scene.camera,this.zRotation,(P=this.xArrow)===null||P===void 0?void 0:P.points.worldTip,B));(S=this.zyRotationLine)===null||S===void 0?void 0:S.updatePoints(k(t.scene.camera,this.zRotation,(E=this.yArrow)===null||E===void 0?void 0:E.points.worldTip,B));if(this.xyTranslation!=null){this.xyTranslation.updatePoints(N(i,t.scene.camera,B,(I=this.customization.scalars)===null||I===void 0?void 0:I.xyTranslation))}if(this.xzTranslation!=null){this.xzTranslation.updatePoints(O(i,t.scene.camera,B,($=this.customization.scalars)===null||$===void 0?void 0:$.xzTranslation))}if(this.yzTranslation!=null){this.yzTranslation.updatePoints(M(i,t.scene.camera,B,(j=this.customization.scalars)===null||j===void 0?void 0:j.yzTranslation))}}}const ci=()=>`:host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;--viewer-transform-widget-x-axis-arrow-color:var(--x-axis-color);--viewer-transform-widget-y-axis-arrow-color:var(--y-axis-color);--viewer-transform-widget-z-axis-arrow-color:var(--z-axis-color);--viewer-transform-widget-two-axes-square-color:var(--two-axes-color);--viewer-transform-widget-hovered-arrow-color:#ffff00;--viewer-transform-widget-input-width:8em}.widget{position:absolute;top:0;left:0}.widget.hovered{pointer-events:auto}.widget-input.wrapper{position:absolute;pointer-events:auto;display:flex;align-items:center;border:1px solid #444444;border-radius:4px;width:var(--viewer-transform-widget-input-width);text-align:center;background-color:white;box-sizing:border-box}.widget-input.units{position:relative;width:25%;height:100%;padding:0 0.25rem;font-size:0.8125rem;color:#444444}input.widget-input{position:relative;text-align:center;box-sizing:border-box;width:75%;height:100%;outline:none;border-width:0 1px 0 0;border-color:#444444;border-radius:2px 0 0 2px;font-size:0.875rem;color:#444444}input.widget-input.x-translate,input.widget-input.x-rotate{border-left:5px solid var(--viewer-transform-widget-x-axis-arrow-color)}input.widget-input.y-translate,input.widget-input.y-rotate{border-left:5px solid var(--viewer-transform-widget-y-axis-arrow-color)}input.widget-input.z-translate,input.widget-input.z-rotate{border-left:5px solid var(--viewer-transform-widget-z-axis-arrow-color)}input.widget-input:disabled{color:#888888}input.widget-input:focus{outline:none}`;const fi=s(class t extends n{constructor(i){super();if(i!==false){this.__registerHost()}this.__attachShadow();this.positionChanged=o(this,"positionChanged");this.rotationChanged=o(this,"rotationChanged");this.interactionEnded=o(this,"interactionEnded");this.interactionStarted=o(this,"interactionStarted");this.xRotationDisabled=false;this.yRotationDisabled=false;this.zRotationDisabled=false;this.xTranslationDisabled=false;this.yTranslationDisabled=false;this.zTranslationDisabled=false;this.xyTranslationDisabled=false;this.xzTranslationDisabled=false;this.yzTranslationDisabled=false;this.showInputs=true;this.distanceUnit="millimeters";this.angleUnit="degrees";this.decimalPlaces=1;this.rotationSnapKey="shift";this.translationHandleScalar=1;this.rotationHandleScalar=1;this.interactionThrottle=75;this.EXPERIMENTAL_undoKeybindings=false;this.inputValue=0;this.isEndingTransform=false;this.xArrowColor="#ea3324";this.yArrowColor="#4faf32";this.zArrowColor="#0000ff";this.twoAxesSquareColor="#e0e0e0";this.hoveredColor="#ffff00";this.lastAngle=0;this.inputShouldFocus=false;this.handleHoveredDrawableChanged=i=>{this.hovered=i};this.handleViewerFrameDrawn=()=>{this.updatePropsFromViewer()};this.handleViewerDimensionsChange=()=>{x((()=>{if(this.viewer!=null&&this.canvasRef!=null){this.canvasRef.width=this.viewer.viewport.width;this.canvasRef.height=this.viewer.viewport.height;this.updateCanvasBounds(this.canvasRef)}}))};this.handleResize=()=>{if(this.canvasRef!=null){this.updateCanvasBounds(this.canvasRef)}};this.handleInputResize=()=>{if(this.inputWrapperRef!=null){const i=this.inputWrapperRef;y((()=>{this.inputBounds=i.getBoundingClientRect()}))}};this.handleStyleChange=()=>{y((()=>{const i=window.getComputedStyle(this.hostEl);this.xArrowColor=i.getPropertyValue("--viewer-transform-widget-x-axis-arrow-color").trim();this.yArrowColor=i.getPropertyValue("--viewer-transform-widget-y-axis-arrow-color").trim();this.zArrowColor=i.getPropertyValue("--viewer-transform-widget-z-axis-arrow-color").trim();this.twoAxesSquareColor=i.getPropertyValue("--viewer-transform-widget-two-axes-square-color").trim();this.hoveredColor=i.getPropertyValue("--viewer-transform-widget-hovered-arrow-color").trim();this.getTransformWidget().updateColors({xArrow:this.xArrowColor,yArrow:this.yArrowColor,zArrow:this.zArrowColor,twoAxesSquare:this.twoAxesSquareColor,hovered:this.hoveredColor})}))};this.handlePointerMove=i=>{if(this.dragging==null){const t=B(e.create(i.clientX,i.clientY),this.getCanvasBounds());const s=this.getTransformWidget();if(t!=null&&s.boundsContainsPoint(t)){s.updateCursor(t)}else{s.updateCursor(undefined);this.hovered=undefined}}};this.handleBeginDrag=async i=>{var t,s,n;const o=this.getCanvasBounds();if(this.hovered!=null&&o!=null&&this.viewer!=null&&this.position!=null&&this.viewer.frame!=null){this.dragging=this.hovered;if(this.dragging.identifier!==((t=this.lastDragged)===null||t===void 0?void 0:t.identifier)){this.inputValue=0;this.dragStartTransform=this.currentTransform;this.updateInputPosition();this.updateInputValue()}this.lastDragged=undefined;const l=B(e.create(i.clientX,i.clientY),o);const h=this.viewer.viewport.transformWorldToViewport(this.position,this.viewer.frame.scene.camera.projectionViewMatrix);this.lastAngle=l!=null?d.fromPoints(h,l):0;this.lastWorldPosition=X(l,(s=this.viewer)===null||s===void 0?void 0:s.frame,(n=this.viewer)===null||n===void 0?void 0:n.viewport,this.currentTransform);this.interactionStarted.emit();window.removeEventListener("pointermove",this.handlePointerMove);window.addEventListener("pointermove",this.handleDragWithTimer);window.addEventListener("pointerup",this.handleEndTransform)}};this.handleDragWithTimer=async i=>{if(i!=null){i.preventDefault();this.lastMouseEvent=i}if(this.interactionTimer==null){this.interactionTimer=window.setTimeout((async()=>{this.interactionTimer=undefined;await this.handleDrag();this.lastMouseEvent=undefined}),this.interactionThrottle)}};this.handleDrag=async()=>{var i,t,s;const n=this.getCanvasBounds();if(this.dragging!=null&&this.lastWorldPosition!=null&&n!=null&&this.viewer!=null&&this.viewer.frame!=null&&this.position!=null&&this.lastMouseEvent!=null){await((i=this.controller)===null||i===void 0?void 0:i.beginTransform());const o=B(e.create(this.lastMouseEvent.clientX,this.lastMouseEvent.clientY),n);const l=this.viewer.viewport.transformWorldToViewport(this.position,this.viewer.frame.scene.camera.projectionViewMatrix);const h=X(o,(t=this.viewer)===null||t===void 0?void 0:t.frame,(s=this.viewer)===null||s===void 0?void 0:s.viewport,this.currentTransform);if(h!=null&&o!=null&&l!=null){const i=d.fromPoints(l,o);const t=ii(this.lastMouseEvent,this.rotationSnapKey,i,this.lastAngle,this.getDisplayedAngle(),this.rotationSnapDegrees);this.transform(this.lastWorldPosition,h,t-this.lastAngle);this.updateInputPosition();this.updateInputValue();this.lastWorldPosition=h;this.lastAngle=t}}};this.handleEndTransform=async i=>{var t,s;const n=B(e.create(i.clientX,i.clientY),this.getCanvasBounds());const o=this.getTransformWidget();this.lastDragged=this.dragging;this.dragging=undefined;this.lastWorldPosition=undefined;this.lastAngle=0;this.updateInputPosition();this.updateInputValue();o.updateCursor(n);o.updateTransform(this.currentTransform);this.beginEndTransform();window.removeEventListener("pointermove",this.handleDragWithTimer);window.removeEventListener("pointerup",this.handleEndTransform);try{const i=(t=this.controller)===null||t===void 0?void 0:t.getCurrentDelta();await((s=this.controller)===null||s===void 0?void 0:s.endTransform());this.interactionEnded.emit(i)}catch(i){console.error("Failed to end transform interaction",i)}window.addEventListener("pointermove",this.handlePointerMove);this.completeEndTransform()};this.handleInputStep=async i=>{if(this.inputValue!=null&&this.lastInputValue!=null){if(this.isModifyingAngleUnits()){const t=new m(this.angleUnit);const s=t.convertFrom(this.lastInputValue);const n=d.normalizeRadians(s+d.toRadians(i));this.inputValue=t.convertTo(n)}else{this.inputValue=this.lastInputValue+i}await this.updateTransformFromInput(this.inputValue)}};this.handleInputChange=async i=>{await this.updateTransformFromInput(i)};this.handleKeyDown=async i=>{const t=i.ctrlKey||i.metaKey;if(i.key==="z"&&t&&this.EXPERIMENTAL_undoKeybindings){i.stopPropagation();await this.EXPERIMENTAL_undo()}};this.updateTransformFromInput=async i=>{var t,s,n;if(this.lastDragged!=null&&this.currentTransform!=null&&this.startingTransform!=null&&this.lastInputValue!=null){this.currentTransform=_(this.currentTransform,this.lastDragged.identifier,i,this.lastInputValue,this.distanceUnit,this.angleUnit);this.updateInputValue();this.lastInputValue=i;await((t=this.controller)===null||t===void 0?void 0:t.beginTransform());this.getTransformWidget().updateTransform(this.currentTransform);await((s=this.controller)===null||s===void 0?void 0:s.updateTransform(u.multiply(this.currentTransform,u.invert(this.startingTransform))));this.updateInputPosition();await((n=this.controller)===null||n===void 0?void 0:n.endTransformDebounced(this.beginEndTransform,this.completeEndTransform))}};this.updatePropsFromViewer=()=>{const{frame:i}=this.viewer||{};if(i!=null){const t=this.getTransformWidget();t.updateFrame(i,this.dragging==null);this.updateInputPosition()}};this.setupTransformWidget=i=>{var t,s;console.debug(`Initializing transform widget. [initial-position=${JSON.stringify(this.position)}, has-initial-frame=${((t=this.viewer)===null||t===void 0?void 0:t.frame)!=null}]`);const n=this.getTranslationScalar();const o=this.getRotationScalar();this.widget=new vi(i,{colors:{xArrow:this.xArrowColor,yArrow:this.yArrowColor,zArrow:this.zArrowColor,twoAxesSquare:this.twoAxesSquareColor,hovered:this.hoveredColor},scalars:{xTranslation:n,yTranslation:n,zTranslation:n,xyTranslation:o,xzTranslation:o,yzTranslation:o,xRotation:o,yRotation:o,zRotation:o}});if(this.rotation!=null){this.currentTransform=this.getTransformForNewRotation(this.rotation);this.startingTransform=this.currentTransform;this.widget.updateTransform(this.currentTransform)}if(this.position!=null){this.currentTransform=this.getTransformForNewPosition(this.position);this.startingTransform=this.currentTransform;this.widget.updateTransform(this.currentTransform)}if(((s=this.viewer)===null||s===void 0?void 0:s.frame)!=null){this.widget.updateFrame(this.viewer.frame,true)}this.handleSettingDisabledAxis();this.hoveredChangeDisposable=this.widget.onHoveredChanged(this.handleHoveredDrawableChanged);return this.widget};this.updateCanvasBounds=i=>{y((()=>{this.canvasBounds=i.getBoundingClientRect();this.getTransformWidget().updateDimensions(i)}))};this.updateInputValue=()=>{var i,t,s;const n=(i=this.dragging)!==null&&i!==void 0?i:this.lastDragged;const o=(n===null||n===void 0?void 0:n.identifier)==="xy-translate"||(n===null||n===void 0?void 0:n.identifier)==="xz-translate"||(n===null||n===void 0?void 0:n.identifier)==="yz-translate";if(n!=null&&this.currentTransform!=null&&this.dragStartTransform!=null&&!o){this.lastInputValue=this.inputValue;this.inputValue=K(n.identifier,this.currentTransform,this.dragStartTransform,this.distanceUnit,this.angleUnit);if(this.inputRef!=null){const i=(s=(t=this.getDisplayedDistance())!==null&&t!==void 0?t:this.getDisplayedAngle())!==null&&s!==void 0?s:0;const n=`${parseFloat(i.toFixed(this.decimalPlaces))}`;this.inputRef.value=n}}};this.updateInputPosition=()=>{var i,t;const s=(i=this.dragging)!==null&&i!==void 0?i:this.lastDragged;const n=(s===null||s===void 0?void 0:s.identifier)==="xy-translate"||(s===null||s===void 0?void 0:s.identifier)==="xz-translate"||(s===null||s===void 0?void 0:s.identifier)==="yz-translate";if(this.showInputs&&((t=this.viewer)===null||t===void 0?void 0:t.frame)!=null&&this.position!=null&&s!=null&&!n){const i=this.getTransformWidget();const t=i.getFullBounds();this.inputPosition=t!=null?Q(this.viewer.viewport,t,s.points.toArray()):undefined}else if(n){this.inputPosition=undefined}};this.beginEndTransform=()=>{const i=this.getTransformWidget();i.updateDisabledAxis({xRotation:true,yRotation:true,zRotation:true,xTranslation:true,yTranslation:true,zTranslation:true,xyTranslation:true,xzTranslation:true,yzTranslation:true});this.isEndingTransform=true};this.completeEndTransform=()=>{const i=this.getTransformWidget();i.updateDisabledAxis({xRotation:this.xRotationDisabled,yRotation:this.yRotationDisabled,zRotation:this.zRotationDisabled,xTranslation:this.xTranslationDisabled,yTranslation:this.yTranslationDisabled,zTranslation:this.zTranslationDisabled,xyTranslation:this.xyTranslationDisabled,xzTranslation:this.xzTranslationDisabled,yzTranslation:this.yzTranslationDisabled});this.isEndingTransform=false;this.inputShouldFocus=true;if(this.currentTransform!=null){this.position=h.fromMatrixPosition(this.currentTransform);this.rotation=v.fromRotationMatrix(this.currentTransform)}};this.isModifyingAngleUnits=()=>{var i,t,s;const n=(t=(i=this.dragging)===null||i===void 0?void 0:i.identifier)!==null&&t!==void 0?t:(s=this.lastDragged)===null||s===void 0?void 0:s.identifier;return!!(n===null||n===void 0?void 0:n.includes("rotate"))};this.getTranslationScalar=()=>{if(this.translationHandleScalar>0){return this.translationHandleScalar}console.warn("Invalid value provided for translation-handle-scalar. Expected a positive value greater than zero.");return 1};this.getRotationScalar=()=>{if(this.rotationHandleScalar>0){return this.rotationHandleScalar}console.warn("Invalid value provided for rotation-handle-scalar. Expected a positive value greater than zero.");return 1};this.getDisplayedUnits=()=>{if(this.isModifyingAngleUnits()){return new m(this.angleUnit)}return new z(this.distanceUnit)};this.getDisplayedAngle=()=>{if(this.isModifyingAngleUnits()){return this.inputValue}};this.getDisplayedDistance=()=>{var i,t,s;const n=(t=(i=this.dragging)===null||i===void 0?void 0:i.identifier)!==null&&t!==void 0?t:(s=this.lastDragged)===null||s===void 0?void 0:s.identifier;if(n===null||n===void 0?void 0:n.includes("translate")){return this.inputValue}};this.getTransformForNewPosition=i=>{if(i!=null){const t=this.currentTransform!=null?this.currentTransform:u.makeIdentity();const s=u.makeRotation(f.fromMatrixRotation(t));const n=u.makeTranslation(i);return u.multiply(n,s)}};this.getTransformForNewRotation=i=>{const t=this.currentTransform!=null?this.currentTransform:u.makeIdentity();const s=u.invert(u.makeRotation(f.fromMatrixRotation(t)));const n=u.makeRotation(f.fromEuler(i));const o=u.multiply(t,s);return u.multiply(o,n)};this.getCanvasBounds=()=>{if(this.canvasBounds!=null){return this.canvasBounds}else if(this.canvasRef!=null){this.updateCanvasBounds(this.canvasRef);return this.canvasBounds}};this.getTransformWidget=()=>{if(this.widget==null&&this.canvasRef!=null){return this.setupTransformWidget(this.canvasRef)}else if(this.widget!=null){return this.widget}else{throw new Error("Transform widget was not initialized. The canvas element may not have been initialized.")}}}componentDidLoad(){window.addEventListener("pointermove",this.handlePointerMove);this.canvasResizeObserver=new ResizeObserver(this.handleResize);this.inputResizeObserver=new ResizeObserver(this.handleInputResize);this.hostStyleObserver=new MutationObserver(this.handleStyleChange);if(this.canvasRef!=null){this.canvasResizeObserver.observe(this.canvasRef);this.setupTransformWidget(this.canvasRef)}this.hostStyleObserver.observe(this.hostEl,{attributes:true,attributeFilter:["style"]});this.handleViewerChanged(this.viewer,undefined);this.handleStyleChange()}disconnectedCallback(){var i,t,s,n,o;window.removeEventListener("pointermove",this.handlePointerMove);(i=this.canvasResizeObserver)===null||i===void 0?void 0:i.disconnect();(t=this.inputResizeObserver)===null||t===void 0?void 0:t.disconnect();(s=this.hostStyleObserver)===null||s===void 0?void 0:s.disconnect();(n=this.hoveredChangeDisposable)===null||n===void 0?void 0:n.dispose();(o=this.widget)===null||o===void 0?void 0:o.dispose()}componentDidRender(){if(this.inputShouldFocus&&this.inputRef!=null){j(this.inputRef);this.inputShouldFocus=false}}async EXPERIMENTAL_undo(){var i,t;const s=await((i=this.controller)===null||i===void 0?void 0:i.EXPERIMENTAL_undoTransform());if(this.currentTransform!=null&&s!=null){this.currentTransform=u.multiply(s,this.currentTransform);(t=this.widget)===null||t===void 0?void 0:t.updateTransform(this.currentTransform);this.updateInputPosition();this.updateInputValue();this.lastInputValue=this.inputValue;this.position=h.fromMatrixPosition(this.currentTransform);this.rotation=v.fromRotationMatrix(this.currentTransform)}}handleViewerChanged(i,t){var s;t===null||t===void 0?void 0:t.removeEventListener("frameDrawn",this.handleViewerFrameDrawn);t===null||t===void 0?void 0:t.removeEventListener("dimensionschange",this.handleViewerDimensionsChange);i===null||i===void 0?void 0:i.addEventListener("frameDrawn",this.handleViewerFrameDrawn);i===null||i===void 0?void 0:i.addEventListener("dimensionschange",this.handleViewerDimensionsChange);if((i===null||i===void 0?void 0:i.stream)!=null){(s=this.controller)===null||s===void 0?void 0:s.dispose();this.controller=new b(i.stream)}}handleDisabledPropertyChanged(){var i;(i=this.widget)===null||i===void 0?void 0:i.updateDisabledAxis({xRotation:this.xRotationDisabled,yRotation:this.yRotationDisabled,zRotation:this.zRotationDisabled,xTranslation:this.xTranslationDisabled,yTranslation:this.yTranslationDisabled,zTranslation:this.zTranslationDisabled,xyTranslation:this.xyTranslationDisabled,xzTranslation:this.xzTranslationDisabled,yzTranslation:this.yzTranslationDisabled})}handleTransformHandleScalarChanged(){var i;const t=this.getTranslationScalar();const s=this.getRotationScalar();(i=this.widget)===null||i===void 0?void 0:i.updateScalars({xTranslation:t,yTranslation:t,zTranslation:t,xyTranslation:s,xzTranslation:s,yzTranslation:s,xRotation:s,yRotation:s,zRotation:s})}handleRotationChanged(i,t){var s;const n=i!==null&&i!==void 0?i:v.create();this.currentTransform=this.getTransformForNewRotation(n);this.startingTransform=this.currentTransform;if(i==null&&this.currentTransform!=null&&u.isIdentity(this.currentTransform)){this.currentTransform=undefined;this.startingTransform=this.currentTransform}(s=this.widget)===null||s===void 0?void 0:s.updateTransform(this.currentTransform);console.debug(`Updating widget rotation [previous=${JSON.stringify(t)}, current=${JSON.stringify(i)}]`);this.rotationChanged.emit(i)}handlePositionChanged(i,t){var s,n;this.currentTransform=this.getTransformForNewPosition(i);this.startingTransform=this.currentTransform;console.debug(`Updating widget position [previous=${JSON.stringify(t)}, current=${JSON.stringify(i)}]`);(s=this.widget)===null||s===void 0?void 0:s.updateTransform(this.currentTransform);if(i==null){this.lastDragged=undefined;this.inputPosition=undefined;(n=this.controller)===null||n===void 0?void 0:n.clearTransform()}this.positionChanged.emit(i)}handleInputFormattingChanged(){this.updateInputValue();this.lastInputValue=this.inputValue}render(){var t,s,n,o,e,h;return i(l,{key:"5d32e8df03f363c836a8a6194f9ff945227a70c8"},i("canvas",{key:"ba1d8b8b1fb99b808809d32176f341d12708af32",ref:i=>{this.canvasRef=i},class:g("widget",{hovered:this.hovered!=null}),tabindex:"0",width:(t=this.viewer)===null||t===void 0?void 0:t.viewport.width,height:(s=this.viewer)===null||s===void 0?void 0:s.viewport.height,onPointerDown:this.handleBeginDrag,onKeyDown:this.handleKeyDown}),this.showInputs&&this.inputPosition&&((n=this.viewer)===null||n===void 0?void 0:n.viewport)&&i(ti,{key:"734bd29977c8efe57e5e4e9d838279c8d7777ead",ref:i=>{var t,s;if(i!=null){(t=this.inputResizeObserver)===null||t===void 0?void 0:t.observe(i)}else if(this.inputWrapperRef!=null){(s=this.inputResizeObserver)===null||s===void 0?void 0:s.unobserve(this.inputWrapperRef)}this.inputWrapperRef=i},bounds:this.inputBounds,viewport:this.viewer.viewport,point:this.inputPosition.point,placement:this.inputPosition.placement,displayUnit:this.getDisplayedUnits()},i(si,{key:"0d8d997c37a534fcbfe24d452e520a321fea2f18",ref:i=>{this.inputRef=i},identifier:(e=(o=this.dragging)===null||o===void 0?void 0:o.identifier)!==null&&e!==void 0?e:(h=this.lastDragged)===null||h===void 0?void 0:h.identifier,disabled:this.isEndingTransform,onChange:this.handleInputChange,onIncrement:()=>this.handleInputStep(1),onDecrement:()=>this.handleInputStep(-1),onBlur:()=>{this.inputShouldFocus=false},onUndo:this.EXPERIMENTAL_undoKeybindings?()=>this.EXPERIMENTAL_undo():undefined})))}transform(i,t,s){var n,o;if(this.position!=null&&this.startingTransform!=null&&this.currentTransform!=null&&this.dragging!=null&&this.viewer!=null&&this.viewer.frame!=null){this.currentTransform=L(this.currentTransform,i,t,(n=this.viewer)===null||n===void 0?void 0:n.frame.scene.camera.viewVector,s,this.dragging.identifier);this.getTransformWidget().updateTransform(this.currentTransform);(o=this.controller)===null||o===void 0?void 0:o.updateTransform(u.multiply(this.currentTransform,u.invert(this.startingTransform)))}}handleSettingDisabledAxis(){if(this.widget){this.widget.updateDisabledAxis({xRotation:this.xRotationDisabled,yRotation:this.yRotationDisabled,zRotation:this.zRotationDisabled,xTranslation:this.xTranslationDisabled,yTranslation:this.yTranslationDisabled,zTranslation:this.zTranslationDisabled,xyTranslation:this.xyTranslationDisabled,xzTranslation:this.xzTranslationDisabled,yzTranslation:this.yzTranslationDisabled})}else{console.warn("Cannot set disabled values - no widget defined")}}get hostEl(){return this}static get watchers(){return{viewer:[{handleViewerChanged:0}],xTranslationDisabled:[{handleDisabledPropertyChanged:0}],yTranslationDisabled:[{handleDisabledPropertyChanged:0}],zTranslationDisabled:[{handleDisabledPropertyChanged:0}],xyTranslationDisabled:[{handleDisabledPropertyChanged:0}],xzTranslationDisabled:[{handleDisabledPropertyChanged:0}],yzTranslationDisabled:[{handleDisabledPropertyChanged:0}],xRotationDisabled:[{handleDisabledPropertyChanged:0}],yRotationDisabled:[{handleDisabledPropertyChanged:0}],zRotationDisabled:[{handleDisabledPropertyChanged:0}],translationHandleScalar:[{handleTransformHandleScalarChanged:0}],rotationHandleScalar:[{handleTransformHandleScalarChanged:0}],rotation:[{handleRotationChanged:0}],position:[{handlePositionChanged:0}],distanceUnit:[{handleInputFormattingChanged:0}],angleUnit:[{handleInputFormattingChanged:0}],decimalPlaces:[{handleInputFormattingChanged:0}]}}static get style(){return ci()}},[1,"vertex-viewer-transform-widget",{viewer:[16],position:[1040],rotation:[1040],controller:[1040],xRotationDisabled:[1028,"x-rotation-disabled"],yRotationDisabled:[1028,"y-rotation-disabled"],zRotationDisabled:[1028,"z-rotation-disabled"],xTranslationDisabled:[1028,"x-translation-disabled"],yTranslationDisabled:[1028,"y-translation-disabled"],zTranslationDisabled:[1028,"z-translation-disabled"],xyTranslationDisabled:[1028,"xy-translation-disabled"],xzTranslationDisabled:[1028,"xz-translation-disabled"],yzTranslationDisabled:[1028,"yz-translation-disabled"],showInputs:[4,"show-inputs"],distanceUnit:[1,"distance-unit"],angleUnit:[1,"angle-unit"],decimalPlaces:[2,"decimal-places"],rotationSnapDegrees:[2,"rotation-snap-degrees"],rotationSnapKey:[1,"rotation-snap-key"],translationHandleScalar:[2,"translation-handle-scalar"],rotationHandleScalar:[2,"rotation-handle-scalar"],interactionThrottle:[2,"interaction-throttle"],EXPERIMENTAL_undoKeybindings:[4,"e-x-p-e-r-i-m-e-n-t-a-l_undo-keybindings"],hovered:[1040],inputPosition:[32],inputValue:[32],isEndingTransform:[32],EXPERIMENTAL_undo:[64]},undefined,{viewer:[{handleViewerChanged:0}],xTranslationDisabled:[{handleDisabledPropertyChanged:0}],yTranslationDisabled:[{handleDisabledPropertyChanged:0}],zTranslationDisabled:[{handleDisabledPropertyChanged:0}],xyTranslationDisabled:[{handleDisabledPropertyChanged:0}],xzTranslationDisabled:[{handleDisabledPropertyChanged:0}],yzTranslationDisabled:[{handleDisabledPropertyChanged:0}],xRotationDisabled:[{handleDisabledPropertyChanged:0}],yRotationDisabled:[{handleDisabledPropertyChanged:0}],zRotationDisabled:[{handleDisabledPropertyChanged:0}],translationHandleScalar:[{handleTransformHandleScalarChanged:0}],rotationHandleScalar:[{handleTransformHandleScalarChanged:0}],rotation:[{handleRotationChanged:0}],position:[{handlePositionChanged:0}],distanceUnit:[{handleInputFormattingChanged:0}],angleUnit:[{handleInputFormattingChanged:0}],decimalPlaces:[{handleInputFormattingChanged:0}]}]);function wi(){if(typeof customElements==="undefined"){return}const i=["vertex-viewer-transform-widget"];i.forEach((i=>{switch(i){case"vertex-viewer-transform-widget":if(!customElements.get(t(i))){customElements.define(t(i),fi)}break}}))}wi();const pi=fi;const gi=wi;export{pi as VertexViewerTransformWidget,gi as defineCustomElement};
4
+ import{h as i,t,p as s,H as n,d as o,e as l}from"./p-Bb32XUUS.js";import{p as e,v as h,r as a,b as r,a as d,m as u,h as v,g as c,q as f,e as w,c as p}from"./p-DDQcM-So.js";import{c as g}from"./p-C6gMOKYg.js";import{w as x,r as y}from"./p-Cd7kap5W.js";import{T as b}from"./p-D33gVA2W.js";import{A as m,D as z}from"./p-B9R0QWr4.js";import{E as T}from"./p-CHdoymO5.js";import{d as D,T as C,R,e as P,r as S,s as E,x as A,A as U,b as H,y as I,z as F,f as N,g as O,h as M,i as k,j as $}from"./p-abSJ29r7.js";function j(i){if(window.document.activeElement!==i){i.focus();i.setSelectionRange(i.value.length,i.value.length)}}function B(i,t){return t!=null?e.create(i.x-t.left,i.y-t.top):undefined}function J(i,t,s,n){const o=n!=null?h.fromMatrixPosition(n):undefined;if(i!=null&&t!=null&&s!=null&&o!=null){const n=s.transformPointToRay(i,t.image,t.scene.camera);if(t.scene.camera.isOrthographic()){const i=a.at(a.create({origin:o,direction:t.scene.camera.direction}),h.magnitude(t.scene.camera.viewVector)*2);return a.intersectPlane(n,r.fromNormalAndCoplanarPoint(t.scene.camera.direction,i))}else{return a.intersectPlane(n,r.fromNormalAndCoplanarPoint(t.scene.camera.direction,o))}}return undefined}function X(i,t,s,n,o,l){return u.multiply(i,_(t,s,n,o,l))}function _(i,t,s,n,o){const l=new z(n);const e=new m(o);const a=()=>e.convertFrom(t-s);const r=()=>l.convertRealValueToWorld(t-s);switch(i){case"x-translate":return u.makeTranslation(h.create(r(),0,0));case"y-translate":return u.makeTranslation(h.create(0,r(),0));case"z-translate":return u.makeTranslation(h.create(0,0,r()));case"x-rotate":return u.makeRotation(f.fromAxisAngle(h.left(),a()));case"y-rotate":return u.makeRotation(f.fromAxisAngle(h.down(),a()));case"z-rotate":return u.makeRotation(f.fromAxisAngle(h.forward(),a()));default:return u.makeIdentity()}}function q(i){switch(i){case"x-rotate":return"xyz";case"y-rotate":return"yzx";case"z-rotate":return"zxy";default:return"xyz"}}function K(i,t,s,n,o){const l=new z(n);const e=new m(o);const a=()=>u.makeRotation(f.fromMatrixRotation(t));const r=()=>u.multiply(t,u.invert(s));const c=()=>h.transformMatrix(h.fromMatrixPosition(r()),u.invert(a()));const w=()=>v.fromRotationMatrix(u.multiply(u.invert(a()),s),q(i));switch(i){case"x-translate":return l.convertWorldValueToReal(c().x);case"y-translate":return l.convertWorldValueToReal(c().y);case"z-translate":return l.convertWorldValueToReal(c().z);case"x-rotate":return e.convertTo(d.normalizeRadians(w().x));case"y-rotate":return e.convertTo(d.normalizeRadians(w().y));case"z-rotate":return e.convertTo(d.normalizeRadians(w().z));default:return 0}}function L(i,t,s,n,o,l){return V(i,h.subtract(s,t),n,o,l)}function V(i,t,s,n,o){switch(o){case"x-translate":return Q(i,t,h.right());case"y-translate":return Q(i,t,h.up());case"z-translate":return Q(i,t,h.back());case"xy-translate":return Z(i,t,h.create(0,0,1));case"xz-translate":return Z(i,t,h.create(0,1,0));case"yz-translate":return Z(i,t,h.create(1,0,0));case"x-rotate":return W(i,s,h.right(),n);case"y-rotate":return W(i,s,h.up(),n);case"z-rotate":return W(i,s,h.forward(),n);default:return i}}function W(i,t,s,n){const o=Y(i,t,s);const l=f.fromAxisAngle(o,n);const e=u.makeRotation(l);return u.multiply(i,e)}function Y(i,t,s){const n=u.makeRotation(f.fromMatrixRotation(i));const o=h.transformMatrix(s,n);const l=h.transformMatrix(h.negate(s),n);return h.dot(t,o)>h.dot(t,l)?s:h.negate(s)}function Q(i,t,s){const n=h.normalize(s);const o=u.makeRotation(f.fromMatrixRotation(i));const l=h.transformMatrix(n,o);const e=h.project(t,l);const a=u.makeTranslation(e);return u.multiply(a,i)}function Z(i,t,s){const n=h.normalize(s);const o=u.makeRotation(f.fromMatrixRotation(i));const l=h.transformMatrix(n,o);const e=h.fromMatrixPosition(i);const a=r.fromNormalAndCoplanarPoint(l,e);const d=r.projectPoint(a,t);const v=h.add(d,h.scale(a.constant,a.normal));const c=u.makeTranslation(v);return u.multiply(c,i)}function G(i,t,s){if(s.length===0){throw new Error("Unable to compute input position. At least one shape point must be provided.")}const n=c.pad(t,5);const o=s.map((t=>i.transformNdcPointToViewport(t)));const l=c.topLeft(n);const h=e.add(l,e.create(n.width,0));const a=c.bottomRight(n);const r=e.subtract(a,e.create(n.width,0));const d=e.scale(o.reduce(((i,t)=>e.add(i,t)),e.create()),1/o.length,1/o.length);const u=[h,r,a].reduce(((i,t)=>e.distance(d,t)<e.distance(d,i)?t:i),l);switch(u){case l:return{point:u,placement:"top-left"};case h:return{point:u,placement:"top-right"};case r:return{point:u,placement:"bottom-left"};default:return{point:u,placement:"bottom-right"}}}function ii(i,t,s,n,o,l){const e=t==="alt"&&i.altKey||t==="ctrl"&&i.ctrlKey||t==="meta"&&i.metaKey||t==="shift"&&i.shiftKey;if(e&&l!=null&&l>0&&Number.isInteger(l)){const i=s-n;const t=d.toDegrees(i);const e=Math.round(t/l)*l;if(o!=null){const i=Math.round(o/l)*l;const t=o-i;const s=e-t;const h=d.toRadians(s);return h+n}else{const i=d.toRadians(e);return i+n}}else{return s}}const ti=({ref:t,bounds:s,viewport:n,point:o,placement:l,displayUnit:e},h)=>{const a=oi(n,s!==null&&s!==void 0?s:w.create(0,0),o,l);return i("div",{ref:t,class:"widget-input wrapper",style:{...a,height:(s===null||s===void 0?void 0:s.height)!=null?`${s.height}px`:undefined}},h,i("div",{class:"widget-input units"},e.unit.abbreviatedName))};const si=({ref:t,identifier:s,disabled:n,onChange:o,onIncrement:l,onDecrement:e,onBlur:h,onUndo:a})=>{const r=i=>{if(i.target!=null){const t=parseFloat(i.target.value);if(!isNaN(t)){o===null||o===void 0?void 0:o(parseFloat(i.target.value))}}};const d=i=>{const t=i.ctrlKey||i.metaKey;if(i.key==="ArrowUp"){l===null||l===void 0?void 0:l()}else if(i.key==="ArrowDown"){e===null||e===void 0?void 0:e()}else if(i.key==="z"&&t&&a){i.preventDefault();a()}};return i("input",{ref:t,disabled:n,class:`widget-input ${s}`,type:"text",onChange:r,onKeyDown:d,onBlur:h})};function ni(i,t){return Math.min(i,Math.max(0,t))}function oi(i,t,s,n,o=5){const{width:l,height:e}=i.dimensions;const h=t.width+o;const a=t.height+o;function r(i){return`${i}px`}switch(n){case"top-left":return{right:r(ni(l-h,l-s.x)),bottom:r(ni(e-a,e-s.y))};case"top-right":return{left:r(ni(l-h,s.x)),bottom:r(ni(e-a,e-s.y))};case"bottom-left":return{right:r(ni(l-h,l-s.x)),top:r(ni(e-a,s.y))};case"bottom-right":default:return{left:r(ni(l-h,s.x)),top:r(ni(e-a,s.y))}}}function li(i,t,s=3,n=1,o=1){return ai(i,t,h.back(),h.up(),s,n,o)}function ei(i,t,s=3,n=1,o=1){return ai(i,t,h.right(),h.back(),s,n,o)}function hi(i,t,s=3,n=1,o=1){return ai(i,t,h.right(),h.up(),s,n,o)}function ai(i,t,s,n,o,l=1,e=1){const r=h.transformMatrix(h.add(s,n),u.makeRotation(f.fromMatrixRotation(i)));const v=h.transformMatrix(s,u.makeRotation(f.fromMatrixRotation(i)));const c=h.transformMatrix(n,u.makeRotation(f.fromMatrixRotation(i)));const w=10*e**.25;const p=h.fromMatrixPosition(i);const g=h.add(p,h.scale(o*w,r));const x=a.create({origin:g,direction:v});const y=a.create({origin:g,direction:c});const b=h.cross(v,c);const m=h.rotateAboutAxis(d.toRadians(45),a.at(y,-(o*l)),b,g);const z=h.rotateAboutAxis(d.toRadians(45),a.at(x,o*l),b,g);const T=h.rotateAboutAxis(d.toRadians(45),a.at(y,o*l),b,g);const C=h.rotateAboutAxis(d.toRadians(45),a.at(x,-(o*l)),b,g);return new D(h.dot(v,t.direction)!==-1&&h.dot(c,t.direction)!==-1,m,C,z,T,h.transformMatrix(m,t.projectionViewMatrix),h.transformMatrix(C,t.projectionViewMatrix),h.transformMatrix(z,t.projectionViewMatrix),h.transformMatrix(T,t.projectionViewMatrix))}function ri(i,t,s,n){if(i instanceof C){return di(i,t,s,n)}return false}function di(i,t,s,n){return ui([i.points.worldLeft,i.points.worldRight,i.points.worldTip],t,s,n)||ui([i.points.worldLeft,i.points.worldRight,i.points.worldBase],t,s,n)}function ui(i,t,s,n){var o;if(i.length===3){const l=s.transformPointToRay(n,t.image,t.scene.camera);const e=h.subtract(i[1],i[0]);const a=h.subtract(i[2],i[0]);const r=p.epsilon((o=p.fromVectors([l.direction,l.origin,e,a]))!==null&&o!==void 0?o:p.create(e,a));const d=h.cross(l.direction,a);const u=h.dot(e,d);if(!(Math.abs(u)>=r)){return false}const v=h.subtract(l.origin,i[0]);const c=h.dot(v,d)/u;if(c<0||c>1){return false}const f=h.cross(v,e);const w=h.dot(l.direction,f)/u;if(w<0||c+w>1){return false}const g=h.dot(a,f)/u;return!isNaN(g)&&(g>0||t.scene.camera.isOrthographic())}return false}class vi extends R{constructor(i,t={},s={}){var n,o,l,e,h,a,r,d,u,v,c,f,w,p;super(i);this.customization=t;this.disabledAxis={xTranslation:false,yTranslation:false,zTranslation:false,xyTranslation:false,xzTranslation:false,yzTranslation:false,xRotation:false,yRotation:false,zRotation:false};this.axisLines=[];this.rotationLines=[];this.translationMeshes=[];this.rotationMeshes=[];this.hoveredChanged=new T;this.xArrowFillColor=(n=t.colors)===null||n===void 0?void 0:n.xArrow;this.yArrowFillColor=(o=t.colors)===null||o===void 0?void 0:o.yArrow;this.zArrowFillColor=(l=t.colors)===null||l===void 0?void 0:l.zArrow;this.hoveredArrowFillColor=(e=t.colors)===null||e===void 0?void 0:e.hovered;this.outlineColor=(h=t.colors)===null||h===void 0?void 0:h.outline;this.disabledAxis.xTranslation=(a=s.xTranslation)!==null&&a!==void 0?a:false;this.disabledAxis.yTranslation=(r=s.yTranslation)!==null&&r!==void 0?r:false;this.disabledAxis.zTranslation=(d=s.zTranslation)!==null&&d!==void 0?d:false;this.disabledAxis.xyTranslation=(u=s.xyTranslation)!==null&&u!==void 0?u:false;this.disabledAxis.xzTranslation=(v=s.xzTranslation)!==null&&v!==void 0?v:false;this.disabledAxis.yzTranslation=(c=s.yzTranslation)!==null&&c!==void 0?c:false;this.disabledAxis.xRotation=(f=s.xRotation)!==null&&f!==void 0?f:false;this.disabledAxis.yRotation=(w=s.yRotation)!==null&&w!==void 0?w:false;this.disabledAxis.zRotation=(p=s.zRotation)!==null&&p!==void 0?p:false}dispose(){var i;(i=this.reglFrameDisposable)===null||i===void 0?void 0:i.cancel()}getDrawableElements(){return this.drawableElements}getFullBounds(){return this.fullBounds}boundsContainsPoint(i){return this.interactiveBounds!=null&&this.frame!=null&&c.containsPoints(this.interactiveBounds,i)}updateDisabledAxis(i){this.disabledAxis={...this.disabledAxis,...i};this.updateDisabledOnDrawables()}updateCursor(i){this.cursor=i;if(i!=null&&this.frame!=null){this.updateHovered()}else{this.clearHovered()}}updateTransform(i){var t;this.transform=i;if(i!=null&&this.frame!=null){this.updateAndDraw()}else{this.clear();(t=this.reglFrameDisposable)===null||t===void 0?void 0:t.cancel();this.reglFrameDisposable=undefined}}updateColors(i={}){var t,s,n,o,l,e,h,a,r,d,u,v,c,f,w,p;this.xArrowFillColor=(t=i.xArrow)!==null&&t!==void 0?t:this.xArrowFillColor;this.yArrowFillColor=(s=i.yArrow)!==null&&s!==void 0?s:this.yArrowFillColor;this.zArrowFillColor=(n=i.zArrow)!==null&&n!==void 0?n:this.zArrowFillColor;this.twoAxesSquareFillColor=(o=i.twoAxesSquare)!==null&&o!==void 0?o:this.twoAxesSquareFillColor;this.hoveredArrowFillColor=(l=i.hovered)!==null&&l!==void 0?l:this.hoveredArrowFillColor;this.outlineColor=(e=i.outline)!==null&&e!==void 0?e:this.outlineColor;(h=this.xArrow)===null||h===void 0?void 0:h.updateFillColor(this.getXTranslationColor(),true);(a=this.yArrow)===null||a===void 0?void 0:a.updateFillColor(this.getYTranslationColor(),true);(r=this.zArrow)===null||r===void 0?void 0:r.updateFillColor(this.getZTranslationColor(),true);(d=this.xRotation)===null||d===void 0?void 0:d.updateFillColor(this.getXRotationColor(),true);(u=this.yRotation)===null||u===void 0?void 0:u.updateFillColor(this.getYRotationColor(),true);(v=this.zRotation)===null||v===void 0?void 0:v.updateFillColor(this.getZRotationColor(),true);(c=this.xyTranslation)===null||c===void 0?void 0:c.updateFillColor(this.getTwoAxesTranslationColor(),true);(f=this.xzTranslation)===null||f===void 0?void 0:f.updateFillColor(this.getTwoAxesTranslationColor(),true);(w=this.yzTranslation)===null||w===void 0?void 0:w.updateFillColor(this.getTwoAxesTranslationColor(),true);(p=this.hoveredElement)===null||p===void 0?void 0:p.updateFillColor(this.hoveredArrowFillColor)}updateScalars(i){this.customization={...this.customization,scalars:i};if(this.transform!=null&&this.frame!=null){this.updateElements(this.transform,this.frame)}}onHoveredChanged(i){return this.hoveredChanged.on(i)}updateDisabledOnDrawables(){var i,t,s,n,o,l,e,h,a,r,d,u,v,c,f;(i=this.xRotation)===null||i===void 0?void 0:i.setDisabled(this.disabledAxis.xRotation);(t=this.xyRotationLine)===null||t===void 0?void 0:t.setDisabled(this.disabledAxis.xRotation);(s=this.xzRotationLine)===null||s===void 0?void 0:s.setDisabled(this.disabledAxis.xRotation);(n=this.yRotation)===null||n===void 0?void 0:n.setDisabled(this.disabledAxis.yRotation);(o=this.yzRotationLine)===null||o===void 0?void 0:o.setDisabled(this.disabledAxis.yRotation);(l=this.yxRotationLine)===null||l===void 0?void 0:l.setDisabled(this.disabledAxis.yRotation);(e=this.zRotation)===null||e===void 0?void 0:e.setDisabled(this.disabledAxis.zRotation);(h=this.zxRotationLine)===null||h===void 0?void 0:h.setDisabled(this.disabledAxis.zRotation);(a=this.zyRotationLine)===null||a===void 0?void 0:a.setDisabled(this.disabledAxis.zRotation);(r=this.xArrow)===null||r===void 0?void 0:r.setDisabled(this.disabledAxis.xTranslation);(d=this.yArrow)===null||d===void 0?void 0:d.setDisabled(this.disabledAxis.yTranslation);(u=this.zArrow)===null||u===void 0?void 0:u.setDisabled(this.disabledAxis.zTranslation);(v=this.xyTranslation)===null||v===void 0?void 0:v.setDisabled(this.disabledAxis.xyTranslation);(c=this.xzTranslation)===null||c===void 0?void 0:c.setDisabled(this.disabledAxis.xzTranslation);(f=this.yzTranslation)===null||f===void 0?void 0:f.setDisabled(this.disabledAxis.yzTranslation);this.updateColors()}updateHovered(){var i,t,s,n,o,l,e,h,a,r;const d=this.hoveredElement;const u=this.frame;if(u!=null){this.hoveredElement=[...this.translationMeshes,...this.rotationMeshes].filter((i=>i.points.valid&&!i.isDisabled())).find((i=>this.cursor!=null?ri(i,u,this.viewport,this.cursor):false));if(this.hoveredElement!==d){this.hoveredChanged.emit(this.hoveredElement);(i=this.hoveredElement)===null||i===void 0?void 0:i.updateFillColor(this.hoveredArrowFillColor);this.clearFillColorOfPreviouslyHovered(d);if(((t=this.hoveredElement)===null||t===void 0?void 0:t.identifier)==="xy-translate"){(s=this.xArrow)===null||s===void 0?void 0:s.updateFillColor(this.hoveredArrowFillColor);(n=this.yArrow)===null||n===void 0?void 0:n.updateFillColor(this.hoveredArrowFillColor)}else if(((o=this.hoveredElement)===null||o===void 0?void 0:o.identifier)==="xz-translate"){(l=this.xArrow)===null||l===void 0?void 0:l.updateFillColor(this.hoveredArrowFillColor);(e=this.zArrow)===null||e===void 0?void 0:e.updateFillColor(this.hoveredArrowFillColor)}else if(((h=this.hoveredElement)===null||h===void 0?void 0:h.identifier)==="yz-translate"){(a=this.yArrow)===null||a===void 0?void 0:a.updateFillColor(this.hoveredArrowFillColor);(r=this.zArrow)===null||r===void 0?void 0:r.updateFillColor(this.hoveredArrowFillColor)}}}}clearHovered(){const i=this.hoveredElement;this.hoveredElement=undefined;if(this.hoveredElement!==i){this.hoveredChanged.emit(this.hoveredElement);this.clearFillColorOfPreviouslyHovered(i)}}clearFillColorOfPreviouslyHovered(i){var t,s,n,o,l,e,h,a,r,d,u,v;i===null||i===void 0?void 0:i.updateFillColor(i===null||i===void 0?void 0:i.initialFillColor);if((i===null||i===void 0?void 0:i.identifier)==="xy-translate"){(t=this.xArrow)===null||t===void 0?void 0:t.updateFillColor((s=this.xArrow)===null||s===void 0?void 0:s.initialFillColor);(n=this.yArrow)===null||n===void 0?void 0:n.updateFillColor((o=this.yArrow)===null||o===void 0?void 0:o.initialFillColor)}else if((i===null||i===void 0?void 0:i.identifier)==="xz-translate"){(l=this.xArrow)===null||l===void 0?void 0:l.updateFillColor((e=this.xArrow)===null||e===void 0?void 0:e.initialFillColor);(h=this.zArrow)===null||h===void 0?void 0:h.updateFillColor((a=this.zArrow)===null||a===void 0?void 0:a.initialFillColor)}else if((i===null||i===void 0?void 0:i.identifier)==="yz-translate"){(r=this.yArrow)===null||r===void 0?void 0:r.updateFillColor((d=this.yArrow)===null||d===void 0?void 0:d.initialFillColor);(u=this.zArrow)===null||u===void 0?void 0:u.updateFillColor((v=this.zArrow)===null||v===void 0?void 0:v.initialFillColor)}}hasData(){return this.transform!=null}createOrUpdateElements(){if(this.transform!=null&&this.frame!=null){if(this.xArrow==null||this.yArrow==null||this.zArrow==null){this.createElements(this.transform,this.frame)}else{this.updateElements(this.transform,this.frame)}this.interactiveBounds=P(this.viewport,...this.rotationMeshes,...this.translationMeshes);this.fullBounds=P(this.viewport,...this.rotationMeshes,...this.translationMeshes,...this.axisLines)}}createElements(i,t){var s,n,o,l,e,a,r,d,u,v,c,f;this.reglCommand=S({canvas:this.canvasElement,extensions:"angle_instanced_arrays"});const{createShape:w}=E(this.reglCommand);const p=this.computeTriangleSize(h.fromMatrixPosition(i),t);this.xArrow=new C(w,"x-translate",A(i,t.scene.camera,p,(s=this.customization.scalars)===null||s===void 0?void 0:s.xTranslation),this.outlineColor,this.getXTranslationColor());this.xRotation=new C(w,"x-rotate",li(i,t.scene.camera,p,(n=this.customization.scalars)===null||n===void 0?void 0:n.xRotation,(o=this.customization.scalars)===null||o===void 0?void 0:o.xTranslation),this.outlineColor,this.getXRotationColor());this.xAxis=new U(w,"x-axis",H(i,t.scene.camera,this.xArrow),this.outlineColor,this.getXTranslationColor());this.yArrow=new C(w,"y-translate",I(i,t.scene.camera,p,(l=this.customization.scalars)===null||l===void 0?void 0:l.yTranslation),this.outlineColor,this.getYTranslationColor());this.yRotation=new C(w,"y-rotate",ei(i,t.scene.camera,p,(e=this.customization.scalars)===null||e===void 0?void 0:e.yRotation,(a=this.customization.scalars)===null||a===void 0?void 0:a.yTranslation),this.outlineColor,this.getYRotationColor());this.yAxis=new U(w,"y-axis",H(i,t.scene.camera,this.yArrow),this.outlineColor,this.getYTranslationColor());this.zArrow=new C(w,"z-translate",F(i,t.scene.camera,p,(r=this.customization.scalars)===null||r===void 0?void 0:r.zTranslation),this.outlineColor,this.getZTranslationColor());this.zAxis=new U(w,"z-axis",H(i,t.scene.camera,this.zArrow),this.outlineColor,this.getZTranslationColor());this.zRotation=new C(w,"z-rotate",hi(i,t.scene.camera,p,(d=this.customization.scalars)===null||d===void 0?void 0:d.zRotation,(u=this.customization.scalars)===null||u===void 0?void 0:u.zTranslation),this.outlineColor,this.getZRotationColor());this.xyTranslation=new C(w,"xy-translate",N(i,t.scene.camera,p,(v=this.customization.scalars)===null||v===void 0?void 0:v.xyTranslation),this.outlineColor,this.getTwoAxesTranslationColor());this.xzTranslation=new C(w,"xz-translate",O(i,t.scene.camera,p,(c=this.customization.scalars)===null||c===void 0?void 0:c.xzTranslation),this.outlineColor,this.getTwoAxesTranslationColor());this.yzTranslation=new C(w,"yz-translate",M(i,t.scene.camera,p,(f=this.customization.scalars)===null||f===void 0?void 0:f.yzTranslation),this.outlineColor,this.getTwoAxesTranslationColor());this.createRotationLines(w,i,t);this.axisLines=[this.xAxis,this.yAxis,this.zAxis];this.translationMeshes=[this.xArrow,this.yArrow,this.zArrow,this.xyTranslation,this.xzTranslation,this.yzTranslation];this.rotationMeshes=[this.xRotation,this.yRotation,this.zRotation];this.updateDisabledOnDrawables();this.availableElements=[...this.axisLines,...this.rotationLines,...this.translationMeshes,...this.rotationMeshes]}getXRotationColor(){return this.xArrowFillColor}getYRotationColor(){return this.yArrowFillColor}getZRotationColor(){return this.zArrowFillColor}getXTranslationColor(){return this.xArrowFillColor}getYTranslationColor(){return this.yArrowFillColor}getZTranslationColor(){return this.zArrowFillColor}getTwoAxesTranslationColor(){return this.twoAxesSquareFillColor}createRotationLines(i,t,s){var n,o,l,e,a,r;const d=this.computeTriangleSize(h.fromMatrixPosition(t),s);const u=k(s.scene.camera,this.xRotation,(n=this.yArrow)===null||n===void 0?void 0:n.points.worldTip,d);const v=k(s.scene.camera,this.xRotation,(o=this.zArrow)===null||o===void 0?void 0:o.points.worldTip,d);const c=k(s.scene.camera,this.yRotation,(l=this.xArrow)===null||l===void 0?void 0:l.points.worldTip,d);const f=k(s.scene.camera,this.yRotation,(e=this.zArrow)===null||e===void 0?void 0:e.points.worldTip,d);const w=k(s.scene.camera,this.zRotation,(a=this.xArrow)===null||a===void 0?void 0:a.points.worldTip,d);const p=k(s.scene.camera,this.zRotation,(r=this.yArrow)===null||r===void 0?void 0:r.points.worldTip,d);if(u!=null){this.xyRotationLine=new $(i,"xy-rotation-line",u,this.outlineColor)}if(v!=null){this.xzRotationLine=new $(i,"xz-rotation-line",v,this.outlineColor)}if(c!=null){this.yxRotationLine=new $(i,"yx-rotation-line",c,this.outlineColor)}if(f!=null){this.yzRotationLine=new $(i,"yz-rotation-line",f,this.outlineColor)}if(w!=null){this.zxRotationLine=new $(i,"zx-rotation-line",w,this.outlineColor)}if(p!=null){this.zyRotationLine=new $(i,"zy-rotation-line",p,this.outlineColor)}this.rotationLines=[this.xyRotationLine,this.xzRotationLine,this.yxRotationLine,this.yzRotationLine,this.zxRotationLine,this.zyRotationLine].filter((i=>i!=null))}updateElements(i,t){var s,n,o,l,e,a,r,d,u,v,c,f,w,p,g,x,y,b,m,z,T,D,C,R,P,S,E,U,$,j;const B=this.computeTriangleSize(h.fromMatrixPosition(i),t);if(this.xArrow!=null){this.xArrow.updatePoints(A(i,t.scene.camera,B,(s=this.customization.scalars)===null||s===void 0?void 0:s.xTranslation));(n=this.xAxis)===null||n===void 0?void 0:n.updatePoints(H(i,t.scene.camera,this.xArrow))}(o=this.xRotation)===null||o===void 0?void 0:o.updatePoints(li(i,t.scene.camera,B,(l=this.customization.scalars)===null||l===void 0?void 0:l.xRotation,(e=this.customization.scalars)===null||e===void 0?void 0:e.xTranslation));if(this.yArrow!=null){this.yArrow.updatePoints(I(i,t.scene.camera,B,(a=this.customization.scalars)===null||a===void 0?void 0:a.yTranslation));(r=this.yAxis)===null||r===void 0?void 0:r.updatePoints(H(i,t.scene.camera,this.yArrow))}(d=this.yRotation)===null||d===void 0?void 0:d.updatePoints(ei(i,t.scene.camera,B,(u=this.customization.scalars)===null||u===void 0?void 0:u.yRotation,(v=this.customization.scalars)===null||v===void 0?void 0:v.yTranslation));if(this.zArrow!=null){this.zArrow.updatePoints(F(i,t.scene.camera,B,(c=this.customization.scalars)===null||c===void 0?void 0:c.zTranslation));(f=this.zAxis)===null||f===void 0?void 0:f.updatePoints(H(i,t.scene.camera,this.zArrow))}(w=this.zRotation)===null||w===void 0?void 0:w.updatePoints(hi(i,t.scene.camera,B,(p=this.customization.scalars)===null||p===void 0?void 0:p.zRotation,(g=this.customization.scalars)===null||g===void 0?void 0:g.zTranslation));(x=this.xyRotationLine)===null||x===void 0?void 0:x.updatePoints(k(t.scene.camera,this.xRotation,(y=this.yArrow)===null||y===void 0?void 0:y.points.worldTip,B));(b=this.xzRotationLine)===null||b===void 0?void 0:b.updatePoints(k(t.scene.camera,this.xRotation,(m=this.zArrow)===null||m===void 0?void 0:m.points.worldTip,B));(z=this.yxRotationLine)===null||z===void 0?void 0:z.updatePoints(k(t.scene.camera,this.yRotation,(T=this.xArrow)===null||T===void 0?void 0:T.points.worldTip,B));(D=this.yzRotationLine)===null||D===void 0?void 0:D.updatePoints(k(t.scene.camera,this.yRotation,(C=this.zArrow)===null||C===void 0?void 0:C.points.worldTip,B));(R=this.zxRotationLine)===null||R===void 0?void 0:R.updatePoints(k(t.scene.camera,this.zRotation,(P=this.xArrow)===null||P===void 0?void 0:P.points.worldTip,B));(S=this.zyRotationLine)===null||S===void 0?void 0:S.updatePoints(k(t.scene.camera,this.zRotation,(E=this.yArrow)===null||E===void 0?void 0:E.points.worldTip,B));if(this.xyTranslation!=null){this.xyTranslation.updatePoints(N(i,t.scene.camera,B,(U=this.customization.scalars)===null||U===void 0?void 0:U.xyTranslation))}if(this.xzTranslation!=null){this.xzTranslation.updatePoints(O(i,t.scene.camera,B,($=this.customization.scalars)===null||$===void 0?void 0:$.xzTranslation))}if(this.yzTranslation!=null){this.yzTranslation.updatePoints(M(i,t.scene.camera,B,(j=this.customization.scalars)===null||j===void 0?void 0:j.yzTranslation))}}}const ci=()=>`:host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;--viewer-transform-widget-x-axis-arrow-color:var(--x-axis-color);--viewer-transform-widget-y-axis-arrow-color:var(--y-axis-color);--viewer-transform-widget-z-axis-arrow-color:var(--z-axis-color);--viewer-transform-widget-two-axes-square-color:var(--two-axes-color);--viewer-transform-widget-hovered-arrow-color:#ffff00;--viewer-transform-widget-input-width:8em}.widget{position:absolute;top:0;left:0}.widget.hovered{pointer-events:auto}.widget-input.wrapper{position:absolute;pointer-events:auto;display:flex;align-items:center;border:1px solid #444444;border-radius:4px;width:var(--viewer-transform-widget-input-width);text-align:center;background-color:white;box-sizing:border-box}.widget-input.units{position:relative;width:25%;height:100%;padding:0 0.25rem;font-size:0.8125rem;color:#444444}input.widget-input{position:relative;text-align:center;box-sizing:border-box;width:75%;height:100%;outline:none;border-width:0 1px 0 0;border-color:#444444;border-radius:2px 0 0 2px;font-size:0.875rem;color:#444444}input.widget-input.x-translate,input.widget-input.x-rotate{border-left:5px solid var(--viewer-transform-widget-x-axis-arrow-color)}input.widget-input.y-translate,input.widget-input.y-rotate{border-left:5px solid var(--viewer-transform-widget-y-axis-arrow-color)}input.widget-input.z-translate,input.widget-input.z-rotate{border-left:5px solid var(--viewer-transform-widget-z-axis-arrow-color)}input.widget-input:disabled{color:#888888}input.widget-input:focus{outline:none}`;const fi=s(class t extends n{constructor(i){super();if(i!==false){this.__registerHost()}this.__attachShadow();this.positionChanged=o(this,"positionChanged");this.rotationChanged=o(this,"rotationChanged");this.interactionEnded=o(this,"interactionEnded");this.interactionStarted=o(this,"interactionStarted");this.xRotationDisabled=false;this.yRotationDisabled=false;this.zRotationDisabled=false;this.xTranslationDisabled=false;this.yTranslationDisabled=false;this.zTranslationDisabled=false;this.xyTranslationDisabled=false;this.xzTranslationDisabled=false;this.yzTranslationDisabled=false;this.showInputs=true;this.distanceUnit="millimeters";this.angleUnit="degrees";this.decimalPlaces=1;this.rotationSnapKey="shift";this.translationHandleScalar=1;this.rotationHandleScalar=1;this.interactionThrottle=75;this.EXPERIMENTAL_undoKeybindings=false;this.inputValue=0;this.isEndingTransform=false;this.xArrowColor="#ea3324";this.yArrowColor="#4faf32";this.zArrowColor="#0000ff";this.twoAxesSquareColor="#e0e0e0";this.hoveredColor="#ffff00";this.lastAngle=0;this.inputShouldFocus=false;this.handleHoveredDrawableChanged=i=>{this.hovered=i};this.handleViewerFrameDrawn=()=>{this.updatePropsFromViewer()};this.handleViewerDimensionsChange=()=>{x((()=>{if(this.viewer!=null&&this.canvasRef!=null){this.canvasRef.width=this.viewer.viewport.width;this.canvasRef.height=this.viewer.viewport.height;this.updateCanvasBounds(this.canvasRef)}}))};this.handleResize=()=>{if(this.canvasRef!=null){this.updateCanvasBounds(this.canvasRef)}};this.handleInputResize=()=>{if(this.inputWrapperRef!=null){const i=this.inputWrapperRef;y((()=>{this.inputBounds=i.getBoundingClientRect()}))}};this.handleStyleChange=()=>{y((()=>{const i=window.getComputedStyle(this.hostEl);this.xArrowColor=i.getPropertyValue("--viewer-transform-widget-x-axis-arrow-color").trim();this.yArrowColor=i.getPropertyValue("--viewer-transform-widget-y-axis-arrow-color").trim();this.zArrowColor=i.getPropertyValue("--viewer-transform-widget-z-axis-arrow-color").trim();this.twoAxesSquareColor=i.getPropertyValue("--viewer-transform-widget-two-axes-square-color").trim();this.hoveredColor=i.getPropertyValue("--viewer-transform-widget-hovered-arrow-color").trim();this.getTransformWidget().updateColors({xArrow:this.xArrowColor,yArrow:this.yArrowColor,zArrow:this.zArrowColor,twoAxesSquare:this.twoAxesSquareColor,hovered:this.hoveredColor})}))};this.handlePointerMove=i=>{if(this.dragging==null){const t=B(e.create(i.clientX,i.clientY),this.getCanvasBounds());const s=this.getTransformWidget();if(t!=null&&s.boundsContainsPoint(t)){s.updateCursor(t)}else{s.updateCursor(undefined);this.hovered=undefined}}};this.handleBeginDrag=async i=>{var t,s,n;const o=this.getCanvasBounds();if(this.hovered!=null&&o!=null&&this.viewer!=null&&this.position!=null&&this.viewer.frame!=null){this.dragging=this.hovered;if(this.dragging.identifier!==((t=this.lastDragged)===null||t===void 0?void 0:t.identifier)){this.inputValue=0;this.dragStartTransform=this.currentTransform;this.updateInputPosition();this.updateInputValue()}this.lastDragged=undefined;const l=B(e.create(i.clientX,i.clientY),o);const h=this.viewer.viewport.transformWorldToViewport(this.position,this.viewer.frame.scene.camera.projectionViewMatrix);this.lastAngle=l!=null?d.fromPoints(h,l):0;this.lastWorldPosition=J(l,(s=this.viewer)===null||s===void 0?void 0:s.frame,(n=this.viewer)===null||n===void 0?void 0:n.viewport,this.currentTransform);this.interactionStarted.emit();window.removeEventListener("pointermove",this.handlePointerMove);window.addEventListener("pointermove",this.handleDragWithTimer);window.addEventListener("pointerup",this.handleEndTransform)}};this.handleDragWithTimer=async i=>{if(i!=null){i.preventDefault();this.lastMouseEvent=i}if(this.interactionTimer==null){this.interactionTimer=window.setTimeout((async()=>{this.interactionTimer=undefined;await this.handleDrag();this.lastMouseEvent=undefined}),this.interactionThrottle)}};this.handleDrag=async()=>{var i,t,s;const n=this.getCanvasBounds();if(this.dragging!=null&&this.lastWorldPosition!=null&&n!=null&&this.viewer!=null&&this.viewer.frame!=null&&this.position!=null&&this.lastMouseEvent!=null){await((i=this.controller)===null||i===void 0?void 0:i.beginTransform());const o=B(e.create(this.lastMouseEvent.clientX,this.lastMouseEvent.clientY),n);const l=this.viewer.viewport.transformWorldToViewport(this.position,this.viewer.frame.scene.camera.projectionViewMatrix);const h=J(o,(t=this.viewer)===null||t===void 0?void 0:t.frame,(s=this.viewer)===null||s===void 0?void 0:s.viewport,this.currentTransform);if(h!=null&&o!=null&&l!=null){const i=d.fromPoints(l,o);const t=ii(this.lastMouseEvent,this.rotationSnapKey,i,this.lastAngle,this.getDisplayedAngle(),this.rotationSnapDegrees);this.transform(this.lastWorldPosition,h,t-this.lastAngle);this.updateInputPosition();this.updateInputValue();this.lastWorldPosition=h;this.lastAngle=t}}};this.handleEndTransform=async i=>{var t,s;const n=B(e.create(i.clientX,i.clientY),this.getCanvasBounds());const o=this.getTransformWidget();this.lastDragged=this.dragging;this.dragging=undefined;this.lastWorldPosition=undefined;this.lastAngle=0;this.updateInputPosition();this.updateInputValue();o.updateCursor(n);o.updateTransform(this.currentTransform);this.beginEndTransform();window.removeEventListener("pointermove",this.handleDragWithTimer);window.removeEventListener("pointerup",this.handleEndTransform);try{const i=(t=this.controller)===null||t===void 0?void 0:t.getCurrentDelta();await((s=this.controller)===null||s===void 0?void 0:s.endTransform());this.interactionEnded.emit(i)}catch(i){console.error("Failed to end transform interaction",i)}window.addEventListener("pointermove",this.handlePointerMove);this.completeEndTransform()};this.handleInputStep=async i=>{if(this.inputValue!=null&&this.lastInputValue!=null){if(this.isModifyingAngleUnits()){const t=new m(this.angleUnit);const s=t.convertFrom(this.lastInputValue);const n=d.normalizeRadians(s+d.toRadians(i));this.inputValue=t.convertTo(n)}else{this.inputValue=this.lastInputValue+i}await this.updateTransformFromInput(this.inputValue)}};this.handleInputChange=async i=>{await this.updateTransformFromInput(i)};this.handleKeyDown=async i=>{const t=i.ctrlKey||i.metaKey;if(i.key==="z"&&t&&this.EXPERIMENTAL_undoKeybindings){i.stopPropagation();await this.EXPERIMENTAL_undo()}};this.updateTransformFromInput=async i=>{var t,s,n;if(this.lastDragged!=null&&this.currentTransform!=null&&this.startingTransform!=null&&this.lastInputValue!=null){this.currentTransform=X(this.currentTransform,this.lastDragged.identifier,i,this.lastInputValue,this.distanceUnit,this.angleUnit);this.updateInputValue();this.lastInputValue=i;await((t=this.controller)===null||t===void 0?void 0:t.beginTransform());this.getTransformWidget().updateTransform(this.currentTransform);await((s=this.controller)===null||s===void 0?void 0:s.updateTransform(u.multiply(this.currentTransform,u.invert(this.startingTransform))));this.updateInputPosition();await((n=this.controller)===null||n===void 0?void 0:n.endTransformDebounced(this.beginEndTransform,this.completeEndTransform))}};this.updatePropsFromViewer=()=>{const{frame:i}=this.viewer||{};if(i!=null){const t=this.getTransformWidget();t.updateFrame(i,this.dragging==null);this.updateInputPosition()}};this.setupTransformWidget=i=>{var t,s;console.debug(`Initializing transform widget. [initial-position=${JSON.stringify(this.position)}, has-initial-frame=${((t=this.viewer)===null||t===void 0?void 0:t.frame)!=null}]`);const n=this.getTranslationScalar();const o=this.getRotationScalar();this.widget=new vi(i,{colors:{xArrow:this.xArrowColor,yArrow:this.yArrowColor,zArrow:this.zArrowColor,twoAxesSquare:this.twoAxesSquareColor,hovered:this.hoveredColor},scalars:{xTranslation:n,yTranslation:n,zTranslation:n,xyTranslation:o,xzTranslation:o,yzTranslation:o,xRotation:o,yRotation:o,zRotation:o}});if(this.rotation!=null){this.currentTransform=this.getTransformForNewRotation(this.rotation);this.startingTransform=this.currentTransform;this.widget.updateTransform(this.currentTransform)}if(this.position!=null){this.currentTransform=this.getTransformForNewPosition(this.position);this.startingTransform=this.currentTransform;this.widget.updateTransform(this.currentTransform)}if(((s=this.viewer)===null||s===void 0?void 0:s.frame)!=null){this.widget.updateFrame(this.viewer.frame,true)}this.handleSettingDisabledAxis();this.hoveredChangeDisposable=this.widget.onHoveredChanged(this.handleHoveredDrawableChanged);return this.widget};this.updateCanvasBounds=i=>{y((()=>{this.canvasBounds=i.getBoundingClientRect();this.getTransformWidget().updateDimensions(i)}))};this.updateInputValue=()=>{var i,t,s;const n=(i=this.dragging)!==null&&i!==void 0?i:this.lastDragged;const o=(n===null||n===void 0?void 0:n.identifier)==="xy-translate"||(n===null||n===void 0?void 0:n.identifier)==="xz-translate"||(n===null||n===void 0?void 0:n.identifier)==="yz-translate";if(n!=null&&this.currentTransform!=null&&this.dragStartTransform!=null&&!o){this.lastInputValue=this.inputValue;this.inputValue=K(n.identifier,this.currentTransform,this.dragStartTransform,this.distanceUnit,this.angleUnit);if(this.inputRef!=null){const i=(s=(t=this.getDisplayedDistance())!==null&&t!==void 0?t:this.getDisplayedAngle())!==null&&s!==void 0?s:0;const n=`${parseFloat(i.toFixed(this.decimalPlaces))}`;this.inputRef.value=n}}};this.updateInputPosition=()=>{var i,t;const s=(i=this.dragging)!==null&&i!==void 0?i:this.lastDragged;const n=(s===null||s===void 0?void 0:s.identifier)==="xy-translate"||(s===null||s===void 0?void 0:s.identifier)==="xz-translate"||(s===null||s===void 0?void 0:s.identifier)==="yz-translate";if(this.showInputs&&((t=this.viewer)===null||t===void 0?void 0:t.frame)!=null&&this.position!=null&&s!=null&&!n){const i=this.getTransformWidget();const t=i.getFullBounds();this.inputPosition=t!=null?G(this.viewer.viewport,t,s.points.toArray()):undefined}else if(n){this.inputPosition=undefined}};this.beginEndTransform=()=>{const i=this.getTransformWidget();i.updateDisabledAxis({xRotation:true,yRotation:true,zRotation:true,xTranslation:true,yTranslation:true,zTranslation:true,xyTranslation:true,xzTranslation:true,yzTranslation:true});this.isEndingTransform=true};this.completeEndTransform=()=>{const i=this.getTransformWidget();i.updateDisabledAxis({xRotation:this.xRotationDisabled,yRotation:this.yRotationDisabled,zRotation:this.zRotationDisabled,xTranslation:this.xTranslationDisabled,yTranslation:this.yTranslationDisabled,zTranslation:this.zTranslationDisabled,xyTranslation:this.xyTranslationDisabled,xzTranslation:this.xzTranslationDisabled,yzTranslation:this.yzTranslationDisabled});this.isEndingTransform=false;this.inputShouldFocus=true;if(this.currentTransform!=null){this.position=h.fromMatrixPosition(this.currentTransform);this.rotation=v.fromRotationMatrix(this.currentTransform)}};this.isModifyingAngleUnits=()=>{var i,t,s;const n=(t=(i=this.dragging)===null||i===void 0?void 0:i.identifier)!==null&&t!==void 0?t:(s=this.lastDragged)===null||s===void 0?void 0:s.identifier;return!!(n===null||n===void 0?void 0:n.includes("rotate"))};this.getTranslationScalar=()=>{if(this.translationHandleScalar>0){return this.translationHandleScalar}console.warn("Invalid value provided for translation-handle-scalar. Expected a positive value greater than zero.");return 1};this.getRotationScalar=()=>{if(this.rotationHandleScalar>0){return this.rotationHandleScalar}console.warn("Invalid value provided for rotation-handle-scalar. Expected a positive value greater than zero.");return 1};this.getDisplayedUnits=()=>{if(this.isModifyingAngleUnits()){return new m(this.angleUnit)}return new z(this.distanceUnit)};this.getDisplayedAngle=()=>{if(this.isModifyingAngleUnits()){return this.inputValue}};this.getDisplayedDistance=()=>{var i,t,s;const n=(t=(i=this.dragging)===null||i===void 0?void 0:i.identifier)!==null&&t!==void 0?t:(s=this.lastDragged)===null||s===void 0?void 0:s.identifier;if(n===null||n===void 0?void 0:n.includes("translate")){return this.inputValue}};this.getTransformForNewPosition=i=>{if(i!=null){const t=this.currentTransform!=null?this.currentTransform:u.makeIdentity();const s=u.makeRotation(f.fromMatrixRotation(t));const n=u.makeTranslation(i);return u.multiply(n,s)}};this.getTransformForNewRotation=i=>{const t=this.currentTransform!=null?this.currentTransform:u.makeIdentity();const s=u.invert(u.makeRotation(f.fromMatrixRotation(t)));const n=u.makeRotation(f.fromEuler(i));const o=u.multiply(t,s);return u.multiply(o,n)};this.getCanvasBounds=()=>{if(this.canvasBounds!=null){return this.canvasBounds}else if(this.canvasRef!=null){this.updateCanvasBounds(this.canvasRef);return this.canvasBounds}};this.getTransformWidget=()=>{if(this.widget==null&&this.canvasRef!=null){return this.setupTransformWidget(this.canvasRef)}else if(this.widget!=null){return this.widget}else{throw new Error("Transform widget was not initialized. The canvas element may not have been initialized.")}}}componentDidLoad(){window.addEventListener("pointermove",this.handlePointerMove);this.canvasResizeObserver=new ResizeObserver(this.handleResize);this.inputResizeObserver=new ResizeObserver(this.handleInputResize);this.hostStyleObserver=new MutationObserver(this.handleStyleChange);if(this.canvasRef!=null){this.canvasResizeObserver.observe(this.canvasRef);this.setupTransformWidget(this.canvasRef)}this.hostStyleObserver.observe(this.hostEl,{attributes:true,attributeFilter:["style"]});this.handleViewerChanged(this.viewer,undefined);this.handleStyleChange()}disconnectedCallback(){var i,t,s,n,o;window.removeEventListener("pointermove",this.handlePointerMove);(i=this.canvasResizeObserver)===null||i===void 0?void 0:i.disconnect();(t=this.inputResizeObserver)===null||t===void 0?void 0:t.disconnect();(s=this.hostStyleObserver)===null||s===void 0?void 0:s.disconnect();(n=this.hoveredChangeDisposable)===null||n===void 0?void 0:n.dispose();(o=this.widget)===null||o===void 0?void 0:o.dispose()}componentDidRender(){if(this.inputShouldFocus&&this.inputRef!=null){j(this.inputRef);this.inputShouldFocus=false}}async EXPERIMENTAL_undo(){var i,t;const s=await((i=this.controller)===null||i===void 0?void 0:i.EXPERIMENTAL_undoTransform());if(this.currentTransform!=null&&s!=null){this.currentTransform=u.multiply(s,this.currentTransform);(t=this.widget)===null||t===void 0?void 0:t.updateTransform(this.currentTransform);this.updateInputPosition();this.updateInputValue();this.lastInputValue=this.inputValue;this.position=h.fromMatrixPosition(this.currentTransform);this.rotation=v.fromRotationMatrix(this.currentTransform)}}handleViewerChanged(i,t){var s;t===null||t===void 0?void 0:t.removeEventListener("frameDrawn",this.handleViewerFrameDrawn);t===null||t===void 0?void 0:t.removeEventListener("dimensionschange",this.handleViewerDimensionsChange);i===null||i===void 0?void 0:i.addEventListener("frameDrawn",this.handleViewerFrameDrawn);i===null||i===void 0?void 0:i.addEventListener("dimensionschange",this.handleViewerDimensionsChange);if((i===null||i===void 0?void 0:i.stream)!=null){(s=this.controller)===null||s===void 0?void 0:s.dispose();this.controller=new b(i.stream)}}handleDisabledPropertyChanged(){var i;(i=this.widget)===null||i===void 0?void 0:i.updateDisabledAxis({xRotation:this.xRotationDisabled,yRotation:this.yRotationDisabled,zRotation:this.zRotationDisabled,xTranslation:this.xTranslationDisabled,yTranslation:this.yTranslationDisabled,zTranslation:this.zTranslationDisabled,xyTranslation:this.xyTranslationDisabled,xzTranslation:this.xzTranslationDisabled,yzTranslation:this.yzTranslationDisabled})}handleTransformHandleScalarChanged(){var i;const t=this.getTranslationScalar();const s=this.getRotationScalar();(i=this.widget)===null||i===void 0?void 0:i.updateScalars({xTranslation:t,yTranslation:t,zTranslation:t,xyTranslation:s,xzTranslation:s,yzTranslation:s,xRotation:s,yRotation:s,zRotation:s})}handleRotationChanged(i,t){var s;const n=i!==null&&i!==void 0?i:v.create();this.currentTransform=this.getTransformForNewRotation(n);this.startingTransform=this.currentTransform;if(i==null&&this.currentTransform!=null&&u.isIdentity(this.currentTransform)){this.currentTransform=undefined;this.startingTransform=this.currentTransform}(s=this.widget)===null||s===void 0?void 0:s.updateTransform(this.currentTransform);console.debug(`Updating widget rotation [previous=${JSON.stringify(t)}, current=${JSON.stringify(i)}]`);this.rotationChanged.emit(i)}handlePositionChanged(i,t){var s,n;this.currentTransform=this.getTransformForNewPosition(i);this.startingTransform=this.currentTransform;console.debug(`Updating widget position [previous=${JSON.stringify(t)}, current=${JSON.stringify(i)}]`);(s=this.widget)===null||s===void 0?void 0:s.updateTransform(this.currentTransform);if(i==null){this.lastDragged=undefined;this.inputPosition=undefined;(n=this.controller)===null||n===void 0?void 0:n.clearTransform()}this.positionChanged.emit(i)}handleInputFormattingChanged(){this.updateInputValue();this.lastInputValue=this.inputValue}render(){var t,s,n,o,e,h;return i(l,{key:"5d32e8df03f363c836a8a6194f9ff945227a70c8"},i("canvas",{key:"ba1d8b8b1fb99b808809d32176f341d12708af32",ref:i=>{this.canvasRef=i},class:g("widget",{hovered:this.hovered!=null}),tabindex:"0",width:(t=this.viewer)===null||t===void 0?void 0:t.viewport.width,height:(s=this.viewer)===null||s===void 0?void 0:s.viewport.height,onPointerDown:this.handleBeginDrag,onKeyDown:this.handleKeyDown}),this.showInputs&&this.inputPosition&&((n=this.viewer)===null||n===void 0?void 0:n.viewport)&&i(ti,{key:"734bd29977c8efe57e5e4e9d838279c8d7777ead",ref:i=>{var t,s;if(i!=null){(t=this.inputResizeObserver)===null||t===void 0?void 0:t.observe(i)}else if(this.inputWrapperRef!=null){(s=this.inputResizeObserver)===null||s===void 0?void 0:s.unobserve(this.inputWrapperRef)}this.inputWrapperRef=i},bounds:this.inputBounds,viewport:this.viewer.viewport,point:this.inputPosition.point,placement:this.inputPosition.placement,displayUnit:this.getDisplayedUnits()},i(si,{key:"0d8d997c37a534fcbfe24d452e520a321fea2f18",ref:i=>{this.inputRef=i},identifier:(e=(o=this.dragging)===null||o===void 0?void 0:o.identifier)!==null&&e!==void 0?e:(h=this.lastDragged)===null||h===void 0?void 0:h.identifier,disabled:this.isEndingTransform,onChange:this.handleInputChange,onIncrement:()=>this.handleInputStep(1),onDecrement:()=>this.handleInputStep(-1),onBlur:()=>{this.inputShouldFocus=false},onUndo:this.EXPERIMENTAL_undoKeybindings?()=>this.EXPERIMENTAL_undo():undefined})))}transform(i,t,s){var n,o;if(this.position!=null&&this.startingTransform!=null&&this.currentTransform!=null&&this.dragging!=null&&this.viewer!=null&&this.viewer.frame!=null){this.currentTransform=L(this.currentTransform,i,t,(n=this.viewer)===null||n===void 0?void 0:n.frame.scene.camera.viewVector,s,this.dragging.identifier);this.getTransformWidget().updateTransform(this.currentTransform);(o=this.controller)===null||o===void 0?void 0:o.updateTransform(u.multiply(this.currentTransform,u.invert(this.startingTransform)))}}handleSettingDisabledAxis(){if(this.widget){this.widget.updateDisabledAxis({xRotation:this.xRotationDisabled,yRotation:this.yRotationDisabled,zRotation:this.zRotationDisabled,xTranslation:this.xTranslationDisabled,yTranslation:this.yTranslationDisabled,zTranslation:this.zTranslationDisabled,xyTranslation:this.xyTranslationDisabled,xzTranslation:this.xzTranslationDisabled,yzTranslation:this.yzTranslationDisabled})}else{console.warn("Cannot set disabled values - no widget defined")}}get hostEl(){return this}static get watchers(){return{viewer:[{handleViewerChanged:0}],xTranslationDisabled:[{handleDisabledPropertyChanged:0}],yTranslationDisabled:[{handleDisabledPropertyChanged:0}],zTranslationDisabled:[{handleDisabledPropertyChanged:0}],xyTranslationDisabled:[{handleDisabledPropertyChanged:0}],xzTranslationDisabled:[{handleDisabledPropertyChanged:0}],yzTranslationDisabled:[{handleDisabledPropertyChanged:0}],xRotationDisabled:[{handleDisabledPropertyChanged:0}],yRotationDisabled:[{handleDisabledPropertyChanged:0}],zRotationDisabled:[{handleDisabledPropertyChanged:0}],translationHandleScalar:[{handleTransformHandleScalarChanged:0}],rotationHandleScalar:[{handleTransformHandleScalarChanged:0}],rotation:[{handleRotationChanged:0}],position:[{handlePositionChanged:0}],distanceUnit:[{handleInputFormattingChanged:0}],angleUnit:[{handleInputFormattingChanged:0}],decimalPlaces:[{handleInputFormattingChanged:0}]}}static get style(){return ci()}},[1,"vertex-viewer-transform-widget",{viewer:[16],position:[1040],rotation:[1040],controller:[1040],xRotationDisabled:[1028,"x-rotation-disabled"],yRotationDisabled:[1028,"y-rotation-disabled"],zRotationDisabled:[1028,"z-rotation-disabled"],xTranslationDisabled:[1028,"x-translation-disabled"],yTranslationDisabled:[1028,"y-translation-disabled"],zTranslationDisabled:[1028,"z-translation-disabled"],xyTranslationDisabled:[1028,"xy-translation-disabled"],xzTranslationDisabled:[1028,"xz-translation-disabled"],yzTranslationDisabled:[1028,"yz-translation-disabled"],showInputs:[4,"show-inputs"],distanceUnit:[1,"distance-unit"],angleUnit:[1,"angle-unit"],decimalPlaces:[2,"decimal-places"],rotationSnapDegrees:[2,"rotation-snap-degrees"],rotationSnapKey:[1,"rotation-snap-key"],translationHandleScalar:[2,"translation-handle-scalar"],rotationHandleScalar:[2,"rotation-handle-scalar"],interactionThrottle:[2,"interaction-throttle"],EXPERIMENTAL_undoKeybindings:[4,"e-x-p-e-r-i-m-e-n-t-a-l_undo-keybindings"],hovered:[1040],inputPosition:[32],inputValue:[32],isEndingTransform:[32],EXPERIMENTAL_undo:[64]},undefined,{viewer:[{handleViewerChanged:0}],xTranslationDisabled:[{handleDisabledPropertyChanged:0}],yTranslationDisabled:[{handleDisabledPropertyChanged:0}],zTranslationDisabled:[{handleDisabledPropertyChanged:0}],xyTranslationDisabled:[{handleDisabledPropertyChanged:0}],xzTranslationDisabled:[{handleDisabledPropertyChanged:0}],yzTranslationDisabled:[{handleDisabledPropertyChanged:0}],xRotationDisabled:[{handleDisabledPropertyChanged:0}],yRotationDisabled:[{handleDisabledPropertyChanged:0}],zRotationDisabled:[{handleDisabledPropertyChanged:0}],translationHandleScalar:[{handleTransformHandleScalarChanged:0}],rotationHandleScalar:[{handleTransformHandleScalarChanged:0}],rotation:[{handleRotationChanged:0}],position:[{handlePositionChanged:0}],distanceUnit:[{handleInputFormattingChanged:0}],angleUnit:[{handleInputFormattingChanged:0}],decimalPlaces:[{handleInputFormattingChanged:0}]}]);function wi(){if(typeof customElements==="undefined"){return}const i=["vertex-viewer-transform-widget"];i.forEach((i=>{switch(i){case"vertex-viewer-transform-widget":if(!customElements.get(t(i))){customElements.define(t(i),fi)}break}}))}wi();const pi=fi;const gi=wi;export{pi as VertexViewerTransformWidget,gi as defineCustomElement};
5
5
  //# sourceMappingURL=vertex-viewer-transform-widget.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{h as e,F as t,t as i,p as o,H as a,e as r}from"./p-Bb32XUUS.js";import{q as c,v as n,h as d}from"./p-DDQcM-So.js";import{r as s}from"./p-Cd7kap5W.js";import{O as f,f as b,S as l}from"./p-BfAW7IWG.js";import{c as h}from"./p-C6gMOKYg.js";import{d as v}from"./p-oK38ynrd.js";import{d as g}from"./p-3-bKfpqr.js";import{d as u}from"./p-CmtoXwYo.js";const w={front:{direction:n.back(),quaternion:c.create()},back:{direction:n.forward(),quaternion:c.fromAxisAngle(n.up(),Math.PI)},left:{direction:n.left(),quaternion:c.fromAxisAngle(n.down(),Math.PI/2)},right:{direction:n.right(),quaternion:c.fromAxisAngle(n.up(),Math.PI/2)},top:{direction:n.up(),quaternion:c.fromAxisAngle(n.right(),-Math.PI/2)},bottom:{direction:n.down(),quaternion:c.fromAxisAngle(n.left(),-Math.PI/2)}};const p=({label:i,length:o,rotationAxis:a})=>{const r={width:`${o+5}px`};const s=c.fromAxisAngle(a,Math.PI/2);const f=n.scale(o+15,n.right());return e(t,null,e("vertex-viewer-dom-group",{quaternion:s},e("vertex-viewer-dom-element",{style:r,billboardOff:true,interactionsOff:true},e("div",{class:`triad-axis triad-axis-${i.toLowerCase()}`})),e("vertex-viewer-dom-element",{rotation:d.create({x:Math.PI/2,y:0,z:0}),style:r,billboardOff:true,interactionsOff:true},e("div",{class:`triad-axis triad-axis-${i.toLowerCase()}`})),e("vertex-viewer-dom-element",{position:f,interactionsOff:true},e("div",{class:`triad-label triad-label-${i.toLowerCase()}`},i))))};const m=({label:t,length:i,side:o,disabled:a,onPointerDown:r})=>{const{direction:c,quaternion:d}=w[o];const s=n.scale(i/2-.1,c);return e("vertex-viewer-dom-element",{class:h("cube-side",{disabled:a}),position:s,quaternion:d,style:{width:`${i}px`,height:`${i}px`},onPointerDown:r,billboardOff:true},e("div",{class:`cube-side-face cube-side-face-${t.toLowerCase()}`},t))};const x=({length:t,face1Side:i,face1Corner:o,face2Side:a,face2Corner:r,face3Side:c,face3Corner:d,disabled:s,onPointerDown:f})=>{const{direction:b,quaternion:l}=w[i];const{direction:v,quaternion:g}=w[a];const{direction:u,quaternion:p}=w[c];const m=n.scale(t/2,b);const x=n.scale(t/2,v);const y=n.scale(t/2,u);const k={width:`${t}px`,height:`${t}px`};return e("vertex-viewer-dom-group",{class:h("cube-corner",{disabled:s}),onPointerDown:f},e("vertex-viewer-dom-element",{position:m,quaternion:l,style:k,billboardOff:true},e("div",{class:`cube-corner-face ${o}`})),e("vertex-viewer-dom-element",{position:x,quaternion:g,style:k,billboardOff:true},e("div",{class:`cube-corner-face ${r}`})),e("vertex-viewer-dom-element",{position:y,quaternion:p,style:k,billboardOff:true},e("div",{class:`cube-corner-face ${d}`})))};const y=({length:t,face1Side:i,face2Side:o,face1Edge:a,face2Edge:r,disabled:c,onPointerDown:d})=>{const{direction:s,quaternion:f}=w[i];const{direction:b,quaternion:l}=w[o];const v=n.scale(t/2,s);const g=n.scale(t/2,b);const u={width:`${t}px`,height:`${t}px`};return e("vertex-viewer-dom-group",{class:h("cube-edge",{disabled:c}),onPointerDown:d},e("vertex-viewer-dom-element",{position:v,quaternion:f,style:u,billboardOff:true},e("div",{class:`cube-edge-face ${a}`})),e("vertex-viewer-dom-element",{position:g,quaternion:l,style:u,billboardOff:true},e("div",{class:`cube-edge-face ${r}`})))};const k=({length:t})=>{const{direction:i,quaternion:o}=w.top;const a=n.scale(-t/2,i);return e("vertex-viewer-dom-element",{class:"cube-shadow",position:a,quaternion:o,style:{width:`${t}px`,height:`${t}px`},billboardOff:true,interactionsOff:true},e("div",{class:"cube-shadow-face"}))};const S=()=>`:host{--viewer-view-cube-side-background:var(--white);--viewer-view-cube-side-background-hover:var(--blue-500);--viewer-view-cube-side-background-hover-opacity:0.25;--viewer-view-cube-side-border:1.5px solid var(--neutral-500);--viewer-view-cube-edge-length:12px;--viewer-view-cube-opacity:0.8;--viewer-view-cube-triad-x-axis-color:var(--x-axis-color);--viewer-view-cube-triad-y-axis-color:var(--y-axis-color);--viewer-view-cube-triad-z-axis-color:var(--z-axis-color);color:var(--neutral-700);width:80px;height:80px;margin:20px;position:relative;display:flex;align-items:center;justify-content:center;user-select:none}.renderer{position:unset;width:100%;height:100%;overflow:visible !important}.reference-point{width:5px;height:5px;border-radius:50%;background-color:black}.triad{pointer-events:none}.triad-axis{width:100%;height:1.5px;outline:1px solid transparent;transform:translateX(50%)}.triad-axis-x{background-color:#ea3324}.triad-axis-y{background-color:#4faf32}.triad-axis-z{background-color:#0000ff}.triad-label{font-family:Arial, Helvetica, sans-serif;font-size:0.6875rem}.triad-label-x{color:var(--viewer-view-cube-triad-x-axis-color)}.triad-label-y{color:var(--viewer-view-cube-triad-y-axis-color)}.triad-label-z{color:var(--viewer-view-cube-triad-z-axis-color)}.cube{pointer-events:initial}.cube:hover .cube-side-face{opacity:1}.cube-side{backface-visibility:hidden;-webkit-backface-visibility:hidden}.cube-side-face{box-sizing:border-box;font-size:0.875rem;text-transform:uppercase;width:100%;height:100%;background-color:var(--viewer-view-cube-side-background);border:var(--viewer-view-cube-side-border);display:flex;align-items:center;justify-content:center;outline:1px solid transparent;opacity:var(--viewer-view-cube-opacity);transition:opacity 0.2s ease-in-out}.cube-side-face::before{content:'';position:absolute;left:calc(var(--viewer-view-cube-edge-length) - 4px);right:calc(var(--viewer-view-cube-edge-length) - 4px);top:calc(var(--viewer-view-cube-edge-length) - 4px);bottom:calc(var(--viewer-view-cube-edge-length) - 4px)}.cube-corner,.cube-edge{position:relative}.cube-corner-face,.cube-edge-face{position:absolute;backface-visibility:hidden;-webkit-backface-visibility:hidden}.cube-edge-face.top{top:0;left:var(--viewer-view-cube-edge-length);right:var(--viewer-view-cube-edge-length);height:var(--viewer-view-cube-edge-length)}.cube-edge-face.bottom{bottom:0;left:var(--viewer-view-cube-edge-length);right:var(--viewer-view-cube-edge-length);height:var(--viewer-view-cube-edge-length)}.cube-edge-face.left{left:0;top:var(--viewer-view-cube-edge-length);bottom:var(--viewer-view-cube-edge-length);width:var(--viewer-view-cube-edge-length)}.cube-edge-face.right{right:0;top:var(--viewer-view-cube-edge-length);bottom:var(--viewer-view-cube-edge-length);width:var(--viewer-view-cube-edge-length)}.cube-corner-face{width:var(--viewer-view-cube-edge-length);height:var(--viewer-view-cube-edge-length)}.cube-corner-face.top-left{top:0;left:0}.cube-corner-face.top-right{top:0;right:0}.cube-corner-face.bottom-right{bottom:0;right:0}.cube-corner-face.bottom-left{bottom:0;left:0}.cube-shadow{backface-visibility:hidden;-webkit-backface-visibility:hidden}.cube-shadow-face{position:absolute;left:4px;right:4px;top:4px;bottom:4px;background-color:black;opacity:0.12;filter:blur(4px)}.cube-side-face,.cube-corner-face,.cube-edge-face{pointer-events:initial}.cube-corner .cube-corner-face,.cube-edge .cube-edge-face,.cube-side .cube-side-face::before{background:var(--viewer-view-cube-side-background-hover);opacity:0}.cube-corner:hover .cube-corner-face,.cube-edge:hover .cube-edge-face,.cube-side:hover .cube-side-face::before{opacity:var(--viewer-view-cube-side-background-hover-opacity)}.cube-corner.disabled,.cube-edge.disabled,.cube-side.disabled{pointer-events:none}`;const D=o(class t extends a{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.boxLength=80;this.triadPosition=n.origin();this.xPositiveLabel="Right";this.xNegativeLabel="Left";this.yPositiveLabel="Top";this.yNegativeLabel="Bottom";this.zPositiveLabel="Front";this.zNegativeLabel="Back";this.standardViewsOff=false;this.viewAll=true;this.animationDuration=500;this.triadOff=false;this.worldOrientation=f.DEFAULT;this.updateMatrices=()=>{var e;if(((e=this.viewer)===null||e===void 0?void 0:e.frame)!=null){const{camera:e}=this.viewer.frame.scene;const t=this.boxLength/2;this.triadPosition=n.create(-t-5,-t-5,-t-5);const i=3.125;const o=this.boxLength*i;const a=21.5;this.camera=new b(n.scale(o,n.negate(e.direction)),n.origin(),e.up,.1,100,1,a);this.worldOrientation=this.viewer.frame.scene.worldOrientation}}}handleViewerChanged(e,t){t===null||t===void 0?void 0:t.removeEventListener("frameDrawn",this.updateMatrices);e===null||e===void 0?void 0:e.addEventListener("frameDrawn",this.updateMatrices);this.updateMatrices()}handleStandardView(e){if(this.standardViewsOff){return async()=>undefined}else{return async()=>{if(this.viewer!=null){const t=await this.viewer.scene();const i=this.animationDuration>0?{animation:{milliseconds:this.animationDuration}}:{};const o=e.transformMatrix(this.worldOrientation.matrix);const a=t.boundingBox();if(!this.viewAll){t.camera().standardViewFixedLookAt(o).render(i)}else if((a===null||a===void 0?void 0:a.max)!=null&&n.isEqual(a.max,n.origin())&&n.isEqual(a.min,n.origin())){t.camera().standardView(o).render(i)}else{t.camera().standardView(o).viewAll().render(i)}}}}}componentWillLoad(){this.handleViewerChanged(this.viewer)}componentDidLoad(){if(this.rendererEl!=null){const e=new ResizeObserver((()=>this.handleRendererResized()));e.observe(this.rendererEl);this.handleRendererResized()}}handleRendererResized(){s((()=>{if(this.rendererEl!=null){const e=this.rendererEl.getBoundingClientRect();this.boxLength=Math.min(e.width,e.height)}}))}render(){return e(r,{key:"a3cea27b2376c4ffbe255168515b8c3f0e7ab5aa"},e("vertex-viewer-dom-renderer",{key:"7f1560abaf53c1dc5b8f43b9dade445917861656",ref:e=>this.rendererEl=e,class:"renderer",camera:this.camera},!this.triadOff&&e("vertex-viewer-dom-group",{key:"0671f7678ab3197709e98649d0ac36a1703614c6",class:"triad",position:this.triadPosition},e(p,{key:"b65eddeb99f9b93120246f8143886ac937afb57a",label:"X",length:this.boxLength,rotationAxis:n.origin()}),e(p,{key:"ba49dbda3e18e90e033453d06b509f31336fffe8",label:"Y",length:this.boxLength,rotationAxis:n.back()}),e(p,{key:"ff765198e6e11cc6b7b2d466766809b055c5ccdf",label:"Z",length:this.boxLength,rotationAxis:n.down()})),e("vertex-viewer-dom-group",{key:"0dd9aab195029c25a3090f35ee39c04ed45da8f8",class:"cube",matrix:this.worldOrientation.matrix},e(k,{key:"995e2af8e70518edcf949d5df72387463ff3cc0e",length:this.boxLength+10}),e(m,{key:"0864a044b3d79b9a483cd492b7a04a20fcf64f42",label:this.zPositiveLabel,length:this.boxLength,side:"front",onPointerDown:this.handleStandardView(l.FRONT),disabled:this.standardViewsOff}),e(m,{key:"8f9110528267a00b802f97a8543a896d9fc333f7",label:this.zNegativeLabel,length:this.boxLength,side:"back",onPointerDown:this.handleStandardView(l.BACK),disabled:this.standardViewsOff}),e(m,{key:"6848e1e273bc815ee40e0218cc15bdc80d1f2715",label:this.xNegativeLabel,length:this.boxLength,side:"left",onPointerDown:this.handleStandardView(l.LEFT),disabled:this.standardViewsOff}),e(m,{key:"825624a992f4d31d9faf7506c8e964392da041ab",label:this.xPositiveLabel,length:this.boxLength,side:"right",onPointerDown:this.handleStandardView(l.RIGHT),disabled:this.standardViewsOff}),e(m,{key:"f59f5693ce4f1b4a794f4665b3f920bf29c1f159",label:this.yPositiveLabel,length:this.boxLength,side:"top",onPointerDown:this.handleStandardView(l.TOP),disabled:this.standardViewsOff}),e(m,{key:"65b8c8a2f8cc5cbc7974ca0dc3e6c328e2ca0649",label:this.yNegativeLabel,length:this.boxLength,side:"bottom",onPointerDown:this.handleStandardView(l.BOTTOM),disabled:this.standardViewsOff}),e(y,{key:"0923dfc3696b2c76e69069156c0f57d6cd4f8285",length:this.boxLength,face1Side:"top",face1Edge:"bottom",face2Side:"front",face2Edge:"top",onPointerDown:this.handleStandardView(l.TOP_FRONT),disabled:this.standardViewsOff}),e(y,{key:"6bf8058fbb4e35b9a1ed8dc5ff772ed2d2995add",length:this.boxLength,face1Side:"front",face1Edge:"right",face2Side:"right",face2Edge:"left",onPointerDown:this.handleStandardView(l.FRONT_LEFT),disabled:this.standardViewsOff}),e(y,{key:"61f28c6cd18661c643ec1510305a8603efbd5cdb",length:this.boxLength,face1Side:"bottom",face1Edge:"top",face2Side:"front",face2Edge:"bottom",onPointerDown:this.handleStandardView(l.BOTTOM_FRONT),disabled:this.standardViewsOff}),e(y,{key:"6c62acdf92f6397ec3c381d10078215cf6a29ebb",length:this.boxLength,face1Side:"front",face1Edge:"left",face2Side:"left",face2Edge:"right",onPointerDown:this.handleStandardView(l.FRONT_RIGHT),disabled:this.standardViewsOff}),e(y,{key:"a94dc61cea93cae54e148c4f1ffc73a42717f986",length:this.boxLength,face1Side:"top",face1Edge:"right",face2Side:"right",face2Edge:"top",onPointerDown:this.handleStandardView(l.TOP_LEFT),disabled:this.standardViewsOff}),e(y,{key:"4a97659a3aad5b162252091401ec666727d204be",length:this.boxLength,face1Side:"back",face1Edge:"left",face2Side:"right",face2Edge:"right",onPointerDown:this.handleStandardView(l.BACK_LEFT),disabled:this.standardViewsOff}),e(y,{key:"422acd7e4689eb7ae0403726a29a3784637bdfd6",length:this.boxLength,face1Side:"bottom",face1Edge:"right",face2Side:"right",face2Edge:"bottom",onPointerDown:this.handleStandardView(l.BOTTOM_LEFT),disabled:this.standardViewsOff}),e(y,{key:"afa5fb1b78c1fcbb78a48f040d5c868a4dd338fc",length:this.boxLength,face1Side:"top",face1Edge:"top",face2Side:"back",face2Edge:"top",onPointerDown:this.handleStandardView(l.TOP_BACK),disabled:this.standardViewsOff}),e(y,{key:"e1aa294c3ed0a6e105929a7094cfbdeab26fe7c0",length:this.boxLength,face1Side:"back",face1Edge:"right",face2Side:"left",face2Edge:"left",onPointerDown:this.handleStandardView(l.BACK_RIGHT),disabled:this.standardViewsOff}),e(y,{key:"e3a83623df735d9987a279ef2e055d1f962cafbe",length:this.boxLength,face1Side:"bottom",face1Edge:"bottom",face2Side:"back",face2Edge:"bottom",onPointerDown:this.handleStandardView(l.BOTTOM_BACK),disabled:this.standardViewsOff}),e(y,{key:"ad1d8915f046ba5df73240489c2daf1703b6a310",length:this.boxLength,face1Side:"top",face1Edge:"left",face2Side:"left",face2Edge:"top",onPointerDown:this.handleStandardView(l.TOP_RIGHT),disabled:this.standardViewsOff}),e(y,{key:"f0b94c0f3517d1f54cf0c23f74fa681607da3532",length:this.boxLength,face1Side:"bottom",face1Edge:"left",face2Side:"left",face2Edge:"bottom",onPointerDown:this.handleStandardView(l.BOTTOM_RIGHT),disabled:this.standardViewsOff}),e(x,{key:"c814db371a4b47ba50084e69879845921eb6ba91",length:this.boxLength,face1Side:"top",face1Corner:"bottom-left",face2Side:"front",face2Corner:"top-left",face3Side:"left",face3Corner:"top-right",onPointerDown:this.handleStandardView(l.TOP_FRONT_RIGHT),disabled:this.standardViewsOff}),e(x,{key:"b0f81f620127d1533eeb675c66d74e1b3019cb3b",length:this.boxLength,face1Side:"top",face1Corner:"bottom-right",face2Side:"front",face2Corner:"top-right",face3Side:"right",face3Corner:"top-left",onPointerDown:this.handleStandardView(l.TOP_FRONT_LEFT),disabled:this.standardViewsOff}),e(x,{key:"254834f0214afa786b8997274e0dcbc4f1e5e31c",length:this.boxLength,face1Side:"bottom",face1Corner:"top-right",face2Side:"front",face2Corner:"bottom-right",face3Side:"right",face3Corner:"bottom-left",onPointerDown:this.handleStandardView(l.BOTTOM_FRONT_LEFT),disabled:this.standardViewsOff}),e(x,{key:"847425b3886582ddb596408fbfcd2fcd9e424641",length:this.boxLength,face1Side:"bottom",face1Corner:"top-left",face2Side:"front",face2Corner:"bottom-left",face3Side:"left",face3Corner:"bottom-right",onPointerDown:this.handleStandardView(l.BOTTOM_FRONT_RIGHT),disabled:this.standardViewsOff}),e(x,{key:"fe6eaffd1f06fe45a9fa3fb680d638f3623187aa",length:this.boxLength,face1Side:"top",face1Corner:"top-right",face2Side:"back",face2Corner:"top-left",face3Side:"right",face3Corner:"top-right",onPointerDown:this.handleStandardView(l.TOP_BACK_LEFT),disabled:this.standardViewsOff}),e(x,{key:"e4b8004047f4f1da2decc4b17d86297a67e38e9d",length:this.boxLength,face1Side:"top",face1Corner:"top-left",face2Side:"back",face2Corner:"top-right",face3Side:"left",face3Corner:"top-left",onPointerDown:this.handleStandardView(l.TOP_BACK_RIGHT),disabled:this.standardViewsOff}),e(x,{key:"c06a8465a3b39828bf114faaa0039c8e32196441",length:this.boxLength,face1Side:"bottom",face1Corner:"bottom-left",face2Side:"back",face2Corner:"bottom-right",face3Side:"left",face3Corner:"bottom-left",onPointerDown:this.handleStandardView(l.BOTTOM_BACK_RIGHT),disabled:this.standardViewsOff}),e(x,{key:"2ea208573579fd18a3b7fde9f0bbc3a5834e2652",length:this.boxLength,face1Side:"bottom",face1Corner:"bottom-right",face2Side:"back",face2Corner:"bottom-left",face3Side:"right",face3Corner:"bottom-right",onPointerDown:this.handleStandardView(l.BOTTOM_BACK_LEFT),disabled:this.standardViewsOff}))))}static get watchers(){return{viewer:[{handleViewerChanged:0}]}}static get style(){return S()}},[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"],viewAll:[4,"view-all"],animationDuration:[2,"animation-duration"],triadOff:[4,"triad-off"],worldOrientation:[1040],camera:[1040],viewer:[16],boxLength:[32],triadPosition:[32]},undefined,{viewer:[{handleViewerChanged:0}]}]);function P(){if(typeof customElements==="undefined"){return}const e=["vertex-viewer-view-cube","vertex-viewer-dom-element","vertex-viewer-dom-group","vertex-viewer-dom-renderer"];e.forEach((e=>{switch(e){case"vertex-viewer-view-cube":if(!customElements.get(i(e))){customElements.define(i(e),D)}break;case"vertex-viewer-dom-element":if(!customElements.get(i(e))){v()}break;case"vertex-viewer-dom-group":if(!customElements.get(i(e))){g()}break;case"vertex-viewer-dom-renderer":if(!customElements.get(i(e))){u()}break}}))}P();const C=D;const E=P;export{C as VertexViewerViewCube,E as defineCustomElement};
4
+ import{h as e,F as t,t as i,p as a,H as o,e as r}from"./p-Bb32XUUS.js";import{q as c,v as n,h as d}from"./p-DDQcM-So.js";import{r as s}from"./p-Cd7kap5W.js";import{O as f,f as b,S as l}from"./p-B9R0QWr4.js";import{c as h}from"./p-C6gMOKYg.js";import{d as v}from"./p-oK38ynrd.js";import{d as g}from"./p-3-bKfpqr.js";import{d as u}from"./p-BCOD9yfw.js";const w={front:{direction:n.back(),quaternion:c.create()},back:{direction:n.forward(),quaternion:c.fromAxisAngle(n.up(),Math.PI)},left:{direction:n.left(),quaternion:c.fromAxisAngle(n.down(),Math.PI/2)},right:{direction:n.right(),quaternion:c.fromAxisAngle(n.up(),Math.PI/2)},top:{direction:n.up(),quaternion:c.fromAxisAngle(n.right(),-Math.PI/2)},bottom:{direction:n.down(),quaternion:c.fromAxisAngle(n.left(),-Math.PI/2)}};const p=({label:i,length:a,rotationAxis:o})=>{const r={width:`${a+5}px`};const s=c.fromAxisAngle(o,Math.PI/2);const f=n.scale(a+15,n.right());return e(t,null,e("vertex-viewer-dom-group",{quaternion:s},e("vertex-viewer-dom-element",{style:r,billboardOff:true,interactionsOff:true},e("div",{class:`triad-axis triad-axis-${i.toLowerCase()}`})),e("vertex-viewer-dom-element",{rotation:d.create({x:Math.PI/2,y:0,z:0}),style:r,billboardOff:true,interactionsOff:true},e("div",{class:`triad-axis triad-axis-${i.toLowerCase()}`})),e("vertex-viewer-dom-element",{position:f,interactionsOff:true},e("div",{class:`triad-label triad-label-${i.toLowerCase()}`},i))))};const m=({label:t,length:i,side:a,disabled:o,onPointerDown:r})=>{const{direction:c,quaternion:d}=w[a];const s=n.scale(i/2-.1,c);return e("vertex-viewer-dom-element",{class:h("cube-side",{disabled:o}),position:s,quaternion:d,style:{width:`${i}px`,height:`${i}px`},onPointerDown:r,billboardOff:true},e("div",{class:`cube-side-face cube-side-face-${t.toLowerCase()}`},t))};const x=({length:t,face1Side:i,face1Corner:a,face2Side:o,face2Corner:r,face3Side:c,face3Corner:d,disabled:s,onPointerDown:f})=>{const{direction:b,quaternion:l}=w[i];const{direction:v,quaternion:g}=w[o];const{direction:u,quaternion:p}=w[c];const m=n.scale(t/2,b);const x=n.scale(t/2,v);const y=n.scale(t/2,u);const k={width:`${t}px`,height:`${t}px`};return e("vertex-viewer-dom-group",{class:h("cube-corner",{disabled:s}),onPointerDown:f},e("vertex-viewer-dom-element",{position:m,quaternion:l,style:k,billboardOff:true},e("div",{class:`cube-corner-face ${a}`})),e("vertex-viewer-dom-element",{position:x,quaternion:g,style:k,billboardOff:true},e("div",{class:`cube-corner-face ${r}`})),e("vertex-viewer-dom-element",{position:y,quaternion:p,style:k,billboardOff:true},e("div",{class:`cube-corner-face ${d}`})))};const y=({length:t,face1Side:i,face2Side:a,face1Edge:o,face2Edge:r,disabled:c,onPointerDown:d})=>{const{direction:s,quaternion:f}=w[i];const{direction:b,quaternion:l}=w[a];const v=n.scale(t/2,s);const g=n.scale(t/2,b);const u={width:`${t}px`,height:`${t}px`};return e("vertex-viewer-dom-group",{class:h("cube-edge",{disabled:c}),onPointerDown:d},e("vertex-viewer-dom-element",{position:v,quaternion:f,style:u,billboardOff:true},e("div",{class:`cube-edge-face ${o}`})),e("vertex-viewer-dom-element",{position:g,quaternion:l,style:u,billboardOff:true},e("div",{class:`cube-edge-face ${r}`})))};const k=({length:t})=>{const{direction:i,quaternion:a}=w.top;const o=n.scale(-t/2,i);return e("vertex-viewer-dom-element",{class:"cube-shadow",position:o,quaternion:a,style:{width:`${t}px`,height:`${t}px`},billboardOff:true,interactionsOff:true},e("div",{class:"cube-shadow-face"}))};const S=()=>`:host{--viewer-view-cube-side-background:var(--white);--viewer-view-cube-side-background-hover:var(--blue-500);--viewer-view-cube-side-background-hover-opacity:0.25;--viewer-view-cube-side-border:1.5px solid var(--neutral-500);--viewer-view-cube-edge-length:12px;--viewer-view-cube-opacity:0.8;--viewer-view-cube-triad-x-axis-color:var(--x-axis-color);--viewer-view-cube-triad-y-axis-color:var(--y-axis-color);--viewer-view-cube-triad-z-axis-color:var(--z-axis-color);color:var(--neutral-700);width:80px;height:80px;margin:20px;position:relative;display:flex;align-items:center;justify-content:center;user-select:none}.renderer{position:unset;width:100%;height:100%;overflow:visible !important}.reference-point{width:5px;height:5px;border-radius:50%;background-color:black}.triad{pointer-events:none}.triad-axis{width:100%;height:1.5px;outline:1px solid transparent;transform:translateX(50%)}.triad-axis-x{background-color:#ea3324}.triad-axis-y{background-color:#4faf32}.triad-axis-z{background-color:#0000ff}.triad-label{font-family:Arial, Helvetica, sans-serif;font-size:0.6875rem}.triad-label-x{color:var(--viewer-view-cube-triad-x-axis-color)}.triad-label-y{color:var(--viewer-view-cube-triad-y-axis-color)}.triad-label-z{color:var(--viewer-view-cube-triad-z-axis-color)}.cube{pointer-events:initial}.cube:hover .cube-side-face{opacity:1}.cube-side{backface-visibility:hidden;-webkit-backface-visibility:hidden}.cube-side-face{box-sizing:border-box;font-size:0.875rem;text-transform:uppercase;width:100%;height:100%;background-color:var(--viewer-view-cube-side-background);border:var(--viewer-view-cube-side-border);display:flex;align-items:center;justify-content:center;outline:1px solid transparent;opacity:var(--viewer-view-cube-opacity);transition:opacity 0.2s ease-in-out}.cube-side-face::before{content:'';position:absolute;left:calc(var(--viewer-view-cube-edge-length) - 4px);right:calc(var(--viewer-view-cube-edge-length) - 4px);top:calc(var(--viewer-view-cube-edge-length) - 4px);bottom:calc(var(--viewer-view-cube-edge-length) - 4px)}.cube-corner,.cube-edge{position:relative}.cube-corner-face,.cube-edge-face{position:absolute;backface-visibility:hidden;-webkit-backface-visibility:hidden}.cube-edge-face.top{top:0;left:var(--viewer-view-cube-edge-length);right:var(--viewer-view-cube-edge-length);height:var(--viewer-view-cube-edge-length)}.cube-edge-face.bottom{bottom:0;left:var(--viewer-view-cube-edge-length);right:var(--viewer-view-cube-edge-length);height:var(--viewer-view-cube-edge-length)}.cube-edge-face.left{left:0;top:var(--viewer-view-cube-edge-length);bottom:var(--viewer-view-cube-edge-length);width:var(--viewer-view-cube-edge-length)}.cube-edge-face.right{right:0;top:var(--viewer-view-cube-edge-length);bottom:var(--viewer-view-cube-edge-length);width:var(--viewer-view-cube-edge-length)}.cube-corner-face{width:var(--viewer-view-cube-edge-length);height:var(--viewer-view-cube-edge-length)}.cube-corner-face.top-left{top:0;left:0}.cube-corner-face.top-right{top:0;right:0}.cube-corner-face.bottom-right{bottom:0;right:0}.cube-corner-face.bottom-left{bottom:0;left:0}.cube-shadow{backface-visibility:hidden;-webkit-backface-visibility:hidden}.cube-shadow-face{position:absolute;left:4px;right:4px;top:4px;bottom:4px;background-color:black;opacity:0.12;filter:blur(4px)}.cube-side-face,.cube-corner-face,.cube-edge-face{pointer-events:initial}.cube-corner .cube-corner-face,.cube-edge .cube-edge-face,.cube-side .cube-side-face::before{background:var(--viewer-view-cube-side-background-hover);opacity:0}.cube-corner:hover .cube-corner-face,.cube-edge:hover .cube-edge-face,.cube-side:hover .cube-side-face::before{opacity:var(--viewer-view-cube-side-background-hover-opacity)}.cube-corner.disabled,.cube-edge.disabled,.cube-side.disabled{pointer-events:none}`;const D=a(class t extends o{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.boxLength=80;this.triadPosition=n.origin();this.xPositiveLabel="Right";this.xNegativeLabel="Left";this.yPositiveLabel="Top";this.yNegativeLabel="Bottom";this.zPositiveLabel="Front";this.zNegativeLabel="Back";this.standardViewsOff=false;this.viewAll=true;this.animationDuration=500;this.triadOff=false;this.worldOrientation=f.DEFAULT;this.updateMatrices=()=>{var e;if(((e=this.viewer)===null||e===void 0?void 0:e.frame)!=null){const{camera:e}=this.viewer.frame.scene;const t=this.boxLength/2;this.triadPosition=n.create(-t-5,-t-5,-t-5);const i=3.125;const a=this.boxLength*i;const o=21.5;this.camera=new b(n.scale(a,n.negate(e.direction)),n.origin(),e.up,.1,100,1,o);this.worldOrientation=this.viewer.frame.scene.worldOrientation}}}handleViewerChanged(e,t){t===null||t===void 0?void 0:t.removeEventListener("frameDrawn",this.updateMatrices);e===null||e===void 0?void 0:e.addEventListener("frameDrawn",this.updateMatrices);this.updateMatrices()}handleStandardView(e){if(this.standardViewsOff){return async()=>undefined}else{return async()=>{if(this.viewer!=null){const t=await this.viewer.scene();const i=this.animationDuration>0?{animation:{milliseconds:this.animationDuration}}:{};const a=e.transformMatrix(this.worldOrientation.matrix);const o=t.boundingBox();if(!this.viewAll){t.camera().standardViewFixedLookAt(a).render(i)}else if((o===null||o===void 0?void 0:o.max)!=null&&n.isEqual(o.max,n.origin())&&n.isEqual(o.min,n.origin())){t.camera().standardView(a).render(i)}else{t.camera().standardView(a).viewAll().render(i)}}}}}componentWillLoad(){this.handleViewerChanged(this.viewer)}componentDidLoad(){if(this.rendererEl!=null){const e=new ResizeObserver((()=>this.handleRendererResized()));e.observe(this.rendererEl);this.handleRendererResized()}}handleRendererResized(){s((()=>{if(this.rendererEl!=null){const e=this.rendererEl.getBoundingClientRect();this.boxLength=Math.min(e.width,e.height)}}))}render(){return e(r,{key:"a3cea27b2376c4ffbe255168515b8c3f0e7ab5aa"},e("vertex-viewer-dom-renderer",{key:"7f1560abaf53c1dc5b8f43b9dade445917861656",ref:e=>this.rendererEl=e,class:"renderer",camera:this.camera},!this.triadOff&&e("vertex-viewer-dom-group",{key:"0671f7678ab3197709e98649d0ac36a1703614c6",class:"triad",position:this.triadPosition},e(p,{key:"b65eddeb99f9b93120246f8143886ac937afb57a",label:"X",length:this.boxLength,rotationAxis:n.origin()}),e(p,{key:"ba49dbda3e18e90e033453d06b509f31336fffe8",label:"Y",length:this.boxLength,rotationAxis:n.back()}),e(p,{key:"ff765198e6e11cc6b7b2d466766809b055c5ccdf",label:"Z",length:this.boxLength,rotationAxis:n.down()})),e("vertex-viewer-dom-group",{key:"0dd9aab195029c25a3090f35ee39c04ed45da8f8",class:"cube",matrix:this.worldOrientation.matrix},e(k,{key:"995e2af8e70518edcf949d5df72387463ff3cc0e",length:this.boxLength+10}),e(m,{key:"0864a044b3d79b9a483cd492b7a04a20fcf64f42",label:this.zPositiveLabel,length:this.boxLength,side:"front",onPointerDown:this.handleStandardView(l.FRONT),disabled:this.standardViewsOff}),e(m,{key:"8f9110528267a00b802f97a8543a896d9fc333f7",label:this.zNegativeLabel,length:this.boxLength,side:"back",onPointerDown:this.handleStandardView(l.BACK),disabled:this.standardViewsOff}),e(m,{key:"6848e1e273bc815ee40e0218cc15bdc80d1f2715",label:this.xNegativeLabel,length:this.boxLength,side:"left",onPointerDown:this.handleStandardView(l.LEFT),disabled:this.standardViewsOff}),e(m,{key:"825624a992f4d31d9faf7506c8e964392da041ab",label:this.xPositiveLabel,length:this.boxLength,side:"right",onPointerDown:this.handleStandardView(l.RIGHT),disabled:this.standardViewsOff}),e(m,{key:"f59f5693ce4f1b4a794f4665b3f920bf29c1f159",label:this.yPositiveLabel,length:this.boxLength,side:"top",onPointerDown:this.handleStandardView(l.TOP),disabled:this.standardViewsOff}),e(m,{key:"65b8c8a2f8cc5cbc7974ca0dc3e6c328e2ca0649",label:this.yNegativeLabel,length:this.boxLength,side:"bottom",onPointerDown:this.handleStandardView(l.BOTTOM),disabled:this.standardViewsOff}),e(y,{key:"0923dfc3696b2c76e69069156c0f57d6cd4f8285",length:this.boxLength,face1Side:"top",face1Edge:"bottom",face2Side:"front",face2Edge:"top",onPointerDown:this.handleStandardView(l.TOP_FRONT),disabled:this.standardViewsOff}),e(y,{key:"6bf8058fbb4e35b9a1ed8dc5ff772ed2d2995add",length:this.boxLength,face1Side:"front",face1Edge:"right",face2Side:"right",face2Edge:"left",onPointerDown:this.handleStandardView(l.FRONT_LEFT),disabled:this.standardViewsOff}),e(y,{key:"61f28c6cd18661c643ec1510305a8603efbd5cdb",length:this.boxLength,face1Side:"bottom",face1Edge:"top",face2Side:"front",face2Edge:"bottom",onPointerDown:this.handleStandardView(l.BOTTOM_FRONT),disabled:this.standardViewsOff}),e(y,{key:"6c62acdf92f6397ec3c381d10078215cf6a29ebb",length:this.boxLength,face1Side:"front",face1Edge:"left",face2Side:"left",face2Edge:"right",onPointerDown:this.handleStandardView(l.FRONT_RIGHT),disabled:this.standardViewsOff}),e(y,{key:"a94dc61cea93cae54e148c4f1ffc73a42717f986",length:this.boxLength,face1Side:"top",face1Edge:"right",face2Side:"right",face2Edge:"top",onPointerDown:this.handleStandardView(l.TOP_LEFT),disabled:this.standardViewsOff}),e(y,{key:"4a97659a3aad5b162252091401ec666727d204be",length:this.boxLength,face1Side:"back",face1Edge:"left",face2Side:"right",face2Edge:"right",onPointerDown:this.handleStandardView(l.BACK_LEFT),disabled:this.standardViewsOff}),e(y,{key:"422acd7e4689eb7ae0403726a29a3784637bdfd6",length:this.boxLength,face1Side:"bottom",face1Edge:"right",face2Side:"right",face2Edge:"bottom",onPointerDown:this.handleStandardView(l.BOTTOM_LEFT),disabled:this.standardViewsOff}),e(y,{key:"afa5fb1b78c1fcbb78a48f040d5c868a4dd338fc",length:this.boxLength,face1Side:"top",face1Edge:"top",face2Side:"back",face2Edge:"top",onPointerDown:this.handleStandardView(l.TOP_BACK),disabled:this.standardViewsOff}),e(y,{key:"e1aa294c3ed0a6e105929a7094cfbdeab26fe7c0",length:this.boxLength,face1Side:"back",face1Edge:"right",face2Side:"left",face2Edge:"left",onPointerDown:this.handleStandardView(l.BACK_RIGHT),disabled:this.standardViewsOff}),e(y,{key:"e3a83623df735d9987a279ef2e055d1f962cafbe",length:this.boxLength,face1Side:"bottom",face1Edge:"bottom",face2Side:"back",face2Edge:"bottom",onPointerDown:this.handleStandardView(l.BOTTOM_BACK),disabled:this.standardViewsOff}),e(y,{key:"ad1d8915f046ba5df73240489c2daf1703b6a310",length:this.boxLength,face1Side:"top",face1Edge:"left",face2Side:"left",face2Edge:"top",onPointerDown:this.handleStandardView(l.TOP_RIGHT),disabled:this.standardViewsOff}),e(y,{key:"f0b94c0f3517d1f54cf0c23f74fa681607da3532",length:this.boxLength,face1Side:"bottom",face1Edge:"left",face2Side:"left",face2Edge:"bottom",onPointerDown:this.handleStandardView(l.BOTTOM_RIGHT),disabled:this.standardViewsOff}),e(x,{key:"c814db371a4b47ba50084e69879845921eb6ba91",length:this.boxLength,face1Side:"top",face1Corner:"bottom-left",face2Side:"front",face2Corner:"top-left",face3Side:"left",face3Corner:"top-right",onPointerDown:this.handleStandardView(l.TOP_FRONT_RIGHT),disabled:this.standardViewsOff}),e(x,{key:"b0f81f620127d1533eeb675c66d74e1b3019cb3b",length:this.boxLength,face1Side:"top",face1Corner:"bottom-right",face2Side:"front",face2Corner:"top-right",face3Side:"right",face3Corner:"top-left",onPointerDown:this.handleStandardView(l.TOP_FRONT_LEFT),disabled:this.standardViewsOff}),e(x,{key:"254834f0214afa786b8997274e0dcbc4f1e5e31c",length:this.boxLength,face1Side:"bottom",face1Corner:"top-right",face2Side:"front",face2Corner:"bottom-right",face3Side:"right",face3Corner:"bottom-left",onPointerDown:this.handleStandardView(l.BOTTOM_FRONT_LEFT),disabled:this.standardViewsOff}),e(x,{key:"847425b3886582ddb596408fbfcd2fcd9e424641",length:this.boxLength,face1Side:"bottom",face1Corner:"top-left",face2Side:"front",face2Corner:"bottom-left",face3Side:"left",face3Corner:"bottom-right",onPointerDown:this.handleStandardView(l.BOTTOM_FRONT_RIGHT),disabled:this.standardViewsOff}),e(x,{key:"fe6eaffd1f06fe45a9fa3fb680d638f3623187aa",length:this.boxLength,face1Side:"top",face1Corner:"top-right",face2Side:"back",face2Corner:"top-left",face3Side:"right",face3Corner:"top-right",onPointerDown:this.handleStandardView(l.TOP_BACK_LEFT),disabled:this.standardViewsOff}),e(x,{key:"e4b8004047f4f1da2decc4b17d86297a67e38e9d",length:this.boxLength,face1Side:"top",face1Corner:"top-left",face2Side:"back",face2Corner:"top-right",face3Side:"left",face3Corner:"top-left",onPointerDown:this.handleStandardView(l.TOP_BACK_RIGHT),disabled:this.standardViewsOff}),e(x,{key:"c06a8465a3b39828bf114faaa0039c8e32196441",length:this.boxLength,face1Side:"bottom",face1Corner:"bottom-left",face2Side:"back",face2Corner:"bottom-right",face3Side:"left",face3Corner:"bottom-left",onPointerDown:this.handleStandardView(l.BOTTOM_BACK_RIGHT),disabled:this.standardViewsOff}),e(x,{key:"2ea208573579fd18a3b7fde9f0bbc3a5834e2652",length:this.boxLength,face1Side:"bottom",face1Corner:"bottom-right",face2Side:"back",face2Corner:"bottom-left",face3Side:"right",face3Corner:"bottom-right",onPointerDown:this.handleStandardView(l.BOTTOM_BACK_LEFT),disabled:this.standardViewsOff}))))}static get watchers(){return{viewer:[{handleViewerChanged:0}]}}static get style(){return S()}},[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"],viewAll:[4,"view-all"],animationDuration:[2,"animation-duration"],triadOff:[4,"triad-off"],worldOrientation:[1040],camera:[1040],viewer:[16],boxLength:[32],triadPosition:[32]},undefined,{viewer:[{handleViewerChanged:0}]}]);function P(){if(typeof customElements==="undefined"){return}const e=["vertex-viewer-view-cube","vertex-viewer-dom-element","vertex-viewer-dom-group","vertex-viewer-dom-renderer"];e.forEach((e=>{switch(e){case"vertex-viewer-view-cube":if(!customElements.get(i(e))){customElements.define(i(e),D)}break;case"vertex-viewer-dom-element":if(!customElements.get(i(e))){v()}break;case"vertex-viewer-dom-group":if(!customElements.get(i(e))){g()}break;case"vertex-viewer-dom-renderer":if(!customElements.get(i(e))){u()}break}}))}P();const C=D;const E=P;export{C as VertexViewerViewCube,E as defineCustomElement};
5
5
  //# sourceMappingURL=vertex-viewer-view-cube.js.map