import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import"./vendor-primevue-7po8Zk9v.js";import"./vendor-firebase-CdLSXhbt.js";import{K as t}from"./vendor-vue-core-D3IvUUeM.js";import"./vendor-other-CrvBxfcV.js";import"./types-0oh-UGWL.js";import"./remoteConfig-CNDr9CtS.js";import"./api-3C7_IVZO.js";import"./colorUtil-C83P1Arv.js";import"./i18n-DjEVEIh2.js";import"./useErrorHandling-CBX3YQ5l.js";import"./vendor-reka-ui-Bm3o_ZTf.js";import"./Button-mG8zDgxj.js";import{Ar as n,kr as r,tn as i}from"./dialogService-BC0EXJA5.js";import"./systemStatsStore-gvlzOl4W.js";import"./dialogStore-BbHfkjRE.js";import"./useCopyToClipboard-CUuoo5Dm.js";import"./vendor-tiptap-DsZVujQD.js";import"./vendor-markdown-yjaB1jgA.js";import"./markdownRendererUtil-D5cHPoK2.js";import"./vendor-three-Qz0FU1fN.js";import"./Load3DControls-Drp4k7J9.js";import"./Load3dViewerContent-CVHdIULR.js";import{t as a}from"./Load3D-D-0YXPgB.js";import"./AnimationControls-B7Thj1Zy.js";import{r as o,t as s}from"./load3dService-FyKs_L4c.js";import"./useLoad3dViewer-BM5nV_Fe.js";import{n as c}from"./useLoad3d-_5FyK9MF.js";import{n as l,t as u}from"./Load3DConfiguration-EwGSMUPs.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-CyM9w1DU.js.map