You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
7.3 KiB
1 line
7.3 KiB
|
1 year ago
|
!function(){"use strict";var e=["/Private/thirdparty.js","/Private/three.js","/Bimface/lib/loaders/PntLoader.js","/Bimface/lib/loaders/BimTilesLoader.js","/Private/Editor.js","/Private/WebViewer.js","/Private/bimface.bufferfly.js","/Private/mdvDrawing2D.js"],t=window.hostConfig||{APIHost:"https://api.bimface.com",resourceHost:"https://m.bimface.com",staticHost:"https://static.bimface.com",dataEnvType:"BIMFACE",securityApi:!0};void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),a=1;a<arguments.length;a++){var i=arguments[a];if(null!=i)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t});let a=Object.freeze({Release:"Release",Debug:"Debug"}),i=Object.freeze({Normal:"Normal",DrawingView:"drawingView"}),s=Object.freeze({BIMFACE:"BIMFACE",Local:"Local"}),n=Object.freeze({zh_CN:"zh_CN",en_GB:"en_GB",sv_SE:"sv_SE",zh_TW:"zh_TW"}),o=Object.freeze({Normal:"Normal",Bake:"Bake"});window.BimfaceSDKLoaderConfig=function(){if(window.hostConfig){for(let e in window.hostConfig)t[e]=window.hostConfig[e];t.securityApi=window.hostConfig.securityApi}return{staticHost:`${t.staticHost}/api`,APIHost:t.APIHost,language:"zh_CN",viewToken:null,configuration:a.Release,dataEnvType:t.dataEnvType||"BIMFACE",viewType:i.Normal,visualStyle:o.Bake,version:"",securityApi:t.securityApi}},window.BimfaceEnvOption=s,window.BimfaceLanguageOption=n,window.BimfaceConfigrationOption=a,window.BimfaceViewTypeOption=i;var r=function(e,t){for(var a=0;a<t.length;a++)t[a]=e+t[a]},c=function(e){var t=e.sdkVersion,a=e.options,s=a.configuration,n=[],o=[`/${t}/${a.language}.js`,`/${t}/Application${s}.js`];return n=function(e,t){return"drawingView"==e.renderType||t.viewType==i.DrawingView}(e.metadata,e.options)?[...n,...o,`/${t}/Drawing.css`,`/${t}/bimface.bufferfly.js`,`/${t}/Drawing${s}.js`]:[...n,...o,`/${t}/Bimface.css`,`/${t}/thirdparty.js`,`/${t}/lib/loaders/BimTilesLoader.js`,`/${t}/Bimface${s}.js`],n};window.postProcessing=function(e){var t=e.metadata,i=e.options,s=e.successCb,n=c(e);r(i.staticHost,n),t.databagId=`${t.databagId}`,i.path?(t.path=i.path,t.dataPath="./"):i.resourcePath&&(t.path=i.resourcePath.replace("viewToken","")),t.sdkPath=i.sdkPath,0==n.length?s(t):d(n,(function(){if(i.build===a.Debug&&i.dataPath){let e=i.dataPath.split("/");s({databagId:e.pop(),path:e.join("/")})}s(t)}))};var d=function(e,t,i){var s=e.length,n=0,o=function(f){if(f&&"error"==f.message&&f.element.indexOf("bimface.index")>-1){n=0;var u=i.options;u.build,a.Release;var p=c(i);return r(u.staticHost,p),void d(p,t)}++n==s?t():l(e[n],o)};l(e[n],o)},f=[],l=function(e,t){if(!(f.indexOf(e.split("/").pop())>-1)){var a,i=document.getElementsByTagName("head")[0];return e.indexOf(".css")>-1?((a=document.createElement("link")).setAttribute("href",e),a.setAttribute("rel","stylesheet")):(a=document.createElement("script")).setAttribute("src",e),a.url=e,i.appendChild(a),a.addEventListener("load",(function(){f.push(this.url.split("/").pop()),t&&t({message:"success"})})),a.addEventListener("error",(function(){t&&t({element:e,message:"error"})})),a}t()};window.loadResource=d;var u=function(e,t){for(var a=0;a<t.length;a++)t[a]=e+t[a]},p=function(e,t){var a="pdf-transfer"===e.workerType||"pdfView"===t.viewType;return a&&(e.renderType="pdfView"),a},m=function(e,t){return"drawingView"==e.renderType||t.viewType==i.DrawingView};const w=function(e,t,a){const i="Local"==BimfaceLoaderConfig.dataEnvType||BimfaceLoaderConfig.sdkPath?"bimface":t.sdkVersion;let s=[`/${i}/lib/Base64.min.js`,`/${i}/lib/CryptoJS.min.js`,`/${i}/lib/JSEncrypt.min.js`];u(e,s);let n="";if(t.options.resourcePath.startsWith("http"))n=t.options.resourcePath+"/certfile.cer";else{let e=location.href.lastIndexOf("/");n=location.href.substring(0,e)+"/certfile.cer"}d(s,(function(){var e,i,s;e={type:"get",url:n,async:!0,success:function(e){const i=new JSEncrypt;i.setPublicKey("MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCP15iz0j7CO8vUP/w/rpT5VR4CLhYoVOJWjbHbWQ/esw/K7SC4qjTIN2OOOJjrbITVW8i9vRU3fLxlG0NFw6TaRDfy+UsozGSoqvEtRyzCdxNb3v
|