Web-Archives-Misc/public/Archive/retrogamesbot.com/21.chunk.js
2023-01-16 18:46:17 +01:00

15 lines
4.8 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{300:function(t,o,i){t.exports=function(){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var t,o=function(){return(o=Object.assign||function(t){for(var o,i=1,s=arguments.length;i<s;i++)for(var e in o=arguments[i])Object.prototype.hasOwnProperty.call(o,e)&&(t[e]=o[e]);return t}).apply(this,arguments)};!function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(t||(t={}));var i={prefix:"smartour",padding:5,maskColor:"rgba(0, 0, 0, .5)",animate:!0,slotPosition:t.TOP};return function(){function t(t){void 0===t&&(t={}),this.options=o({},i,{layerEvent:this.over.bind(this)},t),this.mask=null,this.slot=null,this.layer=null}return t.prototype._createMask=function(){this.mask||(this.mask=document.createElement("div"),this.mask.setAttribute("class",this.options.prefix+"-mask"),this.mask.setAttribute("style","\nposition: absolute;\nborder-radius: 4px;\nbox-shadow: 0 0 0 9999px "+this.options.maskColor+";\nz-index: 10001 !important;\ntransition: all .3s;\n"),document.body.appendChild(this.mask))},t.prototype._createSlot=function(t){this.slot||(this.slot=document.createElement("div"),this.slot.setAttribute("style","\nposition: absolute;\nz-index: 10002 !important;\ntransition: all .3s;\n"),document.body.appendChild(this.slot)),this.slot.setAttribute("class",this.options.prefix+"-slot "+this.options.prefix+"-slot_"+this.options.slotPosition),this.slot.innerHTML=t},t.prototype._createLayer=function(){this.layer||(this.layer=document.createElement("div"),this.layer.setAttribute("class",this.options.prefix+"-layer"),this.layer.setAttribute("style","\nposition: fixed;\ntop: 0;\nleft: 0;\nright: 0;\nbottom: 0;\nz-index: 10000 !important;\n"),this.layer.addEventListener("click",this.options.layerEvent),document.body.appendChild(this.layer))},t.prototype._setPosition=function(t,o){["top","left","width","height"].forEach((function(i,s){if(o[s])if("top"===i||"left"===i){var e="scroll"+(i.charAt(0).toUpperCase()+i.slice(1)),n=0;n=document.documentElement&&document.documentElement[e]?document.documentElement[e]:document.body[e],t.style[i]=o[s]+n+"px"}else t.style[i]=o[s]+"px"}))},t.prototype._show=function(t,o,i){var s,e,n,r;void 0===o&&(o=""),void 0===i&&(i=[]),this._createMask(),this._createSlot(o),this._createLayer(),this.options.animate||(this.mask.style.transition=null,this.slot.style.transition=null);var h=document.querySelector(t).getBoundingClientRect(),l=h.top,a=h.left,p=h.width,u=h.height,d=[l-this.options.padding,a-this.options.padding,p+2*this.options.padding,u+2*this.options.padding],c=d[0],m=d[1],y=d[2],f=d[3];this._setPosition(this.mask,[c,m,y,f]);var v=this.slot.getBoundingClientRect(),b=v.width,g=v.height,k=this.options.slotPosition,x=[0,0],w=x[0],E=x[1];"top"===k?(w=(s=[c-g,m+y/2-b/2])[0],E=s[1]):"bottom"===k?(w=(e=[c+f,m+y/2-b/2])[0],E=e[1]):"left"===k?(w=(n=[c-(g-f)/2,m-b])[0],E=n[1]):"right"===k&&(w=(r=[c-(g-f)/2,m+y])[0],E=r[1]),this._setPosition(this.slot,[w,E]),o||(document.body.removeChild(this.slot),this.slot=null),i.length&&i.forEach((function(t){var o=t.el,i=t.event;document.querySelector(o).addEventListener("click",i)}))},t.prototype.focus=function(t){void 0===t&&(t={el:"",slot:"",keyNodes:[],options:{}}),t.options&&Object.keys(t.options).length&&(this.options=o({},this.options,t.options)),this._show(t.el,t.slot,t.keyNodes)},t.prototype.queue=function(t){return this.tourList=t,this.tourListLength=t.length,this.tourIndex=-1,this},t.prototype.run=function(t){if(void 0===t&&(t=!0),this.tourListLength&&this.tourIndex<this.tourListLength-1){t?this.tourIndex++:this.tourIndex--;var i=this.tourList[this.tourIndex];i.options&&(this.options=o({},this.options,i.options)),this._show(i.el,i.slot,i.keyNodes)}else this.over()},t.prototype.next=function(){this.run(!0)},t.prototype.prev=function(){this.run(!1)},t.prototype.over=function(){var t=this;this.mask&&document.body.removeChild(this.mask),this.slot&&document.body.removeChild(this.slot),this.layer&&document.body.removeChild(this.layer),["mask","slot","layer"].forEach((function(o){t[o]=null}))},t}()}()}}]);