wordpress-plugin
Version:
Boilerplate WordPress Plugin structure to support development of JavaScript frameworks: React, Vue, Vanilla, TypeScript, supporting Vite, NextJS, Nuxt, Gatsby, and JSX/TSX Components (like MUI), CSS (like Tailwind + Unity), data APIs (like REST and GraphQ
98 lines • 150 kB
JavaScript
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(d){return d.raw=d};$jscomp.createTemplateTagFirstArgWithRaw=function(d,c){d.raw=c;return d};$jscomp.arrayIteratorImpl=function(d){var c=0;return function(){return c<d.length?{done:!1,value:d[c++]}:{done:!0}}};$jscomp.arrayIterator=function(d){return{next:$jscomp.arrayIteratorImpl(d)}};$jscomp.makeIterator=function(d){var c="undefined"!=typeof Symbol&&Symbol.iterator&&d[Symbol.iterator];return c?c.call(d):$jscomp.arrayIterator(d)};
$jscomp.getGlobal=function(d){d=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,d];for(var c=0;c<d.length;++c){var l=d[c];if(l&&l.Math==Math)return l}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,c,l){d!=Array.prototype&&d!=Object.prototype&&(d[c]=l.value)};$jscomp.polyfill=function(d,c,l,w){if(c){l=$jscomp.global;d=d.split(".");for(w=0;w<d.length-1;w++){var p=d[w];p in l||(l[p]={});l=l[p]}d=d[d.length-1];w=l[d];c=c(w);c!=w&&null!=c&&$jscomp.defineProperty(l,d,{configurable:!0,writable:!0,value:c})}};$jscomp.FORCE_POLYFILL_PROMISE=!1;
$jscomp.polyfill("Promise",function(d){function c(){this.batch_=null}function l(c){return c instanceof p?c:new p(function(d,S){d(c)})}if(d&&!$jscomp.FORCE_POLYFILL_PROMISE)return d;c.prototype.asyncExecute=function(c){if(null==this.batch_){this.batch_=[];var d=this;this.asyncExecuteFunction(function(){d.executeBatch_()})}this.batch_.push(c)};var w=$jscomp.global.setTimeout;c.prototype.asyncExecuteFunction=function(c){w(c,0)};c.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var c=
this.batch_;this.batch_=[];for(var d=0;d<c.length;++d){var n=c[d];c[d]=null;try{n()}catch(K){this.asyncThrow_(K)}}}this.batch_=null};c.prototype.asyncThrow_=function(c){this.asyncExecuteFunction(function(){throw c;})};var p=function(c){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var d=this.createResolveAndReject_();try{c(d.resolve,d.reject)}catch(n){d.reject(n)}};p.prototype.createResolveAndReject_=function(){function c(c){return function(k){n||(n=!0,c.call(d,k))}}var d=this,n=!1;
return{resolve:c(this.resolveTo_),reject:c(this.reject_)}};p.prototype.resolveTo_=function(c){if(c===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(c instanceof p)this.settleSameAsPromise_(c);else{a:switch(typeof c){case "object":var d=null!=c;break a;case "function":d=!0;break a;default:d=!1}d?this.resolveToNonPromiseObj_(c):this.fulfill_(c)}};p.prototype.resolveToNonPromiseObj_=function(c){var d=void 0;try{d=c.then}catch(n){this.reject_(n);return}"function"==typeof d?
this.settleSameAsThenable_(d,c):this.fulfill_(c)};p.prototype.reject_=function(c){this.settle_(2,c)};p.prototype.fulfill_=function(c){this.settle_(1,c)};p.prototype.settle_=function(c,d){if(0!=this.state_)throw Error("Cannot settle("+c+", "+d+"): Promise already settled in state"+this.state_);this.state_=c;this.result_=d;this.executeOnSettledCallbacks_()};p.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var c=0;c<this.onSettledCallbacks_.length;++c)v.asyncExecute(this.onSettledCallbacks_[c]);
this.onSettledCallbacks_=null}};var v=new c;p.prototype.settleSameAsPromise_=function(c){var d=this.createResolveAndReject_();c.callWhenSettled_(d.resolve,d.reject)};p.prototype.settleSameAsThenable_=function(c,d){var k=this.createResolveAndReject_();try{c.call(d,k.resolve,k.reject)}catch(K){k.reject(K)}};p.prototype.then=function(c,d){function k(c,d){return"function"==typeof c?function(d){try{l(c(d))}catch(H){w(H)}}:d}var l,w,v=new p(function(c,d){l=c;w=d});this.callWhenSettled_(k(c,l),k(d,w));return v};
p.prototype.catch=function(c){return this.then(void 0,c)};p.prototype.callWhenSettled_=function(c,d){function k(){switch(l.state_){case 1:c(l.result_);break;case 2:d(l.result_);break;default:throw Error("Unexpected state: "+l.state_);}}var l=this;null==this.onSettledCallbacks_?v.asyncExecute(k):this.onSettledCallbacks_.push(k)};p.resolve=l;p.reject=function(c){return new p(function(d,l){l(c)})};p.race=function(c){return new p(function(d,p){for(var k=$jscomp.makeIterator(c),n=k.next();!n.done;n=k.next())l(n.value).callWhenSettled_(d,
p)})};p.all=function(c){var d=$jscomp.makeIterator(c),n=d.next();return n.done?l([]):new p(function(c,k){function p(d){return function(l){w[d]=l;v--;0==v&&c(w)}}var w=[],v=0;do w.push(void 0),v++,l(n.value).callWhenSettled_(p(w.length-1),k),n=d.next();while(!n.done)})};return p},"es6","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};
$jscomp.SymbolClass=function(d,c){this.$jscomp$symbol$id_=d;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:c})};$jscomp.SymbolClass.prototype.toString=function(){return this.$jscomp$symbol$id_};$jscomp.Symbol=function(){function d(l){if(this instanceof d)throw new TypeError("Symbol is not a constructor");return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX+(l||"")+"_"+c++,l)}var c=0;return d}();
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var d=$jscomp.global.Symbol.iterator;d||(d=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[d]&&$jscomp.defineProperty(Array.prototype,d,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var d=$jscomp.global.Symbol.asyncIterator;d||(d=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("Symbol.asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(d){$jscomp.initSymbolIterator();d={next:d};d[$jscomp.global.Symbol.iterator]=function(){return this};return d};$jscomp.underscoreProtoCanBeSet=function(){var d={a:!0},c={};try{return c.__proto__=d,c.a}catch(l){}return!1};
$jscomp.setPrototypeOf="function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(d,c){d.__proto__=c;if(d.__proto__!==c)throw new TypeError(d+" is not extensible");return d}:null;$jscomp.generator={};$jscomp.generator.ensureIteratorResultIsObject_=function(d){if(!(d instanceof Object))throw new TypeError("Iterator result "+d+" is not an object");};
$jscomp.generator.Context=function(){this.isRunning_=!1;this.yieldAllIterator_=null;this.yieldResult=void 0;this.nextAddress=1;this.finallyAddress_=this.catchAddress_=0;this.finallyContexts_=this.abruptCompletion_=null};$jscomp.generator.Context.prototype.start_=function(){if(this.isRunning_)throw new TypeError("Generator is already running");this.isRunning_=!0};$jscomp.generator.Context.prototype.stop_=function(){this.isRunning_=!1};
$jscomp.generator.Context.prototype.jumpToErrorHandler_=function(){this.nextAddress=this.catchAddress_||this.finallyAddress_};$jscomp.generator.Context.prototype.next_=function(d){this.yieldResult=d};$jscomp.generator.Context.prototype.throw_=function(d){this.abruptCompletion_={exception:d,isException:!0};this.jumpToErrorHandler_()};$jscomp.generator.Context.prototype.return=function(d){this.abruptCompletion_={return:d};this.nextAddress=this.finallyAddress_};
$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks=function(d){this.abruptCompletion_={jumpTo:d};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.yield=function(d,c){this.nextAddress=c;return{value:d}};$jscomp.generator.Context.prototype.yieldAll=function(d,c){d=$jscomp.makeIterator(d);var l=d.next();$jscomp.generator.ensureIteratorResultIsObject_(l);if(l.done)this.yieldResult=l.value,this.nextAddress=c;else return this.yieldAllIterator_=d,this.yield(l.value,c)};
$jscomp.generator.Context.prototype.jumpTo=function(d){this.nextAddress=d};$jscomp.generator.Context.prototype.jumpToEnd=function(){this.nextAddress=0};$jscomp.generator.Context.prototype.setCatchFinallyBlocks=function(d,c){this.catchAddress_=d;void 0!=c&&(this.finallyAddress_=c)};$jscomp.generator.Context.prototype.setFinallyBlock=function(d){this.catchAddress_=0;this.finallyAddress_=d||0};$jscomp.generator.Context.prototype.leaveTryBlock=function(d,c){this.nextAddress=d;this.catchAddress_=c||0};
$jscomp.generator.Context.prototype.enterCatchBlock=function(d){this.catchAddress_=d||0;d=this.abruptCompletion_.exception;this.abruptCompletion_=null;return d};$jscomp.generator.Context.prototype.enterFinallyBlock=function(d,c,l){l?this.finallyContexts_[l]=this.abruptCompletion_:this.finallyContexts_=[this.abruptCompletion_];this.catchAddress_=d||0;this.finallyAddress_=c||0};
$jscomp.generator.Context.prototype.leaveFinallyBlock=function(d,c){c=this.finallyContexts_.splice(c||0)[0];if(c=this.abruptCompletion_=this.abruptCompletion_||c){if(c.isException)return this.jumpToErrorHandler_();void 0!=c.jumpTo&&this.finallyAddress_<c.jumpTo?(this.nextAddress=c.jumpTo,this.abruptCompletion_=null):this.nextAddress=this.finallyAddress_}else this.nextAddress=d};$jscomp.generator.Context.prototype.forIn=function(d){return new $jscomp.generator.Context.PropertyIterator(d)};
$jscomp.generator.Context.PropertyIterator=function(d){this.object_=d;this.properties_=[];for(var c in d)this.properties_.push(c);this.properties_.reverse()};$jscomp.generator.Context.PropertyIterator.prototype.getNext=function(){for(;0<this.properties_.length;){var d=this.properties_.pop();if(d in this.object_)return d}return null};$jscomp.generator.Engine_=function(d){this.context_=new $jscomp.generator.Context;this.program_=d};
$jscomp.generator.Engine_.prototype.next_=function(d){this.context_.start_();if(this.context_.yieldAllIterator_)return this.yieldAllStep_(this.context_.yieldAllIterator_.next,d,this.context_.next_);this.context_.next_(d);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.return_=function(d){this.context_.start_();var c=this.context_.yieldAllIterator_;if(c)return this.yieldAllStep_("return"in c?c["return"]:function(c){return{value:c,done:!0}},d,this.context_.return);this.context_.return(d);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.throw_=function(d){this.context_.start_();if(this.context_.yieldAllIterator_)return this.yieldAllStep_(this.context_.yieldAllIterator_["throw"],d,this.context_.next_);this.context_.throw_(d);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.yieldAllStep_=function(d,c,l){try{var w=d.call(this.context_.yieldAllIterator_,c);$jscomp.generator.ensureIteratorResultIsObject_(w);if(!w.done)return this.context_.stop_(),w;var p=w.value}catch(v){return this.context_.yieldAllIterator_=null,this.context_.throw_(v),this.nextStep_()}this.context_.yieldAllIterator_=null;l.call(this.context_,p);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.nextStep_=function(){for(;this.context_.nextAddress;)try{var d=this.program_(this.context_);if(d)return this.context_.stop_(),{value:d.value,done:!1}}catch(c){this.context_.yieldResult=void 0,this.context_.throw_(c)}this.context_.stop_();if(this.context_.abruptCompletion_){d=this.context_.abruptCompletion_;this.context_.abruptCompletion_=null;if(d.isException)throw d.exception;return{value:d.return,done:!0}}return{value:void 0,done:!0}};
$jscomp.generator.Generator_=function(d){this.next=function(c){return d.next_(c)};this.throw=function(c){return d.throw_(c)};this.return=function(c){return d.return_(c)};$jscomp.initSymbolIterator();this[Symbol.iterator]=function(){return this}};$jscomp.generator.createGenerator=function(d,c){c=new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(c));$jscomp.setPrototypeOf&&$jscomp.setPrototypeOf(c,d.prototype);return c};
$jscomp.asyncExecutePromiseGenerator=function(d){function c(c){return d.next(c)}function l(c){return d.throw(c)}return new Promise(function(w,p){function v(d){d.done?w(d.value):Promise.resolve(d.value).then(c,l).then(v,p)}v(d.next())})};$jscomp.asyncExecutePromiseGeneratorFunction=function(d){return $jscomp.asyncExecutePromiseGenerator(d())};$jscomp.asyncExecutePromiseGeneratorProgram=function(d){return $jscomp.asyncExecutePromiseGenerator(new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(d)))};
(function(d,c){"object"===typeof exports&&"undefined"!==typeof module?c(exports,require("three")):"function"===typeof define&&define.amd?define(["exports","three"],c):(d=d||self,c(d.PANOLENS={},d.THREE))})(this,function(d,c){function l(a){this.constraints=Object.assign({video:{width:{ideal:1920},height:{ideal:1080},facingMode:{exact:"environment"}},audio:!1},a);this.element=this.scene=this.container=null;this.devices=[];this.stream=null;this.ratioScalar=1;this.videoDeviceIndex=0}function w(a){this.format=
null;this.eyeSep=void 0===a?.064:a;this.loffset=new c.Vector2;this.roffset=new c.Vector2}function p(a,b,e){a=void 0===a?16777215:a;b=void 0===b?!0:b;e=void 0===e?1500:e;this.dpr=window.devicePixelRatio;var f=this.createCanvas(),m=f.canvas;f=f.context;var d=new c.SpriteMaterial({color:a,map:this.createCanvasTexture(m)});c.Sprite.call(this,d);this.canvasWidth=m.width;this.canvasHeight=m.height;this.context=f;this.color=a instanceof c.Color?a:new c.Color(a);this.autoSelect=b;this.dwellTime=e;this.rippleDuration=
500;this.position.z=-10;this.center.set(.5,.5);this.scale.set(.5,.5,1);this.callback=this.timerId=this.startTimestamp=null;this.frustumCulled=!1;this.updateCanvasArcByProgress(0)}function v(a,b,e){a=void 0===a?300:a;b=b||C.Info;c.Sprite.call(this);this.type="infospot";this.animated=void 0!==e?e:!0;this.frustumCulled=this.isHovering=!1;this.cursorStyle=this.toPanorama=this.element=null;this.mode=z.NORMAL;this.scale.set(a,a,1);this.rotation.y=Math.PI;this.container=null;this.originalRaycast=this.raycast;
this.HANDLER_FOCUS=null;this.material.side=c.DoubleSide;this.material.depthTest=!1;this.material.transparent=!0;this.material.opacity=0;this.scaleUpAnimation=new q.Tween;this.scaleDownAnimation=new q.Tween;e=function(b){if(this.material){var f=b.image.width/b.image.height,e=new c.Vector3;b.image.width=b.image.naturalWidth||64;b.image.height=b.image.naturalHeight||64;this.scale.set(f*a,a,1);e.copy(this.scale);this.scaleUpAnimation=(new q.Tween(this.scale)).to({x:1.3*e.x,y:1.3*e.y},500).easing(q.Easing.Elastic.Out);
this.scaleDownAnimation=(new q.Tween(this.scale)).to({x:e.x,y:e.y},500).easing(q.Easing.Elastic.Out);this.material.map=b;this.material.needsUpdate=!0}}.bind(this);this.showAnimation=(new q.Tween(this.material)).to({opacity:1},500).onStart(this.enableRaycast.bind(this,!0)).easing(q.Easing.Quartic.Out);this.hideAnimation=(new q.Tween(this.material)).to({opacity:0},500).onStart(this.enableRaycast.bind(this,!1)).easing(q.Easing.Quartic.Out);this.addEventListener("click",this.onClick);this.addEventListener("hover",
this.onHover);this.addEventListener("hoverenter",this.onHoverStart);this.addEventListener("hoverleave",this.onHoverEnd);this.addEventListener("panolens-dual-eye-effect",this.onDualEyeEffect);this.addEventListener(g.CONTAINER,this.setContainer.bind(this));this.addEventListener("panorama-leave",this.onDismiss);this.addEventListener("dismiss",this.onDismiss);this.addEventListener("panolens-infospot-focus",this.setFocusMethod);Z.load(b,e)}function S(a){a||console.warn("PANOLENS.Widget: No container specified");
c.EventDispatcher.call(this);this.DEFAULT_TRANSITION="all 0.27s ease";this.TOUCH_ENABLED=!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch);this.PREVENT_EVENT_HANDLER=function(a){a.preventDefault();a.stopPropagation()};this.container=a;this.mask=this.activeSubMenu=this.activeMainItem=this.mainMenu=this.settingElement=this.videoElement=this.fullscreenElement=this.barElement=null}function k(){this.edgeLength=1E4;c.Mesh.call(this,this.createGeometry(this.edgeLength),
this.createMaterial());this.type="panorama";this.ImageQualityLow=1;this.ImageQualityFair=2;this.ImageQualityMedium=3;this.ImageQualityHigh=4;this.ImageQualitySuperHigh=5;this.animationDuration=1E3;this.defaultInfospotSize=350;this.container=void 0;this.loaded=!1;this.linkedSpots=[];this.isInfospotVisible=!1;this.linkingImageScale=this.linkingImageURL=void 0;this.renderOrder=-1;this.active=this.visible=!1;this.infospotAnimation=(new q.Tween(this)).to({},this.animationDuration/2);this.addEventListener(g.CONTAINER,
this.setContainer.bind(this));this.addEventListener("click",this.onClick.bind(this));this.setupTransitions()}function n(a){k.call(this);this.src=a;this.type="image_panorama"}function K(){k.call(this);this.type="empty_panorama"}function U(a){a=void 0===a?[]:a;k.call(this);this.geometry.deleteAttribute("normal");this.geometry.deleteAttribute("uv");this.images=a;this.type="cube_panorama"}function fa(){for(var a=[],b=0;6>b;b++)a.push(C.WhiteTile);U.call(this,a);this.type="basic_panorama"}function D(a,
b){b=void 0===b?{}:b;k.call(this);this.src=a;this.options=Object.assign({videoElement:document.createElement("video"),loop:!0,muted:!0,autoplay:!1,playsinline:!0,crossOrigin:"anonymous"},b);this.videoElement=this.options.videoElement;this.videoProgress=0;this.type="video_panorama";this.addEventListener(g.LEAVE,this.pauseVideo.bind(this));this.addEventListener(g.ENTER_FADE_START,this.resumeVideoProgress.bind(this));this.addEventListener("video-toggle",this.toggleVideo.bind(this));this.addEventListener("video-time",
this.setVideoCurrentTime.bind(this))}function T(a){this._parameters=a=void 0===a?{}:a;this._panoId=this._zoom=null;this._panoClient=new google.maps.StreetViewService;this._total=this._count=0;this._canvas=[];this._ctx=[];this._hc=this._wc=0;this.result=null;this.rotation=0;this.copyright="";this.onPanoramaLoad=this.onSizeChange=null;this.levelsW=[1,2,4,7,13,26];this.levelsH=[1,1,2,4,7,13];this.widths=[416,832,1664,3328,6656,13312];this.heights=[416,416,832,1664,3328,6656];this.maxH=this.maxW=6656;
var b;try{var e=document.createElement("canvas");(b=e.getContext("experimental-webgl"))||(b=e.getContext("webgl"))}catch(f){}this.maxW=Math.max(b.getParameter(b.MAX_TEXTURE_SIZE),this.maxW);this.maxH=Math.max(b.getParameter(b.MAX_TEXTURE_SIZE),this.maxH)}function ea(a,b){n.call(this);this.panoId=a;this.gsvLoader=null;this.loadRequested=!1;this.setupGoogleMapAPI(b);this.type="google_streetview_panorama"}function H(a,b){"image"===(void 0===a?"image":a)&&n.call(this,b);this.EPS=1E-6;this.frameId=null;
this.dragging=!1;this.userMouse=new c.Vector2;this.quatA=new c.Quaternion;this.quatB=new c.Quaternion;this.quatCur=new c.Quaternion;this.quatSlerp=new c.Quaternion;this.vectorX=new c.Vector3(1,0,0);this.vectorY=new c.Vector3(0,1,0);this.type="little_planet";this.addEventListener(g.WIDNOW_RESIZE,this.onWindowResize)}function aa(a){H.call(this,"image",a);this.type="image_little_planet"}function X(a){k.call(this);this.media=new l(a);this.type="camera_panorama";this.addEventListener(g.ENTER,this.start.bind(this));
this.addEventListener(g.LEAVE,this.stop.bind(this));this.addEventListener(g.CONTAINER,this.onPanolensContainer.bind(this));this.addEventListener("panolens-scene",this.onPanolensScene.bind(this))}function O(a,b){b=void 0===b?new w:b;n.call(this,a);this.stereo=b;this.type="stereo_image_panorama"}function P(a,b,e){b=void 0===b?{}:b;e=void 0===e?new w:e;D.call(this,a,b);this.stereo=e;this.type="stereo_video_panorama"}function wa(a,b,e,f){function c(){n=P.addSourceBuffer('video/mp4; codecs="avc1.640033"');
n.mode="sequence"}function d(){L(N,{responseType:"text",onreadystatechange:function(a){if((a=a.target)&&a.readyState==a.DONE){a=(new DOMParser).parseFromString(a.response,"text/xml",0);try{a.querySelectorAll("Representation"),q=1,w=a.querySelectorAll("SegmentURL"),ha=a.querySelectorAll("Initialization"),A.frameCount=w.length}catch(xa){console.log(xa)}z=F.allow_streaming?Math.min(60,A.frameCount):A.frameCount;Z(V)}}})}function x(a,b){D=ia.length;H=la=0;var c=8;B&&(c=4);for(b=0;b<c;b++)t(a,z,function(){ba||
(e(r,F),ba=!0);for(var b=0;b<c;b++)t(a,D,function(){f(r,F)})})}function t(a,b,f){setTimeout(g,0,a,b,f)}function g(a,b,f){var e,c,m,d,u,h,x;return $jscomp.asyncExecutePromiseGeneratorProgram(function(t){switch(t.nextAddress){case 1:if(!(E<b)){t.jumpTo(3);break}e=0;c=!1;m=ia[la++];E++;case 4:if(!(3>e)||c){t.jumpTo(1);break}d=new Headers;d.append("Range",m.content);d.append("cache-control","no-store");d.append("pragma","no-cache");d.append("cache-control","no-cache");t.setCatchFinallyBlocks(6,7);return t.yield(fetch(a,
{headers:d,method:"GET"}),9);case 9:return u=t.yieldResult,t.yield(u.arrayBuffer(),10);case 10:h=t.yieldResult,y[m.index]=h,H++,c=!0;case 7:t.enterFinallyBlock();t.leaveFinallyBlock(4);break;case 6:x=t.enterCatchBlock();console.log("exception during chunk download, retrying",++e,x);e++;t.jumpTo(7);break;case 3:H===b&&f(),t.jumpToEnd()}})}function ca(){r.removeEventListener("canplay",R,!1);r.currentTime=A.currentIndex}function R(){r.removeEventListener("loadeddata",ca,!1);r.currentTime=A.currentIndex}
function h(){r.currentTime=A.currentIndex;da=ba=!0;e(r,F);f(r,F);r.removeEventListener("loadeddata",ca,!1);r.removeEventListener("canplay",R,!1);r.removeEventListener("timeupdate",h,!1)}function L(a,b){if(null!=a&&""!==a){var f=new XMLHttpRequest;f.open("GET",a,!0);b&&(f.responseType=b.responseType,b.onreadystatechange&&(f.onreadystatechange=b.onreadystatechange.bind(f)),b.onload&&(f.onload=b.onload));f.addEventListener("error",function(a){console.log("Error: "+a+" Could not load url.")},!1);f.send();
return f}}function l(a,b,f,e,c){return{header:"Range",content:"bytes="+a.getAttribute("mediaRange").toString(),index:b,countPosition:f,firstPass:e,firstPassCompleteIndex:c}}function k(a,b,f,e){var c=[],m=0;if(void 0===e?0:e){for(b=0;b<a.length;b++)c.push(l(a[b],b,!1));return c}e=parseInt(Math.round(a.length/b),10);var d=Math.ceil(a.length/b);d=b+d;for(b=0;b<d;b++)a[b*e]&&(c.push(l(a[b*e],b*e,m++,!0,d)),f.push(b*e));d=c.length;for(b=0;b<c.length;b++)c[b].firstPassCompleteIndex=d;f=e;m=0;for(e=Math.floor(e/
2);1<e;e=Math.floor(e/2)){for(b=0;b<a.length/f;b++)a[e+b*f]&&c.push(l(a[e+b*f],e+b*f,m++,!1,d));f=Math.floor(e/2)}f=[];for(b=0;b<c.length;b++)f[c[b].index]=c[b].index;for(b=0;b<a.length;b++)f[b]||c.push(l(a[b],b,m++,!1,d));a=function(a,b){return a.filter(function(a,f,e){return e.map(function(a){return a[b]}).indexOf(a[b])===f})}(c,"index");c=[];f=[];return a}function p(a){return new Uint8Array([(a&4278190080)>>24,(a&16711680)>>16,(a&65280)>>8,a&255])}var A=this,n,q,w=[],r=document.createElement("video"),
v=[],z,C,B,D,la,H,ha=[],M=-1,ia,y=[],E=0,K=0,ba,F={},N,V,I,G,ja,ma,J,S=[112,97,115,112],U=[116,107,104,100],da;navigator.userAgent.match(/Android/i)?B=!0:navigator.userAgent.match(/iPhone|iPad|iPod/i)&&(C=!0);if(/Chrome/i.test(navigator.userAgent.toLowerCase())||/Chrome WebView/i.test(navigator.userAgent.toLowerCase())||/Chromium/i.test(navigator.userAgent.toLowerCase()))var W=!0;else if(/Firefox/i.test(navigator.userAgent.toLowerCase())||/Supermedium/i.test(navigator.userAgent.toLowerCase())){var O=
!0;B||(W=!0)}else/Safari/i.test(navigator.userAgent.toLowerCase())&&/Chrome/i.test(navigator.userAgent.toLowerCase());if(W){var P=new MediaSource;r.src=window.URL.createObjectURL(P);r.preload="auto";P.addEventListener("sourceopen",c)}else r.setAttribute("playsinline",""),r.muted=!0,r.autoplay=!0;fetch("https://my.panomoments.com/sdk/moment",{method:"POST",body:"private_api_key="+a.private_api_key+"&public_api_key="+a.public_api_key+"&moment_id="+a.moment_id+"&variation="+a.variation+"&sdk_client_type=web",
headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(a){return a.json()}).then(function(a){F=a;N=F.web_mpd_url;V=F.web_video_url;d()});this.frameCount=this.currentIndex=0;this.render=function(a){if(ba){G=a/A.frameCount*360;ja=360/A.frameCount;F.clockwise?0>G&&(G=360+G):(G=-G,G=540+G);G%=360;I=parseInt(Math.round(G/ja),10);if(I==A.frameCount&&F.moment_type)I=A.frameCount-1;else if(I==A.frameCount&&!F.moment_type||!I)I=0;if(A.textureReady()&&M!=I){if(W){if(0==ia.length||y[I])var f=
I;else{var e=!1,c=!1;for(a=I;!e&&a<A.frameCount;)y[a]?(e=!0,f=a):a++;for(a=I;!c&&0<=a;)if(y[a]){c=!0;var m=a}else a--;f||(f=A.frameCount);f=Math.abs(I-f)<=Math.abs(I-m)&&f==A.frameCount?0:Math.abs(I-f)<=Math.abs(I-m)?f:m}f||(f=0)}else f=I;A.currentIndex=f;f=A.currentIndex;ma!=f&&((ma=f,W)?y[f]&&n&&!n.updating&&ba&&(f<A.frameCount?(r.currentTime+=1/q,n.timestampOffset=r.currentTime,F.aligned?n.appendBuffer(y[f]):n.appendBuffer(y[(f+framePadding)%A.frameCount])):console.log("Invalid Index")):C||O?F.aligned?
r.fastSeek(1*f/q):r.fastSeek((f+framePadding)%A.frameCount/q):r.currentTime=1*f/q);M=I}b(r,F)}else console.log("Render called before download is ready. Wait for Ready callback before calling Render.")};this.dispose=function(){r.src="";q=n=f=e=b=r=null;w=[];P=null;v.splice(0,v.length);H=la=D=O=W=B=C=z=null;ha=[];ha.splice(0,ha.length);ia=M=null;y.splice(0,y.length);O=ba=K=E=null;F={};da=J=ma=ja=G=I=V=N=null;console.log("PanoMoment Web SDK Disposed")};this.textureReady=function(){return!W&&1==da&&r.readyState===
r.HAVE_ENOUGH_DATA||W&&(O&&3<=r.readyState||r.readyState===r.HAVE_ENOUGH_DATA)?!0:!1};var Z=function(a){var b,f,e,c,m,d,u,h,x,t,g,G,Q,L,r,l,R,ca;return $jscomp.asyncExecutePromiseGeneratorProgram(function(k){switch(k.nextAddress){case 1:b=new Headers,f="bytes="+ha[0].getAttribute("range").toString(),-1<a.indexOf("https://data.panomoments.com/")?a=a.replace(/data.panomoments.com/i,"s3.amazonaws.com/data.panomoments.com"):-1<a.indexOf("https://staging-data.panomoments.com/")&&(a=a.replace(/staging-data.panomoments.com/i,
"s3.amazonaws.com/staging-data.panomoments.com")),b.append("Range",f),e=0,c=!1;case 2:if(!(5>e)||c){k.jumpTo(0);break}k.setCatchFinallyBlocks(4);return k.yield(fetch(a,{headers:b,method:"GET"}),6);case 6:return m=k.yieldResult,k.yield(m.arrayBuffer(),7);case 7:d=k.yieldResult;J=new Uint8Array(d);u=ka(J,S);h=ka(J,U);0<h&&0<u&&(x=new ArrayBuffer(2),t=new DataView(x),t.setInt8(0,J[h+80]),t.setInt8(1,J[h+81]),g=t.getUint16(0),g=g.toString(),G=new ArrayBuffer(2),Q=new DataView(G),Q.setInt8(0,J[h+82]),
Q.setInt8(1,J[h+83]),L=parseFloat(Q.getUint16(0))/Math.pow(2,16),L=L.toString().substr(1),r=g.toString()+L.toString(),l=parseFloat(J[u+7])/parseFloat(J[u+11]),R=Math.round(parseFloat(r)/l),new Uint8Array([p(R)[2],p(R)[3]]),J[h+80]=p(R)[2],J[h+81]=p(R)[3],J[h+82]=[0],J[u+7]=[1],J[u+11]=[1]);ea(V);c=!0;k.leaveTryBlock(2);break;case 4:ca=k.enterCatchBlock(),console.log("failure during init",e,ca),e++,k.jumpTo(2)}})},T=function(a){(!n||n&&n.updating)&&0==K?(console.log("Buffer not ready. Retrying in 1 second."),
setTimeout(function(){T(a)},1E3)):a&&n&&!n.updating&&0==K&&(r.currentTime+=1/q,n.timestampOffset=r.currentTime,n.appendBuffer(a),K++,setTimeout(function(){T(a)},500))},ea=function(a){var f,e,c,m,d,u,h,x,t,g;return $jscomp.asyncExecutePromiseGeneratorProgram(function(G){switch(G.nextAddress){case 1:f=new Headers,e=F.start_frame+90,ja=360/A.frameCount,F.clockwise||(e=-e),0>e&&(e=360+e),A.currentIndex=parseInt(Math.round(e/ja),10),c="bytes="+w[A.currentIndex].getAttribute("mediaRange").toString(),f.append("Range",
c),-1<a.indexOf("https://data.panomoments.com/")?a=a.replace(/data.panomoments.com/i,"s3.amazonaws.com/data.panomoments.com"):-1<a.indexOf("https://staging-data.panomoments.com/")&&(a=a.replace(/staging-data.panomoments.com/i,"s3.amazonaws.com/staging-data.panomoments.com")),m=0,d=!1;case 2:if(!(5>m)||d){G.jumpTo(0);break}G.setCatchFinallyBlocks(4);return G.yield(fetch(a,{headers:f,method:"GET"}),6);case 6:return u=G.yieldResult,G.yield(u.arrayBuffer(),7);case 7:h=G.yieldResult;x=new Uint8Array(h);
t=new Int8Array(J.length+x.length);t.set(J);t.set(x,J.length);W?(y[A.currentIndex]=h,T(t),b(r,F),ia=k(w,z,v,!1)):(r.addEventListener("loadeddata",X),r.addEventListener("canplay",Y),r.src=window.URL.createObjectURL(new Blob([t],{type:"video/mp4"})),r.pause());window.self!==window.top?fa(a):aa(a);d=!0;G.leaveTryBlock(2);break;case 4:g=G.enterCatchBlock(),console.log("failure during first frame download",m,g),m++,G.jumpTo(2)}})},fa=function(a){var b=document.createElement("div");b.style.margin="1px";
b.style.height="100%";b.style.width="100%";b.style.pointerEvents="none";b.style.zIndex=-1;b.style.position="fixed";b.style.top=0;document.body.appendChild(b);var f=new IntersectionObserver(function(a){a[0].isIntersecting&&(f.disconnect(),document.body.removeChild(b),aa())});f.observe(b)},aa=function(a){W?x(V):fetch(V).then(function(a){a.arrayBuffer().then(function(a){da=!1;r.addEventListener("loadeddata",ca,!1);r.addEventListener("canplay",R,!1);r.addEventListener("timeupdate",h,!1);a=new Uint8Array(a);
var b=ka(J,S),f=ka(J,U);if(0<f&&0<b){var e=new ArrayBuffer(2);e=new DataView(e);e.setInt8(0,a[f+80]);e.setInt8(1,a[f+81]);e=e.getUint16(0);e=e.toString();var c=new ArrayBuffer(2);c=new DataView(c);c.setInt8(0,a[f+82]);c.setInt8(1,a[f+83]);c=parseFloat(c.getUint16(0))/Math.pow(2,16);c=c.toString().substr(1);e=e.toString()+c.toString();c=parseFloat(a[b+7])/parseFloat(a[b+11]);e=Math.round(parseFloat(e)/c);a[f+80]=p(e)[2];a[f+81]=p(e)[3];a[f+82]=[0];a[b+7]=[1];a[b+11]=[1]}r.src=window.URL.createObjectURL(new Blob([a],
{type:"video/mp4"}));r.pause()})})},X=function(){da=!0;r.removeEventListener("loadeddata",X);r.removeEventListener("canplay",Y);b(r,F)},Y=function(){da=!0;r.removeEventListener("canplay",Y);r.removeEventListener("loadeddata",X);b(r,F)},ka=function(a,b,f){f=a.indexOf(b[0],f||0);if(1===b.length||-1===f)return f;for(var e=f,c=0;c<b.length&&e<a.length;e++,c++)if(a[e]!==b[c])return ka(J,b,f+1);return e===f+b.length?f:-1}}function B(a){var b=this;k.call(this);this.identifier=a;this.momentData=this.PanoMoments=
null;this.status=g.PANOMOMENT.NONE;this.controls=this.camera=this.container=null;this.defaults={};this.setupDispatcher();this.handlerUpdateCallback=function(){return b.updateCallback()};this.handlerWindowResize=function(){return b.onWindowResize()};this.addEventListener(g.CONTAINER,function(a){return b.onPanolensContainer(a.container)});this.addEventListener(g.CAMERA,function(a){return b.onPanolensCamera(a.camera)});this.addEventListener(g.CONTROLS,function(a){return b.onPanolensControls(a.controls)});
this.addEventListener(g.FADE_IN,function(){return b.enter()});this.addEventListener(g.LEAVE_COMPLETE,function(){return b.leave()});this.addEventListener(g.LOAD_START,function(){return b.disableControl()});this.addEventListener(g.PANOMOMENT.READY,function(){return b.enableControl()})}function Y(a){var b=this;B.call(this,a);this.viewerResetControlLimits=function(){return b.resetControlLimits(!1)}}function na(a){B.call(this,a);this.scale2D=new c.Vector2(1,1)}function oa(a,b){function e(a){if(!1!==h.enabled){a.preventDefault();
if(a.button===h.mouseButtons.ORBIT){if(!0===h.noRotate)return;E=y.ROTATE;L.set(a.clientX,a.clientY)}else if(a.button===h.mouseButtons.ZOOM){if(!0===h.noZoom)return;E=y.DOLLY;r.set(a.clientX,a.clientY)}else if(a.button===h.mouseButtons.PAN){if(!0===h.noPan)return;E=y.PAN;p.set(a.clientX,a.clientY)}E!==y.NONE&&(document.addEventListener("mousemove",f,!1),document.addEventListener("mouseup",m,!1),h.dispatchEvent(T))}}function f(a){if(!1!==h.enabled){a.preventDefault();var b=h.domElement===document?h.domElement.body:
h.domElement;E===y.ROTATE?!0!==h.noRotate&&(l.set(a.clientX,a.clientY),n.subVectors(l,L),0==L.x&&0==L.y?(L.set(l.x,l.y),n.subVectors(l,L)):(h.rotateLeft(2*Math.PI*n.x/b.clientHeight*h.rotateSpeed),h.rotateUp(2*Math.PI*n.y/b.clientHeight*h.rotateSpeed),L.copy(l))):E===y.DOLLY?!0!==h.noZoom&&(z.set(a.clientX,a.clientY),C.subVectors(z,r),0<C.y?h.dollyIn():0>C.y&&h.dollyOut(),r.copy(z)):E===y.PAN&&!0!==h.noPan&&(A.set(a.clientX,a.clientY),q.subVectors(A,p),h.pan(q.x,q.y),p.copy(A))}}function m(){!1!==
h.enabled&&(document.removeEventListener("mousemove",f,!1),document.removeEventListener("mouseup",m,!1),h.dispatchEvent(V),E=y.NONE)}function d(a){if(!1!==h.enabled&&!0!==h.noZoom&&E===y.NONE){a.preventDefault();a.stopPropagation();var b=0;void 0!==a.wheelDelta?b=a.wheelDelta:void 0!==a.detail&&(b=-a.detail);0<b?(h.object.fov=h.object.fov<h.maxFov?h.object.fov+1:h.maxFov,h.object.updateProjectionMatrix()):0>b&&(h.object.fov=h.object.fov>h.minFov?h.object.fov-1:h.minFov,h.object.updateProjectionMatrix());
h.dispatchEvent(F);h.dispatchEvent(T);h.dispatchEvent(V);h.dispatchEvent(I)}}function x(a){}function t(a){if(!1!==h.enabled&&!0!==h.noKeys&&!0!==h.noRotate&&!h.autoRotate){var b=h.momentum&&!h.autoRotate?h.momentumKeydownFactor*h.momentumFactor:h.momentumKeydownFactor;switch(a.keyCode){case h.keys.UP:h.rotateUp(h.rotateSpeed*b);break;case h.keys.BOTTOM:h.rotateUp(-h.rotateSpeed*b);break;case h.keys.LEFT:h.rotateLeft(h.rotateSpeed*b);break;case h.keys.RIGHT:h.rotateLeft(-h.rotateSpeed*b)}}}function g(a){if(!1!==
h.enabled){switch(a.touches.length){case 1:if(!0===h.noRotate)return;E=y.TOUCH_ROTATE;L.set(a.touches[0].pageX,a.touches[0].pageY);break;case 2:if(!0===h.noZoom)return;E=y.TOUCH_DOLLY;var b=a.touches[0].pageX-a.touches[1].pageX;a=a.touches[0].pageY-a.touches[1].pageY;r.set(0,Math.sqrt(b*b+a*a));break;case 3:if(!0===h.noPan)return;E=y.TOUCH_PAN;p.set(a.touches[0].pageX,a.touches[0].pageY);break;default:E=y.NONE}E!==y.NONE&&h.dispatchEvent(T)}}function k(a){if(!1!==h.enabled){a.preventDefault();a.stopPropagation();
var b=h.domElement===document?h.domElement.body:h.domElement;switch(a.touches.length){case 1:if(!0===h.noRotate)break;if(E!==y.TOUCH_ROTATE)break;l.set(a.touches[0].pageX,a.touches[0].pageY);n.subVectors(l,L);h.rotateLeft(2*Math.PI*n.x/b.clientHeight*h.rotateSpeed);h.rotateUp(2*Math.PI*n.y/b.clientHeight*h.rotateSpeed);L.copy(l);break;case 2:if(!0===h.noZoom)break;if(E!==y.TOUCH_DOLLY)break;b=a.touches[0].pageX-a.touches[1].pageX;a=a.touches[0].pageY-a.touches[1].pageY;z.set(0,Math.sqrt(b*b+a*a));
C.subVectors(z,r);0>C.y?(h.object.fov=h.object.fov<h.maxFov?h.object.fov+1:h.maxFov,h.object.updateProjectionMatrix()):0<C.y&&(h.object.fov=h.object.fov>h.minFov?h.object.fov-1:h.minFov,h.object.updateProjectionMatrix());r.copy(z);h.dispatchEvent(F);h.dispatchEvent(I);break;case 3:if(!0===h.noPan)break;if(E!==y.TOUCH_PAN)break;A.set(a.touches[0].pageX,a.touches[0].pageY);q.subVectors(A,p);h.pan(q.x,q.y);p.copy(A);break;default:E=y.NONE}}}function R(){!1!==h.enabled&&(h.dispatchEvent(V),E=y.NONE)}
this.object=a;this.domElement=void 0!==b?b:document;this.frameId=null;this.enabled=!0;this.center=this.target=new c.Vector3;this.noZoom=!1;this.zoomSpeed=1;this.minDistance=0;this.maxDistance=Infinity;this.minZoom=0;this.maxZoom=Infinity;this.noRotate=!1;this.rotateSpeed=-.15;this.noPan=!0;this.keyPanSpeed=7;this.autoRotate=!1;this.autoRotateSpeed=2;this.minPolarAngle=0;this.maxPolarAngle=Math.PI;this.spherical=new c.Spherical;this.momentumKeydownFactor=.05;this.momentum=!0;this.momentumFactor=7.5;
this.dampingFactor=.9;this.speedLimit=Number.MAX_VALUE;this.enableDamping=!0;this.minFov=30;this.maxFov=120;this.minAzimuthAngle=-Infinity;this.maxAzimuthAngle=Infinity;this.noKeys=!1;this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40};this.mouseButtons={ORBIT:c.MOUSE.LEFT,ZOOM:c.MOUSE.MIDDLE,PAN:c.MOUSE.RIGHT};var h=this,L=new c.Vector2,l=new c.Vector2,n=new c.Vector2,p=new c.Vector2,A=new c.Vector2,q=new c.Vector2,w=new c.Vector3,v=new c.Vector3,r=new c.Vector2,z=new c.Vector2,C=new c.Vector2,B=0,D=0,
H=0,K=0,M=1,N=new c.Vector3,O=new c.Vector3,P=new c.Quaternion,y={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},E=y.NONE;this.target0=this.target.clone();this.position0=this.object.position.clone();this.zoom0=this.object.zoom;var S=(new c.Quaternion).setFromUnitVectors(a.up,new c.Vector3(0,1,0)),U=S.clone().inverse(),F={type:"change"},T={type:"start"},V={type:"end"},I={type:"fov"};this.setLastQuaternion=function(a){P.copy(a);h.object.quaternion.copy(a)};this.getLastPosition=
function(){return O};this.rotateLeft=function(a){void 0===a&&(a=2*Math.PI/60/60*h.autoRotateSpeed);a=this.momentum&&!this.autoRotate?a/=this.momentumFactor:a;K-=a};this.rotateUp=function(a){void 0===a&&(a=2*Math.PI/60/60*h.autoRotateSpeed);a=this.momentum&&!this.autoRotate?a/=this.momentumFactor:a;H-=a};this.rotateLeftStatic=function(a){this.enableDamping=!1;K-=a;this.update();this.enableDamping=!0};this.rotateUpStatic=function(a){this.enableDamping=!1;H-=a;this.update();this.enableDamping=!0};this.panLeft=
function(a){var b=this.object.matrix.elements;w.set(b[0],b[1],b[2]);w.multiplyScalar(-a);N.add(w)};this.panUp=function(a){var b=this.object.matrix.elements;w.set(b[4],b[5],b[6]);w.multiplyScalar(a);N.add(w)};this.pan=function(a,b){var f=h.domElement===document?h.domElement.body:h.domElement;if(h.object instanceof c.PerspectiveCamera){var e=h.object.position.clone().sub(h.target).length();e*=Math.tan(h.object.fov/2*Math.PI/180);h.panLeft(2*a*e/f.clientHeight);h.panUp(2*b*e/f.clientHeight)}else h.object instanceof
c.OrthographicCamera?(h.panLeft(a*(h.object.right-h.object.left)/f.clientWidth),h.panUp(b*(h.object.top-h.object.bottom)/f.clientHeight)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.")};this.dollyIn=function(a){void 0===a&&(a=Math.pow(.95,h.zoomSpeed));h.object instanceof c.PerspectiveCamera?M/=a:h.object instanceof c.OrthographicCamera?(h.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*a)),h.object.updateProjectionMatrix(),h.dispatchEvent(F)):
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")};this.dollyOut=function(a){void 0===a&&(a=Math.pow(.95,h.zoomSpeed));h.object instanceof c.PerspectiveCamera?M*=a:h.object instanceof c.OrthographicCamera?(h.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/a)),h.object.updateProjectionMatrix(),h.dispatchEvent(F)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")};this.update=
function(a){var b=this.object.position;v.copy(b).sub(this.target);v.applyQuaternion(S);B=Math.atan2(v.x,v.z);D=Math.atan2(Math.sqrt(v.x*v.x+v.z*v.z),v.y);this.autoRotate&&E===y.NONE&&this.rotateLeft(2*Math.PI/60/60*h.autoRotateSpeed);!0===this.enableDamping&&this.speedLimit!==Number.MAX_VALUE&&(K=c.Math.clamp(K,-this.speedLimit,this.speedLimit),H=c.Math.clamp(H,-this.speedLimit,this.speedLimit));B+=K;D+=H;B=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,B));D=Math.max(this.minPolarAngle,
Math.min(this.maxPolarAngle,D));D=Math.max(1E-7,Math.min(Math.PI-1E-7,D));var f=v.length()*M;f=Math.max(this.minDistance,Math.min(this.maxDistance,f));this.target.add(N);v.x=f*Math.sin(D)*Math.sin(B);v.y=f*Math.cos(D);v.z=f*Math.sin(D)*Math.cos(B);v.applyQuaternion(U);b.copy(this.target).add(v);this.object.lookAt(this.target);h.spherical.set(f,D,B);this.autoRotate||!0!==this.enableDamping||(!this.momentum||E!==y.ROTATE&&E!==y.TOUCH_ROTATE)&&E!==y.NONE?H=K=0:(K*=this.dampingFactor,H*=this.dampingFactor);
M=1;N.set(0,0,0);if(1E-7<O.distanceToSquared(this.object.position)||1E-7<8*(1-P.dot(this.object.quaternion)))!0!==a&&this.dispatchEvent(F),O.copy(this.object.position),P.copy(this.object.quaternion)};this.reset=function(){E=y.NONE;this.target.copy(this.target0);this.object.position.copy(this.position0);this.object.zoom=this.zoom0;this.object.updateProjectionMatrix();this.dispatchEvent(F);this.update()};this.getPolarAngle=function(){return D};this.getAzimuthalAngle=function(){return B};this.dispose=
function(){this.domElement.removeEventListener("mousedown",e);this.domElement.removeEventListener("mousewheel",d);this.domElement.removeEventListener("DOMMouseScroll",d);this.domElement.removeEventListener("touchstart",g);this.domElement.removeEventListener("touchend",R);this.domElement.removeEventListener("touchmove",k);window.removeEventListener("keyup",x);window.removeEventListener("keydown",t)};this.domElement.addEventListener("mousedown",e,{passive:!1});this.domElement.addEventListener("mousewheel",
d,{passive:!1});this.domElement.addEventListener("DOMMouseScroll",d,{passive:!1});this.domElement.addEventListener("touchstart",g,{passive:!1});this.domElement.addEventListener("touchend",R,{passive:!1});this.domElement.addEventListener("touchmove",k,{passive:!1});window.addEventListener("keyup",x,{passive:!1});window.addEventListener("keydown",t,{passive:!1});this.update()}function pa(a){var b=this;this.object=a;this.object.rotation.reorder("YXZ");this.enabled=!0;this.deviceOrientation=null;this.alphaOffset=
this.screenOrientation=0;this.initialOffset=null;var e=function(a){var f=a.alpha,e=a.beta;a=a.gamma;null===b.initialOffset&&(b.initialOffset=f);f-=b.initialOffset;0>f&&(f+=360);b.deviceOrientation={alpha:f,beta:e,gamma:a}},f=function(){b.screenOrientation=window.orientation||0},m=function(){window.addEventListener("orientationchange",f,!1);window.addEventListener("deviceorientation",e,!1)}.bind(this),d=function(){var a=new c.Vector3(0,0,1),b=new c.Euler,f=new c.Quaternion,e=new c.Quaternion(-Math.sqrt(.5),
0,0,Math.sqrt(.5));return function(c,m,d,u,x){b.set(d,m,-u,"YXZ");c.setFromEuler(b);c.multiply(e);c.multiply(f.setFromAxisAngle(a,-x))}}();this.connect=function(){f();void 0!==window.DeviceOrientationEvent&&"function"===typeof window.DeviceOrientationEvent.requestPermission?window.DeviceOrientationEvent.requestPermission().then(function(a){"granted"==a&&m()}).catch(function(a){console.error("THREE.DeviceOrientationControls: Unable to use DeviceOrientation API:",a)}):m();b.enabled=!0};this.disconnect=
function(){window.removeEventListener("orientationchange",f,!1);window.removeEventListener("deviceorientation",e,!1);b.enabled=!1;b.deviceOrientation=null;b.initialOffset=null};this.update=function(a){a=void 0===a?{theta:0}:a;a=void 0===a.theta?0:a.theta;if(!1!==b.enabled){var f=b.deviceOrientation;if(f){var e=f.alpha?c.Math.degToRad(f.alpha)+b.alphaOffset:0,m=f.beta?c.Math.degToRad(f.beta):0;f=f.gamma?c.Math.degToRad(f.gamma):0;var u=b.screenOrientation?c.Math.degToRad(b.screenOrientation):0;d(b.object.quaternion,
e+a,m,f,u)}}};this.dispose=function(){b.disconnect()};this.getAlpha=function(){var a=b.deviceOrientation;return a&&a.alpha?c.Math.degToRad(a.alpha)+b.alphaOffset:0};this.getBeta=function(){var a=b.deviceOrientation;return a&&a.beta?c.Math.degToRad(a.beta):0}}function ya(a){var b=new c.OrthographicCamera(-1,1,1,-1,0,1),e=new c.Scene,f=new c.StereoCamera;f.aspect=.5;var m=new c.WebGLRenderTarget(512,512,{minFilter:c.LinearFilter,magFilter:c.NearestFilter,format:c.RGBAFormat});m.scissorTest=!0;m.texture.generateMipmaps=
!1;var d=new c.Vector2(.441,.156),x=(new c.PlaneBufferGeometry(1,1,10,20)).deleteAttribute("normal").toNonIndexed(),t=x.attributes.position.array,g=x.attributes.uv.array;x.attributes.position.count*=2;x.attributes.uv.count*=2;var l=new Float32Array(2*t.length);l.set(t);l.set(t,t.length);var k=new Float32Array(2*g.length);k.set(g);k.set(g,g.length);g=new c.Vector2;t=t.length/3;for(var h=0,L=l.length/3;h<L;h++){g.x=l[3*h];g.y=l[3*h+1];var n=g.dot(g);n=1.5+(d.x+d.y*n)*n;var p=h<t?0:1;l[3*h]=g.x/n*1.5-
.5+p;l[3*h+1]=g.y/n*3;k[2*h]=.5*(k[2*h]+p)}x.attributes.position.array=l;x.attributes.uv.array=k;d=new c.MeshBasicMaterial({map:m.texture});x=new c.Mesh(x,d);e.add(x);this.setEyeSeparation=function(a){f.eyeSep=a};this.setSize=function(b,f){a.setSize(b,f);var e=a.getPixelRatio();m.setSize(b*e,f*e)};this.render=function(c,d,u){var h=u instanceof O||u instanceof P;c.updateMatrixWorld();h&&this.setEyeSeparation(u.stereo.eyeSep);null===d.parent&&d.updateMatrixWorld();f.update(d);d=m.width/2;var x=m.height;
a.autoClear&&a.clear();h&&u.updateTextureToLeft();m.scissor.set(0,0,d,x);m.viewport.set(0,0,d,x);a.setRenderTarget(m);a.render(c,f.cameraL);a.clearDepth();h&&u.updateTextureToRight();m.scissor.set(d,0,d,x);m.viewport.set(d,0,d,x);a.setRenderTarget(m);a.render(c,f.cameraR);a.clearDepth();a.setRenderTarget(null);a.render(e,b)}}function qa(a){a=void 0===a?{}:a;var b=this.options=Object.assign({container:this.setupContainer(a.container),controlBar:!0,controlButtons:["fullscreen","setting","video"],autoHideControlBar:!1,
autoHideInfospot:!0,horizontalView:!1,clickTolerance:10,cameraFov:60,reverseDragging:!1,enableReticle:!1,dwellTime:1500,autoReticleSelect:!0,viewIndicator:!1,indicatorSize:30,output:null,autoRotate:!1,autoRotateSpeed:2,autoRotateActivationDuration:5E3,initialLookAt:new c.Vector3(0,0,-Number.MAX_SAFE_INTEGER),momentum:!0,rotateSpeed:-1,dampingFactor:.9,speedLimit:Number.MAX_VALUE},a);a=b.container;var e=b.cameraFov,f=b.controlBar,m=b.controlButtons,d=b.viewIndicator,x=b.indicatorSize,g=b.enableReticle,
Q=b.reverseDragging,l=b.output,k=b.scene,h=b.camera;b=b.renderer;var n=a.clientWidth,p=a.clientHeight;this.container=a;this.scene=this.setupScene(k);this.sceneReticle=new c.Scene;this.camera=this.setupCamera(e,n/p,h);this.renderer=this.setupRenderer(b,a);this.reticle=this.addReticle(this.camera,this.sceneReticle);this.control=this.setupControls(this.camera,a);this.effect=this.setupEffects(this.renderer,a);this.mode=z.NORMAL;this.pressObject=this.pressEntityObject=this.infospot=this.hoverObject=this.widget=
this.panorama=null;this.raycaster=new c.Raycaster;this.raycasterPoint=new c.Vector2;this.userMouse=new c.Vector2;this.updateCallbacks=[];this.requestAnimationId=null;this.cameraFrustum=new c.Frustum;this.cameraViewProjectionMatrix=new c.Matrix4;this.outputDivElement=this.autoRotateRequestId=null;this.touchSupported="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch;this.tweenLeftAnimation=new q.Tween;this.tweenUpAnimation=new q.Tween;this.tweenCanvasOpacityOut=new q.Tween;
this.tweenCanvasOpacityIn=new q.Tween;this.outputEnabled=!1;this.viewIndicatorSize=x;this.tempEnableReticle=g;this.setupTween();this.handlerMouseUp=this.onMouseUp.bind(this);this.handlerMouseDown=this.onMouseDown.bind(this);this.handlerMouseMove=this.onMouseMove.bind(this);this.handlerWindowResize=this.onWindowResize.bind(this);this.handlerKeyDown=this.onKeyDown.bind(this);this.handlerKeyUp=this.onKeyUp.bind(this);this.handlerTap=this.onTap.bind(this,{clientX:n/2,clientY:p/2});f&&this.addDefaultControlBar(m);
d&&this.addViewIndicator();Q&&this.reverseDraggingDirection();g?this.enableReticleControl():this.registerMouseAndTouchEvents();"overlay"===l&&this.addOutputElement();this.registerEventListeners();this.animate.call(this)}var za="^0.117.0".replace(/[^0-9.]/g,""),M={ORBIT:0,DEVICEORIENTATION:1},z={UNKNOWN:0,NORMAL:1,CARDBOARD:2,STEREO:3},N={TAB:0,SBS:1},g={CONTAINER:"panolens-container",CAMERA:"panolens-camera",CONTROLS:"panolens-controls",LOAD_START:"load-start",LOAD:"load",LOADED:"loaded",READY:"ready",
ERROR:"error",ENTER:"enter",ENTER_START:"enter-start",ENTER_FADE_START:"enter-fade-start",ENTER_FADE_COMPLETE:"enter-fade-complete",ENTER_COMPLETE:"enter-complete",FADE_IN:"fade-in",FADE_OUT:"fade-out",PROGRESS:"progress",LEAVE:"leave",LEAVE_START:"leave-start",LEAVE_COMPLETE:"leave-complete",INFOSPOT_ANIMATION_COMPLETE:"infospot-animation-complete",VIEWER_HANDLER:"panolens-viewer-handler",MODE_CHANGE:"mode-change",WIDNOW_RESIZE:"window-resize",MEDIA:{PLAY:"play",PAUSE:"pause",VOLUME_CHANGE:"volumechange"},
RETICLE:{RETICLE_RIPPLE_START:"reticle-ripple-start",RETICLE_RIPPLE_END:"reticle-ripple-end",RETICLE_START:"reticle-start",RETICLE_END:"reticle-end",RETICLE_UPDATE:"reticle-update"},PANOMOMENT:{NONE:"panomoments.none",FIRST_FRAME_DECODED:"panomoments.first_frame_decoded",READY:"panomoments.ready",COMPLETED:"panomoments.completed"}},C={Info:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAABAAAAAQADq8/hgAAADBklEQVR42u2bP08UQRiHnzFaSYCI/xoksdBIqGwIiYWRUBISExpCQ0ej38FWOmlIKKhoMPEbaCxsrrHiYrQgOSlQEaICrT+LHSPZzNzt3s3c3Hn7lHvLzvv82L2dm30XKioqKgYY062BJF0HpoA7wARwBbhsPz4DjoEG8AnYNcZ8Sx1Op8IXJM1KWpdUV3nq9m9nJV1I7VNGfEzSM0mNNqR9NOwxx1L7NRMflbQm6SSgeJ4TO8Zoat+8/LKkg4jieQ4kLaf2RtKwpJ0uiufZkTScSn5S0l5C+b/sSZrstvyMpKPU5uc4kjTTjkvpeYCkaeA1/+7hvcIZMGuMqUULQNIU8Aa4ltrWwyHwyBizGzwASSPAe+B2assW7AH3jTE/i+xcZoa12Qfy2Bo3i+5cKABl99zF1GYlWFTBeULLS0DZrOsDcDNggTXgc27bLWA64BhfgHvGmB8dHUXZ1DM0S45xliKMs9bKr+klIOkqsBrwv9JtVq1DewEAT4Ch1BYdMGQdygeg7Df4SmqDAKyoyXpCszPgITCeuvoAjFuX0gE8jljUdv7bCtiOOJ7XpdUZ8L/gdXHOA5QtYH5NXXVgbrgWWn1nwFTqaiPgdPIFcDd1tRFwOl307DwRuZgXwLvctgfA04hjOp18AcReZ6sZY16e3yDpUuQxnU6+S2AkcjEpcDr1zxOXSPgCKLSa0mc4nXwB/EpdbQScTr4AGqmrjYDTyRfAx9TVRsDp5Aug8LJyH+F0cgZg58z11BUHpO5ruGh2G3ybuuqAeF2aBfAqddUB8bq0OgP2U1cegH3aOQOMMb+BrdTVB2DLupQLwLIOnKY26IBT6+ClaQDGmO/ARmqLDtiwDn7HVkcY+EdjNoTlCI+tYhO2iUppm6HKslPUq2qQKHpUe8AFsjaUXuUQWCgqXyoAG8IuME/WkNRrnAHzZfqDSgdgQ6gBc2Td3b3CMTBXtkOsIzTIjZLnQhjcVtlcEIPZLJ0LoVvt8s/Va+3yuSAG84UJRxB98cpM9dJURUVFxSDzBxKde4Lk3/h2AAAAAElFTkSuQmCC",
Arrow:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAABAAAAAQADq8/hgAAADPklEQVR42u2bMUscQRiG30/SRaJEI1ZKUiRErNIELRUbQYSAnX8hpVUgkDYp0wgWVjYW+QcJaQzYpLojJIXhtDDEKBpj65ti58ixmdmb2ZvZ7+T2AUHudmfmeXf2bnb3O6CmpqZmgJGqOiI5AWAWwEMA0wDuArht3r4CcAagBeAbgIaI/NQOp1fhIZKLJN+SbDKcptl3keSQtk+I+BjJVyRbJaRdtEybY9p+ReKjJN+QvIwonufS9DGq7ZuXXyd5nFA8zzHJdW1vkLxDcrdC8Ty7JO9oyc+QPFCUb3NAcqZq+TmSp9rmHZySnCvjErwOIPkUwHv8+w7vF64ALIrIfrIASM4C+ADgnratgxMACyLSiB4AyREAnwE80LbswgGAJyJy4bNxyApr6wbIw4xxy3djrwCYfeeuaZsFsEbPdULXU4DZqusLgMkEA21P05EEbf8A8FhEzos28pkBLxLKL5s/r/M1kEkz9vKQHGeatf05yfmOfubNa7G5JDle5NhtBjwHMBz5yFwAWBaRT+0XzP8pZsKwcQiH2fX8Ycojb+kzxUw4ZJn7CSQXqpRPHMKCq7+iZJ71Mvdy/DftXSQ6HcJdSDaqPPKW/mPOBO+lcbvzCU35RCFM2PpwnQKzZQfdgfe0dxH5dLA6uQJ4pC2fIASrkyuA6X6QjxyC1ckVQNn7bNHlI4ZgdXIFUObiJJl8pBCsTjGfuIwA2Cv4FN7xbYjkjqsRAHuIePXoCiDF1Zk2VidXAL+1R5sAq5MrgJb2aBNgdXIF8FV7tAmwOrkCCFs73wysTtYATHFCU3vEEWm6Ci6KvgY/ao86Ik6XogDeaY86Ik6XbjPgSHvkEThCwQy45XpDRK5JbgN4GWkgUyR9H65MRQxgW0SunZ5FezK7pfwd8e8