PageSourceSearch

https://bimblox-021023.web.app/assets/IFCConverter-9802d419.js

js bimblox-021023.web.app collected 2026-10-03 12:18:24 UTC 10,223 bytes, 11 lines download raw bytes

1var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});import{d as defineComponent,V as Vue3Lottie,T as TrashBinOutline,B as Base,u as useDropZone,c as createElementBlock,a as createVNode,g as withDirectives,b as createBaseVNode,w as withCtx,f as createBlock,h as createCommentVNode,t as toDisplayString,e as resolveComponent,i as resolveDirective,o as openBlock,j as createTextVNode,_ as _export_sfc}from"./index-091a344c.js";import{W as WorkerWrapper}from"./IFCConverter-8156606e.js";import{T as Tool}from"./Tool.mixin-a1f5bff3.js";import{E as ErrorManager}from"./ErrorManager-eb15299d.js";import{f as failedJSON}from"./failed-a67421bb.js";import{f as finishedJSON,p as processingJSON}from"./processingRobot-1b7899e3.js";import{B as BookOutline}from"./BookOutline-8b235376.js";import{C as CloudDownloadOutline}from"./CloudDownloadOutline-f4bd1af9.js";import{F as FlaskOutline}from"./FlaskOutline-fcbe0a98.js";import{D as DocumentOutline}from"./DocumentOutline-6a25f651.js";import{S as ShieldCheckmarkOutline}from"./ShieldCheckmarkOutline-eeb2cc08.js";const _sfc_main=defineComponent({components:{Vue3Lottie,BookOutline,CloudDownloadOutline,TrashBinOutline,FlaskOutline,DocumentOutline,ShieldCheckmarkOutline},mixins:[Tool,Base],data(){return{allowedExts:["ifc","Ifc","IFC"],failedJSON,finishedJSON,processingJSON,disabled:!0,isIdle:!0,hasError:!1,logs:"",glbFinished:!1,jsonFinished:!1,worker:new WorkerWrapper,time:null}},mounted(){useDropZone(this.$refs.dropZoneRef,this.onDrop)}
1,methods:{async onDrop(files){if(files&&files[0].name){let ext=files[0].name.split(".").pop();if(!this.allowedExts.includes(ext))throw new ErrorManager("Wrong file format provided.","");this.isIdle=!1;let s=0,m=0,interval=setInterval(()=>{s==60?(m+=1,s=0):s+=1;let mm=m<10?`0${m}`:m,ss=s<10?`0${s}`:s;this.time=`${mm}:${ss}`},1e3);const url=URL.createObjectURL(files[0]),data=await this.getIfcFile(url);this.worker.postMessage({type:"parse",file:data}),this.worker.onmessage=async msg=>{if(msg.data.type=="finishedGlb"){clearInterval(interval);let glbFile=new Blob([msg.data.glb],{type:"application/octet-stream"});glbFile&&(this.logs+=`
2`,this.logs+="Glb File is ready to be downloaded!",this.glbFinished=!0,this.$nextTick(()=>{const a1=document.getElementById("glb");a1.href=URL.createObjectURL(glbFile),a1.download=`${files[0].name.replace(".ifc","")}.glb`}))}else if(msg.data.type=="finishedProps"){let jsonFile="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(Object.fromEntries(msg.data.properties)));jsonFile&&(this.logs+=`
3`,this.logs+="Properties File is ready to be downloaded!",this.jsonFinished=!0,this.$nextTick(()=>{const a2=document.getElementById("props");a2.href=jsonFile,a2.download=`${files[0].name.replace(".ifc","")}.json`}))}else if(msg.data.type=="parsed")this.logs+=`
4`,this.logs+="File info:",this.logs+=`
5`,this.logs+=`  - File name: ${files[0].name}`,this.logs+=`
6`,this.logs+=`  - File schema: ${msg.data.msg.schema}`,this.logs+=`
7`,this.logs+=`  - File size: ${Number(files[0].size/1024/1024).toFixed(2)} mb`,this.logs+=`
8`,this.logs+=`  - Authored by: ${msg.data.msg.app}`,this.logs+=`
9`,this.logs+="Started parsing...",this.logs+=`
10`,this.logs+="Processing...",this.logs+=`
11`;else if(msg.data.type=="onError")throw clearInterval(interval),this.hasError=!0,console.warn("[Error]:",msg.data.error),new ErrorManager("Couldn't process file.","")}}},clearData(){this.logs="",this.glbFinished=!1,this.jsonFinished=!1,this.isIdle=!0,this.hasError=!1,this.time=null,location.reload()},downloadGemetry(){document.getElementById("glb").click()},downloadProperties(){document.getElementById("props").click()}}}),_hoisted_1={class:"flex flex-col gap-8 pb-15"},_hoisted_2={class:"tool_view flex flex-col gap-4 px-25 items-center box-border duration-1500"},_hoisted_3={class:"flex flex-wrap gap-4 justify-center mt-4 max-w-2xl"},_hoisted_4={class:"flex items-center gap-2 px-3 py-1 rounded-full bg-white bg-opacity-5 border border-white border-opacity-10"},_hoisted_5={class:"flex items-center gap-2 px-3 py-1 rounded-full bg-white bg-opacity-5 border border-white border-opacity-10"},_hoisted_6={class:"flex items-center gap-2 px-3 py-1 rounded-full bg-white bg-opacity-5 border border-white border-opacity-10"},_hoisted_7={key:0,class:"flex flex-col gap-10 w-auto justify-evenly bg-zinc-200 bg-opacity-10 p-5 rounded-md shadow-md box-border"},_hoisted_8={class:"flex gap-6 w-full justify-evenly"},_hoisted_9={key:1,class:"flex flex-col gap-3 w-auto p-5 bg-zinc-200 bg-opacity-20 rounded-md shadow-md box-border"},_hoisted_10={key:0,class:"m-0 text-white"},_hoisted_11={key:2,class:"flex flex-col gap-10 w-auto bg-zinc-200 bg-opacity-30 rounded-md shadow-md box-border p-5"};function render(_ctx,_cache,$props,$setup,$data,$options){const _component_bbx_header=resolveComponent("bbx-header"),_component_n_back_top=resolveComponent("n-back-top"),_component_FlaskOutline=resolveComponent("FlaskOutline"),_component_n_icon=resolveComponent("n-icon"),_component_DocumentOutline=resolveComponent("DocumentOutline"),_component_ShieldCheckmarkOutline=resolveComponent("ShieldCheckmarkOutline"),_component_Vue3Lottie=resolveComponent("Vue3Lottie"),_component_CloudDownloadOutline=resolveComponent("CloudDownloadOutline"),_component_n_button=resolveComponent("n-button"),_component_TrashBinOutline=resolveComponent("TrashBinOutline"),_component_bbx_dropZone=resolveComponent("bbx-dropZone"),_directive_animateonscroll=resolveDirective("animateonscroll");return openBlock(),createElementBlock("div",_hoisted_1,[createVNode(_component_bbx_header),withDirectives((openBlock(),createElementBlock("div",_hoisted_2,[createVNode(_component_n_back_top,{class:"bg-slate-100 bg-opacity-40",right:25}),_cache[11]||(_cache[11]=createBaseVNode("h1",{class:"drop-shadow-xl text-white"},"IFC basic converter",-1)),createBaseVNode("div",_hoisted_3,[createBaseVNode("div",_hoisted_4,[createVNode(_component_n_icon,{size:"16",color:"#d5f23b"},{default:withCtx(()=>[createVNode(_component_FlaskOutline)]),_:1}),_cache[0]||(_cache[0]=createBaseVNode("span",{class:"text-zinc-400 text-xs"},"Demo only — not production-ready",-1))]),createBaseVNode("div",_hoisted_5,[createVNode(_component_n_icon,{size:"16",color:"#d5f23b"},{default:withCtx(()=>[createVNode(_component_DocumentOutline)]),_:1}),_cache[1]||(_cache[1]=createBaseVNode("span",{class:"text-zinc-400 text-xs"},"One file at a time",-1))]),createBaseVNode("div",_hoisted_6,[createVNode(_component_n_icon,{size:"16",color:"#d5f23b"},{default:withCtx(()=>[createVNode(_component_ShieldCheckmarkOutline)]),_:1}
11),_cache[2]||(_cache[2]=createBaseVNode("span",{class:"text-zinc-400 text-xs"},"100% local processing — full privacy",-1))])]),!_ctx.isIdle&&(_ctx.jsonFinished||_ctx.glbFinished)?(openBlock(),createElementBlock("div",_hoisted_7,[createVNode(_component_Vue3Lottie,{ref:"finished",animationData:_ctx.finishedJSON,height:200,width:500,loop:!1,"auto-play":!0},null,8,["animationData"]),createBaseVNode("div",_hoisted_8,[_ctx.glbFinished?(openBlock(),createBlock(_component_n_button,{key:0,class:"button-neon flex flex-grow","icon-placement":"right",onClick:_ctx.downloadGemetry},{icon:withCtx(()=>[createVNode(_component_n_icon,null,{default:withCtx(()=>[createVNode(_component_CloudDownloadOutline)]),_:1})]),default:withCtx(()=>[_cache[3]||(_cache[3]=createTextVNode("Download Glb",-1)),_cache[4]||(_cache[4]=createBaseVNode("a",{id:"glb"},null,-1))]),_:1},8,["onClick"])):createCommentVNode("",!0),_ctx.jsonFinished?(openBlock(),createBlock(_component_n_button,{key:1,class:"button-neon flex flex-grow","icon-placement":"right",onClick:_ctx.downloadProperties},{icon:withCtx(()=>[createVNode(_component_n_icon,null,{default:withCtx(()=>[createVNode(_component_CloudDownloadOutline)]),_:1})]),default:withCtx(()=>[_cache[5]||(_cache[5]=createTextVNode("Download Properties ",-1)),_cache[6]||(_cache[6]=createBaseVNode("a",{id:"props"},null,-1))]),_:1},8,["onClick"])):createCommentVNode("",!0),_ctx.jsonFinished||_ctx.glbFinished?(openBlock(),createBlock(_component_n_button,{key:2,class:"button-neon flex flex-grow",ghost:"",onClick:_ctx.clearData,"icon-placement":"right"},{icon:withCtx(()=>[createVNode(_component_n_icon,null,{default:withCtx(()=>[createVNode(_component_TrashBinOutline)]),_:1})]),default:withCtx(()=>[_cache[7]||(_cache[7]=createTextVNode("Clear",-1))]),_:1},8,["onClick"])):createCommentVNode("",!0)])])):createCommentVNode("",!0),createVNode(_component_bbx_dropZone,{isIdle:_ctx.isIdle,content:"Drop or click to upload IFC file",onOnChange:_ctx.onDrop},null,8,["isIdle","onOnChange"]),!_ctx.isIdle&&!_ctx.hasError&&!_ctx.jsonFinished&&!_ctx.glbFinished&&!_ctx.hasError?(openBlock(),createElementBlock("div",_hoisted_9,[createVNode(_component_Vue3Lottie,{ref:"processing",animationData:_ctx.processingJSON,height:200,width:500,loop:!0,"auto-play":!0},null,8,["animationData"]),_cache[8]||(_cache[8]=createBaseVNode("div",{class:"flex w-full gap-1 justify-center"},[createBaseVNode("h2",{class:"animate-pulse text-white"},"Processing file"),createBaseVNode("h2",{class:"animate-pulse text-white"},"...")],-1)),_ctx.time?(openBlock(),createElementBlock("h4",_hoisted_10,"Time elapsed "+toDisplayString(_ctx.time),1)):createCommentVNode("",!0)])):createCommentVNode("",!0),_ctx.hasError?(openBlock(),createElementBlock("div",_hoisted_11,[_cache[10]||(_cache[10]=createBaseVNode("h2",{class:"text-red-600"},"Failed to process file",-1)),createVNode(_component_Vue3Lottie,{ref:"failed",animationData:_ctx.failedJSON,height:200,width:500,loop:!1,"auto-play":!0},null,8,["animationData"]),createVNode(_component_n_button,{class:"button-neon flex flex-grow",ghost:"","icon-placement":"right",onClick:_ctx.clearData},{icon:withCtx(()=>[createVNode(_component_n_icon,null,{default:withCtx(()=>[createVNode(_component_TrashBinOutline)]),_:1})]),default:withCtx(()=>[_cache[9]||(_cache[9]=createTextVNode("Clear",-1))]),_:1},8,["onClick"])])):createCommentVNode("",!0)])),[[_directive_animateonscroll,{enterClass:"fadein",leaveClass:"fadeout"}]])])}__name(render,"render");const IFCConverter=_export_sfc(_sfc_main,[["render",render],["__scopeId","data-v-428f549a"]]);export{IFCConverter as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.