@realsee/five 6.6.0-alpha.2 → 6.6.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/docs/assets/hierarchy.js +1 -1
  2. package/docs/assets/navigation.js +1 -1
  3. package/docs/assets/search.js +1 -1
  4. package/docs/classes/five.Five.html +1 -1
  5. package/docs/classes/five.Model.html +32 -33
  6. package/docs/classes/five.ModelScene.html +17 -18
  7. package/docs/classes/five.PBMContainer.html +1 -1
  8. package/docs/classes/five.PBMGroup.html +1 -1
  9. package/docs/classes/five.PBMMesh.html +1 -1
  10. package/docs/classes/five.PBMMeshMaterial.html +1 -1
  11. package/docs/classes/five.PBMPointCloud.html +1 -1
  12. package/docs/classes/five.PBMPointCloudMaterial.html +1 -1
  13. package/docs/classes/five.PBMSkinnedMesh.html +1 -1
  14. package/docs/classes/five.PanoCircleMesh.html +1 -1
  15. package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
  16. package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
  17. package/docs/classes/five.Parameter.html +1 -1
  18. package/docs/classes/five.Tile3DModel.html +21 -21
  19. package/docs/classes/five.TileNode.html +2 -2
  20. package/docs/classes/five.TrajectoryNode.html +1 -1
  21. package/docs/classes/five.WorkResolvedObserver.html +1 -1
  22. package/docs/classes/gltf-loader.DDSLoader.html +1 -1
  23. package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
  24. package/docs/classes/gltf-loader.GLTFObject.html +1 -1
  25. package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
  26. package/docs/classes/line.LineGeometry.html +1 -1
  27. package/docs/classes/line.LineMaterial.html +1 -1
  28. package/docs/classes/line.LineSegmentsGeometry.html +1 -1
  29. package/docs/classes/line.THREE_Line2.html +1 -1
  30. package/docs/classes/line.THREE_LineSegments2.html +1 -1
  31. package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
  32. package/docs/classes/vfx.Airflow.html +1 -1
  33. package/docs/classes/vfx.Flame.html +1 -1
  34. package/docs/classes/vfx.Particle.html +1 -1
  35. package/docs/classes/vfx.ParticleGPU.html +19 -0
  36. package/docs/classes/vfx.SpotLight.html +1 -1
  37. package/docs/functions/five.createDebugBoundingMesh.html +1 -1
  38. package/docs/functions/five.isBoundingVolume.html +1 -1
  39. package/docs/functions/five.makeBoundingVolume.html +1 -1
  40. package/docs/hierarchy.html +1 -1
  41. package/docs/interfaces/five.AddableObject.html +1 -1
  42. package/docs/interfaces/five.BaseEvent.html +1 -1
  43. package/docs/interfaces/five.BoundingVolume.html +2 -2
  44. package/docs/interfaces/five.BoxBoundingVolume.html +2 -2
  45. package/docs/interfaces/five.EventCallback.html +1 -1
  46. package/docs/interfaces/five.GestureEvent.html +1 -1
  47. package/docs/interfaces/five.ImageOptions.html +1 -1
  48. package/docs/interfaces/five.IntersectEvent.html +1 -1
  49. package/docs/interfaces/five.IntersectMesh.html +1 -1
  50. package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
  51. package/docs/interfaces/five.Intersection.html +6 -3
  52. package/docs/interfaces/five.LooseWorkPanorama.html +1 -1
  53. package/docs/interfaces/five.LooseWorkWithExtrinsics.html +1 -1
  54. package/docs/interfaces/five.ModeChangeEvent.html +1 -1
  55. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
  56. package/docs/interfaces/five.ModelEvent.html +1 -1
  57. package/docs/interfaces/five.ModelLike.html +2 -2
  58. package/docs/interfaces/five.ModelSceneEvent.html +1 -1
  59. package/docs/interfaces/five.MovePanoOptions.html +1 -1
  60. package/docs/interfaces/five.NetworkResourceEvent.html +1 -1
  61. package/docs/interfaces/five.ObjectEvent.html +1 -1
  62. package/docs/interfaces/five.PBMMaterial.html +1 -1
  63. package/docs/interfaces/five.PBMMeshMaterialParameters.html +1 -1
  64. package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +1 -1
  65. package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
  66. package/docs/interfaces/five.PanoEvent.html +1 -1
  67. package/docs/interfaces/five.PanoTextureEvent.html +1 -1
  68. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
  69. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
  70. package/docs/interfaces/five.ParameterMaterialValue.html +1 -1
  71. package/docs/interfaces/five.ParameterTilesetValue.html +1 -1
  72. package/docs/interfaces/five.ParameterValue.html +1 -1
  73. package/docs/interfaces/five.Pose.html +1 -1
  74. package/docs/interfaces/five.RegionBoundingVolume.html +2 -2
  75. package/docs/interfaces/five.RenderEvent.html +1 -1
  76. package/docs/interfaces/five.ResolvedParameterValue.html +1 -1
  77. package/docs/interfaces/five.SphereBoundingVolume.html +2 -2
  78. package/docs/interfaces/five.State.html +1 -1
  79. package/docs/interfaces/five.StateEvent.html +1 -1
  80. package/docs/interfaces/five.TextureOptions.html +1 -1
  81. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +1 -1
  82. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
  83. package/docs/interfaces/five.ViewLayer.html +21 -21
  84. package/docs/interfaces/five.WorkCubeImage.html +1 -1
  85. package/docs/interfaces/five.WorkImage.html +1 -1
  86. package/docs/interfaces/five.WorkObserver.html +1 -1
  87. package/docs/interfaces/five.WorkTile.html +1 -1
  88. package/docs/interfaces/five.WorksEvent.html +1 -1
  89. package/docs/interfaces/five.XRControllerEvent.html +1 -1
  90. package/docs/interfaces/five.XRGestureEvent.html +1 -1
  91. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
  92. package/docs/interfaces/five.XRSessionEvent.html +1 -1
  93. package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
  94. package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
  95. package/docs/interfaces/plugins.ItemMaskController.html +1 -1
  96. package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
  97. package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
  98. package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
  99. package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
  100. package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
  101. package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
  102. package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
  103. package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
  104. package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
  105. package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
  106. package/docs/interfaces/plugins.TrajectoryController.html +1 -1
  107. package/docs/interfaces/react.FiveInjectionTypes.html +4 -5
  108. package/docs/interfaces/vfx.ParticleGPUArgs.html +60 -0
  109. package/docs/interfaces/vfx.ParticleGPUTweenKeyframe.html +3 -0
  110. package/docs/modules/vfx.html +1 -1
  111. package/docs/types/five.Models.html +4 -4
  112. package/docs/types/five.ParseOptions.html +1 -1
  113. package/docs/types/vfx.ParticleGPUType.html +1 -0
  114. package/five/index.d.ts +16 -12
  115. package/five/index.js +50 -50
  116. package/five/index.mjs +4441 -4423
  117. package/gltf-loader/index.js +3 -3
  118. package/gltf-loader/index.mjs +3 -3
  119. package/line/index.js +3 -3
  120. package/line/index.mjs +3 -3
  121. package/package.json +1 -1
  122. package/plugins/index.js +2 -2
  123. package/plugins/index.mjs +2 -2
  124. package/react/index.js +2 -2
  125. package/react/index.mjs +2 -2
  126. package/shader-lib/index.js +2 -2
  127. package/shader-lib/index.mjs +2 -2
  128. package/sticker/index.js +3 -3
  129. package/sticker/index.mjs +3 -3
  130. package/umd/five-gltf-loader.js +3 -3
  131. package/umd/five-line.js +3 -3
  132. package/umd/five-plugins.js +2 -2
  133. package/umd/five-react.js +2 -2
  134. package/umd/five-shader-lib.js +2 -2
  135. package/umd/five-sticker.js +3 -3
  136. package/umd/five-vfx.js +126 -19
  137. package/umd/five-vue.js +2 -2
  138. package/umd/five.js +42 -42
  139. package/vfx/index.d.ts +99 -0
  140. package/vfx/index.js +126 -19
  141. package/vfx/index.mjs +325 -119
  142. package/vue/index.js +2 -2
  143. package/vue/index.mjs +2 -2
  144. package/work-downloader/index.js +3 -3
  145. package/work-downloader/index.mjs +89 -82
