作者 曹东东
正在显示 34 个修改的文件 包含 3516 行增加 和 373 行删除

要显示太多修改。

为保证性能只显示 34 of 34+ 个文件。

1 -/application/common/controller/Frontend.php  
2 /nbproject/ 1 /nbproject/
3 /runtime/* 2 /runtime/*
4 /public/uploads/* 3 /public/uploads/*
@@ -16,8 +16,16 @@ use PhpOffice\PhpSpreadsheet\Style\Color; @@ -16,8 +16,16 @@ use PhpOffice\PhpSpreadsheet\Style\Color;
16 use PhpOffice\PhpSpreadsheet\Style\Alignment; 16 use PhpOffice\PhpSpreadsheet\Style\Alignment;
17 use PhpOffice\PhpSpreadsheet\Style\Border; 17 use PhpOffice\PhpSpreadsheet\Style\Border;
18 use PhpOffice\PhpSpreadsheet\Style\NumberFormat; 18 use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
  19 +use Endroid\QrCode\QrCode;
  20 +use Upyun\Upyun;
19 21
20 - 22 +function isWechat(){
  23 + if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) {
  24 + return true;
  25 + } else {
  26 + return false;
  27 + }
  28 +}
21 29
22 30
23 function isInArray($str , $arr){ 31 function isInArray($str , $arr){
@@ -1205,6 +1213,77 @@ if (!function_exists('cut_str')) { @@ -1205,6 +1213,77 @@ if (!function_exists('cut_str')) {
1205 } 1213 }
1206 1214
1207 1215
  1216 + /**
  1217 + * 生成二维码
  1218 + * @params $link 二维码地址
  1219 + * @params $fileName 文件名称
  1220 + * @params $size 大小
  1221 + */
  1222 + function mk_Qrcode($link,$fileName,$size = 120)
  1223 + {
  1224 +
  1225 + $file_name = $_SERVER['DOCUMENT_ROOT'].'/uploads/'.$fileName .'.png';
  1226 + $qrCode = new QrCode($link);
  1227 + //设置前景色
  1228 + $qrCode->setForegroundColor(['r' => 0, 'g' => 0, 'b' =>0, 'a' => 0]);
  1229 + //设置背景色
  1230 + $qrCode->setBackgroundColor(['r' => 250, 'g' => 255, 'b' => 255, 'a' => 10]);
  1231 + //设置二维码大小
  1232 + $qrCode->setSize($size);
  1233 +
  1234 + try {
  1235 + $qrCode->writeFile($file_name);
  1236 + } catch (\Exception $e) {
  1237 + return false;
  1238 + }
  1239 + return $file_name;
  1240 + }
  1241 +
  1242 + function upyun_upload($uploadFilePath){
  1243 + $config = get_addon_config('upyun');
  1244 + //创建的服务的名称
  1245 + $serviceName = $config['bucket'];
  1246 + //操作员账号 $config['operator']
  1247 + $operator = "zhaoyang";
  1248 + //操作员密码
  1249 + $password = "Lxq0ykCsvZ6q7abFfvzw51QmcxgOxr3B";
  1250 + //要上传目录
  1251 + $directory = 'signature/';
  1252 + //上传文件名,对象存储其实就是一个key value的存储结构。
  1253 + $key = basename($uploadFilePath);
  1254 + //又拍云默认域名
  1255 + $defaultDomain = $config['cdnurl'];
  1256 + //在对象存储中,其实并没有实际意义上的"目录"(或者叫"文件夹"),整个文件夹和最后的key一起,组成的一个整体也是key
  1257 + if($directory){
  1258 + //真正使用时,$directory可能是用户传过来的,在不知道用户是否写了右斜杠的情况下,统一先去掉再添加一个
  1259 + $key = rtrim($directory, '/') . '/' . $key;
  1260 + }
  1261 +
  1262 + //使用又拍云php-sdk上传文件非常方便,很new一个config对象
  1263 + $serviceConfig = new \Upyun\Config($serviceName, $operator, $password);
  1264 + // 15728640 = 15M,如果文件大于15M,则使用并行分块上传
  1265 + if(filesize($uploadFilePath) > 15728640){
  1266 + /* uploadType有两个值
  1267 + - BLOCK : 串行分块上传
  1268 + - BLOCK_PARALLEL : 并行分块上传
  1269 + */
  1270 + //然后可对new出的config对象的属性继续设置参数(有哪些参数可直接查看Config类: vendor/upyun/sdk/src/Upyun/Config.php)
  1271 + //设置uploadType=BLOCK_PARALLEL表示使用并行分片上传
  1272 + $serviceConfig->uploadType = 'BLOCK_PARALLEL';
  1273 + }
  1274 + $client = new Upyun($serviceConfig);
  1275 + $fp = fopen($uploadFilePath, 'rb');
  1276 + $retArr = $client->write($key, $fp);
  1277 +
  1278 + //随便拿一个元素来判断是否上传成功
  1279 + if(isset($retArr['x-upyun-content-length'])){
  1280 + //在实际使用中,$key可能是用户传过来的,在不知道$key是否以斜杠开头的情况下,统一先去掉再自己添加一个
  1281 + return $defaultDomain . '/' . ltrim($key);
  1282 + }else{
  1283 + return false;
  1284 + }
  1285 + }
  1286 +
1208 1287
1209 1288
1210 } 1289 }
  1 +<?php
  2 +
  3 +namespace app\common\controller;
  4 +
  5 +use app\common\library\Auth;
  6 +use app\school\model\ManystoreShop;
  7 +use think\Config;
  8 +use think\Controller;
  9 +use think\Hook;
  10 +use think\Lang;
  11 +use think\Loader;
  12 +use think\Route;
  13 +use think\Validate;
  14 +
  15 +/**
  16 + * 前台控制器基类
  17 + */
  18 +class Frontend extends Controller
  19 +{
  20 +
  21 + /**
  22 + * 布局模板
  23 + * @var string
  24 + */
  25 + protected $layout = '';
  26 + /**
  27 + * 无需登录的方法,同时也就不需要鉴权了
  28 + * @var array
  29 + */
  30 + protected $noNeedLogin = [];
  31 +
  32 + /**
  33 + * 无需鉴权的方法,但需要登录
  34 + * @var array
  35 + */
  36 + protected $noNeedRight = [];
  37 +
  38 + /**
  39 + * 权限Auth
  40 + * @var Auth
  41 + */
  42 + protected $auth = null;
  43 +
  44 + protected $education = ['0'=>'学前','1'=>'小学','2'=>'初中','3'=>'高中','4'=>'中专','5'=>'大专','6'=>'本科','7'=>'硕士','8'=>'博士'];
  45 + protected $degree = [ 0 => '学士', 1 => '硕士', 2 => '博士'];
  46 + protected $position = [ 0 => '助教', 1 => '讲师', 2 => '副教授', 3 => '教授',4 => '副研究员' ];
  47 + protected $school_id = null;
  48 +
  49 + protected $schoolInfo = [];
  50 + public function _initialize()
  51 + {
  52 +
  53 +
  54 +
  55 + //移除HTML标签
  56 + $this->request->filter('trim,strip_tags,htmlspecialchars');
  57 + $modulename = $this->request->module();
  58 + $controllername = Loader::parseName($this->request->controller());
  59 + $actionname = strtolower($this->request->action());
  60 + //dump(Route::getGroup('project'));
  61 + //list($a,$b,$c) = request()->routeInfo()['rule'];
  62 + // 如果有使用模板布局
  63 + if ($this->layout) {
  64 + $this->view->engine->layout('layout/' . $this->layout);
  65 + }
  66 + $this->auth = Auth::instance();
  67 +
  68 +
  69 +
  70 + $domains = explode('.',$_SERVER ['HTTP_HOST']);
  71 +
  72 + unset($domains[count($domains)-1]);
  73 +
  74 + if (count($domains) <= 2 || count($domains) > 3){
  75 + header("HTTP/1.1 404 Not Found");
  76 + header("Status: 404 Not Found");
  77 + exit;
  78 + }
  79 +
  80 + list($three , $sec , $first) = $domains;
  81 +
  82 + $school = ManystoreShop::where('subdomain_name',$three)->find();
  83 + if (!$school || $school['status'] != 1){
  84 + header("HTTP/1.1 404 Not Found");
  85 + header("Status: 404 Not Found");
  86 + exit;
  87 + }
  88 + $this->school_id = $school['id'];
  89 + $this->schoolInfo = $school;
  90 + $this->assign('schoolInfo',$this->schoolInfo);
  91 +
  92 + /* $school = ManystoreShop::get(5);
  93 + $this->school_id = $school['id'];
  94 + $this->assign('schoolInfo',$school);*/
  95 + // token
  96 + $token = $this->request->server('HTTP_TOKEN', $this->request->request('token', \think\Cookie::get('token')));
  97 +
  98 + $path = str_replace('.', '/', $controllername) . '/' . $actionname;
  99 + // 设置当前请求的URI
  100 + $this->auth->setRequestUri($path);
  101 + // 检测是否需要验证登录
  102 + if (!$this->auth->match($this->noNeedLogin)) {
  103 + //初始化
  104 + $this->auth->init($token);
  105 + //检测是否登录
  106 + if (!$this->auth->isLogin()) {
  107 + $this->redirect('index/student_login/index');
  108 + }
  109 + // 判断是否需要验证权限
  110 + if (!$this->auth->match($this->noNeedRight)) {
  111 + // 判断控制器和方法判断是否有对应权限
  112 + if (!$this->auth->check($path)) {
  113 + $this->error(__('You have no permission'));
  114 + }
  115 + }
  116 + } else {
  117 + // 如果有传递token才验证是否登录状态
  118 + if ($token) {
  119 + $this->auth->init($token);
  120 + }
  121 + }
  122 + $this->view->assign('user', $this->auth->getUser());
  123 +
  124 + // 语言检测
  125 + $lang = strip_tags($this->request->langset());
  126 +
  127 + $site = Config::get("site");
  128 +
  129 + $upload = \app\common\model\Config::upload();
  130 +
  131 + // 上传信息配置后
  132 + Hook::listen("upload_config_init", $upload);
  133 +
  134 + $mark = '[游客]';
  135 + if ($this->auth->isLogin()){
  136 + $mark = "[{$this->auth->nickname}]";
  137 + }
  138 + $upload['mark'] = $mark;
  139 + // 配置信息
  140 + $config = [
  141 + 'site' => array_intersect_key($site, array_flip(['name', 'cdnurl', 'version', 'timezone', 'languages'])),
  142 + 'upload' => $upload,
  143 + 'modulename' => $modulename,
  144 + 'controllername' => $controllername,
  145 + 'actionname' => $actionname,
  146 + 'jsname' => 'frontend/' . str_replace('.', '/', $controllername),
  147 + 'moduleurl' => rtrim(url("/{$modulename}", '', false), '/'),
  148 + 'language' => $lang
  149 + ];
  150 + $config = array_merge($config, Config::get("view_replace_str"));
  151 +
  152 + Config::set('upload', array_merge(Config::get('upload'), $upload));
  153 + // 配置信息后
  154 + Hook::listen("config_init", $config);
  155 + $userInfo = $this->auth->getUser();
  156 + $this->assign('userInfo',$userInfo);
  157 + // 加载当前控制器语言包
  158 + $this->loadlang($controllername);
  159 + $this->assign('site', $site);
  160 + $this->assign('config', $config);
  161 + }
  162 +
  163 + /**
  164 + * 加载语言文件
  165 + * @param string $name
  166 + */
  167 + protected function loadlang($name)
  168 + {
  169 + $name = Loader::parseName($name);
  170 + Lang::load(APP_PATH . $this->request->module() . '/lang/' . $this->request->langset() . '/' . str_replace('.', '/', $name) . '.php');
  171 + }
  172 +
  173 + /**
  174 + * 渲染配置信息
  175 + * @param mixed $name 键名或数组
  176 + * @param mixed $value 值
  177 + */
  178 + protected function assignconfig($name, $value = '')
  179 + {
  180 + $this->view->config = array_merge($this->view->config ? $this->view->config : [], is_array($name) ? $name : [$name => $value]);
  181 + }
  182 +
  183 + /**
  184 + * 刷新Token
  185 + */
  186 + protected function token()
  187 + {
  188 + $token = $this->request->param('__token__');
  189 +
  190 + //验证Token
  191 + if (!Validate::make()->check(['__token__' => $token], ['__token__' => 'require|token'])) {
  192 + $this->error(__('Token verification error'), '', ['__token__' => $this->request->token()]);
  193 + }
  194 +
  195 + //刷新Token
  196 + $this->request->token();
  197 + }
  198 +}
@@ -231,7 +231,10 @@ class Auth @@ -231,7 +231,10 @@ class Auth
231 231
232 //直接登录会员 232 //直接登录会员
233 $this->direct($user->id); 233 $this->direct($user->id);
234 - 234 + if (!$user->open_id && $open_id = session("open_id")){
  235 + $user->open_id = $open_id;
  236 + $user->save();
  237 + }
235 return true; 238 return true;
236 } 239 }
237 240
@@ -8,9 +8,12 @@ use app\common\model\TemplateView; @@ -8,9 +8,12 @@ use app\common\model\TemplateView;
8 use app\school\model\basic\Teacher; 8 use app\school\model\basic\Teacher;
9 use app\school\model\content\Newscategory; 9 use app\school\model\content\Newscategory;
10 use app\school\model\ManystoreShop; 10 use app\school\model\ManystoreShop;
  11 +use EasyWeChat\Factory;
  12 +use Overtrue\Socialite\AuthorizeFailedException;
11 use think\Config; 13 use think\Config;
12 use think\Cookie; 14 use think\Cookie;
13 use think\Db; 15 use think\Db;
  16 +use think\Exception;
14 use think\Request; 17 use think\Request;
15 18
16 class Index extends Frontend 19 class Index extends Frontend
@@ -73,7 +76,25 @@ class Index extends Frontend @@ -73,7 +76,25 @@ class Index extends Frontend
73 $this->assign('elegant_product',$elegant_product); 76 $this->assign('elegant_product',$elegant_product);
74 $this->assign('links',$links); 77 $this->assign('links',$links);
75 $this->view->assign('index',$index='foot');//首页隐藏头部使用 78 $this->view->assign('index',$index='foot');//首页隐藏头部使用
76 - return $this->view->fetch("/index/school/{$this->template}"); 79 +
  80 + if (isWechat()){
  81 + $config = [
  82 + 'app_id' => 'wx401d047673f1c578',
  83 + 'secret' => '2f99955f1964d30d6e962c345c268274',
  84 + 'response_type' => 'array',
  85 + ];
  86 + $app = Factory::officialAccount($config);
  87 + try {
  88 + $oauth = $app->oauth;
  89 + $user = $oauth->user();
  90 + session("open_id",$user->id);
  91 + }catch (AuthorizeFailedException $e){
  92 + $response = $app->oauth->scopes(['snsapi_userinfo'])
  93 + ->redirect($this->request->domain());
  94 + $response->send();
  95 + }
  96 + }
  97 + return $this->view->fetch("/index/school/{$this->template}");
77 } 98 }
78 99
79 // 导师风采 100 // 导师风采
@@ -107,11 +128,11 @@ class Index extends Frontend @@ -107,11 +128,11 @@ class Index extends Frontend
107 $this->assign("list",$list); 128 $this->assign("list",$list);
108 $this->assign("text",$text); 129 $this->assign("text",$text);
109 $this->assign("page",$page); 130 $this->assign("page",$page);
110 - $this->view->assign('index',$index='foot');//首页隐藏头部使用 131 + $this->view->assign('index',$index='foot');//首页隐藏头部使用
111 return $this->fetch(); 132 return $this->fetch();
112 } 133 }
113 - // 教师团队详情页  
114 - public function teacher_detail(){ 134 + // 教师团队详情页
  135 + public function teacher_detail(){
115 $param = $this->request->param(); 136 $param = $this->request->param();
116 $teacherObj = new Teacher(); 137 $teacherObj = new Teacher();
117 138
@@ -142,26 +163,26 @@ class Index extends Frontend @@ -142,26 +163,26 @@ class Index extends Frontend
142 $this->assign("type",$param['type']); 163 $this->assign("type",$param['type']);
143 $this->assign("info",$info); 164 $this->assign("info",$info);
144 $this->assign("text",$text); 165 $this->assign("text",$text);
145 - $this->view->assign('index',$index='foot');//首页隐藏头部使用  
146 - return $this->fetch();  
147 - }  
148 - //创意产品展  
149 - public function exhibition(){ 166 + $this->view->assign('index',$index='foot');//首页隐藏头部使用
  167 + return $this->fetch();
  168 + }
  169 + //创意产品展
  170 + public function exhibition(){
150 $elegant_list = Db::name("elegant")->where("school_id", $this->school_id)->where('type',2)->paginate(10,false,['param'=>request()->param()]); 171 $elegant_list = Db::name("elegant")->where("school_id", $this->school_id)->where('type',2)->paginate(10,false,['param'=>request()->param()]);
151 $this->assign("list",$elegant_list); 172 $this->assign("list",$elegant_list);
152 - $this->view->assign('index',$index='foot');//首页隐藏头部使用  
153 - return $this->fetch();  
154 - }  
155 - // 创意作品展详情  
156 - public function exhibition_detail($id=0){ 173 + $this->view->assign('index',$index='foot');//首页隐藏头部使用
  174 + return $this->fetch();
  175 + }
  176 + // 创意作品展详情
  177 + public function exhibition_detail($id=0){
157 Db::name("elegant")->where("elegant_id", $id)->setInc("visits_count"); 178 Db::name("elegant")->where("elegant_id", $id)->setInc("visits_count");
158 $info = Db::name("elegant")->where("elegant_id", $id)->find(); 179 $info = Db::name("elegant")->where("elegant_id", $id)->find();
159 $this->assign("info",$info); 180 $this->assign("info",$info);
160 - $this->view->assign('index',$index='foot');//首页隐藏头部使用  
161 - return $this->fetch();  
162 - }  
163 - //风云榜  
164 - public function event_list(){ 181 + $this->view->assign('index',$index='foot');//首页隐藏头部使用
  182 + return $this->fetch();
  183 + }
  184 + //风云榜
  185 + public function event_list(){
165 $page= null; 186 $page= null;
166 $uid = Cookie::get("uid"); 187 $uid = Cookie::get("uid");
167 $elegant_list = Db::name("elegant")->where("school_id", $this->school_id)->where('type',1)->paginate(3,false,['param'=>request()->param()]); 188 $elegant_list = Db::name("elegant")->where("school_id", $this->school_id)->where('type',1)->paginate(3,false,['param'=>request()->param()]);
@@ -177,11 +198,11 @@ class Index extends Frontend @@ -177,11 +198,11 @@ class Index extends Frontend
177 $page = $elegant_list->render(); 198 $page = $elegant_list->render();
178 $this->assign("page",$page); 199 $this->assign("page",$page);
179 $this->assign("elegant_person",$elegant_list); 200 $this->assign("elegant_person",$elegant_list);
180 - $this->view->assign('index',$index='foot');//首页隐藏头部使用  
181 - return $this->fetch();  
182 - }  
183 - //风云榜详情  
184 - public function event_detail($id=0){ 201 + $this->view->assign('index',$index='foot');//首页隐藏头部使用
  202 + return $this->fetch();
  203 + }
  204 + //风云榜详情
  205 + public function event_detail($id=0){
185 $uid = Cookie::get("uid"); 206 $uid = Cookie::get("uid");
186 Db::name("elegant")->where("elegant_id", $id)->setInc("visits_count",1); 207 Db::name("elegant")->where("elegant_id", $id)->setInc("visits_count",1);
187 $info = Db::name("elegant")->where("elegant_id", $id)->find(); 208 $info = Db::name("elegant")->where("elegant_id", $id)->find();
@@ -191,11 +212,11 @@ class Index extends Frontend @@ -191,11 +212,11 @@ class Index extends Frontend
191 // $info_['bio'] = $user['bio']; 212 // $info_['bio'] = $user['bio'];
192 // $info = array_merge($info,$info_); 213 // $info = array_merge($info,$info_);
193 $this->assign("info",$info); 214 $this->assign("info",$info);
194 - $this->view->assign('index',$index='foot');//首页隐藏头部使用  
195 - return $this->fetch();  
196 - } 215 + $this->view->assign('index',$index='foot');//首页隐藏头部使用
  216 + return $this->fetch();
  217 + }
197 218
198 - public function getBasedisplay(){ 219 + public function getBasedisplay(){
199 $param = $this->request->param(); 220 $param = $this->request->param();
200 $baseDisplay = Db::name("base_display")->where("school_id", $this->school_id)->where("category_id",$param['category_id'])->limit(3)->select(); 221 $baseDisplay = Db::name("base_display")->where("school_id", $this->school_id)->where("category_id",$param['category_id'])->limit(3)->select();
201 $data['data'] = $baseDisplay; 222 $data['data'] = $baseDisplay;
@@ -210,33 +231,33 @@ class Index extends Frontend @@ -210,33 +231,33 @@ class Index extends Frontend
210 $this->success('','',$data); 231 $this->success('','',$data);
211 } 232 }
212 233
213 - //学校简介  
214 - public function college_profile(){ 234 + //学校简介
  235 + public function college_profile(){
215 $schoolInfo = ManystoreShop::get($this->school_id); 236 $schoolInfo = ManystoreShop::get($this->school_id);
216 $this->view->assign('schoolinfo',$schoolInfo); 237 $this->view->assign('schoolinfo',$schoolInfo);
217 - $this->view->assign('index',$index='foot');//首页隐藏头部使用  
218 - return $this->fetch();  
219 - }  
220 - //组织架构  
221 - public function organizational(){ 238 + $this->view->assign('index',$index='foot');//首页隐藏头部使用
  239 + return $this->fetch();
  240 + }
  241 + //组织架构
  242 + public function organizational(){
222 $schoolInfo = ManystoreShop::get($this->school_id); 243 $schoolInfo = ManystoreShop::get($this->school_id);
223 $this->view->assign('schoolinfo',$schoolInfo); 244 $this->view->assign('schoolinfo',$schoolInfo);
224 - $this->view->assign('index',$index='foot');//首页隐藏头部使用  
225 - return $this->fetch();  
226 - }  
227 - //政策制度  
228 - public function policy_system(){ 245 + $this->view->assign('index',$index='foot');//首页隐藏头部使用
  246 + return $this->fetch();
  247 + }
  248 + //政策制度
  249 + public function policy_system(){
229 250
230 - $this->view->assign('index',$index='foot');//首页隐藏头部使用  
231 - return $this->fetch();  
232 - }  
233 - //政策详情  
234 - public function policy_detail(){  
235 - $this->view->assign('index',$index='foot');//首页隐藏头部使用  
236 - return $this->fetch();  
237 - } 251 + $this->view->assign('index',$index='foot');//首页隐藏头部使用
  252 + return $this->fetch();
  253 + }
  254 + //政策详情
  255 + public function policy_detail(){
  256 + $this->view->assign('index',$index='foot');//首页隐藏头部使用
  257 + return $this->fetch();
  258 + }
