/*!
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 s,createSuper as e,classCallCheck as t,createClass as i,get as n,getPrototypeOf as l}from"../../_virtual/_rollupPluginBabelHelpers.js";import{CSS_FULLSCREEN_CHANGE as r}from"../../events.js";import{POSITIONS as c}from"../../plugin/plugin.js";import{xgIconTips as a}from"../common/iconTools.js";import o from"../common/iconPlugin.js";import u from"../assets/requestCssFull.js";import h from"../assets/exitCssFull.js";var f=/* @__PURE__ */function(){s(p,o);var f=e(p);function p(){return t(this,p),f.apply(this,arguments)}return i(p,[{key:"beforeCreate",value:function(s){"boolean"==typeof s.player.config.cssFullscreen&&(s.config.disable=!s.player.config.cssFullscreen)}},{key:"afterCreate",value:function(){var s=this;n(l(p.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(r,function(e){s.animate(e)}),this.btnClick=this.btnClick.bind(this),this.handleCssFullscreen=this.hook("cssFullscreen_change",this.btnClick,{pre:function(s){s.preventDefault(),s.stopPropagation()}}),this.bind(["click","touchend"],this.handleCssFullscreen))}},{key:"initIcons",value:function(){var s=this.icons,e=this.find(".xgplayer-icon");e.appendChild(s.cssFullscreen),e.appendChild(s.exitCssFullscreen)}},{key:"btnClick",value:function(s){s.preventDefault(),s.stopPropagation();var e=this.player.isCssfullScreen;this.emitUserAction(s,"switch_cssfullscreen",{cssfullscreen:e}),e?this.player.exitCssFullscreen():this.player.getCssFullscreen()}},{key:"animate",value:function(s){this.root&&(s?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.switchTips(s))}},{key:"switchTips",value:function(s){var e=this.i18nKeys,t=this.find(".xg-tips");t&&this.changeLangTextKey(t,s?e.EXITCSSFULLSCREEN_TIPS:e.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:u,class:"xg-get-cssfull"},exitCssFullscreen:{icon:h,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){n(l(p.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return"<xg-icon class='xgplayer-cssfullscreen'>\n    <div class=\"xgplayer-icon\">\n    </div>\n    ".concat(a(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n    </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:c.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),p}();export{f as default};