diff --git a/app/Helpers/StorageHelper.php b/app/Helpers/StorageHelper.php index 6ca1216784..a56aa015b4 100644 --- a/app/Helpers/StorageHelper.php +++ b/app/Helpers/StorageHelper.php @@ -27,6 +27,35 @@ class StorageHelper } } + public static function getMediaType($file_with_path) { + + // The file exists and is allowed to be displayed inline + if (Storage::exists($file_with_path)) { + $fileinfo = pathinfo($file_with_path); + $extension = strtolower($fileinfo['extension']); + switch ($extension) { + case 'jpg': + case 'png': + case 'gif': + case 'svg': + case 'webp': + return 'image'; + case 'pdf': + return 'pdf'; + case 'mp3': + case 'wav': + case 'ogg': + return 'audio'; + case 'mp4': + case 'webm': + case 'mov': + return 'video'; + default: + return $extension; // Default for unknown types + } + } + return null; + } /** * This determines the file types that should be allowed inline and checks their fileinfo extension @@ -52,7 +81,6 @@ class StorageHelper 'pdf', 'png', 'svg', - 'svg', 'wav', 'webm', 'webp', diff --git a/app/Http/Controllers/Api/UploadedFilesController.php b/app/Http/Controllers/Api/UploadedFilesController.php index b28e0f95ee..72c12d81e7 100644 --- a/app/Http/Controllers/Api/UploadedFilesController.php +++ b/app/Http/Controllers/Api/UploadedFilesController.php @@ -98,15 +98,22 @@ class UploadedFilesController extends Controller 'created_at', ]; - $uploads = $object->uploads(); - $offset = ($request->input('offset') > $object->count()) ? $object->count() : abs($request->input('offset')); + + $uploads = Actionlog::select('action_logs.*') + ->whereNotNull('filename') + ->where('item_type', self::$map_object_type[$object_type]) + ->where('item_id', $object->id) + ->where('action_type', '=', 'uploaded') + ->with('adminuser'); + + $offset = ($request->input('offset') > $uploads->count()) ? $uploads->count() : abs($request->input('offset')); $limit = app('api_limit_value'); $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; - $sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'action_logs.created_at'; + $sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at'; // Text search on action_logs fields - // We could use the normal Actionlogs text scope, but it's a very heavy query since it's searcghing across all relations - // And we generally won't need that here + // We could use the normal Actionlogs text scope, but it's a very heavy query since it's searching across all relations + // and we generally won't need that here if ($request->filled('search')) { $uploads->where( @@ -117,8 +124,10 @@ class UploadedFilesController extends Controller ); } + $total = $uploads->count(); $uploads = $uploads->skip($offset)->take($limit)->orderBy($sort, $order)->get(); - return (new UploadedFilesTransformer())->transformFiles($uploads, $uploads->count()); + + return (new UploadedFilesTransformer())->transformFiles($uploads, $total); } diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index 20d3f8805b..ff54880086 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -108,6 +108,14 @@ class UsersController extends Controller $users = $users->where('users.activated', '=', $request->input('activated')); } + if ($request->input('admins') == 'true') { + $users = $users->OnlyAdminsAndSuperAdmins(); + } + + if ($request->input('superadmins') == 'true') { + $users = $users->OnlySuperAdmins(); + } + if ($request->filled('company_id')) { $users = $users->where('users.company_id', '=', $request->input('company_id')); } diff --git a/app/Http/Controllers/Licenses/LicensesController.php b/app/Http/Controllers/Licenses/LicensesController.php index 458b1ce15b..37d30af6ac 100755 --- a/app/Http/Controllers/Licenses/LicensesController.php +++ b/app/Http/Controllers/Licenses/LicensesController.php @@ -304,13 +304,16 @@ class LicensesController extends Controller $response = new StreamedResponse(function () { // Open output stream $handle = fopen('php://output', 'w'); - $licenses= License::with('company', + $licenses = License::with('company', 'manufacturer', 'category', 'supplier', 'adminuser', - 'assignedusers') - ->orderBy('created_at', 'DESC'); + 'assignedusers'); + if (request()->filled('category_id')) { + $licenses = $licenses->where('category_id', request()->input('category_id')); + } + $licenses = $licenses->orderBy('created_at', 'DESC'); Company::scopeCompanyables($licenses) ->chunk(500, function ($licenses) use ($handle) { $headers = [ diff --git a/app/Http/Controllers/Users/UserFilesController.php b/app/Http/Controllers/Users/UserFilesController.php index 45bd0c6329..3e1f6cd9a6 100644 --- a/app/Http/Controllers/Users/UserFilesController.php +++ b/app/Http/Controllers/Users/UserFilesController.php @@ -25,32 +25,22 @@ class UserFilesController extends Controller public function store(UploadFileRequest $request, User $user) { $this->authorize('update', $user); - $files = $request->file('file'); - if (is_null($files)) { - return redirect()->back()->with('error', trans('admin/users/message.upload.nofiles')); - } - foreach ($files as $file) { - $file_name = $request->handleFile('private_uploads/users/', 'user-'.$user->id, $file); - - //Log the uploaded file to the log - $logAction = new Actionlog(); - $logAction->item_id = $user->id; - $logAction->item_type = User::class; - $logAction->created_by = auth()->id(); - $logAction->note = $request->input('notes'); - $logAction->target_id = null; - $logAction->created_at = date("Y-m-d H:i:s"); - $logAction->filename = $file_name; - $logAction->action_type = 'uploaded'; - - if (! $logAction->save()) { - return JsonResponse::create(['error' => 'Failed validation: '.print_r($logAction->getErrors(), true)], 500); + if ($request->hasFile('file')) { + if (! Storage::exists('private_uploads/users')) { + Storage::makeDirectory('private_uploads/users', 775); } - return redirect()->back()->withFragment('files')->with('success', trans('admin/users/message.upload.success')); + foreach ($request->file('file') as $file) { + $file_name = $request->handleFile('private_uploads/users/','user-'.$user->id, $file); + $user->logUpload($file_name, $request->get('notes')); + } + + return redirect()->back()->withFragment('files')->with('success', trans('admin/users/message.upload.success')); } + return redirect()->back()->with('error', trans('admin/users/message.upload.nofiles')); + } diff --git a/app/Http/Transformers/ActionlogsTransformer.php b/app/Http/Transformers/ActionlogsTransformer.php index 809e00beba..64086ca46e 100644 --- a/app/Http/Transformers/ActionlogsTransformer.php +++ b/app/Http/Transformers/ActionlogsTransformer.php @@ -2,6 +2,7 @@ namespace App\Http\Transformers; use App\Helpers\Helper; +use App\Helpers\StorageHelper; use App\Models\Actionlog; use App\Models\Asset; use App\Models\CustomField; @@ -16,6 +17,7 @@ use Illuminate\Contracts\Encryption\DecryptException; use Illuminate\Support\Facades\Crypt; use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\Log; +use Illuminate\Support\Facades\Storage; class ActionlogsTransformer { @@ -133,24 +135,6 @@ class ActionlogsTransformer $clean_meta= $this->changedInfo($clean_meta); } - $file_url = ''; - if($actionlog->filename!='') { - if ($actionlog->action_type == 'accepted') { - $file_url = route('log.storedeula.download', ['filename' => $actionlog->filename]); - } else { - if ($actionlog->item) { - if ($actionlog->itemType() == 'asset') { - $file_url = route('show/assetfile', ['asset' => $actionlog->item->id, 'fileId' => $actionlog->id]); - } elseif ($actionlog->itemType() == 'accessory') { - $file_url = route('show.accessoryfile', ['accessoryId' => $actionlog->item->id, 'fileId' => $actionlog->id]); - } elseif ($actionlog->itemType() == 'license') { - $file_url = route('show.licensefile', ['licenseId' => $actionlog->item->id, 'fileId' => $actionlog->id]); - } elseif ($actionlog->itemType() == 'user') { - $file_url = route('show/userfile', ['user' => $actionlog->item->id, 'fileId' => $actionlog->id]); - } - } - } - } $array = [ 'id' => (int) $actionlog->id, @@ -158,8 +142,10 @@ class ActionlogsTransformer 'file' => ($actionlog->filename!='') ? [ - 'url' => $file_url, + 'url' => $actionlog->uploads_file_url(), 'filename' => $actionlog->filename, + 'inlineable' => StorageHelper::allowSafeInline($actionlog->uploads_file_url()), + 'exists_on_disk' => Storage::exists($actionlog->uploads_file_path()) ? true : false, ] : null, 'item' => ($actionlog->item) ? [ diff --git a/app/Http/Transformers/LicensesTransformer.php b/app/Http/Transformers/LicensesTransformer.php index b63a5725a4..af2e902087 100644 --- a/app/Http/Transformers/LicensesTransformer.php +++ b/app/Http/Transformers/LicensesTransformer.php @@ -62,7 +62,7 @@ class LicensesTransformer 'checkin' => Gate::allows('checkin', License::class), 'clone' => Gate::allows('create', License::class), 'update' => Gate::allows('update', License::class), - 'delete' => (Gate::allows('delete', License::class) && ($license->free_seats_count > 0)) ? true : false, + 'delete' => (Gate::allows('delete', License::class) && ($license->free_seats_count == $license->seats)) ? true : false, ]; $array += $permissions_array; diff --git a/app/Http/Transformers/UploadedFilesTransformer.php b/app/Http/Transformers/UploadedFilesTransformer.php index 48aebbe34a..ae6c981eda 100644 --- a/app/Http/Transformers/UploadedFilesTransformer.php +++ b/app/Http/Transformers/UploadedFilesTransformer.php @@ -32,10 +32,11 @@ class UploadedFilesTransformer 'name' => e($file->filename), 'item' => ($file->item_type) ? [ 'id' => (int) $file->item_id, - 'type' => strtolower(class_basename($file->item_type)), + 'type' => str_plural(strtolower(class_basename($file->item_type))), ] : null, 'filename' => e($file->filename), 'filetype' => StorageHelper::getFiletype($file->uploads_file_path()), + 'mediatype' => StorageHelper::getMediaType($file->uploads_file_path()), 'url' => $file->uploads_file_url(), 'note' => ($file->note) ? e($file->note) : null, 'created_by' => ($file->adminuser) ? [ @@ -44,7 +45,7 @@ class UploadedFilesTransformer ] : null, 'created_at' => Helper::getFormattedDateObject($file->created_at, 'datetime'), 'deleted_at' => Helper::getFormattedDateObject($file->deleted_at, 'datetime'), - 'inline' => StorageHelper::allowSafeInline($file->uploads_file_path()), + 'inlineable' => StorageHelper::allowSafeInline($file->uploads_file_path()), 'exists_on_disk' => (Storage::exists($file->uploads_file_path()) ? true : false), ]; diff --git a/app/Http/Transformers/UsersTransformer.php b/app/Http/Transformers/UsersTransformer.php index 7f05fa5248..5140f67148 100644 --- a/app/Http/Transformers/UsersTransformer.php +++ b/app/Http/Transformers/UsersTransformer.php @@ -22,6 +22,12 @@ class UsersTransformer public function transformUser(User $user) { + $role = ''; + if ($user->isSuperUser()) { + $role = 'superadmin'; + } elseif ($user->isAdmin()) { + $role = 'admin'; + } $array = [ 'id' => (int) $user->id, 'avatar' => e($user->present()->gravatar) ?? null, @@ -59,6 +65,7 @@ class UsersTransformer 'name'=> e($user->userloc->name), ] : null, 'notes'=> Helper::parseEscapedMarkedownInline($user->notes), + 'role' => $role, 'permissions' => $user->decodePermissions(), 'activated' => ($user->activated == '1') ? true : false, 'autoassign_licenses' => ($user->autoassign_licenses == '1') ? true : false, diff --git a/app/Models/Actionlog.php b/app/Models/Actionlog.php index 81c6964ed8..2f2a8cfcee 100755 --- a/app/Models/Actionlog.php +++ b/app/Models/Actionlog.php @@ -457,6 +457,11 @@ class Actionlog extends SnipeModel public function uploads_file_url() { + + if (($this->action_type == 'accepted') || ($this->action_type == 'declined')) { + return route('log.storedeula.download', ['filename' => $this->filename]); + } + switch ($this->item_type) { case Accessory::class: return route('show.accessoryfile', [$this->item_id, $this->id]); @@ -465,7 +470,7 @@ class Actionlog extends SnipeModel case AssetModel::class: return route('show/modelfile', [$this->item_id, $this->id]); case Consumable::class: - return route('show/locationsfile', [$this->item_id, $this->id]); + return route('show.consumablefile', [$this->item_id, $this->id]); case Component::class: return route('show.componentfile', [$this->item_id, $this->id]); case License::class: @@ -482,6 +487,10 @@ class Actionlog extends SnipeModel public function uploads_file_path() { + if (($this->action_type == 'accepted') || ($this->action_type == 'declined')) { + return 'private_uploads/eula-pdfs/'.$this->filename; + } + switch ($this->item_type) { case Accessory::class: return 'private_uploads/accessories/'.$this->filename; diff --git a/app/Models/User.php b/app/Models/User.php index 3d436b07e2..b673761b3b 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -891,6 +891,49 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo ); } + /** + * Return only admins and superusers + * + * @param \Illuminate\Database\Query\Builder $query Query builder instance + */ + public function scopeOnlySuperAdmins($query) + { + + return $query->where('users.permissions', 'LIKE', '%"superuser":"1"%') + ->orWhere('users.permissions', 'LIKE', '%"superuser":1%') + ->orWhereHas( + 'groups', function ($query) { + $query->where('permission_groups.permissions', 'LIKE', '%"superuser":"1"%') + ->orWhere('permission_groups.permissions', 'LIKE', '%"superuser":1%'); + } + ); + + } + + /** + * Return only admins and superusers + * + * @param \Illuminate\Database\Query\Builder $query Query builder instance + */ + public function scopeOnlyAdminsAndSuperAdmins($query) + { + + return $query->where('users.permissions', 'LIKE', '%"superuser":"1"%') + ->orWhere('users.permissions', 'LIKE', '%"superuser":1%') + ->orWhere('users.permissions', 'LIKE', '%"admin":1%') + ->orWhere('users.permissions', 'LIKE', '%"admin":"1"%') + ->orWhereHas( + 'groups', function ($query) { + $query->where('permission_groups.permissions', 'LIKE', '%"superuser":"1"%') + ->orWhere('permission_groups.permissions', 'LIKE', '%"superuser":1%') + ->orWhere('permission_groups.permissions', 'LIKE', '%"admin":1%') + ->orWhere('permission_groups.permissions', 'LIKE', '%"admin":"1"%'); + } + ); + + } + + /** * Query builder scope to order on manager @@ -964,7 +1007,6 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo - /** * Get the preferred locale for the user. * @@ -1003,7 +1045,6 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo public function scopeUserLocation($query, $location, $search) { - return $query->where('location_id', '=', $location) ->where('users.first_name', 'LIKE', '%' . $search . '%') ->orWhere('users.email', 'LIKE', '%' . $search . '%') @@ -1016,9 +1057,6 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo ->orWhere('users.username', 'LIKE', '%' . $search . '%') ->orwhereRaw('CONCAT(users.first_name," ",users.last_name) LIKE \''.$search.'%\''); - - - } /** diff --git a/app/Presenters/HistoryPresenter.php b/app/Presenters/HistoryPresenter.php index 02094c1849..9b9968ebd2 100644 --- a/app/Presenters/HistoryPresenter.php +++ b/app/Presenters/HistoryPresenter.php @@ -106,7 +106,7 @@ class HistoryPresenter extends Presenter 'switchable' => true, 'title' => trans('general.file_name'), 'visible' => true, - 'formatter' => 'fileUploadNameFormatter', + 'formatter' => 'fileNameFormatter', ], [ 'field' => 'file_download', @@ -115,7 +115,7 @@ class HistoryPresenter extends Presenter 'switchable' => true, 'title' => trans('general.download'), 'visible' => true, - 'formatter' => 'fileUploadFormatter', + 'formatter' => 'fileDownloadButtonsFormatter', ], [ 'field' => 'note', diff --git a/app/Presenters/UploadedFilesPresenter.php b/app/Presenters/UploadedFilesPresenter.php index 80b05ab4c6..83b528d387 100644 --- a/app/Presenters/UploadedFilesPresenter.php +++ b/app/Presenters/UploadedFilesPresenter.php @@ -18,7 +18,7 @@ class UploadedFilesPresenter extends Presenter $layout = [ [ 'field' => 'id', - 'searchable' => false, + 'searchable' => true, 'sortable' => true, 'switchable' => true, 'title' => trans('general.id'), @@ -30,6 +30,7 @@ class UploadedFilesPresenter extends Presenter 'sortable' => false, 'switchable' => false, 'title' => trans('general.type'), + 'visible' => true, 'formatter' => 'iconFormatter', ], [ @@ -38,16 +39,17 @@ class UploadedFilesPresenter extends Presenter 'sortable' => false, 'switchable' => true, 'title' => trans('general.image'), - 'formatter' => 'inlineImageFormatter', + 'visible' => true, + 'formatter' => 'filePreviewFormatter', ], [ 'field' => 'filename', - 'searchable' => false, - 'sortable' => false, + 'searchable' => true, + 'sortable' => true, 'switchable' => true, 'title' => trans('general.file_name'), 'visible' => true, - 'formatter' => 'fileUploadNameFormatter', + 'formatter' => 'fileNameFormatter', ], [ 'field' => 'download', @@ -56,7 +58,7 @@ class UploadedFilesPresenter extends Presenter 'switchable' => true, 'title' => trans('general.download'), 'visible' => true, - 'formatter' => 'downloadOrOpenInNewWindowFormatter', + 'formatter' => 'fileDownloadButtonsFormatter', ], [ 'field' => 'note', @@ -68,10 +70,10 @@ class UploadedFilesPresenter extends Presenter ], [ 'field' => 'created_by', - 'searchable' => false, + 'searchable' => true, 'sortable' => true, 'title' => trans('general.created_by'), - 'visible' => false, + 'visible' => true, 'formatter' => 'usersLinkObjFormatter', ], [ @@ -80,7 +82,7 @@ class UploadedFilesPresenter extends Presenter 'sortable' => true, 'switchable' => true, 'title' => trans('general.created_at'), - 'visible' => false, + 'visible' => true, 'formatter' => 'dateDisplayFormatter', ], [ 'field' => 'available_actions', @@ -88,6 +90,7 @@ class UploadedFilesPresenter extends Presenter 'sortable' => false, 'switchable' => false, 'title' => trans('table.actions'), + 'visible' => true, 'formatter' => 'deleteUploadFormatter', ], ]; diff --git a/app/Presenters/UserPresenter.php b/app/Presenters/UserPresenter.php index fe88c1a1e2..a97aa0cd5f 100644 --- a/app/Presenters/UserPresenter.php +++ b/app/Presenters/UserPresenter.php @@ -180,7 +180,7 @@ class UserPresenter extends Presenter 'switchable' => false, 'title' => trans('admin/users/table.username'), 'visible' => true, - 'formatter' => 'usersLinkFormatter', + 'formatter' => 'usernameRoleLinkFormatter', ], [ 'field' => 'employee_num', diff --git a/public/js/dist/all.js b/public/js/dist/all.js index 7a1862a4e9..1040f6d168 100644 --- a/public/js/dist/all.js +++ b/public/js/dist/all.js @@ -1,3 +1,3 @@ /*! For license information please see all.js.LICENSE.txt */ -(()=>{var e,n={215:()=>{},378:t=>{t.exports=function(t,e,n,i){return(i=i||{}).test&&i.getElementsByClassName||!i.test&&document.getElementsByClassName?function(t,e,n){return n?t.getElementsByClassName(e)[0]:t.getElementsByClassName(e)}(t,e,n):i.test&&i.querySelector||!i.test&&document.querySelector?function(t,e,n){return e="."+e,n?t.querySelector(e):t.querySelectorAll(e)}(t,e,n):function(t,e,n){for(var i=[],o=t.getElementsByTagName("*"),r=o.length,s=new RegExp("(^|\\s)"+e+"(\\s|$)"),a=0,l=0;a{t.exports=function(t){for(var e,n=Array.prototype.slice.call(arguments,1),i=0;e=n[i];i++)if(e)for(var o in e)t[o]=e[o];return t}},465:function(t,e){var n,i;i=this,n=function(){return i.SignaturePad=(t=function(t){"use strict";var e=function(t,e){var n=this,i=e||{};this.velocityFilterWeight=i.velocityFilterWeight||.7,this.minWidth=i.minWidth||.5,this.maxWidth=i.maxWidth||2.5,this.dotSize=i.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=i.penColor||"black",this.backgroundColor=i.backgroundColor||"rgba(0,0,0,0)",this.onEnd=i.onEnd,this.onBegin=i.onBegin,this._canvas=t,this._ctx=t.getContext("2d"),this.clear(),this._handleMouseDown=function(t){1===t.which&&(n._mouseButtonDown=!0,n._strokeBegin(t))},this._handleMouseMove=function(t){n._mouseButtonDown&&n._strokeUpdate(t)},this._handleMouseUp=function(t){1===t.which&&n._mouseButtonDown&&(n._mouseButtonDown=!1,n._strokeEnd(t))},this._handleTouchStart=function(t){if(1==t.targetTouches.length){var e=t.changedTouches[0];n._strokeBegin(e)}},this._handleTouchMove=function(t){t.preventDefault();var e=t.targetTouches[0];n._strokeUpdate(e)},this._handleTouchEnd=function(t){t.target===n._canvas&&(t.preventDefault(),n._strokeEnd(t))},this._handleMouseEvents(),this._handleTouchEvents()};e.prototype.clear=function(){var t=this._ctx,e=this._canvas;t.fillStyle=this.backgroundColor,t.clearRect(0,0,e.width,e.height),t.fillRect(0,0,e.width,e.height),this._reset()},e.prototype.toDataURL=function(t,e){var n=this._canvas;return n.toDataURL.apply(n,arguments)},e.prototype.fromDataURL=function(t){var e=this,n=new Image,i=window.devicePixelRatio||1,o=this._canvas.width/i,r=this._canvas.height/i;this._reset(),n.src=t,n.onload=function(){e._ctx.drawImage(n,0,0,o,r)},this._isEmpty=!1},e.prototype._strokeUpdate=function(t){var e=this._createPoint(t);this._addPoint(e)},e.prototype._strokeBegin=function(t){this._reset(),this._strokeUpdate(t),"function"==typeof this.onBegin&&this.onBegin(t)},e.prototype._strokeDraw=function(t){var e=this._ctx,n="function"==typeof this.dotSize?this.dotSize():this.dotSize;e.beginPath(),this._drawPoint(t.x,t.y,n),e.closePath(),e.fill()},e.prototype._strokeEnd=function(t){var e=this.points.length>2,n=this.points[0];!e&&n&&this._strokeDraw(n),"function"==typeof this.onEnd&&this.onEnd(t)},e.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),t.addEventListener("mouseup",this._handleMouseUp)},e.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)},e.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()},e.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),t.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)},e.prototype.isEmpty=function(){return this._isEmpty},e.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._isEmpty=!0,this._ctx.fillStyle=this.penColor},e.prototype._createPoint=function(t){var e=this._canvas.getBoundingClientRect();return new n(t.clientX-e.left,t.clientY-e.top)},e.prototype._addPoint=function(t){var e,n,o,r=this.points;r.push(t),r.length>2&&(3===r.length&&r.unshift(r[0]),e=this._calculateCurveControlPoints(r[0],r[1],r[2]).c2,n=this._calculateCurveControlPoints(r[1],r[2],r[3]).c1,o=new i(r[1],e,n,r[2]),this._addCurve(o),r.shift())},e.prototype._calculateCurveControlPoints=function(t,e,i){var o=t.x-e.x,r=t.y-e.y,s=e.x-i.x,a=e.y-i.y,l={x:(t.x+e.x)/2,y:(t.y+e.y)/2},c={x:(e.x+i.x)/2,y:(e.y+i.y)/2},u=Math.sqrt(o*o+r*r),h=Math.sqrt(s*s+a*a),d=l.x-c.x,p=l.y-c.y,f=h/(u+h),g={x:c.x+d*f,y:c.y+p*f},m=e.x-g.x,v=e.y-g.y;return{c1:new n(l.x+m,l.y+v),c2:new n(c.x+m,c.y+v)}},e.prototype._addCurve=function(t){var e,n,i=t.startPoint;e=t.endPoint.velocityFrom(i),e=this.velocityFilterWeight*e+(1-this.velocityFilterWeight)*this._lastVelocity,n=this._strokeWidth(e),this._drawCurve(t,this._lastWidth,n),this._lastVelocity=e,this._lastWidth=n},e.prototype._drawPoint=function(t,e,n){var i=this._ctx;i.moveTo(t,e),i.arc(t,e,n,0,2*Math.PI,!1),this._isEmpty=!1},e.prototype._drawCurve=function(t,e,n){var i,o,r,s,a,l,c,u,h,d,p,f=this._ctx,g=n-e;for(i=Math.floor(t.length()),f.beginPath(),r=0;r0&&(s=n-o,a=i-r,c+=Math.sqrt(s*s+a*a)),o=n,r=i;return c},i.prototype._point=function(t,e,n,i,o){return e*(1-t)*(1-t)*(1-t)+3*n*(1-t)*(1-t)*t+3*i*(1-t)*t*t+o*t*t*t},e}(document),t);var t}.apply(e,[]),void 0===n||(t.exports=n)},594:function(t,e,n){var i,o;i=[n(4692)],o=function(t){return function(t){"use strict";var e=function(n,i,o,r,s){this.fallbackValue=o?"string"==typeof o?this.parse(o):o:null,this.fallbackFormat=r||"rgba",this.hexNumberSignPrefix=!0===s,this.value=this.fallbackValue,this.origFormat=null,this.predefinedColors=i||{},this.colors=t.extend({},e.webColors,this.predefinedColors),n&&(void 0!==n.h?this.value=n:this.setColor(String(n))),this.value||(this.value={h:0,s:0,b:0,a:1})};e.webColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32",transparent:"transparent"},e.prototype={constructor:e,colors:{},predefinedColors:{},getValue:function(){return this.value},setValue:function(t){this.value=t},_sanitizeNumber:function(t){return"number"==typeof t?t:isNaN(t)||null===t||""===t||void 0===t?1:""===t?0:void 0!==t.toLowerCase?(t.match(/^\./)&&(t="0"+t),Math.ceil(100*parseFloat(t))/100):1},isTransparent:function(t){return!(!t||!("string"==typeof t||t instanceof String))&&("transparent"===(t=t.toLowerCase().trim())||t.match(/#?00000000/)||t.match(/(rgba|hsla)\(0,0,0,0?\.?0\)/))},rgbaIsTransparent:function(t){return 0===t.r&&0===t.g&&0===t.b&&0===t.a},setColor:function(t){if(t=t.toLowerCase().trim()){if(this.isTransparent(t))return this.value={h:0,s:0,b:0,a:0},!0;var e=this.parse(t);e?(this.value=this.value={h:e.h,s:e.s,b:e.b,a:e.a},this.origFormat||(this.origFormat=e.format)):this.fallbackValue&&(this.value=this.fallbackValue)}return!1},setHue:function(t){this.value.h=1-t},setSaturation:function(t){this.value.s=t},setBrightness:function(t){this.value.b=1-t},setAlpha:function(t){this.value.a=Math.round(parseInt(100*(1-t),10)/100*100)/100},toRGB:function(t,e,n,i){var o,r,s,a,l;return 0===arguments.length&&(t=this.value.h,e=this.value.s,n=this.value.b,i=this.value.a),t=(t*=360)%360/60,o=r=s=n-(l=n*e),o+=[l,a=l*(1-Math.abs(t%2-1)),0,0,a,l][t=~~t],r+=[a,l,l,a,0,0][t],s+=[0,0,a,l,l,a][t],{r:Math.round(255*o),g:Math.round(255*r),b:Math.round(255*s),a:i}},toHex:function(t,e,n,i,o){arguments.length<=1&&(e=this.value.h,n=this.value.s,i=this.value.b,o=this.value.a);var r="#",s=this.toRGB(e,n,i,o);return this.rgbaIsTransparent(s)?"transparent":(t||(r=this.hexNumberSignPrefix?"#":""),r+((1<<24)+(parseInt(s.r)<<16)+(parseInt(s.g)<<8)+parseInt(s.b)).toString(16).slice(1))},toHSL:function(t,e,n,i){0===arguments.length&&(t=this.value.h,e=this.value.s,n=this.value.b,i=this.value.a);var o=t,r=(2-e)*n,s=e*n;return s/=r>0&&r<=1?r:2-r,r/=2,s>1&&(s=1),{h:isNaN(o)?0:o,s:isNaN(s)?0:s,l:isNaN(r)?0:r,a:isNaN(i)?0:i}},toAlias:function(t,e,n,i){var o,r=0===arguments.length?this.toHex(!0):this.toHex(!0,t,e,n,i),s="alias"===this.origFormat?r:this.toString(!1,this.origFormat);for(var a in this.colors)if((o=this.colors[a].toLowerCase().trim())===r||o===s)return a;return!1},RGBtoHSB:function(t,e,n,i){var o,r,s,a;return t/=255,e/=255,n/=255,o=((o=0==(a=(s=Math.max(t,e,n))-Math.min(t,e,n))?null:s===t?(e-n)/a:s===e?(n-t)/a+2:(t-e)/a+4)+360)%6*60/360,r=0===a?0:a/s,{h:this._sanitizeNumber(o),s:r,b:s,a:this._sanitizeNumber(i)}},HueToRGB:function(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t},HSLtoRGB:function(t,e,n,i){var o;e<0&&(e=0);var r=2*n-(o=n<=.5?n*(1+e):n+e-n*e),s=t+1/3,a=t,l=t-1/3;return[Math.round(255*this.HueToRGB(r,o,s)),Math.round(255*this.HueToRGB(r,o,a)),Math.round(255*this.HueToRGB(r,o,l)),this._sanitizeNumber(i)]},parse:function(e){if("string"!=typeof e)return this.fallbackValue;if(0===arguments.length)return!1;var n,i,o=this,r=!1,s=void 0!==this.colors[e];return s&&(e=this.colors[e].toLowerCase().trim()),t.each(this.stringParsers,(function(t,a){var l=a.re.exec(e);return!(n=l&&a.parse.apply(o,[l]))||(r={},i=s?"alias":a.format?a.format:o.getValidFallbackFormat(),(r=i.match(/hsla?/)?o.RGBtoHSB.apply(o,o.HSLtoRGB.apply(o,n)):o.RGBtoHSB.apply(o,n))instanceof Object&&(r.format=i),!1)})),r},getValidFallbackFormat:function(){var t=["rgba","rgb","hex","hsla","hsl"];return this.origFormat&&-1!==t.indexOf(this.origFormat)?this.origFormat:this.fallbackFormat&&-1!==t.indexOf(this.fallbackFormat)?this.fallbackFormat:"rgba"},toString:function(t,n,i){i=i||!1;var o=!1;switch(n=n||this.origFormat||this.fallbackFormat){case"rgb":return o=this.toRGB(),this.rgbaIsTransparent(o)?"transparent":"rgb("+o.r+","+o.g+","+o.b+")";case"rgba":return"rgba("+(o=this.toRGB()).r+","+o.g+","+o.b+","+o.a+")";case"hsl":return o=this.toHSL(),"hsl("+Math.round(360*o.h)+","+Math.round(100*o.s)+"%,"+Math.round(100*o.l)+"%)";case"hsla":return o=this.toHSL(),"hsla("+Math.round(360*o.h)+","+Math.round(100*o.s)+"%,"+Math.round(100*o.l)+"%,"+o.a+")";case"hex":return this.toHex(t);case"alias":return!1===(o=this.toAlias())?this.toString(t,this.getValidFallbackFormat()):i&&!(o in e.webColors)&&o in this.predefinedColors?this.predefinedColors[o]:o;default:return o}},stringParsers:[{re:/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*?\)/,format:"rgb",parse:function(t){return[t[1],t[2],t[3],1]}},{re:/rgb\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,format:"rgb",parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],1]}},{re:/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/hsl\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,format:"hsl",parse:function(t){return[t[1]/360,t[2]/100,t[3]/100,t[4]]}},{re:/hsla\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"hsla",parse:function(t){return[t[1]/360,t[2]/100,t[3]/100,t[4]]}},{re:/#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,format:"hex",parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),1]}},{re:/#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,format:"hex",parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),1]}}],colorNameToHex:function(t){return void 0!==this.colors[t.toLowerCase()]&&this.colors[t.toLowerCase()]}};var n={horizontal:!1,inline:!1,color:!1,format:!1,input:"input",container:!1,component:".add-on, .input-group-addon",fallbackColor:!1,fallbackFormat:"hex",hexNumberSignPrefix:!0,sliders:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setHue"},alpha:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setAlpha"}},slidersHorz:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:100,maxTop:0,callLeft:"setHue",callTop:!1},alpha:{maxLeft:100,maxTop:0,callLeft:"setAlpha",callTop:!1}},template:'',leftArrow:"",rightArrow:"",strings:{close:"Close",fail:"Failed to load image:",type:"Could not detect remote target type. Force the type using data-type"},doc:document,onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}},r=function(){function n(t,i){var r=this;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,n),this._config=e.extend({},o,i),this._$modalArrows=null,this._galleryIndex=0,this._galleryName=null,this._padding=null,this._border=null,this._titleIsShown=!1,this._footerIsShown=!1,this._wantedWidth=0,this._wantedHeight=0,this._touchstartX=0,this._touchendX=0,this._modalId="ekkoLightbox-"+Math.floor(1e3*Math.random()+1),this._$element=t instanceof jQuery?t:e(t),this._isBootstrap3=3==e.fn.modal.Constructor.VERSION[0];var s='",a='',l='";e(this._config.doc.body).append('"),this._$modal=e("#"+this._modalId,this._config.doc),this._$modalDialog=this._$modal.find(".modal-dialog").first(),this._$modalContent=this._$modal.find(".modal-content").first(),this._$modalBody=this._$modal.find(".modal-body").first(),this._$modalHeader=this._$modal.find(".modal-header").first(),this._$modalFooter=this._$modal.find(".modal-footer").first(),this._$lightboxContainer=this._$modalBody.find(".ekko-lightbox-container").first(),this._$lightboxBodyOne=this._$lightboxContainer.find("> div:first-child").first(),this._$lightboxBodyTwo=this._$lightboxContainer.find("> div:last-child").first(),this._border=this._calculateBorders(),this._padding=this._calculatePadding(),this._galleryName=this._$element.data("gallery"),this._galleryName&&(this._$galleryItems=e(document.body).find('*[data-gallery="'+this._galleryName+'"]'),this._galleryIndex=this._$galleryItems.index(this._$element),e(document).on("keydown.ekkoLightbox",this._navigationalBinder.bind(this)),this._config.showArrows&&this._$galleryItems.length>1&&(this._$lightboxContainer.append('"),this._$modalArrows=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay").first(),this._$lightboxContainer.on("click","a:first-child",(function(t){return t.preventDefault(),r.navigateLeft()})),this._$lightboxContainer.on("click","a:last-child",(function(t){return t.preventDefault(),r.navigateRight()})),this.updateNavigation())),this._$modal.on("show.bs.modal",this._config.onShow.bind(this)).on("shown.bs.modal",(function(){return r._toggleLoading(!0),r._handle(),r._config.onShown.call(r)})).on("hide.bs.modal",this._config.onHide.bind(this)).on("hidden.bs.modal",(function(){return r._galleryName&&(e(document).off("keydown.ekkoLightbox"),e(window).off("resize.ekkoLightbox")),r._$modal.remove(),r._config.onHidden.call(r)})).modal(this._config),e(window).on("resize.ekkoLightbox",(function(){r._resize(r._wantedWidth,r._wantedHeight)})),this._$lightboxContainer.on("touchstart",(function(){r._touchstartX=event.changedTouches[0].screenX})).on("touchend",(function(){r._touchendX=event.changedTouches[0].screenX,r._swipeGesure()}))}return t(n,null,[{key:"Default",get:function(){return o}}]),t(n,[{key:"element",value:function(){return this._$element}},{key:"modal",value:function(){return this._$modal}},{key:"navigateTo",value:function(t){return t<0||t>this._$galleryItems.length-1?this:(this._galleryIndex=t,this.updateNavigation(),this._$element=e(this._$galleryItems.get(this._galleryIndex)),void this._handle())}},{key:"navigateLeft",value:function(){if(this._$galleryItems&&1!==this._$galleryItems.length){if(0===this._galleryIndex){if(!this._config.wrapping)return;this._galleryIndex=this._$galleryItems.length-1}else this._galleryIndex--;return this._config.onNavigate.call(this,"left",this._galleryIndex),this.navigateTo(this._galleryIndex)}}},{key:"navigateRight",value:function(){if(this._$galleryItems&&1!==this._$galleryItems.length){if(this._galleryIndex===this._$galleryItems.length-1){if(!this._config.wrapping)return;this._galleryIndex=0}else this._galleryIndex++;return this._config.onNavigate.call(this,"right",this._galleryIndex),this.navigateTo(this._galleryIndex)}}},{key:"updateNavigation",value:function(){if(!this._config.wrapping){var t=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay");0===this._galleryIndex?t.find("a:first-child").addClass("disabled"):t.find("a:first-child").removeClass("disabled"),this._galleryIndex===this._$galleryItems.length-1?t.find("a:last-child").addClass("disabled"):t.find("a:last-child").removeClass("disabled")}}},{key:"close",value:function(){return this._$modal.modal("hide")}},{key:"_navigationalBinder",value:function(t){return 39===(t=t||window.event).keyCode?this.navigateRight():37===t.keyCode?this.navigateLeft():void 0}},{key:"_detectRemoteType",value:function(t,e){return!(e=e||!1)&&this._isImage(t)&&(e="image"),!e&&this._getYoutubeId(t)&&(e="youtube"),!e&&this._getVimeoId(t)&&(e="vimeo"),!e&&this._getInstagramId(t)&&(e="instagram"),(!e||["image","youtube","vimeo","instagram","video","url"].indexOf(e)<0)&&(e="url"),e}},{key:"_isImage",value:function(t){return t&&t.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)}},{key:"_containerToUse",value:function(){var t=this,e=this._$lightboxBodyTwo,n=this._$lightboxBodyOne;return this._$lightboxBodyTwo.hasClass("in")&&(e=this._$lightboxBodyOne,n=this._$lightboxBodyTwo),n.removeClass("in show"),setTimeout((function(){t._$lightboxBodyTwo.hasClass("in")||t._$lightboxBodyTwo.empty(),t._$lightboxBodyOne.hasClass("in")||t._$lightboxBodyOne.empty()}),500),e.addClass("in show"),e}},{key:"_handle",value:function(){var t=this._containerToUse();this._updateTitleAndFooter();var e=this._$element.attr("data-remote")||this._$element.attr("href"),n=this._detectRemoteType(e,this._$element.attr("data-type")||!1);if(["image","youtube","vimeo","instagram","video","url"].indexOf(n)<0)return this._error(this._config.strings.type);switch(n){case"image":this._preloadImage(e,t),this._preloadImageByIndex(this._galleryIndex,3);break;case"youtube":this._showYoutubeVideo(e,t);break;case"vimeo":this._showVimeoVideo(this._getVimeoId(e),t);break;case"instagram":this._showInstagramVideo(this._getInstagramId(e),t);break;case"video":this._showHtml5Video(e,t);break;default:this._loadRemoteContent(e,t)}return this}},{key:"_getYoutubeId",value:function(t){if(!t)return!1;var e=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!e||11!==e[2].length)&&e[2]}},{key:"_getVimeoId",value:function(t){return!!(t&&t.indexOf("vimeo")>0)&&t}},{key:"_getInstagramId",value:function(t){return!!(t&&t.indexOf("instagram")>0)&&t}},{key:"_toggleLoading",value:function(t){return(t=t||!1)?(this._$modalDialog.css("display","none"),this._$modal.removeClass("in show"),e(".modal-backdrop").append(this._config.loadingMessage)):(this._$modalDialog.css("display","block"),this._$modal.addClass("in show"),e(".modal-backdrop").find(".ekko-lightbox-loader").remove()),this}},{key:"_calculateBorders",value:function(){return{top:this._totalCssByAttribute("border-top-width"),right:this._totalCssByAttribute("border-right-width"),bottom:this._totalCssByAttribute("border-bottom-width"),left:this._totalCssByAttribute("border-left-width")}}},{key:"_calculatePadding",value:function(){return{top:this._totalCssByAttribute("padding-top"),right:this._totalCssByAttribute("padding-right"),bottom:this._totalCssByAttribute("padding-bottom"),left:this._totalCssByAttribute("padding-left")}}},{key:"_totalCssByAttribute",value:function(t){return parseInt(this._$modalDialog.css(t),10)+parseInt(this._$modalContent.css(t),10)+parseInt(this._$modalBody.css(t),10)}},{key:"_updateTitleAndFooter",value:function(){var t=this._$element.data("title")||"",e=this._$element.data("footer")||"";return this._titleIsShown=!1,t||this._config.alwaysShowClose?(this._titleIsShown=!0,this._$modalHeader.css("display","").find(".modal-title").html(t||" ")):this._$modalHeader.css("display","none"),this._footerIsShown=!1,e?(this._footerIsShown=!0,this._$modalFooter.css("display","").html(e)):this._$modalFooter.css("display","none"),this}},{key:"_showYoutubeVideo",value:function(t,e){var n=this._getYoutubeId(t),i=t.indexOf("&")>0?t.substr(t.indexOf("&")):"",o=this._$element.data("width")||560,r=this._$element.data("height")||o/(560/315);return this._showVideoIframe("//www.youtube.com/embed/"+n+"?badge=0&autoplay=1&html5=1"+i,o,r,e)}},{key:"_showVimeoVideo",value:function(t,e){var n=this._$element.data("width")||500,i=this._$element.data("height")||n/(560/315);return this._showVideoIframe(t+"?autoplay=1",n,i,e)}},{key:"_showInstagramVideo",value:function(t,e){var n=this._$element.data("width")||612,i=n+80;return t="/"!==t.substr(-1)?t+"/":t,e.html(''),this._resize(n,i),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showVideoIframe",value:function(t,e,n,i){return n=n||e,i.html('
'),this._resize(e,n),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showHtml5Video",value:function(t,e){var n=this._$element.data("width")||560,i=this._$element.data("height")||n/(560/315);return e.html('
'),this._resize(n,i),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_loadRemoteContent",value:function(t,n){var i=this,o=this._$element.data("width")||560,r=this._$element.data("height")||560,s=this._$element.data("disableExternalCheck")||!1;return this._toggleLoading(!1),s||this._isExternal(t)?(n.html(''),this._config.onContentLoaded.call(this)):n.load(t,e.proxy((function(){return i._$element.trigger("loaded.bs.modal")}))),this._$modalArrows&&this._$modalArrows.css("display","none"),this._resize(o,r),this}},{key:"_isExternal",value:function(t){var e=t.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof e[1]&&e[1].length>0&&e[1].toLowerCase()!==location.protocol||"string"==typeof e[2]&&e[2].length>0&&e[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host}},{key:"_error",value:function(t){return console.error(t),this._containerToUse().html(t),this._resize(300,300),this}},{key:"_preloadImageByIndex",value:function(t,n){if(this._$galleryItems){var i=e(this._$galleryItems.get(t),!1);if(void 0!==i){var o=i.attr("data-remote")||i.attr("href");return("image"===i.attr("data-type")||this._isImage(o))&&this._preloadImage(o,!1),n>0?this._preloadImageByIndex(t+1,n-1):void 0}}}},{key:"_preloadImage",value:function(t,n){var i=this;n=n||!1;var o=new Image;return n&&function(){var r=setTimeout((function(){n.append(i._config.loadingMessage)}),200);o.onload=function(){r&&clearTimeout(r),r=null;var t=e("");return t.attr("src",o.src),t.addClass("img-fluid"),t.css("width","100%"),n.html(t),i._$modalArrows&&i._$modalArrows.css("display",""),i._resize(o.width,o.height),i._toggleLoading(!1),i._config.onContentLoaded.call(i)},o.onerror=function(){return i._toggleLoading(!1),i._error(i._config.strings.fail+" "+t)}}(),o.src=t,o}},{key:"_swipeGesure",value:function(){return this._touchendXthis._touchstartX?this.navigateLeft():void 0}},{key:"_resize",value:function(t,n){n=n||t,this._wantedWidth=t,this._wantedHeight=n;var i=t/n,o=this._padding.left+this._padding.right+this._border.left+this._border.right,r=this._config.doc.body.clientWidth>575?20:0,s=this._config.doc.body.clientWidth>575?0:20,a=Math.min(t+o,this._config.doc.body.clientWidth-r,this._config.maxWidth);t+o>a?(n=(a-o-s)/i,t=a):t+=o;var l=0,c=0;this._footerIsShown&&(c=this._$modalFooter.outerHeight(!0)||55),this._titleIsShown&&(l=this._$modalHeader.outerHeight(!0)||67);var u=this._padding.top+this._padding.bottom+this._border.bottom+this._border.top,h=parseFloat(this._$modalDialog.css("margin-top"))+parseFloat(this._$modalDialog.css("margin-bottom")),d=Math.min(n,e(window).height()-u-h-l-c,this._config.maxHeight-u-l-c);n>d&&(t=Math.ceil(d*i)+o),this._$lightboxContainer.css("height",d),this._$modalDialog.css("flex",1).css("maxWidth",t);var p=this._$modal.data("bs.modal");if(p)try{p._handleUpdate()}catch(t){p.handleUpdate()}return this}}],[{key:"_jQueryInterface",value:function(t){var i=this;return t=t||{},this.each((function(){var o=e(i),r=e.extend({},n.Default,o.data(),"object"==typeof t&&t);new n(i,r)}))}}]),n}();e.fn[n]=r._jQueryInterface,e.fn[n].Constructor=r,e.fn[n].noConflict=function(){return e.fn[n]=i,r._jQueryInterface}}(jQuery)}(jQuery)},3138:()=>{},3195:(t,e,n)=>{var i=n(5981),o=n(6332),r=n(9799);t.exports=function(t){var e=function(e,o){var r,a=t.matchingItems.length,l=t.i,c=t.page,u=Math.ceil(a/c),h=Math.ceil(l/c),d=o.innerWindow||2,p=o.left||o.outerWindow||0,f=o.right||o.outerWindow||0;f=u-f,e.clear();for(var g=1;g<=u;g++){var m=h===g?"active":"";n.number(g,p,f,h,d)?(r=e.add({page:g,dotted:!1})[0],m&&i(r.elm).add(m),s(r.elm,g,c)):n.dotted(e,g,p,f,h,d,e.size())&&(r=e.add({page:"...",dotted:!0})[0],i(r.elm).add("disabled"))}},n={number:function(t,e,n,i,o){return this.left(t,e)||this.right(t,n)||this.innerWindow(t,i,o)},left:function(t,e){return t<=e},right:function(t,e){return t>e},innerWindow:function(t,e,n){return t>=e-n&&t<=e+n},dotted:function(t,e,n,i,o,r,s){return this.dottedLeft(t,e,n,i,o,r)||this.dottedRight(t,e,n,i,o,r,s)},dottedLeft:function(t,e,n,i,o,r){return e==n+1&&!this.innerWindow(e,o,r)&&!this.right(e,i)},dottedRight:function(t,e,n,i,o,r,s){return!t.items[s-1].values().dotted&&(e==i&&!this.innerWindow(e,o,r)&&!this.right(e,i))}},s=function(e,n,i){o.bind(e,"click",(function(){t.show((n-1)*i+1,i)}))};return function(n){var i=new r(t.listContainer.id,{listClass:n.paginationClass||"pagination",item:"
  • ",valueNames:["page","dotted"],searchClass:"pagination-search-that-is-not-supposed-to-exist",sortClass:"pagination-sort-that-is-not-supposed-to-exist"});t.on("updated",(function(){e(i,n)})),e(i,n)}}},4249:t=>{t.exports=function(t){return t.handlers.filterStart=t.handlers.filterStart||[],t.handlers.filterComplete=t.handlers.filterComplete||[],function(e){if(t.trigger("filterStart"),t.i=1,t.reset.filter(),void 0===e)t.filtered=!1;else{t.filtered=!0;for(var n=t.items,i=0,o=n.length;i{t.exports=function(t){var e,n,i,o,r={resetList:function(){t.i=1,t.templater.clear(),o=void 0},setOptions:function(t){2==t.length&&t[1]instanceof Array?n=t[1]:2==t.length&&"function"==typeof t[1]?(n=void 0,o=t[1]):3==t.length?(n=t[1],o=t[2]):n=void 0},setColumns:function(){0!==t.items.length&&void 0===n&&(n=void 0===t.searchColumns?r.toArray(t.items[0].values()):t.searchColumns)},setSearchString:function(e){e=(e=t.utils.toString(e).toLowerCase()).replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),i=e},toArray:function(t){var e=[];for(var n in t)e.push(n);return e}},s={list:function(){for(var e=0,n=t.items.length;e-1))},reset:function(){t.reset.search(),t.searched=!1}},a=function(e){return t.trigger("searchStart"),r.resetList(),r.setSearchString(e),r.setOptions(arguments),r.setColumns(),""===i?s.reset():(t.searched=!0,o?o(i,n):s.list()),t.update(),t.trigger("searchComplete"),t.visibleItems};return t.handlers.searchStart=t.handlers.searchStart||[],t.handlers.searchComplete=t.handlers.searchComplete||[],t.utils.events.bind(t.utils.getByClass(t.listContainer,t.searchClass),"keyup",(function(e){var n=e.target||e.srcElement;""===n.value&&!t.searched||a(n.value)})),t.utils.events.bind(t.utils.getByClass(t.listContainer,t.searchClass),"input",(function(t){""===(t.target||t.srcElement).value&&a("")})),a}},4692:function(t,e){var n;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(i,o){"use strict";var r=[],s=Object.getPrototypeOf,a=r.slice,l=r.flat?function(t){return r.flat.call(t)}:function(t){return r.concat.apply([],t)},c=r.push,u=r.indexOf,h={},d=h.toString,p=h.hasOwnProperty,f=p.toString,g=f.call(Object),m={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function(t){return null!=t&&t===t.window},b=i.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function x(t,e,n){var i,o,r=(n=n||b).createElement("script");if(r.text=t,e)for(i in w)(o=e[i]||e.getAttribute&&e.getAttribute(i))&&r.setAttribute(i,o);n.head.appendChild(r).parentNode.removeChild(r)}function _(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?h[d.call(t)]||"object":typeof t}var C="3.5.1",k=function(t,e){return new k.fn.init(t,e)};function T(t){var e=!!t&&"length"in t&&t.length,n=_(t);return!v(t)&&!y(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}k.fn=k.prototype={jquery:C,constructor:k,length:0,toArray:function(){return a.call(this)},get:function(t){return null==t?a.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=k.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return k.each(this,t)},map:function(t){return this.pushStack(k.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(k.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(k.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+P+")"+P+"*"),W=new RegExp(P+"|>"),V=new RegExp(q),Y=new RegExp("^"+R+"$"),X={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+F),PSEUDO:new RegExp("^"+q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:new RegExp("^(?:"+j+")$","i"),needsContext:new RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},G=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+P+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},it=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ot=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},rt=function(){d()},st=wt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{I.apply(A=N.call(x.childNodes),x.childNodes),A[x.childNodes.length].nodeType}catch(t){I={apply:A.length?function(t,e){M.apply(t,N.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}function at(t,e,i,o){var r,a,c,u,h,f,v,y=e&&e.ownerDocument,x=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==x&&9!==x&&11!==x)return i;if(!o&&(d(e),e=e||p,g)){if(11!==x&&(h=J.exec(t)))if(r=h[1]){if(9===x){if(!(c=e.getElementById(r)))return i;if(c.id===r)return i.push(c),i}else if(y&&(c=y.getElementById(r))&&b(e,c)&&c.id===r)return i.push(c),i}else{if(h[2])return I.apply(i,e.getElementsByTagName(t)),i;if((r=h[3])&&n.getElementsByClassName&&e.getElementsByClassName)return I.apply(i,e.getElementsByClassName(r)),i}if(n.qsa&&!S[t+" "]&&(!m||!m.test(t))&&(1!==x||"object"!==e.nodeName.toLowerCase())){if(v=t,y=e,1===x&&(W.test(t)||z.test(t))){for((y=tt.test(t)&&vt(e.parentNode)||e)===e&&n.scope||((u=e.getAttribute("id"))?u=u.replace(it,ot):e.setAttribute("id",u=w)),a=(f=s(t)).length;a--;)f[a]=(u?"#"+u:":scope")+" "+bt(f[a]);v=f.join(",")}try{return I.apply(i,y.querySelectorAll(v)),i}catch(e){S(t,!0)}finally{u===w&&e.removeAttribute("id")}}}return l(t.replace(U,"$1"),e,i,o)}function lt(){var t=[];return function e(n,o){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=o}}function ct(t){return t[w]=!0,t}function ut(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ht(t,e){for(var n=t.split("|"),o=n.length;o--;)i.attrHandle[n[o]]=e}function dt(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ft(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function gt(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&&st(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function mt(t){return ct((function(e){return e=+e,ct((function(n,i){for(var o,r=t([],n.length,e),s=r.length;s--;)n[o=r[s]]&&(n[o]=!(i[o]=n[o]))}))}))}function vt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=at.support={},r=at.isXML=function(t){var e=t.namespaceURI,n=(t.ownerDocument||t).documentElement;return!G.test(e||n&&n.nodeName||"HTML")},d=at.setDocument=function(t){var e,o,s=t?t.ownerDocument||t:x;return s!=p&&9===s.nodeType&&s.documentElement?(f=(p=s).documentElement,g=!r(p),x!=p&&(o=p.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",rt,!1):o.attachEvent&&o.attachEvent("onunload",rt)),n.scope=ut((function(t){return f.appendChild(t).appendChild(p.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ut((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ut((function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=K.test(p.getElementsByClassName),n.getById=ut((function(t){return f.appendChild(t).id=w,!p.getElementsByName||!p.getElementsByName(w).length})),n.getById?(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&g){var n=e.getElementById(t);return n?[n]:[]}}):(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&g){var n,i,o,r=e.getElementById(t);if(r){if((n=r.getAttributeNode("id"))&&n.value===t)return[r];for(o=e.getElementsByName(t),i=0;r=o[i++];)if((n=r.getAttributeNode("id"))&&n.value===t)return[r]}return[]}}),i.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],o=0,r=e.getElementsByTagName(t);if("*"===t){for(;n=r[o++];)1===n.nodeType&&i.push(n);return i}return r},i.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&g)return e.getElementsByClassName(t)},v=[],m=[],(n.qsa=K.test(p.querySelectorAll))&&(ut((function(t){var e;f.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+P+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||m.push("\\["+P+"*(?:value|"+j+")"),t.querySelectorAll("[id~="+w+"-]").length||m.push("~="),(e=p.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||m.push("\\["+P+"*name"+P+"*="+P+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||m.push(":checked"),t.querySelectorAll("a#"+w+"+*").length||m.push(".#.+[+~]"),t.querySelectorAll("\\\f"),m.push("[\\r\\n\\f]")})),ut((function(t){t.innerHTML="";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&m.push("name"+P+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),f.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),m.push(",.*:")}))),(n.matchesSelector=K.test(y=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ut((function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),v.push("!=",q)})),m=m.length&&new RegExp(m.join("|")),v=v.length&&new RegExp(v.join("|")),e=K.test(f.compareDocumentPosition),b=e||K.test(f.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},E=e?function(t,e){if(t===e)return h=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===i?t==p||t.ownerDocument==x&&b(x,t)?-1:e==p||e.ownerDocument==x&&b(x,e)?1:u?L(u,t)-L(u,e):0:4&i?-1:1)}:function(t,e){if(t===e)return h=!0,0;var n,i=0,o=t.parentNode,r=e.parentNode,s=[t],a=[e];if(!o||!r)return t==p?-1:e==p?1:o?-1:r?1:u?L(u,t)-L(u,e):0;if(o===r)return dt(t,e);for(n=t;n=n.parentNode;)s.unshift(n);for(n=e;n=n.parentNode;)a.unshift(n);for(;s[i]===a[i];)i++;return i?dt(s[i],a[i]):s[i]==x?-1:a[i]==x?1:0},p):p},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(d(t),n.matchesSelector&&g&&!S[e+" "]&&(!v||!v.test(e))&&(!m||!m.test(e)))try{var i=y.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){S(e,!0)}return at(e,p,null,[t]).length>0},at.contains=function(t,e){return(t.ownerDocument||t)!=p&&d(t),b(t,e)},at.attr=function(t,e){(t.ownerDocument||t)!=p&&d(t);var o=i.attrHandle[e.toLowerCase()],r=o&&$.call(i.attrHandle,e.toLowerCase())?o(t,e,!g):void 0;return void 0!==r?r:n.attributes||!g?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},at.escape=function(t){return(t+"").replace(it,ot)},at.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},at.uniqueSort=function(t){var e,i=[],o=0,r=0;if(h=!n.detectDuplicates,u=!n.sortStable&&t.slice(0),t.sort(E),h){for(;e=t[r++];)e===t[r]&&(o=i.push(r));for(;o--;)t.splice(i[o],1)}return u=null,t},o=at.getText=function(t){var e,n="",i=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=o(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[i++];)n+=o(e);return n},i=at.selectors={cacheLength:50,createPseudo:ct,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||at.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&at.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return X.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&V.test(n)&&(e=s(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=k[t+" "];return e||(e=new RegExp("(^|"+P+")"+t+"("+P+"|$)"))&&k(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(i){var o=at.attr(i,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o.replace(H," ")+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,o){var r="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===o?function(t){return!!t.parentNode}:function(e,n,l){var c,u,h,d,p,f,g=r!==s?"nextSibling":"previousSibling",m=e.parentNode,v=a&&e.nodeName.toLowerCase(),y=!l&&!a,b=!1;if(m){if(r){for(;g;){for(d=e;d=d[g];)if(a?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;f=g="only"===t&&!f&&"nextSibling"}return!0}if(f=[s?m.firstChild:m.lastChild],s&&y){for(b=(p=(c=(u=(h=(d=m)[w]||(d[w]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]||[])[0]===_&&c[1])&&c[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(b=p=0)||f.pop();)if(1===d.nodeType&&++b&&d===e){u[t]=[_,p,b];break}}else if(y&&(b=p=(c=(u=(h=(d=e)[w]||(d[w]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]||[])[0]===_&&c[1]),!1===b)for(;(d=++p&&d&&d[g]||(b=p=0)||f.pop())&&((a?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++b||(y&&((u=(h=d[w]||(d[w]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]=[_,b]),d!==e)););return(b-=o)===i||b%i==0&&b/i>=0}}},PSEUDO:function(t,e){var n,o=i.pseudos[t]||i.setFilters[t.toLowerCase()]||at.error("unsupported pseudo: "+t);return o[w]?o(e):o.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?ct((function(t,n){for(var i,r=o(t,e),s=r.length;s--;)t[i=L(t,r[s])]=!(n[i]=r[s])})):function(t){return o(t,0,n)}):o}},pseudos:{not:ct((function(t){var e=[],n=[],i=a(t.replace(U,"$1"));return i[w]?ct((function(t,e,n,o){for(var r,s=i(t,null,o,[]),a=t.length;a--;)(r=s[a])&&(t[a]=!(e[a]=r))})):function(t,o,r){return e[0]=t,i(e,null,r,n),e[0]=null,!n.pop()}})),has:ct((function(t){return function(e){return at(t,e).length>0}})),contains:ct((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||o(e)).indexOf(t)>-1}})),lang:ct((function(t){return Y.test(t||"")||at.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=g?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===f},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:gt(!1),disabled:gt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!i.pseudos.empty(t)},header:function(t){return Z.test(t.nodeName)},input:function(t){return Q.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:mt((function(){return[0]})),last:mt((function(t,e){return[e-1]})),eq:mt((function(t,e,n){return[n<0?n+e:n]})),even:mt((function(t,e){for(var n=0;ne?e:n;--i>=0;)t.push(i);return t})),gt:mt((function(t,e,n){for(var i=n<0?n+e:n;++i1?function(e,n,i){for(var o=t.length;o--;)if(!t[o](e,n,i))return!1;return!0}:t[0]}function _t(t,e,n,i,o){for(var r,s=[],a=0,l=t.length,c=null!=e;a-1&&(r[c]=!(s[c]=h))}}else v=_t(v===s?v.splice(f,v.length):v),o?o(null,s,v,l):I.apply(s,v)}))}function kt(t){for(var e,n,o,r=t.length,s=i.relative[t[0].type],a=s||i.relative[" "],l=s?1:0,u=wt((function(t){return t===e}),a,!0),h=wt((function(t){return L(e,t)>-1}),a,!0),d=[function(t,n,i){var o=!s&&(i||n!==c)||((e=n).nodeType?u(t,n,i):h(t,n,i));return e=null,o}];l1&&xt(d),l>1&&bt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(U,"$1"),n,l0,o=t.length>0,r=function(r,s,a,l,u){var h,f,m,v=0,y="0",b=r&&[],w=[],x=c,C=r||o&&i.find.TAG("*",u),k=_+=null==x?1:Math.random()||.1,T=C.length;for(u&&(c=s==p||s||u);y!==T&&null!=(h=C[y]);y++){if(o&&h){for(f=0,s||h.ownerDocument==p||(d(h),a=!g);m=t[f++];)if(m(h,s||p,a)){l.push(h);break}u&&(_=k)}n&&((h=!m&&h)&&v--,r&&b.push(h))}if(v+=y,n&&y!==v){for(f=0;m=e[f++];)m(b,w,s,a);if(r){if(v>0)for(;y--;)b[y]||w[y]||(w[y]=O.call(l));w=_t(w)}I.apply(l,w),u&&!r&&w.length>0&&v+e.length>1&&at.uniqueSort(l)}return u&&(_=k,c=x),b};return n?ct(r):r}(r,o)),a.selector=t}return a},l=at.select=function(t,e,n,o){var r,l,c,u,h,d="function"==typeof t&&t,p=!o&&s(t=d.selector||t);if(n=n||[],1===p.length){if((l=p[0]=p[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===e.nodeType&&g&&i.relative[l[1].type]){if(!(e=(i.find.ID(c.matches[0].replace(et,nt),e)||[])[0]))return n;d&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(r=X.needsContext.test(t)?0:l.length;r--&&(c=l[r],!i.relative[u=c.type]);)if((h=i.find[u])&&(o=h(c.matches[0].replace(et,nt),tt.test(l[0].type)&&vt(e.parentNode)||e))){if(l.splice(r,1),!(t=o.length&&bt(l)))return I.apply(n,o),n;break}}return(d||a(t,p))(o,e,!g,n,!e||tt.test(t)&&vt(e.parentNode)||e),n},n.sortStable=w.split("").sort(E).join("")===w,n.detectDuplicates=!!h,d(),n.sortDetached=ut((function(t){return 1&t.compareDocumentPosition(p.createElement("fieldset"))})),ut((function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")}))||ht("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&ut((function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||ht("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ut((function(t){return null==t.getAttribute("disabled")}))||ht(j,(function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null})),at}(i);k.find=D,k.expr=D.selectors,k.expr[":"]=k.expr.pseudos,k.uniqueSort=k.unique=D.uniqueSort,k.text=D.getText,k.isXMLDoc=D.isXML,k.contains=D.contains,k.escapeSelector=D.escape;var S=function(t,e,n){for(var i=[],o=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(o&&k(t).is(n))break;i.push(t)}return i},E=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},$=k.expr.match.needsContext;function A(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var O=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function M(t,e,n){return v(e)?k.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?k.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?k.grep(t,(function(t){return u.call(e,t)>-1!==n})):k.filter(e,t,n)}k.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?k.find.matchesSelector(i,t)?[i]:[]:k.find.matches(t,k.grep(e,(function(t){return 1===t.nodeType})))},k.fn.extend({find:function(t){var e,n,i=this.length,o=this;if("string"!=typeof t)return this.pushStack(k(t).filter((function(){for(e=0;e1?k.uniqueSort(n):n},filter:function(t){return this.pushStack(M(this,t||[],!1))},not:function(t){return this.pushStack(M(this,t||[],!0))},is:function(t){return!!M(this,"string"==typeof t&&$.test(t)?k(t):t||[],!1).length}});var I,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(t,e,n){var i,o;if(!t)return this;if(n=n||I,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:N.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof k?e[0]:e,k.merge(this,k.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:b,!0)),O.test(i[1])&&k.isPlainObject(e))for(i in e)v(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(o=b.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==n.ready?n.ready(t):t(k):k.makeArray(t,this)}).prototype=k.fn,I=k(b);var L=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function P(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}k.fn.extend({has:function(t){var e=k(t,this),n=e.length;return this.filter((function(){for(var t=0;t-1:1===n.nodeType&&k.find.matchesSelector(n,t))){r.push(n);break}return this.pushStack(r.length>1?k.uniqueSort(r):r)},index:function(t){return t?"string"==typeof t?u.call(k(t),this[0]):u.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),k.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return S(t,"parentNode")},parentsUntil:function(t,e,n){return S(t,"parentNode",n)},next:function(t){return P(t,"nextSibling")},prev:function(t){return P(t,"previousSibling")},nextAll:function(t){return S(t,"nextSibling")},prevAll:function(t){return S(t,"previousSibling")},nextUntil:function(t,e,n){return S(t,"nextSibling",n)},prevUntil:function(t,e,n){return S(t,"previousSibling",n)},siblings:function(t){return E((t.parentNode||{}).firstChild,t)},children:function(t){return E(t.firstChild)},contents:function(t){return null!=t.contentDocument&&s(t.contentDocument)?t.contentDocument:(A(t,"template")&&(t=t.content||t),k.merge([],t.childNodes))}},(function(t,e){k.fn[t]=function(n,i){var o=k.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(o=k.filter(i,o)),this.length>1&&(j[t]||k.uniqueSort(o),L.test(t)&&o.reverse()),this.pushStack(o)}}));var R=/[^\x20\t\r\n\f]+/g;function F(t){return t}function q(t){throw t}function H(t,e,n,i){var o;try{t&&v(o=t.promise)?o.call(t).done(e).fail(n):t&&v(o=t.then)?o.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}k.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return k.each(t.match(R)||[],(function(t,n){e[n]=!0})),e}(t):k.extend({},t);var e,n,i,o,r=[],s=[],a=-1,l=function(){for(o=o||t.once,i=e=!0;s.length;a=-1)for(n=s.shift();++a-1;)r.splice(n,1),n<=a&&a--})),this},has:function(t){return t?k.inArray(t,r)>-1:r.length>0},empty:function(){return r&&(r=[]),this},disable:function(){return o=s=[],r=n="",this},disabled:function(){return!r},lock:function(){return o=s=[],n||e||(r=n=""),this},locked:function(){return!!o},fireWith:function(t,n){return o||(n=[t,(n=n||[]).slice?n.slice():n],s.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},k.extend({Deferred:function(t){var e=[["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"]],n="pending",o={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},catch:function(t){return o.then(null,t)},pipe:function(){var t=arguments;return k.Deferred((function(n){k.each(e,(function(e,i){var o=v(t[i[4]])&&t[i[4]];r[i[1]]((function(){var t=o&&o.apply(this,arguments);t&&v(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,o?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,o){var r=0;function s(t,e,n,o){return function(){var a=this,l=arguments,c=function(){var i,c;if(!(t=r&&(n!==q&&(a=void 0,l=[i]),e.rejectWith(a,l))}};t?u():(k.Deferred.getStackHook&&(u.stackTrace=k.Deferred.getStackHook()),i.setTimeout(u))}}return k.Deferred((function(i){e[0][3].add(s(0,i,v(o)?o:F,i.notifyWith)),e[1][3].add(s(0,i,v(t)?t:F)),e[2][3].add(s(0,i,v(n)?n:q))})).promise()},promise:function(t){return null!=t?k.extend(t,o):o}},r={};return k.each(e,(function(t,i){var s=i[2],a=i[5];o[i[1]]=s.add,a&&s.add((function(){n=a}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),s.add(i[3].fire),r[i[0]]=function(){return r[i[0]+"With"](this===r?void 0:this,arguments),this},r[i[0]+"With"]=s.fireWith})),o.promise(r),t&&t.call(r,r),r},when:function(t){var e=arguments.length,n=e,i=Array(n),o=a.call(arguments),r=k.Deferred(),s=function(t){return function(n){i[t]=this,o[t]=arguments.length>1?a.call(arguments):n,--e||r.resolveWith(i,o)}};if(e<=1&&(H(t,r.done(s(n)).resolve,r.reject,!e),"pending"===r.state()||v(o[n]&&o[n].then)))return r.then();for(;n--;)H(o[n],s(n),r.reject);return r.promise()}});var U=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(t,e){i.console&&i.console.warn&&t&&U.test(t.name)&&i.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},k.readyException=function(t){i.setTimeout((function(){throw t}))};var B=k.Deferred();function z(){b.removeEventListener("DOMContentLoaded",z),i.removeEventListener("load",z),k.ready()}k.fn.ready=function(t){return B.then(t).catch((function(t){k.readyException(t)})),this},k.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--k.readyWait:k.isReady)||(k.isReady=!0,!0!==t&&--k.readyWait>0||B.resolveWith(b,[k]))}}),k.ready.then=B.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?i.setTimeout(k.ready):(b.addEventListener("DOMContentLoaded",z),i.addEventListener("load",z));var W=function(t,e,n,i,o,r,s){var a=0,l=t.length,c=null==n;if("object"===_(n))for(a in o=!0,n)W(t,e,a,n[a],!0,r,s);else if(void 0!==i&&(o=!0,v(i)||(s=!0),c&&(s?(e.call(t,i),e=null):(c=e,e=function(t,e,n){return c.call(k(t),n)})),e))for(;a1,null,!0)},removeData:function(t){return this.each((function(){J.remove(this,t)}))}}),k.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=K.get(t,e),n&&(!i||Array.isArray(n)?i=K.access(t,e,k.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=k.queue(t,e),i=n.length,o=n.shift(),r=k._queueHooks(t,e);"inprogress"===o&&(o=n.shift(),i--),o&&("fx"===e&&n.unshift("inprogress"),delete r.stop,o.call(t,(function(){k.dequeue(t,e)}),r)),!i&&r&&r.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return K.get(t,n)||K.access(t,n,{empty:k.Callbacks("once memory").add((function(){K.remove(t,[e+"queue",n])}))})}}),k.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,yt=/^$|^module$|\/(?:java|ecma)script/i;ft=b.createDocumentFragment().appendChild(b.createElement("div")),(gt=b.createElement("input")).setAttribute("type","radio"),gt.setAttribute("checked","checked"),gt.setAttribute("name","t"),ft.appendChild(gt),m.checkClone=ft.cloneNode(!0).cloneNode(!0).lastChild.checked,ft.innerHTML="",m.noCloneChecked=!!ft.cloneNode(!0).lastChild.defaultValue,ft.innerHTML="",m.option=!!ft.lastChild;var bt={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function wt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&A(t,e)?k.merge([t],n):n}function xt(t,e){for(var n=0,i=t.length;n",""]);var _t=/<|&#?\w+;/;function Ct(t,e,n,i,o){for(var r,s,a,l,c,u,h=e.createDocumentFragment(),d=[],p=0,f=t.length;p-1)o&&o.push(r);else if(c=at(r),s=wt(h.appendChild(r),"script"),c&&xt(s),n)for(u=0;r=s[u++];)yt.test(r.type||"")&&n.push(r);return h}var kt=/^key/,Tt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Dt=/^([^.]*)(?:\.(.+)|)/;function St(){return!0}function Et(){return!1}function $t(t,e){return t===function(){try{return b.activeElement}catch(t){}}()==("focus"===e)}function At(t,e,n,i,o,r){var s,a;if("object"==typeof e){for(a in"string"!=typeof n&&(i=i||n,n=void 0),e)At(t,a,n,i,e[a],r);return t}if(null==i&&null==o?(o=n,i=n=void 0):null==o&&("string"==typeof n?(o=i,i=void 0):(o=i,i=n,n=void 0)),!1===o)o=Et;else if(!o)return t;return 1===r&&(s=o,o=function(t){return k().off(t),s.apply(this,arguments)},o.guid=s.guid||(s.guid=k.guid++)),t.each((function(){k.event.add(this,e,o,i,n)}))}function Ot(t,e,n){n?(K.set(t,e,!1),k.event.add(t,e,{namespace:!1,handler:function(t){var i,o,r=K.get(this,e);if(1&t.isTrigger&&this[e]){if(r.length)(k.event.special[e]||{}).delegateType&&t.stopPropagation();else if(r=a.call(arguments),K.set(this,e,r),i=n(this,e),this[e](),r!==(o=K.get(this,e))||i?K.set(this,e,!1):o={},r!==o)return t.stopImmediatePropagation(),t.preventDefault(),o.value}else r.length&&(K.set(this,e,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===K.get(t,e)&&k.event.add(t,e,St)}k.event={global:{},add:function(t,e,n,i,o){var r,s,a,l,c,u,h,d,p,f,g,m=K.get(t);if(Q(t))for(n.handler&&(n=(r=n).handler,o=r.selector),o&&k.find.matchesSelector(st,o),n.guid||(n.guid=k.guid++),(l=m.events)||(l=m.events=Object.create(null)),(s=m.handle)||(s=m.handle=function(e){return void 0!==k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(R)||[""]).length;c--;)p=g=(a=Dt.exec(e[c])||[])[1],f=(a[2]||"").split(".").sort(),p&&(h=k.event.special[p]||{},p=(o?h.delegateType:h.bindType)||p,h=k.event.special[p]||{},u=k.extend({type:p,origType:g,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&k.expr.match.needsContext.test(o),namespace:f.join(".")},r),(d=l[p])||((d=l[p]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(t,i,f,s)||t.addEventListener&&t.addEventListener(p,s)),h.add&&(h.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),o?d.splice(d.delegateCount++,0,u):d.push(u),k.event.global[p]=!0)},remove:function(t,e,n,i,o){var r,s,a,l,c,u,h,d,p,f,g,m=K.hasData(t)&&K.get(t);if(m&&(l=m.events)){for(c=(e=(e||"").match(R)||[""]).length;c--;)if(p=g=(a=Dt.exec(e[c])||[])[1],f=(a[2]||"").split(".").sort(),p){for(h=k.event.special[p]||{},d=l[p=(i?h.delegateType:h.bindType)||p]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=r=d.length;r--;)u=d[r],!o&&g!==u.origType||n&&n.guid!==u.guid||a&&!a.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(d.splice(r,1),u.selector&&d.delegateCount--,h.remove&&h.remove.call(t,u));s&&!d.length&&(h.teardown&&!1!==h.teardown.call(t,f,m.handle)||k.removeEvent(t,p,m.handle),delete l[p])}else for(p in l)k.event.remove(t,p+e[c],n,i,!0);k.isEmptyObject(l)&&K.remove(t,"handle events")}},dispatch:function(t){var e,n,i,o,r,s,a=new Array(arguments.length),l=k.event.fix(t),c=(K.get(this,"events")||Object.create(null))[l.type]||[],u=k.event.special[l.type]||{};for(a[0]=l,e=1;e=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(r=[],s={},n=0;n-1:k.find(o,this,null,[c]).length),s[o]&&r.push(i);r.length&&a.push({elem:c,handlers:r})}return c=this,l\s*$/g;function Lt(t,e){return A(t,"table")&&A(11!==e.nodeType?e:e.firstChild,"tr")&&k(t).children("tbody")[0]||t}function jt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Pt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Rt(t,e){var n,i,o,r,s,a;if(1===e.nodeType){if(K.hasData(t)&&(a=K.get(t).events))for(o in K.remove(e,"handle events"),a)for(n=0,i=a[o].length;n1&&"string"==typeof f&&!m.checkClone&&It.test(f))return t.each((function(o){var r=t.eq(o);g&&(e[0]=f.call(this,o,r.html())),qt(r,e,n,i)}));if(d&&(r=(o=Ct(e,t[0].ownerDocument,!1,t,i)).firstChild,1===o.childNodes.length&&(o=r),r||i)){for(a=(s=k.map(wt(o,"script"),jt)).length;h0&&xt(s,!l&&wt(t,"script")),a},cleanData:function(t){for(var e,n,i,o=k.event.special,r=0;void 0!==(n=t[r]);r++)if(Q(n)){if(e=n[K.expando]){if(e.events)for(i in e.events)o[i]?k.event.remove(n,i):k.removeEvent(n,i,e.handle);n[K.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),k.fn.extend({detach:function(t){return Ht(this,t,!0)},remove:function(t){return Ht(this,t)},text:function(t){return W(this,(function(t){return void 0===t?k.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return qt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Lt(this,t).appendChild(t)}))},prepend:function(){return qt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Lt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return qt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return qt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(k.cleanData(wt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return k.clone(this,t,e)}))},html:function(t){return W(this,(function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Mt.test(t)&&!bt[(vt.exec(t)||["",""])[1].toLowerCase()]){t=k.htmlPrefilter(t);try{for(;n3,st.removeChild(t)),a}}))}();var Xt=["Webkit","Moz","ms"],Gt=b.createElement("div").style,Qt={};function Zt(t){var e=k.cssProps[t]||Qt[t];return e||(t in Gt?t:Qt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=Xt.length;n--;)if((t=Xt[n]+e)in Gt)return t}(t)||t)}var Kt=/^(none|table(?!-c[ea]).+)/,Jt=/^--/,te={position:"absolute",visibility:"hidden",display:"block"},ee={letterSpacing:"0",fontWeight:"400"};function ne(t,e,n){var i=ot.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function ie(t,e,n,i,o,r){var s="width"===e?1:0,a=0,l=0;if(n===(i?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(l+=k.css(t,n+rt[s],!0,o)),i?("content"===n&&(l-=k.css(t,"padding"+rt[s],!0,o)),"margin"!==n&&(l-=k.css(t,"border"+rt[s]+"Width",!0,o))):(l+=k.css(t,"padding"+rt[s],!0,o),"padding"!==n?l+=k.css(t,"border"+rt[s]+"Width",!0,o):a+=k.css(t,"border"+rt[s]+"Width",!0,o));return!i&&r>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-r-l-a-.5))||0),l}function oe(t,e,n){var i=Bt(t),o=(!m.boxSizingReliable()||n)&&"border-box"===k.css(t,"boxSizing",!1,i),r=o,s=Vt(t,e,i),a="offset"+e[0].toUpperCase()+e.slice(1);if(Ut.test(s)){if(!n)return s;s="auto"}return(!m.boxSizingReliable()&&o||!m.reliableTrDimensions()&&A(t,"tr")||"auto"===s||!parseFloat(s)&&"inline"===k.css(t,"display",!1,i))&&t.getClientRects().length&&(o="border-box"===k.css(t,"boxSizing",!1,i),(r=a in t)&&(s=t[a])),(s=parseFloat(s)||0)+ie(t,e,n||(o?"border":"content"),r,i,s)+"px"}function re(t,e,n,i,o){return new re.prototype.init(t,e,n,i,o)}k.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Vt(t,"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(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,r,s,a=G(e),l=Jt.test(e),c=t.style;if(l||(e=Zt(a)),s=k.cssHooks[e]||k.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(o=s.get(t,!1,i))?o:c[e];"string"===(r=typeof n)&&(o=ot.exec(n))&&o[1]&&(n=ut(t,e,o),r="number"),null!=n&&n==n&&("number"!==r||l||(n+=o&&o[3]||(k.cssNumber[a]?"":"px")),m.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),s&&"set"in s&&void 0===(n=s.set(t,n,i))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,i){var o,r,s,a=G(e);return Jt.test(e)||(e=Zt(a)),(s=k.cssHooks[e]||k.cssHooks[a])&&"get"in s&&(o=s.get(t,!0,n)),void 0===o&&(o=Vt(t,e,i)),"normal"===o&&e in ee&&(o=ee[e]),""===n||n?(r=parseFloat(o),!0===n||isFinite(r)?r||0:o):o}}),k.each(["height","width"],(function(t,e){k.cssHooks[e]={get:function(t,n,i){if(n)return!Kt.test(k.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?oe(t,e,i):zt(t,te,(function(){return oe(t,e,i)}))},set:function(t,n,i){var o,r=Bt(t),s=!m.scrollboxSize()&&"absolute"===r.position,a=(s||i)&&"border-box"===k.css(t,"boxSizing",!1,r),l=i?ie(t,e,i,a,r):0;return a&&s&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(r[e])-ie(t,e,"border",!1,r)-.5)),l&&(o=ot.exec(n))&&"px"!==(o[3]||"px")&&(t.style[e]=n,n=k.css(t,e)),ne(0,n,l)}}})),k.cssHooks.marginLeft=Yt(m.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Vt(t,"marginLeft"))||t.getBoundingClientRect().left-zt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),k.each({margin:"",padding:"",border:"Width"},(function(t,e){k.cssHooks[t+e]={expand:function(n){for(var i=0,o={},r="string"==typeof n?n.split(" "):[n];i<4;i++)o[t+rt[i]+e]=r[i]||r[i-2]||r[0];return o}},"margin"!==t&&(k.cssHooks[t+e].set=ne)})),k.fn.extend({css:function(t,e){return W(this,(function(t,e,n){var i,o,r={},s=0;if(Array.isArray(e)){for(i=Bt(t),o=e.length;s1)}}),k.Tween=re,re.prototype={constructor:re,init:function(t,e,n,i,o,r){this.elem=t,this.prop=n,this.easing=o||k.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=r||(k.cssNumber[n]?"":"px")},cur:function(){var t=re.propHooks[this.prop];return t&&t.get?t.get(this):re.propHooks._default.get(this)},run:function(t){var e,n=re.propHooks[this.prop];return this.options.duration?this.pos=e=k.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):re.propHooks._default.set(this),this}},re.prototype.init.prototype=re.prototype,re.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=k.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){k.fx.step[t.prop]?k.fx.step[t.prop](t):1!==t.elem.nodeType||!k.cssHooks[t.prop]&&null==t.elem.style[Zt(t.prop)]?t.elem[t.prop]=t.now:k.style(t.elem,t.prop,t.now+t.unit)}}},re.propHooks.scrollTop=re.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},k.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},k.fx=re.prototype.init,k.fx.step={};var se,ae,le=/^(?:toggle|show|hide)$/,ce=/queueHooks$/;function ue(){ae&&(!1===b.hidden&&i.requestAnimationFrame?i.requestAnimationFrame(ue):i.setTimeout(ue,k.fx.interval),k.fx.tick())}function he(){return i.setTimeout((function(){se=void 0})),se=Date.now()}function de(t,e){var n,i=0,o={height:t};for(e=e?1:0;i<4;i+=2-e)o["margin"+(n=rt[i])]=o["padding"+n]=t;return e&&(o.opacity=o.width=t),o}function pe(t,e,n){for(var i,o=(fe.tweeners[e]||[]).concat(fe.tweeners["*"]),r=0,s=o.length;r1)},removeAttr:function(t){return this.each((function(){k.removeAttr(this,t)}))}}),k.extend({attr:function(t,e,n){var i,o,r=t.nodeType;if(3!==r&&8!==r&&2!==r)return void 0===t.getAttribute?k.prop(t,e,n):(1===r&&k.isXMLDoc(t)||(o=k.attrHooks[e.toLowerCase()]||(k.expr.match.bool.test(e)?ge:void 0)),void 0!==n?null===n?void k.removeAttr(t,e):o&&"set"in o&&void 0!==(i=o.set(t,n,e))?i:(t.setAttribute(e,n+""),n):o&&"get"in o&&null!==(i=o.get(t,e))?i:null==(i=k.find.attr(t,e))?void 0:i)},attrHooks:{type:{set:function(t,e){if(!m.radioValue&&"radio"===e&&A(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,o=e&&e.match(R);if(o&&1===t.nodeType)for(;n=o[i++];)t.removeAttribute(n)}}),ge={set:function(t,e,n){return!1===e?k.removeAttr(t,n):t.setAttribute(n,n),n}},k.each(k.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=me[e]||k.find.attr;me[e]=function(t,e,i){var o,r,s=e.toLowerCase();return i||(r=me[s],me[s]=o,o=null!=n(t,e,i)?s:null,me[s]=r),o}}));var ve=/^(?:input|select|textarea|button)$/i,ye=/^(?:a|area)$/i;function be(t){return(t.match(R)||[]).join(" ")}function we(t){return t.getAttribute&&t.getAttribute("class")||""}function xe(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(R)||[]}k.fn.extend({prop:function(t,e){return W(this,k.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[k.propFix[t]||t]}))}}),k.extend({prop:function(t,e,n){var i,o,r=t.nodeType;if(3!==r&&8!==r&&2!==r)return 1===r&&k.isXMLDoc(t)||(e=k.propFix[e]||e,o=k.propHooks[e]),void 0!==n?o&&"set"in o&&void 0!==(i=o.set(t,n,e))?i:t[e]=n:o&&"get"in o&&null!==(i=o.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=k.find.attr(t,"tabindex");return e?parseInt(e,10):ve.test(t.nodeName)||ye.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(k.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.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,i,o,r,s,a,l=0;if(v(t))return this.each((function(e){k(this).addClass(t.call(this,e,we(this)))}));if((e=xe(t)).length)for(;n=this[l++];)if(o=we(n),i=1===n.nodeType&&" "+be(o)+" "){for(s=0;r=e[s++];)i.indexOf(" "+r+" ")<0&&(i+=r+" ");o!==(a=be(i))&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,i,o,r,s,a,l=0;if(v(t))return this.each((function(e){k(this).removeClass(t.call(this,e,we(this)))}));if(!arguments.length)return this.attr("class","");if((e=xe(t)).length)for(;n=this[l++];)if(o=we(n),i=1===n.nodeType&&" "+be(o)+" "){for(s=0;r=e[s++];)for(;i.indexOf(" "+r+" ")>-1;)i=i.replace(" "+r+" "," ");o!==(a=be(i))&&n.setAttribute("class",a)}return this},toggleClass:function(t,e){var n=typeof t,i="string"===n||Array.isArray(t);return"boolean"==typeof e&&i?e?this.addClass(t):this.removeClass(t):v(t)?this.each((function(n){k(this).toggleClass(t.call(this,n,we(this),e),e)})):this.each((function(){var e,o,r,s;if(i)for(o=0,r=k(this),s=xe(t);e=s[o++];)r.hasClass(e)?r.removeClass(e):r.addClass(e);else void 0!==t&&"boolean"!==n||((e=we(this))&&K.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":K.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+be(we(n))+" ").indexOf(e)>-1)return!0;return!1}});var _e=/\r/g;k.fn.extend({val:function(t){var e,n,i,o=this[0];return arguments.length?(i=v(t),this.each((function(n){var o;1===this.nodeType&&(null==(o=i?t.call(this,n,k(this).val()):t)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=k.map(o,(function(t){return null==t?"":t+""}))),(e=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))}))):o?(e=k.valHooks[o.type]||k.valHooks[o.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(_e,""):null==n?"":n:void 0}}),k.extend({valHooks:{option:{get:function(t){var e=k.find.attr(t,"value");return null!=e?e:be(k.text(t))}},select:{get:function(t){var e,n,i,o=t.options,r=t.selectedIndex,s="select-one"===t.type,a=s?null:[],l=s?r+1:o.length;for(i=r<0?l:s?r:0;i-1)&&(n=!0);return n||(t.selectedIndex=-1),r}}}}),k.each(["radio","checkbox"],(function(){k.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=k.inArray(k(t).val(),e)>-1}},m.checkOn||(k.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),m.focusin="onfocusin"in i;var Ce=/^(?:focusinfocus|focusoutblur)$/,ke=function(t){t.stopPropagation()};k.extend(k.event,{trigger:function(t,e,n,o){var r,s,a,l,c,u,h,d,f=[n||b],g=p.call(t,"type")?t.type:t,m=p.call(t,"namespace")?t.namespace.split("."):[];if(s=d=a=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!Ce.test(g+k.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),c=g.indexOf(":")<0&&"on"+g,(t=t[k.expando]?t:new k.Event(g,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=m.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:k.makeArray(e,[t]),h=k.event.special[g]||{},o||!h.trigger||!1!==h.trigger.apply(n,e))){if(!o&&!h.noBubble&&!y(n)){for(l=h.delegateType||g,Ce.test(l+g)||(s=s.parentNode);s;s=s.parentNode)f.push(s),a=s;a===(n.ownerDocument||b)&&f.push(a.defaultView||a.parentWindow||i)}for(r=0;(s=f[r++])&&!t.isPropagationStopped();)d=s,t.type=r>1?l:h.bindType||g,(u=(K.get(s,"events")||Object.create(null))[t.type]&&K.get(s,"handle"))&&u.apply(s,e),(u=c&&s[c])&&u.apply&&Q(s)&&(t.result=u.apply(s,e),!1===t.result&&t.preventDefault());return t.type=g,o||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(f.pop(),e)||!Q(n)||c&&v(n[g])&&!y(n)&&((a=n[c])&&(n[c]=null),k.event.triggered=g,t.isPropagationStopped()&&d.addEventListener(g,ke),n[g](),t.isPropagationStopped()&&d.removeEventListener(g,ke),k.event.triggered=void 0,a&&(n[c]=a)),t.result}},simulate:function(t,e,n){var i=k.extend(new k.Event,n,{type:t,isSimulated:!0});k.event.trigger(i,null,e)}}),k.fn.extend({trigger:function(t,e){return this.each((function(){k.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return k.event.trigger(t,e,n,!0)}}),m.focusin||k.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){k.event.simulate(e,t.target,k.event.fix(t))};k.event.special[e]={setup:function(){var i=this.ownerDocument||this.document||this,o=K.access(i,e);o||i.addEventListener(t,n,!0),K.access(i,e,(o||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,o=K.access(i,e)-1;o?K.access(i,e,o):(i.removeEventListener(t,n,!0),K.remove(i,e))}}}));var Te=i.location,De={guid:Date.now()},Se=/\?/;k.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new i.DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||k.error("Invalid XML: "+t),e};var Ee=/\[\]$/,$e=/\r?\n/g,Ae=/^(?:submit|button|image|reset|file)$/i,Oe=/^(?:input|select|textarea|keygen)/i;function Me(t,e,n,i){var o;if(Array.isArray(e))k.each(e,(function(e,o){n||Ee.test(t)?i(t,o):Me(t+"["+("object"==typeof o&&null!=o?e:"")+"]",o,n,i)}));else if(n||"object"!==_(e))i(t,e);else for(o in e)Me(t+"["+o+"]",e[o],n,i)}k.param=function(t,e){var n,i=[],o=function(t,e){var n=v(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!k.isPlainObject(t))k.each(t,(function(){o(this.name,this.value)}));else for(n in t)Me(n,t[n],e,o);return i.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=k.prop(this,"elements");return t?k.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!k(this).is(":disabled")&&Oe.test(this.nodeName)&&!Ae.test(t)&&(this.checked||!mt.test(t))})).map((function(t,e){var n=k(this).val();return null==n?null:Array.isArray(n)?k.map(n,(function(t){return{name:e.name,value:t.replace($e,"\r\n")}})):{name:e.name,value:n.replace($e,"\r\n")}})).get()}});var Ie=/%20/g,Ne=/#.*$/,Le=/([?&])_=[^&]*/,je=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pe=/^(?:GET|HEAD)$/,Re=/^\/\//,Fe={},qe={},He="*/".concat("*"),Ue=b.createElement("a");function Be(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,o=0,r=e.toLowerCase().match(R)||[];if(v(n))for(;i=r[o++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function ze(t,e,n,i){var o={},r=t===qe;function s(a){var l;return o[a]=!0,k.each(t[a]||[],(function(t,a){var c=a(e,n,i);return"string"!=typeof c||r||o[c]?r?!(l=c):void 0:(e.dataTypes.unshift(c),s(c),!1)})),l}return s(e.dataTypes[0])||!o["*"]&&s("*")}function We(t,e){var n,i,o=k.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((o[n]?t:i||(i={}))[n]=e[n]);return i&&k.extend(!0,t,i),t}Ue.href=Te.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Te.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Te.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":He,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(t,e){return e?We(We(t,k.ajaxSettings),e):We(k.ajaxSettings,t)},ajaxPrefilter:Be(Fe),ajaxTransport:Be(qe),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,o,r,s,a,l,c,u,h,d,p=k.ajaxSetup({},e),f=p.context||p,g=p.context&&(f.nodeType||f.jquery)?k(f):k.event,m=k.Deferred(),v=k.Callbacks("once memory"),y=p.statusCode||{},w={},x={},_="canceled",C={readyState:0,getResponseHeader:function(t){var e;if(c){if(!s)for(s={};e=je.exec(r);)s[e[1].toLowerCase()+" "]=(s[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=s[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?r:null},setRequestHeader:function(t,e){return null==c&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)C.always(t[C.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||_;return n&&n.abort(e),T(0,e),this}};if(m.promise(C),p.url=((t||p.url||Te.href)+"").replace(Re,Te.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(R)||[""],null==p.crossDomain){l=b.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Ue.protocol+"//"+Ue.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=k.param(p.data,p.traditional)),ze(Fe,p,e,C),c)return C;for(h in(u=k.event&&p.global)&&0==k.active++&&k.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Pe.test(p.type),o=p.url.replace(Ne,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Ie,"+")):(d=p.url.slice(o.length),p.data&&(p.processData||"string"==typeof p.data)&&(o+=(Se.test(o)?"&":"?")+p.data,delete p.data),!1===p.cache&&(o=o.replace(Le,"$1"),d=(Se.test(o)?"&":"?")+"_="+De.guid+++d),p.url=o+d),p.ifModified&&(k.lastModified[o]&&C.setRequestHeader("If-Modified-Since",k.lastModified[o]),k.etag[o]&&C.setRequestHeader("If-None-Match",k.etag[o])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+He+"; q=0.01":""):p.accepts["*"]),p.headers)C.setRequestHeader(h,p.headers[h]);if(p.beforeSend&&(!1===p.beforeSend.call(f,C,p)||c))return C.abort();if(_="abort",v.add(p.complete),C.done(p.success),C.fail(p.error),n=ze(qe,p,e,C)){if(C.readyState=1,u&&g.trigger("ajaxSend",[C,p]),c)return C;p.async&&p.timeout>0&&(a=i.setTimeout((function(){C.abort("timeout")}),p.timeout));try{c=!1,n.send(w,T)}catch(t){if(c)throw t;T(-1,t)}}else T(-1,"No Transport");function T(t,e,s,l){var h,d,b,w,x,_=e;c||(c=!0,a&&i.clearTimeout(a),n=void 0,r=l||"",C.readyState=t>0?4:0,h=t>=200&&t<300||304===t,s&&(w=function(t,e,n){for(var i,o,r,s,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(o in a)if(a[o]&&a[o].test(i)){l.unshift(o);break}if(l[0]in n)r=l[0];else{for(o in n){if(!l[0]||t.converters[o+" "+l[0]]){r=o;break}s||(s=o)}r=r||s}if(r)return r!==l[0]&&l.unshift(r),n[r]}(p,C,s)),!h&&k.inArray("script",p.dataTypes)>-1&&(p.converters["text script"]=function(){}),w=function(t,e,n,i){var o,r,s,a,l,c={},u=t.dataTypes.slice();if(u[1])for(s in t.converters)c[s.toLowerCase()]=t.converters[s];for(r=u.shift();r;)if(t.responseFields[r]&&(n[t.responseFields[r]]=e),!l&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=r,r=u.shift())if("*"===r)r=l;else if("*"!==l&&l!==r){if(!(s=c[l+" "+r]||c["* "+r]))for(o in c)if((a=o.split(" "))[1]===r&&(s=c[l+" "+a[0]]||c["* "+a[0]])){!0===s?s=c[o]:!0!==c[o]&&(r=a[0],u.unshift(a[1]));break}if(!0!==s)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+l+" to "+r}}}return{state:"success",data:e}}(p,w,C,h),h?(p.ifModified&&((x=C.getResponseHeader("Last-Modified"))&&(k.lastModified[o]=x),(x=C.getResponseHeader("etag"))&&(k.etag[o]=x)),204===t||"HEAD"===p.type?_="nocontent":304===t?_="notmodified":(_=w.state,d=w.data,h=!(b=w.error))):(b=_,!t&&_||(_="error",t<0&&(t=0))),C.status=t,C.statusText=(e||_)+"",h?m.resolveWith(f,[d,_,C]):m.rejectWith(f,[C,_,b]),C.statusCode(y),y=void 0,u&&g.trigger(h?"ajaxSuccess":"ajaxError",[C,p,h?d:b]),v.fireWith(f,[C,_]),u&&(g.trigger("ajaxComplete",[C,p]),--k.active||k.event.trigger("ajaxStop")))}return C},getJSON:function(t,e,n){return k.get(t,e,n,"json")},getScript:function(t,e){return k.get(t,void 0,e,"script")}}),k.each(["get","post"],(function(t,e){k[e]=function(t,n,i,o){return v(n)&&(o=o||i,i=n,n=void 0),k.ajax(k.extend({url:t,type:e,dataType:o,data:n,success:i},k.isPlainObject(t)&&t))}})),k.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),k._evalUrl=function(t,e,n){return k.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){k.globalEval(t,e,n)}})},k.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=k(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){k(this).wrapInner(t.call(this,e))})):this.each((function(){var e=k(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(n){k(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){k(this).replaceWith(this.childNodes)})),this}}),k.expr.pseudos.hidden=function(t){return!k.expr.pseudos.visible(t)},k.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new i.XMLHttpRequest}catch(t){}};var Ve={0:200,1223:204},Ye=k.ajaxSettings.xhr();m.cors=!!Ye&&"withCredentials"in Ye,m.ajax=Ye=!!Ye,k.ajaxTransport((function(t){var e,n;if(m.cors||Ye&&!t.crossDomain)return{send:function(o,r){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)a.setRequestHeader(s,o[s]);e=function(t){return function(){e&&(e=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?r(0,"error"):r(a.status,a.statusText):r(Ve[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),n=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&i.setTimeout((function(){e&&n()}))},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),k.ajaxPrefilter((function(t){t.crossDomain&&(t.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(t){return k.globalEval(t),t}}}),k.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),k.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,o){e=k(" @include ('partials.bootstrap-table') @stop diff --git a/resources/views/account/requestable-assets.blade.php b/resources/views/account/requestable-assets.blade.php index 44f1c8739b..7a969c7f70 100644 --- a/resources/views/account/requestable-assets.blade.php +++ b/resources/views/account/requestable-assets.blade.php @@ -32,14 +32,14 @@ @if ($assets->count() > 0)
  • {{ trans('general.assets') }} - {{ $assets->count()}} + {{ $assets->count()}}
  • @endif @if ($models->count() > 0)
  • {{ trans('general.asset_models') }} - {{ $models->count()}} + {{ $models->count()}}
  • @endif diff --git a/resources/views/asset_maintenances/index.blade.php b/resources/views/asset_maintenances/index.blade.php index 5e800dcf71..1259d3c5d6 100644 --- a/resources/views/asset_maintenances/index.blade.php +++ b/resources/views/asset_maintenances/index.blade.php @@ -7,12 +7,6 @@ @stop -@section('header_right') - @can('update', \App\Models\Asset::class) - {{ trans('general.create') }} - @endcan -@stop - {{-- Page content --}} @section('content') @@ -24,17 +18,10 @@ '', ])
    name) }}-{{ date('Y-m-d') }}", + "ignoreColumn": ["image","delete","download","icon"] }'> - - - - - - - - - - - - - - - - - @foreach ($object->uploads as $file) - - - - - - - - - - - - - - - - @endforeach - -
    - {{trans('general.id')}} - - {{trans('general.file_type')}} - - {{ trans('general.preview') }} - - {{ trans('general.file_name') }} - - {{ trans('general.filesize') }} - - {{ trans('general.notes') }} - - {{ trans('general.download') }} - - {{ trans('general.created_at') }} - - {{ trans('general.created_by') }} - - {{ trans('table.actions') }} -
    - {{ $file->id }} - - @if (Storage::exists($filepath.$file->filename)) - {{ pathinfo($filepath.$file->filename, PATHINFO_EXTENSION) }} - - @endif - - - @if (($file->filename) && (Storage::exists($filepath.$file->filename))) - @if (Helper::checkUploadIsImage($file->get_src(str_plural(strtolower(class_basename(get_class($object))))))) - - - - @elseif (Helper::checkUploadIsVideo($file->get_src(str_plural(strtolower(class_basename(get_class($object))))))) - - - - @elseif (Helper::checkUploadIsAudio($file->get_src(str_plural(strtolower(class_basename(get_class($object))))))) - - @else - {{ trans('general.preview_not_available') }} - @endif - @else - - {{ trans('general.file_not_found') }} - @endif - - - {{ $file->filename }} - - {{ (Storage::exists($filepath.$file->filename)) ? Helper::formatFilesizeUnits(Storage::size($filepath.$file->filename)) : '' }} - - @if ($file->note) - {{ $file->note }} - @endif - - @if ($file->filename) - @if (Storage::exists($filepath.$file->filename)) - - - - {{ trans('general.download') }} - - - - - - - @endif - @endif - - {{ $file->created_at ? Helper::getFormattedDateObject($file->created_at, 'datetime', false) : '' }} - - {{ ($file->adminuser) ? $file->adminuser->present()->getFullNameAttribute() : '' }} - - - - {{ trans('general.delete') }} - -
    + + + + + + \ No newline at end of file diff --git a/resources/views/blade/gallery-card.blade.php b/resources/views/blade/gallery-card.blade.php new file mode 100644 index 0000000000..050bd068dc --- /dev/null +++ b/resources/views/blade/gallery-card.blade.php @@ -0,0 +1,38 @@ + + + \ No newline at end of file diff --git a/resources/views/categories/index.blade.php b/resources/views/categories/index.blade.php index a8747dfdac..6eec402ddd 100755 --- a/resources/views/categories/index.blade.php +++ b/resources/views/categories/index.blade.php @@ -6,12 +6,6 @@ @parent @stop - -@section('header_right') - - {{ trans('general.create') }} -@stop - {{-- Page content --}} @section('content') @@ -26,6 +20,7 @@ data-side-pagination="server" data-sort-order="asc" id="categoryTable" + data-buttons="categoryButtons" class="table table-striped snipe-table" data-url="{{ route('api.categories.index') }}" data-export-options='{ diff --git a/resources/views/categories/view.blade.php b/resources/views/categories/view.blade.php index 313b784883..7de415e11c 100644 --- a/resources/views/categories/view.blade.php +++ b/resources/views/categories/view.blade.php @@ -8,23 +8,6 @@ @parent @stop -@section('header_right') - - - {{ trans('general.back') }} - -
    - - - -
    -@stop - {{-- Page content --}} @section('content') @@ -39,6 +22,9 @@ @if ($category->category_type=='asset') {{ trans('general.assets') }} + @if ($category->showableAssets()->count() > 0) + {{ $category->showableAssets()->count() }} + @endif @elseif ($category->category_type=='accessory') {{ trans('general.accessories') }} @elseif ($category->category_type=='license') @@ -49,16 +35,15 @@ {{ trans('general.components') }} @endif - @if ($category->category_type=='asset') - {{ $category->showableAssets()->count() }} - @endif @if ($category->category_type=='asset')
  • {{ trans('general.asset_models') }} - {{ $category->models->count()}} + @if ($category->models->count() > 0) + {{ $category->models->count()}} + @endif
  • @endif @@ -75,10 +60,10 @@ category_type=='asset') - data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}" data-cookie-id-table="categoryAssetsTable" id="categoryAssetsTable" + data-buttons="assetButtons" data-id-table="categoryAssetsTable" data-toolbar="#assetsBulkEditToolbar" data-bulk-button-id="#bulkAssetEditButton" @@ -88,9 +73,10 @@ "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] }' @elseif ($category->category_type=='accessory') - data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}" + data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}" data-cookie-id-table="categoryAccessoryTable" id="categoryAccessoryTable" + data-buttons="accessoryButtons" data-id-table="categoryAccessoryTable" data-export-options='{ "fileName": "export-{{ str_slug($category->name) }}-accessories-{{ date('Y-m-d') }}", @@ -100,31 +86,33 @@ data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}" data-cookie-id-table="categoryConsumableTable" id="categoryConsumableTable" + data-buttons="consumableButtons" data-id-table="categoryConsumableTable" data-export-options='{ "fileName": "export-{{ str_slug($category->name) }}-consumables-{{ date('Y-m-d') }}", "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] }' @elseif ($category->category_type=='component') - data-columns="{{ \App\Presenters\ComponentPresenter::dataTableLayout() }}" + data-columns="{{ \App\Presenters\ComponentPresenter::dataTableLayout() }}" data-cookie-id-table="categoryCompomnentTable" id="categoryCompomnentTable" + data-buttons="componentButtons" data-id-table="categoryCompomnentTable" data-export-options='{ "fileName": "export-{{ str_slug($category->name) }}-components-{{ date('Y-m-d') }}", "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] }' @elseif ($category->category_type=='license') - data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}" + data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}" data-cookie-id-table="categoryLicenseTable" id="categoryLicenseTable" + data-buttons="licenseButtons" data-id-table="categoryLicenseTable" data-export-options='{ "fileName": "export-{{ str_slug($category->name) }}-licenses-{{ date('Y-m-d') }}", "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] }' @endif - data-show-footer="true" data-side-pagination="server" data-sort-order="asc" @@ -151,15 +139,16 @@
    - {{ trans('general.create') }} -@stop {{-- Page content --}} @section('content')
    @@ -23,6 +19,7 @@ data-side-pagination="server" data-sort-order="asc" id="companiesTable" + data-buttons="companyButtons" class="table table-striped snipe-table" data-url="{{ route('api.companies.index') }}" data-export-options='{ diff --git a/resources/views/companies/view.blade.php b/resources/views/companies/view.blade.php index 5765ea3726..37088b2538 100644 --- a/resources/views/companies/view.blade.php +++ b/resources/views/companies/view.blade.php @@ -21,7 +21,7 @@ @@ -33,7 +33,7 @@ @@ -43,7 +43,7 @@ @@ -53,7 +53,7 @@ @@ -63,7 +63,7 @@ @@ -73,7 +73,7 @@ diff --git a/resources/views/components/index.blade.php b/resources/views/components/index.blade.php index 0914834e4a..2b3cb88450 100644 --- a/resources/views/components/index.blade.php +++ b/resources/views/components/index.blade.php @@ -6,11 +6,6 @@ @parent @stop -@section('header_right') - @can('create', \App\Models\Component::class) - shortcuts_enabled == 1 ? "accesskey=n" : ''}} class="btn btn-primary pull-right"> {{ trans('general.create') }} - @endcan -@stop {{-- Page content --}} @section('content') @@ -28,6 +23,7 @@ data-sort-order="asc" data-sort-name="name" id="componentsTable" + data-buttons="componentButtons" class="table table-striped snipe-table" data-url="{{ route('api.components.index') }}" data-export-options='{ diff --git a/resources/views/components/view.blade.php b/resources/views/components/view.blade.php index 43276839e9..42cd033e28 100644 --- a/resources/views/components/view.blade.php +++ b/resources/views/components/view.blade.php @@ -84,7 +84,7 @@ @@ -169,11 +169,7 @@
    - +
    @@ -247,6 +243,21 @@
    @endcan + @can('delete', $component) +
    + @if ($component->isDeletable()) + + @else + + + {{ trans('general.delete') }} + + @endif + @endcan +
    diff --git a/resources/views/consumables/index.blade.php b/resources/views/consumables/index.blade.php index eb946e8486..71cc509e72 100644 --- a/resources/views/consumables/index.blade.php +++ b/resources/views/consumables/index.blade.php @@ -6,12 +6,6 @@ @parent @stop -@section('header_right') - @can('create', \App\Models\Consumable::class) - shortcuts_enabled == 1 ? "accesskey=n" : ''}} class="btn btn-primary pull-right"> {{ trans('general.create') }} - @endcan -@stop - {{-- Page content --}} @section('content') @@ -31,6 +25,7 @@ data-sort-name="name" data-toolbar="#toolbar" id="consumablesTable" + data-buttons="consumableButtons" class="table table-striped snipe-table" data-url="{{ route('api.consumables.index') }}" data-export-options='{ diff --git a/resources/views/consumables/view.blade.php b/resources/views/consumables/view.blade.php index d7e16a5647..56d2e2ddba 100644 --- a/resources/views/consumables/view.blade.php +++ b/resources/views/consumables/view.blade.php @@ -41,7 +41,7 @@ @@ -54,7 +54,7 @@ @@ -139,7 +139,7 @@ @can('delete', $consumable)
    @if ($consumable->deleted_at=='') - @@ -440,12 +440,7 @@
    - - +
    @@ -487,17 +482,5 @@ @section('moar_scripts') - - - @include ('partials.bootstrap-table', ['simple_view' => true]) @endsection \ No newline at end of file diff --git a/resources/views/custom_fields/index.blade.php b/resources/views/custom_fields/index.blade.php index 0deebf0c3a..e94b7518c1 100644 --- a/resources/views/custom_fields/index.blade.php +++ b/resources/views/custom_fields/index.blade.php @@ -33,7 +33,8 @@ data-side-pagination="client" data-sort-order="asc" data-sort-name="name" - id="customFieldsTable" + id="customFieldsetTable" + data-buttons="customFieldsetButtons" class="table table-striped snipe-table" data-export-options='{ "fileName": "export-fieldsets-{{ date('Y-m-d') }}", @@ -89,7 +90,7 @@ @if($fieldset->models->count() > 0) @else - + @endif @endcan @@ -130,6 +131,7 @@ data-sort-order="asc" data-sort-name="name" id="customFieldsTable" + data-buttons="customFieldButtons" class="table table-striped snipe-table" data-export-options='{ "fileName": "export-fields-{{ date('Y-m-d') }}", @@ -252,7 +254,7 @@ {{ trans('button.delete') }} @else - diff --git a/resources/views/departments/index.blade.php b/resources/views/departments/index.blade.php index c50bedc74b..41101ada95 100644 --- a/resources/views/departments/index.blade.php +++ b/resources/views/departments/index.blade.php @@ -6,10 +6,6 @@ @parent @stop -@section('header_right') - - {{ trans('general.create') }} -@stop {{-- Page content --}} @section('content')
    @@ -22,6 +18,7 @@ data-side-pagination="server" data-sort-order="asc" id="departmentsTable" + data-buttons="departmentButtons" class="table table-striped snipe-table" data-url="{{ route('api.departments.index') }}" data-export-options='{ diff --git a/resources/views/depreciations/index.blade.php b/resources/views/depreciations/index.blade.php index 9f5d7c0619..e522468004 100755 --- a/resources/views/depreciations/index.blade.php +++ b/resources/views/depreciations/index.blade.php @@ -6,12 +6,6 @@ @parent @stop -@section('header_right') - - {{ trans('general.create') }} -@stop - - {{-- Page content --}} @section('content') @@ -26,6 +20,7 @@ data-side-pagination="server" data-sort-order="asc" id="depreciationsTable" + data-buttons="depreciationButtons" class="table table-striped snipe-table" data-url="{{ route('api.depreciations.index') }}" data-export-options='{ diff --git a/resources/views/depreciations/view.blade.php b/resources/views/depreciations/view.blade.php index 5a79f7b611..591353ba28 100644 --- a/resources/views/depreciations/view.blade.php +++ b/resources/views/depreciations/view.blade.php @@ -34,21 +34,21 @@ {{ trans('general.assets') }} - {!! ($depreciation->assets()->AssetsForShow()->count() > 0 ) ? ''.number_format($depreciation->assets()->AssetsForShow()->count()).'' : '' !!} + {!! ($depreciation->assets()->AssetsForShow()->count() > 0 ) ? ''.number_format($depreciation->assets()->AssetsForShow()->count()).'' : '' !!}
  • {{ trans('general.licenses') }} - {!! ($depreciation->licenses_count > 0 ) ? ''.number_format($depreciation->licenses_count).'' : '' !!} + {!! ($depreciation->licenses_count > 0 ) ? ''.number_format($depreciation->licenses_count).'' : '' !!}
  • {{ trans('general.asset_models') }} - {!! ($depreciation->models_count > 0 ) ? ''.number_format($depreciation->models_count).'' : '' !!} + {!! ($depreciation->models_count > 0 ) ? ''.number_format($depreciation->models_count).'' : '' !!}
  • diff --git a/resources/views/groups/index.blade.php b/resources/views/groups/index.blade.php index 5523c52816..2b09057a56 100755 --- a/resources/views/groups/index.blade.php +++ b/resources/views/groups/index.blade.php @@ -26,6 +26,7 @@ data-sort-order="asc" data-sort-name="name" id="groupsTable" + data-buttons="groupButtons" class="table table-striped snipe-table" data-url="{{ route('api.groups.index') }}" data-export-options='{ diff --git a/resources/views/hardware/index.blade.php b/resources/views/hardware/index.blade.php index 6ff3011323..fa67078b7b 100755 --- a/resources/views/hardware/index.blade.php +++ b/resources/views/hardware/index.blade.php @@ -24,9 +24,9 @@ @elseif (Request::get('status')=='Archived') {{ trans('general.archived') }} @elseif (Request::get('status')=='Deleted') - {{ trans('general.deleted') }} + {{ ucfirst(trans('general.deleted')) }} @elseif (Request::get('status')=='byod') - {{ trans('general.byod') }} + {{ strtoupper(trans('general.byod')) }} @endif @else {{ trans('general.all') }} @@ -43,14 +43,6 @@ @yield('title0') @parent @stop -@section('header_right') - - {{ trans('admin/hardware/general.custom_export') }} - @can('create', \App\Models\Asset::class) - shortcuts_enabled == 1 ? "n" : ''}} class="btn btn-primary pull-right"> {{ trans('general.create') }} - @endcan - -@stop {{-- Page content --}} @section('content') @@ -77,6 +69,7 @@ data-toolbar="#assetsBulkEditToolbar" data-bulk-button-id="#bulkAssetEditButton" data-bulk-form-id="#assetsBulkForm" + data-buttons="assetButtons" id="{{ request()->has('status') ? e(request()->input('status')) : '' }}assetsListingTable" class="table table-striped snipe-table" data-url="{{ route('api.assets.index', diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 782aae5da1..8d696c1fc4 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -112,19 +112,19 @@ @if ($asset->audits->count() > 0) -
  • - +
  • + - - -
  • + + + @endif
  • @@ -1329,32 +1329,20 @@
    - @can('update', \App\Models\Asset::class) - - @endcan
  • asset_tag }}-maintenances", + "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] + }' data-url="{{ route('api.maintenances.index', array('asset_id' => $asset->id)) }}" data-cookie-id-table="assetMaintenancesTable" data-cookie="true"> @@ -1376,10 +1364,9 @@ data-sort-order="desc" data-sort-name="created_at" data-export-options='{ - "fileName": "export-asset-{{ $asset->id }}-audits", - "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] - }' - + "fileName": "export-asset-{{ $asset->id }}-audits", + "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] + }' data-url="{{ route('api.activity.index', ['item_id' => $asset->id, 'item_type' => 'asset', 'action_type' => 'audit']) }}" data-cookie-id-table="assetHistory" data-cookie="true"> @@ -1390,7 +1377,7 @@ - + @@ -1411,23 +1398,14 @@ data-columns="{{ \App\Presenters\HistoryPresenter::dataTableLayout() }}" class="table table-striped snipe-table" id="assetHistory" - data-id-table="assetHistory" - - - data-side-pagination="server" - - - data-sort-order="desc" data-sort-name="created_at" - data-export-options='{ - "fileName": "export-asset-{{ $asset->id }}-history", - "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] - }' - + "fileName": "export-asset-{{ $asset->id }}-history", + "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] + }' data-url="{{ route('api.activity.index', ['item_id' => $asset->id, 'item_type' => 'asset']) }}" data-cookie-id-table="assetHistory" data-cookie="true"> @@ -1439,11 +1417,7 @@
    - +
    @@ -1453,13 +1427,7 @@
    - - - +
    @@ -1474,16 +1442,6 @@ @endcan @stop @section('moar_scripts') - @include ('partials.bootstrap-table') @stop diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index 0f9e332eea..b7bdb2d2aa 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -960,17 +960,18 @@ dir="{{ Helper::determineLanguageDirection() }}"> -
    {{ trans('general.created_by') }} {{ trans('general.file_name') }} {{ trans('general.notes') }}{{ trans('general.download') }}{{ trans('general.download') }} {{ trans('admin/hardware/table.changed')}} {{ trans('admin/settings/general.login_ip') }} {{ trans('admin/settings/general.login_user_agent') }}
    - - - - - - - - - - - - - - + "fileName": "export-location-asset-{{ $location->id }}-history", + "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] + }' + data-url="{{ route('api.activity.index', ['target_id' => $location->id, 'target_type' => 'location']) }}" + data-cookie-id-table="locationHistory" + data-cookie="true">
    {{ trans('general.date') }}{{ trans('general.created_by') }}{{ trans('general.action') }}{{ trans('general.item') }}{{ trans('general.target') }}{{ trans('general.notes') }}{{ trans('general.signature') }}{{ trans('general.download') }}{{ trans('admin/hardware/table.changed')}}
    @@ -512,7 +500,7 @@ @if ($location->deleted_at=='') @if ($location->isDeletable()) - @@ -549,14 +537,6 @@ @include ('modals.upload-file', ['item_type' => 'locations', 'item_id' => $location->id]) @endcan - @include ('partials.bootstrap-table', [ 'exportFile' => 'locations-export', diff --git a/resources/views/manufacturers/index.blade.php b/resources/views/manufacturers/index.blade.php index 09585a5487..654f206d50 100755 --- a/resources/views/manufacturers/index.blade.php +++ b/resources/views/manufacturers/index.blade.php @@ -6,22 +6,6 @@ @parent @stop -{{-- Page title --}} -@section('header_right') - @can('create', \App\Models\Manufacturer::class) - - {{ trans('general.create') }} - @endcan - - @if (Request::get('deleted')=='true') - {{ trans('general.show_current') }} - @else - - {{ trans('general.show_deleted') }} - @endif - -@stop - {{-- Page content --}} @section('content') @@ -55,6 +39,7 @@ data-side-pagination="server" data-sort-order="asc" id="manufacturersTable" + data-buttons="manufacturerButtons" class="table table-striped snipe-table" data-url="{{route('api.manufacturers.index', ['deleted' => (request('deleted')=='true') ? 'true' : 'false' ]) }}" data-export-options='{ diff --git a/resources/views/manufacturers/view.blade.php b/resources/views/manufacturers/view.blade.php index dd156192ba..39b6844514 100644 --- a/resources/views/manufacturers/view.blade.php +++ b/resources/views/manufacturers/view.blade.php @@ -40,7 +40,7 @@ @@ -52,7 +52,7 @@ @@ -65,7 +65,7 @@ @@ -77,7 +77,7 @@ @@ -90,7 +90,7 @@ diff --git a/resources/views/models/index.blade.php b/resources/views/models/index.blade.php index 7c0768ae73..95351e768d 100755 --- a/resources/views/models/index.blade.php +++ b/resources/views/models/index.blade.php @@ -12,21 +12,6 @@ @parent @stop -{{-- Page title --}} -@section('header_right') - @can('create', \App\Models\AssetModel::class) - {{ trans('general.create') }} - @endcan - - @if (Request::get('status')=='deleted') - {{ trans('admin/models/general.view_models') }} - @else - {{ trans('admin/models/general.view_deleted') }} - @endif - -@stop - - {{-- Page content --}} @section('content') @@ -49,6 +34,7 @@ data-bulk-form-id="#modelsBulkForm" data-sort-order="asc" id="asssetModelsTable" + data-buttons="modelButtons" class="table table-striped snipe-table" data-url="{{ route('api.models.index', ['status' => request('status')]) }}" data-export-options='{ diff --git a/resources/views/models/view.blade.php b/resources/views/models/view.blade.php index 905763534d..3570e76d6e 100755 --- a/resources/views/models/view.blade.php +++ b/resources/views/models/view.blade.php @@ -54,7 +54,7 @@ @@ -67,7 +67,7 @@ @@ -110,11 +110,7 @@
    - +
    @@ -297,7 +293,7 @@ {{ trans('general.delete') }} @else - @@ -315,15 +311,6 @@ @section('moar_scripts') - - @include ('partials.bootstrap-table', ['exportFile' => 'manufacturer' . $model->name . '-export', 'search' => false]) @stop diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index b78079577a..b7f8d6dc44 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -121,6 +121,7 @@ paginationSwitchUp: 'fa-caret-square-o-up', fullscreen: 'fa-expand', columns: 'fa-columns', + print: 'fa-print', refresh: 'fas fa-sync-alt', export: 'fa-download', clearSearch: 'fa-times' @@ -306,6 +307,25 @@ }; } + + + // This is a special formatter that will indicate whether a user is an admin or superadmin + function usernameRoleLinkFormatter(value, row) { + + if ((value) && (row)) { + + if (row.role === 'superadmin') { + return ' ' + value + ''; + } else if (row.role === 'admin') { + return ' ' + value + ''; + } + + // Regular user + return '' + value + ''; + } + + } + // Use this when we're introspecting into a column object and need to link function genericColumnObjLinkFormatter(destination) { return function (value,row) { @@ -370,6 +390,8 @@ } + + // Make the edit/delete buttons function genericActionsFormatter(owner_name, element_name) { if (!element_name) { @@ -424,7 +446,7 @@ actions += '' + '{{ trans('general.delete') }} '; @@ -905,27 +927,162 @@ return '' + altName + ''; } } + + + // This is users in the user accounts section for EULAs function downloadFormatter(value) { if (value) { return ''; } } - function fileUploadFormatter(value) { + // This is used by the UploadedFilesPresenter and the HistoryPresenter + // It handles the download and inline buttons for files that are uploaded to assets, users, etc + function fileDownloadButtonsFormatter(row, value) { + + if (value) { + if (value.url) { + var inlinable = value.inlineable; + var exists_on_disk = value.exists_on_disk; + var download_url = value.url; + } else if (value.file) { + var inlinable = value.file.inlineable; + var exists_on_disk = value.file.exists_on_disk; + var download_url = value.file.url; + } else { + return ''; + } + + var download_button = ''; + var download_button_disabled = ''; + var inline_button = ''; + var inline_button_disabled = ''; + + if (exists_on_disk === true) { + return '' + download_button + ' ' + inline_button + ''; + } else { + return '' + download_button_disabled + ' ' + inline_button_disabled + ''; + } + + } + } + + + function filePreviewFormatter(row, value) { + if ((value) && (value.url) && (value.inlineable)) { - return ''; - } else if ((value) && (value.url)) { - return ''; + + if (value.mediatype == 'image') { + return ''; + } else if (value.mediatype == 'video') { + return ''; + } else if (value.mediatype == 'audio') { + return ''; + } + return '{{ trans('general.preview_not_available') }}'; } + return '{{ trans('general.preview_not_available') }}'; + } - function fileUploadNameFormatter(value) { - if ((value) && (value.filename) && (value.url)) { - return '' + value.filename + ''; + + + // This is used in the table listings + function deleteUploadFormatter(value, row) { + + if ((row.available_actions) && (row.available_actions.delete === true)) { + var destination; + + // This is kinda gross, but for right now we're posting to the GUI delete routes + // All of these URLS and storage directories need to be updated to be more consistent :( + if (row.item.type == 'assetmodels') { + destination = 'models'; + } else { + destination = row.item.type; + } + + return '' + + '{{ trans('general.delete') }} '; } } + // This handles the custom view for the filestable blade component gallery-card component + window.customViewFormatter = data => { + const template = $('#fileGalleryTemplate').html() + let view = '' + + $.each(data, function (i, row) { + + delete_url = row.url +'/delete'; + + if (row.exists_on_disk === true) + { + if (row.mediatype === 'image') { + embed_code = ''; + } else if (row.mediatype === 'video') { + embed_code = ''; + } else if (row.mediatype === 'audio') { + embed_code = ''; + } else if (row.mediatype === 'pdf') { + embed_code = 'File cannot be displayed'; + } else { + embed_code = '
    '; + } + } else { + embed_code = '


    {{ trans('general.file_upload_status.file_not_found') }}
    '; + } + + view += template.replace('%ID%', row.id) + .replace('%ICON%', row.icon) + .replace('%FILETYPE%', row.filetype) + .replace('%FILE_URL%', row.url) + .replace('%LINK_URL%', row.url) + .replace('%FILENAME%', (row.exists_on_disk === true) ? row.filename : ' ' + row.filename + '') + .replace('%CREATED_AT%', row.created_at.formatted) + .replace('%CREATED_BY%', (row.created_by) ? row.created_by.name : '') + .replace('%NOTE%', (row.note) ? row.note : '') + .replace('%PANEL_CLASS%', (row.exists_on_disk === true) ? 'default' : 'danger') + .replace('%FILE_EMBED%', embed_code) + .replace('%DOWNLOAD_BUTTON%', (row.exists_on_disk === true) ? ' ' : '') + .replace('%NEW_WINDOW_BUTTON%', (row.exists_on_disk === true) ? ' ' : '') + .replace('%DELETE_BUTTON%', (row.available_actions.delete === true) ? + '{{ trans('general.delete') }}' : + '{{ trans('general.delete') }}' + ); + }) + + return `
    ${view}
    ` + } + + + + function fileNameFormatter(row, value) { + + if (value) { + if ((value.file) && (value.file.filename) && (value.file.url)) { + + if (value.file.exists_on_disk === true) { + return '' + value.file.filename + ''; + } + + return ' ' + value.file.filename + ''; + + } else if ((value.filename) && (value.url)) { + if (value.exists_on_disk === true) { + return '' + value.filename + ''; + } + return ' ' + value.filename + ''; + } + } + + } + + function linkToUserSectionBasedOnCount (count, id, section) { if (count) { return '' + count + ''; @@ -1068,6 +1225,501 @@ }); + // User table buttons + window.userButtons = () => ({ + @can('create', \App\Models\User::class) + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('users.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + @endcan + + btnExport: { + text: '{{ trans('general.export') }}', + icon: 'fa-solid fa-file-csv', + event () { + window.location.href = '{{ route('users.export') }}'; + }, + attributes: { + title: '{{ trans('general.export') }}' + } + }, + + btnShowAdmins: { + text: '{{ trans('general.show_admins') }}', + icon: 'fa-solid fa-crown{{ (request()->input('admins') == "true") ? ' text-danger' : '' }}', + event () { + window.location.href = '{{ (request()->input('admins') == "true") ? route('users.index') : route('users.index', ['admins' => 'true']) }}'; + }, + attributes: { + title: 'Show only admins', + + } + }, + + btnShowDeleted: { + text: '{{ (request()->input('status') == "deleted") ?trans('admin/users/table.show_current') : trans('admin/users/table.show_deleted') }}', + icon: 'fa-solid fa-user-slash {{ (request()->input('status') == "deleted") ? ' text-danger' : ' fa-user-slash' }}', + event () { + window.location.href = '{{ (request()->input('status') == "deleted") ? route('users.index') : route('users.index', ['status' => 'deleted']) }}'; + }, + attributes: { + title: '{{ (request()->input('status') == "deleted") ? trans('admin/users/table.show_current') : trans('admin/users/table.show_deleted') }}', + + } + }, + + }); // end user table buttons + + + @can('create', \App\Models\Company::class) + // Company table buttons + window.companyButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('companies.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + + }); // End company table buttons + @endcan + + + // Asset table buttons + window.assetButtons = () => ({ + @can('create', \App\Models\Asset::class) + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('hardware.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + @endcan + + @can('update', \App\Models\Asset::class) + btnAddMaintenance: { + text: '{{ trans('button.add_maintenance') }}', + icon: 'fa-solid fa-screwdriver-wrench', + event () { + window.location.href = '{{ route('maintenances.create', ['asset_id' => (isset($asset)) ? $asset->id :'' ]) }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + } + }, + @endcan + + + btnExport: { + text: '{{ trans('admin/hardware/general.custom_export') }}', + icon: 'fa-solid fa-file-csv', + event () { + window.location.href = '{{ route('reports/custom') }}'; + }, + attributes: { + title: '{{ trans('admin/hardware/general.custom_export') }}' + } + }, + + btnShowDeleted: { + text: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}', + icon: 'fa-solid fa-trash {{ (request()->input('status') == "Deleted") ? ' text-danger' : '' }}', + event () { + window.location.href = '{{ (request()->input('status') == "Deleted") ? route('hardware.index') : route('hardware.index', ['status' => 'Deleted']) }}'; + }, + attributes: { + title: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}', + + } + }, + }); + + @can('create', \App\Models\Location::class) + // Location table buttons + window.locationButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('locations.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + }); + @endcan + + @can('create', \App\Models\Accessory::class) + // Accessory table buttons + window.accessoryButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('accessories.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + }); + @endcan + + @can('create', \App\Models\Depreciation::class) + // Accessory table buttons + window.depreciationButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('depreciations.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + }); + @endcan + + @can('create', \App\Models\CustomField::class) + // Accessory table buttons + window.customFieldButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('fields.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + }); + @endcan + + + @can('create', \App\Models\CustomFieldset::class) + // Accessory table buttons + window.customFieldsetButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('fieldsets.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + }); + @endcan + + @can('create', \App\Models\Component::class) + // Compoment table buttons + window.componentButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('components.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + }); + @endcan + + @can('create', \App\Models\Consumable::class) + // Consumable table buttons + window.consumableButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('consumables.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + }); + @endcan + + @can('create', \App\Models\Manufacturer::class) + // Consumable table buttons + window.manufacturerButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('manufacturers.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + }, + + btnShowDeleted: { + text: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}', + icon: 'fa-solid fa-trash {{ (request()->input('status') == "deleted") ? ' text-danger' : '' }}', + event () { + window.location.href = '{{ (request()->input('status') == "deleted") ? route('manufacturers.index') : route('manufacturers.index', ['status' => 'deleted']) }}'; + }, + attributes: { + title: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}', + + } + }, + }, + }); + @endcan + + @can('create', \App\Models\Supplier::class) + // Consumable table buttons + window.supplierButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('suppliers.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + }); + @endcan + + @can('create', \App\Models\Component::class) + // License table buttons + window.licenseButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('licenses.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + }); + @endcan + + @can('create', \App\Models\Department::class) + // Department table buttons + window.departmentButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('departments.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + }); + @endcan + + @can('create', \App\Models\CustomField::class) + // Custom Field table buttons + window.departmentButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('departments.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + }); + @endcan + + @can('update', \App\Models\Asset::class) + // Custom Field table buttons + window.maintenanceButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('maintenances.create', ['asset_id' => (isset($asset)) ? $asset->id :'' ]) }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + }); + @endcan + + @can('create', \App\Models\Category::class) + // Custom Field table buttons + window.categoryButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('categories.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + }); + @endcan + + @can('create', \App\Models\AssetModel::class) + // Custom Field table buttons + window.modelButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('models.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + btnShowDeleted: { + text: '{{ (request()->input('status') == "deleted") ? trans('general.list_all') : trans('general.deleted') }}', + icon: 'fa-solid fa-trash {{ (request()->input('status') == "deleted") ? ' text-danger' : '' }}', + event () { + window.location.href = '{{ (request()->input('status') == "deleted") ? route('models.index') : route('models.index', ['status' => 'deleted']) }}'; + }, + attributes: { + title: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}', + + } + }, + }); + @endcan + + @can('create', \App\Models\Statuslabel::class) + // Status label table buttons + window.statuslabelButtons = () => ({ + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('statuslabels.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + }); + @endcan + + + // License table buttons + window.licenseButtons = () => ({ + @can('create', \App\Models\License::class) + btnAdd: { + text: '{{ trans('general.create') }}', + icon: 'fa fa-plus', + event () { + window.location.href = '{{ route('licenses.create') }}'; + }, + attributes: { + title: '{{ trans('general.create') }}', + @if ($snipeSettings->shortcuts_enabled == 1) + accesskey: 'n' + @endif + } + }, + @endcan + + btnExport: { + text: '{{ trans('general.export') }}', + icon: 'fa-solid fa-file-csv', + event () { + window.location.href = '{{ route('licenses.export', ['category_id' => (isset($category)) ? $category->id :'' ]) }}'; + }, + attributes: { + title: '{{ trans('general.export') }}' + } + } + }); + + + + $(function() { diff --git a/resources/views/reports/custom.blade.php b/resources/views/reports/custom.blade.php index 28d8ab0318..835a8d9013 100644 --- a/resources/views/reports/custom.blade.php +++ b/resources/views/reports/custom.blade.php @@ -823,12 +823,6 @@ .on('select2:select', function (event) { window.location.href = event.params.data.element.dataset.route; }); - - $('#dataConfirmModal').on('show.bs.modal', function (event) { - var content = $(event.relatedTarget).data('content'); - var title = $(event.relatedTarget).data('title'); - $(this).find(".modal-body").text(content); - $(this).find(".modal-header").text(title); - }); + @stop diff --git a/resources/views/statuslabels/index.blade.php b/resources/views/statuslabels/index.blade.php index d2f020b13a..ce2a6f758b 100755 --- a/resources/views/statuslabels/index.blade.php +++ b/resources/views/statuslabels/index.blade.php @@ -6,12 +6,6 @@ @parent @stop -@section('header_right') - @can('create', \App\Models\Statuslabel::class) - -{{ trans('general.create') }} - @endcan -@stop {{-- Page content --}} @section('content') @@ -28,6 +22,7 @@ data-sort-order="asc" data-sort-name="name" id="statuslabelsTable" + data-buttons="statuslabelButtons" class="table table-striped snipe-table" data-url="{{ route('api.statuslabels.index') }}" data-export-options='{ diff --git a/resources/views/statuslabels/view.blade.php b/resources/views/statuslabels/view.blade.php index ffca04e8ed..f80bfa5782 100644 --- a/resources/views/statuslabels/view.blade.php +++ b/resources/views/statuslabels/view.blade.php @@ -24,6 +24,7 @@ data-bulk-button-id="#bulkAssetEditButton" data-bulk-form-id="#assetsBulkForm" id="assetsListingTable" + data-buttons="assetButtons" class="table table-striped snipe-table" data-url="{{route('api.assets.index', ['status_id' => $statuslabel->id]) }}" data-export-options='{ diff --git a/resources/views/suppliers/index.blade.php b/resources/views/suppliers/index.blade.php index 397371351b..6e70a734c3 100755 --- a/resources/views/suppliers/index.blade.php +++ b/resources/views/suppliers/index.blade.php @@ -10,12 +10,6 @@ @section('content') -@section('header_right') - @can('create', \App\Models\Supplier::class) - {{ trans('general.create') }} - @endcan -@stop -
    @@ -27,6 +21,7 @@ data-side-pagination="server" data-sort-order="asc" id="suppliersTable" + data-buttons="supplierButtons" class="table table-striped snipe-table" data-url="{{ route('api.suppliers.index') }}" data-export-options='{ diff --git a/resources/views/suppliers/view.blade.php b/resources/views/suppliers/view.blade.php index ba0960c9c3..19357f0fad 100755 --- a/resources/views/suppliers/view.blade.php +++ b/resources/views/suppliers/view.blade.php @@ -35,7 +35,7 @@ @@ -48,7 +48,7 @@ @@ -60,7 +60,7 @@ @@ -72,7 +72,7 @@ @@ -84,7 +84,7 @@ @@ -96,7 +96,7 @@ diff --git a/resources/views/users/index.blade.php b/resources/views/users/index.blade.php index 4e14c102a2..f43588f0d8 100755 --- a/resources/views/users/index.blade.php +++ b/resources/views/users/index.blade.php @@ -18,16 +18,6 @@ @if ($snipeSettings->ldap_enabled == 1) {{trans('general.ldap_sync')}} @endif - shortcuts_enabled == 1 ? "n" : ''}} class="btn btn-primary pull-right" style="margin-right: 5px;"> {{ trans('general.create') }} - @endcan - - @if (request('status')=='deleted') - {{ trans('admin/users/table.show_current') }} - @else - {{ trans('admin/users/table.show_deleted') }} - @endif - @can('view', \App\Models\User::class) - {{ trans('general.export') }} @endcan @stop @@ -50,9 +40,17 @@ data-bulk-button-id="#bulkUserEditButton" data-bulk-form-id="#usersBulkForm" id="usersTable" + data-buttons="userButtons" class="table table-striped snipe-table" data-url="{{ route('api.users.index', - array('deleted'=> (request('status')=='deleted') ? 'true' : 'false','company_id' => e(request('company_id')))) }}" + [ + 'status' => e(request('status')), + 'deleted'=> (request('status')=='deleted') ? 'true' : 'false', + 'company_id' => e(request('company_id')), + 'manager_id' => e(request('manager_id')), + 'admins' => e(request('admins')), + 'superadmins' => e(request('superadmins')) + ]) }}" data-export-options='{ "fileName": "export-users-{{ date('Y-m-d') }}", "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] @@ -63,6 +61,7 @@
    + @stop @section('moar_scripts') diff --git a/resources/views/users/view.blade.php b/resources/views/users/view.blade.php index c9d58cfb27..fcfc6c2e6b 100755 --- a/resources/views/users/view.blade.php +++ b/resources/views/users/view.blade.php @@ -45,7 +45,7 @@ @@ -56,7 +56,7 @@ @@ -67,7 +67,7 @@ @@ -78,7 +78,7 @@ @@ -89,7 +89,7 @@ @@ -110,7 +110,7 @@