238 259
239 - public function Ilike_elegant(){ 260 + public function Ilike_elegant(){
240 $uid = Cookie::get("uid"); 261 $uid = Cookie::get("uid");
241 if(empty($uid)){ 262 if(empty($uid)){
242 $this->error("请登录",url('student_login/index')); 263 $this->error("请登录",url('student_login/index'));
@@ -17,6 +17,8 @@ use think\Collection; @@ -17,6 +17,8 @@ use think\Collection;
17 use think\Db; 17 use think\Db;
18 use think\Exception; 18 use think\Exception;
19 use app\school\model\basic\User; 19 use app\school\model\basic\User;
  20 +use Endroid\QrCode\QrCode;
  21 +use think\Request;
20 22
21 class SignupInfo extends Frontend 23 class SignupInfo extends Frontend
22 { 24 {
@@ -234,7 +236,6 @@ class SignupInfo extends Frontend @@ -234,7 +236,6 @@ class SignupInfo extends Frontend
234 $containerId = $params['container_id']; 236 $containerId = $params['container_id'];
235 $registerId = $params['register_id']; 237 $registerId = $params['register_id'];
236 $projectTypeId = $params['project_type_id']; 238 $projectTypeId = $params['project_type_id'];
237 -  
238 //比赛信息 239 //比赛信息
239 $ProjectRegister = new ProjectRegister(); 240 $ProjectRegister = new ProjectRegister();
240 $container = ProjectContainer::get($containerId); 241 $container = ProjectContainer::get($containerId);
@@ -471,6 +472,7 @@ class SignupInfo extends Frontend @@ -471,6 +472,7 @@ class SignupInfo extends Frontend
471 $register_id = false; 472 $register_id = false;
472 //details表存的信息 473 //details表存的信息
473 $detailsAll = $params['form']; 474 $detailsAll = $params['form'];
  475 +
474 try { 476 try {
475 $register_id = Db::transaction(function () use ($regArr , $detailsAll , $ProjectRegister,$newStudentArr,$teacherArr,$registerId,$containerId,$rateFlg){ 477 $register_id = Db::transaction(function () use ($regArr , $detailsAll , $ProjectRegister,$newStudentArr,$teacherArr,$registerId,$containerId,$rateFlg){
476 if ($detailsAll){ 478 if ($detailsAll){
@@ -483,7 +485,21 @@ class SignupInfo extends Frontend @@ -483,7 +485,21 @@ class SignupInfo extends Frontend
483 $ProjectRegister->allowField(true)->save($regArr); 485 $ProjectRegister->allowField(true)->save($regArr);
484 $did = Db::name('project_register_details')->insertGetId(['project_details'=>json_encode($detailsAll)]); 486 $did = Db::name('project_register_details')->insertGetId(['project_details'=>json_encode($detailsAll)]);
485 $ProjectRegister->project_details = $did; 487 $ProjectRegister->project_details = $did;
  488 +
  489 + //非更新数据 生成审核二维码
  490 + $link = request()->domain().'/teacher/ajax/canvas?id='.$ProjectRegister->id;
  491 + $qrUrl = mk_Qrcode($link,$ProjectRegister->id.'_register');
  492 + if(!$qrUrl) {
  493 + \exception('提交失败,请重试');
  494 + }
  495 + $qr_code = upyun_upload($qrUrl);
  496 +
  497 + if(!$qr_code) {
  498 + \exception('提交失败,请重试');
  499 + }
  500 + $ProjectRegister->qr_code = $qr_code;
486 $ProjectRegister->save(); 501 $ProjectRegister->save();
  502 + unlink($qrUrl);
487 }else{ 503 }else{
488 $ProjectRegister->allowField(true)->isUpdate(true,['id' => $registerId])->save($regArr); 504 $ProjectRegister->allowField(true)->isUpdate(true,['id' => $registerId])->save($regArr);
489 $p = $ProjectRegister->find($registerId); 505 $p = $ProjectRegister->find($registerId);
@@ -144,6 +144,12 @@ @@ -144,6 +144,12 @@
144 .col-md-9{ 144 .col-md-9{
145 margin-top: 30px; 145 margin-top: 30px;
146 } 146 }
  147 + .verify {
  148 + position: absolute;
  149 + right: 25px;
  150 + top:0px;
  151 + border:2px solid #E5A0A9;
  152 + }
147 </style> 153 </style>
148 <div class="rotation"> 154 <div class="rotation">
149 <img src="__CDN__/assets/img/teacherRotation.png" /> 155 <img src="__CDN__/assets/img/teacherRotation.png" />
@@ -173,6 +179,11 @@ @@ -173,6 +179,11 @@
173 <p style="margin: 0;">{$vo.container_name}</p> 179 <p style="margin: 0;">{$vo.container_name}</p>
174 </div> 180 </div>
175 <div class="program"> 181 <div class="program">
  182 + {if $vo.review_stage == 0 && $vo.project_approval_status == 0 && $vo.qr_code}
  183 + <div class="verify">
  184 + <a title="教师审核二维码" href="javascript:;" id="qr_code"><img src="{$vo.qr_code}" width="75" height="75" ></a>
  185 + </div>
  186 + {/if}
176 <div class="pic"> 187 <div class="pic">
177 <text class="iconfont" style="font-size: 1.5rem;">&#xe617;</text> 188 <text class="iconfont" style="font-size: 1.5rem;">&#xe617;</text>
178 <text class="center "> 189 <text class="center ">
@@ -200,7 +211,9 @@ @@ -200,7 +211,9 @@
200 <p class="program_intro">{$vo.project_des}</p> 211 <p class="program_intro">{$vo.project_des}</p>
201 <p class="program_time iconfont">&#xe611;&nbsp;{$vo.name}</p> 212 <p class="program_time iconfont">&#xe611;&nbsp;{$vo.name}</p>
202 </div> 213 </div>
  214 +
203 </div> 215 </div>
  216 +
204 <p class="title2">项目信息 <a style="float: right; margin: 10px 10px 0px 0px;" class="btn btn-success btn-xs" href="javascript:;">{if $vo.is_captain == 2}队长{else/}队员{/if}</a></p> 217 <p class="title2">项目信息 <a style="float: right; margin: 10px 10px 0px 0px;" class="btn btn-success btn-xs" href="javascript:;">{if $vo.is_captain == 2}队长{else/}队员{/if}</a></p>
205 <div class="program_info"> 218 <div class="program_info">
206 <table border="0" cellspacing="0" cellpadding="2rem"> 219 <table border="0" cellspacing="0" cellpadding="2rem">
@@ -344,6 +357,8 @@ @@ -344,6 +357,8 @@
344 </td> 357 </td>
345 </tr> 358 </tr>
346 </table> 359 </table>
  360 +
  361 +
347 </div> 362 </div>
348 {/foreach} 363 {/foreach}
349 364
@@ -357,3 +372,4 @@ @@ -357,3 +372,4 @@
357 </div> 372 </div>
358 </div> 373 </div>
359 </div> 374 </div>
  375 +
@@ -13,6 +13,7 @@ use think\Cache; @@ -13,6 +13,7 @@ use think\Cache;
13 use think\Config; 13 use think\Config;
14 use think\Db; 14 use think\Db;
15 use think\Lang; 15 use think\Lang;
  16 +use Upyun\Upyun;
16 17
17 /** 18 /**
18 * Ajax异步请求接口 19 * Ajax异步请求接口
@@ -21,7 +22,7 @@ use think\Lang; @@ -21,7 +22,7 @@ use think\Lang;
21 class Ajax extends TeacherBase 22 class Ajax extends TeacherBase
22 { 23 {
23 24
24 - protected $noNeedLogin = ['lang']; 25 + protected $noNeedLogin = ['lang','canvas','upyun_upload'];
25 protected $noNeedRight = ['*']; 26 protected $noNeedRight = ['*'];
26 protected $layout = ''; 27 protected $layout = '';
27 28
@@ -305,4 +306,121 @@ class Ajax extends TeacherBase @@ -305,4 +306,121 @@ class Ajax extends TeacherBase
305 } 306 }
306 } 307 }
307 308
  309 + //手写签名板
  310 + public function canvas(){
  311 + $id = input('id');
  312 + if ($this->request->isPost()){
  313 + if (!$id) $this->error('用户数据异常');
  314 + $teacher_id = $this->auth['id'];
  315 + $detail = Db::table('fa_project_register')->where(['review_stage' => 0,'project_approval_status' => 0,'item_id' => $id])->find();
  316 + if (!$detail) $this->error('项目数据异常');
  317 + //判断是否是审核成员
  318 + $member_ids = Db::table('fa_members')
  319 + ->alias('m')
  320 +// ->field('m.container_id,m.member_id')
  321 +// ->join('fa_project_register p','m.container_id = p.container_id and m.item_id = p.id','LEFT')
  322 + ->where(['m.member_type' => 2 ,'m.member_source' => 2,'m.item_id' => $id])
  323 + ->column('member_id');
  324 + if (!in_array($teacher_id,$member_ids)) $this->error('当前用户不是该项目审核人员');
  325 + $opinion = input('opinion');//意见
  326 + $type = input('type');//审核 1:通过 2:退回
  327 + $imgbase64 = input('imgbase64');
  328 + $file_url = '';
  329 + //图片上传
  330 + if (preg_match('/^(data:\s*image\/(\w+);base64,)/',$imgbase64,$result)){
  331 + $type = $result[2];//图片后缀
  332 + $new_file = ROOT_PATH . DS . 'public' . DS . 'signature' . DS ;
  333 + $url = 'upload/'. date("Ymd", time()) . "/";
  334 + $new_file = $new_file . $url;
  335 + if (!file_exists($new_file)) {
  336 + //检查是否有该文件夹,如果没有就创建,并给予最高权限
  337 + mkdir($new_file, 0777,true);
  338 + }
  339 + $filename = time() . '_' . uniqid() . ".{$type}"; //文件名
  340 + $new_file = $new_file . $filename;
  341 +
  342 + //写入操作
  343 + if(file_put_contents($new_file, base64_decode(str_replace($result[1], '', $imgbase64)))) {
  344 + $file_url = $this->upyun_upload($new_file);
  345 + }
  346 + }
  347 + //通过:project_approval_status => 1 退回:project_status => 2
  348 +
  349 + $data['signature_url'] = $file_url;
  350 + $data['updatetime'] = time();
  351 + if ($type == 2){
  352 + $data['project_status'] = 2;
  353 + $msg = '退回';
  354 + }else{
  355 + $data['project_approval_status'] = 1;
  356 + $msg = '通过';
  357 + }
  358 + Db::table("fa_project_register")->where('id',$id)->update($data);
  359 + //fa_register_log project_type_name => fa_project_register.project_type--fa_project_type
  360 + $log['register_id'] = $id;
  361 + $log['container_id'] = $detail['container_id'];
  362 + $log['school_id'] = $this->auth['school_id'];
  363 + $log['project_college'] = Db::table('fa_college')->where('id',$detail['project_college'])->value('college_name');
  364 + $log['teacher_id'] = $teacher_id;
  365 + $log['type'] = 'teacher';
  366 + $log['verify_stage'] = 0;
  367 + $log['project_name'] = $detail['project_name'];
  368 + $log['project_type'] = $detail['project_type'];
  369 + $log['project_type_name'] = Db::table('fa_project_type')->where('id',$detail['project_type'])->value('name');
  370 + $log['created_time'] = datetime('Y-m-d H:i:s',time());
  371 + $log['teacher_name'] = $this->auth['teacher_name'];
  372 + $log['job_num'] = $this->auth['job_num'];
  373 + $log['operation'] = '项目审核' . $msg;
  374 + $log['memo'] = '项目审核';
  375 + Db::table("fa_register_log")->insert($log);
  376 + $this->success('操作成功',$file_url);
  377 + }
  378 + $this->view->assign('id',$id);
  379 + return $this->fetch('');
  380 + }
  381 +
  382 + function upyun_upload($uploadFilePath){
  383 + $config = get_addon_config('upyun');
  384 + //创建的服务的名称
  385 + $serviceName = $config['bucket'];
  386 + //操作员账号 $config['operator']
  387 + $operator = "zhaoyang";
  388 + //操作员密码
  389 + $password = "Lxq0ykCsvZ6q7abFfvzw51QmcxgOxr3B";
  390 + //要上传目录
  391 + $directory = 'signature/';
  392 + //上传文件名,对象存储其实就是一个key value的存储结构。
  393 + $key = basename($uploadFilePath);
  394 + //又拍云默认域名
  395 + $defaultDomain = $config['cdnurl'];
  396 + //在对象存储中,其实并没有实际意义上的"目录"(或者叫"文件夹"),整个文件夹和最后的key一起,组成的一个整体也是key
  397 + if($directory){
  398 + //真正使用时,$directory可能是用户传过来的,在不知道用户是否写了右斜杠的情况下,统一先去掉再添加一个
  399 + $key = rtrim($directory, '/') . '/' . $key;
  400 + }
  401 +
  402 + //使用又拍云php-sdk上传文件非常方便,很new一个config对象
  403 + $serviceConfig = new \Upyun\Config($serviceName, $operator, $password);
  404 + // 15728640 = 15M,如果文件大于15M,则使用并行分块上传
  405 + if(filesize($uploadFilePath) > 15728640){
  406 + /* uploadType有两个值
  407 + - BLOCK : 串行分块上传
  408 + - BLOCK_PARALLEL : 并行分块上传
  409 + */
  410 + //然后可对new出的config对象的属性继续设置参数(有哪些参数可直接查看Config类: vendor/upyun/sdk/src/Upyun/Config.php)
  411 + //设置uploadType=BLOCK_PARALLEL表示使用并行分片上传
  412 + $serviceConfig->uploadType = 'BLOCK_PARALLEL';
  413 + }
  414 + $client = new Upyun($serviceConfig);
  415 + $fp = fopen($uploadFilePath, 'rb');
  416 + $retArr = $client->write($key, $fp);
  417 +
  418 + //随便拿一个元素来判断是否上传成功
  419 + if(isset($retArr['x-upyun-content-length'])){
  420 + //在实际使用中,$key可能是用户传过来的,在不知道$key是否以斜杠开头的情况下,统一先去掉再自己添加一个
  421 + return $defaultDomain . '/' . ltrim($key);
  422 + }else{
  423 + return false;
  424 + }
  425 + }
308 } 426 }
  1 +<!DOCTYPE html>
  2 +<html>
  3 +
  4 +<head>
  5 + <meta charset="utf-8">
  6 + <title>签名页</title>
  7 + <script src="__CDN__/assets/js/signature.js"></script>
  8 + <script src="__CDN__/assets/js/jquery-3.4.1.min.js"></script>
  9 +</head>
  10 +
  11 +<body>
  12 +<div class="popverBox">
  13 + <div id="signSure" class="signSure">
  14 + <input type="hidden" name="id" id="id" value="{$id}">
  15 + <div class="topBtnBox">
  16 + <div class="topTitle">电子签名</div>
  17 + <canvas class="whiteBord" id="whiteBord">
  18 + 您的浏览器不支持canvas技术,请升级浏览器!
  19 + </canvas>
  20 +
  21 + </div>
  22 + <div>
  23 + <div class="topTitle">审核意见</div>
  24 + <textarea class="opinion" placeholder="输入审核意见,不超过200个字" name="opinion" id="opinion"></textarea>
  25 + </div>
  26 + <div class="bottomBtnBox">
  27 + <button class="primaryBtn" id="againWrite">重写</button>
  28 + <button class="primaryBtn activeBtn" id="sureWrite">通过</button>
  29 + <button class="primaryBtn backBtn" id="back">退回</button>
  30 + </div>
  31 + </div>
  32 +</div>
  33 +</body>
  34 +
  35 +<script>
  36 + function sureWriteCallback(imageBase64){
  37 + // 签名完成后的的逻辑代码...
  38 + $.ajax({
  39 + type : "POST", //提交方式
  40 + url : "canvas",//路径
  41 + data : {
  42 + "imgbase64" : imageBase64,
  43 + 'type' : 1,
  44 + 'id' : $('#id').val(),
  45 + 'opinion' : $('#opinion').val()
  46 + },//数据,这里使用的是Json格式进行传输
  47 + success:function (data) {
  48 + layer.msg('签名成功');
  49 + }
  50 + })
  51 + }
  52 + let params = {
  53 + whiteBord:'whiteBord',//canvas标签的id名称
  54 + againWrite:'againWrite',//重写按钮id名
  55 + sureWrite:'sureWrite',//确认按钮id名
  56 + whiteBordPtions:{},//白板的配置项(空对象时取默认值)
  57 + sureWriteCallback,// 签名完成后的回调函数
  58 + }
  59 + signature(params) // signature.js里封装好的函数,把参数传进去,调用一下即可
  60 +</script>
  61 +
  62 +<style>
  63 + .popverBox{
  64 + background: #666;;
  65 + position: relative;
  66 + font-size: 30px;
  67 + /*height: 900px;*/
  68 + }
  69 + .signSure{
  70 + position: absolute;
  71 + left: 9%;
  72 + top: 4%;
  73 + /*transform: translate(-50%, -50%);*/
  74 + width: 80%;
  75 + background: #fff;
  76 + border-radius: 16px;
  77 + padding: 20px 12px 28px 12px;
  78 + }
  79 + .topTitle{
  80 + margin: 20px 0 12px 12px;
  81 + font-size: 30px;
  82 + }
  83 + .whiteBord{
  84 + width: 100%;
  85 + height: 400px;
  86 + border: 1px solid #eee;
  87 + background: #f6f6f6;
  88 + margin: 0 auto;
  89 + border-radius: 4px;
  90 + margin-bottom: 12px;
  91 + }
  92 + .bottomBtnBox{
  93 + padding: 60px 7px;
  94 + display: flex;
  95 + justify-content: space-between;
  96 + }
  97 + .primaryBtn{
  98 + width: 25%;
  99 + height: 80px;
  100 + color: #666;
  101 + border: 1px solid #ccc;
  102 + border-radius: 4px;
  103 + background: #fff;
  104 + font-size: 30px;
  105 + }
  106 + .activeBtn{
  107 + /*background: #315294;*/
  108 + background: rgb(38,198,218);
  109 + color: #fff;
  110 + border: none;
  111 + }
  112 + .backBtn{
  113 + /*background: #315294;*/
  114 + background: rgb(252,75,108);
  115 + color: #fff;
  116 + border: none;
  117 + }
  118 + .opinion{
  119 + width: 100%;
  120 + height: 179px;
  121 + font-size: 30px;
  122 + color: white;
  123 + }
  124 +
  125 + .opinion::-webkit-input-placeholder{
  126 + height: 179px;line-height: 179px
  127 + }/* 使用webkit内核的浏览器 */
  128 + .opinion:-moz-placeholder{
  129 + height: 179px;line-height: 179px
  130 + }/* Firefox版本4-18 */
  131 + .opinion::-moz-placeholder{
  132 + height: 179px;line-height: 179px
  133 + }/* Firefox版本19+ */
  134 + .opinion:-ms-input-placeholder{
  135 + height: 179px;line-height: 179px
  136 + }
  137 +
  138 +</style>
  139 +</html>
@@ -27,9 +27,20 @@ @@ -27,9 +27,20 @@
27 "symfony/var-exporter": "^4.4.13", 27 "symfony/var-exporter": "^4.4.13",
28 "ext-json": "*", 28 "ext-json": "*",
29 "ext-curl": "*", 29 "ext-curl": "*",
30 - "ext-pdo": "*" 30 + "ext-pdo": "*",
  31 + "endroid/qrcode": "^2.1"
31 }, 32 },
32 "config": { 33 "config": {
33 - "preferred-install": "dist" 34 + "preferred-install": "dist",
  35 + "allow-plugins": {
  36 + "topthink/think-installer": true,
  37 + "easywechat-composer/easywechat-composer": true
  38 + }
  39 + },
  40 + "repositories": {
  41 + "packagist": {
  42 + "type": "composer",
  43 + "url": "https://mirrors.huaweicloud.com/repository/php/"
  44 + }
34 } 45 }
35 } 46 }
@@ -4,9 +4,54 @@ @@ -4,9 +4,54 @@
4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5 "This file is @generated automatically" 5 "This file is @generated automatically"
6 ], 6 ],
7 - "content-hash": "4a630f335229986f47661bbe170400d4", 7 + "content-hash": "7e5fc6d1e698abe4bb5bc60b23f4277d",
8 "packages": [ 8 "packages": [
9 { 9 {
  10 + "name": "bacon/bacon-qr-code",
  11 + "version": "1.0.3",
  12 + "source": {
  13 + "type": "git",
  14 + "url": "https://github.com/Bacon/BaconQrCode.git",
  15 + "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee"
  16 + },
  17 + "dist": {
  18 + "type": "zip",
  19 + "url": "https://mirrors.huaweicloud.com/repository/php/bacon/bacon-qr-code/1.0.3/bacon-bacon-qr-code-1.0.3.zip",
  20 + "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee",
  21 + "shasum": ""
  22 + },
  23 + "require": {
  24 + "ext-iconv": "*",
  25 + "php": "^5.4|^7.0"
  26 + },
  27 + "require-dev": {
  28 + "phpunit/phpunit": "^4.8"
  29 + },
  30 + "suggest": {
  31 + "ext-gd": "to generate QR code images"
  32 + },
  33 + "type": "library",
  34 + "autoload": {
  35 + "psr-0": {
  36 + "BaconQrCode": "src/"
  37 + }
  38 + },
  39 + "license": [
  40 + "BSD-2-Clause"
  41 + ],
  42 + "authors": [
  43 + {
  44 + "name": "Ben Scholzen 'DASPRiD'",
  45 + "email": "mail@dasprids.de",
  46 + "homepage": "http://www.dasprids.de",
  47 + "role": "Developer"
  48 + }
  49 + ],
  50 + "description": "BaconQrCode is a QR code generator for PHP.",
  51 + "homepage": "https://github.com/Bacon/BaconQrCode",
  52 + "time": "2017-10-17T09:59:25+00:00"
  53 + },
  54 + {
10 "name": "easywechat-composer/easywechat-composer", 55 "name": "easywechat-composer/easywechat-composer",
11 "version": "1.4.0", 56 "version": "1.4.0",
12 "source": { 57 "source": {
@@ -18,13 +63,7 @@ @@ -18,13 +63,7 @@
18 "type": "zip", 63 "type": "zip",
19 "url": "https://api.github.com/repos/mingyoung/easywechat-composer/zipball/93cfce1ec842b9a5b1b0791a52afd18b833f114a", 64 "url": "https://api.github.com/repos/mingyoung/easywechat-composer/zipball/93cfce1ec842b9a5b1b0791a52afd18b833f114a",
20 "reference": "93cfce1ec842b9a5b1b0791a52afd18b833f114a", 65 "reference": "93cfce1ec842b9a5b1b0791a52afd18b833f114a",
21 - "shasum": "",  
22 - "mirrors": [  
23 - {  
24 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
25 - "preferred": true  
26 - }  
27 - ] 66 + "shasum": ""
28 }, 67 },
29 "require": { 68 "require": {
30 "composer-plugin-api": "^1.0 || ^2.0", 69 "composer-plugin-api": "^1.0 || ^2.0",
@@ -57,6 +96,75 @@ @@ -57,6 +96,75 @@
57 "time": "2020-07-23T11:06:47+00:00" 96 "time": "2020-07-23T11:06:47+00:00"
58 }, 97 },
59 { 98 {
  99 + "name": "endroid/qrcode",
  100 + "version": "2.5.1",
  101 + "source": {
  102 + "type": "git",
  103 + "url": "https://github.com/endroid/qr-code.git",
  104 + "reference": "6062677d3404e0ded40647b8f62ec55ff9722eb7"
  105 + },
  106 + "dist": {
  107 + "type": "zip",
  108 + "url": "https://mirrors.huaweicloud.com/repository/php/endroid/qrcode/2.5.1/endroid-qrcode-2.5.1.zip",
  109 + "reference": "6062677d3404e0ded40647b8f62ec55ff9722eb7",
  110 + "shasum": ""
  111 + },
  112 + "require": {
  113 + "bacon/bacon-qr-code": "^1.0.3",
  114 + "ext-gd": "*",
  115 + "khanamiryan/qrcode-detector-decoder": "1",
  116 + "myclabs/php-enum": "^1.5",
  117 + "php": ">=5.6",
  118 + "symfony/options-resolver": "^2.7",
  119 + "symfony/property-access": "^2.7"
  120 + },
  121 + "require-dev": {
  122 + "phpunit/phpunit": "^5.7",
  123 + "symfony/asset": "^2.7",
  124 + "symfony/browser-kit": "^2.7",
  125 + "symfony/finder": "^2.7",
  126 + "symfony/framework-bundle": "^2.7",
  127 + "symfony/http-kernel": "^2.7",
  128 + "symfony/templating": "^2.7",
  129 + "symfony/twig-bundle": "^2.7",
  130 + "symfony/yaml": "^2.7"
  131 + },
  132 + "type": "symfony-bundle",
  133 + "extra": {
  134 + "branch-alias": {
  135 + "dev-master": "2.x-dev"
  136 + }
  137 + },
  138 + "autoload": {
  139 + "psr-4": {
  140 + "Endroid\\QrCode\\": "src/"
  141 + }
  142 + },
  143 + "license": [
  144 + "MIT"
  145 + ],
  146 + "authors": [
  147 + {
  148 + "name": "Jeroen van den Enden",
  149 + "email": "info@endroid.nl",
  150 + "homepage": "http://endroid.nl/"
  151 + }
  152 + ],
  153 + "description": "Endroid QR Code",
  154 + "homepage": "https://github.com/endroid/QrCode",
  155 + "keywords": [
  156 + "bundle",
  157 + "code",
  158 + "endroid",
  159 + "flex",
  160 + "qr",
  161 + "qrcode",
  162 + "symfony"
  163 + ],
  164 + "abandoned": "endroid/qr-code",
  165 + "time": "2018-05-09T20:26:30+00:00"
  166 + },
  167 + {
60 "name": "guzzlehttp/guzzle", 168 "name": "guzzlehttp/guzzle",
61 "version": "6.5.5", 169 "version": "6.5.5",
62 "source": { 170 "source": {
@@ -68,13 +176,7 @@ @@ -68,13 +176,7 @@
68 "type": "zip", 176 "type": "zip",
69 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", 177 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
70 "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", 178 "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
71 - "shasum": "",  
72 - "mirrors": [  
73 - {  
74 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
75 - "preferred": true  
76 - }  
77 - ] 179 + "shasum": ""
78 }, 180 },
79 "require": { 181 "require": {
80 "ext-json": "*", 182 "ext-json": "*",
@@ -141,13 +243,7 @@ @@ -141,13 +243,7 @@
141 "type": "zip", 243 "type": "zip",
142 "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631", 244 "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631",
143 "reference": "60d379c243457e073cff02bc323a2a86cb355631", 245 "reference": "60d379c243457e073cff02bc323a2a86cb355631",
144 - "shasum": "",  
145 - "mirrors": [  
146 - {  
147 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
148 - "preferred": true  
149 - }  
150 - ] 246 + "shasum": ""
151 }, 247 },
152 "require": { 248 "require": {
153 "php": ">=5.5" 249 "php": ">=5.5"
@@ -198,13 +294,7 @@ @@ -198,13 +294,7 @@
198 "type": "zip", 294 "type": "zip",
199 "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", 295 "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3",
200 "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", 296 "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3",
201 - "shasum": "",  
202 - "mirrors": [  
203 - {  
204 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
205 - "preferred": true  
206 - }  
207 - ] 297 + "shasum": ""
208 }, 298 },
209 "require": { 299 "require": {
210 "php": ">=5.4.0", 300 "php": ">=5.4.0",
@@ -275,13 +365,7 @@ @@ -275,13 +365,7 @@
275 "type": "zip", 365 "type": "zip",
276 "url": "https://api.github.com/repos/karsonzhang/fastadmin-addons/zipball/24b9cad089003488e6b03dc44dc029bcf3b88cf4", 366 "url": "https://api.github.com/repos/karsonzhang/fastadmin-addons/zipball/24b9cad089003488e6b03dc44dc029bcf3b88cf4",
277 "reference": "24b9cad089003488e6b03dc44dc029bcf3b88cf4", 367 "reference": "24b9cad089003488e6b03dc44dc029bcf3b88cf4",
278 - "shasum": "",  
279 - "mirrors": [  
280 - {  
281 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
282 - "preferred": true  
283 - }  
284 - ] 368 + "shasum": ""
285 }, 369 },
286 "require": { 370 "require": {
287 "nelexa/zip": "^3.3", 371 "nelexa/zip": "^3.3",
@@ -321,6 +405,55 @@ @@ -321,6 +405,55 @@
321 "time": "2020-10-13T08:22:20+00:00" 405 "time": "2020-10-13T08:22:20+00:00"
322 }, 406 },
323 { 407 {
  408 + "name": "khanamiryan/qrcode-detector-decoder",
  409 + "version": "1",
  410 + "source": {
  411 + "type": "git",
  412 + "url": "https://github.com/khanamiryan/php-qrcode-detector-decoder.git",
  413 + "reference": "96d5f80680b04803c4f1b69d6e01735e876b80c7"
  414 + },
  415 + "dist": {
  416 + "type": "zip",
  417 + "url": "https://mirrors.huaweicloud.com/repository/php/khanamiryan/qrcode-detector-decoder/1/khanamiryan-qrcode-detector-decoder-1.zip",
  418 + "reference": "96d5f80680b04803c4f1b69d6e01735e876b80c7",
  419 + "shasum": ""
  420 + },
  421 + "require": {
  422 + "php": "^5.6|^7.0"
  423 + },
  424 + "require-dev": {
  425 + "phpunit/phpunit": "^5.7"
  426 + },
  427 + "type": "library",
  428 + "autoload": {
  429 + "files": [
  430 + "lib/common/customFunctions.php"
  431 + ],
  432 + "classmap": [
  433 + "lib/"
  434 + ]
  435 + },
  436 + "license": [
  437 + "MIT"
  438 + ],
  439 + "authors": [
  440 + {
  441 + "name": "Ashot Khanamiryan",
  442 + "email": "a.khanamiryan@gmail.com",
  443 + "homepage": "https://github.com/khanamiryan",
  444 + "role": "Developer"
  445 + }
  446 + ],
  447 + "description": "QR code decoder / reader",
  448 + "homepage": "https://github.com/khanamiryan/php-qrcode-detector-decoder",
  449 + "keywords": [
  450 + "barcode",
  451 + "qr",
  452 + "zxing"
  453 + ],
  454 + "time": "2017-01-13T09:11:46+00:00"
  455 + },
  456 + {
324 "name": "maennchen/zipstream-php", 457 "name": "maennchen/zipstream-php",
325 "version": "2.1.0", 458 "version": "2.1.0",
326 "source": { 459 "source": {
@@ -332,13 +465,7 @@ @@ -332,13 +465,7 @@
332 "type": "zip", 465 "type": "zip",
333 "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/c4c5803cc1f93df3d2448478ef79394a5981cc58", 466 "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/c4c5803cc1f93df3d2448478ef79394a5981cc58",
334 "reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58", 467 "reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58",
335 - "shasum": "",  
336 - "mirrors": [  
337 - {  
338 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
339 - "preferred": true  
340 - }  
341 - ] 468 + "shasum": ""
342 }, 469 },
343 "require": { 470 "require": {
344 "myclabs/php-enum": "^1.5", 471 "myclabs/php-enum": "^1.5",
@@ -405,13 +532,7 @@ @@ -405,13 +532,7 @@
405 "type": "zip", 532 "type": "zip",
406 "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/9999f1432fae467bc93c53f357105b4c31bb994c", 533 "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/9999f1432fae467bc93c53f357105b4c31bb994c",
407 "reference": "9999f1432fae467bc93c53f357105b4c31bb994c", 534 "reference": "9999f1432fae467bc93c53f357105b4c31bb994c",
408 - "shasum": "",  
409 - "mirrors": [  
410 - {  
411 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
412 - "preferred": true  
413 - }  
414 - ] 535 + "shasum": ""
415 }, 536 },
416 "require": { 537 "require": {
417 "php": "^7.2 || ^8.0" 538 "php": "^7.2 || ^8.0"
@@ -506,13 +627,7 @@ @@ -506,13 +627,7 @@
506 "type": "zip", 627 "type": "zip",
507 "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/9567d9c4c519fbe40de01dbd1e4469dbbb66f46a", 628 "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/9567d9c4c519fbe40de01dbd1e4469dbbb66f46a",
508 "reference": "9567d9c4c519fbe40de01dbd1e4469dbbb66f46a", 629 "reference": "9567d9c4c519fbe40de01dbd1e4469dbbb66f46a",
509 - "shasum": "",  
510 - "mirrors": [  
511 - {  
512 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
513 - "preferred": true  
514 - }  
515 - ] 630 + "shasum": ""
516 }, 631 },
517 "require": { 632 "require": {
518 "php": "^7.2 || ^8.0" 633 "php": "^7.2 || ^8.0"
@@ -582,13 +697,7 @@ @@ -582,13 +697,7 @@
582 "type": "zip", 697 "type": "zip",
583 "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f9eee5cec93dfb313a38b6b288741e84e53f02d5", 698 "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f9eee5cec93dfb313a38b6b288741e84e53f02d5",
584 "reference": "f9eee5cec93dfb313a38b6b288741e84e53f02d5", 699 "reference": "f9eee5cec93dfb313a38b6b288741e84e53f02d5",
585 - "shasum": "",  
586 - "mirrors": [  
587 - {  
588 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
589 - "preferred": true  
590 - }  
591 - ] 700 + "shasum": ""
592 }, 701 },
593 "require": { 702 "require": {
594 "php": ">=7.2", 703 "php": ">=7.2",
@@ -679,13 +788,7 @@ @@ -679,13 +788,7 @@
679 "type": "zip", 788 "type": "zip",
680 "url": "https://api.github.com/repos/myclabs/php-enum/zipball/5f36467c7a87e20fbdc51e524fd8f9d1de80187c", 789 "url": "https://api.github.com/repos/myclabs/php-enum/zipball/5f36467c7a87e20fbdc51e524fd8f9d1de80187c",
681 "reference": "5f36467c7a87e20fbdc51e524fd8f9d1de80187c", 790 "reference": "5f36467c7a87e20fbdc51e524fd8f9d1de80187c",
682 - "shasum": "",  
683 - "mirrors": [  
684 - {  
685 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
686 - "preferred": true  
687 - }  
688 - ] 791 + "shasum": ""
689 }, 792 },
690 "require": { 793 "require": {
691 "ext-json": "*", 794 "ext-json": "*",
@@ -731,13 +834,7 @@ @@ -731,13 +834,7 @@
731 "type": "zip", 834 "type": "zip",
732 "url": "https://api.github.com/repos/Ne-Lexa/php-zip/zipball/501b52f6fc393a599b44ff348a42740e1eaac7c6", 835 "url": "https://api.github.com/repos/Ne-Lexa/php-zip/zipball/501b52f6fc393a599b44ff348a42740e1eaac7c6",
733 "reference": "501b52f6fc393a599b44ff348a42740e1eaac7c6", 836 "reference": "501b52f6fc393a599b44ff348a42740e1eaac7c6",
734 - "shasum": "",  
735 - "mirrors": [  
736 - {  
737 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
738 - "preferred": true  
739 - }  
740 - ] 837 + "shasum": ""
741 }, 838 },
742 "require": { 839 "require": {
743 "ext-zlib": "*", 840 "ext-zlib": "*",
@@ -803,13 +900,7 @@ @@ -803,13 +900,7 @@
803 "type": "zip", 900 "type": "zip",
804 "url": "https://api.github.com/repos/overtrue/pinyin/zipball/3b781d267197b74752daa32814d3a2cf5d140779", 901 "url": "https://api.github.com/repos/overtrue/pinyin/zipball/3b781d267197b74752daa32814d3a2cf5d140779",
805 "reference": "3b781d267197b74752daa32814d3a2cf5d140779", 902 "reference": "3b781d267197b74752daa32814d3a2cf5d140779",
806 - "shasum": "",  
807 - "mirrors": [  
808 - {  
809 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
810 - "preferred": true  
811 - }  
812 - ] 903 + "shasum": ""
813 }, 904 },
814 "require": { 905 "require": {
815 "php": ">=5.3" 906 "php": ">=5.3"
@@ -854,13 +945,7 @@ @@ -854,13 +945,7 @@
854 "type": "zip", 945 "type": "zip",
855 "url": "https://api.github.com/repos/overtrue/socialite/zipball/ae4c8d1e9fe39418b9a598d42f01d7c1fe30f200", 946 "url": "https://api.github.com/repos/overtrue/socialite/zipball/ae4c8d1e9fe39418b9a598d42f01d7c1fe30f200",
856 "reference": "ae4c8d1e9fe39418b9a598d42f01d7c1fe30f200", 947 "reference": "ae4c8d1e9fe39418b9a598d42f01d7c1fe30f200",
857 - "shasum": "",  
858 - "mirrors": [  
859 - {  
860 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
861 - "preferred": true  
862 - }  
863 - ] 948 + "shasum": ""
864 }, 949 },
865 "require": { 950 "require": {
866 "ext-json": "*", 951 "ext-json": "*",
@@ -913,20 +998,14 @@ @@ -913,20 +998,14 @@
913 "version": "4.2.11", 998 "version": "4.2.11",
914 "source": { 999 "source": {
915 "type": "git", 1000 "type": "git",
916 - "url": "https://github.com/overtrue/wechat.git", 1001 + "url": "https://github.com/w7corp/easywechat.git",
917 "reference": "853e0772e6aa53a71edf1b5d251c7ff1e6b2a2bf" 1002 "reference": "853e0772e6aa53a71edf1b5d251c7ff1e6b2a2bf"
918 }, 1003 },
919 "dist": { 1004 "dist": {
920 "type": "zip", 1005 "type": "zip",
921 "url": "https://api.github.com/repos/overtrue/wechat/zipball/853e0772e6aa53a71edf1b5d251c7ff1e6b2a2bf", 1006 "url": "https://api.github.com/repos/overtrue/wechat/zipball/853e0772e6aa53a71edf1b5d251c7ff1e6b2a2bf",
922 "reference": "853e0772e6aa53a71edf1b5d251c7ff1e6b2a2bf", 1007 "reference": "853e0772e6aa53a71edf1b5d251c7ff1e6b2a2bf",
923 - "shasum": "",  
924 - "mirrors": [  
925 - {  
926 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
927 - "preferred": true  
928 - }  
929 - ] 1008 + "shasum": ""
930 }, 1009 },
931 "require": { 1010 "require": {
932 "easywechat-composer/easywechat-composer": "^1.1", 1011 "easywechat-composer/easywechat-composer": "^1.1",
@@ -978,6 +1057,7 @@ @@ -978,6 +1057,7 @@
978 "weixin", 1057 "weixin",
979 "weixin-sdk" 1058 "weixin-sdk"
980 ], 1059 ],
  1060 + "abandoned": "w7corp/easywechat",
981 "time": "2019-11-27T16:38:00+00:00" 1061 "time": "2019-11-27T16:38:00+00:00"
982 }, 1062 },
983 { 1063 {
@@ -992,13 +1072,7 @@ @@ -992,13 +1072,7 @@
992 "type": "zip", 1072 "type": "zip",
993 "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", 1073 "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95",
994 "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", 1074 "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95",
995 - "shasum": "",  
996 - "mirrors": [  
997 - {  
998 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
999 - "preferred": true  
1000 - }  
1001 - ] 1075 + "shasum": ""
1002 }, 1076 },
1003 "require": { 1077 "require": {
1004 "php": "^7" 1078 "php": "^7"
@@ -1043,13 +1117,7 @@ @@ -1043,13 +1117,7 @@
1043 "type": "zip", 1117 "type": "zip",
1044 "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/917ab212fa00dc6eacbb26e8bc387ebe40993bc1", 1118 "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/917ab212fa00dc6eacbb26e8bc387ebe40993bc1",
1045 "reference": "917ab212fa00dc6eacbb26e8bc387ebe40993bc1", 1119 "reference": "917ab212fa00dc6eacbb26e8bc387ebe40993bc1",
1046 - "shasum": "",  
1047 - "mirrors": [  
1048 - {  
1049 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1050 - "preferred": true  
1051 - }  
1052 - ] 1120 + "shasum": ""
1053 }, 1121 },
1054 "require": { 1122 "require": {
1055 "ext-ctype": "*", 1123 "ext-ctype": "*",
@@ -1118,13 +1186,7 @@ @@ -1118,13 +1186,7 @@
1118 "type": "zip", 1186 "type": "zip",
1119 "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f", 1187 "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f",
1120 "reference": "a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f", 1188 "reference": "a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f",
1121 - "shasum": "",  
1122 - "mirrors": [  
1123 - {  
1124 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1125 - "preferred": true  
1126 - }  
1127 - ] 1189 + "shasum": ""
1128 }, 1190 },
1129 "require": { 1191 "require": {
1130 "ext-ctype": "*", 1192 "ext-ctype": "*",
@@ -1220,13 +1282,7 @@ @@ -1220,13 +1282,7 @@
1220 "type": "zip", 1282 "type": "zip",
1221 "url": "https://api.github.com/repos/silexphp/Pimple/zipball/e55d12f9d6a0e7f9c85992b73df1267f46279930", 1283 "url": "https://api.github.com/repos/silexphp/Pimple/zipball/e55d12f9d6a0e7f9c85992b73df1267f46279930",
1222 "reference": "e55d12f9d6a0e7f9c85992b73df1267f46279930", 1284 "reference": "e55d12f9d6a0e7f9c85992b73df1267f46279930",
1223 - "shasum": "",  
1224 - "mirrors": [  
1225 - {  
1226 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1227 - "preferred": true  
1228 - }  
1229 - ] 1285 + "shasum": ""
1230 }, 1286 },
1231 "require": { 1287 "require": {
1232 "php": "^7.2.5", 1288 "php": "^7.2.5",
@@ -1276,13 +1332,7 @@ @@ -1276,13 +1332,7 @@
1276 "type": "zip", 1332 "type": "zip",
1277 "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", 1333 "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
1278 "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", 1334 "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
1279 - "shasum": "",  
1280 - "mirrors": [  
1281 - {  
1282 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1283 - "preferred": true  
1284 - }  
1285 - ] 1335 + "shasum": ""
1286 }, 1336 },
1287 "require": { 1337 "require": {
1288 "php": ">=5.3.0" 1338 "php": ">=5.3.0"
@@ -1328,13 +1378,7 @@ @@ -1328,13 +1378,7 @@
1328 "type": "zip", 1378 "type": "zip",
1329 "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 1379 "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
1330 "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 1380 "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
1331 - "shasum": "",  
1332 - "mirrors": [  
1333 - {  
1334 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1335 - "preferred": true  
1336 - }  
1337 - ] 1381 + "shasum": ""
1338 }, 1382 },
1339 "require": { 1383 "require": {
1340 "php": ">=5.3.0" 1384 "php": ">=5.3.0"
@@ -1383,13 +1427,7 @@ @@ -1383,13 +1427,7 @@
1383 "type": "zip", 1427 "type": "zip",
1384 "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", 1428 "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
1385 "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", 1429 "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
1386 - "shasum": "",  
1387 - "mirrors": [  
1388 - {  
1389 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1390 - "preferred": true  
1391 - }  
1392 - ] 1430 + "shasum": ""
1393 }, 1431 },
1394 "require": { 1432 "require": {
1395 "php": "^7.0 || ^8.0", 1433 "php": "^7.0 || ^8.0",
@@ -1438,13 +1476,7 @@ @@ -1438,13 +1476,7 @@
1438 "type": "zip", 1476 "type": "zip",
1439 "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", 1477 "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
1440 "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", 1478 "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
1441 - "shasum": "",  
1442 - "mirrors": [  
1443 - {  
1444 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1445 - "preferred": true  
1446 - }  
1447 - ] 1479 + "shasum": ""
1448 }, 1480 },
1449 "require": { 1481 "require": {
1450 "php": ">=7.0.0", 1482 "php": ">=7.0.0",
@@ -1496,13 +1528,7 @@ @@ -1496,13 +1528,7 @@
1496 "type": "zip", 1528 "type": "zip",
1497 "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", 1529 "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
1498 "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", 1530 "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
1499 - "shasum": "",  
1500 - "mirrors": [  
1501 - {  
1502 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1503 - "preferred": true  
1504 - }  
1505 - ] 1531 + "shasum": ""
1506 }, 1532 },
1507 "require": { 1533 "require": {
1508 "php": ">=5.3.0" 1534 "php": ">=5.3.0"
@@ -1552,13 +1578,7 @@ @@ -1552,13 +1578,7 @@
1552 "type": "zip", 1578 "type": "zip",
1553 "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", 1579 "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
1554 "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", 1580 "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
1555 - "shasum": "",  
1556 - "mirrors": [  
1557 - {  
1558 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1559 - "preferred": true  
1560 - }  
1561 - ] 1581 + "shasum": ""
1562 }, 1582 },
1563 "require": { 1583 "require": {
1564 "php": ">=5.3.0" 1584 "php": ">=5.3.0"
@@ -1605,13 +1625,7 @@ @@ -1605,13 +1625,7 @@
1605 "type": "zip", 1625 "type": "zip",
1606 "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", 1626 "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
1607 "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", 1627 "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
1608 - "shasum": "",  
1609 - "mirrors": [  
1610 - {  
1611 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1612 - "preferred": true  
1613 - }  
1614 - ] 1628 + "shasum": ""
1615 }, 1629 },
1616 "require": { 1630 "require": {
1617 "php": ">=5.3.0" 1631 "php": ">=5.3.0"
@@ -1659,13 +1673,7 @@ @@ -1659,13 +1673,7 @@
1659 "type": "zip", 1673 "type": "zip",
1660 "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", 1674 "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
1661 "reference": "120b605dfeb996808c31b6477290a714d356e822", 1675 "reference": "120b605dfeb996808c31b6477290a714d356e822",
1662 - "shasum": "",  
1663 - "mirrors": [  
1664 - {  
1665 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1666 - "preferred": true  
1667 - }  
1668 - ] 1676 + "shasum": ""
1669 }, 1677 },
1670 "require": { 1678 "require": {
1671 "php": ">=5.6" 1679 "php": ">=5.6"
@@ -1705,13 +1713,7 @@ @@ -1705,13 +1713,7 @@
1705 "type": "zip", 1713 "type": "zip",
1706 "url": "https://api.github.com/repos/symfony/cache/zipball/969a76c2dbce7e4306684f5376718147d1ec4ae7", 1714 "url": "https://api.github.com/repos/symfony/cache/zipball/969a76c2dbce7e4306684f5376718147d1ec4ae7",
1707 "reference": "969a76c2dbce7e4306684f5376718147d1ec4ae7", 1715 "reference": "969a76c2dbce7e4306684f5376718147d1ec4ae7",
1708 - "shasum": "",  
1709 - "mirrors": [  
1710 - {  
1711 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1712 - "preferred": true  
1713 - }  
1714 - ] 1716 + "shasum": ""
1715 }, 1717 },
1716 "require": { 1718 "require": {
1717 "php": ">=7.1.3", 1719 "php": ">=7.1.3",
@@ -1804,13 +1806,7 @@ @@ -1804,13 +1806,7 @@
1804 "type": "zip", 1806 "type": "zip",
1805 "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/8034ca0b61d4dd967f3698aaa1da2507b631d0cb", 1807 "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/8034ca0b61d4dd967f3698aaa1da2507b631d0cb",
1806 "reference": "8034ca0b61d4dd967f3698aaa1da2507b631d0cb", 1808 "reference": "8034ca0b61d4dd967f3698aaa1da2507b631d0cb",
1807 - "shasum": "",  
1808 - "mirrors": [  
1809 - {  
1810 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1811 - "preferred": true  
1812 - }  
1813 - ] 1809 + "shasum": ""
1814 }, 1810 },
1815 "require": { 1811 "require": {
1816 "php": ">=7.2.5", 1812 "php": ">=7.2.5",
@@ -1886,13 +1882,7 @@ @@ -1886,13 +1882,7 @@
1886 "type": "zip", 1882 "type": "zip",
1887 "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e17bb5e0663dc725f7cdcafc932132735b4725cd", 1883 "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e17bb5e0663dc725f7cdcafc932132735b4725cd",
1888 "reference": "e17bb5e0663dc725f7cdcafc932132735b4725cd", 1884 "reference": "e17bb5e0663dc725f7cdcafc932132735b4725cd",
1889 - "shasum": "",  
1890 - "mirrors": [  
1891 - {  
1892 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1893 - "preferred": true  
1894 - }  
1895 - ] 1885 + "shasum": ""
1896 }, 1886 },
1897 "require": { 1887 "require": {
1898 "php": ">=7.1.3", 1888 "php": ">=7.1.3",
@@ -1977,13 +1967,7 @@ @@ -1977,13 +1967,7 @@
1977 "type": "zip", 1967 "type": "zip",
1978 "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/84e23fdcd2517bf37aecbd16967e83f0caee25a7", 1968 "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/84e23fdcd2517bf37aecbd16967e83f0caee25a7",
1979 "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7", 1969 "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7",
1980 - "shasum": "",  
1981 - "mirrors": [  
1982 - {  
1983 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
1984 - "preferred": true  
1985 - }  
1986 - ] 1970 + "shasum": ""
1987 }, 1971 },
1988 "require": { 1972 "require": {
1989 "php": ">=7.1.3" 1973 "php": ">=7.1.3"
@@ -2059,13 +2043,7 @@ @@ -2059,13 +2043,7 @@
2059 "type": "zip", 2043 "type": "zip",
2060 "url": "https://api.github.com/repos/symfony/finder/zipball/2c3ba7ad6884e6c4451ce2340e2dc23f6fa3e0d8", 2044 "url": "https://api.github.com/repos/symfony/finder/zipball/2c3ba7ad6884e6c4451ce2340e2dc23f6fa3e0d8",
2061 "reference": "2c3ba7ad6884e6c4451ce2340e2dc23f6fa3e0d8", 2045 "reference": "2c3ba7ad6884e6c4451ce2340e2dc23f6fa3e0d8",
2062 - "shasum": "",  
2063 - "mirrors": [  
2064 - {  
2065 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
2066 - "preferred": true  
2067 - }  
2068 - ] 2046 + "shasum": ""
2069 }, 2047 },
2070 "require": { 2048 "require": {
2071 "php": ">=7.2.5" 2049 "php": ">=7.2.5"
@@ -2128,13 +2106,7 @@ @@ -2128,13 +2106,7 @@
2128 "type": "zip", 2106 "type": "zip",
2129 "url": "https://api.github.com/repos/symfony/http-foundation/zipball/10683b407c3b6087c64619ebc97a87e36ea62c92", 2107 "url": "https://api.github.com/repos/symfony/http-foundation/zipball/10683b407c3b6087c64619ebc97a87e36ea62c92",
2130 "reference": "10683b407c3b6087c64619ebc97a87e36ea62c92", 2108 "reference": "10683b407c3b6087c64619ebc97a87e36ea62c92",
2131 - "shasum": "",  
2132 - "mirrors": [  
2133 - {  
2134 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
2135 - "preferred": true  
2136 - }  
2137 - ] 2109 + "shasum": ""
2138 }, 2110 },
2139 "require": { 2111 "require": {
2140 "php": ">=7.1.3", 2112 "php": ">=7.1.3",
@@ -2203,13 +2175,7 @@ @@ -2203,13 +2175,7 @@
2203 "type": "zip", 2175 "type": "zip",
2204 "url": "https://api.github.com/repos/symfony/mime/zipball/4404d6545125863561721514ad9388db2661eec5", 2176 "url": "https://api.github.com/repos/symfony/mime/zipball/4404d6545125863561721514ad9388db2661eec5",
2205 "reference": "4404d6545125863561721514ad9388db2661eec5", 2177 "reference": "4404d6545125863561721514ad9388db2661eec5",
2206 - "shasum": "",  
2207 - "mirrors": [  
2208 - {  
2209 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
2210 - "preferred": true  
2211 - }  
2212 - ] 2178 + "shasum": ""
2213 }, 2179 },
2214 "require": { 2180 "require": {
2215 "php": ">=7.2.5", 2181 "php": ">=7.2.5",
@@ -2275,6 +2241,137 @@ @@ -2275,6 +2241,137 @@
2275 "time": "2020-09-02T16:23:27+00:00" 2241 "time": "2020-09-02T16:23:27+00:00"
2276 }, 2242 },
2277 { 2243 {
  2244 + "name": "symfony/options-resolver",
  2245 + "version": "v2.8.52",
  2246 + "source": {
  2247 + "type": "git",
  2248 + "url": "https://github.com/symfony/options-resolver.git",
  2249 + "reference": "7aaab725bb58f0e18aa12c61bdadd4793ab4c32b"
  2250 + },
  2251 + "dist": {
  2252 + "type": "zip",
  2253 + "url": "https://mirrors.huaweicloud.com/repository/php/symfony/options-resolver/v2.8.52/symfony-options-resolver-v2.8.52.zip",
  2254 + "reference": "7aaab725bb58f0e18aa12c61bdadd4793ab4c32b",
  2255 + "shasum": ""
  2256 + },
  2257 + "require": {
  2258 + "php": ">=5.3.9"
  2259 + },
  2260 + "type": "library",
  2261 + "extra": {
  2262 + "branch-alias": {
  2263 + "dev-master": "2.8-dev"
  2264 + }
  2265 + },
  2266 + "autoload": {
  2267 + "psr-4": {
  2268 + "Symfony\\Component\\OptionsResolver\\": ""
  2269 + },
  2270 + "exclude-from-classmap": [
  2271 + "/Tests/"
  2272 + ]
  2273 + },
  2274 + "license": [
  2275 + "MIT"
  2276 + ],
  2277 + "authors": [
  2278 + {
  2279 + "name": "Fabien Potencier",
  2280 + "email": "fabien@symfony.com"
  2281 + },
  2282 + {
  2283 + "name": "Symfony Community",
  2284 + "homepage": "https://symfony.com/contributors"
  2285 + }
  2286 + ],
  2287 + "description": "Symfony OptionsResolver Component",
  2288 + "homepage": "https://symfony.com",
  2289 + "keywords": [
  2290 + "config",
  2291 + "configuration",
  2292 + "options"
  2293 + ],
  2294 + "time": "2018-11-11T11:18:13+00:00"
  2295 + },
  2296 + {
  2297 + "name": "symfony/polyfill-ctype",
  2298 + "version": "v1.25.0",
  2299 + "source": {
  2300 + "type": "git",
  2301 + "url": "https://github.com/symfony/polyfill-ctype.git",
  2302 + "reference": "30885182c981ab175d4d034db0f6f469898070ab"
  2303 + },
  2304 + "dist": {
  2305 + "type": "zip",
  2306 + "url": "https://mirrors.huaweicloud.com/repository/php/symfony/polyfill-ctype/v1.25.0/symfony-polyfill-ctype-v1.25.0.zip",
  2307 + "reference": "30885182c981ab175d4d034db0f6f469898070ab",
  2308 + "shasum": ""
  2309 + },
  2310 + "require": {
  2311 + "php": ">=7.1"
  2312 + },
  2313 + "provide": {
  2314 + "ext-ctype": "*"
  2315 + },
  2316 + "suggest": {
  2317 + "ext-ctype": "For best performance"
  2318 + },
  2319 + "type": "library",
  2320 + "extra": {
  2321 + "branch-alias": {
  2322 + "dev-main": "1.23-dev"
  2323 + },
  2324 + "thanks": {
  2325 + "name": "symfony/polyfill",
  2326 + "url": "https://github.com/symfony/polyfill"
  2327 + }
  2328 + },
  2329 + "autoload": {
  2330 + "files": [
  2331 + "bootstrap.php"
  2332 + ],
  2333 + "psr-4": {
  2334 + "Symfony\\Polyfill\\Ctype\\": ""
  2335 + }
  2336 + },
  2337 + "license": [
  2338 + "MIT"
  2339 + ],
  2340 + "authors": [
  2341 + {
  2342 + "name": "Gert de Pagter",
  2343 + "email": "BackEndTea@gmail.com"
  2344 + },
  2345 + {
  2346 + "name": "Symfony Community",
  2347 + "homepage": "https://symfony.com/contributors"
  2348 + }
  2349 + ],
  2350 + "description": "Symfony polyfill for ctype functions",
  2351 + "homepage": "https://symfony.com",
  2352 + "keywords": [
  2353 + "compatibility",
  2354 + "ctype",
  2355 + "polyfill",
  2356 + "portable"
  2357 + ],
  2358 + "funding": [
  2359 + {
  2360 + "url": "https://symfony.com/sponsor",
  2361 + "type": "custom"
  2362 + },
  2363 + {
  2364 + "url": "https://github.com/fabpot",
  2365 + "type": "github"
  2366 + },
  2367 + {
  2368 + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
  2369 + "type": "tidelift"
  2370 + }
  2371 + ],
  2372 + "time": "2021-10-20T20:35:02+00:00"
  2373 + },
  2374 + {
2278 "name": "symfony/polyfill-intl-idn", 2375 "name": "symfony/polyfill-intl-idn",
2279 "version": "v1.18.1", 2376 "version": "v1.18.1",
2280 "source": { 2377 "source": {
@@ -2286,13 +2383,7 @@ @@ -2286,13 +2383,7 @@
2286 "type": "zip", 2383 "type": "zip",
2287 "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/5dcab1bc7146cf8c1beaa4502a3d9be344334251", 2384 "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/5dcab1bc7146cf8c1beaa4502a3d9be344334251",
2288 "reference": "5dcab1bc7146cf8c1beaa4502a3d9be344334251", 2385 "reference": "5dcab1bc7146cf8c1beaa4502a3d9be344334251",
2289 - "shasum": "",  
2290 - "mirrors": [  
2291 - {  
2292 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
2293 - "preferred": true  
2294 - }  
2295 - ] 2386 + "shasum": ""
2296 }, 2387 },
2297 "require": { 2388 "require": {
2298 "php": ">=5.3.3", 2389 "php": ">=5.3.3",
@@ -2377,13 +2468,7 @@ @@ -2377,13 +2468,7 @@
2377 "type": "zip", 2468 "type": "zip",
2378 "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", 2469 "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e",
2379 "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", 2470 "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e",
2380 - "shasum": "",  
2381 - "mirrors": [  
2382 - {  
2383 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
2384 - "preferred": true  
2385 - }  
2386 - ] 2471 + "shasum": ""
2387 }, 2472 },
2388 "require": { 2473 "require": {
2389 "php": ">=5.3.3" 2474 "php": ">=5.3.3"
@@ -2464,13 +2549,7 @@ @@ -2464,13 +2549,7 @@
2464 "type": "zip", 2549 "type": "zip",
2465 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", 2550 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a",
2466 "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", 2551 "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a",
2467 - "shasum": "",  
2468 - "mirrors": [  
2469 - {  
2470 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
2471 - "preferred": true  
2472 - }  
2473 - ] 2552 + "shasum": ""
2474 }, 2553 },
2475 "require": { 2554 "require": {
2476 "php": ">=5.3.3" 2555 "php": ">=5.3.3"
@@ -2547,13 +2626,7 @@ @@ -2547,13 +2626,7 @@
2547 "type": "zip", 2626 "type": "zip",
2548 "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/0dd93f2c578bdc9c72697eaa5f1dd25644e618d3", 2627 "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/0dd93f2c578bdc9c72697eaa5f1dd25644e618d3",
2549 "reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3", 2628 "reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3",
2550 - "shasum": "",  
2551 - "mirrors": [  
2552 - {  
2553 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
2554 - "preferred": true  
2555 - }  
2556 - ] 2629 + "shasum": ""
2557 }, 2630 },
2558 "require": { 2631 "require": {
2559 "paragonie/random_compat": "~1.0|~2.0|~9.99", 2632 "paragonie/random_compat": "~1.0|~2.0|~9.99",
@@ -2630,13 +2703,7 @@ @@ -2630,13 +2703,7 @@
2630 "type": "zip", 2703 "type": "zip",
2631 "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae", 2704 "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae",
2632 "reference": "639447d008615574653fb3bc60d1986d7172eaae", 2705 "reference": "639447d008615574653fb3bc60d1986d7172eaae",
2633 - "shasum": "",  
2634 - "mirrors": [  
2635 - {  
2636 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
2637 - "preferred": true  
2638 - }  
2639 - ] 2706 + "shasum": ""
2640 }, 2707 },
2641 "require": { 2708 "require": {
2642 "php": ">=5.3.3" 2709 "php": ">=5.3.3"
@@ -2709,13 +2776,7 @@ @@ -2709,13 +2776,7 @@
2709 "type": "zip", 2776 "type": "zip",
2710 "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981", 2777 "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981",
2711 "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981", 2778 "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981",
2712 - "shasum": "",  
2713 - "mirrors": [  
2714 - {  
2715 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
2716 - "preferred": true  
2717 - }  
2718 - ] 2779 + "shasum": ""
2719 }, 2780 },
2720 "require": { 2781 "require": {
2721 "php": ">=7.0.8" 2782 "php": ">=7.0.8"
@@ -2784,6 +2845,66 @@ @@ -2784,6 +2845,66 @@
2784 "time": "2020-07-14T12:35:20+00:00" 2845 "time": "2020-07-14T12:35:20+00:00"
2785 }, 2846 },
2786 { 2847 {
  2848 + "name": "symfony/property-access",
  2849 + "version": "v2.8.52",
  2850 + "source": {
  2851 + "type": "git",
  2852 + "url": "https://github.com/symfony/property-access.git",
  2853 + "reference": "c8f10191183be9bb0d5a1b8364d3891f1bde07b6"
  2854 + },
  2855 + "dist": {
  2856 + "type": "zip",
  2857 + "url": "https://mirrors.huaweicloud.com/repository/php/symfony/property-access/v2.8.52/symfony-property-access-v2.8.52.zip",
  2858 + "reference": "c8f10191183be9bb0d5a1b8364d3891f1bde07b6",
  2859 + "shasum": ""
  2860 + },
  2861 + "require": {
  2862 + "php": ">=5.3.9",
  2863 + "symfony/polyfill-ctype": "~1.8"
  2864 + },
  2865 + "type": "library",
  2866 + "extra": {
  2867 + "branch-alias": {
  2868 + "dev-master": "2.8-dev"
  2869 + }
  2870 + },
  2871 + "autoload": {
  2872 + "psr-4": {
  2873 + "Symfony\\Component\\PropertyAccess\\": ""
  2874 + },
  2875 + "exclude-from-classmap": [
  2876 + "/Tests/"
  2877 + ]
  2878 + },
  2879 + "license": [
  2880 + "MIT"
  2881 + ],
  2882 + "authors": [
  2883 + {
  2884 + "name": "Fabien Potencier",
  2885 + "email": "fabien@symfony.com"
  2886 + },
  2887 + {
  2888 + "name": "Symfony Community",
  2889 + "homepage": "https://symfony.com/contributors"
  2890 + }
  2891 + ],
  2892 + "description": "Symfony PropertyAccess Component",
  2893 + "homepage": "https://symfony.com",
  2894 + "keywords": [
  2895 + "access",
  2896 + "array",
  2897 + "extraction",
  2898 + "index",
  2899 + "injection",
  2900 + "object",
  2901 + "property",
  2902 + "property path",
  2903 + "reflection"
  2904 + ],
  2905 + "time": "2018-11-11T11:18:13+00:00"
  2906 + },
  2907 + {
2787 "name": "symfony/psr-http-message-bridge", 2908 "name": "symfony/psr-http-message-bridge",
2788 "version": "v1.3.0", 2909 "version": "v1.3.0",
2789 "source": { 2910 "source": {
@@ -2795,13 +2916,7 @@ @@ -2795,13 +2916,7 @@
2795 "type": "zip", 2916 "type": "zip",
2796 "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/9d3e80d54d9ae747ad573cad796e8e247df7b796", 2917 "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/9d3e80d54d9ae747ad573cad796e8e247df7b796",
2797 "reference": "9d3e80d54d9ae747ad573cad796e8e247df7b796", 2918 "reference": "9d3e80d54d9ae747ad573cad796e8e247df7b796",
2798 - "shasum": "",  
2799 - "mirrors": [  
2800 - {  
2801 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
2802 - "preferred": true  
2803 - }  
2804 - ] 2919 + "shasum": ""
2805 }, 2920 },
2806 "require": { 2921 "require": {
2807 "php": "^7.1", 2922 "php": "^7.1",
@@ -2866,13 +2981,7 @@ @@ -2866,13 +2981,7 @@
2866 "type": "zip", 2981 "type": "zip",
2867 "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", 2982 "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1",
2868 "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", 2983 "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1",
2869 - "shasum": "",  
2870 - "mirrors": [  
2871 - {  
2872 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
2873 - "preferred": true  
2874 - }  
2875 - ] 2984 + "shasum": ""
2876 }, 2985 },
2877 "require": { 2986 "require": {
2878 "php": ">=7.2.5", 2987 "php": ">=7.2.5",
@@ -2948,13 +3057,7 @@ @@ -2948,13 +3057,7 @@
2948 "type": "zip", 3057 "type": "zip",
2949 "url": "https://api.github.com/repos/symfony/var-exporter/zipball/bb6c505d1492bf55534184c0a38826bda529e5e2", 3058 "url": "https://api.github.com/repos/symfony/var-exporter/zipball/bb6c505d1492bf55534184c0a38826bda529e5e2",
2950 "reference": "bb6c505d1492bf55534184c0a38826bda529e5e2", 3059 "reference": "bb6c505d1492bf55534184c0a38826bda529e5e2",
2951 - "shasum": "",  
2952 - "mirrors": [  
2953 - {  
2954 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
2955 - "preferred": true  
2956 - }  
2957 - ] 3060 + "shasum": ""
2958 }, 3061 },
2959 "require": { 3062 "require": {
2960 "php": ">=7.1.3" 3063 "php": ">=7.1.3"
@@ -3028,13 +3131,7 @@ @@ -3028,13 +3131,7 @@
3028 "type": "zip", 3131 "type": "zip",
3029 "url": "https://api.github.com/repos/top-think/framework/zipball/c255c22b2f5fa30f320ecf6c1d29f7740eb3e8be", 3132 "url": "https://api.github.com/repos/top-think/framework/zipball/c255c22b2f5fa30f320ecf6c1d29f7740eb3e8be",
3030 "reference": "c255c22b2f5fa30f320ecf6c1d29f7740eb3e8be", 3133 "reference": "c255c22b2f5fa30f320ecf6c1d29f7740eb3e8be",
3031 - "shasum": "",  
3032 - "mirrors": [  
3033 - {  
3034 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
3035 - "preferred": true  
3036 - }  
3037 - ] 3134 + "shasum": ""
3038 }, 3135 },
3039 "require": { 3136 "require": {
3040 "php": ">=5.4.0", 3137 "php": ">=5.4.0",
@@ -3085,13 +3182,7 @@ @@ -3085,13 +3182,7 @@
3085 "type": "zip", 3182 "type": "zip",
3086 "url": "https://api.github.com/repos/top-think/think-captcha/zipball/1d64363c814c92f6086c4fa5e3223fe7e23db09d", 3183 "url": "https://api.github.com/repos/top-think/think-captcha/zipball/1d64363c814c92f6086c4fa5e3223fe7e23db09d",
3087 "reference": "1d64363c814c92f6086c4fa5e3223fe7e23db09d", 3184 "reference": "1d64363c814c92f6086c4fa5e3223fe7e23db09d",
3088 - "shasum": "",  
3089 - "mirrors": [  
3090 - {  
3091 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
3092 - "preferred": true  
3093 - }  
3094 - ] 3185 + "shasum": ""
3095 }, 3186 },
3096 "require": { 3187 "require": {
3097 "topthink/framework": "~5.0.0", 3188 "topthink/framework": "~5.0.0",
@@ -3131,13 +3222,7 @@ @@ -3131,13 +3222,7 @@
3131 "type": "zip", 3222 "type": "zip",
3132 "url": "https://api.github.com/repos/top-think/think-installer/zipball/1be326e68f63de4e95977ed50f46ae75f017556d", 3223 "url": "https://api.github.com/repos/top-think/think-installer/zipball/1be326e68f63de4e95977ed50f46ae75f017556d",
3133 "reference": "1be326e68f63de4e95977ed50f46ae75f017556d", 3224 "reference": "1be326e68f63de4e95977ed50f46ae75f017556d",
3134 - "shasum": "",  
3135 - "mirrors": [  
3136 - {  
3137 - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",  
3138 - "preferred": true  
3139 - }  
3140 - ] 3225 + "shasum": ""
3141 }, 3226 },
3142 "require": { 3227 "require": {
3143 "composer-plugin-api": "^1.0" 3228 "composer-plugin-api": "^1.0"
@@ -124,6 +124,7 @@ @@ -124,6 +124,7 @@
124 border: 1px solid #333; 124 border: 1px solid #333;
125 border-bottom: none !important; 125 border-bottom: none !important;
126 overflow: hidden; 126 overflow: hidden;
  127 + position: relative;
127 } 128 }
128 .item_title{ 129 .item_title{
129 display: flex; 130 display: flex;
  1 +/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */
  2 +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}k.fn=k.prototype={jquery:f,constructor:k,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return k.each(this,e)},map:function(n){return this.pushStack(k.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},k.extend=k.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(k.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||k.isPlainObject(n)?n:{},i=!1,a[t]=k.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},k.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t){b(e,{nonce:t&&t.nonce})},each:function(e,t){var n,r=0;if(d(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(p,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(d(Object(e))?k.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(d(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g.apply([],a)},guid:1,support:y}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=t[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var h=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,k="sizzle"+1*new Date,m=n.document,S=0,r=0,p=ue(),x=ue(),N=ue(),A=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",$=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",F=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="<a id='"+k+"'></a><select id='"+k+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!==C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!==C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(F," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[S,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[S,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[k]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace(B,"$1"));return s[k]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[S,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[k]||(e[k]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===S&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[k]&&(v=Ce(v)),y&&!y[k]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[k]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(B,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(B," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=N[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[k]?i.push(a):o.push(a);(a=N(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=S+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t===C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument===C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(S=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(S=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=k.split("").sort(D).join("")===k,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);k.find=h,k.expr=h.selectors,k.expr[":"]=k.expr.pseudos,k.uniqueSort=k.unique=h.uniqueSort,k.text=h.getText,k.isXMLDoc=h.isXML,k.contains=h.contains,k.escapeSelector=h.escape;var T=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&k(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},N=k.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1<i.call(n,e)!==r}):k.filter(n,e,r)}k.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?k.find.matchesSelector(r,e)?[r]:[]:k.find.matches(e,k.grep(t,function(e){return 1===e.nodeType}))},k.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(k(e).filter(function(){for(t=0;t<r;t++)if(k.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)k.find(e,i[t],n);return 1<r?k.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&N.test(e)?k(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(k.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&k(e);if(!N.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&k.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?k.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(k(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),k.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return"undefined"!=typeof e.contentDocument?e.contentDocument:(A(e,"template")&&(e=e.content||e),k.merge([],e.childNodes))}},function(r,i){k.fn[r]=function(e,t){var n=k.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=k.filter(t,n)),1<this.length&&(O[r]||k.uniqueSort(n),H.test(r)&&n.reverse()),this.pushStack(n)}});var R=/[^\x20\t\r\n\f]+/g;function M(e){return e}function I(e){throw e}function W(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}k.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},k.each(e.match(R)||[],function(e,t){n[t]=!0}),n):k.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){k.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return k.each(arguments,function(e,t){var n;while(-1<(n=k.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<k.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},k.extend({Deferred:function(e){var o=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return k.Deferred(function(r){k.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,M,s),l(u,o,I,s)):(u++,t.call(e,l(u,o,M,s),l(u,o,I,s),l(u,o,M,o.notifyWith))):(a!==M&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){k.Deferred.exceptionHook&&k.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==I&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(k.Deferred.getStackHook&&(t.stackTrace=k.Deferred.getStackHook()),C.setTimeout(t))}}return k.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:M,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:M)),o[2][3].add(l(0,e,m(n)?n:I))}).promise()},promise:function(e){return null!=e?k.extend(e,a):a}},s={};return k.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=k.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(W(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)W(i[t],a(t),o.reject);return o.promise()}});var $=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&$.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},k.readyException=function(e){C.setTimeout(function(){throw e})};var F=k.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),k.ready()}k.fn.ready=function(e){return F.then(e)["catch"](function(e){k.readyException(e)}),this},k.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--k.readyWait:k.isReady)||(k.isReady=!0)!==e&&0<--k.readyWait||F.resolveWith(E,[k])}}),k.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(k.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var _=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)_(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(k(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},z=/^-ms-/,U=/-([a-z])/g;function X(e,t){return t.toUpperCase()}function V(e){return e.replace(z,"ms-").replace(U,X)}var G=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Y(){this.expando=k.expando+Y.uid++}Y.uid=1,Y.prototype={cache:function(e){var t=e[this.expando];return t||(t={},G(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[V(t)]=n;else for(r in t)i[V(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in r?[t]:t.match(R)||[]).length;while(n--)delete r[t[n]]}(void 0===t||k.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!k.isEmptyObject(t)}};var Q=new Y,J=new Y,K=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function ee(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:K.test(i)?JSON.parse(i):i)}catch(e){}J.set(e,t,n)}else n=void 0;return n}k.extend({hasData:function(e){return J.hasData(e)||Q.hasData(e)},data:function(e,t,n){return J.access(e,t,n)},removeData:function(e,t){J.remove(e,t)},_data:function(e,t,n){return Q.access(e,t,n)},_removeData:function(e,t){Q.remove(e,t)}}),k.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=J.get(o),1===o.nodeType&&!Q.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=V(r.slice(5)),ee(o,r,i[r]));Q.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){J.set(this,n)}):_(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=J.get(o,n))?t:void 0!==(t=ee(o,n))?t:void 0;this.each(function(){J.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){J.remove(this,e)})}}),k.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Q.get(e,t),n&&(!r||Array.isArray(n)?r=Q.access(e,t,k.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=k.queue(e,t),r=n.length,i=n.shift(),o=k._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){k.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Q.get(e,n)||Q.access(e,n,{empty:k.Callbacks("once memory").add(function(){Q.remove(e,[t+"queue",n])})})}}),k.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?k.queue(this[0],t):void 0===n?this:this.each(function(){var e=k.queue(this,t,n);k._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&k.dequeue(this,t)})},dequeue:function(e){return this.each(function(){k.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=k.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Q.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var te=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ne=new RegExp("^(?:([+-])=|)("+te+")([a-z%]*)$","i"),re=["Top","Right","Bottom","Left"],ie=E.documentElement,oe=function(e){return k.contains(e.ownerDocument,e)},ae={composed:!0};ie.getRootNode&&(oe=function(e){return k.contains(e.ownerDocument,e)||e.getRootNode(ae)===e.ownerDocument});var se=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&oe(e)&&"none"===k.css(e,"display")},ue=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=a[o];return i};function le(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return k.css(e,t,"")},u=s(),l=n&&n[3]||(k.cssNumber[t]?"":"px"),c=e.nodeType&&(k.cssNumber[t]||"px"!==l&&+u)&&ne.exec(k.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)k.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,k.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ce={};function fe(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Q.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&se(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ce[s])||(o=a.body.appendChild(a.createElement(s)),u=k.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ce[s]=u)))):"none"!==n&&(l[c]="none",Q.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}k.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){se(this)?k(this).show():k(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Q.set(e[n],"globalEval",!t||Q.get(t[n],"globalEval"))}ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;var me,xe,be=/<|&#?\w+;/;function we(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))k.merge(p,o.nodeType?[o]:o);else if(be.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+k.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;k.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<k.inArray(o,r))i&&i.push(o);else if(l=oe(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}me=E.createDocumentFragment().appendChild(E.createElement("div")),(xe=E.createElement("input")).setAttribute("type","radio"),xe.setAttribute("checked","checked"),xe.setAttribute("name","t"),me.appendChild(xe),y.checkClone=me.cloneNode(!0).cloneNode(!0).lastChild.checked,me.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t<arguments.length;t++)u[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){a=k.event.handlers.call(this,s,l),t=0;while((i=a[t++])&&!s.isPropagationStopped()){s.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!s.isImmediatePropagationStopped())s.rnamespace&&!1!==o.namespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,void 0!==(r=((k.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,u))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<k(i,this).index(l):k.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(k.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[k.expando]?e:new k.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&De(t,"click",ke),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&De(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Q.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},k.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},k.Event=function(e,t){if(!(this instanceof k.Event))return new k.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?ke:Se,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&k.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[k.expando]=!0},k.Event.prototype={constructor:k.Event,isDefaultPrevented:Se,isPropagationStopped:Se,isImmediatePropagationStopped:Se,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=ke,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=ke,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=ke,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},k.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&Te.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Ce.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},k.event.addProp),k.each({focus:"focusin",blur:"focusout"},function(e,t){k.event.special[e]={setup:function(){return De(this,e,Ne),!1},trigger:function(){return De(this,e),!0},delegateType:t}}),k.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){k.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||k.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),k.fn.extend({on:function(e,t,n,r){return Ae(this,e,t,n,r)},one:function(e,t,n,r){return Ae(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,k(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Se),this.each(function(){k.event.remove(this,e,n,t)})}});var je=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/<script|<style|<link/i,Le=/checked\s*(?:[^=]|=\s*.checked.)/i,He=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n<r;n++)k.event.add(t,i,l[i][n]);J.hasData(e)&&(s=J.access(e),u=k.extend({},s),J.set(t,u))}}function Ie(n,r,i,o){r=g.apply([],r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&Le.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Ie(t,r,i,o)});if(f&&(t=(e=we(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=k.map(ve(e,"script"),Pe)).length;c<f;c++)u=e,c!==p&&(u=k.clone(u,!0,!0),s&&k.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,k.map(a,Re),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Q.access(u,"globalEval")&&k.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?k._evalUrl&&!u.noModule&&k._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")}):b(u.textContent.replace(He,""),u,l))}return n}function We(e,t,n){for(var r,i=t?k.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||k.cleanData(ve(r)),r.parentNode&&(n&&oe(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}k.extend({htmlPrefilter:function(e){return e.replace(je,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Me(o[r],a[r]);else Me(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=k.event.special,o=0;void 0!==(n=e[o]);o++)if(G(n)){if(t=n[Q.expando]){if(t.events)for(r in t.events)i[r]?k.event.remove(n,r):k.removeEvent(n,r,t.handle);n[Q.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),k.fn.extend({detach:function(e){return We(this,e,!0)},remove:function(e){return We(this,e)},text:function(e){return _(this,function(e){return void 0===e?k.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Ie(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Oe(this,e).appendChild(e)})},prepend:function(){return Ie(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Oe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Ie(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Ie(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(k.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return k.clone(this,e,t)})},html:function(e){return _(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!qe.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=k.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(k.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Ie(this,arguments,function(e){var t=this.parentNode;k.inArray(this,n)<0&&(k.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),k.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){k.fn[e]=function(e){for(var t,n=[],r=k(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),k(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var $e=new RegExp("^("+te+")(?!px)[a-z%]+$","i"),Fe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Be=new RegExp(re.join("|"),"i");function _e(e,t,n){var r,i,o,a,s=e.style;return(n=n||Fe(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||oe(e)||(a=k.style(e,t)),!y.pixelBoxStyles()&&$e.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function ze(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(u){s.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ie.appendChild(s).appendChild(u);var e=C.getComputedStyle(u);n="1%"!==e.top,a=12===t(e.marginLeft),u.style.right="60%",o=36===t(e.right),r=36===t(e.width),u.style.position="absolute",i=12===t(u.offsetWidth/3),ie.removeChild(s),u=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s=E.createElement("div"),u=E.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===u.style.backgroundClip,k.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),a},scrollboxSize:function(){return e(),i}}))}();var Ue=["Webkit","Moz","ms"],Xe=E.createElement("div").style,Ve={};function Ge(e){var t=k.cssProps[e]||Ve[e];return t||(e in Xe?e:Ve[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Ue.length;while(n--)if((e=Ue[n]+t)in Xe)return e}(e)||e)}var Ye=/^(none|table(?!-c[ea]).+)/,Qe=/^--/,Je={position:"absolute",visibility:"hidden",display:"block"},Ke={letterSpacing:"0",fontWeight:"400"};function Ze(e,t,n){var r=ne.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function et(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=k.css(e,n+re[a],!0,i)),r?("content"===n&&(u-=k.css(e,"padding"+re[a],!0,i)),"margin"!==n&&(u-=k.css(e,"border"+re[a]+"Width",!0,i))):(u+=k.css(e,"padding"+re[a],!0,i),"padding"!==n?u+=k.css(e,"border"+re[a]+"Width",!0,i):s+=k.css(e,"border"+re[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function tt(e,t,n){var r=Fe(e),i=(!y.boxSizingReliable()||n)&&"border-box"===k.css(e,"boxSizing",!1,r),o=i,a=_e(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if($e.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||"auto"===a||!parseFloat(a)&&"inline"===k.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===k.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+et(e,t,n||(i?"border":"content"),o,r,a)+"px"}function nt(e,t,n,r,i){return new nt.prototype.init(e,t,n,r,i)}k.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=_e(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=V(t),u=Qe.test(t),l=e.style;if(u||(t=Ge(s)),a=k.cssHooks[t]||k.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=ne.exec(n))&&i[1]&&(n=le(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(k.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=V(t);return Qe.test(t)||(t=Ge(s)),(a=k.cssHooks[t]||k.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=_e(e,t,r)),"normal"===i&&t in Ke&&(i=Ke[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),k.each(["height","width"],function(e,u){k.cssHooks[u]={get:function(e,t,n){if(t)return!Ye.test(k.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?tt(e,u,n):ue(e,Je,function(){return tt(e,u,n)})},set:function(e,t,n){var r,i=Fe(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===k.css(e,"boxSizing",!1,i),s=n?et(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-et(e,u,"border",!1,i)-.5)),s&&(r=ne.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=k.css(e,u)),Ze(0,t,s)}}}),k.cssHooks.marginLeft=ze(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(_e(e,"marginLeft"))||e.getBoundingClientRect().left-ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),k.each({margin:"",padding:"",border:"Width"},function(i,o){k.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+re[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(k.cssHooks[i+o].set=Ze)}),k.fn.extend({css:function(e,t){return _(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Fe(e),i=t.length;a<i;a++)o[t[a]]=k.css(e,t[a],!1,r);return o}return void 0!==n?k.style(e,t,n):k.css(e,t)},e,t,1<arguments.length)}}),((k.Tween=nt).prototype={constructor:nt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||k.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(k.cssNumber[n]?"":"px")},cur:function(){var e=nt.propHooks[this.prop];return e&&e.get?e.get(this):nt.propHooks._default.get(this)},run:function(e){var t,n=nt.propHooks[this.prop];return this.options.duration?this.pos=t=k.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):nt.propHooks._default.set(this),this}}).init.prototype=nt.prototype,(nt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=k.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){k.fx.step[e.prop]?k.fx.step[e.prop](e):1!==e.elem.nodeType||!k.cssHooks[e.prop]&&null==e.elem.style[Ge(e.prop)]?e.elem[e.prop]=e.now:k.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=nt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},k.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},k.fx=nt.prototype.init,k.fx.step={};var rt,it,ot,at,st=/^(?:toggle|show|hide)$/,ut=/queueHooks$/;function lt(){it&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(lt):C.setTimeout(lt,k.fx.interval),k.fx.tick())}function ct(){return C.setTimeout(function(){rt=void 0}),rt=Date.now()}function ft(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=re[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function pt(e,t,n){for(var r,i=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function dt(o,e,t){var n,a,r=0,i=dt.prefilters.length,s=k.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=rt||ct(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:k.extend({},e),opts:k.extend(!0,{specialEasing:{},easing:k.easing._default},t),originalProperties:e,originalOptions:t,startTime:rt||ct(),duration:t.duration,tweens:[],createTween:function(e,t){var n=k.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=V(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=k.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=dt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(k._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return k.map(c,pt,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),k.fx.timer(k.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}k.Animation=k.extend(dt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return le(n.elem,e,ne.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(R);for(var n,r=0,i=e.length;r<i;r++)n=e[r],dt.tweeners[n]=dt.tweeners[n]||[],dt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&se(e),v=Q.get(e,"fxshow");for(r in n.queue||(null==(a=k._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,k.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],st.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||k.style(e,r)}if((u=!k.isEmptyObject(t))||!k.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Q.get(e,"display")),"none"===(c=k.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=k.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===k.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Q.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&fe([e],!0),p.done(function(){for(r in g||fe([e]),Q.remove(e,"fxshow"),d)k.style(e,r,d[r])})),u=pt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?dt.prefilters.unshift(e):dt.prefilters.push(e)}}),k.speed=function(e,t,n){var r=e&&"object"==typeof e?k.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return k.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in k.fx.speeds?r.duration=k.fx.speeds[r.duration]:r.duration=k.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&k.dequeue(this,r.queue)},r},k.fn.extend({fadeTo:function(e,t,n,r){return this.filter(se).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=k.isEmptyObject(t),o=k.speed(e,n,r),a=function(){var e=dt(this,k.extend({},t),o);(i||Q.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&!1!==i&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=k.timers,r=Q.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&ut.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||k.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Q.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=k.timers,o=n?n.length:0;for(t.finish=!0,k.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),k.each(["toggle","show","hide"],function(e,r){var i=k.fn[r];k.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(ft(r,!0),e,t,n)}}),k.each({slideDown:ft("show"),slideUp:ft("hide"),slideToggle:ft("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){k.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),k.timers=[],k.fx.tick=function(){var e,t=0,n=k.timers;for(rt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||k.fx.stop(),rt=void 0},k.fx.timer=function(e){k.timers.push(e),k.fx.start()},k.fx.interval=13,k.fx.start=function(){it||(it=!0,lt())},k.fx.stop=function(){it=null},k.fx.speeds={slow:600,fast:200,_default:400},k.fn.delay=function(r,e){return r=k.fx&&k.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},ot=E.createElement("input"),at=E.createElement("select").appendChild(E.createElement("option")),ot.type="checkbox",y.checkOn=""!==ot.value,y.optSelected=at.selected,(ot=E.createElement("input")).value="t",ot.type="radio",y.radioValue="t"===ot.value;var ht,gt=k.expr.attrHandle;k.fn.extend({attr:function(e,t){return _(this,k.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){k.removeAttr(this,e)})}}),k.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?k.prop(e,t,n):(1===o&&k.isXMLDoc(e)||(i=k.attrHooks[t.toLowerCase()]||(k.expr.match.bool.test(t)?ht:void 0)),void 0!==n?null===n?void k.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=k.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(R);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ht={set:function(e,t,n){return!1===t?k.removeAttr(e,n):e.setAttribute(n,n),n}},k.each(k.expr.match.bool.source.match(/\w+/g),function(e,t){var a=gt[t]||k.find.attr;gt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=gt[o],gt[o]=r,r=null!=a(e,t,n)?o:null,gt[o]=i),r}});var vt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;function mt(e){return(e.match(R)||[]).join(" ")}function xt(e){return e.getAttribute&&e.getAttribute("class")||""}function bt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(R)||[]}k.fn.extend({prop:function(e,t){return _(this,k.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[k.propFix[e]||e]})}}),k.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&k.isXMLDoc(e)||(t=k.propFix[t]||t,i=k.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=k.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(k.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){k.propFix[this.toLowerCase()]=this}),k.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){k(this).addClass(t.call(this,e,xt(this)))});if((e=bt(t)).length)while(n=this[u++])if(i=xt(n),r=1===n.nodeType&&" "+mt(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=mt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){k(this).removeClass(t.call(this,e,xt(this)))});if(!arguments.length)return this.attr("class","");if((e=bt(t)).length)while(n=this[u++])if(i=xt(n),r=1===n.nodeType&&" "+mt(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=mt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){k(this).toggleClass(i.call(this,e,xt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=k(this),r=bt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=xt(this))&&Q.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Q.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+mt(xt(n))+" ").indexOf(t))return!0;return!1}});var wt=/\r/g;k.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,k(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=k.map(t,function(e){return null==e?"":e+""})),(r=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=k.valHooks[t.type]||k.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(wt,""):null==e?"":e:void 0}}),k.extend({valHooks:{option:{get:function(e){var t=k.find.attr(e,"value");return null!=t?t:mt(k.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=k(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=k.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<k.inArray(k.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),k.each(["radio","checkbox"],function(){k.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<k.inArray(k(e).val(),t)}},y.checkOn||(k.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var Tt=/^(?:focusinfocus|focusoutblur)$/,Ct=function(e){e.stopPropagation()};k.extend(k.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!Tt.test(d+k.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[k.expando]?e:new k.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:k.makeArray(t,[e]),c=k.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,Tt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Q.get(o,"events")||{})[e.type]&&Q.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&G(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!G(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),k.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Ct),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Ct),k.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=k.extend(new k.Event,n,{type:e,isSimulated:!0});k.event.trigger(r,null,t)}}),k.fn.extend({trigger:function(e,t){return this.each(function(){k.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return k.event.trigger(e,t,n,!0)}}),y.focusin||k.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){k.event.simulate(r,e.target,k.event.fix(e))};k.event.special[r]={setup:function(){var e=this.ownerDocument||this,t=Q.access(e,r);t||e.addEventListener(n,i,!0),Q.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this,t=Q.access(e,r)-1;t?Q.access(e,r,t):(e.removeEventListener(n,i,!0),Q.remove(e,r))}}});var Et=C.location,kt=Date.now(),St=/\?/;k.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||k.error("Invalid XML: "+e),t};var Nt=/\[\]$/,At=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,jt=/^(?:input|select|textarea|keygen)/i;function qt(n,e,r,i){var t;if(Array.isArray(e))k.each(e,function(e,t){r||Nt.test(n)?i(n,t):qt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)qt(n+"["+t+"]",e[t],r,i)}k.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!k.isPlainObject(e))k.each(e,function(){i(this.name,this.value)});else for(n in e)qt(n,e[n],t,i);return r.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=k.prop(this,"elements");return e?k.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!k(this).is(":disabled")&&jt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=k(this).val();return null==n?null:Array.isArray(n)?k.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}});var Lt=/%20/g,Ht=/#.*$/,Ot=/([?&])_=[^&]*/,Pt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:GET|HEAD)$/,Mt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Ft=E.createElement("a");function Bt(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(R)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function _t(t,i,o,a){var s={},u=t===Wt;function l(e){var r;return s[e]=!0,k.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function zt(e,t){var n,r,i=k.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&k.extend(!0,e,r),e}Ft.href=Et.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,k.ajaxSettings),t):zt(k.ajaxSettings,e)},ajaxPrefilter:Bt(It),ajaxTransport:Bt(Wt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=k.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?k(y):k.event,x=k.Deferred(),b=k.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Pt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Et.href)+"").replace(Mt,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(R)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Ft.protocol+"//"+Ft.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=k.param(v.data,v.traditional)),_t(It,v,t,T),h)return T;for(i in(g=k.event&&v.global)&&0==k.active++&&k.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Rt.test(v.type),f=v.url.replace(Ht,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Lt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(St.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Ot,"$1"),o=(St.test(f)?"&":"?")+"_="+kt+++o),v.url=f+o),v.ifModified&&(k.lastModified[f]&&T.setRequestHeader("If-Modified-Since",k.lastModified[f]),k.etag[f]&&T.setRequestHeader("If-None-Match",k.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+$t+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=_t(Wt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(k.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(k.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--k.active||k.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return k.get(e,t,n,"json")},getScript:function(e,t){return k.get(e,void 0,t,"script")}}),k.each(["get","post"],function(e,i){k[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),k.ajax(k.extend({url:e,type:i,dataType:r,data:t,success:n},k.isPlainObject(e)&&e))}}),k._evalUrl=function(e,t){return k.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){k.globalEval(e,t)}})},k.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=k(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){k(this).wrapInner(n.call(this,e))}):this.each(function(){var e=k(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){k(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){k(this).replaceWith(this.childNodes)}),this}}),k.expr.pseudos.hidden=function(e){return!k.expr.pseudos.visible(e)},k.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Ut={0:200,1223:204},Xt=k.ajaxSettings.xhr();y.cors=!!Xt&&"withCredentials"in Xt,y.ajax=Xt=!!Xt,k.ajaxTransport(function(i){var o,a;if(y.cors||Xt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Ut[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),k.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return k.globalEval(e),e}}}),k.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),k.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=k("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=mt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&k.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?k("<div>").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}}),k.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),k.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),k.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||k.guid++,i},k.holdReady=function(e){e?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=A,k.isFunction=m,k.isWindow=x,k.camelCase=V,k.type=w,k.now=Date.now,k.isNumeric=function(e){var t=k.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return k});var Qt=C.jQuery,Jt=C.$;return k.noConflict=function(e){return C.$===k&&(C.$=Jt),e&&C.jQuery===k&&(C.jQuery=Qt),k},e||(C.jQuery=C.$=k),k});
  1 +/**
  2 + * @param {*} params {}
  3 + * /**
  4 + * whiteBord 白板盒子canvas id名
  5 + * popverBox 确认签字以后想要隐藏掉的盒子
  6 + * againWrite 重写按钮id名
  7 + * sureWrite 确定按钮id名
  8 + * whiteBordPtions 白板配置项
  9 + * sureWriteCallback 确定签名之后的回调函数
  10 + * @returns 签名的图片:格式base64
  11 + */
  12 +function signature(params) {
  13 + let {whiteBord,againWrite,sureWrite,whiteBordPtions,sureWriteCallback} = params
  14 + let whiteBoardDom = document.getElementById(whiteBord);
  15 + let againWriteBtn = document.getElementById(againWrite)
  16 + let sureWriteBtn = document.getElementById(sureWrite)
  17 +
  18 + let writeCanvas;
  19 + let imageBase64=''
  20 + againWriteBtn.addEventListener("click", function () {
  21 + drawClear()
  22 + })
  23 + sureWriteBtn.addEventListener('click', function () {
  24 + savePict()
  25 + })
  26 + function WriteFont(options) {
  27 + let obj = {
  28 + canvas: whiteBoardDom,
  29 + context: whiteBoardDom.getContext("2d"),
  30 + isWrite: false, //是否开始
  31 + canvasWidth: 300, //canvas宽高
  32 + canvasHeight: 400,
  33 + lastPoint: {}, //
  34 + writeWidth: 2, //基础轨迹宽度
  35 + writeColor: '#000', // 轨迹颜色
  36 + }
  37 +
  38 + for (let name in options) {
  39 + obj[name] = options[name];
  40 + }
  41 +
  42 + /**
  43 + * 轨迹宽度
  44 + */
  45 + this.setLineWidth = function () {
  46 + let nowTime = new Date().getTime();
  47 + obj.lastWriteTime = nowTime;
  48 + obj.context.lineWidth = obj.writeWidth;
  49 +
  50 + }
  51 +
  52 + /**
  53 + * 绘制轨迹
  54 + */
  55 + this.writing = function (point) {
  56 + obj.context.beginPath();
  57 + obj.context.moveTo(obj.lastPoint.x, obj.lastPoint.y);
  58 + obj.context.lineTo(point.x, point.y);
  59 + this.setLineWidth();
  60 + obj.context.stroke();
  61 + obj.lastPoint = point;
  62 + obj.context.closePath();
  63 + }
  64 +
  65 + /**
  66 + * 轨迹样式
  67 + */
  68 + this.writeContextStyle = function () {
  69 + obj.context.beginPath();
  70 + obj.context.strokeStyle = obj.writeColor;
  71 + obj.context.lineCap = 'round';
  72 + obj.context.lineJoin = "round";
  73 + }
  74 +
  75 + /**
  76 + * 写开始
  77 + */
  78 + this.writeBegin = function (point) {
  79 + obj.isWrite = true;
  80 + obj.lastWriteTime = new Date().getTime();
  81 + obj.lastPoint = point;
  82 + this.writeContextStyle();
  83 + }
  84 +
  85 + /**
  86 + * 写结束
  87 + */
  88 + this.writeEnd = function () {
  89 + obj.isWrite = false;
  90 + }
  91 +
  92 + /**
  93 + * 清空画板
  94 + */
  95 + this.canvasClear = function () {
  96 + obj.context.save();
  97 + obj.context.strokeStyle = '#fff';
  98 + obj.context.clearRect(0, 0, obj.canvasWidth, obj.canvasHeight);
  99 + obj.context.restore();
  100 + }
  101 +
  102 + /**
  103 + * 初始化画板
  104 + */
  105 + this.canvasInit = function () {
  106 + whiteBoardDom.width = obj.canvasWidth;
  107 + whiteBoardDom.height = obj.canvasHeight;
  108 + emptyCanvas = whiteBoardDom.toDataURL("image/png");
  109 + }
  110 + let that = this
  111 + /**======================事件绑定===========================**/
  112 + whiteBoardDom.addEventListener('touchstart', function (e) {
  113 +
  114 + let point = {
  115 + x: e.touches[0].pageX - 35,
  116 + y: e.touches[0].pageY - 60
  117 + };
  118 + that.writeBegin(point);
  119 + point = {
  120 + x: point.x / obj.canvasWidth * 330,
  121 + y: point.y / obj.canvasHeight * 170
  122 + };
  123 + });
  124 +
  125 + whiteBoardDom.addEventListener('touchend', function (e) {
  126 + that.writeEnd();
  127 + });
  128 +
  129 + whiteBoardDom.addEventListener('touchmove', function (e) {
  130 + if (obj.isWrite) {
  131 + let point = {
  132 + x: e.touches[0].pageX - 35,
  133 + y: e.touches[0].pageY - 60
  134 + };
  135 + that.writing(point);
  136 + point = {
  137 + x: point.x / obj.canvasWidth * 330,
  138 + y: point.y / obj.canvasHeight * 170
  139 + };
  140 + }
  141 + });
  142 +
  143 +
  144 + this.canvasInit();
  145 + this.canvasClear();
  146 + obj.control = {
  147 + clearCanvas: that.canvasClear
  148 + };
  149 +
  150 + this.option = obj;
  151 +
  152 + }
  153 + /**
  154 + * 初始化调用
  155 + * 设置参数
  156 + */
  157 + writeCanvas = new WriteFont('whiteBord', whiteBordPtions);
  158 +
  159 + function savePict() {
  160 + imageBase64 = whiteBoardDom.toDataURL("image/png"); //base64
  161 + writeCanvas.option.control.clearCanvas();
  162 + sureWriteCallback(imageBase64)
  163 + }
  164 + function drawClear() {
  165 + writeCanvas.option.control.clearCanvas();
  166 +
  167 + }
  168 +}
  1 +composer.lock
  2 +vendor
  3 +nbproject
  4 +.idea
  5 +.buildpath
  6 +.project
  7 +.DS_Store
  8 +.*.sw*
  9 +.*.un~
  1 +language: php
  2 +php:
  3 + - 5.4
  4 + - 5.5
  5 + - 5.6
  6 + - 7.0
  7 + - 7.1
  8 + - hhvm
  9 +
  10 +install:
  11 + - travis_retry composer install --no-interaction
  12 + - composer info -i
  13 +
  14 +script: vendor/bin/phpunit --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml tests
  1 +Copyright (c) 2013, Ben 'DASPRiD' Scholzen
  2 +All rights reserved.
  3 +
  4 +Redistribution and use in source and binary forms, with or without
  5 +modification, are permitted provided that the following conditions are met:
  6 +
  7 +1. Redistributions of source code must retain the above copyright notice, this
  8 + list of conditions and the following disclaimer.
  9 +2. Redistributions in binary form must reproduce the above copyright notice,
  10 + this list of conditions and the following disclaimer in the documentation
  11 + and/or other materials provided with the distribution.
  12 +
  13 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  14 +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  15 +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  16 +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  17 +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  18 +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  19 +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20 +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  21 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  22 +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1 +<?php
  2 +/**
  3 + * BaconQrCode
  4 + *
  5 + * @link http://github.com/Bacon/BaconQrCode For the canonical source repository
  6 + * @copyright 2013 Ben 'DASPRiD' Scholzen
  7 + * @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
  8 + */
  9 +
  10 +namespace BaconQrCode;
  11 +
  12 +use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
  13 +
  14 +/**
  15 + * Module for generating QR codes.
  16 + */
  17 +class Module implements AutoloaderProviderInterface
  18 +{
  19 + /**
  20 + * Get autoloader config.
  21 + *
  22 + * @return array
  23 + */
  24 + public function getAutoloaderConfig()
  25 + {
  26 + return array(
  27 + 'Zend\Loader\ClassMapAutoloader' => array(
  28 + __DIR__ . '/autoload_classmap.php',
  29 + ),
  30 + 'Zend\Loader\StandardAutoloader' => array(
  31 + 'namespaces' => array(
  32 + __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
  33 + ),
  34 + ),
  35 + );
  36 + }
  37 +}
  1 +QR Code generator
  2 +=================
  3 +
  4 +Master: [![Build Status](https://api.travis-ci.org/Bacon/BaconQrCode.png?branch=master)](http://travis-ci.org/Bacon/BaconQrCode)
  5 +
  6 +Introduction
  7 +------------
  8 +BaconQrCode is a port of QR code portion of the ZXing library. It currently
  9 +only features the encoder part, but could later receive the decoder part as
  10 +well.
  11 +
  12 +As the Reed Solomon codec implementation of the ZXing library performs quite
  13 +slow in PHP, it was exchanged with the implementation by Phil Karn.
  14 +
  15 +
  16 +Example usage
  17 +-------------
  18 +```php
  19 +$renderer = new \BaconQrCode\Renderer\Image\Png();
  20 +$renderer->setHeight(256);
  21 +$renderer->setWidth(256);
  22 +$writer = new \BaconQrCode\Writer($renderer);
  23 +$writer->writeFile('Hello World!', 'qrcode.png');
  24 +```
  1 +<?php
  2 +// Generated by ZF2's ./bin/classmap_generator.php
  3 +return array(
  4 + 'BaconQrCode\Common\AbstractEnum' => __DIR__ . '/src/BaconQrCode/Common/AbstractEnum.php',
  5 + 'BaconQrCode\Common\BitArray' => __DIR__ . '/src/BaconQrCode/Common/BitArray.php',
  6 + 'BaconQrCode\Common\BitMatrix' => __DIR__ . '/src/BaconQrCode/Common/BitMatrix.php',
  7 + 'BaconQrCode\Common\BitUtils' => __DIR__ . '/src/BaconQrCode/Common/BitUtils.php',
  8 + 'BaconQrCode\Common\CharacterSetEci' => __DIR__ . '/src/BaconQrCode/Common/CharacterSetEci.php',
  9 + 'BaconQrCode\Common\EcBlock' => __DIR__ . '/src/BaconQrCode/Common/EcBlock.php',
  10 + 'BaconQrCode\Common\EcBlocks' => __DIR__ . '/src/BaconQrCode/Common/EcBlocks.php',
  11 + 'BaconQrCode\Common\ErrorCorrectionLevel' => __DIR__ . '/src/BaconQrCode/Common/ErrorCorrectionLevel.php',
  12 + 'BaconQrCode\Common\FormatInformation' => __DIR__ . '/src/BaconQrCode/Common/FormatInformation.php',
  13 + 'BaconQrCode\Common\Mode' => __DIR__ . '/src/BaconQrCode/Common/Mode.php',
  14 + 'BaconQrCode\Common\ReedSolomonCodec' => __DIR__ . '/src/BaconQrCode/Common/ReedSolomonCodec.php',
  15 + 'BaconQrCode\Common\Version' => __DIR__ . '/src/BaconQrCode/Common/Version.php',
  16 + 'BaconQrCode\Encoder\BlockPair' => __DIR__ . '/src/BaconQrCode/Encoder/BlockPair.php',
  17 + 'BaconQrCode\Encoder\ByteMatrix' => __DIR__ . '/src/BaconQrCode/Encoder/ByteMatrix.php',
  18 + 'BaconQrCode\Encoder\Encoder' => __DIR__ . '/src/BaconQrCode/Encoder/Encoder.php',
  19 + 'BaconQrCode\Encoder\MaskUtil' => __DIR__ . '/src/BaconQrCode/Encoder/MaskUtil.php',
  20 + 'BaconQrCode\Encoder\MatrixUtil' => __DIR__ . '/src/BaconQrCode/Encoder/MatrixUtil.php',
  21 + 'BaconQrCode\Encoder\QrCode' => __DIR__ . '/src/BaconQrCode/Encoder/QrCode.php',
  22 + 'BaconQrCode\Exception\ExceptionInterface' => __DIR__ . '/src/BaconQrCode/Exception/ExceptionInterface.php',
  23 + 'BaconQrCode\Exception\InvalidArgumentException' => __DIR__ . '/src/BaconQrCode/Exception/InvalidArgumentException.php',
  24 + 'BaconQrCode\Exception\OutOfBoundsException' => __DIR__ . '/src/BaconQrCode/Exception/OutOfBoundsException.php',
  25 + 'BaconQrCode\Exception\RuntimeException' => __DIR__ . '/src/BaconQrCode/Exception/RuntimeException.php',
  26 + 'BaconQrCode\Exception\UnexpectedValueException' => __DIR__ . '/src/BaconQrCode/Exception/UnexpectedValueException.php',
  27 + 'BaconQrCode\Exception\WriterException' => __DIR__ . '/src/BaconQrCode/Exception/WriterException.php',
  28 + 'BaconQrCode\Renderer\Color\Cmyk' => __DIR__ . '/src/BaconQrCode/Renderer/Color/Cmyk.php',
  29 + 'BaconQrCode\Renderer\Color\ColorInterface' => __DIR__ . '/src/BaconQrCode/Renderer/Color/ColorInterface.php',
  30 + 'BaconQrCode\Renderer\Color\Gray' => __DIR__ . '/src/BaconQrCode/Renderer/Color/Gray.php',
  31 + 'BaconQrCode\Renderer\Color\Rgb' => __DIR__ . '/src/BaconQrCode/Renderer/Color/Rgb.php',
  32 + 'BaconQrCode\Renderer\Image\AbstractRenderer' => __DIR__ . '/src/BaconQrCode/Renderer/Image/AbstractRenderer.php',
  33 + 'BaconQrCode\Renderer\Image\Decorator\DecoratorInterface' => __DIR__ . '/src/BaconQrCode/Renderer/Image/Decorator/DecoratorInterface.php',
  34 + 'BaconQrCode\Renderer\Image\Decorator\FinderPattern' => __DIR__ . '/src/BaconQrCode/Renderer/Image/Decorator/FinderPattern.php',
  35 + 'BaconQrCode\Renderer\Image\Eps' => __DIR__ . '/src/BaconQrCode/Renderer/Image/Eps.php',
  36 + 'BaconQrCode\Renderer\Image\Png' => __DIR__ . '/src/BaconQrCode/Renderer/Image/Png.php',
  37 + 'BaconQrCode\Renderer\Image\RendererInterface' => __DIR__ . '/src/BaconQrCode/Renderer/Image/RendererInterface.php',
  38 + 'BaconQrCode\Renderer\Image\Svg' => __DIR__ . '/src/BaconQrCode/Renderer/Image/Svg.php',
  39 + 'BaconQrCode\Renderer\RendererInterface' => __DIR__ . '/src/BaconQrCode/Renderer/RendererInterface.php',
  40 + 'BaconQrCode\Renderer\Text\Plain' => __DIR__ . '/src/BaconQrCode/Renderer/Text/Plain.php',
  41 + 'BaconQrCode\Renderer\Text\Html' => __DIR__ . '/src/BaconQrCode/Renderer/Text/Html.php',
  42 + 'BaconQrCode\Writer' => __DIR__ . '/src/BaconQrCode/Writer.php',
  43 +);
  1 +<?php
  2 +return function ($class) {
  3 + static $map;
  4 + if (!$map) {
  5 + $map = include __DIR__ . '/autoload_classmap.php';
  6 + }
  7 +
  8 + if (!isset($map[$class])) {
  9 + return false;
  10 + }
  11 + return include $map[$class];
  12 +};
  1 +<?php
  2 +spl_autoload_register(include __DIR__ . '/autoload_function.php');
  1 +{
  2 + "name": "bacon/bacon-qr-code",
  3 + "description": "BaconQrCode is a QR code generator for PHP.",
  4 + "license" : "BSD-2-Clause",
  5 + "homepage": "https://github.com/Bacon/BaconQrCode",
  6 + "require": {
  7 + "php": "^5.4|^7.0",
  8 + "ext-iconv": "*"
  9 + },
  10 + "suggest": {
  11 + "ext-gd": "to generate QR code images"
  12 + },
  13 + "authors": [
  14 + {
  15 + "name": "Ben Scholzen 'DASPRiD'",
  16 + "email": "mail@dasprids.de",
  17 + "homepage": "http://www.dasprids.de",
  18 + "role": "Developer"
  19 + }
  20 + ],
  21 + "autoload": {
  22 + "psr-0": {
  23 + "BaconQrCode": "src/"
  24 + }
  25 + },
  26 + "require-dev": {
  27 + "phpunit/phpunit": "^4.8"
  28 + }
  29 +}
  1 +<?php
  2 +/**
  3 + * BaconQrCode
  4 + *
  5 + * @link http://github.com/Bacon/BaconQrCode For the canonical source repository
  6 + * @copyright 2013 Ben 'DASPRiD' Scholzen
  7 + * @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
  8 + */
  9 +
  10 +namespace BaconQrCode\Common;
  11 +
  12 +use BaconQrCode\Exception;
  13 +use ReflectionClass;
  14 +
  15 +/**
  16 + * A general enum implementation until we got SplEnum.
  17 + */
  18 +abstract class AbstractEnum
  19 +{
  20 + /**
  21 + * Default value.
  22 + */
  23 + const __default = null;
  24 +
  25 + /**
  26 + * Current value.
  27 + *
  28 + * @var mixed
  29 + */
  30 + protected $value;
  31 +
  32 + /**
  33 + * Cache of constants.
  34 + *
  35 + * @var array
  36 + */
  37 + protected $constants;
  38 +
  39 + /**
  40 + * Whether to handle values strict or not.
  41 + *
  42 + * @var boolean
  43 + */
  44 + protected $strict;
  45 +
  46 + /**
  47 + * Creates a new enum.
  48 + *
  49 + * @param mixed $initialValue
  50 + * @param boolean $strict
  51 + */
  52 + public function __construct($initialValue = null, $strict = false)
  53 + {
  54 + $this->strict = $strict;
  55 + $this->change($initialValue);
  56 + }
  57 +
  58 + /**
  59 + * Changes the value of the enum.
  60 + *
  61 + * @param mixed $value
  62 + * @return void
  63 + */
  64 + public function change($value)
  65 + {
  66 + if (!in_array($value, $this->getConstList(), $this->strict)) {
  67 + throw new Exception\UnexpectedValueException('Value not a const in enum ' . get_class($this));
  68 + }
  69 +
  70 + $this->value = $value;
  71 + }
  72 +
  73 + /**
  74 + * Gets current value.
  75 + *
  76 + * @return mixed
  77 + */
  78 + public function get()
  79 + {
  80 + return $this->value;
  81 + }
  82 +
  83 + /**
  84 + * Gets all constants (possible values) as an array.
  85 + *
  86 + * @param boolean $includeDefault
  87 + * @return array
  88 + */
  89 + public function getConstList($includeDefault = true)
  90 + {
  91 + if ($this->constants === null) {
  92 + $reflection = new ReflectionClass($this);
  93 + $this->constants = $reflection->getConstants();
  94 + }
  95 +
  96 + if ($includeDefault) {
  97 + return $this->constants;
  98 + }
  99 +
  100 + $constants = $this->constants;
  101 + unset($constants['__default']);
  102 +
  103 + return $constants;
  104 + }
  105 +
  106 + /**
  107 + * Gets the name of the enum.
  108 + *
  109 + * @return string
  110 + */
  111 + public function __toString()
  112 + {
  113 + return array_search($this->value, $this->getConstList());
  114 + }
  115 +}
  1 +<?php
  2 +/**
  3 + * BaconQrCode
  4 + *
  5 + * @link http://github.com/Bacon/BaconQrCode For the canonical source repository
  6 + * @copyright 2013 Ben 'DASPRiD' Scholzen
  7 + * @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
  8 + */
  9 +
  10 +namespace BaconQrCode\Common;
  11 +
  12 +use SplFixedArray;
  13 +
  14 +/**
  15 + * A simple, fast array of bits.
  16 + */
  17 +class BitArray
  18 +{
  19 + /**
  20 + * Bits represented as an array of integers.
  21 + *
  22 + * @var SplFixedArray
  23 + */
  24 + protected $bits;
  25 +
  26 + /**
  27 + * Size of the bit array in bits.
  28 + *
  29 + * @var integer
  30 + */
  31 + protected $size;
  32 +
  33 + /**
  34 + * Creates a new bit array with a given size.
  35 + *
  36 + * @param integer $size
  37 + */
  38 + public function __construct($size = 0)
  39 + {
  40 + $this->size = $size;
  41 + $this->bits = new SplFixedArray(($this->size + 31) >> 3);
  42 + }
  43 +
  44 + /**
  45 + * Gets the size in bits.
  46 + *
  47 + * @return integer
  48 + */
  49 + public function getSize()
  50 + {
  51 + return $this->size;
  52 + }
  53 +
  54 + /**
  55 + * Gets the size in bytes.
  56 + *
  57 + * @return integer
  58 + */
  59 + public function getSizeInBytes()
  60 + {
  61 + return ($this->size + 7) >> 3;
  62 + }
  63 +
  64 + /**
  65 + * Ensures that the array has a minimum capacity.
  66 + *
  67 + * @param integer $size
  68 + * @return void
  69 + */
  70 + public function ensureCapacity($size)
  71 + {
  72 + if ($size > count($this->bits) << 5) {
  73 + $this->bits->setSize(($size + 31) >> 5);
  74 + }
  75 + }
  76 +
  77 + /**
  78 + * Gets a specific bit.
  79 + *
  80 + * @param integer $i
  81 + * @return boolean
  82 + */
  83 + public function get($i)
  84 + {
  85 + return ($this->bits[$i >> 5] & (1 << ($i & 0x1f))) !== 0;
  86 + }
  87 +
  88 + /**
  89 + * Sets a specific bit.
  90 + *
  91 + * @param integer $i
  92 + * @return void
  93 + */
  94 + public function set($i)
  95 + {
  96 + $this->bits[$i >> 5] = $this->bits[$i >> 5] | 1 << ($i & 0x1f);
  97 + }
  98 +
  99 + /**
  100 + * Flips a specific bit.
  101 + *
  102 + * @param integer $i
  103 + * @return void
  104 + */
  105 + public function flip($i)
  106 + {
  107 + $this->bits[$i >> 5] ^= 1 << ($i & 0x1f);
  108 + }
  109 +
  110 + /**
  111 + * Gets the next set bit position from a given position.
  112 + *
  113 + * @param integer $from
  114 + * @return integer
  115 + */
  116 + public function getNextSet($from)
  117 + {
  118 + if ($from >= $this->size) {
  119 + return $this->size;
  120 + }
  121 +
  122 + $bitsOffset = $from >> 5;
  123 + $currentBits = $this->bits[$bitsOffset];
  124 + $bitsLength = count($this->bits);
  125 +
  126 + $currentBits &= ~((1 << ($from & 0x1f)) - 1);
  127 +
  128 + while ($currentBits === 0) {
  129 + if (++$bitsOffset === $bitsLength) {
  130 + return $this->size;
  131 + }
  132 +
  133 + $currentBits = $this->bits[$bitsOffset];
  134 + }
  135 +
  136 + $result = ($bitsOffset << 5) + BitUtils::numberOfTrailingZeros($currentBits);
  137 +
  138 + return $result > $this->size ? $this->size : $result;
  139 + }
  140 +
  141 + /**
  142 + * Gets the next unset bit position from a given position.
  143 + *
  144 + * @param integer $from
  145 + * @return integer
  146 + */
  147 + public function getNextUnset($from)
  148 + {
  149 + if ($from >= $this->size) {
  150 + return $this->size;
  151 + }
  152 +
  153 + $bitsOffset = $from >> 5;
  154 + $currentBits = ~$this->bits[$bitsOffset];
  155 + $bitsLength = count($this->bits);
  156 +
  157 + $currentBits &= ~((1 << ($from & 0x1f)) - 1);
  158 +
  159 + while ($currentBits === 0) {
  160 + if (++$bitsOffset === $bitsLength) {
  161 + return $this->size;
  162 + }
  163 +
  164 + $currentBits = ~$this->bits[$bitsOffset];
  165 + }
  166 +
  167 + $result = ($bitsOffset << 5) + BitUtils::numberOfTrailingZeros($currentBits);
  168 +
  169 + return $result > $this->size ? $this->size : $result;
  170 + }
  171 +
  172 + /**
  173 + * Sets a bulk of bits.
  174 + *
  175 + * @param integer $i
  176 + * @param integer $newBits
  177 + * @return void
  178 + */
  179 + public function setBulk($i, $newBits)
  180 + {
  181 + $this->bits[$i >> 5] = $newBits;
  182 + }
  183 +
  184 + /**
  185 + * Sets a range of bits.
  186 + *
  187 + * @param integer $start
  188 + * @param integer $end
  189 + * @return void
  190 + * @throws Exception\InvalidArgumentException
  191 + */
  192 + public function setRange($start, $end)
  193 + {
  194 + if ($end < $start) {
  195 + throw new Exception\InvalidArgumentException('End must be greater or equal to start');
  196 + }
  197 +
  198 + if ($end === $start) {
  199 + return;
  200 + }
  201 +
  202 + $end--;
  203 +
  204 + $firstInt = $start >> 5;
  205 + $lastInt = $end >> 5;
  206 +
  207 + for ($i = $firstInt; $i <= $lastInt; $i++) {
  208 + $firstBit = $i > $firstInt ? 0 : $start & 0x1f;
  209 + $lastBit = $i < $lastInt ? 31 : $end & 0x1f;
  210 +
  211 + if ($firstBit === 0 && $lastBit === 31) {
  212 + $mask = 0x7fffffff;
  213 + } else {
  214 + $mask = 0;
  215 +
  216 + for ($j = $firstBit; $j < $lastBit; $j++) {
  217 + $mask |= 1 << $j;
  218 + }
  219 + }
  220 +
  221 + $this->bits[$i] = $this->bits[$i] | $mask;
  222 + }
  223 + }
  224 +
  225 + /**
  226 + * Clears the bit array, unsetting every bit.
  227 + *
  228 + * @return void
  229 + */
  230 + public function clear()
  231 + {
  232 + $bitsLength = count($this->bits);
  233 +
  234 + for ($i = 0; $i < $bitsLength; $i++) {
  235 + $this->bits[$i] = 0;
  236 + }
  237 + }
  238 +
  239 + /**
  240 + * Checks if a range of bits is set or not set.
  241 + *
  242 + * @param integer $start
  243 + * @param integer $end
  244 + * @param integer $value
  245 + * @return boolean
  246 + * @throws Exception\InvalidArgumentException
  247 + */
  248 + public function isRange($start, $end, $value)
  249 + {
  250 + if ($end < $start) {
  251 + throw new Exception\InvalidArgumentException('End must be greater or equal to start');
  252 + }
  253 +
  254 + if ($end === $start) {
  255 + return;
  256 + }
  257 +
  258 + $end--;
  259 +
  260 + $firstInt = $start >> 5;
  261 + $lastInt = $end >> 5;
  262 +
  263 + for ($i = $firstInt; $i <= $lastInt; $i++) {
  264 + $firstBit = $i > $firstInt ? 0 : $start & 0x1f;
  265 + $lastBit = $i < $lastInt ? 31 : $end & 0x1f;
  266 +
  267 + if ($firstBit === 0 && $lastBit === 31) {
  268 + $mask = 0x7fffffff;
  269 + } else {
  270 + $mask = 0;
  271 +
  272 + for ($j = $firstBit; $j <= $lastBit; $j++) {
  273 + $mask |= 1 << $j;
  274 + }
  275 + }
  276 +
  277 + if (($this->bits[$i] & $mask) !== ($value ? $mask : 0)) {
  278 + return false;
  279 + }
  280 + }
  281 +
  282 + return true;
  283 + }
  284 +
  285 + /**
  286 + * Appends a bit to the array.
  287 + *
  288 + * @param boolean $bit
  289 + * @return void
  290 + */
  291 + public function appendBit($bit)
  292 + {
  293 + $this->ensureCapacity($this->size + 1);
  294 +
  295 + if ($bit) {
  296 + $this->bits[$this->size >> 5] = $this->bits[$this->size >> 5] | (1 << ($this->size & 0x1f));
  297 + }
  298 +
  299 + $this->size++;
  300 + }
  301 +
  302 + /**
  303 + * Appends a number of bits (up to 32) to the array.
  304 + *
  305 + * @param integer $value
  306 + * @param integer $numBits
  307 + * @return void
  308 + * @throws Exception\InvalidArgumentException
  309 + */
  310 + public function appendBits($value, $numBits)
  311 + {
  312 + if ($numBits < 0 || $numBits > 32) {
  313 + throw new Exception\InvalidArgumentException('Num bits must be between 0 and 32');
  314 + }
  315 +
  316 + $this->ensureCapacity($this->size + $numBits);
  317 +
  318 + for ($numBitsLeft = $numBits; $numBitsLeft > 0; $numBitsLeft--) {
  319 + $this->appendBit((($value >> ($numBitsLeft - 1)) & 0x01) === 1);
  320 + }
  321 + }
  322 +
  323 + /**
  324 + * Appends another bit array to this array.
  325 + *
  326 + * @param BitArray $other
  327 + * @return void
  328 + */
  329 + public function appendBitArray(self $other)
  330 + {
  331 + $otherSize = $other->getSize();
  332 + $this->ensureCapacity($this->size + $other->getSize());
  333 +
  334 + for ($i = 0; $i < $otherSize; $i++) {
  335 + $this->appendBit($other->get($i));
  336 + }
  337 + }
  338 +
  339 + /**
  340 + * Makes an exclusive-or comparision on the current bit array.
  341 + *
  342 + * @param BitArray $other
  343 + * @return void
  344 + * @throws Exception\InvalidArgumentException
  345 + */
  346 + public function xorBits(self $other)
  347 + {
  348 + $bitsLength = count($this->bits);
  349 + $otherBits = $other->getBitArray();
  350 +
  351 + if ($bitsLength !== count($otherBits)) {
  352 + throw new Exception\InvalidArgumentException('Sizes don\'t match');
  353 + }
  354 +
  355 + for ($i = 0; $i < $bitsLength; $i++) {
  356 + $this->bits[$i] = $this->bits[$i] ^ $otherBits[$i];
  357 + }
  358 + }
  359 +
  360 + /**
  361 + * Converts the bit array to a byte array.
  362 + *
  363 + * @param integer $bitOffset
  364 + * @param integer $numBytes
  365 + * @return SplFixedArray
  366 + */
  367 + public function toBytes($bitOffset, $numBytes)
  368 + {
  369 + $bytes = new SplFixedArray($numBytes);
  370 +
  371 + for ($i = 0; $i < $numBytes; $i++) {
  372 + $byte = 0;
  373 +
  374 + for ($j = 0; $j < 8; $j++) {
  375 + if ($this->get($bitOffset)) {
  376 + $byte |= 1 << (7 - $j);
  377 + }
  378 +
  379 + $bitOffset++;
  380 + }
  381 +
  382 + $bytes[$i] = $byte;
  383 + }
  384 +
  385 + return $bytes;
  386 + }
  387 +
  388 + /**
  389 + * Gets the internal bit array.
  390 + *
  391 + * @return SplFixedArray
  392 + */
  393 + public function getBitArray()
  394 + {
  395 + return $this->bits;
  396 + }
  397 +
  398 + /**
  399 + * Reverses the array.
  400 + *
  401 + * @return void
  402 + */
  403 + public function reverse()
  404 + {
  405 + $newBits = new SplFixedArray(count($this->bits));
  406 +
  407 + for ($i = 0; $i < $this->size; $i++) {
  408 + if ($this->get($this->size - $i - 1)) {
  409 + $newBits[$i >> 5] = $newBits[$i >> 5] | (1 << ($i & 0x1f));
  410 + }
  411 + }
  412 +
  413 + $this->bits = newBits;
  414 + }
  415 +
  416 + /**
  417 + * Returns a string representation of the bit array.
  418 + *
  419 + * @return string
  420 + */
  421 + public function __toString()
  422 + {
  423 + $result = '';
  424 +
  425 + for ($i = 0; $i < $this->size; $i++) {
  426 + if (($i & 0x07) === 0) {
  427 + $result .= ' ';
  428 + }
  429 +
  430 + $result .= $this->get($i) ? 'X' : '.';
  431 + }
  432 +
  433 + return $result;
  434 + }
  435 +}
  1 +<?php
  2 +/**
  3 + * BaconQrCode
  4 + *
  5 + * @link http://github.com/Bacon/BaconQrCode For the canonical source repository
  6 + * @copyright 2013 Ben 'DASPRiD' Scholzen
  7 + * @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
  8 + */
  9 +
  10 +namespace BaconQrCode\Common;
  11 +
  12 +use SplFixedArray;
  13 +
  14 +/**
  15 + * Bit matrix.
  16 + *
  17 + * Represents a 2D matrix of bits. In function arguments below, and throughout
  18 + * the common module, x is the column position, and y is the row position. The
  19 + * ordering is always x, y. The origin is at the top-left.
  20 + */
  21 +class BitMatrix
  22 +{
  23 + /**
  24 + * Width of the bit matrix.
  25 + *
  26 + * @var integer
  27 + */
  28 + protected $width;
  29 +
  30 + /**
  31 + * Height of the bit matrix.
  32 + *
  33 + * @var integer
  34 + */
  35 + protected $height;
  36 +
  37 + /**
  38 + * Size in bits of each individual row.
  39 + *
  40 + * @var integer
  41 + */
  42 + protected $rowSize;
  43 +
  44 + /**
  45 + * Bits representation.
  46 + *
  47 + * @var SplFixedArray
  48 + */
  49 + protected $bits;
  50 +
  51 + /**
  52 + * Creates a new bit matrix with given dimensions.
  53 + *
  54 + * @param integer $width
  55 + * @param integer|null $height
  56 + * @throws Exception\InvalidArgumentException
  57 + */
  58 + public function __construct($width, $height = null)
  59 + {
  60 + if ($height === null) {
  61 + $height = $width;
  62 + }
  63 +
  64 + if ($width < 1 || $height < 1) {
  65 + throw new Exception\InvalidArgumentException('Both dimensions must be greater than zero');
  66 + }
  67 +
  68 + $this->width = $width;
  69 + $this->height = $height;
  70 + $this->rowSize = ($width + 31) >> 5;
  71 + $this->bits = new SplFixedArray($this->rowSize * $height);
  72 + }
  73 +
  74 + /**
  75 + * Gets the requested bit, where true means black.
  76 + *
  77 + * @param integer $x
  78 + * @param integer $y
  79 + * @return boolean
  80 + */
  81 + public function get($x, $y)
  82 + {
  83 + $offset = $y * $this->rowSize + ($x >> 5);
  84 + return (BitUtils::unsignedRightShift($this->bits[$offset], ($x & 0x1f)) & 1) !== 0;
  85 + }
  86 +
  87 + /**
  88 + * Sets the given bit to true.
  89 + *
  90 + * @param integer $x
  91 + * @param integer $y
  92 + * @return void
  93 + */
  94 + public function set($x, $y)
  95 + {
  96 + $offset = $y * $this->rowSize + ($x >> 5);
  97 + $this->bits[$offset] = $this->bits[$offset] | (1 << ($x & 0x1f));
  98 + }
  99 +
  100 + /**
  101 + * Flips the given bit.
  102 + *
  103 + * @param integer $x
  104 + * @param integer $y
  105 + * @return void
  106 + */
  107 + public function flip($x, $y)
  108 + {
  109 + $offset = $y * $this->rowSize + ($x >> 5);
  110 + $this->bits[$offset] = $this->bits[$offset] ^ (1 << ($x & 0x1f));
  111 + }
  112 +
  113 + /**
  114 + * Clears all bits (set to false).
  115 + *
  116 + * @return void
  117 + */
  118 + public function clear()
  119 + {
  120 + $max = count($this->bits);
  121 +
  122 + for ($i = 0; $i < $max; $i++) {
  123 + $this->bits[$i] = 0;
  124 + }
  125 + }
  126 +
  127 + /**
  128 + * Sets a square region of the bit matrix to true.
  129 + *
  130 + * @param integer $left
  131 + * @param integer $top
  132 + * @param integer $width
  133 + * @param integer $height
  134 + * @return void
  135 + */
  136 + public function setRegion($left, $top, $width, $height)
  137 + {
  138 + if ($top < 0 || $left < 0) {
  139 + throw new Exception\InvalidArgumentException('Left and top must be non-negative');
  140 + }
  141 +
  142 + if ($height < 1 || $width < 1) {
  143 + throw new Exception\InvalidArgumentException('Width and height must be at least 1');
  144 + }
  145 +
  146 + $right = $left + $width;
  147 + $bottom = $top + $height;
  148 +
  149 + if ($bottom > $this->height || $right > $this->width) {
  150 + throw new Exception\InvalidArgumentException('The region must fit inside the matrix');
  151 + }
  152 +
  153 + for ($y = $top; $y < $bottom; $y++) {
  154 + $offset = $y * $this->rowSize;
  155 +
  156 + for ($x = $left; $x < $right; $x++) {
  157 + $index = $offset + ($x >> 5);
  158 + $this->bits[$index] = $this->bits[$index] | (1 << ($x & 0x1f));
  159 + }
  160 + }
  161 + }
  162 +
  163 + /**
  164 + * A fast method to retrieve one row of data from the matrix as a BitArray.
  165 + *
  166 + * @param integer $y
  167 + * @param BitArray $row
  168 + * @return BitArray
  169 + */
  170 + public function getRow($y, BitArray $row = null)
  171 + {
  172 + if ($row === null || $row->getSize() < $this->width) {
  173 + $row = new BitArray($this->width);
  174 + }
  175 +
  176 + $offset = $y * $this->rowSize;
  177 +
  178 + for ($x = 0; $x < $this->rowSize; $x++) {
  179 + $row->setBulk($x << 5, $this->bits[$offset + $x]);
  180 + }
  181 +
  182 + return $row;
  183 + }
  184 +
  185 + /**
  186 + * Sets a row of data from a BitArray.
  187 + *
  188 + * @param integer $y
  189 + * @param BitArray $row
  190 + * @return void
  191 + */
  192 + public function setRow($y, BitArray $row)
  193 + {
  194 + $bits = $row->getBitArray();
  195 +
  196 + for ($i = 0; $i < $this->rowSize; $i++) {
  197 + $this->bits[$y * $this->rowSize + $i] = $bits[$i];
  198 + }
  199 + }
  200 +
  201 + /**
  202 + * This is useful in detecting the enclosing rectangle of a 'pure' barcode.
  203 + *
  204 + * @return SplFixedArray
  205 + */
  206 + public function getEnclosingRectangle()
  207 + {
  208 + $left = $this->width;
  209 + $top = $this->height;
  210 + $right = -1;
  211 + $bottom = -1;
  212 +
  213 + for ($y = 0; $y < $this->height; $y++) {
  214 + for ($x32 = 0; $x32 < $this->rowSize; $x32++) {
  215 + $bits = $this->bits[$y * $this->rowSize + $x32];
  216 +
  217 + if ($bits !== 0) {
  218 + if ($y < $top) {
  219 + $top = $y;
  220 + }
  221 +
  222 + if ($y > $bottom) {
  223 + $bottom = $y;
  224 + }
  225 +
  226 + if ($x32 * 32 < $left) {
  227 + $bit = 0;
  228 +
  229 + while (($bits << (31 - $bit)) === 0) {
  230 + $bit++;
  231 + }
  232 +
  233 + if (($x32 * 32 + $bit) < $left) {
  234 + $left = $x32 * 32 + $bit;
  235 + }
  236 + }
  237 + }
  238 +
  239 + if ($x32 * 32 + 31 > $right) {
  240 + $bit = 31;
  241 +
  242 + while (BitUtils::unsignedRightShift($bits, $bit) === 0) {
  243 + $bit--;
  244 + }
  245 +
  246 + if (($x32 * 32 + $bit) > $right) {
  247 + $right = $x32 * 32 + $bit;
  248 + }
  249 + }
  250 + }
  251 + }
  252 +
  253 + $width = $right - $left;
  254 + $height = $bottom - $top;
  255 +
  256 + if ($width < 0 || $height < 0) {
  257 + return null;
  258 + }
  259 +
  260 + return SplFixedArray::fromArray(array($left, $top, $width, $height), false);
  261 + }
  262 +
  263 + /**
  264 + * Gets the most top left set bit.
  265 + *
  266 + * This is useful in detecting a corner of a 'pure' barcode.
  267 + *
  268 + * @return SplFixedArray
  269 + */
  270 + public function getTopLeftOnBit()
  271 + {
  272 + $bitsOffset = 0;
  273 +
  274 + while ($bitsOffset < count($this->bits) && $this->bits[$bitsOffset] === 0) {
  275 + $bitsOffset++;
  276 + }
  277 +
  278 + if ($bitsOffset === count($this->bits)) {
  279 + return null;
  280 + }
  281 +
  282 + $x = intval($bitsOffset / $this->rowSize);
  283 + $y = ($bitsOffset % $this->rowSize) << 5;
  284 +
  285 + $bits = $this->bits[$bitsOffset];
  286 + $bit = 0;
  287 +
  288 + while (($bits << (31 - $bit)) === 0) {
  289 + $bit++;
  290 + }
  291 +
  292 + $x += $bit;
  293 +
  294 + return SplFixedArray::fromArray(array($x, $y), false);
  295 + }
  296 +
  297 + /**
  298 + * Gets the most bottom right set bit.
  299 + *
  300 + * This is useful in detecting a corner of a 'pure' barcode.
  301 + *
  302 + * @return SplFixedArray
  303 + */
  304 + public function getBottomRightOnBit()
  305 + {
  306 + $bitsOffset = count($this->bits) - 1;
  307 +
  308 + while ($bitsOffset >= 0 && $this->bits[$bitsOffset] === 0) {
  309 + $bitsOffset--;
  310 + }
  311 +
  312 + if ($bitsOffset < 0) {
  313 + return null;
  314 + }
  315 +
  316 + $x = intval($bitsOffset / $this->rowSize);
  317 + $y = ($bitsOffset % $this->rowSize) << 5;
  318 +
  319 + $bits = $this->bits[$bitsOffset];
  320 + $bit = 0;
  321 +
  322 + while (BitUtils::unsignedRightShift($bits, $bit) === 0) {
  323 + $bit--;
  324 + }
  325 +
  326 + $x += $bit;
  327 +
  328 + return SplFixedArray::fromArray(array($x, $y), false);
  329 + }
  330 +
  331 + /**
  332 + * Gets the width of the matrix,
  333 + *
  334 + * @return integer
  335 + */
  336 + public function getWidth()
  337 + {
  338 + return $this->width;
  339 + }
  340 +
  341 + /**
  342 + * Gets the height of the matrix.
  343 + *
  344 + * @return integer
  345 + */
  346 + public function getHeight()
  347 + {
  348 + return $this->height;
  349 + }
  350 +}
  1 +<?php
  2 +/**
  3 + * BaconQrCode
  4 + *
  5 + * @link http://github.com/Bacon/BaconQrCode For the canonical source repository
  6 + * @copyright 2013 Ben 'DASPRiD' Scholzen
  7 + * @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
  8 + */
  9 +
  10 +namespace BaconQrCode\Common;
  11 +
  12 +/**
  13 + * General bit utilities.
  14 + *
  15 + * All utility methods are based on 32-bit integers and also work on 64-bit
  16 + * systems.
  17 + */
  18 +class BitUtils
  19 +{
  20 + /**
  21 + * Performs an unsigned right shift.
  22 + *
  23 + * This is the same as the unsigned right shift operator ">>>" in other
  24 + * languages.
  25 + *
  26 + * @param integer $a
  27 + * @param integer $b
  28 + * @return integer
  29 + */
  30 + public static function unsignedRightShift($a, $b)
  31 + {
  32 + return (
  33 + $a >= 0
  34 + ? $a >> $b
  35 + : (($a & 0x7fffffff) >> $b) | (0x40000000 >> ($b - 1))
  36 + );
  37 + }
  38 +
  39 + /**
  40 + * Gets the number of trailing zeros.
  41 + *
  42 + * @param integer $i
  43 + * @return integer
  44 + */
  45 + public static function numberOfTrailingZeros($i)
  46 + {
  47 + $lastPos = strrpos(str_pad(decbin($i), 32, '0', STR_PAD_LEFT), '1');
  48 +
  49 + return $lastPos === false ? 32 : 31 - $lastPos;
  50 + }
  51 +}
  1 +<?php
  2 +/**
  3 + * BaconQrCode
  4 + *
  5 + * @link http://github.com/Bacon/BaconQrCode For the canonical source repository
  6 + * @copyright 2013 Ben 'DASPRiD' Scholzen
  7 + * @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
  8 + */
  9 +
  10 +namespace BaconQrCode\Common;
  11 +
  12 +/**
  13 + * Encapsulates a Character Set ECI, according to "Extended Channel
  14 + * Interpretations" 5.3.1.1 of ISO 18004.
  15 + */
  16 +class CharacterSetEci extends AbstractEnum
  17 +{
  18 + /**#@+
  19 + * Character set constants.
  20 + */
  21 + const CP437 = 0;
  22 + const ISO8859_1 = 1;
  23 + const ISO8859_2 = 4;
  24 + const ISO8859_3 = 5;
  25 + const ISO8859_4 = 6;
  26 + const ISO8859_5 = 7;
  27 + const ISO8859_6 = 8;
  28 + const ISO8859_7 = 9;
  29 + const ISO8859_8 = 10;
  30 + const ISO8859_9 = 11;
  31 + const ISO8859_10 = 12;
  32 + const ISO8859_11 = 13;
  33 + const ISO8859_12 = 14;
  34 + const ISO8859_13 = 15;
  35 + const ISO8859_14 = 16;
  36 + const ISO8859_15 = 17;
  37 + const ISO8859_16 = 18;
  38 + const SJIS = 20;
  39 + const CP1250 = 21;
  40 + const CP1251 = 22;
  41 + const CP1252 = 23;
  42 + const CP1256 = 24;
  43 + const UNICODE_BIG_UNMARKED = 25;
  44 + const UTF8 = 26;
  45 + const ASCII = 27;
  46 + const BIG5 = 28;
  47 + const GB18030 = 29;
  48 + const EUC_KR = 30;
  49 + /**#@-*/
  50 +
  51 + /**
  52 + * Map between character names and their ECI values.
  53 + *
  54 + * @var array
  55 + */
  56 + protected static $nameToEci = array(
  57 + 'ISO-8859-1' => self::ISO8859_1,
  58 + 'ISO-8859-2' => self::ISO8859_2,
  59 + 'ISO-8859-3' => self::ISO8859_3,
  60 + 'ISO-8859-4' => self::ISO8859_4,
  61 + 'ISO-8859-5' => self::ISO8859_5,
  62 + 'ISO-8859-6' => self::ISO8859_6,
  63 + 'ISO-8859-7' => self::ISO8859_7,
  64 + 'ISO-8859-8' => self::ISO8859_8,
  65 + 'ISO-8859-9' => self::ISO8859_9,
  66 + 'ISO-8859-10' => self::ISO8859_10,
  67 + 'ISO-8859-11' => self::ISO8859_11,
  68 + 'ISO-8859-12' => self::ISO8859_12,
  69 + 'ISO-8859-13' => self::ISO8859_13,
  70 + 'ISO-8859-14' => self::ISO8859_14,
  71 + 'ISO-8859-15' => self::ISO8859_15,
  72 + 'ISO-8859-16' => self::ISO8859_16,
  73 + 'SHIFT-JIS' => self::SJIS,
  74 + 'WINDOWS-1250' => self::CP1250,
  75 + 'WINDOWS-1251' => self::CP1251,
  76 + 'WINDOWS-1252' => self::CP1252,
  77 + 'WINDOWS-1256' => self::CP1256,
  78 + 'UTF-16BE' => self::UNICODE_BIG_UNMARKED,
  79 + 'UTF-8' => self::UTF8,
  80 + 'ASCII' => self::ASCII,
  81 + 'GBK' => self::GB18030,
  82 + 'EUC-KR' => self::EUC_KR,
  83 + );
  84 +
  85 + /**
  86 + * Additional possible values for character sets.
  87 + *
  88 + * @var array
  89 + */
  90 + protected $additionalValues = array(
  91 + self::CP437 => 2,
  92 + self::ASCII => 170,
  93 + );
  94 +
  95 + /**
  96 + * Gets character set ECI by value.
  97 + *
  98 + * @param string $name
  99 + * @return CharacterSetEci|null
  100 + */
  101 + public static function getCharacterSetECIByValue($value)
  102 + {
  103 + if ($value < 0 || $value >= 900) {
  104 + throw new Exception\InvalidArgumentException('Value must be between 0 and 900');
  105 + }
  106 +
  107 + if (false !== ($key = array_search($value, self::$additionalValues))) {
  108 + $value = $key;
  109 + }
  110 +
  111 + try {
  112 + return new self($value);
  113 + } catch (Exception\UnexpectedValueException $e) {
  114 + return null;
  115 + }
  116 + }
  117 +
  118 + /**
  119 + * Gets character set ECI by name.
  120 + *
  121 + * @param string $name
  122 + * @return CharacterSetEci|null
  123 + */
  124 + public static function getCharacterSetECIByName($name)
  125 + {
  126 + $name = strtoupper($name);
  127 +
  128 + if (isset(self::$nameToEci[$name])) {
  129 + return new self(self::$nameToEci[$name]);
  130 + }
  131 +
  132 + return null;
  133 + }
  134 +}
  1 +<?php
  2 +/**
  3 + * BaconQrCode
  4 + *
  5 + * @link http://github.com/Bacon/BaconQrCode For the canonical source repository
  6 + * @copyright 2013 Ben 'DASPRiD' Scholzen
  7 + * @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
  8 + */
  9 +
  10 +namespace BaconQrCode\Common;
  11 +
  12 +/**
  13 + * Encapsualtes the parameters for one error-correction block in one symbol
  14 + * version. This includes the number of data codewords, and the number of times
  15 + * a block with these parameters is used consecutively in the QR code version's
  16 + * format.
  17 + */
  18 +class EcBlock
  19 +{
  20 + /**
  21 + * How many times the block is used.
  22 + *
  23 + * @var integer
  24 + */
  25 + protected $count;
  26 +
  27 + /**
  28 + * Number of data codewords.
  29 + *
  30 + * @var integer
  31 + */
  32 + protected $dataCodewords;
  33 +
  34 + /**
  35 + * Creates a new EC block.
  36 + *
  37 + * @param integer $count
  38 + * @param integer $dataCodewords
  39 + */
  40 + public function __construct($count, $dataCodewords)
  41 + {
  42 + $this->count = $count;
  43 + $this->dataCodewords = $dataCodewords;
  44 + }
  45 +
  46 + /**
  47 + * Returns how many times the block is used.
  48 + *
  49 + * @return integer
  50 + */
  51 + public function getCount()
  52 + {
  53 + return $this->count;
  54 + }
  55 +
  56 + /**
  57 + * Returns the number of data codewords.
  58 + *
  59 + * @return integer
  60 + */
  61 + public function getDataCodewords()
  62 + {
  63 + return $this->dataCodewords;
  64 + }
  65 +}
  1 +<?php
  2 +/**
  3 + * BaconQrCode
  4 + *
  5 + * @link http://github.com/Bacon/BaconQrCode For the canonical source repository
  6 + * @copyright 2013 Ben 'DASPRiD' Scholzen
  7 + * @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
  8 + */
  9 +
  10 +namespace BaconQrCode\Common;
  11 +
  12 +use SplFixedArray;
  13 +
  14 +/**
  15 + * Encapsulates a set of error-correction blocks in one symbol version. Most
  16 + * versions will use blocks of differing sizes within one version, so, this
  17 + * encapsulates the parameters for each set of blocks. It also holds the number
  18 + * of error-correction codewords per block since it will be the same across all
  19 + * blocks within one version.
  20 + */
  21 +class EcBlocks
  22 +{
  23 + /**
  24 + * Number of EC codewords per block.
  25 + *
  26 + * @var integer
  27 + */
  28 + protected $ecCodewordsPerBlock;
  29 +
  30 + /**
  31 + * List of EC blocks.
  32 + *
  33 + * @var SplFixedArray
  34 + */
  35 + protected $ecBlocks;
  36 +
  37 + /**
  38 + * Creates a new EC blocks instance.
  39 + *
  40 + * @param integer $ecCodewordsPerBlock
  41 + * @param EcBlock $ecb1
  42 + * @param EcBlock|null $ecb2
  43 + */
  44 + public function __construct($ecCodewordsPerBlock, EcBlock $ecb1, EcBlock $ecb2 = null)
  45 + {
  46 + $this->ecCodewordsPerBlock = $ecCodewordsPerBlock;
  47 +
  48 + $this->ecBlocks = new SplFixedArray($ecb2 === null ? 1 : 2);
  49 + $this->ecBlocks[0] = $ecb1;
  50 +
  51 + if ($ecb2 !== null) {
  52 + $this->ecBlocks[1] = $ecb2;
  53 + }
  54 + }
  55 +
  56 + /**
  57 + * Gets the number of EC codewords per block.
  58 + *
  59 + * @return integer
  60 + */
  61 + public function getEcCodewordsPerBlock()
  62 + {
  63 + return $this->ecCodewordsPerBlock;
  64 + }
  65 +
  66 + /**
  67 + * Gets the total number of EC block appearances.
  68 + *
  69 + * @return integer
  70 + */
  71 + public function getNumBlocks()
  72 + {
  73 + $total = 0;
  74 +
  75 + foreach ($this->ecBlocks as $ecBlock) {
  76 + $total += $ecBlock->getCount();
  77 + }
  78 +
  79 + return $total;
  80 + }
  81 +
  82 + /**
  83 + * Gets the total count of EC codewords.
  84 + *
  85 + * @return integer
  86 + */
  87 + public function getTotalEcCodewords()
  88 + {
  89 + return $this->ecCodewordsPerBlock * $this->getNumBlocks();
  90 + }
  91 +
  92 + /**
  93 + * Gets the EC blocks included in this collection.
  94 + *
  95 + * @return SplFixedArray
  96 + */
  97 + public function getEcBlocks()
  98 + {
  99 + return $this->ecBlocks;
  100 + }
  101 +}
  1 +<?php
  2 +/**
  3 + * BaconQrCode
  4 + *
  5 + * @link http://github.com/Bacon/BaconQrCode For the canonical source repository
  6 + * @copyright 2013 Ben 'DASPRiD' Scholzen
  7 + * @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
  8 + */
  9 +
  10 +namespace BaconQrCode\Common;
  11 +
  12 +/**
  13 + * Enum representing the four error correction levels.
  14 + */
  15 +class ErrorCorrectionLevel extends AbstractEnum
  16 +{
  17 + /**
  18 + * Level L, ~7% correction.
  19 + */
  20 + const L = 0x1;
  21 +
  22 + /**
  23 + * Level M, ~15% correction.
  24 + */
  25 + const M = 0x0;
  26 +
  27 + /**
  28 + * Level Q, ~25% correction.
  29 + */
  30 + const Q = 0x3;
  31 +
  32 + /**
  33 + * Level H, ~30% correction.
  34 + */
  35 + const H = 0x2;
  36 +
  37 + /**
  38 + * Gets the ordinal of this enumeration constant.
  39 + *
  40 + * @return integer
  41 + */
  42 + public function getOrdinal()
  43 + {
  44 + switch ($this->value) {
  45 + case self::L:
  46 + return 0;
  47 + break;
  48 +
  49 + case self::M:
  50 + return 1;
  51 + break;
  52 +
  53 + case self::Q:
  54 + return 2;
  55 + break;
  56 +
  57 + case self::H:
  58 + return 3;
  59 + break;
  60 + }
  61 + }
  62 +}
  1 +<?php
  2 +/**
  3 + * BaconQrCode
  4 + *
  5 + * @link http://github.com/Bacon/BaconQrCode For the canonical source repository
  6 + * @copyright 2013 Ben 'DASPRiD' Scholzen
  7 + * @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
  8 + */
  9 +
  10 +namespace BaconQrCode\Common;
  11 +
  12 +/**
  13 + * Encapsulates a QR Code's format information, including the data mask used and
  14 + * error correction level.
  15 + */
  16 +class FormatInformation
  17 +{
  18 + /**
  19 + * Mask for format information.
  20 + */
  21 + const FORMAT_INFO_MASK_QR = 0x5412;
  22 +
  23 + /**
  24 + * Lookup table for decoding format information.
  25 + *
  26 + * See ISO 18004:2006, Annex C, Table C.1
  27 + *
  28 + * @var array
  29 + */
  30 + protected static $formatInfoDecodeLookup = array(
  31 + array(0x5412, 0x00),
  32 + array(0x5125, 0x01),
  33 + array(0x5e7c, 0x02),
  34 + array(0x5b4b, 0x03),
  35 + array(0x45f9, 0x04),
  36 + array(0x40ce, 0x05),
  37 + array(0x4f97, 0x06),
  38 + array(0x4aa0, 0x07),
  39 + array(0x77c4, 0x08),
  40 + array(0x72f3, 0x09),
  41 + array(0x7daa, 0x0a),
  42 + array(0x789d, 0x0b),
  43 + array(0x662f, 0x0c),
  44 + array(0x6318, 0x0d),
  45 + array(0x6c41, 0x0e),
  46 + array(0x6976, 0x0f),
  47 + array(0x1689, 0x10),
  48 + array(0x13be, 0x11),
  49 + array(0x1ce7, 0x12),
  50 + array(0x19d0, 0x13),
  51 + array(0x0762, 0x14),
  52 + array(0x0255, 0x15),
  53 + array(0x0d0c, 0x16),
  54 + array(0x083b, 0x17),
  55 + array(0x355f, 0x18),
  56 + array(0x3068, 0x19),
  57 + array(0x3f31, 0x1a),
  58 + array(0x3a06, 0x1b),
  59 + array(0x24b4, 0x1c),
  60 + array(0x2183, 0x1d),
  61 + array(0x2eda, 0x1e),
  62 + array(0x2bed, 0x1f),
  63 + );
  64 +
  65 + /**
  66 + * Offset i holds the number of 1 bits in the binary representation of i.
  67 + *
  68 + * @var array
  69 + */
  70 + protected static $bitsSetInHalfByte = array(0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4);
  71 +
  72 + /**
  73 + * Error correction level.
  74 + *
  75 + * @var ErrorCorrectionLevel
  76 + */
  77 + protected $ecLevel;
  78 +
  79 + /**
  80 + * Data mask.
  81 + *
  82 + * @var integer
  83 + */
  84 + protected $dataMask;
  85 +
  86 + /**
  87 + * Creates a new format information instance.
  88 + *
  89 + * @param integer $formatInfo
  90 + */
  91 + protected function __construct($formatInfo)
  92 + {
  93 + $this->ecLevel = new ErrorCorrectionLevel(($formatInfo >> 3) & 0x3);
  94 + $this->dataMask = $formatInfo & 0x7;
  95 + }
  96 +
  97 + /**
  98 + * Checks how many bits are different between two integers.
  99 + *
  100 + * @param integer $a
  101 + * @param integer $b
  102 + * @return integer
  103 + */
  104 + public static function numBitsDiffering($a, $b)
  105 + {
  106 + $a ^= $b;
  107 +
  108 + return (
  109 + self::$bitsSetInHalfByte[$a & 0xf]
  110 + + self::$bitsSetInHalfByte[(BitUtils::unsignedRightShift($a, 4) & 0xf)]
  111 + + self::$bitsSetInHalfByte[(BitUtils::unsignedRightShift($a, 8) & 0xf)]
  112 + + self::$bitsSetInHalfByte[(BitUtils::unsignedRightShift($a, 12) & 0xf)]
  113 + + self::$bitsSetInHalfByte[(BitUtils::unsignedRightShift($a, 16) & 0xf)]
  114 + + self::$bitsSetInHalfByte[(BitUtils::unsignedRightShift($a, 20) & 0xf)]
  115 + + self::$bitsSetInHalfByte[(BitUtils::unsignedRightShift($a, 24) & 0xf)]
  116 + + self::$bitsSetInHalfByte[(BitUtils::unsignedRightShift($a, 28) & 0xf)]
  117 + );
  118 + }
  119 +
  120 + /**
  121 + * Decodes format information.
  122 + *
  123 + * @param integer $maskedFormatInfo1
  124 + * @param integer $maskedFormatInfo2
  125 + * @return FormatInformation|null
  126 + */
  127 + public static function decodeFormatInformation($maskedFormatInfo1, $maskedFormatInfo2)
  128 + {
  129 + $formatInfo = self::doDecodeFormatInformation($maskedFormatInfo1, $maskedFormatInfo2);
  130 +
  131 + if ($formatInfo !== null) {
  132 + return $formatInfo;
  133 + }
  134 +
  135 + // Should return null, but, some QR codes apparently do not mask this
  136 + // info. Try again by actually masking the pattern first.
  137 + return self::doDecodeFormatInformation(
  138 + $maskedFormatInfo1 ^ self::FORMAT_INFO_MASK_QR,
  139 + $maskedFormatInfo2 ^ self::FORMAT_INFO_MASK_QR
  140 + );
  141 + }
  142 +
  143 + /**
  144 + * Internal method for decoding format information.
  145 + *
  146 + * @param integer $maskedFormatInfo1
  147 + * @param integer $maskedFormatInfo2
  148 + * @return FormatInformation|null
  149 + */
  150 + protected static function doDecodeFormatInformation($maskedFormatInfo1, $maskedFormatInfo2)
  151 + {
  152 + $bestDifference = PHP_INT_MAX;
  153 + $bestFormatInfo = 0;
  154 +
  155 + foreach (self::$formatInfoDecodeLookup as $decodeInfo) {
  156 + $targetInfo = $decodeInfo[0];
  157 +
  158 + if ($targetInfo === $maskedFormatInfo1 || $targetInfo === $maskedFormatInfo2) {
  159 + // Found an exact match
  160 + return new self($decodeInfo[1]);
  161 + }
  162 +
  163 + $bitsDifference = self::numBitsDiffering($maskedFormatInfo1, $targetInfo);
  164 +
  165 + if ($bitsDifference < $bestDifference) {
  166 + $bestFormatInfo = $decodeInfo[1];
  167 + $bestDifference = $bitsDifference;
  168 + }
  169 +
  170 + if ($maskedFormatInfo1 !== $maskedFormatInfo2) {
  171 + // Also try the other option
  172 + $bitsDifference = self::numBitsDiffering($maskedFormatInfo2, $targetInfo);
  173 +
  174 + if ($bitsDifference < $bestDifference) {
  175 + $bestFormatInfo = $decodeInfo[1];
  176 + $bestDifference = $bitsDifference;
  177 + }
  178 + }
  179 + }
  180 +
  181 + // Hamming distance of the 32 masked codes is 7, by construction, so
  182 + // <= 3 bits differing means we found a match.
  183 + if ($bestDifference <= 3) {
  184 + return new self($bestFormatInfo);
  185 + }
  186 +
  187 + return null;
  188 + }
  189 +
  190 + /**
  191 + * Gets the error correction level.
  192 + *
  193 + * @return ErrorCorrectionLevel
  194 + */
  195 + public function getErrorCorrectionLevel()
  196 + {
  197 + return $this->ecLevel;
  198 + }
  199 +
  200 + /**
  201 + * Gets the data mask.
  202 + *
  203 + * @return integer
  204 + */
  205 + public function getDataMask()
  206 + {
  207 + return $this->dataMask;
  208 + }
  209 +
  210 + /**
  211 + * Hashes the code of the EC level.
  212 + *
  213 + * @return integer
  214 + */
  215 + public function hashCode()
  216 + {
  217 + return ($this->ecLevel->get() << 3) | $this->dataMask;
  218 + }
  219 +
  220 + /**
  221 + * Verifies if this instance equals another one.
  222 + *
  223 + * @param mixed $other
  224 + * @return boolean
  225 + */
  226 + public function equals($other) {
  227 + if (!$other instanceof self) {
  228 + return false;
  229 + }
  230 +
  231 + return (
  232 + $this->ecLevel->get() === $other->getErrorCorrectionLevel()->get()
  233 + && $this->dataMask === $other->getDataMask()
  234 + );
  235 + }
  236 +}
  1 +<?php
  2 +/**
  3 + * BaconQrCode
  4 + *
  5 + * @link http://github.com/Bacon/BaconQrCode For the canonical source repository
  6 + * @copyright 2013 Ben 'DASPRiD' Scholzen
  7 + * @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
  8 + */
  9 +
  10 +namespace BaconQrCode\Common;
  11 +
  12 +/**
  13 + * Enum representing various modes in which data can be encoded to bits.
  14 + */
  15 +class Mode extends AbstractEnum
  16 +{
  17 + /**#@+
  18 + * Mode constants.
  19 + */
  20 + const TERMINATOR = 0x0;
  21 + const NUMERIC = 0x1;
  22 + const ALPHANUMERIC = 0x2;
  23 + const STRUCTURED_APPEND = 0x3;
  24 + const BYTE = 0x4;
  25 + const ECI = 0x7;
  26 + const KANJI = 0x8;
  27 + const FNC1_FIRST_POSITION = 0x5;
  28 + const FNC1_SECOND_POSITION = 0x9;
  29 + const HANZI = 0xd;
  30 + /**#@-*/
  31 +
  32 + /**
  33 + * Character count bits for each version.
  34 + *
  35 + * @var array
  36 + */
  37 + protected static $characterCountBitsForVersions = array(
  38 + self::TERMINATOR => array(0, 0, 0),
  39 + self::NUMERIC => array(10, 12, 14),
  40 + self::ALPHANUMERIC => array(9, 11, 13),
  41 + self::STRUCTURED_APPEND => array(0, 0, 0),
  42 + self::BYTE => array(8, 16, 16),
  43 + self::ECI => array(0, 0, 0),
  44 + self::KANJI => array(8, 10, 12),
  45 + self::FNC1_FIRST_POSITION => array(0, 0, 0),
  46 + self::FNC1_SECOND_POSITION => array(0, 0, 0),
  47 + self::HANZI => array(8, 10, 12),
  48 + );
  49 +
  50 + /**
  51 + * Gets the number of bits used in a specific QR code version.
  52 + *
  53 + * @param Version $version
  54 + * @return integer
  55 + */
  56 + public function getCharacterCountBits(Version $version)
  57 + {
  58 + $number = $version->getVersionNumber();
  59 +
  60 + if ($number <= 9) {
  61 + $offset = 0;
  62 + } elseif ($number <= 26) {
  63 + $offset = 1;
  64 + } else {
  65 + $offset = 2;
  66 + }
  67 +
  68 + return self::$characterCountBitsForVersions[$this->value][$offset];
  69 + }
  70 +}
  1 +<?php
  2 +/**
  3 + * BaconQrCode
  4 + *
  5 + * @link http://github.com/Bacon/BaconQrCode For the canonical source repository
  6 + * @copyright 2013 Ben 'DASPRiD' Scholzen
  7 + * @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
  8 + */
  9 +
  10 +namespace BaconQrCode\Common;
  11 +
  12 +use BaconQrCode\Exception;
  13 +use SplFixedArray;
  14 +
  15 +/**
  16 + * Reed-Solomon codec for 8-bit characters.
  17 + *
  18 + * Based on libfec by Phil Karn, KA9Q.
  19 + */
  20 +class ReedSolomonCodec
  21 +{
  22 + /**
  23 + * Symbol size in bits.
  24 + *
  25 + * @var integer
  26 + */
  27 + protected $symbolSize;
  28 +
  29 + /**
  30 + * Block size in symbols.
  31 + *
  32 + * @var integer
  33 + */
  34 + protected $blockSize;
  35 +
  36 + /**
  37 + * First root of RS code generator polynomial, index form.
  38 + *
  39 + * @var integer
  40 + */
  41 + protected $firstRoot;
  42 +
  43 + /**
  44 + * Primitive element to generate polynomial roots, index form.
  45 + *
  46 + * @var integer
  47 + */
  48 + protected $primitive;
  49 +
  50 + /**
  51 + * Prim-th root of 1, index form.
  52 + *
  53 + * @var integer
  54 + */
  55 + protected $iPrimitive;
  56 +
  57 + /**
  58 + * RS code generator polynomial degree (number of roots).
  59 + *
  60 + * @var integer
  61 + */
  62 + protected $numRoots;
  63 +
  64 + /**
  65 + * Padding bytes at front of shortened block.
  66 + *
  67 + * @var integer
  68 + */
  69 + protected $padding;
  70 +
  71 + /**
  72 + * Log lookup table.
  73 + *
  74 + * @var SplFixedArray
  75 + */
  76 + protected $alphaTo;
  77 +
  78 + /**
  79 + * Anti-Log lookup table.
  80 + *
  81 + * @var SplFixedArray
  82 + */
  83 + protected $indexOf;
  84 +
  85 + /**
  86 + * Generator polynomial.
  87 + *
  88 + * @var SplFixedArray
  89 + */
  90 + protected $generatorPoly;
  91 +
  92 + /**
  93 + * Creates a new reed solomon instance.
  94 + *
  95 + * @param integer $symbolSize
  96 + * @param integer $gfPoly
  97 + * @param integer $firstRoot
  98 + * @param integer $primitive
  99 + * @param integer $numRoots
  100 + * @param integer $padding
  101 + * @throws Exception\InvalidArgumentException
  102 + * @throws Exception\RuntimeException
  103 + */
  104 + public function __construct($symbolSize, $gfPoly, $firstRoot, $primitive, $numRoots, $padding)
  105 + {
  106 + if ($symbolSize < 0 || $symbolSize > 8) {
  107 + throw new Exception\InvalidArgumentException('Symbol size must be between 0 and 8');
  108 + }
  109 +
  110 + if ($firstRoot < 0 || $firstRoot >= (1 << $symbolSize)) {
  111 + throw new Exception\InvalidArgumentException('First root must be between 0 and ' . (1 << $symbolSize));
  112 + }
  113 +
  114 + if ($numRoots < 0 || $numRoots >= (1 << $symbolSize)) {
  115 + throw new Exception\InvalidArgumentException('Num roots must be between 0 and ' . (1 << $symbolSize));
  116 + }
  117 +
  118 + if ($padding < 0 || $padding >= ((1 << $symbolSize) - 1 - $numRoots)) {
  119 + throw new Exception\InvalidArgumentException('Padding must be between 0 and ' . ((1 << $symbolSize) - 1 - $numRoots));
  120 + }
  121 +
  122 + $this->symbolSize = $symbolSize;
  123 + $this->blockSize = (1 << $symbolSize) - 1;
  124 + $this->padding = $padding;
  125 + $this->alphaTo = SplFixedArray::fromArray(array_fill(0, $this->blockSize + 1, 0), false);
  126 + $this->indexOf = SplFixedArray::fromArray(array_fill(0, $this->blockSize + 1, 0), false);
  127 +
  128 + // Generate galous field lookup table
  129 + $this->indexOf[0] = $this->blockSize;
  130 + $this->alphaTo[$this->blockSize] = 0;
  131 +
  132 + $sr = 1;
  133 +
  134 + for ($i = 0; $i < $this->blockSize; $i++) {
  135 + $this->indexOf[$sr] = $i;
  136 + $this->alphaTo[$i] = $sr;
  137 +
  138 + $sr <<= 1;
  139 +
  140 + if ($sr & (1 << $symbolSize)) {
  141 + $sr ^= $gfPoly;
  142 + }
  143 +
  144 + $sr &= $this->blockSize;
  145 + }
  146 +
  147 + if ($sr !== 1) {
  148 + throw new Exception\RuntimeException('Field generator polynomial is not primitive');
  149 + }
  150 +
  151 + // Form RS code generator polynomial from its roots
  152 + $this->generatorPoly = SplFixedArray::fromArray(array_fill(0, $numRoots + 1, 0), false);
  153 + $this->firstRoot = $firstRoot;
  154 + $this->primitive = $primitive;
  155 + $this->numRoots = $numRoots;
  156 +
  157 + // Find prim-th root of 1, used in decoding
  158 + for ($iPrimitive = 1; ($iPrimitive % $primitive) !== 0; $iPrimitive += $this->blockSize);
  159 + $this->iPrimitive = intval($iPrimitive / $primitive);
  160 +
  161 + $this->generatorPoly[0] = 1;
  162 +
  163 + for ($i = 0, $root = $firstRoot * $primitive; $i < $numRoots; $i++, $root += $primitive) {
  164 + $this->generatorPoly[$i + 1] = 1;
  165 +
  166 + for ($j = $i; $j > 0; $j--) {
  167 + if ($this->generatorPoly[$j] !== 0) {
  168 + $this->generatorPoly[$j] = $this->generatorPoly[$j - 1] ^ $this->alphaTo[$this->modNn($this->indexOf[$this->generatorPoly[$j]] + $root)];
  169 + } else {
  170 + $this->generatorPoly[$j] = $this->generatorPoly[$j - 1];
  171 + }
  172 + }
  173 +
  174 + $this->generatorPoly[$j] = $this->alphaTo[$this->modNn($this->indexOf[$this->generatorPoly[0]] + $root)];
  175 + }
  176 +
  177 + // Convert generator poly to index form for quicker encoding
  178 + for ($i = 0; $i <= $numRoots; $i++) {
  179 + $this->generatorPoly[$i] = $this->indexOf[$this->generatorPoly[$i]];
  180 + }
  181 + }
  182 +
  183 + /**
  184 + * Encodes data and writes result back into parity array.
  185 + *
  186 + * @param SplFixedArray $data
  187 + * @param SplFixedArray $parity
  188 + * @return void
  189 + */
  190 + public function encode(SplFixedArray $data, SplFixedArray $parity)
  191 + {
  192 + for ($i = 0; $i < $this->numRoots; $i++) {
  193 + $parity[$i] = 0;
  194 + }
  195 +
  196 + $iterations = $this->blockSize - $this->numRoots - $this->padding;
  197 +
  198 + for ($i = 0; $i < $iterations; $i++) {
  199 + $feedback = $this->indexOf[$data[$i] ^ $parity[0]];
  200 +
  201 + if ($feedback !== $this->blockSize) {
  202 + // Feedback term is non-zero
  203 + $feedback = $this->modNn($this->blockSize - $this->generatorPoly[$this->numRoots] + $feedback);
  204 +
  205 + for ($j = 1; $j < $this->numRoots; $j++) {
  206 + $parity[$j] = $parity[$j] ^ $this->alphaTo[$this->modNn($feedback + $this->generatorPoly[$this->numRoots - $j])];
  207 + }
  208 + }
  209 +
  210 + for ($j = 0; $j < $this->numRoots - 1; $j++) {
  211 + $parity[$j] = $parity[$j + 1];
  212 + }
  213 +
  214 + if ($feedback !== $this->blockSize) {
  215 + $parity[$this->numRoots - 1] = $this->alphaTo[$this->modNn($feedback + $this->generatorPoly[0])];
  216 + } else {
  217 + $parity[$this->numRoots - 1] = 0;
  218 + }
  219 + }
  220 + }
  221 +
  222 + /**
  223 + * Decodes received data.
  224 + *
  225 + * @param SplFixedArray $data
  226 + * @param SplFixedArray|null $erasures
  227 + * @return null|integer
  228 + */
  229 + public function decode(SplFixedArray $data, SplFixedArray $erasures = null)
  230 + {
  231 + // This speeds up the initialization a bit.
  232 + $numRootsPlusOne = SplFixedArray::fromArray(array_fill(0, $this->numRoots + 1, 0), false);
  233 + $numRoots = SplFixedArray::fromArray(array_fill(0, $this->numRoots, 0), false);
  234 +
  235 + $lambda = clone $numRootsPlusOne;
  236 + $b = clone $numRootsPlusOne;
  237 + $t = clone $numRootsPlusOne;
  238 + $omega = clone $numRootsPlusOne;
  239 + $root = clone $numRoots;
  240 + $loc = clone $numRoots;
  241 +
  242 + $numErasures = ($erasures !== null ? count($erasures) : 0);
  243 +
  244 + // Form the Syndromes; i.e., evaluate data(x) at roots of g(x)
  245 + $syndromes = SplFixedArray::fromArray(array_fill(0, $this->numRoots, $data[0]), false);
  246 +
  247 + for ($i = 1; $i < $this->blockSize - $this->padding; $i++) {
  248 + for ($j = 0; $j < $this->numRoots; $j++) {
  249 + if ($syndromes[$j] === 0) {
  250 + $syndromes[$j] = $data[$i];
  251 + } else {
  252 + $syndromes[$j] = $data[$i] ^ $this->alphaTo[
  253 + $this->modNn($this->indexOf[$syndromes[$j]] + ($this->firstRoot + $j) * $this->primitive)
  254 + ];
  255 + }
  256 + }
  257 + }
  258 +
  259 + // Convert syndromes to index form, checking for nonzero conditions
  260 + $syndromeError = 0;
  261 +
  262 + for ($i = 0; $i < $this->numRoots; $i++) {
  263 + $syndromeError |= $syndromes[$i];
  264 + $syndromes[$i] = $this->indexOf[$syndromes[$i]];
  265 + }
  266 +
  267 + if (!$syndromeError) {
  268 + // If syndrome is zero, data[] is a codeword and there are no errors
  269 + // to correct, so return data[] unmodified.
  270 + return 0;
  271 + }
  272 +
  273 + $lambda[0] = 1;
  274 +
  275 + if ($numErasures > 0) {
  276 + // Init lambda to be the erasure locator polynomial
  277 + $lambda[1] = $this->alphaTo[$this->modNn($this->primitive * ($this->blockSize - 1 - $erasures[0]))];
  278 +
  279 + for ($i = 1; $i < $numErasures; $i++) {
  280 + $u = $this->modNn($this->primitive * ($this->blockSize - 1 - $erasures[$i]));
  281 +
  282 + for ($j = $i + 1; $j > 0; $j--) {
  283 + $tmp = $this->indexOf[$lambda[$j - 1]];
  284 +
  285 + if ($tmp !== $this->blockSize) {
  286 + $lambda[$j] = $lambda[$j] ^ $this->alphaTo[$this->modNn($u + $tmp)];
  287 + }
  288 + }
  289 + }
  290 + }
  291 +
  292 + for ($i = 0; $i <= $this->numRoots; $i++) {
  293 + $b[$i] = $this->indexOf[$lambda[$i]];
  294 + }
  295 +
  296 + // Begin Berlekamp-Massey algorithm to determine error+erasure locator
  297 + // polynomial
  298 + $r = $numErasures;
  299 + $el = $numErasures;
  300 +
  301 + while (++$r <= $this->numRoots) {
  302 + // Compute discrepancy at the r-th step in poly form
  303 + $discrepancyR = 0;
  304 +
  305 + for ($i = 0; $i < $r; $i++) {
  306 + if ($lambda[$i] !== 0 && $syndromes[$r - $i - 1] !== $this->blockSize) {
  307 + $discrepancyR ^= $this->alphaTo[$this->modNn($this->indexOf[$lambda[$i]] + $syndromes[$r - $i - 1])];
  308 + }
  309 + }
  310 +
  311 + $discrepancyR = $this->indexOf[$discrepancyR];
  312 +
  313 + if ($discrepancyR === $this->blockSize) {
  314 + $tmp = $b->toArray();
  315 + array_unshift($tmp, $this->blockSize);
  316 + array_pop($tmp);
  317 + $b = SplFixedArray::fromArray($tmp, false);
  318 + } else {
  319 + $t[0] = $lambda[0];
  320 +
  321 + for ($i = 0; $i < $this->numRoots; $i++) {
  322 + if ($b[$i] !== $this->blockSize) {
  323 + $t[$i + 1] = $lambda[$i + 1] ^ $this->alphaTo[$this->modNn($discrepancyR + $b[$i])];
  324 + } else {
  325 + $t[$i + 1] = $lambda[$i + 1];
  326 + }
  327 + }
  328 +
  329 + if (2 * $el <= $r + $numErasures - 1) {
  330 + $el = $r + $numErasures - $el;
  331 +
  332 + for ($i = 0; $i <= $this->numRoots; $i++) {
  333 + $b[$i] = (
  334 + $lambda[$i] === 0
  335 + ? $this->blockSize
  336 + : $this->modNn($this->indexOf[$lambda[$i]] - $discrepancyR + $this->blockSize)
  337 + );
  338 + }
  339 + } else {
  340 + $tmp = $b->toArray();
  341 + array_unshift($tmp, $this->blockSize);
  342 + array_pop($tmp);
  343 + $b = SplFixedArray::fromArray($tmp, false);
  344 + }
  345 +
  346 + $lambda = clone $t;
  347 + }
  348 + }
  349 +
  350 + // Convert lambda to index form and compute deg(lambda(x))
  351 + $degLambda = 0;
  352 +
  353 + for ($i = 0; $i <= $this->numRoots; $i++) {
  354 + $lambda[$i] = $this->indexOf[$lambda[$i]];
  355 +
  356 + if ($lambda[$i] !== $this->blockSize) {
  357 + $degLambda = $i;
  358 + }
  359 + }
  360 +
  361 + // Find roots of the error+erasure locator polynomial by Chien search.
  362 + $reg = clone $lambda;
  363 + $reg[0] = 0;
  364 + $count = 0;
  365 +
  366 + for ($i = 1, $k = $this->iPrimitive - 1; $i <= $this->blockSize; $i++, $k = $this->modNn($k + $this->iPrimitive)) {
  367 + $q = 1;
  368 +
  369 + for ($j = $degLambda; $j > 0; $j--) {
  370 + if ($reg[$j] !== $this->blockSize) {
  371 + $reg[$j] = $this->modNn($reg[$j] + $j);
  372 + $q ^= $this->alphaTo[$reg[$j]];
  373 + }
  374 + }
  375 +
  376 + if ($q !== 0) {
  377 + // Not a root
  378 + continue;
  379 + }
  380 +
  381 + // Store root (index-form) and error location number
  382 + $root[$count] = $i;
  383 + $loc[$count] = $k;
  384 +
  385 + if (++$count === $degLambda) {
  386 + break;
  387 + }
  388 + }
  389 +
  390 + if ($degLambda !== $count) {
  391 + // deg(lambda) unequal to number of roots: uncorreactable error
  392 + // detected
  393 + return null;
  394 + }
  395 +
  396 + // Compute err+eras evaluate poly omega(x) = s(x)*lambda(x) (modulo
  397 + // x**numRoots). In index form. Also find deg(omega).
  398 + $degOmega = $degLambda - 1;
  399 +
  400 + for ($i = 0; $i <= $degOmega; $i++) {
  401 + $tmp = 0;
  402 +
  403 + for ($j = $i; $j >= 0; $j--) {
  404 + if ($syndromes[$i - $j] !== $this->blockSize && $lambda[$j] !== $this->blockSize) {
  405 + $tmp ^= $this->alphaTo[$this->modNn($syndromes[$i - $j] + $lambda[$j])];
  406 + }
  407 + }
  408 +
  409 + $omega[$i] = $this->indexOf[$tmp];
  410 + }
  411 +
  412 + // Compute error values in poly-form. num1 = omega(inv(X(l))), num2 =
  413 + // inv(X(l))**(firstRoot-1) and den = lambda_pr(inv(X(l))) all in poly
  414 + // form.
  415 + for ($j = $count - 1; $j >= 0; $j--) {
  416 + $num1 = 0;
  417 +
  418 + for ($i = $degOmega; $i >= 0; $i--) {
  419 + if ($omega[$i] !== $this->blockSize) {
  420 + $num1 ^= $this->alphaTo[$this->modNn($omega[$i] + $i * $root[$j])];
  421 + }
  422 + }
  423 +
  424 + $num2 = $this->alphaTo[$this->modNn($root[$j] * ($this->firstRoot - 1) + $this->blockSize)];
  425 + $den = 0;
  426 +
  427 + // lambda[i+1] for i even is the formal derivativelambda_pr of
  428 + // lambda[i]
  429 + for ($i = min($degLambda, $this->numRoots - 1) & ~1; $i >= 0; $i -= 2) {
  430 + if ($lambda[$i + 1] !== $this->blockSize) {
  431 + $den ^= $this->alphaTo[$this->modNn($lambda[$i + 1] + $i * $root[$j])];
  432 + }
  433 + }
  434 +
  435 + // Apply error to data
  436 + if ($num1 !== 0 && $loc[$j] >= $this->padding) {
  437 + $data[$loc[$j] - $this->padding] = $data[$loc[$j] - $this->padding] ^ (
  438 + $this->alphaTo[
  439 + $this->modNn(
  440 + $this->indexOf[$num1] + $this->indexOf[$num2] + $this->blockSize - $this->indexOf[$den]
  441 + )
  442 + ]
  443 + );
  444 + }
  445 + }
  446 +
  447 + if ($erasures !== null) {
  448 + if (count($erasures) < $count) {
  449 + $erasures->setSize($count);
  450 + }
  451 +
  452 + for ($i = 0; $i < $count; $i++) {
  453 + $erasures[$i] = $loc[$i];
  454 + }
  455 + }
  456 +
  457 + return $count;
  458 + }
  459 +
  460 + /**
  461 + * Computes $x % GF_SIZE, where GF_SIZE is 2**GF_BITS - 1, without a slow
  462 + * divide.
  463 + *
  464 + * @param itneger $x
  465 + * @return integer
  466 + */
  467 + protected function modNn($x)
  468 + {
  469 + while ($x >= $this->blockSize) {
  470 + $x -= $this->blockSize;
  471 + $x = ($x >> $this->symbolSize) + ($x & $this->blockSize);
  472 + }
  473 +
  474 + return $x;
  475 + }
  476 +}