@3dweb/360javascriptviewer 1.8.40 → 1.8.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ /*! For license information please see JavascriptViewer.esm.js.LICENSE.txt */
2
+ var t={83:t=>{var e=1/0,n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,s=Object.prototype.toString;function l(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=function(t){return function(t,c){var h;if("function"!=typeof c)throw new TypeError("Expected a function");return t=function(t){var c=function(t){return t?(t=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==s.call(t)}(t))return NaN;if(l(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=l(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var c=r.test(t);return c||o.test(t)?a(t.slice(2),c?2:8):i.test(t)?NaN:+t}(t))===e||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}(t),h=c%1;return c==c?h?c-h:c:0}(t),function(){return--t>0&&(h=c.apply(this,arguments)),t<=1&&(c=void 0),h}}(2,t)}},982:(t,e,n)=>{var i=n(699);t.exports=function(t){var e,n,r,o;if(e=/^((?:rgb|hs[lv]|cmyk|xyz|lab)a?)\s*\(([^\)]*)\)/.exec(t)){var a=e[1],s="cmyk"===(l=a.replace(/a$/,""))?4:3;n=i[l],r=e[2].replace(/^\s+|\s+$/g,"").split(/\s*,\s*/).map((function(t,e){return/%$/.test(t)&&e===s?parseFloat(t)/100:(/%$/.test(t),parseFloat(t))})),a===l&&r.push(1),o=void 0===r[s]?1:r[s],r=r.slice(0,s),n[l]=function(){return r}}else if(/^#[A-Fa-f0-9]+$/.test(t)){var l;s=(l=t.replace(/^#/,"")).length,n=i.rgb,r=(r=l.split(3===s?/(.)/:/(..)/)).filter(Boolean).map((function(t){return 3===s?parseInt(t+t,16):parseInt(t,16)})),o=1,n.rgb=function(){return r},r[0]||(r[0]=0),r[1]||(r[1]=0),r[2]||(r[2]=0)}else(n=i.keyword).keyword=function(){return t},r=t,o=1;var c={rgb:void 0,hsl:void 0,hsv:void 0,cmyk:void 0,keyword:void 0,hex:void 0};try{c.rgb=n.rgb(r)}catch(t){}try{c.hsl=n.hsl(r)}catch(t){}try{c.hsv=n.hsv(r)}catch(t){}try{c.cmyk=n.cmyk(r)}catch(t){}try{c.keyword=n.keyword(r)}catch(t){}return c.rgb&&(c.hex="#"+c.rgb.map((function(t){var e=t.toString(16);return 1===e.length?"0"+e:e})).join("")),c.rgb&&(c.rgba=c.rgb.concat(o)),c.hsl&&(c.hsla=c.hsl.concat(o)),c.hsv&&(c.hsva=c.hsv.concat(o)),c.cmyk&&(c.cmyka=c.cmyk.concat(o)),c}},2:t=>{function e(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a;return s==a?e=0:i==s?e=(r-o)/l:r==s?e=2+(o-i)/l:o==s&&(e=4+(i-r)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(a+s)/2,[e,100*(s==a?0:n<=.5?l/(s+a):l/(2-s-a)),100*n]}function n(t){var e,n,i=t[0],r=t[1],o=t[2],a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a;return n=0==s?0:l/s*1e3/10,s==a?e=0:i==s?e=(r-o)/l:r==s?e=2+(o-i)/l:o==s&&(e=4+(i-r)/l),(e=Math.min(60*e,360))<0&&(e+=360),[e,n,s/255*1e3/10]}function i(t){var n=t[0],i=t[1],r=t[2];return[e(t)[0],1/255*Math.min(n,Math.min(i,r))*100,100*(r=1-1/255*Math.max(n,Math.max(i,r)))]}function o(t){var e,n=t[0]/255,i=t[1]/255,r=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-r)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-r-e)/(1-e)||0),100*e]}function a(t){return E[JSON.stringify(t)]}function s(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]}function l(t){var e=s(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]}function c(t){var e,n,i,r,o,a=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return[o=255*l,o,o];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),r=[0,0,0];for(var c=0;c<3;c++)(i=a+1/3*-(c-1))<0&&i++,i>1&&i--,o=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,r[c]=255*o;return r}function h(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,r=Math.floor(e)%6,o=e-Math.floor(e),a=255*i*(1-n),s=255*i*(1-n*o),l=255*i*(1-n*(1-o));switch(i*=255,r){case 0:return[i,l,a];case 1:return[s,i,a];case 2:return[a,i,l];case 3:return[a,s,i];case 4:return[l,a,i];case 5:return[i,a,s]}}function u(t){var e,n,i,o,a=t[0]/360,s=t[1]/100,l=t[2]/100,c=s+l;switch(c>1&&(s/=c,l/=c),i=6*a-(e=Math.floor(6*a)),1&e&&(i=1-i),o=s+i*((n=1-l)-s),e){default:case 6:case 0:r=n,g=o,b=s;break;case 1:r=o,g=n,b=s;break;case 2:r=s,g=n,b=o;break;case 3:r=s,g=o,b=n;break;case 4:r=o,g=s,b=n;break;case 5:r=n,g=s,b=o}return[255*r,255*g,255*b]}function d(t){var e=t[0]/100,n=t[1]/100,i=t[2]/100,r=t[3]/100;return[255*(1-Math.min(1,e*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r)),255*(1-Math.min(1,i*(1-r)+r))]}function m(t){var e,n,i,r=t[0]/100,o=t[1]/100,a=t[2]/100;return n=-.9689*r+1.8758*o+.0415*a,i=.0557*r+-.204*o+1.057*a,e=(e=3.2406*r+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]}function f(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]}function p(t){var e,n,i,r,o=t[0],a=t[1],s=t[2];return o<=8?r=(n=100*o/903.3)/100*7.787+16/116:(n=100*Math.pow((o+16)/116,3),r=Math.pow(n/100,1/3)),[e=e/95.047<=.008856?e=95.047*(a/500+r-16/116)/7.787:95.047*Math.pow(a/500+r,3),n,i=i/108.883<=.008859?i=108.883*(r-s/200-16/116)/7.787:108.883*Math.pow(r-s/200,3)]}function v(t){var e,n=t[0],i=t[1],r=t[2];return(e=360*Math.atan2(r,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+r*r),e]}function y(t){return m(p(t))}function w(t){var e,n=t[0],i=t[1];return e=t[2]/360*2*Math.PI,[n,i*Math.cos(e),i*Math.sin(e)]}function x(t){return R[t]}t.exports={rgb2hsl:e,rgb2hsv:n,rgb2hwb:i,rgb2cmyk:o,rgb2keyword:a,rgb2xyz:s,rgb2lab:l,rgb2lch:function(t){return v(l(t))},hsl2rgb:c,hsl2hsv:function(t){var e=t[0],n=t[1]/100,i=t[2]/100;return 0===i?[0,0,0]:[e,2*(n*=(i*=2)<=1?i:2-i)/(i+n)*100,(i+n)/2*100]},hsl2hwb:function(t){return i(c(t))},hsl2cmyk:function(t){return o(c(t))},hsl2keyword:function(t){return a(c(t))},hsv2rgb:h,hsv2hsl:function(t){var e,n,i=t[0],r=t[1]/100,o=t[2]/100;return e=r*o,[i,100*(e=(e/=(n=(2-r)*o)<=1?n:2-n)||0),100*(n/=2)]},hsv2hwb:function(t){return i(h(t))},hsv2cmyk:function(t){return o(h(t))},hsv2keyword:function(t){return a(h(t))},hwb2rgb:u,hwb2hsl:function(t){return e(u(t))},hwb2hsv:function(t){return n(u(t))},hwb2cmyk:function(t){return o(u(t))},hwb2keyword:function(t){return a(u(t))},cmyk2rgb:d,cmyk2hsl:function(t){return e(d(t))},cmyk2hsv:function(t){return n(d(t))},cmyk2hwb:function(t){return i(d(t))},cmyk2keyword:function(t){return a(d(t))},keyword2rgb:x,keyword2hsl:function(t){return e(x(t))},keyword2hsv:function(t){return n(x(t))},keyword2hwb:function(t){return i(x(t))},keyword2cmyk:function(t){return o(x(t))},keyword2lab:function(t){return l(x(t))},keyword2xyz:function(t){return s(x(t))},xyz2rgb:m,xyz2lab:f,xyz2lch:function(t){return v(f(t))},lab2xyz:p,lab2rgb:y,lab2lch:v,lch2lab:w,lch2xyz:function(t){return p(w(t))},lch2rgb:function(t){return y(w(t))}};var R={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},E={};for(var I in R)E[JSON.stringify(R[I])]=I},699:(t,e,n)=>{var i=n(2),r=function(){return new c};for(var o in i){r[o+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),i[t](e)}}(o);var a=/(\w+)2(\w+)/.exec(o),s=a[1],l=a[2];(r[s]=r[s]||{})[l]=r[o]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var n=i[t](e);if("string"==typeof n||void 0===n)return n;for(var r=0;r<n.length;r++)n[r]=Math.round(n[r]);return n}}(o)}var c=function(){this.convs={}};c.prototype.routeSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n))},c.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},c.prototype.getValues=function(t){var e=this.convs[t];if(!e){var n=this.space,i=this.convs[n];e=r[n][t](i),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach((function(t){c.prototype[t]=function(e){return this.routeSpace(t,arguments)}})),t.exports=r},569:t=>{t.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),a=n(2),s=function(){throw new Error("Slot not connected")};e.defaultSlotConfig={noBuffer:!1};var l=function(t,e){return Object.keys(e).reduce((function(n,i){return n.concat(e[i][t]||[])}),[])},c=function(t){return Object.keys(t).reduce((function(e,n){var i=t[n],o=Object.keys(i).filter((function(t){return(i[t]||[]).length>0})),a=[].concat(r(e),r(o));return[].concat(r(new Set(a)))}),[])};e.slot=function(){return function(t){return Object.assign((function(){return s()}),{config:t,lazy:function(){return s},on:function(){return s},slotName:"Not connected"})}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.defaultSlotConfig)},e.connectSlot=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=e.reduce((function(t,e,n){return Object.assign({},t,i({},n,{}))}),i({},"LOCAL_TRANSPORT",{})),h=e.reduce((function(t,e,n){return Object.assign({},t,i({},n,{}))}),{}),u=function(t,e){var n=function(){},i=new Promise((function(t){return n=t}));h[t][e]={registered:i,onRegister:n}},d=[],g=[],m=function(t){return d.forEach((function(e){return e(t)}))},f=function(t){return g.forEach((function(e){return e(t)}))};return e.forEach((function(e,n){e.addRemoteHandlerRegistrationCallback(t,(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.DEFAULT_PARAM,e=arguments[1],i=s[n][t]||[];s[n][t]=i.concat(e),1===l(t,s).length&&m(t),h[n][t]||u(String(n),t),h[n][t].onRegister()})),e.addRemoteHandlerUnregistrationCallback(t,(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.DEFAULT_PARAM,e=arguments[1],i=(s[n][t]||[]).indexOf(e);i>-1&&s[n][t].splice(i,1),0===l(t,s).length&&f(t),u(String(n),t)}))})),Object.assign((function(t,i){var c=2===arguments.length,d=c?i:t,g=c?t:a.DEFAULT_PARAM;if(n.noBuffer||0===e.length){var m=l(g,s);return o.callHandlers(d,m)}e.forEach((function(t,e){h[e][g]||u(String(e),g)}));var f=e.reduce((function(t,e,n){return[].concat(r(t),[h[n][g].registered])}),[]);return Promise.all(f).then((function(){var t=l(g,s);return o.callHandlers(d,t)}))}),{on:function(n,i){var r="",o=function(){return new Promise((function(t){return t()}))};return"string"==typeof n?(r=n,o=i||o):(r=a.DEFAULT_PARAM,o=n),e.forEach((function(e){return e.registerHandler(t,r,o)})),s.LOCAL_TRANSPORT[r]=(s.LOCAL_TRANSPORT[r]||[]).concat(o),1===l(r,s).length&&m(r),function(){e.forEach((function(e){return e.unregisterHandler(t,r,o)}));var n=(s.LOCAL_TRANSPORT[r]||[]).indexOf(o);-1!==n&&s.LOCAL_TRANSPORT[r].splice(n,1),0===l(r,s).length&&f(r)}},lazy:function(t,e){return d.push(t),g.push(e),c(s).forEach(t),function(){c(s).forEach(e);var n=d.indexOf(t);n>-1&&d.splice(n,1);var i=g.indexOf(e);i>-1&&g.splice(i,1)}},config:n,slotName:t})}},function(t,e,n){function i(t,e){var n=null;try{n=t(e)}catch(t){return Promise.reject(t)}return n&&n.then?n:Promise.resolve(n)}Object.defineProperty(e,"__esModule",{value:!0}),e.callHandlers=function(t,e){return e&&0!==e.length?1===e.length?i(e[0],t):Promise.all(e.map((function(e){return i(e,t)}))):new Promise((function(t){}))}},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_PARAM="$_DEFAULT_$"},function(t,e,n){var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e3;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this._timeout=e,this._onMessageCallbacks=[],this._onConnectCallbacks=[],this._onDisconnectCallbacks=[],this._onErrorCallbacks=[],this._ready=!1}return i(t,[{key:"onData",value:function(t){-1===this._onMessageCallbacks.indexOf(t)&&this._onMessageCallbacks.push(t)}},{key:"onConnect",value:function(t){this._ready&&t(),this._onConnectCallbacks.push(t)}},{key:"onDisconnect",value:function(t){this._onDisconnectCallbacks.push(t)}},{key:"onError",value:function(t){this._onErrorCallbacks.push(t)}},{key:"_messageReceived",value:function(t){this._onMessageCallbacks.forEach((function(e){return e(t)}))}},{key:"_error",value:function(t){this._onErrorCallbacks.forEach((function(e){return e(t)}))}},{key:"_connected",value:function(){this._ready=!0,this._onConnectCallbacks.forEach((function(t){return t()}))}},{key:"_disconnected",value:function(){this._ready=!1,this._onDisconnectCallbacks.forEach((function(t){return t()}))}},{key:"timeout",get:function(){return this._timeout}}]),t}();e.GenericChannel=r},function(t,e,n){t.exports=n(5)},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var i=n(0);e.slot=i.slot;var r=n(6);e.combineEvents=r.combineEvents,e.createEventBus=r.createEventBus;var o=n(3);e.GenericChannel=o.GenericChannel;var a=n(8);e.ChunkedChannel=a.ChunkedChannel;var s=n(2);e.DEFAULT_PARAM=s.DEFAULT_PARAM},function(t,e,n){function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(7);e.combineEvents=function(t,e,n,r,o,a,s,l,c,h,u,d,g,m,f,p,v,y,b,w,x,R,E,I){var k=Array.from(arguments),C=k.reduce((function(t,e){return[].concat(i(t),i(Object.keys(e)))}),[]),S=[].concat(i(new Set(C)));if(C.length>S.length)throw new Error("ts-event-bus: duplicate slots encountered in combineEvents.");return Object.assign.apply(Object,[{}].concat(i(k)))},e.createEventBus=function(t){var e=(t.channels||[]).map((function(t){return new o.Transport(t)}));return Object.keys(t.events).reduce((function(n,i){var o=t.events[i].config;return n[i]=r.connectSlot(i,e,o),n}),{})}},function(t,e,n){var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=0,a=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._channel=e,this._localHandlers={},this._localHandlerRegistrations={},this._remoteHandlers={},this._remoteHandlerRegistrationCallbacks={},this._remoteHandlerDeletionCallbacks={},this._pendingRequests={},this._channelReady=!1,this._channel.onData((function(t){switch(t.type){case"request":return n._requestReceived(t);case"response":return n._responseReceived(t);case"handler_registered":return n._registerRemoteHandler(t);case"handler_unregistered":return n._unregisterRemoteHandler(t);case"error":return n._errorReceived(t);default:!function(t){throw new Error("Should not happen: "+t)}(t)}})),this._channel.onConnect((function(){n._channelReady=!0,Object.keys(n._localHandlerRegistrations).forEach((function(t){n._localHandlerRegistrations[t].forEach((function(t){n._channel.send(t)}))}))})),this._channel.onDisconnect((function(){n._channelReady=!1,n._unregisterAllRemoteHandlers(),n._rejectAllPendingRequests(new Error("REMOTE_CONNECTION_CLOSED"))})),this._channel.onError((function(t){return n._rejectAllPendingRequests(t)}))}return i(t,[{key:"_requestReceived",value:function(t){var e=this,n=t.slotName,i=t.data,o=t.id,a=t.param,s=this._localHandlers[n];if(s){var l=s[a];l&&r.callHandlers(i,l).then((function(t){return e._channel.send({type:"response",slotName:n,id:o,data:t,param:a})})).catch((function(t){return e._channel.send({id:o,message:""+t,param:a,slotName:n,stack:t.stack||"",type:"error"})}))}}},{key:"_responseReceived",value:function(t){var e=t.slotName,n=t.data,i=t.id,r=t.param,o=this._pendingRequests[e];o&&o[r]&&o[r][i]&&(o[r][i].resolve(n),delete o[r][i])}},{key:"_errorReceived",value:function(t){var e=t.slotName,n=t.id,i=t.message,r=t.stack,o=t.param,a=this._pendingRequests[e];if(a&&a[o]&&a[o][n]){var s=new Error(i+" on "+e+" with param "+o);s.stack=r||s.stack,this._pendingRequests[e][o][n].reject(s),delete this._pendingRequests[e][o][n]}}},{key:"_registerRemoteHandler",value:function(t){var e=this,n=t.slotName,i=t.param,r=this._remoteHandlerRegistrationCallbacks[n];if(r){var a=this._remoteHandlers[n];if(!a||!a[i]){var s=function(t){return new Promise((function(r,a){if(!e._channelReady)return a(new Error("CHANNEL_NOT_READY on "+n));var s=""+o++;e._pendingRequests[n]=e._pendingRequests[n]||{},e._pendingRequests[n][i]=e._pendingRequests[n][i]||{},e._pendingRequests[n][i][s]={resolve:r,reject:a},e._channel.send({type:"request",id:s,slotName:n,param:i,data:t}),setTimeout((function(){var t=((e._pendingRequests[n]||{})[i]||{})[s];if(t){var r=new Error("TIMED_OUT on "+n+" with param "+i);t.reject(r),delete e._pendingRequests[n][i][s]}}),e._channel.timeout)}))};this._remoteHandlers[n]=this._remoteHandlers[n]||{},this._remoteHandlers[n][i]=s,r(i,s)}}}},{key:"_unregisterRemoteHandler",value:function(t){var e=t.slotName,n=t.param,i=this._remoteHandlerDeletionCallbacks[e],r=this._remoteHandlers[e];if(r){var o=r[n];o&&i&&(i(n,o),delete this._remoteHandlers[e][n])}}},{key:"_unregisterAllRemoteHandlers",value:function(){var t=this;Object.keys(this._remoteHandlerDeletionCallbacks).forEach((function(e){var n=t._remoteHandlers[e];n&&Object.keys(n).filter((function(t){return n[t]})).forEach((function(n){return t._unregisterRemoteHandler({slotName:e,param:n})}))}))}},{key:"_rejectAllPendingRequests",value:function(t){var e=this;Object.keys(this._pendingRequests).forEach((function(n){Object.keys(e._pendingRequests[n]).forEach((function(i){Object.keys(e._pendingRequests[n][i]).forEach((function(r){e._pendingRequests[n][i][r].reject(t)}))})),e._pendingRequests[n]={}}))}},{key:"addRemoteHandlerRegistrationCallback",value:function(t,e){this._remoteHandlerRegistrationCallbacks[t]||(this._remoteHandlerRegistrationCallbacks[t]=e)}},{key:"addRemoteHandlerUnregistrationCallback",value:function(t,e){this._remoteHandlerDeletionCallbacks[t]||(this._remoteHandlerDeletionCallbacks[t]=e)}},{key:"registerHandler",value:function(t,e,n){if(this._localHandlers[t]=this._localHandlers[t]||{},this._localHandlers[t][e]=this._localHandlers[t][e]||[],this._localHandlers[t][e].push(n),1===this._localHandlers[t][e].length){var i={type:"handler_registered",param:e,slotName:t};this._localHandlerRegistrations[e]=this._localHandlerRegistrations[e]||[],this._localHandlerRegistrations[e].push(i),this._channelReady&&this._channel.send(i)}}},{key:"unregisterHandler",value:function(t,e,n){var i=this._localHandlers[t];if(i&&i[e]){var r=i[e].indexOf(n);if(r>-1&&(i[e].splice(r,1),0===i[e].length)){var o={type:"handler_unregistered",param:e,slotName:t};this._channelReady&&this._channel.send(o)}}}}]),t}();e.Transport=a},function(t,e,n){var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0};Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),a=n(9),s=function(t){if(!t.chunkId)throw new Error("ChunkedMessage did not have a chunkId: "+JSON.stringify(t))},l=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.timeout));return n._buffer={},n._chunkSize=t.chunkSize,n._sender=t.sender,n._maxStringAlloc=t.maxStringAlloc||-1,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{key:"send",value:function(t){var e=this,n=JSON.stringify(t);if(n.length<=this._chunkSize)this._sender(t);else{var i=function(t){for(var e=new Uint16Array(t.length),n=0,i=t.length;n<i;n++)e[n]=t.charCodeAt(n);return e}(n),r=[].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}(Array(30))).map((function(){return Math.random().toString(36)[3]})).join("");this._sender({type:"chunk_start",chunkId:r,size:n.length}),function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=i.slice(n,n+e._chunkSize);o.length&&(e._sender({type:"chunk_data",chunkId:r,data:Array.from(o)}),t(n+e._chunkSize))}(),this._sender({type:"chunk_end",chunkId:r})}}},{key:"_messageReceived",value:function(t){switch(t.type){case"chunk_start":this._receiveNewChunk(t);break;case"chunk_data":this._receiveChunkData(t);break;case"chunk_end":var n=this._mergeChunks(t);r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_messageReceived",this).call(this,n);break;default:r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_messageReceived",this).call(this,t)}}},{key:"_receiveNewChunk",value:function(t){if(s(t),this._buffer[t.chunkId])throw new Error("There was already an entry in the buffer for chunkId "+t.chunkId);this._buffer[t.chunkId]={id:t.chunkId,chunks:[],size:t.size}}},{key:"_receiveChunkData",value:function(t){if(s(t),!this._buffer[t.chunkId])throw new Error("ChunkId "+t.chunkId+" was not found in the buffer");this._buffer[t.chunkId].chunks.push(t.data)}},{key:"_mergeChunks",value:function(t){if(s(t),!this._buffer[t.chunkId])throw new Error("ChunkId "+t.chunkId+" was not found in the buffer");var e=this._buffer[t.chunkId].chunks.reduce((function(t,e,n){return e.forEach((function(e,n){return t.uintArray[t.currentIx+n]=e})),t.currentIx+=e.length,t}),{uintArray:new Uint16Array(this._buffer[t.chunkId].size),currentIx:0}),n=void 0,i=function(t,e){if(-1===e)return String.fromCharCode.apply(null,t);for(var n="",i=0;i<t.length;i+=e)i+e>t.length?n+=String.fromCharCode.apply(null,t.subarray(i)):n+=String.fromCharCode.apply(null,t.subarray(i,i+e));return n}(e.uintArray,this._maxStringAlloc);try{n=JSON.parse(i)}catch(t){throw new Error("Not a valid JSON string: "+i)}if(!a.isTransportMessage(n))throw new Error("Not a transport message: "+JSON.stringify(n));return n}}]),e}(o.GenericChannel);e.ChunkedChannel=l},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.isTransportMessage=function(t){switch(t.type){case"request":case"response":case"error":case"handler_unregistered":case"handler_registered":return!0;default:return!1}}}])}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var i={};(()=>{n.d(i,{q:()=>ht,P:()=>ct});class t extends Error{constructor(t){super(t+=" check the documentation at https://www.360-javascriptviewer.com/installation"),this.name="360 Javascript Viewer InputError"}}const e=t;var r=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};var o=n(83),a=n.n(o),s=a()((function(){var t=[];return"undefined"!=typeof window&&(window.navigator.languages&&(t=t.concat(window.navigator.languages)),window.navigator.language&&t.push(window.navigator.language),window.navigator.userLanguage&&t.push(window.navigator.userLanguage),window.navigator.browserLanguage&&t.push(window.navigator.browserLanguage),window.navigator.systemLanguage&&t.push(window.navigator.systemLanguage)),t.push("en-US"),t.filter((function(t,e,n){return n.indexOf(t)===e})).map((function(t){if(!t||-1===t.indexOf("-")||t.toLowerCase()!==t)return t;var e=t.split("-");return"".concat(e[0],"-").concat(e[1].toUpperCase())}))})),l=a()((function(){return s()[0]}));const c=JSON.parse('{"P":[{"language":"en","dragToRotate":"Drag To Rotate"},{"language":"nl","dragToRotate":"Sleep Voor Roteren"},{"language":"es","dragToRotate":"arrastrar para rotar"},{"language":"ru","dragToRotate":"перетащите, чтобы повернуть"},{"language":"fr","dragToRotate":"faire glisser pour faire pivoter"},{"language":"ch","dragToRotate":"拖动旋转"},{"language":"it","dragToRotate":"trascina per ruotare"},{"language":"de","dragToRotate":"zum Drehen ziehen"},{"language":"ko","dragToRotate":"드래그하여 회전"},{"language":"pt","dragToRotate":"arraste para girar"}]}');class h{static getDragToRotate(t){const e=l();for(const n of t.dragToRotate.languages)if(n.language===e)return n.text;let n=this.getTranslation(e);return null===n&&(n=this.getTranslation("en")),null==n?void 0:n.dragToRotate}static getTranslation(t){for(const e of c.P)if(e.language===t)return e;const e=t.split("-").shift();for(const t of c.P)if(t.language===e)return t;return null}}var u=n(982);function d(t){return function(t,e){const n=e[0]-t[0],i=e[1]-t[1],r=Math.atan2(i,n);return r>=0?r:r+2*Math.PI}([t[0].clientX,t[0].clientY],[t[1].clientX,t[1].clientY])/Math.PI*180}function g(t,e,n,i){const r=w(t),o=w(e),a=w(i);return f(x(i[0],R(r,a)),x(i[0],R(o,a)),n[0])}function m(t){return t.touches?y(t.touches):[b(t)]}function f(t,e,n){const{clientX:i,clientY:r}=t,{clientX:o,clientY:a}=e,{clientX:s,clientY:l}=n;return{clientX:i,clientY:r,deltaX:i-o,deltaY:r-a,distX:i-s,distY:r-l}}function p(t){return Math.sqrt(Math.pow(t[0].clientX-t[1].clientX,2)+Math.pow(t[0].clientY-t[1].clientY,2))}function v(t,e,n){return t.map(((t,i)=>f(t,e[i],n[i])))}function y(t){const e=Math.min(t.length,2),n=[];for(let i=0;i<e;++i)n.push(b(t[i]));return n}function b(t){return{clientX:t.clientX,clientY:t.clientY}}function w(t){return 1===t.length?t[0]:{clientX:(t[0].clientX+t[1].clientX)/2,clientY:(t[0].clientY+t[1].clientY)/2}}function x(t,e){return{clientX:t.clientX+e.clientX,clientY:t.clientY+e.clientY}}function R(t,e){return{clientX:t.clientX-e.clientX,clientY:t.clientY-e.clientY}}function E(t,e,n,i){t.addEventListener(e,n,i)}function I(t,e,n){t.removeEventListener(e,n)}function k(){return Date.now?Date.now():(new Date).getTime()}function C(t){const e=u(t);return e?{r:e.rgba[0],g:e.rgba[1],b:e.rgba[2],a:e.rgba[3]}:null}function S({objects:t}){const e=t=>t&&"object"==typeof t;return t.reduce(((t,n)=>(Object.keys(n).forEach((i=>{const r=t[i],o=n[i];Array.isArray(r)&&Array.isArray(o)?t[i]=r.concat(...o):e(r)&&e(o)?t[i]=S({objects:[r,o]}):t[i]=o})),t)),{})}class D{static getNotificationCustomImage(t){return`<img src="${t.dragToRotate.imageUrl}" class="jsv-notification" />`}static getReadyForRotate(t){return`<div style="display: flex; align-items: center; flex-direction: column;">\n${this.getSvg(t)} ${this.getText(t)}</div>`}static getPoweredBy(t,e){const n=this.getLogoSvg();let i=atob("aHR0cHM6Ly93d3cuMzYwLWphdmFzY3JpcHR2aWV3ZXIuY29t");return e&&e.length>0&&(i+=`?host=${e}`),`<div style="display: flex; align-items: center; flex-direction: column; width: 100%">\n <a title="${atob("QnV5IDM2MCBKYXZhc2NyaXB0IFZpZXdlciBsaWNlbnNl")}" target="_blank" href="${i}" style="opacity: 0.8;">\n ${n}\n </a>\n </div>`}static getMainColor(t){let e=C(t.dragToRotate.mainColor);return null===e&&(e={r:0,g:0,b:0,a:1}),e}static getTextColor(t){let e=C(t.dragToRotate.textColor);return null===e&&(e={r:0,g:0,b:0,a:1}),e}static getText(t){const e=h.getDragToRotate(t),n=this.getMainColor(t),i=this.getTextColor(t);return`<div style="text-align: center; font-size: 12px; padding:0.2em 0.5em; white-space: nowrap; color: rgba(${i.r}, ${i.g}, ${i.b});\n background-color: rgba(${n.r}, ${n.g}, ${n.b}, ${n.a}); border-radius: 0.5em;">\n<span>${e}</span>\n</div>`}static getLogoSvg(){return'<svg preserveAspectRatio="xMaxYMid meet" xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><path d="M14.9.2c4.1 0 7.7 1.6 10.4 4.3s4.3 6.3 4.3 10.4-1.6 7.7-4.3 10.4-6.3 4.3-10.4 4.3S7.2 28 4.5 25.3.2 19 .2 14.9 1.9 7.2 4.5 4.5 10.9.2 14.9.2zm9.5 5.3c-2.4-2.5-5.8-4-9.5-4s-7 1.5-9.4 4-3.9 5.8-3.9 9.5 1.5 7 3.9 9.5 5.8 3.9 9.5 3.9 7-1.5 9.5-3.9 3.9-5.8 3.9-9.5-1.6-7.1-4-9.5"/><path d="M25.3 21.8c-.3.9-1.7 2.2-2.6 2.9-5.4 4.3-12.8 3.6-17.3-1.6-1.6-1.8-3.1-5.2-2.9-7.6 1.2 1.3 4 2.2 5.7 2.7 5.5 1.6 14.1 1.7 19.1-2.7 0 .6-.6 1.7-1 2.3-2.9 3.9-8 5-12.5 4.7-2.8-.2-4-.8-4.8-.9 1.1.9 3.4 1.4 4.7 1.6l3 .3c6.1-.2 7.2-1.3 8.6-1.7" fill-rule="evenodd"/><path d="M4.6 12.5c3.6 1.6 5.8 2.1 9.9 1.8 2.5-.2 5.4-.9 7.9-2.3 3.2-2 2.6-3.6 2.8-4.4 3.1 5.8-6.3 10.1-10.9 10-4.9.1-7.5-.6-11.8-2.3-.1-1.7.4-4.3 1.1-5.8C6.8 3 14.7.7 20.5 3.6c1 .5 2.7 1.5 3.2 3 1.2 4.1-6.9 6.4-9.6 6.7-3.9.5-5.9 0-9.5-.8" fill="#c40005"/></svg>'}static getSvg(t){const e=this.getMainColor(t),n=this.getTextColor(t),i=`rgba(${e.r}, ${e.g}, ${e.b}, ${e.a})`,r=`rgba(${n.r}, ${n.g}, ${n.b}, ${n.a})`;return`<div style="max-width: 120px; width: 100%; padding: 5% 15%;">\n<svg viewBox="90.63 81.107 335.724 216.946" xmlns="http://www.w3.org/2000/svg">\n <defs>\n <clipPath id="clipPath26">\n <path d="m0 1872h2272v-1872h-2272z" id="path720"/>\n </clipPath>\n </defs>\n <g id="Layer_2">\n <g>\n <g transform="matrix(1, 0, 0, 1, 0, 31)">\n <circle fill-rule="evenodd" clip-rule="evenodd" cx="256" cy="185" r="175" fill="${i}" transform="matrix(0.959211, 0, 0, 0.619847, 12.934134, 43.908459)"/>\n <g id="g769" transform="matrix(11.198128, 0, 0, 11.248407, 83.541389, 67.014397)" style="">\n <g transform="matrix(0.025142, 0, 0, -0.022177, -12.123219, 30.249571)" clip-path="url(#clipPath26)" fill:"url(#linearGradient885)" id="g761" style="fill: url(#linearGradient885);">\n <g transform="translate(1368.2,787.12)" id="g731" style="fill:url(#linearGradient777)">\n <path d="m 0,0 -207.95,86.789 c -3.52,1.661 -7.664,1.32 -10.867,-0.892 -3.203,-2.217 -4.981,-5.974 -4.663,-9.859 l 3.925,-47.857 c -15.131,-0.383 -30.426,-0.563 -45.9,-0.484 -254.84,1.307 -467.33,61.883 -519.27,172.51 -1.861,-8.744 -2.841,-29.185 -2.887,-38.174 -0.735,-143.3 235.03,-260.67 526.59,-262.17 17.515,-0.089 34.825,0.254 51.899,0.996 l 4.434,-54.087 c 0.319,-3.883 2.685,-7.3 6.205,-8.967 3.521,-1.662 7.665,-1.322 10.869,0.891 l 189.15,142.47 c 3.203,2.219 4.98,5.975 4.662,9.86 -0.319,3.884 -2.685,7.301 -6.206,8.968" id="path729" style="fill:${r}; paint-order: stroke;"/>\n </g>\n <g transform="translate(1636.5,943.74)" id="g735" style="fill:url(#linearGradient781)">\n <path d="m 0,0 c 0.071,13.962 -2.169,39.231 -6.421,52.618 -28.864,-83.165 -148.3,-140.31 -310.08,-166.06 l 92.158,-36.446 c 3.622,-1.435 6.206,-4.691 6.778,-8.546 0.57,-3.855 -0.96,-7.72 -4.011,-10.142 l -81.037,-64.28 c 178.42,40.757 302.08,129.41 302.61,232.85" id="path733" style="fill:${n}; paint-order: stroke;"/>\n </g>\n <g transform="translate(749.04,1092.5)" id="g739" style="fill:url(#linearGradient785)">\n <path d="m 0,0 v 80.728 c -98.906,-34.704 -160.82,-83.963 -161.17,-138.88 -0.09,-14.262 4.092,-28.161 11.877,-41.572 12.635,48.038 67.386,67.816 149.29,99.722" id="path737" style="fill:${r} ; paint-order: stroke;"/>\n </g>\n <g transform="translate(1468.1,1090.1)" id="g743" style="fill:url(#linearGradient789)">\n <path d="m 0,0 c 75.974,-30.102 128.61,-46.357 145.87,-90.299 4.221,9.835 6.496,19.92 6.562,30.21 0.339,53.62 -58.025,102.36 -152.43,137.69 z" id="path741" style="fill:${r}; paint-order: stroke;"/>\n </g>\n <g transform="translate(780.58,981.42)" id="g747" style="fill:url(#linearGradient793)">\n <path d="m 0,0 c -16.619,0 -29.094,3.449 -41.02,7.881 l -16.618,-51.717 c 9.852,-4.933 33.238,-9.866 58.653,-9.866 73.241,0 124.66,45.32 124.66,108.37 0,30.059 -15.563,56.148 -42.584,67.478 l 0.507,0.983 c 31.166,10.849 61.274,40.888 61.274,82.257 0,32.025 -19.197,68.962 -81.53,68.962 -24.908,0 -47.784,-6.397 -58.695,-11.329 L 4.14,211.803 c 8.838,4.431 22.877,8.362 36.367,8.362 23.385,0 36.367,-11.811 36.367,-30.039 0,-33.007 -36.875,-45.32 -60.767,-45.32 H 9.341 L -0.004,96.538 h 9.345 c 26.472,0 50.914,-12.813 50.914,-44.337 C 60.255,21.68 35.813,0.003 -0.004,0.003" id="path745" style="fill:${r}; paint-order: stroke;"/>\n </g>\n <g transform="translate(1022.7,1054.8)" id="g751" style="fill:url(#linearGradient797)">\n <path d="m 0,0 c 1.057,2.948 2.072,6.397 3.129,9.846 7.781,17.727 23.385,30.541 36.875,30.541 17.126,0 23.892,-14.298 23.892,-32.025 0,-33.488 -11.417,-90.619 -44.148,-90.619 -17.676,0 -23.385,20.193 -23.385,40.868 0,10.848 0.55,23.161 3.637,41.389 m 15.604,-127.1 c 67.491,0 112.7,67.98 112.7,139.89 0,30.541 -14.547,72.411 -60.767,72.913 -18.691,0 -37.382,-8.383 -50.365,-22.66 h -2.114 c 19.241,45.3 51.422,73.875 92.991,82.739 6.215,1.483 11.924,2.466 18.183,2.466 l 9.346,52.699 c -5.202,0 -9.896,0 -18.692,-1.483 C 81.534,195.032 46.224,180.273 16.116,154.163 -21.816,121.156 -64.4,54.661 -64.4,-28.577 c 0,-47.285 18.734,-98.52 80.009,-98.52" id="path749" style="fill:${r}; paint-order: stroke;"/>\n </g>\n <g transform="translate(1309,1203.6)" id="g755" style="fill:url(#linearGradient801)">\n <path d="m 0,0 c 12.982,0 18.691,-14.779 18.691,-35.474 0,-35.955 -20.255,-188.16 -60.767,-188.16 -15.604,0 -21.313,15.28 -21.313,41.87 0,40.888 21.821,181.76 63.389,181.76 m -50.914,-275.85 c 95.062,0 132.44,137.92 132.44,231.01 0,36.938 -8.839,97.037 -75.314,97.037 -84.66,0 -131.9,-120.68 -131.9,-228.54 0,-44.317 12.983,-99.504 74.765,-99.504" id="path753" style="fill:${r}; paint-order: stroke;"/>\n </g>\n <g transform="translate(1442.6,1286.9)" id="g759" style="fill:url(#linearGradient805)">\n <path d="m 0,0 c 18.013,0 32.613,-15.92 32.613,-35.559 0,-19.638 -14.6,-35.558 -32.613,-35.558 -18.011,0 -32.612,15.92 -32.612,35.558 C -32.612,-15.92 -18.011,0 0,0 m 0,-91.835 c 28.506,0 51.615,25.196 51.615,56.276 0,31.081 -23.109,56.277 -51.615,56.277 -28.505,0 -51.614,-25.196 -51.614,-56.277 0,-31.08 23.109,-56.276 51.614,-56.276" id="path757" style="fill:${r}; paint-order: stroke;"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n</svg>\n</div>`}}var _=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class P{static hideImage(t,e){const n=e.document.getElementById(t.id);n&&(n.style.display="none")}static addHiddenStyle(t,e){return _(this,arguments,void 0,(function*(t,e,n=100){return new Promise(((n,i)=>_(this,void 0,void 0,(function*(){const r=e.document.getElementById(t);null===r?i():(r.classList.remove("jsv-show"),r.classList.add("jsv-hidden"),setTimeout((()=>{n()}),2e3))}))))}))}static hideImageSlow(t,e){return _(this,arguments,void 0,(function*(t,e,n=100){return new Promise(((i,r)=>_(this,void 0,void 0,(function*(){""===t&&i();const o=e.document.getElementById(t);if(null===o)r();else{let t=1,e=setInterval((function(){t-=50/n,t<=0&&(clearInterval(e),t=0,o.style.display="none",o.style.visibility="hidden",i()),o.style.opacity=`${t}`,o.style.filter="alpha(opacity="+100*t+")"}),50)}}))))}))}static addShowStyle(t,e){return _(this,arguments,void 0,(function*(t,e,n=100){return new Promise(((n,i)=>_(this,void 0,void 0,(function*(){const r=e.document.getElementById(t);null===r?i():(r.classList.remove("jsv-hidden"),r.classList.add("jsv-show"),setTimeout((()=>{n()}),2e3))}))))}))}static addStyles(t){const e=t.document.createElement("style");e.innerText="\n .jsv-hidden { \n opacity:0;\n display: none;\n transition: opacity .8s ease-in-out\n }\n .jsv-show {\n opacity:1;\n display:unset;\n transition: opacity .8s ease-in-out\n }\n .jsv-width-100 {\n width: 100%;\n } \n .jsv-height-100 {\n height: 100%;\n }\n ",document.head.appendChild(e)}static showImage(t,e){const n=e.document.getElementById(t.id);if(!n)throw"could not find element with id "+t.id;n.style.display="block",n.style.removeProperty("z-index"),n.style.removeProperty("width"),n.style.removeProperty("position"),n.style.removeProperty("opacity"),n.style.removeProperty("filter"),n.style.removeProperty("visibility")}static getImageHolderElement(t,e,n,i,r){var o,a,s,l;const c=t.document.createElement("div"),h=null!==(o=i[0])&&void 0!==o?o:null;if(r.autoCDNResizer&&r.zoom&&null!==h&&(null===(a=r.autoCDNResizerConfig)||void 0===a?void 0:a.scaleWithZoomMax)){if(null===(s=r.autoCDNResizerConfig)||void 0===s?void 0:s.useWidth){let t=h.naturalWidth;t/=r.zoomMax,c.style.maxWidth=`${t}px`}if(null===(l=r.autoCDNResizerConfig)||void 0===l?void 0:l.useHeight){let t=h.naturalHeight;t/=r.zoomMax,c.style.height=`${t}px`}}return c.style.padding="0",c.style.margin="0",c.style.position="relative",c.id=n,c}static removeElement(t){if(null!==t&&t&&t.parentNode&&t.hasChildNodes())try{t.parentNode.removeChild(t)}catch(t){return}}static getMainHolderElement(t,n,i,r){const o=n.document.getElementById(t);if(o instanceof HTMLDivElement)return o.style.position="relative",o;throw new e(`Could not find main holder with id "${t}". Did you create an element like <div id="${t}"></div>`)}static createLink(t,e){const n=t.document.createElement("a");n.title=atob("MzYwIHByb2R1Y3Qgdmlld2VyLCAzNjAgc3Bpbg=="),n.style.position="absolute",n.style.bottom="10px",n.style.right="10px",n.style.zIndex="300",n.style.color="#ccc",n.href=atob("aHR0cHM6Ly93d3cuMzYwLWphdmFzY3JpcHR2aWV3ZXIuY29t"),n.innerText=atob("MzYwIHByb2R1Y3Qgdmlld2Vy"),e.appendChild(n)}static getImageElement(t,e){const n=e.document.createElement("img");return n.src=t.src,n.id=t.id,n.style.userSelect="none",n.style.display="none",n.style.touchAction="pan-x",n.style.touchAction="pan-y",t.extraClass.length>0&&t.extraClass.split(" ").forEach((t=>{t.length>0&&n.classList.add(t.trim())})),n}static setPointer(t,e){t.style.cursor=e}static setTouchAction(t,e){e&&(t.style.touchAction=e)}}class M{static getFilename(t,n,i){if(0===n.length){const n=i.split(".").pop();if(void 0===n)throw new e(`no extension found in url: ${i}, cannot generate other filenames`);const r=(t<10?"0":"")+t.toString();return i.replace(`.${n}`,`_${r}.${n}`)}const r=this.getImagesPath(i),o=this.getImagesPath(n)||r,a=n.lastIndexOf("/")+1;if(-1!==(n=n.substr(a)).toLowerCase().indexOf("xxxx")){if(t<10){const e="000"+t.toString();return`${o}${n.replace("xxxx",e)}`}if(t>9&&t<100){const e="00"+t.toString();return`${o}${n.replace("xxxx",e)}`}if(t>99){const e="0"+t.toString();return`${o}${n.replace("xxxx",e)}`}}if(-1!==n.toLowerCase().indexOf("xxx")){if(t<10){const e="00"+t.toString();return`${o}${n.replace("xxx",e)}`}if(t>9&&t<100){const e="0"+t.toString();return`${o}${n.replace("xxx",e)}`}if(t>99){const e=t.toString();return`${o}${n.replace("xxx",e)}`}}if(-1!==n.toLowerCase().indexOf("xx")){const e=(t<10?"0":"")+t.toString();return`${o}${n.replace("xx",e)}`}if(-1!==n.toLowerCase().indexOf("x")){const e=t.toString();return`${o}${n.replace("x",e)}`}throw new e(`no placeholder x or xx found in format: ${n}`)}static generateImagesUrlsFromFormat(t,e){const n=[],i=e.startFrameNo,r=e.totalFrames,o=e.imageUrlFormat;if(0===t.length)return n;for(let e=i;r>n.length;e++)n.push(this.getFilename(e,o,t));return n}static getPossibleImages(t,e,n,i,o,a){return s=this,l=void 0,h=function*(){return new Promise(((a,s)=>{var l,c;let h=[],u=0;if(o.imageUrls&&o.imageUrls.length>0)h=o.imageUrls,u=o.imageUrls.length;else{u=o.totalFrames;const t=o.imageUrls||[],n=o.mainImageUrl,i=n.length>0?n:e.src;h=t.length>0?t:this.generateImagesUrlsFromFormat(i,o)}const d=o.zoom?o.zoomMax:1;let g=t.clientWidth,m=t.clientHeight,f="";o.autoCDNResizer&&o.zoom&&(null===(l=o.autoCDNResizerConfig)||void 0===l?void 0:l.scaleWithZoomMax)&&(g*=d,m*=d,f=(null===(c=o.autoCDNResizerConfig)||void 0===c?void 0:c.useWidth)?"jsv-width-100":"jsv-height-100");const p=h.map(((t,e)=>{var i,r;if(o.autoCDNResizer){const e=new URL(t);(null===(i=o.autoCDNResizerConfig)||void 0===i?void 0:i.useHeight)&&e.searchParams.set("height",m.toString()),(null===(r=o.autoCDNResizerConfig)||void 0===r?void 0:r.useWidth)&&e.searchParams.set("width",g.toString()),t=e.toString()}return{src:t,id:n+e.toString(),sequence:e+1,encoded:"",extraClass:o.extraImageClass+" "+f}}));let v=1;h=p.map((t=>t.src)),function(t,e,n){return r(this,void 0,void 0,(function*(){const e=t=>r(this,void 0,void 0,(function*(){return new Promise(((e,i)=>{const r=new Image;r.src=t,r.onload=()=>{r.naturalWidth<10?i(new Error(`image (${t} is smaller then 10 px, probably not exist`)):(n.onSingleImageComplete({result:"",url:t,status:200,naturalWidth:r.naturalWidth,naturalHeight:r.naturalHeight}),e())},r.onerror=()=>{n.onSingleImageFail("failed loading "+t)}}))})),i=t=>r(this,void 0,void 0,(function*(){return Promise.all(t.map(e))}));return new Promise(((e,n)=>{const r=((t,e)=>{const n=[],i=[...t],r=Math.ceil(i.length/10);for(let t=0;t<r;t++)n.push(i.splice(0,10));return n})(t),o=t=>{const a=t.shift();void 0!==a&&i(a).then((()=>{0===r.length?e():o(t)})).catch((t=>{n(t)}))};o(r)}))}))}(h,0,{onSingleImageComplete:t=>{p[h.indexOf(t.url)].encoded="",p[h.indexOf(t.url)].naturalWidth=t.naturalWidth,p[h.indexOf(t.url)].naturalHeight=t.naturalHeight,i.loadImage({currentImage:v,totalImages:u,percentage:Math.round(v/u*100),image:p[v-1]}),v++},onSingleImageFail:t=>{s(new Error(t))}}).then((()=>{v-1===h.length?a(p):s(new Error(`Not all images are loaded ${v-1} from ${h.length}. \n Check the warning to see the image urls we are trying to fetch`))})).catch((t=>{s(t)}))}))},new((c=void 0)||(c=Promise))((function(t,e){function n(t){try{r(h.next(t))}catch(t){e(t)}}function i(t){try{r(h.throw(t))}catch(t){e(t)}}function r(e){var r;e.done?t(e.value):(r=e.value,r instanceof c?r:new c((function(t){t(r)}))).then(n,i)}r((h=h.apply(s,l||[])).next())}));var s,l,c,h}static getMainImage(t,n){const i=n.document.getElementById(t);if(i instanceof HTMLPictureElement){const e=i.querySelector("img");if(e){let n=e.src;return e.hasAttribute("data-src")&&(n=e.getAttribute("data-src")),{src:n,id:t,sequence:0,extraClass:""}}}if(i instanceof HTMLImageElement){let e=i.src;return i.hasAttribute("data-src")&&(e=i.getAttribute("data-src")),{src:e,id:t,sequence:0,extraClass:""}}throw new e(`Could not find main image with id "${t}"`)}static getMainImageFromURl(t){return{src:t,id:"",sequence:0,extraClass:""}}static getMainImageElement(t,n){const i=n.document.getElementById(t);if(i instanceof HTMLImageElement||i instanceof HTMLPictureElement)return i;throw new e(`Could not find main image with id "${t}"`)}static blurMainImage(t,e){const n=e.document.getElementById(t);n instanceof HTMLImageElement&&(n.style.filter="blur(5px)")}static hideReadyNotification(t,e,n){const i="notification_"+e;return P.addHiddenStyle(i,n,700)}static createOrGetPoweredBy(t,e,n,i,r){let o=Math.max(Math.floor(25*Math.random()),5);const a=btoa("powered_by_"+e),s=window.document.getElementById(a);if(s)return s;const l=n.document.createElement("div");l.style.top=`${o}%`,o=Math.max(Math.floor(15*Math.random()),5);const c=o%2==0;l.style[c?"left":"right"]=`${o}%`,l.style.position="absolute",l.style.display="flex",l.style.alignItems="right",l.style.justifyContent="top",l.id=a,l.style.zIndex="200",l.style.width="5%",l.style.minWidth="30px",l.className="jsv-hidden";const h=r?"":window.location.host;return l.innerHTML=D.getPoweredBy(t,h),i.appendChild(l),setTimeout((()=>{P.addShowStyle(a,window,300)}),300),l}static createReadyNotification(t,e,n,i){const r=n.document.createElement("div");r.style.position="absolute",r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.id="notification_"+e,r.style.zIndex="200",r.style.top="50%",r.style.left="50%",r.style.height="20%",r.style.width="20%",r.style.pointerEvents="none",r.style.transform="translate(-50%, -50%)",t.dragToRotate.showStartToRotateDefaultNotification&&(r.innerHTML=D.getReadyForRotate(t)),!t.dragToRotate.showStartToRotateDefaultNotification&&t.dragToRotate.imageUrl.length>0&&(r.innerHTML=D.getNotificationCustomImage(t)),i.appendChild(r)}static createProgressBar(t,e,n,i){const r=e.document.createElement("div");r.style.display="flex",r.style.position="absolute",r.style.height=i.defaultProgressBarHeight,r.style.width="30%",r.style.overflow="hidden",r.style.backgroundColor=i.defaultProgressBarBackgroundColor,r.style.borderRadius="0.25rem",r.id="loader_"+t,r.style.zIndex="200",r.style.top="50%",r.style.left="50%",r.style.transform="translate(-50%, -50%)";const o=e.document.createElement("div");return o.style.backgroundColor=i.defaultProgressBarColor,r.appendChild(o),n.appendChild(r),r}static getImagesPath(t){const e=t.replace(/^.*[\\/]/,"");return t.substring(0,t.length-e.length)}}const T=["textarea","input"],N=class{constructor(t,e){this.dragStarted=!1,this.pinchFlag=!1,this.datas={},this.isDrag=!1,this.isPinch=!1,this.isMouse=!1,this.isTouch=!1,this.prevClients=[],this.startClients=[],this.movement=0,this.startPinchClients=[],this.startDistance=0,this.customDist=[0,0],this.targets=[],this.prevTime=0,this.isDouble=!1,this.startRotate=0,this.onDragStart=(t,e=!0)=>{if(t.stopPropagation(),!this.dragStarted&&!t.cancelable)return;const{container:n,pinchOutside:i,dragstart:r,preventRightClick:o,preventDefault:a,checkInput:s}=this.options;t instanceof MouseEvent&&t.preventDefault();const l=this.isTouch;if(!this.dragStarted){const e=document.activeElement,n=t.target,i=n.tagName.toLowerCase(),r=T.indexOf(i)>-1,o=n.isContentEditable;if(r||o){if(s||e===n)return!1;if(e&&o&&e.isContentEditable&&e.contains(n))return!1}else if((a||"touchstart"===t.type)&&e){const t=e.tagName;(e.isContentEditable||T.indexOf(t)>-1)&&e.blur()}}let c=0;if(!this.dragStarted&&l&&i&&(c=setTimeout((()=>{E(n,"touchstart",this.onDragStart,{passive:!1})}))),this.dragStarted&&l&&i&&I(n,"touchstart",this.onDragStart),l&&function(t){return t.touches&&t.touches.length>=2}(t)){if(clearTimeout(c),!this.dragStarted&&t.touches.length!==t.changedTouches.length)return;this.pinchFlag||this.onPinchStart(t)}if(this.dragStarted)return;const h=this.startClients[0]?this.startClients:m(t);this.customDist=[0,0],this.dragStarted=!0,this.isDrag=!1,this.startClients=h,this.prevClients=h,this.datas={},this.movement=0;const u=f(h[0],this.prevClients[0],this.startClients[0]);if(t instanceof MouseEvent&&o&&(3===t.which||2===t.button))return clearTimeout(c),this.initDrag(),!1;!1===(r&&r(Object.assign({type:"dragstart",datas:this.datas,inputEvent:t,isTrusted:e},u)))&&(clearTimeout(c),this.initDrag()),this.isDouble=k()-this.prevTime<200,this.dragStarted&&a&&t.preventDefault()},this.onDrag=(t,e)=>{if(t.stopPropagation(),t instanceof MouseEvent&&0===t.buttons)return;if(!this.dragStarted&&1===t.buttons&&t instanceof MouseEvent&&this.onDragStart(t),!this.dragStarted)return;const n=m(t);this.pinchFlag&&this.onPinch(t,n);const i=this.move([0,0],t,n);if(!i||!i.deltaX&&!i.deltaY)return;const r=this.options.drag;r&&r(Object.assign(Object.assign({},i),{isScroll:!!e,inputEvent:t}))},this.onDragEnd=t=>{if(t.stopPropagation(),!this.dragStarted)return;this.dragStarted=!1;const{dragend:e,pinchOutside:n,container:i}=this.options;this.isTouch&&n&&I(i,"touchstart",this.onDragStart),this.pinchFlag&&this.onPinchEnd(t);const r=this.prevClients,o=this.startClients,a=this.pinchFlag?g(r,r,o,this.startPinchClients):f(r[0],r[0],o[0]),s=k(),l=!this.isDrag&&this.isDouble;this.prevTime=this.isDrag||l?0:s,this.startClients=[],this.prevClients=[],e&&e(Object.assign({type:"dragend",datas:this.datas,isDouble:l,isDrag:this.isDrag,inputEvent:t},a))},this.options=Object.assign({checkInput:!1,container:t.length>1?"undefined"!=typeof window?window:new HTMLDivElement:t[0],preventRightClick:!0,preventDefault:!0,pinchThreshold:0},e);const{container:n,events:i}=this.options;if(this.isTouch=i.indexOf("touch")>-1,this.isMouse=i.indexOf("mouse")>-1,this.customDist=[0,0],this.targets=t,this.isMouse&&(E(n,"mousedown",this.onDragStart,{capture:!0}),E(n,"mousemove",this.onDrag,{capture:!0}),E(n,"mouseleave",this.onDragEnd,{capture:!1}),E(n,"mouseup",this.onDragEnd,{capture:!1}),E(n,"contextmenu",this.onDragEnd,{capture:!1})),this.isTouch){const e={passive:!1};t.forEach((t=>{E(t,"touchstart",this.onDragStart,e)})),E(n,"touchmove",this.onDrag,{passive:!0}),E(n,"touchend",this.onDragEnd,e),E(n,"touchcancel",this.onDragEnd,e)}}move([t,e],n,i=this.prevClients){n.stopPropagation();const r=this.customDist,o=this.prevClients,a=this.startClients,s=this.pinchFlag?g(i,o,a,this.startPinchClients):f(i[0],o[0],a[0]);r[0]+=t,r[1]+=e,s.deltaX+=t,s.deltaY+=e;const{deltaX:l,deltaY:c}=s;return s.distX+=r[0],s.distY+=r[1],this.movement+=Math.sqrt(l*l+c*c),this.prevClients=i,this.isDrag=!0,Object.assign(Object.assign({type:"drag",datas:this.datas},s),{movement:this.movement,isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:n})}onPinchStart(t){t.stopPropagation();const{pinchstart:e,pinchThreshold:n}=this.options;if(this.isDrag&&this.movement>n)return;const i=y(t.changedTouches);if(this.pinchFlag=!0,this.startClients.push(...i),this.prevClients.push(...i),this.startDistance=p(this.prevClients),this.startPinchClients=[...this.prevClients],!e)return;const r=this.prevClients,o=w(r),a=f(o,o,o);this.startRotate=d(r),e(Object.assign(Object.assign({type:"pinchstart",datas:this.datas,angle:this.startRotate,touches:v(r,r,r)},a),{inputEvent:t}))}onPinch(t,e){if(!this.dragStarted||!this.pinchFlag||e.length<2)return;this.isPinch=!0;const n=this.options.pinch;if(!n)return;const i=this.prevClients,r=this.startClients,o=f(w(e),w(i),w(r)),a=d(e),s=p(e);n(Object.assign(Object.assign({type:"pinch",datas:this.datas,movement:this.movement,angle:a,rotation:a-this.startRotate,touches:v(e,i,r),scale:s/this.startDistance,distance:s},o),{inputEvent:t}))}onPinchEnd(t){if(!this.dragStarted||!this.pinchFlag)return;const e=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;const n=this.options.pinchend;if(!n)return;const i=this.prevClients,r=this.startClients,o=f(w(i),w(i),w(r));n(Object.assign(Object.assign({type:"pinchend",datas:this.datas,isPinch:e,touches:v(i,i,r)},o),{inputEvent:t})),this.isPinch=!1,this.pinchFlag=!1}triggerDragStart(t){this.onDragStart(t,!1)}unset(){const t=this.targets,e=this.options.container;this.isMouse&&(t.forEach((t=>{I(t,"mousedown",this.onDragStart)})),I(e,"mousemove",this.onDrag),I(e,"mouseup",this.onDragEnd),I(e,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((t=>{I(t,"touchstart",this.onDragStart)})),I(e,"touchstart",this.onDragStart),I(e,"touchmove",this.onDrag),I(e,"touchend",this.onDragEnd),I(e,"touchcancel",this.onDragEnd))}initDrag(){this.startClients=[],this.prevClients=[],this.dragStarted=!1}};var H=n(569);const z={loadImage:(0,H.slot)(),started:(0,H.slot)(),startDragging:(0,H.slot)(),changeImage:(0,H.slot)(),endAutoRotate:(0,H.slot)(),click:(0,H.slot)(),pinch:(0,H.slot)(),scroll:(0,H.slot)(),doubleClick:(0,H.slot)()};class O{constructor(t,e){this.bar=e,this.p=t,this.refresh()}refresh(){this.bar.style.width=`${this.p}%`}update(t){this.p=t,this.refresh()}}var Y=function(){return Y=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Y.apply(this,arguments)};function Z(t,e){for(var n=t.length;n--;)if(t[n].pointerId===e.pointerId)return n;return-1}function A(t,e){var n;if(e.touches){n=0;for(var i=0,r=e.touches;i<r.length;i++){var o=r[i];o.pointerId=n++,A(t,o)}}else(n=Z(t,e))>-1&&t.splice(n,1),t.push(e)}function X(t){for(var e,n=(t=t.slice(0)).pop();e=t.pop();)n={clientX:(e.clientX-n.clientX)/2+n.clientX,clientY:(e.clientY-n.clientY)/2+n.clientY};return n}function G(t){if(t.length<2)return 0;var e=t[0],n=t[1];return Math.sqrt(Math.pow(Math.abs(n.clientX-e.clientX),2)+Math.pow(Math.abs(n.clientY-e.clientY),2))}"undefined"!=typeof window&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}));var j={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};function B(t,e,n,i){j[t].split(" ").forEach((function(t){e.addEventListener(t,n,i)}))}function F(t,e,n){j[t].split(" ").forEach((function(t){e.removeEventListener(t,n)}))}"undefined"!=typeof window&&("function"==typeof window.PointerEvent?j={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:"function"==typeof window.TouchEvent&&(j={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));var L,J="undefined"!=typeof document&&!!document.documentMode;function W(){return L||(L=document.createElement("div").style)}var V=["webkit","moz","ms"],$={};function q(t){if($[t])return $[t];var e=W();if(t in e)return $[t]=t;for(var n=t[0].toUpperCase()+t.slice(1),i=V.length;i--;){var r=""+V[i]+n;if(r in e)return $[t]=r}}function U(t,e){return parseFloat(e[q(t)])||0}function Q(t,e,n){void 0===n&&(n=window.getComputedStyle(t));var i="border"===e?"Width":"";return{left:U(e+"Left"+i,n),right:U(e+"Right"+i,n),top:U(e+"Top"+i,n),bottom:U(e+"Bottom"+i,n)}}function K(t,e,n){t.style[q(e)]=n}function tt(t){var e=t.parentNode,n=window.getComputedStyle(t),i=window.getComputedStyle(e),r=t.getBoundingClientRect(),o=e.getBoundingClientRect();return{elem:{style:n,width:r.width,height:r.height,top:r.top,bottom:r.bottom,left:r.left,right:r.right,margin:Q(t,"margin",n),border:Q(t,"border",n)},parent:{style:i,width:o.width,height:o.height,top:o.top,bottom:o.bottom,left:o.left,right:o.right,padding:Q(e,"padding",i),border:Q(e,"border",i)}}}function et(t,e){return 1===t.nodeType&&(" "+function(t){return(t.getAttribute("class")||"").trim()}(t)+" ").indexOf(" "+e+" ")>-1}var nt=/^http:[\w\.\/]+svg$/,it={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:function(t){t.preventDefault(),t.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,relative:!1,setTransform:function(t,e,n){var i=e.x,r=e.y,o=e.scale,a=e.isSVG;if(K(t,"transform","scale("+o+") translate("+i+"px, "+r+"px)"),a&&J){var s=window.getComputedStyle(t).getPropertyValue("transform");t.setAttribute("transform",s)}},startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function rt(t,e){if(!t)throw new Error("Panzoom requires an element as an argument");if(1!==t.nodeType)throw new Error("Panzoom requires an element with a nodeType of 1");if(!function(t){var e=t.ownerDocument,n=t.parentNode;return e&&n&&9===e.nodeType&&1===n.nodeType&&e.documentElement.contains(n)}(t))throw new Error("Panzoom should be called on elements that have been attached to the DOM");e=Y(Y({},it),e);var n=function(t){return nt.test(t.namespaceURI)&&"svg"!==t.nodeName.toLowerCase()}(t),i=t.parentNode;i.style.overflow=e.overflow,i.style.userSelect="none",i.style.touchAction=e.touchAction,(e.canvas?i:t).style.cursor=e.cursor,t.style.userSelect="none",t.style.touchAction=e.touchAction,K(t,"transformOrigin","string"==typeof e.origin?e.origin:n?"0 0":"50% 50%");var r,o,a,s,l,c,h=0,u=0,d=1,g=!1;function m(e,n,i){if(!i.silent){var r=new CustomEvent(e,{detail:n});t.dispatchEvent(r)}}function f(e,i){var r={x:h,y:u,scale:d,isSVG:n};return requestAnimationFrame((function(){"boolean"==typeof i.animate&&(i.animate?function(t,e){K(t,"transition",q("transform")+" "+e.duration+"ms "+e.easing)}(t,i):K(t,"transition","none")),i.setTransform(t,r,i)})),m(e,r,i),m("panzoomchange",r,i),r}function p(){if(e.contain){var n=tt(t),i=n.parent.width-n.parent.border.left-n.parent.border.right,r=n.parent.height-n.parent.border.top-n.parent.border.bottom,o=i/(n.elem.width/d),a=r/(n.elem.height/d);"inside"===e.contain?e.maxScale=Math.min(o,a):"outside"===e.contain&&(e.minScale=Math.max(o,a))}}function v(n,i,r,o){var a=Y(Y({},e),o),s={x:h,y:u,opts:a};if(!a.force&&(a.disablePan||a.panOnlyWhenZoomed&&d===a.startScale))return s;if(n=parseFloat(n),i=parseFloat(i),a.disableXAxis||(s.x=(a.relative?h:0)+n),a.disableYAxis||(s.y=(a.relative?u:0)+i),"inside"===a.contain){var l=tt(t);s.x=Math.max(-l.elem.margin.left-l.parent.padding.left,Math.min(l.parent.width-l.elem.width/r-l.parent.padding.left-l.elem.margin.left-l.parent.border.left-l.parent.border.right,s.x)),s.y=Math.max(-l.elem.margin.top-l.parent.padding.top,Math.min(l.parent.height-l.elem.height/r-l.parent.padding.top-l.elem.margin.top-l.parent.border.top-l.parent.border.bottom,s.y))}else if("outside"===a.contain){var c=(l=tt(t)).elem.width/d,g=l.elem.height/d,m=c*r,f=g*r,p=(m-c)/2,v=(f-g)/2,y=(-(m-l.parent.width)-l.parent.padding.left-l.parent.border.left-l.parent.border.right+p)/r,b=(p-l.parent.padding.left)/r;s.x=Math.max(Math.min(s.x,b),y);var w=(-(f-l.parent.height)-l.parent.padding.top-l.parent.border.top-l.parent.border.bottom+v)/r,x=(v-l.parent.padding.top)/r;s.y=Math.max(Math.min(s.y,x),w)}return s}function y(t,n){var i=Y(Y({},e),n),r={scale:d,opts:i};return!i.force&&i.disableZoom||(r.scale=Math.min(Math.max(t,i.minScale),i.maxScale)),r}function b(t,e,n){var i=v(t,e,d,n),r=i.opts;return h=i.x,u=i.y,f("panzoompan",r)}function w(t,e){var n=y(t,e),i=n.opts;if(i.force||!i.disableZoom){t=n.scale;var r=h,o=u;if(i.focal){var a=i.focal;r=(a.x/t-a.x/d+h*t)/t,o=(a.y/t-a.y/d+u*t)/t}var s=v(r,o,t,{relative:!1,force:!0});return h=s.x,u=s.y,d=t,f("panzoomzoom",i)}}function x(t,n){var i=Y(Y(Y({},e),{animate:!0}),n);return w(d*Math.exp((t?1:-1)*i.step),i)}function R(e,i,r){var o=tt(t),a=o.parent.width-o.parent.padding.left-o.parent.padding.right-o.parent.border.left-o.parent.border.right,s=o.parent.height-o.parent.padding.top-o.parent.padding.bottom-o.parent.border.top-o.parent.border.bottom,l=i.clientX-o.parent.left-o.parent.padding.left-o.parent.border.left-o.elem.margin.left,c=i.clientY-o.parent.top-o.parent.padding.top-o.parent.border.top-o.elem.margin.top;n||(l-=o.elem.width/d/2,c-=o.elem.height/d/2);var h={x:l/a*(a*e),y:c/s*(s*e)};return w(e,Y(Y({animate:!1},r),{focal:h}))}w(e.startScale,{animate:!1}),setTimeout((function(){p(),b(e.startX,e.startY,{animate:!1})}));var E=[];function I(t){if(!function(t,e){for(var n=t;null!=n;n=n.parentNode)if(et(n,e.excludeClass)||e.exclude.indexOf(n)>-1)return!0;return!1}(t.target,e)){A(E,t),g=!0,e.handleStartEvent(t),r=h,o=u,m("panzoomstart",{x:h,y:u,scale:d},e);var n=X(E);a=n.clientX,s=n.clientY,l=d,c=G(E)}}function k(t){if(g&&void 0!==r&&void 0!==o&&void 0!==a&&void 0!==s){A(E,t);var n=X(E);E.length>1&&R(y((G(E)-c)*e.step/80+l).scale,n),b(r+(n.clientX-a)/d,o+(n.clientY-s)/d,{animate:!1})}}function C(t){1===E.length&&m("panzoomend",{x:h,y:u,scale:d},e),function(t,e){if(e.touches)for(;t.length;)t.pop();else{var n=Z(t,e);n>-1&&t.splice(n,1)}}(E,t),g&&(g=!1,r=o=a=s=void 0)}var S=!1;function D(){S||(S=!0,B("down",e.canvas?i:t,I),B("move",document,k,{passive:!0}),B("up",document,C,{passive:!0}))}return e.noBind||D(),{bind:D,destroy:function(){S=!1,F("down",e.canvas?i:t,I),F("move",document,k),F("up",document,C)},eventNames:j,getPan:function(){return{x:h,y:u}},getScale:function(){return d},getOptions:function(){return function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}(e)},pan:b,reset:function(t){var n=Y(Y(Y({},e),{animate:!0,force:!0}),t);d=y(n.startScale,n).scale;var i=v(n.startX,n.startY,d,n);return h=i.x,u=i.y,f("panzoomreset",n)},setOptions:function(n){for(var r in void 0===n&&(n={}),n)n.hasOwnProperty(r)&&(e[r]=n[r]);n.hasOwnProperty("cursor")&&(t.style.cursor=n.cursor),n.hasOwnProperty("overflow")&&(i.style.overflow=n.overflow),n.hasOwnProperty("touchAction")&&(i.style.touchAction=n.touchAction,t.style.touchAction=n.touchAction),(n.hasOwnProperty("minScale")||n.hasOwnProperty("maxScale")||n.hasOwnProperty("contain"))&&p()},setStyle:function(e,n){return K(t,e,n)},zoom:w,zoomIn:function(t){return x(!0,t)},zoomOut:function(t){return x(!1,t)},zoomToPoint:R,zoomWithWheel:function(t,n){t.preventDefault();var i=Y(Y({},e),n),r=(0===t.deltaY&&t.deltaX?t.deltaX:t.deltaY)<0?1:-1;return R(y(d*Math.exp(r*i.step/3),i).scale,t,i)}}}rt.defaultOptions=it;const ot=rt;class at{constructor(t,e,n,i){this.panzoomLoaded=!1,this.currentZoomScale=1,this.previousPinchDistance=0,this.screenX=0,this.screenY=0,this.window=t,this.images=e,this.mainHolderElement=n,this.zoomMax=i,this.initPanZoom()}initPanZoom(){this.images.forEach(((t,e)=>{var n;const i=null===(n=this.window)||void 0===n?void 0:n.document.getElementById(`${t.id}`);i&&(this.images[e].pz=this.getMobilePanzoom(i))})),this.panzoomLoaded=!0}handleZoom(t,e,n,i,r=!1){let o=!1;this.currentZoomScale<1&&t<0||this.currentZoomScale+t>this.zoomMax&&t>0||(this.currentZoomScale+=t,this.currentZoomScale<1.3&&t<0&&(e=0,n=0,o=!0,r=!0,this.previousPinchDistance=0,this.currentZoomScale=1),(r?this.images:[i]).forEach((t=>{var i,r;o?null===(r=t.pz)||void 0===r||r.reset({animate:!0}):null===(i=t.pz)||void 0===i||i.zoom(this.currentZoomScale,{animate:!0,focal:{x:e,y:n}})})))}handlePan(t,e){this.images.forEach((n=>{var i;null===(i=n.pz)||void 0===i||i.pan(t,e,{relative:!0,animate:!1})}))}getMobilePanzoom(t){return ot(t,{cursor:"",maxScale:this.zoomMax,minScale:1,startX:0,startY:0,animate:!1,canvas:!1,noBind:!0,disablePan:!1,easing:"ease",panOnlyWhenZoomed:!0,touchAction:""})}getRelativePosition(t,e){var n;let i=0,r=0;const o=null===(n=this.mainHolderElement)||void 0===n?void 0:n.getBoundingClientRect();if(o){const n=this.window.scrollX+(null==o?void 0:o.left),a=this.window.scrollY+(null==o?void 0:o.top);return i=Math.round(t-n-o.width/2),r=Math.round(e-a-(o.height-o.height/2)),[i*this.currentZoomScale*2,r*this.currentZoomScale*2]}return[i,r]}pinch(t,e){var n;if(!this.panzoomLoaded)return;t.originalEvent.cancelBubble=!0;const i=null===(n=this.mainHolderElement)||void 0===n?void 0:n.getBoundingClientRect(),r=Math.sqrt(i.width*i.width+i.height*i.height),o=t.scale/r;if(t.first||0===this.previousPinchDistance)return void(this.previousPinchDistance=o);this.screenX=(t.originalEvent.targetTouches[0].pageX+t.originalEvent.targetTouches[1].pageX)/2,this.screenY=(t.originalEvent.targetTouches[0].pageY+t.originalEvent.targetTouches[1].pageY)/2;let a=o-this.previousPinchDistance;a*=4;const[s,l]=this.getRelativePosition(this.screenX,this.screenY);this.handleZoom(a,s,l,e),this.previousPinchDistance=o}scroll(t,e,n){let i=t.originalEvent.deltaY>0?-1:1;i*=e/100;const r=t.originalEvent,[o,a]=this.getRelativePosition(r.pageX,r.pageY);this.handleZoom(i,o,a,n)}isZoomed(){return this.currentZoomScale>1}pan(t,e){this.handlePan(t,e)}reset(t){this.handleZoom(-1*(this.currentZoomScale-1),0,0,t,!0)}zoomOnPage(t,e,n,i){if(t>this.zoomMax)return;const[r,o]=this.getRelativePosition(e,n);this.handleZoom(t-this.currentZoomScale,r,o,i)}zoom(t,e,n,i){var r,o;if(t>this.zoomMax)return;const a=this.window.document.getElementById(i.id);if(a){this.currentZoomScale=t;const s=0!==e?e*a.clientWidth/this.currentZoomScale:0,l=0!==n?n*a.clientHeight/this.currentZoomScale:0;null===(r=i.pz)||void 0===r||r.pan(s,l,{animate:!0}),null===(o=i.pz)||void 0===o||o.zoom(this.currentZoomScale,{animate:!0})}}}class st{static isValid(t,e){e=e.toLowerCase().split("").reverse().join("");const n=parseInt(t.charAt(0),10),i=t.split("=="),r=parseInt(i[0].charAt(i[0].length-1),10);return i[0].substr(1,i[0].length-2)===this.reverse(e,2*r)&&n+r===10}static reverse(t,e){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ".toLowerCase();let i="";e>26&&(e%=26);let r=0;for(;r<t.length;){if(-1!==n.indexOf(t[r])){const o=n.indexOf(t[r]);n[o+e]?i+=n[o+e]:i+=n[o+e-26]}r++}return i}}var lt=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};const ct={license:"",mainImageId:"jsv-image",mainHolderId:"jsv-holder",mainImageUrl:"",totalFrames:72,imageUrls:[],speed:80,inertia:20,defaultProgressBar:!0,defaultProgressBarColor:"rgb(0, 0, 0)",defaultProgressBarBackgroundColor:"rgba(255, 255, 255, 0.5)",defaultProgressBarHeight:"5px",firstImageNumber:1,imageUrlFormat:"",startFrameNo:1,reverse:!1,autoRotate:0,autoRotateSpeed:0,autoRotateReverse:!1,enableImageEvents:!1,zoom:!1,zoomWheelSpeed:50,zoomMax:2,stopAtEdges:!1,enableChangeImageEvent:!1,cursorConfig:{default:"grab",drag:"grabbing",zoomIn:"zoom-in",zoomOut:"zoom-out",pan:"move"},touchConfig:{default:"pan-y",drag:"pan-y",zoomIn:"pan-x",zoomOut:"pan-x",pan:"pan-x"},autoCDNResizer:!1,autoCDNResizerConfig:{useWidth:!0,useHeight:!1,scaleWithZoomMax:!1},notificationConfig:{dragToRotate:{showStartToRotateDefaultNotification:!1,imageUrl:"",languages:[],mainColor:"rgba(0,0,0,0.20)",textColor:"rgba(243,237,237,0.80)"}},extraImageClass:"",id:""};class ht{constructor(t){this.isStarted=!1,this.isDragged=!1,this.images=[],this.currentImageNumber=1,this.previousImageNumber=1,this.desiredRotationInDegrees=0,this.mainImage=null,this.mainHolderElement=null,this.uniqueId="",this.currentDegree=0,this.currentSpeed=0,this.inAnimation=!1,this.desiredRotationInDegreesStartSlowingDown=null,this.useEasing=!0,this.updateInAction=!1,this.window=null,this.startDragInvocations=0,this.firstDrag=!1,this.standbyRefreshRate=40,this.previousTargetDegree=null,this.nAutoRotations=0,this.dragAllowed=!0,this.currentPointer="default",this.currentTouch="default",this.zoomPointerTimeout=null,this.unsubscribe=null,this.watermark=!1,this.watermark=!0,this.zoom=null,this.eventBus=ht.initEventBus(),this.window="undefined"!=typeof window?window:null,this.options=t,this.runningInBrowser()}static loadConfig(t,e,n){return new Promise(((i,r)=>{if(!t||t.length<10||!e&&n&&"file:"!==n)i({config:"",watermark:!0});else{const n=new XMLHttpRequest,o=`https://config.3dweb.io/${t=null==t?void 0:t.trim()}`;n.onreadystatechange=function(){if(4===this.readyState&&200===this.status){const e=JSON.parse(this.responseText);if(null!==e.config)return i(e);r(new Error(`could not find a presentation with id ${t}`))}else if(0!==this.status&&200!==this.status)switch(this.status){case 404:r(new Error(`could not find a presentation with id ${t}`));break;case 403:r(new Error(`you do not have access to presentation with id ${t}`));break;default:r(new Error(`could not load presentation with id ${t}`))}},n.open("GET",o,!0),n.setRequestHeader("3dweb-host",e),n.send()}}))}static initEventBus(){return(0,H.createEventBus)({events:z,channels:[]})}runningInBrowser(){return"undefined"!=typeof window}events(){return this.eventBus}setSpeed(t){this.currentSpeed=t>999||t<-999?999:t}setId(t){return this.options.id=t,this.options.imageUrls=[],this.destroy().then((()=>this.start())).catch((t=>{console.error(t)}))}setInertia(t){this.options.inertia=t>99?99:t<1?1:t}initProgressBar(){if(this.options.defaultProgressBar){this.options.mainImageId&&M.blurMainImage(this.options.mainImageId,this.window);const t=M.createProgressBar(this.uniqueId,this.window,this.mainHolderElement,this.options),e=new O(0,t.firstChild);this.eventBus.loadImage.on((t=>{e.update(t.percentage)})),this.eventBus.started.on((()=>{t.style.display="none"}))}}documentIsReady(){return"complete"===this.window.document.readyState}isB(){const t=new RegExp(atob("KGdvb2dsZWJvdC98Ym90fEdvb2dsZWJvdC1Nb2JpbGV8R29vZ2xlYm90LUltYWdlfEdvb2dsZSBmYXZpY29ufE1lZGlhcGFydG5lcnMtR29vZ2xlfGJpbmdib3R8c2x1cnB8amF2YXx3Z2V0fGN1cmx8Q29tbW9ucy1IdHRwQ2xpZW50fFB5dGhvbi11cmxsaWJ8bGlid3d3fGh0dHB1bml0fG51dGNofHBocGNyYXdsfG1zbmJvdHxqeXhvYm90fEZBU1QtV2ViQ3Jhd2xlcnxGQVNUIEVudGVycHJpc2UgQ3Jhd2xlcnxiaWdsb3Ryb258dGVvbWF8Y29udmVyYXxzZWVrYm90fGdpZ2FibGFzdHxleGFib3R8bmdib3R8aWFfYXJjaGl2ZXJ8R2luZ2VyQ3Jhd2xlcnx3ZWJtb24gfGh0dHJhY2t8d2ViY3Jhd2xlcnxncnViLm9yZ3xVc2luZU5vdXZlbGxlQ3Jhd2xlcnxhbnRpYm90fG5ldHJlc2VhcmNoc2VydmVyfHNwZWVkeXxmbHVmZnl8YmlibnVtLmJuZnxmaW5kbGlua3xtc3Jib3R8cGFuc2NpZW50fHlhY3lib3R8QUlTZWFyY2hCb3R8SU9JfGlwcy1hZ2VudHx0YWdvb2JvdHxNSjEyYm90fGRvdGJvdHx3b3Jpb2JvdHx5YW5nYXxidXp6Ym90fG1sYm90fHlhbmRleGJvdHxwdXJlYm90fExpbmd1ZWUgQm90fFZveWFnZXJ8Q3liZXJQYXRyb2x8dm9pbGFib3R8YmFpZHVzcGlkZXJ8Y2l0ZXNlZXJ4Ym90fHNwYm90fHR3ZW5nYWJvdHxwb3N0cmFua3x0dXJuaXRpbmJvdHxzY3JpYmRib3R8cGFnZTJyc3N8c2l0ZWJvdHxsaW5rZGV4fEFkaWR4Ym90fGJsZWtrb2JvdHxlem9vbXN8ZG90Ym90fE1haWwuUlVfQm90fGRpc2NvYm90fGhlcml0cml4fGZpbmR0aGF0ZmlsZXxldXJvcGFyY2hpdmUub3JnfE5lcmRCeU5hdHVyZS5Cb3R8c2lzdHJpeCBjcmF3bGVyfGFocmVmc2JvdHxBYm91bmRleHxkb21haW5jcmF3bGVyfHdic2VhcmNoYm90fHN1bW1pZnl8Y2Nib3R8ZWRpc3RlcmJvdHxzZXpuYW1ib3R8ZWMybGlua2ZpbmRlcnxnc2xmYm90fGFpaGl0Ym90fGludGVsaXVtX2JvdHxmYWNlYm9va2V4dGVybmFsaGl0fHlldGl8UmV0cmV2b1BhZ2VBbmFseXplcnxsYi1zcGlkZXJ8c29nb3V8bHNzYm90fGNhcmVlcmJvdHx3b3Rib3h8d29jYm90fGljaGlyb3xEdWNrRHVja0JvdHxsc3Nyb2NrZXRjcmF3bGVyfGRydXBhY3R8d2ViY29tcGFueWNyYXdsZXJ8YWNvb25ib3R8b3BlbmluZGV4c3BpZGVyfGduYW0gZ25hbSBzcGlkZXJ8d2ViLWFyY2hpdmUtbmV0LmNvbS5ib3R8YmFja2xpbmtjcmF3bGVyfGNvY2NvY3xpbnRlZ3JvbWVkYnxjb250ZW50IGNyYXdsZXIgc3BpZGVyfHRvcGxpc3Rib3R8c2Vva2lja3Mtcm9ib3R8aXQybWVkaWEtZG9tYWluLWNyYXdsZXJ8aXAtd2ViLWNyYXdsZXIuY29tfHNpdGVleHBsb3Jlci5pbmZvfGVsaXNhYm90fHByb3hpbWljfGNoYW5nZWRldGVjdGlvbnxibGV4Ym90fGFyYWJvdHxXZVNFRTpTZWFyY2h8bmlraS1ib3R8Q3J5c3RhbFNlbWFudGljc0JvdHxyb2dlcmJvdHwzNjBTcGlkZXJ8cHNib3R8SW50ZXJmYXhTY2FuQm90fExpcHBlcmhleSBTRU8gU2VydmljZXxDQyBNZXRhZGF0YSBTY2FwZXJ8ZzAwZzFlLm5ldHxHcmFwZXNob3RDcmF3bGVyfHVybGFwcGVuZGJvdHxicmFpbm9ib3R8ZnItY3Jhd2xlcnxiaW5sYXJ8U2ltcGxlQ3Jhd2xlcnxMaXZlbGFwYm90fFR3aXR0ZXJib3R8Y1hlbnNlYm90fHNtdGJvdHxibmYuZnJfYm90fEE2LUluZGV4ZXJ8QURtYW50WHxGYWNlYm90fFR3aXR0ZXJib3R8T3JhbmdlQm90fG1lbW9yeWJvdHxBZHZCb3R8TWVnYUluZGV4fFNlbWFudGljU2Nob2xhckJvdHxsdHg3MXxuZXJkeWJvdHx4b3ZpYm90fEJVYmlOR3xRd2FudGlmeXxhcmNoaXZlLm9yZ19ib3R8QXBwbGVib3R8VHdlZXRtZW1lQm90fGNyYXdsZXI0anxmaW5keGJvdHxTZW1ydXNoQm90fHlvb3pCb3R8bGlwcGVyaGV5fHkhai1hc3J8RG9tYWluIFJlLUFuaW1hdG9yIEJvdHxBZGRUaGlzKQ=="),"i"),e=this.window.navigator.userAgent;return t.test(e)}isLocalhost(){const t=this.window.location.hostname,e=this.window.location.port;return Boolean(-1!==t.indexOf("dev.")||-1!==t.indexOf("beta.")||-1!==t.indexOf("file")||""!==e||"localhost"===t||"[::1]"===t||t.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))}isV(){if(this.options.id)return!this.watermark;const t=this.window.location.host;return st.isValid(this.options.license,t)}getFirstImageIndex(){return this.options.firstImageNumber&&this.options.firstImageNumber>0&&this.options.firstImageNumber-1<this.images.length?this.options.firstImageNumber-1:0}destroy(){return lt(this,void 0,void 0,(function*(){return new Promise(((t,e)=>{try{if(this.isStarted){const e=this.window.document.getElementById(this.uniqueId);if(e&&P.removeElement(e),this.options.defaultProgressBar){const t=this.window.document.getElementById("loader_"+this.uniqueId);P.removeElement(t);const e=this.window.document.getElementById("link_"+this.uniqueId);P.removeElement(e)}if(this.options.notificationConfig.dragToRotate.showStartToRotateDefaultNotification||this.options.notificationConfig.dragToRotate.imageUrl.length>0){const t=this.window.document.getElementById("notification_"+this.uniqueId);P.removeElement(t)}P.showImage(this.mainImage,this.window),this.mainHolderElement.outerHTML=this.mainHolderElement.outerHTML,this.isStarted=!1,this.images=[],this.mainImage=null,this.mainHolderElement=null,this.firstDrag=!1,this.eventBus=ht.initEventBus(),t(!0)}else t(!1)}catch(t){let n="error with destroying viewer";t instanceof Error&&(n+=t.toString()),e(n)}}))}))}start(){return lt(this,void 0,void 0,(function*(){if(this.documentIsReady())return new Promise(((t,e)=>{const n=this.window.location.host,i=this.window.location.protocol,r=JSON.parse(JSON.stringify(this.options));this.options=S({objects:[ct,this.options]}),this.options.id?ht.loadConfig(this.options.id,n,i).then((n=>{this.watermark=n.watermark;const i=JSON.parse(n.config);this.options=S({objects:[ct,i,r]}),this.currentSpeed=this.options.speed,this.options.totalFrames=this.getTotalFrames(),this.startPresentation().then(t).catch(e)})).catch((t=>{this.handleError(t,e)})):(this.currentSpeed=this.options.speed,this.options.totalFrames=this.getTotalFrames(),this.startPresentation().then(t).catch(e))}));yield new Promise((t=>{setTimeout((()=>{t()}),200)})).then((()=>this.start()))}))}startPresentation(){return lt(this,void 0,void 0,(function*(){return new Promise(((t,e)=>{try{if(this.isStarted&&e(`Viewer ${this.uniqueId} already started`),this.runningInBrowser()||e(`Viewer ${this.uniqueId} not started in browser`),P.addStyles(this.window),this.registerStartEvents(),this.registerInputEvents(),this.mainImage=M.getMainImage(this.options.mainImageId,this.window),this.mainHolderElement=P.getMainHolderElement(this.options.mainHolderId,this.window,this.isB(),this.isLocalhost()),!this.isB()||this.isLocalhost()||this.isV()||P.createLink(this.window,this.mainHolderElement),!this.isV()&&!this.isLocalhost()){const t=JSON.parse(JSON.stringify(this.options.notificationConfig));t.dragToRotate.mainColor="rgb(255 ,255,255)",t.dragToRotate.textColor="rgb(55, 25, 2)",this.eventBus.startDragging.on((({invocations:e})=>{if(e>=2){clearTimeout(this.pbto);const e=M.createOrGetPoweredBy(t,this.uniqueId,this.window,this.mainHolderElement,this.isLocalhost());null!==e&&(this.pbto=setTimeout((()=>{P.addHiddenStyle(e.id,this.window,3e3).then((()=>{P.removeElement(e)}))}),5e3))}}))}this.uniqueId=this.uniqueId||"_"+Math.random().toString(36).substr(2,9),this.initProgressBar(),this.getImages().then((n=>lt(this,void 0,void 0,(function*(){this.images=n;const i=P.getImageHolderElement(this.window,this.mainHolderElement,this.uniqueId,n,this.options);this.prepareImageHolder(i).then((()=>(this.mainHolderElement.appendChild(i),P.hideImageSlow(this.mainImage.id,this.window).then((()=>{this.inAnimation||(P.showImage(this.images[this.getFirstImageIndex()],this.window),this.currentImageNumber=this.options.firstImageNumber||1,this.previousImageNumber=this.options.firstImageNumber||1,this.setCurrentDegree(this.currentImageNumber)),this.isStarted=!0,this.eventBus.started(!0),t()})).catch((t=>{this.handleError(t,e)}))))).catch((t=>{this.handleError(t,e)}))})))).catch((t=>{this.handleError(t,e)}))}catch(t){this.handleError(t,e)}}))}))}handleError(t,e){let n="unknown error";t instanceof Error&&(n=t.toString(),this.reportError(n),this.destroy().then((()=>{e(t.toString())})).catch((t=>{this.reportError(t)}))),e(n)}registerInputEvents(){this.eventBus.pinch.on((t=>this.onPinchListener(t))),this.eventBus.doubleClick.on((t=>this.onDoubleClickListener(t))),this.eventBus.scroll.on((t=>this.onScrollListener(t)))}startDragToRotateNotification(){M.createReadyNotification(this.options.notificationConfig,this.uniqueId,this.window,this.mainHolderElement)}hideDragToRotateNotification(){this.unsubscribe(),this.options.zoom&&this.zoomUnsubscribe(),M.hideReadyNotification(this.options.notificationConfig,this.uniqueId,this.window).then((()=>{const t=this.window.document.getElementById("notification_"+this.uniqueId);P.removeElement(t)}))}registerStartEvents(){(this.options.notificationConfig.dragToRotate.showStartToRotateDefaultNotification||this.options.notificationConfig.dragToRotate.imageUrl.length>0)&&(this.eventBus.started.on((()=>this.startDragToRotateNotification())),this.unsubscribe=this.eventBus.startDragging.on((()=>this.hideDragToRotateNotification())),this.options.zoom&&(this.zoomUnsubscribe=this.eventBus.pinch.on((()=>this.hideDragToRotateNotification())),this.zoomUnsubscribe=this.eventBus.scroll.on((()=>this.hideDragToRotateNotification())))),this.options.zoom&&this.eventBus.started.on((t=>this.registerZoom(t))),this.options.autoRotate>0&&this.eventBus.started.on((t=>this.runAutoRotate(t)))}runAutoRotate(t){t?this.autoRotate(this.options.autoRotate).then((t=>{this.eventBus.endAutoRotate({currentDegree:this.currentDegree,currentImage:this.images[this.currentImageNumber-1],completed:t})})).catch((t=>{this.reportError(t)})):this.destroy().then((()=>{this.reportWarning("Failed starting autorotate")})).catch((t=>this.reportError(t)))}registerZoom(t){t&&(this.zoom=new at(this.window,this.images,this.mainHolderElement,this.options.zoomMax))}onPinchListener(t){var e;this.options.zoom&&(this.dragAllowed=!1,null===(e=this.zoom)||void 0===e||e.pinch(t,this.images[this.currentImageNumber-1]),setTimeout((()=>{this.dragAllowed=!0}),1e3))}onDoubleClickListener(t){var e,n;this.options.zoom&&(null===(e=this.zoom)||void 0===e?void 0:e.isZoomed())&&(null===(n=this.zoom)||void 0===n||n.reset(this.images[this.currentImageNumber-1]),this.setPointer("default"))}onScrollListener(t){var e,n;if(this.options.zoom){this.cancelCurrentActions(),this.zoomPointerTimeout&&clearTimeout(this.zoomPointerTimeout),null===(e=this.zoom)||void 0===e||e.scroll(t,this.options.zoomWheelSpeed,this.images[this.currentImageNumber-1]);const i=t.originalEvent.deltaY;(null===(n=this.zoom)||void 0===n?void 0:n.isZoomed())?(i<0?this.setPointer("zoomIn"):this.setPointer("zoomOut"),this.zoomPointerTimeout=this.window.setTimeout((()=>{this.setPointer("pan")}),500)):this.setPointer("default")}}prepareImageHolder(t){return lt(this,void 0,void 0,(function*(){const e=[],n=(t,e)=>lt(this,void 0,void 0,(function*(){return new Promise(((n,i)=>{const r=[];for(let n=0;n<t.length;n++)r.push(e.call(this,t[n],n));Promise.all(r).then((t=>n(t))).catch((t=>i(t)))}))})),i=(n,i)=>{(this.options.zoom||this.options.enableImageEvents)&&this.addZoomEvents(n),e.push(n),this.images[i].encoded="",t.appendChild(n)},r=(t,e)=>new Promise(((n,r)=>{const o=P.getImageElement(t,this.window);o instanceof HTMLImageElement?o.decode().then((()=>{i.call(this,o,e),n(!0)})).catch((()=>{i.call(this,o,e),n(!1)})):r("could not find element with id "+t.id)})),o=()=>{var t,n;(this.options.zoom||this.options.enableImageEvents)&&(null===(t=this.mainHolderElement)||void 0===t||t.addEventListener("wheel",this.onScroll.bind(this),{passive:!1}),null===(n=this.mainHolderElement)||void 0===n||n.addEventListener("dblclick",this.onDoubleClick.bind(this),{passive:!0})),new N(e,{container:this.mainHolderElement,dragstart:this.dragStart.bind(this),dragend:this.dragEnd.bind(this),drag:this.drag.bind(this),preventDefault:!1,events:["mouse","touch"]})};return new Promise(((t,e)=>{n(this.images,r).then((()=>{o(),t()})).catch((t=>{e(t)}))}))}))}addZoomEvents(t){t.addEventListener("click",this.onClick.bind(this)),this.onScale(t,((t,e,n)=>{t>.5&&this.events().pinch({completed:!0,currentImage:this.images[this.currentImageNumber-1],currentDegree:this.currentDegree,originalEvent:n,scale:t,first:e})}))}setPointer(t){if(this.currentPointer!==t){const e=this.options.cursorConfig[t];this.currentPointer=t,P.setPointer(this.mainHolderElement,e)}const e=this.options.touchConfig[t];this.currentTouch!==e&&(this.currentTouch=e,P.setTouchAction(this.mainHolderElement,e))}onScale(t,e){let n,i=!0,r=0,o=!1;t.addEventListener("touchmove",(function(t){if(2===t.targetTouches.length){const r=Math.hypot(t.targetTouches[0].pageX-t.targetTouches[1].pageX,t.targetTouches[0].pageY-t.targetTouches[1].pageY);o=!0,e(r,i,t),void 0===n&&(n=r,i=!1)}}),{capture:!1,passive:!0}),t.addEventListener("touchend",(t=>{var e,a;if(n=void 0,i=!0,(null===(e=this.zoom)||void 0===e?void 0:e.isZoomed())&&!o){const t=(new Date).getTime(),e=t-r;clearTimeout(void 0),e<500&&e>0&&(null===(a=this.zoom)||void 0===a||a.reset(this.images[this.currentImageNumber-1])),r=t}o=!1}),{capture:!1,passive:!0})}onClick(t){this.events().click({currentDegree:this.currentDegree,currentImage:this.images[this.currentImageNumber-1],completed:!0,originalEvent:t})}onScroll(t){t.preventDefault(),this.events().scroll({currentDegree:this.currentDegree,currentImage:this.images[this.currentImageNumber-1],completed:!0,originalEvent:t})}onDoubleClick(t){this.events().doubleClick({currentDegree:this.currentDegree,currentImage:this.images[this.currentImageNumber-1],completed:!0,originalEvent:t})}reportError(t){console.error(`360 Javascript Viewer: ${t}`)}reportWarning(t){console.warn(`360 Javascript Viewer: ${t}`)}updateImage(){if(this.updateInAction=!0,0===this.desiredRotationInDegrees)return this.inAnimation=!1,this.updateInAction=!1,this.desiredRotationInDegreesStartSlowingDown=null,new Promise((t=>{t({currentDegree:this.currentDegree})}));const t=this.getNextImageNumber();if(this.options.stopAtEdges&&!this.inAnimation){const e=this.images.length,n=1;if(this.previousImageNumber===n&&t===e||this.previousImageNumber===e&&t===n)return this.updateInAction=!1,new Promise((t=>{t({currentDegree:this.currentDegree})}))}return this.setCurrentImage(t),(e=this.getCurrentRefreshRate(),new Promise((t=>setTimeout(t,e)))).then((()=>this.updateImage()));var e}zoomTo(t,e,n){return new Promise(((i,r)=>{var o,a;if(this.options.zoom){t>this.options.zoomMax&&r(`supplied zoom factor ${t} higher then max zoom of ${this.options.zoomMax}`);const s=this.images[this.currentImageNumber-1];null===(o=this.zoom)||void 0===o||o.reset(s),null===(a=this.zoom)||void 0===a||a.zoom(t,e,n,s),this.setPointer(t>1?"zoomIn":"zoomOut"),i()}else r("zoom not activated")}))}rotateDegrees(t){return this.inAnimation=!0,this.desiredRotationInDegrees=t,this.updateImage()}resetZoom(){return new Promise(((t,e)=>{var n;this.options.zoom||e("zoom is not activated"),null===(n=this.zoom)||void 0===n||n.reset(this.images[this.currentImageNumber-1]),this.setPointer("default"),setTimeout((()=>{t()}),500)}))}isZoomedIn(){var t;return!!this.options.zoom&&!!this.zoom&&(null===(t=this.zoom)||void 0===t?void 0:t.isZoomed())}rotateToFrame(t,e=!0,n=!0){const i=360/this.options.totalFrames*(t-1);return this.rotateToDegree(i,e,n)}rotateToDegree(t,e=!0,n=!0){if(this.inAnimation=!0,this.cancelCurrentActions(),this.useEasing=n,this.desiredRotationInDegrees=0,t=Math.round(t),this.previousTargetDegree===t||t===this.currentDegree)return this.useEasing=!0,new Promise((t=>{t({currentDegree:this.currentDegree})}));this.inAnimation=!0;const i=t>this.currentDegree?t-this.currentDegree:360-this.currentDegree+t,r=t<this.currentDegree?-1*(this.currentDegree-t):-1*(this.currentDegree+(360-t));return this.desiredRotationInDegrees=e&&Math.abs(r)<i?r:i,this.previousTargetDegree=t,this.updateImage()}cancelCurrentActions(){this.desiredRotationInDegrees=0,this.previousTargetDegree=null,this.nAutoRotations=0}dragEnd(){var t;this.isDragged=!1,this.options.zoom&&(null===(t=this.zoom)||void 0===t?void 0:t.isZoomed())?this.setPointer("pan"):this.setPointer("default");const e=this.options.inertia/100;this.desiredRotationInDegrees+=-1*e*this.desiredRotationInDegrees}drag(t){var e,n,i;if(this.options.zoom&&(null===(e=this.zoom)||void 0===e?void 0:e.isZoomed())){if(t.inputEvent.targetTouches&&t.inputEvent.targetTouches&&2===t.inputEvent.targetTouches.length&&Math.hypot(t.inputEvent.targetTouches[0].pageX-t.inputEvent.targetTouches[1].pageX,t.inputEvent.targetTouches[0].pageY-t.inputEvent.targetTouches[1].pageY)<1)return;if(Math.hypot(t.deltaX,t.deltaY)<1)return;return null===(n=this.zoom)||void 0===n||n.pan(t.deltaX,t.deltaY,this.images[this.currentImageNumber-1]),void this.setPointer("pan")}if(Math.abs(t.deltaY)>Math.abs(t.deltaX))return;if(!this.dragAllowed)return!1;if(this.window.TouchEvent&&t instanceof TouchEvent&&2===t.touches.length)return!1;const r=this.getDegreesOneImage();let o=t.deltaX/(null===(i=this.mainHolderElement)||void 0===i?void 0:i.clientWidth)*this.getTotalFrames()*r;return o=this.options.speed/100*o,this.options.reverse||(o*=-1),this.desiredRotationInDegrees+=o,this.updateInAction||this.updateImage(),this.setPointer("drag"),this.firstDrag&&(this.startDragInvocations++,this.eventBus.startDragging({invocations:this.startDragInvocations}),this.firstDrag=!1),this.isDragged}dragStart(){var t;this.dragAllowed&&(this.options.zoom&&(null===(t=this.zoom)||void 0===t?void 0:t.isZoomed())||(this.isDragged=!0,this.firstDrag=!0,this.setPointer("drag"),this.cancelCurrentActions()))}getNextImageNumber(){const t=this.images.length,e=this.getDegreesOneImage();let n=this.currentImageNumber;return Math.abs(this.desiredRotationInDegrees)<e?(this.viewerHasNoAction()&&(this.desiredRotationInDegrees=0),n):(n=this.desiredRotationInDegrees>0?ht.increaseImageNumber(n,t):ht.decreaseImageNumber(n,t),this.decreaseDesiredRotation(e),n)}getDegreesOneImage(){const t=this.images.length;return Math.round(360/t)}setCurrentDegree(t){const e=this.getDegreesOneImage();this.currentDegree=1===t?0:(t-1)*e}static decreaseImageNumber(t,e){return--t<1?e:t}static increaseImageNumber(t,e){return++t>e?1:t}decreaseDesiredRotation(t){t=Math.abs(t),this.desiredRotationInDegrees<0?this.desiredRotationInDegrees+=t:this.desiredRotationInDegrees-=Math.abs(t)}setCurrentImage(t){t!==this.previousImageNumber&&this.isStarted&&(-1!==this.previousImageNumber&&P.hideImage(this.images[this.previousImageNumber-1],this.window),P.showImage(this.images[t-1],this.window),this.previousImageNumber=t,this.currentImageNumber=t,this.setCurrentDegree(t),this.options.enableChangeImageEvent&&this.events().changeImage({currentImage:this.images[t-1],currentDegree:this.currentDegree,completed:!0}))}viewerHasNoAction(){return!this.isDragged}getImages(){return lt(this,void 0,void 0,(function*(){return M.getPossibleImages(this.mainHolderElement,this.mainImage,this.uniqueId,this.eventBus,this.options,this.window)}))}getTotalFrames(){if(this.options.imageUrls&&this.options.imageUrls.length>0)return this.options.imageUrls.length;const t=this.options.totalFrames;if(t>0&&t<=360)return t;throw new e(`totalFrames must be between 1 and 360 now ${t}`)}static speedToRefreshRate(t){return(100-t)/2}getCurrentRefreshRate(){if(0===this.desiredRotationInDegrees)return this.standbyRefreshRate;if(this.viewerHasNoAction()&&this.useEasing){this.desiredRotationInDegreesStartSlowingDown||(this.desiredRotationInDegreesStartSlowingDown=Math.abs(this.desiredRotationInDegrees));let t=(1-(1-Math.abs(this.desiredRotationInDegrees)/this.desiredRotationInDegreesStartSlowingDown))*this.currentSpeed;return t=(100-this.options.inertia)/100*t,ht.speedToRefreshRate(t)}return ht.speedToRefreshRate(this.currentSpeed)}autoRotate(t){return lt(this,void 0,void 0,(function*(){this.nAutoRotations=t;const e=e=>lt(this,void 0,void 0,(function*(){let n=0;for(n=0;n<this.nAutoRotations;n++){if(this.isDragged||this.nAutoRotations!==t){e&&this.setSpeed(this.options.speed);break}n===t-1&&(this.useEasing=!0);const i=this.options.autoRotateReverse?-360:360;yield this.rotateDegrees(i)}return new Promise(((e,i)=>{e(n===t-1)}))}));return new Promise(((n,i)=>{this.useEasing=!1;const r=this.options.autoRotateSpeed!==this.options.speed;r&&this.setSpeed(this.options.autoRotateSpeed),e(r).then((()=>{r&&this.setSpeed(this.options.speed),this.useEasing=!0,this.nAutoRotations===t?n(!0):n(!1)})).catch((t=>{this.reportError(t),i()}))}))}))}}})();var o=i.q,a=i.P;export{o as JavascriptViewer,a as defaultsOptions};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3dweb/360javascriptviewer",
3
- "version": "1.8.40",
3
+ "version": "1.8.41",
4
4
  "description": "A 360 javascript viewer working with images",
5
5
  "type": "module",
6
6
  "module": "lib/JavascriptViewer.esm.js",
@@ -15,6 +15,7 @@
15
15
  "types": "typings/JavascriptViewer.d.ts",
16
16
  "files": [
17
17
  "lib/JavascriptViewer.js",
18
+ "lib/JavascriptViewer.esm.js",
18
19
  "typings/JavascriptViewer.d.ts"
19
20
  ],
20
21
  "scripts": {