Google Authenticator – WordPress Two Factor Authentication (2FA) - Version 5.3.7

Version Description

  • Google Authenticator-Two Factor Authentication (2FA) : Security : Two factor login with username fix.
Download this release

Release Info

Developer cyberlord92
Plugin Icon 128x128 Google Authenticator – WordPress Two Factor Authentication (2FA)
Version 5.3.7
Comparing to
See all releases

Code changes from version 5.3.6 to 5.3.7

api/class-customer-setup.php CHANGED
@@ -50,7 +50,41 @@ class Customer_Setup {
50
  return $response;
51
 
52
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
 
 
54
  function send_email_alert( $email, $phone, $message ) {
55
 
56
  $url = MO_HOST_NAME . '/moas/api/notify/send';
50
  return $response;
51
 
52
  }
53
+
54
+ function guest_audit() {
55
+ $url = MO_HOST_NAME . "/moas/rest/customer/guest-audit";
56
+ $email = get_option( "mo2f_email" );
57
+
58
+ $user = wp_get_current_user();
59
+
60
+ if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
61
+ if (empty($email))
62
+ $email = $user->user_email;
63
+ }
64
+
65
+ $mo2fApi= new Mo2f_Api();
66
+ $MoWpnsUtility = new MoWpnsUtility();
67
+ $company = get_option( 'mo2f_admin_company' ) != '' ? get_option( 'mo2f_admin_company' ) : $_SERVER['SERVER_NAME'];
68
+ $applicationName='Wordpress Two Factor;'.$MoWpnsUtility->checkPlugins();
69
+ $fields = array (
70
+ 'emailAddress' => $email,
71
+ 'companyName'=>$company,
72
+ 'cmsName'=>"WP",
73
+ 'applicationType'=>'Two Factor',
74
+ 'applicationName'=>$applicationName,
75
+ 'pluginVersion'=>MO2F_VERSION,
76
+ // 'inUse'=>'test'
77
+ );
78
+
79
+
80
+ $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
81
+
82
+ $field_string = json_encode ( $fields );
83
+ $response = $mo2fApi->make_curl_call( $url, $field_string,$headers );
84
+ return $response;
85
 
86
+ }
87
+
88
  function send_email_alert( $email, $phone, $message ) {
89
 
90
  $url = MO_HOST_NAME . '/moas/api/notify/send';
controllers/mo2fa_common_login.php CHANGED
@@ -192,7 +192,7 @@ function mo2f_get_forgotphone_form( $login_status, $login_message, $redirect_to,
192
  <?php if ( $mo2f_forgotphone_enabled ) {
193
  if ( isset( $login_message ) && ! empty( $login_message ) ) { ?>
194
  <div id="otpMessage" class="mo2fa_display_message_frontend">
195
- <p cclass="mo2fa_display_message_frontend"><?php echo $login_message; ?></p>
196
  </div>
197
  <?php } ?>
198
  <p class="mo2f_backup_options"><?php echo mo2f_lt( 'Please choose the options from below:' ); ?></p>
192
  <?php if ( $mo2f_forgotphone_enabled ) {
193
  if ( isset( $login_message ) && ! empty( $login_message ) ) { ?>
194
  <div id="otpMessage" class="mo2fa_display_message_frontend">
195
+ <p class="mo2fa_display_message_frontend"><?php echo $login_message; ?></p>
196
  </div>
197
  <?php } ?>
198
  <p class="mo2f_backup_options"><?php echo mo2f_lt( 'Please choose the options from below:' ); ?></p>
controllers/two_fa.php CHANGED
@@ -1,3 +1,4 @@
1
  <?php
2
 
3
- include $dirName . 'views'.DIRECTORY_SEPARATOR.'two_fa.php';
 
1
  <?php
2
 
3
+ include $dirName . 'views'.DIRECTORY_SEPARATOR.'two_fa.php';
4
+ update_site_option('mo2f_two_factor',true);
handler/class_miniorange_2fa_strong_password.php CHANGED
@@ -28,17 +28,13 @@ class class_miniorange_2fa_strong_password {
28
  {
29
  return true;
30
  }
31
- // $currentUser = wp_get_current_user();
32
- // $admin = 0;
33
- // if ( in_array( 'administrator', (array) $user->roles ) ) {
34
- // $admin = 1;
35
- // }
36
  if($Users == 'all' or ($Users == 'admin' and $UserRole == 'administrator') or ($Users == 'user' and $UserRole != 'administrator' ) or ($Users == 'admin' and is_null($UserRole)))
37
  {
38
  $password = (isset($_POST['pass1']) && trim($_POST['pass1'])) ? $_POST['pass1'] : false;
39
  $password=($password==false)?(isset($_POST['password_1'])?$_POST['password_1']:false):$password ;
40
  $user_id = isset($userData->ID) ? $userData->ID : false;
41
- $username = isset($_POST["user_login"]) ? $_POST["user_login"] : isset($userData->user_login)?$userData->user_login:$userData->user_email;
42
 
43
  if ($password == false) { return $errors; }
44
  if ($errors->get_error_data("pass")) { return $errors; }
28
  {
29
  return true;
30
  }
31
+
 
 
 
 
32
  if($Users == 'all' or ($Users == 'admin' and $UserRole == 'administrator') or ($Users == 'user' and $UserRole != 'administrator' ) or ($Users == 'admin' and is_null($UserRole)))
33
  {
34
  $password = (isset($_POST['pass1']) && trim($_POST['pass1'])) ? $_POST['pass1'] : false;
35
  $password=($password==false)?(isset($_POST['password_1'])?$_POST['password_1']:false):$password ;
36
  $user_id = isset($userData->ID) ? $userData->ID : false;
37
+ $username = isset($_POST["user_login"]) ? $_POST["user_login"] : (isset($userData->user_login)?$userData->user_login:$userData->user_email);
38
 
39
  if ($password == false) { return $errors; }
40
  if ($errors->get_error_data("pass")) { return $errors; }
handler/feedback_form.php CHANGED
@@ -24,6 +24,11 @@ class FeedbackHandler
24
 
25
  function wpns_handle_feedback($postdata)
26
  {
 
 
 
 
 
27
  $user = wp_get_current_user();
28
  $feedback_option = $_POST['option'];
29
  $message = 'Plugin Deactivated';
24
 
25
  function wpns_handle_feedback($postdata)
26
  {
27
+ if(MO2F_TEST_MODE){
28
+ deactivate_plugins(dirname(dirname(__FILE__ ))."\\miniorange_2_factor_settings.php");
29
+ return;
30
+ }
31
+
32
  $user = wp_get_current_user();
33
  $feedback_option = $_POST['option'];
34
  $message = 'Plugin Deactivated';
handler/gaonprem.php CHANGED
@@ -101,24 +101,24 @@ class Google_auth_onpremise{
101
 
102
  function verifyCode($secret, $code,$discrepancy = 1, $currentTimeSlice = null)
103
  {
104
- global $Mo2fdbQueries;
105
-
106
  if ($currentTimeSlice === null) {
107
  $currentTimeSlice = floor(time() / 30);
108
  }
109
 
110
  if (strlen($code) != 6) {
111
- return false;
112
  }
113
  for ($i = -$discrepancy; $i <= $discrepancy; ++$i) {
114
  $calculatedCode = $this->getCode($secret, $currentTimeSlice + $i);
115
  if ($this->timingSafeEquals($calculatedCode, $code)) {
116
- $response=array("status"=>'SUCCESS');
117
  return $response;
118
  }
119
  }
120
 
121
- return false;
122
  }
123
 
124
  function geturl($secret,$issuer,$email){
101
 
102
  function verifyCode($secret, $code,$discrepancy = 1, $currentTimeSlice = null)
103
  {
104
+ global $Mo2fdbQueries;
105
+ $response=array("status"=>'false');
106
  if ($currentTimeSlice === null) {
107
  $currentTimeSlice = floor(time() / 30);
108
  }
109
 
110
  if (strlen($code) != 6) {
111
+ return $response;
112
  }
113
  for ($i = -$discrepancy; $i <= $discrepancy; ++$i) {
114
  $calculatedCode = $this->getCode($secret, $currentTimeSlice + $i);
115
  if ($this->timingSafeEquals($calculatedCode, $code)) {
116
+ $response['status']='SUCCESS';
117
  return $response;
118
  }
119
  }
120
 
121
+ return $response;
122
  }
123
 
124
  function geturl($secret,$issuer,$email){
handler/mo-waf.php CHANGED
@@ -234,8 +234,7 @@
234
  if($RateLimiting == 1)
235
  {
236
 
237
- // if(!is_crawler())
238
- // {
239
  $time = 60;
240
  $reqLimit = $RequestsPMin;
241
  $query = "delete from ".$prefix."wpns_ip_rate_details where time<".(time()-$time);
@@ -298,17 +297,7 @@
298
  }
299
  }
300
  }
301
- // }
302
- // else
303
- // {
304
- // if($RateLimitingCrawler == '1')
305
- // {
306
- // $USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
307
- // applyRateLimitingCrawler($ipaddress,$fileName);
308
-
309
- // }
310
-
311
- // }
312
  }
313
 
314
  $attack = array();
234
  if($RateLimiting == 1)
235
  {
236
 
237
+
 
238
  $time = 60;
239
  $reqLimit = $RequestsPMin;
240
  $query = "delete from ".$prefix."wpns_ip_rate_details where time<".(time()-$time);
297
  }
298
  }
299
  }
300
+
 
 
 
 
 
 
 
 
 
 
301
  }
302
 
303
  $attack = array();
handler/setup_twofa.php CHANGED
@@ -358,13 +358,7 @@ function mo2f_show_registration_screen($user){
358
  global $dirName;
359
 
360
  include $dirName . 'controllers/account.php';
361
- // if(in_array($mo2f_current_registration_status, array("MO_2_FACTOR_OTP_DELIVERED_SUCCESS", "MO_2_FACTOR_OTP_DELIVERED_FAILURE"))){
362
- // include $dirName . 'views/account/verify.php';
363
- // }else if($mo2f_current_registration_status == "MO_2_FACTOR_VERIFY_CUSTOMER"){
364
- // include $dirName . 'views/account/login.php';
365
- // }else if($mo2f_current_registration_status == "REGISTRATION_STARTED"){
366
- // include $dirName . 'views/account/register.php';
367
- // }
368
  }
369
 
370
  function mo2f_show_2FA_configuration_screen( $user, $selected2FAmethod ) {
358
  global $dirName;
359
 
360
  include $dirName . 'controllers/account.php';
361
+
 
 
 
 
 
 
362
  }
363
 
364
  function mo2f_show_2FA_configuration_screen( $user, $selected2FAmethod ) {
handler/two_fa_login.php CHANGED
@@ -140,12 +140,12 @@ class Miniorange_Mobile_Login {
140
 
141
  function custom_login_enqueue_scripts() {
142
  wp_enqueue_script( 'jquery' );
143
- wp_enqueue_script( 'bootstrap_script', plugins_url( 'includes/js/bootstrap.min.js', __FILE__ ) );
144
  }
145
 
146
  function mo_2_factor_hide_login() {
147
- wp_register_style( 'hide-login', plugins_url( 'includes/css/hide-login.css?version=5.1.21', __FILE__ ) );
148
- wp_register_style( 'bootstrap', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.21', __FILE__ ) );
149
  wp_enqueue_style( 'hide-login' );
150
  wp_enqueue_style( 'bootstrap' );
151
 
@@ -197,7 +197,7 @@ class Miniorange_Mobile_Login {
197
  }
198
 
199
  function mo_2_factor_show_login_with_password_when_phonelogin_enabled() {
200
- wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.21', __FILE__ ) );
201
  wp_enqueue_style( 'show-login' );
202
  }
203
 
@@ -218,10 +218,11 @@ class Miniorange_Mobile_Login {
218
  }
219
 
220
  function mo_2_factor_show_login() {
 
221
  if ( get_option( 'mo2f_enable_login_with_2nd_factor' ) ) {
222
- wp_register_style( 'show-login', plugins_url( 'includes/css/hide-login-form.css?version=5.1.21', __FILE__ ) );
223
  } else {
224
- wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.21', __FILE__ ) );
225
  }
226
  wp_enqueue_style( 'show-login' );
227
  }
140
 
141
  function custom_login_enqueue_scripts() {
142
  wp_enqueue_script( 'jquery' );
143
+ wp_enqueue_script( 'bootstrap_script', plugins_url( 'includes/js/bootstrap.min.js', dirname(__FILE__ )) );
144
  }
145
 
146
  function mo_2_factor_hide_login() {
147
+ wp_register_style( 'hide-login', plugins_url( 'includes/css/hide-login.css?version=5.1.21', dirname(__FILE__ ) ) );
148
+ wp_register_style( 'bootstrap', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.21', dirname(__FILE__ ) ) );
149
  wp_enqueue_style( 'hide-login' );
150
  wp_enqueue_style( 'bootstrap' );
151
 
197
  }
198
 
199
  function mo_2_factor_show_login_with_password_when_phonelogin_enabled() {
200
+ wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.21', dirname(__FILE__ ) ) );
201
  wp_enqueue_style( 'show-login' );
202
  }
203
 
218
  }
219
 
220
  function mo_2_factor_show_login() {
221
+
222
  if ( get_option( 'mo2f_enable_login_with_2nd_factor' ) ) {
223
+ wp_register_style( 'show-login',plugins_url( 'includes/css/hide-login-form.css?version=5.1.21', dirname(__FILE__ )) );
224
  } else {
225
+ wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.21', dirname(__FILE__ )) );
226
  }
227
  wp_enqueue_style( 'show-login' );
228
  }
handler/two_fa_settings.php CHANGED
@@ -393,7 +393,7 @@ class Miniorange_Authentication {
393
  }
394
  wp_enqueue_script( 'jquery' );
395
  wp_enqueue_script( 'mo_2_factor_admin_settings_phone_script', plugins_url( 'includes/js/phone.js', __FILE__ ) );
396
- wp_enqueue_script( 'bootstrap_script', plugins_url( 'includes/js/bootstrap.min.js', __FILE__ ) );
397
  wp_enqueue_script( 'bootstrap_script_hehe', plugins_url( 'includes/js/bootstrap-tour-standalone.min.js', __FILE__ ) );
398
  wp_enqueue_script( 'mo2f_ns_admin_datatable_script', plugins_url('includes/js/jquery.dataTables.min.js', __FILE__ ), array('jquery'));
399
 
393
  }
394
  wp_enqueue_script( 'jquery' );
395
  wp_enqueue_script( 'mo_2_factor_admin_settings_phone_script', plugins_url( 'includes/js/phone.js', __FILE__ ) );
396
+ wp_enqueue_script( 'bootstrap_script', plugins_url( 'includes/js/bootstrap.min.js', dirname(__FILE__ )) );
397
  wp_enqueue_script( 'bootstrap_script_hehe', plugins_url( 'includes/js/bootstrap-tour-standalone.min.js', __FILE__ ) );
398
  wp_enqueue_script( 'mo2f_ns_admin_datatable_script', plugins_url('includes/js/jquery.dataTables.min.js', __FILE__ ), array('jquery'));
399
 
helper/utility.php CHANGED
@@ -258,7 +258,8 @@ class MoWpnsUtility
258
  else if(strpos($useragent, 'safari') !== false)
259
  return 'safari';
260
  }
261
-
 
262
  public static function getFeatureStatus(){
263
  $status='';
264
  $status.="#";
@@ -275,9 +276,31 @@ class MoWpnsUtility
275
  $status.="M1";
276
  if(get_site_option('mo2f_visit_backup'))
277
  $status.="B1";
278
-
 
 
279
  $status.="R".rand(0,1000);
280
  return $status;
281
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
 
283
  }
258
  else if(strpos($useragent, 'safari') !== false)
259
  return 'safari';
260
  }
261
+ //to know if the features are being used or not.
262
+
263
  public static function getFeatureStatus(){
264
  $status='';
265
  $status.="#";
276
  $status.="M1";
277
  if(get_site_option('mo2f_visit_backup'))
278
  $status.="B1";
279
+ if(get_site_option('mo2f_two_factor'))
280
+ $status.="TF1";
281
+
282
  $status.="R".rand(0,1000);
283
  return $status;
284
  }
285
+ //check if two factor is used for security
286
+ function checkPlugins(){
287
+ $installed="";
288
+ $filedirname=dirname(dirname(dirname(__FILE__)));
289
+ // var_dump($filedirname."/wordfence/wordfence.php",file_exists($filedirname."/wordfence/wordfence.php"));exit;
290
+ if(file_exists($filedirname."/wordfence/wordfence.php")){
291
+ $installed.="wordfence;";
292
+ }
293
+ if(file_exists($filedirname."/all-in-one-wp-security-and-firewall/wp-security.php")){
294
+ $installed.="all-in-one-wp-security-and-firewall;";
295
+ }
296
+ if(file_exists($filedirname."/better-wp-security/better-wp-security.php")){
297
+ $installed.="better-wp-security;";
298
+ }
299
+ if(file_exists($filedirname."/sucuri-scanner/sucuri.php")){
300
+ $installed.="sucuri-scanner;";
301
+ }
302
+ return $installed;
303
+
304
+ }
305
 
306
  }
includes/css/button_styles.css.orig DELETED
@@ -1,111 +0,0 @@
1
- .mo_wpns_switch {
2
- position: relative;
3
- display: inline-block;
4
- width: 60px;
5
- height: 34px;
6
- }
7
-
8
- .mo_wpns_switch input {
9
- opacity: 0;
10
- width: 0;
11
- height: 0;
12
- }
13
-
14
- .mo_wpns_slider {
15
- position: absolute;
16
- cursor: pointer;
17
- top: 0;
18
- left: 0;
19
- right: 0;
20
- bottom: 0;
21
- background-color: #ccc;
22
- -webkit-transition: .4s;
23
- transition: .4s;
24
- }
25
-
26
- .mo_wpns_slider:before {
27
- position: absolute;
28
- content: "";
29
- height: 26px;
30
- width: 26px;
31
- left: 4px;
32
- bottom: 4px;
33
- background-color: white;
34
- -webkit-transition: .4s;
35
- transition: .4s;
36
- }
37
-
38
- input:checked + .mo_wpns_slider {
39
- background-color: #20b2aa;
40
- }
41
-
42
- input:focus + .mo_wpns_slider {
43
- box-shadow: 0 0 1px #20b2aa;
44
- }
45
-
46
- input:checked + .mo_wpns_slider:before {
47
- -webkit-transform: translateX(26px);
48
- -ms-transform: translateX(26px);
49
- transform: translateX(26px);
50
- }
51
-
52
- /* Rounded sliders */
53
- .mo_wpns_slider.mo_wpns_round {
54
- border-radius: 34px;
55
- }
56
-
57
- .mo_wpns_slider.mo_wpns_round:before {
58
- border-radius: 50%;
59
- }
60
- .mo_wpns_switch_small {
61
- position: relative;
62
- display: inline-block;
63
- width: 44px;
64
- height: 24px;
65
- }
66
- .mo_wpns_switch_small input {
67
- opacity: 0;
68
- width: 0;
69
- height: 0;
70
- }
71
- .mo_wpns_slider_small {
72
- position: absolute;
73
- cursor: pointer;
74
- top: 0;
75
- left: 0;
76
- right: 0;
77
- bottom: 0;
78
- background-color: #ccc;
79
- -webkit-transition: .4s;
80
- transition: .4s;
81
- }
82
- .mo_wpns_slider_small:before {
83
- position: absolute;
84
- content: "";
85
- height: 18px;
86
- width: 18px;
87
- left: 3px;
88
- bottom: 3px;
89
- background-color: white;
90
- -webkit-transition: .4s;
91
- transition: .4s;
92
- }
93
- input:checked + .mo_wpns_slider_small {
94
- background-color: #20b2aa;
95
- }
96
- input:focus + .mo_wpns_slider_small {
97
- box-shadow: 0 0 1px #20b2aa;
98
- }
99
-
100
- input:checked + .mo_wpns_slider_small:before {
101
- -webkit-transform: translateX(17px);
102
- -ms-transform: translateX(17px);
103
- transform: translateX(17px);
104
- }
105
- .mo_wpns_slider_small.mo_wpns_round_small {
106
- border-radius: 24px;
107
- }
108
-
109
- .mo_wpns_slider_small.mo_wpns_round_small:before {
110
- border-radius: 50%;
111
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/css/hide-login-form.css ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body.login div#login {
2
+ display: block;
3
+ }
4
+
5
+ body.login div#login form#loginform input#user_login {
6
+ display: none;
7
+ }
8
+
9
+ body.login div#login form#loginform p.forgetmenot {
10
+ display: none;
11
+ }
12
+
13
+ body.login div#login form#loginform p.submit input#wp-submit {
14
+ display: none;
15
+ }
16
+
17
+ body.login div#login form#loginform p label {
18
+ display: none;
19
+ }
20
+
21
+ body.login div#login p#nav {
22
+ display: none;
23
+ }
24
+
25
+ body.login div#login form#loginform input#user_pass {
26
+ display: none;
27
+ }
28
+
29
+ body.login div#login div#login_error {
30
+ display: none;
31
+ }
32
+
33
+ body.login div#login div#login_error1 {
34
+ border-left: 4px solid #dd3d36;
35
+ margin-left: 0;
36
+ padding: 12px;
37
+ background: #fff;
38
+ -webkit-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
39
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
40
+ }
41
+
42
+ input.button-add {
43
+ background: #00a0d2 no-repeat 10px center !important;
44
+ background-size: 16px !important;
45
+ border-color: #00a0d2;
46
+ border-width: 0px;
47
+ vertical-align: middle !important;
48
+ border-radius: 3px !important;
49
+ color: white;
50
+ height: 30px;
51
+ cursor: pointer;
52
+ }
includes/css/show-login.css ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body.login div#login {
2
+ display: block;
3
+ }
4
+
5
+ body.login div#login form#loginform input#user_login {
6
+ display: block;
7
+ }
8
+
9
+ body.login div#login form#loginform p.forgetmenot {
10
+ display: block;
11
+ }
12
+
13
+ body.login div#login form#loginform p.submit input#wp-submit {
14
+ display: block;
15
+ }
16
+
17
+ body.login div#login form#loginform p label {
18
+ display: block;
19
+ }
20
+
21
+ body.login div#login p#nav {
22
+ display: block;
23
+ }
24
+
25
+ body.login div#login form#loginform input#user_pass {
26
+ display: block;
27
+ }
28
+
29
+ body.login div#login div#login_error {
30
+ display: block;
31
+ }
32
+
33
+ body.login div#login div#login_error1 {
34
+ border-left: 4px solid #dd3d36;
35
+ margin-left: 0;
36
+ padding: 12px;
37
+ background: #fff;
38
+ -webkit-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
39
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
40
+ }
41
+
42
+ input.button-add {
43
+ background: #00a0d2 url(../../includes/images/mo_white_logo.png) no-repeat 10px center !important;
44
+ background-size: 16px !important;
45
+ }
46
+
47
+ .miniorange-button {
48
+ height: 34px;
49
+ display: inline-block;
50
+ font-size: 14px;
51
+ line-height: 28px;
52
+ padding: 0 12px 2px;
53
+ border-width: 1px;
54
+ vertical-align: baseline;
55
+ border-style: solid;
56
+ border-color: #0073aa;
57
+ -webkit-appearance: none;
58
+ -webkit-border-radius: 3px;
59
+ border-radius: 3px;
60
+ white-space: nowrap;
61
+ -webkit-box-sizing: border-box;
62
+ -moz-box-sizing: border-box;
63
+ box-sizing: border-box;
64
+ -webkit-box-shadow: inset 0 1px 0 rgba(120, 200, 230, .5), 0 1px 0 rgba(0, 0, 0, .15);
65
+ box-shadow: inset 0 1px 0 rgba(120, 200, 230, .5), 0 1px 0 rgba(0, 0, 0, .15);
66
+ color: #fff;
67
+ text-decoration: none;
68
+ cursor: pointer;
69
+ }
70
+
71
+ .login_with_2factor_inner_div {
72
+ border-bottom: 1px solid #EEE;
73
+ width: 90%;
74
+ margin: 0 5%;
75
+ z-index: 1;
76
+ top: 50%;
77
+ position: absolute;
78
+ }
79
+
80
+ .login_with_2factor_h2 {
81
+ color: #666;
82
+ margin: 0 auto 20px auto;
83
+ padding: 3px 0;
84
+ text-align: center;
85
+ background: white;
86
+ width: 20%;
87
+ position: relative;
88
+ z-index: 2;
89
+ }
includes/css/twofa_style_settings.css.orig DELETED
@@ -1,976 +0,0 @@
1
- .mo2f_modal-open {
2
- overflow: hidden !important;
3
- position: fixed !important;
4
- width: 100% !important;
5
-
6
- }
7
-
8
- .mo2f_modal {
9
- position: fixed !important;
10
- top: 0;
11
- right: 0;
12
- bottom: 0;
13
- left: 0;
14
- z-index: 100000 !important;
15
-
16
- overflow: hidden !important;
17
- -webkit-overflow-scrolling: touch;
18
- outline: 0;
19
-
20
- }
21
-
22
- .mo2f_modal_inner {
23
- display: none;
24
- }
25
-
26
- .mo2f_modal.fade .mo2f_modal-dialog {
27
- -webkit-transition: -webkit-transform .3s ease-out;
28
- -o-transition: -o-transform .3s ease-out;
29
- transition: transform .3s ease-out;
30
- -webkit-transform: translate(0, -25%);
31
- -ms-transform: translate(0, -25%);
32
- -o-transform: translate(0, -25%);
33
- transform: translate(0, -25%)
34
- }
35
-
36
- .mo2f_modal.in .mo2f_modal-dialog {
37
- -webkit-transform: translate(0, 80px) !important;
38
- -ms-transform: translate(0, 80px) !important;
39
- -o-transform: translate(0, 80px) !important;
40
- transform: translate(0, 80px) !important;
41
-
42
- }
43
-
44
- .mo2f_modal-open .mo2f_modal {
45
- overflow-x: hidden;
46
- overflow-y: hidden;
47
- }
48
-
49
- .mo2f_modal-dialog {
50
- position: relative;
51
- width: auto;
52
- margin: 10px;
53
-
54
- }
55
-
56
- .login mo_customer_validation-modal-content {
57
- position: relative !important;
58
- background-color: #fff !important;
59
- -webkit-background-clip: padding-box !important;
60
- background-clip: padding-box !important;
61
- border: 1px solid #999 !important;
62
- border: 1px solid rgba(0, 0, 0, .2) !important;
63
- border-radius: 6px !important;
64
- outline: 0 !important;
65
-
66
- -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5) !important;
67
- box-shadow: 0 3px 9px rgba(0, 0, 0, .5) !important;
68
- }
69
-
70
- .mo2f-modal-backdrop {
71
- position: absolute;
72
- top: 0;
73
- right: 0;
74
- left: 0;
75
- background-color: #f1f1f1 !important;
76
- filter: alpha(opacity=50) !important;
77
- opacity: 0.8 !important;
78
- height: 100% !important;
79
- }
80
-
81
- #smsAlertModal {
82
- background-color: black !important;
83
- opacity: 0.8 !important;
84
- font-family: Roboto;
85
- }
86
-
87
- #twoFAtestAlertModal {
88
- background-color: black !important;
89
- opacity: 0.8 !important;
90
- filter: alpha(opacity=50) !important;
91
- }
92
-
93
- .mo2f_modal-header {
94
- min-height: 14px;
95
- padding: 10px;
96
- border-bottom: 1px solid #e5e5e5
97
- }
98
-
99
- .mo2f_modal-title {
100
- margin: 0 !important;
101
- line-height: 1.0 !important;
102
- font-size: 1rem;
103
- }
104
-
105
- .mo2f_modal-body {
106
- / / width: 96 % !important;
107
- position: relative !important;
108
- padding: 15px !important;
109
- overflow-y: auto !important;
110
- max-height: 550px !important;
111
- }
112
-
113
- .mo2f_modal-footer {
114
- padding: 15px;
115
- text-align: right;
116
- border-top: 1px solid #e5e5e5
117
- }
118
-
119
- .mo2f_modal-footer .btn + .btn {
120
- margin-bottom: 0;
121
- margin-left: 5px
122
- }
123
-
124
- .mo2f_modal-footer .btn-group .btn + .btn {
125
- margin-left: -1px
126
- }
127
-
128
- .mo2f_modal-footer .btn-block + .btn-block {
129
- margin-left: 0
130
- }
131
-
132
- .mo2f_modal-scrollbar-measure {
133
- position: absolute;
134
- top: -9999px;
135
- width: 50px;
136
- height: 50px;
137
- overflow: scroll
138
- }
139
-
140
- .mo2f_close {
141
- float: right;
142
- font-size: 21px;
143
- font-weight: 700;
144
- line-height: 1;
145
- color: #000;
146
- text-shadow: 0 1px 0 #fff;
147
- filter: alpha(opacity=20);
148
- opacity: .2
149
- }
150
-
151
- .mo2f_close:hover, .mo2f_close:focus {
152
- color: #000;
153
- text-decoration: none;
154
- cursor: pointer;
155
- filter: alpha(opacity=50);
156
- opacity: .5
157
- }
158
-
159
- button.mo2f_close {
160
- -webkit-appearance: none;
161
- padding: 0;
162
- cursor: pointer;
163
- background: 0 0;
164
- border: 0
165
- }
166
-
167
- @media ( min-width: 768px) {
168
- .mo2f_modal-dialog {
169
- width: 373px;
170
- margin: 0px auto
171
- }
172
-
173
- .login mo_customer_validation-modal-content {
174
- -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
175
- box-shadow: 0 5px 15px rgba(0, 0, 0, .5)
176
- }
177
-
178
- .mo2f_modal-sm {
179
- width: 300px
180
- }
181
-
182
- .mo2f_modal-md {
183
- width: 550px
184
- }
185
- }
186
-
187
- @media ( min-width: 992px) {
188
- .mo2f_modal-lg {
189
- width: 900px;
190
- }
191
-
192
- .mo2f_modal-md {
193
- width: 550px
194
- }
195
- }
196
-
197
-
198
- @media ( min-width: 768px) {
199
- .mo2f_modal-dialog {
200
- width: 373px;
201
- margin: 0px auto
202
- }
203
-
204
- .login mo_customer_validation-modal-content {
205
- -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
206
- box-shadow: 0 5px 15px rgba(0, 0, 0, .5)
207
- }
208
-
209
- .mo2f_modal-sm {
210
- width: 300px
211
- }
212
-
213
- .mo2f_modal-md {
214
- width: 550px
215
- }
216
- }
217
-
218
- @media ( min-width: 992px) {
219
- .mo2f_modal-lg {
220
- width: 900px;
221
- }
222
-
223
- .mo2f_modal-md {
224
- width: 550px
225
- }
226
- }
227
-
228
- .center{
229
-
230
- text-align: center !important;
231
- }
232
-
233
- #otpMessage {
234
- border-radius: 1px;
235
- padding: 1px 5px;
236
- background: #f1f1f1;
237
- }
238
-
239
- .mo2f_carousel-indicators {
240
- position: absolute;
241
- bottom: -20px;
242
- z-index: 15;
243
- width: 60%;
244
- list-style: none;
245
- text-align: center;
246
- }
247
-
248
- .miniorange_kba_validate:hover, .miniorange_validate_otp:hover, .miniorange_login_forgotphone:hover,
249
- .miniorange_login_offline:hover, .miniorange_login_forgotphone:hover, .miniorange_otp_token_submit:hover {
250
- background-color: #0073AA !important
251
- }
252
-
253
- .miniorange_kba_validate, .miniorange_validate_otp, .miniorange_login_forgotphone,
254
- .miniorange_login_offline, .miniorange_login_forgotphone, .miniorange_otp_token_submit {
255
- background: #00A0D2 !important;
256
- border-color: #0073AA !important;
257
- box-shadow: 0 1px 0 rgba(120, 200, 230, .5) inset, 0 1px 0 rgba(0, 0, 0, .15) !important;
258
- color: #FFF !important;
259
- text-decoration: none !important;
260
- cursor: pointer !important;
261
- border-width: 1px !important;
262
- border-style: solid !important;
263
- border-radius: 3px !important;
264
- white-space: nowrap !important;
265
- box-sizing: border-box !important;
266
- line-height: 28px !important;
267
- padding: 0 12px !important;
268
- font-size: 13px !important
269
- }
270
-
271
- .mo_customer_validation-modal.fade .mo_customer_validation-modal-dialog {
272
- -webkit-transition: -webkit-transform .3s ease-out;
273
- -o-transition: -o-transform .3s ease-out;
274
- transition: transform .3s ease-out;
275
- -webkit-transform: translate(0, -25%);
276
- -ms-transform: translate(0, -25%);
277
- -o-transform: translate(0, -25%);
278
- transform: translate(0, -25%)
279
- }
280
-
281
- .mo_customer_validation-modal.in .mo_customer_validation-modal-dialog {
282
- -webkit-transform: translate(0, 80px) !important;
283
- -ms-transform: translate(0, 80px) !important;
284
- -o-transform: translate(0, 80px) !important;
285
- transform: translate(0, 80px) !important
286
- }
287
-
288
- .mo_customer_validation-modal-open .mo_customer_validation-modal {
289
- overflow-x: hidden;
290
- overflow-y: hidden
291
- }
292
-
293
- .mo_customer_validation-modal-dialog {
294
- position: relative;
295
- width: auto;
296
- margin: 10px
297
- }
298
-
299
- .mo_customer_validation-modal-content {
300
- position: relative;
301
- -webkit-background-clip: padding-box;
302
- border: 1px solid #999;
303
- border: 1px solid rgba(0, 0, 0, .2);
304
- outline: 0;
305
- margin-top: 8%;
306
- margin-left: 0;
307
- padding: 15px 20px 0;
308
- font-family: "Open Sans", sans-serif;
309
- color: #777;
310
- font-size: 14px;
311
- line-height: 1.4em;
312
- background: #FFF;
313
- box-shadow: 0 1px 3px rgba(0, 0, 0, .13)
314
- }
315
-
316
- .mo_customer_validation-modal-backdrop {
317
- position: absolute;
318
- top: 0;
319
- right: 0;
320
- left: 0;
321
- background-color: #000 !important;
322
- filter: alpha(opacity=50) !important;
323
- opacity: .9 !important;
324
- height: 100% !important
325
- }
326
-
327
- .mo_customer_validation-modal-header {
328
- min-height: 14px;
329
- padding: 10px 10px 20px;
330
- border-bottom: 1px solid #e5e5e5
331
- }
332
-
333
- .mo_customer_validation-modal-title {
334
- margin: 0 !important;
335
- line-height: 1 !important
336
- }
337
-
338
- .mo_customer_validation-modal-body {
339
- position: relative;
340
- padding: 5%;
341
- overflow: hidden !important;
342
- max-height: 550px !important
343
- }
344
-
345
- .mo_customer_validation-modal-footer {
346
- padding: 15px;
347
- text-align: right;
348
- border-top: 1px solid #e5e5e5
349
- }
350
-
351
- .mo_customer_validation-modal-footer .btn + .btn {
352
- margin-bottom: 0;
353
- margin-left: 5px
354
- }
355
-
356
- .mo_customer_validation-modal-footer .btn-group .btn + .btn {
357
- margin-left: -1px
358
- }
359
-
360
- .mo_customer_validation-modal-footer .btn-block + .btn-block {
361
- margin-left: 0
362
- }
363
-
364
- .mo_customer_validation-modal-scrollbar-measure {
365
- position: absolute;
366
- top: -9999px;
367
- width: 50px;
368
- height: 50px;
369
- overflow: scroll
370
- }
371
-
372
- @media (min-width: 768px) {
373
- .mo_customer_validation-modal-dialog {
374
- width: auto;
375
- margin: 0 auto
376
- }
377
-
378
- .mo_customer_validation-modal-content {
379
- -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
380
- box-shadow: 0 5px 15px rgba(0, 0, 0, .5)
381
- }
382
-
383
- .mo_customer_validation-modal-sm {
384
- width: 300px
385
- }
386
-
387
- .mo_customer_validation-modal-md {
388
- width: 532px
389
- }
390
-
391
- .mo_customer_validation-modal-lg {
392
- width: 50%
393
- }
394
- }
395
-
396
- @media (min-width: 992px) {
397
- .mo_customer_validation-modal-dialog {
398
- width: auto;
399
- margin: 0 auto
400
- }
401
-
402
- .mo_customer_validation-modal-lg {
403
- width: 490px
404
- }
405
-
406
- .mo_customer_validation-modal-md {
407
- width: 532px
408
- }
409
- }
410
-
411
- .mo_customer_validation-textbox {
412
- background: #FBFBFB;
413
- font-family: "Open Sans", sans-serif;
414
- font-size: 24px;
415
- width: 100%;
416
- border: 1px solid #DDD;
417
- padding: 3px;
418
- margin: 2px 6px 16px 0
419
- }
420
-
421
- .mo_customer_validation-textbox:focus {
422
- border-color: #5B9DD9;
423
- box-shadow: 0 0 2px rgba(30, 140, 190, .8)
424
-
425
- }
426
-
427
-
428
-
429
- /*Hode login*/
430
-
431
- body.login-action-login div#login {
432
- display: none;
433
- }
434
-
435
- body.login-action-login div#login form#loginform input#user_login {
436
- display: none;
437
- }
438
-
439
- body.login-action-login div#login form#loginform p.forgetmenot {
440
- display: none;
441
- }
442
-
443
- body.login-action-login div#login form#loginform p.submit input#wp-submit {
444
- display: none;
445
- }
446
-
447
- body.login-action-login div#login form#loginform p label {
448
- display: none;
449
- }
450
-
451
- body.login-action-login div#login p#nav {
452
- display: none;
453
- }
454
-
455
- body.login-action-login div#login form#loginform input#user_pass {
456
- display: none;
457
- }
458
-
459
- body.login-action-login div#login div#login_error {
460
- display: none;
461
- }
462
-
463
- body.login-action-login p.message {
464
- display: none;
465
- }
466
-
467
- body.login-action-login div#login #loginform {
468
- box-shadow: inherit;
469
- }
470
-
471
- body.login-action-login div#login div#login_error1 {
472
- border-left: 4px solid #dd3d36;
473
- margin-left: 0;
474
- padding: 12px;
475
- background: #fff;
476
- -webkit-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
477
- box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
478
- }
479
-
480
- .mo2f_header {
481
- font-size: 28px;
482
- font-family: -webkit-body;
483
- color: #777;
484
- }
485
-
486
- .mo2f_powered_by_miniorange {
487
- width: 100px;
488
- height: 25px;
489
- -webkit-background-size: 100px 25px;
490
- background-size: 100px 25px;
491
- background-repeat: no-repeat;
492
- display: inline-block;
493
- vertical-align: middle;
494
- }
495
-
496
- .mo2f_powered_by_div {
497
- text-align: right;
498
- font-size: 9px;
499
- padding-right: 2%;
500
- background-color: #FFFFFF;
501
- }
502
-
503
- .button-green {
504
- color: rgb(0, 160, 210);
505
- background: none !important;
506
- border: none;
507
- padding: 0 !important;
508
- font: inherit;
509
- border-color: transparent !important;
510
- /*border is optional*/
511
- border-bottom: 1px solid #444;
512
- cursor: pointer;
513
- }
514
-
515
- .mo2fa_display_message {
516
- padding: 12px;
517
- border-left: 4px solid #00a0d2;
518
- background-color: #fff;
519
- -webkit-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
520
- box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
521
-
522
- }
523
-
524
- .mo2fa_messages_container {
525
- width: 300px;
526
- }
527
-
528
- .mo2fa_otp_messages_container {
529
- width: 400px;
530
- }
531
-
532
- .mo2fa_push_messages_container {
533
- width: 300px;
534
- }
535
-
536
- .miniorange_mobile_auth, .miniorange_app_setup_page {
537
- border: 1px none transparent;
538
- padding: 10% 24px 10px 20px;
539
- min-height: 360px;
540
- background: transparent;
541
- z-index: 99999;
542
- }
543
-
544
- .mo2f-textbox {
545
- width: 160px;
546
- margin: 15px 0px !important;
547
- background-color: rgba(123, 110, 110, 0.06) !important;
548
- border-radius: 4px !important;
549
- padding: 3px !important;
550
- }
551
-
552
- .miniorange_kba_page {
553
- border: 1px none transparent;
554
- padding: 10% 24px 10px 20px;
555
- min-height: 360px;
556
- background: transparent;
557
- z-index: 99999;
558
-
559
- }
560
-
561
- .miniorange_push_oobemail_auth, .miniorange_trust_device {
562
- border: 1px none transparent;
563
- padding: 10% 24px 10px 20px;
564
- min-height: 360px;
565
- background: transparent;
566
- z-index: 99999;
567
- }
568
-
569
- .miniorange_soft_auth {
570
- border: 1px none transparent;
571
- padding: 10% 24px 10px 20px;
572
- min-height: 360px;
573
- background: transparent;
574
- z-index: 99999;
575
- }
576
-
577
- .miniorange-inner-login-container {
578
- background-color: #fff;
579
- margin: 0px auto !important;
580
- width: 400px;
581
- border-radius: 5px;
582
- border: 1px solid rgba(128, 128, 128, 0.06);
583
- }
584
-
585
- .miniorange-inner-kba-login-container {
586
- background-color: #fff;
587
- margin: 0px auto !important;
588
- width: 500px;
589
- border-radius: 5px;
590
- z-index: 99999;
591
- border: 1px solid rgba(128, 128, 128, 0.06);
592
- }
593
-
594
- .miniorange-inner-push-login-container {
595
- background-color: #fff;
596
- margin: 0px auto !important;
597
- width: 300px;
598
- border-radius: 5px;
599
-
600
- z-index: 99999;
601
- border: 1px solid rgba(128, 128, 128, 0.06);
602
- }
603
-
604
- .miniorange-button {
605
- height: 30px;
606
- display: inline-block;
607
- font-size: 14px;
608
- line-height: 28px;
609
- padding: 0 12px 2px;
610
- border-width: 1px;
611
- vertical-align: baseline;
612
- background: #00a0d2;
613
- border-style: solid;
614
- border-color: #0073aa;
615
- -webkit-appearance: none;
616
- -webkit-border-radius: 3px;
617
- border-radius: 3px;
618
- white-space: nowrap;
619
- -webkit-box-sizing: border-box;
620
- -moz-box-sizing: border-box;
621
- box-sizing: border-box;
622
- -webkit-box-shadow: inset 0 1px 0 rgba(120, 200, 230, .5), 0 1px 0 rgba(0, 0, 0, .15);
623
- box-shadow: inset 0 1px 0 rgba(120, 200, 230, .5), 0 1px 0 rgba(0, 0, 0, .15);
624
- color: #fff;
625
- text-decoration: none;
626
- cursor: pointer;
627
- }
628
-
629
- .mo_green {
630
- background: #2ECC71;
631
- border-color: #2ECC71;
632
- width: 37%;
633
- }
634
-
635
- .mo_red {
636
- background: #E74C3C;
637
- border-color: #E74C3C;
638
- width: 37%;
639
- }
640
-
641
- .showQRHelp, .showOTPHelp {
642
- text-align: center !important;
643
- }
644
-
645
- .mo_email_textbox {
646
- width: 48%;
647
- text-align: center;
648
- height: 40px;
649
- font-size: 18px;
650
- border-radius: 5px;
651
- }
652
-
653
- .mo_header_background {
654
- padding: 5px !important;
655
- background-color: beige !important;
656
- }
657
-
658
- .mo2f_textbox {
659
- width: 60% !important;
660
- border-radius: 4px !important;
661
- height: 30px !important;
662
- font-size: 14px !important;
663
- }
664
-
665
- .mo2f_kba_textbox {
666
- width: 100% !important;
667
- border-radius: 4px !important;
668
- height: 30px !important;
669
- font-size: 14px !important;
670
- }
671
-
672
- .mo_hr {
673
- border-top: 1px solid rgba(220, 214, 214, 0.25) !important;
674
- margin-top: 5px !important;
675
- margin-right: 10px !important;
676
- }
677
-
678
- .mo_margin_left {
679
- margin-left: 20px !important;
680
- }
681
-
682
- .miniorange-app-setup-container {
683
- background-color: #fff;
684
- margin: 0px auto !important;
685
- width: 700px;
686
- border-radius: 5px;
687
- margin-top: -100px !important;
688
- z-index: 99999;
689
- border: 1px solid rgba(128, 128, 128, 0.06);
690
-
691
- }
692
-
693
- .miniorange-ga-setup-container {
694
- background-color: #fff;
695
- margin: 0px auto !important;
696
- width: 900px;
697
- border-radius: 5px;
698
- margin-top: -50px !important;
699
- z-index: 99999;
700
- border: 1px solid rgba(128, 128, 128, 0.06);
701
- }
702
-
703
- .mo_app_link {
704
- text-decoration: none !important;
705
- color: #000 !important;
706
- }
707
-
708
- .mo2fa_app_setup_messages {
709
- width: 700px;
710
- }
711
-
712
- .mo2f_td_show {
713
- display: grid !important;
714
- }
715
-
716
- .mo2f_td_hide {
717
- display: none !important;
718
- }
719
-
720
- .mo2f_kba_ques {
721
- width: 370px !important;
722
- border-radius: 4px !important;
723
- height: 30px !important;
724
- font-size: 14px !important;
725
- }
726
-
727
- .mo2f_kba_table {
728
- padding: 0 10px;
729
- width: 100%;
730
- }
731
-
732
- .mo2f_kba_tb_data {
733
- padding-left: 15px;
734
- }
735
-
736
- .mo2f_table_textbox {
737
- width: 150px;
738
- height: 30px !important;
739
- font-size: 14px !important;
740
-
741
- }
742
-
743
- .mo2f_kba_header {
744
- font-weight: bold;
745
- }
746
-
747
- .mo2f_separator {
748
- border-left: 1px solid #EBECEC;
749
- padding: 5px;
750
- }
751
-
752
- .mo2f_inline_padding {
753
- padding-left: 20px;
754
- padding-right: 20px;
755
- }
756
-
757
-
758
-
759
-
760
-
761
-
762
-
763
- .mo2f_powered_by_miniorange {
764
- width: 100px;
765
- height: 30px;
766
- -webkit-background-size: 100px 25px;
767
- background-size: 100px 25px;
768
- background-repeat: no-repeat;
769
- display: inline-block;
770
- vertical-align: middle;
771
- }
772
-
773
- .mo2f_powered_by_div {
774
- text-align: right;
775
- font-size: 9px;
776
- padding-right: 5px;
777
- background-color: #FFFFFF;
778
- width: 92%;
779
- border-radius: 6px;
780
- }
781
-
782
- .mo2f-login-container {
783
- display: inline-block !important;
784
- display: -moz-inline-stack !important;
785
- text-align: center !important;
786
- width: 100%;
787
-
788
- }
789
-
790
- .mo2f-button {
791
- width: 100% !important;
792
- color: #fff !important;
793
- line-height: normal;
794
- height: 30px !important;
795
- margin: 0px !important;
796
- font-size: 14px !important;
797
- padding: 7px !important;
798
- background-color: #f0ad4e !important;
799
- border-color: #eea236 !important;
800
- -webkit-appearance: none;
801
- -webkit-border-radius: 3px !important;
802
- border-radius: 3px !important;
803
-
804
- }
805
-
806
- .mo2fa_display_message_login {
807
- text-align: left !important;
808
- font-size: 13px !important;
809
- }
810
-
811
- .mo2f-link {
812
- color: #0191BF !important;
813
- font-size: 14px !important;
814
- font-weight: bold !important;
815
- cursor: pointer !important;
816
- }
817
-
818
- .mo_green {
819
- background: #2ECC71 !important;
820
- border-color: #2ECC71 !important;
821
- width: 26% !important;
822
- border-width: 1px;
823
- vertical-align: middle !important;
824
- border-radius: 3px !important;
825
- color: white;
826
- height: 30px;
827
- cursor: pointer;
828
- }
829
-
830
- .mo_red {
831
- background: #E74C3C !important;
832
- border-color: #E74C3C !important;
833
- width: 26% !important;
834
- border-width: 1px;
835
- vertical-align: middle !important;
836
- border-radius: 3px !important;
837
- color: white;
838
- height: 30px;
839
- cursor: pointer;
840
- }
841
-
842
- .mo_otp_token {
843
- font-size: 15px;
844
- color: #212F3C;
845
- border: none;
846
- display: block;
847
- border-bottom-style: solid;
848
- border-width: 2px;
849
- border-color: #D0D3D4;
850
- border-radius: 0px;
851
- outline: none;
852
- width: 140px;
853
- text-align: center;
854
- }
855
-
856
- .showQRHelp, .showOTPHelp {
857
- text-align: center !important;
858
-
859
- }
860
-
861
- .mo2f_device {
862
- padding-left: 200px !important;
863
- vertical-align: -webkit-baseline-middle !important;
864
- line-height: 3 !important;
865
- }
866
-
867
- .miniorange-button {
868
- height: 30px;
869
- font-size: 14px !important;
870
- line-height: 5px !important;
871
- padding: 16px !important;
872
- border-width: 1px;
873
- vertical-align: middle !important;
874
- background-color: #f0ad4e !important;
875
- border-color: #eea236 !important;
876
- -webkit-appearance: none;
877
- border-style: solid;
878
- -webkit-border-radius: 3px !important;
879
- border-radius: 3px !important;
880
- white-space: nowrap;
881
- -webkit-box-sizing: border-box;
882
- -moz-box-sizing: border-box;
883
- box-sizing: border-box;
884
- color: #fff;
885
- text-decoration: none;
886
- cursor: pointer;
887
- }
888
-
889
- .mo_hr {
890
- border-top: 1px solid rgba(220, 214, 214, 0.25) !important;
891
- margin-top: 5px !important;
892
- margin-right: 10px !important;
893
- }
894
-
895
- .mo_margin_left {
896
- margin-left: 20px !important;
897
- }
898
-
899
- .mo_app_link {
900
- text-decoration: none !important;
901
- color: #000 !important;
902
- }
903
-
904
- .mo2f_td_show {
905
- display: grid !important;
906
- }
907
-
908
- .mo2f_td_hide {
909
- display: none !important;
910
- }
911
-
912
- .mo2f_label {
913
- font-weight: 100 !important;
914
- margin-left: 10px !important;
915
-
916
- }
917
-
918
- .mo2f_kba_ques {
919
- width: 394px !important;
920
- border-radius: 4px !important;
921
- height: 40px !important;
922
- font-size: 14px !important;
923
- }
924
-
925
- .mo2f_kba_table {
926
- padding: 0 10px;
927
- width: 100%;
928
- border: hidden !important;
929
- }
930
-
931
- .mo2f_kba_tb_data {
932
- padding-left: 15px;
933
- }
934
-
935
- .mo2f_table_textbox_1 {
936
- width: 150px;
937
- height: 30px !important;
938
- font-size: 14px !important;
939
- }
940
-
941
- .mo2f_table_textbox {
942
- width: 200px;
943
- height: 40px !important;
944
- font-size: 14px !important;
945
-
946
- }
947
-
948
- .mo2f_kba_header {
949
- font-weight: bold;
950
- border: hidden !important;
951
- }
952
-
953
- .mo2f_kba_body {
954
- border: hidden !important;
955
- }
956
-
957
- .mo2f_separator {
958
- border-left: 1px solid #EBECEC;
959
- padding: 5px;
960
- }
961
-
962
- .mo2f_authn_header {
963
- font-size: 14px !important;
964
- }
965
-
966
- #mo2f_inline_table {
967
- border: hidden !important;
968
- }
969
-
970
- .mo2f_ordered_list {
971
- margin: 0 0 0 1em !important;
972
- }
973
-
974
- .mo2f_list {
975
- font-size: 14px !important;
976
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/images/mo_white_logo.png ADDED
Binary file
includes/jquery-qrcode/README.md.orig DELETED
@@ -1,40 +0,0 @@
1
- # jQuery.qrcode
2
-
3
- [![license][license-img]][github] [![web][web-img]][web] [![github][github-img]][github] [![bower][bower-img]][github]
4
-
5
- jQuery plugin to dynamically generate QR codes. Uses [QR Code Generator][qrcode] (MIT).
6
-
7
-
8
- ## License
9
- The MIT License (MIT)
10
-
11
- Copyright (c) 2016 Lars Jung (https://larsjung.de)
12
-
13
- Permission is hereby granted, free of charge, to any person obtaining a copy
14
- of this software and agauthciated documentation files (the "Software"), to deal
15
- in the Software without restriction, including without limitation the rights
16
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
- copies of the Software, and to permit persons to whom the Software is
18
- furnished to do so, subject to the following conditions:
19
-
20
- The above copyright notice and this permission notice shall be included in
21
- all copies or substantial portions of the Software.
22
-
23
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29
- THE SOFTWARE.
30
-
31
-
32
- [web]: https://larsjung.de/qrcode/
33
- [github]: https://github.com/lrsjng/jquery-qrcode
34
-
35
- [license-img]: https://img.shields.io/badge/license-MIT-a0a060.svg?style=flat-square
36
- [web-img]: https://img.shields.io/badge/web-larsjung.de/qrcode-a0a060.svg?style=flat-square
37
- [github-img]: https://img.shields.io/badge/github-lrsjng/jquery--qrcode-a0a060.svg?style=flat-square
38
- [bower-img]: https://img.shields.io/badge/bower-lrsjng/jquery--qrcode-a0a060.svg?style=flat-square
39
-
40
- [qrcode]: https://github.com/kazuhikoarase/qrcode-generator
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/jquery-qrcode/jquery-qrcode.js.orig DELETED
@@ -1,2332 +0,0 @@
1
- /*! jquery-qrcode v0.14.0 - https://larsjung.de/jquery-qrcode/ */
2
- (function (vendor_qrcode) {
3
- 'use strict';
4
-
5
- var jq = window.jQuery;
6
-
7
- // Check if canvas is available in the browser (as Modernizr does)
8
- var hasCanvas = (function () {
9
- var elem = document.createElement('canvas');
10
- return !!(elem.getContext && elem.getContext('2d'));
11
- }());
12
-
13
- // Wrapper for the original QR code generator.
14
- function createQRCode(text, level, version, quiet) {
15
- var qr = {};
16
-
17
- var vqr = vendor_qrcode(version, level);
18
- vqr.addData(text);
19
- vqr.make();
20
-
21
- quiet = quiet || 0;
22
-
23
- var qrModuleCount = vqr.getModuleCount();
24
- var quietModuleCount = vqr.getModuleCount() + 2 * quiet;
25
-
26
- function isDark(row, col) {
27
- row -= quiet;
28
- col -= quiet;
29
-
30
- if (row < 0 || row >= qrModuleCount || col < 0 || col >= qrModuleCount) {
31
- return false;
32
- }
33
- return vqr.isDark(row, col);
34
- }
35
-
36
- function addBlank(l, t, r, b) {
37
- var prevIsDark = qr.isDark;
38
- var moduleSize = 1 / quietModuleCount;
39
-
40
- qr.isDark = function (row, col) {
41
- var ml = col * moduleSize;
42
- var mt = row * moduleSize;
43
- var mr = ml + moduleSize;
44
- var mb = mt + moduleSize;
45
-
46
- return prevIsDark(row, col) && (l > mr || ml > r || t > mb || mt > b);
47
- };
48
- }
49
-
50
- qr.text = text;
51
- qr.level = level;
52
- qr.version = version;
53
- qr.moduleCount = quietModuleCount;
54
- qr.isDark = isDark;
55
- qr.addBlank = addBlank;
56
-
57
- return qr;
58
- }
59
-
60
- // Returns a minimal QR code for the given text starting with version `minVersion`.
61
- // Returns `undefined` if `text` is too long to be encoded in `maxVersion`.
62
- function createMinQRCode(text, level, minVersion, maxVersion, quiet) {
63
- minVersion = Math.max(1, minVersion || 1);
64
- maxVersion = Math.min(40, maxVersion || 40);
65
- for (var version = minVersion; version <= maxVersion; version += 1) {
66
- try {
67
- return createQRCode(text, level, version, quiet);
68
- } catch (err) {/* empty */}
69
- }
70
- return undefined;
71
- }
72
-
73
- function drawBackgroundLabel(qr, context, settings) {
74
- var size = settings.size;
75
- var font = 'bold ' + settings.mSize * size + 'px ' + settings.fontname;
76
- var ctx = jq('<canvas/>')[0].getContext('2d');
77
-
78
- ctx.font = font;
79
-
80
- var w = ctx.measureText(settings.label).width;
81
- var sh = settings.mSize;
82
- var sw = w / size;
83
- var sl = (1 - sw) * settings.mPosX;
84
- var st = (1 - sh) * settings.mPosY;
85
- var sr = sl + sw;
86
- var sb = st + sh;
87
- var pad = 0.01;
88
-
89
- if (settings.mode === 1) {
90
- // Strip
91
- qr.addBlank(0, st - pad, size, sb + pad);
92
- } else {
93
- // Box
94
- qr.addBlank(sl - pad, st - pad, sr + pad, sb + pad);
95
- }
96
-
97
- context.fillStyle = settings.fontcolor;
98
- context.font = font;
99
- context.fillText(settings.label, sl * size, st * size + 0.75 * settings.mSize * size);
100
- }
101
-
102
- function drawBackgroundImage(qr, context, settings) {
103
- var size = settings.size;
104
- var w = settings.image.naturalWidth || 1;
105
- var h = settings.image.naturalHeight || 1;
106
- var sh = settings.mSize;
107
- var sw = sh * w / h;
108
- var sl = (1 - sw) * settings.mPosX;
109
- var st = (1 - sh) * settings.mPosY;
110
- var sr = sl + sw;
111
- var sb = st + sh;
112
- var pad = 0.01;
113
-
114
- if (settings.mode === 3) {
115
- // Strip
116
- qr.addBlank(0, st - pad, size, sb + pad);
117
- } else {
118
- // Box
119
- qr.addBlank(sl - pad, st - pad, sr + pad, sb + pad);
120
- }
121
-
122
- context.drawImage(settings.image, sl * size, st * size, sw * size, sh * size);
123
- }
124
-
125
- function drawBackground(qr, context, settings) {
126
- if (jq(settings.background).is('img')) {
127
- context.drawImage(settings.background, 0, 0, settings.size, settings.size);
128
- } else if (settings.background) {
129
- context.fillStyle = settings.background;
130
- context.fillRect(settings.left, settings.top, settings.size, settings.size);
131
- }
132
-
133
- var mode = settings.mode;
134
- if (mode === 1 || mode === 2) {
135
- drawBackgroundLabel(qr, context, settings);
136
- } else if (mode === 3 || mode === 4) {
137
- drawBackgroundImage(qr, context, settings);
138
- }
139
- }
140
-
141
- function drawModuleDefault(qr, context, settings, left, top, width, row, col) {
142
- if (qr.isDark(row, col)) {
143
- context.rect(left, top, width, width);
144
- }
145
- }
146
-
147
- function drawModuleRoundedDark(ctx, l, t, r, b, rad, nw, ne, se, sw) {
148
- if (nw) {
149
- ctx.moveTo(l + rad, t);
150
- } else {
151
- ctx.moveTo(l, t);
152
- }
153
-
154
- if (ne) {
155
- ctx.lineTo(r - rad, t);
156
- ctx.arcTo(r, t, r, b, rad);
157
- } else {
158
- ctx.lineTo(r, t);
159
- }
160
-
161
- if (se) {
162
- ctx.lineTo(r, b - rad);
163
- ctx.arcTo(r, b, l, b, rad);
164
- } else {
165
- ctx.lineTo(r, b);
166
- }
167
-
168
- if (sw) {
169
- ctx.lineTo(l + rad, b);
170
- ctx.arcTo(l, b, l, t, rad);
171
- } else {
172
- ctx.lineTo(l, b);
173
- }
174
-
175
- if (nw) {
176
- ctx.lineTo(l, t + rad);
177
- ctx.arcTo(l, t, r, t, rad);
178
- } else {
179
- ctx.lineTo(l, t);
180
- }
181
- }
182
-
183
- function drawModuleRoundendLight(ctx, l, t, r, b, rad, nw, ne, se, sw) {
184
- if (nw) {
185
- ctx.moveTo(l + rad, t);
186
- ctx.lineTo(l, t);
187
- ctx.lineTo(l, t + rad);
188
- ctx.arcTo(l, t, l + rad, t, rad);
189
- }
190
-
191
- if (ne) {
192
- ctx.moveTo(r - rad, t);
193
- ctx.lineTo(r, t);
194
- ctx.lineTo(r, t + rad);
195
- ctx.arcTo(r, t, r - rad, t, rad);
196
- }
197
-
198
- if (se) {
199
- ctx.moveTo(r - rad, b);
200
- ctx.lineTo(r, b);
201
- ctx.lineTo(r, b - rad);
202
- ctx.arcTo(r, b, r - rad, b, rad);
203
- }
204
-
205
- if (sw) {
206
- ctx.moveTo(l + rad, b);
207
- ctx.lineTo(l, b);
208
- ctx.lineTo(l, b - rad);
209
- ctx.arcTo(l, b, l + rad, b, rad);
210
- }
211
- }
212
-
213
- function drawModuleRounded(qr, context, settings, left, top, width, row, col) {
214
- var isDark = qr.isDark;
215
- var right = left + width;
216
- var bottom = top + width;
217
- var radius = settings.radius * width;
218
- var rowT = row - 1;
219
- var rowB = row + 1;
220
- var colL = col - 1;
221
- var colR = col + 1;
222
- var center = isDark(row, col);
223
- var northwest = isDark(rowT, colL);
224
- var north = isDark(rowT, col);
225
- var northeast = isDark(rowT, colR);
226
- var east = isDark(row, colR);
227
- var southeast = isDark(rowB, colR);
228
- var south = isDark(rowB, col);
229
- var southwest = isDark(rowB, colL);
230
- var west = isDark(row, colL);
231
-
232
- if (center) {
233
- drawModuleRoundedDark(context, left, top, right, bottom, radius, !north && !west, !north && !east, !south && !east, !south && !west);
234
- } else {
235
- drawModuleRoundendLight(context, left, top, right, bottom, radius, north && west && northwest, north && east && northeast, south && east && southeast, south && west && southwest);
236
- }
237
- }
238
-
239
- function drawModules(qr, context, settings) {
240
- var moduleCount = qr.moduleCount;
241
- var moduleSize = settings.size / moduleCount;
242
- var fn = drawModuleDefault;
243
- var row;
244
- var col;
245
-
246
- if (settings.radius > 0 && settings.radius <= 0.5) {
247
- fn = drawModuleRounded;
248
- }
249
-
250
- context.beginPath();
251
- for (row = 0; row < moduleCount; row += 1) {
252
- for (col = 0; col < moduleCount; col += 1) {
253
- var l = settings.left + col * moduleSize;
254
- var t = settings.top + row * moduleSize;
255
- var w = moduleSize;
256
-
257
- fn(qr, context, settings, l, t, w, row, col);
258
- }
259
- }
260
- if (jq(settings.fill).is('img')) {
261
- context.strokeStyle = 'rgba(0,0,0,0.5)';
262
- context.lineWidth = 2;
263
- context.stroke();
264
- var prev = context.globalCompositeOperation;
265
- context.globalCompositeOperation = 'destination-out';
266
- context.fill();
267
- context.globalCompositeOperation = prev;
268
-
269
- context.clip();
270
- context.drawImage(settings.fill, 0, 0, settings.size, settings.size);
271
- context.restore();
272
- } else {
273
- context.fillStyle = settings.fill;
274
- context.fill();
275
- }
276
- }
277
-
278
- // Draws QR code to the given `canvas` and returns it.
279
- function drawOnCanvas(canvas, settings) {
280
- var qr = createMinQRCode(settings.text, settings.ecLevel, settings.minVersion, settings.maxVersion, settings.quiet);
281
- if (!qr) {
282
- return null;
283
- }
284
-
285
- var $canvas = jq(canvas).data('qrcode', qr);
286
- var context = $canvas[0].getContext('2d');
287
-
288
- drawBackground(qr, context, settings);
289
- drawModules(qr, context, settings);
290
-
291
- return $canvas;
292
- }
293
-
294
- // Returns a `canvas` element representing the QR code for the given settings.
295
- function createCanvas(settings) {
296
- var $canvas = jq('<canvas/>').attr('width', settings.size).attr('height', settings.size);
297
- return drawOnCanvas($canvas, settings);
298
- }
299
-
300
- // Returns an `image` element representing the QR code for the given settings.
301
- function createImage(settings) {
302
- return jq('<img/>').attr('src', createCanvas(settings)[0].toDataURL('image/png'));
303
- }
304
-
305
- // Returns a `div` element representing the QR code for the given settings.
306
- function createDiv(settings) {
307
- var qr = createMinQRCode(settings.text, settings.ecLevel, settings.minVersion, settings.maxVersion, settings.quiet);
308
- if (!qr) {
309
- return null;
310
- }
311
-
312
- // some shortcuts to improve compression
313
- var settings_size = settings.size;
314
- var settings_bgColor = settings.background;
315
- var math_floor = Math.floor;
316
-
317
- var moduleCount = qr.moduleCount;
318
- var moduleSize = math_floor(settings_size / moduleCount);
319
- var offset = math_floor(0.5 * (settings_size - moduleSize * moduleCount));
320
-
321
- var row;
322
- var col;
323
-
324
- var containerCSS = {
325
- position: 'relative',
326
- left: 0,
327
- top: 0,
328
- padding: 0,
329
- margin: 0,
330
- width: settings_size,
331
- height: settings_size
332
- };
333
- var darkCSS = {
334
- position: 'absolute',
335
- padding: 0,
336
- margin: 0,
337
- width: moduleSize,
338
- height: moduleSize,
339
- 'background-color': settings.fill
340
- };
341
-
342
- var $div = jq('<div/>').data('qrcode', qr).css(containerCSS);
343
-
344
- if (settings_bgColor) {
345
- $div.css('background-color', settings_bgColor);
346
- }
347
-
348
- for (row = 0; row < moduleCount; row += 1) {
349
- for (col = 0; col < moduleCount; col += 1) {
350
- if (qr.isDark(row, col)) {
351
- jq('<div/>')
352
- .css(darkCSS)
353
- .css({
354
- left: offset + col * moduleSize,
355
- top: offset + row * moduleSize
356
- })
357
- .appendTo($div);
358
- }
359
- }
360
- }
361
-
362
- return $div;
363
- }
364
-
365
- function createHTML(settings) {
366
- if (hasCanvas && settings.render === 'canvas') {
367
- return createCanvas(settings);
368
- } else if (hasCanvas && settings.render === 'image') {
369
- return createImage(settings);
370
- }
371
-
372
- return createDiv(settings);
373
- }
374
-
375
- // Plugin
376
- // ======
377
-
378
- // Default settings
379
- // ----------------
380
- var defaults = {
381
- // render method: `'canvas'`, `'image'` or `'div'`
382
- render: 'canvas',
383
-
384
- // version range somewhere in 1 .. 40
385
- minVersion: 1,
386
- maxVersion: 40,
387
-
388
- // error correction level: `'L'`, `'M'`, `'Q'` or `'H'`
389
- ecLevel: 'L',
390
-
391
- // offset in pixel if drawn onto existing canvas
392
- left: 0,
393
- top: 0,
394
-
395
- // size in pixel
396
- size: 200,
397
-
398
- // code color or image element
399
- fill: '#000',
400
-
401
- // background color or image element, `null` for transparent background
402
- background: null,
403
-
404
- // content
405
- text: 'no text',
406
-
407
- // corner radius relative to module width: 0.0 .. 0.5
408
- radius: 0,
409
-
410
- // quiet zone in modules
411
- quiet: 0,
412
-
413
- // modes
414
- // 0: normal
415
- // 1: label strip
416
- // 2: label box
417
- // 3: image strip
418
- // 4: image box
419
- mode: 0,
420
-
421
- mSize: 0.1,
422
- mPosX: 0.5,
423
- mPosY: 0.5,
424
-
425
- label: 'no label',
426
- fontname: 'sans',
427
- fontcolor: '#000',
428
-
429
- image: null
430
- };
431
-
432
- // Register the plugin
433
- // -------------------
434
- jq.fn.qrcode = function (options) {
435
- var settings = jq.extend({}, defaults, options);
436
-
437
- return this.each(function (idx, el) {
438
- if (el.nodeName.toLowerCase() === 'canvas') {
439
- drawOnCanvas(el, settings);
440
- } else {
441
- jq(el).append(createHTML(settings));
442
- }
443
- });
444
- };
445
- }(function () {
446
- // `qrcode` is the single public function defined by the `QR Code Generator`
447
- //---------------------------------------------------------------------
448
- //
449
- // QR Code Generator for JavaScript
450
- //
451
- // Copyright (c) 2009 Kazuhiko Arase
452
- //
453
- // URL: http://www.d-project.com/
454
- //
455
- // Licensed under the MIT license:
456
- // http://www.opensource.org/licenses/mit-license.php
457
- //
458
- // The word 'QR Code' is registered trademark of
459
- // DENSO WAVE INCORPORATED
460
- // http://www.denso-wave.com/qrcode/faqpatent-e.html
461
- //
462
- //---------------------------------------------------------------------
463
-
464
- var qrcode = function() {
465
-
466
- //---------------------------------------------------------------------
467
- // qrcode
468
- //---------------------------------------------------------------------
469
-
470
- /**
471
- * qrcode
472
- * @param typeNumber 1 to 40
473
- * @param errorCorrectLevel 'L','M','Q','H'
474
- */
475
- var qrcode = function(typeNumber, errorCorrectLevel) {
476
-
477
- var PAD0 = 0xEC;
478
- var PAD1 = 0x11;
479
-
480
- var _typeNumber = typeNumber;
481
- var _errorCorrectLevel = QRErrorCorrectLevel[errorCorrectLevel];
482
- var _modules = null;
483
- var _moduleCount = 0;
484
- var _dataCache = null;
485
- var _dataList = new Array();
486
-
487
- var _this = {};
488
-
489
- var makeImpl = function(test, maskPattern) {
490
-
491
- _moduleCount = _typeNumber * 4 + 17;
492
- _modules = function(moduleCount) {
493
- var modules = new Array(moduleCount);
494
- for (var row = 0; row < moduleCount; row += 1) {
495
- modules[row] = new Array(moduleCount);
496
- for (var col = 0; col < moduleCount; col += 1) {
497
- modules[row][col] = null;
498
- }
499
- }
500
- return modules;
501
- }(_moduleCount);
502
-
503
- setupPositionProbePattern(0, 0);
504
- setupPositionProbePattern(_moduleCount - 7, 0);
505
- setupPositionProbePattern(0, _moduleCount - 7);
506
- setupPositionAdjustPattern();
507
- setupTimingPattern();
508
- setupTypeInfo(test, maskPattern);
509
-
510
- if (_typeNumber >= 7) {
511
- setupTypeNumber(test);
512
- }
513
-
514
- if (_dataCache == null) {
515
- _dataCache = createData(_typeNumber, _errorCorrectLevel, _dataList);
516
- }
517
-
518
- mapData(_dataCache, maskPattern);
519
- };
520
-
521
- var setupPositionProbePattern = function(row, col) {
522
-
523
- for (var r = -1; r <= 7; r += 1) {
524
-
525
- if (row + r <= -1 || _moduleCount <= row + r) continue;
526
-
527
- for (var c = -1; c <= 7; c += 1) {
528
-
529
- if (col + c <= -1 || _moduleCount <= col + c) continue;
530
-
531
- if ( (0 <= r && r <= 6 && (c == 0 || c == 6) )
532
- || (0 <= c && c <= 6 && (r == 0 || r == 6) )
533
- || (2 <= r && r <= 4 && 2 <= c && c <= 4) ) {
534
- _modules[row + r][col + c] = true;
535
- } else {
536
- _modules[row + r][col + c] = false;
537
- }
538
- }
539
- }
540
- };
541
-
542
- var getBestMaskPattern = function() {
543
-
544
- var minLostPoint = 0;
545
- var pattern = 0;
546
-
547
- for (var i = 0; i < 8; i += 1) {
548
-
549
- makeImpl(true, i);
550
-
551
- var lostPoint = QRUtil.getLostPoint(_this);
552
-
553
- if (i == 0 || minLostPoint > lostPoint) {
554
- minLostPoint = lostPoint;
555
- pattern = i;
556
- }
557
- }
558
-
559
- return pattern;
560
- };
561
-
562
- var setupTimingPattern = function() {
563
-
564
- for (var r = 8; r < _moduleCount - 8; r += 1) {
565
- if (_modules[r][6] != null) {
566
- continue;
567
- }
568
- _modules[r][6] = (r % 2 == 0);
569
- }
570
-
571
- for (var c = 8; c < _moduleCount - 8; c += 1) {
572
- if (_modules[6][c] != null) {
573
- continue;
574
- }
575
- _modules[6][c] = (c % 2 == 0);
576
- }
577
- };
578
-
579
- var setupPositionAdjustPattern = function() {
580
-
581
- var pos = QRUtil.getPatternPosition(_typeNumber);
582
-
583
- for (var i = 0; i < pos.length; i += 1) {
584
-
585
- for (var j = 0; j < pos.length; j += 1) {
586
-
587
- var row = pos[i];
588
- var col = pos[j];
589
-
590
- if (_modules[row][col] != null) {
591
- continue;
592
- }
593
-
594
- for (var r = -2; r <= 2; r += 1) {
595
-
596
- for (var c = -2; c <= 2; c += 1) {
597
-
598
- if (r == -2 || r == 2 || c == -2 || c == 2
599
- || (r == 0 && c == 0) ) {
600
- _modules[row + r][col + c] = true;
601
- } else {
602
- _modules[row + r][col + c] = false;
603
- }
604
- }
605
- }
606
- }
607
- }
608
- };
609
-
610
- var setupTypeNumber = function(test) {
611
-
612
- var bits = QRUtil.getBCHTypeNumber(_typeNumber);
613
-
614
- for (var i = 0; i < 18; i += 1) {
615
- var mod = (!test && ( (bits >> i) & 1) == 1);
616
- _modules[Math.floor(i / 3)][i % 3 + _moduleCount - 8 - 3] = mod;
617
- }
618
-
619
- for (var i = 0; i < 18; i += 1) {
620
- var mod = (!test && ( (bits >> i) & 1) == 1);
621
- _modules[i % 3 + _moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
622
- }
623
- };
624
-
625
- var setupTypeInfo = function(test, maskPattern) {
626
-
627
- var data = (_errorCorrectLevel << 3) | maskPattern;
628
- var bits = QRUtil.getBCHTypeInfo(data);
629
-
630
- // vertical
631
- for (var i = 0; i < 15; i += 1) {
632
-
633
- var mod = (!test && ( (bits >> i) & 1) == 1);
634
-
635
- if (i < 6) {
636
- _modules[i][8] = mod;
637
- } else if (i < 8) {
638
- _modules[i + 1][8] = mod;
639
- } else {
640
- _modules[_moduleCount - 15 + i][8] = mod;
641
- }
642
- }
643
-
644
- // horizontal
645
- for (var i = 0; i < 15; i += 1) {
646
-
647
- var mod = (!test && ( (bits >> i) & 1) == 1);
648
-
649
- if (i < 8) {
650
- _modules[8][_moduleCount - i - 1] = mod;
651
- } else if (i < 9) {
652
- _modules[8][15 - i - 1 + 1] = mod;
653
- } else {
654
- _modules[8][15 - i - 1] = mod;
655
- }
656
- }
657
-
658
- // fixed module
659
- _modules[_moduleCount - 8][8] = (!test);
660
- };
661
-
662
- var mapData = function(data, maskPattern) {
663
-
664
- var inc = -1;
665
- var row = _moduleCount - 1;
666
- var bitIndex = 7;
667
- var byteIndex = 0;
668
- var maskFunc = QRUtil.getMaskFunction(maskPattern);
669
-
670
- for (var col = _moduleCount - 1; col > 0; col -= 2) {
671
-
672
- if (col == 6) col -= 1;
673
-
674
- while (true) {
675
-
676
- for (var c = 0; c < 2; c += 1) {
677
-
678
- if (_modules[row][col - c] == null) {
679
-
680
- var dark = false;
681
-
682
- if (byteIndex < data.length) {
683
- dark = ( ( (data[byteIndex] >>> bitIndex) & 1) == 1);
684
- }
685
-
686
- var mask = maskFunc(row, col - c);
687
-
688
- if (mask) {
689
- dark = !dark;
690
- }
691
-
692
- _modules[row][col - c] = dark;
693
- bitIndex -= 1;
694
-
695
- if (bitIndex == -1) {
696
- byteIndex += 1;
697
- bitIndex = 7;
698
- }
699
- }
700
- }
701
-
702
- row += inc;
703
-
704
- if (row < 0 || _moduleCount <= row) {
705
- row -= inc;
706
- inc = -inc;
707
- break;
708
- }
709
- }
710
- }
711
- };
712
-
713
- var createBytes = function(buffer, rsBlocks) {
714
-
715
- var offset = 0;
716
-
717
- var maxDcCount = 0;
718
- var maxEcCount = 0;
719
-
720
- var dcdata = new Array(rsBlocks.length);
721
- var ecdata = new Array(rsBlocks.length);
722
-
723
- for (var r = 0; r < rsBlocks.length; r += 1) {
724
-
725
- var dcCount = rsBlocks[r].dataCount;
726
- var ecCount = rsBlocks[r].totalCount - dcCount;
727
-
728
- maxDcCount = Math.max(maxDcCount, dcCount);
729
- maxEcCount = Math.max(maxEcCount, ecCount);
730
-
731
- dcdata[r] = new Array(dcCount);
732
-
733
- for (var i = 0; i < dcdata[r].length; i += 1) {
734
- dcdata[r][i] = 0xff & buffer.getBuffer()[i + offset];
735
- }
736
- offset += dcCount;
737
-
738
- var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
739
- var rawPoly = qrPolynomial(dcdata[r], rsPoly.getLength() - 1);
740
-
741
- var modPoly = rawPoly.mod(rsPoly);
742
- ecdata[r] = new Array(rsPoly.getLength() - 1);
743
- for (var i = 0; i < ecdata[r].length; i += 1) {
744
- var modIndex = i + modPoly.getLength() - ecdata[r].length;
745
- ecdata[r][i] = (modIndex >= 0)? modPoly.getAt(modIndex) : 0;
746
- }
747
- }
748
-
749
- var totalCodeCount = 0;
750
- for (var i = 0; i < rsBlocks.length; i += 1) {
751
- totalCodeCount += rsBlocks[i].totalCount;
752
- }
753
-
754
- var data = new Array(totalCodeCount);
755
- var index = 0;
756
-
757
- for (var i = 0; i < maxDcCount; i += 1) {
758
- for (var r = 0; r < rsBlocks.length; r += 1) {
759
- if (i < dcdata[r].length) {
760
- data[index] = dcdata[r][i];
761
- index += 1;
762
- }
763
- }
764
- }
765
-
766
- for (var i = 0; i < maxEcCount; i += 1) {
767
- for (var r = 0; r < rsBlocks.length; r += 1) {
768
- if (i < ecdata[r].length) {
769
- data[index] = ecdata[r][i];
770
- index += 1;
771
- }
772
- }
773
- }
774
-
775
- return data;
776
- };
777
-
778
- var createData = function(typeNumber, errorCorrectLevel, dataList) {
779
-
780
- var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
781
-
782
- var buffer = qrBitBuffer();
783
-
784
- for (var i = 0; i < dataList.length; i += 1) {
785
- var data = dataList[i];
786
- buffer.put(data.getMode(), 4);
787
- buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) );
788
- data.write(buffer);
789
- }
790
-
791
- // calc num max data.
792
- var totalDataCount = 0;
793
- for (var i = 0; i < rsBlocks.length; i += 1) {
794
- totalDataCount += rsBlocks[i].dataCount;
795
- }
796
-
797
- if (buffer.getLengthInBits() > totalDataCount * 8) {
798
- throw new Error('code length overflow. ('
799
- + buffer.getLengthInBits()
800
- + '>'
801
- + totalDataCount * 8
802
- + ')');
803
- }
804
-
805
- // end code
806
- if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
807
- buffer.put(0, 4);
808
- }
809
-
810
- // padding
811
- while (buffer.getLengthInBits() % 8 != 0) {
812
- buffer.putBit(false);
813
- }
814
-
815
- // padding
816
- while (true) {
817
-
818
- if (buffer.getLengthInBits() >= totalDataCount * 8) {
819
- break;
820
- }
821
- buffer.put(PAD0, 8);
822
-
823
- if (buffer.getLengthInBits() >= totalDataCount * 8) {
824
- break;
825
- }
826
- buffer.put(PAD1, 8);
827
- }
828
-
829
- return createBytes(buffer, rsBlocks);
830
- };
831
-
832
- _this.addData = function(data) {
833
- var newData = qr8BitByte(data);
834
- _dataList.push(newData);
835
- _dataCache = null;
836
- };
837
-
838
- _this.isDark = function(row, col) {
839
- if (row < 0 || _moduleCount <= row || col < 0 || _moduleCount <= col) {
840
- throw new Error(row + ',' + col);
841
- }
842
- return _modules[row][col];
843
- };
844
-
845
- _this.getModuleCount = function() {
846
- return _moduleCount;
847
- };
848
-
849
- _this.make = function() {
850
- makeImpl(false, getBestMaskPattern() );
851
- };
852
-
853
- _this.createTableTag = function(cellSize, margin) {
854
-
855
- cellSize = cellSize || 2;
856
- margin = (typeof margin == 'undefined')? cellSize * 4 : margin;
857
-
858
- var qrHtml = '';
859
-
860
- qrHtml += '<table style="';
861
- qrHtml += ' border-width: 0px; border-style: none;';
862
- qrHtml += ' border-collapse: collapse;';
863
- qrHtml += ' padding: 0px; margin: ' + margin + 'px;';
864
- qrHtml += '">';
865
- qrHtml += '<tbody>';
866
-
867
- for (var r = 0; r < _this.getModuleCount(); r += 1) {
868
-
869
- qrHtml += '<tr>';
870
-
871
- for (var c = 0; c < _this.getModuleCount(); c += 1) {
872
- qrHtml += '<td style="';
873
- qrHtml += ' border-width: 0px; border-style: none;';
874
- qrHtml += ' border-collapse: collapse;';
875
- qrHtml += ' padding: 0px; margin: 0px;';
876
- qrHtml += ' width: ' + cellSize + 'px;';
877
- qrHtml += ' height: ' + cellSize + 'px;';
878
- qrHtml += ' background-color: ';
879
- qrHtml += _this.isDark(r, c)? '#000000' : '#ffffff';
880
- qrHtml += ';';
881
- qrHtml += '"/>';
882
- }
883
-
884
- qrHtml += '</tr>';
885
- }
886
-
887
- qrHtml += '</tbody>';
888
- qrHtml += '</table>';
889
-
890
- return qrHtml;
891
- };
892
-
893
- _this.createImgTag = function(cellSize, margin) {
894
-
895
- cellSize = cellSize || 2;
896
- margin = (typeof margin == 'undefined')? cellSize * 4 : margin;
897
-
898
- var size = _this.getModuleCount() * cellSize + margin * 2;
899
- var min = margin;
900
- var max = size - margin;
901
-
902
- return createImgTag(size, size, function(x, y) {
903
- if (min <= x && x < max && min <= y && y < max) {
904
- var c = Math.floor( (x - min) / cellSize);
905
- var r = Math.floor( (y - min) / cellSize);
906
- return _this.isDark(r, c)? 0 : 1;
907
- } else {
908
- return 1;
909
- }
910
- } );
911
- };
912
-
913
- return _this;
914
- };
915
-
916
- //---------------------------------------------------------------------
917
- // qrcode.stringToBytes
918
- //---------------------------------------------------------------------
919
-
920
- qrcode.stringToBytes = function(s) {
921
- var bytes = new Array();
922
- for (var i = 0; i < s.length; i += 1) {
923
- var c = s.charCodeAt(i);
924
- bytes.push(c & 0xff);
925
- }
926
- return bytes;
927
- };
928
-
929
- //---------------------------------------------------------------------
930
- // qrcode.createStringToBytes
931
- //---------------------------------------------------------------------
932
-
933
- /**
934
- * @param unicodeData base64 string of byte array.
935
- * [16bit Unicode],[16bit Bytes], ...
936
- * @param numChars
937
- */
938
- qrcode.createStringToBytes = function(unicodeData, numChars) {
939
-
940
- // create conversion map.
941
-
942
- var unicodeMap = function() {
943
-
944
- var bin = base64DecodeInputStream(unicodeData);
945
- var read = function() {
946
- var b = bin.read();
947
- if (b == -1) throw new Error();
948
- return b;
949
- };
950
-
951
- var count = 0;
952
- var unicodeMap = {};
953
- while (true) {
954
- var b0 = bin.read();
955
- if (b0 == -1) break;
956
- var b1 = read();
957
- var b2 = read();
958
- var b3 = read();
959
- var k = String.fromCharCode( (b0 << 8) | b1);
960
- var v = (b2 << 8) | b3;
961
- unicodeMap[k] = v;
962
- count += 1;
963
- }
964
- if (count != numChars) {
965
- throw new Error(count + ' != ' + numChars);
966
- }
967
-
968
- return unicodeMap;
969
- }();
970
-
971
- var unknownChar = '?'.charCodeAt(0);
972
-
973
- return function(s) {
974
- var bytes = new Array();
975
- for (var i = 0; i < s.length; i += 1) {
976
- var c = s.charCodeAt(i);
977
- if (c < 128) {
978
- bytes.push(c);
979
- } else {
980
- var b = unicodeMap[s.charAt(i)];
981
- if (typeof b == 'number') {
982
- if ( (b & 0xff) == b) {
983
- // 1byte
984
- bytes.push(b);
985
- } else {
986
- // 2bytes
987
- bytes.push(b >>> 8);
988
- bytes.push(b & 0xff);
989
- }
990
- } else {
991
- bytes.push(unknownChar);
992
- }
993
- }
994
- }
995
- return bytes;
996
- };
997
- };
998
-
999
- //---------------------------------------------------------------------
1000
- // QRMode
1001
- //---------------------------------------------------------------------
1002
-
1003
- var QRMode = {
1004
- MODE_NUMBER : 1 << 0,
1005
- MODE_ALPHA_NUM : 1 << 1,
1006
- MODE_8BIT_BYTE : 1 << 2,
1007
- MODE_KANJI : 1 << 3
1008
- };
1009
-
1010
- //---------------------------------------------------------------------
1011
- // QRErrorCorrectLevel
1012
- //---------------------------------------------------------------------
1013
-
1014
- var QRErrorCorrectLevel = {
1015
- L : 1,
1016
- M : 0,
1017
- Q : 3,
1018
- H : 2
1019
- };
1020
-
1021
- //---------------------------------------------------------------------
1022
- // QRMaskPattern
1023
- //---------------------------------------------------------------------
1024
-
1025
- var QRMaskPattern = {
1026
- PATTERN000 : 0,
1027
- PATTERN001 : 1,
1028
- PATTERN010 : 2,
1029
- PATTERN011 : 3,
1030
- PATTERN100 : 4,
1031
- PATTERN101 : 5,
1032
- PATTERN110 : 6,
1033
- PATTERN111 : 7
1034
- };
1035
-
1036
- //---------------------------------------------------------------------
1037
- // QRUtil
1038
- //---------------------------------------------------------------------
1039
-
1040
- var QRUtil = function() {
1041
-
1042
- var PATTERN_POSITION_TABLE = [
1043
- [],
1044
- [6, 18],
1045
- [6, 22],
1046
- [6, 26],
1047
- [6, 30],
1048
- [6, 34],
1049
- [6, 22, 38],
1050
- [6, 24, 42],
1051
- [6, 26, 46],
1052
- [6, 28, 50],
1053
- [6, 30, 54],
1054
- [6, 32, 58],
1055
- [6, 34, 62],
1056
- [6, 26, 46, 66],
1057
- [6, 26, 48, 70],
1058
- [6, 26, 50, 74],
1059
- [6, 30, 54, 78],
1060
- [6, 30, 56, 82],
1061
- [6, 30, 58, 86],
1062
- [6, 34, 62, 90],
1063
- [6, 28, 50, 72, 94],
1064
- [6, 26, 50, 74, 98],
1065
- [6, 30, 54, 78, 102],
1066
- [6, 28, 54, 80, 106],
1067
- [6, 32, 58, 84, 110],
1068
- [6, 30, 58, 86, 114],
1069
- [6, 34, 62, 90, 118],
1070
- [6, 26, 50, 74, 98, 122],
1071
- [6, 30, 54, 78, 102, 126],
1072
- [6, 26, 52, 78, 104, 130],
1073
- [6, 30, 56, 82, 108, 134],
1074
- [6, 34, 60, 86, 112, 138],
1075
- [6, 30, 58, 86, 114, 142],
1076
- [6, 34, 62, 90, 118, 146],
1077
- [6, 30, 54, 78, 102, 126, 150],
1078
- [6, 24, 50, 76, 102, 128, 154],
1079
- [6, 28, 54, 80, 106, 132, 158],
1080
- [6, 32, 58, 84, 110, 136, 162],
1081
- [6, 26, 54, 82, 110, 138, 166],
1082
- [6, 30, 58, 86, 114, 142, 170]
1083
- ];
1084
- var G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0);
1085
- var G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0);
1086
- var G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1);
1087
-
1088
- var _this = {};
1089
-
1090
- var getBCHDigit = function(data) {
1091
- var digit = 0;
1092
- while (data != 0) {
1093
- digit += 1;
1094
- data >>>= 1;
1095
- }
1096
- return digit;
1097
- };
1098
-
1099
- _this.getBCHTypeInfo = function(data) {
1100
- var d = data << 10;
1101
- while (getBCHDigit(d) - getBCHDigit(G15) >= 0) {
1102
- d ^= (G15 << (getBCHDigit(d) - getBCHDigit(G15) ) );
1103
- }
1104
- return ( (data << 10) | d) ^ G15_MASK;
1105
- };
1106
-
1107
- _this.getBCHTypeNumber = function(data) {
1108
- var d = data << 12;
1109
- while (getBCHDigit(d) - getBCHDigit(G18) >= 0) {
1110
- d ^= (G18 << (getBCHDigit(d) - getBCHDigit(G18) ) );
1111
- }
1112
- return (data << 12) | d;
1113
- };
1114
-
1115
- _this.getPatternPosition = function(typeNumber) {
1116
- return PATTERN_POSITION_TABLE[typeNumber - 1];
1117
- };
1118
-
1119
- _this.getMaskFunction = function(maskPattern) {
1120
-
1121
- switch (maskPattern) {
1122
-
1123
- case QRMaskPattern.PATTERN000 :
1124
- return function(i, j) { return (i + j) % 2 == 0; };
1125
- case QRMaskPattern.PATTERN001 :
1126
- return function(i, j) { return i % 2 == 0; };
1127
- case QRMaskPattern.PATTERN010 :
1128
- return function(i, j) { return j % 3 == 0; };
1129
- case QRMaskPattern.PATTERN011 :
1130
- return function(i, j) { return (i + j) % 3 == 0; };
1131
- case QRMaskPattern.PATTERN100 :
1132
- return function(i, j) { return (Math.floor(i / 2) + Math.floor(j / 3) ) % 2 == 0; };
1133
- case QRMaskPattern.PATTERN101 :
1134
- return function(i, j) { return (i * j) % 2 + (i * j) % 3 == 0; };
1135
- case QRMaskPattern.PATTERN110 :
1136
- return function(i, j) { return ( (i * j) % 2 + (i * j) % 3) % 2 == 0; };
1137
- case QRMaskPattern.PATTERN111 :
1138
- return function(i, j) { return ( (i * j) % 3 + (i + j) % 2) % 2 == 0; };
1139
-
1140
- default :
1141
- throw new Error('bad maskPattern:' + maskPattern);
1142
- }
1143
- };
1144
-
1145
- _this.getErrorCorrectPolynomial = function(errorCorrectLength) {
1146
- var a = qrPolynomial([1], 0);
1147
- for (var i = 0; i < errorCorrectLength; i += 1) {
1148
- a = a.multiply(qrPolynomial([1, QRMath.gexp(i)], 0) );
1149
- }
1150
- return a;
1151
- };
1152
-
1153
- _this.getLengthInBits = function(mode, type) {
1154
-
1155
- if (1 <= type && type < 10) {
1156
-
1157
- // 1 - 9
1158
-
1159
- switch(mode) {
1160
- case QRMode.MODE_NUMBER : return 10;
1161
- case QRMode.MODE_ALPHA_NUM : return 9;
1162
- case QRMode.MODE_8BIT_BYTE : return 8;
1163
- case QRMode.MODE_KANJI : return 8;
1164
- default :
1165
- throw new Error('mode:' + mode);
1166
- }
1167
-
1168
- } else if (type < 27) {
1169
-
1170
- // 10 - 26
1171
-
1172
- switch(mode) {
1173
- case QRMode.MODE_NUMBER : return 12;
1174
- case QRMode.MODE_ALPHA_NUM : return 11;
1175
- case QRMode.MODE_8BIT_BYTE : return 16;
1176
- case QRMode.MODE_KANJI : return 10;
1177
- default :
1178
- throw new Error('mode:' + mode);
1179
- }
1180
-
1181
- } else if (type < 41) {
1182
-
1183
- // 27 - 40
1184
-
1185
- switch(mode) {
1186
- case QRMode.MODE_NUMBER : return 14;
1187
- case QRMode.MODE_ALPHA_NUM : return 13;
1188
- case QRMode.MODE_8BIT_BYTE : return 16;
1189
- case QRMode.MODE_KANJI : return 12;
1190
- default :
1191
- throw new Error('mode:' + mode);
1192
- }
1193
-
1194
- } else {
1195
- throw new Error('type:' + type);
1196
- }
1197
- };
1198
-
1199
- _this.getLostPoint = function(qrcode) {
1200
-
1201
- var moduleCount = qrcode.getModuleCount();
1202
-
1203
- var lostPoint = 0;
1204
-
1205
- // LEVEL1
1206
-
1207
- for (var row = 0; row < moduleCount; row += 1) {
1208
- for (var col = 0; col < moduleCount; col += 1) {
1209
-
1210
- var sameCount = 0;
1211
- var dark = qrcode.isDark(row, col);
1212
-
1213
- for (var r = -1; r <= 1; r += 1) {
1214
-
1215
- if (row + r < 0 || moduleCount <= row + r) {
1216
- continue;
1217
- }
1218
-
1219
- for (var c = -1; c <= 1; c += 1) {
1220
-
1221
- if (col + c < 0 || moduleCount <= col + c) {
1222
- continue;
1223
- }
1224
-
1225
- if (r == 0 && c == 0) {
1226
- continue;
1227
- }
1228
-
1229
- if (dark == qrcode.isDark(row + r, col + c) ) {
1230
- sameCount += 1;
1231
- }
1232
- }
1233
- }
1234
-
1235
- if (sameCount > 5) {
1236
- lostPoint += (3 + sameCount - 5);
1237
- }
1238
- }
1239
- };
1240
-
1241
- // LEVEL2
1242
-
1243
- for (var row = 0; row < moduleCount - 1; row += 1) {
1244
- for (var col = 0; col < moduleCount - 1; col += 1) {
1245
- var count = 0;
1246
- if (qrcode.isDark(row, col) ) count += 1;
1247
- if (qrcode.isDark(row + 1, col) ) count += 1;
1248
- if (qrcode.isDark(row, col + 1) ) count += 1;
1249
- if (qrcode.isDark(row + 1, col + 1) ) count += 1;
1250
- if (count == 0 || count == 4) {
1251
- lostPoint += 3;
1252
- }
1253
- }
1254
- }
1255
-
1256
- // LEVEL3
1257
-
1258
- for (var row = 0; row < moduleCount; row += 1) {
1259
- for (var col = 0; col < moduleCount - 6; col += 1) {
1260
- if (qrcode.isDark(row, col)
1261
- && !qrcode.isDark(row, col + 1)
1262
- && qrcode.isDark(row, col + 2)
1263
- && qrcode.isDark(row, col + 3)
1264
- && qrcode.isDark(row, col + 4)
1265
- && !qrcode.isDark(row, col + 5)
1266
- && qrcode.isDark(row, col + 6) ) {
1267
- lostPoint += 40;
1268
- }
1269
- }
1270
- }
1271
-
1272
- for (var col = 0; col < moduleCount; col += 1) {
1273
- for (var row = 0; row < moduleCount - 6; row += 1) {
1274
- if (qrcode.isDark(row, col)
1275
- && !qrcode.isDark(row + 1, col)
1276
- && qrcode.isDark(row + 2, col)
1277
- && qrcode.isDark(row + 3, col)
1278
- && qrcode.isDark(row + 4, col)
1279
- && !qrcode.isDark(row + 5, col)
1280
- && qrcode.isDark(row + 6, col) ) {
1281
- lostPoint += 40;
1282
- }
1283
- }
1284
- }
1285
-
1286
- // LEVEL4
1287
-
1288
- var darkCount = 0;
1289
-
1290
- for (var col = 0; col < moduleCount; col += 1) {
1291
- for (var row = 0; row < moduleCount; row += 1) {
1292
- if (qrcode.isDark(row, col) ) {
1293
- darkCount += 1;
1294
- }
1295
- }
1296
- }
1297
-
1298
- var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
1299
- lostPoint += ratio * 10;
1300
-
1301
- return lostPoint;
1302
- };
1303
-
1304
- return _this;
1305
- }();
1306
-
1307
- //---------------------------------------------------------------------
1308
- // QRMath
1309
- //---------------------------------------------------------------------
1310
-
1311
- var QRMath = function() {
1312
-
1313
- var EXP_TABLE = new Array(256);
1314
- var LOG_TABLE = new Array(256);
1315
-
1316
- // initialize tables
1317
- for (var i = 0; i < 8; i += 1) {
1318
- EXP_TABLE[i] = 1 << i;
1319
- }
1320
- for (var i = 8; i < 256; i += 1) {
1321
- EXP_TABLE[i] = EXP_TABLE[i - 4]
1322
- ^ EXP_TABLE[i - 5]
1323
- ^ EXP_TABLE[i - 6]
1324
- ^ EXP_TABLE[i - 8];
1325
- }
1326
- for (var i = 0; i < 255; i += 1) {
1327
- LOG_TABLE[EXP_TABLE[i] ] = i;
1328
- }
1329
-
1330
- var _this = {};
1331
-
1332
- _this.glog = function(n) {
1333
-
1334
- if (n < 1) {
1335
- throw new Error('glog(' + n + ')');
1336
- }
1337
-
1338
- return LOG_TABLE[n];
1339
- };
1340
-
1341
- _this.gexp = function(n) {
1342
-
1343
- while (n < 0) {
1344
- n += 255;
1345
- }
1346
-
1347
- while (n >= 256) {
1348
- n -= 255;
1349
- }
1350
-
1351
- return EXP_TABLE[n];
1352
- };
1353
-
1354
- return _this;
1355
- }();
1356
-
1357
- //---------------------------------------------------------------------
1358
- // qrPolynomial
1359
- //---------------------------------------------------------------------
1360
-
1361
- function qrPolynomial(num, shift) {
1362
-
1363
- if (typeof num.length == 'undefined') {
1364
- throw new Error(num.length + '/' + shift);
1365
- }
1366
-
1367
- var _num = function() {
1368
- var offset = 0;
1369
- while (offset < num.length && num[offset] == 0) {
1370
- offset += 1;
1371
- }
1372
- var _num = new Array(num.length - offset + shift);
1373
- for (var i = 0; i < num.length - offset; i += 1) {
1374
- _num[i] = num[i + offset];
1375
- }
1376
- return _num;
1377
- }();
1378
-
1379
- var _this = {};
1380
-
1381
- _this.getAt = function(index) {
1382
- return _num[index];
1383
- };
1384
-
1385
- _this.getLength = function() {
1386
- return _num.length;
1387
- };
1388
-
1389
- _this.multiply = function(e) {
1390
-
1391
- var num = new Array(_this.getLength() + e.getLength() - 1);
1392
-
1393
- for (var i = 0; i < _this.getLength(); i += 1) {
1394
- for (var j = 0; j < e.getLength(); j += 1) {
1395
- num[i + j] ^= QRMath.gexp(QRMath.glog(_this.getAt(i) ) + QRMath.glog(e.getAt(j) ) );
1396
- }
1397
- }
1398
-
1399
- return qrPolynomial(num, 0);
1400
- };
1401
-
1402
- _this.mod = function(e) {
1403
-
1404
- if (_this.getLength() - e.getLength() < 0) {
1405
- return _this;
1406
- }
1407
-
1408
- var ratio = QRMath.glog(_this.getAt(0) ) - QRMath.glog(e.getAt(0) );
1409
-
1410
- var num = new Array(_this.getLength() );
1411
- for (var i = 0; i < _this.getLength(); i += 1) {
1412
- num[i] = _this.getAt(i);
1413
- }
1414
-
1415
- for (var i = 0; i < e.getLength(); i += 1) {
1416
- num[i] ^= QRMath.gexp(QRMath.glog(e.getAt(i) ) + ratio);
1417
- }
1418
-
1419
- // recursive call
1420
- return qrPolynomial(num, 0).mod(e);
1421
- };
1422
-
1423
- return _this;
1424
- };
1425
-
1426
- //---------------------------------------------------------------------
1427
- // QRRSBlock
1428
- //---------------------------------------------------------------------
1429
-
1430
- var QRRSBlock = function() {
1431
-
1432
- var RS_BLOCK_TABLE = [
1433
-
1434
- // L
1435
- // M
1436
- // Q
1437
- // H
1438
-
1439
- // 1
1440
- [1, 26, 19],
1441
- [1, 26, 16],
1442
- [1, 26, 13],
1443
- [1, 26, 9],
1444
-
1445
- // 2
1446
- [1, 44, 34],
1447
- [1, 44, 28],
1448
- [1, 44, 22],
1449
- [1, 44, 16],
1450
-
1451
- // 3
1452
- [1, 70, 55],
1453
- [1, 70, 44],
1454
- [2, 35, 17],
1455
- [2, 35, 13],
1456
-
1457
- // 4
1458
- [1, 100, 80],
1459
- [2, 50, 32],
1460
- [2, 50, 24],
1461
- [4, 25, 9],
1462
-
1463
- // 5
1464
- [1, 134, 108],
1465
- [2, 67, 43],
1466
- [2, 33, 15, 2, 34, 16],
1467
- [2, 33, 11, 2, 34, 12],
1468
-
1469
- // 6
1470
- [2, 86, 68],
1471
- [4, 43, 27],
1472
- [4, 43, 19],
1473
- [4, 43, 15],
1474
-
1475
- // 7
1476
- [2, 98, 78],
1477
- [4, 49, 31],
1478
- [2, 32, 14, 4, 33, 15],
1479
- [4, 39, 13, 1, 40, 14],
1480
-
1481
- // 8
1482
- [2, 121, 97],
1483
- [2, 60, 38, 2, 61, 39],
1484
- [4, 40, 18, 2, 41, 19],
1485
- [4, 40, 14, 2, 41, 15],
1486
-
1487
- // 9
1488
- [2, 146, 116],
1489
- [3, 58, 36, 2, 59, 37],
1490
- [4, 36, 16, 4, 37, 17],
1491
- [4, 36, 12, 4, 37, 13],
1492
-
1493
- // 10
1494
- [2, 86, 68, 2, 87, 69],
1495
- [4, 69, 43, 1, 70, 44],
1496
- [6, 43, 19, 2, 44, 20],
1497
- [6, 43, 15, 2, 44, 16],
1498
-
1499
- // 11
1500
- [4, 101, 81],
1501
- [1, 80, 50, 4, 81, 51],
1502
- [4, 50, 22, 4, 51, 23],
1503
- [3, 36, 12, 8, 37, 13],
1504
-
1505
- // 12
1506
- [2, 116, 92, 2, 117, 93],
1507
- [6, 58, 36, 2, 59, 37],
1508
- [4, 46, 20, 6, 47, 21],
1509
- [7, 42, 14, 4, 43, 15],
1510
-
1511
- // 13
1512
- [4, 133, 107],
1513
- [8, 59, 37, 1, 60, 38],
1514
- [8, 44, 20, 4, 45, 21],
1515
- [12, 33, 11, 4, 34, 12],
1516
-
1517
- // 14
1518
- [3, 145, 115, 1, 146, 116],
1519
- [4, 64, 40, 5, 65, 41],
1520
- [11, 36, 16, 5, 37, 17],
1521
- [11, 36, 12, 5, 37, 13],
1522
-
1523
- // 15
1524
- [5, 109, 87, 1, 110, 88],
1525
- [5, 65, 41, 5, 66, 42],
1526
- [5, 54, 24, 7, 55, 25],
1527
- [11, 36, 12, 7, 37, 13],
1528
-
1529
- // 16
1530
- [5, 122, 98, 1, 123, 99],
1531
- [7, 73, 45, 3, 74, 46],
1532
- [15, 43, 19, 2, 44, 20],
1533
- [3, 45, 15, 13, 46, 16],
1534
-
1535
- // 17
1536
- [1, 135, 107, 5, 136, 108],
1537
- [10, 74, 46, 1, 75, 47],
1538
- [1, 50, 22, 15, 51, 23],
1539
- [2, 42, 14, 17, 43, 15],
1540
-
1541
- // 18
1542
- [5, 150, 120, 1, 151, 121],
1543
- [9, 69, 43, 4, 70, 44],
1544
- [17, 50, 22, 1, 51, 23],
1545
- [2, 42, 14, 19, 43, 15],
1546
-
1547
- // 19
1548
- [3, 141, 113, 4, 142, 114],
1549
- [3, 70, 44, 11, 71, 45],
1550
- [17, 47, 21, 4, 48, 22],
1551
- [9, 39, 13, 16, 40, 14],
1552
-
1553
- // 20
1554
- [3, 135, 107, 5, 136, 108],
1555
- [3, 67, 41, 13, 68, 42],
1556
- [15, 54, 24, 5, 55, 25],
1557
- [15, 43, 15, 10, 44, 16],
1558
-
1559
- // 21
1560
- [4, 144, 116, 4, 145, 117],
1561
- [17, 68, 42],
1562
- [17, 50, 22, 6, 51, 23],
1563
- [19, 46, 16, 6, 47, 17],
1564
-
1565
- // 22
1566
- [2, 139, 111, 7, 140, 112],
1567
- [17, 74, 46],
1568
- [7, 54, 24, 16, 55, 25],
1569
- [34, 37, 13],
1570
-
1571
- // 23
1572
- [4, 151, 121, 5, 152, 122],
1573
- [4, 75, 47, 14, 76, 48],
1574
- [11, 54, 24, 14, 55, 25],
1575
- [16, 45, 15, 14, 46, 16],
1576
-
1577
- // 24
1578
- [6, 147, 117, 4, 148, 118],
1579
- [6, 73, 45, 14, 74, 46],
1580
- [11, 54, 24, 16, 55, 25],
1581
- [30, 46, 16, 2, 47, 17],
1582
-
1583
- // 25
1584
- [8, 132, 106, 4, 133, 107],
1585
- [8, 75, 47, 13, 76, 48],
1586
- [7, 54, 24, 22, 55, 25],
1587
- [22, 45, 15, 13, 46, 16],
1588
-
1589
- // 26
1590
- [10, 142, 114, 2, 143, 115],
1591
- [19, 74, 46, 4, 75, 47],
1592
- [28, 50, 22, 6, 51, 23],
1593
- [33, 46, 16, 4, 47, 17],
1594
-
1595
- // 27
1596
- [8, 152, 122, 4, 153, 123],
1597
- [22, 73, 45, 3, 74, 46],
1598
- [8, 53, 23, 26, 54, 24],
1599
- [12, 45, 15, 28, 46, 16],
1600
-
1601
- // 28
1602
- [3, 147, 117, 10, 148, 118],
1603
- [3, 73, 45, 23, 74, 46],
1604
- [4, 54, 24, 31, 55, 25],
1605
- [11, 45, 15, 31, 46, 16],
1606
-
1607
- // 29
1608
- [7, 146, 116, 7, 147, 117],
1609
- [21, 73, 45, 7, 74, 46],
1610
- [1, 53, 23, 37, 54, 24],
1611
- [19, 45, 15, 26, 46, 16],
1612
-
1613
- // 30
1614
- [5, 145, 115, 10, 146, 116],
1615
- [19, 75, 47, 10, 76, 48],
1616
- [15, 54, 24, 25, 55, 25],
1617
- [23, 45, 15, 25, 46, 16],
1618
-
1619
- // 31
1620
- [13, 145, 115, 3, 146, 116],
1621
- [2, 74, 46, 29, 75, 47],
1622
- [42, 54, 24, 1, 55, 25],
1623
- [23, 45, 15, 28, 46, 16],
1624
-
1625
- // 32
1626
- [17, 145, 115],
1627
- [10, 74, 46, 23, 75, 47],
1628
- [10, 54, 24, 35, 55, 25],
1629
- [19, 45, 15, 35, 46, 16],
1630
-
1631
- // 33
1632
- [17, 145, 115, 1, 146, 116],
1633
- [14, 74, 46, 21, 75, 47],
1634
- [29, 54, 24, 19, 55, 25],
1635
- [11, 45, 15, 46, 46, 16],
1636
-
1637
- // 34
1638
- [13, 145, 115, 6, 146, 116],
1639
- [14, 74, 46, 23, 75, 47],
1640
- [44, 54, 24, 7, 55, 25],
1641
- [59, 46, 16, 1, 47, 17],
1642
-
1643
- // 35
1644
- [12, 151, 121, 7, 152, 122],
1645
- [12, 75, 47, 26, 76, 48],
1646
- [39, 54, 24, 14, 55, 25],
1647
- [22, 45, 15, 41, 46, 16],
1648
-
1649
- // 36
1650
- [6, 151, 121, 14, 152, 122],
1651
- [6, 75, 47, 34, 76, 48],
1652
- [46, 54, 24, 10, 55, 25],
1653
- [2, 45, 15, 64, 46, 16],
1654
-
1655
- // 37
1656
- [17, 152, 122, 4, 153, 123],
1657
- [29, 74, 46, 14, 75, 47],
1658
- [49, 54, 24, 10, 55, 25],
1659
- [24, 45, 15, 46, 46, 16],
1660
-
1661
- // 38
1662
- [4, 152, 122, 18, 153, 123],
1663
- [13, 74, 46, 32, 75, 47],
1664
- [48, 54, 24, 14, 55, 25],
1665
- [42, 45, 15, 32, 46, 16],
1666
-
1667
- // 39
1668
- [20, 147, 117, 4, 148, 118],
1669
- [40, 75, 47, 7, 76, 48],
1670
- [43, 54, 24, 22, 55, 25],
1671
- [10, 45, 15, 67, 46, 16],
1672
-
1673
- // 40
1674
- [19, 148, 118, 6, 149, 119],
1675
- [18, 75, 47, 31, 76, 48],
1676
- [34, 54, 24, 34, 55, 25],
1677
- [20, 45, 15, 61, 46, 16]
1678
- ];
1679
-
1680
- var qrRSBlock = function(totalCount, dataCount) {
1681
- var _this = {};
1682
- _this.totalCount = totalCount;
1683
- _this.dataCount = dataCount;
1684
- return _this;
1685
- };
1686
-
1687
- var _this = {};
1688
-
1689
- var getRsBlockTable = function(typeNumber, errorCorrectLevel) {
1690
-
1691
- switch(errorCorrectLevel) {
1692
- case QRErrorCorrectLevel.L :
1693
- return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
1694
- case QRErrorCorrectLevel.M :
1695
- return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
1696
- case QRErrorCorrectLevel.Q :
1697
- return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
1698
- case QRErrorCorrectLevel.H :
1699
- return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
1700
- default :
1701
- return undefined;
1702
- }
1703
- };
1704
-
1705
- _this.getRSBlocks = function(typeNumber, errorCorrectLevel) {
1706
-
1707
- var rsBlock = getRsBlockTable(typeNumber, errorCorrectLevel);
1708
-
1709
- if (typeof rsBlock == 'undefined') {
1710
- throw new Error('bad rs block @ typeNumber:' + typeNumber +
1711
- '/errorCorrectLevel:' + errorCorrectLevel);
1712
- }
1713
-
1714
- var length = rsBlock.length / 3;
1715
-
1716
- var list = new Array();
1717
-
1718
- for (var i = 0; i < length; i += 1) {
1719
-
1720
- var count = rsBlock[i * 3 + 0];
1721
- var totalCount = rsBlock[i * 3 + 1];
1722
- var dataCount = rsBlock[i * 3 + 2];
1723
-
1724
- for (var j = 0; j < count; j += 1) {
1725
- list.push(qrRSBlock(totalCount, dataCount) );
1726
- }
1727
- }
1728
-
1729
- return list;
1730
- };
1731
-
1732
- return _this;
1733
- }();
1734
-
1735
- //---------------------------------------------------------------------
1736
- // qrBitBuffer
1737
- //---------------------------------------------------------------------
1738
-
1739
- var qrBitBuffer = function() {
1740
-
1741
- var _buffer = new Array();
1742
- var _length = 0;
1743
-
1744
- var _this = {};
1745
-
1746
- _this.getBuffer = function() {
1747
- return _buffer;
1748
- };
1749
-
1750
- _this.getAt = function(index) {
1751
- var bufIndex = Math.floor(index / 8);
1752
- return ( (_buffer[bufIndex] >>> (7 - index % 8) ) & 1) == 1;
1753
- };
1754
-
1755
- _this.put = function(num, length) {
1756
- for (var i = 0; i < length; i += 1) {
1757
- _this.putBit( ( (num >>> (length - i - 1) ) & 1) == 1);
1758
- }
1759
- };
1760
-
1761
- _this.getLengthInBits = function() {
1762
- return _length;
1763
- };
1764
-
1765
- _this.putBit = function(bit) {
1766
-
1767
- var bufIndex = Math.floor(_length / 8);
1768
- if (_buffer.length <= bufIndex) {
1769
- _buffer.push(0);
1770
- }
1771
-
1772
- if (bit) {
1773
- _buffer[bufIndex] |= (0x80 >>> (_length % 8) );
1774
- }
1775
-
1776
- _length += 1;
1777
- };
1778
-
1779
- return _this;
1780
- };
1781
-
1782
- //---------------------------------------------------------------------
1783
- // qr8BitByte
1784
- //---------------------------------------------------------------------
1785
-
1786
- var qr8BitByte = function(data) {
1787
-
1788
- var _mode = QRMode.MODE_8BIT_BYTE;
1789
- var _data = data;
1790
- var _bytes = qrcode.stringToBytes(data);
1791
-
1792
- var _this = {};
1793
-
1794
- _this.getMode = function() {
1795
- return _mode;
1796
- };
1797
-
1798
- _this.getLength = function(buffer) {
1799
- return _bytes.length;
1800
- };
1801
-
1802
- _this.write = function(buffer) {
1803
- for (var i = 0; i < _bytes.length; i += 1) {
1804
- buffer.put(_bytes[i], 8);
1805
- }
1806
- };
1807
-
1808
- return _this;
1809
- };
1810
-
1811
- //=====================================================================
1812
- // GIF Support etc.
1813
- //
1814
-
1815
- //---------------------------------------------------------------------
1816
- // byteArrayOutputStream
1817
- //---------------------------------------------------------------------
1818
-
1819
- var byteArrayOutputStream = function() {
1820
-
1821
- var _bytes = new Array();
1822
-
1823
- var _this = {};
1824
-
1825
- _this.writeByte = function(b) {
1826
- _bytes.push(b & 0xff);
1827
- };
1828
-
1829
- _this.writeShort = function(i) {
1830
- _this.writeByte(i);
1831
- _this.writeByte(i >>> 8);
1832
- };
1833
-
1834
- _this.writeBytes = function(b, off, len) {
1835
- off = off || 0;
1836
- len = len || b.length;
1837
- for (var i = 0; i < len; i += 1) {
1838
- _this.writeByte(b[i + off]);
1839
- }
1840
- };
1841
-
1842
- _this.writeString = function(s) {
1843
- for (var i = 0; i < s.length; i += 1) {
1844
- _this.writeByte(s.charCodeAt(i) );
1845
- }
1846
- };
1847
-
1848
- _this.toByteArray = function() {
1849
- return _bytes;
1850
- };
1851
-
1852
- _this.toString = function() {
1853
- var s = '';
1854
- s += '[';
1855
- for (var i = 0; i < _bytes.length; i += 1) {
1856
- if (i > 0) {
1857
- s += ',';
1858
- }
1859
- s += _bytes[i];
1860
- }
1861
- s += ']';
1862
- return s;
1863
- };
1864
-
1865
- return _this;
1866
- };
1867
-
1868
- //---------------------------------------------------------------------
1869
- // base64EncodeOutputStream
1870
- //---------------------------------------------------------------------
1871
-
1872
- var base64EncodeOutputStream = function() {
1873
-
1874
- var _buffer = 0;
1875
- var _buflen = 0;
1876
- var _length = 0;
1877
- var _base64 = '';
1878
-
1879
- var _this = {};
1880
-
1881
- var writeEncoded = function(b) {
1882
- _base64 += String.fromCharCode(encode(b & 0x3f) );
1883
- };
1884
-
1885
- var encode = function(n) {
1886
- if (n < 0) {
1887
- // error.
1888
- } else if (n < 26) {
1889
- return 0x41 + n;
1890
- } else if (n < 52) {
1891
- return 0x61 + (n - 26);
1892
- } else if (n < 62) {
1893
- return 0x30 + (n - 52);
1894
- } else if (n == 62) {
1895
- return 0x2b;
1896
- } else if (n == 63) {
1897
- return 0x2f;
1898
- }
1899
- throw new Error('n:' + n);
1900
- };
1901
-
1902
- _this.writeByte = function(n) {
1903
-
1904
- _buffer = (_buffer << 8) | (n & 0xff);
1905
- _buflen += 8;
1906
- _length += 1;
1907
-
1908
- while (_buflen >= 6) {
1909
- writeEncoded(_buffer >>> (_buflen - 6) );
1910
- _buflen -= 6;
1911
- }
1912
- };
1913
-
1914
- _this.flush = function() {
1915
-
1916
- if (_buflen > 0) {
1917
- writeEncoded(_buffer << (6 - _buflen) );
1918
- _buffer = 0;
1919
- _buflen = 0;
1920
- }
1921
-
1922
- if (_length % 3 != 0) {
1923
- // padding
1924
- var padlen = 3 - _length % 3;
1925
- for (var i = 0; i < padlen; i += 1) {
1926
- _base64 += '=';
1927
- }
1928
- }
1929
- };
1930
-
1931
- _this.toString = function() {
1932
- return _base64;
1933
- };
1934
-
1935
- return _this;
1936
- };
1937
-
1938
- //---------------------------------------------------------------------
1939
- // base64DecodeInputStream
1940
- //---------------------------------------------------------------------
1941
-
1942
- var base64DecodeInputStream = function(str) {
1943
-
1944
- var _str = str;
1945
- var _pos = 0;
1946
- var _buffer = 0;
1947
- var _buflen = 0;
1948
-
1949
- var _this = {};
1950
-
1951
- _this.read = function() {
1952
-
1953
- while (_buflen < 8) {
1954
-
1955
- if (_pos >= _str.length) {
1956
- if (_buflen == 0) {
1957
- return -1;
1958
- }
1959
- throw new Error('unexpected end of file./' + _buflen);
1960
- }
1961
-
1962
- var c = _str.charAt(_pos);
1963
- _pos += 1;
1964
-
1965
- if (c == '=') {
1966
- _buflen = 0;
1967
- return -1;
1968
- } else if (c.match(/^\s$/) ) {
1969
- // ignore if whitespace.
1970
- continue;
1971
- }
1972
-
1973
- _buffer = (_buffer << 6) | decode(c.charCodeAt(0) );
1974
- _buflen += 6;
1975
- }
1976
-
1977
- var n = (_buffer >>> (_buflen - 8) ) & 0xff;
1978
- _buflen -= 8;
1979
- return n;
1980
- };
1981
-
1982
- var decode = function(c) {
1983
- if (0x41 <= c && c <= 0x5a) {
1984
- return c - 0x41;
1985
- } else if (0x61 <= c && c <= 0x7a) {
1986
- return c - 0x61 + 26;
1987
- } else if (0x30 <= c && c <= 0x39) {
1988
- return c - 0x30 + 52;
1989
- } else if (c == 0x2b) {
1990
- return 62;
1991
- } else if (c == 0x2f) {
1992
- return 63;
1993
- } else {
1994
- throw new Error('c:' + c);
1995
- }
1996
- };
1997
-
1998
- return _this;
1999
- };
2000
-
2001
- //---------------------------------------------------------------------
2002
- // gifImage (B/W)
2003
- //---------------------------------------------------------------------
2004
-
2005
- var gifImage = function(width, height) {
2006
-
2007
- var _width = width;
2008
- var _height = height;
2009
- var _data = new Array(width * height);
2010
-
2011
- var _this = {};
2012
-
2013
- _this.setPixel = function(x, y, pixel) {
2014
- _data[y * _width + x] = pixel;
2015
- };
2016
-
2017
- _this.write = function(out) {
2018
-
2019
- //---------------------------------
2020
- // GIF Signature
2021
-
2022
- out.writeString('GIF87a');
2023
-
2024
- //---------------------------------
2025
- // Screen Descriptor
2026
-
2027
- out.writeShort(_width);
2028
- out.writeShort(_height);
2029
-
2030
- out.writeByte(0x80); // 2bit
2031
- out.writeByte(0);
2032
- out.writeByte(0);
2033
-
2034
- //---------------------------------
2035
- // Global Color Map
2036
-
2037
- // black
2038
- out.writeByte(0x00);
2039
- out.writeByte(0x00);
2040
- out.writeByte(0x00);
2041
-
2042
- // white
2043
- out.writeByte(0xff);
2044
- out.writeByte(0xff);
2045
- out.writeByte(0xff);
2046
-
2047
- //---------------------------------
2048
- // Image Descriptor
2049
-
2050
- out.writeString(',');
2051
- out.writeShort(0);
2052
- out.writeShort(0);
2053
- out.writeShort(_width);
2054
- out.writeShort(_height);
2055
- out.writeByte(0);
2056
-
2057
- //---------------------------------
2058
- // Local Color Map
2059
-
2060
- //---------------------------------
2061
- // Raster Data
2062
-
2063
- var lzwMinCodeSize = 2;
2064
- var raster = getLZWRaster(lzwMinCodeSize);
2065
-
2066
- out.writeByte(lzwMinCodeSize);
2067
-
2068
- var offset = 0;
2069
-
2070
- while (raster.length - offset > 255) {
2071
- out.writeByte(255);
2072
- out.writeBytes(raster, offset, 255);
2073
- offset += 255;
2074
- }
2075
-
2076
- out.writeByte(raster.length - offset);
2077
- out.writeBytes(raster, offset, raster.length - offset);
2078
- out.writeByte(0x00);
2079
-
2080
- //---------------------------------
2081
- // GIF Terminator
2082
- out.writeString(';');
2083
- };
2084
-
2085
- var bitOutputStream = function(out) {
2086
-
2087
- var _out = out;
2088
- var _bitLength = 0;
2089
- var _bitBuffer = 0;
2090
-
2091
- var _this = {};
2092
-
2093
- _this.write = function(data, length) {
2094
-
2095
- if ( (data >>> length) != 0) {
2096
- throw new Error('length over');
2097
- }
2098
-
2099
- while (_bitLength + length >= 8) {
2100
- _out.writeByte(0xff & ( (data << _bitLength) | _bitBuffer) );
2101
- length -= (8 - _bitLength);
2102
- data >>>= (8 - _bitLength);
2103
- _bitBuffer = 0;
2104
- _bitLength = 0;
2105
- }
2106
-
2107
- _bitBuffer = (data << _bitLength) | _bitBuffer;
2108
- _bitLength = _bitLength + length;
2109
- };
2110
-
2111
- _this.flush = function() {
2112
- if (_bitLength > 0) {
2113
- _out.writeByte(_bitBuffer);
2114
- }
2115
- };
2116
-
2117
- return _this;
2118
- };
2119
-
2120
- var getLZWRaster = function(lzwMinCodeSize) {
2121
-
2122
- var clearCode = 1 << lzwMinCodeSize;
2123
- var endCode = (1 << lzwMinCodeSize) + 1;
2124
- var bitLength = lzwMinCodeSize + 1;
2125
-
2126
- // Setup LZWTable
2127
- var table = lzwTable();
2128
-
2129
- for (var i = 0; i < clearCode; i += 1) {
2130
- table.add(String.fromCharCode(i) );
2131
- }
2132
- table.add(String.fromCharCode(clearCode) );
2133
- table.add(String.fromCharCode(endCode) );
2134
-
2135
- var byteOut = byteArrayOutputStream();
2136
- var bitOut = bitOutputStream(byteOut);
2137
-
2138
- // clear code
2139
- bitOut.write(clearCode, bitLength);
2140
-
2141
- var dataIndex = 0;
2142
-
2143
- var s = String.fromCharCode(_data[dataIndex]);
2144
- dataIndex += 1;
2145
-
2146
- while (dataIndex < _data.length) {
2147
-
2148
- var c = String.fromCharCode(_data[dataIndex]);
2149
- dataIndex += 1;
2150
-
2151
- if (table.contains(s + c) ) {
2152
-
2153
- s = s + c;
2154
-
2155
- } else {
2156
-
2157
- bitOut.write(table.indexOf(s), bitLength);
2158
-
2159
- if (table.size() < 0xfff) {
2160
-
2161
- if (table.size() == (1 << bitLength) ) {
2162
- bitLength += 1;
2163
- }
2164
-
2165
- table.add(s + c);
2166
- }
2167
-
2168
- s = c;
2169
- }
2170
- }
2171
-
2172
- bitOut.write(table.indexOf(s), bitLength);
2173
-
2174
- // end code
2175
- bitOut.write(endCode, bitLength);
2176
-
2177
- bitOut.flush();
2178
-
2179
- return byteOut.toByteArray();
2180
- };
2181
-
2182
- var lzwTable = function() {
2183
-
2184
- var _map = {};
2185
- var _size = 0;
2186
-
2187
- var _this = {};
2188
-
2189
- _this.add = function(key) {
2190
- if (_this.contains(key) ) {
2191
- throw new Error('dup key:' + key);
2192
- }
2193
- _map[key] = _size;
2194
- _size += 1;
2195
- };
2196
-
2197
- _this.size = function() {
2198
- return _size;
2199
- };
2200
-
2201
- _this.indexOf = function(key) {
2202
- return _map[key];
2203
- };
2204
-
2205
- _this.contains = function(key) {
2206
- return typeof _map[key] != 'undefined';
2207
- };
2208
-
2209
- return _this;
2210
- };
2211
-
2212
- return _this;
2213
- };
2214
-
2215
- var createImgTag = function(width, height, getPixel, alt) {
2216
-
2217
- var gif = gifImage(width, height);
2218
- for (var y = 0; y < height; y += 1) {
2219
- for (var x = 0; x < width; x += 1) {
2220
- gif.setPixel(x, y, getPixel(x, y) );
2221
- }
2222
- }
2223
-
2224
- var b = byteArrayOutputStream();
2225
- gif.write(b);
2226
-
2227
- var base64 = base64EncodeOutputStream();
2228
- var bytes = b.toByteArray();
2229
- for (var i = 0; i < bytes.length; i += 1) {
2230
- base64.writeByte(bytes[i]);
2231
- }
2232
- base64.flush();
2233
-
2234
- var img = '';
2235
- img += '<img';
2236
- img += '\u0020src="';
2237
- img += 'data:image/gif;base64,';
2238
- img += base64;
2239
- img += '"';
2240
- img += '\u0020width="';
2241
- img += width;
2242
- img += '"';
2243
- img += '\u0020height="';
2244
- img += height;
2245
- img += '"';
2246
- if (alt) {
2247
- img += '\u0020alt="';
2248
- img += alt;
2249
- img += '"';
2250
- }
2251
- img += '/>';
2252
-
2253
- return img;
2254
- };
2255
-
2256
- //---------------------------------------------------------------------
2257
- // returns qrcode function.
2258
-
2259
- return qrcode;
2260
- }();
2261
-
2262
- (function (factory) {
2263
- if (typeof define === 'function' && define.amd) {
2264
- define([], factory);
2265
- } else if (typeof exports === 'object') {
2266
- module.exports = factory();
2267
- }
2268
- }(function () {
2269
- return qrcode;
2270
- }));
2271
- //---------------------------------------------------------------------
2272
- //
2273
- // QR Code Generator for JavaScript UTF8 Support (optional)
2274
- //
2275
- // Copyright (c) 2011 Kazuhiko Arase
2276
- //
2277
- // URL: http://www.d-project.com/
2278
- //
2279
- // Licensed under the MIT license:
2280
- // http://www.opensource.org/licenses/mit-license.php
2281
- //
2282
- // The word 'QR Code' is registered trademark of
2283
- // DENSO WAVE INCORPORATED
2284
- // http://www.denso-wave.com/qrcode/faqpatent-e.html
2285
- //
2286
- //---------------------------------------------------------------------
2287
-
2288
- !function(qrcode) {
2289
-
2290
- //---------------------------------------------------------------------
2291
- // overwrite qrcode.stringToBytes
2292
- //---------------------------------------------------------------------
2293
-
2294
- qrcode.stringToBytes = function(s) {
2295
- // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array
2296
- function toUTF8Array(str) {
2297
- var utf8 = [];
2298
- for (var i=0; i < str.length; i++) {
2299
- var charcode = str.charCodeAt(i);
2300
- if (charcode < 0x80) utf8.push(charcode);
2301
- else if (charcode < 0x800) {
2302
- utf8.push(0xc0 | (charcode >> 6),
2303
- 0x80 | (charcode & 0x3f));
2304
- }
2305
- else if (charcode < 0xd800 || charcode >= 0xe000) {
2306
- utf8.push(0xe0 | (charcode >> 12),
2307
- 0x80 | ((charcode>>6) & 0x3f),
2308
- 0x80 | (charcode & 0x3f));
2309
- }
2310
- // surrogate pair
2311
- else {
2312
- i++;
2313
- // UTF-16 encodes 0x10000-0x10FFFF by
2314
- // subtracting 0x10000 and splitting the
2315
- // 20 bits of 0x0-0xFFFFF into two halves
2316
- charcode = 0x10000 + (((charcode & 0x3ff)<<10)
2317
- | (str.charCodeAt(i) & 0x3ff));
2318
- utf8.push(0xf0 | (charcode >>18),
2319
- 0x80 | ((charcode>>12) & 0x3f),
2320
- 0x80 | ((charcode>>6) & 0x3f),
2321
- 0x80 | (charcode & 0x3f));
2322
- }
2323
- }
2324
- return utf8;
2325
- }
2326
- return toUTF8Array(s);
2327
- };
2328
-
2329
- }(qrcode);
2330
-
2331
- return qrcode; // eslint-disable-line no-undef
2332
- }()));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/jquery-qrcode/jquery-qrcode.min.js.orig DELETED
@@ -1,2 +0,0 @@
1
- /*! jquery-qrcode v0.14.0 - https://larsjung.de/jquery-qrcode/ */
2
- !function(r){"use strict";function t(t,e,n,o){function a(r,t){return r-=o,t-=o,0>r||r>=c||0>t||t>=c?!1:f.isDark(r,t)}function i(r,t,e,n){var o=u.isDark,a=1/l;u.isDark=function(i,u){var f=u*a,c=i*a,l=f+a,g=c+a;return o(i,u)&&(r>l||f>e||t>g||c>n)}}var u={},f=r(n,e);f.addData(t),f.make(),o=o||0;var c=f.getModuleCount(),l=f.getModuleCount()+2*o;return u.text=t,u.level=e,u.version=n,u.moduleCount=l,u.isDark=a,u.addBlank=i,u}function e(r,e,n,o,a){n=Math.max(1,n||1),o=Math.min(40,o||40);for(var i=n;o>=i;i+=1)try{return t(r,e,i,a)}catch(u){}}function n(r,t,e){var n=e.size,o="bold "+e.mSize*n+"px "+e.fontname,a=w("<canvas/>")[0].getContext("2d");a.font=o;var i=a.measureText(e.label).width,u=e.mSize,f=i/n,c=(1-f)*e.mPosX,l=(1-u)*e.mPosY,g=c+f,s=l+u,v=.01;1===e.mode?r.addBlank(0,l-v,n,s+v):r.addBlank(c-v,l-v,g+v,s+v),t.fillStyle=e.fontcolor,t.font=o,t.fillText(e.label,c*n,l*n+.75*e.mSize*n)}function o(r,t,e){var n=e.size,o=e.image.naturalWidth||1,a=e.image.naturalHeight||1,i=e.mSize,u=i*o/a,f=(1-u)*e.mPosX,c=(1-i)*e.mPosY,l=f+u,g=c+i,s=.01;3===e.mode?r.addBlank(0,c-s,n,g+s):r.addBlank(f-s,c-s,l+s,g+s),t.drawImage(e.image,f*n,c*n,u*n,i*n)}function a(r,t,e){w(e.background).is("img")?t.drawImage(e.background,0,0,e.size,e.size):e.background&&(t.fillStyle=e.background,t.fillRect(e.left,e.top,e.size,e.size));var a=e.mode;1===a||2===a?n(r,t,e):(3===a||4===a)&&o(r,t,e)}function i(r,t,e,n,o,a,i,u){r.isDark(i,u)&&t.rect(n,o,a,a)}function u(r,t,e,n,o,a,i,u,f,c){i?r.moveTo(t+a,e):r.moveTo(t,e),u?(r.lineTo(n-a,e),r.arcTo(n,e,n,o,a)):r.lineTo(n,e),f?(r.lineTo(n,o-a),r.arcTo(n,o,t,o,a)):r.lineTo(n,o),c?(r.lineTo(t+a,o),r.arcTo(t,o,t,e,a)):r.lineTo(t,o),i?(r.lineTo(t,e+a),r.arcTo(t,e,n,e,a)):r.lineTo(t,e)}function f(r,t,e,n,o,a,i,u,f,c){i&&(r.moveTo(t+a,e),r.lineTo(t,e),r.lineTo(t,e+a),r.arcTo(t,e,t+a,e,a)),u&&(r.moveTo(n-a,e),r.lineTo(n,e),r.lineTo(n,e+a),r.arcTo(n,e,n-a,e,a)),f&&(r.moveTo(n-a,o),r.lineTo(n,o),r.lineTo(n,o-a),r.arcTo(n,o,n-a,o,a)),c&&(r.moveTo(t+a,o),r.lineTo(t,o),r.lineTo(t,o-a),r.arcTo(t,o,t+a,o,a))}function c(r,t,e,n,o,a,i,c){var l=r.isDark,g=n+a,s=o+a,v=e.radius*a,h=i-1,d=i+1,w=c-1,m=c+1,y=l(i,c),T=l(h,w),p=l(h,c),B=l(h,m),A=l(i,m),E=l(d,m),k=l(d,c),M=l(d,w),C=l(i,w);y?u(t,n,o,g,s,v,!p&&!C,!p&&!A,!k&&!A,!k&&!C):f(t,n,o,g,s,v,p&&C&&T,p&&A&&B,k&&A&&E,k&&C&&M)}function l(r,t,e){var n,o,a=r.moduleCount,u=e.size/a,f=i;for(e.radius>0&&e.radius<=.5&&(f=c),t.beginPath(),n=0;a>n;n+=1)for(o=0;a>o;o+=1){var l=e.left+o*u,g=e.top+n*u,s=u;f(r,t,e,l,g,s,n,o)}if(w(e.fill).is("img")){t.strokeStyle="rgba(0,0,0,0.5)",t.lineWidth=2,t.stroke();var v=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",t.fill(),t.globalCompositeOperation=v,t.clip(),t.drawImage(e.fill,0,0,e.size,e.size),t.restore()}else t.fillStyle=e.fill,t.fill()}function g(r,t){var n=e(t.text,t.ecLevel,t.minVersion,t.maxVersion,t.quiet);if(!n)return null;var o=w(r).data("qrcode",n),i=o[0].getContext("2d");return a(n,i,t),l(n,i,t),o}function s(r){var t=w("<canvas/>").attr("width",r.size).attr("height",r.size);return g(t,r)}function v(r){return w("<img/>").attr("src",s(r)[0].toDataURL("image/png"))}function h(r){var t=e(r.text,r.ecLevel,r.minVersion,r.maxVersion,r.quiet);if(!t)return null;var n,o,a=r.size,i=r.background,u=Math.floor,f=t.moduleCount,c=u(a/f),l=u(.5*(a-c*f)),g={position:"relative",left:0,top:0,padding:0,margin:0,width:a,height:a},s={position:"absolute",padding:0,margin:0,width:c,height:c,"background-color":r.fill},v=w("<div/>").data("qrcode",t).css(g);for(i&&v.css("background-color",i),n=0;f>n;n+=1)for(o=0;f>o;o+=1)t.isDark(n,o)&&w("<div/>").css(s).css({left:l+o*c,top:l+n*c}).appendTo(v);return v}function d(r){return m&&"canvas"===r.render?s(r):m&&"image"===r.render?v(r):h(r)}var w=window.jQuery,m=function(){var r=document.createElement("canvas");return!(!r.getContext||!r.getContext("2d"))}(),y={render:"canvas",minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:0,quiet:0,mode:0,mSize:.1,mPosX:.5,mPosY:.5,label:"no label",fontname:"sans",fontcolor:"#000",image:null};w.fn.qrcode=function(r){var t=w.extend({},y,r);return this.each(function(r,e){"canvas"===e.nodeName.toLowerCase()?g(e,t):w(e).append(d(t))})}}(function(){var r=function(){function r(t,e){if("undefined"==typeof t.length)throw new Error(t.length+"/"+e);var n=function(){for(var r=0;r<t.length&&0==t[r];)r+=1;for(var n=new Array(t.length-r+e),o=0;o<t.length-r;o+=1)n[o]=t[o+r];return n}(),o={};return o.getAt=function(r){return n[r]},o.getLength=function(){return n.length},o.multiply=function(t){for(var e=new Array(o.getLength()+t.getLength()-1),n=0;n<o.getLength();n+=1)for(var a=0;a<t.getLength();a+=1)e[n+a]^=i.gexp(i.glog(o.getAt(n))+i.glog(t.getAt(a)));return r(e,0)},o.mod=function(t){if(o.getLength()-t.getLength()<0)return o;for(var e=i.glog(o.getAt(0))-i.glog(t.getAt(0)),n=new Array(o.getLength()),a=0;a<o.getLength();a+=1)n[a]=o.getAt(a);for(var a=0;a<t.getLength();a+=1)n[a]^=i.gexp(i.glog(t.getAt(a))+e);return r(n,0).mod(t)},o}var t=function(t,e){var o=236,i=17,l=t,g=n[e],s=null,v=0,d=null,w=new Array,m={},y=function(r,t){v=4*l+17,s=function(r){for(var t=new Array(r),e=0;r>e;e+=1){t[e]=new Array(r);for(var n=0;r>n;n+=1)t[e][n]=null}return t}(v),T(0,0),T(v-7,0),T(0,v-7),A(),B(),k(r,t),l>=7&&E(r),null==d&&(d=D(l,g,w)),M(d,t)},T=function(r,t){for(var e=-1;7>=e;e+=1)if(!(-1>=r+e||r+e>=v))for(var n=-1;7>=n;n+=1)-1>=t+n||t+n>=v||(e>=0&&6>=e&&(0==n||6==n)||n>=0&&6>=n&&(0==e||6==e)||e>=2&&4>=e&&n>=2&&4>=n?s[r+e][t+n]=!0:s[r+e][t+n]=!1)},p=function(){for(var r=0,t=0,e=0;8>e;e+=1){y(!0,e);var n=a.getLostPoint(m);(0==e||r>n)&&(r=n,t=e)}return t},B=function(){for(var r=8;v-8>r;r+=1)null==s[r][6]&&(s[r][6]=r%2==0);for(var t=8;v-8>t;t+=1)null==s[6][t]&&(s[6][t]=t%2==0)},A=function(){for(var r=a.getPatternPosition(l),t=0;t<r.length;t+=1)for(var e=0;e<r.length;e+=1){var n=r[t],o=r[e];if(null==s[n][o])for(var i=-2;2>=i;i+=1)for(var u=-2;2>=u;u+=1)-2==i||2==i||-2==u||2==u||0==i&&0==u?s[n+i][o+u]=!0:s[n+i][o+u]=!1}},E=function(r){for(var t=a.getBCHTypeNumber(l),e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);s[Math.floor(e/3)][e%3+v-8-3]=n}for(var e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);s[e%3+v-8-3][Math.floor(e/3)]=n}},k=function(r,t){for(var e=g<<3|t,n=a.getBCHTypeInfo(e),o=0;15>o;o+=1){var i=!r&&1==(n>>o&1);6>o?s[o][8]=i:8>o?s[o+1][8]=i:s[v-15+o][8]=i}for(var o=0;15>o;o+=1){var i=!r&&1==(n>>o&1);8>o?s[8][v-o-1]=i:9>o?s[8][15-o-1+1]=i:s[8][15-o-1]=i}s[v-8][8]=!r},M=function(r,t){for(var e=-1,n=v-1,o=7,i=0,u=a.getMaskFunction(t),f=v-1;f>0;f-=2)for(6==f&&(f-=1);;){for(var c=0;2>c;c+=1)if(null==s[n][f-c]){var l=!1;i<r.length&&(l=1==(r[i]>>>o&1));var g=u(n,f-c);g&&(l=!l),s[n][f-c]=l,o-=1,-1==o&&(i+=1,o=7)}if(n+=e,0>n||n>=v){n-=e,e=-e;break}}},C=function(t,e){for(var n=0,o=0,i=0,u=new Array(e.length),f=new Array(e.length),c=0;c<e.length;c+=1){var l=e[c].dataCount,g=e[c].totalCount-l;o=Math.max(o,l),i=Math.max(i,g),u[c]=new Array(l);for(var s=0;s<u[c].length;s+=1)u[c][s]=255&t.getBuffer()[s+n];n+=l;var v=a.getErrorCorrectPolynomial(g),h=r(u[c],v.getLength()-1),d=h.mod(v);f[c]=new Array(v.getLength()-1);for(var s=0;s<f[c].length;s+=1){var w=s+d.getLength()-f[c].length;f[c][s]=w>=0?d.getAt(w):0}}for(var m=0,s=0;s<e.length;s+=1)m+=e[s].totalCount;for(var y=new Array(m),T=0,s=0;o>s;s+=1)for(var c=0;c<e.length;c+=1)s<u[c].length&&(y[T]=u[c][s],T+=1);for(var s=0;i>s;s+=1)for(var c=0;c<e.length;c+=1)s<f[c].length&&(y[T]=f[c][s],T+=1);return y},D=function(r,t,e){for(var n=u.getRSBlocks(r,t),c=f(),l=0;l<e.length;l+=1){var g=e[l];c.put(g.getMode(),4),c.put(g.getLength(),a.getLengthInBits(g.getMode(),r)),g.write(c)}for(var s=0,l=0;l<n.length;l+=1)s+=n[l].dataCount;if(c.getLengthInBits()>8*s)throw new Error("code length overflow. ("+c.getLengthInBits()+">"+8*s+")");for(c.getLengthInBits()+4<=8*s&&c.put(0,4);c.getLengthInBits()%8!=0;)c.putBit(!1);for(;;){if(c.getLengthInBits()>=8*s)break;if(c.put(o,8),c.getLengthInBits()>=8*s)break;c.put(i,8)}return C(c,n)};return m.addData=function(r){var t=c(r);w.push(t),d=null},m.isDark=function(r,t){if(0>r||r>=v||0>t||t>=v)throw new Error(r+","+t);return s[r][t]},m.getModuleCount=function(){return v},m.make=function(){y(!1,p())},m.createTableTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e="";e+='<table style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: "+t+"px;",e+='">',e+="<tbody>";for(var n=0;n<m.getModuleCount();n+=1){e+="<tr>";for(var o=0;o<m.getModuleCount();o+=1)e+='<td style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: 0px;",e+=" width: "+r+"px;",e+=" height: "+r+"px;",e+=" background-color: ",e+=m.isDark(n,o)?"#000000":"#ffffff",e+=";",e+='"/>';e+="</tr>"}return e+="</tbody>",e+="</table>"},m.createImgTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e=m.getModuleCount()*r+2*t,n=t,o=e-t;return h(e,e,function(t,e){if(t>=n&&o>t&&e>=n&&o>e){var a=Math.floor((t-n)/r),i=Math.floor((e-n)/r);return m.isDark(i,a)?0:1}return 1})},m};t.stringToBytes=function(r){for(var t=new Array,e=0;e<r.length;e+=1){var n=r.charCodeAt(e);t.push(255&n)}return t},t.createStringToBytes=function(r,t){var e=function(){for(var e=s(r),n=function(){var r=e.read();if(-1==r)throw new Error;return r},o=0,a={};;){var i=e.read();if(-1==i)break;var u=n(),f=n(),c=n(),l=String.fromCharCode(i<<8|u),g=f<<8|c;a[l]=g,o+=1}if(o!=t)throw new Error(o+" != "+t);return a}(),n="?".charCodeAt(0);return function(r){for(var t=new Array,o=0;o<r.length;o+=1){var a=r.charCodeAt(o);if(128>a)t.push(a);else{var i=e[r.charAt(o)];"number"==typeof i?(255&i)==i?t.push(i):(t.push(i>>>8),t.push(255&i)):t.push(n)}}return t}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},a=function(){var t=[[],[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]],n=1335,a=7973,u=21522,f={},c=function(r){for(var t=0;0!=r;)t+=1,r>>>=1;return t};return f.getBCHTypeInfo=function(r){for(var t=r<<10;c(t)-c(n)>=0;)t^=n<<c(t)-c(n);return(r<<10|t)^u},f.getBCHTypeNumber=function(r){for(var t=r<<12;c(t)-c(a)>=0;)t^=a<<c(t)-c(a);return r<<12|t},f.getPatternPosition=function(r){return t[r-1]},f.getMaskFunction=function(r){switch(r){case o.PATTERN000:return function(r,t){return(r+t)%2==0};case o.PATTERN001:return function(r,t){return r%2==0};case o.PATTERN010:return function(r,t){return t%3==0};case o.PATTERN011:return function(r,t){return(r+t)%3==0};case o.PATTERN100:return function(r,t){return(Math.floor(r/2)+Math.floor(t/3))%2==0};case o.PATTERN101:return function(r,t){return r*t%2+r*t%3==0};case o.PATTERN110:return function(r,t){return(r*t%2+r*t%3)%2==0};case o.PATTERN111:return function(r,t){return(r*t%3+(r+t)%2)%2==0};default:throw new Error("bad maskPattern:"+r)}},f.getErrorCorrectPolynomial=function(t){for(var e=r([1],0),n=0;t>n;n+=1)e=e.multiply(r([1,i.gexp(n)],0));return e},f.getLengthInBits=function(r,t){if(t>=1&&10>t)switch(r){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+r)}else if(27>t)switch(r){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+r)}else{if(!(41>t))throw new Error("type:"+t);switch(r){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+r)}}},f.getLostPoint=function(r){for(var t=r.getModuleCount(),e=0,n=0;t>n;n+=1)for(var o=0;t>o;o+=1){for(var a=0,i=r.isDark(n,o),u=-1;1>=u;u+=1)if(!(0>n+u||n+u>=t))for(var f=-1;1>=f;f+=1)0>o+f||o+f>=t||(0!=u||0!=f)&&i==r.isDark(n+u,o+f)&&(a+=1);a>5&&(e+=3+a-5)}for(var n=0;t-1>n;n+=1)for(var o=0;t-1>o;o+=1){var c=0;r.isDark(n,o)&&(c+=1),r.isDark(n+1,o)&&(c+=1),r.isDark(n,o+1)&&(c+=1),r.isDark(n+1,o+1)&&(c+=1),(0==c||4==c)&&(e+=3)}for(var n=0;t>n;n+=1)for(var o=0;t-6>o;o+=1)r.isDark(n,o)&&!r.isDark(n,o+1)&&r.isDark(n,o+2)&&r.isDark(n,o+3)&&r.isDark(n,o+4)&&!r.isDark(n,o+5)&&r.isDark(n,o+6)&&(e+=40);for(var o=0;t>o;o+=1)for(var n=0;t-6>n;n+=1)r.isDark(n,o)&&!r.isDark(n+1,o)&&r.isDark(n+2,o)&&r.isDark(n+3,o)&&r.isDark(n+4,o)&&!r.isDark(n+5,o)&&r.isDark(n+6,o)&&(e+=40);for(var l=0,o=0;t>o;o+=1)for(var n=0;t>n;n+=1)r.isDark(n,o)&&(l+=1);var g=Math.abs(100*l/t/t-50)/5;return e+=10*g},f}(),i=function(){for(var r=new Array(256),t=new Array(256),e=0;8>e;e+=1)r[e]=1<<e;for(var e=8;256>e;e+=1)r[e]=r[e-4]^r[e-5]^r[e-6]^r[e-8];for(var e=0;255>e;e+=1)t[r[e]]=e;var n={};return n.glog=function(r){if(1>r)throw new Error("glog("+r+")");return t[r]},n.gexp=function(t){for(;0>t;)t+=255;for(;t>=256;)t-=255;return r[t]},n}(),u=function(){var r=[[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,7,37,13],[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]],t=function(r,t){var e={};return e.totalCount=r,e.dataCount=t,e},e={},o=function(t,e){switch(e){case n.L:return r[4*(t-1)+0];case n.M:return r[4*(t-1)+1];case n.Q:return r[4*(t-1)+2];case n.H:return r[4*(t-1)+3];default:return}};return e.getRSBlocks=function(r,e){var n=o(r,e);if("undefined"==typeof n)throw new Error("bad rs block @ typeNumber:"+r+"/errorCorrectLevel:"+e);for(var a=n.length/3,i=new Array,u=0;a>u;u+=1)for(var f=n[3*u+0],c=n[3*u+1],l=n[3*u+2],g=0;f>g;g+=1)i.push(t(c,l));return i},e}(),f=function(){var r=new Array,t=0,e={};return e.getBuffer=function(){return r},e.getAt=function(t){var e=Math.floor(t/8);return 1==(r[e]>>>7-t%8&1)},e.put=function(r,t){for(var n=0;t>n;n+=1)e.putBit(1==(r>>>t-n-1&1))},e.getLengthInBits=function(){return t},e.putBit=function(e){var n=Math.floor(t/8);r.length<=n&&r.push(0),e&&(r[n]|=128>>>t%8),t+=1},e},c=function(r){var n=e.MODE_8BIT_BYTE,o=t.stringToBytes(r),a={};return a.getMode=function(){return n},a.getLength=function(r){return o.length},a.write=function(r){for(var t=0;t<o.length;t+=1)r.put(o[t],8)},a},l=function(){var r=new Array,t={};return t.writeByte=function(t){r.push(255&t)},t.writeShort=function(r){t.writeByte(r),t.writeByte(r>>>8)},t.writeBytes=function(r,e,n){e=e||0,n=n||r.length;for(var o=0;n>o;o+=1)t.writeByte(r[o+e])},t.writeString=function(r){for(var e=0;e<r.length;e+=1)t.writeByte(r.charCodeAt(e))},t.toByteArray=function(){return r},t.toString=function(){var t="";t+="[";for(var e=0;e<r.length;e+=1)e>0&&(t+=","),t+=r[e];return t+="]"},t},g=function(){var r=0,t=0,e=0,n="",o={},a=function(r){n+=String.fromCharCode(i(63&r))},i=function(r){if(0>r);else{if(26>r)return 65+r;if(52>r)return 97+(r-26);if(62>r)return 48+(r-52);if(62==r)return 43;if(63==r)return 47}throw new Error("n:"+r)};return o.writeByte=function(n){for(r=r<<8|255&n,t+=8,e+=1;t>=6;)a(r>>>t-6),t-=6},o.flush=function(){if(t>0&&(a(r<<6-t),r=0,t=0),e%3!=0)for(var o=3-e%3,i=0;o>i;i+=1)n+="="},o.toString=function(){return n},o},s=function(r){var t=r,e=0,n=0,o=0,a={};a.read=function(){for(;8>o;){if(e>=t.length){if(0==o)return-1;throw new Error("unexpected end of file./"+o)}var r=t.charAt(e);if(e+=1,"="==r)return o=0,-1;r.match(/^\s$/)||(n=n<<6|i(r.charCodeAt(0)),o+=6)}var a=n>>>o-8&255;return o-=8,a};var i=function(r){if(r>=65&&90>=r)return r-65;if(r>=97&&122>=r)return r-97+26;if(r>=48&&57>=r)return r-48+52;if(43==r)return 62;if(47==r)return 63;throw new Error("c:"+r)};return a},v=function(r,t){var e=r,n=t,o=new Array(r*t),a={};a.setPixel=function(r,t,n){o[t*e+r]=n},a.write=function(r){r.writeString("GIF87a"),r.writeShort(e),r.writeShort(n),r.writeByte(128),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(255),r.writeByte(255),r.writeByte(255),r.writeString(","),r.writeShort(0),r.writeShort(0),r.writeShort(e),r.writeShort(n),r.writeByte(0);var t=2,o=u(t);r.writeByte(t);for(var a=0;o.length-a>255;)r.writeByte(255),r.writeBytes(o,a,255),a+=255;r.writeByte(o.length-a),r.writeBytes(o,a,o.length-a),r.writeByte(0),r.writeString(";")};var i=function(r){var t=r,e=0,n=0,o={};return o.write=function(r,o){if(r>>>o!=0)throw new Error("length over");for(;e+o>=8;)t.writeByte(255&(r<<e|n)),o-=8-e,r>>>=8-e,n=0,e=0;n=r<<e|n,e+=o},o.flush=function(){e>0&&t.writeByte(n)},o},u=function(r){for(var t=1<<r,e=(1<<r)+1,n=r+1,a=f(),u=0;t>u;u+=1)a.add(String.fromCharCode(u));a.add(String.fromCharCode(t)),a.add(String.fromCharCode(e));var c=l(),g=i(c);g.write(t,n);var s=0,v=String.fromCharCode(o[s]);for(s+=1;s<o.length;){var h=String.fromCharCode(o[s]);s+=1,a.contains(v+h)?v+=h:(g.write(a.indexOf(v),n),a.size()<4095&&(a.size()==1<<n&&(n+=1),a.add(v+h)),v=h)}return g.write(a.indexOf(v),n),g.write(e,n),g.flush(),c.toByteArray()},f=function(){var r={},t=0,e={};return e.add=function(n){if(e.contains(n))throw new Error("dup key:"+n);r[n]=t,t+=1},e.size=function(){return t},e.indexOf=function(t){return r[t]},e.contains=function(t){return"undefined"!=typeof r[t]},e};return a},h=function(r,t,e,n){for(var o=v(r,t),a=0;t>a;a+=1)for(var i=0;r>i;i+=1)o.setPixel(i,a,e(i,a));var u=l();o.write(u);for(var f=g(),c=u.toByteArray(),s=0;s<c.length;s+=1)f.writeByte(c[s]);f.flush();var h="";return h+="<img",h+=' src="',h+="data:image/gif;base64,",h+=f,h+='"',h+=' width="',h+=r,h+='"',h+=' height="',h+=t,h+='"',n&&(h+=' alt="',h+=n,h+='"'),h+="/>"};return t}();return function(r){"function"==typeof define&&define.amd?define([],r):"object"==typeof exports&&(module.exports=r())}(function(){return r}),!function(r){r.stringToBytes=function(r){function t(r){for(var t=[],e=0;e<r.length;e++){var n=r.charCodeAt(e);128>n?t.push(n):2048>n?t.push(192|n>>6,128|63&n):55296>n||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(e++,n=65536+((1023&n)<<10|1023&r.charCodeAt(e)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}return t(r)}}(r),r}());
 
 
miniorange_2_factor_settings.php CHANGED
@@ -3,13 +3,14 @@
3
  * Plugin Name: miniOrange 2 Factor Authentication
4
  * Plugin URI: https://miniorange.com
5
  * Description: This plugin provides various two-factor authentication methods as an additional layer of security after the default wordpress login. We Support Google/Authy/LastPass Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
6
- * Version: 5.3.6
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
10
  */
11
  define( 'MO_HOST_NAME', 'https://login.xecurify.com' );
12
- define( 'MO2F_VERSION', '5.3.6' );
 
13
  class Miniorange_twoFactor{
14
 
15
  function __construct()
@@ -68,9 +69,17 @@
68
  add_submenu_page( $menu_slug ,'miniOrange 2-Factor' ,'Account' ,'administrator','mo_2fa_account' , array( $this, 'mo_wpns'));
69
  add_submenu_page( $menu_slug ,'miniOrange 2-Factor' ,'Upgrade' ,'administrator','mo_2fa_upgrade' , array( $this, 'mo_wpns'));
70
  }
71
-
 
 
 
 
 
 
 
72
  function mo_wpns()
73
  {
 
74
  global $wpnsDbQueries,$Mo2fdbQueries;
75
  $wpnsDbQueries->mo_plugin_activate();
76
  $Mo2fdbQueries->mo_plugin_activate();
@@ -97,6 +106,7 @@
97
 
98
  function mo_wpns_activate()
99
  {
 
100
  global $wpnsDbQueries,$Mo2fdbQueries;
101
  $wpnsDbQueries->mo_plugin_activate();
102
  $Mo2fdbQueries->mo_plugin_activate();
3
  * Plugin Name: miniOrange 2 Factor Authentication
4
  * Plugin URI: https://miniorange.com
5
  * Description: This plugin provides various two-factor authentication methods as an additional layer of security after the default wordpress login. We Support Google/Authy/LastPass Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
6
+ * Version: 5.3.7
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
10
  */
11
  define( 'MO_HOST_NAME', 'https://login.xecurify.com' );
12
+ define( 'MO2F_VERSION', '5.3.7' );
13
+ define( 'MO2F_TEST_MODE', false );
14
  class Miniorange_twoFactor{
15
 
16
  function __construct()
69
  add_submenu_page( $menu_slug ,'miniOrange 2-Factor' ,'Account' ,'administrator','mo_2fa_account' , array( $this, 'mo_wpns'));
70
  add_submenu_page( $menu_slug ,'miniOrange 2-Factor' ,'Upgrade' ,'administrator','mo_2fa_upgrade' , array( $this, 'mo_wpns'));
71
  }
72
+
73
+ function checkSecurity(){
74
+
75
+ $guestcustomer = new Customer_Setup();
76
+
77
+ $guestcustomer->guest_audit();
78
+ }
79
+
80
  function mo_wpns()
81
  {
82
+ $this->checkSecurity();
83
  global $wpnsDbQueries,$Mo2fdbQueries;
84
  $wpnsDbQueries->mo_plugin_activate();
85
  $Mo2fdbQueries->mo_plugin_activate();
106
 
107
  function mo_wpns_activate()
108
  {
109
+ $this->checkSecurity();
110
  global $wpnsDbQueries,$Mo2fdbQueries;
111
  $wpnsDbQueries->mo_plugin_activate();
112
  $Mo2fdbQueries->mo_plugin_activate();
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://miniorange.com/
6
  Requires at least: 3.0.1
7
  Tested up to: 5.3
8
  Requires PHP: 5.3.0
9
- Stable tag: 5.3.6
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -272,6 +272,9 @@ miniOrange authentication service has 15+ authentication methods.One time passco
272
 
273
  == Changelog ==
274
 
 
 
 
275
  = 5.3.6 =
276
  * Google Authenticator-Two Factor Authentication (2FA) : Anti virus zip file fix.
277
 
@@ -681,6 +684,9 @@ More descriptive setup messages and UI changes.
681
 
682
  == Upgrade Notice ==
683
 
 
 
 
684
  = 5.3.6 =
685
  * Google Authenticator-Two Factor Authentication (2FA) : Anti virus zip file fix.
686
 
6
  Requires at least: 3.0.1
7
  Tested up to: 5.3
8
  Requires PHP: 5.3.0
9
+ Stable tag: 5.3.7
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
272
 
273
  == Changelog ==
274
 
275
+ = 5.3.7 =
276
+ * Google Authenticator-Two Factor Authentication (2FA) : Security : Two factor login with username fix.
277
+
278
  = 5.3.6 =
279
  * Google Authenticator-Two Factor Authentication (2FA) : Anti virus zip file fix.
280
 
684
 
685
  == Upgrade Notice ==
686
 
687
+ = 5.3.6 =
688
+ * Google Authenticator-Two Factor Authentication (2FA) : Security : Two factor login with username fix.
689
+
690
  = 5.3.6 =
691
  * Google Authenticator-Two Factor Authentication (2FA) : Anti virus zip file fix.
692
 
uninstall.php CHANGED
@@ -87,10 +87,11 @@
87
  delete_option('mo_file_backup_themes');
88
  delete_option('mo_file_backup_wp_files');
89
 
90
- delete_option('mo2f_visit_waf');
91
- delete_option('mo2f_visit_login_and_spam');
92
- delete_option('mo2f_visit_malware');
93
- delete_option('mo2f_visit_backup');
 
94
 
95
 
96
  $users = get_users( array() );
87
  delete_option('mo_file_backup_themes');
88
  delete_option('mo_file_backup_wp_files');
89
 
90
+ delete_site_option('mo2f_visit_waf');
91
+ delete_site_option('mo2f_visit_login_and_spam');
92
+ delete_site_option('mo2f_visit_malware');
93
+ delete_site_option('mo2f_visit_backup');
94
+ delete_site_option('mo2f_two_factor');
95
 
96
 
97
  $users = get_users( array() );
views/account/login.php CHANGED
@@ -5,7 +5,7 @@ echo' <form name="f" method="post" action="">
5
  <div class="mo_wpns_divided_layout">
6
  <div class="mo_wpns_setting_layout">
7
  <h3>Login with miniOrange</h3>
8
- <p><b>It seems you already have an account with miniOrange. Please enter your miniOrange email and password.</td><a href="#mo_wpns_forgot_password_link"> Click here if you forgot your password?</a></b></p>
9
  <table class="mo_wpns_settings_table">
10
  <tr>
11
  <td><b><font color="#FF0000">*</font>Email:</b></td>
@@ -27,9 +27,6 @@ echo' <form name="f" method="post" action="">
27
  </div>
28
  </div>
29
  </form>
30
- <form id="forgot_password_form" method="post" action="">
31
- <input type="hidden" name="option" value="mo_wpns_reset_password" />
32
- </form>
33
  <form id="cancel_form" method="post" action="">
34
  <input type="hidden" name="option" value="mo_wpns_cancel" />
35
  </form>
@@ -37,10 +34,6 @@ echo' <form name="f" method="post" action="">
37
  jQuery(document).ready(function(){
38
  $(\'a[href="#cancel_link"]\').click(function(){
39
  $("#cancel_form").submit();
40
- });
41
-
42
- $(\'a[href="#mo_wpns_forgot_password_link"]\').click(function(){
43
- $("#forgot_password_form").submit();
44
- });
45
  });
46
  </script>';
5
  <div class="mo_wpns_divided_layout">
6
  <div class="mo_wpns_setting_layout">
7
  <h3>Login with miniOrange</h3>
8
+ <p><b>It seems you already have an account with miniOrange. Please enter your miniOrange email and password.</td><a target="_blank" href="https://login.xecurify.com/moas/idp/resetpassword"> Click here if you forgot your password?</a></b></p>
9
  <table class="mo_wpns_settings_table">
10
  <tr>
11
  <td><b><font color="#FF0000">*</font>Email:</b></td>
27
  </div>
28
  </div>
29
  </form>
 
 
 
30
  <form id="cancel_form" method="post" action="">
31
  <input type="hidden" name="option" value="mo_wpns_cancel" />
32
  </form>
34
  jQuery(document).ready(function(){
35
  $(\'a[href="#cancel_link"]\').click(function(){
36
  $("#cancel_form").submit();
37
+ });
 
 
 
 
38
  });
39
  </script>';