diff --git a/embed/css/photo-sphere-viewer.min.css b/embed/css/photo-sphere-viewer.min.css index ae813e2..7116964 100644 --- a/embed/css/photo-sphere-viewer.min.css +++ b/embed/css/photo-sphere-viewer.min.css @@ -1,14 +1,14 @@ /** - * Minified by jsDelivr using clean-css v5.3.0. - * Original file: /npm/photo-sphere-viewer@4.7.1/dist/photo-sphere-viewer.css + * Minified by jsDelivr using clean-css v5.3.2. + * Original file: /npm/@photo-sphere-viewer/core@5.5.0/index.css * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ /*! - * Photo Sphere Viewer 4.7.1 + * PhotoSphereViewer 5.5.0 * @copyright 2014-2015 Jérémy Heleine - * @copyright 2015-2022 Damien "Mistic" Sorel + * @copyright 2023 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ -.psv-container{width:100%;height:100%;margin:0;padding:0;position:relative;background:radial-gradient(#fff 0,#fdfdfd 16%,#fbfbfb 33%,#f8f8f8 49%,#efefef 66%,#dfdfdf 82%,#bfbfbf 100%);overflow:hidden}.psv-container--fullscreen{position:fixed;top:0;right:0;bottom:0;left:0}.psv-canvas-container{position:absolute;top:0;left:0;z-index:0;-webkit-transition:opacity linear .1s;transition:opacity linear .1s}.psv-canvas{display:block}.psv-loader-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute;top:0;left:0;width:100%;height:100%;z-index:80}.psv-loader{position:relative;text-align:center;color:rgba(61,61,61,.7);width:150px;height:150px;border:10px solid transparent}.psv-loader::before{content:"";display:inline-block;height:100%;vertical-align:middle}.psv-loader,.psv-loader-image,.psv-loader-text{display:inline-block;vertical-align:middle}.psv-loader-canvas{position:absolute;top:0;left:0;width:100%;height:100%}.psv-loader-text{font:14px sans-serif}.psv-navbar{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;z-index:90;bottom:-40px;left:0;width:100%;height:40px;background:rgba(61,61,61,.5);-webkit-transition:bottom ease-in-out .1s;transition:bottom ease-in-out .1s}.psv-navbar--open{bottom:0}.psv-navbar,.psv-navbar *{-webkit-box-sizing:content-box;box-sizing:content-box}.psv-caption{-webkit-box-flex:1;-ms-flex:1 1 100%;flex:1 1 100%;color:rgba(255,255,255,.7);overflow:hidden;text-align:center}.psv-caption-icon{height:20px;width:20px;cursor:pointer}.psv-caption-icon *{fill:rgba(255,255,255,0.7)}.psv-caption-content{display:inline-block;padding:10px;font:16px sans-serif;white-space:nowrap}.psv-button{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;padding:10px;position:relative;cursor:pointer;height:20px;width:20px;background:0 0;color:rgba(255,255,255,.7)}.psv-button--active{background:rgba(255,255,255,.2)}.psv-button--disabled{pointer-events:none;opacity:.5}.psv-button-svg{width:100%;-webkit-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform .2s ease;transition:-webkit-transform .2s ease;transition:transform .2s ease;transition:transform .2s ease,-webkit-transform .2s ease}.psv-button:not(.psv-button--disabled):focus-visible{outline:2px dotted currentcolor;outline-offset:-2px}.psv-container:not(.psv--is-touch) .psv-button--hover-scale:not(.psv-button--disabled):hover .psv-button-svg{-webkit-transform:scale(1.2);transform:scale(1.2)}.psv-move-button+.psv-move-button{margin-left:-10px}.psv-custom-button{width:auto}.psv-autorotate-button.psv-button{width:25px;height:25px;padding:7.5px}.psv-zoom-range.psv-button{width:80px;height:1px;margin:10px 0;padding:9.5px 0;max-width:600px}.psv-zoom-range-line{position:relative;width:80px;height:1px;background:rgba(255,255,255,.7);-webkit-transition:all .3s ease;transition:all .3s ease}.psv-zoom-range-handle{position:absolute;border-radius:50%;top:-3px;width:7px;height:7px;background:rgba(255,255,255,.7);-webkit-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform .3s ease;transition:-webkit-transform .3s ease;transition:transform .3s ease;transition:transform .3s ease,-webkit-transform .3s ease}.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-line{-webkit-box-shadow:0 0 2px rgba(255,255,255,.7);box-shadow:0 0 2px rgba(255,255,255,.7)}.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-handle{-webkit-transform:scale(1.3);transform:scale(1.3)}.psv-notification{position:absolute;z-index:100;bottom:-40px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;padding:0 2em;opacity:0;-webkit-transition-property:opacity,bottom;transition-property:opacity,bottom;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-duration:.2s;transition-duration:.2s}.psv-notification-content{max-width:50em;background-color:rgba(61,61,61,.8);border-radius:4px;padding:.5em 1em;font:14px sans-serif;color:#fff}.psv-notification--visible{opacity:100;bottom:80px}.psv-overlay{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute;z-index:110;top:0;left:0;bottom:0;right:0;background:radial-gradient(#fff 0,#fdfdfd 16%,#fbfbfb 33%,#f8f8f8 49%,#efefef 66%,#dfdfdf 82%,#bfbfbf 100%);color:#000;opacity:.8}.psv-overlay-image{margin-bottom:4vh}.psv-overlay-image svg{width:50vw}@media (orientation:landscape){.psv-overlay-image svg{width:25vw}}.psv-overlay-text{font:30px sans-serif;text-align:center}.psv-overlay-subtext{font:20px sans-serif;opacity:.8;text-align:center}.psv-panel{position:absolute;z-index:90;right:0;height:100%;width:400px;max-width:calc(100% - 24px);background:rgba(10,10,10,.7);-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);opacity:0;-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:opacity,transform;transition-property:opacity,transform,-webkit-transform;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-duration:.1s;transition-duration:.1s;cursor:default;margin-left:9px}.psv--has-navbar .psv-panel{height:calc(100% - 40px)}.psv-panel-close-button{display:none;position:absolute;top:0;left:-24px;width:24px;height:24px;background:rgba(0,0,0,.9)}.psv-panel-close-button::after,.psv-panel-close-button::before{content:"";position:absolute;top:50%;left:4px;width:15px;height:1px;background-color:#fff;-webkit-transition:.2s ease-in-out;transition:.2s ease-in-out;-webkit-transition-property:width,left,-webkit-transform;transition-property:width,left,-webkit-transform;transition-property:width,left,transform;transition-property:width,left,transform,-webkit-transform}.psv-panel-close-button::before{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.psv-panel-close-button::after{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.psv-panel-close-button:hover::after,.psv-panel-close-button:hover::before{left:0;width:23px}.psv-panel-close-button:hover::before{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.psv-panel-close-button:hover::after{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.psv-panel-resizer{display:none;position:absolute;top:0;left:-9px;width:9px;height:100%;background-color:rgba(0,0,0,.9);cursor:col-resize}.psv-panel-resizer::before{content:"";position:absolute;top:50%;left:1px;margin-top:-14.5px;width:1px;height:1px;-webkit-box-shadow:1px 0 #fff,3px 0 #fff,5px 0 #fff,1px 2px #fff,3px 2px #fff,5px 2px #fff,1px 4px #fff,3px 4px #fff,5px 4px #fff,1px 6px #fff,3px 6px #fff,5px 6px #fff,1px 8px #fff,3px 8px #fff,5px 8px #fff,1px 10px #fff,3px 10px #fff,5px 10px #fff,1px 12px #fff,3px 12px #fff,5px 12px #fff,1px 14px #fff,3px 14px #fff,5px 14px #fff,1px 16px #fff,3px 16px #fff,5px 16px #fff,1px 18px #fff,3px 18px #fff,5px 18px #fff,1px 20px #fff,3px 20px #fff,5px 20px #fff,1px 22px #fff,3px 22px #fff,5px 22px #fff,1px 24px #fff,3px 24px #fff,5px 24px #fff,1px 26px #fff,3px 26px #fff,5px 26px #fff,1px 28px #fff,3px 28px #fff,5px 28px #fff;box-shadow:1px 0 #fff,3px 0 #fff,5px 0 #fff,1px 2px #fff,3px 2px #fff,5px 2px #fff,1px 4px #fff,3px 4px #fff,5px 4px #fff,1px 6px #fff,3px 6px #fff,5px 6px #fff,1px 8px #fff,3px 8px #fff,5px 8px #fff,1px 10px #fff,3px 10px #fff,5px 10px #fff,1px 12px #fff,3px 12px #fff,5px 12px #fff,1px 14px #fff,3px 14px #fff,5px 14px #fff,1px 16px #fff,3px 16px #fff,5px 16px #fff,1px 18px #fff,3px 18px #fff,5px 18px #fff,1px 20px #fff,3px 20px #fff,5px 20px #fff,1px 22px #fff,3px 22px #fff,5px 22px #fff,1px 24px #fff,3px 24px #fff,5px 24px #fff,1px 26px #fff,3px 26px #fff,5px 26px #fff,1px 28px #fff,3px 28px #fff,5px 28px #fff;background:0 0}.psv-panel-content{width:100%;height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;color:#dcdcdc;font:16px sans-serif;overflow:auto}.psv-panel-content:not(.psv-panel-content--no-margin){padding:1em}.psv-panel-content--no-interaction{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.psv-panel--open{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1;-webkit-transition-duration:.2s;transition-duration:.2s}.psv-panel--open .psv-panel-close-button,.psv-panel--open .psv-panel-resizer{display:block}.psv-panel-menu{height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.psv-panel-menu-title{-webkit-box-flex:0;-ms-flex:none;flex:none;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font:24px sans-serif;margin:24px 12px}.psv-panel-menu-title svg{width:24px;height:24px;margin-right:12px}.psv-panel-menu-list{-webkit-box-flex:1;-ms-flex:1;flex:1;list-style:none;margin:0;padding:0;overflow-x:hidden}.psv-panel-menu-item{min-height:20px;padding:.5em 1em;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-transition:background .1s ease-in-out;transition:background .1s ease-in-out}.psv-panel-menu-item--active{outline:1px solid currentcolor;outline-offset:-1px}.psv-panel-menu-item-icon{-webkit-box-flex:0;-ms-flex:none;flex:none;height:20px;width:20px;margin-right:.5em}.psv-panel-menu-item-icon img{max-width:100%;max-height:100%}.psv-panel-menu-item-icon svg{width:100%;height:100%}.psv-panel-menu-item:focus-visible{outline:1px dotted currentcolor;outline-offset:-1px}.psv-panel-menu--stripped .psv-panel-menu-item:hover{background:rgba(255,255,255,.2)}.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(odd),.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(odd)::before{background:rgba(255,255,255,.1)}.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(2n),.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(2n)::before{background:0 0}.psv-container:not(.psv--is-touch) .psv-panel-menu-item:hover{background:rgba(255,255,255,.2)}.psv-tooltip{position:absolute;z-index:50;-webkit-box-sizing:border-box;box-sizing:border-box;max-width:200px;background-color:rgba(61,61,61,.8);border-radius:4px;padding:.5em 1em;opacity:0;-webkit-transition-property:opacity;transition-property:opacity;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-duration:.1s;transition-duration:.1s;outline:5px solid transparent}.psv-tooltip-content{color:#fff;font:14px sans-serif;text-shadow:0 1px #000}.psv-tooltip-arrow{position:absolute;height:0;width:0;border:7px solid transparent}.psv-tooltip--bottom-center{-webkit-box-shadow:0 3px 0 rgba(90,90,90,.7);box-shadow:0 3px 0 rgba(90,90,90,.7);-webkit-transform:translate3d(0,-5px,0);transform:translate3d(0,-5px,0);-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:opacity,transform;transition-property:opacity,transform,-webkit-transform}.psv-tooltip--bottom-center .psv-tooltip-arrow{border-bottom-color:rgba(61,61,61,.8)}.psv-tooltip--center-left{-webkit-box-shadow:-3px 0 0 rgba(90,90,90,.7);box-shadow:-3px 0 0 rgba(90,90,90,.7);-webkit-transform:translate3d(5px,0,0);transform:translate3d(5px,0,0);-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:opacity,transform;transition-property:opacity,transform,-webkit-transform}.psv-tooltip--center-left .psv-tooltip-arrow{border-left-color:rgba(61,61,61,.8)}.psv-tooltip--top-center{-webkit-box-shadow:0 -3px 0 rgba(90,90,90,.7);box-shadow:0 -3px 0 rgba(90,90,90,.7);-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0);-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:opacity,transform;transition-property:opacity,transform,-webkit-transform}.psv-tooltip--top-center .psv-tooltip-arrow{border-top-color:rgba(61,61,61,.8)}.psv-tooltip--center-right{-webkit-box-shadow:3px 0 0 rgba(90,90,90,.7);box-shadow:3px 0 0 rgba(90,90,90,.7);-webkit-transform:translate3d(-5px,0,0);transform:translate3d(-5px,0,0);-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:opacity,transform;transition-property:opacity,transform,-webkit-transform}.psv-tooltip--center-right .psv-tooltip-arrow{border-right-color:rgba(61,61,61,.8)}.psv-tooltip--bottom-left{-webkit-box-shadow:-3px 3px 0 rgba(90,90,90,.7);box-shadow:-3px 3px 0 rgba(90,90,90,.7);-webkit-transform:translate3d(0,-5px,0);transform:translate3d(0,-5px,0);-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:opacity,transform;transition-property:opacity,transform,-webkit-transform}.psv-tooltip--bottom-left .psv-tooltip-arrow{border-bottom-color:rgba(61,61,61,.8)}.psv-tooltip--bottom-right{-webkit-box-shadow:3px 3px 0 rgba(90,90,90,.7);box-shadow:3px 3px 0 rgba(90,90,90,.7);-webkit-transform:translate3d(0,-5px,0);transform:translate3d(0,-5px,0);-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:opacity,transform;transition-property:opacity,transform,-webkit-transform}.psv-tooltip--bottom-right .psv-tooltip-arrow{border-bottom-color:rgba(61,61,61,.8)}.psv-tooltip--top-left{-webkit-box-shadow:-3px -3px 0 rgba(90,90,90,.7);box-shadow:-3px -3px 0 rgba(90,90,90,.7);-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0);-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:opacity,transform;transition-property:opacity,transform,-webkit-transform}.psv-tooltip--top-left .psv-tooltip-arrow{border-top-color:rgba(61,61,61,.8)}.psv-tooltip--top-right{-webkit-box-shadow:3px -3px 0 rgba(90,90,90,.7);box-shadow:3px -3px 0 rgba(90,90,90,.7);-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0);-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:opacity,transform;transition-property:opacity,transform,-webkit-transform}.psv-tooltip--top-right .psv-tooltip-arrow{border-top-color:rgba(61,61,61,.8)}.psv-tooltip--visible{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1;-webkit-transition-duration:.1s;transition-duration:.1s} -/*# sourceMappingURL=/sm/400d3ded9b543b7a96fffaa7fead8dfae547b80f6d6136e8c673b7da081f200e.map */ \ No newline at end of file +.psv-container{--psv-core-loaded:true;width:100%;height:100%;margin:0;padding:0;position:relative;background:radial-gradient(#fff 0,#fdfdfd 16%,#fbfbfb 33%,#f8f8f8 49%,#efefef 66%,#dfdfdf 82%,#bfbfbf 100%);overflow:hidden}.psv-container *{box-sizing:content-box}.psv-canvas-container{position:absolute;top:0;left:0;z-index:0;transition:opacity linear .1s}.psv-canvas{display:block}.psv-loader-container{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;width:100%;height:100%;z-index:80}.psv-loader{--psv-loader-border:3px;--psv-loader-tickness:10px;position:relative;display:flex;justify-content:center;align-items:center;color:rgba(255,255,255,.7);width:150px;height:150px}.psv-loader-canvas{position:absolute;top:0;left:0;width:100%;height:100%;color:rgba(61,61,61,.5);z-index:-1}.psv-loader-text{font:600 16px sans-serif}.psv-navbar{display:flex;position:absolute;z-index:90;bottom:-40px;left:0;width:100%;height:40px;background:rgba(61,61,61,.5);transition:bottom ease-in-out .1s;font:16px sans-serif;cursor:default}.psv-navbar--open{bottom:0}.psv-navbar,.psv-navbar *{box-sizing:content-box}.psv-button{flex:0 0 auto;padding:10px;position:relative;cursor:pointer;height:20px;width:20px;background:0 0;color:rgba(255,255,255,.7)}.psv-button--active{background:rgba(255,255,255,.2)}.psv-button--disabled{pointer-events:none;opacity:.5}.psv-button-svg{width:100%;transform:scale(1);transition:transform .2s ease;vertical-align:initial}.psv-button:not(.psv-button--disabled):focus-visible{outline:2px solid #007cff;outline-offset:-2px}.psv-container:not(.psv--is-touch) .psv-button--hover-scale:not(.psv-button--disabled):hover .psv-button-svg{transform:scale(1.2)}.psv-move-button+.psv-move-button{margin-left:-10px}.psv-custom-button{width:auto;min-width:20px}.psv-caption{flex:1 1 100%;color:rgba(255,255,255,.7);overflow:hidden;text-align:center;cursor:unset;padding:unset;height:unset;width:unset}.psv-caption-content{display:inline-block;padding:10px;white-space:nowrap}.psv-zoom-range.psv-button{width:80px;height:1px;margin:10px 0;padding:9.5px 0;max-width:600px}.psv-zoom-range-line{position:relative;width:80px;height:1px;background:rgba(255,255,255,.7);transition:all .3s ease}.psv-zoom-range-handle{position:absolute;border-radius:50%;top:-3px;width:7px;height:7px;background:rgba(255,255,255,.7);transform:scale(1);transition:transform .3s ease}.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-line{box-shadow:0 0 2px rgba(255,255,255,.7)}.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-handle{transform:scale(1.3)}.psv-notification{position:absolute;z-index:100;bottom:-40px;display:flex;justify-content:center;box-sizing:border-box;width:100%;padding:0 2em;opacity:0;transition-property:opacity,bottom;transition-timing-function:ease-in-out;transition-duration:.2s}.psv-notification-content{max-width:50em;background:rgba(61,61,61,.8);border-radius:4px;padding:.5em 1em;font:14px sans-serif;color:#fff}.psv-notification--visible{opacity:100;bottom:80px}.psv-overlay{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;z-index:110;inset:0;background:radial-gradient(#fff 0,#fdfdfd 16%,#fbfbfb 33%,#f8f8f8 49%,#efefef 66%,#dfdfdf 82%,#bfbfbf 100%);opacity:.8;cursor:default}.psv-overlay-image{margin-bottom:4vh}.psv-overlay-image svg{width:50vw}@media (orientation:landscape){.psv-overlay-image svg{width:25vw}}.psv-overlay-title{color:#000;font:30px sans-serif;text-align:center}.psv-overlay-text{color:rgba(0,0,0,.8);font:20px sans-serif;opacity:.8;text-align:center}.psv-panel{position:absolute;z-index:90;right:0;height:100%;width:400px;max-width:calc(100% - 9px);background:rgba(10,10,10,.7);transform:translate3d(100%,0,0);opacity:0;transition-property:opacity,transform;transition-timing-function:ease-in-out;transition-duration:.1s;cursor:default;margin-left:9px}.psv--has-navbar .psv-panel{height:calc(100% - 40px)}.psv-panel-close-button{display:none;position:absolute;top:-1px;right:0;width:19.2px;height:19.2px;padding:6.4px;background:0 0;color:#fff;transition:background .3s ease-in-out;cursor:pointer}.psv-panel-close-button svg{transition:transform .3s ease-in-out}.psv-panel-close-button:hover{background:rgba(0,0,0,.9)}.psv-panel-close-button:hover svg{transform:scale(-1)}.psv-panel-resizer{display:none;position:absolute;top:0;left:-9px;width:9px;height:100%;background-color:rgba(0,0,0,.9);cursor:col-resize}.psv-panel-resizer::before{content:"";position:absolute;top:50%;left:1px;margin-top:-14.5px;width:1px;height:1px;box-shadow:1px 0 #fff,3px 0 #fff,5px 0 #fff,1px 2px #fff,3px 2px #fff,5px 2px #fff,1px 4px #fff,3px 4px #fff,5px 4px #fff,1px 6px #fff,3px 6px #fff,5px 6px #fff,1px 8px #fff,3px 8px #fff,5px 8px #fff,1px 10px #fff,3px 10px #fff,5px 10px #fff,1px 12px #fff,3px 12px #fff,5px 12px #fff,1px 14px #fff,3px 14px #fff,5px 14px #fff,1px 16px #fff,3px 16px #fff,5px 16px #fff,1px 18px #fff,3px 18px #fff,5px 18px #fff,1px 20px #fff,3px 20px #fff,5px 20px #fff,1px 22px #fff,3px 22px #fff,5px 22px #fff,1px 24px #fff,3px 24px #fff,5px 24px #fff,1px 26px #fff,3px 26px #fff,5px 26px #fff,1px 28px #fff,3px 28px #fff,5px 28px #fff;background:0 0}.psv-panel-content{width:100%;height:100%;box-sizing:border-box;color:#dcdcdc;font:16px sans-serif;overflow:auto}.psv-panel-content:not(.psv-panel-content--no-margin){padding:1em}.psv-panel-content--no-interaction{user-select:none;pointer-events:none}.psv-panel--open{transform:translate3d(0,0,0);opacity:1;transition-duration:.2s}.psv-panel--open .psv-panel-close-button,.psv-panel--open .psv-panel-resizer{display:block}@media screen and (max-width:400px){.psv-panel{width:100%!important;max-width:none}.psv-panel-resizer{display:none!important}}.psv-panel-menu{height:100%;display:flex;flex-direction:column}.psv-panel-menu-title{flex:none;display:flex;align-items:center;font:24px sans-serif;margin:24px 12px}.psv-panel-menu-title svg{width:24px;height:24px;margin-right:12px}.psv-panel-menu-list{flex:1;list-style:none;margin:0;padding:0;overflow-x:hidden}.psv-panel-menu-item{min-height:1.5em;padding:.5em 1em;cursor:pointer;display:flex;align-items:center;justify-content:flex-start;transition:background .1s ease-in-out}.psv-panel-menu-item--active{outline:1px solid currentcolor;outline-offset:-1px}.psv-panel-menu-item-icon{flex:none;height:1.5em;width:1.5em;margin-right:.5em}.psv-panel-menu-item-icon img{max-width:100%;max-height:100%}.psv-panel-menu-item-icon svg{width:100%;height:100%}.psv-panel-menu-item:focus-visible{outline:2px solid #007cff;outline-offset:-2px}.psv-panel-menu--stripped .psv-panel-menu-item:hover{background:rgba(255,255,255,.2)}.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(odd),.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(odd)::before{background:rgba(255,255,255,.1)}.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(2n),.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(2n)::before{background:0 0}.psv-container:not(.psv--is-touch) .psv-panel-menu-item:hover{background:rgba(255,255,255,.2)}.psv-tooltip{position:absolute;z-index:50;box-sizing:border-box;max-width:200px;background:rgba(61,61,61,.8);border-radius:4px;padding:.5em 1em;opacity:0;transition-property:opacity,transform;transition-timing-function:ease-in-out;transition-duration:.1s;cursor:default}.psv-tooltip-content{color:#fff;font:14px sans-serif;text-shadow:0 1px #000}.psv-tooltip-arrow{position:absolute;height:0;width:0;border:7px solid transparent}.psv-tooltip--top-center,.psv-tooltip--top-left,.psv-tooltip--top-right{transform:translate3d(0,5px,0)}.psv-tooltip--top-center .psv-tooltip-arrow,.psv-tooltip--top-left .psv-tooltip-arrow,.psv-tooltip--top-right .psv-tooltip-arrow{border-top-color:rgba(61,61,61,.8)}.psv-tooltip--bottom-center,.psv-tooltip--bottom-left,.psv-tooltip--bottom-right{transform:translate3d(0,-5px,0)}.psv-tooltip--bottom-center .psv-tooltip-arrow,.psv-tooltip--bottom-left .psv-tooltip-arrow,.psv-tooltip--bottom-right .psv-tooltip-arrow{border-bottom-color:rgba(61,61,61,.8)}.psv-tooltip--center-left,.psv-tooltip--left-bottom,.psv-tooltip--left-top{transform:translate3d(5px,0,0)}.psv-tooltip--center-left .psv-tooltip-arrow,.psv-tooltip--left-bottom .psv-tooltip-arrow,.psv-tooltip--left-top .psv-tooltip-arrow{border-left-color:rgba(61,61,61,.8)}.psv-tooltip--center-right,.psv-tooltip--right-bottom,.psv-tooltip--right-top{transform:translate3d(-5px,0,0)}.psv-tooltip--center-right .psv-tooltip-arrow,.psv-tooltip--right-bottom .psv-tooltip-arrow,.psv-tooltip--right-top .psv-tooltip-arrow{border-right-color:rgba(61,61,61,.8)}.psv-tooltip--left-top,.psv-tooltip--top-left{box-shadow:-3px -3px 0 rgba(90,90,90,.7)}.psv-tooltip--top-center{box-shadow:0 -3px 0 rgba(90,90,90,.7)}.psv-tooltip--right-top,.psv-tooltip--top-right{box-shadow:3px -3px 0 rgba(90,90,90,.7)}.psv-tooltip--bottom-left,.psv-tooltip--left-bottom{box-shadow:-3px 3px 0 rgba(90,90,90,.7)}.psv-tooltip--bottom-center{box-shadow:0 3px 0 rgba(90,90,90,.7)}.psv-tooltip--bottom-right,.psv-tooltip--right-bottom{box-shadow:3px 3px 0 rgba(90,90,90,.7)}.psv-tooltip--center-left{box-shadow:-3px 0 0 rgba(90,90,90,.7)}.psv-tooltip--center-right{box-shadow:3px 0 0 rgba(90,90,90,.7)}.psv-tooltip--visible{transform:translate3d(0,0,0);opacity:1} +/*# sourceMappingURL=/sm/d759c837ae3d2fe6830a63ea8e8664fb4120b3e07437dd754bd7f5b301072913.map */ \ No newline at end of file diff --git a/embed/index.html b/embed/index.html index eb637f8..cd78e06 100644 --- a/embed/index.html +++ b/embed/index.html @@ -17,47 +17,27 @@ width: 100%; height: 100%; } - - .psv-button.custom-button { - font-size: 22px; - line-height: 20px; - } - - .demo-label { - color: white; - font-size: 20px; - font-family: Helvetica, sans-serif; - text-align: center; - padding: 5px; - border: 1px solid white; - background: rgba(0,0,0,0.4); - } - - -
+ + +
- - + -

Panorama

> - - diff --git a/embed/js/browser.min.js b/embed/js/browser.min.js deleted file mode 100644 index 76e4bde..0000000 --- a/embed/js/browser.min.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Minified by jsDelivr using Terser v5.13.1. - * Original file: /npm/uevent@2.2.0/browser.js - * - * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files - */ -/*! - * uevent (v2.2.0) - * @copyright 2015-2022 Damien "Mistic" Sorel - * @licence MIT - */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).uEvent={})}(this,(function(e){"use strict";var t=function(){return!0},n=function(){return!1},i=function(){function e(e,t,i){Object.defineProperties(this,{target:{get:function(){return e},set:function(){},enumerable:!0},type:{get:function(){return t},set:function(){},enumerable:!0},args:{get:function(){return i},set:function(){},enumerable:!0}}),this.isDefaultPrevented=n,this.isPropagationStopped=n}var i=e.prototype;return i.preventDefault=function(){this.isDefaultPrevented=t},i.stopPropagation=function(){this.isPropagationStopped=t},e}(),o=function(){function e(){}var t=e.prototype;return t.on=function(e,t){var n=this;if(this.__events=this.__events||{},"object"==typeof e)for(var i in e)e.hasOwnProperty(i)&&(this.__events[i]=this.__events[i]||[],this.__events[i].push(e[i]));else e.split(" ").forEach((function(e){n.__events[e]=n.__events[e]||[],n.__events[e].push(t)}));return this},t.off=function(e,t){var n=this;if("object"==typeof e){for(var i in e)if(e.hasOwnProperty(i)){if(this.__events&&i in this.__events){var o=this.__events[i].indexOf(e[i]);-1!==o&&this.__events[i].splice(o,1)}if(this.__once&&i in this.__once){var s=this.__once[i].indexOf(e[i]);-1!==s&&this.__once[i].splice(s,1)}}}else e?e.split(" ").forEach((function(e){if(n.__events&&e in n.__events)if(t){var i=n.__events[e].indexOf(t);-1!==i&&n.__events[e].splice(i,1)}else n.__events[e].length=0;if(n.__once&&e in n.__once)if(t){var o=n.__once[e].indexOf(t);-1!==o&&n.__once[e].splice(o,1)}else n.__once[e].length=0})):(this.__events={},this.__once={});return this},t.once=function(e,t){var n=this;if(this.__once=this.__once||{},"object"==typeof e)for(var i in e)e.hasOwnProperty(i)&&(this.__once[i]=this.__once[i]||[],this.__once[i].push(e[i]));else e.split(" ").forEach((function(e){n.__once[e]=n.__once[e]||[],n.__once[e].push(t)}));return this},t.trigger=function(e){var t=Array.prototype.slice.call(arguments,1),n=new i(this,e,t);if(this.__events&&e in this.__events)for(var o=0,s=this.__events[e].length;o{for(var s in t)i(e,s,{get:t[s],enumerable:!0})},a=()=>t,h={};r(h,{AbstractAdapter:()=>Bt,AbstractButton:()=>oi,AbstractComponent:()=>ii,AbstractConfigurablePlugin:()=>_i,AbstractPlugin:()=>Ei,CONSTANTS:()=>l,DEFAULTS:()=>Mi,EquirectangularAdapter:()=>ti,PSVError:()=>ne,SYSTEM:()=>Qt,TypedEvent:()=>Ue,VERSION:()=>hs,Viewer:()=>as,events:()=>De,registerButton:()=>Pi,utils:()=>C});var c=a(),l={};r(l,{ACTIONS:()=>_,ANIMATION_MIN_DURATION:()=>p,CAPTURE_EVENTS_CLASS:()=>E,CTRLZOOM_TIMEOUT:()=>g,DBLCLICK_DELAY:()=>v,DEFAULT_TRANSITION:()=>d,EASINGS:()=>O,ICONS:()=>T,IDS:()=>x,INERTIA_WINDOW:()=>f,KEY_CODES:()=>M,LONGTOUCH_DELAY:()=>m,MOVE_THRESHOLD:()=>u,SPHERE_RADIUS:()=>y,TWOFINGERSOVERLAY_DELAY:()=>w,VIEWER_DATA:()=>b});var d=1500,p=500,u=4,v=300,m=500,w=100,g=2e3,f=300,y=10,b="photoSphereViewer",E="psv--capture-event",_=(e=>(e.ROTATE_UP="ROTATE_UP",e.ROTATE_DOWN="ROTATE_DOWN",e.ROTATE_RIGHT="ROTATE_RIGHT",e.ROTATE_LEFT="ROTATE_LEFT",e.ZOOM_IN="ZOOM_IN",e.ZOOM_OUT="ZOOM_OUT",e))(_||{}),x={MENU:"menu",TWO_FINGERS:"twoFingers",CTRL_ZOOM:"ctrlZoom",ERROR:"error",DESCRIPTION:"description"},M={Enter:"Enter",Control:"Control",Escape:"Escape",Space:" ",PageUp:"PageUp",PageDown:"PageDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Delete:"Delete",Plus:"+",Minus:"-"},T={arrow:'\x3c!-- Created by Flatart from the Noun Project --\x3e\n',close:'',download:'\x3c!--Created by Michael Zenaty from the Noun Project--\x3e\n',fullscreenIn:'\x3c!--Created by Garrett Knoll from the Noun Project--\x3e\n',fullscreenOut:'\x3c!--Created by Garrett Knoll from the Noun Project--\x3e\n',info:'\x3c!--Created by Arafat Uddin from the Noun Project--\x3e\n',menu:'\x3c!-- Created by Richard Kunák from the Noun Project--\x3e\n',zoomIn:'\x3c!--Created by Ryan Canning from the Noun Project--\x3e\n',zoomOut:'\x3c!--Created by Ryan Canning from the Noun Project--\x3e\n'},O={linear:e=>e,inQuad:e=>e*e,outQuad:e=>e*(2-e),inOutQuad:e=>e<.5?2*e*e:(4-2*e)*e-1,inCubic:e=>e*e*e,outCubic:e=>--e*e*e+1,inOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,inQuart:e=>e*e*e*e,outQuart:e=>1- --e*e*e*e,inOutQuart:e=>e<.5?8*e*e*e*e:1-8*--e*e*e*e,inQuint:e=>e*e*e*e*e,outQuint:e=>1+--e*e*e*e*e,inOutQuint:e=>e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e,inSine:e=>1-Math.cos(e*(Math.PI/2)),outSine:e=>Math.sin(e*(Math.PI/2)),inOutSine:e=>.5-.5*Math.cos(Math.PI*e),inExpo:e=>Math.pow(2,10*(e-1)),outExpo:e=>1-Math.pow(2,-10*e),inOutExpo:e=>(e=2*e-1)<0?.5*Math.pow(2,10*e):1-.5*Math.pow(2,-10*e),inCirc:e=>1-Math.sqrt(1-e*e),outCirc:e=>Math.sqrt(1-(e-1)*(e-1)),inOutCirc:e=>(e*=2)<1?.5-.5*Math.sqrt(1-e*e):.5+.5*Math.sqrt(1-(e-=2)*e)},C={};function L(e,t){let i=e%t;return i<0&&(i+=t),i}function I(e){return e.reduce(((e,t)=>e+t),0)}function k(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function P(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function S(e,t){return[0,2*Math.PI,2*-Math.PI].reduce(((i,s)=>{const o=t-e+s;return Math.abs(o)Math.PI?e-=2*Math.PI:e-i<-Math.PI&&(e+=2*Math.PI);const o=(i-e)*Math.cos((t+s)/2),n=s-t;return Math.sqrt(o*o+n*n)}function z(e){return"string"==typeof e?e.match(/^[a-z]/i)?document.getElementById(e):document.querySelector(e):e}function A(e,t,i){void 0===i?e.classList.toggle(t):i?e.classList.add(t):i||e.classList.remove(t)}function D(e,t){e.classList.add(...t.split(" "))}function U(e,t){e.classList.remove(...t.split(" "))}function N(e,t){let i=e;do{if(i===t)return!0;i=i.parentElement}while(i);return!1}function V(e,t){if(!e?.matches)return null;let i=e;do{if(i.matches(t))return i;i=i.parentElement}while(i);return null}function F(e){let t=0,i=0,s=e;for(;s;)t+=s.offsetLeft-s.scrollLeft+s.clientLeft,i+=s.offsetTop-s.scrollTop+s.clientTop,s=s.offsetParent;return{x:t,y:i}}function W(e,t){return window.getComputedStyle(e,null)[t]}function j(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Y(e){if(e.touches.length<2)return null;const t={x:e.touches[0].clientX,y:e.touches[0].clientY},i={x:e.touches[1].clientX,y:e.touches[1].clientY};return{distance:k(t,i),angle:P(t,i),center:{x:(t.x+i.x)/2,y:(t.y+i.y)/2}}}function X(e){return(document.fullscreenElement||document.webkitFullscreenElement)===e}function $(e){(e.requestFullscreen||e.webkitRequestFullscreen).call(e)}function Z(){(document.exitFullscreen||document.webkitExitFullscreen).call(document)}function B(e){return e.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,((e,t)=>(t>0?"-":"")+e.toLowerCase()))}function G(e,t){let i=!1;return function(...s){i||(i=!0,setTimeout((()=>{e.apply(this,s),i=!1}),t))}}function q(e){if("object"!=typeof e||null===e||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function K(e,t){const i=t;return function e(t,s){return Array.isArray(s)?(t&&Array.isArray(t)?t.length=0:t=[],s.forEach(((i,s)=>{t[s]=e(null,i)}))):"object"==typeof s?(t&&!Array.isArray(t)||(t={}),Object.keys(s).forEach((o=>{"object"==typeof s[o]&&s[o]&&q(s[o])?s[o]!==i&&(t[o]?e(t[o],s[o]):t[o]=e(null,s[o])):t[o]=s[o]}))):t=s,t}(e,t)}function Q(e){return K(null,e)}function J(e){return!e||0===Object.keys(e).length&&e.constructor===Object}function ee(e){return null==e}function te(...e){for(const t of e)if(!ee(t))return t;return null}function ie(e,t){if(e===t)return!0;if(se(e)&&se(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i of Object.keys(e))if(!ie(e[i],t[i]))return!1;return!0}return!1}function se(e){return"object"==typeof e&&null!==e}r(C,{Animation:()=>ke,Dynamic:()=>Se,MultiDynamic:()=>He,PressHandler:()=>Re,Slider:()=>Ae,SliderDirection:()=>ze,addClasses:()=>D,angle:()=>P,applyEulerInverse:()=>Oe,checkStylesheet:()=>Le,checkVersion:()=>Ie,cleanCssPosition:()=>ye,clone:()=>Q,createTexture:()=>Me,cssPositionIsOrdered:()=>be,dasherize:()=>B,deepEqual:()=>ie,deepmerge:()=>K,distance:()=>k,exitFullscreen:()=>Z,firstNonNull:()=>te,getAbortError:()=>he,getAngle:()=>H,getClosest:()=>V,getConfigParser:()=>Ce,getElement:()=>z,getPosition:()=>F,getShortestArc:()=>S,getStyle:()=>W,getStyleProperty:()=>j,getTouchData:()=>Y,getXMPValue:()=>pe,greatArcDistance:()=>R,hasParent:()=>N,invertResolvableBoolean:()=>ae,isAbortError:()=>ce,isEmpty:()=>J,isExtendedPosition:()=>de,isFullscreenEnabled:()=>X,isNil:()=>ee,isPlainObject:()=>q,logWarn:()=>le,parseAngle:()=>xe,parsePoint:()=>fe,parseSpeed:()=>Ee,removeClasses:()=>U,requestFullscreen:()=>$,resolveBoolean:()=>re,speedToDuration:()=>_e,sum:()=>I,throttle:()=>G,toggleClass:()=>A,wrap:()=>L});var oe=a(),ne=class e extends Error{constructor(t){super(t),this.name="PSVError",Error.captureStackTrace?.(this,e)}};function re(e,t){q(e)?(t(e.initial,!0),e.promise.then((e=>t(e,!1)))):t(e,!0)}function ae(e){return{initial:!e.initial,promise:e.promise.then((e=>!e))}}function he(){const e=new Error("Loading was aborted.");return e.name="AbortError",e}function ce(e){return"AbortError"===e?.name}function le(e){console.warn(`PhotoSphereViewer: ${e}`)}function de(e){return!!e&&[["textureX","textureY"],["yaw","pitch"]].some((([t,i])=>void 0!==e[t]&&void 0!==e[i]))}function pe(e,t){let i=e.match("(.*)");if(null!==i){const e=parseInt(i[1],10);return isNaN(e)?null:e}if(i=e.match("GPano:"+t+'="(.*?)"'),null!==i){const e=parseInt(i[1],10);return isNaN(e)?null:e}return null}var ue={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},ve=["left","center","right"],me=["top","center","bottom"],we=[...ve,...me],ge="center";function fe(e){if(!e)return{x:.5,y:.5};if("object"==typeof e)return e;let t=e.toLocaleLowerCase().split(" ").slice(0,2);1===t.length&&(t=ue[t[0]]?[t[0],ge]:[t[0],t[0]]);const i="left"!==t[1]&&"right"!==t[1]&&"top"!==t[0]&&"bottom"!==t[0];t=t.map((e=>ue[e]||e)),i||t.reverse();const s=t.join(" ").match(/^([0-9.]+)% ([0-9.]+)%$/);return s?{x:parseFloat(s[1])/100,y:parseFloat(s[2])/100}:{x:.5,y:.5}}function ye(e,{allowCenter:t,cssOrder:i}={allowCenter:!0,cssOrder:!0}){return e?("string"==typeof e&&(e=e.split(" ")),1===e.length&&(e[0]===ge?e=[ge,ge]:-1!==ve.indexOf(e[0])?e=[ge,e[0]]:-1!==me.indexOf(e[0])&&(e=[e[0],ge])),2!==e.length||-1===we.indexOf(e[0])||-1===we.indexOf(e[1])?(le(`Unparsable position ${e}`),null):t||e[0]!==ge||e[1]!==ge?(i&&!be(e)&&(e=[e[1],e[0]]),e[1]===ge&&-1!==ve.indexOf(e[0])&&(e=[ge,e[0]]),e[0]===ge&&-1!==me.indexOf(e[1])&&(e=[e[1],ge]),e):(le("Invalid position center center"),null)):null}function be(e){return-1!==me.indexOf(e[0])&&-1!==ve.indexOf(e[1])}function Ee(e){let t;if("string"==typeof e){const i=e.toString().trim();let s=parseFloat(i.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/,"$1"));const o=i.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim();switch(o.match(/(pm|per minute)$/)&&(s/=60),o){case"dpm":case"degrees per minute":case"dps":case"degrees per second":t=oe.MathUtils.degToRad(s);break;case"rdpm":case"radians per minute":case"rdps":case"radians per second":t=s;break;case"rpm":case"revolutions per minute":case"rps":case"revolutions per second":t=s*Math.PI*2;break;default:throw new ne(`Unknown speed unit "${o}"`)}}else t=e;return t}function _e(e,t){if("number"!=typeof e){const i=Ee(e);return t/Math.abs(i)*1e3}return Math.abs(e)}function xe(e,t=!1,i=t){let s;if("string"==typeof e){const t=e.toLowerCase().trim().match(/^(-?[0-9]+(?:\.[0-9]*)?)(.*)$/);if(!t)throw new ne(`Unknown angle "${e}"`);const i=parseFloat(t[1]),o=t[2];if(o)switch(o){case"deg":case"degs":s=oe.MathUtils.degToRad(i);break;case"rad":case"rads":s=i;break;default:throw new ne(`Unknown angle unit "${o}"`)}else s=i}else{if("number"!=typeof e||isNaN(e))throw new ne(`Unknown angle "${e}"`);s=e}return s=L(t?s+Math.PI:s,2*Math.PI),t?oe.MathUtils.clamp(s-Math.PI,-Math.PI/(i?2:1),Math.PI/(i?2:1)):s}function Me(e,t=!1){const i=new oe.Texture(e);return i.needsUpdate=!0,i.minFilter=t?oe.LinearMipmapLinearFilter:oe.LinearFilter,i.generateMipmaps=t,i.anisotropy=t?2:1,i}var Te=new oe.Quaternion;function Oe(e,t){Te.setFromEuler(t).invert(),e.applyQuaternion(Te)}function Ce(e,t){const i=function(i){if(!i)return Q(e);const s=Q({...e,...i}),o={};for(let[i,n]of Object.entries(s)){if(t&&i in t)n=t[i](n,{rawConfig:s,defValue:e[i]});else if(!(i in e)){le(`Unknown option ${i}`);continue}o[i]=n}return o};return i.defaults=e,i.parsers=t||{},i}function Le(e,t){"true"!==j(e,`--psv-${t}-loaded`)&&console.error(`PhotoSphereViewer: stylesheet "@photo-sphere-viewer/${t}/index.css" is not loaded`)}function Ie(e,t,i){t&&t!==i&&console.error(`PhotoSphereViewer: @photo-sphere-viewer/${e} is in version ${t} but @photo-sphere-viewer/core is in version ${i}`)}var ke=class{constructor(e){this.easing=O.linear,this.callbacks=[],this.resolved=!1,this.cancelled=!1,this.options=e,e?(e.easing&&(this.easing="function"==typeof e.easing?e.easing:O[e.easing]||O.linear),this.delayTimeout=setTimeout((()=>{this.delayTimeout=void 0,this.animationFrame=window.requestAnimationFrame((e=>this.__run(e)))}),e.delay||0)):this.resolved=!0}__run(e){if(this.cancelled)return;this.start||(this.start=e);const t=(e-this.start)/this.options.duration,i={};if(t<1){for(const[e,s]of Object.entries(this.options.properties))if(s){const o=s.start+(s.end-s.start)*this.easing(t);i[e]=o}this.options.onTick(i,t),this.animationFrame=window.requestAnimationFrame((e=>this.__run(e)))}else{for(const[e,t]of Object.entries(this.options.properties))t&&(i[e]=t.end);this.options.onTick(i,1),this.__resolve(!0),this.animationFrame=void 0}}__resolve(e){e?this.resolved=!0:this.cancelled=!0,this.callbacks.forEach((t=>t(e))),this.callbacks.length=0}then(e){return this.resolved||this.cancelled?Promise.resolve(this.resolved).then(e):new Promise((e=>{this.callbacks.push(e)})).then(e)}cancel(){this.cancelled||this.resolved||(this.__resolve(!1),this.delayTimeout&&(window.clearTimeout(this.delayTimeout),this.delayTimeout=void 0),this.animationFrame&&(window.cancelAnimationFrame(this.animationFrame),this.animationFrame=void 0))}},Pe=a(),Se=class{constructor(e,t){if(this.fn=e,this.mode=0,this.speed=0,this.speedMult=0,this.currentSpeed=0,this.target=0,this.__current=0,this.min=t.min,this.max=t.max,this.wrap=t.wrap,this.current=t.defaultValue,this.wrap&&0!==this.min)throw new ne("invalid config");this.fn&&this.fn(this.current)}get current(){return this.__current}set current(e){this.__current=e}setSpeed(e){this.speed=e}goto(e,t=1){this.mode=2,this.target=this.wrap?L(e,this.max):Pe.MathUtils.clamp(e,this.min,this.max),this.speedMult=t}step(e,t=1){0===t?this.setValue(this.current+e):(2!==this.mode&&(this.target=this.current),this.goto(this.target+e,t))}roll(e=!1,t=1){this.mode=1,this.target=e?-1/0:1/0,this.speedMult=t}stop(){this.mode=0}setValue(e){return this.target=this.wrap?L(e,this.max):Pe.MathUtils.clamp(e,this.min,this.max),this.mode=0,this.currentSpeed=0,this.target!==this.current&&(this.current=this.target,this.fn&&this.fn(this.current),!0)}update(e){if(2===this.mode){this.wrap&&Math.abs(this.target-this.current)>this.max/2&&(this.current=this.currentt&&(this.currentSpeed=Math.max(t,this.currentSpeed-e/1e3*this.speed*this.speedMult*2));let i=null;return this.current>this.target&&this.currentSpeed?i=Math.max(this.target,this.current+this.currentSpeed*e/1e3):this.current(e[t]=i.current,e)),{})}setSpeed(e){for(const t of Object.values(this.dynamics))t.setSpeed(e)}goto(e,t=1){for(const[i,s]of Object.entries(e))this.dynamics[i].goto(s,t)}step(e,t=1){if(0===t)this.setValue(Object.keys(e).reduce(((t,i)=>(t[i]=e[i]+this.dynamics[i].current,t)),{}));else for(const[i,s]of Object.entries(e))this.dynamics[i].step(s,t)}roll(e,t=1){for(const[i,s]of Object.entries(e))this.dynamics[i].roll(s,t)}stop(){for(const e of Object.values(this.dynamics))e.stop()}setValue(e){let t=!1;for(const[i,s]of Object.entries(e))t=this.dynamics[i].setValue(s)||t;return t&&this.fn&&this.fn(this.current),t}update(e){let t=!1;for(const i of Object.values(this.dynamics))t=i.update(e)||t;return t&&this.fn&&this.fn(this.current),t}},Re=class{constructor(e=200){this.delay=e,this.time=0,this.delay=e}get pending(){return 0!==this.time}down(){this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0),this.time=(new Date).getTime()}up(e){if(!this.time)return;Date.now()-this.time{e(),this.timeout=void 0,this.time=0}),this.delay):(e(),this.time=0)}},ze=(e=>(e.VERTICAL="VERTICAL",e.HORIZONTAL="HORIZONTAL",e))(ze||{}),Ae=class{constructor(e,t,i){this.container=e,this.direction=t,this.listener=i,this.mousedown=!1,this.mouseover=!1,this.container.addEventListener("click",this),this.container.addEventListener("mousedown",this),this.container.addEventListener("mouseenter",this),this.container.addEventListener("mouseleave",this),this.container.addEventListener("touchstart",this),this.container.addEventListener("mousemove",this,!0),this.container.addEventListener("touchmove",this,!0),window.addEventListener("mouseup",this),window.addEventListener("touchend",this)}get isVertical(){return"VERTICAL"===this.direction}get isHorizontal(){return"HORIZONTAL"===this.direction}destroy(){window.removeEventListener("mouseup",this),window.removeEventListener("touchend",this)}handleEvent(e){switch(e.type){case"click":e.stopPropagation();break;case"mousedown":this.__onMouseDown(e);break;case"mouseenter":this.__onMouseEnter(e);break;case"mouseleave":this.__onMouseLeave(e);break;case"touchstart":this.__onTouchStart(e);break;case"mousemove":this.__onMouseMove(e);break;case"touchmove":this.__onTouchMove(e);break;case"mouseup":this.__onMouseUp(e);break;case"touchend":this.__onTouchEnd(e)}}__onMouseDown(e){this.mousedown=!0,this.__update(e.clientX,e.clientY,!0)}__onMouseEnter(e){this.mouseover=!0,this.__update(e.clientX,e.clientY,!0)}__onTouchStart(e){this.mouseover=!0,this.mousedown=!0;const t=e.changedTouches[0];this.__update(t.clientX,t.clientY,!0)}__onMouseMove(e){(this.mousedown||this.mouseover)&&(e.stopPropagation(),this.__update(e.clientX,e.clientY,!0))}__onTouchMove(e){if(this.mousedown||this.mouseover){e.stopPropagation();const t=e.changedTouches[0];this.__update(t.clientX,t.clientY,!0)}}__onMouseUp(e){this.mousedown&&(this.mousedown=!1,this.__update(e.clientX,e.clientY,!1))}__onMouseLeave(e){this.mouseover&&(this.mouseover=!1,this.__update(e.clientX,e.clientY,!0))}__onTouchEnd(e){if(this.mousedown){this.mouseover=!1,this.mousedown=!1;const t=e.changedTouches[0];this.__update(t.clientX,t.clientY,!1)}}__update(e,t,i){const s=this.container.getBoundingClientRect(),o=this.isVertical?t:e,n=s[this.isVertical?"bottom":"left"],r=s[this.isVertical?"height":"width"],a=Math.abs((n-o)/r);this.listener({value:a,click:!i,mousedown:this.mousedown,mouseover:this.mouseover,cursor:{clientX:e,clientY:t}})}},De={};r(De,{BeforeAnimateEvent:()=>We,BeforeRenderEvent:()=>Ye,BeforeRotateEvent:()=>$e,ClickEvent:()=>Be,ConfigChangedEvent:()=>qe,DoubleClickEvent:()=>Qe,FullscreenEvent:()=>et,HideNotificationEvent:()=>it,HideOverlayEvent:()=>ot,HidePanelEvent:()=>rt,HideTooltipEvent:()=>ht,KeypressEvent:()=>lt,LoadProgressEvent:()=>pt,ObjectEnterEvent:()=>Ft,ObjectEvent:()=>Nt,ObjectHoverEvent:()=>Xt,ObjectLeaveEvent:()=>jt,PanoramaErrorEvent:()=>ft,PanoramaLoadEvent:()=>vt,PanoramaLoadedEvent:()=>wt,PositionUpdatedEvent:()=>bt,ReadyEvent:()=>_t,RenderEvent:()=>Mt,ShowNotificationEvent:()=>Ot,ShowOverlayEvent:()=>Lt,ShowPanelEvent:()=>kt,ShowTooltipEvent:()=>St,SizeUpdatedEvent:()=>Rt,StopAllEvent:()=>At,ViewerEvent:()=>Ve,ZoomUpdatedEvent:()=>Ut});var Ue=class extends Event{constructor(e,t=!1){super(e,{cancelable:t})}},Ne=class extends EventTarget{dispatchEvent(e){return super.dispatchEvent(e)}addEventListener(e,t,i){super.addEventListener(e,t,i)}removeEventListener(e,t,i){super.removeEventListener(e,t,i)}},Ve=class extends Ue{},Fe=class e extends Ve{constructor(t,i){super(e.type,!0),this.position=t,this.zoomLevel=i}};Fe.type="before-animate";var We=Fe,je=class e extends Ve{constructor(t,i){super(e.type),this.timestamp=t,this.elapsed=i}};je.type="before-render";var Ye=je,Xe=class e extends Ve{constructor(t){super(e.type,!0),this.position=t}};Xe.type="before-rotate";var $e=Xe,Ze=class e extends Ve{constructor(t){super(e.type),this.data=t}};Ze.type="click";var Be=Ze,Ge=class e extends Ve{constructor(t){super(e.type),this.options=t}containsOptions(...e){return e.some((e=>this.options.includes(e)))}};Ge.type="config-changed";var qe=Ge,Ke=class e extends Ve{constructor(t){super(e.type),this.data=t}};Ke.type="dblclick";var Qe=Ke,Je=class e extends Ve{constructor(t){super(e.type),this.fullscreenEnabled=t}};Je.type="fullscreen";var et=Je,tt=class e extends Ve{constructor(t){super(e.type),this.notificationId=t}};tt.type="hide-notification";var it=tt,st=class e extends Ve{constructor(t){super(e.type),this.overlayId=t}};st.type="hide-overlay";var ot=st,nt=class e extends Ve{constructor(t){super(e.type),this.panelId=t}};nt.type="hide-panel";var rt=nt,at=class e extends Ve{constructor(t){super(e.type),this.tooltipData=t}};at.type="hide-tooltip";var ht=at,ct=class e extends Ve{constructor(t){super(e.type,!0),this.key=t}};ct.type="key-press";var lt=ct,dt=class e extends Ve{constructor(t){super(e.type),this.progress=t}};dt.type="load-progress";var pt=dt,ut=class e extends Ve{constructor(t){super(e.type),this.panorama=t}};ut.type="panorama-load";var vt=ut,mt=class e extends Ve{constructor(t){super(e.type),this.data=t}};mt.type="panorama-loaded";var wt=mt,gt=class e extends Ve{constructor(t,i){super(e.type),this.panorama=t,this.error=i}};gt.type="panorama-error";var ft=gt,yt=class e extends Ve{constructor(t){super(e.type),this.position=t}};yt.type="position-updated";var bt=yt,Et=class e extends Ve{constructor(){super(e.type)}};Et.type="ready";var _t=Et,xt=class e extends Ve{constructor(){super(e.type)}};xt.type="render";var Mt=xt,Tt=class e extends Ve{constructor(t){super(e.type),this.notificationId=t}};Tt.type="show-notification";var Ot=Tt,Ct=class e extends Ve{constructor(t){super(e.type),this.overlayId=t}};Ct.type="show-overlay";var Lt=Ct,It=class e extends Ve{constructor(t){super(e.type),this.panelId=t}};It.type="show-panel";var kt=It,Pt=class e extends Ve{constructor(t,i){super(e.type),this.tooltip=t,this.tooltipData=i}};Pt.type="show-tooltip";var St=Pt,Ht=class e extends Ve{constructor(t){super(e.type),this.size=t}};Ht.type="size-updated";var Rt=Ht,zt=class e extends Ve{constructor(){super(e.type)}};zt.type="stop-all";var At=zt,Dt=class e extends Ve{constructor(t){super(e.type),this.zoomLevel=t}};Dt.type="zoom-updated";var Ut=Dt,Nt=class extends Ve{constructor(e,t,i,s,o){super(e),this.originalEvent=t,this.object=i,this.viewerPoint=s,this.userDataKey=o}},Vt=class e extends Nt{constructor(t,i,s,o){super(e.type,t,i,s,o)}};Vt.type="enter-object";var Ft=Vt,Wt=class e extends Nt{constructor(t,i,s,o){super(e.type,t,i,s,o)}};Wt.type="leave-object";var jt=Wt,Yt=class e extends Nt{constructor(t,i,s,o){super(e.type,t,i,s,o)}};Yt.type="hover-object";var Xt=Yt,$t=a(),Zt=class e{constructor(e){this.viewer=e}init(){}destroy(){}supportsTransition(e){return!1}supportsPreload(e){return!1}textureCoordsToSphericalCoords(e,t){throw new ne("Current adapter does not support texture coordinates.")}sphericalCoordsToTextureCoords(e,t){throw new ne("Current adapter does not support texture coordinates.")}setOverlay(e,t,i){throw new ne("Current adapter does not support overlay")}static createOverlayMaterial({additionalUniforms:t,overrideVertexShader:i}={}){return new $t.ShaderMaterial({uniforms:{...t,[e.OVERLAY_UNIFORMS.panorama]:{value:null},[e.OVERLAY_UNIFORMS.overlay]:{value:null},[e.OVERLAY_UNIFORMS.globalOpacity]:{value:1},[e.OVERLAY_UNIFORMS.overlayOpacity]:{value:0}},vertexShader:i||"\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:`\nuniform sampler2D ${e.OVERLAY_UNIFORMS.panorama};\nuniform sampler2D ${e.OVERLAY_UNIFORMS.overlay};\nuniform float ${e.OVERLAY_UNIFORMS.globalOpacity};\nuniform float ${e.OVERLAY_UNIFORMS.overlayOpacity};\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 tColor1 = texture2D( ${e.OVERLAY_UNIFORMS.panorama}, vUv );\n vec4 tColor2 = texture2D( ${e.OVERLAY_UNIFORMS.overlay}, vUv );\n gl_FragColor = vec4(\n mix( tColor1.rgb, tColor2.rgb, tColor2.a * ${e.OVERLAY_UNIFORMS.overlayOpacity} ),\n ${e.OVERLAY_UNIFORMS.globalOpacity}\n );\n}`})}};Zt.supportsDownload=!1,Zt.supportsOverlay=!1,Zt.OVERLAY_UNIFORMS={panorama:"panorama",overlay:"overlay",globalOpacity:"globalOpacity",overlayOpacity:"overlayOpacity"};var Bt=Zt;function Gt(e){if(e)for(const[,t]of[["_",e],...Object.entries(e)])if(t.prototype instanceof Bt)return Ie(t.id,t.VERSION,"5.5.0"),t;return null}var qt=a(),Kt=`${b}_touchSupport`,Qt={loaded:!1,pixelRatio:1,isWebGLSupported:!1,maxTextureWidth:0,isTouchEnabled:null,fullscreenEvent:null,__maxCanvasWidth:null,get maxCanvasWidth(){return null===this.__maxCanvasWidth&&(this.__maxCanvasWidth=function(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.width=e,t.height=e/2;for(;t.width>1024;){i.fillStyle="white",i.fillRect(0,0,1,1);try{if(i.getImageData(0,0,1,1).data[0]>0)return t.width}catch(e){}t.width/=2,t.height/=2}throw new ne("Unable to detect system capabilities")}(this.maxTextureWidth)),this.__maxCanvasWidth},load(){if(!this.loaded){const e=function(){const e=document.createElement("canvas"),t=["webgl2","webgl","experimental-webgl","moz-webgl","webkit-3d"];let i=null;if(!e.getContext)return null;return t.some((t=>{try{return i=e.getContext(t),null!==i}catch(e){return!1}}))?i:null}();this.pixelRatio=window.devicePixelRatio||1,this.isWebGLSupported=null!==e,this.maxTextureWidth=e?e.getParameter(e.MAX_TEXTURE_SIZE):0,this.isTouchEnabled=function(){let e="ontouchstart"in window||navigator.maxTouchPoints>0;Kt in localStorage&&(e="true"===localStorage[Kt]);const t=new Promise((t=>{const i=()=>{window.removeEventListener("mousedown",s),window.removeEventListener("touchstart",o),clearTimeout(r)},s=()=>{i(),localStorage[Kt]=!1,t(!1)},o=()=>{i(),localStorage[Kt]=!0,t(!0)},n=()=>{i(),localStorage[Kt]=e,t(e)};window.addEventListener("mousedown",s,!1),window.addEventListener("touchstart",o,!1);const r=setTimeout(n,1e4)}));return{initial:e,promise:t}}(),this.fullscreenEvent=function(){if("exitFullscreen"in document)return"fullscreenchange";if("webkitExitFullscreen"in document)return"webkitfullscreenchange";return null}(),this.loaded=!0}if(!Qt.isWebGLSupported)throw new ne("WebGL is not supported.");if(0===Qt.maxTextureWidth)throw new ne("Unable to detect system capabilities")}};var Jt=URL.createObjectURL(new Blob(["(",function(){function e(e){return`rgb(${e.r}, ${e.g}, ${e.b})`}function t(e,t){return{r:Math.round(e.r/2+t.r/2),g:Math.round(e.g/2+t.g/2),b:Math.round(e.b/2+t.b/2)}}function i(t,i,s,o,n){const r=t.createLinearGradient(i,0,s,0);return r.addColorStop(0,e(o)),r.addColorStop(1,e(n)),r}function s(e,t,i,s,o,n){n=Math.round(n);let r=0,a=0,h=0,c=0;const l=e.getImageData(t,i,s,o);for(let e=0;e{const n=o.data.panoData,r=new OffscreenCanvas(n.fullWidth,n.fullHeight),a=r.getContext("2d"),h=new OffscreenCanvas(n.croppedWidth,n.croppedHeight);h.getContext("2d").putImageData(o.data.image,0,0),function(o,n,r){const a=r.fullHeight-r.croppedHeight-r.croppedY,h=r.fullWidth-r.croppedWidth-r.croppedX,c=r.croppedY+r.croppedHeight/2,l=o.width/32,d=l,p=10,u=`blur(${l}px)`,v=o.getContext("2d");if(v.drawImage(n,r.croppedX,r.croppedY,r.croppedWidth,r.croppedHeight),r.croppedY>0){if(r.croppedX>0||h>0){v.filter="none";const e=s(v,r.croppedX,r.croppedY,p,p,2),n=s(v,o.width-h-11,r.croppedY,p,p,2),a=t(e,n);r.croppedX>0&&(v.fillStyle=i(v,0,r.croppedX,a,e),v.fillRect(-d,-d,r.croppedX+2*d,c+d)),h>0&&(v.fillStyle=i(v,o.width-h,o.width,n,a),v.fillRect(o.width-h-d,-d,h+2*d,c+d))}v.filter=u,v.drawImage(n,0,0,n.width,p,r.croppedX,-d,r.croppedWidth,r.croppedY+2*d),v.fillStyle=e(s(v,0,0,o.width,p,p)),v.fillRect(-d,-d,o.width+2*d,2*d)}if(a>0){if(r.croppedX>0||h>0){v.filter="none";const e=s(v,r.croppedX,o.height-a-1-p,p,p,2),n=s(v,o.width-h-1-p,o.height-a-1-p,p,p,2),l=t(e,n);r.croppedX>0&&(v.fillStyle=i(v,0,r.croppedX,l,e),v.fillRect(-d,c,r.croppedX+2*d,o.height-c+d)),h>0&&(v.fillStyle=i(v,o.width-h,o.width,n,l),v.fillRect(o.width-h-d,c,h+2*d,o.height-c+d))}v.filter=u,v.drawImage(n,0,n.height-p,n.width,p,r.croppedX,o.height-a-d,r.croppedWidth,a+2*d),v.fillStyle=e(s(v,0,o.height-1-p,o.width,p,p)),v.fillRect(-d,o.height-d,o.width+2*d,2*d)}r.croppedX>0&&(v.filter=u,v.drawImage(n,n.width-p,0,p,n.height,-d,r.croppedY,2*d,r.croppedHeight),v.drawImage(n,0,0,p,n.height,0,r.croppedY,r.croppedX+d,r.croppedHeight));h>0&&(v.filter=u,v.drawImage(n,0,0,p,n.height,o.width-d,r.croppedY,2*d,r.croppedHeight),v.drawImage(n,n.width-p,0,p,n.height,o.width-h-d,r.croppedY,h+d,r.croppedHeight));v.filter="none",v.drawImage(n,r.croppedX,r.croppedY,r.croppedWidth,r.croppedHeight)}(r,h,n),postMessage(a.getImageData(0,0,r.width,r.height))}}.toString(),")()"],{type:"application/javascript"})),ei=Ce({backgroundColor:"#000",interpolateBackground:!1,resolution:64,useXmpData:!0,blur:!1},{resolution:e=>{if(!e||!qt.MathUtils.isPowerOfTwo(e))throw new ne("EquirectangularAdapter resolution must be power of two");return e}}),ti=class extends Bt{constructor(e,t){super(e),this.config=ei(t),ee(this.viewer.config.useXmpData)||(this.config.useXmpData=this.viewer.config.useXmpData),ee(this.viewer.config.canvasBackground)||(this.config.backgroundColor=this.viewer.config.canvasBackground),this.config.interpolateBackground&&(window.Worker?this.interpolationWorker=new Worker(Jt):(le("Web Worker API not available"),this.config.interpolateBackground=!1)),this.SPHERE_SEGMENTS=this.config.resolution,this.SPHERE_HORIZONTAL_SEGMENTS=this.SPHERE_SEGMENTS/2}supportsTransition(){return!0}supportsPreload(){return!0}destroy(){this.interpolationWorker?.terminate(),super.destroy()}textureCoordsToSphericalCoords(e,t){if(ee(e.textureX)||ee(e.textureY))throw new ne("Texture position is missing 'textureX' or 'textureY'");const i=(e.textureX+t.croppedX)/t.fullWidth*Math.PI*2,s=(e.textureY+t.croppedY)/t.fullHeight*Math.PI;return{yaw:i>=Math.PI?i-Math.PI:i+Math.PI,pitch:Math.PI/2-s}}sphericalCoordsToTextureCoords(e,t){const i=e.yaw/Math.PI/2*t.fullWidth,s=e.pitch/Math.PI*t.fullHeight;return{textureX:Math.round(e.yawthis.viewer.loader.setProgress(e):null,e),n=s?await this.loadXMP(o):null,r=await this.viewer.textureLoader.blobToImage(o);"function"==typeof t&&(t=t(r,n)),t||n||(t=this.__defaultPanoData(r));const a={isEquirectangular:!0,fullWidth:te(t?.fullWidth,n?.fullWidth,r.width),fullHeight:te(t?.fullHeight,n?.fullHeight,r.height),croppedWidth:te(t?.croppedWidth,n?.croppedWidth,r.width),croppedHeight:te(t?.croppedHeight,n?.croppedHeight,r.height),croppedX:te(t?.croppedX,n?.croppedX,0),croppedY:te(t?.croppedY,n?.croppedY,0),poseHeading:te(t?.poseHeading,n?.poseHeading,0),posePitch:te(t?.posePitch,n?.posePitch,0),poseRoll:te(t?.poseRoll,n?.poseRoll,0)};a.croppedWidth===r.width&&a.croppedHeight===r.height||le(`Invalid panoData, croppedWidth/croppedHeight is not coherent with the loaded image.\n panoData: ${a.croppedWidth}x${a.croppedHeight}, image: ${r.width}x${r.height}`),Math.abs(a.fullWidth-2*a.fullHeight)>1&&(le("Invalid panoData, fullWidth should be twice fullHeight"),a.fullWidth=2*a.fullHeight),a.croppedX+a.croppedWidth>a.fullWidth&&(le("Invalid panoData, croppedX + croppedWidth > fullWidth"),a.croppedX=a.fullWidth-a.croppedWidth),a.croppedY+a.croppedHeight>a.fullHeight&&(le("Invalid panoData, croppedY + croppedHeight > fullHeight"),a.croppedY=a.fullHeight-a.croppedHeight);return{panorama:e,texture:this.createEquirectangularTexture(r,a),panoData:a,cacheKey:e}}async loadXMP(e){const t=await this.loadBlobAsString(e),i=t.indexOf(""),o=t.substring(i,s);return-1!==i&&-1!==s&&o.includes("GPano:")?{isEquirectangular:!0,fullWidth:pe(o,"FullPanoWidthPixels"),fullHeight:pe(o,"FullPanoHeightPixels"),croppedWidth:pe(o,"CroppedAreaImageWidthPixels"),croppedHeight:pe(o,"CroppedAreaImageHeightPixels"),croppedX:pe(o,"CroppedAreaLeftPixels"),croppedY:pe(o,"CroppedAreaTopPixels"),poseHeading:pe(o,"PoseHeadingDegrees"),posePitch:pe(o,"PosePitchDegrees"),poseRoll:pe(o,"PoseRollDegrees")}:null}loadBlobAsString(e){return new Promise(((t,i)=>{const s=new FileReader;s.onload=()=>t(s.result),s.onerror=i,s.readAsText(e)}))}createEquirectangularTexture(e,t){if(this.config.blur||t.fullWidth>Qt.maxTextureWidth||t.croppedWidth!==t.fullWidth||t.croppedHeight!==t.fullHeight){const i=Math.min(1,Qt.maxCanvasWidth/t.fullWidth),s={fullWidth:t.fullWidth*i,fullHeight:t.fullHeight*i,croppedWidth:t.croppedWidth*i,croppedHeight:t.croppedHeight*i,croppedX:t.croppedX*i,croppedY:t.croppedY*i},o=document.createElement("canvas");o.width=s.fullWidth,o.height=s.fullHeight;const n=o.getContext("2d");this.config.backgroundColor&&(n.fillStyle=this.config.backgroundColor,n.fillRect(0,0,o.width,o.height)),this.config.blur&&(n.filter=`blur(${o.width/2048}px)`),n.drawImage(e,s.croppedX,s.croppedY,s.croppedWidth,s.croppedHeight);const r=Me(o);return!this.config.interpolateBackground||t.croppedWidth===t.fullWidth&&t.croppedHeight===t.fullHeight||(this.interpolationWorker.postMessage({image:n.getImageData(s.croppedX,s.croppedY,s.croppedWidth,s.croppedHeight),panoData:s}),this.interpolationWorker.onmessage=e=>{n.putImageData(e.data,0,0),r.needsUpdate=!0,this.viewer.needsUpdate()}),r}return Me(e)}createMesh(e=1){const t=new qt.SphereGeometry(y*e,this.SPHERE_SEGMENTS,this.SPHERE_HORIZONTAL_SEGMENTS,-Math.PI/2).scale(-1,1,1),i=Bt.createOverlayMaterial();return new qt.Mesh(t,i)}setTexture(e,t){this.__setUniform(e,Bt.OVERLAY_UNIFORMS.panorama,t.texture)}setOverlay(e,t,i){this.__setUniform(e,Bt.OVERLAY_UNIFORMS.overlayOpacity,i),t?this.__setUniform(e,Bt.OVERLAY_UNIFORMS.overlay,t.texture):this.__setUniform(e,Bt.OVERLAY_UNIFORMS.overlay,null)}setTextureOpacity(e,t){this.__setUniform(e,Bt.OVERLAY_UNIFORMS.globalOpacity,t),e.material.transparent=t<1}disposeTexture(e){e.texture?.dispose()}__setUniform(e,t,i){e.material.uniforms[t].value=i}__defaultPanoData(e){const t=Math.max(e.width,2*e.height),i=Math.round(t/2),s=Math.round((t-e.width)/2),o=Math.round((i-e.height)/2);return{isEquirectangular:!0,fullWidth:t,fullHeight:i,croppedWidth:e.width,croppedHeight:e.height,croppedX:s,croppedY:o}}};ti.id="equirectangular",ti.VERSION="5.5.0",ti.supportsDownload=!0,ti.supportsOverlay=!0;var ii=class e{constructor(t,i){this.parent=t,this.children=[],this.container=document.createElement("div"),this.state={visible:!0},this.viewer=t instanceof e?t.viewer:t,this.container.className=i.className||"",this.parent.children.push(this),this.parent.container.appendChild(this.container)}destroy(){this.parent.container.removeChild(this.container);const e=this.parent.children.indexOf(this);-1!==e&&this.parent.children.splice(e,1),this.children.slice().forEach((e=>e.destroy())),this.children.length=0}toggle(e=!this.isVisible()){e?this.show():this.hide()}hide(e){this.container.style.display="none",this.state.visible=!1}show(e){this.container.style.display="",this.state.visible=!0}isVisible(){return this.state.visible}},si=Ce({id:null,className:null,title:null,hoverScale:!1,collapsable:!1,tabbable:!0,icon:null,iconActive:null}),oi=class extends ii{constructor(e,t){super(e,{className:`psv-button ${t.hoverScale?"psv-button--hover-scale":""} ${t.className||""}`}),this.state={visible:!0,enabled:!0,supported:!0,collapsed:!1,active:!1,width:0},this.config=si(t),this.config.id=this.constructor.id,t.icon&&this.__setIcon(t.icon),this.state.width=this.container.offsetWidth,this.config.title?this.container.title=this.config.title:this.id&&this.id in this.viewer.config.lang&&(this.container.title=this.viewer.config.lang[this.id]),t.tabbable&&(this.container.tabIndex=0),this.container.addEventListener("click",(e=>{this.state.enabled&&this.onClick(),e.stopPropagation()})),this.container.addEventListener("keydown",(e=>{e.key===M.Enter&&this.state.enabled&&(this.onClick(),e.stopPropagation())}))}get id(){return this.config.id}get title(){return this.container.title}get content(){return this.container.innerHTML}get width(){return this.state.width}get collapsable(){return this.config.collapsable}show(e=!0){this.isVisible()||(this.state.visible=!0,this.state.collapsed||(this.container.style.display=""),e&&this.viewer.navbar.autoSize())}hide(e=!0){this.isVisible()&&(this.state.visible=!1,this.container.style.display="none",e&&this.viewer.navbar.autoSize())}checkSupported(){re(this.isSupported(),((e,t)=>{this.state&&(this.state.supported=e,t?e||this.hide():this.toggle(e))}))}autoSize(){}isSupported(){return!0}toggleActive(e=!this.state.active){e!==this.state.active&&(this.state.active=e,A(this.container,"psv-button--active",this.state.active),this.config.iconActive&&this.__setIcon(this.state.active?this.config.iconActive:this.config.icon))}disable(){this.container.classList.add("psv-button--disabled"),this.state.enabled=!1}enable(){this.container.classList.remove("psv-button--disabled"),this.state.enabled=!0}collapse(){this.state.collapsed=!0,this.container.style.display="none"}uncollapse(){this.state.collapsed=!1,this.state.visible&&(this.container.style.display="")}__setIcon(e){this.container.innerHTML=e,D(this.container.querySelector("svg"),"psv-button-svg")}},ni=class extends oi{constructor(e,t){super(e,{className:`psv-custom-button ${t.className||""}`,hoverScale:!1,collapsable:!1!==t.collapsable,tabbable:!1!==t.tabbable,title:t.title}),this.customOnClick=t.onClick,t.id?this.config.id=t.id:this.config.id="psvButton-"+Math.random().toString(36).substring(2),t.content&&(this.container.innerHTML=t.content),this.state.width=this.container.offsetWidth,t.disabled&&this.disable(),!1===t.visible&&this.hide()}onClick(){this.customOnClick?.(this.viewer)}},ri=class extends oi{constructor(e){super(e,{className:"psv-description-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:T.info}),this.mode=0,this.viewer.addEventListener(it.type,this),this.viewer.addEventListener(Ot.type,this),this.viewer.addEventListener(rt.type,this),this.viewer.addEventListener(kt.type,this),this.viewer.addEventListener(qe.type,this)}destroy(){this.viewer.removeEventListener(it.type,this),this.viewer.removeEventListener(Ot.type,this),this.viewer.removeEventListener(rt.type,this),this.viewer.removeEventListener(kt.type,this),this.viewer.removeEventListener(qe.type,this),super.destroy()}handleEvent(e){if(e instanceof qe)return void(e.containsOptions("description")&&this.autoSize(!0));if(!this.mode)return;let t=!1;e instanceof it?t=1===this.mode:e instanceof Ot?t=1===this.mode&&e.notificationId!==x.DESCRIPTION:e instanceof rt?t=2===this.mode:e instanceof kt&&(t=2===this.mode&&e.panelId!==x.DESCRIPTION),t&&(this.toggleActive(!1),this.mode=0)}onClick(){this.mode?this.__close():this.__open()}hide(e){super.hide(e),this.mode&&this.__close()}autoSize(e=!1){if(e){const e=this.viewer.navbar.getButton("caption",!1),t=e&&!e.isVisible(),i=!!this.viewer.config.description;t||i?this.show(!1):this.hide(!1)}}__close(){switch(this.mode){case 1:this.viewer.notification.hide(x.DESCRIPTION);break;case 2:this.viewer.panel.hide(x.DESCRIPTION)}}__open(){this.toggleActive(!0),this.viewer.config.description?(this.mode=2,this.viewer.panel.show({id:x.DESCRIPTION,content:(this.viewer.config.caption?`

${this.viewer.config.caption}

`:"")+this.viewer.config.description})):(this.mode=1,this.viewer.notification.show({id:x.DESCRIPTION,content:this.viewer.config.caption}))}};ri.id="description";var ai=class extends oi{constructor(e){super(e,{className:"psv-download-button",hoverScale:!0,collapsable:!0,tabbable:!0,icon:T.download}),this.viewer.addEventListener(qe.type,this)}destroy(){this.viewer.removeEventListener(qe.type,this),super.destroy()}handleEvent(e){e instanceof qe&&e.containsOptions("downloadUrl")&&this.checkSupported()}onClick(){const e=document.createElement("a");e.href=this.viewer.config.downloadUrl||this.viewer.config.panorama,e.href.startsWith("data:")&&!this.viewer.config.downloadName?e.download="panorama."+e.href.substring(0,e.href.indexOf(";")).split("/").pop():e.download=this.viewer.config.downloadName||e.href.split("/").pop(),e.target="_blank",this.viewer.container.appendChild(e),e.click(),setTimeout((()=>{this.viewer.container.removeChild(e)}),100)}checkSupported(){this.viewer.adapter.constructor.supportsDownload||this.viewer.config.downloadUrl?this.show():this.hide()}};ai.id="download";var hi=class extends oi{constructor(e){super(e,{className:"psv-fullscreen-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:T.fullscreenIn,iconActive:T.fullscreenOut}),this.viewer.addEventListener(et.type,this)}destroy(){this.viewer.removeEventListener(et.type,this),super.destroy()}handleEvent(e){e instanceof et&&this.toggleActive(e.fullscreenEnabled)}onClick(){this.viewer.toggleFullscreen()}};hi.id="fullscreen";var ci=class extends oi{constructor(e){super(e,{className:"psv-menu-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:T.menu}),this.viewer.addEventListener(kt.type,this),this.viewer.addEventListener(rt.type,this),super.hide()}destroy(){this.viewer.removeEventListener(kt.type,this),this.viewer.removeEventListener(rt.type,this),super.destroy()}handleEvent(e){e instanceof kt?this.toggleActive(e.panelId===x.MENU):e instanceof rt&&this.toggleActive(!1)}onClick(){this.state.active?this.__hideMenu():this.__showMenu()}hide(e){super.hide(e),this.__hideMenu()}show(e){super.show(e),this.state.active&&this.__showMenu()}__showMenu(){var e,t;this.viewer.panel.show({id:x.MENU,content:(e=this.viewer.navbar.collapsed,t=this.viewer.config.lang.menu,`\n
\n

${T.menu} ${t}

\n
    \n ${e.map((e=>`\n
  • \n ${e.content}\n ${e.title}\n
  • \n `)).join("")}\n
\n
\n`),noMargin:!0,clickHandler:e=>{const t=e?V(e,"li"):void 0,i=t?t.dataset.psvButton:void 0;i&&(this.viewer.navbar.getButton(i).onClick(),this.__hideMenu())}})}__hideMenu(){this.viewer.panel.hide(x.MENU)}};function li(e){let t=0;switch(e){case 0:t=90;break;case 1:t=-90;break;case 3:t=180;break;default:t=0}return T.arrow.replace("rotate(0",`rotate(${t}`)}ci.id="menu";var di=class extends oi{constructor(e,t){super(e,{className:"psv-move-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:li(t)}),this.direction=t,this.handler=new Re,this.container.addEventListener("mousedown",this),this.container.addEventListener("keydown",this),this.container.addEventListener("keyup",this),this.viewer.container.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchend",this)}destroy(){this.__onMouseUp(),this.viewer.container.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchend",this),super.destroy()}handleEvent(e){switch(e.type){case"mousedown":this.__onMouseDown();break;case"mouseup":case"touchend":this.__onMouseUp();break;case"keydown":e.key===M.Enter&&this.__onMouseDown();break;case"keyup":e.key===M.Enter&&this.__onMouseUp()}}onClick(){}isSupported(){return ae(Qt.isTouchEnabled)}__onMouseDown(){if(!this.state.enabled)return;const e={};switch(this.direction){case 0:e.pitch=!1;break;case 1:e.pitch=!0;break;case 3:e.yaw=!1;break;default:e.yaw=!0}this.viewer.stopAll(),this.viewer.dynamics.position.roll(e),this.handler.down()}__onMouseUp(){this.state.enabled&&this.handler.up((()=>{this.viewer.dynamics.position.stop(),this.viewer.resetIdleTimer()}))}};di.groupId="move";var pi=class extends di{constructor(e){super(e,1)}};pi.id="moveDown";var ui=class extends di{constructor(e){super(e,2)}};ui.id="moveLeft";var vi=class extends di{constructor(e){super(e,3)}};vi.id="moveRight";var mi=class extends di{constructor(e){super(e,0)}};mi.id="moveUp";var wi=class extends oi{constructor(e,t,i){super(e,{className:"psv-zoom-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:t}),this.direction=i,this.handler=new Re,this.container.addEventListener("mousedown",this),this.container.addEventListener("keydown",this),this.container.addEventListener("keyup",this),this.viewer.container.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchend",this)}destroy(){this.__onMouseUp(),this.viewer.container.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchend",this),super.destroy()}handleEvent(e){switch(e.type){case"mousedown":this.__onMouseDown();break;case"mouseup":case"touchend":this.__onMouseUp();break;case"keydown":e.key===M.Enter&&this.__onMouseDown();break;case"keyup":e.key===M.Enter&&this.__onMouseUp()}}onClick(){}isSupported(){return ae(Qt.isTouchEnabled)}__onMouseDown(){this.state.enabled&&(this.viewer.dynamics.zoom.roll(1===this.direction),this.handler.down())}__onMouseUp(){this.state.enabled&&this.handler.up((()=>this.viewer.dynamics.zoom.stop()))}};wi.groupId="zoom";var gi=class extends wi{constructor(e){super(e,T.zoomIn,0)}};gi.id="zoomIn";var fi=class extends wi{constructor(e){super(e,T.zoomOut,1)}};fi.id="zoomOut";var yi=class extends oi{constructor(e){super(e,{className:"psv-zoom-range",hoverScale:!1,collapsable:!1,tabbable:!1}),this.zoomRange=document.createElement("div"),this.zoomRange.className="psv-zoom-range-line",this.container.appendChild(this.zoomRange),this.zoomValue=document.createElement("div"),this.zoomValue.className="psv-zoom-range-handle",this.zoomRange.appendChild(this.zoomValue),this.slider=new Ae(this.container,"HORIZONTAL",(e=>this.__onSliderUpdate(e))),this.mediaMinWidth=parseInt(j(this.container,"max-width"),10),this.viewer.addEventListener(Ut.type,this),this.viewer.state.ready?this.__moveZoomValue(this.viewer.getZoomLevel()):this.viewer.addEventListener(_t.type,this)}destroy(){this.slider.destroy(),this.viewer.removeEventListener(Ut.type,this),this.viewer.removeEventListener(_t.type,this),super.destroy()}handleEvent(e){e instanceof Ut?this.__moveZoomValue(e.zoomLevel):e instanceof _t&&this.__moveZoomValue(this.viewer.getZoomLevel())}onClick(){}isSupported(){return ae(Qt.isTouchEnabled)}autoSize(){this.state.supported&&(this.viewer.state.size.width<=this.mediaMinWidth&&this.state.visible?this.hide(!1):this.viewer.state.size.width>this.mediaMinWidth&&!this.state.visible&&this.show(!1))}__moveZoomValue(e){this.zoomValue.style.left=e/100*this.zoomRange.offsetWidth-this.zoomValue.offsetWidth/2+"px"}__onSliderUpdate(e){e.mousedown&&this.viewer.zoom(100*e.value)}};yi.id="zoomRange",yi.groupId="zoom";var bi=a(),Ei=class extends Ne{constructor(e){super(),this.viewer=e}init(){}destroy(){}},_i=class extends Ei{constructor(e,t){super(e),this.config=this.constructor.configParser(t)}setOption(e,t){this.setOptions({[e]:t})}setOptions(e){const t={...this.config,...e},i=this.constructor,s=i.configParser,o=i.readonlyOptions,n=i.id;for(let[i,r]of Object.entries(e))i in s.defaults?o.includes(i)?le(`${n}: Option "${i}" cannot be updated`):(i in s.parsers&&(r=s.parsers[i](r,{rawConfig:t,defValue:s.defaults[i]})),this.config[i]=r):le(`${n}: Unknown option "${i}"`)}};function xi(e){if(e)for(const[,t]of[["_",e],...Object.entries(e)])if(t.prototype instanceof Ei)return Ie(t.id,t.VERSION,"5.5.0"),t;return null}_i.readonlyOptions=[];var Mi={panorama:null,overlay:null,overlayOpacity:1,container:null,adapter:[ti,null],plugins:[],caption:null,description:null,downloadUrl:null,downloadName:null,loadingImg:null,loadingTxt:"Loading...",size:null,fisheye:0,minFov:30,maxFov:90,defaultZoomLvl:50,defaultYaw:0,defaultPitch:0,sphereCorrection:null,moveSpeed:1,zoomSpeed:1,moveInertia:!0,mousewheel:!0,mousemove:!0,mousewheelCtrlKey:!1,touchmoveTwoFingers:!1,useXmpData:null,panoData:null,requestHeaders:null,canvasBackground:null,rendererParameters:{alpha:!0,antialias:!0},withCredentials:!1,navbar:["zoom","move","download","description","caption","fullscreen"],lang:{zoom:"Zoom",zoomOut:"Zoom out",zoomIn:"Zoom in",moveUp:"Move up",moveDown:"Move down",moveLeft:"Move left",moveRight:"Move right",download:"Download",fullscreen:"Fullscreen",menu:"Menu",close:"Close",twoFingers:"Use two fingers to navigate",ctrlZoom:"Use ctrl + scroll to zoom the image",loadError:"The panorama can't be loaded"},keyboard:"fullscreen",keyboardActions:{[M.ArrowUp]:"ROTATE_UP",[M.ArrowDown]:"ROTATE_DOWN",[M.ArrowRight]:"ROTATE_RIGHT",[M.ArrowLeft]:"ROTATE_LEFT",[M.PageUp]:"ZOOM_IN",[M.PageDown]:"ZOOM_OUT",[M.Plus]:"ZOOM_IN",[M.Minus]:"ZOOM_OUT"}},Ti={panorama:"Use setPanorama method to change the panorama",panoData:"Use setPanorama method to change the panorama",overlay:"Use setOverlay method to changer the overlay",overlayOpacity:"Use setOverlay method to changer the overlay",container:"Cannot change viewer container",adapter:"Cannot change adapter",plugins:"Cannot change plugins"},Oi={container:e=>{if(!e)throw new ne("No value given for container.");return e},adapter:(e,{defValue:t})=>{if(!(e=e?Array.isArray(e)?[Gt(e[0]),e[1]]:[Gt(e),null]:t)[0])throw new ne("An undefined value was given for adapter.");if(!e[0].id)throw new ne("Adapter has no id.");return e},overlayOpacity:e=>bi.MathUtils.clamp(e,0,1),defaultYaw:e=>xe(e),defaultPitch:e=>xe(e,!0),defaultZoomLvl:e=>bi.MathUtils.clamp(e,0,100),minFov:(e,{rawConfig:t})=>(t.maxFov(e(Array.isArray(e.twoFingers)&&(le("lang.twoFingers must not be an array"),e.twoFingers=e.twoFingers[0]),{...Mi.lang,...e}),keyboard:e=>!!e&&("object"==typeof e?(le("Use keyboardActions to configure the keyboard actions, keyboard option must be either true, false, 'fullscreen' or 'always'"),"fullscreen"):"always"===e?"always":"fullscreen"),keyboardActions:(e,{rawConfig:t})=>t.keyboard&&"object"==typeof t.keyboard?t.keyboard:e,fisheye:e=>!0===e?1:!1===e?0:e,requestHeaders:e=>e&&"object"==typeof e?()=>e:"function"==typeof e?e:null,rendererParameters:(e,{defValue:t})=>({...e,...t}),plugins:e=>e.map(((e,t)=>{if(!(e=Array.isArray(e)?[xi(e[0]),e[1]]:[xi(e),null])[0])throw new ne(`An undefined value was given for plugin ${t}.`);if(!e[0].id)throw new ne(`Plugin ${t} has no id.`);return e})),navbar:e=>!1===e?null:!0===e?Q(Mi.navbar):"string"==typeof e?e.split(/[ ,]/):e,useXmpData:e=>(null!==e&&le("Global useXmpData is deprecated, it is now configured on the adapter."),e),canvasBackground:e=>(null!==e&&le("Global canvasBackground is deprecated, it is now configured on the adapter."),e),overlay:e=>(null!==e&&le('"overlay" option is deprecated, use "@photo-sphere-viewer/overlay-plugin" instead.'),e)},Ci=Ce(Mi,Oi),Li=class extends oi{constructor(e){super(e,{className:"psv-caption",hoverScale:!1,collapsable:!1,tabbable:!0}),this.contentWidth=0,this.state.width=0,this.contentElt=document.createElement("div"),this.contentElt.className="psv-caption-content",this.container.appendChild(this.contentElt),this.setCaption(this.viewer.config.caption)}hide(){this.contentElt.style.display="none",this.state.visible=!1}show(){this.contentElt.style.display="",this.state.visible=!0}onClick(){}setCaption(e){this.show(),this.contentElt.innerHTML=e??"",this.contentElt.innerHTML?this.contentWidth=this.contentElt.offsetWidth:this.contentWidth=0,this.autoSize()}autoSize(){this.toggle(this.container.offsetWidth>=this.contentWidth),this.__refreshButton()}__refreshButton(){this.viewer.navbar.getButton(ri.id,!1)?.autoSize(!0)}};Li.id="caption";var Ii={},ki={};function Pi(e,t){if(!e.id)throw new ne("Button id is required");if(Ii[e.id]=e,e.groupId&&(ki[e.groupId]=ki[e.groupId]||[]).push(e),t){const i=Mi.navbar;switch(t){case"start":i.unshift(e.id);break;case"end":i.push(e.id);break;default:{const[s,o]=t.split(":"),n=i.indexOf(s);if(!s||!o||-1===n)throw new ne(`Invalid defaultPosition ${t}`);i.splice(n+("right"===o?1:0),0,e.id)}}}}[fi,yi,gi,ri,Li,ai,hi,ui,vi,mi,pi].forEach((e=>Pi(e)));var Si=class extends ii{constructor(e){super(e,{className:`psv-navbar ${E}`}),this.collapsed=[],this.state.visible=!1}show(){this.viewer.container.classList.add("psv--has-navbar"),this.container.classList.add("psv-navbar--open"),this.state.visible=!0}hide(){this.viewer.container.classList.remove("psv--has-navbar"),this.container.classList.remove("psv-navbar--open"),this.state.visible=!1}setButtons(e){this.children.slice().forEach((e=>e.destroy())),this.children.length=0,-1!==e.indexOf(Li.id)&&-1===e.indexOf(ri.id)&&e.splice(e.indexOf(Li.id),0,ri.id),e.forEach((e=>{"object"==typeof e?new ni(this,e):Ii[e]?new Ii[e](this):ki[e]?ki[e].forEach((e=>{new e(this)})):le(`Unknown button ${e}`)})),new ci(this),this.children.forEach((e=>{e instanceof oi&&e.checkSupported()})),this.autoSize()}setCaption(e){this.children.some((t=>t instanceof Li&&(t.setCaption(e),!0)))}getButton(e,t=!0){const i=this.children.find((t=>t instanceof oi&&t.id===e));return!i&&t&&le(`button "${e}" not found in the navbar`),i}autoSize(){this.children.forEach((e=>{e instanceof oi&&e.autoSize()}));const e=this.container.offsetWidth;let t=0;const i=[];this.children.forEach((e=>{e.isVisible()&&e instanceof oi&&(t+=e.width,e.collapsable&&i.push(e))})),0!==t&&(e0?(i.forEach((e=>e.collapse())),this.collapsed=i,this.getButton(ci.id).show(!1)):e>=t&&this.collapsed.length>0&&(this.collapsed.forEach((e=>e.uncollapse())),this.collapsed=[],this.getButton(ci.id).hide(!1)),this.getButton(Li.id,!1)?.autoSize())}},Hi=class extends ii{constructor(e){super(e,{className:"psv-loader-container"}),this.loader=document.createElement("div"),this.loader.className="psv-loader",this.container.appendChild(this.loader),this.size=this.loader.offsetWidth,this.canvas=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.canvas.setAttribute("class","psv-loader-canvas"),this.canvas.setAttribute("viewBox",`0 0 ${this.size} ${this.size}`),this.loader.appendChild(this.canvas),this.textColor=j(this.loader,"color"),this.color=j(this.canvas,"color"),this.border=parseInt(j(this.loader,"--psv-loader-border"),10),this.thickness=parseInt(j(this.loader,"--psv-loader-tickness"),10),this.viewer.addEventListener(qe.type,this),this.__updateContent(),this.hide()}destroy(){this.viewer.removeEventListener(qe.type,this),super.destroy()}handleEvent(e){e instanceof qe&&e.containsOptions("loadingImg","loadingTxt")&&this.__updateContent()}setProgress(e){const t=Math.min(e,99.999)/100*Math.PI*2,i=this.size/2,s=i,o=this.thickness/2+this.border,n=(this.size-this.thickness)/2-this.border,r=Math.sin(t)*n+i,a=-Math.cos(t)*n+i,h=e>50?"1":"0";this.canvas.innerHTML=`\n \n \n `,this.viewer.dispatchEvent(new pt(Math.round(e)))}__updateContent(){const e=this.loader.querySelector(".psv-loader-image, .psv-loader-text");let t;if(e&&this.loader.removeChild(e),this.viewer.config.loadingImg?(t=document.createElement("img"),t.className="psv-loader-image",t.src=this.viewer.config.loadingImg):this.viewer.config.loadingTxt&&(t=document.createElement("div"),t.className="psv-loader-text",t.innerHTML=this.viewer.config.loadingTxt),t){const e=Math.round(Math.sqrt(2*Math.pow(this.size/2-this.thickness/2-this.border,2)));t.style.maxWidth=e+"px",t.style.maxHeight=e+"px",this.loader.appendChild(t)}}},Ri=class extends ii{constructor(e){super(e,{className:"psv-notification"}),this.state={visible:!1,contentId:null,timeout:null},this.content=document.createElement("div"),this.content.className="psv-notification-content",this.container.appendChild(this.content),this.content.addEventListener("click",(()=>this.hide()))}isVisible(e){return this.state.visible&&(!e||!this.state.contentId||this.state.contentId===e)}toggle(){throw new ne("Notification cannot be toggled")}show(e){this.state.timeout&&(clearTimeout(this.state.timeout),this.state.timeout=null),"string"==typeof e&&(e={content:e}),this.state.contentId=e.id||null,this.content.innerHTML=e.content,this.container.classList.add("psv-notification--visible"),this.state.visible=!0,this.viewer.dispatchEvent(new Ot(e.id)),e.timeout&&(this.state.timeout=setTimeout((()=>this.hide(this.state.contentId)),e.timeout))}hide(e){if(this.isVisible(e)){const e=this.state.contentId;this.container.classList.remove("psv-notification--visible"),this.state.visible=!1,this.state.contentId=null,this.viewer.dispatchEvent(new it(e))}}},zi=class extends ii{constructor(e){super(e,{className:`psv-overlay ${E}`}),this.state={visible:!1,contentId:null,dissmisable:!0},this.image=document.createElement("div"),this.image.className="psv-overlay-image",this.container.appendChild(this.image),this.title=document.createElement("div"),this.title.className="psv-overlay-title",this.container.appendChild(this.title),this.text=document.createElement("div"),this.text.className="psv-overlay-text",this.container.appendChild(this.text),this.container.addEventListener("click",this),this.viewer.addEventListener(lt.type,this),super.hide()}destroy(){this.viewer.removeEventListener(lt.type,this),super.destroy()}handleEvent(e){"click"===e.type?this.isVisible()&&this.state.dissmisable&&(this.hide(),e.stopPropagation()):e instanceof lt&&this.isVisible()&&this.state.dissmisable&&e.key===M.Escape&&(this.hide(),e.preventDefault())}isVisible(e){return this.state.visible&&(!e||!this.state.contentId||this.state.contentId===e)}toggle(){throw new ne("Overlay cannot be toggled")}show(e){"string"==typeof e&&(e={title:e}),this.state.contentId=e.id||null,this.state.dissmisable=!1!==e.dissmisable,this.image.innerHTML=e.image||"",this.title.innerHTML=e.title||"",this.text.innerHTML=e.text||"",super.show(),this.viewer.dispatchEvent(new Lt(e.id))}hide(e){if(this.isVisible(e)){const e=this.state.contentId;super.hide(),this.state.contentId=null,this.viewer.dispatchEvent(new ot(e))}}},Ai="psv-panel-content--no-interaction",Di=class extends ii{constructor(e){super(e,{className:`psv-panel ${E}`}),this.state={visible:!1,contentId:null,mouseX:0,mouseY:0,mousedown:!1,clickHandler:null,keyHandler:null,width:{}};const t=document.createElement("div");t.className="psv-panel-resizer",this.container.appendChild(t);const i=document.createElement("div");i.className="psv-panel-close-button",i.innerHTML=T.close,i.title=e.config.lang.close,this.container.appendChild(i),this.content=document.createElement("div"),this.content.className="psv-panel-content",this.container.appendChild(this.content),this.container.addEventListener("wheel",(e=>e.stopPropagation())),i.addEventListener("click",(()=>this.hide())),t.addEventListener("mousedown",this),t.addEventListener("touchstart",this),this.viewer.container.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchend",this),this.viewer.container.addEventListener("mousemove",this),this.viewer.container.addEventListener("touchmove",this),this.viewer.addEventListener(lt.type,this)}destroy(){this.viewer.removeEventListener(lt.type,this),this.viewer.container.removeEventListener("mousemove",this),this.viewer.container.removeEventListener("touchmove",this),this.viewer.container.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchend",this),super.destroy()}handleEvent(e){switch(e.type){case"mousedown":this.__onMouseDown(e);break;case"touchstart":this.__onTouchStart(e);break;case"mousemove":this.__onMouseMove(e);break;case"touchmove":this.__onTouchMove(e);break;case"mouseup":this.__onMouseUp(e);break;case"touchend":this.__onTouchEnd(e);break;case lt.type:this.__onKeyPress(e)}}isVisible(e){return this.state.visible&&(!e||!this.state.contentId||this.state.contentId===e)}toggle(){throw new ne("Panel cannot be toggled")}show(e){"string"==typeof e&&(e={content:e});const t=this.isVisible(e.id);this.state.contentId=e.id||null,this.state.visible=!0,this.state.clickHandler&&(this.content.removeEventListener("click",this.state.clickHandler),this.content.removeEventListener("keydown",this.state.keyHandler),this.state.clickHandler=null,this.state.keyHandler=null),e.id&&this.state.width[e.id]?this.container.style.width=this.state.width[e.id]:e.width?this.container.style.width=e.width:this.container.style.width=null,this.content.innerHTML=e.content,this.content.scrollTop=0,this.container.classList.add("psv-panel--open"),A(this.content,"psv-panel-content--no-margin",!0===e.noMargin),e.clickHandler&&(this.state.clickHandler=t=>{e.clickHandler(t.target)},this.state.keyHandler=t=>{t.key===M.Enter&&e.clickHandler(t.target)},this.content.addEventListener("click",this.state.clickHandler),this.content.addEventListener("keydown",this.state.keyHandler),t||setTimeout((()=>{this.content.querySelector("a,button,[tabindex]")?.focus()}),300)),this.viewer.dispatchEvent(new kt(e.id))}hide(e){if(this.isVisible(e)){const e=this.state.contentId;this.state.visible=!1,this.state.contentId=null,this.content.innerHTML=null,this.container.classList.remove("psv-panel--open"),this.state.clickHandler&&(this.content.removeEventListener("click",this.state.clickHandler),this.state.clickHandler=null),this.viewer.dispatchEvent(new rt(e))}}__onMouseDown(e){e.stopPropagation(),this.__startResize(e.clientX,e.clientY)}__onTouchStart(e){if(e.stopPropagation(),1===e.touches.length){const t=e.touches[0];this.__startResize(t.clientX,t.clientY)}}__onMouseUp(e){this.state.mousedown&&(e.stopPropagation(),this.state.mousedown=!1,this.content.classList.remove(Ai))}__onTouchEnd(e){this.state.mousedown&&(e.stopPropagation(),0===e.touches.length&&(this.state.mousedown=!1,this.content.classList.remove(Ai)))}__onMouseMove(e){this.state.mousedown&&(e.stopPropagation(),this.__resize(e.clientX,e.clientY))}__onTouchMove(e){if(this.state.mousedown){const t=e.touches[0];this.__resize(t.clientX,t.clientY)}}__onKeyPress(e){this.isVisible()&&e.key===M.Escape&&(this.hide(),e.preventDefault())}__startResize(e,t){this.state.mouseX=e,this.state.mouseY=t,this.state.mousedown=!0,this.content.classList.add(Ai)}__resize(e,t){const i=e,s=t,o=Math.max(200,this.container.offsetWidth-(i-this.state.mouseX))+"px";this.state.contentId&&(this.state.width[this.state.contentId]=o),this.container.style.width=o,this.state.mouseX=i,this.state.mouseY=s}},Ui=class extends ii{constructor(e,t){super(e,{className:"psv-tooltip"}),this.state={visible:!0,arrow:0,border:0,state:0,width:0,height:0,pos:"",config:null,data:null},this.content=document.createElement("div"),this.content.className="psv-tooltip-content",this.container.appendChild(this.content),this.arrow=document.createElement("div"),this.arrow.className="psv-tooltip-arrow",this.container.appendChild(this.arrow),this.container.addEventListener("transitionend",this),this.container.addEventListener("touchdown",(e=>e.stopPropagation())),this.container.addEventListener("mousedown",(e=>e.stopPropagation())),this.container.style.top="-1000px",this.container.style.left="-1000px",this.show(t)}handleEvent(e){"transitionend"===e.type&&this.__onTransitionEnd(e)}destroy(){delete this.state.data,super.destroy()}toggle(){throw new ne("Tooltip cannot be toggled")}show(e){if(0!==this.state.state)throw new ne("Initialized tooltip cannot be re-initialized");e.className&&D(this.container,e.className),e.style&&Object.assign(this.container.style,e.style),this.state.state=3,this.update(e.content,e),this.state.data=e.data,this.state.state=1,this.viewer.dispatchEvent(new St(this,this.state.data)),this.__waitImages()}update(e,t){this.content.innerHTML=e;const i=this.container.getBoundingClientRect();this.state.width=i.right-i.left,this.state.height=i.bottom-i.top,this.state.arrow=parseInt(j(this.arrow,"border-top-width"),10),this.state.border=parseInt(j(this.container,"border-top-left-radius"),10),this.move(t??this.state.config)}move(e){if(1!==this.state.state&&3!==this.state.state)throw new ne("Uninitialized tooltip cannot be moved");e.box=e.box??this.state.config?.box??{width:0,height:0},this.state.config=e;const t=this.container,i=this.arrow,s={posClass:ye(e.position,{allowCenter:!1,cssOrder:!1})||["top","center"],width:this.state.width,height:this.state.height,top:0,left:0,arrowTop:0,arrowLeft:0};this.__computeTooltipPosition(s,e);let o=null,n=null;if(s.top<0?o="bottom":s.top+s.height>this.viewer.state.size.height&&(o="top"),s.left<0?n="right":s.left+s.width>this.viewer.state.size.width&&(n="left"),n||o){const t=be(s.posClass);o&&(s.posClass[t?0:1]=o),n&&(s.posClass[t?1:0]=n),this.__computeTooltipPosition(s,e)}t.style.top=s.top+"px",t.style.left=s.left+"px",i.style.top=s.arrowTop+"px",i.style.left=s.arrowLeft+"px";const r=s.posClass.join("-");r!==this.state.pos&&(t.classList.remove(`psv-tooltip--${this.state.pos}`),this.state.pos=r,t.classList.add(`psv-tooltip--${this.state.pos}`))}hide(){this.container.classList.remove("psv-tooltip--visible"),this.state.state=2,this.viewer.dispatchEvent(new ht(this.state.data))}__onTransitionEnd(e){if("transform"===e.propertyName)switch(this.state.state){case 1:this.container.classList.add("psv-tooltip--visible"),this.state.state=3;break;case 2:this.state.state=0,this.destroy()}}__computeTooltipPosition(e,t){const i=this.state.arrow,s=t.top,o=e.height,n=t.left,r=e.width,a=i+this.state.border,h=t.box.width/2+2*i,c=t.box.height/2+2*i;switch(e.posClass.join("-")){case"top-left":e.top=s-c-o,e.left=n+a-r,e.arrowTop=o,e.arrowLeft=r-a-i;break;case"top-center":e.top=s-c-o,e.left=n-r/2,e.arrowTop=o,e.arrowLeft=r/2-i;break;case"top-right":e.top=s-c-o,e.left=n-a,e.arrowTop=o,e.arrowLeft=i;break;case"bottom-left":e.top=s+c,e.left=n+a-r,e.arrowTop=2*-i,e.arrowLeft=r-a-i;break;case"bottom-center":e.top=s+c,e.left=n-r/2,e.arrowTop=2*-i,e.arrowLeft=r/2-i;break;case"bottom-right":e.top=s+c,e.left=n-a,e.arrowTop=2*-i,e.arrowLeft=i;break;case"left-top":e.top=s+a-o,e.left=n-h-r,e.arrowTop=o-a-i,e.arrowLeft=r;break;case"center-left":e.top=s-o/2,e.left=n-h-r,e.arrowTop=o/2-i,e.arrowLeft=r;break;case"left-bottom":e.top=s-a,e.left=n-h-r,e.arrowTop=i,e.arrowLeft=r;break;case"right-top":e.top=s+a-o,e.left=n+h,e.arrowTop=o-a-i,e.arrowLeft=2*-i;break;case"center-right":e.top=s-o/2,e.left=n+h,e.arrowTop=o/2-i,e.arrowLeft=2*-i;break;case"right-bottom":e.top=s-a,e.left=n+h,e.arrowTop=i,e.arrowLeft=2*-i}}__waitImages(){const e=this.content.querySelectorAll("img");if(e.length>0){const t=[];e.forEach((e=>{t.push(new Promise((t=>{e.onload=t,e.onerror=t})))})),Promise.all(t).then((()=>{if(1===this.state.state||3===this.state.state){const e=this.container.getBoundingClientRect();this.state.width=e.right-e.left,this.state.height=e.bottom-e.top,this.move(this.state.config)}}))}}},Ni=a(),Vi={enabled:!0,maxItems:10,ttl:600,items:{},purgeInterval:null,init(){Ni.Cache.enabled&&(le("ThreeJS cache should be disabled"),Ni.Cache.enabled=!1),!this.purgeInterval&&this.enabled&&(this.purgeInterval=setInterval((()=>this.purge()),6e4))},add(e,t,i){this.enabled&&t&&(this.items[t]=this.items[t]??{files:{},lastAccess:null},this.items[t].files[e]=i,this.items[t].lastAccess=Date.now())},get(e,t){if(this.enabled&&t&&this.items[t])return this.items[t].lastAccess=Date.now(),this.items[t].files[e]},remove(e,t){this.enabled&&t&&this.items[t]&&(delete this.items[t].files[e],0===Object.keys(this.items[t].files).length&&delete this.items[t])},purge(){Object.entries(this.items).sort((([,e],[,t])=>t.lastAccess-e.lastAccess)).forEach((([e,{lastAccess:t}],i)=>{i>0&&(Date.now()-t>=1e3*this.ttl||i>=this.maxItems)&&delete this.items[e]}))}},Fi=a(),Wi=class{constructor(e){this.viewer=e,this.config=e.config,this.state=e.state}destroy(){}},ji=new Fi.Vector3,Yi=new Fi.Euler(0,0,0,"ZXY"),Xi=class extends Wi{constructor(e){super(e)}fovToZoomLevel(e){const t=Math.round((e-this.config.minFov)/(this.config.maxFov-this.config.minFov)*100);return t-2*(t-50)}zoomLevelToFov(e){return this.config.maxFov+e/100*(this.config.minFov-this.config.maxFov)}vFovToHFov(e){return Fi.MathUtils.radToDeg(2*Math.atan(Math.tan(Fi.MathUtils.degToRad(e)/2)*this.state.aspect))}getAnimationProperties(e,t,i){const s=!ee(t),o=!ee(i),n={};let r;if(s){const i=this.viewer.getPosition(),s=S(i.yaw,t.yaw);n.yaw={start:i.yaw,end:i.yaw+s},n.pitch={start:i.pitch,end:t.pitch},r=_e(e,H(i,t))}if(o){const t=this.viewer.getZoomLevel(),s=Math.abs(i-t);n.zoom={start:t,end:i},r||(r=_e(e,Math.PI/4*s/100))}return r=Math.max(p,r),{duration:r,properties:n}}textureCoordsToSphericalCoords(e){if(!this.state.textureData?.panoData)throw new ne("Current adapter does not support texture coordinates or no texture has been loaded");const t=this.viewer.adapter.textureCoordsToSphericalCoords(e,this.state.textureData.panoData);return Yi.equals(this.viewer.renderer.panoramaPose)&&Yi.equals(this.viewer.renderer.sphereCorrection)?t:(this.sphericalCoordsToVector3(t,ji),ji.applyEuler(this.viewer.renderer.panoramaPose),ji.applyEuler(this.viewer.renderer.sphereCorrection),this.vector3ToSphericalCoords(ji))}sphericalCoordsToTextureCoords(e){if(!this.state.textureData?.panoData)throw new ne("Current adapter does not support texture coordinates or no texture has been loaded");return Yi.equals(this.viewer.renderer.panoramaPose)&&Yi.equals(this.viewer.renderer.sphereCorrection)||(this.sphericalCoordsToVector3(e,ji),Oe(ji,this.viewer.renderer.sphereCorrection),Oe(ji,this.viewer.renderer.panoramaPose),e=this.vector3ToSphericalCoords(ji)),this.viewer.adapter.sphericalCoordsToTextureCoords(e,this.state.textureData.panoData)}sphericalCoordsToVector3(e,t,i=y){return t||(t=new Fi.Vector3),t.x=i*-Math.cos(e.pitch)*Math.sin(e.yaw),t.y=i*Math.sin(e.pitch),t.z=i*Math.cos(e.pitch)*Math.cos(e.yaw),t}vector3ToSphericalCoords(e){const t=Math.acos(e.y/Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z)),i=Math.atan2(e.x,e.z);return{yaw:i<0?-i:2*Math.PI-i,pitch:Math.PI/2-t}}viewerCoordsToVector3(e){const t=this.viewer.renderer.getIntersections(e).filter((e=>e.object.userData[b]));return t.length?t[0].point:null}viewerCoordsToSphericalCoords(e){const t=this.viewerCoordsToVector3(e);return t?this.vector3ToSphericalCoords(t):null}vector3ToViewerCoords(e){const t=e.clone();return t.project(this.viewer.renderer.camera),{x:Math.round((t.x+1)/2*this.state.size.width),y:Math.round((1-t.y)/2*this.state.size.height)}}sphericalCoordsToViewerCoords(e){return this.sphericalCoordsToVector3(e,ji),this.vector3ToViewerCoords(ji)}isPointVisible(e){let t,i;if(e instanceof Fi.Vector3)t=e,i=this.vector3ToViewerCoords(e);else{if(!de(e))return!1;t=this.sphericalCoordsToVector3(e,ji),i=this.vector3ToViewerCoords(t)}return t.dot(this.viewer.state.direction)>0&&i.x>=0&&i.x<=this.viewer.state.size.width&&i.y>=0&&i.y<=this.viewer.state.size.height}cleanPosition(e){return"yaw"in e&&"pitch"in e?{yaw:xe(e.yaw),pitch:xe(e.pitch,!this.state.littlePlanet)}:this.textureCoordsToSphericalCoords(e)}cleanSphereCorrection(e){return{pan:xe(e?.pan||0),tilt:xe(e?.tilt||0,!0),roll:xe(e?.roll||0,!0,!1)}}cleanPanoramaPose(e){return{pan:Fi.MathUtils.degToRad(e?.poseHeading||0),tilt:Fi.MathUtils.degToRad(e?.posePitch||0),roll:Fi.MathUtils.degToRad(e?.poseRoll||0)}}},$i=a(),Zi=class e{constructor(){this.$=e.IDLE}is(...e){return e.some((e=>this.$&e))}set(e){this.$=e}add(e){this.$|=e}remove(e){this.$&=~e}};Zi.IDLE=0,Zi.CLICK=1,Zi.MOVING=2,Zi.INERTIA=4;var Bi=Zi,Gi=class extends Wi{constructor(e){super(e),this.data={startMouseX:0,startMouseY:0,mouseX:0,mouseY:0,mouseHistory:[],pinchDist:0,ctrlKeyDown:!1,dblclickData:null,dblclickTimeout:null,longtouchTimeout:null,twofingersTimeout:null,ctrlZoomTimeout:null},this.step=new Bi,this.keyHandler=new Re,this.resizeObserver=new ResizeObserver(G((()=>this.viewer.autoSize()),50)),this.moveThreshold=u*Qt.pixelRatio}init(){window.addEventListener("keydown",this,{passive:!1}),window.addEventListener("keyup",this),this.viewer.container.addEventListener("mousedown",this),window.addEventListener("mousemove",this,{passive:!1}),window.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchstart",this,{passive:!1}),window.addEventListener("touchmove",this,{passive:!1}),window.addEventListener("touchend",this,{passive:!1}),this.viewer.container.addEventListener("wheel",this,{passive:!1}),document.addEventListener(Qt.fullscreenEvent,this),this.resizeObserver.observe(this.viewer.container)}destroy(){window.removeEventListener("keydown",this),window.removeEventListener("keyup",this),this.viewer.container.removeEventListener("mousedown",this),window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchstart",this),window.removeEventListener("touchmove",this),window.removeEventListener("touchend",this),this.viewer.container.removeEventListener("wheel",this),document.removeEventListener(Qt.fullscreenEvent,this),this.resizeObserver.disconnect(),clearTimeout(this.data.dblclickTimeout),clearTimeout(this.data.longtouchTimeout),clearTimeout(this.data.twofingersTimeout),clearTimeout(this.data.ctrlZoomTimeout),super.destroy()}handleEvent(e){switch(e.type){case"keydown":this.__onKeyDown(e);break;case"keyup":this.__onKeyUp();break;case"mousemove":this.__onMouseMove(e);break;case"mouseup":this.__onMouseUp(e);break;case"touchmove":this.__onTouchMove(e);break;case"touchend":this.__onTouchEnd(e);break;case Qt.fullscreenEvent:this.__onFullscreenChange()}if(!V(e.target,"."+E))switch(e.type){case"mousedown":this.__onMouseDown(e);break;case"touchstart":this.__onTouchStart(e);break;case"wheel":this.__onMouseWheel(e)}}__onKeyDown(e){if(this.config.mousewheelCtrlKey&&(this.data.ctrlKeyDown=e.key===M.Control,this.data.ctrlKeyDown&&(clearTimeout(this.data.ctrlZoomTimeout),this.viewer.overlay.hide(x.CTRL_ZOOM))),!this.viewer.dispatchEvent(new lt(e.key)))return;if(!this.state.keyboardEnabled)return;const t=this.config.keyboardActions?.[e.key];if("function"==typeof t)t(this.viewer),e.preventDefault();else if(t&&!this.keyHandler.pending){switch("ZOOM_IN"!==t&&"ZOOM_OUT"!==t&&this.viewer.stopAll(),t){case"ROTATE_UP":this.viewer.dynamics.position.roll({pitch:!1});break;case"ROTATE_DOWN":this.viewer.dynamics.position.roll({pitch:!0});break;case"ROTATE_RIGHT":this.viewer.dynamics.position.roll({yaw:!1});break;case"ROTATE_LEFT":this.viewer.dynamics.position.roll({yaw:!0});break;case"ZOOM_IN":this.viewer.dynamics.zoom.roll(!1);break;case"ZOOM_OUT":this.viewer.dynamics.zoom.roll(!0)}this.keyHandler.down(),e.preventDefault()}}__onKeyUp(){this.data.ctrlKeyDown=!1,this.state.keyboardEnabled&&this.keyHandler.up((()=>{this.viewer.dynamics.position.stop(),this.viewer.dynamics.zoom.stop(),this.viewer.resetIdleTimer()}))}__onMouseDown(e){this.step.add(Bi.CLICK),this.data.startMouseX=e.clientX,this.data.startMouseY=e.clientY}__onMouseUp(e){this.step.is(Bi.CLICK,Bi.MOVING)&&this.__stopMove(e.clientX,e.clientY,e.target,2===e.button)}__onMouseMove(e){this.config.mousemove&&this.step.is(Bi.CLICK,Bi.MOVING)&&(e.preventDefault(),this.__doMove(e.clientX,e.clientY)),this.__handleObjectsEvents(e)}__onTouchStart(e){1===e.touches.length?(this.step.add(Bi.CLICK),this.data.startMouseX=e.touches[0].clientX,this.data.startMouseY=e.touches[0].clientY,this.data.longtouchTimeout||(this.data.longtouchTimeout=setTimeout((()=>{const t=e.touches[0];this.__stopMove(t.clientX,t.clientY,t.target,!0),this.data.longtouchTimeout=null}),m))):2===e.touches.length&&(this.step.set(Bi.IDLE),this.__cancelLongTouch(),this.config.mousemove&&(this.__cancelTwoFingersOverlay(),this.__startMoveZoom(e),e.preventDefault()))}__onTouchEnd(e){if(this.__cancelLongTouch(),this.step.is(Bi.CLICK,Bi.MOVING))if(e.preventDefault(),this.__cancelTwoFingersOverlay(),1===e.touches.length)this.__stopMove(this.data.mouseX,this.data.mouseY);else if(0===e.touches.length){const t=e.changedTouches[0];this.__stopMove(t.clientX,t.clientY,t.target)}}__onTouchMove(e){if(this.__cancelLongTouch(),this.config.mousemove)if(1===e.touches.length){if(this.config.touchmoveTwoFingers)this.step.is(Bi.CLICK)&&!this.data.twofingersTimeout&&(this.data.twofingersTimeout=setTimeout((()=>{this.viewer.overlay.show({id:x.TWO_FINGERS,image:'\x3c!--Created by AomAm from the Noun Project--\x3e\n',title:this.config.lang.twoFingers})}),w));else if(this.step.is(Bi.CLICK,Bi.MOVING)){e.preventDefault();const t=e.touches[0];this.__doMove(t.clientX,t.clientY)}}else this.__doMoveZoom(e),this.__cancelTwoFingersOverlay()}__cancelLongTouch(){this.data.longtouchTimeout&&(clearTimeout(this.data.longtouchTimeout),this.data.longtouchTimeout=null)}__cancelTwoFingersOverlay(){this.config.touchmoveTwoFingers&&(this.data.twofingersTimeout&&(clearTimeout(this.data.twofingersTimeout),this.data.twofingersTimeout=null),this.viewer.overlay.hide(x.TWO_FINGERS))}__onMouseWheel(e){if(!this.config.mousewheel||!e.deltaY)return;if(this.config.mousewheelCtrlKey&&!this.data.ctrlKeyDown)return this.viewer.overlay.show({id:x.CTRL_ZOOM,image:'\x3c!-- Created by Icon Island from the Noun Project --\x3e\n',title:this.config.lang.ctrlZoom}),clearTimeout(this.data.ctrlZoomTimeout),void(this.data.ctrlZoomTimeout=setTimeout((()=>this.viewer.overlay.hide(x.CTRL_ZOOM)),g));e.preventDefault(),e.stopPropagation();const t=e.deltaY/Math.abs(e.deltaY)*5*this.config.zoomSpeed;0!==t&&this.viewer.dynamics.zoom.step(-t,5)}__onFullscreenChange(){const e=this.viewer.isFullscreenEnabled();"fullscreen"===this.config.keyboard&&(e?this.viewer.startKeyboardControl():this.viewer.stopKeyboardControl()),this.viewer.dispatchEvent(new et(e))}__resetMove(){this.step.set(Bi.IDLE),this.data.mouseX=0,this.data.mouseY=0,this.data.startMouseX=0,this.data.startMouseY=0,this.data.mouseHistory.length=0}__startMoveZoom(e){this.viewer.stopAll(),this.__resetMove();const t=Y(e);this.step.set(Bi.MOVING),({distance:this.data.pinchDist,center:{x:this.data.mouseX,y:this.data.mouseY}}=t),this.__logMouseMove(this.data.mouseX,this.data.mouseY)}__stopMove(e,t,i,s=!1){this.step.is(Bi.MOVING)?this.config.moveInertia?(this.__logMouseMove(e,t),this.__stopMoveInertia(e,t)):(this.__resetMove(),this.viewer.resetIdleTimer()):(this.step.is(Bi.CLICK)&&!this.__moveThresholdReached(e,t)&&this.__doClick(e,t,i,s),this.step.remove(Bi.CLICK),this.step.is(Bi.INERTIA)||(this.__resetMove(),this.viewer.resetIdleTimer()))}__stopMoveInertia(e,t){const i=new $i.SplineCurve(this.data.mouseHistory.map((([,e,t])=>new $i.Vector2(e,t)))).getTangent(1),s=this.data.mouseHistory.reduce((({total:e,prev:t},i)=>({total:t?e+k({x:t[1],y:t[2]},{x:i[1],y:i[2]})/(i[0]-t[0]):0,prev:i})),{total:0,prev:null}).total/this.data.mouseHistory.length;if(!s)return this.__resetMove(),void this.viewer.resetIdleTimer();this.step.set(Bi.INERTIA);let o=e,n=t;this.state.animation=new ke({properties:{speed:{start:s,end:0}},duration:1e3,easing:"outQuad",onTick:e=>{o+=e.speed*i.x*3*Qt.pixelRatio,n+=e.speed*i.y*3*Qt.pixelRatio,this.__applyMove(o,n)}}),this.state.animation.then((e=>{this.state.animation=null,e&&(this.__resetMove(),this.viewer.resetIdleTimer())}))}__doClick(e,t,i,s=!1){const o=this.viewer.container.getBoundingClientRect(),n=e-o.left,r=t-o.top,a=this.viewer.renderer.getIntersections({x:n,y:r}),h=a.find((e=>e.object.userData[b]));if(h){const o=this.viewer.dataHelper.vector3ToSphericalCoords(h.point),c={rightclick:s,target:i,clientX:e,clientY:t,viewerX:n,viewerY:r,yaw:o.yaw,pitch:o.pitch,objects:a.map((e=>e.object)).filter((e=>!e.userData[b]))};try{const e=this.viewer.dataHelper.sphericalCoordsToTextureCoords(c);Object.assign(c,e)}catch(e){}this.data.dblclickTimeout?(Math.abs(this.data.dblclickData.clientX-c.clientX){this.data.dblclickTimeout=null,this.data.dblclickData=null}),v))}}__handleObjectsEvents(e){if(!J(this.state.objectsObservers)&&N(e.target,this.viewer.container)){const t=F(this.viewer.container),i={x:e.clientX-t.x,y:e.clientY-t.y},s=this.viewer.renderer.getIntersections(i),o=(t,s,o)=>{this.viewer.dispatchEvent(new o(e,t,i,s))};for(const[e,t]of Object.entries(this.state.objectsObservers)){const i=s.find((t=>t.object.userData[e]));i?(t&&i.object!==t&&(o(t,e,jt),this.state.objectsObservers[e]=null),t?o(i.object,e,Xt):(this.state.objectsObservers[e]=i.object,o(i.object,e,Ft))):t&&(o(t,e,jt),this.state.objectsObservers[e]=null)}}}__doMove(e,t){this.step.is(Bi.CLICK)&&this.__moveThresholdReached(e,t)?(this.viewer.stopAll(),this.__resetMove(),this.step.set(Bi.MOVING),this.data.mouseX=e,this.data.mouseY=t,this.__logMouseMove(e,t)):this.step.is(Bi.MOVING)&&(this.__applyMove(e,t),this.__logMouseMove(e,t))}__moveThresholdReached(e,t){return Math.abs(e-this.data.startMouseX)>=this.moveThreshold||Math.abs(t-this.data.startMouseY)>=this.moveThreshold}__applyMove(e,t){const i=this.config.moveSpeed*((e-this.data.mouseX)/this.state.size.width)*$i.MathUtils.degToRad(this.state.littlePlanet?90:this.state.hFov),s=this.config.moveSpeed*((t-this.data.mouseY)/this.state.size.height)*$i.MathUtils.degToRad(this.state.littlePlanet?90:this.state.vFov),o=this.viewer.getPosition();this.viewer.rotate({yaw:o.yaw-i,pitch:o.pitch+s}),this.data.mouseX=e,this.data.mouseY=t}__doMoveZoom(e){if(this.step.is(Bi.MOVING)){e.preventDefault();const t=Y(e),i=(t.distance-this.data.pinchDist)/Qt.pixelRatio*this.config.zoomSpeed;this.viewer.zoom(this.viewer.getZoomLevel()+i),this.__doMove(t.center.x,t.center.y),this.data.pinchDist=t.distance}}__logMouseMove(e,t){const i=Date.now(),s=this.data.mouseHistory.length?this.data.mouseHistory[this.data.mouseHistory.length-1]:[0,-1,-1];s[1]===e&&s[2]===t?s[0]=i:i===s[0]?(s[1]=e,s[2]=t):this.data.mouseHistory.push([i,e,t]);let o=null;for(let e=0;ef/10?(this.data.mouseHistory.splice(0,e),e=0,o=this.data.mouseHistory[e][0]):(o=this.data.mouseHistory[e][0],e++)}},qi=a(),Ki=new qi.Vector2,Qi=new qi.Matrix4,Ji=new qi.Box3,es=class extends Wi{constructor(e){super(e),this.frustumNeedsUpdate=!0,this.renderer=new qi.WebGLRenderer(this.config.rendererParameters),this.renderer.setPixelRatio(Qt.pixelRatio),this.renderer.outputColorSpace=qi.LinearSRGBColorSpace,this.renderer.domElement.className="psv-canvas",this.scene=new qi.Scene,this.camera=new qi.PerspectiveCamera(50,16/9,.1,2*y),this.camera.matrixWorldAutoUpdate=!1,this.mesh=this.viewer.adapter.createMesh(),this.mesh.userData={[b]:!0},this.meshContainer=new qi.Group,this.meshContainer.add(this.mesh),this.scene.add(this.meshContainer),this.raycaster=new qi.Raycaster,this.frustum=new qi.Frustum,this.container=document.createElement("div"),this.container.className="psv-canvas-container",this.container.appendChild(this.renderer.domElement),this.viewer.container.appendChild(this.container),this.viewer.addEventListener(Rt.type,this),this.viewer.addEventListener(Ut.type,this),this.viewer.addEventListener(bt.type,this),this.viewer.addEventListener(qe.type,this),this.hide()}get panoramaPose(){return this.mesh.rotation}get sphereCorrection(){return this.meshContainer.rotation}init(){this.show(),this.renderer.setAnimationLoop((e=>this.__renderLoop(e)))}destroy(){this.renderer.setAnimationLoop(null),this.cleanScene(this.scene),this.viewer.container.removeChild(this.container),this.viewer.removeEventListener(Rt.type,this),this.viewer.removeEventListener(Ut.type,this),this.viewer.removeEventListener(bt.type,this),this.viewer.removeEventListener(qe.type,this),super.destroy()}handleEvent(e){switch(e.type){case Rt.type:this.__onSizeUpdated();break;case Ut.type:this.__onZoomUpdated();break;case bt.type:this.__onPositionUpdated();break;case qe.type:e.containsOptions("fisheye")&&this.__onPositionUpdated(),e.containsOptions("canvasBackground")&&(this.container.style.background=this.config.canvasBackground)}}hide(){this.container.style.opacity="0"}show(){this.container.style.opacity="1"}setCustomRenderer(e){this.customRenderer=e?e(this.renderer):null,this.viewer.needsUpdate()}__onSizeUpdated(){this.renderer.setSize(this.state.size.width,this.state.size.height),this.camera.aspect=this.state.aspect,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onZoomUpdated(){this.camera.fov=this.state.vFov,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onPositionUpdated(){this.camera.position.set(0,0,0),this.camera.lookAt(this.state.direction),this.config.fisheye&&this.camera.position.copy(this.state.direction).multiplyScalar(this.config.fisheye/2).negate(),this.camera.updateMatrixWorld(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__renderLoop(e){const t=this.timestamp?e-this.timestamp:0;this.timestamp=e,this.viewer.dispatchEvent(new Ye(e,t)),this.viewer.dynamics.update(t),(this.state.needsUpdate||this.state.continuousUpdateCount>0)&&((this.customRenderer||this.renderer).render(this.scene,this.camera),this.viewer.dispatchEvent(new Mt),this.state.needsUpdate=!1)}setTexture(e){this.viewer.adapter.constructor.supportsOverlay&&this.setOverlay(null,0),this.state.textureData&&this.viewer.adapter.disposeTexture(this.state.textureData),this.state.textureData=e,this.viewer.adapter.setTexture(this.mesh,e),this.viewer.needsUpdate()}setOverlay(e,t){this.state.overlayData&&this.viewer.adapter.disposeTexture(this.state.overlayData),this.state.overlayData=e,this.viewer.adapter.setOverlay(this.mesh,e,t),this.viewer.needsUpdate()}setPanoramaPose(e,t=this.mesh){const i=this.viewer.dataHelper.cleanPanoramaPose(e);t.rotation.set(-i.tilt,-i.pan,-i.roll,"ZXY")}setSphereCorrection(e,t=this.meshContainer){const i=this.viewer.dataHelper.cleanSphereCorrection(e);t.rotation.set(i.tilt,i.pan,i.roll,"ZXY")}transition(e,t){const i=!ee(t.position),s=!ee(t.zoom),o=new We(i?this.viewer.dataHelper.cleanPosition(t.position):void 0,t.zoom);this.viewer.dispatchEvent(o);const n=new qi.Group,r=this.viewer.adapter.createMesh(.5);if(this.viewer.adapter.setTexture(r,e,!0),this.viewer.adapter.setTextureOpacity(r,0),this.setPanoramaPose(e.panoData,r),this.setSphereCorrection(t.sphereCorrection,n),i&&"fade-only"===t.transition){const e=this.viewer.getPosition(),t=new qi.Vector3(0,1,0);n.rotateOnWorldAxis(t,o.position.yaw-e.yaw);const i=new qi.Vector3(0,1,0).cross(this.camera.getWorldDirection(new qi.Vector3)).normalize();n.rotateOnWorldAxis(i,o.position.pitch-e.pitch)}n.add(r),this.scene.add(n),this.renderer.setRenderTarget(new qi.WebGLRenderTarget),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null);const{duration:a,properties:h}=this.viewer.dataHelper.getAnimationProperties(t.transition,!0===t.transition?o.position:null,o.zoomLevel),c=new ke({properties:{...h,opacity:{start:0,end:1}},duration:a,easing:"inOutCubic",onTick:e=>{this.viewer.adapter.setTextureOpacity(r,e.opacity),i&&!0===t.transition&&this.viewer.dynamics.position.setValue({yaw:e.yaw,pitch:e.pitch}),s&&this.viewer.dynamics.zoom.setValue(e.zoom),this.viewer.needsUpdate()}});return c.then((s=>{s?(this.setTexture(e),this.viewer.adapter.setTextureOpacity(this.mesh,1),this.setPanoramaPose(e.panoData),this.setSphereCorrection(t.sphereCorrection),i&&"fade-only"===t.transition&&this.viewer.rotate(t.position)):this.viewer.adapter.disposeTexture(e),this.scene.remove(n),r.geometry.dispose(),r.geometry=null})),c}getIntersections(e){Ki.x=2*e.x/this.state.size.width-1,Ki.y=-2*e.y/this.state.size.height+1,this.raycaster.setFromCamera(Ki,this.camera);const t=this.raycaster.intersectObjects(this.scene.children,!0).filter((e=>e.object.isMesh&&!!e.object.userData));return this.customRenderer?.getIntersections&&t.push(...this.customRenderer.getIntersections(this.raycaster,Ki)),t}isObjectVisible(e){if(!e)return!1;if(this.frustumNeedsUpdate&&(Qi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromProjectionMatrix(Qi),this.frustumNeedsUpdate=!1),e.isVector3)return this.frustum.containsPoint(e);if(e.isMesh&&e.geometry){const t=e;return t.geometry.boundingBox||t.geometry.computeBoundingBox(),Ji.copy(t.geometry.boundingBox).applyMatrix4(t.matrixWorld),this.frustum.intersectsBox(Ji)}return!!e.isObject3D&&this.frustum.intersectsObject(e)}addObject(e){this.scene.add(e)}removeObject(e){this.scene.remove(e)}cleanScene(e){const t=e=>{e.map?.dispose(),e.uniforms&&Object.values(e.uniforms).forEach((e=>{e.value?.dispose?.()})),e.dispose()};e.traverse((i=>{i.geometry?.dispose(),i.material&&(Array.isArray(i.material)?i.material.forEach((e=>{t(e)})):t(i.material)),i instanceof qi.Scene||i.dispose?.(),i!==e&&this.cleanScene(i)}))}},ts=a(),is=class extends Wi{constructor(e){super(e),this.fileLoader=new ts.FileLoader,this.fileLoader.setResponseType("blob"),this.imageLoader=new ts.ImageLoader,this.config.withCredentials&&(this.fileLoader.setWithCredentials(!0),this.imageLoader.setCrossOrigin("use-credentials"))}destroy(){this.abortLoading(),super.destroy()}abortLoading(){}loadFile(e,t,i){const s=Vi.get(e,i);if(s){if(s instanceof Blob)return t?.(100),Promise.resolve(s);Vi.remove(e,i)}return this.config.requestHeaders&&this.fileLoader.setRequestHeader(this.config.requestHeaders(e)),new Promise(((s,o)=>{let n=0;t?.(n),this.fileLoader.load(e,(o=>{n=100,t?.(n),Vi.add(e,i,o),s(o)}),(e=>{if(e.lengthComputable){const i=e.loaded/e.total*100;i>n&&(n=i,t?.(n))}}),(e=>{o(e)}))}))}loadImage(e,t,i){const s=Vi.get(e,i);return s?(t?.(100),s instanceof Blob?this.blobToImage(s):Promise.resolve(s)):t||this.config.requestHeaders?this.loadFile(e,t,i).then((e=>this.blobToImage(e))):this.imageLoader.loadAsync(e).then((t=>(Vi.add(e,i,t),t)))}blobToImage(e){return new Promise(((t,i)=>{const s=document.createElement("img");s.onload=()=>{URL.revokeObjectURL(s.src),t(s)},s.onerror=i,s.src=URL.createObjectURL(e)}))}preloadPanorama(e){return this.viewer.adapter.supportsPreload(e)?this.viewer.adapter.loadTexture(e):Promise.reject(new ne("Current adapter does not support preload"))}},ss=a(),os=class extends Wi{constructor(e){super(e),this.zoom=new Se((e=>{this.viewer.state.vFov=this.viewer.dataHelper.zoomLevelToFov(e),this.viewer.state.hFov=this.viewer.dataHelper.vFovToHFov(this.viewer.state.vFov),this.viewer.dispatchEvent(new Ut(e))}),{defaultValue:this.viewer.config.defaultZoomLvl,min:0,max:100,wrap:!1}),this.position=new He((e=>{this.viewer.dataHelper.sphericalCoordsToVector3(e,this.viewer.state.direction),this.viewer.dispatchEvent(new bt(e))}),{yaw:new Se(null,{defaultValue:this.config.defaultYaw,min:0,max:2*Math.PI,wrap:!0}),pitch:new Se(null,{defaultValue:this.config.defaultPitch,min:this.viewer.state.littlePlanet?0:-Math.PI/2,max:this.viewer.state.littlePlanet?2*Math.PI:Math.PI/2,wrap:this.viewer.state.littlePlanet})}),this.updateSpeeds()}updateSpeeds(){this.zoom.setSpeed(50*this.config.zoomSpeed),this.position.setSpeed(ss.MathUtils.degToRad(50*this.config.moveSpeed))}update(e){this.zoom.update(e),this.position.update(e)}},ns=a(),rs=class{constructor(){this.ready=!1,this.needsUpdate=!1,this.continuousUpdateCount=0,this.keyboardEnabled=!1,this.direction=new ns.Vector3(0,0,y),this.vFov=60,this.hFov=60,this.aspect=1,this.animation=null,this.transitionAnimation=null,this.loadingPromise=null,this.littlePlanet=!1,this.idleTime=-1,this.objectsObservers={},this.size={width:0,height:0}}get panoData(){return le("ViewerState.panoData is deprecated, use ViewerState.textureData.panoData instead"),this.textureData?.panoData}},as=class extends Ne{constructor(e){super(),this.plugins={},this.children=[],this.onResize=G((()=>this.navbar.autoSize()),500),Vi.init(),Qt.load(),this.state=new rs,this.config=Ci(e),this.parent=z(e.container),this.parent[b]=this,this.container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),Le(this.container,"core"),this.adapter=new this.config.adapter[0](this,this.config.adapter[1]),this.renderer=new es(this),this.textureLoader=new is(this),this.eventsHandler=new Gi(this),this.dataHelper=new Xi(this),this.dynamics=new os(this),this.adapter.init?.(),this.loader=new Hi(this),this.navbar=new Si(this),this.panel=new Di(this),this.notification=new Ri(this),this.overlay=new zi(this),this.resize(this.config.size),this.setCursor(null),re(Qt.isTouchEnabled,(e=>{A(this.container,"psv--is-touch",e)})),this.config.plugins.forEach((([e,t])=>{this.plugins[e.id]=new e(this,t)}));for(const e of Object.values(this.plugins))e.init?.();this.config.navbar&&this.navbar.setButtons(this.config.navbar),this.state.loadingPromise||(this.config.panorama?this.setPanorama(this.config.panorama):this.loader.show())}destroy(){this.stopAll(),this.stopKeyboardControl(),this.exitFullscreen();for(const[e,t]of Object.entries(this.plugins))t.destroy(),delete this.plugins[e];this.children.slice().forEach((e=>e.destroy())),this.children.length=0,this.eventsHandler.destroy(),this.renderer.destroy(),this.textureLoader.destroy(),this.dataHelper.destroy(),this.adapter.destroy(),this.dynamics.destroy(),this.parent.removeChild(this.container),delete this.parent[b]}init(){this.eventsHandler.init(),this.renderer.init(),this.config.navbar&&this.navbar.show(),"always"===this.config.keyboard&&this.startKeyboardControl(),this.resetIdleTimer(),this.state.ready=!0,this.dispatchEvent(new _t)}resetIdleTimer(){this.state.idleTime=performance.now()}disableIdleTimer(){this.state.idleTime=-1}getPlugin(e){if("string"==typeof e)return this.plugins[e];{const t=xi(e);return t?this.plugins[t.id]:null}}getPosition(){return this.dataHelper.cleanPosition(this.dynamics.position.current)}getZoomLevel(){return this.dynamics.zoom.current}getSize(){return{...this.state.size}}isFullscreenEnabled(){return X(this.parent)}needsUpdate(){this.state.needsUpdate=!0}needsContinuousUpdate(e){e?this.state.continuousUpdateCount++:this.state.continuousUpdateCount>0&&this.state.continuousUpdateCount--}autoSize(){this.container.clientWidth===this.state.size.width&&this.container.clientHeight===this.state.size.height||(this.state.size.width=Math.round(this.container.clientWidth),this.state.size.height=Math.round(this.container.clientHeight),this.state.aspect=this.state.size.width/this.state.size.height,this.state.hFov=this.dataHelper.vFovToHFov(this.state.vFov),this.dispatchEvent(new Rt(this.getSize())),this.onResize())}setPanorama(e,t={}){this.textureLoader.abortLoading(),this.state.transitionAnimation?.cancel(),this.state.ready||["sphereCorrection","panoData","overlay","overlayOpacity"].forEach((e=>{e in t||(t[e]=this.config[e])})),de(t)&&(le("PanoramaOptions.yaw and PanoramaOptions.pitch are deprecated, use PanoramaOptions.position instead"),t.position=this.dataHelper.cleanPosition(t)),"number"==typeof t.transition&&(le("Use PanoramaOptions.speed to define the speed/duration of the transition"),t.speed=t.transition,t.transition=!0),void 0===t.transition&&(t.transition=!0),void 0===t.speed&&(t.speed=d),void 0===t.showLoader&&(t.showLoader=!0),void 0===t.caption&&(t.caption=this.config.caption),void 0===t.description&&(t.description=this.config.description),t.panoData||"function"!=typeof this.config.panoData||(t.panoData=this.config.panoData);const i=!ee(t.position),s=!ee(t.zoom);(i||s)&&this.stopAll(),this.hideError(),this.resetIdleTimer(),this.config.panorama=e,this.config.caption=t.caption,this.config.description=t.description;const o=i=>{if(this.loader.hide(),this.state.loadingPromise=null,ce(i))return!1;if(i)throw this.navbar.setCaption(""),this.showError(this.config.lang.loadError),console.error(i),this.dispatchEvent(new ft(e,i)),i;return this.setOverlay(t.overlay,t.overlayOpacity),this.navbar.setCaption(this.config.caption),!0};this.navbar.setCaption(`${this.config.loadingTxt||""}`),!t.showLoader&&this.state.ready||this.loader.show(),this.dispatchEvent(new vt(e));const n=this.adapter.loadTexture(this.config.panorama,t.panoData).then((e=>{if(e.panorama!==this.config.panorama)throw this.adapter.disposeTexture(e),he();return e}));return t.transition&&this.state.ready&&this.adapter.supportsTransition(this.config.panorama)?this.state.loadingPromise=n.then((e=>(this.loader.hide(),this.dispatchEvent(new wt(e)),this.state.transitionAnimation=this.renderer.transition(e,t),this.state.transitionAnimation))).then((e=>{if(this.state.transitionAnimation=null,!e)throw he()})).then((()=>o()),(e=>o(e))):this.state.loadingPromise=n.then((e=>{this.renderer.show(),this.renderer.setTexture(e),this.renderer.setPanoramaPose(e.panoData),this.renderer.setSphereCorrection(t.sphereCorrection),this.state.ready||this.init(),this.dispatchEvent(new wt(e)),s&&this.zoom(t.zoom),i&&this.rotate(t.position)})).then((()=>o()),(e=>o(e))),this.state.loadingPromise}setOverlay(e,t=this.config.overlayOpacity){const i=this.adapter.constructor.supportsOverlay;return e?i?this.adapter.loadTexture(e,(e=>{if(this.state.textureData.panoData.isEquirectangular){const t=this.state.textureData.panoData,i=e.width/t.croppedWidth;return{isEquirectangular:!0,fullWidth:i*t.fullWidth,fullHeight:i*t.fullHeight,croppedWidth:i*t.croppedWidth,croppedHeight:i*t.croppedHeight,croppedX:i*t.croppedX,croppedY:i*t.croppedY}}}),!1,!1).then((e=>{this.renderer.setOverlay(e,t)})):Promise.reject(new ne("Current adapter does not supports overlay")):(i&&this.renderer.setOverlay(null,0),Promise.resolve())}setOptions(e){const t={...this.config,...e};for(let[i,s]of Object.entries(e))if(i in Mi)if(i in Ti)le(Ti[i]);else switch(i in Oi&&(s=Oi[i](s,{rawConfig:t,defValue:Mi[i]})),this.config[i]=s,i){case"mousemove":this.state.cursorOverride||this.setCursor(null);break;case"caption":this.navbar.setCaption(this.config.caption);break;case"size":this.resize(this.config.size);break;case"sphereCorrection":this.renderer.setSphereCorrection(this.config.sphereCorrection);break;case"navbar":case"lang":this.navbar.setButtons(this.config.navbar);break;case"moveSpeed":case"zoomSpeed":this.dynamics.updateSpeeds();break;case"minFov":case"maxFov":this.dynamics.zoom.setValue(this.dataHelper.fovToZoomLevel(this.state.vFov)),this.dispatchEvent(new Ut(this.getZoomLevel()));break;case"keyboard":"always"===this.config.keyboard?this.startKeyboardControl():this.stopKeyboardControl()}else le(`Unknown option ${i}`);this.needsUpdate(),this.dispatchEvent(new qe(Object.keys(e)))}setOption(e,t){this.setOptions({[e]:t})}showError(e){this.overlay.show({id:x.ERROR,image:'\x3c!--Created by Shastry from the Noun Project--\x3e\n',title:e,dissmisable:!1})}hideError(){this.overlay.hide(x.ERROR)}rotate(e){const t=new $e(this.dataHelper.cleanPosition(e));this.dispatchEvent(t),t.defaultPrevented||this.dynamics.position.setValue(t.position)}zoom(e){this.dynamics.zoom.setValue(e)}zoomIn(e=1){this.dynamics.zoom.step(e)}zoomOut(e=1){this.dynamics.zoom.step(-e)}animate(e){const t=de(e),i=!ee(e.zoom),s=new We(t?this.dataHelper.cleanPosition(e):void 0,e.zoom);if(this.dispatchEvent(s),s.defaultPrevented)return;this.stopAll();const{duration:o,properties:n}=this.dataHelper.getAnimationProperties(e.speed,s.position,s.zoomLevel);return o?(this.state.animation=new ke({properties:n,duration:o,easing:"inOutSine",onTick:e=>{t&&this.dynamics.position.setValue({yaw:e.yaw,pitch:e.pitch}),i&&this.dynamics.zoom.setValue(e.zoom)}}),this.state.animation.then((()=>{this.state.animation=null,this.resetIdleTimer()})),this.state.animation):(t&&this.rotate(s.position),i&&this.zoom(s.zoomLevel),new ke(null))}stopAnimation(){return this.state.animation?(this.state.animation.cancel(),this.state.animation):Promise.resolve()}resize(e){const t=e;["width","height"].forEach((i=>{e&&t[i]&&(/^[0-9.]+$/.test(t[i])&&(t[i]+="px"),this.parent.style[i]=t[i])})),this.autoSize()}enterFullscreen(){this.isFullscreenEnabled()||$(this.parent)}exitFullscreen(){this.isFullscreenEnabled()&&Z()}toggleFullscreen(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()}startKeyboardControl(){this.state.keyboardEnabled=!0}stopKeyboardControl(){this.state.keyboardEnabled=!1}createTooltip(e){return new Ui(this,e)}setCursor(e){this.state.cursorOverride=e,this.container.style.cursor=e||(this.config.mousemove?"move":"default")}observeObjects(e){this.state.objectsObservers[e]||(this.state.objectsObservers[e]=null)}unobserveObjects(e){delete this.state.objectsObservers[e]}stopAll(){return this.dispatchEvent(new At),this.disableIdleTimer(),this.stopAnimation()}};c.Cache.enabled=!1,c.ColorManagement.enabled=!1;var hs="5.5.0";((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let h of o(t))n.call(e,h)||h===r||i(e,h,{get:()=>t[h],enumerable:!(a=s(t,h))||a.enumerable})})(i(e,"__esModule",{value:!0}),h)})); diff --git a/embed/js/photo-sphere-viewer.min.js b/embed/js/photo-sphere-viewer.min.js deleted file mode 100644 index 0be6e3a..0000000 --- a/embed/js/photo-sphere-viewer.min.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Minified by jsDelivr using Terser v5.14.1. - * Original file: /npm/photo-sphere-viewer@4.7.1/dist/photo-sphere-viewer.js - * - * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files - */ -/*! -* Photo Sphere Viewer 4.7.1 -* @copyright 2014-2015 Jérémy Heleine -* @copyright 2015-2022 Damien "Mistic" Sorel -* @licence MIT (https://opensource.org/licenses/MIT) -*/ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("three"),require("uevent")):"function"==typeof define&&define.amd?define(["exports","three","uevent"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).PhotoSphereViewer={},t.THREE,t.uEvent)}(this,(function(t,e,o){"use strict";function i(t){this.message=t,"captureStackTrace"in Error?Error.captureStackTrace(this,i):this.stack=(new Error).stack}i.prototype=Object.create(Error.prototype),i.prototype.name="PSVError",i.prototype.constructor=i;var n=function(){function t(t){this.psv=t}var o=t.prototype;return o.destroy=function(){delete this.psv},o.supportsTransition=function(t){return!1},o.supportsPreload=function(t){return!1},o.loadTexture=function(t,e,o){throw new i("loadTexture not implemented")},o.createMesh=function(t){throw new i("createMesh not implemented")},o.setTexture=function(t,e,o){throw new i("setTexture not implemented")},o.setTextureOpacity=function(t,e){throw new i("setTextureOpacity not implemented")},o.disposeTexture=function(t){throw new i("disposeTexture not implemented")},o.setOverlay=function(t,e,o){throw new i("setOverlay not implemented")},t.createOverlayMaterial=function(){var o;return new e.ShaderMaterial({uniforms:(o={},o[t.OVERLAY_UNIFORMS.panorama]={value:new e.Texture},o[t.OVERLAY_UNIFORMS.overlay]={value:new e.Texture},o[t.OVERLAY_UNIFORMS.globalOpacity]={value:1},o[t.OVERLAY_UNIFORMS.overlayOpacity]={value:1},o),vertexShader:"\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"\nuniform sampler2D "+t.OVERLAY_UNIFORMS.panorama+";\nuniform sampler2D "+t.OVERLAY_UNIFORMS.overlay+";\nuniform float "+t.OVERLAY_UNIFORMS.globalOpacity+";\nuniform float "+t.OVERLAY_UNIFORMS.overlayOpacity+";\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 tColor1 = texture2D( "+t.OVERLAY_UNIFORMS.panorama+", vUv );\n vec4 tColor2 = texture2D( "+t.OVERLAY_UNIFORMS.overlay+", vUv );\n gl_FragColor = vec4( \n mix( tColor1.rgb, tColor2.rgb, tColor2.a * "+t.OVERLAY_UNIFORMS.overlayOpacity+" ), \n "+t.OVERLAY_UNIFORMS.globalOpacity+"\n );\n}"})},t}();function r(t,e){for(var o=0;o0;T in localStorage&&(t="true"===localStorage[T]);var e=new Promise((function(e){var o,i=function(){o(),localStorage[T]=!1,e(!1)},n=function(){o(),localStorage[T]=!0,e(!0)},r=function(){o(),localStorage[T]=t,e(t)};window.addEventListener("mousedown",i,!1),window.addEventListener("touchstart",n,!1);var s=setTimeout(r,1e4);o=function(){window.removeEventListener("mousedown",i),window.removeEventListener("touchstart",n),clearTimeout(s)}}));return{initial:t,promise:e}}(),b.maxTextureWidth=function(t){return null!==t?t.getParameter(t.MAX_TEXTURE_SIZE):0}(t),b.mouseWheelEvent="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",b.fullscreenEvent=(e=Object.keys(M).filter((function(t){return t in document}))).length?M[e[0]]:null}var e};var O=null;b.getMaxCanvasWidth=function(){return null===O&&(O=function(t){var e=document.createElement("canvas"),o=e.getContext("2d");e.width=t,e.height=t/2;for(;e.width>1024;){o.fillStyle="white",o.fillRect(0,0,1,1);try{if(o.getImageData(0,0,1,1).data[0]>0)return e.width}catch(t){}e.width/=2,e.height/=2}throw new i("Unable to detect system capabilities")}(b.maxTextureWidth)),O};var M={exitFullscreen:"fullscreenchange",webkitExitFullscreen:"webkitfullscreenchange",mozCancelFullScreen:"mozfullscreenchange",msExitFullscreen:"MSFullscreenChange"};function L(t,e,o){void 0===o?t.classList.toggle(e):o?t.classList.add(e):o||t.classList.remove(e)}function x(t,e){var o;(o=t.classList).add.apply(o,e.split(" "))}function C(t,e){if(!t.matches)return null;var o=t;do{if(o.matches(e))return o;o=o instanceof SVGElement?o.parentNode:o.parentElement}while(o);return null}function P(t){for(var e=0,o=0,i=t;i;)e+=i.offsetLeft-i.scrollLeft+i.clientLeft,o+=i.offsetTop-i.scrollTop+i.clientTop,i=i.offsetParent;return{left:e,top:o}}function A(t){return(document.fullscreenElement||document.webkitFullscreenElement)===t}function I(t){(t.requestFullscreen||t.webkitRequestFullscreen).call(t)}function S(){(document.exitFullscreen||document.webkitExitFullscreen).call(document)}function R(t,e){return window.getComputedStyle(t,null)[e]} -/** - * @summary Normalize mousewheel values accross browsers - * @memberOf PSV.utils - * @description From Facebook's Fixed Data Table - * {@link https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js} - * @copyright Facebook - * @param {WheelEvent} event - * @returns {{spinX: number, spinY: number, pixelX: number, pixelY: number}} - */function k(t){var e=0,o=0,i=0,n=0;return"detail"in t&&(o=t.detail),"wheelDelta"in t&&(o=-t.wheelDelta/120),"wheelDeltaY"in t&&(o=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=o,o=0),i=10*e,n=10*o,"deltaY"in t&&(n=t.deltaY),"deltaX"in t&&(i=t.deltaX),(i||n)&&t.deltaMode&&(1===t.deltaMode?(i*=40,n*=40):(i*=800,n*=800)),i&&!e&&(e=i<1?-1:1),n&&!o&&(o=n<1?-1:1),{spinX:e,spinY:o,pixelX:i,pixelY:n}}function D(t,e){var o=t%e;return o<0&&(o+=e),o}function N(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function U(t,e){return[0,2*Math.PI,2*-Math.PI].reduce((function(o,i){var n=e-t+i;return Math.abs(n)0?"-":"")+t.toLowerCase()}))} -/** - * @summary Returns a function, that, when invoked, will only be triggered at most once during a given window of time. - * @memberOf PSV.utils - * @copyright underscore.js - modified by Clément Prévost {@link http://stackoverflow.com/a/27078401} - * @param {Function} func - * @param {number} wait - * @returns {Function} - */function F(t,e){var o,i,n,r,s=0,a=function(){s=Date.now(),r=void 0,n=t.apply(o,i),r||(o=i=null)};return function(){var c=Date.now();s||(s=c);var h=e-(c-s);return o=this,i=arguments,h<=0||h>e?(r&&(clearTimeout(r),r=void 0),s=c,n=t.apply(o,i),r||(o=i=null)):r||(r=setTimeout(a,h)),n}}function V(t){if("object"==typeof t&&null!==t){if("function"==typeof Object.getPrototypeOf){var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}return"[object Object]"===Object.prototype.toString.call(t)}return!1} -/** - * @summary Merges the enumerable attributes of two objects - * @memberOf PSV.utils - * @description Replaces arrays and alters the target object. - * @copyright Nicholas Fisher - * @param {Object} target - * @param {Object} src - * @returns {Object} target - */function W(t,e){var o=e;return function t(e,i){return Array.isArray(i)?(e&&Array.isArray(e)?e.length=0:e=[],i.forEach((function(o,i){e[i]=t(null,o)}))):"object"==typeof i?(e&&!Array.isArray(e)||(e={}),Object.keys(i).forEach((function(n){"object"==typeof i[n]&&i[n]&&V(i[n])?i[n]!=o&&(e[n]?t(e[n],i[n]):e[n]=t(null,i[n])):e[n]=i[n]}))):e=i,e}(t,e)}function Y(t){return W(null,t)}function j(t){return!t||0===Object.keys(t).length&&t.constructor===Object}function Z(t,e){Object.keys(t).forEach((function(o){e(t[o],o)}))}function X(t){return null==t}function B(){for(var t=arguments.length,e=new Array(t),o=0;o(.*)");if(null!==o){var i=parseInt(o[1],10);return isNaN(i)?null:i}if(null!==(o=t.match("GPano:"+e+'="(.*?)"'))){var n=parseInt(o[1],10);return isNaN(n)?null:n}return null}var et={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"};function ot(t){if(!t)return{x:.5,y:.5};if("object"==typeof t)return t;var e=t.toLocaleLowerCase().split(" ").slice(0,2);1===e.length&&(e=void 0!==et[e[0]]?[e[0],"center"]:[e[0],e[0]]);var o="left"!==e[1]&&"right"!==e[1]&&"top"!==e[0]&&"bottom"!==e[0];e=e.map((function(t){return et[t]||t})),o||e.reverse();var i=e.join(" ").match(/^([0-9.]+)% ([0-9.]+)%$/);return i?{x:parseFloat(i[1])/100,y:parseFloat(i[2])/100}:{x:.5,y:.5}}var it={0:"left",.5:"center",1:"right"},nt={0:"top",.5:"center",1:"bottom"};function rt(t,e){if(void 0===e&&(e=!0),"string"==typeof t){var o=ot(t);if(!(o.x in it)||!(o.y in nt))throw new i('Unable to parse position "'+t+'"');t=[nt[o.y],it[o.x]]}if(!e&&"center"===t[0]&&"center"===t[1])throw new i('Unable to parse position "center center"');return t}function st(t){var o;if("string"==typeof t){var n=t.toString().trim(),r=parseFloat(n.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/,"$1")),s=n.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim();switch(s.match(/(pm|per minute)$/)&&(r/=60),s){case"dpm":case"degrees per minute":case"dps":case"degrees per second":o=e.MathUtils.degToRad(r);break;case"rdpm":case"radians per minute":case"rdps":case"radians per second":o=r;break;case"rpm":case"revolutions per minute":case"rps":case"revolutions per second":o=r*Math.PI*2;break;default:throw new i('Unknown speed unit "'+s+'"')}}else o=t;return o}function at(t,o,n){var r;if(void 0===o&&(o=!1),void 0===n&&(n=o),"string"==typeof t){var s=t.toLowerCase().trim().match(/^(-?[0-9]+(?:\.[0-9]*)?)(.*)$/);if(!s)throw new i('Unknown angle "'+t+'"');var a=parseFloat(s[1]),c=s[2];if(c)switch(c){case"deg":case"degs":r=e.MathUtils.degToRad(a);break;case"rad":case"rads":r=a;break;default:throw new i('Unknown angle unit "'+c+'"')}else r=a}else{if("number"!=typeof t||isNaN(t))throw new i('Unknown angle "'+t+'"');r=t}return r=D(o?r+Math.PI:r,2*Math.PI),o?e.MathUtils.clamp(r-Math.PI,-Math.PI/(n?2:1),Math.PI/(n?2:1)):r}function ct(t){var o=new e.Texture(t);return o.needsUpdate=!0,o.minFilter=e.LinearFilter,o.generateMipmaps=!1,o}var ht=new e.Quaternion;function lt(t,e){ht.setFromEuler(e).invert(),t.applyQuaternion(ht)}var pt=function(){function t(t){var e=this;this.__callbacks=[],t?(t.easing&&"string"!=typeof t.easing||(t.easing=w[t.easing||"linear"]),this.__start=null,this.options=t,t.delay?this.__delayTimeout=setTimeout((function(){e.__delayTimeout=null,e.__animationFrame=window.requestAnimationFrame((function(t){return e.__run(t)}))}),t.delay):this.__animationFrame=window.requestAnimationFrame((function(t){return e.__run(t)}))):this.__resolved=!0}var e=t.prototype;return e.__run=function(t){var e=this;null===this.__start&&(this.__start=t);var o=(t-this.__start)/this.options.duration,i={};o<1?(Z(this.options.properties,(function(t,n){t&&(i[n]=t.start+(t.end-t.start)*e.options.easing(o))})),this.options.onTick(i,o),this.__animationFrame=window.requestAnimationFrame((function(t){return e.__run(t)}))):(Z(this.options.properties,(function(t,e){t&&(i[e]=t.end)})),this.options.onTick(i,1),this.__animationFrame=window.requestAnimationFrame((function(){e.__resolved=!0,e.__resolve(!0)})))},e.__resolve=function(t){this.__callbacks.forEach((function(e){return e(t)})),this.__callbacks.length=0},e.then=function(t){var e=this;return this.__resolved||this.__cancelled?Promise.resolve(this.__resolved).then(t):new Promise((function(t){e.__callbacks.push(t)})).then(t)},e.cancel=function(){this.__cancelled||this.__resolved||(this.__cancelled=!0,this.__resolve(!1),this.__delayTimeout&&(window.clearTimeout(this.__delayTimeout),this.__delayTimeout=null),this.__animationFrame&&(window.cancelAnimationFrame(this.__animationFrame),this.__animationFrame=null))},t}(),ut=function(){function t(e,o,n,r,s){if(void 0===o&&(o=0),void 0===n&&(n=-1/0),void 0===r&&(r=1/0),void 0===s&&(s=!1),this.fn=e,this.mode=t.STOP,this.speed=0,this.speedMult=1,this.currentSpeed=0,this.target=0,this.current=o,this.min=n,this.max=r,this.loopValue=s,s&&0!==n)throw new i("invalid config");this.fn&&this.fn(o)}var o=t.prototype;return o.setSpeed=function(t){this.speed=t},o.goto=function(o,i){void 0===i&&(i=1),this.mode=t.POSITION,this.target=this.loopValue?D(o,this.max):e.MathUtils.clamp(o,this.min,this.max),this.speedMult=i},o.step=function(e,o){void 0===o&&(o=1),this.mode!==t.POSITION&&(this.target=this.current),this.goto(this.target+e,o)},o.roll=function(e,o){void 0===e&&(e=!1),void 0===o&&(o=1),this.mode=t.INFINITE,this.target=e?-1/0:1/0,this.speedMult=o},o.stop=function(){this.mode=t.STOP},o.setValue=function(o){return this.target=this.loopValue?D(o,this.max):e.MathUtils.clamp(o,this.min,this.max),this.mode=t.STOP,this.target!==this.current&&(this.current=this.target,this.fn&&this.fn(this.current),!0)},o.update=function(o){if(this.mode===t.POSITION){this.loopValue&&Math.abs(this.target-this.current)>this.max/2&&(this.current=this.currentn&&(this.currentSpeed=Math.max(n,this.currentSpeed-o/1e3*this.speed*this.speedMult*2));var r=null;return this.current>this.target&&this.currentSpeed?r=Math.max(this.target,this.current+this.currentSpeed*o/1e3):this.current"),i=t.substring(e,o);return-1!==e&&-1!==o&&i.includes("GPano:")?{fullWidth:tt(i,"FullPanoWidthPixels"),fullHeight:tt(i,"FullPanoHeightPixels"),croppedWidth:tt(i,"CroppedAreaImageWidthPixels"),croppedHeight:tt(i,"CroppedAreaImageHeightPixels"),croppedX:tt(i,"CroppedAreaLeftPixels"),croppedY:tt(i,"CroppedAreaTopPixels"),poseHeading:tt(i,"PoseHeadingDegrees"),posePitch:tt(i,"PosePitchDegrees"),poseRoll:tt(i,"PoseRollDegrees")}:null}))},r.__loadBlobAsString=function(t){return new Promise((function(e,o){var i=new FileReader;i.onload=function(){return e(i.result)},i.onerror=o,i.readAsText(t)}))},r.__createEquirectangularTexture=function(t,e){if(e.fullWidth>b.maxTextureWidth||e.croppedWidth!==e.fullWidth||e.croppedHeight!==e.fullHeight){var o=b.getMaxCanvasWidth()/e.fullWidth,i=a({},e);o<1&&(i.fullWidth*=o,i.fullHeight*=o,i.croppedWidth*=o,i.croppedHeight*=o,i.croppedX*=o,i.croppedY*=o);var n=document.createElement("canvas");return n.width=i.fullWidth,n.height=i.fullHeight,n.getContext("2d").drawImage(t,i.croppedX,i.croppedY,i.croppedWidth,i.croppedHeight),ct(n)}return ct(t)},r.createMesh=function(t){void 0===t&&(t=1);var o=new e.SphereGeometry(p*t,this.SPHERE_SEGMENTS,this.SPHERE_HORIZONTAL_SEGMENTS,-Math.PI/2).scale(-1,1,1),i=n.createOverlayMaterial();return new e.Mesh(o,i)},r.setTexture=function(t,e){this.__setUniform(t,n.OVERLAY_UNIFORMS.panorama,e.texture),this.setOverlay(t,null)},r.setOverlay=function(t,o,i){this.__setUniform(t,n.OVERLAY_UNIFORMS.overlayOpacity,i),o?this.__setUniform(t,n.OVERLAY_UNIFORMS.overlay,o.texture):this.__setUniform(t,n.OVERLAY_UNIFORMS.overlay,new e.Texture)},r.setTextureOpacity=function(t,e){this.__setUniform(t,n.OVERLAY_UNIFORMS.globalOpacity,e),t.material.transparent=e<1},r.disposeTexture=function(t){var e;null==(e=t.texture)||e.dispose()},r.__setUniform=function(t,o,i){t.material.uniforms[o].value instanceof e.Texture&&t.material.uniforms[o].value.dispose(),t.material.uniforms[o].value=i},o}(n);mt.id="equirectangular",mt.supportsDownload=!0,mt.supportsOverlay=!0;var gt=function(){function t(t,e){this.psv=t.psv||t,this.parent=t,this.parent.children.push(this),this.children=[],this.prop={visible:!0},this.container=document.createElement("div"),this.container.className=e,this.parent.container.appendChild(this.container)}var e=t.prototype;return e.destroy=function(){this.parent.container.removeChild(this.container);var t=this.parent.children.indexOf(this);-1!==t&&this.parent.children.splice(t,1),this.children.slice().forEach((function(t){return t.destroy()})),this.children.length=0,delete this.container,delete this.parent,delete this.psv,delete this.prop},e.refreshUi=function(){var t=this;this.children.every((function(e){return e.refreshUi(),!0===t.psv.prop.uiRefresh}))},e.toggle=function(){this.isVisible()?this.hide():this.show()},e.hide=function(){this.container.style.display="none",this.prop.visible=!1},e.show=function(){this.container.style.display="",this.prop.visible=!0},e.isVisible=function(){return this.prop.visible},t}(),_t=function(t){function e(e,o,i,n){var r;return void 0===o&&(o=""),void 0===i&&(i=!1),void 0===n&&(n=!0),(r=t.call(this,e,"psv-button "+o)||this).prop=a({},r.prop,{id:r.constructor.id,collapsable:i,enabled:!0,supported:!0,collapsed:!1,active:!1,width:r.container.offsetWidth}),r.constructor.icon&&r.__setIcon(r.constructor.icon),r.prop.id&&r.psv.config.lang[r.prop.id]&&(r.container.title=r.psv.config.lang[r.prop.id]),n&&(r.container.tabIndex=0),r.container.addEventListener("click",(function(t){r.prop.enabled&&r.onClick(),t.stopPropagation()})),r.container.addEventListener("keydown",(function(t){t.key===y.Enter&&r.prop.enabled&&(r.onClick(),t.stopPropagation())})),r}c(e,t);var o=e.prototype;return o.checkSupported=function(){var t=this,e=this.isSupported();V(e)?(!1===e.initial&&(this.hide(),this.prop.supported=!1),e.promise.then((function(e){t.prop&&(t.prop.supported=e,e?t.show():t.hide())}))):(this.prop.supported=e,e||this.hide())},o.isSupported=function(){return!0},o.toggleActive=function(t){this.prop.active=void 0!==t?t:!this.prop.active,L(this.container,"psv-button--active",this.prop.active),this.constructor.iconActive&&this.__setIcon(this.prop.active?this.constructor.iconActive:this.constructor.icon)},o.show=function(t){void 0===t&&(t=!0),this.isVisible()||(this.prop.visible=!0,this.prop.collapsed||(this.container.style.display=""),t&&this.psv.refreshUi("show button "+this.prop.id))},o.hide=function(t){void 0===t&&(t=!0),this.isVisible()&&(this.prop.visible=!1,this.container.style.display="none",t&&this.psv.refreshUi("hide button "+this.prop.id))},o.disable=function(){this.container.classList.add("psv-button--disabled"),this.prop.enabled=!1},o.enable=function(){this.container.classList.remove("psv-button--disabled"),this.prop.enabled=!0},o.collapse=function(){this.prop.collapsed=!0,this.container.style.display="none"},o.uncollapse=function(){this.prop.collapsed=!1,this.prop.visible&&(this.container.style.display="")},o.__setIcon=function(t,e){void 0===e&&(e=this.container),t?(e.innerHTML=t,e.querySelector("svg").classList.add("psv-button-svg")):e.innerHTML=""},o.onClick=function(){throw new i('onClick not implemented for button "'+this.prop.id+'".')},e}(gt);_t.id=null,_t.groupId=null,_t.icon=null,_t.iconActive=null;var wt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-autorotate-button",!0)||this).psv.on(f.AUTOROTATE,l(o)),o}c(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.AUTOROTATE,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){if(t.type===f.AUTOROTATE)this.toggleActive(t.args[0])},o.onClick=function(){this.psv.isAutorotateEnabled()&&(this.psv.config.autorotateIdle=!1,this.psv.resetIdleTimer()),this.psv.toggleAutorotate()},e}(_t);wt.id="autorotate",wt.icon='\x3c!--Created by Nick Bluth from the Noun Project--\x3e\n',wt.iconActive='\x3c!--Created by Nick Bluth from the Noun Project--\x3e\n';var yt=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-custom-button",!1!==o.collapsable,!1!==o.tabbable)||this).config=o,i.config.id?i.prop.id=i.config.id:i.prop.id="psvButton-"+Math.random().toString(36).substr(2,9),i.config.className&&x(i.container,i.config.className),i.config.title&&(i.container.title=i.config.title),i.config.content&&(i.container.innerHTML=i.config.content),i.prop.width=i.container.offsetWidth,!1===i.config.enabled&&i.disable(),!1===i.config.visible&&i.hide(),i}c(e,t);var o=e.prototype;return o.destroy=function(){delete this.config,t.prototype.destroy.call(this)},o.onClick=function(){this.config.onClick&&this.config.onClick.call(this.psv,this.psv)},e}(_t),Et=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-description-button")||this).prop=a({},o.prop,{mode:null}),o.psv.on(f.HIDE_NOTIFICATION,l(o)),o.psv.on(f.SHOW_NOTIFICATION,l(o)),o.psv.on(f.CLOSE_PANEL,l(o)),o.psv.on(f.OPEN_PANEL,l(o)),o}c(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.HIDE_NOTIFICATION,this),this.psv.off(f.SHOW_NOTIFICATION,this),this.psv.off(f.CLOSE_PANEL,this),this.psv.off(f.OPEN_PANEL,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){if(this.prop.mode){var e=!1;switch(t.type){case f.HIDE_NOTIFICATION:e=1===this.prop.mode;break;case f.SHOW_NOTIFICATION:e=1===this.prop.mode&&t.args[0]!==_.DESCRIPTION;break;case f.CLOSE_PANEL:e=2===this.prop.mode;break;case f.OPEN_PANEL:e=2===this.prop.mode&&t.args[0]!==_.DESCRIPTION}e&&(this.toggleActive(!1),this.prop.mode=null)}},o.hide=function(e){t.prototype.hide.call(this,e),this.prop.mode&&this.__close()},o.refreshUi=function(t){if(void 0===t&&(t=!1),t){var e=this.psv.navbar.getButton("caption",!1),o=e&&!e.isVisible(),i=!!this.psv.config.description;o||i?this.show(!1):this.hide(!1)}},o.onClick=function(){this.prop.mode?this.__close():this.__open()},o.__close=function(){switch(this.prop.mode){case 1:this.psv.notification.hide(_.DESCRIPTION);break;case 2:this.psv.panel.hide(_.DESCRIPTION)}},o.__open=function(){this.toggleActive(!0),this.psv.config.description?(this.prop.mode=2,this.psv.panel.show({id:_.DESCRIPTION,content:(this.psv.config.caption?"

"+this.psv.config.caption+"

":"")+this.psv.config.description})):(this.prop.mode=1,this.psv.notification.show({id:_.DESCRIPTION,content:this.psv.config.caption}))},e}(_t);Et.id="description",Et.icon='\x3c!--Created by Arafat Uddin from the Noun Project--\x3e\n';var Tt=function(t){function e(e){return t.call(this,e,"psv-button--hover-scale psv-download-button",!0)||this}c(e,t);var o=e.prototype;return o.onClick=function(){var t=this,e=document.createElement("a");e.href=this.psv.config.downloadUrl||this.psv.config.panorama,e.download=e.href.split("/").pop(),this.psv.container.appendChild(e),e.click(),setTimeout((function(){t.psv.container.removeChild(e)}),100)},o.refreshUi=function(){var t=this.psv.adapter.constructor.supportsDownload||this.psv.config.downloadUrl;t&&!this.prop.visible?this.show():!t&&this.prop.visible&&this.hide()},e}(_t);Tt.id="download",Tt.icon='\x3c!--Created by Michael Zenaty from the Noun Project--\x3e\n';var bt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-fullscreen-button")||this).psv.on(f.FULLSCREEN_UPDATED,l(o)),o}c(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.FULLSCREEN_UPDATED,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){if(t.type===f.FULLSCREEN_UPDATED)this.toggleActive(t.args[0])},o.onClick=function(){this.psv.toggleFullscreen()},e}(_t);bt.id="fullscreen",bt.icon='\x3c!--Created by Garrett Knoll from the Noun Project--\x3e\n',bt.iconActive='\x3c!--Created by Garrett Knoll from the Noun Project--\x3e\n';var Ot='\x3c!-- Created by Richard Kunák from the Noun Project--\x3e\n',Mt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-menu-button")||this).psv.on(f.OPEN_PANEL,l(o)),o.psv.on(f.CLOSE_PANEL,l(o)),t.prototype.hide.call(l(o)),o}c(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.OPEN_PANEL,this),this.psv.off(f.CLOSE_PANEL,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case f.OPEN_PANEL:this.toggleActive(t.args[0]===_.MENU);break;case f.CLOSE_PANEL:this.toggleActive(!1)}},o.hide=function(e){t.prototype.hide.call(this,e),this.__hideMenu()},o.show=function(e){t.prototype.show.call(this,e),this.prop.active&&this.__showMenu()},o.onClick=function(){this.prop.active?this.__hideMenu():this.__showMenu()},o.__showMenu=function(){var t=this;this.psv.panel.show({id:_.MENU,content:e.MENU_TEMPLATE(this.parent.collapsed,this.psv,z(e.BUTTON_DATA)),noMargin:!0,clickHandler:function(o){var i=o.target?C(o.target,"li"):void 0,n=i?i.dataset[e.BUTTON_DATA]:void 0;n&&(t.parent.getButton(n).onClick(),t.__hideMenu())}})},o.__hideMenu=function(){this.psv.panel.hide(_.MENU)},e}(_t);Mt.id="menu",Mt.icon=Ot,Mt.BUTTON_DATA="psvButton",Mt.MENU_TEMPLATE=function(t,e,o){return'\n
\n

'+Ot+" "+e.config.lang.menu+'

\n
    \n '+t.map((function(t){return"\n
  • \n '+t.container.innerHTML+'\n '+t.container.title+"\n
  • \n "})).join("")+"\n
\n
\n"};var Lt=function(){function t(t){void 0===t&&(t=200),this.delay=t,this.time=0,this.timeout=null}var e=t.prototype;return e.down=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.time=(new Date).getTime()},e.up=function(t){var e=this;this.time&&((new Date).getTime()-this.time\x3c!-- Created by Flatart from the Noun Project --\x3e\n'.replace("rotate(0","rotate("+e)}var Ct=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-button--hover-scale psv-move-button")||this).container.title=i.psv.config.lang.move,i.prop=a({},i.prop,{value:o,handler:new Lt}),i.container.addEventListener("mousedown",l(i)),i.container.addEventListener("keydown",l(i)),i.container.addEventListener("keyup",l(i)),i.psv.container.addEventListener("mouseup",l(i)),i.psv.container.addEventListener("touchend",l(i)),i}c(e,t);var o=e.prototype;return o.destroy=function(){this.__onMouseUp(),this.psv.container.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchend",this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case"mousedown":this.__onMouseDown();break;case"mouseup":case"touchend":this.__onMouseUp();break;case"keydown":t.key===y.Enter&&this.__onMouseDown();break;case"keyup":t.key===y.Enter&&this.__onMouseUp()}},o.isSupported=function(){return{initial:!b.isTouchEnabled.initial,promise:b.isTouchEnabled.promise.then((function(t){return!t}))}},o.onClick=function(){},o.__onMouseDown=function(){this.prop.enabled&&(this.psv.__stopAll(),this.psv.dynamics.position.roll(this.prop.value),this.prop.handler.down())},o.__onMouseUp=function(){var t=this;this.prop.enabled&&this.prop.handler.up((function(){t.psv.dynamics.position.stop(),t.psv.resetIdleTimer()}))},e}(_t);Ct.groupId="move";var Pt=function(t){function e(e){return t.call(this,e,{latitude:!0})||this}return c(e,t),e}(Ct);Pt.id="moveDown",Pt.icon=xt("down");var At=function(t){function e(e){return t.call(this,e,{longitude:!0})||this}return c(e,t),e}(Ct);At.id="moveLeft",At.icon=xt("left");var It=function(t){function e(e){return t.call(this,e,{longitude:!1})||this}return c(e,t),e}(Ct);It.id="moveRight",It.icon=xt("right");var St=function(t){function e(e){return t.call(this,e,{latitude:!1})||this}return c(e,t),e}(Ct);St.id="moveUp",St.icon=xt("up");var Rt=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-button--hover-scale psv-zoom-button")||this).prop=a({},i.prop,{value:o,handler:new Lt}),i.container.addEventListener("mousedown",l(i)),i.container.addEventListener("keydown",l(i)),i.container.addEventListener("keyup",l(i)),i.psv.container.addEventListener("mouseup",l(i)),i.psv.container.addEventListener("touchend",l(i)),i}c(e,t);var o=e.prototype;return o.destroy=function(){this.__onMouseUp(),this.psv.container.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchend",this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case"mousedown":this.__onMouseDown();break;case"mouseup":case"touchend":this.__onMouseUp();break;case"keydown":t.key===y.Enter&&this.__onMouseDown();break;case"keyup":t.key===y.Enter&&this.__onMouseUp()}},o.isSupported=function(){return{initial:!b.isTouchEnabled.initial,promise:b.isTouchEnabled.promise.then((function(t){return!t}))}},o.onClick=function(){},o.__onMouseDown=function(){this.prop.enabled&&(this.psv.dynamics.zoom.roll(this.prop.value),this.prop.handler.down())},o.__onMouseUp=function(){var t=this;this.prop.enabled&&this.prop.handler.up((function(){return t.psv.dynamics.zoom.stop()}))},e}(_t);Rt.groupId="zoom";var kt=function(t){function e(e){return t.call(this,e,!1)||this}return c(e,t),e}(Rt);kt.id="zoomIn",kt.icon='\x3c!--Created by Ryan Canning from the Noun Project--\x3e\n';var Dt=function(t){function e(e){return t.call(this,e,!0)||this}return c(e,t),e}(Rt);Dt.id="zoomOut",Dt.icon='\x3c!--Created by Ryan Canning from the Noun Project--\x3e\n';var Nt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-zoom-range",!1,!1)||this).prop=a({},o.prop,{mediaMinWidth:0}),o.zoomRange=document.createElement("div"),o.zoomRange.className="psv-zoom-range-line",o.container.appendChild(o.zoomRange),o.zoomValue=document.createElement("div"),o.zoomValue.className="psv-zoom-range-handle",o.zoomRange.appendChild(o.zoomValue),o.slider=new vt({container:o.container,direction:vt.HORIZONTAL,onUpdate:function(t){return o.__onSliderUpdate(t)}}),o.prop.mediaMinWidth=parseInt(R(o.container,"maxWidth"),10),o.psv.on(f.ZOOM_UPDATED,l(o)),o.psv.prop.ready?o.__moveZoomValue(o.psv.getZoomLevel()):o.psv.once(f.READY,l(o)),o.refreshUi(),o}c(e,t);var o=e.prototype;return o.destroy=function(){this.slider.destroy(),delete this.zoomRange,delete this.zoomValue,this.psv.off(f.ZOOM_UPDATED,this),this.psv.off(f.READY,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case f.ZOOM_UPDATED:this.__moveZoomValue(t.args[0]);break;case f.READY:this.__moveZoomValue(this.psv.getZoomLevel())}},o.isSupported=function(){return{initial:!b.isTouchEnabled.initial,promise:b.isTouchEnabled.promise.then((function(t){return!t}))}},o.refreshUi=function(){this.prop.supported&&(this.psv.prop.size.width<=this.prop.mediaMinWidth&&this.prop.visible?this.hide():this.psv.prop.size.width>this.prop.mediaMinWidth&&!this.prop.visible&&this.show())},o.onClick=function(){},o.__moveZoomValue=function(t){this.zoomValue.style.left=t/100*this.zoomRange.offsetWidth-this.zoomValue.offsetWidth/2+"px"},o.__onSliderUpdate=function(t){t.mousedown&&this.psv.zoom(100*t.value)},e}(_t);Nt.id="zoomRange",Nt.groupId="zoom";var Ut,Ht=function(t){function e(e){var o;return(o=t.call(this)||this).psv=e,o}c(e,t);var o=e.prototype;return o.init=function(){},o.destroy=function(){delete this.psv},e}(o.EventEmitter);Ht.id=null;var zt={panorama:null,overlay:null,overlayOpacity:1,container:null,adapter:null,plugins:[],caption:null,description:null,downloadUrl:null,loadingImg:null,loadingTxt:"Loading...",size:null,fisheye:!1,minFov:30,maxFov:90,defaultZoomLvl:50,defaultLong:0,defaultLat:0,sphereCorrection:null,moveSpeed:1,zoomSpeed:1,autorotateDelay:null,autorotateIdle:!1,autorotateSpeed:"2rpm",autorotateLat:null,moveInertia:!0,mousewheel:!0,mousemove:!0,captureCursor:!1,mousewheelCtrlKey:!1,touchmoveTwoFingers:!1,useXmpData:!0,panoData:null,requestHeaders:null,canvasBackground:"#000",withCredentials:!1,navbar:["autorotate","zoom","move","download","description","caption","fullscreen"],lang:{autorotate:"Automatic rotation",zoom:"Zoom",zoomOut:"Zoom out",zoomIn:"Zoom in",move:"Move",download:"Download",fullscreen:"Fullscreen",menu:"Menu",twoFingers:"Use two fingers to navigate",ctrlZoom:"Use ctrl + scroll to zoom the image",loadError:"The panorama can't be loaded"},keyboard:(Ut={},Ut[y.ArrowUp]=v.ROTATE_LAT_UP,Ut[y.ArrowDown]=v.ROTATE_LAT_DOWN,Ut[y.ArrowRight]=v.ROTATE_LONG_RIGHT,Ut[y.ArrowLeft]=v.ROTATE_LONG_LEFT,Ut[y.PageUp]=v.ZOOM_IN,Ut[y.PageDown]=v.ZOOM_OUT,Ut[y.Plus]=v.ZOOM_IN,Ut[y.Minus]=v.ZOOM_OUT,Ut[y.Space]=v.TOGGLE_AUTOROTATE,Ut)},Ft={panorama:"Use setPanorama method to change the panorama",panoData:"Use setPanorama method to change the panorama",container:"Cannot change viewer container",adapter:"Cannot change adapter",plugins:"Cannot change plugins"},Vt={zoomButtonIncrement:"zoomButtonIncrement is deprecated, use zoomSpeed",mousewheelSpeed:"mousewheelSpeed is deprecated, use zoomSpeed",sphereCorrectionReorder:"sphereCorrectionReorder is deprecated"},Wt={container:function(t){if(!t)throw new i("No value given for container.");return t},adapter:function(t){if(!(t=t?Array.isArray(t)?[q(t[0],n),t[1]]:[q(t,n)]:[mt])[0])throw new i("Un undefined value with given for adapter.");return t},overlayOpacity:function(t){return e.MathUtils.clamp(t,0,1)},defaultLong:function(t){return at(t)},defaultLat:function(t){return at(t,!0)},minFov:function(t,o){return o.maxFov=this.prop.contentWidth?this.show():t0?(n.forEach((function(t){return t.collapse()})),this.collapsed=n,this.getButton(Mt.id).show(!1)):e>=o&&this.collapsed.length>0&&(this.collapsed.forEach((function(t){return t.uncollapse()})),this.collapsed=[],this.getButton(Mt.id).hide(!1));var r=this.getButton(Yt.id,!1);r&&r.refreshUi()}},o.__cleanButtons=function(t){return!0===t?Y(zt.navbar):"string"==typeof t?t.split(/[ ,]/):t||[]},e}(gt),Gt=function(t){function o(e){var o;return(o=t.call(this,e,"psv-loader-container")||this).loader=document.createElement("div"),o.loader.className="psv-loader",o.container.appendChild(o.loader),o.canvas=document.createElement("canvas"),o.canvas.className="psv-loader-canvas",o.canvas.width=o.loader.clientWidth*b.pixelRatio,o.canvas.height=o.loader.clientWidth*b.pixelRatio,o.loader.appendChild(o.canvas),o.prop=a({},o.prop,{tickness:(o.loader.offsetWidth-o.loader.clientWidth)/2*b.pixelRatio,current:null}),o.refreshUi(),o.hide(),o}c(o,t);var i=o.prototype;return i.destroy=function(){delete this.loader,delete this.canvas,t.prototype.destroy.call(this)},i.refreshUi=function(){if(this.prop.current!==(this.psv.config.loadingImg||this.psv.config.loadingTxt)){var t;if(this.prop.current&&this.loader.removeChild(this.loader.lastChild),this.psv.config.loadingImg?((t=document.createElement("img")).className="psv-loader-image",t.src=this.psv.config.loadingImg):this.psv.config.loadingTxt&&((t=document.createElement("div")).className="psv-loader-text",t.innerHTML=this.psv.config.loadingTxt),t){var e=Math.round(Math.sqrt(2*Math.pow((this.canvas.width/2-this.prop.tickness/2)/b.pixelRatio,2)));t.style.maxWidth=e+"px",t.style.maxHeight=e+"px",this.loader.appendChild(t)}this.prop.current=this.psv.config.loadingImg||this.psv.config.loadingTxt}},i.setProgress=function(t){var o=this.canvas.getContext("2d");o.clearRect(0,0,this.canvas.width,this.canvas.height),o.lineWidth=this.prop.tickness,o.strokeStyle=R(this.loader,"color"),o.beginPath(),o.arc(this.canvas.width/2,this.canvas.height/2,this.canvas.width/2-this.prop.tickness/2,-Math.PI/2,e.MathUtils.clamp(t,0,100)/100*2*Math.PI-Math.PI/2),o.stroke(),this.psv.trigger(f.LOAD_PROGRESS,Math.round(t))},o}(gt),qt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-notification")||this).prop=a({},o.prop,{visible:!1,contentId:void 0,timeout:null}),o.content=document.createElement("div"),o.content.className="psv-notification-content",o.container.appendChild(o.content),o.content.addEventListener("click",(function(){return o.hide()})),o}c(e,t);var o=e.prototype;return o.destroy=function(){delete this.content,t.prototype.destroy.call(this)},o.isVisible=function(t){return this.prop.visible&&(!t||!this.prop.contentId||this.prop.contentId===t)},o.toggle=function(){throw new i("Notification cannot be toggled")},o.show=function(t){var e=this;this.prop.timeout&&(clearTimeout(this.prop.timeout),this.prop.timeout=null),"string"==typeof t&&(t={content:t}),this.prop.contentId=t.id,this.content.innerHTML=t.content,this.container.classList.add("psv-notification--visible"),this.prop.visible=!0,this.psv.trigger(f.SHOW_NOTIFICATION,t.id),t.timeout&&(this.prop.timeout=setTimeout((function(){return e.hide(t.id)}),t.timeout))},o.hide=function(t){if(this.isVisible(t)){var e=this.prop.contentId;this.container.classList.remove("psv-notification--visible"),this.prop.visible=!1,this.prop.contentId=void 0,this.psv.trigger(f.HIDE_NOTIFICATION,e)}},e}(gt),Kt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-overlay")||this).prop=a({},o.prop,{contentId:void 0,dissmisable:!0}),o.image=document.createElement("div"),o.image.className="psv-overlay-image",o.container.appendChild(o.image),o.text=document.createElement("div"),o.text.className="psv-overlay-text",o.container.appendChild(o.text),o.subtext=document.createElement("div"),o.subtext.className="psv-overlay-subtext",o.container.appendChild(o.subtext),o.psv.on(f.CLICK,l(o)),o.psv.on(f.KEY_PRESS,l(o)),t.prototype.hide.call(l(o)),o}c(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.CLICK,this),this.psv.off(f.KEY_PRESS,this),delete this.image,delete this.text,delete this.subtext,t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case f.CLICK:this.isVisible()&&this.prop.dissmisable&&(this.hide(),t.stopPropagation());break;case f.KEY_PRESS:this.isVisible()&&this.prop.dissmisable&&t.args[0]===y.Escape&&(this.hide(),t.preventDefault())}},o.isVisible=function(t){return this.prop.visible&&(!t||!this.prop.contentId||this.prop.contentId===t)},o.toggle=function(){throw new i("Overlay cannot be toggled")},o.show=function(e){"string"==typeof e&&(e={text:e}),this.prop.contentId=e.id,this.prop.dissmisable=!1!==e.dissmisable,this.image.innerHTML=e.image||"",this.text.innerHTML=e.text||"",this.subtext.innerHTML=e.subtext||"",t.prototype.show.call(this),this.psv.trigger(f.SHOW_OVERLAY,e.id)},o.hide=function(e){if(this.isVisible(e)){var o=this.prop.contentId;t.prototype.hide.call(this),this.prop.contentId=void 0,this.psv.trigger(f.HIDE_OVERLAY,o)}},e}(gt),Qt=function(t){function e(e){var o;(o=t.call(this,e,"psv-panel psv--capture-event")||this).prop=a({},o.prop,{visible:!1,contentId:void 0,mouseX:0,mouseY:0,mousedown:!1,clickHandler:null,keyHandler:null,width:{}});var i=document.createElement("div");i.className="psv-panel-resizer",o.container.appendChild(i);var n=document.createElement("div");return n.className="psv-panel-close-button",o.container.appendChild(n),o.content=document.createElement("div"),o.content.className="psv-panel-content",o.container.appendChild(o.content),o.container.addEventListener(b.mouseWheelEvent,(function(t){return t.stopPropagation()})),n.addEventListener("click",(function(){return o.hide()})),i.addEventListener("mousedown",l(o)),i.addEventListener("touchstart",l(o)),o.psv.container.addEventListener("mouseup",l(o)),o.psv.container.addEventListener("touchend",l(o)),o.psv.container.addEventListener("mousemove",l(o)),o.psv.container.addEventListener("touchmove",l(o)),o.psv.on(f.KEY_PRESS,l(o)),o}c(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.KEY_PRESS,this),this.psv.container.removeEventListener("mousemove",this),this.psv.container.removeEventListener("touchmove",this),this.psv.container.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchend",this),delete this.prop,delete this.content,t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case"mousedown":this.__onMouseDown(t);break;case"touchstart":this.__onTouchStart(t);break;case"mousemove":this.__onMouseMove(t);break;case"touchmove":this.__onTouchMove(t);break;case"mouseup":case"touchend":this.__onMouseUp(t);break;case f.KEY_PRESS:this.isVisible()&&t.args[0]===y.Escape&&(this.hide(),t.preventDefault())}},o.isVisible=function(t){return this.prop.visible&&(!t||!this.prop.contentId||this.prop.contentId===t)},o.toggle=function(){throw new i("Panel cannot be toggled")},o.show=function(t){var e=this,o=this.isVisible(t.id);"string"==typeof t&&(t={content:t}),this.prop.contentId=t.id,this.prop.visible=!0,this.prop.clickHandler&&(this.content.removeEventListener("click",this.prop.clickHandler),this.content.removeEventListener("keydown",this.prop.keyHandler),this.prop.clickHandler=null,this.prop.keyHandler=null),t.id&&this.prop.width[t.id]?this.container.style.width=this.prop.width[t.id]:t.width?this.container.style.width=t.width:this.container.style.width=null,this.content.innerHTML=t.content,this.content.scrollTop=0,this.container.classList.add("psv-panel--open"),L(this.content,"psv-panel-content--no-margin",!0===t.noMargin),t.clickHandler&&(this.prop.clickHandler=t.clickHandler,this.prop.keyHandler=function(e){e.key===y.Enter&&t.clickHandler(e)},this.content.addEventListener("click",this.prop.clickHandler),this.content.addEventListener("keydown",this.prop.keyHandler),o||setTimeout((function(){var t;null==(t=e.content.querySelector("a,button,[tabindex]"))||t.focus()}),300)),this.psv.trigger(f.OPEN_PANEL,t.id)},o.hide=function(t){if(this.isVisible(t)){var e=this.prop.contentId;this.prop.visible=!1,this.prop.contentId=void 0,this.content.innerHTML=null,this.container.classList.remove("psv-panel--open"),this.prop.clickHandler&&(this.content.removeEventListener("click",this.prop.clickHandler),this.prop.clickHandler=null),this.psv.trigger(f.CLOSE_PANEL,e)}},o.__onMouseDown=function(t){t.stopPropagation(),this.__startResize(t)},o.__onTouchStart=function(t){t.stopPropagation(),this.__startResize(t.changedTouches[0])},o.__onMouseUp=function(t){this.prop.mousedown&&(t.stopPropagation(),this.prop.mousedown=!1,this.content.classList.remove("psv-panel-content--no-interaction"))},o.__onMouseMove=function(t){this.prop.mousedown&&(t.stopPropagation(),this.__resize(t))},o.__onTouchMove=function(t){this.prop.mousedown&&this.__resize(t.touches[0])},o.__startResize=function(t){this.prop.mouseX=t.clientX,this.prop.mouseY=t.clientY,this.prop.mousedown=!0,this.content.classList.add("psv-panel-content--no-interaction")},o.__resize=function(t){var e=t.clientX,o=t.clientY,i=Math.max(200,this.container.offsetWidth-(e-this.prop.mouseX))+"px";this.prop.contentId&&(this.prop.width[this.prop.contentId]=i),this.container.style.width=i,this.prop.mouseX=e,this.prop.mouseY=o},e}(gt),$t=function(){function t(t){this.psv=t,this.config=t.config,this.prop=t.prop}return t.prototype.destroy=function(){delete this.psv,delete this.config,delete this.prop},t}(),Jt=new e.Vector2,te=new e.Vector3,ee=new e.Euler(0,0,0,"ZXY"),oe=function(t){function o(e){return t.call(this,e)||this}c(o,t);var n=o.prototype;return n.fovToZoomLevel=function(t){var e=Math.round((t-this.config.minFov)/(this.config.maxFov-this.config.minFov)*100);return e-2*(e-50)},n.zoomLevelToFov=function(t){return this.config.maxFov+t/100*(this.config.minFov-this.config.maxFov)},n.vFovToHFov=function(t){return e.MathUtils.radToDeg(2*Math.atan(Math.tan(e.MathUtils.degToRad(t)/2)*this.prop.aspect))},n.speedToDuration=function(t,e){if(t&&"number"==typeof t)return Math.abs(t);var o=t?st(t):this.config.autorotateSpeed;return e/Math.abs(o)*1e3},n.textureCoordsToSphericalCoords=function(t){var e=this.prop.panoData;if(!e)throw new i("Current adapter does not support texture coordinates.");var o=(t.x+e.croppedX)/e.fullWidth*Math.PI*2,n=(t.y+e.croppedY)/e.fullHeight*Math.PI,r={longitude:o>=Math.PI?o-Math.PI:o+Math.PI,latitude:Math.PI/2-n};return ee.equals(this.psv.renderer.mesh.rotation)&&ee.equals(this.psv.renderer.meshContainer.rotation)?r:(this.sphericalCoordsToVector3(r,te),te.applyEuler(this.psv.renderer.mesh.rotation),te.applyEuler(this.psv.renderer.meshContainer.rotation),this.vector3ToSphericalCoords(te))},n.sphericalCoordsToTextureCoords=function(t){var e=this.prop.panoData;if(!e)throw new i("Current adapter does not support texture coordinates.");ee.equals(this.psv.renderer.mesh.rotation)&&ee.equals(this.psv.renderer.meshContainer.rotation)||(this.sphericalCoordsToVector3(t,te),lt(te,this.psv.renderer.meshContainer.rotation),lt(te,this.psv.renderer.mesh.rotation),t=this.vector3ToSphericalCoords(te));var o=t.longitude/Math.PI/2*e.fullWidth,n=t.latitude/Math.PI*e.fullHeight;return{x:Math.round(t.longitude\x3c!--Created by AomAm from the Noun Project--\x3e\n',text:e.config.lang.twoFingers})}),100)):(t.preventDefault(),this.__move(t.touches[0])):2===t.touches.length&&(t.preventDefault(),this.__moveZoom(t),this.__cancelTwoFingersOverlay()))},i.__cancelLongTouch=function(){this.prop.longtouchTimeout&&(clearTimeout(this.prop.longtouchTimeout),this.prop.longtouchTimeout=null)},i.__cancelTwoFingersOverlay=function(){this.prop.twofingersTimeout&&(clearTimeout(this.prop.twofingersTimeout),this.prop.twofingersTimeout=null),this.psv.overlay.hide(_.TWO_FINGERS)},i.__onMouseWheel=function(t){var e=this;if(this.config.mousewheel){if(this.config.mousewheelCtrlKey&&!this.state.ctrlKeyDown)return this.psv.overlay.show({id:_.CTRL_ZOOM,image:'\x3c!-- Created by Icon Island from the Noun Project --\x3e\n',text:this.config.lang.ctrlZoom}),clearTimeout(this.state.ctrlZoomTimeout),void(this.state.ctrlZoomTimeout=setTimeout((function(){return e.psv.overlay.hide(_.CTRL_ZOOM)}),2e3));t.preventDefault(),t.stopPropagation();var o=5*k(t).spinY*this.config.zoomSpeed;0!==o&&this.psv.dynamics.zoom.step(-o,5)}},i.__fullscreenToggled=function(t){this.prop.fullscreen=void 0!==t?t:A(this.psv.container),this.config.keyboard&&(this.prop.fullscreen?this.psv.startKeyboardControl():this.psv.stopKeyboardControl()),this.psv.trigger(f.FULLSCREEN_UPDATED,this.prop.fullscreen)},i.__startMove=function(t){var e=this;this.psv.__stopAll().then((function(){e.state.mouseX=t.clientX,e.state.mouseY=t.clientY,e.state.startMouseX=e.state.mouseX,e.state.startMouseY=e.state.mouseY,e.state.moving=!0,e.state.zooming=!1,e.state.mouseHistory.length=0,e.__logMouseMove(t)}))},i.__startMoveZoom=function(t){var e=this;this.psv.__stopAll().then((function(){var o={x:t.touches[0].clientX,y:t.touches[0].clientY},i={x:t.touches[1].clientX,y:t.touches[1].clientY};e.state.pinchDist=N(o,i),e.state.mouseX=(o.x+i.x)/2,e.state.mouseY=(o.y+i.y)/2,e.state.startMouseX=e.state.mouseX,e.state.startMouseY=e.state.mouseY,e.state.moving=!0,e.state.zooming=!0}))},i.__stopMove=function(t){if(this.psv.resetIdleTimer(),!C(t.target,".psv-container"))return this.state.moving=!1,void(this.state.mouseHistory.length=0);this.state.moving&&(Math.abs(t.clientX-this.state.startMouseX)30?(this.state.mouseHistory.splice(0,n),n=0,i=this.state.mouseHistory[n][0]):(i=this.state.mouseHistory[n][0],n++)},o}($t),ne=function(t){function o(o){var i,n;return(n=t.call(this,o)||this).renderer=new e.WebGLRenderer({alpha:!0,antialias:!0}),n.renderer.setPixelRatio(b.pixelRatio),n.renderer.domElement.className="psv-canvas",n.scene=new e.Scene,n.camera=new e.PerspectiveCamera(50,16/9,1,20),n.mesh=n.psv.adapter.createMesh(),n.mesh.userData=((i={}).psvSphere=!0,i),n.meshContainer=new e.Group,n.meshContainer.add(n.mesh),n.scene.add(n.meshContainer),n.raycaster=new e.Raycaster,n.timestamp=null,n.ready=!1,n.canvasContainer=document.createElement("div"),n.canvasContainer.className="psv-canvas-container",n.canvasContainer.style.background=n.psv.config.canvasBackground,n.canvasContainer.style.cursor=n.psv.config.mousemove?"move":"default",n.canvasContainer.appendChild(n.renderer.domElement),n.psv.container.appendChild(n.canvasContainer),o.on(f.SIZE_UPDATED,l(n)),o.on(f.ZOOM_UPDATED,l(n)),o.on(f.POSITION_UPDATED,l(n)),o.on(f.CONFIG_CHANGED,l(n)),n.hide(),n}c(o,t);var i=o.prototype;return i.destroy=function(){this.renderer.setAnimationLoop(null),this.__cleanTHREEScene(this.scene),this.psv.container.removeChild(this.canvasContainer),delete this.canvasContainer,delete this.renderer,delete this.scene,delete this.camera,delete this.mesh,delete this.meshContainer,delete this.raycaster,t.prototype.destroy.call(this)},i.handleEvent=function(t){switch(t.type){case f.SIZE_UPDATED:this.__onSizeUpdated();break;case f.ZOOM_UPDATED:this.__onZoomUpdated();break;case f.POSITION_UPDATED:this.__onPositionUpdated();break;case f.CONFIG_CHANGED:t.args[0].includes("fisheye")&&this.__onPositionUpdated(),t.args[0].includes("mousemove")&&(this.canvasContainer.style.cursor=this.psv.config.mousemove?"move":"default")}},i.hide=function(){this.canvasContainer.style.opacity=0},i.show=function(){this.canvasContainer.style.opacity=1},i.__onSizeUpdated=function(){this.renderer.setSize(this.prop.size.width,this.prop.size.height),this.camera.aspect=this.prop.aspect,this.camera.updateProjectionMatrix(),this.prop.needsUpdate=!0},i.__onZoomUpdated=function(){this.camera.fov=this.prop.vFov,this.camera.updateProjectionMatrix(),this.prop.needsUpdate=!0},i.__onPositionUpdated=function(){this.camera.position.set(0,0,0),this.camera.lookAt(this.prop.direction),this.config.fisheye&&this.camera.position.copy(this.prop.direction).multiplyScalar(this.config.fisheye/2).negate(),this.prop.needsUpdate=!0},i.__renderLoop=function(t){var e=null!==this.timestamp?t-this.timestamp:0;this.timestamp=t,this.psv.trigger(f.BEFORE_RENDER,t,e),Z(this.psv.dynamics,(function(t){return t.update(e)})),this.prop.idleTime>0&&t-this.prop.idleTime>this.config.autorotateDelay&&this.psv.startAutorotate(),this.prop.needsUpdate&&(this.render(),this.prop.needsUpdate=!1)},i.render=function(){this.renderer.render(this.scene,this.camera),this.psv.trigger(f.RENDER)},i.setTexture=function(t){var e=this;this.prop.panoData=t.panoData,this.psv.adapter.setTexture(this.mesh,t),this.ready||(this.renderer.setAnimationLoop((function(t){return e.__renderLoop(t)})),this.ready=!0),this.psv.needsUpdate(),this.psv.trigger(f.PANORAMA_LOADED,t)},i.setOverlay=function(t,e){this.psv.adapter.setOverlay(this.mesh,t,e),this.psv.needsUpdate()},i.setPanoramaPose=function(t,e){void 0===e&&(e=this.mesh);var o=this.psv.dataHelper.cleanPanoramaPose(t);e.rotation.set(-o.tilt,-o.pan,-o.roll,"ZXY")},i.setSphereCorrection=function(t,e){void 0===e&&(e=this.meshContainer);var o=this.psv.dataHelper.cleanSphereCorrection(t);e.rotation.set(o.tilt,o.pan,o.roll,"ZXY")},i.transition=function(t,o){var i=this,n=J(o),r="zoom"in o,s=new e.Group,a=this.psv.adapter.createMesh(.5);if(this.psv.adapter.setTexture(a,t,!0),this.psv.adapter.setTextureOpacity(a,0),this.setPanoramaPose(t.panoData,a),this.setSphereCorrection(o.sphereCorrection,s),n){var c=this.psv.dataHelper.cleanPosition(o),h=this.psv.getPosition(),l=new e.Vector3(0,1,0);s.rotateOnWorldAxis(l,c.longitude-h.longitude);var p=new e.Vector3(0,1,0).cross(this.camera.getWorldDirection(new e.Vector3)).normalize();s.rotateOnWorldAxis(p,c.latitude-h.latitude)}s.add(a),this.scene.add(s);var u=new pt({properties:{opacity:{start:0,end:1},zoom:r?{start:this.psv.getZoomLevel(),end:o.zoom}:void 0},duration:o.transition,easing:"outCubic",onTick:function(t){i.psv.adapter.setTextureOpacity(a,t.opacity),i.psv.adapter.setTextureOpacity(i.mesh,1-t.opacity),r&&i.psv.zoom(t.zoom),i.psv.needsUpdate()}});return u.then((function(e){e?(i.setTexture(t),i.psv.adapter.setTextureOpacity(i.mesh,1),i.setPanoramaPose(t.panoData),i.setSphereCorrection(o.sphereCorrection),n&&i.psv.rotate(o)):i.psv.adapter.disposeTexture(t),i.scene.remove(s),a.geometry.dispose(),a.geometry=null})),u},i.__cleanTHREEScene=function(t){var o=this;t.traverse((function(i){i.geometry&&i.geometry.dispose(),i.material&&(Array.isArray(i.material)?i.material.forEach((function(t){t.map&&t.map.dispose(),t.dispose()})):(i.material.map&&i.material.map.dispose(),i.material.dispose())),!i.dispose||i instanceof e.Scene||i.dispose(),i!==t&&o.__cleanTHREEScene(i)}))},o}($t),re=function(t){function o(o){var i;return(i=t.call(this,o)||this).loader=new e.FileLoader,i.loader.setResponseType("blob"),i.config.withCredentials&&i.loader.setWithCredentials(!0),i.config.requestHeaders&&"object"==typeof i.config.requestHeaders&&i.loader.setRequestHeader(i.config.requestHeaders),i}c(o,t);var i=o.prototype;return i.destroy=function(){this.abortLoading(),t.prototype.destroy.call(this)},i.loadTexture=function(t,e){return this.psv.adapter.loadTexture(t,e)},i.abortLoading=function(){},i.loadFile=function(t,e){var o=this;return this.config.requestHeaders&&"function"==typeof this.config.requestHeaders&&this.loader.setRequestHeader(this.config.requestHeaders(t)),new Promise((function(i,n){var r=0;e&&e(r),o.loader.load(t,(function(t){r=100,e&&e(r),i(t)}),(function(t){if(t.lengthComputable){var o=t.loaded/t.total*100;o>r&&(r=o,e&&e(r))}}),(function(t){n(t)}))}))},i.loadImage=function(t,e){return this.loadFile(t,e).then((function(t){return new Promise((function(e,o){var i=document.createElementNS("http://www.w3.org/1999/xhtml","img");i.onload=function(){URL.revokeObjectURL(i.src),e(i)},i.onerror=o,i.src=URL.createObjectURL(t)}))}))},i.preloadPanorama=function(t){return this.psv.adapter.supportsPreload(t)?this.psv.adapter.loadTexture(t):Promise.resolve()},o}($t),se=0,ae=1,ce=2,he=3,le=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-tooltip")||this).prop=a({},i.prop,o,{state:se,width:0,height:0,pos:"",config:null,data:null}),i.content=document.createElement("div"),i.content.className="psv-tooltip-content",i.container.appendChild(i.content),i.arrow=document.createElement("div"),i.arrow.className="psv-tooltip-arrow",i.container.appendChild(i.arrow),i.container.addEventListener("transitionend",l(i)),i.container.style.top="-1000px",i.container.style.left="-1000px",i}c(e,t);var o=e.prototype;return o.destroy=function(){delete this.arrow,delete this.content,t.prototype.destroy.call(this)},o.handleEvent=function(t){if("transitionend"===t.type)this.__onTransitionEnd(t)},o.toggle=function(){throw new i("Tooltip cannot be toggled")},o.show=function(t){if(this.prop.state!==se)throw new i("Initialized tooltip cannot be re-initialized");t.className&&x(this.container,t.className),this.content.innerHTML=t.content;var e=this.container.getBoundingClientRect();this.prop.width=e.right-e.left,this.prop.height=e.bottom-e.top,this.prop.state=he,this.move(t),this.prop.data=t.data,this.prop.state=ae,this.psv.trigger(f.SHOW_TOOLTIP,this.prop.data,this),this.__waitImages()},o.move=function(t){if(this.prop.state!==ae&&this.prop.state!==he)throw new i("Uninitialized tooltip cannot be moved");this.config=t;var e=this.container,o=this.arrow,n={posClass:t.position?rt(t.position,!1):["top","center"],width:this.prop.width,height:this.prop.height,top:0,left:0,arrowTop:0,arrowLeft:0};this.__computeTooltipPosition(n,t);var r=!1;n.topthis.psv.prop.size.height-this.prop.offset&&(n.posClass[0]="top",r=!0),n.leftthis.psv.prop.size.width-this.prop.offset&&(n.posClass[1]="left",r=!0),r&&this.__computeTooltipPosition(n,t),e.style.top=n.top+"px",e.style.left=n.left+"px",o.style.top=n.arrowTop+"px",o.style.left=n.arrowLeft+"px";var s=n.posClass.join("-");s!==this.prop.pos&&(e.classList.remove("psv-tooltip--"+this.prop.pos),this.prop.pos=s,e.classList.add("psv-tooltip--"+this.prop.pos))},o.hide=function(){this.container.classList.remove("psv-tooltip--visible"),this.prop.state=ce,this.psv.trigger(f.HIDE_TOOLTIP,this.prop.data)},o.__onTransitionEnd=function(t){if("transform"===t.propertyName)switch(this.prop.state){case ae:this.container.classList.add("psv-tooltip--visible"),this.prop.state=he;break;case ce:this.prop.state=se,this.destroy()}},o.__computeTooltipPosition=function(t,e){var o=!1;switch(e.box||(e.box={width:0,height:0}),t.posClass[0]){case"bottom":t.top=e.top+e.box.height+this.prop.offset+this.prop.arrow,t.arrowTop=2*-this.prop.arrow,o=!0;break;case"center":t.top=e.top+e.box.height/2-t.height/2,t.arrowTop=t.height/2-this.prop.arrow;break;case"top":t.top=e.top-t.height-this.prop.offset-this.prop.arrow,t.arrowTop=t.height,o=!0}switch(t.posClass[1]){case"right":o?(t.left=e.left+e.box.width/2-this.prop.offset-this.prop.arrow,t.arrowLeft=this.prop.offset):(t.left=e.left+e.box.width+this.prop.offset+this.prop.arrow,t.arrowLeft=2*-this.prop.arrow);break;case"center":t.left=e.left+e.box.width/2-t.width/2,t.arrowLeft=t.width/2-this.prop.arrow;break;case"left":o?(t.left=e.left-t.width+e.box.width/2+this.prop.offset+this.prop.arrow,t.arrowLeft=t.width-this.prop.offset-2*this.prop.arrow):(t.left=e.left-t.width-this.prop.offset-this.prop.arrow,t.arrowLeft=t.width)}},o.__waitImages=function(){var t=this,e=this.content.querySelectorAll("img");if(e.length>0){var o=[];e.forEach((function(t){o.push(new Promise((function(e){t.onload=e,t.onerror=e})))})),Promise.all(o).then((function(){if(t.prop.state===ae||t.prop.state===he){var e=t.container.getBoundingClientRect();t.prop.width=e.right-e.left,t.prop.height=e.bottom-e.top,t.move(t.config)}}))}},e}(gt),pe=function(t){function e(e){var o;o=t.call(this,e)||this;var i=new le(o.psv);return o.size={arrow:parseInt(R(i.arrow,"borderTopWidth"),10),offset:parseInt(R(i.container,"outlineWidth"),10)},i.destroy(),o}c(e,t);var o=e.prototype;return o.destroy=function(){delete this.size,t.prototype.destroy.call(this)},o.create=function(t){var e=new le(this.psv,this.size);return e.show(t),e},e}($t);e.Cache.enabled=!0;var ue=function(t){function o(o){var n;if(n=t.call(this)||this,b.load(),!b.isWebGLSupported)throw new i("WebGL is not supported.");if(0===b.maxTextureWidth)throw new i("Unable to detect system capabilities");return n.prop={ready:!1,uiRefresh:!1,needsUpdate:!1,fullscreen:!1,direction:new e.Vector3(0,0,p),vFov:null,hFov:null,aspect:null,autorotateEnabled:!1,animationPromise:null,loadingPromise:null,littlePlanet:!1,idleTime:-1,objectsObservers:{},size:{width:0,height:0},panoData:{fullWidth:0,fullHeight:0,croppedWidth:0,croppedHeight:0,croppedX:0,croppedY:0,poseHeading:0,posePitch:0,poseRoll:0}},n.config=function(t){var e=Y(zt);W(e,t);var o={};return Z(e,(function(t,n){if(Vt[n])$(Vt[n]);else{if(!Object.prototype.hasOwnProperty.call(zt,n))throw new i("Unknown option "+n);Wt[n]?o[n]=Wt[n](t,e):o[n]=t}})),o}(o),n.parent="string"==typeof o.container?document.getElementById(o.container):o.container,n.parent[u]=l(n),n.container=document.createElement("div"),n.container.classList.add("psv-container"),n.parent.appendChild(n.container),n.adapter=new n.config.adapter[0](l(n),n.config.adapter[1]),n.children=[],n.plugins={},n.renderer=new ne(l(n)),n.textureLoader=new re(l(n)),n.eventsHandler=new ie(l(n)),n.dataHelper=new oe(l(n)),n.loader=new Gt(l(n)),n.navbar=new Bt(l(n)),n.panel=new Qt(l(n)),n.tooltip=new pe(l(n)),n.notification=new qt(l(n)),n.overlay=new Kt(l(n)),n.dynamics={zoom:new ut((function(t){n.prop.vFov=n.dataHelper.zoomLevelToFov(t),n.prop.hFov=n.dataHelper.vFovToHFov(n.prop.vFov),n.trigger(f.ZOOM_UPDATED,t)}),n.config.defaultZoomLvl,0,100),position:new dt({longitude:new ut(null,n.config.defaultLong,0,2*Math.PI,!0),latitude:n.prop.littlePlanet?new ut(null,n.config.defaultLat,0,2*Math.PI,!0):new ut(null,n.config.defaultLat,-Math.PI/2,Math.PI/2)},(function(t){n.dataHelper.sphericalCoordsToVector3(t,n.prop.direction),n.trigger(f.POSITION_UPDATED,t)}))},n.__updateSpeeds(),n.eventsHandler.init(),n.__resizeRefresh=F((function(){return n.refreshUi("resize")}),500),n.resize(n.config.size),n.config.plugins.forEach((function(t){var e=t[0],o=t[1];n.plugins[e.id]=new e(l(n),o)})),Z(n.plugins,(function(t){return null==t.init?void 0:t.init()})),n.navbar.setButtons(n.config.navbar),n.config.panorama&&n.setPanorama(n.config.panorama),L(n.container,"psv--is-touch",b.isTouchEnabled.initial),b.isTouchEnabled.promise.then((function(t){return L(n.container,"psv--is-touch",t)})),n.once(f.RENDER,(function(){n.config.navbar&&(n.container.classList.add("psv--has-navbar"),n.navbar.show()),X(n.config.autorotateDelay)||(n.prop.idleTime=performance.now()),n.prop.ready=!0,setTimeout((function(){n.refreshUi("init"),n.trigger(f.READY)}),0)})),n}c(o,t);var n=o.prototype;return n.destroy=function(){this.__stopAll(),this.stopKeyboardControl(),this.exitFullscreen(),Z(this.plugins,(function(t){return t.destroy()})),delete this.plugins,this.children.slice().forEach((function(t){return t.destroy()})),this.children.length=0,this.eventsHandler.destroy(),this.renderer.destroy(),this.textureLoader.destroy(),this.dataHelper.destroy(),this.adapter.destroy(),this.parent.removeChild(this.container),delete this.parent[u],delete this.parent,delete this.container,delete this.loader,delete this.navbar,delete this.panel,delete this.tooltip,delete this.notification,delete this.overlay,delete this.dynamics,delete this.config},n.refreshUi=function(t){var e=this;this.prop.ready&&(this.prop.uiRefresh?"new"!==this.prop.uiRefresh&&(this.prop.uiRefresh="new",setTimeout((function(){e.prop.uiRefresh=!1,e.refreshUi(t)}))):(this.prop.uiRefresh=!0,this.children.every((function(t){return t.refreshUi(),!0===e.prop.uiRefresh})),this.prop.uiRefresh=!1))},n.getPlugin=function(t){if("string"==typeof t)return this.plugins[t];var e=q(t,Ht);return e?this.plugins[e.id]:void 0},n.getPosition=function(){return this.dataHelper.cleanPosition(this.dynamics.position.current)},n.getZoomLevel=function(){return this.dynamics.zoom.current},n.getSize=function(){return a({},this.prop.size)},n.isAutorotateEnabled=function(){return this.prop.autorotateEnabled},n.isFullscreenEnabled=function(){return b.fullscreenEvent?A(this.container):this.prop.fullscreen},n.needsUpdate=function(){this.prop.needsUpdate=!0},n.autoSize=function(){this.container.clientWidth===this.prop.size.width&&this.container.clientHeight===this.prop.size.height||(this.prop.size.width=Math.round(this.container.clientWidth),this.prop.size.height=Math.round(this.container.clientHeight),this.prop.aspect=this.prop.size.width/this.prop.size.height,this.prop.hFov=this.dataHelper.vFovToHFov(this.prop.vFov),this.trigger(f.SIZE_UPDATED,this.getSize()),this.__resizeRefresh())},n.setPanorama=function(t,e){var o,i=this;void 0===e&&(e={}),this.textureLoader.abortLoading(),null==(o=this.prop.transitionAnimation)||o.cancel(),this.prop.ready||["sphereCorrection","panoData","overlay","overlayOpacity"].forEach((function(t){t in e||(e[t]=i.config[t])})),void 0!==e.transition&&!0!==e.transition||(e.transition=1500),void 0===e.showLoader&&(e.showLoader=!0),void 0===e.caption&&(e.caption=this.config.caption),void 0===e.description&&(e.description=this.config.description),e.panoData||"function"!=typeof this.config.panoData||(e.panoData=this.config.panoData);var n=J(e),r="zoom"in e;(n||r)&&this.__stopAll(),this.hideError(),this.config.panorama=t,this.config.caption=e.caption,this.config.description=e.description;var s=function(t){if(i.loader.hide(),i.prop.loadingPromise=null,Q(t))return!1;if(t)throw i.navbar.setCaption(""),i.showError(i.config.lang.loadError),console.error(t),t;return i.resetIdleTimer(),i.setOverlay(e.overlay,e.overlayOpacity),i.navbar.setCaption(i.config.caption),!0};this.navbar.setCaption(""+(this.config.loadingTxt||"")+""),!e.showLoader&&this.prop.ready||this.loader.show();var a=this.adapter.loadTexture(this.config.panorama,e.panoData).then((function(t){if(t.panorama!==i.config.panorama)throw i.adapter.disposeTexture(t),K();return t}));return e.transition&&this.prop.ready&&this.adapter.supportsTransition(this.config.panorama)?this.prop.loadingPromise=a.then((function(t){return i.loader.hide(),i.prop.transitionAnimation=i.renderer.transition(t,e),i.prop.transitionAnimation})).then((function(t){if(i.prop.transitionAnimation=null,!t)throw K()})).then(s,s):this.prop.loadingPromise=a.then((function(t){i.renderer.show(),i.renderer.setTexture(t),i.renderer.setPanoramaPose(t.panoData),i.renderer.setSphereCorrection(e.sphereCorrection),r&&i.zoom(e.zoom),n&&i.rotate(e)})).then(s,s),this.prop.loadingPromise},n.setOverlay=function(t,e){var o=this;return void 0===e&&(e=1),this.adapter.constructor.supportsOverlay?t?this.adapter.loadTexture(t,(function(t){var e=o.prop.panoData,i=t.width/e.croppedWidth;return{fullWidth:i*e.fullWidth,fullHeight:i*e.fullHeight,croppedWidth:i*e.croppedWidth,croppedHeight:i*e.croppedHeight,croppedX:i*e.croppedX,croppedY:i*e.croppedY}}),!1).then((function(t){o.renderer.setOverlay(t,e)})):(this.renderer.setOverlay(null,0),Promise.resolve()):Promise.reject(new i(this.adapter.constructor.id+" adapter does not supports overlay"))},n.setOptions=function(t){var e=this,o=a({},this.config,t);Z(t,(function(t,n){if(Vt[n])$(Vt[n]);else{if(!Object.prototype.hasOwnProperty.call(zt,n))throw new i("Unknown option "+n);if(Ft[n])throw new i(Ft[n]);switch(Wt[n]?e.config[n]=Wt[n](t,o):e.config[n]=t,n){case"overlay":case"overlayOpacity":e.setOverlay(e.config.overlay,e.config.overlayOpacity);break;case"caption":case"description":e.navbar.setCaption(e.config.caption);break;case"size":e.resize(t);break;case"sphereCorrection":e.renderer.setSphereCorrection(t);break;case"navbar":case"lang":e.navbar.setButtons(e.config.navbar);break;case"moveSpeed":case"zoomSpeed":e.__updateSpeeds();break;case"minFov":case"maxFov":e.dynamics.zoom.setValue(e.dataHelper.fovToZoomLevel(e.prop.vFov)),e.trigger(f.ZOOM_UPDATED,e.getZoomLevel());break;case"canvasBackground":e.renderer.canvasContainer.style.background=e.config.canvasBackground;break;case"autorotateIdle":e.resetIdleTimer()}}})),this.needsUpdate(),this.refreshUi("set options"),this.trigger(f.CONFIG_CHANGED,Object.keys(t))},n.setOption=function(t,e){var o;this.setOptions(((o={})[t]=e,o))},n.resetIdleTimer=function(){this.prop.idleTime=this.config.autorotateIdle?performance.now():-1},n.disableIdleTimer=function(){this.prop.idleTime=-1},n.startAutorotate=function(t){void 0===t&&(t=!1),t&&!this.isAutorotateEnabled()||!t&&this.isAutorotateEnabled()||(t||this.__stopAll(),this.dynamics.position.roll({longitude:this.config.autorotateSpeed<0},Math.abs(this.config.autorotateSpeed/this.config.moveSpeed)),this.dynamics.position.goto({latitude:this.config.autorotateLat},Math.abs(this.config.autorotateSpeed/this.config.moveSpeed)),this.prop.autorotateEnabled=!0,t||this.trigger(f.AUTOROTATE,!0))},n.stopAutorotate=function(){this.isAutorotateEnabled()&&(this.dynamics.position.stop(),this.prop.autorotateEnabled=!1,this.trigger(f.AUTOROTATE,!1))},n.toggleAutorotate=function(){this.isAutorotateEnabled()?this.stopAutorotate():this.startAutorotate()},n.showError=function(t){this.overlay.show({id:_.ERROR,image:'\x3c!--Created by Shastry from the Noun Project--\x3e\n',text:t,dissmisable:!1})},n.hideError=function(){this.overlay.hide(_.ERROR)},n.rotate=function(t){if(!this.trigger(f.BEFORE_ROTATE,t).isDefaultPrevented()){var e=this.change(m.GET_ROTATE_POSITION,this.dataHelper.cleanPosition(t));this.dynamics.position.setValue(e)}},n.animate=function(t){var e=this;this.__stopAll();var o,i=J(t),n="zoom"in t,r={};if(i){var s=this.change(m.GET_ANIMATE_POSITION,this.dataHelper.cleanPosition(t)),a=this.getPosition(),c=U(a.longitude,s.longitude);r.longitude={start:a.longitude,end:a.longitude+c},r.latitude={start:a.latitude,end:s.latitude},o=this.dataHelper.speedToDuration(t.speed,H(a,s))}if(n){var h=Math.abs(t.zoom-this.getZoomLevel());r.zoom={start:this.getZoomLevel(),end:t.zoom},o||(o=this.dataHelper.speedToDuration(t.speed,Math.PI/4*h/100))}return o?(this.prop.animationPromise=new pt({properties:r,duration:o,easing:"inOutSine",onTick:function(t){i&&e.rotate(t),n&&e.zoom(t.zoom)}}),this.prop.animationPromise.then((function(){e.prop.animationPromise=null,e.resetIdleTimer()})),this.prop.animationPromise):(i&&this.rotate(t),n&&this.zoom(t.zoom),new pt)},n.stopAnimation=function(){var t=this;return this.prop.animationPromise?new Promise((function(e){t.prop.animationPromise.then(e),t.prop.animationPromise.cancel(),t.prop.animationPromise=null})):Promise.resolve()},n.zoom=function(t){this.dynamics.zoom.setValue(t)},n.zoomIn=function(t){void 0===t&&(t=1),this.dynamics.zoom.step(t)},n.zoomOut=function(t){void 0===t&&(t=1),this.dynamics.zoom.step(-t)},n.resize=function(t){var e=this;["width","height"].forEach((function(o){t&&t[o]&&(/^[0-9.]+$/.test(t[o])&&(t[o]+="px"),e.parent.style[o]=t[o])})),this.autoSize()},n.enterFullscreen=function(){b.fullscreenEvent?I(this.container):(this.container.classList.add("psv-container--fullscreen"),this.autoSize(),this.eventsHandler.__fullscreenToggled(!0))},n.exitFullscreen=function(){this.isFullscreenEnabled()&&(b.fullscreenEvent?S():(this.container.classList.remove("psv-container--fullscreen"),this.autoSize(),this.eventsHandler.__fullscreenToggled(!1)))},n.toggleFullscreen=function(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()},n.startKeyboardControl=function(){this.eventsHandler.enableKeyboard()},n.stopKeyboardControl=function(){this.eventsHandler.disableKeyboard()},n.observeObjects=function(t,e){var o=this;return this.prop.objectsObservers[t]={listener:e},function(){delete o.prop.objectsObservers[t]}},n.__stopAll=function(){return this.trigger(f.STOP_ALL),this.disableIdleTimer(),this.stopAutorotate(),this.stopAnimation()},n.__updateSpeeds=function(){this.dynamics.zoom.setSpeed(50*this.config.zoomSpeed),this.dynamics.position.setSpeed(e.MathUtils.degToRad(50*this.config.moveSpeed))},o}(o.EventEmitter);t.AbstractAdapter=n,t.AbstractButton=_t,t.AbstractComponent=gt,t.AbstractPlugin=Ht,t.Animation=pt,t.CONSTANTS=E,t.DEFAULTS=zt,t.EquirectangularAdapter=mt,t.PSVError=i,t.SYSTEM=b,t.Viewer=ue,t.registerButton=Xt,t.utils=ft,Object.defineProperty(t,"__esModule",{value:!0})})); -//# sourceMappingURL=/sm/3711cd16151c12d984aa9d8c7a6d39223b65090654f0d64937f0d9c4005b15a8.map \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 66da254..3c0e452 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ use anyhow::{anyhow, bail, Result}; use clap::{Arg, Command}; use log::info; use native_dialog::{FileDialog, MessageDialog}; -use rand::distributions::{DistString}; +use rand::distributions::DistString; use rust_embed::RustEmbed; use simplelog::{ColorChoice, ConfigBuilder, LevelFilter, TermLogger, TerminalMode}; use std::{borrow::Cow, path::PathBuf, thread::JoinHandle};