UNPKG

dwt

Version:

Dynamic Web TWAIN is a TWAIN/ICA/SANE-based scanning SDK software specifically designed for web applications running on Windows/macOS/Linux. With just a few lines of code, you can develop robust applications to scan documents from TWAIN/ICA/SANE-compatibl

121 lines 136 kB
/** * Dynamsoft JavaScript Library * @product Dynamsoft Barcode Reader * @website http://www.dynamsoft.com * @preserve Copyright 2020, Dynamsoft Corporation * @author Dynamsoft * @version 7.3.0 202001091800 * @fileoverview Dynamsoft JavaScript Library for Dynamsoft Barcode Reader * More info on DBR: http://www.dynamsoft.com/Products/Dynamic-Barcode-Reader.aspx */ var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,e){if(e.get||e.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[c]=e.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_"; $jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(a){return $jscomp.SYMBOL_PREFIX+(a||"")+$jscomp.symbolCounter_++}; $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(a){var c=0;return $jscomp.iteratorPrototype(function(){return c<a.length?{done:!1,value:a[c++]}:{done:!0}})}; $jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(a,c){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var e=0,f={next:function(){if(e<a.length){var d=e++;return{value:c(d,a[d]),done:!1}}f.next=function(){return{done:!0,value:void 0}};return f.next()}};f[Symbol.iterator]=function(){return f};return f}; $jscomp.polyfill=function(a,c,e,f){if(c){e=$jscomp.global;a=a.split(".");for(f=0;f<a.length-1;f++){var d=a[f];d in e||(e[d]={});e=e[d]}a=a[a.length-1];f=e[a];c=c(f);c!=f&&null!=c&&$jscomp.defineProperty(e,a,{configurable:!0,writable:!0,value:c})}};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(a){return a})}},"es6-impl","es3"); $jscomp.checkStringArgs=function(a,c,e){if(null==a)throw new TypeError("The 'this' value for String.prototype."+e+" must not be null or undefined");if(c instanceof RegExp)throw new TypeError("First argument to String.prototype."+e+" must not be a regular expression");return a+""}; $jscomp.polyfill("String.prototype.endsWith",function(a){return a?a:function(a,e){var c=$jscomp.checkStringArgs(this,a,"endsWith");a+="";void 0===e&&(e=c.length);for(var d=Math.max(0,Math.min(e|0,c.length)),b=a.length;0<b&&0<d;)if(c[--d]!=a[--b])return!1;return 0>=b}},"es6-impl","es3"); $jscomp.polyfill("String.prototype.startsWith",function(a){return a?a:function(a,e){var c=$jscomp.checkStringArgs(this,a,"startsWith");a+="";for(var d=c.length,b=a.length,g=Math.max(0,Math.min(e|0,c.length)),k=0;k<b&&g<d;)if(c[g++]!=a[k++])return!1;return k>=b}},"es6-impl","es3");$jscomp.findInternal=function(a,c,e){a instanceof String&&(a=String(a));for(var f=a.length,d=0;d<f;d++){var b=a[d];if(c.call(e,b,d,a))return{i:d,v:b}}return{i:-1,v:void 0}}; $jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,e){return $jscomp.findInternal(this,a,e).v}},"es6-impl","es3");$jscomp.makeIterator=function(a){$jscomp.initSymbolIterator();var c=a[Symbol.iterator];return c?c.call(a):$jscomp.arrayIterator(a)};$jscomp.EXPOSE_ASYNC_EXECUTOR=!0;$jscomp.FORCE_POLYFILL_PROMISE=!1; $jscomp.polyfill("Promise",function(a){function c(){this.batch_=null}if(a&&!$jscomp.FORCE_POLYFILL_PROMISE)return a;c.prototype.asyncExecute=function(b){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(b);return this};c.prototype.asyncExecuteBatch_=function(){var b=this;this.asyncExecuteFunction(function(){b.executeBatch_()})};var e=$jscomp.global.setTimeout;c.prototype.asyncExecuteFunction=function(b){e(b,0)};c.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var b= this.batch_;this.batch_=[];for(var a=0;a<b.length;++a){var d=b[a];delete b[a];try{d()}catch(h){this.asyncThrow_(h)}}}this.batch_=null};c.prototype.asyncThrow_=function(b){this.asyncExecuteFunction(function(){throw b;})};var f=function(b){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var a=this.createResolveAndReject_();try{b(a.resolve,a.reject)}catch(k){a.reject(k)}};f.prototype.createResolveAndReject_=function(){function b(b){return function(g){d||(d=!0,b.call(a,g))}}var a=this,d= !1;return{resolve:b(this.resolveTo_),reject:b(this.reject_)}};f.prototype.resolveTo_=function(b){if(b===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(b instanceof f)this.settleSameAsPromise_(b);else{var a;a:switch(typeof b){case "object":a=null!=b;break a;case "function":a=!0;break a;default:a=!1}a?this.resolveToNonPromiseObj_(b):this.fulfill_(b)}};f.prototype.resolveToNonPromiseObj_=function(b){var a=void 0;try{a=b.then}catch(k){this.reject_(k);return}"function"== typeof a?this.settleSameAsThenable_(a,b):this.fulfill_(b)};f.prototype.reject_=function(b){this.settle_(2,b)};f.prototype.fulfill_=function(b){this.settle_(1,b)};f.prototype.settle_=function(b,a){if(0!=this.state_)throw Error("Cannot settle("+b+", "+a|"): Promise already settled in state"+this.state_);this.state_=b;this.result_=a;this.executeOnSettledCallbacks_()};f.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var b=this.onSettledCallbacks_,a=0;a<b.length;++a)b[a].call(), b[a]=null;this.onSettledCallbacks_=null}};var d=new c;f.prototype.settleSameAsPromise_=function(b){var a=this.createResolveAndReject_();b.callWhenSettled_(a.resolve,a.reject)};f.prototype.settleSameAsThenable_=function(b,a){var g=this.createResolveAndReject_();try{b.call(a,g.resolve,g.reject)}catch(h){g.reject(h)}};f.prototype.then=function(b,a){function g(b,a){return"function"==typeof b?function(a){try{d(b(a))}catch(m){c(m)}}:a}var d,c,e=new f(function(b,a){d=b;c=a});this.callWhenSettled_(g(b,d), g(a,c));return e};f.prototype["catch"]=function(b){return this.then(void 0,b)};f.prototype.callWhenSettled_=function(b,a){function g(){switch(h.state_){case 1:b(h.result_);break;case 2:a(h.result_);break;default:throw Error("Unexpected state: "+h.state_);}}var h=this;null==this.onSettledCallbacks_?d.asyncExecute(g):this.onSettledCallbacks_.push(function(){d.asyncExecute(g)})};f.resolve=function(b){return b instanceof f?b:new f(function(a,d){a(b)})};f.reject=function(b){return new f(function(a,d){d(b)})}; f.race=function(b){return new f(function(a,d){for(var g=$jscomp.makeIterator(b),c=g.next();!c.done;c=g.next())f.resolve(c.value).callWhenSettled_(a,d)})};f.all=function(b){var a=$jscomp.makeIterator(b),d=a.next();return d.done?f.resolve([]):new f(function(b,g){function c(a){return function(g){h[a]=g;k--;0==k&&b(h)}}var h=[],k=0;do h.push(void 0),k++,f.resolve(d.value).callWhenSettled_(c(h.length-1),g),d=a.next();while(!d.done)})};$jscomp.EXPOSE_ASYNC_EXECUTOR&&(f.$jscomp$new$AsyncExecutor=function(){return new c}); return f},"es6-impl","es3");var dynamsoft=dynamsoft||{}; (function(a,c,e){if(!(c._preDefine_ver&&20190506<=c._preDefine_ver)){c._preDefine_ver=20190506;var f=function(b,a){for(var g in a)a.hasOwnProperty(g)&&(b[g]=a[g]);return b},d=function(b){if(null==b||"object"!=typeof b)return b;var a,c,h;if(b instanceof Date)return a=new Date,a.setTime(b.getTime()),a;if(b instanceof Array){a=[];h=b.length;for(c=0;c<h;c++)a[c]=d(b[c]);return a}if(b instanceof Object){a={};for(c in b)b.hasOwnProperty(c)&&(a[c]=d(b[c]));return a}return 0};c.lib||(c.lib={});f(c.lib,{win:a, doc:a.document,debug:!1,nil:e,mix:f,clone:d,keys:Object.keys,guid:function(b){var a=[],d;for(d=0;8>d;d++)a.push("0123456789abcdef".substr(Math.floor(16*Math.random()),1));a.push("-");for(d=0;4>d;d++)a.push("0123456789abcdef".substr(Math.floor(16*Math.random()),1));a.push("-4");for(d=0;3>d;d++)a.push("0123456789abcdef".substr(Math.floor(16*Math.random()),1));a.push("-");d="0123456789abcdef".substr(Math.floor(16*Math.random()),1);d="0123456789abcdef".substr(d&3|8,1);a.push(d);for(d=0;3>d;d++)a.push("0123456789abcdef".substr(Math.floor(16* Math.random()),1));a.push("-");for(d=0;8>d;d++)a.push("0123456789abcdef".substr(Math.floor(16*Math.random()),1));a.unshift(b);return a.join("")},now:Date.now||function(){return+new Date},noop:function(){}})}})("undefined"!==typeof window?window:this,dynamsoft); (function(a){var c=!{toString:1}.propertyIsEnumerable("toString"),e="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toString toLocaleString valueOf".split(" ");a.keys=Object.keys||function(a){var d=[],b,g;for(b in a)({}).hasOwnProperty.call(a,b)&&d.push(b);if(c)for(g=e.length-1;0<=g;g--)b=e[g],{}.hasOwnProperty.call(a,b)&&d.push(b);return d}})(dynamsoft.lib); (function(a,c){function e(a){return a===c}function f(b,d){k["[object "+b+"]"]=d=b.toLowerCase();a["is"+b]=function(b){return a.type(b)===d}}if(!(a._isXXX_ver&&20180508<=a._isXXX_ver)){a._isXXX_ver=20180508;var d=a.mix,b,g={}.hasOwnProperty,k={};d(a,{isDef:function(a){return a!==c},isUndef:e,isUndefined:e,isNull:function(a){return null===a},isNaN:function(a){return isNaN(a)},type:function(a){return null===a||a===c?String(a):k[{}.toString.call(a)]||"object"},isPlainObject:function(b){if(!b||"object"!== a.type(b)||b.nodeType||b.window==b)return!1;var d,c;try{if((c=b.constructor)&&!g(b,"constructor")&&!g(c.prototype,"isPrototypeOf"))return!1}catch(y){return!1}for(d in b);return e(d)||g(b,d)}});f("Function");a.each=d=function(b,d,g){if(b){var c,f,h=0;c=b.length;f=e(c)||a.isFunction(b);g=g||null;if(f)for(f=a.keys(b);h<f.length&&(c=f[h],!1!==d.call(g,b[c],c,b));h++);else for(f=b[0];h<c&&!1!==d.call(g,f,h,b);f=b[++h]);}return b};b=["String","Object","Boolean","Number"];Array.isArray?a.isArray=Array.isArray: b.push("Array");d(b,f)}})(dynamsoft.lib);(function(a){var c=a.mix,e=a.win,f;a._log_ver&&a.isNumber(a._log_ver)&&20180508<=a._log_ver||(a._log_ver=20180508,a.isDef(e.console)&&(f=e.console,a.isFunction(f.log)&&a.isFunction(f.error)||(f=!1)),c(a,{log:function(d){a.debug&&f&&f.log(d)},error:function(d){a.debug&&f&&f.error(d)},getLogger:function(){var d=a.log;return{warn:d,log:d,info:d,debug:d}}}))})(dynamsoft.lib); (function(a){a._random_ver&&20180508<=a._random_ver||(a._random_ver=20180508,a.getRandom=function(){for(var c=a.now()%1E4,e=[],f,d=0;5>d;d++)f=Math.floor(10*Math.random()),0==d&&0==f?d=-1:e.push(f);10>c?e.push("000"):100>c?e.push("00"):1E3>c&&e.push("0");e.push(c);return e.join("")})})(dynamsoft.lib); (function(a){a._strUtil_ver&&a.isNumber(a._strUtil_ver)&&20180508<=a._strUtil_ver||(a._strUtil_ver=20180508,a.mix(a,{startsWith:function(a,e){return 0===a.lastIndexOf(e,0)},endsWith:function(a,e){var c=a.length-e.length;return 0<=c&&a.indexOf(e,c)===c},replaceAll:function(a,e,f){return a.replace(new RegExp(e,"gi"),f)},upperCaseFirst:function(a){return a.charAt(0).toUpperCase()+a.substr(1)},makeArray:function(c){if(null==c)return[];if(a.isArray(c))return c;var e=typeof c.length,f=typeof c;if("number"!== e||c.alert||"string"===f||"function"===f&&!("item"in c&&"number"===e))return[c];for(var e=[],f=0,d=c.length;f<d;f++)e[f]=c[f];return e}}))})(dynamsoft.lib); (function(a){if(!(a._navInfo_ver&&a.isNumber(a._navInfo_ver)&&20180508<=a._navInfo_ver)){a._navInfo_ver=20180508;var c=a.win,e=(a=a.doc)&&a.documentElement,f=navigator,d=f.userAgent.toLowerCase(),b=f.platform.toLowerCase(),g=a.location.protocol,f="https:"===g,g="https:"!==g&&"http:"!==g,k="win32"==b||"win64"==b||"windows"==b,h="mac68k"==b||"macppc"==b||"macintosh"==b||"macintel"==b||"iphone"==b,q=0<=b.indexOf("linux"),b="win64"==b||0<=d.indexOf("wow64")||0<=d.indexOf("x86_64")||0<=d.indexOf("win64")|| 0<=d.indexOf("x64"),n=0<=d.indexOf("wow64"),y=d.indexOf("msie"),v=d.indexOf("trident"),t=d.indexOf("rv:"),m=d.indexOf("edge"),l=d.match(/version\/([\d.]+).*safari/),C=l?!0:!1,D=l?l[1]:0,u=d.indexOf("firefox"),w=-1!=u,p=k&&!w&&-1!=m,A=d.indexOf("chrome"),z=!p&&-1!=A,r=k&&!w&&!p&&!z&&(-1!=y||-1!=v||-1!=t),E="",x=0,F=d.match(/Gecko/)?!0:!1,B=!1,J="",P=!1,O=c.JSON;if(p)l=d.slice(m+5),l=l.slice(0,l.indexOf(" ")),l=l.slice(0,l.indexOf(".")),27<=l&&(B=!0);else if(z)l=d.slice(A+7),J=l=l.slice(0,l.indexOf(" ")), l=l.slice(0,l.indexOf(".")),27<=l&&(B=!0);else if(w)l=d.slice(u+8),J=l=l.slice(0,l.indexOf(" ")),l=l.slice(0,l.indexOf(".")),27<=l&&(B=!0);else if(r){-1!=y?(l=d.slice(y+4),E=l=l.slice(0,l.indexOf(";"))):-1!=t?(l=d.slice(t+3),l=l.slice(0,l.indexOf(";")),E=l=l.slice(0,l.indexOf(")"))):-1!=v&&(l=d.slice(v+7),E=l=l.slice(0,l.indexOf(";")));if(""===E||8<E)B=!0;J=l}else C&&(l&&(J=l[1]),l=D,l=l.slice(0,l.indexOf(".")),7<=l&&(B=!0));if(p||r)a.documentMode?x=a.documentMode:(x=5,a.compatMode&&"CSS1Compat"== a.compatMode&&(x=7));e&&e.querySelector&&(!r||r&&8<J)&&(P=!0);r&&9>J&&(O=null);dynamsoft.navInfo={host:c,bSSL:f,bFileSystem:g,bWin:k,bMac:h,bLinux:q,isX64:b,isWOW64:n,bIE:r,bEdge:p,bChrome:z,bFirefox:w,bSafari:C,bGecko:F,bHTML5Edition:B,strBrowserVersion:J,IEMode:x,bQuerySelectorSupported:P,nativeJson:O,nodejs:!1,scrollBarWidth:!1}}})(dynamsoft.lib); (function(a){a._extend_ver&&a.isNumber(a._extend_ver)&&20180508<=a._extend_ver||(a._extend_ver=20180508,a.extend=function(c,e){var f=function(){c.apply(this,arguments);e&&e.apply(this,arguments)};a.each(c.prototype,function(a,b){f.prototype[b]=a});return f.prototype.constructor=f})})(dynamsoft.lib); (function(a){function c(c){var f=this.constructor;this.__attrs={};this.__attrVals={};for(this.userConfig=c;f;)this.addAttrs(f.ATTRS),f=f.superclass?f.superclass.constructor:null;a.mix(this.__attrs,c)}a._attribute_ver&&a.isNumber(a._attribute_ver)&&20180508<=a._attribute_ver||(a._attribute_ver=20180508,a.mix(c.prototype,{get:function(a){return a in this.__attrs?this.__attrs[a]:""},set:function(a,c){a in this.__attrs&&(this.__attrs[a]=c)},addAttrs:function(c){a.mix(this.__attrs,c)}}),c.extend=function(c){var f; c=c||{};c.constructor&&(f=c.constructor);f=a.extend(this,f);a.mix(f,c);return f},a.Attributes=c)})(dynamsoft.lib); (function(a){function c(a){return 10>a?"0"+a:a}function e(b,d,c){var g=b[d],f,h,m;if("object"===typeof g)if(a.isArray(g)){f=0;h=g.length;for(var l=[];f<h;)m=e(g,String(f),c),void 0!==m&&(l[l.length]=m);g=l}else for(l=a.keys(g),f=0,h=l.length;f<h;f++){var k=l[f];m=e(g,k,c);void 0===m?delete g[k]:g[k]=m}return c.call(b,d,g)}if(!(a._json_ver&&20180508<=a._json_ver)){a._json_ver=20180508;var f=a.win.JSON;if(f&&f.parse&&f.stringify)a.parse=f.parse,a.stringify=f.stringify;else{var d=function(){var b={"\b":"\\b", "\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t",'"':'\\"'},d={},c=/["\b\f\n\r\t\x00-\x1f]/g,g=/\\\\|\\\/|\\b|\\f|\\n|\\r|\\t|\\"|\\u[0-9a-zA-Z]{4}/g;a.each(b,function(a,b){d[a]=b});d["\\/"]="/";d["\\\\"]="\\";return{quote:function(a){return'"'+a.replace(c,function(a){var d;(d=b[a])||(d="\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4));return d})+'"'},unQuote:function(a){return a.slice(1,a.length-1).replace(g,function(a){var b;(b=d[a])||(b=String.fromCharCode(parseInt(a.slice(2),16)));return b})}}}(), b;b=function(g,f,e,k,v,t,m){var l=f[g];if(l&&"object"===typeof l)if("function"===typeof l.toJSON)l=l.toJSON(g);else if(l instanceof Date)l=isFinite(l.valueOf())?l.getUTCFullYear()+"-"+c(l.getUTCMonth()+1)+"-"+c(l.getUTCDate())+"T"+c(l.getUTCHours())+":"+c(l.getUTCMinutes())+":"+c(l.getUTCSeconds())+"Z":null;else if(l instanceof String||l instanceof Number||l instanceof Boolean)l=l.valueOf();void 0!==e&&(l=e.call(f,g,l));switch(typeof l){case "number":return isFinite(l)?String(l):"null";case "string":return d.quote(l); case "boolean":return String(l);case "object":if(!l)return"null";if(a.isArray(l)){g=l;f=m;m+=v;for(var l=[],h=g.length,n=0;n<h;){var q=b(String(n),g,e,k,v,t,m);l[l.length]=void 0===q?"null":q;++n}l.length?v?(e=l.join("\n,"+m),e="[\n"+m+e+"\n"+f+"]"):e="["+l.join(",")+"]":e="[]";return e}g=l;f=m;m+=v;for(var n=0,w,l=void 0!==k?k:a.keys(g),q=[],h=l.length;n<h;n++){w=l[n];var p=b(w,g,e,k,v,t,m);void 0!==p&&(w=d.quote(w),w+=":",v&&(w+=" "),w+=p,q[q.length]=w)}q.length?v?(e=q.join(",\n"+m),e="{\n"+m+e+ "\n"+f+"}"):e="{"+q.join(",")+"}":e="{}";return e}};a.stringify=function(d,g,c){var f="",e,h;g&&("function"===typeof g?h=g:a.isArray(g)&&(e=g));"number"===typeof c?(c=Math.min(10,c),f=Array(c+1).join(" ")):"string"===typeof c&&(f=c.slice(0,10));return b("",{"":d},h,e,f,[],"")};var g={},k;g.yy={unQuote:d.unQuote};k=function(b){this.rules=[];a.mix(this,b);this.resetInput(this.input)};k.prototype={constructor:function(b){this.rules=[];a.mix(this,b);this.resetInput(this.input)},resetInput:function(b){a.mix(this, {input:b,matched:"",stateStack:[k.STATIC.INITIAL],match:"",text:"",firstLine:1,lineNumber:1,lastLine:1,firstColumn:1,lastColumn:1})},getCurrentRules:function(){var b=this.stateStack[this.stateStack.length-1],d=[],b=this.mapState(b);a.each(this.rules,function(g){var c=g.state||g[3];c?a.inArray(b,c)&&d.push(g):b==k.STATIC.INITIAL&&d.push(g)});return d},pushState:function(a){this.stateStack.push(a)},popState:function(){return this.stateStack.pop()},getStateStack:function(){return this.stateStack},showDebugInfo:function(){var a= k.STATIC.DEBUG_CONTEXT_LIMIT,b=this.matched,d=this.match,g=this.input,b=b.slice(0,b.length-d.length),b=(b.length>a?"...":"")+b.slice(-a).replace(/\n/," "),d=d+g,d=d.slice(0,a)+(d.length>a?"...":"");return b+d+"\n"+Array(b.length+1).join("-")+"^"},mapSymbol:function(a){var b=this.symbolMap;return b?b[a]||(b[a]=++this.symbolId):a},mapReverseSymbol:function(b){var d=this.symbolMap,g=this.reverseSymbolMap;!g&&d&&(g=this.reverseSymbolMap={},a.each(d,function(a,b){g[a]=b}));return g?g[b]:b},mapState:function(a){var b= this.stateMap;return b?b[a]||(b[a]=++this.stateId):a},lex:function(){var b=this.input,d,g,c,f=this.getCurrentRules();this.match=this.text="";if(!b)return this.mapSymbol(k.STATIC.END_TAG);for(d=0;d<f.length;d++){g=f[d];var e=g.token||g[0];c=g.action||g[2]||void 0;if(g=b.match(g.regexp||g[1])){if(d=g[0].match(/\n.*/g))this.lineNumber+=d.length;a.mix(this,{firstLine:this.lastLine,lastLine:this.lineNumber+1,firstColumn:this.lastColumn,lastColumn:d?d[d.length-1].length-1:this.lastColumn+g[0].length}); d=this.match=g[0];this.matches=g;this.text=d;this.matched+=d;c=c&&c.call(this);c=void 0===c?e:this.mapSymbol(c);this.input=b=b.slice(d.length);return c?c:this.lex()}}a.error("lex error at line "+this.lineNumber+":\n"+this.showDebugInfo())}};k.STATIC={INITIAL:"I",DEBUG_CONTEXT_LIMIT:20,END_TAG:"$EOF"};f=new k({rules:[[2,/^"(\\"|\\\\|\\\/|\\b|\\f|\\n|\\r|\\t|\\u[0-9a-zA-Z]{4}|[^\\"\x00-\x1f])*"/,0],[0,/^[\t\r\n\x20]/,0],[3,/^,/,0],[4,/^:/,0],[5,/^\[/,0],[6,/^\]/,0],[7,/^\{/,0],[8,/^\}/,0],[9,/^-?\d+(?:\.\d+)?(?:e-?\d+)?/i, 0],[10,/^true|false/,0],[11,/^null/,0],[12,/^./,0]]});g.lexer=f;f.symbolMap={$EOF:1,STRING:2,COMMA:3,COLON:4,LEFT_BRACKET:5,RIGHT_BRACKET:6,LEFT_BRACE:7,RIGHT_BRACE:8,NUMBER:9,BOOLEAN:10,NULL:11,INVALID:12,$START:13,json:14,value:15,object:16,array:17,elementList:18,member:19,memberList:20};g.productions=[[13,[14]],[14,[15],function(){return this.$1}],[15,[2],function(){return this.yy.unQuote(this.$1)}],[15,[9],function(){return parseFloat(this.$1)}],[15,[16],function(){return this.$1}],[15,[17], function(){return this.$1}],[15,[10],function(){return"true"===this.$1}],[15,[11],function(){return null}],[18,[15],function(){return[this.$1]}],[18,[18,3,15],function(){this.$1[this.$1.length]=this.$3;return this.$1}],[17,[5,6],function(){return[]}],[17,[5,18,6],function(){return this.$2}],[19,[2,4,15],function(){return{key:this.yy.unQuote(this.$1),value:this.$3}}],[20,[19],function(){var a={};a[this.$1.key]=this.$1.value;return a}],[20,[20,3,19],function(){this.$1[this.$3.key]=this.$3.value;return this.$1}], [16,[7,8],function(){return{}}],[16,[7,20,8],function(){return this.$2}]];g.table={gotos:{0:{14:7,15:8,16:9,17:10},2:{15:12,16:9,17:10,18:13},3:{19:16,20:17},18:{15:23,16:9,17:10},20:{15:24,16:9,17:10},21:{19:25}},action:{0:{2:[1,0,1],5:[1,0,2],7:[1,0,3],9:[1,0,4],10:[1,0,5],11:[1,0,6]},1:{1:[2,2,0],3:[2,2,0],6:[2,2,0],8:[2,2,0]},2:{2:[1,0,1],5:[1,0,2],6:[1,0,11],7:[1,0,3],9:[1,0,4],10:[1,0,5],11:[1,0,6]},3:{2:[1,0,14],8:[1,0,15]},4:{1:[2,3,0],3:[2,3,0],6:[2,3,0],8:[2,3,0]},5:{1:[2,6,0],3:[2,6,0], 6:[2,6,0],8:[2,6,0]},6:{1:[2,7,0],3:[2,7,0],6:[2,7,0],8:[2,7,0]},7:{1:[0,0,0]},8:{1:[2,1,0]},9:{1:[2,4,0],3:[2,4,0],6:[2,4,0],8:[2,4,0]},10:{1:[2,5,0],3:[2,5,0],6:[2,5,0],8:[2,5,0]},11:{1:[2,10,0],3:[2,10,0],6:[2,10,0],8:[2,10,0]},12:{3:[2,8,0],6:[2,8,0]},13:{3:[1,0,18],6:[1,0,19]},14:{4:[1,0,20]},15:{1:[2,15,0],3:[2,15,0],6:[2,15,0],8:[2,15,0]},16:{3:[2,13,0],8:[2,13,0]},17:{3:[1,0,21],8:[1,0,22]},18:{2:[1,0,1],5:[1,0,2],7:[1,0,3],9:[1,0,4],10:[1,0,5],11:[1,0,6]},19:{1:[2,11,0],3:[2,11,0],6:[2,11, 0],8:[2,11,0]},20:{2:[1,0,1],5:[1,0,2],7:[1,0,3],9:[1,0,4],10:[1,0,5],11:[1,0,6]},21:{2:[1,0,14]},22:{1:[2,16,0],3:[2,16,0],6:[2,16,0],8:[2,16,0]},23:{3:[2,9,0],6:[2,9,0]},24:{3:[2,12,0],8:[2,12,0]},25:{3:[2,14,0],8:[2,14,0]}}};g.parse=function(b){var d=this,g=d.lexer,c,f,e,m=d.table,l=m.gotos,m=m.action,k=d.productions,h=[null],u=[0];for(g.resetInput(b);;){c=u[u.length-1];f||(f=g.lex());if(!f)return a.log("it is not a valid input: "+b,"error"),!1;e=m[c]&&m[c][f];if(!e){var w=[];m[c]&&a.each(m[c], function(a,b){w.push(d.lexer.mapReverseSymbol(b))});b="Syntax error at line "+g.lineNumber+":\n"+g.showDebugInfo()+"\nexpect "+w.join(", ");a.log(b);return!1}switch(e[0]){case 1:u.push(f);h.push(g.text);u.push(e[2]);f=null;break;case 2:var p=k[e[1]];c=p.symbol||p[0];e=p.action||p[2];var A=(p.rhs||p[1]).length,z=0,p=h[h.length-A];d.$$=p;for(p=void 0;z<A;z++)d["$"+(A-z)]=h[h.length-1-z];e&&(p=e.call(d));p=void 0!==p?p:d.$$;A&&(u=u.slice(0,-2*A),h=h.slice(0,-1*A));u.push(c);h.push(p);u.push(l[u[u.length- 2]][u[u.length-1]]);break;case 0:return p}}};a.parse=function(b,a){var d=g.parse(String(b));return a?e({"":d},"",a):d}}}})(dynamsoft.lib); (function(a,c){function e(){if(!g){d&&!b.nodejs&&y(f,"load",e);g=1;for(var c=0;c<k.length;c++)try{k[c](a)}catch(t){a.log(t.stack||t,"error"),setTimeout(function(){throw t;},0)}}}if(!(a._utilities_ver&&20180508<=a._utilities_ver)){a._utilities_ver=20180508;var f=a.win,d=a.doc,b=dynamsoft.navInfo;a.getLogger();var g=0,k=[],h=/\S/,q=!(!d||!d.addEventListener),n=q?function(a,b,d){a.addEventListener(b,d,!1)}:function(a,b,d){a.attachEvent("on"+b,d)},y=q?function(a,b,d){a.removeEventListener(b,d,!1)}:function(a, b,d){a.detachEvent("on"+b,d)};a.mix(a,{isWindow:function(a){return null!=a&&a==a.window},globalEval:function(a){a&&h.test(a)&&(f.execScript?f.execScript(a):f.eval.call(f,a))},ready:function(b){if(g)try{b(a)}catch(t){a.log(t.stack||t,"error"),setTimeout(function(){throw t;},0)}else k.push(b);return this}});(function(){if(d&&"complete"!==d.readyState)if(n(f,"load",e),q){var a=function(){y(d,"DOMContentLoaded",a);e()};n(d,"DOMContentLoaded",a)}else{var b=function(){"complete"===d.readyState&&(y(d,"readystatechange", b),e())};n(d,"readystatechange",b);var g,c=d&&d.documentElement,k=c&&c.doScroll;try{g=null===f.frameElement}catch(u){g=!1}if(k&&g){var h=function(){try{k("left"),e()}catch(u){setTimeout(h,40)}};h()}}else e()})();if(b.bIE)try{d.execCommand("BackgroundImageCache",!1,!0)}catch(v){}}})(dynamsoft.lib); (function(a){a._domUtil_ver&&20180508<=a._domUtil_ver||(a._domUtil_ver=20180508,a.mix(a,{get:function(c){return a.doc.getElementById(c)},hide:function(c){if(c=a.isString(c)?a.get(c):c)c.style.display="none"},show:function(c){if(c=a.isString(c)?a.get(c):c)c.style.display=""},toggle:function(c){if(c=a.isString(c)?a.get(c):c)c.style.display="none"===c.style.display?"":"none"},empty:function(a){if(a)for(;a.firstChild;)a.removeChild(a.firstChild)}}))})(dynamsoft.lib); (function(a,c){var e=a.lib,f=a.navInfo;if(!(e._ls_ver&&e.isNumber(e._ls_ver)&&20190110<=e._ls_ver)){e._ls_ver=20190110;var d=!1,b=!1;if(!(f.bEdge&&f.bFileSystem||f.bIE&&8>f.strBrowserVersion))try{d=(b=window.localStorage)?!0:!1}catch(g){b=!1}e.LS={isSupportLS:function(){return d},item:function(a,d,c){return this.isSupportLS()?(d?(b.setItem(a,d),a=d):a=b.getItem(a),null===a?c:a):c},removeItem:function(a){if(this.isSupportLS())b.removeItem(a);else return!1;return!0}}}})(dynamsoft); (function(a){if(!(a._array_ver&&20190506<=a._array_ver)){a._array_ver=20190506;var c=Array.prototype,e=c.indexOf,f=c.filter;a.isFunction(e)||(e=function(a,b){var d;if(null==this)return-1;var c=Object(this),f=c.length>>>0;if(0===f)return-1;d=+b||0;Infinity===Math.abs(d)&&(d=0);if(d>=f)return-1;for(d=Math.max(0<=d?d:f-Math.abs(d),0);d<f;){if(d in c&&c[d]===a)return d;d++}return-1});a.mix(a,{filter:f?function(a,b,c){return f.call(a,b,c||this)}:function(d,b,c){var g=[];a.each(d,function(a,d,f){b.call(c|| this,a,d,f)&&g.push(a)});return g},indexOf:function(a,b){return e.call(b,a)},uniq:function(a){for(var b=[],d=a.length,c=0;c<d;c++){for(var f=c+1;f<d;f++)a[c]===a[f]&&(c++,f=c);b.push(a[c])}return b}})}})(dynamsoft.lib); (function(a){if(!(a._function_ver&&20190506<=a._function_ver)){a._function_ver=20190506;var c=Array.prototype,e=Function.prototype;a.isFunction(e.bind)||(e.bind=function(a){var d=this;if(1<arguments.length){var b=c.slice.call(arguments,1);return function(){return d.apply(a,arguments.length?b.concat(c.slice.call(arguments)):b)}}return function(){return arguments.length?d.apply(a,arguments):d.call(a)}})}})(dynamsoft.lib); (function(a){if(!(a._string_ver&&20190506<=a._string_ver)){a._string_ver=20190506;var c=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,e=String.prototype,f=e.trim;f||(f=e.trim=function(){return this.replace(c,"")});a.trim=function(a){return null==a?"":f.call(a)}}})(dynamsoft.lib); (function(a,c){function e(a){var b=typeof a;return null==a||"object"!==b&&"function"!==b}function f(){if(y)return y;var a="";h(q,function(b){a+=b+"|"});a=a.slice(0,-1);return y=new RegExp(a,"g")}function d(){if(v)return v;var a="";h(n,function(b){a+=b+"|"});a+="&#(\\d{1,5});";return v=new RegExp(a,"g")}function b(a){return encodeURIComponent(String(a))}var g=a.getLogger(),k=a.isDef,h=a.each,q={"&amp;":"&","&gt;":">","&lt;":"<","&#x60;":"`","&#x2F;":"/","&quot;":'"',"&#x27;":"'"},n={},y,v,t=/[\-#$\^*()+\[\]{}|\\,.?\s]/g; h(q,function(a,b){n[a]=b});a.mix(a,{urlEncode:b,urlDecode:function(a){return decodeURIComponent(a.replace(/\+/g," "))},fromUnicode:function(a){return a.replace(/\\u([a-f\d]{4})/ig,function(a,b){return String.fromCharCode(parseInt(b,16))})},escapeHtml:function(a){return(a+"").replace(f(),function(a){return n[a]})},escapeRegExp:function(a){return a.replace(t,"\\$&")},unEscapeHtml:function(a){return a.replace(d(),function(a,b){return q[a]||String.fromCharCode(+b)})},param:function(d,c,g,f){c=c||"&"; g=g||"=";a.isUndef(f)&&(f=!0);var m=[];h(d,function(d,l){var p=b(l);e(d)?(m.push(p),k(d)&&m.push(g,b(d+"")),m.push(c)):a.isArray(d)&&d.length&&h(d,function(a){e(a)&&(m.push(p,f?b("[]"):""),k(a)&&m.push(g,b(a+"")),m.push(c))})});m.pop();return m.join("")},unparam:function(b,d,f){if(!a.isString(b)||!(b=a.trim(b)))return{};f=f||"=";var e={},m,k=a.urlDecode;b=b.split(d||"&");for(var l=0,h=b.length;l<h;++l){m=a.indexOf(f,b[l]);if(-1===m)d=k(b[l]),m=c;else{d=k(b[l].substring(0,m));m=b[l].substring(m+1); try{m=k(m)}catch(z){g.error("decodeURIComponent error : "+m),g.error(z)}a.endsWith(d,"[]")&&(d=d.substring(0,d.length-2))}d in e?a.isArray(e[d])?e[d].push(m):e[d]=[e[d],m]:e[d]=m}return e}})})(dynamsoft.lib); (function(a){function c(a,b){for(var d=0,c=a.length-1,f=[],e;0<=c;c--)e=a[c],"."!==e&&(".."===e?d++:d?d--:f[f.length]=e);if(b)for(;d--;d)f[f.length]="..";return f=f.reverse()}var e=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,f=a.Path={resolve:function(){var d="",b,g=arguments,f,e=0;for(b=g.length-1;0<=b&&!e;b--)f=g[b],a.isString(f)&&f&&(d=f+"/"+d,e="/"===f.charAt(0));d=c(a.filter(d.split("/"),function(a){return!!a}),!e).join("/");return(e?"/":"")+d||"."},normalize:function(d){var b= "/"===d.charAt(0),g="/"===d.slice(-1);(d=c(a.filter(d.split("/"),function(a){return!!a}),!b).join("/"))||b||(d=".");d&&g&&(d+="/");return(b?"/":"")+d},join:function(){var d=a.makeArray(arguments);return f.normalize(a.filter(d,function(b){return b&&a.isString(b)}).join("/"))},relative:function(d,b){d=f.normalize(d);b=f.normalize(b);var c=a.filter(d.split("/"),function(a){return!!a}),e=[],h,q,n=a.filter(b.split("/"),function(a){return!!a});q=Math.min(c.length,n.length);for(h=0;h<q&&c[h]===n[h];h++); for(q=h;h<c.length;)e.push(".."),h++;e=e.concat(n.slice(q));return e=e.join("/")},basename:function(a,b){var d;d=(a.match(e)||[])[3]||"";b&&d&&d.slice(-1*b.length)===b&&(d=d.slice(0,-1*b.length));return d},dirname:function(a){var b=a.match(e)||[];a=b[1]||"";b=b[2]||"";if(!a&&!b)return".";b&&(b=b.substring(0,b.length-1));return a+b},extname:function(a){return(a.match(e)||[])[4]||""}}})(dynamsoft.lib); (function(a,c){function e(d){d._queryMap||(d._queryMap=a.unparam(d._query))}function f(a){this._query=a||""}f.prototype={constructor:f,clone:function(){return new f(this.toString())},reset:function(a){this._query=a||"";this._queryMap=null;return this},count:function(){var d=0;e(this);a.each(this._queryMap,function(b){a.isArray(b)?d+=b.length:d++});return d},has:function(d){var b;e(this);b=this._queryMap;return d?d in b:!a.isEmptyObject(b)},get:function(a){var b;e(this);b=this._queryMap;return a?b[a]: b},keys:function(){e(this);return a.keys(this._queryMap)},set:function(d,b){var c;e(this);c=this._queryMap;a.isString(d)?this._queryMap[d]=b:(d instanceof f&&(d=d.get()),a.each(d,function(a,b){c[b]=a}));return this},remove:function(a){e(this);a?delete this._queryMap[a]:this._queryMap={};return this},add:function(d,b){var c=this,k,h;a.isString(d)?(e(c),k=c._queryMap,h=k[d],h=a.isUndef(h)?b:[].concat(h).concat(b),k[d]=h):(d instanceof f&&(d=d.get()),a.each(d,function(a,b){c.add(b,a)}));return c},toString:function(d){e(this); return a.param(this._queryMap,c,c,d)}};a.uriQuery=f})(dynamsoft.lib); (function(a){function c(a,b){return a.toLowerCase()===b.toLowerCase()}function e(a,b){return encodeURI(a).replace(b,function(a){a=a.charCodeAt(0).toString(16);return"%"+(1===a.length?"0"+a:a)})}function f(c){if(c instanceof f)return c.clone();var g=this;a.mix(g,{scheme:"",userInfo:"",hostname:"",port:"",path:"",query:"",fragment:""});c=f.getComponents(c);b(c,function(b,c){b=b||"";if("query"===c)g.query=new d(b);else{try{b=a.urlDecode(b)}catch(u){k.error(u+"urlDecode error : "+b)}g[c]=b}});return g} var d=a.uriQuery,b=a.each,g=a.Path,k=a.getLogger(),h=/[#\/\?@]/g,q=/[#\?]/g,n=/[#@]/g,y=/#/g,v={scheme:1,userInfo:2,hostname:3,port:4,path:5,query:6,fragment:7},t=RegExp("^(?:([\\w\\d+.-]+):)?(?://(?:([^/?#@]*)@)?([\\w\\d\\-\\u0100-\\uffff.+%]*|\\[[^\\]]+\\])(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");f.prototype={constructor:f,clone:function(){var a=new f,d=this;b(v,function(b,c){a[c]=d[c]});a.query=a.query.clone();return a},resolve:function(d){a.isString(d)&&(d=new f(d));var c=0,e,m=this.clone(); b("scheme userInfo hostname port path query fragment".split(" "),function(b){if("path"===b)if(c)m[b]=d[b];else{if(b=d.path)c=1,a.startsWith(b,"/")||(m.hostname&&!m.path?b="/"+b:m.path&&(e=m.path.lastIndexOf("/"),-1!==e&&(b=m.path.slice(0,e+1)+b))),m.path=g.normalize(b)}else if("query"===b){if(c||d.query.toString())m.query=d.query.clone(),c=1}else if(c||d[b])m[b]=d[b],c=1});return m},getScheme:function(){return this.scheme},setScheme:function(a){this.scheme=a;return this},getHostname:function(){return this.hostname}, setHostname:function(a){this.hostname=a;return this},setUserInfo:function(a){this.userInfo=a;return this},getUserInfo:function(){return this.userInfo},setPort:function(a){this.port=a;return this},getPort:function(){return this.port},setPath:function(a){this.path=a;return this},getPath:function(){return this.path},setQuery:function(b){a.isString(b)&&(a.startsWith(b,"?")&&(b=b.slice(1)),b=new d(e(b,n)));this.query=b;return this},getQuery:function(){return this.query},getFragment:function(){return this.fragment}, setFragment:function(b){a.startsWith(b,"#")&&(b=b.slice(1));this.fragment=b;return this},isSameOriginAs:function(a){return c(this.hostname,a.hostname)&&c(this.scheme,a.scheme)&&c(this.port,a.port)},toString:function(b){var d=[],c,f;if(c=this.scheme)d.push(e(c,h)),d.push(":");if(c=this.hostname){d.push("//");if(f=this.userInfo)d.push(e(f,h)),d.push("@");d.push(encodeURIComponent(c));if(f=this.port)d.push(":"),d.push(f)}if(f=this.path)c&&!a.startsWith(f,"/")&&(f="/"+f),f=g.normalize(f),d.push(e(f,q)); if(b=this.query.toString.call(this.query,b))d.push("?"),d.push(b);if(b=this.fragment)d.push("#"),d.push(e(b,y));return d.join("")}};f.getComponents=function(a){var d=(a||"").match(t)||[],c={};b(v,function(a,b){c[b]=d[a]});return c};a.Uri=f})(dynamsoft.lib); (function(a){var c=a.lib,e=a.navInfo;c._color_ver&&c.isNumber(c._color_ver)&&20180508<=c._color_ver||(c._color_ver=20180508,c.colorStrToInt=function(a){var d="0x",b;if(/^(rgb|RGB)/.test(a)){var c=a.replace(/[^\d,.]/g,"").split(",");for(b=0;3>b;++b)a=Number(c[b]).toString(16),1==a.length&&(a="0"+a),d+=a;4==c.length?(a=Math.round(255*Number(c[b])).toString(16),1==a.length&&(a="0"+a),d+=a):d+="ff"}else if("transparent"==a)d+="00000000";else if(/^#[0-9a-fA-f]{6}$/.test(a))d+=a.replace(/#/,"")+"ff";else if(/^#[0-9a-fA-f]{3}$/.test(a)){for(b= 0;3>b;++b)d+=a[b]+a[b];d+="ff"}else d="-1";return Number(d)},c.IntToColorStr=function(a){if(4294967295<a||0>a)return null;if(e.bHTML5Edition)a="rgba("+Math.floor(a/16777216)+","+Math.floor(a/65536)%256+","+Math.floor(a/256)%256+","+a%256/255+")";else if(0==a%256)a="transparent";else{for(a=Math.floor(a/256).toString(16);6!=a.length;)a="0"+a;a="#"+a}return a})})(dynamsoft); (function(a,c){function e(){}function f(a){if(a&&d.isString(a.url)){var b=new e;b.sendInternal(a);return b}d.log("the url is error.")}var d=a.lib;if(!(d._ajax_ver&&d.isNumber(d._ajax_ver)&&20190506<=d._ajax_ver)){d._ajax_ver=20190506;var b=a.navInfo,g=d.win,k=d.each,h=/^(?:about|app|app\-storage|.+\-extension|file|widget)$/,q=new d.Uri(location.href),n=q&&h.test(q.getScheme()),y=function(){try{return new g.XMLHttpRequest}catch(w){}},v=function(){try{var a=!1;k(["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP", "Microsoft.XMLHTTP","Msxml2.XMLHTTP.3.0","Msxml3.XMLHTTP"],function(b){try{return a=new g.ActiveXObject(b)}catch(A){d.error("new xhr error: "+A.message)}});return a}catch(p){}},t=!n&&g.XMLHttpRequest?"withCredentials"in(y()||[]):!1,m=g.ActiveXObject?function(a){return b.bIE&&9>=parseInt(b.strBrowserVersion)?v():!n&&y()||v()}:y,l=/^(?:GET|HEAD)$/,C=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,D={xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"}, u=c;b.bIE&&10>=parseInt(b.strBrowserVersion)&&(u=d.noop);d.mix(e.prototype,{url:!1,onSuccess:!1,onError:!1,onComplete:!1,method:"GET",async:!0,xhrFields:!1,mimeType:!1,username:!1,password:!1,data:!1,dataType:"text",headers:!1,contentType:"application/x-www-form-urlencoded; charset=UTF-8",beforeSend:!1,afterSend:!1,timeout:0,cache:!0,crossDomain:!1,retry:0,setRequestHeader:function(a,b){this.headers[a]=b;return this},getAllResponseHeaders:function(){return 2===this.state?this.responseHeadersString: null},getNativeXhr:function(){return this.nativeXhr},getResponseHeader:function(a){var b,d;a=a.toLowerCase();if(2===this.state){if(!(d=this.responseHeaders))for(d=this.responseHeaders={};b=C.exec(this.responseHeadersString);)d[b[1].toLowerCase()]=b[2];b=d[a]}return void 0===b?null:b},overrideMimeType:function(a){this.state||(this.mimeType=a);return this},abort:function(a){this.state=3;this.status=0;this.statusText=a||"abort";this.nativeXhr&&this.nativeXhr.abort();this._callback();return this},_ioReady:function(a, b){var c=this,g=!1;if(2!==c.state&&3!==c.state){1===c.state&&(c.state=2);c.readyState=4;200<=a&&300>a||304===a?(b=304===a?"not modified":"success",g=!0):0>a&&(a=0);try{200<=a&&c.handleResponseData()}catch(r){d.error(r.stack||r,"error"),b=r.message||"parser error"}(200>a||!g)&&0<c.retry?(--c.retry,setTimeout(function(){c.sendInternal()},200)):(c.status=a,c.statusText=b,c._callback(g))}},_callback:function(a){var b=this,c=b.timeoutTimer;c&&(clearTimeout(c),b.timeoutTimer=0);k([a?b.onSuccess:b.onError, b.onComplete],function(a){d.isFunction(a)&&a.apply(b.context,[b.responseData,b.statusText,b])});b.responseData=null},handleResponseData:function(){var a;a=this.dataType;var b=this.nativeXhr;if("blob"===a||"arraybuffer"===a)a=g.Blob?b.response:b.responseBody;else if("json"==a)a=b.responseType&&"json"==b.responseType.toLowerCase()?b.response:b.responseText?(g.JSON&&g.JSON.parse?g.JSON.parse:d.parse)(b.responseText):{};else if("user-defined"===a)a=void 0!==b.response?b.response:b.responseText;else{this.responseText= a=b.responseText||"";try{var c=b.responseXML;c&&c.documentElement&&(this.responseXML=c)}catch(z){}}this.responseData=a},sendInternal:function(a){var c=this,g,f,e,h,n;a=c._setup(a);g=a.method;f=a.url;e=a.dataType;n=a.mimeType;if(d.isString(f)&&(c.nativeXhr=h=m(a.crossDomain))){try{if(c.state=1,a.username?h.open(g,f,a.async,a.username,a.password):h.open(g,f,a.async),(a.async||b.bIE)&&e&&"user-defined"!=e&&"responseType"in h)try{h.responseType=e}catch(F){}}catch(F){2>c.state?(d.error(F.stack||F,"error"), c._ioReady(-1,"open error: "+(d.isNumber(F.number)?"("+F.number+")":"")+(F.message||""))):d.error(F);return}g=a.xhrFields||{};"withCredentials"in g&&(t||delete g.withCredentials);k(g,function(a,b){try{h[b]=a}catch(J){d.error(J)}});n&&h.overrideMimeType&&h.overrideMimeType(n);n=a.headers||{};!1===n["X-Requested-With"]&&delete n["X-Requested-With"];"setRequestHeader"in h&&(a.contentType&&h.setRequestHeader("Content-Type",a.contentType),h.setRequestHeader("Accept",e&&D[e]?D[e]+("*"===e?"":", */*; q=0.01"): D["*"]),k(n,function(a,b){h.setRequestHeader(b,a)}));a.cache||(h.setRequestHeader("If-Modified-Since","0"),h.setRequestHeader("Cache-Control","no-cache"));n=(e=!l.test(a.method))&&a.data||null;e&&b.bIE&&10>parseInt(b.strBrowserVersion)&&(n=a.data);a.async&&0<a.timeout&&(300>a.timeout&&(a.timeout=300),c.timeoutTimer=setTimeout(function(){c.abort("timeout")},a.timeout));try{c.state=1;if(d.isFunction(c.beforeSend)&&!1===c.beforeSend(h,c)){c.abort("cancel");return}h.send(n);n=null;a.data=null;d.isFunction(c.afterSend)&& c.afterSend(c)}catch(F){2>c.state?(d.error(F.stack||F,"error"),c._ioReady(-1,"send error: "+(F.message||""))):d.error(F)}a.async&&4!==h.readyState?h.onreadystatechange=function(){c._xhrCallback()}:c._xhrCallback()}},_xhrCallback:function(a,b){var c=this.nativeXhr;try{if(4===c.readyState||b)if(c.onreadystatechange=u,b)4!==c.readyState&&c.abort();else{this.responseHeadersString=c.getAllResponseHeaders();var g=c.status,e;try{e=c.statusText}catch(E){d.error("xhr statusText error: "),d.error(E),e=""}this._ioReady(g, e)}}catch(E){d.error(E.stack||E,"error"),c.onreadystatechange=u,b||this._ioReady(-1,E.message||"process error")}},_setup:function(a){var b,c,g;if(a){this.context=a.context;delete a.context;a instanceof e&&(a=a.config);this.config=a;b=a.url;d.startsWith(b,"http://")||d.startsWith(b,"https://")?g=new d.Uri(b):(d.startsWith(b,"//")&&(a.url=b="http:"+b),g=q.resolve(b));b=a.dataType?a.dataType.toLowerCase():"text";a.dataType=b;a.method=a.method?a.method.toUpperCase():"GET";"crossDomain"in a||(a.crossDomain= !g.isSameOriginAs(q));b=a.headers;for(c in b)d.isUndefined(b[c])&&delete b[c];d.mix(this,a)}this.state=1;return this}});d.mix(d,{ajax:f,io:{get:function(a,b,c,d){return f({method:"GET",url:a,onSuccess:b,onError:c,dataType:d})},post:function(a,b,c,d,g){return f({method:"POST",data:b,url:a,onSuccess:c,onError:d,dataType:g})},put:function(a,b,c,d,g){return f({method:"PUT",data:b,url:a,onSuccess:c,onError:d,dataType:g})}}})}})(dynamsoft); (function(a){if(!(a._loadjs_ver&&20180508<=a._loadjs_ver)){a._loadjs_ver=20180508;var c=a.doc,e=c&&c.documentElement,f=c.getElementsByTagName("head")[0]||e,d=c.createElement("script").readyState?function(a,c){var b=a.onreadystatechange;a.onreadystatechange=function(){var d=a.readyState;if("loaded"===d||"complete"===d)a.onreadystatechange=null,b&&b(),c.call(this)}}:function(a,c){a.addEventListener("load",c,!1);a.addEventListener("error",c,!1)};a.getScript=function(b,g,e){var h;a.isFunction(e)||(e= function(){});if(a.isString(b)&&""!=b)return h=c.createElement("script"),b=["",b].join(""),h.src=b,g&&(h.async=!0),h.charset="utf-8",d(h,e),f.insertBefore(h,f.firstChild),h;e()};a.getCss=function(b,g){var e,h=g;a.isFunction(h)||(h=!1);if(a.isString(b)&&""!=b)return e=c.createElement("link"),e.href=b,e.rel="stylesheet",e.async=!0,h&&d(e,h),f.insertBefore(e,f.firstChild),e;h&&h()}}})(dynamsoft.lib); (function(a){a._customEvt_ver&&a.isNumber(a._customEvt_ver)&&20180508<=a._customEvt_ver||(a._customEvt_ver=20180508,a.obj={customEvent:{fire:function(c){var e=this,f;e.exec=e.exec||{};c=c.toLowerCase();f=Array.prototype.slice.call(arguments,1);a.each(e.exec[c]||[],function(c){var b=c.f;c=c.c||e;try{b.apply(c,f)}catch(g){a.log(g)}})},on:function(a,e,f){this.exec=this.exec||{};a=a.toLowerCase();this.exec[a]=this.exec[a]||[];this.exec[a].push({f:e,c:f})},off:function(a,e,f){if(f=this.exec)if(a)if(a= a.toLowerCase(),e)for(a=f[a]||[],f=a.length-1;0<=f;f--)a[f]===e&&a.splice(f,1);else f[a]=null;else this.exec=null}}})})(dynamsoft.lib); (function(a){var c=a.lib,e=a.navInfo,f=c.win.document,d;c._evtBase_ver&&c.isNumber(c._evtBase_ver)&&20180508<=c._evtBase_ver||(c._evtBase_ver=20180508,d=function(a){return e.bGecko&&"mousewheel"===a?"DOMMouseScroll":a},c.mix(c,{addEventListener:f.addEventListener?function(a,c,e){c=d(c);a&&a.addEventListener(c,e,!1)}:function(a,c,e){c=d(c);a&&a.attachEvent("on"+c,e)},removeEventListener:f.removeEventListener?function(a,c,e){c=d(c);a&&a.removeEventListener(c,e,!1)}:function(a,c,e){c=d(c);a&&a.detachEvent("on"+ c,e)},stopPropagation:function(a){a=a||window.event;a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();a.returnValue=!1;a.cancelBubble=!0},fireEvent:function(a,c){var b;f.createEvent?(b=f.createEvent("HTMLEvents"),b.initEvent(a,!0,!0),c.dispatchEvent&&c.dispatchEvent(b)):f.createEventObject?(b=f.createEventObject(),b.bubbles=!0,b.cancelable=!0,c.fireEvent(a,b)):(b=new Event(a),c.dispatchEvent&&c.dispatchEvent(b))}}))})(dynamsoft); (function(a){var c=a.lib;if(!(c._asyncQueue_ver&&c.isNumber(c._asyncQueue_ver)&&20180822<=c._asyncQueue_ver)){c._asyncQueue_ver=20180822;var e={queue:[],doNextStarted:!1,timer:!1,pushToDo:function(a,c,b){e.queue.push({obj:a,method:c,args:b})},doNext:function(){if(e.doNextStarted)if(0==e.queue.length)e.timer=setTimeout(e.doNext,500);else{var a=e.queue[0],d=a.obj,b=a.method,a=a.args;e.queue.splice(0,1);if(c.isFunction(d[b])){if(2<a.length){var g=a[a.length-2],k=a[a.length-1];a[a.length-2]=function(){try{g.apply(d, arguments)}catch(h){}e.timer=setTimeout(e.doNext,0)};a[a.length-1]=function(){try{k.apply(d,arguments)}catch(h){}e.timer=setTimeout(e.doNext,0)}}try{d[b].apply(d,a)}catch(h){}}else c.log("not invoke a function: "+b),e.timer=setTimeout(e.doNext,0)}else clearTimeout(e.timer),e.timer=!1},start:function(){e.doNextStarted||(e.doNextStarted=!0,e.timer=setTimeout(e.doNext,0))},stop:function(){clearTimeout(e.timer);e.doNextStarted=!1;e.queue=[]}};c.asyncQueue=e}})(dynamsoft); (function(a){if(!(a._sprintf_ver&&20190507<=a._sprintf_ver)){a._sprintf_ver=20190507;var c,e=/[^T]/,f=/[^v]/,d=/[diefg]/,b=/[bcdiefguxX]/,g=/[j]/,k=/^[^\x25]+/,h=/^\x25{2}/,q=/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,n=/^([a-z_][a-z_\d]*)/i,y=/^\.([a-z_][a-z_\d]*)/i,v=/^\[(\d+)\]/,t=/^[+-]/,m=Object.create?Object.create(null):{};c=function(a){var l;l=a;if(m[l])l=m[l];else{for(var D=l,u,w=[],p=0;D;){if(null!==(u=k.exec(D)))w.push(u[0]);else if(null!== (u=h.exec(D)))w.push("%");else if(null!==(u=q.exec(D))){if(u[2]){var p=p|1,A=[],z=u[2],r;if(null!==(r=n.exec(z)))for(A.push(r[1]);""!==(z=z.substring(r[0].length));)if(null!==(r=y.exec(z)))A.push(r[1]);else if(null!==(r=v.exec(z)))A.push(r[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");u[2]=A}else p|=2;if(3===p)throw Error("[sprintf] mixing positional and named placeholders is not (yet) supported"); w.push({placeholder:u[0],param_no:u[1],keys:u[2],sign:u[3],pad_char:u[4],align:u[5],width:u[6],precision:u[7],type:u[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");D=D.substring(u[0].length)}l=m[l]=w}D=arguments;u=1;for(var w=l.length,A="",E,x,F,B,J,z=0;z<w;z++)if("string"===typeof l[z])A+=l[z];else if("object"===typeof l[z]){r=l[z];if(r.keys)for(p=D[u],E=0;E<r.keys.length;E++){if(void 0==p)throw Error(c('[sprintf] Cannot access property "%s" of undefined value "%s"',r.keys[E], r.keys[E-1]));p=p[r.keys[E]]}else p=r.param_no?D[r.param_no]:D[u++];e.test(r.type)&&f.test(r.type)&&p instanceof Function&&(p=p());if(b.test(r.type)&&"number"!==typeof p&&isNaN(p))throw new TypeError(c("[sprintf] expecting number but found %T",p));d.test(r.type)&&(B=0<=p);switch(r.type){case "b":p=parseInt(p,10).toString(2);break;case "c":p=String.fromCharCode(parseInt(p,10));break;case "d":case "i":p=parseInt(p,10);break;case "j":p=JSON.stringify(p,null,r.width?parseInt(r.width):0);break;case "e":p= r.precision?parseFloat(p).toExponential(r.precision):parseFloat(p).toExponential();break;case "f":p=r.precision?parseFloat(p).toFixed(r.precision):parseFloat(p);break;case "g":p=r.precision?String(Number(p.toPrecision(r.precision))):parseFloat(p);break;case "o":p=(parseInt(p,10)>>>0).toString(8);break;case "s":p=String(p);p=r.precision?p.substring(0,r.precision):p;break;case "t":p=String(!!p);p=r.precision?p.substring(0,r.precision):p;break;case "T":p=Object.prototype.toString.call(p).slice(8,-1).toLowerCase(); p=r.precision?p.substring(0,r.precision):p;break;case "u":p=parseInt(p,10)>>>0;break;case "v":p=p.valueOf();p=r.precision?p.substring(0,r.precision):p;break;case "x":p=(parseInt(p,10)>>>0).toString(16);break;case "X":p=(parseInt(p,10)>>>0).toString(16).toUpperCase()}if(g.test(r.type))A+=p;else{!d.test(r.type)||B&&!r.sign?J="":(J=B?"+":"-",p=p.toString().replace(t,""));E=r.pad_char?"0"===r.pad_char?"0":r.pad_char.charAt(1):" ";F=r.width-(J+p).length;if(r.width)if(0<F)if(x=E,"_".repeat)x=x.repeat(F); else{for(var P=0,O=[];P<F;P++)O.push(x);x=O.join("")}else x="";else x="";A+=r.align?J+p+x:"0"===E?J+x+p:x+J+p}}return A};a.sprintf=c;a.vsprintf=function(a,b){return c.apply(null,[a].concat(b||[]))}}})(dynamsoft.lib); (function(a){function c(){for(var a=0;a<A.length;a++)A[a][0](A[a][1]);A=[];z=!1}function e(a,b){A.push([a,b]);z||(z=!0,p(c,0))}function f(a){a.state_="fulfilled";C(a)}function d(a){a.state_="rejected";C(a)}function b(a,b){"pending"===a.state_&&(a.state_="sealed",a.data_=b,e(d,a))}function g(a,b){"pending"===a.state_&&(a.state_="sealed",a.data_=b,e(f,a))}function k(a,b){a!==b&&l(a,b)||g(a,b)}function h(a,c){function d(a){k(c,a)}function e(a){b(c,a)}try{a(d,e)}catch(B){e(B)}}function q(a){var c=a.owner, d=c.state_,c=c.data_,e=a[d];a=a.then;if("function"===typeof e){d="fulfilled";try{c=e(c)}catch(B){b(a,B)}}l(a,c)||("fulfilled"===d&&k(a,c),"rejected"===d&&b(a,c))}function n(a){if("function"!==typeof a)throw new TypeError("Promise constructor takes a function argument");if(!1===this instanceof n)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[];h(a,this)}if(!(a._promise_ver&&20190506<=a._promise_ver)){a._promise_ver= 20190506;var y=a.isUndef(y)?this:y,v=a.isUndef(window)?a.isUndef(v)?y:v:window,t=a.isUndef(t)?0:t,m=a.isUndef(m)?setTimeout:m,l,C,D=v.Promise,u=D&&"resolve"in D&&"reject"in D&&"all"in D&&"race"in D&&function(){var a;new D(function(b){a=b});return"function"===typeof a}(),w=function(){},p=m,A=[],z;l=function(a,c){var d;try{if(a===c)throw new TypeError("A promises callback cannot return that same promise.");if(c&&("function"===typeof c||"object"===typeof c)){var e=c.then;if("function"===typeof e)return e.call(c, function(b){d||(d=!0,c!==b?k(a,b):g(a,b))},function(c){d||(d=!0,b(a,c))}),!0}}catch(B){return d||b(a,B),!0}return!1};C=function(a){var b=a.then_;a.then_=void 0;for(a=0;a<b.length;a++)q(b[a])};n.prototype={constructor:n,state_:"pending",then_:null,data_:void 0,then:function(a,b){var c={owner:this,then:new this.constructor(w),fulfilled:a,rejected:b};"fulfilled"===this.state_||"rejected"===this.state_?e(q,c):this.then_.push(c);return c.then},"catch":function(a){return this.then(null,a)}};n.all=function(a){if("[object Array]"!== Object.prototype.toString.call(a))throw new TypeError("You must pass an array to Promise.all().");return new this(function(b,c){function d(a){g++;return function(c){e[a]=c;--g||b(e)}}for(var e=[],g=0,f=0,m;f<a.length;f++)(m=a[f])&&"function"===typeof m.then?m.then(d(f),c):e[f]=m;g||b(e)})};n.race=function(a){if("[object Array]"!==Object.prototype.toString.call(a))throw new TypeError("You must pass an array to Promise.race().");return new this(function(b,c){for(var d=0,e;d<a.length;d++)(e=a[d])&&"function"=== typeof e.then?e.then(b,c):b(e)})};n.resolve=function(a){return a&&"object"===typeof a&&a.constructor===this?a:new this(function(b){b(a)})};n.reject=function(a){return new this(function(b,c){c(a)})};t?(t.Promise=u?D:n,t.Polyfill=n):"function"==typeof define&&define.amd?define(function(){return u?D:n}):u||(v.Promise=n)}})(dynamsoft.lib); (function(a){function c(a){a.style.top=(k.body.scrollTop||k.documentElement.scrollTop)+((g.innerHeight?g.innerHeight:k.documentElement.clientHeight)-a.offsetHeight)/2+"px";a._dlgInfo.isTopOverridden=!0}function e(a){var b=!1;g.ge