xl-pano
Version:
一个基于 Typescript 的,同时支持立方体和球体场景的轻量开源库。
2 lines • 34 kB
JavaScript
var XLPano;(()=>{"use strict";var e,t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};t.r(r),t.d(r,{CubeScene:()=>w,HotSpot:()=>A,Pano:()=>R,SphereScene:()=>S});e=function(e,t){for(var r=["webgl","experimental-webgl","webkit-3d","moz-webgl"],n=null,o=0;o<r.length;++o){try{n=e.getContext(r[o],t)}catch(e){}if(n)break}return n};const n=function(t,r,n){n=n||function(e){var t=document.getElementsByTagName("body")[0];if(t){var r=window.WebGLRenderingContext?'It doesn\'t appear your computer can support WebGL.<br/><a href="http://get.webgl.org">Click here for more information.</a>':'This page requires a browser that supports WebGL.<br/><a href="http://get.webgl.org">Click here to upgrade your browser.</a>';e&&(r+="<br/><br/>Status: "+e),t.innerHTML=function(e){return'<div style="margin: auto; width:500px;z-index:10000;margin-top:20em;text-align:center;">'+e+"</div>"}(r)}},t.addEventListener&&t.addEventListener("webglcontextcreationerror",(function(e){n(e.statusMessage)}),!1);var o=e(t,r);return o||(window.WebGLRenderingContext,n("")),o},o=function(){var e={enable:{0:!0},disable:{0:!0},getParameter:{0:!0},drawArrays:{0:!0},drawElements:{0:!0,2:!0},createShader:{0:!0},getShaderParameter:{1:!0},getProgramParameter:{1:!0},getVertexAttrib:{1:!0},vertexAttribPointer:{2:!0},bindTexture:{0:!0},activeTexture:{0:!0},getTexParameter:{0:!0,1:!0},texParameterf:{0:!0,1:!0},texParameteri:{0:!0,1:!0,2:!0},texImage2D:{0:!0,2:!0,6:!0,7:!0},texSubImage2D:{0:!0,6:!0,7:!0},copyTexImage2D:{0:!0,2:!0},copyTexSubImage2D:{0:!0},generateMipmap:{0:!0},bindBuffer:{0:!0},bufferData:{0:!0,2:!0},bufferSubData:{0:!0},getBufferParameter:{0:!0,1:!0},pixelStorei:{0:!0,1:!0},readPixels:{4:!0,5:!0},bindRenderbuffer:{0:!0},bindFramebuffer:{0:!0},checkFramebufferStatus:{0:!0},framebufferRenderbuffer:{0:!0,1:!0,2:!0},framebufferTexture2D:{0:!0,1:!0,2:!0},getFramebufferAttachmentParameter:{0:!0,1:!0,2:!0},getRenderbufferParameter:{0:!0,1:!0},renderbufferStorage:{0:!0,1:!0},clear:{0:!0},depthFunc:{0:!0},blendFunc:{0:!0,1:!0},blendFuncSeparate:{0:!0,1:!0,2:!0,3:!0},blendEquation:{0:!0},blendEquationSeparate:{0:!0,1:!0},stencilFunc:{0:!0},stencilFuncSeparate:{0:!0,1:!0},stencilMaskSeparate:{0:!0},stencilOp:{0:!0,1:!0,2:!0},stencilOpSeparate:{0:!0,1:!0,2:!0,3:!0},cullFace:{0:!0},frontFace:{0:!0}},t=null;function r(e){if(null==t)for(var r in t={},e)"number"==typeof e[r]&&(t[e[r]]=r)}function n(){if(null==t)throw"WebGLDebugUtils.init(ctx) not called"}function o(e){n();var r=t[e];return void 0!==r?r:"*UNKNOWN WebGL ENUM (0x"+e.toString(16)+")"}function i(t,r,n){var i=e[t];return void 0!==i&&i[r]?o(n):n.toString()}function a(e){var t=e.getParameter(e.MAX_VERTEX_ATTRIBS),r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r);for(var n=0;n<t;++n)e.disableVertexAttribArray(n),e.vertexAttribPointer(n,4,e.FLOAT,!1,0,0),e.vertexAttrib1f(n,0);e.deleteBuffer(r);var o=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);for(n=0;n<o;++n)e.activeTexture(e.TEXTURE0+n),e.bindTexture(e.TEXTURE_CUBE_MAP,null),e.bindTexture(e.TEXTURE_2D,null);for(e.activeTexture(e.TEXTURE0),e.useProgram(null),e.bindBuffer(e.ARRAY_BUFFER,null),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.DITHER),e.disable(e.SCISSOR_TEST),e.blendColor(0,0,0,0),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.clearColor(0,0,0,0),e.clearDepth(1),e.clearStencil(-1),e.colorMask(!0,!0,!0,!0),e.cullFace(e.BACK),e.depthFunc(e.LESS),e.depthMask(!0),e.depthRange(0,1),e.frontFace(e.CCW),e.hint(e.GENERATE_MIPMAP_HINT,e.DONT_CARE),e.lineWidth(1),e.pixelStorei(e.PACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.UNPACK_COLORSPACE_CONVERSION_WEBGL&&e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),e.polygonOffset(0,0),e.sampleCoverage(1,!1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilMask(4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.viewport(0,0,e.canvas.clientWidth,e.canvas.clientHeight),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT);e.getError(););}return{init:r,mightBeEnum:function(e){return n(),void 0!==t[e]},glEnumToString:o,glFunctionArgToString:i,makeDebugContext:function(e,t){r(e),t=t||function(e,t,r){for(var n,a="",s=0;s<r.length;++s)a+=(0==s?"":", ")+i(t,s,r[s]);n="WebGL error "+o(e)+" in "+t+"("+a+")",window.console&&window.console.log&&window.console.log(n)};var n={};function a(e,r){return function(){var o=e[r].apply(e,arguments),i=e.getError();return 0!=i&&(n[i]=!0,t(i,r,arguments)),o}}var s={};for(var c in e)"function"==typeof e[c]?s[c]=a(e,c):s[c]=e[c];return s.getError=function(){for(var t in n)if(n[t])return n[t]=!1,t;return e.NO_ERROR},s},makeLostContextSimulatingContext:function(e){var t={},r=1,n=!1,o=[],i=void 0,s=void 0,c=void 0,u={};function f(e){for(var t=0;t<e.length;++t){var n=e[t];if((o=n)instanceof WebGLBuffer||o instanceof WebGLFramebuffer||o instanceof WebGLProgram||o instanceof WebGLRenderbuffer||o instanceof WebGLShader||o instanceof WebGLTexture)return n.__webglDebugContextLostId__==r}var o;return!0}function h(e,t){var r=e[t];return function(){if(!n){if(!f(arguments))return void(u[e.INVALID_OPERATION]=!0);var t=r.apply(e,arguments);return t}}}for(var l in e)"function"==typeof e[l]?t[l]=h(e,l):t[l]=e[l];function p(e){return{statusMessage:e}}t.loseContext=function(){if(!n){for(n=!0,++r;e.getError(););!function(){for(var e=Object.keys(u),t=0;t<e.length;++t)delete glErrorShdow_[e]}(),u[e.CONTEXT_LOST_WEBGL]=!0,setTimeout((function(){i&&i(p("context lost"))}),0)}},t.restoreContext=function(){if(n){if(!s)throw"You can not restore the context without a listener";setTimeout((function(){if(function(){for(var t=0;t<o.length;++t){var r=o[t];r instanceof WebGLBuffer?e.deleteBuffer(r):r instanceof WebctxFramebuffer?e.deleteFramebuffer(r):r instanceof WebctxProgram?e.deleteProgram(r):r instanceof WebctxRenderbuffer?e.deleteRenderbuffer(r):r instanceof WebctxShader?e.deleteShader(r):r instanceof WebctxTexture&&e.deleteTexture(r)}}(),a(e),n=!1,s){var t=s;s=c,c=void 0,t(p("context restored"))}}),0)}},t.getError=function(){if(!n)for(;t=e.getError();)u[t]=!0;for(var t in u)if(u[t])return delete u[t],t;return e.NO_ERROR};for(var d=["createBuffer","createFramebuffer","createProgram","createRenderbuffer","createShader","createTexture"],g=0;g<d.length;++g)t[E=d[g]]=function(t){return function(){if(n)return null;var i=t.apply(e,arguments);return i.__webglDebugContextLostId__=r,o.push(i),i}}(e[E]);var v=["getActiveAttrib","getActiveUniform","getBufferParameter","getContextAttributes","getAttachedShaders","getFramebufferAttachmentParameter","getParameter","getProgramParameter","getProgramInfoLog","getRenderbufferParameter","getShaderParameter","getShaderInfoLog","getShaderSource","getTexParameter","getUniform","getUniformLocation","getVertexAttrib"];for(g=0;g<v.length;++g)t[E=v[g]]=function(t){return function(){return n?null:t.apply(e,arguments)}}(t[E]);var y,m=["isBuffer","isEnabled","isFramebuffer","isProgram","isRenderbuffer","isShader","isTexture"];for(g=0;g<m.length;++g){var E;t[E=m[g]]=function(t){return function(){return!n&&t.apply(e,arguments)}}(t[E])}function b(e){return"function"==typeof e?e:function(t){e.handleEvent(t)}}return t.checkFramebufferStatus=(y=t.checkFramebufferStatus,function(){return n?e.FRAMEBUFFER_UNSUPPORTED:y.apply(e,arguments)}),t.getAttribLocation=function(t){return function(){return n?-1:t.apply(e,arguments)}}(t.getAttribLocation),t.getVertexAttribOffset=function(t){return function(){return n?0:t.apply(e,arguments)}}(t.getVertexAttribOffset),t.isContextLost=function(){return n},t.registerOnContextLostListener=function(e){i=b(e)},t.registerOnContextRestoredListener=function(e){n?c=b(e):s=b(e)},t},resetToInitialState:a}}();function i(e,t){e.useProgram(t),e.program=t}function a(e,t,r){var n=s(e,e.VERTEX_SHADER,t),o=s(e,e.FRAGMENT_SHADER,r),i=e.createProgram();if(!i)throw new Error("创建程序对象失败");if(e.attachShader(i,n),e.attachShader(i,o),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS))throw e.deleteProgram(i),e.deleteShader(o),e.deleteShader(n),new Error("链接程序对象失败:"+e.getProgramInfoLog(i));return i}function s(e,t,r){var n=e.createShader(t);if(null===n)throw new Error("创建 "+t+" 着色器对象失败");if(e.shaderSource(n,r),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw e.deleteShader(n),new Error("编译着"+t+"色器失败:"+e.getShaderInfoLog(n));return n}function c(e,t,r,n,o){var i=e.createBuffer();if(!i)throw new Error("创建缓冲区对象失败");e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW);var a=e.getAttribLocation(e.program,o);if(a<0)throw new Error("获取 "+o+" 地址失败");e.vertexAttribPointer(a,r,n,!1,0,0),e.enableVertexAttribArray(a)}function u(e){return new Promise((function(t,r){var n=new Image;n.crossOrigin="anonymous",n.onload=function(){return t(n)},n.onerror=function(e){return r(e)},n.src=e}))}var f=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},h=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},l={};function p(e){return Promise.all(e.map((function(e){return u(e)}))).then((function(t){e.forEach((function(e,r){l[e]=t[r]}))}))}function d(e){return e.textures instanceof Array?e.textures.filter((function(e){return"string"==typeof e})):"string"==typeof e.textures?[e.textures]:[]}var g=[-86,86];const v=function(){function e(t){var r;if(t){for(var n=new Float32Array(e.size),o=0;o<e.size;o++)n[o]=t.elements[o];r=n}else r=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);this.elements=r}return e.prototype.setIdentity=function(){var e=this.elements;return e[0]=1,e[4]=0,e[8]=0,e[12]=0,e[1]=0,e[5]=1,e[9]=0,e[13]=0,e[2]=0,e[6]=0,e[10]=1,e[14]=0,e[3]=0,e[7]=0,e[11]=0,e[15]=1,this},e.prototype.set=function(t){if(this===t||this.elements===t.elements)return this;for(var r=new Float32Array(e.size),n=0;n<e.size;n++)r[n]=t.elements[n];return this},e.prototype.multiply=function(e){var t,r,n,o,i,a,s,c;if(r=this.elements,n=this.elements,r===(o=e.elements))for(o=new Float32Array(16),t=0;t<16;++t)o[t]=r[t];for(t=0;t<4;t++)i=n[t],a=n[t+4],s=n[t+8],c=n[t+12],r[t]=i*o[0]+a*o[1]+s*o[2]+c*o[3],r[t+4]=i*o[4]+a*o[5]+s*o[6]+c*o[7],r[t+8]=i*o[8]+a*o[9]+s*o[10]+c*o[11],r[t+12]=i*o[12]+a*o[13]+s*o[14]+c*o[15];return this},e.prototype.transpose=function(){var e,t;return t=(e=this.elements)[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},e.prototype.setInverseOf=function(e){var t,r,n,o,i;if(r=e.elements,n=this.elements,(o=new Float32Array(16))[0]=r[5]*r[10]*r[15]-r[5]*r[11]*r[14]-r[9]*r[6]*r[15]+r[9]*r[7]*r[14]+r[13]*r[6]*r[11]-r[13]*r[7]*r[10],o[4]=-r[4]*r[10]*r[15]+r[4]*r[11]*r[14]+r[8]*r[6]*r[15]-r[8]*r[7]*r[14]-r[12]*r[6]*r[11]+r[12]*r[7]*r[10],o[8]=r[4]*r[9]*r[15]-r[4]*r[11]*r[13]-r[8]*r[5]*r[15]+r[8]*r[7]*r[13]+r[12]*r[5]*r[11]-r[12]*r[7]*r[9],o[12]=-r[4]*r[9]*r[14]+r[4]*r[10]*r[13]+r[8]*r[5]*r[14]-r[8]*r[6]*r[13]-r[12]*r[5]*r[10]+r[12]*r[6]*r[9],o[1]=-r[1]*r[10]*r[15]+r[1]*r[11]*r[14]+r[9]*r[2]*r[15]-r[9]*r[3]*r[14]-r[13]*r[2]*r[11]+r[13]*r[3]*r[10],o[5]=r[0]*r[10]*r[15]-r[0]*r[11]*r[14]-r[8]*r[2]*r[15]+r[8]*r[3]*r[14]+r[12]*r[2]*r[11]-r[12]*r[3]*r[10],o[9]=-r[0]*r[9]*r[15]+r[0]*r[11]*r[13]+r[8]*r[1]*r[15]-r[8]*r[3]*r[13]-r[12]*r[1]*r[11]+r[12]*r[3]*r[9],o[13]=r[0]*r[9]*r[14]-r[0]*r[10]*r[13]-r[8]*r[1]*r[14]+r[8]*r[2]*r[13]+r[12]*r[1]*r[10]-r[12]*r[2]*r[9],o[2]=r[1]*r[6]*r[15]-r[1]*r[7]*r[14]-r[5]*r[2]*r[15]+r[5]*r[3]*r[14]+r[13]*r[2]*r[7]-r[13]*r[3]*r[6],o[6]=-r[0]*r[6]*r[15]+r[0]*r[7]*r[14]+r[4]*r[2]*r[15]-r[4]*r[3]*r[14]-r[12]*r[2]*r[7]+r[12]*r[3]*r[6],o[10]=r[0]*r[5]*r[15]-r[0]*r[7]*r[13]-r[4]*r[1]*r[15]+r[4]*r[3]*r[13]+r[12]*r[1]*r[7]-r[12]*r[3]*r[5],o[14]=-r[0]*r[5]*r[14]+r[0]*r[6]*r[13]+r[4]*r[1]*r[14]-r[4]*r[2]*r[13]-r[12]*r[1]*r[6]+r[12]*r[2]*r[5],o[3]=-r[1]*r[6]*r[11]+r[1]*r[7]*r[10]+r[5]*r[2]*r[11]-r[5]*r[3]*r[10]-r[9]*r[2]*r[7]+r[9]*r[3]*r[6],o[7]=r[0]*r[6]*r[11]-r[0]*r[7]*r[10]-r[4]*r[2]*r[11]+r[4]*r[3]*r[10]+r[8]*r[2]*r[7]-r[8]*r[3]*r[6],o[11]=-r[0]*r[5]*r[11]+r[0]*r[7]*r[9]+r[4]*r[1]*r[11]-r[4]*r[3]*r[9]-r[8]*r[1]*r[7]+r[8]*r[3]*r[5],o[15]=r[0]*r[5]*r[10]-r[0]*r[6]*r[9]-r[4]*r[1]*r[10]+r[4]*r[2]*r[9]+r[8]*r[1]*r[6]-r[8]*r[2]*r[5],0==(i=r[0]*o[0]+r[1]*o[4]+r[2]*o[8]+r[3]*o[12]))return this;for(i=1/i,t=0;t<16;t++)n[t]=o[t]*i;return this},e.prototype.invert=function(){return this.setInverseOf(this)},e.prototype.setOrtho=function(e,t,r,n,o,i){var a,s,c,u;if(e===t||r===n||o===i)throw"null frustum";return s=1/(t-e),c=1/(n-r),u=1/(i-o),(a=this.elements)[0]=2*s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2*c,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=-2*u,a[11]=0,a[12]=-(t+e)*s,a[13]=-(n+r)*c,a[14]=-(i+o)*u,a[15]=1,this},e.prototype.ortho=function(t,r,n,o,i,a){return this.multiply((new e).setOrtho(t,r,n,o,i,a))},e.prototype.setPerspective=function(e,t,r,n){var o,i,a,s;if(r===n||0===t)throw"null frustum";if(r<=0)throw"near <= 0";if(n<=0)throw"far <= 0";if(e=Math.PI*e/180/2,0===(a=Math.sin(e)))throw"null frustum";return i=1/(n-r),s=Math.cos(e)/a,(o=this.elements)[0]=s/t,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=-(n+r)*i,o[11]=-1,o[12]=0,o[13]=0,o[14]=-2*r*n*i,o[15]=0,this},e.prototype.perspective=function(t,r,n,o){return this.multiply((new e).setPerspective(t,r,n,o))},e.prototype.setScale=function(e,t,r){var n=this.elements;return n[0]=e,n[4]=0,n[8]=0,n[12]=0,n[1]=0,n[5]=t,n[9]=0,n[13]=0,n[2]=0,n[6]=0,n[10]=r,n[14]=0,n[3]=0,n[7]=0,n[11]=0,n[15]=1,this},e.prototype.scale=function(e,t,r){var n=this.elements;return n[0]*=e,n[4]*=t,n[8]*=r,n[1]*=e,n[5]*=t,n[9]*=r,n[2]*=e,n[6]*=t,n[10]*=r,n[3]*=e,n[7]*=t,n[11]*=r,this},e.prototype.setTranslate=function(e,t,r){var n=this.elements;return n[0]=1,n[4]=0,n[8]=0,n[12]=e,n[1]=0,n[5]=1,n[9]=0,n[13]=t,n[2]=0,n[6]=0,n[10]=1,n[14]=r,n[3]=0,n[7]=0,n[11]=0,n[15]=1,this},e.prototype.translate=function(e,t,r){var n=this.elements;return n[12]+=n[0]*e+n[4]*t+n[8]*r,n[13]+=n[1]*e+n[5]*t+n[9]*r,n[14]+=n[2]*e+n[6]*t+n[10]*r,n[15]+=n[3]*e+n[7]*t+n[11]*r,this},e.prototype.setRotate=function(e,t,r,n){var o,i,a,s,c,u,f,h,l,p,d,g;return e=Math.PI*e/180,o=this.elements,i=Math.sin(e),a=Math.cos(e),0!==t&&0===r&&0===n?(t<0&&(i=-i),o[0]=1,o[4]=0,o[8]=0,o[12]=0,o[1]=0,o[5]=a,o[9]=-i,o[13]=0,o[2]=0,o[6]=i,o[10]=a,o[14]=0,o[3]=0,o[7]=0,o[11]=0,o[15]=1):0===t&&0!==r&&0===n?(r<0&&(i=-i),o[0]=a,o[4]=0,o[8]=i,o[12]=0,o[1]=0,o[5]=1,o[9]=0,o[13]=0,o[2]=-i,o[6]=0,o[10]=a,o[14]=0,o[3]=0,o[7]=0,o[11]=0,o[15]=1):0===t&&0===r&&0!==n?(n<0&&(i=-i),o[0]=a,o[4]=-i,o[8]=0,o[12]=0,o[1]=i,o[5]=a,o[9]=0,o[13]=0,o[2]=0,o[6]=0,o[10]=1,o[14]=0,o[3]=0,o[7]=0,o[11]=0,o[15]=1):(1!==(s=Math.sqrt(t*t+r*r+n*n))&&(t*=c=1/s,r*=c,n*=c),u=1-a,f=t*r,h=r*n,l=n*t,p=t*i,d=r*i,g=n*i,o[0]=t*t*u+a,o[1]=f*u+g,o[2]=l*u-d,o[3]=0,o[4]=f*u-g,o[5]=r*r*u+a,o[6]=h*u+p,o[7]=0,o[8]=l*u+d,o[9]=h*u-p,o[10]=n*n*u+a,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1),this},e.prototype.rotate=function(t,r,n,o){return this.multiply((new e).setRotate(t,r,n,o))},e.prototype.setLookAt=function(e,t,r,n,o,i,a,s,c){var u,f,h,l,p,d,g,v,y,m,E,b;return f=n-e,h=o-t,l=i-r,d=(h*=p=1/Math.sqrt(f*f+h*h+l*l))*c-(l*=p)*s,g=l*a-(f*=p)*c,v=f*s-h*a,m=(g*=y=1/Math.sqrt(d*d+g*g+v*v))*l-(v*=y)*h,E=v*f-(d*=y)*l,b=d*h-g*f,(u=this.elements)[0]=d,u[1]=m,u[2]=-f,u[3]=0,u[4]=g,u[5]=E,u[6]=-h,u[7]=0,u[8]=v,u[9]=b,u[10]=-l,u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,this.translate(-e,-t,-r)},e.prototype.lookAt=function(t,r,n,o,i,a,s,c,u){return this.multiply((new e).setLookAt(t,r,n,o,i,a,s,c,u))},e.size=16,e}();function y(e){var t=e%360;return t<0&&(t+=360),t}function m(e){return e*(2*Math.PI/360)}function E(e){return e/(2*Math.PI/360)}const b=function(){function e(){this.pitch=0,this.yaw=0,this.eye={position:{x:0,y:0,z:0},target:{x:0,y:0,z:-1},up:{x:0,y:1,z:0}},this.yRange=g,this.fovy=60,this.dragging=!1,this.dragStartPoint={x:0,y:0},this.angling=!1,this.fovying=!1,this.angleChangeCallbacks=[],this.hotSpots=[]}return e.prototype.getPitchRange=function(){var e=this.fovy/2;return[this.yRange[0]+e,this.yRange[1]-e]},e.prototype.setMvpMatrix=function(){var e=this.pano.gl,t=this.eye,r=t.position,n=r.x,o=r.y,i=r.z,a=t.target,s=a.x,c=a.y,u=a.z,f=t.up,h=f.x,l=f.y,p=f.z,d=e.getUniformLocation(e.program,"u_MvpMatrix");if(!d)throw new Error("获取 mvp 矩阵地址失败");var g=this.pano.canvas,y=g.width,m=g.height,E=new v;E.setPerspective(this.fovy,y/m,.01,10),E.lookAt(n,o,i,s,c,u,h,l,p),E.rotate(-this.pitch,1,0,0),E.rotate(this.yaw,0,1,0),e.uniformMatrix4fv(d,!1,E.elements)},e.prototype.addListener=function(e,t){"angleChange"===e&&this.angleChangeCallbacks.push(t)},e.prototype.removeListener=function(e,t){"angleChange"===e&&(this.angleChangeCallbacks=this.angleChangeCallbacks.filter((function(e){return e!==t})))},e.prototype.removeAllListeners=function(){this.angleChangeCallbacks=[]},e.prototype.destroy=function(){this.hotSpots&&this.hotSpots.length&&this.hotSpots.forEach((function(e){return e.destroy()}))},e.prototype.getAngle=function(){return{pitch:this.pitch,yaw:this.yaw}},e.prototype.getFovy=function(){return this.fovy},e.prototype.renderHotSpots=function(e,t){var r=this;void 0===e&&(e=0),void 0===t&&(t=0),this.hotSpots&&this.hotSpots.length&&this.hotSpots.forEach((function(n){return n.render(-e,t,r.pano,r)}))},e.prototype.executeAngleChangeCallbacks=function(){var e=this;this.angleChangeCallbacks.forEach((function(t){return t({pitch:e.pitch,yaw:e.yaw})}))},e.prototype.beforeDrawElements=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0);var r=this.pano.gl;this.pitch+=e;var n=this.getPitchRange();this.pitch<n[0]&&(this.pitch=n[0]),this.pitch>n[1]&&(this.pitch=n[1]),this.yaw+=t,this.yaw=y(this.yaw),this.setMvpMatrix(),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT)},e.prototype.addHotSpots=function(e){var t=this,r=function(e){e.pitch-=t.pitch,e.yaw-=t.yaw};e instanceof Array?(e.forEach((function(e){return r(e)})),this.hotSpots=this.hotSpots.concat(e)):(r(e),this.hotSpots.push(e))},e.prototype.draw=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.beforeDrawElements(e,t),this.drawModel(),this.renderHotSpots(e,t),this.executeAngleChangeCallbacks()},e.prototype.moveTo=function(e,t){var r,n=this.pano.canvas,o=this.dragStartPoint.x-e,i=this.dragStartPoint.y-t,a=this.getPitchRange();r=this.pitch<=a[0]&&i>=0||this.pitch>=a[1]&&i<=0?0:-E(Math.atan(i/(n.height/2)));var s=E(Math.atan(o/(n.width/2)));this.draw(1.5*r,1.5*s),this.dragStartPoint={x:e,y:t}},e.prototype.move=function(e,t,r){var n=this;void 0===r&&(r={});var o=r.animation,i=r.callback,a=r.duration,s=void 0===a?500:a;if(o){this.angling=!0;var c=e/s,u=t/s,f=Date.now(),h=f,l=function(){requestAnimationFrame((function(){var e=Date.now(),t=e-f;e<h+s?(n.draw(c*t,u*t),f=e,l()):(n.angling=!1,i&&i())}))};l()}else this.draw(e,t),i&&i()},e.prototype.setAngle=function(e,t){var r=e.pitch,n=e.yaw;this.move(r-this.pitch,n-this.yaw,t)},e.prototype.setFovy=function(e,t){var r=this;if(void 0===t&&(t={}),e<=0||e>=180)throw new Error("视角范围超出(0, 180)限制");var n=t.animation,o=t.callback,i=t.duration,a=void 0===i?500:i;if(n){this.fovying=!0;var s=(e-this.fovy)/a,c=Date.now(),u=c,f=function(){requestAnimationFrame((function(){var e=Date.now(),t=e-c;e<u+a?(r.fovy+=s*t,r.draw(),c=e,f()):(r.fovying=!1,o&&o())}))};f()}else this.fovy=e,this.draw(),o&&o()},e.prototype.onHotSpotClick=function(e){var t=this;this.move(e.pitch,e.yaw>180?-(360-e.yaw):e.yaw,{animation:!0,callback:function(){return t.pano.switchScene(e.target)}}),this.setFovy(this.fovy-6,{animation:!0,callback:function(){return t.fovy=60}})},e.prototype.eventBind=function(){var e=this,t=this.pano.canvas;t.onmousedown=function(r){e.dragging=!0,t.style.cursor="grabbing",e.dragStartPoint={x:r.offsetX,y:r.offsetY}},t.onmouseup=function(){e.dragging=!1,t.style.cursor="grab"},t.onmouseout=function(){e.dragging=!1,t.style.cursor="grab"},t.onmousemove=function(t){!e.dragging||e.angling||e.fovying||e.moveTo(t.offsetX,t.offsetY)},t.ontouchstart=function(r){var n=t.getBoundingClientRect(),o=n.top,i=n.left,a=r.changedTouches[0].clientX-i,s=r.changedTouches[0].clientY-o;e.dragStartPoint={x:a,y:s}},t.ontouchmove=function(r){var n=t.getBoundingClientRect(),o=n.top,i=n.left,a=r.changedTouches[0].clientX-i,s=r.changedTouches[0].clientY-o;e.angling||e.fovying||e.moveTo(a,s)}},e.prototype.drawModel=function(){},e.prototype.replaceTextures=function(e){},e.prototype.render=function(e){this.pano=e,this.eventBind()},e}();var _,T=(_=function(e,t){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},_(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}_(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});const w=function(e){function t(t,r){var n=e.call(this)||this;if(n.textures=[],n.textures=t,r){var o=r.pitch,i=r.yaw;o&&(n.pitch=o),i&&(n.yaw=i)}return n}return T(t,e),t.initTexture=function(e,t,r){var n=e.createTexture();if(!n)throw new Error("创建纹理对象失败");var o=e.TEXTURE0,i="f";switch(r){case 0:o=e.TEXTURE0,i="f";break;case 1:o=e.TEXTURE1,i="r";break;case 2:o=e.TEXTURE2,i="u";break;case 3:o=e.TEXTURE3,i="l";break;case 4:o=e.TEXTURE4,i="d";break;case 5:o=e.TEXTURE5,i="b"}e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1),e.activeTexture(o),e.bindTexture(e.TEXTURE_2D,n),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);var a=e.getUniformLocation(e.program,i+"_Sampler");if(!a)throw new Error("获取 "+a+" 地址失败");e.uniform1i(a,r)},t.getUFaceLocation=function(e){if(!t.u_Face){var r=e.getUniformLocation(e.program,"u_Face");if(!r)throw new Error("获取 u_Face 地址失败");t.u_Face=r}return t.u_Face},t.prototype.drawModel=function(){var e=this;t.allFacesIndices.forEach((function(t,r){e.renderFace(t,r)}))},t.prototype.loadTextures=function(){var e=this.textures,t=e[0],r=e[1],n=e[2],o=e[3],i=e[4],a=[e[5],r,n,o,i,t],s=[];return a.forEach((function(e,t){"string"==typeof e&&s.push({src:e,index:t})})),function(e){return f(this,void 0,void 0,(function(){var t,r,n,o,i,a;return h(this,(function(s){switch(s.label){case 0:t=[],r=0,n=e,s.label=1;case 1:return r<n.length?(o=n[r],l[o]?(t.push(l[o]),[3,4]):[3,2]):[3,5];case 2:return a=(i=t).push,[4,u(o)];case 3:a.apply(i,[s.sent()]),s.label=4;case 4:return r++,[3,1];case 5:return[2,t]}}))}))}(s.map((function(e){return e.src}))).then((function(e){return a.map((function(t){return"string"==typeof t?e.shift():t}))}))},t.prototype.renderFace=function(e,r){var n=this.pano.gl,o=n.createBuffer();if(!o)throw new Error("创建索引缓冲区对象失败");n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,o),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e,n.STATIC_DRAW),n.uniform1i(t.getUFaceLocation(n),r),n.drawElements(n.TRIANGLES,e.length,n.UNSIGNED_BYTE,0)},t.prototype.replaceTextures=function(e){this.textures=e,this.render(this.pano)},t.prototype.render=function(r){var n=this;e.prototype.render.call(this,r);var o=this.pano.gl;c(o,t.vertices,3,o.FLOAT,"a_Position"),c(o,t.texs,2,o.FLOAT,"a_TexCoord"),this.loadTextures().then((function(e){e.forEach((function(e,r){r<=5&&t.initTexture(o,e,r)})),n.draw()}))},t.vertices=new Float32Array([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1]),t.texs=new Float32Array([0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,1,0,0,0,0,1,1,1]),t.allFacesIndices=[new Uint8Array([0,1,2,0,2,3]),new Uint8Array([4,5,6,4,6,7]),new Uint8Array([8,9,10,8,10,11]),new Uint8Array([12,13,14,12,14,15]),new Uint8Array([16,17,18,16,18,19]),new Uint8Array([20,21,22,20,22,23])],t}(b);var x=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const S=function(e){function t(t,r){var n=e.call(this)||this;if(n.textures=t,r){var o=r.pitch,i=r.yaw;o&&(n.pitch=o),i&&(n.yaw=i)}return n}return x(t,e),Object.defineProperty(t,"verticeTexIndices",{get:function(){for(var e,r,n,o,i,a,s,c,u=[],f=[],h=[],l=0;l<=t.sections;l++){e=l*Math.PI/t.sections,r=Math.sin(e),n=Math.cos(e);for(var p=0;p<=t.sections;p++)o=2*p*Math.PI/t.sections,i=Math.sin(o),a=Math.cos(o),u.push(i*r,n,a*r),f.push(p/t.sections,(t.sections-l)/t.sections),l<t.sections&&p<t.sections&&(c=(s=l*(t.sections+1)+p)+(t.sections+1),h.push(s,c,s+1,s+1,c,c+1))}var d=new Float32Array(u),g=new Uint32Array(h);return{vertices:d,texs:new Float32Array(f),indices:g}},enumerable:!1,configurable:!0}),t.initTexture=function(e,t){var r=e.createTexture();if(!r)throw new Error("创建纹理对象失败");e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,r),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);var n=e.getUniformLocation(e.program,"u_Sampler");if(!n)throw new Error("获取 u_Sampler 地址失败");e.uniform1i(n,0)},t.prototype.drawModel=function(){var e=t.verticeTexIndices.indices,r=this.pano.gl,n=r.createBuffer();if(!n)throw new Error("创建索引缓冲区对象失败");if(r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,n),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e,r.STATIC_DRAW),!r.getExtension("OES_element_index_uint"))throw new Error("不支持大于 gl.UNSIGNED_BYTE 的 type");r.drawElements(r.TRIANGLES,e.length,r.UNSIGNED_INT,0)},t.prototype.loadTextures=function(){return"string"==typeof this.textures?function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return l[e]?[2,l[e]]:[4,u(e)];case 1:return[2,t.sent()]}}))}))}(this.textures):Promise.resolve(this.textures)},t.prototype.replaceTextures=function(e){this.textures=e,this.render(this.pano)},t.prototype.render=function(r){var n=this;e.prototype.render.call(this,r);var o=this.pano.gl,i=t.verticeTexIndices,a=i.vertices,s=i.texs;c(o,a,3,o.FLOAT,"a_Position"),c(o,s,2,o.FLOAT,"a_TexCoord"),this.loadTextures().then((function(e){t.initTexture(o,e),n.draw()}))},t.sections=60,t}(b),R=function(){function e(e,t){var r=this;this.scenes=[],this.sceneIndex=0,this.rendered=!1,this.sceneChangeCallbacks=[],this.switchScene=function(e){if(e!==r.sceneIndex){var t=r.scenes[r.sceneIndex];t&&t.destroy(),r.sceneIndex=e,r.render(),r.sceneChangeCallbacks.forEach((function(e){e(r.scenes[r.sceneIndex],r.sceneIndex)}))}};var i=document.getElementById(e);if(!i)throw new Error("找不到容器,请确认 id 是否正确");this.container=i;var a=document.createElement("canvas");this.canvas=a,i.append(a),this.gl=function(e,t){var r=n(e,{antialias:!0});if(!r)throw new Error("创建 WebGL 上下文失败");return t&&(r=o.makeDebugContext(r)),r}(a,t),this.setStyle(),this.onContainerResize()}return e.prototype.initShader=function(){var t=this.scenes[this.sceneIndex];if(t instanceof w)e.CubeGLProgram||(e.CubeGLProgram=a(this.gl,"attribute vec4 a_Position;\nattribute vec2 a_TexCoord;\nvarying vec2 v_TexCoord;\nuniform mat4 u_MvpMatrix;\n\nvoid main() {\n gl_Position = u_MvpMatrix * a_Position;\n v_TexCoord = a_TexCoord;\n}\n","precision mediump float;\n\nuniform sampler2D f_Sampler;\nuniform sampler2D r_Sampler;\nuniform sampler2D u_Sampler;\nuniform sampler2D l_Sampler;\nuniform sampler2D d_Sampler;\nuniform sampler2D b_Sampler;\nvarying vec2 v_TexCoord;\n// 标记每个面 0-f 1-r 2-u 3-l 4-d 5-b\nuniform int u_Face;\n\nvoid main() {\n if (u_Face == 0) {\n gl_FragColor = texture2D(f_Sampler, v_TexCoord);\n } else if (u_Face == 1) {\n gl_FragColor = texture2D(r_Sampler, v_TexCoord);\n } else if (u_Face == 2) {\n gl_FragColor = texture2D(u_Sampler, v_TexCoord);\n } else if (u_Face == 3) {\n gl_FragColor = texture2D(l_Sampler, v_TexCoord);\n } else if (u_Face == 4) {\n gl_FragColor = texture2D(d_Sampler, v_TexCoord);\n } else {\n gl_FragColor = texture2D(b_Sampler, v_TexCoord);\n }\n}\n")),i(this.gl,e.CubeGLProgram);else{if(!(t instanceof S))throw new Error("当前场景非法");e.SphereGLProgram||(e.SphereGLProgram=a(this.gl,"attribute vec4 a_Position;\nattribute vec2 a_TexCoord;\nvarying vec2 v_TexCoord;\nuniform mat4 u_MvpMatrix;\n\nvoid main() {\n gl_Position = u_MvpMatrix * a_Position;\n v_TexCoord = a_TexCoord;\n}\n","precision mediump float;\n\nuniform sampler2D u_Sampler;\nvarying vec2 v_TexCoord;\n\nvoid main() {\n gl_FragColor = texture2D(u_Sampler, v_TexCoord);\n}\n")),i(this.gl,e.SphereGLProgram)}},e.prototype.setStyle=function(){var e=this.container,t=this.canvas;e.style.overflow="hidden";var r=e.style.position;"absolute"!==r&&"fixed"!==r&&(e.style.position="relative");var n=e.offsetWidth,o=e.offsetHeight,i=window.devicePixelRatio||1;t.width=n*i,t.height=o*i,t.style.width=n+"px",t.style.height=o+"px",this.gl.viewport(0,0,t.width,t.height),t.style.cursor="grab"},e.prototype.onContainerResize=function(){var e=this;ResizeObserver&&new ResizeObserver((function(){e.rendered&&(e.setStyle(),e.render())})).observe(this.container)},e.prototype.addListener=function(e,t){"sceneChange"===e&&this.sceneChangeCallbacks.push(t)},e.prototype.removeListener=function(e,t){"sceneChange"===e&&(this.sceneChangeCallbacks=this.sceneChangeCallbacks.filter((function(e){return e!==t})))},e.prototype.removeAllListeners=function(){this.sceneChangeCallbacks=[]},e.prototype.addScene=function(e){this.scenes.push(e)},e.prototype.render=function(){var e=this,t=function(){var t=e.scenes[e.sceneIndex];if(!t)throw new Error("当前场景不存在");e.initShader();var r=e.gl;r.clearColor(0,0,0,1),r.enable(r.DEPTH_TEST),t.render(e),e.rendered=!0};this.rendered?t():function(e){return f(this,void 0,void 0,(function(){var t,r,n,o,i,a;return h(this,(function(s){switch(s.label){case 0:return(t=e.scenes).length>0?[4,(c=t[0],p(d(c)))]:[3,2];case 1:s.sent(),s.label=2;case 2:return t.length>1&&(r=[],(n=t[0].hotSpots).length>0&&(r=n.map((function(e){return e.target}))),o=[],r.forEach((function(e){var r=t[e];r&&(o=o.concat(d(r)))})),p(o),i=r.concat([0]),a=[],t.forEach((function(e,r){if(!i.includes(r)){var n=t[r];n&&(a=a.concat(d(n)))}})),p(a)),[2]}var c}))}))}(this).then(t)},e.prototype.getCurrentScene=function(){return this.scenes[this.sceneIndex]},e.prototype.setScene=function(e){if("number"==typeof e){if(e<0||e>this.scenes.length-1)throw new Error("场景索引超出范围");this.switchScene(e)}else{var t=this.scenes.indexOf(e);if(-1===t)throw new Error("场景不存在");this.switchScene(t)}},e}(),A=function(){function e(e,t){void 0===t&&(t={});var r=t.pitch,n=void 0===r?0:r,o=t.yaw,i=void 0===o?0:o,a=t.target;e.style.position="absolute",e.style.cursor="pointer",this.dom=e,this.pitch=n,this.yaw=i,this.target=a,this.originOnClick=e.onclick}return e.prototype.render=function(e,t,r,n){var o=this;this.pano=r,this.scene=n;var i=this.pano.container;(this.target||0===this.target)&&(this.dom.onclick=function(e){o.scene.onHotSpotClick(o),o.originOnClick&&o.originOnClick(e)}),i.append(this.dom);var a=this.dom.getBoundingClientRect(),s=a.width,c=a.height,u=(i.offsetWidth-s)/2,f=(i.offsetHeight-c)/2,h=i.offsetWidth,l=i.offsetHeight;this.pitch+=e,this.yaw-=t;var p,d=Math.tan(m(Math.abs(this.pitch)))*(i.offsetHeight/2)*1.5,g=this.pitch>0?f-d:f+d;this.dom.style.top=g+"px",this.yaw=y(this.yaw),p=this.yaw>=0&&this.yaw<90?Math.tan(m(this.yaw)):this.yaw>270?-Math.tan(m(360-this.yaw)):4,p*=i.offsetWidth/2*(l/h)*1.5,this.dom.style.left=u+p+"px"},e.prototype.destroy=function(){this.pano.container&&this.pano.container.removeChild(this.dom)},e}();XLPano=r})();
//# sourceMappingURL=xlpano.min.js.map