diff --git a/bits/01_version.js b/bits/01_version.js index 5173202..692e487 100644 --- a/bits/01_version.js +++ b/bits/01_version.js @@ -1 +1 @@ -PRINTJ.version = '1.2.2'; +PRINTJ.version = '1.2.3'; diff --git a/dist/LICENSE b/dist/LICENSE index de06dc2..4a5a262 100644 --- a/dist/LICENSE +++ b/dist/LICENSE @@ -1,4 +1,192 @@ -Copyright (C) 2016-present SheetJS + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (C) 2016-present SheetJS LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -11,4 +199,3 @@ Copyright (C) 2016-present SheetJS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - diff --git a/dist/printj.js b/dist/printj.js index a7de1cc..778d0bb 100644 --- a/dist/printj.js +++ b/dist/printj.js @@ -25,7 +25,7 @@ var PRINTJ; /*jshint ignore:end */ }(function(PRINTJ) { -PRINTJ.version = '1.2.2'; +PRINTJ.version = '1.2.3'; function tokenize(fmt) { var out = []; diff --git a/dist/printj.min.js b/dist/printj.min.js index b41a2f2..00e7cfd 100644 --- a/dist/printj.min.js +++ b/dist/printj.min.js @@ -1,2 +1,2 @@ /* printj.js (C) 2016-present SheetJS -- http://sheetjs.com */ -var PRINTJ;(function(factory){if(typeof DO_NOT_EXPORT_PRINTJ==="undefined"){if("object"===typeof exports){factory(exports)}else if("function"===typeof define&&define.amd){define(function(){var module={};factory(module);return module})}else{factory(PRINTJ={})}}else{factory(PRINTJ={})}})(function(PRINTJ){PRINTJ.version="1.2.2";function tokenize(fmt){var out=[];var start=0;var i=0;var infmt=false;var fmtparam="",fmtflags="",fmtwidth="",fmtprec="",fmtlen="";var c=0;var L=fmt.length;for(;i=48&&c<58){if(fmtprec.length)fmtprec+=String.fromCharCode(c);else if(c==48&&!fmtwidth.length)fmtflags+=String.fromCharCode(c);else fmtwidth+=String.fromCharCode(c)}else switch(c){case 36:if(fmtprec.length)fmtprec+="$";else if(fmtwidth.charAt(0)=="*")fmtwidth+="$";else{fmtparam=fmtwidth+"$";fmtwidth=""}break;case 39:fmtflags+="'";break;case 45:fmtflags+="-";break;case 43:fmtflags+="+";break;case 32:fmtflags+=" ";break;case 35:fmtflags+="#";break;case 46:fmtprec=".";break;case 42:if(fmtprec.charAt(0)==".")fmtprec+="*";else fmtwidth+="*";break;case 104:;case 108:if(fmtlen.length>1)throw"bad length "+fmtlen+String(c);fmtlen+=String.fromCharCode(c);break;case 76:;case 106:;case 122:;case 116:;case 113:;case 90:;case 119:if(fmtlen!=="")throw"bad length "+fmtlen+String.fromCharCode(c);fmtlen=String.fromCharCode(c);break;case 73:if(fmtlen!=="")throw"bad length "+fmtlen+"I";fmtlen="I";break;case 100:;case 105:;case 111:;case 117:;case 120:;case 88:;case 102:;case 70:;case 101:;case 69:;case 103:;case 71:;case 97:;case 65:;case 99:;case 67:;case 115:;case 83:;case 112:;case 110:;case 68:;case 85:;case 79:;case 109:;case 98:;case 66:;case 121:;case 89:;case 74:;case 86:;case 84:;case 37:infmt=false;if(fmtprec.length>1)fmtprec=fmtprec.substr(1);out.push([String.fromCharCode(c),fmt.substring(start,i+1),fmtparam,fmtflags,fmtwidth,fmtprec,fmtlen]);start=i+1;fmtlen=fmtprec=fmtwidth=fmtflags=fmtparam="";break;default:throw new Error("Invalid format string starting with |"+fmt.substring(start,i+1)+"|");}}if(start-1;if(m[2])argidx=parseInt(m[2])-1;else if(c===109&&!alt){o.push("Success");continue}var width=0;if(m[4]!=null&&m[4].length>0){if(m[4].charAt(0)!=="*")width=parseInt(m[4],10);else if(m[4].length===1)width=args[idx++];else width=args[parseInt(m[4].substr(1),10)-1]}var prec=-1;if(m[5]!=null&&m[5].length>0){if(m[5].charAt(0)!=="*")prec=parseInt(m[5],10);else if(m[5].length===1)prec=args[idx++];else prec=args[parseInt(m[5].substr(1),10)-1]}if(!m[2])argidx=idx++;var arg=args[argidx];var len=m[6]||"";switch(c){case 83:;case 115:O=String(arg);if(prec>=0)O=O.substr(0,prec);if(width>O.length||-width>O.length){if((flags.indexOf("-")==-1||width<0)&&flags.indexOf("0")!=-1){pad=width-O.length>=0?"0".repeat(width-O.length):"";O=pad+O}else{pad=width-O.length>=0?" ".repeat(width-O.length):"";O=flags.indexOf("-")>-1?O+pad:pad+O}}break;case 67:;case 99:switch(typeof arg){case"number":var cc=arg;if(c==67||len.charCodeAt(0)===108){cc&=4294967295;O=String.fromCharCode(cc)}else{cc&=255;O=String.fromCharCode(cc)}break;case"string":O=arg.charAt(0);break;default:O=String(arg).charAt(0);}if(width>O.length||-width>O.length){if((flags.indexOf("-")==-1||width<0)&&flags.indexOf("0")!=-1){pad=width-O.length>=0?"0".repeat(width-O.length):"";O=pad+O}else{pad=width-O.length>=0?" ".repeat(width-O.length):"";O=flags.indexOf("-")>-1?O+pad:pad+O}}break;case 68:bytes=8;case 100:;case 105:isnum=-1;sign=true;break;case 85:bytes=8;case 117:isnum=-1;break;case 79:bytes=8;case 111:isnum=-1;radix=8;break;case 120:isnum=-1;radix=-16;break;case 88:isnum=-1;radix=16;break;case 66:bytes=8;case 98:isnum=-1;radix=2;break;case 70:;case 102:isnum=1;break;case 69:;case 101:isnum=2;break;case 71:;case 103:isnum=3;break;case 65:;case 97:isnum=4;break;case 112:Vnum=typeof arg=="number"?arg:arg?Number(arg.l):-1;if(isNaN(Vnum))Vnum=-1;if(alt)O=Vnum.toString(10);else{Vnum=Math.abs(Vnum);O="0x"+Vnum.toString(16).toLowerCase()}break;case 110:if(arg){arg.len=0;for(var oo=0;oo=0)O=O.substr(0,prec);if(width>O.length||-width>O.length){if((flags.indexOf("-")==-1||width<0)&&flags.indexOf("0")!=-1){pad=width-O.length>=0?"0".repeat(width-O.length):"";O=pad+O}else{pad=width-O.length>=0?" ".repeat(width-O.length):"";O=flags.indexOf("-")>-1?O+pad:pad+O}}break;}if(width<0){width=-width;flags+="-"}if(isnum==-1){Vnum=Number(arg);switch(len){case"hh":{bytes=1}break;case"h":{bytes=2}break;case"l":{if(bytes==4)bytes=8}break;case"L":;case"q":;case"ll":{if(bytes==4)bytes=8}break;case"j":{if(bytes==4)bytes=8}break;case"t":{if(bytes==4)bytes=8}break;case"z":;case"Z":{if(bytes==4)bytes=8}break;case"I":{if(bytes==4)bytes=8}break;case"w":break;}switch(bytes){case 1:Vnum=Vnum&255;if(sign&&Vnum>127)Vnum-=255+1;break;case 2:Vnum=Vnum&65535;if(sign&&Vnum>32767)Vnum-=65535+1;break;case 4:Vnum=sign?Vnum|0:Vnum>>>0;break;default:Vnum=isNaN(Vnum)?0:Math.round(Vnum);break;}if(bytes>4&&Vnum<0&&!sign){if(radix==16||radix==-16){O=(Vnum>>>0).toString(16);Vnum=Math.floor((Vnum-(Vnum>>>0))/Math.pow(2,32));O=(Vnum>>>0).toString(16)+(8-O.length>=0?"0".repeat(8-O.length):"")+O;O=(16-O.length>=0?"f".repeat(16-O.length):"")+O;if(radix==16)O=O.toUpperCase()}else if(radix==8){O=(Vnum>>>0).toString(8);O=(10-O.length>=0?"0".repeat(10-O.length):"")+O;Vnum=Math.floor((Vnum-(Vnum>>>0&1073741823))/Math.pow(2,30));O=(Vnum>>>0).toString(8)+O.substr(O.length-10);O=O.substr(O.length-20);O="1"+(21-O.length>=0?"7".repeat(21-O.length):"")+O}else{Vnum=-Vnum%1e16;var d1=[1,8,4,4,6,7,4,4,0,7,3,7,0,9,5,5,1,6,1,6];var di=d1.length-1;while(Vnum>0){if((d1[di]-=Vnum%10)<0){d1[di]+=10;d1[di-1]--}--di;Vnum=Math.floor(Vnum/10)}O=d1.join("")}}else{if(radix===-16)O=Vnum.toString(16).toLowerCase();else if(radix===16)O=Vnum.toString(16).toUpperCase();else O=Vnum.toString(radix)}if(prec===0&&O=="0"&&!(radix==8&&alt))O="";else{if(O.length=0?"0".repeat(prec-O.length):"")+O;else O=O.substr(0,1)+(prec+1-O.length>=0?"0".repeat(prec+1-O.length):"")+O.substr(1)}if(!sign&&alt&&Vnum!==0)switch(radix){case-16:O="0x"+O;break;case 16:O="0X"+O;break;case 8:if(O.charAt(0)!="0")O="0"+O;break;case 2:O="0b"+O;break;}}if(sign&&O.charAt(0)!="-"){if(flags.indexOf("+")>-1)O="+"+O;else if(flags.indexOf(" ")>-1)O=" "+O}if(width>0){if(O.length-1){O=O+(width-O.length>=0?" ".repeat(width-O.length):"")}else if(flags.indexOf("0")>-1&&prec<0&&O.length>0){if(prec>O.length)O=(prec-O.length>=0?"0".repeat(prec-O.length):"")+O;pad=width-O.length>=0?(prec>0?" ":"0").repeat(width-O.length):"";if(O.charCodeAt(0)<48){if(O.charAt(2).toLowerCase()=="x")O=O.substr(0,3)+pad+O.substring(3);else O=O.substr(0,1)+pad+O.substring(1)}else if(O.charAt(1).toLowerCase()=="x")O=O.substr(0,2)+pad+O.substring(2);else O=pad+O}else{O=(width-O.length>=0?" ".repeat(width-O.length):"")+O}}}}else if(isnum>0){Vnum=Number(arg);if(arg===null)Vnum=0/0;if(len=="L")bytes=12;var isf=isFinite(Vnum);if(!isf){if(Vnum<0)O="-";else if(flags.indexOf("+")>-1)O="+";else if(flags.indexOf(" ")>-1)O=" ";O+=isNaN(Vnum)?"nan":"inf"}else{var E=0;if(prec==-1&&isnum!=4)prec=6;if(isnum==3){O=Vnum.toExponential(1);E=+O.substr(O.indexOf("e")+1);if(prec===0)prec=1;if(prec>E&&E>=-4){isnum=11;prec=prec-(E+1)}else{isnum=12;prec=prec-1}}var sg=Vnum<0||1/Vnum==-Infinity?"-":"";if(Vnum<0)Vnum=-Vnum;switch(isnum){case 1:;case 11:if(Vnum<1e21){O=Vnum.toFixed(prec);if(isnum==1){if(prec===0&&alt&&O.indexOf(".")==-1)O+="."}else if(!alt)O=O.replace(/(\.\d*[1-9])0*$/,"$1").replace(/\.0*$/,"");else if(O.indexOf(".")==-1)O+=".";break}O=Vnum.toExponential(20);E=+O.substr(O.indexOf("e")+1);O=O.charAt(0)+O.substr(2,O.indexOf("e")-2);O=O+(E-O.length+1>=0?"0".repeat(E-O.length+1):"");if(alt||prec>0&&isnum!==11)O=O+"."+(prec>=0?"0".repeat(prec):"");break;case 2:;case 12:O=Vnum.toExponential(prec);E=O.indexOf("e");if(O.length-E===3)O=O.substr(0,E+2)+"0"+O.substr(E+2);if(alt&&O.indexOf(".")==-1)O=O.substr(0,E)+"."+O.substr(E);else if(!alt&&isnum==12)O=O.replace(/\.0*e/,"e").replace(/\.(\d*[1-9])0*e/,".$1e");break;case 4:if(Vnum===0){O="0x0"+(alt||prec>0?"."+(prec>=0?"0".repeat(prec):""):"")+"p+0";break}O=Vnum.toString(16);var ac=O.charCodeAt(0);if(ac==48){ac=2;E=-4;Vnum*=16;while(O.charCodeAt(ac++)==48){E-=4;Vnum*=16}O=Vnum.toString(16);ac=O.charCodeAt(0)}var ai=O.indexOf(".");if(O.indexOf("(")>-1){var am=O.match(/\(e(.*)\)/);var ae=am?+am[1]:0;E+=4*ae;Vnum/=Math.pow(16,ae)}else if(ai>1){E+=4*(ai-1);Vnum/=Math.pow(16,ai-1)}else if(ai==-1){E+=4*(O.length-1);Vnum/=Math.pow(16,O.length-1)}if(bytes>8){if(ac<50){E-=3;Vnum*=8}else if(ac<52){E-=2;Vnum*=4}else if(ac<56){E-=1;Vnum*=2}}else{if(ac>=56){E+=3;Vnum/=8}else if(ac>=52){E+=2;Vnum/=4}else if(ac>=50){E+=1;Vnum/=2}}O=Vnum.toString(16);if(O.length>1){if(O.length>prec+2&&O.charCodeAt(prec+2)>=56){var _f=O.charCodeAt(0)==102;O=(Vnum+8*Math.pow(16,-prec-1)).toString(16);if(_f&&O.charCodeAt(0)==49)E+=4}if(prec>0){O=O.substr(0,prec+2);if(O.length=0?"0".repeat(prec+2-O.length):"")+O.substr(1);else O+=prec+2-O.length>=0?"0".repeat(prec+2-O.length):""}}else if(prec===0)O=O.charAt(0)+(alt?".":"")}else if(prec>0)O=O+"."+(prec>=0?"0".repeat(prec):"");else if(alt)O=O+".";O="0x"+O+"p"+(E>=0?"+"+E:E);break;}if(sg===""){if(flags.indexOf("+")>-1)sg="+";else if(flags.indexOf(" ")>-1)sg=" "}O=sg+O}if(width>O.length){if(flags.indexOf("-")>-1){O=O+(width-O.length>=0?" ".repeat(width-O.length):"")}else if(flags.indexOf("0")>-1&&O.length>0&&isf){pad=width-O.length>=0?"0".repeat(width-O.length):"";if(O.charCodeAt(0)<48){if(O.charAt(2).toLowerCase()=="x")O=O.substr(0,3)+pad+O.substring(3);else O=O.substr(0,1)+pad+O.substring(1)}else if(O.charAt(1).toLowerCase()=="x")O=O.substr(0,2)+pad+O.substring(2);else O=pad+O}else{O=(width-O.length>=0?" ".repeat(width-O.length):"")+O}}if(c<96)O=O.toUpperCase()}o.push(O)}return o.join("")}function vsprintf(fmt,args){return doit(tokenize(fmt),args)}function sprintf(){var args=new Array(arguments.length-1);for(var i=0;i=48&&c<58){if(fmtprec.length)fmtprec+=String.fromCharCode(c);else if(c==48&&!fmtwidth.length)fmtflags+=String.fromCharCode(c);else fmtwidth+=String.fromCharCode(c)}else switch(c){case 36:if(fmtprec.length)fmtprec+="$";else if(fmtwidth.charAt(0)=="*")fmtwidth+="$";else{fmtparam=fmtwidth+"$";fmtwidth=""}break;case 39:fmtflags+="'";break;case 45:fmtflags+="-";break;case 43:fmtflags+="+";break;case 32:fmtflags+=" ";break;case 35:fmtflags+="#";break;case 46:fmtprec=".";break;case 42:if(fmtprec.charAt(0)==".")fmtprec+="*";else fmtwidth+="*";break;case 104:;case 108:if(fmtlen.length>1)throw"bad length "+fmtlen+String(c);fmtlen+=String.fromCharCode(c);break;case 76:;case 106:;case 122:;case 116:;case 113:;case 90:;case 119:if(fmtlen!=="")throw"bad length "+fmtlen+String.fromCharCode(c);fmtlen=String.fromCharCode(c);break;case 73:if(fmtlen!=="")throw"bad length "+fmtlen+"I";fmtlen="I";break;case 100:;case 105:;case 111:;case 117:;case 120:;case 88:;case 102:;case 70:;case 101:;case 69:;case 103:;case 71:;case 97:;case 65:;case 99:;case 67:;case 115:;case 83:;case 112:;case 110:;case 68:;case 85:;case 79:;case 109:;case 98:;case 66:;case 121:;case 89:;case 74:;case 86:;case 84:;case 37:infmt=false;if(fmtprec.length>1)fmtprec=fmtprec.substr(1);out.push([String.fromCharCode(c),fmt.substring(start,i+1),fmtparam,fmtflags,fmtwidth,fmtprec,fmtlen]);start=i+1;fmtlen=fmtprec=fmtwidth=fmtflags=fmtparam="";break;default:throw new Error("Invalid format string starting with |"+fmt.substring(start,i+1)+"|");}}if(start-1;if(m[2])argidx=parseInt(m[2])-1;else if(c===109&&!alt){o.push("Success");continue}var width=0;if(m[4]!=null&&m[4].length>0){if(m[4].charAt(0)!=="*")width=parseInt(m[4],10);else if(m[4].length===1)width=args[idx++];else width=args[parseInt(m[4].substr(1),10)-1]}var prec=-1;if(m[5]!=null&&m[5].length>0){if(m[5].charAt(0)!=="*")prec=parseInt(m[5],10);else if(m[5].length===1)prec=args[idx++];else prec=args[parseInt(m[5].substr(1),10)-1]}if(!m[2])argidx=idx++;var arg=args[argidx];var len=m[6]||"";switch(c){case 83:;case 115:O=String(arg);if(prec>=0)O=O.substr(0,prec);if(width>O.length||-width>O.length){if((flags.indexOf("-")==-1||width<0)&&flags.indexOf("0")!=-1){pad=width-O.length>=0?"0".repeat(width-O.length):"";O=pad+O}else{pad=width-O.length>=0?" ".repeat(width-O.length):"";O=flags.indexOf("-")>-1?O+pad:pad+O}}break;case 67:;case 99:switch(typeof arg){case"number":var cc=arg;if(c==67||len.charCodeAt(0)===108){cc&=4294967295;O=String.fromCharCode(cc)}else{cc&=255;O=String.fromCharCode(cc)}break;case"string":O=arg.charAt(0);break;default:O=String(arg).charAt(0);}if(width>O.length||-width>O.length){if((flags.indexOf("-")==-1||width<0)&&flags.indexOf("0")!=-1){pad=width-O.length>=0?"0".repeat(width-O.length):"";O=pad+O}else{pad=width-O.length>=0?" ".repeat(width-O.length):"";O=flags.indexOf("-")>-1?O+pad:pad+O}}break;case 68:bytes=8;case 100:;case 105:isnum=-1;sign=true;break;case 85:bytes=8;case 117:isnum=-1;break;case 79:bytes=8;case 111:isnum=-1;radix=8;break;case 120:isnum=-1;radix=-16;break;case 88:isnum=-1;radix=16;break;case 66:bytes=8;case 98:isnum=-1;radix=2;break;case 70:;case 102:isnum=1;break;case 69:;case 101:isnum=2;break;case 71:;case 103:isnum=3;break;case 65:;case 97:isnum=4;break;case 112:Vnum=typeof arg=="number"?arg:arg?Number(arg.l):-1;if(isNaN(Vnum))Vnum=-1;if(alt)O=Vnum.toString(10);else{Vnum=Math.abs(Vnum);O="0x"+Vnum.toString(16).toLowerCase()}break;case 110:if(arg){arg.len=0;for(var oo=0;oo=0)O=O.substr(0,prec);if(width>O.length||-width>O.length){if((flags.indexOf("-")==-1||width<0)&&flags.indexOf("0")!=-1){pad=width-O.length>=0?"0".repeat(width-O.length):"";O=pad+O}else{pad=width-O.length>=0?" ".repeat(width-O.length):"";O=flags.indexOf("-")>-1?O+pad:pad+O}}break;}if(width<0){width=-width;flags+="-"}if(isnum==-1){Vnum=Number(arg);switch(len){case"hh":{bytes=1}break;case"h":{bytes=2}break;case"l":{if(bytes==4)bytes=8}break;case"L":;case"q":;case"ll":{if(bytes==4)bytes=8}break;case"j":{if(bytes==4)bytes=8}break;case"t":{if(bytes==4)bytes=8}break;case"z":;case"Z":{if(bytes==4)bytes=8}break;case"I":{if(bytes==4)bytes=8}break;case"w":break;}switch(bytes){case 1:Vnum=Vnum&255;if(sign&&Vnum>127)Vnum-=255+1;break;case 2:Vnum=Vnum&65535;if(sign&&Vnum>32767)Vnum-=65535+1;break;case 4:Vnum=sign?Vnum|0:Vnum>>>0;break;default:Vnum=isNaN(Vnum)?0:Math.round(Vnum);break;}if(bytes>4&&Vnum<0&&!sign){if(radix==16||radix==-16){O=(Vnum>>>0).toString(16);Vnum=Math.floor((Vnum-(Vnum>>>0))/Math.pow(2,32));O=(Vnum>>>0).toString(16)+(8-O.length>=0?"0".repeat(8-O.length):"")+O;O=(16-O.length>=0?"f".repeat(16-O.length):"")+O;if(radix==16)O=O.toUpperCase()}else if(radix==8){O=(Vnum>>>0).toString(8);O=(10-O.length>=0?"0".repeat(10-O.length):"")+O;Vnum=Math.floor((Vnum-(Vnum>>>0&1073741823))/Math.pow(2,30));O=(Vnum>>>0).toString(8)+O.substr(O.length-10);O=O.substr(O.length-20);O="1"+(21-O.length>=0?"7".repeat(21-O.length):"")+O}else{Vnum=-Vnum%1e16;var d1=[1,8,4,4,6,7,4,4,0,7,3,7,0,9,5,5,1,6,1,6];var di=d1.length-1;while(Vnum>0){if((d1[di]-=Vnum%10)<0){d1[di]+=10;d1[di-1]--}--di;Vnum=Math.floor(Vnum/10)}O=d1.join("")}}else{if(radix===-16)O=Vnum.toString(16).toLowerCase();else if(radix===16)O=Vnum.toString(16).toUpperCase();else O=Vnum.toString(radix)}if(prec===0&&O=="0"&&!(radix==8&&alt))O="";else{if(O.length=0?"0".repeat(prec-O.length):"")+O;else O=O.substr(0,1)+(prec+1-O.length>=0?"0".repeat(prec+1-O.length):"")+O.substr(1)}if(!sign&&alt&&Vnum!==0)switch(radix){case-16:O="0x"+O;break;case 16:O="0X"+O;break;case 8:if(O.charAt(0)!="0")O="0"+O;break;case 2:O="0b"+O;break;}}if(sign&&O.charAt(0)!="-"){if(flags.indexOf("+")>-1)O="+"+O;else if(flags.indexOf(" ")>-1)O=" "+O}if(width>0){if(O.length-1){O=O+(width-O.length>=0?" ".repeat(width-O.length):"")}else if(flags.indexOf("0")>-1&&prec<0&&O.length>0){if(prec>O.length)O=(prec-O.length>=0?"0".repeat(prec-O.length):"")+O;pad=width-O.length>=0?(prec>0?" ":"0").repeat(width-O.length):"";if(O.charCodeAt(0)<48){if(O.charAt(2).toLowerCase()=="x")O=O.substr(0,3)+pad+O.substring(3);else O=O.substr(0,1)+pad+O.substring(1)}else if(O.charAt(1).toLowerCase()=="x")O=O.substr(0,2)+pad+O.substring(2);else O=pad+O}else{O=(width-O.length>=0?" ".repeat(width-O.length):"")+O}}}}else if(isnum>0){Vnum=Number(arg);if(arg===null)Vnum=0/0;if(len=="L")bytes=12;var isf=isFinite(Vnum);if(!isf){if(Vnum<0)O="-";else if(flags.indexOf("+")>-1)O="+";else if(flags.indexOf(" ")>-1)O=" ";O+=isNaN(Vnum)?"nan":"inf"}else{var E=0;if(prec==-1&&isnum!=4)prec=6;if(isnum==3){O=Vnum.toExponential(1);E=+O.substr(O.indexOf("e")+1);if(prec===0)prec=1;if(prec>E&&E>=-4){isnum=11;prec=prec-(E+1)}else{isnum=12;prec=prec-1}}var sg=Vnum<0||1/Vnum==-Infinity?"-":"";if(Vnum<0)Vnum=-Vnum;switch(isnum){case 1:;case 11:if(Vnum<1e21){O=Vnum.toFixed(prec);if(isnum==1){if(prec===0&&alt&&O.indexOf(".")==-1)O+="."}else if(!alt)O=O.replace(/(\.\d*[1-9])0*$/,"$1").replace(/\.0*$/,"");else if(O.indexOf(".")==-1)O+=".";break}O=Vnum.toExponential(20);E=+O.substr(O.indexOf("e")+1);O=O.charAt(0)+O.substr(2,O.indexOf("e")-2);O=O+(E-O.length+1>=0?"0".repeat(E-O.length+1):"");if(alt||prec>0&&isnum!==11)O=O+"."+(prec>=0?"0".repeat(prec):"");break;case 2:;case 12:O=Vnum.toExponential(prec);E=O.indexOf("e");if(O.length-E===3)O=O.substr(0,E+2)+"0"+O.substr(E+2);if(alt&&O.indexOf(".")==-1)O=O.substr(0,E)+"."+O.substr(E);else if(!alt&&isnum==12)O=O.replace(/\.0*e/,"e").replace(/\.(\d*[1-9])0*e/,".$1e");break;case 4:if(Vnum===0){O="0x0"+(alt||prec>0?"."+(prec>=0?"0".repeat(prec):""):"")+"p+0";break}O=Vnum.toString(16);var ac=O.charCodeAt(0);if(ac==48){ac=2;E=-4;Vnum*=16;while(O.charCodeAt(ac++)==48){E-=4;Vnum*=16}O=Vnum.toString(16);ac=O.charCodeAt(0)}var ai=O.indexOf(".");if(O.indexOf("(")>-1){var am=O.match(/\(e(.*)\)/);var ae=am?+am[1]:0;E+=4*ae;Vnum/=Math.pow(16,ae)}else if(ai>1){E+=4*(ai-1);Vnum/=Math.pow(16,ai-1)}else if(ai==-1){E+=4*(O.length-1);Vnum/=Math.pow(16,O.length-1)}if(bytes>8){if(ac<50){E-=3;Vnum*=8}else if(ac<52){E-=2;Vnum*=4}else if(ac<56){E-=1;Vnum*=2}}else{if(ac>=56){E+=3;Vnum/=8}else if(ac>=52){E+=2;Vnum/=4}else if(ac>=50){E+=1;Vnum/=2}}O=Vnum.toString(16);if(O.length>1){if(O.length>prec+2&&O.charCodeAt(prec+2)>=56){var _f=O.charCodeAt(0)==102;O=(Vnum+8*Math.pow(16,-prec-1)).toString(16);if(_f&&O.charCodeAt(0)==49)E+=4}if(prec>0){O=O.substr(0,prec+2);if(O.length=0?"0".repeat(prec+2-O.length):"")+O.substr(1);else O+=prec+2-O.length>=0?"0".repeat(prec+2-O.length):""}}else if(prec===0)O=O.charAt(0)+(alt?".":"")}else if(prec>0)O=O+"."+(prec>=0?"0".repeat(prec):"");else if(alt)O=O+".";O="0x"+O+"p"+(E>=0?"+"+E:E);break;}if(sg===""){if(flags.indexOf("+")>-1)sg="+";else if(flags.indexOf(" ")>-1)sg=" "}O=sg+O}if(width>O.length){if(flags.indexOf("-")>-1){O=O+(width-O.length>=0?" ".repeat(width-O.length):"")}else if(flags.indexOf("0")>-1&&O.length>0&&isf){pad=width-O.length>=0?"0".repeat(width-O.length):"";if(O.charCodeAt(0)<48){if(O.charAt(2).toLowerCase()=="x")O=O.substr(0,3)+pad+O.substring(3);else O=O.substr(0,1)+pad+O.substring(1)}else if(O.charAt(1).toLowerCase()=="x")O=O.substr(0,2)+pad+O.substring(2);else O=pad+O}else{O=(width-O.length>=0?" ".repeat(width-O.length):"")+O}}if(c<96)O=O.toUpperCase()}o.push(O)}return o.join("")}function vsprintf(fmt,args){return doit(tokenize(fmt),args)}function sprintf(){var args=new Array(arguments.length-1);for(var i=0;i