!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["nativeshare.js"]=t():e["nativeshare.js"]=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||object.defineproperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esmodule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return object.prototype.hasownproperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function r(){}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,n=document.getelementsbytagname("script")[0],o=document.createelement("script");o.src=e,o.async=!0,n.parentnode.insertbefore(o,n),o.onload=t}function i(e,t){if(null==e)throw new typeerror("cannot convert undefined or null to object");for(var n=object(e),r=1;r1&&void 0!==arguments[1]&&arguments[1],n=[];for(var r in e)t?n.push(r+"="+encodeuricomponent(e[r])):n.push(r+"="+e[r]);return n.join("&")}function u(e){var t=document.createelement("a");return t.href=e,t.hostname}function l(e){oe?oe.content=e:document.head.insertadjacenthtml("beforeend",'')}function f(e){je?je.href=e:document.head.insertadjacenthtml("beforeend",'')}function s(e){document.title=e}function p(e){return c({share_id:924053302,url:_e.encode(e.link),title:_e.encode(e.title),description:_e.encode(e.desc),previewimageurl:_e.encode(e.icon),image_url:_e.encode(e.icon)})}function h(){a((se?"mqqapi://share/to_fri?src_type=web&version=1&file_type=news":"mqqapi://share/to_fri?src_type=isqqbrowser&version=1&file_type=news")+"&"+p(se))}function b(){a((se?"mqqapi://share/to_fri?file_type=news&src_type=web&version=1&generalpastboard=1&sharetype=1&cflag=1&objectlocation=pasteboard&callback_type=scheme&callback_name=qq41af4b2a":"mqqapi://share/to_qzone?src_type=isqqbrowser&version=1&file_type=news&req_type=1")+"&"+p(se))}function y(){var e={url:se.link,title:se.title,pic:se.icon,desc:se.desc};location.href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?"+c(e,!0)}function d(){var e={url:se.link,title:se.title,pic:se.icon};location.href="http://service.weibo.com/share/share.php?"+c(e,!0)}function w(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function v(e,t,n){return t in e?object.defineproperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function m(e,t){if(!e)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _(e,t){if("function"!=typeof t&&null!==t)throw new typeerror("super expression must either be null or a function, not "+typeof t);e.prototype=object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(object.setprototypeof?object.setprototypeof(e,t):e.__proto__=t)}function o(e,t,n){return t in e?object.defineproperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function s(e,t){if(!e)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function k(e,t){if("function"!=typeof t&&null!==t)throw new typeerror("super expression must either be null or a function, not "+typeof t);e.prototype=object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(object.setprototypeof?object.setprototypeof(e,t):e.__proto__=t)}function p(e,t,n){return t in e?object.defineproperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function q(e,t){if(!e)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function t(e,t){if("function"!=typeof t&&null!==t)throw new typeerror("super expression must either be null or a function, not "+typeof t);e.prototype=object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(object.setprototypeof?object.setprototypeof(e,t):e.__proto__=t)}function e(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function d(e,t){if(!e)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function x(e,t){if("function"!=typeof t&&null!==t)throw new typeerror("super expression must either be null or a function, not "+typeof t);e.prototype=object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(object.setprototypeof?object.setprototypeof(e,t):e.__proto__=t)}function q(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function m(e,t){if(!e)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function n(e,t){if("function"!=typeof t&&null!==t)throw new typeerror("super expression must either be null or a function, not "+typeof t);e.prototype=object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(object.setprototypeof?object.setprototypeof(e,t):e.__proto__=t)}function a(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function u(e,t){if(!e)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function b(e,t){if("function"!=typeof t&&null!==t)throw new typeerror("super expression must either be null or a function, not "+typeof t);e.prototype=object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(object.setprototypeof?object.setprototypeof(e,t):e.__proto__=t)}function r(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function w(e,t){if(!e)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new typeerror("super expression must either be null or a function, not "+typeof t);e.prototype=object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(object.setprototypeof?object.setprototypeof(e,t):e.__proto__=t)}function z(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function f(e,t){if(!e)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new typeerror("super expression must either be null or a function, not "+typeof t);e.prototype=object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(object.setprototypeof?object.setprototypeof(e,t):e.__proto__=t)}function z(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function j(e,t){if(!e)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function h(e,t){if("function"!=typeof t&&null!==t)throw new typeerror("super expression must either be null or a function, not "+typeof t);e.prototype=object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(object.setprototypeof?object.setprototypeof(e,t):e.__proto__=t)}function x(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function g(e,t){if(!e)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function k(e,t){if("function"!=typeof t&&null!==t)throw new typeerror("super expression must either be null or a function, not "+typeof t);e.prototype=object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(object.setprototypeof?object.setprototypeof(e,t):e.__proto__=t)}function v(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function y(e,t){if(!e)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function $(e,t){if("function"!=typeof t&&null!==t)throw new typeerror("super expression must either be null or a function, not "+typeof t);e.prototype=object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(object.setprototypeof?object.setprototypeof(e,t):e.__proto__=t)}function ee(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function te(e,t){if(!e)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function ne(e,t){if("function"!=typeof t&&null!==t)throw new typeerror("super expression must either be null or a function, not "+typeof t);e.prototype=object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(object.setprototypeof?object.setprototypeof(e,t):e.__proto__=t)}function re(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function oe(e,t){if(!e)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function ie(e,t){if("function"!=typeof t&&null!==t)throw new typeerror("super expression must either be null or a function, not "+typeof t);e.prototype=object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(object.setprototypeof?object.setprototypeof(e,t):e.__proto__=t)}object.defineproperty(t,"__esmodule",{value:!0});var ae,ce=navigator.useragent,ue=/(ipad).*os\s([\d_]+)/.test(ce),le=/(ipod)(.*os\s([\d_]+))?/.test(ce),fe=!ue&&/(iphone\sos)\s([\d_]+)/.test(ce),se=ue||le||fe,pe=/(android);?[\s\/]+([\d.]+)?/.test(ce),he=/micromessenger/i.test(ce),be=/qq\/([\d\.]+)/.test(ce),ye=/qzone\//.test(ce),de=/mqqbrowser/i.test(ce)&&!he&&!be,we=/ucbrowser/i.test(ce),ve=/mobile.*baidubrowser/i.test(ce),ge=/sogoumobilebrowser/i.test(ce),me=/baiduboxapp/i.test(ce),_e={_keystr:"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t,n,r,o,i,a,c,u="",l=0;for(e=_e._utf8_encode(e);l>2,i=(3&t)<<4|n>>4,a=(15&n)<<2|r>>6,c=63&r,isnan(n)?a=c=64:isnan(r)&&(c=64),u=u+this._keystr.charat(o)+this._keystr.charat(i)+this._keystr.charat(a)+this._keystr.charat(c);return u},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n127&&r<2048?(t+=string.fromcharcode(r>>6|192),t+=string.fromcharcode(63&r|128)):(t+=string.fromcharcode(r>>12|224),t+=string.fromcharcode(r>>6&63|128),t+=string.fromcharcode(63&r|128))}return t}},oe=document.queryselector("meta[name=description]"),je=document.queryselector("link[rel*=icon]"),se={link:location.href,title:function(){return document.title}(),desc:function(){return object(oe).content||""}(),icon:function(){return object(je).href||location.protocol+"//"+location.hostname+"/favicon.ico"}(),from:"",success:r,fail:r,trigger:r},ke=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};i(this._sharedata,e),this._config.syncdesctotag&&l(this._sharedata.desc),this._config.syncicontotag&&f(this._sharedata.icon),this._config.synctitletotag&&s(this._sharedata.title)}},{key:"setconfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this._config,e)}},{key:"getconfig",value:function(){return i({},this._config)}}]),e}(),ce=pe,qe=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments[1];this.setsharedata(t);var n=this.getsharedata(),r=this.constructor.commamdmap[string(e).tolowercase()];browser.app.share({title:n.title,description:n.desc,url:n.link,img_url:n.icon,from:n.from,to_app:r})}}]),t}(ce);te.commamdmap=(ae={},v(ae,"wechattimeline",8),v(ae,"wechatfriend",1),v(ae,"qqfriend",4),v(ae,"qzone",3),v(ae,"weibo",11),v(ae,"copyurl",10),v(ae,"more",5),v(ae,"generateqrcode",7),v(ae,"default",void 0),ae);var ee,de=te,xe=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments[1];this.setsharedata(t);var n=this.getsharedata(),r=this.constructor.commamdmap[string(e).tolowercase()];ucbrowser.web_shareex?ucbrowser.web_shareex(json.stringify({title:n.title,content:n.desc,sourceurl:n.link,imageurl:n.icon,source:n.from,target:r})):ucbrowser.web_share(title,desc,link,r,"",from,"")}}]),t}(ce);qe.commamdmap=(ee={},o(ee,"wechattimeline","kweixinfriend"),o(ee,"wechatfriend","kweixin"),o(ee,"qqfriend","kqq"),o(ee,"qzone","kqzone"),o(ee,"weibo","ksinaweibo"),o(ee,"default",void 0),ee);var me,ne=qe,ae=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments[1];this.setsharedata(t);var n=this.getsharedata(),r=this.constructor.commamdmap[string(e).tolowercase()];ucweb.startrequest("shell.page_share",[n.title,n.desc,n.link,r,"",n.from,n.icon])}}]),t}(ce);ue.commamdmap=(me={},p(me,"wechattimeline","wechattimeline"),p(me,"wechatfriend","wechatfriends"),p(me,"qqfriend","qq"),p(me,"qzone","qzone"),p(me,"weibo","sinaweibo"),p(me,"default",""),me);var be=ue,re=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments[1];if(this.setsharedata(t),"weibo"!==(e=string(e).tolowercase()))throw"qqfriend"===e?h():"qzone"===e&&b(),new error("the browser may not support command "+e+"!");d()}}]),t}(ce),et=$e,tt=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],arguments[1]);this.setsharedata(e),mqq.ui.showsharemenu()}},{key:"init",value:function(){var e=this;o("https://open.mobile.qq.com/sdk/qqapi.js",function(){var t=e._sharedata;mqq.ui.setonsharehandler(function(e){mqq.ui.sharemessage({back:!0,share_type:e,title:t.title,desc:t.desc,share_url:t.link,image_url:t.icon,sourcename:t.from},function(e){0===e.retcode?t.success(e):t.fail(e)})})})}}]),t}(ce),rt=nt,ot=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],arguments[1]);this.setsharedata(e),mqq.ui.showsharemenu()}},{key:"init",value:function(){var e=this;o("https://open.mobile.qq.com/sdk/qqapi.js",function(){e.setsharedata()})}}]),t}(ce),ct=at,ut=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],arguments[1]);this.setsharedata(t);for(var n=this.getsharedata(),r=[],o=[],i=[],a=[],c=0;c<5;c++)r.push(n.icon),a.push(n.link),o.push(n.title),i.push(n.desc);qzappexternal.setshare(function(t){0!=t.code&&(e.hassomethingwrong=!0)},{type:"share",image:r,title:o,summary:i,shareurl:a})}},{key:"setsharedata",value:function(e){try{this.call("default",e)}catch(e){}}},{key:"init",value:function(){var e=this;o("https://qzonestyle.gtimg.cn/qzone/phone/m/v4/widget/mobile/jsbridge.js",function(){e.call("default")})}}]),t}(ce),ft=lt,st=function(){function e(e,t){for(var n=0;n