"use strict";(self.webpackChunkflow_web_extension=self.webpackChunkflow_web_extension||[]).push([["64801"],{74663:function(e,n,o){o.r(n),o.d(n,{DoubaoCommandService:()=>l});class r{registerCommandProcessor(e){this._processor=e}registerCommandHandler(e){this._handler=e}dispatchCommandEvent(e){var n,o,r,i=null===(o=this._processor)||void 0===o?void 0:null===(n=o.process)||void 0===n?void 0:n.call(o,e);i&&(null===(r=this._handler)||void 0===r||r.handle(i))}}var i=o(491995),d={process(e){var n,{data:o}=e;return o.event_type===i.t.Cmd?{cmd:null===(n=o.cmd)||void 0===n?void 0:n.cmd_type,data:{version:"1.0",data:o.cmd}}:o.cmd?{cmd:o.cmd,data:{version:"2.0",data:o.downlink_body}}:void 0}},c=o(515042),a=o(763136),s=o(41139),t={handle:e=>{e.cmd&&e.data&&(0,c.Me)().then(n=>{var o=n.filter(n=>{var o;return null===(o=n.matchPlugin)||void 0===o?void 0:o.call(n,e)}).map(e=>e.pluginIdentifier);if(s.k.console.info({message:"Received Cmd: ".concat(e.cmd)}),!o.length){s.k.console.info({message:"Skip Cmd: ".concat(e.cmd)});return}(0,a.$h)(o).then(n=>{n.forEach(n=>{var o;return null==n?void 0:null===(o=n.handleCmd)||void 0===o?void 0:o.call(n,e)})})})}};class l{dispatchCommandEvent(e){this.coreService.dispatchCommandEvent(e)}constructor({externalService:e}){var n;this.coreService=new r,this.coreService.registerCommandProcessor(d),this.coreService.registerCommandHandler(t),this.externalService=e,null===(n=e.socketClient)||void 0===n||n.on("message",this.coreService.dispatchCommandEvent.bind(this.coreService))}}}}]);
//# sourceMappingURL=64801.js.map