package/vue/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2025/8/15
5
- * Version: 6.6.0-alpha.2
4
+ * Generated: 2025/8/18
5
+ * Version: 6.6.0-alpha.4
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
package/vue/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2025/8/15
5
- * Version: 6.6.0-alpha.2
4
+ * Generated: 2025/8/18
5
+ * Version: 6.6.0-alpha.4
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2025/8/15
5
- * Version: 6.6.0-alpha.2
4
+ * Generated: 2025/8/18
5
+ * Version: 6.6.0-alpha.4
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("node:fs"),$=require("node:fs/promises"),y=require("node:path"),H=require("node:stream"),K=require("sharp");function P(n,e,r,i){function a(t){return t instanceof r?t:new r(function(o){o(t)})}return new(r||(r=Promise))(function(t,o){function u(c){try{s(i.next(c))}catch(f){o(f)}}function l(c){try{s(i.throw(c))}catch(f){o(f)}}function s(c){c.done?t(c.value):a(c.value).then(u,l)}s((i=i.apply(n,e||[])).next())})}function k(n,e){var r={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},i,a,t,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(s){return function(c){return l([s,c])}}function l(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(r=0)),r;)try{if(i=1,a&&(t=s[0]&2?a.return:s[0]?a.throw||((t=a.return)&&t.call(a),0):a.next)&&!(t=t.call(a,s[1])).done)return t;switch(a=0,t&&(s=[s[0]&2,t.value]),s[0]){case 0:case 1:t=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,a=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(t=r.trys,!(t=t.length>0&&t[t.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!t||s[1]>t[0]&&s[1]<t[3])){r.label=s[1];break}if(s[0]===6&&r.label<t[1]){r.label=t[1],t=s;break}if(t&&r.label<t[2]){r.label=t[2],r.ops.push(s);break}t[2]&&r.ops.pop(),r.trys.pop();continue}s=e.call(n,r)}catch(c){s=[6,c],a=0}finally{i=t=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function L(n,e){if(e&&e[e.length-1]!=="/"&&(e+="/"),n.length>e.length&&n.startsWith(e))return n.slice(e.length);throw new Error("".concat(n," is not starting with ").concat(e))}function Q(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var r=[];n=n.map(function(u){return(u!=null?u:"").trim()}).filter(function(u){return u.length>0&&!/^\/+$/.test(u)});for(var i=0;i<n.length;i++){var a=i===0,t=i===n.length-1,o=n[i];a||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),t||(o=o.replace(/\/+$/,"")),r.push(o)}return r.join("/")}var V=1024*1024*5;function F(n,e,r){return P(this,void 0,void 0,function(){var i,a,t,o;return k(this,function(u){switch(u.label){case 0:return I.existsSync(e)?[2,e]:[4,r(n)];case 1:return i=u.sent(),i.ok&&i.body?[4,$.mkdir(y.dirname(e),{recursive:!0})]:[3,6];case 2:return u.sent(),a=Number((o=i.headers.get("content-length"))!==null&&o!==void 0?o:"Infinity"),a>V?[2,new Promise(function(l,s){var c=H.Readable.fromWeb(i.body),f=I.createWriteStream(e);c.pipe(f),c.on("error",s),f.on("finish",function(){return l(e)})})]:[3,3];case 3:return[4,i.arrayBuffer()];case 4:return t=u.sent(),[4,$.writeFile(e,Buffer.from(t))];case 5:return u.sent(),[2,e];case 6:throw new Error("url: ".concat(n,"(").concat(i.statusText,")"))}})})}function M(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o,u,l,s,c,f;return k(this,function(d){return r=y.extname(n).slice(1)||"jpg",i=e.cut,a=e.size,t=e.format,o=t===void 0?r:t,u=K(n),i&&(u=u.extract({left:i[0],top:i[1],width:i[2],height:i[3]})),a&&(u=u.resize(a)),o&&(u=u.toFormat(o)),l="",e.toFilename?l=e.toFilename(n,{cut:e.cut,size:e.size,format:e.format}):(s="",c="",f=o,i&&(s=i.join("x")),a&&(c="".concat(a,"x")),f===r&&!c&&!s&&(f=""),l=[n,s,c,f].filter(function(h){return h.length>0}).join(".")),l!==n&&!I.existsSync(l)?[2,u.toFile(l).then(function(){return l})]:[2,l]})})}function G(n){var e=[];if(n.content&&(n.content.uri?e.push(n.content.uri):n.content.url&&e.push(n.content.url)),n.children)for(var r=0,i=n.children;r<i.length;r++){var a=i[r],t=G(a);t.length>0&&e.push.apply(e,t)}return e}function Y(n,e,r){return P(this,void 0,void 0,function(){var i,a,t;return k(this,function(o){switch(o.label){case 0:return i=new URL(n,e).href,a=y.join(r.distPath,L(i,r.baseURL)),t=F(i,a,r.fetch),r.log(function(u){return"download: ".concat(i," -> ").concat(u)},t),[4,t];case 1:return o.sent(),/\.json$/.test(n)?[4,X(i,r)]:[3,3];case 2:o.sent(),o.label=3;case 3:return[2]}})})}function X(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o,u,l,s,c,f,d,h,g,v,p,m,w,U;return k(this,function(b){switch(b.label){case 0:return r=y.join(e.distPath,L(n,e.baseURL)),i=F(n,r,e.fetch),e.log(function(j){return"download: ".concat(n," -> ").concat(j)},i),[4,i];case 1:return b.sent(),o=(t=JSON).parse,[4,$.readFile(r,"utf8")];case 2:return a=o.apply(t,[b.sent()]),a.asset.overview?(u=new URL(a.asset.overview.imageFile,n).href,l=y.join(e.distPath,L(u,e.baseURL)),s=F(u,l,e.fetch),e.log(function(j){return"download: ".concat(u," -> ").concat(j)},s),[4,s]):[3,4];case 3:b.sent(),b.label=4;case 4:if(!a.asset.trajectories)return[3,8];c=function(j){var R,O,z;return k(this,function(S){switch(S.label){case 0:return R=new URL(j.file,n).href,O=y.join(e.distPath,L(R,e.baseURL)),z=F(R,O,e.fetch),e.log(function(_){return"download: ".concat(R," -> ").concat(_)},z),[4,z];case 1:return S.sent(),[2]}})},f=0,d=a.asset.trajectories.list,b.label=5;case 5:return f<d.length?(h=d[f],[5,c(h)]):[3,8];case 6:b.sent(),b.label=7;case 7:return f++,[3,5];case 8:for(g=G(a.root),v=[],p=0,m=g;p<m.length;p++)w=m[p],U=Y(w,n,e),v.push(U);return[4,Promise.all(v)];case 9:return b.sent(),[2]}})})}function Z(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o,m,u,l,s,c,f,d,h,g,v,p,m;return k(this,function(w){switch(w.label){case 0:return e.log("process model"),n.model?(r=n.model,i=r.textures,a=r.layers,t=r.file,o=r.textureBase,t?(e.log("process model file"),m=n.getURL(t),u=y.join(e.distPath,L(m,e.baseURL)),l=F(m,u,e.fetch),e.log(function(U){return"download: ".concat(t," -> ").concat(U)},l),[4,l]):[3,5]):[3,9];case 1:if(w.sent(),!i)return[3,5];s=function(U){var b,j,R,O,z,S,_,q,W,N,B,A,J;return k(this,function(C){switch(C.label){case 0:return b=Q(n.getURL(o!=null?o:""),U),j=y.join(e.distPath,L(b,e.baseURL)),R=F(b,j,e.fetch),e.log(function(D){return"download: ".concat(b," -> ").concat(D)},R),[4,R];case 1:for(C.sent(),O=e.imageOptions.format,O.length===0&&O.push(void 0),z=e.imageOptions.size,z.length===0&&z.push(void 0),S=[],_=0,q=O;_<q.length;_++)for(W=q[_],N=0,B=z;N<B.length;N++)A=B[N],J=M(j,{format:W,size:A,toFilename:e.imageProcessingFilename}),e.log(function(D){return"imageProcessing: ".concat(j," -> ").concat(D)},J),S.push(J);return[4,Promise.all(S)];case 2:return C.sent(),[2]}})},c=0,f=i,w.label=2;case 2:return c<f.length?(d=f[c],[5,s(d)]):[3,5];case 3:w.sent(),w.label=4;case 4:return c++,[3,2];case 5:if(!a)return[3,9];h=0,g=a,w.label=6;case 6:return h<g.length?(v=g[h],p=v.tileset,e.log("process model layer"),m=n.getURL(p),[4,X(m,e)]):[3,9];case 7:w.sent(),w.label=8;case 8:return h++,[3,6];case 9:return[2]}})})}function T(n,e,r){return P(this,void 0,void 0,function(){var i,a,t,o,u,l,s,c,f,d,h,g,v;return k(this,function(p){switch(p.label){case 0:return i=y.join(r.distPath,L(n,r.baseURL)),a=F(n,i,r.fetch),r.log(function(m){return"download: ".concat(n," -> ").concat(m)},a),[4,a];case 1:if(p.sent(),t=Math.pow(2,e.level),o=r.imageOptions.format,o.length===0&&o.push(void 0),u=[],t>1)for(l=0;l<t;l++)for(s=0;s<t;s++)for(c=0,f=o;c<f.length;c++)d=f[c],h=[e.size/t*s,e.size/t*l,e.size/t,e.size/t],g=e.scale>=1?void 0:e.scale*e.size/t,e.level===1&&e.scale>=.5&&(d==="jpg"||/\.jpg$/.test(i))&&(g=void 0),v=M(i,{format:d,size:g,cut:h,toFilename:r.imageProcessingFilename}),r.log(function(m){return"imageProcessing: ".concat(i," -> ").concat(m)},v),u.push(v);return[4,Promise.all(u)];case 2:return p.sent(),[2]}})})}function x(n,e){return P(this,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:return[4,Promise.all([T(n.work.getURL(n.front),n,e),T(n.work.getURL(n.back),n,e),T(n.work.getURL(n.left),n,e),T(n.work.getURL(n.right),n,e),T(n.work.getURL(n.up),n,e),T(n.work.getURL(n.down),n,e)])];case 1:return r.sent(),[2]}})})}function E(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o,u,l,s,c,f,d,h;return k(this,function(g){switch(g.label){case 0:return r=y.join(e.distPath,L(n,e.baseURL)),i=F(n,r,e.fetch),e.log(function(v){return"download: ".concat(n," -> ").concat(v)},i),[4,i];case 1:for(g.sent(),a=e.imageOptions.format,a.length===0&&a.push(void 0),t=e.imageOptions.size,t.length===0&&t.push(void 0),o=[],u=0,l=a;u<l.length;u++)for(s=l[u],c=0,f=t;c<f.length;c++)d=f[c],h=M(r,{format:s,size:d,toFilename:e.imageProcessingFilename}),e.log(function(v){return"imageProcessing: ".concat(r," -> ").concat(v)},h),o.push(h);return[4,Promise.all(o)];case 2:return g.sent(),[2]}})})}function ee(n,e){return P(this,void 0,void 0,function(){var r;return k(this,function(i){switch(i.label){case 0:return r=n.images,[4,Promise.all([E(r.work.getURL(r.front),e),E(r.work.getURL(r.back),e),E(r.work.getURL(r.left),e),E(r.work.getURL(r.right),e),E(r.work.getURL(r.up),e),E(r.work.getURL(r.down),e)])];case 1:return i.sent(),r.tiles?[4,Promise.all(r.tiles.map(function(a){return x(a,e)}))]:[3,3];case 2:i.sent(),i.label=3;case 3:return[2]}})})}function re(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o;return k(this,function(u){switch(u.label){case 0:r=n.observers,i=0,a=r,u.label=1;case 1:return i<a.length?(t=a[i],o=ee(t,e),e.log("process observer #".concat(t.index," derived: ").concat(t.derivedIdStr),o),[4,o]):[3,4];case 2:u.sent(),u.label=3;case 3:return i++,[3,1];case 4:return[2]}})})}function ne(n,e){if(e){var r=Date.now();e.then(function(a){var t=Date.now()-r,o=typeof n=="function"?n(a):n;console.log(o+"(".concat(t,"ms)"))}).catch(function(){})}else{var i=typeof n=="function"?n(null):n;console.log(i)}}function te(n){return P(this,arguments,void 0,function(e,r){var i,a,t,o,u,l,s,c,f,d,h,g,v,p,m;return r===void 0&&(r={}),k(this,function(w){switch(w.label){case 0:if(i=e.baseURL,a="",r.distPath)a=y.resolve(process.cwd(),r.distPath);else for(a=y.resolve(process.cwd(),(l=e.workCode)!==null&&l!==void 0?l:"work-".concat(Date.now()));I.existsSync(a);)/.-(\d+)$/.test(a)?a=a.replace(/.-(\d+)$/,function(U,b){return"-"+(Number(b)+1)}):a=a+"-1";return t={baseURL:i,distPath:a,fetch:(s=r.fetch)!==null&&s!==void 0?s:fetch,imageOptions:{size:(f=(c=r.imageOptions)===null||c===void 0?void 0:c.size)!==null&&f!==void 0?f:[],format:(h=(d=r.imageOptions)===null||d===void 0?void 0:d.format)!==null&&h!==void 0?h:[]},textureOptions:{size:(v=(g=r.textureOptions)===null||g===void 0?void 0:g.size)!==null&&v!==void 0?v:[],format:(m=(p=r.textureOptions)===null||p===void 0?void 0:p.format)!==null&&m!==void 0?m:[]},log:r.log?ne:(function(){return Promise.resolve()}),imageProcessingFilename:r.imageProcessingFilename},t.log(JSON.stringify(t,null," ")),[4,$.mkdir(a,{recursive:!0})];case 1:return w.sent(),o="work.json",u=y.resolve(a,o),[4,$.writeFile(u,JSON.stringify(e.toJSON(),null," "))];case 2:return w.sent(),[4,re(e,t)];case 3:return w.sent(),[4,Z(e,t)];case 4:return w.sent(),[2]}})})}exports.download=te;
255
+ */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("node:fs"),N=require("node:fs/promises"),y=require("node:path"),H=require("node:stream"),K=require("sharp");function P(n,e,r,i){function a(t){return t instanceof r?t:new r(function(o){o(t)})}return new(r||(r=Promise))(function(t,o){function u(c){try{s(i.next(c))}catch(f){o(f)}}function l(c){try{s(i.throw(c))}catch(f){o(f)}}function s(c){c.done?t(c.value):a(c.value).then(u,l)}s((i=i.apply(n,e||[])).next())})}function k(n,e){var r={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},i,a,t,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(s){return function(c){return l([s,c])}}function l(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(r=0)),r;)try{if(i=1,a&&(t=s[0]&2?a.return:s[0]?a.throw||((t=a.return)&&t.call(a),0):a.next)&&!(t=t.call(a,s[1])).done)return t;switch(a=0,t&&(s=[s[0]&2,t.value]),s[0]){case 0:case 1:t=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,a=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(t=r.trys,!(t=t.length>0&&t[t.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!t||s[1]>t[0]&&s[1]<t[3])){r.label=s[1];break}if(s[0]===6&&r.label<t[1]){r.label=t[1],t=s;break}if(t&&r.label<t[2]){r.label=t[2],r.ops.push(s);break}t[2]&&r.ops.pop(),r.trys.pop();continue}s=e.call(n,r)}catch(c){s=[6,c],a=0}finally{i=t=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function F(n,e){if(e&&e[e.length-1]!=="/"&&(e+="/"),n.length>e.length&&n.startsWith(e))return n.slice(e.length);throw new Error("".concat(n," is not starting with ").concat(e))}function Q(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var r=[];n=n.map(function(u){return(u!=null?u:"").trim()}).filter(function(u){return u.length>0&&!/^\/+$/.test(u)});for(var i=0;i<n.length;i++){var a=i===0,t=i===n.length-1,o=n[i];a||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),t||(o=o.replace(/\/+$/,"")),r.push(o)}return r.join("/")}var V=1024*1024*5;function U(n,e,r){return P(this,void 0,void 0,function(){var i,a,t,o;return k(this,function(u){switch(u.label){case 0:return q.existsSync(e)?[2,e]:[4,r(n)];case 1:return i=u.sent(),i.ok&&i.body?[4,N.mkdir(y.dirname(e),{recursive:!0})]:[3,6];case 2:return u.sent(),a=Number((o=i.headers.get("content-length"))!==null&&o!==void 0?o:"Infinity"),a>V?[2,new Promise(function(l,s){var c=H.Readable.fromWeb(i.body),f=q.createWriteStream(e);c.pipe(f),c.on("error",s),f.on("finish",function(){return l(e)})})]:[3,3];case 3:return[4,i.arrayBuffer()];case 4:return t=u.sent(),[4,N.writeFile(e,Buffer.from(t))];case 5:return u.sent(),[2,e];case 6:throw new Error("url: ".concat(n,"(").concat(i.statusText,")"))}})})}function M(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o,u,l,s,c,f;return k(this,function(v){return r=y.extname(n).slice(1)||"jpg",i=e.cut,a=e.size,t=e.format,o=t===void 0?r:t,u=K(n),i&&(u=u.extract({left:i[0],top:i[1],width:i[2],height:i[3]})),a&&(u=u.resize(a)),o&&(u=u.toFormat(o)),l="",e.toFilename?l=e.toFilename(n,{cut:e.cut,size:e.size,format:e.format}):(s="",c="",f=o,i&&(s=i.join("x")),a&&(c="".concat(a,"x")),f===r&&!c&&!s&&(f=""),l=[n,s,c,f].filter(function(h){return h.length>0}).join(".")),l!==n&&!q.existsSync(l)?[2,u.toFile(l).then(function(){return l})]:[2,l]})})}function G(n){var e=[];if(n.content&&(n.content.uri?e.push(n.content.uri):n.content.url&&e.push(n.content.url)),n.children)for(var r=0,i=n.children;r<i.length;r++){var a=i[r],t=G(a);t.length>0&&e.push.apply(e,t)}return e}function Y(n,e,r){return P(this,void 0,void 0,function(){var i,a,t;return k(this,function(o){switch(o.label){case 0:return i=new URL(n,e).href,a=y.join(r.distPath,F(i,r.baseURL)),t=U(i,a,r.fetch),r.log(function(u){return"download: ".concat(i," -> ").concat(u)},t),[4,t];case 1:return o.sent(),/\.json$/.test(n)?[4,X(i,r)]:[3,3];case 2:o.sent(),o.label=3;case 3:return[2]}})})}function X(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o,u,l,s,c,f,v,h,d,m,p,w,g,L,j;return k(this,function(b){switch(b.label){case 0:return r=y.join(e.distPath,F(n,e.baseURL)),i=U(n,r,e.fetch),e.log(function(R){return"download: ".concat(n," -> ").concat(R)},i),[4,i];case 1:return b.sent(),o=(t=JSON).parse,[4,N.readFile(r,"utf8")];case 2:return a=o.apply(t,[b.sent()]),a.asset.overview?(u=new URL(a.asset.overview.imageFile,n).href,l=y.join(e.distPath,F(u,e.baseURL)),s=U(u,l,e.fetch),e.log(function(R){return"download: ".concat(u," -> ").concat(R)},s),[4,s]):[3,4];case 3:b.sent(),b.label=4;case 4:if(!a.asset.trajectories)return[3,8];c=function(R){var z,O,S;return k(this,function(_){switch(_.label){case 0:return z=new URL(R.file,n).href,O=y.join(e.distPath,F(z,e.baseURL)),S=U(z,O,e.fetch),e.log(function($){return"download: ".concat(z," -> ").concat($)},S),[4,S];case 1:return _.sent(),[2]}})},f=0,v=a.asset.trajectories.list,b.label=5;case 5:return f<v.length?(h=v[f],[5,c(h)]):[3,8];case 6:b.sent(),b.label=7;case 7:return f++,[3,5];case 8:d=G(a.root),m=6,p=0,b.label=9;case 9:if(!(p<d.length))return[3,12];for(w=[],g=0;g<m;g++)L=d[p+g],L&&(j=Y(L,n,e),w.push(j));return[4,Promise.all(w)];case 10:b.sent(),b.label=11;case 11:return p+=m,[3,9];case 12:return[2]}})})}function Z(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o,w,u,l,s,c,f,v,h,d,m,p,w;return k(this,function(g){switch(g.label){case 0:return e.log("process model"),n.model?(r=n.model,i=r.textures,a=r.layers,t=r.file,o=r.textureBase,t?(e.log("process model file"),w=n.getURL(t),u=y.join(e.distPath,F(w,e.baseURL)),l=U(w,u,e.fetch),e.log(function(L){return"download: ".concat(t," -> ").concat(L)},l),[4,l]):[3,5]):[3,9];case 1:if(g.sent(),!i)return[3,5];s=function(L){var j,b,R,z,O,S,_,$,W,I,B,A,C;return k(this,function(J){switch(J.label){case 0:return j=Q(n.getURL(o!=null?o:""),L),b=y.join(e.distPath,F(j,e.baseURL)),R=U(j,b,e.fetch),e.log(function(D){return"download: ".concat(j," -> ").concat(D)},R),[4,R];case 1:for(J.sent(),z=e.imageOptions.format,z.length===0&&z.push(void 0),O=e.imageOptions.size,O.length===0&&O.push(void 0),S=[],_=0,$=z;_<$.length;_++)for(W=$[_],I=0,B=O;I<B.length;I++)A=B[I],C=M(b,{format:W,size:A,toFilename:e.imageProcessingFilename}),e.log(function(D){return"imageProcessing: ".concat(b," -> ").concat(D)},C),S.push(C);return[4,Promise.all(S)];case 2:return J.sent(),[2]}})},c=0,f=i,g.label=2;case 2:return c<f.length?(v=f[c],[5,s(v)]):[3,5];case 3:g.sent(),g.label=4;case 4:return c++,[3,2];case 5:if(!a)return[3,9];h=0,d=a,g.label=6;case 6:return h<d.length?(m=d[h],p=m.tileset,e.log("process model layer"),w=n.getURL(p),[4,X(w,e)]):[3,9];case 7:g.sent(),g.label=8;case 8:return h++,[3,6];case 9:return[2]}})})}function T(n,e,r){return P(this,void 0,void 0,function(){var i,a,t,o,u,l,s,c,f,v,h,d,m;return k(this,function(p){switch(p.label){case 0:return i=y.join(r.distPath,F(n,r.baseURL)),a=U(n,i,r.fetch),r.log(function(w){return"download: ".concat(n," -> ").concat(w)},a),[4,a];case 1:if(p.sent(),t=Math.pow(2,e.level),o=r.imageOptions.format,o.length===0&&o.push(void 0),u=[],t>1)for(l=0;l<t;l++)for(s=0;s<t;s++)for(c=0,f=o;c<f.length;c++)v=f[c],h=[e.size/t*s,e.size/t*l,e.size/t,e.size/t],d=e.scale>=1?void 0:e.scale*e.size/t,e.level===1&&e.scale>=.5&&(v==="jpg"||/\.jpg$/.test(i))&&(d=void 0),m=M(i,{format:v,size:d,cut:h,toFilename:r.imageProcessingFilename}),r.log(function(w){return"imageProcessing: ".concat(i," -> ").concat(w)},m),u.push(m);return[4,Promise.all(u)];case 2:return p.sent(),[2]}})})}function x(n,e){return P(this,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:return[4,Promise.all([T(n.work.getURL(n.front),n,e),T(n.work.getURL(n.back),n,e),T(n.work.getURL(n.left),n,e),T(n.work.getURL(n.right),n,e),T(n.work.getURL(n.up),n,e),T(n.work.getURL(n.down),n,e)])];case 1:return r.sent(),[2]}})})}function E(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o,u,l,s,c,f,v,h;return k(this,function(d){switch(d.label){case 0:return r=y.join(e.distPath,F(n,e.baseURL)),i=U(n,r,e.fetch),e.log(function(m){return"download: ".concat(n," -> ").concat(m)},i),[4,i];case 1:for(d.sent(),a=e.imageOptions.format,a.length===0&&a.push(void 0),t=e.imageOptions.size,t.length===0&&t.push(void 0),o=[],u=0,l=a;u<l.length;u++)for(s=l[u],c=0,f=t;c<f.length;c++)v=f[c],h=M(r,{format:s,size:v,toFilename:e.imageProcessingFilename}),e.log(function(m){return"imageProcessing: ".concat(r," -> ").concat(m)},h),o.push(h);return[4,Promise.all(o)];case 2:return d.sent(),[2]}})})}function ee(n,e){return P(this,void 0,void 0,function(){var r;return k(this,function(i){switch(i.label){case 0:return r=n.images,[4,Promise.all([E(r.work.getURL(r.front),e),E(r.work.getURL(r.back),e),E(r.work.getURL(r.left),e),E(r.work.getURL(r.right),e),E(r.work.getURL(r.up),e),E(r.work.getURL(r.down),e)])];case 1:return i.sent(),r.tiles?[4,Promise.all(r.tiles.map(function(a){return x(a,e)}))]:[3,3];case 2:i.sent(),i.label=3;case 3:return[2]}})})}function re(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o;return k(this,function(u){switch(u.label){case 0:r=n.observers,i=0,a=r,u.label=1;case 1:return i<a.length?(t=a[i],o=ee(t,e),e.log("process observer #".concat(t.index," derived: ").concat(t.derivedIdStr),o),[4,o]):[3,4];case 2:u.sent(),u.label=3;case 3:return i++,[3,1];case 4:return[2]}})})}function ne(n,e){if(e){var r=Date.now();e.then(function(a){var t=Date.now()-r,o=typeof n=="function"?n(a):n;console.log(o+"(".concat(t,"ms)"))}).catch(function(){})}else{var i=typeof n=="function"?n(null):n;console.log(i)}}function te(n){return P(this,arguments,void 0,function(e,r){var i,a,t,o,u,l,s,c,f,v,h,d,m,p,w;return r===void 0&&(r={}),k(this,function(g){switch(g.label){case 0:if(i=e.baseURL,a="",r.distPath)a=y.resolve(process.cwd(),r.distPath);else for(a=y.resolve(process.cwd(),(l=e.workCode)!==null&&l!==void 0?l:"work-".concat(Date.now()));q.existsSync(a);)/.-(\d+)$/.test(a)?a=a.replace(/.-(\d+)$/,function(L,j){return"-"+(Number(j)+1)}):a=a+"-1";return t={baseURL:i,distPath:a,fetch:(s=r.fetch)!==null&&s!==void 0?s:fetch,imageOptions:{size:(f=(c=r.imageOptions)===null||c===void 0?void 0:c.size)!==null&&f!==void 0?f:[],format:(h=(v=r.imageOptions)===null||v===void 0?void 0:v.format)!==null&&h!==void 0?h:[]},textureOptions:{size:(m=(d=r.textureOptions)===null||d===void 0?void 0:d.size)!==null&&m!==void 0?m:[],format:(w=(p=r.textureOptions)===null||p===void 0?void 0:p.format)!==null&&w!==void 0?w:[]},log:r.log?ne:(function(){return Promise.resolve()}),imageProcessingFilename:r.imageProcessingFilename},t.log(JSON.stringify(t,null," ")),[4,N.mkdir(a,{recursive:!0})];case 1:return g.sent(),o="work.json",u=y.resolve(a,o),[4,N.writeFile(u,JSON.stringify(e.toJSON(),null," "))];case 2:return g.sent(),[4,re(e,t)];case 3:return g.sent(),[4,Z(e,t)];case 4:return g.sent(),[2]}})})}exports.download=te;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2025/8/15
5
- * Version: 6.6.0-alpha.2
4
+ * Generated: 2025/8/18
5
+ * Version: 6.6.0-alpha.4
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -254,7 +254,7 @@
254
254
  * Agreement and all related documents shall be drafted in English.
