import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import"./vendor-primevue-DGevbYGF.js";import"./vendor-firebase-yTFzdAQf.js";import{q as t}from"./vendor-vue-core-BdhYaYlO.js";import"./vendor-other-D9HJWI2D.js";import"./useFeatureFlags-DLStzqlx.js";import"./api-C1WIrB4Z.js";import"./vendor-markdown-th9BvURy.js";import"./colorUtil-DJbZtU1U.js";import"./i18n-DKtnmyh4.js";import"./vendor-reka-ui-CSo89nDv.js";import"./Button-DHxPjNdi.js";import{ar as n,jn as r,rr as i}from"./dialogService-CwVeD8j9.js";import"./extensionStore-By6c6sCD.js";import"./userStore-ChcnLOkA.js";import"./useErrorHandling-CWU_3R6Y.js";import"./useExternalLink-DZBh_BZs.js";import"./vendor-tiptap-BZHcjrm1.js";import"./markdownRendererUtil-J4WlXR5e.js";import"./Popover-_oREh-V5.js";import"./vendor-three-BAimT_0v.js";import"./Load3DControls-DqDaf3B4.js";import"./constants-CsJ_J7UB.js";import"./Load3dViewerContent-C472gfq0.js";import{t as a}from"./Load3D-Dd0z5pZ2.js";import"./AnimationControls-8FCOKK6G.js";import{r as o,t as s}from"./load3dService-BNTye4XY.js";import"./useLoad3dViewer-czaPLbuC.js";import{n as c}from"./useLoad3d-DRb-mKgY.js";import{n as l,t as u}from"./Load3DConfiguration-Dd0hCou7.js";var d={name:`image`,type:`Preview3D`,isPreview:!0};r().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 i({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-p3dbGoN5.js.map