UNPKG

@ezuikit/theme-plugin-snapshot

Version:

回放主题

31 lines (30 loc) 9.26 kB
/* * * @ezuikit/theme-plugin-snapshot v0.1.0 * Copyright (c) 2024-3-23 Ezviz-OpenBiz * Released under MIT the License. * */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).ThemePluginSnapshot=t()}(this,(function(){"use strict"; /* * * @ezuikit/utils-dom v1.0.1-alpha.1 * Copyright (c) 2024-3-23 Ezviz-OpenBiz * Released under MIT the License. * */var e="ezui";function t(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),i=1;i<t;i++)o[i-1]=arguments[i];var n;e&&(o=o.filter((function(e){return e&&!!e.replace(/ /g,"")})),(n=e.classList).add.apply(n,[].concat(o)))}!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===o&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".ezui-icon{align-items:center;color:inherit;display:inline-flex;font-style:normal;line-height:0;text-align:center;text-rendering:optimizeLegibility;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ezui-icon svg{display:inline-block}");const o=o=>{const i="camera"; /* * * @ezuikit/icons v0.1.0 * Copyright (c) 2024-3-23 Ezviz-OpenBiz * Released under MIT the License. * */ return function(o){var i;const n=`${e}-icon`,r=document.createElement("span");return r.className="",t(r,`${n}`,`${n}-${o.name}`,null!==(i=null==o?void 0:o.className)&&void 0!==i?i:""),r.setAttribute("role","img"),r.innerHTML=o.svg,r}({name:i,svg:null!=o?o:`<svg\n viewBox="1 1 19 19"\n focusable="false"\n data-icon="${i}"\n width="1em"\n height="1em"\n fill="currentColor"\n aria-hidden="true"\n >\n <path d="M10.8,7.7c-2,0-3.7,1.6-3.7,3.7S8.7,15,10.8,15c2,0,3.7-1.6,3.7-3.7S12.8,7.7,10.8,7.7z M10.8,8.7c1.5,0,2.7,1.2,2.7,2.7S12.2,14,10.8,14c-1.5,0-2.7-1.2-2.7-2.7S9.3,8.7,10.8,8.7z" />\n <path d="M8.6,3.7l-0.1,0C8,3.7,7.7,4,7.5,4.3l-1,1.7l-1.3,0C4,6.1,3.1,7,3.1,8.2v7.1 c0,1.2,0.9,2.1,2.1,2.1h11.1c1.2,0,2.1-0.9,2.1-2.1V8.2l0-0.1c-0.1-1.1-1-1.9-2.1-1.9l-1.3,0l-1.1-1.8c-0.2-0.4-0.7-0.6-1.1-0.6H8.6 z M8.6,4.7h4.2c0.1,0,0.2,0.1,0.3,0.1l1.2,2c0.1,0.2,0.3,0.2,0.4,0.2h1.6c0.6,0,1.1,0.5,1.1,1.1v7.1c0,0.6-0.5,1.1-1.1,1.1H5.1 c-0.6,0-1.1-0.5-1.1-1.1V8.2c0-0.6,0.5-1.1,1.1-1.1h1.6c0.2,0,0.3-0.1,0.4-0.2l1.2-2C8.4,4.7,8.5,4.7,8.6,4.7z" />\n </svg>`})}; /* * * @ezuikit/theme-plugin-footer v0.1.0 * Copyright (c) 2024-3-23 Ezviz-OpenBiz * Released under MIT the License. * */!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===o&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(":root{--font-size:14px;--color:#fff;--background-color:#000;--active-color:#1890ff;--botton-color:var(--color);--botton-border-color:var(--color);--footer-height:48px;--footer-icon-size:27px;--footer-color:--color;--footer-background-color:var(--background-color,#000);--footer-active-color:var(--active-color,#1890ff);--header-height:var(--footer-height,48px);--header-icon-size:27px;--header-color:var(--footer-color);--header-background-color:var(-footer-bg-color,#000);--header-active-color:var(--footer-active-color,#1890ff);--date-picker-header-height:34px;--date-picker-color:#595959;--date-picker-primary-color:#1890ff;--date-picker-font-size:14px;--date-picker-border-color:rgba(5,5,5,.06);--date-picker-disable-border-color:rgba(0,0,0,.2);--data-picker-scrollbar-width:8px;--data-picker-border-radius:2px}.ezui-footer{background-color:#000;bottom:0;box-sizing:border-box;color:var(--ezui-footer-color,#fff);display:flex;flex-direction:column;height:var(--ezui-footer-height,48px);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ezui-footer-top{background-color:var(--ezui-footer-background-color,rgba(0,0,0,.5));bottom:var(--ezui-footer-height,48px);display:flex;flex-direction:row;justify-content:space-between;left:0;opacity:1;pointer-events:all;position:absolute;right:0;transition:opacity .3s ease;z-index:999}.ezui-footer-top-hidden{opacity:0;pointer-events:none}.ezui-footer-bottom .ezui-footer-item,.ezui-footer-left>.ezui-footer-item,.ezui-footer-left>span,.ezui-footer-right>.ezui-footer-item,.ezui-footer-right>span{align-items:center;cursor:pointer;display:inline-flex;font-size:var(--ezui-footer-icon-size,27px);justify-content:center;min-height:var(--ezui-footer-height,48px);width:var(--ezui-footer-height,48px)}.ezui-footer-left,.ezui-footer-right{box-sizing:border-box;display:flex;padding-left:12px;padding-right:12px}.ezui-footer-bottom{background-color:#000;color:#fff;display:flex;flex-direction:row;height:var(--ezui-footer-height,48px);justify-content:space-between}.ezui-footer-bottom .ezui-footer-bottom-item{align-items:center;cursor:pointer;display:inline-flex;font-size:20px;justify-content:center;min-height:var(--ezui-footer-height,48px);width:var(--ezui-footer-height,48px)}.ezui-footer-bottom-left{flex:1 1 auto}.ezui-footer-bottom-right{align-items:center;display:inline-flex;flex-direction:row;font-size:22px;justify-content:flex-end}.ezui-footer-bottom-right .ezui-icon{align-items:center;box-sizing:border-box;cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;padding-left:9px;padding-right:9px}.ezui-footer-mobile-extend{background-color:#fff;color:#000;display:flex;flex-direction:column}.ezui-footer-mobile-extend-type{display:flex;justify-content:space-between}.ezui-footer-mobile-extend-type .ezui-icon{color:#000}.ezui-theme-mobile .ezui-footer-top{bottom:0}");const i=`${`${e}-footer`}-left`;var n="object"==typeof global&&global&&global.Object===Object&&global,r="object"==typeof self&&self&&self.Object===Object&&self,a=n||r||Function("return this")(),l=a.Symbol,c=Object.prototype,f=c.hasOwnProperty,u=c.toString,s=l?l.toStringTag:void 0;var d=Object.prototype.toString;var p="[object Null]",h="[object Undefined]",g=l?l.toStringTag:void 0;function v(e){return null==e?void 0===e?h:p:g&&g in Object(e)?function(e){var t=f.call(e,s),o=e[s];try{e[s]=void 0;var i=!0}catch(e){}var n=u.call(e);return i&&(t?e[s]=o:delete e[s]),n}(e):function(e){return d.call(e)}(e)}var m="[object Symbol]";var b=/\s/;var x=/^\s+/;function y(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&b.test(e.charAt(t)););return t}(e)+1).replace(x,""):e}function z(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var w=NaN,j=/^[-+]0x[0-9a-f]+$/i,T=/^0b[01]+$/i,k=/^0o[0-7]+$/i,S=parseInt;function C(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&v(e)==m}(e))return w;if(z(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=z(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=y(e);var o=T.test(e);return o||k.test(e)?S(e.slice(2),o?2:8):j.test(e)?w:+e}var $=function(){return a.Date.now()},E="Expected a function",N=Math.max,O=Math.min;function A(e,t,o){var i,n,r,a,l,c,f=0,u=!1,s=!1,d=!0;if("function"!=typeof e)throw new TypeError(E);function p(t){var o=i,r=n;return i=n=void 0,f=t,a=e.apply(r,o)}function h(e){var o=e-c;return void 0===c||o>=t||o<0||s&&e-f>=r}function g(){var e=$();if(h(e))return v(e);l=setTimeout(g,function(e){var o=t-(e-c);return s?O(o,r-(e-f)):o}(e))}function v(e){return l=void 0,d&&i?p(e):(i=n=void 0,a)}function m(){var e=$(),o=h(e);if(i=arguments,n=this,c=e,o){if(void 0===l)return function(e){return f=e,l=setTimeout(g,t),u?p(e):a}(c);if(s)return clearTimeout(l),l=setTimeout(g,t),p(c)}return void 0===l&&(l=setTimeout(g,t)),a}return t=C(t)||0,z(o)&&(u=!!o.leading,r=(s="maxWait"in o)?N(C(o.maxWait)||0,t):r,d="trailing"in o?!!o.trailing:d),m.cancel=function(){void 0!==l&&clearTimeout(l),f=0,i=c=n=l=void 0},m.flush=function(){return void 0===l?a:v($())},m}var L="Expected a function";return function(n){return function(r){const a=r,l=o(null==n?void 0:n.icon),c=a.$container.querySelector(`.${i}`);return t(l,`${e}-disable`),l.addEventListener("click",function(e,t,o){var i=!0,n=!0;if("function"!=typeof e)throw new TypeError(L);return z(o)&&(i="leading"in o?!!o.leading:i,n="trailing"in o?!!o.trailing:n),A(e,t,{leading:i,maxWait:t,trailing:n})}((()=>{var t,o;l.classList.contains(`${e}-disable`)||(r.options.ignoreDownloadSnapshot||(null==n?void 0:n.ignoreDownloadSnapshot)?a.player.snapshot(null!==(t=null==n?void 0:n.name)&&void 0!==t?t:(new Date).getTime()):a.player.snapshot(null!==(o=null==n?void 0:n.name)&&void 0!==o?o:(new Date).getTime(),"jpeg","",!0))}),200)),c&&c.appendChild(l),a.event.on("EVENT_CALLBACK",(t=>{"appearFirstFrameCallback"===t.data.type&&function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),i=1;i<t;i++)o[i-1]=arguments[i];var n;e&&(n=e.classList).remove.apply(n,[].concat(o))}(l,`${e}-disable`)})),["urlChange","pause","stop"].forEach((o=>{a.event.on(o,(()=>{t(l,`${e}-disable`)}))})),l}}}));