import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import"./vendor-primevue-DYf-ECwY.js";import"./vendor-firebase-yTFzdAQf.js";import{q as t}from"./vendor-vue-core-IZuWV8u3.js";import"./vendor-other-D1_ndkJp.js";import"./useFeatureFlags-DjI8HfpU.js";import"./api-C5jfeYdJ.js";import"./vendor-markdown-th9BvURy.js";import"./colorUtil-vwiX_KSk.js";import"./i18n-Bdsl_BiU.js";import"./vendor-reka-ui-Dfvl2gA8.js";import"./Button-BOHBs1GV.js";import{Mn as n,jn as r,vn as i}from"./dialogService-Bi1dBSPP.js";import"./systemStatsStore-D8Q9B-Td.js";import"./userStore-DaXXm4Yp.js";import"./useErrorHandling-CC7s0fJf.js";import"./vendor-tiptap-F_4ky0lj.js";import"./Popover-cEFhN-pL.js";import"./markdownRendererUtil-DO0bU-vH.js";import"./useExternalLink-CgEj7wAu.js";import"./vendor-three-BAimT_0v.js";import"./Load3DControls-zbuEnQ9e.js";import"./constants-Bg5Vkm2P.js";import"./Load3dViewerContent-ssSqAYEP.js";import{t as a}from"./Load3D-CWz-ljtV.js";import"./AnimationControls-CcP6lJYg.js";import{r as o,t as s}from"./load3dService-DWbgve6S.js";import"./useLoad3dViewer-CsXF4chw.js";import{n as c}from"./useLoad3d-DAQtwjj_.js";import{n as l,t as u}from"./Load3DConfiguration-BlYQEm2f.js";var d={name:`image`,type:`Preview3D`,isPreview:!0};i().registerExtension({name:`Comfy.SaveGLB`,async beforeRegisterNodeDef(e,t){t.name===`SaveGLB`&&(t.input.required.image=[`PREVIEW_3D`])},getCustomWidgets(){return{PREVIEW_3D(e){let t=new r({node:e,name:d.name,component:a,inputSpec:d,options:{}});return t.type=`load3D`,n(e,t),{widget:t}}}},getNodeMenuItems(e){if(e.constructor.comfyClass!==`SaveGLB`)return[];let t=s().getLoad3d(e);return!t||t.isSplatModel()?[]:l(t)},async nodeCreated(e){if(e.constructor.comfyClass!==`SaveGLB`)return;let[n,r]=e.size;e.setSize([Math.max(n,400),Math.max(r,550)]),await t();let i=e.onExecuted;e.onExecuted=function(t){i?.call(this,t);let n=t[`3d`]?.[0];n&&c(e).waitForLoad3d(t=>{let r=e.widgets?.find(e=>e.name===`image`);if(t&&r){let i=(n.subfolder??``)+`/`+(n.filename??``);r.value=i;let a=new u(t,e.properties),s=n.type,onModelLoaded=()=>{t.removeEventListener(`modelLoadingEnd`,onModelLoaded),o.generateThumbnailIfNeeded(t,i,s)};t.addEventListener(`modelLoadingEnd`,onModelLoaded),a.configureForSaveMesh(s,i)}})}}});
//# sourceMappingURL=saveMesh-BgCfA0h1.js.map