"use strict";var _constant=require("../../../utils/constant");function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function _objectSpread(t){for(var e=1;e=r.length)&&(c.activeTab=0),e.setData(c),r.length||e.hideDrawer()}}}})}}},lifetimes:{detached:function(){"function"==typeof this.unsub&&this.unsub(),this.unsub=null,this.unbindIconClick()}},methods:{showDrawer:function(){this.selectComponent("#volc-drawer-rich-text-portrait").showFrame()},hideDrawer:function(){var t,e;null===(t=this.selectComponent("#volc-drawer-rich-text-portrait"))||void 0===t||null===(e=t.hideFrame)||void 0===e||e.call(t,{silent:!0})},bindIconClick:function(){var t=this;this.unbindIconClick(),this.sdkInstance&&(this._onBottomIconClick=function(e){var n;"RICHTEXT"===(null==e||null===(n=e.icon)||void 0===n?void 0:n.key)&&t.showDrawer()},this._bottomIconClickSdk=this.sdkInstance,this.sdkInstance.on(_constant.EVENTS.PUBLIC.bottomIcon.click,this._onBottomIconClick))},unbindIconClick:function(){var t,e;this._bottomIconClickSdk&&this._onBottomIconClick&&(null===(t=(e=this._bottomIconClickSdk).off)||void 0===t||t.call(e,_constant.EVENTS.PUBLIC.bottomIcon.click,this._onBottomIconClick)),this._bottomIconClickSdk=null,this._onBottomIconClick=null},onTabClick:function(t){var e=t.detail.index;this.setData({activeTab:e})},onChange:function(t){var e=t.detail.index;this.setData({activeTab:e})}}});