/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
import{t as n,p as t,H as s,d as e,h as o,e as i}from"./p-DmsAWRoU.js";import{v as a,q as h,m as r,h as d}from"./p-Tvs4yxd5.js";import{o as l}from"./p-Dc9KNUUp.js";const c=()=>`.sc-vertex-viewer-dom-group-h{display:block;transform-style:preserve-3d}`;const u=t(class n extends s{constructor(n){super();if(n!==false){this.__registerHost()}this.propertyChange=e(this,"propertyChange");this.position=a.origin();this.positionJson="";this.quaternion=h.create();this.quaternionJson="";this.scale=a.create(1,1,1);this.scaleJson="";this.matrix=r.makeIdentity()}handlePositionChange(){this.syncMatrix()}handlePositionJsonChanged(){this.syncPosition()}handleRotationChanged(){this.syncQuaternionWithRotation()}handleRotationJsonChanged(){this.syncRotation()}handleQuaternionChange(){this.syncMatrix()}handleQuaternionJsonChanged(){this.syncQuaternion()}handleScaleChange(){this.syncMatrix()}handleScaleJsonChanged(){this.syncScale()}handleMatrixChanged(n,t){if(!l.isEqual(n,t)){this.propertyChange.emit()}}componentWillLoad(){this.syncProperties()}componentShouldUpdate(){return false}syncProperties(){this.syncPosition();this.syncRotation();this.syncQuaternion();this.syncScale();this.syncMatrix()}syncPosition(){this.position=this.positionJson.length>0?this.parseJson("positionJson",this.positionJson,a.fromJson):this.position}syncRotation(){this.rotation=this.rotationJson!=null&&this.rotationJson.length>0?this.parseJson("rotationJson",this.rotationJson,d.fromJson):this.rotation;this.syncQuaternionWithRotation()}syncQuaternionWithRotation(){this.quaternion=this.rotation!=null?h.fromEuler(this.rotation):this.quaternion}syncQuaternion(){this.quaternion=this.quaternionJson.length>0?this.parseJson("quaternionJson",this.quaternionJson,h.fromJson):this.quaternion}syncScale(){this.scale=this.scaleJson.length>0?this.parseJson("scaleJson",this.scaleJson,a.fromJson):this.scale}syncMatrix(){this.matrix=r.makeTRS(this.position,this.quaternion,this.scale)}parseJson(n,t,s){try{return s(t)}catch(t){console.warn(`Could not parse \`${n}\`. Invalid JSON.`);throw t}}render(){return o(i,{key:"38d400024a27631bf1f111d9a4f44b01469c814d"},o("slot",{key:"50ab66305307ce5c45638c562830ca55c2956835"}))}static get watchers(){return{position:[{handlePositionChange:0}],positionJson:[{handlePositionJsonChanged:0}],rotation:[{handleRotationChanged:0}],rotationJson:[{handleRotationJsonChanged:0}],quaternion:[{handleQuaternionChange:0}],quaternionJson:[{handleQuaternionJsonChanged:0}],scale:[{handleScaleChange:0}],scaleJson:[{handleScaleJsonChanged:0}],matrix:[{handleMatrixChanged:0}]}}static get style(){return c()}},[262,"vertex-viewer-dom-group",{position:[1040],positionJson:[1,"position"],rotation:[1040],rotationJson:[1,"rotation"],quaternion:[1040],quaternionJson:[1,"quaternion"],scale:[1040],scaleJson:[1,"scale"],matrix:[1040]},undefined,{position:[{handlePositionChange:0}],positionJson:[{handlePositionJsonChanged:0}],rotation:[{handleRotationChanged:0}],rotationJson:[{handleRotationJsonChanged:0}],quaternion:[{handleQuaternionChange:0}],quaternionJson:[{handleQuaternionJsonChanged:0}],scale:[{handleScaleChange:0}],scaleJson:[{handleScaleJsonChanged:0}],matrix:[{handleMatrixChanged:0}]}]);function g(){if(typeof customElements==="undefined"){return}const t=["vertex-viewer-dom-group"];t.forEach((t=>{switch(t){case"vertex-viewer-dom-group":if(!customElements.get(n(t))){customElements.define(n(t),u)}break}}))}g();export{u as V,g as d};
//# sourceMappingURL=p-CzjE4kTb.js.map