@polygon-streaming/web-player-threejs 2.4.6

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.
@@ -0,0 +1 @@
1
+ var ct=Object.defineProperty;var ut=(n,t,e)=>t in n?ct(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var a=(n,t,e)=>(ut(n,typeof t!="symbol"?t+"":t,e),e);(function(n,t){const e=E,s=n();for(;;)try{if(-parseInt(e(289))/1*(-parseInt(e(284))/2)+-parseInt(e(292))/3*(parseInt(e(296))/4)+-parseInt(e(294))/5*(parseInt(e(297))/6)+-parseInt(e(299))/7+-parseInt(e(293))/8*(parseInt(e(290))/9)+parseInt(e(287))/10+-parseInt(e(298))/11*(-parseInt(e(295))/12)===t)break;s.push(s.shift())}catch{s.push(s.shift())}})(T,322716);function ht(n,t){return n[E(291)](/\$\(([^()]*)\)/g,(s,r)=>{const i=t[r];return i!==void 0?i:s})}function E(n,t){const e=T();return E=function(s,r){return s=s-284,e[s]},E(n,t)}function T(){const n=["3405LBCStS","2369064lVdvkF","13030DswLXW","324ohQfHz","1160ZgdiMt","954SZEuzY","534391qLULvx","2162573ICVgMr","8ANqfZy","...","length","1361890mNbMmC","stringify","55854bwiGgv","9LzVWnF","replace"];return T=function(){return n},T()}(function(n,t){const e=w,s=n();for(;;)try{if(-parseInt(e(213))/1*(parseInt(e(217))/2)+-parseInt(e(216))/3*(-parseInt(e(206))/4)+-parseInt(e(212))/5*(parseInt(e(215))/6)+-parseInt(e(207))/7*(parseInt(e(209))/8)+parseInt(e(211))/9*(-parseInt(e(210))/10)+-parseInt(e(219))/11*(-parseInt(e(214))/12)+-parseInt(e(218))/13*(-parseInt(e(204))/14)===t)break;s.push(s.shift())}catch{s.push(s.shift())}})(D,945008);function dt(n,t){return new URL(n,t).href}function w(n,t){const e=D();return w=function(s,r){return s=s-204,e[s]},w(n,t)}function yt(n){return n[w(205)]("/")?n:n+"/"}function D(){const n=["76316AvxzTB","8283121XjCmHv","length","8oSGYFj","2045470LbyaWk","27GgLAsv","151750oQkNVH","1vjObRP","372EcOQBA","36ONJazB","231EDHasb","590382hKIjWQ","39gTRHde","481294qgCYHB","1837668ajzYks","endsWith"];return D=function(){return n},D()}function $(n){const t=w;return n[t(205)]("/")?n.substring(0,n[t(208)]-1):n}(function(n,t){for(var e=b,s=n();;)try{var r=parseInt(e(177))/1*(-parseInt(e(151))/2)+-parseInt(e(153))/3+-parseInt(e(150))/4+parseInt(e(179))/5+parseInt(e(178))/6+parseInt(e(175))/7*(parseInt(e(156))/8)+parseInt(e(167))/9*(-parseInt(e(180))/10);if(r===t)break;s.push(s.shift())}catch{s.push(s.shift())}})(M,797661);function M(){var n=["Opaque","Production","Viverse","boundingBox","Development","Staging","126sjshSL","Mesh","ThreeJs","DevRemote","Core","Custom","Cutoff","Viewer","35LzXVmG","Quality","16477khZSRc","1450422FpiBXD","7398860dhizCG","314740zWQYSf","NonPlayer","Public","6184944NyKurM","16HiQSiP","mesh","1078725XpDdTd","BabylonJs","Transparent","2487064oOkjwE","PlayCanvas","nonPlayer","BoundingBox","Simplify"];return M=function(){return n},M()}function b(n,t){var e=M();return b=function(s,r){s=s-149;var i=e[s];return i},b(n,t)}var lt=(n=>{var t=b;return n[t(168)]=t(152),n[t(159)]=t(164),n})(lt||{}),ft=(n=>(n.BoundingBoxCenter="boundingBoxCenter",n.BoundingBox="boundingBox",n))(ft||{}),bt=(n=>{var t=b;return n[t(181)]=t(158),n.Player="player",n})(bt||{}),pt=(n=>{var t=b;return n[n[t(172)]=0]=t(172),n[n[t(157)]=1]=t(157),n[n[t(169)]=2]="ThreeJs",n[n[t(154)]=3]=t(154),n})(pt||{}),zt=(n=>{var t=b;return n[n.Refine=0]="Refine",n[n[t(160)]=1]=t(160),n[n.SwapLod=2]="SwapLod",n})(zt||{}),It=(n=>{var t=b;return n[n.Opaque=0]=t(161),n[n.Transparent=1]=t(155),n[n[t(173)]=2]="Cutoff",n})(It||{}),it=(n=>{var t=b;return n[n[t(176)]=0]=t(176),n[n.DistanceToCamera=1]="DistanceToCamera",n})(it||{}),Q=(n=>{var t=b;return n[n[t(165)]=0]=t(165),n[n[t(170)]=1]=t(170),n[n[t(166)]=2]=t(166),n[n[t(162)]=3]=t(162),n[n[t(174)]=4]=t(174),n[n[t(163)]=5]=t(163),n[n.Public=6]=t(149),n[n[t(171)]=7]="Core",n})(Q||{});(function(n,t){const e=O,s=n();for(;;)try{if(-parseInt(e(469))/1+-parseInt(e(474))/2+parseInt(e(470))/3+parseInt(e(473))/4+-parseInt(e(476))/5*(parseInt(e(477))/6)+parseInt(e(471))/7+-parseInt(e(472))/8===t)break;s.push(s.shift())}catch{s.push(s.shift())}})(R,466731);function g(n,t){const e=O;return Math.abs(n-t)<=Number[e(475)]}function O(n,t){const e=R();return O=function(s,r){return s=s-469,e[s]},O(n,t)}function R(){const n=["20BbiSjH","397776dpCxPm","46846dFNYaS","1462746BNdrSZ","1363817AFkTrQ","4561088neGhio","3352068QhCkkx","343066iSsPkP","EPSILON"];return R=function(){return n},R()}var I;class p{constructor(t=0,e=0,s=0){this.x=void 0,this.y=void 0,this.z=void 0,t.length===3?(this.x=t[0],this.y=t[1],this.z=t[2]):(this.x=t,this.y=e,this.z=s)}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}add2(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addScaled(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}clone(){const t=this.constructor;return new t(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}cross(t,e){const s=t.x,r=t.y,i=t.z,c=e.x,d=e.y,u=e.z;return this.x=r*u-d*i,this.y=i*c-u*s,this.z=s*d-c*r,this}distance(t){const e=this.x-t.x,s=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+s*s+r*r)}div(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}div2(t,e){return this.x=t.x/e.x,this.y=t.y/e.y,this.z=t.z/e.z,this}divScalar(t){return this.x/=t,this.y/=t,this.z/=t,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}equals(t){return this.x===t.x&&this.y===t.y&&this.z===t.z}equalsApprox(t,e=1e-6){return Math.abs(this.x-t.x)<e&&Math.abs(this.y-t.y)<e&&Math.abs(this.z-t.z)<e}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}lerp(t,e,s){return this.x=t.x+s*(e.x-t.x),this.y=t.y+s*(e.y-t.y),this.z=t.z+s*(e.z-t.z),this}mul(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}mul2(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}mulScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=this){const e=t.x*t.x+t.y*t.y+t.z*t.z;if(e>0){const s=1/Math.sqrt(e);this.x=t.x*s,this.y=t.y*s,this.z=t.z*s}return this}floor(t=this){return this.x=Math.floor(t.x),this.y=Math.floor(t.y),this.z=Math.floor(t.z),this}ceil(t=this){return this.x=Math.ceil(t.x),this.y=Math.ceil(t.y),this.z=Math.ceil(t.z),this}round(t=this){return this.x=Math.round(t.x),this.y=Math.round(t.y),this.z=Math.round(t.z),this}min(t){return t.x<this.x&&(this.x=t.x),t.y<this.y&&(this.y=t.y),t.z<this.z&&(this.z=t.z),this}max(t){return t.x>this.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),t.z>this.z&&(this.z=t.z),this}project(t){const e=this.x*t.x+this.y*t.y+this.z*t.z,s=t.x*t.x+t.y*t.y+t.z*t.z,r=e/s;return this.x=t.x*r,this.y=t.y*r,this.z=t.z*r,this}set(t,e,s){return this.x=t,this.y=e,this.z=s,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}sub2(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}toString(){return`[${this.x}, ${this.y}, ${this.z}]`}}I=p;p.ZERO=Object.freeze(new I(0,0,0));p.ONE=Object.freeze(new I(1,1,1));p.UP=Object.freeze(new I(0,1,0));p.DOWN=Object.freeze(new I(0,-1,0));p.RIGHT=Object.freeze(new I(1,0,0));p.LEFT=Object.freeze(new I(-1,0,0));p.FORWARD=Object.freeze(new I(0,0,-1));p.BACK=Object.freeze(new I(0,0,1));const o=m;(function(n,t){const e=m,s=n();for(;;)try{if(parseInt(e(281))/1*(-parseInt(e(276))/2)+-parseInt(e(268))/3*(-parseInt(e(285))/4)+parseInt(e(277))/5*(parseInt(e(294))/6)+-parseInt(e(293))/7*(parseInt(e(272))/8)+-parseInt(e(290))/9+-parseInt(e(291))/10*(-parseInt(e(269))/11)+parseInt(e(271))/12===t)break;s.push(s.shift())}catch{s.push(s.shift())}})(A,133871);function m(n,t){const e=A();return m=function(s,r){return s=s-264,e[s]},m(n,t)}class f{constructor(t=0,e=0,s=0){a(this,"x");a(this,"y");a(this,"z");typeof t===m(289)?(this.x=t,this.y=e,this.z=s):(this.x=t.x,this.y=t.y,this.z=t.z)}static[o(275)](t){return t==null?null:new f(t[0],t[1],t[2])}[o(284)](t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}static[o(284)](t,e){return new f(t.x+e.x,t.y+e.y,t.z+e.z)}[o(273)](t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}static[o(273)](t,e){return new f(t.x-e.x,t.y-e.y,t.z-e.z)}[o(280)](t){return this.x-=t,this.y-=t,this.z-=t,this}static[o(280)](t,e){return new f(t.x-e,t.y-e,t.z-e)}[o(288)](t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}static[o(288)](t,e){return new f(t.x*e.x,t.y*e.y,t.z*e.z)}[o(295)](t){return this.x*=t,this.y*=t,this.z*=t,this}static[o(295)](t,e){return new f(t.x*e,t.y*e,t.z*e)}[o(282)](t){return this.x*t.x+this.y*t.y+this.z*t.z}static dot(t,e){return t.x*e.x+t.y*e.y+t.z*e.z}cross(t){return this.x=this.y*t.z-t.y*this.z,this.y=this.z*t.x-t.z*this.x,this.z=this.x*t.y-t.x*this.y,this}static[o(292)](t,e){return new f(t.y*e.z-e.y*t.z,t.z*e.x-e.z*t.x,t.x*e.y-e.x*t.y)}[o(283)](t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}static[o(283)](t,e){return new f(t.x/e.x,t.y/e.y,t.z/e.z)}[o(267)](t){return this.x/=t,this.y/=t,this.z/=t,this}static divScalar(t,e){return new f(t.x/e,t.y/e,t.z/e)}normalize(){const t=o,e=this[t(265)]();if(e>0){const s=1/Math[t(270)](e);this.x*=s,this.y*=s,this.z*=s}return this}static[o(279)](t){const e=o,s=t.x*t.x+t.y*t.y+t.z*t.z;if(s>0){const r=1/Math[e(270)](s);t.x*=r,t.y*=r,t.z*=r}return t}[o(266)](t,e,s){return this.x=t.x+s*(e.x-t.x),this.y=t.y+s*(e.y-t.y),this.z=t.z+s*(e.z-t.z),this}[o(286)](){return Math[o(270)](this.x*this.x+this.y*this.y+this.z*this.z)}static length(t){return Math[o(270)](t.x*t.x+t.y*t.y+t.z*t.z)}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}static[o(265)](t){return t.x*t.x+t.y*t.y+t.z*t.z}distance(t){const e=o,s=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return Math[e(270)](s*s+r*r+i*i)}static distance(t,e){const s=t.x-e.x,r=t.y-e.y,i=t.z-e.z;return Math.sqrt(s*s+r*r+i*i)}distanceSq(t){const e=this.x-t.x,s=this.y-t.y,r=this.z-t.z;return e*e+s*s+r*r}static distanceSq(t,e){const s=t.x-e.x,r=t.y-e.y,i=t.z-e.z;return s*s+r*r+i*i}[o(278)](){return new f(this.x,this.y,this.z)}static[o(278)](t){return new f(t.x,t.y,t.z)}[o(287)](t,e,s){return this.x=t,this.y=e,this.z=s,this}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}[o(264)](t,e=!1){return e?g(this.x,t.x)&&g(this.y,t.y)&&g(this.z,t.z):this.x===t.x&&this.y===t.y&&this.z===t.z}static equals(t,e,s=!1){return s?g(t.x,e.x)&&g(t.y,e.y)&&g(t.z,e.z):t.x===e.x&&t.y===e.y&&t.z===e.z}[o(274)](){return this.x+", "+this.y+", "+this.z}static toString(t){return t.x+", "+t.y+", "+t.z}toPlayCanvasVector(t=new p){return t[o(287)](this.x,this.y,this.z),t}}function A(){const n=["length","set","mul","number","2234772CRSNHx","2083490EBdrMn","cross","7PdhVAX","24ODCYgt","mulScalar","equals","lengthSq","lerp","divScalar","195hiIQFf","11fvruHU","sqrt","4102068aCgQxM","1948792Enfqdb","sub","toString","fromArray","104bRBdaW","39790nhlTWK","clone","normalize","subScalar","1491zojPXY","dot","div","add","7464GJZJYU"];return A=function(){return n},A()}const U=L;(function(n,t){const e=L,s=n();for(;;)try{if(-parseInt(e(439))/1+-parseInt(e(442))/2*(parseInt(e(432))/3)+parseInt(e(437))/4+-parseInt(e(443))/5+parseInt(e(431))/6+-parseInt(e(436))/7+parseInt(e(434))/8*(parseInt(e(435))/9)===t)break;s.push(s.shift())}catch{s.push(s.shift())}})(P,940406);U(441);U(433);U(438);function L(n,t){const e=P();return L=function(s,r){return s=s-431,e[s]},L(n,t)}U(440);function P(){const n=["3479158qRaSeS","8535575hdcUMa","3396582yihyMX","3SdNivO","#e0e00d","10157800eATbSr","27WzxzOq","3618720jPtTtv","5607768gvDBGy","#3273ed","873154nAbPph","initially-reached-target-tree","#c91818"];return P=function(){return n},P()}const Z=C;(function(n,t){const e=C,s=n();for(;;)try{if(parseInt(e(518))/1*(-parseInt(e(538))/2)+-parseInt(e(522))/3*(parseInt(e(535))/4)+parseInt(e(516))/5*(parseInt(e(541))/6)+-parseInt(e(498))/7*(-parseInt(e(544))/8)+-parseInt(e(524))/9*(parseInt(e(508))/10)+parseInt(e(485))/11*(-parseInt(e(478))/12)+-parseInt(e(486))/13*(-parseInt(e(480))/14)===t)break;s.push(s.shift())}catch{s.push(s.shift())}})(B,460451);Z(517),Z(482);function B(){const n=["revokeObjectURL","createElement","sort","type","indexOf","35zETrph","/assets","55019PhRowl","Polygon Streaming service worker registration successful with scope: ","createObjectURL","getCameraFov","9WmSRbd","attributes","496593MbabSm","toString","document","call","getPosition","substring","minY","value","log","onload","Instance","1213992MFpxQq","currentScript","click","30pTRxge","VITE_IS_DOWNLOADABLE","then","226590LrElmo","href","setAttribute","999512ejwVIE",".umd.js","maxZ","download","Failed to load script: ","hasOwnProperty","serviceWorker","body","sqrt","Module","563964MmdGds","function","14FNsXCo","length","public","tan","sub","77EVHSdb","29729193xQTeaU","pow","instantiate","object","error","Unable to register Polygon Streaming service worker: ","keys","values","maxX","maxY","minZ","appendChild","14qfTuuI","src","minX","color: ","true","/service-worker.js","clone","register","random","undefined","50FfLUYp","onerror","toLowerCase"];return B=function(){return n},B()}function C(n,t){const e=B();return C=function(s,r){return s=s-472,e[s]},C(n,t)}function St(){const n=Z;"serviceWorker"in navigator&&navigator[n(474)][n(505)](n(503))[n(540)](t=>{const e=n;console[e(532)](e(519),t.scope)},t=>{const e=n;console[e(490)](e(491)+t)})}const x=j;(function(n,t){const e=j,s=n();for(;;)try{if(-parseInt(e(169))/1+-parseInt(e(198))/2*(-parseInt(e(179))/3)+-parseInt(e(156))/4+-parseInt(e(165))/5*(-parseInt(e(178))/6)+-parseInt(e(153))/7*(-parseInt(e(201))/8)+parseInt(e(151))/9*(-parseInt(e(148))/10)+parseInt(e(149))/11*(parseInt(e(166))/12)===t)break;s.push(s.shift())}catch{s.push(s.shift())}})(V,512312);var gt={VITE_BASE_URL:"",VITE_SHARED_ASSETS_PATH:x(135),BASE_URL:"/",MODE:x(194),DEV:!1,PROD:!0,SSR:!1};function V(){const n=["80913UWdVZa","VITE_SHARED_ASSETS_PATH","hasOwnProperty","showLoadingModel","toggleColliderVisualization","VITE_SHOW_LOADING_MODEL","length","s3Domain","baseUrl","core","logSettings","showDistancePoint","true","visualizeOperation","log","public","initInstance","logOperations","showNodeMaterialInfo","2nICqdx","sendTrafficPeriod","VITE_SEND_TRAFFIC_RECORD","4007664JncOWw","/assets","build","version","logCollider","Polygon Streaming web player: version: ","VITE_UNSENT_TRAFFIC_MAX_SIZE","sendTrafficRecord","trim","undefined","showBoundingBoxes","error","2.4.6","VITE_SEND_TRAFFIC_PERIOD","30470Gnatxk","18345151FxQhaO","Quality","1710qhjZbA","_instance","14zMEeSg","instance","VITE_TOGGLE_COLLIDER_VISUALIZATION","3923208BPqPru","showOverlay","unsetTrafficMaxSize","1726657672453","Public","VITE_BASE_URL","warn","showReferencePosition","renderWireframe","15EFmiZq","12OlQCmF","sharedAssetsUrl","logIndividualOperations","960401bMPVJn",", variant: ","Env already initialized","colliderOpacity","variant","VITE_REGISTER_SERVICE_WORKER","type","registerServiceWorker","visualizationType","671634mWRXYR"];return V=function(){return n},V()}function j(n,t){const e=V();return j=function(s,r){return s=s-135,e[s]},j(n,t)}var Ut,Wt,Ft,Ht,Gt,Qt,Zt,Xt,Yt,Kt,Jt,$t,te,ee,ne,se,re,ie,xe,ae,oe,ce;const q=class q{constructor(t=gt,e={version:x(146),variant:x(188),build:x(159),s3Domain:"stream.viverse.com"}){a(this,Wt);a(this,Ft,!0);a(this,Ht);a(this,"sharedAssetsUrl");a(this,"registerServiceWorker",!0);a(this,Gt,!0);a(this,"unsetTrafficMaxSize",104857600);a(this,Qt,60);a(this,Zt,!0);a(this,Xt);a(this,Yt);a(this,"logInitialModelDataLoaded",!1);a(this,Kt,!1);a(this,Jt,!1);a(this,$t,!1);a(this,te,!1);a(this,"showNodeInfo",!1);a(this,ee,!1);a(this,ne,!1);a(this,"useDebugMaterial",!1);a(this,se,!1);a(this,re,!1);a(this,ie,!1);a(this,xe,!1);a(this,"visualizeBoundingSphere",!1);a(this,ae,!1);a(this,oe,.3);a(this,ce,it[x(150)]);const s=x;this[s(175)]=Q[s(160)],this[s(137)]=e[s(137)],this[s(173)]=e[s(173)];const r={VERSION:e[s(137)],VARIANT:e[s(173)],S3_DOMAIN:e[s(186)]};this.baseUrl=t.VITE_BASE_URL!=null&&t[s(161)][s(142)]()[s(185)]>0?$(ht(yt(t[s(161)]),r)):"",this[s(167)]=this[s(187)][s(185)]>0?$(dt(t.VITE_SHARED_ASSETS_PATH,this[s(187)])):t[s(180)],t[s(184)]!=null&&(this.showLoadingModel=t[s(184)]===s(191)),t[s(174)]!=null&&(this[s(176)]=t[s(174)]===s(191)),t.VITE_TOGGLE_COLLIDER_VISUALIZATION!=null&&(this[s(183)]=t[s(155)]===s(191)),t[s(200)]!=null&&(this[s(141)]=t[s(200)]===s(191)),t.VITE_UNSENT_TRAFFIC_MAX_SIZE!=null&&(this[s(158)]=parseInt(t[s(140)])),t[s(147)]!=null&&(this.sendTrafficPeriod=parseInt(t[s(147)])),this.showLoadingModel=!0,typeof window!==s(143)&&(console[s(193)](s(139)+e[s(137)]+s(170)+e[s(173)]+", build: "+e[s(136)]),this[s(176)]&&St())}static get[(Ut=x(152),Wt=x(175),Ft=x(183),Ht=x(187),Gt=x(141),Qt=x(199),Zt=x(182),Xt=x(137),Yt=x(173),Kt=x(138),Jt=x(196),$t=x(168),te=x(189),ee=x(197),ne=x(190),se=x(144),re=x(157),ie=x(192),xe=x(164),ae=x(163),oe=x(172),ce=x(177),x(154))](){const t=x;return this._instance===void 0&&console[t(145)]("Env needs to be initialized with initInstance() first"),this._instance}static[x(195)](t,e){const s=x;if(this[s(152)]!==void 0){console[s(162)](s(171));return}this[s(152)]=new q(t,e)}logProperties(){const t=x;console.log("Env properties for environment: "+Q[this[t(175)]]+":");for(const e in this)this[t(181)](e)&&e!==t(175)&&console.log(" "+e+": "+this[e])}};a(q,Ut);let S=q;const X=(n,t)=>t.some(e=>n instanceof e);let tt,et;function wt(){return tt||(tt=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function mt(){return et||(et=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Y=new WeakMap,H=new WeakMap,W=new WeakMap;function vt(n){const t=new Promise((e,s)=>{const r=()=>{n.removeEventListener("success",i),n.removeEventListener("error",c)},i=()=>{e(z(n.result)),r()},c=()=>{s(n.error),r()};n.addEventListener("success",i),n.addEventListener("error",c)});return W.set(t,n),t}function Et(n){if(Y.has(n))return;const t=new Promise((e,s)=>{const r=()=>{n.removeEventListener("complete",i),n.removeEventListener("error",c),n.removeEventListener("abort",c)},i=()=>{e(),r()},c=()=>{s(n.error||new DOMException("AbortError","AbortError")),r()};n.addEventListener("complete",i),n.addEventListener("error",c),n.addEventListener("abort",c)});Y.set(n,t)}let K={get(n,t,e){if(n instanceof IDBTransaction){if(t==="done")return Y.get(n);if(t==="store")return e.objectStoreNames[1]?void 0:e.objectStore(e.objectStoreNames[0])}return z(n[t])},set(n,t,e){return n[t]=e,!0},has(n,t){return n instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in n}};function xt(n){K=n(K)}function Tt(n){return mt().includes(n)?function(...t){return n.apply(k(this),t),z(this.request)}:function(...t){return z(n.apply(k(this),t))}}function Dt(n){return typeof n=="function"?Tt(n):(n instanceof IDBTransaction&&Et(n),X(n,wt())?new Proxy(n,K):n)}function z(n){if(n instanceof IDBRequest)return vt(n);if(H.has(n))return H.get(n);const t=Dt(n);return t!==n&&(H.set(n,t),W.set(t,n)),t}const k=n=>W.get(n);function Mt(n,t,{blocked:e,upgrade:s,blocking:r,terminated:i}={}){const c=indexedDB.open(n,t),d=z(c);return s&&c.addEventListener("upgradeneeded",u=>{s(z(c.result),u.oldVersion,u.newVersion,z(c.transaction),u)}),e&&c.addEventListener("blocked",u=>e(u.oldVersion,u.newVersion,u)),d.then(u=>{i&&u.addEventListener("close",()=>i()),r&&u.addEventListener("versionchange",l=>r(l.oldVersion,l.newVersion,l))}).catch(()=>{}),d}function Ot(n,{blocked:t}={}){const e=indexedDB.deleteDatabase(n);return t&&e.addEventListener("blocked",s=>t(s.oldVersion,s)),z(e).then(()=>{})}const Rt=["get","getKey","getAll","getAllKeys","count"],At=["put","add","delete","clear"],G=new Map;function nt(n,t){if(!(n instanceof IDBDatabase&&!(t in n)&&typeof t=="string"))return;if(G.get(t))return G.get(t);const e=t.replace(/FromIndex$/,""),s=t!==e,r=At.includes(e);if(!(e in(s?IDBIndex:IDBObjectStore).prototype)||!(r||Rt.includes(e)))return;const i=async function(c,...d){const u=this.transaction(c,r?"readwrite":"readonly");let l=u.store;return s&&(l=l.index(d.shift())),(await Promise.all([l[e](...d),r&&u.done]))[0]};return G.set(t,i),i}xt(n=>({...n,get:(t,e,s)=>nt(t,e)||n.get(t,e,s),has:(t,e)=>!!nt(t,e)||n.has(t,e)}));const Lt=["continue","continuePrimaryKey","advance"],st={},J=new WeakMap,at=new WeakMap,Pt={get(n,t){if(!Lt.includes(t))return n[t];let e=st[t];return e||(e=st[t]=function(...s){J.set(this,at.get(this)[t](...s))}),e}};async function*Bt(...n){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...n)),!t)return;t=t;const e=new Proxy(t,Pt);for(at.set(e,t),W.set(e,k(t));t;)yield e,t=await(J.get(e)||t.continue()),J.delete(e)}function rt(n,t){return t===Symbol.asyncIterator&&X(n,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&X(n,[IDBIndex,IDBObjectStore])}xt(n=>({...n,get(t,e,s){return rt(t,e)?Bt:n.get(t,e,s)},has(t,e){return rt(t,e)||n.has(t,e)}}));const Ct=Object.freeze(Object.defineProperty({__proto__:null,deleteDB:Ot,openDB:Mt,unwrap:k,wrap:z},Symbol.toStringTag,{value:"Module"})),h=_;(function(n,t){const e=_,s=n();for(;;)try{if(-parseInt(e(452))/1*(parseInt(e(429))/2)+parseInt(e(416))/3+-parseInt(e(449))/4*(-parseInt(e(453))/5)+-parseInt(e(432))/6+parseInt(e(406))/7+parseInt(e(456))/8+-parseInt(e(415))/9===t)break;s.push(s.shift())}catch{s.push(s.shift())}})(N,471973);var Vt={VITE_BASE_URL:"",VITE_SHARED_ASSETS_PATH:h(435),BASE_URL:"/",MODE:h(463),DEV:!1,PROD:!0,SSR:!1};const jt={version:h(434),variant:h(447),build:h(465),s3Domain:h(448)};function N(){const n=["respondWith","status","byteLength","catch","There has been a problem with sending traffic records:","core","stream.viverse.com","26944dnjijP","some","createObjectStore","74735AMbNsL","290vEgvnR","unsetTrafficMaxSize","waitUntil","7213728ewkiSA","delete","preventDefault","getAllKeys","split","has","push","public","headers","1726657672453","sendTrafficRecord","openDB","request","forEach","instance","bytes","range","replace","traffics",".xrg","initInstance","6309310KHvPLm","files","url","/management/traffics","slice","Origin","stringify","filter","application/json","10655541QvMynj","130614UiMBUb","claim","get","bytes ","skipWaiting","activate","error","addEventListener","all",".sxrweb","arrayBuffer","POST","statusText","8lKNcup","blobs","fetch","1694460IqcVMi","put","2.4.6","/assets","append","sendTrafficPeriod","now","Network response was ","Content-Range","clients"];return N=function(){return n},N()}S[h(405)](Vt,jt);const y={bytes:0,blobs:{}};self[h(423)]("install",()=>{self[h(420)]()}),self[h(423)](h(421),n=>{const t=h;n[t(455)](self[t(441)][t(417)]())}),self.addEventListener(h(431),n=>{const t=h;[t(404),t(425)][t(450)](e=>n[t(468)][t(408)].includes(e))&&n[t(468)].headers.has(t(472))&&(n[t(458)](),n[t(442)](kt(n[t(468)])))});S.instance.sendTrafficRecord&&setInterval(()=>{ot()},S[h(470)][h(437)]*1e3);function _(n,t){const e=N();return _=function(s,r){return s=s-403,e[s]},_(n,t)}async function kt(n){const t=h,e=n.url,s=await Ct[t(467)](t(407),1,{upgrade(d){const u=t;d[u(451)](u(407))}}),{start:r,end:i}=Nt(n[t(464)][t(418)](t(472)));r===0&&i===15&&await _t(n,s,e)&&qt(s,e);const c=await s[t(418)](t(407),e+"_"+r+"_"+i);if(c){const d=c[t(410)](0,c[t(444)]),u=new Headers;return u.append(t(440),t(419)+r+"-"+(i||"")+"/"+c.byteLength),new Response(d,{status:206,headers:u})}else{y[t(471)]>=S[t(470)][t(454)]&&S.instance[t(466)]&&await ot();const d=new Headers;n[t(464)][t(469)]((F,v)=>{d[t(436)](v,F)}),!d[t(461)](t(411))&&d.append(t(411),location.origin);const u=new Request(n,{headers:d}),l=await fetch(u);if(l&&l[t(443)]===206){const F=await l.clone()[t(426)]();if(await s[t(433)]("files",F,e+"_"+r+"_"+i),S[t(470)][t(466)]){y[t(471)]=y.bytes+i-r+1;const v={bytes:i-r+1,timestamp:Math.floor(Date[t(438)]()/1e3),fromByte:r,endByte:i};y[t(430)][e]===void 0&&(y[t(430)][e]={bytes:0,traffics:[]}),y[t(430)][e][t(471)]=y.blobs[e][t(471)]+v[t(471)],y[t(430)][e][t(403)][t(462)](v)}return l}else return l}}function Nt(n){const t=h,[e,s]=n[t(473)](/bytes=/,"")[t(460)]("-");return{start:Number(e),end:s?Number(s):null}}async function _t(n,t,e){const s=h,r=await fetch(n,{method:"HEAD"}),i=r[s(464)][s(418)]("Last-Modified"),c=await t.get("files","last_modifed_"+e);return i!==c?(await t[s(433)](s(407),i,"last_modifed_"+e),!0):!1}async function qt(n,t){const e=h,s=await n[e(459)](e(407)),r=s[e(413)](i=>i.startsWith(t));await Promise[e(424)](r.map(i=>n[e(457)]("files",i)))}async function ot(){const n=h;if(y[n(471)]<=0)return!0;for(const t in y[n(430)]){let e=!0;if(fetch(n(409),{method:n(427),headers:{"Content-Type":n(414)},body:JSON[n(412)]({url:t,traffics:y[n(430)][t].traffics})}).then(s=>{const r=n;if(!s.ok)throw new Error(r(439)+s[r(428)]);y.bytes=y.bytes-y.blobs[t][r(471)],delete y.blobs[t]})[n(445)](s=>{const r=n;console[r(422)](r(446),s),e=!1}),!e)return!1}return!0}
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@polygon-streaming/web-player-threejs",
3
+ "version": "2.4.6",
4
+ "description": "Polygon Streaming Web Player for Three.js",
5
+ "license": "SEE LICENSE IN LICENCE FILE",
6
+ "main": "./dist/polygon-streaming.es.js",
7
+ "type": "module",
8
+ "module": "./dist/polygon-streaming.es.js",
9
+ "exports": {
10
+ "import": "./dist/polygon-streaming.es.js"
11
+ },
12
+ "peerDependencies": {
13
+ "three": "0.x"
14
+ }
15
+ }