255
255
  */import { createWriteStream as Q, existsSync as W } from "node:fs";
256
256
  import { writeFile as X, mkdir as q, readFile as V } from "node:fs/promises";
257
- import { dirname as Y, extname as Z, join as L, resolve as D } from "node:path";
257
+ import { dirname as Y, extname as Z, join as U, resolve as D } from "node:path";
258
258
  import { Readable as x } from "node:stream";
259
259
  import ee from "sharp";
260
260
  function k(n, e, r, a) {
@@ -344,7 +344,7 @@ function y(n, e) {
344
344
  return { value: s[0] ? s[1] : void 0, done: !0 };
345
345
  }
346
346
  }
347
- function U(n, e) {
347
+ function F(n, e) {
348
348
  if (e && e[e.length - 1] !== "/" && (e += "/"), n.length > e.length && n.startsWith(e))
349
349
  return n.slice(e.length);
350
350
  throw new Error("".concat(n, " is not starting with ").concat(e));
@@ -365,7 +365,7 @@ function re() {
365
365
  return r.join("/");
366
366
  }
367
367
  var ne = 1024 * 1024 * 5;
368
- function F(n, e, r) {
368
+ function O(n, e, r) {
369
369
  return k(this, void 0, void 0, function() {
370
370
  var a, i, t, o;
371
371
  return y(this, function(u) {
@@ -396,7 +396,7 @@ function F(n, e, r) {
396
396
  function M(n, e) {
397
397
  return k(this, void 0, void 0, function() {
398
398
  var r, a, i, t, o, u, f, s, c, l;
399
- return y(this, function(d) {
399
+ return y(this, function(v) {
400
400
  return r = Z(n).slice(1) || "jpg", a = e.cut, i = e.size, t = e.format, o = t === void 0 ? r : t, u = ee(n), a && (u = u.extract({
401
401
  left: a[0],
402
402
  top: a[1],
@@ -425,7 +425,7 @@ function te(n, e, r) {
425
425
  return y(this, function(o) {
426
426
  switch (o.label) {
427
427
  case 0:
428
- return a = new URL(n, e).href, i = L(r.distPath, U(a, r.baseURL)), t = F(a, i, r.fetch), r.log(function(u) {
428
+ return a = new URL(n, e).href, i = U(r.distPath, F(a, r.baseURL)), t = O(a, i, r.fetch), r.log(function(u) {
429
429
  return "download: ".concat(a, " -> ").concat(u);
430
430
  }, t), [4, t];
431
431
  case 1:
@@ -443,31 +443,31 @@ function te(n, e, r) {
443
443
  }
444
444
  function K(n, e) {
445
445
  return k(this, void 0, void 0, function() {
446
- var r, a, i, t, o, u, f, s, c, l, d, h, g, v, p, m, w, O;
446
+ var r, a, i, t, o, u, f, s, c, l, v, h, d, m, p, w, g, L, P;
447
447
  return y(this, function(b) {
448
448
  switch (b.label) {
449
449
  case 0:
450
- return r = L(e.distPath, U(n, e.baseURL)), a = F(n, r, e.fetch), e.log(function(P) {
451
- return "download: ".concat(n, " -> ").concat(P);
450
+ return r = U(e.distPath, F(n, e.baseURL)), a = O(n, r, e.fetch), e.log(function(R) {
451
+ return "download: ".concat(n, " -> ").concat(R);
452
452
  }, a), [4, a];
453
453
  case 1:
454
454
  return b.sent(), o = (t = JSON).parse, [4, V(r, "utf8")];
455
455
  case 2:
456
- return i = o.apply(t, [b.sent()]), i.asset.overview ? (u = new URL(i.asset.overview.imageFile, n).href, f = L(e.distPath, U(u, e.baseURL)), s = F(u, f, e.fetch), e.log(function(P) {
457
- return "download: ".concat(u, " -> ").concat(P);
456
+ return i = o.apply(t, [b.sent()]), i.asset.overview ? (u = new URL(i.asset.overview.imageFile, n).href, f = U(e.distPath, F(u, e.baseURL)), s = O(u, f, e.fetch), e.log(function(R) {
457
+ return "download: ".concat(u, " -> ").concat(R);
458
458
  }, s), [4, s]) : [3, 4];
459
459
  case 3:
460
460
  b.sent(), b.label = 4;
461
461
  case 4:
462
462
  if (!i.asset.trajectories) return [3, 8];
463
- c = function(P) {
464
- var R, j, z;
463
+ c = function(R) {
464
+ var z, j, S;
465
465
  return y(this, function(_) {
466
466
  switch (_.label) {
467
467
  case 0:
468
- return R = new URL(P.file, n).href, j = L(e.distPath, U(R, e.baseURL)), z = F(R, j, e.fetch), e.log(function(S) {
469
- return "download: ".concat(R, " -> ").concat(S);
470
- }, z), [4, z];
468
+ return z = new URL(R.file, n).href, j = U(e.distPath, F(z, e.baseURL)), S = O(z, j, e.fetch), e.log(function($) {
469
+ return "download: ".concat(z, " -> ").concat($);
470
+ }, S), [4, S];
471
471
  case 1:
472
472
  return _.sent(), [
473
473
  2
@@ -475,19 +475,26 @@ function K(n, e) {
475
475
  ];
476
476
  }
477
477
  });
478
- }, l = 0, d = i.asset.trajectories.list, b.label = 5;
478
+ }, l = 0, v = i.asset.trajectories.list, b.label = 5;
479
479
  case 5:
480
- return l < d.length ? (h = d[l], [5, c(h)]) : [3, 8];
480
+ return l < v.length ? (h = v[l], [5, c(h)]) : [3, 8];
481
481
  case 6:
482
482
  b.sent(), b.label = 7;
483
483
  case 7:
484
484
  return l++, [3, 5];
485
485
  case 8:
486
- for (g = H(i.root), v = [], p = 0, m = g; p < m.length; p++)
487
- w = m[p], O = te(w, n, e), v.push(O);
488
- return [4, Promise.all(v)];
486
+ d = H(i.root), m = 6, p = 0, b.label = 9;
489
487
  case 9:
490
- return b.sent(), [
488
+ if (!(p < d.length)) return [3, 12];
489
+ for (w = [], g = 0; g < m; g++)
490
+ L = d[p + g], L && (P = te(L, n, e), w.push(P));
491
+ return [4, Promise.all(w)];
492
+ case 10:
493
+ b.sent(), b.label = 11;
494
+ case 11:
495
+ return p += m, [3, 9];
496
+ case 12:
497
+ return [
491
498
  2
492
499
  /*return*/
493
500
  ];
@@ -497,55 +504,55 @@ function K(n, e) {
497
504
  }
498
505
  function ae(n, e) {
499
506
  return k(this, void 0, void 0, function() {
500
- var r, a, i, t, o, m, u, f, s, c, l, d, h, g, v, p, m;
501
- return y(this, function(w) {
502
- switch (w.label) {
507
+ var r, a, i, t, o, w, u, f, s, c, l, v, h, d, m, p, w;
508
+ return y(this, function(g) {
509
+ switch (g.label) {
503
510
  case 0:
504
- return e.log("process model"), n.model ? (r = n.model, a = r.textures, i = r.layers, t = r.file, o = r.textureBase, t ? (e.log("process model file"), m = n.getURL(t), u = L(e.distPath, U(m, e.baseURL)), f = F(m, u, e.fetch), e.log(function(O) {
505
- return "download: ".concat(t, " -> ").concat(O);
511
+ return e.log("process model"), n.model ? (r = n.model, a = r.textures, i = r.layers, t = r.file, o = r.textureBase, t ? (e.log("process model file"), w = n.getURL(t), u = U(e.distPath, F(w, e.baseURL)), f = O(w, u, e.fetch), e.log(function(L) {
512
+ return "download: ".concat(t, " -> ").concat(L);
506
513
  }, f), [4, f]) : [3, 5]) : [3, 9];
507
514
  case 1:
508
- if (w.sent(), !a) return [3, 5];
509
- s = function(O) {
510
- var b, P, R, j, z, _, S, N, A, $, I, G, B;
511
- return y(this, function(J) {
512
- switch (J.label) {
515
+ if (g.sent(), !a) return [3, 5];
516
+ s = function(L) {
517
+ var P, b, R, z, j, S, _, $, A, N, I, G, B;
518
+ return y(this, function(C) {
519
+ switch (C.label) {
513
520
  case 0:
514
- return b = re(n.getURL(o != null ? o : ""), O), P = L(e.distPath, U(b, e.baseURL)), R = F(b, P, e.fetch), e.log(function(C) {
515
- return "download: ".concat(b, " -> ").concat(C);
521
+ return P = re(n.getURL(o != null ? o : ""), L), b = U(e.distPath, F(P, e.baseURL)), R = O(P, b, e.fetch), e.log(function(J) {
522
+ return "download: ".concat(P, " -> ").concat(J);
516
523
  }, R), [4, R];
517
524
  case 1:
518
- for (J.sent(), j = e.imageOptions.format, j.length === 0 && j.push(void 0), z = e.imageOptions.size, z.length === 0 && z.push(void 0), _ = [], S = 0, N = j; S < N.length; S++)
519
- for (A = N[S], $ = 0, I = z; $ < I.length; $++)
520
- G = I[$], B = M(P, {
525
+ for (C.sent(), z = e.imageOptions.format, z.length === 0 && z.push(void 0), j = e.imageOptions.size, j.length === 0 && j.push(void 0), S = [], _ = 0, $ = z; _ < $.length; _++)
526
+ for (A = $[_], N = 0, I = j; N < I.length; N++)
527
+ G = I[N], B = M(b, {
521
528
  format: A,
522
529
  size: G,
523
530
  toFilename: e.imageProcessingFilename
524
- }), e.log(function(C) {
525
- return "imageProcessing: ".concat(P, " -> ").concat(C);
526
- }, B), _.push(B);
527
- return [4, Promise.all(_)];
531
+ }), e.log(function(J) {
532
+ return "imageProcessing: ".concat(b, " -> ").concat(J);
533
+ }, B), S.push(B);
534
+ return [4, Promise.all(S)];
528
535
  case 2:
529
- return J.sent(), [
536
+ return C.sent(), [
530
537
  2
531
538
  /*return*/
532
539
  ];
533
540
  }
534
541
  });
535
- }, c = 0, l = a, w.label = 2;
542
+ }, c = 0, l = a, g.label = 2;
536
543
  case 2:
537
- return c < l.length ? (d = l[c], [5, s(d)]) : [3, 5];
544
+ return c < l.length ? (v = l[c], [5, s(v)]) : [3, 5];
538
545
  case 3:
539
- w.sent(), w.label = 4;
546
+ g.sent(), g.label = 4;
540
547
  case 4:
541
548
  return c++, [3, 2];
542
549
  case 5:
543
550
  if (!i) return [3, 9];
544
- h = 0, g = i, w.label = 6;
551
+ h = 0, d = i, g.label = 6;
545
552
  case 6:
546
- return h < g.length ? (v = g[h], p = v.tileset, e.log("process model layer"), m = n.getURL(p), [4, K(m, e)]) : [3, 9];
553
+ return h < d.length ? (m = d[h], p = m.tileset, e.log("process model layer"), w = n.getURL(p), [4, K(w, e)]) : [3, 9];
547
554
  case 7:
548
- w.sent(), w.label = 8;
555
+ g.sent(), g.label = 8;
549
556
  case 8:
550
557
  return h++, [3, 6];
551
558
  case 9:
@@ -559,31 +566,31 @@ function ae(n, e) {
559
566
  }
560
567
  function E(n, e, r) {
561
568
  return k(this, void 0, void 0, function() {
562
- var a, i, t, o, u, f, s, c, l, d, h, g, v;
569
+ var a, i, t, o, u, f, s, c, l, v, h, d, m;
563
570
  return y(this, function(p) {
564
571
  switch (p.label) {
565
572
  case 0:
566
- return a = L(r.distPath, U(n, r.baseURL)), i = F(n, a, r.fetch), r.log(function(m) {
567
- return "download: ".concat(n, " -> ").concat(m);
573
+ return a = U(r.distPath, F(n, r.baseURL)), i = O(n, a, r.fetch), r.log(function(w) {
574
+ return "download: ".concat(n, " -> ").concat(w);
568
575
  }, i), [4, i];
569
576
  case 1:
570
577
  if (p.sent(), t = Math.pow(2, e.level), o = r.imageOptions.format, o.length === 0 && o.push(void 0), u = [], t > 1)
571
578
  for (f = 0; f < t; f++)
572
579
  for (s = 0; s < t; s++)
573
580
  for (c = 0, l = o; c < l.length; c++)
574
- d = l[c], h = [
581
+ v = l[c], h = [
575
582
  e.size / t * s,
576
583
  e.size / t * f,
577
584
  e.size / t,
578
585
  e.size / t
579
- ], g = e.scale >= 1 ? void 0 : e.scale * e.size / t, e.level === 1 && e.scale >= 0.5 && (d === "jpg" || /\.jpg$/.test(a)) && (g = void 0), v = M(a, {
580
- format: d,
581
- size: g,
586
+ ], d = e.scale >= 1 ? void 0 : e.scale * e.size / t, e.level === 1 && e.scale >= 0.5 && (v === "jpg" || /\.jpg$/.test(a)) && (d = void 0), m = M(a, {
587
+ format: v,
588
+ size: d,
582
589
  cut: h,
583
590
  toFilename: r.imageProcessingFilename
584
- }), r.log(function(m) {
585
- return "imageProcessing: ".concat(a, " -> ").concat(m);
586
- }, v), u.push(v);
591
+ }), r.log(function(w) {
592
+ return "imageProcessing: ".concat(a, " -> ").concat(w);
593
+ }, m), u.push(m);
587
594
  return [4, Promise.all(u)];
588
595
  case 2:
589
596
  return p.sent(), [
@@ -618,26 +625,26 @@ function ie(n, e) {
618
625
  }
619
626
  function T(n, e) {
620
627
  return k(this, void 0, void 0, function() {
621
- var r, a, i, t, o, u, f, s, c, l, d, h;
622
- return y(this, function(g) {
623
- switch (g.label) {
628
+ var r, a, i, t, o, u, f, s, c, l, v, h;
629
+ return y(this, function(d) {
630
+ switch (d.label) {
624
631
  case 0:
625
- return r = L(e.distPath, U(n, e.baseURL)), a = F(n, r, e.fetch), e.log(function(v) {
626
- return "download: ".concat(n, " -> ").concat(v);
632
+ return r = U(e.distPath, F(n, e.baseURL)), a = O(n, r, e.fetch), e.log(function(m) {
633
+ return "download: ".concat(n, " -> ").concat(m);
627
634
  }, a), [4, a];
628
635
  case 1:
629
- for (g.sent(), i = e.imageOptions.format, i.length === 0 && i.push(void 0), t = e.imageOptions.size, t.length === 0 && t.push(void 0), o = [], u = 0, f = i; u < f.length; u++)
636
+ for (d.sent(), i = e.imageOptions.format, i.length === 0 && i.push(void 0), t = e.imageOptions.size, t.length === 0 && t.push(void 0), o = [], u = 0, f = i; u < f.length; u++)
630
637
  for (s = f[u], c = 0, l = t; c < l.length; c++)
631
- d = l[c], h = M(r, {
638
+ v = l[c], h = M(r, {
632
639
  format: s,
633
- size: d,
640
+ size: v,
634
641
  toFilename: e.imageProcessingFilename
635
- }), e.log(function(v) {
636
- return "imageProcessing: ".concat(r, " -> ").concat(v);
642
+ }), e.log(function(m) {
643
+ return "imageProcessing: ".concat(r, " -> ").concat(m);
637
644
  }, h), o.push(h);
638
645
  return [4, Promise.all(o)];
639
646
  case 2:
640
- return g.sent(), [
647
+ return d.sent(), [
641
648
  2
642
649
  /*return*/
643
650
  ];
@@ -711,16 +718,16 @@ function ue(n, e) {
711
718
  }
712
719
  function ge(n) {
713
720
  return k(this, arguments, void 0, function(e, r) {
714
- var a, i, t, o, u, f, s, c, l, d, h, g, v, p, m;
715
- return r === void 0 && (r = {}), y(this, function(w) {
716
- switch (w.label) {
721
+ var a, i, t, o, u, f, s, c, l, v, h, d, m, p, w;
722
+ return r === void 0 && (r = {}), y(this, function(g) {
723
+ switch (g.label) {
717
724
  case 0:
718
725
  if (a = e.baseURL, i = "", r.distPath)
719
726
  i = D(process.cwd(), r.distPath);
720
727
  else
721
728
  for (i = D(process.cwd(), (f = e.workCode) !== null && f !== void 0 ? f : "work-".concat(Date.now())); W(i); )
722
- /.-(\d+)$/.test(i) ? i = i.replace(/.-(\d+)$/, function(O, b) {
723
- return "-" + (Number(b) + 1);
729
+ /.-(\d+)$/.test(i) ? i = i.replace(/.-(\d+)$/, function(L, P) {
730
+ return "-" + (Number(P) + 1);
724
731
  }) : i = i + "-1";
725
732
  return t = {
726
733
  baseURL: a,
@@ -728,11 +735,11 @@ function ge(n) {
728
735
  fetch: (s = r.fetch) !== null && s !== void 0 ? s : fetch,
729
736
  imageOptions: {
730
737
  size: (l = (c = r.imageOptions) === null || c === void 0 ? void 0 : c.size) !== null && l !== void 0 ? l : [],
731
- format: (h = (d = r.imageOptions) === null || d === void 0 ? void 0 : d.format) !== null && h !== void 0 ? h : []
738
+ format: (h = (v = r.imageOptions) === null || v === void 0 ? void 0 : v.format) !== null && h !== void 0 ? h : []
732
739
  },
733
740
  textureOptions: {
734
- size: (v = (g = r.textureOptions) === null || g === void 0 ? void 0 : g.size) !== null && v !== void 0 ? v : [],
735
- format: (m = (p = r.textureOptions) === null || p === void 0 ? void 0 : p.format) !== null && m !== void 0 ? m : []
741
+ size: (m = (d = r.textureOptions) === null || d === void 0 ? void 0 : d.size) !== null && m !== void 0 ? m : [],
742
+ format: (w = (p = r.textureOptions) === null || p === void 0 ? void 0 : p.format) !== null && w !== void 0 ? w : []
736
743
  },
737
744
  log: r.log ? ue : (function() {
738
745
  return Promise.resolve();
@@ -740,13 +747,13 @@ function ge(n) {
740
747
  imageProcessingFilename: r.imageProcessingFilename
741
748
  }, t.log(JSON.stringify(t, null, " ")), [4, q(i, { recursive: !0 })];
742
749
  case 1:
743
- return w.sent(), o = "work.json", u = D(i, o), [4, X(u, JSON.stringify(e.toJSON(), null, " "))];
750
+ return g.sent(), o = "work.json", u = D(i, o), [4, X(u, JSON.stringify(e.toJSON(), null, " "))];
744
751
  case 2:
745
- return w.sent(), [4, oe(e, t)];
752
+ return g.sent(), [4, oe(e, t)];
746
753
  case 3:
747
- return w.sent(), [4, ae(e, t)];
754
+ return g.sent(), [4, ae(e, t)];
748
755
  case 4:
749
- return w.sent(), [
756
+ return g.sent(), [
750
757
  2
751
758
  /*return*/
752
759
  ];