import{F as n,aN as m,aO as d}from"./index-6jOCfdig.js";import{GLTFLoader as u}from"./glTFLoader-Bx351I09.js";import"./index-Ds2meNS5.js";import"./svelte/svelte_svelte.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_client.js";import"./svelte/svelte_internal_flags_async.js";import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_store.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";import"./bone-DdTyU8i_.js";import"./skeleton-C0c5yg7x.js";import"./rawTexture-CpjOe2U7.js";import"./assetContainer-Drc86vic.js";import"./objectModelMapping-DT0r674A.js";const s="KHR_materials_unlit";class c{constructor(r){this.name=s,this.order=210,this._loader=r,this.enabled=this._loader.isExtensionUsed(s)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,o,i){return u.LoadExtensionAsync(r,o,this.name,async()=>await this._loadUnlitPropertiesAsync(r,o,i))}_loadUnlitPropertiesAsync(r,o,i){const t=this._loader._getOrCreateMaterialAdapter(i),p=new Array,e=o.pbrMetallicRoughness;return e&&(e.baseColorFactor&&(t.baseColor=n.FromArray(e.baseColorFactor),t.geometryOpacity=e.baseColorFactor[3]),e.baseColorTexture&&p.push(this._loader.loadTextureInfoAsync(`${r}/baseColorTexture`,e.baseColorTexture,l=>{l.name=`${i.name} (Base Color)`,t.baseColorTexture=l}))),t.isUnlit=!0,o.doubleSided&&(t.backFaceCulling=!1,t.twoSidedLighting=!0),this._loader.loadMaterialAlphaProperties(r,o,i),Promise.all(p).then(()=>{})}}m(s);d(s,!0,a=>new c(a));export{c as KHR_materials_unlit};
