var e=function(){return(e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&a[a.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]=0&&e._handleList.splice(n,1),window.removeEventListener("message",t,!1)},e.empty=function(){for(;e._handleList.length;)window.removeEventListener("message",e._handleList.shift(),!1)},e.parse=function(e){return"object"==typeof e?e:JSON.parse(e)},e._handleList=[],e}();var a,o,i,c=this;!function(e){e.unknown="unknown",e.spreadsheet="s",e.writer="w",e.presentation="p",e.pdf="f"}(a||(a={})),function(e){e.wps="w",e.et="s",e.presentation="p",e.pdf="f"}(o||(o={})),function(e){e.nomal="nomal",e.simple="simple"}(i||(i={}));var s,u,p=(s=0,function(){return++s}),l=function(e,t){if(!u){(u=document.createElement("iframe")).classList.add("web-office-iframe");var n={id:"office-iframe",src:e,scrolling:"no",frameborder:"0",allowfullscreen:"allowfullscreen",webkitallowfullscreen:"true",mozallowfullscreen:"true",style:"width: 100%; height: 100%;"};for(var r in t||((t=document.createElement("div")).classList.add("web-office-default-container"),function(e){var t=document.createElement("style");document.head.appendChild(t);var n=t.sheet;n.insertRule(e,n.cssRules.length)}(".web-office-default-container {position: absolute; padding: 0; margin: 0; width: 100vw; height: 100vh; left: 0; top: 0;}"),document.body.appendChild(t)),n)u.setAttribute(r,n[r]);t.appendChild(u),u.destroy=function(){u.parentNode.removeChild(u),u=null}}return u},f=function(e){l().contentWindow.postMessage(JSON.stringify(e),"*")},d=function(e){return new Promise(function(t){var n=p(),a=function(e){var o=r.parse(e.data);"wps.api.reply"===o.eventName&&o.msgId===n&&(t(o.data),r.remove(a))};r.add(a),f({eventName:"wps.jssdk.api",data:e,msgId:n})})},v=function(a,o,i,s){return t(c,void 0,void 0,function(){var c,u,l,d,v,m,h,w;return n(this,function(y){switch(y.label){case 0:return c=p(),d=new Promise(function(e,t){u=e,l=t}),v={},o.args?[4,b(o.args)]:[3,2];case 1:m=y.sent(),h=m[0],w=m[1],o.args=h,v=w,y.label=2;case 2:return function(t){var n=t[0],r=t[1];"function"==typeof(n=e({},n)).data&&(n.data=n.data());r(),f(n)}([{eventName:a,data:o,msgId:c},function(){var e=this,o=function(p){return t(e,void 0,void 0,function(){var e,t,d;return n(this,function(n){switch(n.label){case 0:return"api.callback"===(e=r.parse(p.data)).eventName&&e.callbackId&&v[e.callbackId]?[4,v[e.callbackId].apply(v,e.data.args)]:[3,2];case 1:t=n.sent(),f({eventName:"api.callback.reply",result:t,callbackId:e.callbackId}),n.label=2;case 2:return e.eventName===a+".reply"&&e.msgId===c&&(e.error?((d=new Error("")).stack=e.error+"\n"+i,s&&s(),l(d)):u(e.result),r.remove(o)),[2]}})})};return r.add(o),d}]),[2,d]}})})};function b(e){return t(this,void 0,void 0,function(){var t,r,a,o,i,c,s;return n(this,function(n){switch(n.label){case 0:t={},r=[],e=e.slice(0),n.label=1;case 1:return e.length?(a=void 0,[4,e.shift()]):[3,3];case 2:if(o=n.sent(),function(e){if(!e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(a))for(i in a={},o)"function"==typeof(c=o[i])&&(s=p(),t[s]=c,c={callbackId:s}),a[i]=c;else"function"==typeof o?(s=p(),t[s]=o,a={callbackId:s}):a=o;return r.push(a),[3,1];case 3:return[2,[r,t]]}})})}var m=function(t,n){void 0===n&&(n=!0);var r=e({},t),a=r.headers,o=void 0===a?{}:a,c=r.subscriptions,s=void 0===c?{}:c,u=r.mode,p=void 0===u?i.nomal:u,l=o.backBtn,f=void 0===l?{}:l,d=o.shareBtn,v=void 0===d?{}:d,b=o.otherMenuBtn,m=void 0===b?{}:b,h=function(e,t){e.subscribe&&"function"==typeof e.subscribe&&(e.callback=t,s[t]=e.subscribe,n&&delete e.subscribe)};if(h(f,"wpsconfig_back_btn"),h(v,"wpsconfig_share_btn"),h(m,"wpsconfig_other_menu_btn"),m.items&&Array.isArray(m.items)){var w=[];m.items.forEach(function(e,t){switch(void 0===e&&(e={}),e.type){case"export_img":e.type=1,e.callback="export_img";break;case"export_pdf":e.type=1,e.callback="export_pdf";break;case"save_version":e.type=1,e.callback="save_version";break;case"about_wps":e.type=1,e.callback="about_wps";break;case"split_line":e.type=2;break;case"custom":e.type=3,h(e,"wpsconfig_other_menu_btn_"+t),w.push(e)}}),w.length&&(j||I)&&(m.items=w)}if(r.url=r.url||r.wpsUrl,(p===i.simple||r.commonOptions&&!1===r.commonOptions.isShowTopArea)&&r.url&&(r.url+="&simple&hidecmb"),r.debug&&r.url&&(r.url+="&debugger"),r.wordOptions&&(r.wpsOptions=r.wordOptions),r.excelOptions&&(r.etOptions=r.excelOptions),r.pptOptions&&(r.wppOptions=r.pptOptions),"object"==typeof s.print){var y="wpsconfig_print";"function"==typeof s.print.subscribe&&(s[y]=s.print.subscribe,r.print={callback:y},void 0!==s.print.custom&&(r.print.custom=s.print.custom)),delete s.print}"function"==typeof s.exportPdf&&(s[y="wpsconfig_export_pdf"]=s.exportPdf,r.exportPdf={callback:y},delete s.exportPdf);return e({},r,{subscriptions:s})},h=function(e){void 0===e&&(e="");var t="";if(!t&&e){var n=e.toLowerCase();-1!==n.indexOf("/office/s/")&&(t=a.spreadsheet),-1!==n.indexOf("/office/w/")&&(t=a.writer),-1!==n.indexOf("/office/p/")&&(t=a.presentation),-1!==n.indexOf("/office/f/")&&(t=a.pdf)}if(!t){var r=e.match(/[\?&]type=([a-z]+)/)||[];t=o[r[1]]||""}return t};function w(e,t){void 0===t&&(t=!0);var n=e.map(function(e){var t=e.attributes;if(!Array.isArray(t)){var n=[];for(var r in t)if(t.hasOwnProperty(r)){var a={name:r,value:t[r]};n.push(a)}e.attributes=n}return e});return t&&f({eventName:"setCommandBars",data:n}),n}var y,g=window.navigator.userAgent.toLowerCase(),j=/Android|webOS|iPhone|iPod|BlackBerry|iPad/i.test(g),I=function(){try{return-1!==window._parent.location.search.indexOf("from=wxminiprogram")}catch(e){return!1}}();function k(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}!function(e){e[e.msoFalse=0]="msoFalse",e[e.msoTrue=-1]="msoTrue"}(y||(y={}));var O=0,_=new Set;function x(e){return++O,!e&&function(e){_.forEach(function(t){return t(e)})}(O),O}function E(o,i){var c,s=this,u=i.Events,p=i.Enum,l=i.Props,d=l[0],b=l[1],m={objId:O};switch(function t(n,r,a){r=r.slice(0);var o=function(){var o=r.shift();!o.alias&&~C.indexOf(o.prop)&&r.push(e({},o,{alias:o.prop+"Async"})),Object.defineProperty(n,o.alias||o.prop,{get:function(){var r=this,i=1===o.cache,c=i&&this["__"+o.prop+"CacheValue"];if(c)return c;var s=new Error(""),u=s.stack.split("\n").slice(2).join("\n"),p=x(i),l=function(){for(var t,r=[],i=0;i