import"./rolldown-runtime-DIIn1E2Q.js";import"./vendor-primevue-_eYbXsHY.js";import"./vendor-firebase-D7u00oy9.js";import{q as e}from"./vendor-vue-core-DO0afONr.js";import"./vendor-other-D7fTIduy.js";import"./useFeatureFlags-ChmiVSwD.js";import"./api-BebQfoGK.js";import"./vendor-markdown-Da9QPS2x.js";import"./colorUtil-xHrUTSza.js";import"./i18n-dAUEhQVe.js";import"./vendor-reka-ui-D1HCh14_.js";import"./Button-hTbieW3T.js";import{Qi as t,ar as n,ea as r}from"./dialogService-Cm1GEBK8.js";import"./formatUtil-Gr6H7233.js";import"./userStore-DMlTsx5E.js";import"./useErrorHandling-DudkVSep.js";import"./extensionStore-P-YqST__.js";import"./useExternalLink-DY6FqhTr.js";import"./vendor-tiptap-CcjHVRxb.js";import"./markdownRendererUtil-PltcX2Bi.js";import"./Popover-BhkpNQxC.js";import"./electronDownloadStore-BYrGQ7mS.js";import"./vendor-three-8NczM_fZ.js";import"./Load3DControls-E5pxy74X.js";import"./constants-DwnN7bTR.js";import"./Load3dViewerContent-Z1VApFbr.js";import{t as i}from"./Load3D-Qiw2noIi.js";import"./AnimationControls-DNRGBGTs.js";import{r as a,t as o}from"./load3dService-D7UetPdG.js";import"./useLoad3dViewer-9bWqoOpD.js";import{n as s}from"./useLoad3d-ChNoCDhk.js";import{n as c,t as l}from"./Load3DConfiguration-Bhs5KUxY.js";var u={name:`image`,type:`Preview3D`,isPreview:!0};n().registerExtension({name:`Comfy.SaveGLB`,async beforeRegisterNodeDef(e,t){t.name===`SaveGLB`&&(t.input.required.image=[`PREVIEW_3D`])},getCustomWidgets(){return{PREVIEW_3D(e){let n=new t({node:e,name:u.name,component:i,inputSpec:u,options:{}});return n.type=`load3D`,r(e,n),{widget:n}}}},getNodeMenuItems(e){if(e.constructor.comfyClass!==`SaveGLB`)return[];let t=o().getLoad3d(e);return!t||t.isSplatModel()?[]:c(t)},async nodeCreated(t){if(t.constructor.comfyClass!==`SaveGLB`)return;let[n,r]=t.size;t.setSize([Math.max(n,400),Math.max(r,550)]),await e();let i=t.onExecuted;t.onExecuted=function(e){i?.call(this,e);let n=e[`3d`]?.[0];n&&s(t).waitForLoad3d(e=>{let r=t.widgets?.find(e=>e.name===`image`);if(e&&r){let i=(n.subfolder??``)+`/`+(n.filename??``);r.value=i;let o=new l(e,t.properties),s=n.type,onModelLoaded=()=>{e.removeEventListener(`modelLoadingEnd`,onModelLoaded),a.generateThumbnailIfNeeded(e,i,s)};e.addEventListener(`modelLoadingEnd`,onModelLoaded),o.configureForSaveMesh(s,i)}})}}});
//# sourceMappingURL=saveMesh-B_UoAyCH.js.map