/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
import{inherits as e,createSuper as t,classCallCheck as a,createClass as r}from"../../_virtual/_rollupPluginBabelHelpers.js";import i from"../../utils/util.js";import{ENDED as l,PLAY as n}from"../../events.js";import o from"../../plugin/plugin.js";import s from"../assets/replay.js";var p=/* @__PURE__ */function(){e(u,o);var p=t(u);function u(){return a(this,u),p.apply(this,arguments)}return r(u,[{key:"registerIcons",value:function(){return{replay:s}}},{key:"afterCreate",value:function(){var e=this;o.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayClick",function(){e.player.replay()},{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(l,function(){if(e.playerConfig.loop||i.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var a=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof a&&a.indexOf("none")>-1)return null;t.setAttribute("transform",a)}}}),this.on(n,function(){e.hide()})}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),i.removeClass(this.player.root,"replay")}},{key:"show",value:function(e){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return'<xg-replay class="xgplayer-replay">\n      <xg-replay-txt class="xgplayer-replay-txt" lang-key="'.concat(this.i18nKeys.REPLAY,'">').concat(this.i18n.REPLAY,"</xg-replay-txt>\n    </xg-replay>")}}],[{key:"pluginName",get:function(){return"replay"}},{key:"defaultConfig",get:function(){return{disable:!1}}}]),u}();export{p as default};