text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.yjSharejs=t():e.yjSharejs=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.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(e){return e&&e.__esModule?e:{default:e}}var i=n(1),o=r(i),a=n(2),s=r(a),c={_shareData:{},_qrCodeData:{},initWx:function(e){var t=c;t._shareData=e,t.getJsSignInfo()},getQrCode:function(e){var t=c;t._qrCodeData=e;var n=document.querySelector(t._qrCodeData.qrCodeWrap);if(n.innerHTML="",new s.default(n,{width:120,height:120}).makeCode(t._qrCodeData.qrContent),t._qrCodeData.qrIco){n.style.position="relative";var r=document.createElement("img");r.src=t._qrCodeData.qrIco,r.id="yj-share-qrcode",r.style="position: absolute;top: 45px;left: 45px;border: 1px solid #fff;border-radius: 5px;background: #fff;",r.width=30,r.height=30,r.alt="Scan me!",n.appendChild(r)}},getJsSignInfo:function(){var e=c;e.ajax({url:"v1/mobile/getJsSignInfo",type:"POST",data:{url:window.location.href.split("#")[0]},dataType:"json",success:function(t,n){e.initWeixinJsSdk(JSON.parse(t).value.signInfo)},fail:function(e){}})},initWeixinJsSdk:function(e){var t=c,n=(window.location.host,{link:t._shareData.shareLink||null,title:t._shareData.shareTitle||null,desc:t._shareData.shareDec||null,imgUrl:t._shareData.shareImg||null});!function(){o.default.config({debug:!1,appId:e.appId,timestamp:e.timestamp,nonceStr:e.nonceStr,signature:e.signature,jsApiList:["onMenuShareTimeline","onMenuShareAppMessage"]});var t={title:n.title,desc:n.desc,link:n.link,imgUrl:n.imgUrl,type:"",dataUrl:"",success:function(){},cancel:function(){}},r={title:n.title,desc:n.desc,link:n.link,imgUrl:n.imgUrl,type:"",dataUrl:"",success:function(){},cancel:function(){}};o.default.ready(function(){o.default.onMenuShareTimeline(t),o.default.onMenuShareAppMessage(r)})}()},ajax:function(e){var t=window.location.host;e.url=window.location.protocol+"//"+t+"/"+e.url,e=e||{},e.type=(e.type||"GET").toUpperCase(),e.dataType=e.dataType||"json";var n=JSON.stringify(e.data);if(window.XMLHttpRequest)var r=new XMLHttpRequest;else var r=new ActiveXObject("Microsoft.XMLHTTP");r.onreadystatechange=function(){if(4==r.readyState){var t=r.status;t>=200&&t<300?e.success&&e.success(r.responseText,r.responseXML):e.fail&&e.fail(t)}},"GET"==e.type?(r.open("GET",e.url+"?"+n,!0),r.send(null)):"POST"==e.type&&(r.open("POST",e.url,!0),r.setRequestHeader("Content-Type","application/json"),r.send(n))}};e.exports=c},function(e,t){!function(t,n){e.exports=function(e,t){function n(t,n,r){e.WeixinJSBridge?WeixinJSBridge.invoke(t,i(n),function(e){s(t,e,r)}):l(t,r)}function r(t,n,r){e.WeixinJSBridge?WeixinJSBridge.on(t,function(e){r&&r.trigger&&r.trigger(e),s(t,e,n)}):r?l(t,r):l(t,n)}function i(e){return e=e||{},e.appId=M.appId,e.verifyAppId=M.appId,e.verifySignType="sha1",e.verifyTimestamp=M.timestamp+"",e.verifyNonceStr=M.nonceStr,e.verifySignature=M.signature,e}function o(e){return{timeStamp:e.timestamp+"",nonceStr:e.nonceStr,package:e.package,paySign:e.paySign,signType:e.signType||"SHA1"}}function a(e){return e.postalCode=e.addressPostalCode,delete e.addressPostalCode,e.provinceName=e.proviceFirstStageName,delete e.proviceFirstStageName,e.cityName=e.addressCitySecondStageName,delete e.addressCitySecondStageName,e.countryName=e.addressCountiesThirdStageName,delete e.addressCountiesThirdStageName,e.detailInfo=e.addressDetailInfo,delete e.addressDetailInfo,e}function s(e,t,n){"openEnterpriseChat"==e&&(t.errCode=t.err_code),delete t.err_code,delete t.err_desc,delete t.err_detail;var r=t.errMsg;r||(r=t.err_msg,delete t.err_msg,r=c(e,r),t.errMsg=r),n=n||{},n._complete&&(n._complete(t),delete n._complete),r=t.errMsg||"",M.debug&&!n.isInnerInvoke&&alert(JSON.stringify(t));var i=r.indexOf(":");switch(r.substring(i+1)){case"ok":n.success&&n.success(t);break;case"cancel":n.cancel&&n.cancel(t);break;default:n.fail&&n.fail(t)}n.complete&&n.complete(t)}function c(e,t){var n=e,r=m[n];r&&(n=r);var i="ok";if(t){var o=t.indexOf(":");i=t.substring(o+1),"confirm"==i&&(i="ok"),"failed"==i&&(i="fail"),-1!=i.indexOf("failed_")&&(i=i.substring(7)),-1!=i.indexOf("fail_")&&(i=i.substring(5)),i=i.replace(/_/g," "),i=i.toLowerCase(),("access denied"==i||"no permission to execute"==i)&&(i="permission denied"),"config"==n&&"function not exist"==i&&(i="ok"),""==i&&(i="fail")}return t=n+":"+i}function u(e){if(e){for(var t=0,n=e.length;n>t;++t){var r=e[t],i=g[r];i&&(e[t]=i)}return e}}function l(e,t){if(!(!M.debug||t&&t.isInnerInvoke)){var n=m[e];n&&(e=n),t&&t._complete&&delete t._complete}}function d(e){if(!(T||C||M.debug||"6.0.2">k||L.systemType<0)){var t=new Image;L.appId=M.appId,L.initTime=E.initEndTime-E.initStartTime,L.preVerifyTime=E.preVerifyEndTime-E.preVerifyStartTime,x.getNetworkType({isInnerInvoke:!0,success:function(e){L.networkType=e.networkType;var n="https://open.weixin.qq.com/sdk/report?v="+L.version+"&o="+L.isPreVerifyOk+"&s="+L.systemType+"&c="+L.clientVersion+"&a="+L.appId+"&n="+L.networkType+"&i="+L.initTime+"&p="+L.preVerifyTime+"&u="+L.url;t.src=n}})}}function h(){return(new Date).getTime()}function f(t){I&&(e.WeixinJSBridge?t():v.addEventListener&&v.addEventListener("WeixinJSBridgeReady",t,!1))}function p(){x.invoke||(x.invoke=function(t,n,r){e.WeixinJSBridge&&WeixinJSBridge.invoke(t,i(n),r)},x.on=function(t,n){e.WeixinJSBridge&&WeixinJSBridge.on(t,n)})}if(!e.jWeixin){var g={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",onMenuShareQZone:"menu:share:QZone",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest",openEnterpriseRedPacket:"getRecevieBizHongBaoRequest",startSearchBeacons:"startMonitoringBeacons",stopSearchBeacons:"stopMonitoringBeacons",onSearchBeacons:"onBeaconsInRange",consumeAndShareCard:"consumedShareCard",openAddress:"editAddress"},m=function(){var e={};for(var t in g)e[g[t]]=t;return e}(),v=e.document,_=v.title,y=navigator.userAgent.toLowerCase(),w=navigator.platform.toLowerCase(),T=!(!w.match("mac")&&!w.match("win")),C=-1!=y.indexOf("wxdebugger"),I=-1!=y.indexOf("micromessenger"),S=-1!=y.indexOf("android"),A=-1!=y.indexOf("iphone")||-1!=y.indexOf("ipad"),k=function(){var e=y.match(/micromessenger\/(\d+\.\d+\.\d+)/)||y.match(/micromessenger\/(\d+\.\d+)/);return e?e[1]:""}(),E={initStartTime:h(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},L={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",isPreVerifyOk:1,systemType:A?1:S?2:-1,clientVersion:k,url:encodeURIComponent(location.href)},M={},D={_completes:[]},P={state:0,data:{}};f(function(){E.initEndTime=h()});var B=!1,b=[],x={config:function(e){M=e,l("config",e);var t=!1!==M.check;f(function(){if(t)n(g.config,{verifyJsApiList:u(M.jsApiList)},function(){D._complete=function(e){E.preVerifyEndTime=h(),P.state=1,P.data=e},D.success=function(e){L.isPreVerifyOk=0},D.fail=function(e){D._fail?D._fail(e):P.state=-1};var e=D._completes;return e.push(function(){d()}),D.complete=function(t){for(var n=0,r=e.length;r>n;++n)e[n]();D._completes=[]},D}()),E.preVerifyStartTime=h();else{P.state=1;for(var e=D._completes,r=0,i=e.length;i>r;++r)e[r]();D._completes=[]}}),M.beta&&p()},ready:function(e){0!=P.state?e():(D._completes.push(e),!I&&M.debug&&e())},error:function(e){"6.0.2">k||(-1==P.state?e(P.data):D._fail=e)},checkJsApi:function(e){var t=function(e){var t=e.checkResult;for(var n in t){var r=m[n];r&&(t[r]=t[n],delete t[n])}return e};n("checkJsApi",{jsApiList:u(e.jsApiList)},function(){return e._complete=function(e){if(S){var n=e.checkResult;n&&(e.checkResult=JSON.parse(n))}e=t(e)},e}())},onMenuShareTimeline:function(e){r(g.onMenuShareTimeline,{complete:function(){n("shareTimeline",{title:e.title||_,desc:e.title||_,img_url:e.imgUrl||"",link:e.link||location.href,type:e.type||"link",data_url:e.dataUrl||""},e)}},e)},onMenuShareAppMessage:function(e){r(g.onMenuShareAppMessage,{complete:function(){n("sendAppMessage",{title:e.title||_,desc:e.desc||"",link:e.link||location.href,img_url:e.imgUrl||"",type:e.type||"link",data_url:e.dataUrl||""},e)}},e)},onMenuShareQQ:function(e){r(g.onMenuShareQQ,{complete:function(){n("shareQQ",{title:e.title||_,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},onMenuShareWeibo:function(e){r(g.onMenuShareWeibo,{complete:function(){n("shareWeiboApp",{title:e.title||_,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},onMenuShareQZone:function(e){r(g.onMenuShareQZone,{complete:function(){n("shareQZone",{title:e.title||_,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},startRecord:function(e){n("startRecord",{},e)},stopRecord:function(e){n("stopRecord",{},e)},onVoiceRecordEnd:function(e){r("onVoiceRecordEnd",e)},playVoice:function(e){n("playVoice",{localId:e.localId},e)},pauseVoice:function(e){n("pauseVoice",{localId:e.localId},e)},stopVoice:function(e){n("stopVoice",{localId:e.localId},e)},onVoicePlayEnd:function(e){r("onVoicePlayEnd",e)},uploadVoice:function(e){n("uploadVoice",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},downloadVoice:function(e){n("downloadVoice",{serverId:e.serverId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},translateVoice:function(e){n("translateVoice",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},chooseImage:function(e){n("chooseImage",{scene:"1|2",count:e.count||9,sizeType:e.sizeType||["original","compressed"],sourceType:e.sourceType||["album","camera"]},function(){return e._complete=function(e){if(S){var t=e.localIds;t&&(e.localIds=JSON.parse(t))}},e}())},getLocation:function(e){},previewImage:function(e){n(g.previewImage,{current:e.current,urls:e.urls},e)},uploadImage:function(e){n("uploadImage",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},downloadImage:function(e){n("downloadImage",{serverId:e.serverId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},getLocalImgData:function(e){!1===B?(B=!0,n("getLocalImgData",{localId:e.localId},function(){return e._complete=function(e){if(B=!1,b.length>0){var t=b.shift();wx.getLocalImgData(t)}},e}())):b.push(e)},getNetworkType:function(e){var t=function(e){var t=e.errMsg;e.errMsg="getNetworkType:ok";var n=e.subtype;if(delete e.subtype,n)e.networkType=n;else{var r=t.indexOf(":"),i=t.substring(r+1);switch(i){case"wifi":case"edge":case"wwan":e.networkType=i;break;default:e.errMsg="getNetworkType:fail"}}return e};n("getNetworkType",{},function(){return e._complete=function(e){e=t(e)},e}())},openLocation:function(e){n("openLocation",{latitude:e.latitude,longitude:e.longitude,name:e.name||"",address:e.address||"",scale:e.scale||28,infoUrl:e.infoUrl||""},e)},getLocation:function(e){e=e||{},n(g.getLocation,{type:e.type||"wgs84"},function(){return e._complete=function(e){delete e.type},e}())},hideOptionMenu:function(e){n("hideOptionMenu",{},e)},showOptionMenu:function(e){n("showOptionMenu",{},e)},closeWindow:function(e){e=e||{},n("closeWindow",{},e)},hideMenuItems:function(e){n("hideMenuItems",{menuList:e.menuList},e)},showMenuItems:function(e){n("showMenuItems",{menuList:e.menuList},e)},hideAllNonBaseMenuItem:function(e){n("hideAllNonBaseMenuItem",{},e)},showAllNonBaseMenuItem:function(e){n("showAllNonBaseMenuItem",{},e)},scanQRCode:function(e){e=e||{},n("scanQRCode",{needResult:e.needResult||0,scanType:e.scanType||["qrCode","barCode"]},function(){return e._complete=function(e){if(A){var t=e.resultStr;if(t){var n=JSON.parse(t);e.resultStr=n&&n.scan_code&&n.scan_code.scan_result}}},e}())},openAddress:function(e){n(g.openAddress,{},function(){return e._complete=function(e){e=a(e)},e}())},openProductSpecificView:function(e){n(g.openProductSpecificView,{pid:e.productId,view_type:e.viewType||0,ext_info:e.extInfo},e)},addCard:function(e){for(var t=e.cardList,r=[],i=0,o=t.length;o>i;++i){var a=t[i],s={card_id:a.cardId,card_ext:a.cardExt};r.push(s)}n(g.addCard,{card_list:r},function(){return e._complete=function(e){var t=e.card_list;if(t){t=JSON.parse(t);for(var n=0,r=t.length;r>n;++n){var i=t[n];i.cardId=i.card_id,i.cardExt=i.card_ext,i.isSuccess=!!i.is_succ,delete i.card_id,delete i.card_ext,delete i.is_succ}e.cardList=t,delete e.card_list}},e}())},chooseCard:function(e){n("chooseCard",{app_id:M.appId,location_id:e.shopId||"",sign_type:e.signType||"SHA1",card_id:e.cardId||"",card_type:e.cardType||"",card_sign:e.cardSign,time_stamp:e.timestamp+"",nonce_str:e.nonceStr},function(){return e._complete=function(e){e.cardList=e.choose_card_info,delete e.choose_card_info},e}())},openCard:function(e){for(var t=e.cardList,r=[],i=0,o=t.length;o>i;++i){var a=t[i],s={card_id:a.cardId,code:a.code};r.push(s)}n(g.openCard,{card_list:r},e)},consumeAndShareCard:function(e){n(g.consumeAndShareCard,{consumedCardId:e.cardId,consumedCode:e.code},e)},chooseWXPay:function(e){n(g.chooseWXPay,o(e),e)},openEnterpriseRedPacket:function(e){n(g.openEnterpriseRedPacket,o(e),e)},startSearchBeacons:function(e){n(g.startSearchBeacons,{ticket:e.ticket},e)},stopSearchBeacons:function(e){n(g.stopSearchBeacons,{},e)},onSearchBeacons:function(e){r(g.onSearchBeacons,e)},openEnterpriseChat:function(e){n("openEnterpriseChat",{useridlist:e.userIds,chatname:e.groupName},e)}},O=1,N={};return v.addEventListener("error",function(e){if(!S){var t=e.target,n=t.tagName,r=t.src;if("IMG"==n||"VIDEO"==n||"AUDIO"==n||"SOURCE"==n){if(-1!=r.indexOf("wxlocalresource://")){e.preventDefault(),e.stopPropagation();var i=t["wx-id"];if(i||(i=O++,t["wx-id"]=i),N[i])return;N[i]=!0,wx.getLocalImgData({localId:r,success:function(e){t.src=e.localData}})}}}},!0),v.addEventListener("load",function(e){if(!S){var t=e.target,n=t.tagName;if(t.src,"IMG"==n||"VIDEO"==n||"AUDIO"==n||"SOURCE"==n){var r=t["wx-id"];r&&(N[r]=!1)}}},!0),t&&(e.wx=e.jWeixin=x),x}}(t)}(window)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r;!function(){function e(e){this.mode=u.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,n=this.data.length;t<n;t++){var r=[],i=this.data.charCodeAt(t);i>65536?(r[0]=240|(1835008&i)>>>18,r[1]=128|(258048&i)>>>12,r[2]=128|(4032&i)>>>6,r[3]=128|63&i):i>2048?(r[0]=224|(61440&i)>>>12,r[1]=128|(4032&i)>>>6,r[2]=128|63&i):i>128?(r[0]=192|(1984&i)>>>6,r[1]=128|63&i):r[0]=i,this.parsedData.push(r)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function t(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function n(e,t){if(void 0==e.length)throw new Error(e.length+"/"+t);for(var n=0;n<e.length&&0==e[n];)n++;this.num=new Array(e.length-n+t);for(var r=0;r<e.length-n;r++)this.num[r]=e[r+n]}function i(e,t){this.totalCount=e,this.dataCount=t}function o(){this.buffer=[],this.length=0}function a(){var e=!1,t=navigator.userAgent;if(/android/i.test(t)){e=!0;var n=t.toString().match(/android ([0-9]\.[0-9])/i);n&&n[1]&&(e=parseFloat(n[1]))}return e}function s(e,t){for(var n=1,r=c(e),i=0,o=g.length;i<=o;i++){var a=0;switch(t){case l.L:a=g[i][0];break;case l.M:a=g[i][1];break;case l.Q:a=g[i][2];break;case l.H:a=g[i][3]}if(r<=a)break;n++}if(n>g.length)throw new Error("Too long data");return n}function c(e){var t=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=e?3:0)}e.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,n=this.parsedData.length;t<n;t++)e.put(this.parsedData[t],8)}},t.prototype={addData:function(t){var n=new e(t);this.dataList.push(n),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,n){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var i=0;i<this.moduleCount;i++)this.modules[r][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,n),this.typeNumber>=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=t.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,n)},setupPositionProbePattern:function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(this.modules[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},getBestMaskPattern:function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=h.getLostPoint(this);(0==n||e>r)&&(e=r,t=n)}return t},createMovieClip:function(e,t,n){var r=e.createEmptyMovieClip(t,n);this.make();for(var i=0;i<this.modules.length;i++)for(var o=1*i,a=0;a<this.modules[i].length;a++){var s=1*a,c=this.modules[i][a];c&&(r.beginFill(0,100),r.moveTo(s,o),r.lineTo(s+1,o),r.lineTo(s+1,o+1),r.lineTo(s,o+1),r.endFill())}return r},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)null==this.modules[e][6]&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)null==this.modules[6][t]&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=h.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var n=0;n<e.length;n++){var r=e[t],i=e[n];if(null==this.modules[r][i])for(var o=-2;o<=2;o++)for(var a=-2;a<=2;a++)this.modules[r+o][i+a]=-2==o||2==o||-2==a||2==a||0==o&&0==a}},setupTypeNumber:function(e){for(var t=h.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var r=!e&&1==(t>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(var n=0;n<18;n++){var r=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},setupTypeInfo:function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=h.getBCHTypeInfo(n),i=0;i<15;i++){var o=!e&&1==(r>>i&1);i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(var i=0;i<15;i++){var o=!e&&1==(r>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var n=-1,r=this.moduleCount-1,i=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[r][a-s]){var c=!1;o<e.length&&(c=1==(e[o]>>>i&1));var u=h.getMask(t,r,a-s);u&&(c=!c),this.modules[r][a-s]=c,i--,-1==i&&(o++,i=7)}if((r+=n)<0||this.moduleCount<=r){r-=n,n=-n;break}}}},t.PAD0=236,t.PAD1=17,t.createData=function(e,n,r){for(var a=i.getRSBlocks(e,n),s=new o,c=0;c<r.length;c++){var u=r[c];s.put(u.mode,4),s.put(u.getLength(),h.getLengthInBits(u.mode,e)),u.write(s)}for(var l=0,c=0;c<a.length;c++)l+=a[c].dataCount;if(s.getLengthInBits()>8*l)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+8*l+")");for(s.getLengthInBits()+4<=8*l&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;;){if(s.getLengthInBits()>=8*l)break;if(s.put(t.PAD0,8),s.getLengthInBits()>=8*l)break;s.put(t.PAD1,8)}return t.createBytes(s,a)},t.createBytes=function(e,t){for(var r=0,i=0,o=0,a=new Array(t.length),s=new Array(t.length),c=0;c<t.length;c++){var u=t[c].dataCount,l=t[c].totalCount-u;i=Math.max(i,u),o=Math.max(o,l),a[c]=new Array(u);for(var d=0;d<a[c].length;d++)a[c][d]=255&e.buffer[d+r];r+=u;var f=h.getErrorCorrectPolynomial(l),p=new n(a[c],f.getLength()-1),g=p.mod(f);s[c]=new Array(f.getLength()-1);for(var d=0;d<s[c].length;d++){var m=d+g.getLength()-s[c].length;s[c][d]=m>=0?g.get(m):0}}for(var v=0,d=0;d<t.length;d++)v+=t[d].totalCount;for(var _=new Array(v),y=0,d=0;d<i;d++)for(var c=0;c<t.length;c++)d<a[c].length&&(_[y++]=a[c][d]);for(var d=0;d<o;d++)for(var c=0;c<t.length;c++)d<s[c].length&&(_[y++]=s[c][d]);return _};for(var u={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},l={L:1,M:0,Q:3,H:2},d={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},h={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;h.getBCHDigit(t)-h.getBCHDigit(h.G15)>=0;)t^=h.G15<<h.getBCHDigit(t)-h.getBCHDigit(h.G15);return(e<<10|t)^h.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;h.getBCHDigit(t)-h.getBCHDigit(h.G18)>=0;)t^=h.G18<<h.getBCHDigit(t)-h.getBCHDigit(h.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return h.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case d.PATTERN000:return(t+n)%2==0;case d.PATTERN001:return t%2==0;case d.PATTERN010:return n%3==0;case d.PATTERN011:return(t+n)%3==0;case d.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case d.PATTERN101:return t*n%2+t*n%3==0;case d.PATTERN110:return(t*n%2+t*n%3)%2==0;case d.PATTERN111:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new n([1],0),r=0;r<e;r++)t=t.multiply(new n([1,f.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case u.MODE_NUMBER:return 10;case u.MODE_ALPHA_NUM:return 9;case u.MODE_8BIT_BYTE:case u.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case u.MODE_NUMBER:return 12;case u.MODE_ALPHA_NUM:return 11;case u.MODE_8BIT_BYTE:return 16;case u.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else{if(!(t<41))throw new Error("type:"+t);switch(e){case u.MODE_NUMBER:return 14;case u.MODE_ALPHA_NUM:return 13;case u.MODE_8BIT_BYTE:return 16;case u.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}}},getLostPoint:function(e){for(var t=e.getModuleCount(),n=0,r=0;r<t;r++)for(var i=0;i<t;i++){for(var o=0,a=e.isDark(r,i),s=-1;s<=1;s++)if(!(r+s<0||t<=r+s))for(var c=-1;c<=1;c++)i+c<0||t<=i+c||0==s&&0==c||a==e.isDark(r+s,i+c)&&o++;o>5&&(n+=3+o-5)}for(var r=0;r<t-1;r++)for(var i=0;i<t-1;i++){var u=0;e.isDark(r,i)&&u++,e.isDark(r+1,i)&&u++,e.isDark(r,i+1)&&u++,e.isDark(r+1,i+1)&&u++,0!=u&&4!=u||(n+=3)}for(var r=0;r<t;r++)for(var i=0;i<t-6;i++)e.isDark(r,i)&&!e.isDark(r,i+1)&&e.isDark(r,i+2)&&e.isDark(r,i+3)&&e.isDark(r,i+4)&&!e.isDark(r,i+5)&&e.isDark(r,i+6)&&(n+=40);for(var i=0;i<t;i++)for(var r=0;r<t-6;r++)e.isDark(r,i)&&!e.isDark(r+1,i)&&e.isDark(r+2,i)&&e.isDark(r+3,i)&&e.isDark(r+4,i)&&!e.isDark(r+5,i)&&e.isDark(r+6,i)&&(n+=40);for(var l=0,i=0;i<t;i++)for(var r=0;r<t;r++)e.isDark(r,i)&&l++;return n+=Math.abs(100*l/t/t-50)/5*10}},f={glog:function(e){if(e<1)throw new Error("glog("+e+")");return f.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return f.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},p=0;p<8;p++)f.EXP_TABLE[p]=1<<p;for(var p=8;p<256;p++)f.EXP_TABLE[p]=f.EXP_TABLE[p-4]^f.EXP_TABLE[p-5]^f.EXP_TABLE[p-6]^f.EXP_TABLE[p-8];for(var p=0;p<255;p++)f.LOG_TABLE[f.EXP_TABLE[p]]=p;n.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var i=0;i<e.getLength();i++)t[r+i]^=f.gexp(f.glog(this.get(r))+f.glog(e.get(i)));return new n(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=f.glog(this.get(0))-f.glog(e.get(0)),r=new Array(this.getLength()),i=0;i<this.getLength();i++)r[i]=this.get(i);for(var i=0;i<e.getLength();i++)r[i]^=f.gexp(f.glog(e.get(i))+t);return new n(r,0).mod(e)}},i.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],i.getRSBlocks=function(e,t){var n=i.getRsBlockTable(e,t);if(void 0==n)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var r=n.length/3,o=[],a=0;a<r;a++)for(var s=n[3*a+0],c=n[3*a+1],u=n[3*a+2],l=0;l<s;l++)o.push(new i(c,u));return o},i.getRsBlockTable=function(e,t){switch(t){case l.L:return i.RS_BLOCK_TABLE[4*(e-1)+0];case l.M:return i.RS_BLOCK_TABLE[4*(e-1)+1];case l.Q:return i.RS_BLOCK_TABLE[4*(e-1)+2];case l.H:return i.RS_BLOCK_TABLE[4*(e-1)+3];default:return}},o.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var g=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],m=function(){var e=function(e,t){this._el=e,this._htOption=t};return e.prototype.draw=function(e){function t(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg",e);for(var r in t)t.hasOwnProperty(r)&&n.setAttribute(r,t[r]);return n}var n=this._htOption,r=this._el,i=e.getModuleCount();Math.floor(n.width/i),Math.floor(n.height/i);this.clear();var o=t("svg",{viewBox:"0 0 "+String(i)+" "+String(i),width:"100%",height:"100%",fill:n.colorLight});o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),r.appendChild(o),o.appendChild(t("rect",{fill:n.colorLight,width:"100%",height:"100%"})),o.appendChild(t("rect",{fill:n.colorDark,width:"1",height:"1",id:"template"}));for(var a=0;a<i;a++)for(var s=0;s<i;s++)if(e.isDark(a,s)){var c=t("use",{x:String(s),y:String(a)});c.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),o.appendChild(c)}},e.prototype.clear=function(){for(;this._el.hasChildNodes();)this._el.removeChild(this._el.lastChild)},e}(),v="svg"===document.documentElement.tagName.toLowerCase(),_=v?m:function(){return"undefined"!=typeof CanvasRenderingContext2D}()?function(){function e(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}function t(e,t){var n=this;if(n._fFail=t,n._fSuccess=e,null===n._bSupportDataURI){var r=document.createElement("img"),i=function(){n._bSupportDataURI=!1,n._fFail&&n._fFail.call(n)},o=function(){n._bSupportDataURI=!0,n._fSuccess&&n._fSuccess.call(n)};return r.onabort=i,r.onerror=i,r.onload=o,void(r.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==")}!0===n._bSupportDataURI&&n._fSuccess?n._fSuccess.call(n):!1===n._bSupportDataURI&&n._fFail&&n._fFail.call(n)}var n=function(e,t){this._bIsPainted=!1,this._android=a(),this._htOption=t,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=t.width,this._elCanvas.height=t.height,e.appendChild(this._elCanvas),this._el=e,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return n.prototype.draw=function(e){var t=this._elImage,n=this._oContext,r=this._htOption,i=e.getModuleCount(),o=r.width/i,a=r.height/i,s=Math.round(o),c=Math.round(a);t.style.display="none",this.clear();for(var u=0;u<i;u++)for(var l=0;l<i;l++){var d=e.isDark(u,l),h=l*o,f=u*a;n.strokeStyle=d?r.colorDark:r.colorLight,n.lineWidth=1,n.fillStyle=d?r.colorDark:r.colorLight,n.fillRect(h,f,o,a),n.strokeRect(Math.floor(h)+.5,Math.floor(f)+.5,s,c),n.strokeRect(Math.ceil(h)-.5,Math.ceil(f)-.5,s,c)}this._bIsPainted=!0},n.prototype.makeImage=function(){this._bIsPainted&&t.call(this,e)},n.prototype.isPainted=function(){return this._bIsPainted},n.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},n.prototype.round=function(e){return e?Math.floor(1e3*e)/1e3:e},n}():function(){var e=function(e,t){this._el=e,this._htOption=t};return e.prototype.draw=function(e){for(var t=this._htOption,n=this._el,r=e.getModuleCount(),i=Math.floor(t.width/r),o=Math.floor(t.height/r),a=['<table style="border:0;border-collapse:collapse;">'],s=0;s<r;s++){a.push("<tr>");for(var c=0;c<r;c++)a.push('<td style="border:0;border-collapse:collapse;padding:0;margin:0;width:'+i+"px;height:"+o+"px;background-color:"+(e.isDark(s,c)?t.colorDark:t.colorLight)+';"></td>');a.push("</tr>")}a.push("</table>"),n.innerHTML=a.join("");var u=n.childNodes[0],l=(t.width-u.offsetWidth)/2,d=(t.height-u.offsetHeight)/2;l>0&&d>0&&(u.style.margin=d+"px "+l+"px")},e.prototype.clear=function(){this._el.innerHTML=""},e}();r=function(e,t){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:l.H},"string"==typeof t&&(t={text:t}),t)for(var n in t)this._htOption[n]=t[n];"string"==typeof e&&(e=document.getElementById(e)),this._htOption.useSVG&&(_=m),this._android=a(),this._el=e,this._oQRCode=null,this._oDrawing=new _(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},r.prototype.makeCode=function(e){this._oQRCode=new t(s(e,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(e),this._oQRCode.make(),this._oDrawing.draw(this._oQRCode),this.makeImage()},r.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},r.prototype.clear=function(){this._oDrawing.clear()},r.CorrectLevel=l}(),t.default=r}])});