@3dweb/360javascriptviewer
Version:
A 360 javascript viewer working with images
1 lines • 92.4 kB
JavaScript
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(this,(()=>(()=>{var t={2:t=>{function e(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(i,r,o),a=Math.max(i,r,o),c=a-s;return a==s?e=0:i==a?e=(r-o)/c:r==a?e=2+(o-i)/c:o==a&&(e=4+(i-r)/c),(e=Math.min(60*e,360))<0&&(e+=360),n=(s+a)/2,[e,100*(a==s?0:n<=.5?c/(a+s):c/(2-a-s)),100*n]}function n(t){var e,n,i=t[0],r=t[1],o=t[2],s=Math.min(i,r,o),a=Math.max(i,r,o),c=a-s;return n=0==a?0:c/a*1e3/10,a==s?e=0:i==a?e=(r-o)/c:r==a?e=2+(o-i)/c:o==a&&(e=4+(i-r)/c),(e=Math.min(60*e,360))<0&&(e+=360),[e,n,a/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 s(t){return E[JSON.stringify(t)]}function a(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 c(t){var e=a(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 l(t){var e,n,i,r,o,s=t[0]/360,a=t[1]/100,c=t[2]/100;if(0==a)return[o=255*c,o,o];e=2*c-(n=c<.5?c*(1+a):c+a-c*a),r=[0,0,0];for(var l=0;l<3;l++)(i=s+1/3*-(l-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[l]=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),s=255*i*(1-n),a=255*i*(1-n*o),c=255*i*(1-n*(1-o));switch(i*=255,r){case 0:return[i,c,s];case 1:return[a,i,s];case 2:return[s,i,c];case 3:return[s,a,i];case 4:return[c,s,i];case 5:return[i,s,a]}}function d(t){var e,n,i,o,s=t[0]/360,a=t[1]/100,c=t[2]/100,l=a+c;switch(l>1&&(a/=l,c/=l),i=6*s-(e=Math.floor(6*s)),1&e&&(i=1-i),o=a+i*((n=1-c)-a),e){default:case 6:case 0:r=n,g=o,b=a;break;case 1:r=o,g=n,b=a;break;case 2:r=a,g=n,b=o;break;case 3:r=a,g=o,b=n;break;case 4:r=o,g=a,b=n;break;case 5:r=n,g=a,b=o}return[255*r,255*g,255*b]}function u(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,s=t[2]/100;return n=-.9689*r+1.8758*o+.0415*s,i=.0557*r+-.204*o+1.057*s,e=(e=3.2406*r+-1.5372*o+-.4986*s)>.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 p(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 f(t){var e,n,i,r,o=t[0],s=t[1],a=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*(s/500+r-16/116)/7.787:95.047*Math.pow(s/500+r,3),n,i=i/108.883<=.008859?i=108.883*(r-a/200-16/116)/7.787:108.883*Math.pow(r-a/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(f(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:s,rgb2xyz:a,rgb2lab:c,rgb2lch:function(t){return v(c(t))},hsl2rgb:l,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(l(t))},hsl2cmyk:function(t){return o(l(t))},hsl2keyword:function(t){return s(l(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 s(h(t))},hwb2rgb:d,hwb2hsl:function(t){return e(d(t))},hwb2hsv:function(t){return n(d(t))},hwb2cmyk:function(t){return o(d(t))},hwb2keyword:function(t){return s(d(t))},cmyk2rgb:u,cmyk2hsl:function(t){return e(u(t))},cmyk2hsv:function(t){return n(u(t))},cmyk2hwb:function(t){return i(u(t))},cmyk2keyword:function(t){return s(u(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 c(x(t))},keyword2xyz:function(t){return a(x(t))},xyz2rgb:m,xyz2lab:p,xyz2lch:function(t){return v(p(t))},lab2xyz:f,lab2rgb:y,lab2lch:v,lch2lab:w,lch2xyz:function(t){return f(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},24:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_PARAM=void 0,e.DEFAULT_PARAM="$_DEFAULT_$"},43:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChunkedChannel=void 0;var i=n(520),r=n(266);const o=t=>{if(!t.chunkId)throw new Error(`ChunkedMessage did not have a chunkId: ${JSON.stringify(t)}`)};class s extends i.GenericChannel{constructor(t){super(t.timeout),this._chunkSize=void 0,this._maxStringAlloc=void 0,this._sender=void 0,this._buffer={},this._chunkSize=t.chunkSize,this._sender=t.sender,this._maxStringAlloc=t.maxStringAlloc||-1}send(t){const e=JSON.stringify(t);if(e.length<=this._chunkSize)return void this._sender(t);const n=(t=>{const e=new Uint16Array(t.length);for(let n=0,i=t.length;n<i;n++)e[n]=t.charCodeAt(n);return e})(e),i=[...Array(30)].map((()=>Math.random().toString(36)[3])).join("");this._sender({type:"chunk_start",chunkId:i,size:e.length});const r=(t=0)=>{let e=n.slice(t,t+this._chunkSize);e.length&&(this._sender({type:"chunk_data",chunkId:i,data:Array.from(e)}),r(t+this._chunkSize))};r(),this._sender({type:"chunk_end",chunkId:i})}_messageReceived(t){switch(t.type){case"chunk_start":this._receiveNewChunk(t);break;case"chunk_data":this._receiveChunkData(t);break;case"chunk_end":const e=this._mergeChunks(t);super._messageReceived(e);break;default:super._messageReceived(t)}}_receiveNewChunk(t){if(o(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}}_receiveChunkData(t){if(o(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)}_mergeChunks(t){if(o(t),!this._buffer[t.chunkId])throw new Error(`ChunkId ${t.chunkId} was not found in the buffer`);let e;const n=((t,e)=>{if(-1===e)return String.fromCharCode.apply(null,t);{let n="";for(let 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}})(this._buffer[t.chunkId].chunks.reduce(((t,e,n)=>(e.forEach(((e,n)=>t.uintArray[t.currentIx+n]=e)),t.currentIx+=e.length,t)),{uintArray:new Uint16Array(this._buffer[t.chunkId].size),currentIx:0}).uintArray,this._maxStringAlloc);try{e=JSON.parse(n)}catch(t){throw new Error(`Not a valid JSON string: ${n}`)}if(!(0,r.isTransportMessage)(e))throw new Error(`Not a transport message: ${JSON.stringify(e)}`);return e}}e.ChunkedChannel=s},119:(t,e,n)=>{"use strict";const i=n(865),r=n(201),o=new WeakMap,s=new WeakMap,a=(t,{cacheKey:e,cache:n=new Map,maxAge:o}={})=>{"number"==typeof o&&r(n);const a=function(...i){const r=e?e(i):i[0],s=n.get(r);if(s)return s.data;const a=t.apply(this,i);return n.set(r,{data:a,maxAge:o?Date.now()+o:Number.POSITIVE_INFINITY}),a};return i(a,t,{ignoreNonConfigurable:!0}),s.set(a,n),a};a.decorator=(t={})=>(e,n,i)=>{const r=e[n];if("function"!=typeof r)throw new TypeError("The decorated value must be a function");delete i.value,delete i.writable,i.get=function(){if(!o.has(this)){const e=a(r,t);return o.set(this,e),e}return o.get(this)}},a.clear=t=>{const e=s.get(t);if(!e)throw new TypeError("Can't clear a function that was not memoized!");if("function"!=typeof e.clear)throw new TypeError("The cache Map can't be cleared!");e.clear()},t.exports=a},196:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.combineEvents=function(...t){const e=t.reduce(((t,e)=>(t.push.apply(t,Object.keys(e)),t)),[]),n=[...new Set(e)];if(e.length>n.length)throw new Error("ts-event-bus: duplicate slots encountered in combineEvents.");return Object.assign({},...t)},e.createEventBus=function(t){const e=(t.channels||[]).map((e=>new r.Transport(e,t.ignoredEvents))),n={};for(const r in t.events)t.events.hasOwnProperty(r)&&(!t.ignoredEvents||t.ignoredEvents&&!t.ignoredEvents.includes(r))&&(n[r]=(0,i.connectSlot)(r,e,t.events[r].config));return n};var i=n(753),r=n(876)},201:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{c(i.next(t))}catch(t){o(t)}}function a(t){try{c(i.throw(t))}catch(t){o(t)}}function c(t){t.done?r(t.value):new n((function(e){e(t.value)})).then(s,a)}c((i=i.apply(t,e||[])).next())}))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=r(n(714));function s(t,e="maxAge"){let n,r,s;const a=()=>i(this,void 0,void 0,(function*(){if(void 0!==n)return;const a=a=>i(this,void 0,void 0,(function*(){s=o.default();const i=a[1][e]-Date.now();return i<=0?(t.delete(a[0]),void s.resolve()):(n=a[0],r=setTimeout((()=>{t.delete(a[0]),s&&s.resolve()}),i),"function"==typeof r.unref&&r.unref(),s.promise)}));try{for(const e of t)yield a(e)}catch(t){}n=void 0})),c=t.set.bind(t);return t.set=(e,i)=>{t.has(e)&&t.delete(e);const o=c(e,i);return n&&n===e&&(n=void 0,void 0!==r&&(clearTimeout(r),r=void 0),void 0!==s&&(s.reject(void 0),s=void 0)),a(),o},a(),t}e.default=s,t.exports=s,t.exports.default=s},266:(t,e)=>{"use strict";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":case"event_list":return!0;default:return!1}}},520:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GenericChannel=void 0,e.GenericChannel=class{constructor(t=5e3){this._timeout=t,this._onMessageCallbacks=[],this._onConnectCallbacks=[],this._onDisconnectCallbacks=[],this._onErrorCallbacks=[],this._ready=!1}get timeout(){return this._timeout}onData(t){-1===this._onMessageCallbacks.indexOf(t)&&this._onMessageCallbacks.push(t)}onConnect(t){this._ready&&t(),this._onConnectCallbacks.push(t)}onDisconnect(t){this._onDisconnectCallbacks.push(t)}onError(t){this._onErrorCallbacks.push(t)}_messageReceived(t){this._onMessageCallbacks.forEach((e=>e(t)))}_error(t){this._onErrorCallbacks.forEach((e=>e(t)))}_connected(){this._ready=!0,this._onConnectCallbacks.forEach((t=>t()))}_disconnected(){this._ready=!1,this._onDisconnectCallbacks.forEach((t=>t()))}}},526:()=>{},569:(t,e,n)=>{"use strict";Object.defineProperty(e,"NI",{enumerable:!0,get:function(){return i.slot}}),Object.defineProperty(e,"lV",{enumerable:!0,get:function(){return r.createEventBus}});var i=n(753),r=n(196);n(526),n(520),n(43),n(266),n(24)},699:(t,e,n)=>{var i=n(2),r=function(){return new l};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 s=/(\w+)2(\w+)/.exec(o),a=s[1],c=s[2];(r[a]=r[a]||{})[c]=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 l=function(){this.convs={}};l.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))},l.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},l.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){l.prototype[t]=function(e){return this.routeSpace(t,arguments)}})),t.exports=r},714:t=>{"use strict";t.exports=()=>{const t={};return t.promise=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),t}},753:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.slot=function(t=s){return a(t)},e.connectSlot=function(t,e,n={}){const o=e.reduce(((t,e,n)=>({...t,[n]:{}})),{[c]:{}}),s=e.reduce(((t,e,n)=>({...t,[n]:{}})),{}),a=(t,e)=>{let n=()=>{};const i=new Promise((t=>n=t));s[t][e]={registered:i,onRegister:n}},d=[],u=[],g=t=>d.forEach((e=>e(t))),m=t=>u.forEach((e=>e(t)));return e.forEach(((e,n)=>{e.addRemoteHandlerRegistrationCallback(t,((t=r.DEFAULT_PARAM,e)=>{if(!s[n])return;const i=o[n][t]||[];o[n][t]=i.concat(e),1===l(t,o).length&&g(t),s[n][t]||a(String(n),t),s[n][t].onRegister()})),e.addRemoteHandlerUnregistrationCallback(t,((t=r.DEFAULT_PARAM,e)=>{const i=(o[n][t]||[]).indexOf(e);i>-1&&o[n][t].splice(i,1),0===l(t,o).length&&m(t),s[n]&&a(String(n),t)})),e.addRemoteEventListChangedListener(t,(()=>{s[n]&&Object.keys(s[n]).forEach((t=>{s[n][t].onRegister()})),delete s[n]}))})),Object.assign((function(t,c){const h=2===arguments.length,d=h?c:t,u=h?t:r.DEFAULT_PARAM,g=()=>{const t=l(u,o);return(0,i.callHandlers)(d,t)};if(0===e.length)return g();const m=[];if(n.autoReconnect&&e.forEach((t=>{m.push(t.autoReconnect())})),n.noBuffer)return Promise.all(m).then((()=>g()));{e.forEach(((t,e)=>{s[e]&&!s[e][u]&&a(String(e),u)}));const t=e.reduce(((t,e,n)=>{var i;return[...t,...null!==(i=s[n]&&[s[n][u].registered])&&void 0!==i?i:[]]}),[]);return Promise.all(t).then((()=>g()))}}),{on:function(n,i){let s="",a=()=>new Promise((t=>t()));return"string"==typeof n?(s=n,a=i||a):(s=r.DEFAULT_PARAM,a=n),e.forEach((e=>e.registerHandler(t,s,a))),o[c][s]=(o[c][s]||[]).concat(a),1===l(s,o).length&&g(s),()=>{e.forEach((e=>e.unregisterHandler(t,s,a)));const n=(o[c][s]||[]).indexOf(a);-1!==n&&o[c][s].splice(n,1),0===l(s,o).length&&m(s)}},lazy:function(t,e){return d.push(t),u.push(e),h(o).forEach(t),()=>{h(o).forEach(e);const n=d.indexOf(t);n>-1&&d.splice(n,1);const i=u.indexOf(e);i>-1&&u.splice(i,1)}},config:n,slotName:t})},e.defaultSlotConfig=void 0;var i=n(933),r=n(24);const o=()=>{throw new Error("Slot not connected")},s={noBuffer:!1,autoReconnect:!0};e.defaultSlotConfig=s;const a=t=>Object.assign((()=>o()),{config:t,lazy:()=>o,on:()=>o,slotName:"Not connected"}),c="LOCAL_TRANSPORT",l=(t,e)=>Object.keys(e).reduce(((n,i)=>n.concat(e[i][t]||[])),[]),h=t=>Object.keys(t).reduce(((e,n)=>{const i=t[n],r=[...e,...Object.keys(i).filter((t=>(i[t]||[]).length>0))];return[...new Set(r)]}),[])},865:t=>{"use strict";const e=(t,e,i,r)=>{if("length"===i||"prototype"===i)return;if("arguments"===i||"caller"===i)return;const o=Object.getOwnPropertyDescriptor(t,i),s=Object.getOwnPropertyDescriptor(e,i);!n(o,s)&&r||Object.defineProperty(t,i,s)},n=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},i=(t,e)=>`/* Wrapped ${t}*/\n${e}`,r=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),o=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");t.exports=(t,n,{ignoreNonConfigurable:s=!1}={})=>{const{name:a}=t;for(const i of Reflect.ownKeys(n))e(t,n,i,s);return((t,e)=>{const n=Object.getPrototypeOf(e);n!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,n)})(t,n),((t,e,n)=>{const s=""===n?"":`with ${n.trim()}() `,a=i.bind(null,s,e.toString());Object.defineProperty(a,"name",o),Object.defineProperty(t,"toString",{...r,value:a})})(t,n,a),t}},876:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;var i=n(933);let r=0;e.Transport=class{constructor(t,e){this._channel=t,this._localHandlers={},this._localHandlerRegistrations={},this._remoteHandlers={},this._remoteHandlerRegistrationCallbacks={},this._remoteHandlerDeletionCallbacks={},this._remoteIgnoredEventsCallbacks={},this._pendingRequests={},this._channelReady=!1,this._channel.onData((t=>{switch(t.type){case"request":return this._requestReceived(t);case"response":return this._responseReceived(t);case"handler_registered":return this._registerRemoteHandler(t);case"handler_unregistered":return this._unregisterRemoteHandler(t);case"error":return this._errorReceived(t);case"event_list":return this._remoteIgnoredEventsReceived(t);default:(t=>{throw new Error(`Should not happen: ${t}`)})(t)}})),this._channel.onConnect((()=>{this._channelReady=!0,Object.keys(this._localHandlerRegistrations).forEach((t=>{this._localHandlerRegistrations[t].forEach((t=>{this._channel.send(t)}))})),e&&this._channel.send({type:"event_list",ignoredEvents:e})})),this._channel.onDisconnect((()=>{this._channelReady=!1,this._unregisterAllRemoteHandlers(),this._rejectAllPendingRequests(new Error("REMOTE_CONNECTION_CLOSED"))})),this._channel.onError((t=>this._rejectAllPendingRequests(t)))}_remoteIgnoredEventsReceived({ignoredEvents:t}){Object.keys(this._remoteIgnoredEventsCallbacks).forEach((e=>{t.includes(e)&&this._remoteIgnoredEventsCallbacks[e]()}))}_requestReceived({slotName:t,data:e,id:n,param:r}){const o=this._localHandlers[t];if(!o)return;const s=o[r];s&&(0,i.callHandlers)(e,s).then((async e=>{await this.autoReconnect(),this.isDisconnected()||this._channel.send({type:"response",slotName:t,id:n,data:e,param:r})})).catch((async e=>{await this.autoReconnect(),this.isDisconnected()||this._channel.send({id:n,message:`${e}`,param:r,slotName:t,stack:e.stack||"",type:"error"})}))}_responseReceived({slotName:t,data:e,id:n,param:i}){const r=this._pendingRequests[t];r&&r[i]&&r[i][n]&&(r[i][n].resolve(e),delete r[i][n])}_errorReceived({slotName:t,id:e,message:n,stack:i,param:r}){const o=this._pendingRequests[t];if(!o||!o[r]||!o[r][e])return;const s=new Error(`${n} on ${t} with param ${r}`);s.stack=i||s.stack,this._pendingRequests[t][r][e].reject(s),delete this._pendingRequests[t][r][e]}_registerRemoteHandler({slotName:t,param:e}){const n=this._remoteHandlerRegistrationCallbacks[t];if(!n)return;const i=this._remoteHandlers[t];if(i&&i[e])return;const o=n=>new Promise(((i,o)=>{if(!this._channelReady)return o(new Error(`CHANNEL_NOT_READY on ${t}`));const s=""+r++;this._pendingRequests[t]=this._pendingRequests[t]||{},this._pendingRequests[t][e]=this._pendingRequests[t][e]||{},this._pendingRequests[t][e][s]={resolve:i,reject:o},this._channel.send({type:"request",id:s,slotName:t,param:e,data:n}),setTimeout((()=>{const n=((this._pendingRequests[t]||{})[e]||{})[s];if(n){const i=new Error(`TIMED_OUT on ${t} with param ${e}`);n.reject(i),delete this._pendingRequests[t][e][s]}}),this._channel.timeout)}));this._remoteHandlers[t]=this._remoteHandlers[t]||{},this._remoteHandlers[t][e]=o,n(e,o)}_unregisterRemoteHandler({slotName:t,param:e}){const n=this._remoteHandlerDeletionCallbacks[t],i=this._remoteHandlers[t];if(!i)return;const r=i[e];r&&n&&(n(e,r),delete this._remoteHandlers[t][e])}_unregisterAllRemoteHandlers(){Object.keys(this._remoteHandlerDeletionCallbacks).forEach((t=>{const e=this._remoteHandlers[t];e&&Object.keys(e).filter((t=>e[t])).forEach((e=>this._unregisterRemoteHandler({slotName:t,param:e})))}))}_rejectAllPendingRequests(t){Object.keys(this._pendingRequests).forEach((e=>{Object.keys(this._pendingRequests[e]).forEach((n=>{Object.keys(this._pendingRequests[e][n]).forEach((i=>{this._pendingRequests[e][n][i].reject(t)}))})),this._pendingRequests[e]={}}))}addRemoteHandlerRegistrationCallback(t,e){this._remoteHandlerRegistrationCallbacks[t]||(this._remoteHandlerRegistrationCallbacks[t]=e)}addRemoteHandlerUnregistrationCallback(t,e){this._remoteHandlerDeletionCallbacks[t]||(this._remoteHandlerDeletionCallbacks[t]=e)}addRemoteEventListChangedListener(t,e){this._remoteIgnoredEventsCallbacks[t]||(this._remoteIgnoredEventsCallbacks[t]=e)}registerHandler(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){const n={type:"handler_registered",param:e,slotName:t};this._localHandlerRegistrations[e]=this._localHandlerRegistrations[e]||[],this._localHandlerRegistrations[e].push(n),this._channelReady&&this._channel.send(n)}}unregisterHandler(t,e,n){const i=this._localHandlers[t];if(i&&i[e]){const r=i[e].indexOf(n);if(r>-1&&(i[e].splice(r,1),0===i[e].length)){const n={type:"handler_unregistered",param:e,slotName:t};this._channelReady&&this._channel.send(n)}}}isDisconnected(){return!this._channelReady}autoReconnect(){if(this.isDisconnected()&&this._channel.autoReconnect){const t=new Promise((t=>{this._channel.onConnect((()=>t()))}));return this._channel.autoReconnect(),t}return Promise.resolve()}}},933:(t,e)=>{"use strict";function n(t,e){let 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?n(e[0],t):Promise.all(e.map((e=>n(e,t)))):new Promise((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 s=e[1],a="cmyk"===(c=s.replace(/a$/,""))?4:3;n=i[c],r=e[2].replace(/^\s+|\s+$/g,"").split(/\s*,\s*/).map((function(t,e){return/%$/.test(t)&&e===a?parseFloat(t)/100:(/%$/.test(t),parseFloat(t))})),s===c&&r.push(1),o=void 0===r[a]?1:r[a],r=r.slice(0,a),n[c]=function(){return r}}else if(/^#[A-Fa-f0-9]+$/.test(t)){var c;a=(c=t.replace(/^#/,"")).length,n=i.rgb,r=(r=c.split(3===a?/(.)/:/(..)/)).filter(Boolean).map((function(t){return 3===a?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 l={rgb:void 0,hsl:void 0,hsv:void 0,cmyk:void 0,keyword:void 0,hex:void 0};try{l.rgb=n.rgb(r)}catch(t){}try{l.hsl=n.hsl(r)}catch(t){}try{l.hsv=n.hsv(r)}catch(t){}try{l.cmyk=n.cmyk(r)}catch(t){}try{l.keyword=n.keyword(r)}catch(t){}return l.rgb&&(l.hex="#"+l.rgb.map((function(t){var e=t.toString(16);return 1===e.length?"0"+e:e})).join("")),l.rgb&&(l.rgba=l.rgb.concat(o)),l.hsl&&(l.hsla=l.hsl.concat(o)),l.hsv&&(l.hsva=l.hsv.concat(o)),l.cmyk&&(l.cmyka=l.cmyk.concat(o)),l}}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}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),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{JavascriptViewer:()=>ut,defaultsOptions:()=>dt});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 s(t){try{c(i.next(t))}catch(t){o(t)}}function a(t){try{c(i.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};var o=n(119);function s(t){return"string"==typeof t}function a(t,e,n){return n.indexOf(t)===e}function c(t){return-1===t.indexOf(",")?t:t.split(",")}function l(t){if(!t)return t;if("C"===t||"posix"===t||"POSIX"===t)return"en-US";if(-1!==t.indexOf(".")){var e=t.split(".")[0];return l(void 0===e?"":e)}if(-1!==t.indexOf("@")){var n=t.split("@")[0];return l(void 0===n?"":n)}if(-1===t.indexOf("-")||(i=t).toLowerCase()!==i)return t;var i,r=t.split("-"),o=r[0],s=r[1],a=void 0===s?"":s;return"".concat(o,"-").concat(a.toUpperCase())}var h=o((function(t){var e=void 0===t?{}:t,n=e.useFallbackLocale,i=void 0===n||n,r=e.fallbackLocale,o=void 0===r?"en-US":r,h=[];if("undefined"!=typeof navigator){for(var d=[],u=0,g=navigator.languages||[];u<g.length;u++){var m=g[u];d=d.concat(c(m))}var p=navigator.language,f=p?c(p):p;h=h.concat(d,f)}return i&&h.push(o),h.filter(s).map(l).filter(a)}),{cacheKey:JSON.stringify}),d=o((function(t){return h(t)[0]||null}),{cacheKey:JSON.stringify});const u=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 g{static getDragToRotate(t){const e=d();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 u.P)if(e.language===t)return e;const e=t.split("-").shift();for(const t of u.P)if(t.language===e)return t;return null}}var m=n(982);function p(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 f(t,e,n,i){const r=E(t),o=E(e),s=E(i);return b(I(i[0],C(r,s)),I(i[0],C(o,s)),n[0])}function v(t){return t.touches?x(t.touches):[R(t)]}function b(t,e,n){const{clientX:i,clientY:r}=t,{clientX:o,clientY:s}=e,{clientX:a,clientY:c}=n;return{clientX:i,clientY:r,deltaX:i-o,deltaY:r-s,distX:i-a,distY:r-c}}function y(t){return Math.sqrt(Math.pow(t[0].clientX-t[1].clientX,2)+Math.pow(t[0].clientY-t[1].clientY,2))}function w(t,e,n){return t.map(((t,i)=>b(t,e[i],n[i])))}function x(t){const e=Math.min(t.length,2),n=[];for(let i=0;i<e;++i)n.push(R(t[i]));return n}function R(t){return{clientX:t.clientX,clientY:t.clientY}}function E(t){return 1===t.length?t[0]:{clientX:(t[0].clientX+t[1].clientX)/2,clientY:(t[0].clientY+t[1].clientY)/2}}function I(t,e){return{clientX:t.clientX+e.clientX,clientY:t.clientY+e.clientY}}function C(t,e){return{clientX:t.clientX-e.clientX,clientY:t.clientY-e.clientY}}function k(t,e,n,i){t.addEventListener(e,n,i)}function S(t,e,n){t.removeEventListener(e,n)}function D(){return Date.now?Date.now():(new Date).getTime()}function _(t){const e=m(t);return e?{r:e.rgba[0],g:e.rgba[1],b:e.rgba[2],a:e.rgba[3]}:null}function P({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]=P({objects:[r,o]}):t[i]=o})),t)),{})}class N{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!important; align-items: center; flex-direction: column; width: 100%">\n <a title="${atob("QnV5IDM2MCBKYXZhc2NyaXB0IFZpZXdlciBsaWNlbnNl")}" target="_blank" href="${i}" style="opacity: 0.8!important;display: inline-block !important;">\n ${n} \n </a>\n <a href="${i}" style="text-decoration:none;color:#a5c100;font-size:10px;white-space: nowrap;display: inline-block !important;opacity: 1!important;">Free version</a> \n </div>`}static getMainColor(t){let e=_(t.dragToRotate.mainColor);return null===e&&(e={r:0,g:0,b:0,a:1}),e}static getTextColor(t){let e=_(t.dragToRotate.textColor);return null===e&&(e={r:0,g:0,b:0,a:1}),e}static getText(t){const e=g.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 M=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{c(i.next(t))}catch(t){o(t)}}function a(t){try{c(i.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};class T{static hideImage(t,e){const n=e.document.getElementById(t.id);n&&(n.style.display="none")}static addHiddenStyle(t,e){return M(this,arguments,void 0,(function*(t,e,n=100){return new Promise(((n,i)=>M(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 M(this,arguments,void 0,(function*(t,e,n=100){return new Promise(((i,r)=>M(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 M(this,arguments,void 0,(function*(t,e,n=100){return new Promise(((n,i)=>M(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);n&&(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,s,a,c;const l=t.document.createElement("div"),h=null!==(o=i[0])&&void 0!==o?o:null;if(r.autoCDNResizer&&r.zoom&&null!==h&&(null===(s=r.autoCDNResizerConfig)||void 0===s?void 0:s.scaleWithZoomMax)){if(null===(a=r.autoCDNResizerConfig)||void 0===a?void 0:a.useWidth){let t=h.naturalWidth;t/=r.zoomMax,l.style.maxWidth=`${t}px`}if(null===(c=r.autoCDNResizerConfig)||void 0===c?void 0:c.useHeight){let t=h.naturalHeight;t/=r.zoomMax,l.style.height=`${t}px`}}return l.style.padding="0",l.style.margin="0",l.style.position="relative",l.id=n,l}static removeElement(t){if(null!==t&&t&&t.parentNode&&t.hasChildNodes())try{t.parentNode.removeChild(t)}catch(t){return}}static getMainHolderElement(t,n){const i=n.document.getElementById(t);if(i instanceof HTMLDivElement)return i.style.position="relative",i;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())})),void 0!==t.alt&&(n.alt=t.alt),n}static setPointer(t,e){t.style.cursor=e}static setTouchAction(t,e){e&&(t.style.touchAction=e)}}class H{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,s=n.lastIndexOf("/")+1;if(-1!==(n=n.substr(s)).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,s){return a=this,c=void 0,h=function*(){return new Promise(((s,a)=>{var c,l;let h=[],d=0;if(o.imageUrls&&o.imageUrls.length>0)h=o.imageUrls,d=o.imageUrls.length;else{d=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 u=o.zoom?o.zoomMax:1;let g=t.clientWidth,m=t.clientHeight,p="";o.autoCDNResizer&&o.zoom&&(null===(c=o.autoCDNResizerConfig)||void 0===c?void 0:c.scaleWithZoomMax)&&(g*=u,m*=u,p=(null===(l=o.autoCDNResizerConfig)||void 0===l?void 0:l.useWidth)?"jsv-width-100":"jsv-height-100");const f=h.map(((t,e)=>{var i,r,s;if(o.autoCDNResizer){const e=new URL(t);if((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()),null===(s=o.autoCDNResizerConfig)||void 0===s?void 0:s.extraParams){const t=o.autoCDNResizerConfig.extraParams;for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const i=t[n];e.searchParams.set(n,i)}}t=e.toString()}return{src:t,id:n+e.toString(),sequence:e+1,encoded:"",extraClass:o.extraImageClass+" "+p,alt:o.imageAltText}}));let v=1;h=f.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=>{const e=[],n=[...t],i=Math.ceil(n.length/10);for(let t=0;t<i;t++)e.push(n.splice(0,10));return e})(t),o=t=>{const s=t.shift();void 0!==s&&i(s).then((()=>{0===r.length?e():o(t)})).catch((t=>{n(t)}))};o(r)}))}))}(h,0,{onSingleImageComplete:t=>{f[h.indexOf(t.url)].encoded="",f[h.indexOf(t.url)].naturalWidth=t.naturalWidth,f[h.indexOf(t.url)].naturalHeight=t.naturalHeight,i.loadImage({currentImage:v,totalImages:d,percentage:Math.round(v/d*100),image:f[v-1]}),v++},onSingleImageFail:t=>{a(new Error(t))}}).then((()=>{v-1===h.length?s(f):a(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=>{a(t)}))}))},new((l=void 0)||(l=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 l?r:new l((function(t){t(r)}))).then(n,i)}r((h=h.apply(a,c||[])).next())}));var a,c,l,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 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 T.addHiddenStyle(i,n,700)}static createOrGetPoweredBy(t,e,n,i,r){let o=Math.max(Math.floor(25*Math.random()),5);const s=btoa("powered_by_"+e),a=window.document.getElementById(s);if(a)return a;const c=n.document.createElement("div");c.style.top=`${o}%`,o=Math.max(Math.floor(15*Math.random()),5);const l=o%2==0;c.style[l?"left":"right"]=`${o}%`,c.style.position="absolute",c.style.display="flex",c.style.alignItems="right",c.style.justifyContent="top",c.id=s,c.style.zIndex="200",c.style.width="5%",c.style.minWidth="30px",c.className="jsv-hidden";const h=r?"":window.location.host;return c.innerHTML=N.getPoweredBy(t,h),i.appendChild(c),setTimeout((()=>{T.addShowStyle(s,window,3e3)}),300),c}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=N.getReadyForRotate(t)),!t.dragToRotate.showStartToRotateDefaultNotification&&t.dragToRotate.imageUrl.length>0&&(r.innerHTML=N.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 z=["textarea","input"],Y=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,th