From 51a16de01bb527a747172ef3cdb6704db67a3fa6 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 8 Nov 2017 20:36:02 +0200 Subject: [PATCH 001/167] Merge template formatting --- storage/templates/bold.js | 628 ++++++++++++++++++++++--------------- storage/templates/clean.js | 500 ++++++++++++++++------------- 2 files changed, 664 insertions(+), 464 deletions(-) diff --git a/storage/templates/bold.js b/storage/templates/bold.js index 910438b4ee60..150f7d126d5c 100755 --- a/storage/templates/bold.js +++ b/storage/templates/bold.js @@ -1,266 +1,386 @@ -{ - "content": [ - { - "columns": [ - { - "width": 380, - "stack": [ - {"text":"$yourInvoiceLabelUC", "style": "yourInvoice"}, - "$clientDetails" - ], - "margin": [60, 100, 0, 10] - }, - { - "canvas": [ - { - "type": "rect", - "x": 0, - "y": 0, - "w": 225, - "h": "$invoiceDetailsHeight", - "r":0, - "lineWidth": 1, - "color": "$primaryColor:#36a498" - } - ], - "width":10, - "margin":[-10,100,0,10] - }, - { - "table": { - "body": "$invoiceDetails" +{ + "content":[ + { + "columns":[ + { + "width":380, + "stack":[ + { + "text":"$yourInvoiceLabelUC", + "style":"yourInvoice" + }, + "$clientDetails" + ], + "margin":[ + 60, + 100, + 0, + 10 + ] }, - "layout": "noBorders", - "margin": [0, 110, 0, 0] - } - ] - }, - { - "style": "invoiceLineItemsTable", - "table": { - "headerRows": 1, - "widths": "$invoiceLineItemColumns", - "body": "$invoiceLineItems" - }, - "layout": { - "hLineWidth": "$none", - "vLineWidth": "$none", - "paddingLeft": "$amount:8", - "paddingRight": "$amount:8", - "paddingTop": "$amount:14", - "paddingBottom": "$amount:14" - } - }, - { - "columns": [ - { - "width": 46, - "text": " " - }, - "$notesAndTerms", - { - "table": { - "widths": ["*", "40%"], - "body": "$subtotals" + { + "canvas":[ + { + "type":"rect", + "x":0, + "y":0, + "w":225, + "h":"$invoiceDetailsHeight", + "r":0, + "lineWidth":1, + "color":"$primaryColor:#36a498" + } + ], + "width":10, + "margin":[ + -10, + 100, + 0, + 10 + ] }, - "layout": { - "hLineWidth": "$none", - "vLineWidth": "$none", - "paddingLeft": "$amount:8", - "paddingRight": "$amount:8", - "paddingTop": "$amount:4", - "paddingBottom": "$amount:4" + { + "table":{ + "body":"$invoiceDetails" + }, + "layout":"noBorders", + "margin":[ + 0, + 110, + 0, + 0 + ] } - }] - }, - { - "stack": [ - "$invoiceDocuments" - ], - "style": "invoiceDocuments" - } - ], - "footer": - [ - {"canvas": [{ "type": "line", "x1": 0, "y1": 0, "x2": 600, "y2": 0,"lineWidth": 100,"lineColor":"$secondaryColor:#292526"}]}, - { - "columns": - [ - { - "text": "$invoiceFooter", - "margin": [40, -40, 40, 0], - "alignment": "left", - "color": "#FFFFFF" - } - ] - } - ], - "header": [ - { - "canvas": [ - { - "type": "line", - "x1": 0, - "y1": 0, - "x2": 600, - "y2": 0, - "lineWidth": 200, - "lineColor": "$secondaryColor:#292526" - } - ], - "width": 10 - }, - { - "columns": [ - { - "image": "$accountLogo", - "fit": [120, 60], - "margin": [30, 16, 0, 0] - }, - { - "stack": "$accountDetails", - "margin": [ + ] + }, + { + "style":"invoiceLineItemsTable", + "table":{ + "headerRows":1, + "widths":"$invoiceLineItemColumns", + "body":"$invoiceLineItems" + }, + "layout":{ + "hLineWidth":"$none", + "vLineWidth":"$none", + "paddingLeft":"$amount:8", + "paddingRight":"$amount:8", + "paddingTop":"$amount:14", + "paddingBottom":"$amount:14" + } + }, + { + "columns":[ + { + "width":46, + "text":" " + }, + "$notesAndTerms", + { + "table":{ + "widths":[ + "*", + "40%" + ], + "body":"$subtotals" + }, + "layout":{ + "hLineWidth":"$none", + "vLineWidth":"$none", + "paddingLeft":"$amount:8", + "paddingRight":"$amount:8", + "paddingTop":"$amount:4", + "paddingBottom":"$amount:4" + } + } + ] + }, + { + "stack":[ + "$invoiceDocuments" + ], + "style":"invoiceDocuments" + } + ], + "footer":[ + { + "canvas":[ + { + "type":"line", + "x1":0, + "y1":0, + "x2":600, + "y2":0, + "lineWidth":100, + "lineColor":"$secondaryColor:#292526" + } + ] + }, + { + "columns":[ + { + "text":"$invoiceFooter", + "margin":[ + 40, + -40, + 40, + 0 + ], + "alignment":"left", + "color":"#FFFFFF" + } + ] + } + ], + "header":[ + { + "canvas":[ + { + "type":"line", + "x1":0, + "y1":0, + "x2":600, + "y2":0, + "lineWidth":200, + "lineColor":"$secondaryColor:#292526" + } + ], + "width":10 + }, + { + "columns":[ + { + "image":"$accountLogo", + "fit":[ + 120, + 60 + ], + "margin":[ + 30, + 16, + 0, + 0 + ] + }, + { + "stack":"$accountDetails", + "margin":[ 0, 16, 0, 0 - ], - "width": 140 - }, - { - "stack": "$accountAddress", - "margin": [ + ], + "width":140 + }, + { + "stack":"$accountAddress", + "margin":[ 20, 16, 0, 0 - ] - } - ] - } - ], - "defaultStyle": { - "font": "$bodyFont", - "fontSize": "$fontSize", - "margin": [8, 4, 8, 4] - }, - "styles": { - "primaryColor":{ - "color": "$primaryColor:#36a498" - }, - "accountName": { - "bold": true, - "margin": [4, 2, 4, 1], - "color": "$primaryColor:#36a498" - }, - "accountDetails": { - "margin": [4, 2, 4, 1], - "color": "#FFFFFF" - }, - "accountAddress": { - "margin": [4, 2, 4, 1], - "color": "#FFFFFF" - }, - "clientDetails": { - "margin": [0, 2, 0, 1] - }, - "odd": { - "fillColor": "#ebebeb" - }, - "subtotalsBalanceDueLabel": { - "fontSize": "$fontSizeLargest", - "bold": true - }, - "subtotalsBalanceDue": { - "fontSize": "$fontSizeLargest", - "color": "$primaryColor:#36a498", - "bold": true - }, - "invoiceDetails": { - "color": "#ffffff" - }, - "invoiceNumber": { - "bold": true - }, - "tableHeader": { - "fontSize": 12, - "bold": true - }, - "costTableHeader": { - "alignment": "right" - }, - "qtyTableHeader": { - "alignment": "right" - }, - "taxTableHeader": { - "alignment": "right" - }, - "lineTotalTableHeader": { - "alignment": "right", - "margin": [0, 0, 40, 0] - }, - "firstColumn": { - "margin": [40, 0, 0, 0] - }, - "lastColumn": { - "margin": [0, 0, 40, 0] - }, - "productKey": { - "color": "$primaryColor:#36a498", - "bold": true - }, - "yourInvoice": { - "font": "$headerFont", - "bold": true, - "fontSize": 14, - "color": "$primaryColor:#36a498", - "margin": [0,0,0,8] - }, - "invoiceLineItemsTable": { - "margin": [0, 26, 0, 16] - }, - "clientName": { - "bold": true - }, - "cost": { - "alignment": "right" - }, - "quantity": { - "alignment": "right" - }, - "tax": { - "alignment": "right" - }, - "lineTotal": { - "alignment": "right" - }, - "subtotals": { - "alignment": "right", - "margin": [0,0,40,0] - }, - "termsLabel": { - "bold": true, - "margin": [0, 0, 0, 4] - }, - "fullheader": { - "font": "$headerFont", - "fontSize": "$fontSizeLargest", - "bold": true - }, - "subheader": { - "font": "$headerFont", - "fontSize": "$fontSizeLarger" - }, - "help": { - "fontSize": "$fontSizeSmaller", - "color": "#737373" - }, - "invoiceDocuments": { - "margin": [47, 0, 47, 0] - }, - "invoiceDocument": { - "margin": [0, 10, 0, 10] + ] } - }, - "pageMargins": [0, 80, 0, 40] - } + ] + } + ], + "defaultStyle":{ + "font":"$bodyFont", + "fontSize":"$fontSize", + "margin":[ + 8, + 4, + 8, + 4 + ] + }, + "styles":{ + "primaryColor":{ + "color":"$primaryColor:#36a498" + }, + "accountName":{ + "bold":true, + "margin":[ + 4, + 2, + 4, + 1 + ], + "color":"$primaryColor:#36a498" + }, + "accountDetails":{ + "margin":[ + 4, + 2, + 4, + 1 + ], + "color":"#FFFFFF" + }, + "accountAddress":{ + "margin":[ + 4, + 2, + 4, + 1 + ], + "color":"#FFFFFF" + }, + "clientDetails":{ + "margin":[ + 0, + 2, + 0, + 1 + ] + }, + "odd":{ + "fillColor":"#ebebeb" + }, + "subtotalsBalanceDueLabel":{ + "fontSize":"$fontSizeLargest", + "bold":true + }, + "subtotalsBalanceDue":{ + "fontSize":"$fontSizeLargest", + "color":"$primaryColor:#36a498", + "bold":true + }, + "invoiceDetails":{ + "color":"#ffffff" + }, + "invoiceNumber":{ + "bold":true + }, + "tableHeader":{ + "fontSize":12, + "bold":true + }, + "costTableHeader":{ + "alignment":"right" + }, + "qtyTableHeader":{ + "alignment":"right" + }, + "taxTableHeader":{ + "alignment":"right" + }, + "lineTotalTableHeader":{ + "alignment":"right", + "margin":[ + 0, + 0, + 40, + 0 + ] + }, + "firstColumn":{ + "margin":[ + 40, + 0, + 0, + 0 + ] + }, + "lastColumn":{ + "margin":[ + 0, + 0, + 40, + 0 + ] + }, + "productKey":{ + "color":"$primaryColor:#36a498", + "bold":true + }, + "yourInvoice":{ + "font":"$headerFont", + "bold":true, + "fontSize":14, + "color":"$primaryColor:#36a498", + "margin":[ + 0, + 0, + 0, + 8 + ] + }, + "invoiceLineItemsTable":{ + "margin":[ + 0, + 26, + 0, + 16 + ] + }, + "clientName":{ + "bold":true + }, + "cost":{ + "alignment":"right" + }, + "quantity":{ + "alignment":"right" + }, + "tax":{ + "alignment":"right" + }, + "lineTotal":{ + "alignment":"right" + }, + "subtotals":{ + "alignment":"right", + "margin":[ + 0, + 0, + 40, + 0 + ] + }, + "termsLabel":{ + "bold":true, + "margin":[ + 0, + 0, + 0, + 4 + ] + }, + "fullheader":{ + "font":"$headerFont", + "fontSize":"$fontSizeLargest", + "bold":true + }, + "subheader":{ + "font":"$headerFont", + "fontSize":"$fontSizeLarger" + }, + "help":{ + "fontSize":"$fontSizeSmaller", + "color":"#737373" + }, + "invoiceDocuments":{ + "margin":[ + 47, + 0, + 47, + 0 + ] + }, + "invoiceDocument":{ + "margin":[ + 0, + 10, + 0, + 10 + ] + } + }, + "pageMargins":[ + 0, + 80, + 0, + 40 + ] +} diff --git a/storage/templates/clean.js b/storage/templates/clean.js index fa5010cacf3b..900951240fc4 100755 --- a/storage/templates/clean.js +++ b/storage/templates/clean.js @@ -1,218 +1,298 @@ -{ - "content": [{ - "columns": [ - { - "image": "$accountLogo", - "fit": [120, 80] +{ + "content":[ + { + "columns":[ + { + "image":"$accountLogo", + "fit":[ + 120, + 80 + ] }, - { - "stack": "$accountDetails", - "margin": [7, 0, 0, 0] + { + "stack":"$accountDetails", + "margin":[ + 7, + 0, + 0, + 0 + ] }, - { - "stack": "$accountAddress" + { + "stack":"$accountAddress" } - ] - }, - { - "text": "$entityTypeUC", - "margin": [8, 30, 8, 5], - "style": "entityTypeLabel" - - }, - { - "table": { - "headerRows": 1, - "widths": ["auto", "auto", "*"], - "body": [ - [ - { - "table": { - "body": "$invoiceDetails" - }, - "margin": [0, 0, 12, 0], - "layout": "noBorders" - }, - { - "stack": "$clientDetails" - }, - { - "text": "" - } - ] + ] + }, + { + "text":"$entityTypeUC", + "margin":[ + 8, + 30, + 8, + 5 + ], + "style":"entityTypeLabel" + }, + { + "table":{ + "headerRows":1, + "widths":[ + "auto", + "auto", + "*" + ], + "body":[ + [ + { + "table":{ + "body":"$invoiceDetails" + }, + "margin":[ + 0, + 0, + 12, + 0 + ], + "layout":"noBorders" + }, + { + "stack":"$clientDetails" + }, + { + "text":"" + } + ] ] - }, - "layout": { - "hLineWidth": "$firstAndLast:.5", - "vLineWidth": "$none", - "hLineColor": "#D8D8D8", - "paddingLeft": "$amount:8", - "paddingRight": "$amount:8", - "paddingTop": "$amount:6", - "paddingBottom": "$amount:6" - } - }, - { - "style": "invoiceLineItemsTable", - "table": { - "headerRows": 1, - "widths": "$invoiceLineItemColumns", - "body": "$invoiceLineItems" - }, - "layout": { - "hLineWidth": "$notFirst:.5", - "vLineWidth": "$none", - "hLineColor": "#D8D8D8", - "paddingLeft": "$amount:8", - "paddingRight": "$amount:8", - "paddingTop": "$amount:14", - "paddingBottom": "$amount:14" - } - }, - { - "columns": [ + }, + "layout":{ + "hLineWidth":"$firstAndLast:.5", + "vLineWidth":"$none", + "hLineColor":"#D8D8D8", + "paddingLeft":"$amount:8", + "paddingRight":"$amount:8", + "paddingTop":"$amount:6", + "paddingBottom":"$amount:6" + } + }, + { + "style":"invoiceLineItemsTable", + "table":{ + "headerRows":1, + "widths":"$invoiceLineItemColumns", + "body":"$invoiceLineItems" + }, + "layout":{ + "hLineWidth":"$notFirst:.5", + "vLineWidth":"$none", + "hLineColor":"#D8D8D8", + "paddingLeft":"$amount:8", + "paddingRight":"$amount:8", + "paddingTop":"$amount:14", + "paddingBottom":"$amount:14" + } + }, + { + "columns":[ "$notesAndTerms", - { - "table": { - "widths": ["*", "40%"], - "body": "$subtotals" - }, - "layout": { - "hLineWidth": "$none", - "vLineWidth": "$none", - "paddingLeft": "$amount:34", - "paddingRight": "$amount:8", - "paddingTop": "$amount:4", - "paddingBottom": "$amount:4" - } + { + "table":{ + "widths":[ + "*", + "40%" + ], + "body":"$subtotals" + }, + "layout":{ + "hLineWidth":"$none", + "vLineWidth":"$none", + "paddingLeft":"$amount:34", + "paddingRight":"$amount:8", + "paddingTop":"$amount:4", + "paddingBottom":"$amount:4" + } } - ] - }, - { - "stack": [ + ] + }, + { + "stack":[ "$invoiceDocuments" - ], - "style": "invoiceDocuments" - } - ], - "defaultStyle": { - "font": "$bodyFont", - "fontSize": "$fontSize", - "margin": [8, 4, 8, 4] - }, - "footer": { - "columns": [ - { - "text": "$invoiceFooter", - "alignment": "left" - } - ], - "margin": [40, -20, 40, 0] - }, - "styles": { - "entityTypeLabel": { - "font": "$headerFont", - "fontSize": "$fontSizeLargest", - "color": "$primaryColor:#37a3c6" - }, - "primaryColor":{ - "color": "$primaryColor:#37a3c6" - }, - "accountName": { - "color": "$primaryColor:#37a3c6", - "bold": true - }, - "invoiceDetails": { - "margin": [0, 0, 8, 0] - }, - "accountDetails": { - "margin": [0, 2, 0, 2] - }, - "clientDetails": { - "margin": [0, 2, 0, 2] - }, - "notesAndTerms": { - "margin": [0, 2, 0, 2] - }, - "accountAddress": { - "margin": [0, 2, 0, 2] - }, - "odd": { - "fillColor": "#fbfbfb" - }, - "productKey": { - "color": "$primaryColor:#37a3c6", - "bold": true - }, - "subtotalsBalanceDueLabel": { - "fontSize": "$fontSizeLarger" - }, - "subtotalsBalanceDue": { - "fontSize": "$fontSizeLarger", - "color": "$primaryColor:#37a3c6" - }, - "invoiceNumber": { - "bold": true - }, - "tableHeader": { - "bold": true, - "fontSize": "$fontSizeLarger" - }, - "costTableHeader": { - "alignment": "right" - }, - "qtyTableHeader": { - "alignment": "right" - }, - "taxTableHeader": { - "alignment": "right" - }, - "lineTotalTableHeader": { - "alignment": "right" - }, - "invoiceLineItemsTable": { - "margin": [0, 16, 0, 16] - }, - "clientName": { - "bold": true - }, - "cost": { - "alignment": "right" - }, - "quantity": { - "alignment": "right" - }, - "tax": { - "alignment": "right" - }, - "lineTotal": { - "alignment": "right" - }, - "subtotals": { - "alignment": "right" - }, - "termsLabel": { - "bold": true - }, - "fullheader": { - "font": "$headerFont", - "fontSize": "$fontSizeLargest", - "bold": true - }, - "subheader": { - "font": "$headerFont", - "fontSize": "$fontSizeLarger" - }, - "help": { - "fontSize": "$fontSizeSmaller", - "color": "#737373" - }, - "invoiceDocuments": { - "margin": [7, 0, 7, 0] - }, - "invoiceDocument": { - "margin": [0, 10, 0, 10] - } - }, - "pageMargins": [40, 40, 40, 60] + ], + "style":"invoiceDocuments" + } + ], + "defaultStyle":{ + "font":"$bodyFont", + "fontSize":"$fontSize", + "margin":[ + 8, + 4, + 8, + 4 + ] + }, + "footer":{ + "columns":[ + { + "text":"$invoiceFooter", + "alignment":"left" + } + ], + "margin":[ + 40, + -20, + 40, + 0 + ] + }, + "styles":{ + "entityTypeLabel":{ + "font":"$headerFont", + "fontSize":"$fontSizeLargest", + "color":"$primaryColor:#37a3c6" + }, + "primaryColor":{ + "color":"$primaryColor:#37a3c6" + }, + "accountName":{ + "color":"$primaryColor:#37a3c6", + "bold":true + }, + "invoiceDetails":{ + "margin":[ + 0, + 0, + 8, + 0 + ] + }, + "accountDetails":{ + "margin":[ + 0, + 2, + 0, + 2 + ] + }, + "clientDetails":{ + "margin":[ + 0, + 2, + 0, + 2 + ] + }, + "notesAndTerms":{ + "margin":[ + 0, + 2, + 0, + 2 + ] + }, + "accountAddress":{ + "margin":[ + 0, + 2, + 0, + 2 + ] + }, + "odd":{ + "fillColor":"#fbfbfb" + }, + "productKey":{ + "color":"$primaryColor:#37a3c6", + "bold":true + }, + "subtotalsBalanceDueLabel":{ + "fontSize":"$fontSizeLarger" + }, + "subtotalsBalanceDue":{ + "fontSize":"$fontSizeLarger", + "color":"$primaryColor:#37a3c6" + }, + "invoiceNumber":{ + "bold":true + }, + "tableHeader":{ + "bold":true, + "fontSize":"$fontSizeLarger" + }, + "costTableHeader":{ + "alignment":"right" + }, + "qtyTableHeader":{ + "alignment":"right" + }, + "taxTableHeader":{ + "alignment":"right" + }, + "lineTotalTableHeader":{ + "alignment":"right" + }, + "invoiceLineItemsTable":{ + "margin":[ + 0, + 16, + 0, + 16 + ] + }, + "clientName":{ + "bold":true + }, + "cost":{ + "alignment":"right" + }, + "quantity":{ + "alignment":"right" + }, + "tax":{ + "alignment":"right" + }, + "lineTotal":{ + "alignment":"right" + }, + "subtotals":{ + "alignment":"right" + }, + "termsLabel":{ + "bold":true + }, + "fullheader":{ + "font":"$headerFont", + "fontSize":"$fontSizeLargest", + "bold":true + }, + "subheader":{ + "font":"$headerFont", + "fontSize":"$fontSizeLarger" + }, + "help":{ + "fontSize":"$fontSizeSmaller", + "color":"#737373" + }, + "invoiceDocuments":{ + "margin":[ + 7, + 0, + 7, + 0 + ] + }, + "invoiceDocument":{ + "margin":[ + 0, + 10, + 0, + 10 + ] + } + }, + "pageMargins":[ + 40, + 40, + 40, + 60 + ] } From 7934707b9bb634983854df5842bca9b9aeeb64dc Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 9 Nov 2017 21:21:08 +1100 Subject: [PATCH 002/167] Delete push token (#1737) * Remove push notification token when a user logs out * bug * logging * json encode array values only * use Token as Key instead of email * fix duplicate tokens appearing * refactor get User Accounts from API * refactor get User Accounts from API --- app/Http/Controllers/AccountApiController.php | 33 +++++++++++++++++-- app/Http/routes.php | 1 + 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/AccountApiController.php b/app/Http/Controllers/AccountApiController.php index cf6b3647559e..a5f8af6adf2a 100644 --- a/app/Http/Controllers/AccountApiController.php +++ b/app/Http/Controllers/AccountApiController.php @@ -16,6 +16,7 @@ use Auth; use Cache; use Exception; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Log; use Response; use Socialite; use Utils; @@ -91,7 +92,7 @@ class AccountApiController extends BaseAPIController return $this->response($data); } - + public function show(Request $request) { $account = Auth::user()->account; @@ -118,7 +119,13 @@ class AccountApiController extends BaseAPIController public function getUserAccounts(Request $request) { - return $this->processLogin($request); + $user = Auth::user(); + + $users = $this->accountRepo->findUsers($user, 'account.account_tokens'); + $transformer = new UserAccountTransformer($user->account, $request->serializer, $request->token_name); + $data = $this->createCollection($users, $transformer, 'user_account'); + + return $this->response($data); } public function update(UpdateAccountRequest $request) @@ -140,7 +147,7 @@ class AccountApiController extends BaseAPIController $devices = json_decode($account->devices, true); for ($x = 0; $x < count($devices); $x++) { - if ($devices[$x]['email'] == Auth::user()->username) { + if ($devices[$x]['email'] == $request->email) { $devices[$x]['token'] = $request->token; //update $devices[$x]['device'] = $request->device; $account->devices = json_encode($devices); @@ -171,6 +178,26 @@ class AccountApiController extends BaseAPIController return $this->response($newDevice); } + public function removeDeviceToken(Request $request) { + + $account = Auth::user()->account; + + $devices = json_decode($account->devices, true); + + foreach($devices as $key => $value) + { + + if($request->token == $value['token']) + unset($devices[$key]); + + } + + $account->devices = json_encode(array_values($devices)); + $account->save(); + + return $this->response(['success']); + } + public function updatePushNotifications(Request $request) { $account = Auth::user()->account; diff --git a/app/Http/routes.php b/app/Http/routes.php index b82309989c64..d9ea859b0019 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -356,6 +356,7 @@ Route::group(['middleware' => ['lookup:api', 'api'], 'prefix' => 'api/v1'], func Route::resource('users', 'UserApiController'); Route::resource('expenses', 'ExpenseApiController'); Route::post('add_token', 'AccountApiController@addDeviceToken'); + Route::post('remove_token', 'AccountApiController@removeDeviceToken'); Route::post('update_notifications', 'AccountApiController@updatePushNotifications'); Route::get('dashboard', 'DashboardApiController@index'); Route::resource('documents', 'DocumentAPIController'); From 2af92644950b8a16b314e751c008d44cf1467de0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 10 Nov 2017 09:37:10 +0200 Subject: [PATCH 003/167] Fix lang variable --- resources/lang/pt_BR/texts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/pt_BR/texts.php b/resources/lang/pt_BR/texts.php index 31ee1ae74bb3..e8d14cdb3e36 100644 --- a/resources/lang/pt_BR/texts.php +++ b/resources/lang/pt_BR/texts.php @@ -238,7 +238,7 @@ $LANG = array( 'confirmation_subject' => 'Confirmação de Conta do Invoice Ninja', 'confirmation_header' => 'Confirmação de Conta', 'confirmation_message' => 'Favor acessar o link abaixo para confirmar a sua conta.', - 'invoice_subject' => 'Nova fatura :numer de :account', + 'invoice_subject' => 'Nova fatura :number de :account', 'invoice_message' => 'Para visualizar a sua fatura de :amount, clique no link abaixo.', 'payment_subject' => 'Recebimento de pagamento de', 'payment_message' => 'Obrigado, pagamento de :amount confirmado', From 5839106731ec110df7316c6fe0eb21c956b2af1d Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 10 Nov 2017 12:03:05 +0200 Subject: [PATCH 004/167] Make license key larger --- app/Ninja/PaymentDrivers/BasePaymentDriver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Ninja/PaymentDrivers/BasePaymentDriver.php b/app/Ninja/PaymentDrivers/BasePaymentDriver.php index 8854363f8ab1..43092b1a194b 100644 --- a/app/Ninja/PaymentDrivers/BasePaymentDriver.php +++ b/app/Ninja/PaymentDrivers/BasePaymentDriver.php @@ -793,7 +793,7 @@ class BasePaymentDriver // Add the license key to the invoice content $invoiceItem = $payment->invoice->invoice_items->first(); - $invoiceItem->notes .= "\n\n##{$license->license_key}"; + $invoiceItem->notes .= "\n\n#{$license->license_key}"; $invoiceItem->save(); // Add the license key to the redirect URL From 05ad79e20728ccff16825c80172e34b7a654ec4c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 10 Nov 2017 12:07:06 +0200 Subject: [PATCH 005/167] Fix payment source in datatable --- app/Ninja/Datatables/PaymentDatatable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Ninja/Datatables/PaymentDatatable.php b/app/Ninja/Datatables/PaymentDatatable.php index 89ef8e24c736..435b610f92c7 100644 --- a/app/Ninja/Datatables/PaymentDatatable.php +++ b/app/Ninja/Datatables/PaymentDatatable.php @@ -69,7 +69,7 @@ class PaymentDatatable extends EntityDatatable } elseif ($model->email) { return $model->email; } elseif ($model->payment_type) { - return trans('texts.payment_type_' . strtolower($model->payment_type)); + return trans('texts.payment_type_' . $model->payment_type); } } elseif ($model->last4) { if ($model->bank_name) { From 443c2193d5c2387eeeb81f8d8f41731e5a9b947c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 10 Nov 2017 12:21:27 +0200 Subject: [PATCH 006/167] Installation on 3.8.1 fails: Exception AccountRepository.php #1738 --- app/Ninja/Repositories/AccountRepository.php | 42 ++++++++++---------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/app/Ninja/Repositories/AccountRepository.php b/app/Ninja/Repositories/AccountRepository.php index 2b5036160309..1ae0f807d9ee 100644 --- a/app/Ninja/Repositories/AccountRepository.php +++ b/app/Ninja/Repositories/AccountRepository.php @@ -59,29 +59,31 @@ class AccountRepository $account->company_id = $company->id; // Set default language/currency based on IP - $data = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $account->ip)); - $currencyCode = strtolower($data['geoplugin_currencyCode']); - $countryCode = strtolower($data['geoplugin_countryCode']); + if (\Cache::get('currencies')) { + $data = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $account->ip)); + $currencyCode = strtolower($data['geoplugin_currencyCode']); + $countryCode = strtolower($data['geoplugin_countryCode']); - $currency = \Cache::get('currencies')->filter(function ($item) use ($currencyCode) { - return strtolower($item->code) == $currencyCode; - })->first(); - if ($currency) { - $account->currency_id = $currency->id; - } + $currency = \Cache::get('currencies')->filter(function ($item) use ($currencyCode) { + return strtolower($item->code) == $currencyCode; + })->first(); + if ($currency) { + $account->currency_id = $currency->id; + } - $country = \Cache::get('countries')->filter(function ($item) use ($countryCode) { - return strtolower($item->iso_3166_2) == $countryCode || strtolower($item->iso_3166_3) == $countryCode; - })->first(); - if ($country) { - $account->country_id = $country->id; - } + $country = \Cache::get('countries')->filter(function ($item) use ($countryCode) { + return strtolower($item->iso_3166_2) == $countryCode || strtolower($item->iso_3166_3) == $countryCode; + })->first(); + if ($country) { + $account->country_id = $country->id; + } - $language = \Cache::get('languages')->filter(function ($item) use ($countryCode) { - return strtolower($item->locale) == $countryCode; - })->first(); - if ($language) { - $account->language_id = $language->id; + $language = \Cache::get('languages')->filter(function ($item) use ($countryCode) { + return strtolower($item->locale) == $countryCode; + })->first(); + if ($language) { + $account->language_id = $language->id; + } } $account->save(); From b6a762c1fbe758ca455d035858ab86becb401e9e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 10 Nov 2017 12:46:23 +0200 Subject: [PATCH 007/167] Update docs --- docs/configure.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configure.rst b/docs/configure.rst index 84aaf1943365..68fdec9461b0 100644 --- a/docs/configure.rst +++ b/docs/configure.rst @@ -86,7 +86,7 @@ Omnipay We use `Omnipay `_ to support our payment gateway integrations. -Follow these steps to add a driver. +Follow these steps to add a `custom driver`_. - Add the package to composer.json and then run ``composer install`` - Add a row to the gateways table. ``name`` is used in the gateway select, ``provider`` needs to match the Omnipay driver name From 4e0d05b90eabd292e4e8f49397e7e4df6531f8a0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sat, 11 Nov 2017 20:20:38 +0200 Subject: [PATCH 008/167] Update composer details --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 92eb142a799a..f5856c0f31be 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { - "name": "hillelcoren/invoice-ninja", - "description": "An open-source invoicing site built with Laravel", + "name": "invoiceninja/invoiceninja", + "description": "Invoices, expenses & time-tracking built with Laravel", "keywords": [ "invoice", "laravel" From 237a491a62f132101c05bb0310471f769d195847 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 10:58:08 +0200 Subject: [PATCH 009/167] Upgrade to Laravel 5.3 --- README.md | 2 +- app/Exceptions/Handler.php | 28 + app/Http/Controllers/Auth/AuthController.php | 220 +---- .../Auth/ForgotPasswordController.php | 32 + app/Http/Controllers/Auth/LoginController.php | 194 ++++ ...roller.php => ResetPasswordController.php} | 29 +- .../ClientAuth/ForgotPasswordController.php | 86 ++ ...AuthController.php => LoginController.php} | 53 +- .../ClientAuth/PasswordController.php | 82 +- .../ClientAuth/ResetPasswordController.php | 61 ++ app/Http/Controllers/InvoiceController.php | 2 +- app/Http/Middleware/Authenticate.php | 2 +- .../Middleware/RedirectIfAuthenticated.php | 15 +- app/Http/routes.php | 40 +- app/Models/Contact.php | 20 +- app/Models/User.php | 2 + .../Repositories/DashboardRepository.php | 2 +- app/Providers/AppServiceProvider.php | 6 +- app/Providers/AuthServiceProvider.php | 7 +- app/Providers/EventServiceProvider.php | 5 +- app/Providers/RouteServiceProvider.php | 4 +- composer.json | 58 +- composer.lock | 918 ++++++++---------- config/app.php | 3 + config/auth.php | 16 +- .../email.blade.php} | 0 .../auth/{ => passwords}/reset.blade.php | 0 resources/views/clientauth/login.blade.php | 2 +- .../email.blade.php} | 2 +- .../{ => passwords}/reset.blade.php | 0 30 files changed, 976 insertions(+), 915 deletions(-) create mode 100644 app/Http/Controllers/Auth/ForgotPasswordController.php create mode 100644 app/Http/Controllers/Auth/LoginController.php rename app/Http/Controllers/Auth/{PasswordController.php => ResetPasswordController.php} (61%) create mode 100644 app/Http/Controllers/ClientAuth/ForgotPasswordController.php rename app/Http/Controllers/ClientAuth/{AuthController.php => LoginController.php} (56%) create mode 100644 app/Http/Controllers/ClientAuth/ResetPasswordController.php rename resources/views/auth/{password.blade.php => passwords/email.blade.php} (100%) rename resources/views/auth/{ => passwords}/reset.blade.php (100%) rename resources/views/clientauth/{password.blade.php => passwords/email.blade.php} (98%) rename resources/views/clientauth/{ => passwords}/reset.blade.php (100%) diff --git a/README.md b/README.md index c7cda787513a..0649db5d86bd 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ The self-host zip includes all third party libraries whereas downloading the cod * [Voice Commands](https://www.youtube.com/watch?v=w1ylz-q58cU) ## Features -* Built using Laravel 5.2 +* Built using Laravel 5.3 * Live PDF generation using [pdfmake](http://pdfmake.org/) * Supports 50+ payment gateways with [Omnipay](https://github.com/thephpleague/omnipay) * Integrate with hundreds of apps with [Zapier](https://zapier.com/zapbook/invoice-ninja/) and [Integromat](https://www.integromat.com/en/integrations/invoiceninja) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 6aa8054d38f0..dbec7cadac42 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -4,6 +4,7 @@ namespace App\Exceptions; use Crawler; use Exception; +use Illuminate\Auth\AuthenticationException; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; @@ -150,4 +151,31 @@ class Handler extends ExceptionHandler return parent::render($request, $e); } } + + /** + * Convert an authentication exception into an unauthenticated response. + * + * @param \Illuminate\Http\Request $request + * @param \Illuminate\Auth\AuthenticationException $exception + * @return \Illuminate\Http\Response + */ + protected function unauthenticated($request, AuthenticationException $exception) + { + if ($request->expectsJson()) { + return response()->json(['error' => 'Unauthenticated.'], 401); + } + + $guard = array_get($exception->guards(), 0); + + switch ($guard) { + case 'client': + $url = '/client/login'; + break; + default: + $url = '/login'; + break; + } + + return redirect()->guest($url); + } } diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index 7403ce9b2960..016cb29d264b 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -2,42 +2,13 @@ namespace App\Http\Controllers\Auth; -use App\Events\UserLoggedIn; -use App\Http\Controllers\Controller; -use App\Models\User; +use Illuminate\Http\Request; use App\Ninja\Repositories\AccountRepository; use App\Services\AuthService; -use Auth; -use Event; -use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers; -use Illuminate\Http\Request; -use Lang; -use Session; -use Utils; -use Cache; -use Illuminate\Contracts\Auth\Authenticatable; -use App\Http\Requests\ValidateTwoFactorRequest; +use App\Http\Controllers\Controller; class AuthController extends Controller { - /* - |-------------------------------------------------------------------------- - | Registration & Login Controller - |-------------------------------------------------------------------------- - | - | This controller handles the registration of new users, as well as the - | authentication of existing users. By default, this controller uses - | a simple trait to add these behaviors. Why don't you explore it? - | - */ - - use AuthenticatesAndRegistersUsers; - - /** - * @var string - */ - protected $redirectTo = '/dashboard'; - /** * @var AuthService */ @@ -63,43 +34,13 @@ class AuthController extends Controller $this->authService = $authService; } - /** - * @param array $data - * - * @return mixed - */ - public function validator(array $data) - { - return Validator::make($data, [ - 'name' => 'required|max:255', - 'email' => 'required|email|max:255|unique:users', - 'password' => 'required|confirmed|min:6', - ]); - } - - /** - * Create a new user instance after a valid registration. - * - * @param array $data - * - * @return User - */ - public function create(array $data) - { - return User::create([ - 'name' => $data['name'], - 'email' => $data['email'], - 'password' => bcrypt($data['password']), - ]); - } - /** * @param $provider * @param Request $request * * @return \Illuminate\Http\RedirectResponse */ - public function authLogin($provider, Request $request) + public function oauthLogin($provider, Request $request) { return $this->authService->execute($provider, $request->has('code')); } @@ -107,161 +48,12 @@ class AuthController extends Controller /** * @return \Illuminate\Http\RedirectResponse */ - public function authUnlink() + public function oauthUnlink() { - $this->accountRepo->unlinkUserFromOauth(Auth::user()); + $this->accountRepo->unlinkUserFromOauth(auth()->user()); - Session::flash('message', trans('texts.updated_settings')); + session()->flash('message', trans('texts.updated_settings')); return redirect()->to('/settings/' . ACCOUNT_USER_DETAILS); } - - /** - * @return \Illuminate\Http\Response - */ - public function getLoginWrapper() - { - if (auth()->check()) { - return redirect('/'); - } - - if (! Utils::isNinja() && ! User::count()) { - return redirect()->to('/setup'); - } - - if (Utils::isNinja() && ! Utils::isTravis()) { - // make sure the user is on SITE_URL/login to ensure OAuth works - $requestURL = request()->url(); - $loginURL = SITE_URL . '/login'; - $subdomain = Utils::getSubdomain(request()->url()); - if ($requestURL != $loginURL && ! strstr($subdomain, 'webapp-')) { - return redirect()->to($loginURL); - } - } - - return self::getLogin(); - } - - /** - * @param Request $request - * - * @return \Illuminate\Http\Response - */ - public function postLoginWrapper(Request $request) - { - $userId = Auth::check() ? Auth::user()->id : null; - $user = User::where('email', '=', $request->input('email'))->first(); - - if ($user && $user->failed_logins >= MAX_FAILED_LOGINS) { - Session::flash('error', trans('texts.invalid_credentials')); - return redirect()->to('login'); - } - - $response = self::postLogin($request); - - if (Auth::check()) { - /* - $users = false; - // we're linking a new account - if ($request->link_accounts && $userId && Auth::user()->id != $userId) { - $users = $this->accountRepo->associateAccounts($userId, Auth::user()->id); - Session::flash('message', trans('texts.associated_accounts')); - // check if other accounts are linked - } else { - $users = $this->accountRepo->loadAccounts(Auth::user()->id); - } - */ - } elseif ($user) { - error_log('login failed'); - $user->failed_logins = $user->failed_logins + 1; - $user->save(); - } - - return $response; - } - - /** - * Send the post-authentication response. - * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @return \Illuminate\Http\Response - */ - private function authenticated(Request $request, Authenticatable $user) - { - if ($user->google_2fa_secret) { - Auth::logout(); - $request->session()->put('2fa:user:id', $user->id); - return redirect('/validate_two_factor/' . $user->account->account_key); - } - - Event::fire(new UserLoggedIn()); - - return redirect()->intended($this->redirectTo); - } - - /** - * - * @return \Illuminate\Http\Response - */ - public function getValidateToken() - { - if (session('2fa:user:id')) { - return view('auth.two_factor'); - } - - return redirect('login'); - } - - /** - * - * @param App\Http\Requests\ValidateSecretRequest $request - * @return \Illuminate\Http\Response - */ - public function postValidateToken(ValidateTwoFactorRequest $request) - { - //get user id and create cache key - $userId = $request->session()->pull('2fa:user:id'); - $key = $userId . ':' . $request->totp; - - //use cache to store token to blacklist - Cache::add($key, true, 4); - - //login and redirect user - Auth::loginUsingId($userId); - Event::fire(new UserLoggedIn()); - - return redirect()->intended($this->redirectTo); - } - - /** - * @return \Illuminate\Http\Response - */ - public function getLogoutWrapper() - { - if (Auth::check() && ! Auth::user()->registered) { - if (request()->force_logout) { - $account = Auth::user()->account; - $this->accountRepo->unlinkAccount($account); - - if (! $account->hasMultipleAccounts()) { - $account->company->forceDelete(); - } - $account->forceDelete(); - } else { - return redirect('/'); - } - } - - $response = self::getLogout(); - - Session::flush(); - - $reason = htmlentities(request()->reason); - if (!empty($reason) && Lang::has("texts.{$reason}_logout")) { - Session::flash('warning', trans("texts.{$reason}_logout")); - } - - return $response; - } } diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php new file mode 100644 index 000000000000..6a247fefd088 --- /dev/null +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -0,0 +1,32 @@ +middleware('guest'); + } +} diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php new file mode 100644 index 000000000000..9145743d015c --- /dev/null +++ b/app/Http/Controllers/Auth/LoginController.php @@ -0,0 +1,194 @@ +middleware('guest', ['except' => 'getLogoutWrapper']); + } + + /** + * @return \Illuminate\Http\Response + */ + public function getLoginWrapper(Request $request) + { + if (auth()->check()) { + return redirect('/'); + } + + if (! Utils::isNinja() && ! User::count()) { + return redirect()->to('/setup'); + } + + if (Utils::isNinja() && ! Utils::isTravis()) { + // make sure the user is on SITE_URL/login to ensure OAuth works + $requestURL = request()->url(); + $loginURL = SITE_URL . '/login'; + $subdomain = Utils::getSubdomain(request()->url()); + if ($requestURL != $loginURL && ! strstr($subdomain, 'webapp-')) { + return redirect()->to($loginURL); + } + } + + return self::showLoginForm($request); + } + + /** + * @param Request $request + * + * @return \Illuminate\Http\Response + */ + public function postLoginWrapper(Request $request) + { + $userId = auth()->check() ? auth()->user()->id : null; + $user = User::where('email', '=', $request->input('email'))->first(); + + if ($user && $user->failed_logins >= MAX_FAILED_LOGINS) { + session()->flash('error', trans('texts.invalid_credentials')); + return redirect()->to('login'); + } + + $response = self::login($request); + + if (auth()->check()) { + /* + $users = false; + // we're linking a new account + if ($request->link_accounts && $userId && Auth::user()->id != $userId) { + $users = $this->accountRepo->associateAccounts($userId, Auth::user()->id); + Session::flash('message', trans('texts.associated_accounts')); + // check if other accounts are linked + } else { + $users = $this->accountRepo->loadAccounts(Auth::user()->id); + } + */ + } elseif ($user) { + error_log('login failed'); + $user->failed_logins = $user->failed_logins + 1; + $user->save(); + } + + return $response; + } + + /** + * Send the post-authentication response. + * + * @param \Illuminate\Http\Request $request + * @param \Illuminate\Contracts\Auth\Authenticatable $user + * @return \Illuminate\Http\Response + */ + private function authenticated(Request $request, Authenticatable $user) + { + if ($user->google_2fa_secret) { + auth()->logout(); + session()->put('2fa:user:id', $user->id); + return redirect('/validate_two_factor/' . $user->account->account_key); + } + + Event::fire(new UserLoggedIn()); + + return redirect()->intended($this->redirectTo); + } + + /** + * + * @return \Illuminate\Http\Response + */ + public function getValidateToken() + { + if (session('2fa:user:id')) { + return view('auth.two_factor'); + } + + return redirect('login'); + } + + /** + * + * @param App\Http\Requests\ValidateSecretRequest $request + * @return \Illuminate\Http\Response + */ + public function postValidateToken(ValidateTwoFactorRequest $request) + { + //get user id and create cache key + $userId = session()->pull('2fa:user:id'); + $key = $userId . ':' . $request->totp; + + //use cache to store token to blacklist + Cache::add($key, true, 4); + + //login and redirect user + auth()->loginUsingId($userId); + Event::fire(new UserLoggedIn()); + + return redirect()->intended($this->redirectTo); + } + + /** + * @return \Illuminate\Http\Response + */ + public function getLogoutWrapper(Request $request) + { + if (auth()->check() && ! auth()->user()->registered) { + if (request()->force_logout) { + $account = auth()->user()->account; + $this->accountRepo->unlinkAccount($account); + + if (! $account->hasMultipleAccounts()) { + $account->company->forceDelete(); + } + $account->forceDelete(); + } else { + return redirect('/'); + } + } + + $response = self::logout($request); + + $reason = htmlentities(request()->reason); + if (!empty($reason) && Lang::has("texts.{$reason}_logout")) { + sesion()->flash('warning', trans("texts.{$reason}_logout")); + } + + return $response; + } +} diff --git a/app/Http/Controllers/Auth/PasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php similarity index 61% rename from app/Http/Controllers/Auth/PasswordController.php rename to app/Http/Controllers/Auth/ResetPasswordController.php index 189f736fcfd8..a07a372f8642 100644 --- a/app/Http/Controllers/Auth/PasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -7,7 +7,7 @@ use App\Events\UserLoggedIn; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\ResetsPasswords; -class PasswordController extends Controller +class ResetPasswordController extends Controller { /* |-------------------------------------------------------------------------- @@ -21,40 +21,27 @@ class PasswordController extends Controller */ use ResetsPasswords { - getResetSuccessResponse as protected traitGetResetSuccessResponse; + sendResetResponse as protected traitSendResetResponse; } /** + * Where to redirect users after resetting their password. + * * @var string */ protected $redirectTo = '/dashboard'; /** - * Create a new password controller instance. + * Create a new controller instance. * - * @internal param \Illuminate\Contracts\Auth\Guard $auth - * @internal param \Illuminate\Contracts\Auth\PasswordBroker $passwords + * @return void */ public function __construct() { $this->middleware('guest'); } - /** - * Display the form to request a password reset link. - * - * @return \Illuminate\Http\Response - */ - public function getEmailWrapper() - { - if (auth()->check()) { - return redirect('/'); - } - - return $this->getEmail(); - } - - protected function getResetSuccessResponse($response) + protected function sendResetResponse($response) { $user = auth()->user(); @@ -64,7 +51,7 @@ class PasswordController extends Controller return redirect('/validate_two_factor/' . $user->account->account_key); } else { Event::fire(new UserLoggedIn()); - return $this->traitGetResetSuccessResponse($response); + return $this->traitSendResetResponse($response); } } } diff --git a/app/Http/Controllers/ClientAuth/ForgotPasswordController.php b/app/Http/Controllers/ClientAuth/ForgotPasswordController.php new file mode 100644 index 000000000000..6af3c1d143b2 --- /dev/null +++ b/app/Http/Controllers/ClientAuth/ForgotPasswordController.php @@ -0,0 +1,86 @@ +middleware('guest:client'); + + //Config::set('auth.defaults.passwords', 'client'); + } + + /** + * @return \Illuminate\Http\RedirectResponse + */ + public function showLinkRequestForm() + { + $data = [ + 'clientauth' => true, + ]; + + if (! session('contact_key')) { + return \Redirect::to('/client/session_expired'); + } + + return view('clientauth.passwords.email')->with($data); + } + + /** + * Send a reset link to the given user. + * + * @param \Illuminate\Http\Request $request + * + * @return \Illuminate\Http\Response + */ + public function sendResetLinkEmail(Request $request) + { + $contactId = null; + $contactKey = session('contact_key'); + if ($contactKey) { + $contact = Contact::where('contact_key', '=', $contactKey)->first(); + if ($contact && ! $contact->is_deleted && $contact->email) { + $contactId = $contact->id; + } + } + + $response = $this->broker()->sendResetLink(['id' => $contactId], function (Message $message) { + $message->subject($this->getEmailSubject()); + }); + + return $response == Password::RESET_LINK_SENT + ? $this->sendResetLinkResponse($response) + : $this->sendResetLinkFailedResponse($request, $response); + } + + protected function broker() + { + return Password::broker('clients'); + } +} diff --git a/app/Http/Controllers/ClientAuth/AuthController.php b/app/Http/Controllers/ClientAuth/LoginController.php similarity index 56% rename from app/Http/Controllers/ClientAuth/AuthController.php rename to app/Http/Controllers/ClientAuth/LoginController.php index f48934b06826..befc498cfa57 100644 --- a/app/Http/Controllers/ClientAuth/AuthController.php +++ b/app/Http/Controllers/ClientAuth/LoginController.php @@ -2,32 +2,62 @@ namespace App\Http\Controllers\ClientAuth; +use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\Contact; -use App\Models\User; use Illuminate\Foundation\Auth\AuthenticatesUsers; -use Illuminate\Http\Request; -use Session; -class AuthController extends Controller +class LoginController extends Controller { + /* + |-------------------------------------------------------------------------- + | Login Controller + |-------------------------------------------------------------------------- + | + | This controller handles authenticating users for the application and + | redirecting them to your home screen. The controller uses a trait + | to conveniently provide its functionality to your applications. + | + */ + use AuthenticatesUsers; /** - * @var string - */ - protected $guard = 'client'; - - /** + * Where to redirect users after login. + * * @var string */ protected $redirectTo = '/client/dashboard'; + /** + * Create a new controller instance. + * + * @return void + */ + public function __construct() + { + $this->middleware('guest:client', ['except' => 'logout']); + } + + /** + * Get the guard to be used during authentication. + * + * @return \Illuminate\Contracts\Auth\StatefulGuard + */ + protected function guard() + { + return auth()->guard('client'); + } + /** * @return mixed */ public function showLoginForm() { + if (! session('contact_key')) { + return redirect('/client/session_expired'); + } + $data = [ 'clientauth' => true, ]; @@ -42,7 +72,7 @@ class AuthController extends Controller * * @return array */ - protected function getCredentials(Request $request) + protected function credentials(Request $request) { $credentials = $request->only('password'); $credentials['id'] = null; @@ -59,7 +89,7 @@ class AuthController extends Controller } /** - * Validate the user login request. + * Validate the user login request - don't require the email * * @param \Illuminate\Http\Request $request * @@ -79,4 +109,5 @@ class AuthController extends Controller { return view('clientauth.sessionexpired')->with(['clientauth' => true]); } + } diff --git a/app/Http/Controllers/ClientAuth/PasswordController.php b/app/Http/Controllers/ClientAuth/PasswordController.php index b13f0dffb16e..a9996227a416 100644 --- a/app/Http/Controllers/ClientAuth/PasswordController.php +++ b/app/Http/Controllers/ClientAuth/PasswordController.php @@ -13,86 +13,6 @@ use Illuminate\Support\Facades\Password; class PasswordController extends Controller { - /* - |-------------------------------------------------------------------------- - | Password Reset Controller - |-------------------------------------------------------------------------- - | - | This controller is responsible for handling password reset requests - | and uses a simple trait to include this behavior. You're free to - | explore this trait and override any methods you wish to tweak. - | - */ - - use ResetsPasswords; - - /** - * @var string - */ - protected $redirectTo = '/client/dashboard'; - - /** - * Create a new password controller instance. - * - * @internal param \Illuminate\Contracts\Auth\Guard $auth - * @internal param \Illuminate\Contracts\Auth\PasswordBroker $passwords - */ - public function __construct() - { - $this->middleware('guest'); - Config::set('auth.defaults.passwords', 'client'); - } - - /** - * @return \Illuminate\Http\RedirectResponse - */ - public function showLinkRequestForm() - { - $data = [ - 'clientauth' => true, - ]; - - if (! session('contact_key')) { - return \Redirect::to('/client/sessionexpired'); - } - - return view('clientauth.password')->with($data); - } - - /** - * Send a reset link to the given user. - * - * @param \Illuminate\Http\Request $request - * - * @return \Illuminate\Http\Response - */ - public function sendResetLinkEmail(Request $request) - { - $broker = $this->getBroker(); - - $contactId = null; - $contactKey = session('contact_key'); - if ($contactKey) { - $contact = Contact::where('contact_key', '=', $contactKey)->first(); - if ($contact && ! $contact->is_deleted && $contact->email) { - $contactId = $contact->id; - } - } - - $response = Password::broker($broker)->sendResetLink(['id' => $contactId], function (Message $message) { - $message->subject($this->getEmailSubject()); - }); - - switch ($response) { - case Password::RESET_LINK_SENT: - return $this->getSendResetLinkEmailSuccessResponse($response); - - case Password::INVALID_USER: - default: - return $this->getSendResetLinkEmailFailureResponse($response); - } - } - /** * Display the password reset view for the given token. * @@ -116,7 +36,7 @@ class PasswordController extends Controller ); if (! session('contact_key')) { - return \Redirect::to('/client/sessionexpired'); + return \Redirect::to('/client/session_expired'); } return view('clientauth.reset')->with($data); diff --git a/app/Http/Controllers/ClientAuth/ResetPasswordController.php b/app/Http/Controllers/ClientAuth/ResetPasswordController.php new file mode 100644 index 000000000000..6a53f42a33ef --- /dev/null +++ b/app/Http/Controllers/ClientAuth/ResetPasswordController.php @@ -0,0 +1,61 @@ +middleware('guest:client'); + + //Config::set('auth.defaults.passwords', 'client'); + } + + protected function broker() + { + return Password::broker('clients'); + } + + protected function guard() + { + return auth()->guard('clients'); + } + + public function showResetForm(Request $request, $token = null) + { + return view('clientauth.passwords.reset')->with( + ['token' => $token, 'email' => $request->email] + ); + } + +} diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index c9fc36f466d6..a508fcf308fd 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -93,7 +93,7 @@ class InvoiceController extends BaseController ->where('invitations.invoice_id', '=', $invoice->id) ->where('invitations.account_id', '=', Auth::user()->account_id) ->where('invitations.deleted_at', '=', null) - ->select('contacts.public_id')->lists('public_id'); + ->select('contacts.public_id')->pluck('public_id'); $clients = Client::scope()->withTrashed()->with('contacts', 'country'); diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 62a6c52318db..e7bbcd467268 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -64,7 +64,7 @@ class Authenticate Session::put('contact_key', $contact->contact_key); } if (! $contact) { - return \Redirect::to('client/sessionexpired'); + return \Redirect::to('client/session_expired'); } $account = $contact->account; diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index ac78de26231f..972b0b0ae27b 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -39,12 +39,21 @@ class RedirectIfAuthenticated * * @return mixed */ - public function handle(Request $request, Closure $next) + public function handle(Request $request, Closure $next, $guard = null) { - if ($this->auth->check() && Client::scope()->count() > 0) { + if (auth()->guard($guard)->check()) { Session::reflash(); - return new RedirectResponse(url('/dashboard')); + switch ($guard) { + case 'client': + if (session('contact_key')) { + return redirect('/client/dashboard'); + } + break; + default: + return redirect('/dashboard'); + break; + } } return $next($request); diff --git a/app/Http/routes.php b/app/Http/routes.php index d9ea859b0019..8bf3ac11c412 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -79,39 +79,37 @@ Route::group(['middleware' => 'lookup:postmark'], function () { Route::group(['middleware' => 'lookup:account'], function () { Route::post('/payment_hook/{account_key}/{gateway_id}', 'OnlinePaymentController@handlePaymentWebhook'); Route::match(['GET', 'POST', 'OPTIONS'], '/buy_now/{gateway_type?}', 'OnlinePaymentController@handleBuyNow'); - Route::get('validate_two_factor/{account_key}', 'Auth\AuthController@getValidateToken'); - Route::post('validate_two_factor/{account_key}', ['middleware' => 'throttle:5', 'uses' => 'Auth\AuthController@postValidateToken']); + Route::get('validate_two_factor/{account_key}', 'Auth\LoginController@getValidateToken'); + Route::post('validate_two_factor/{account_key}', ['middleware' => 'throttle:5', 'uses' => 'Auth\LoginController@postValidateToken']); }); //Route::post('/hook/bot/{platform?}', 'BotController@handleMessage'); // Laravel auth routes -Route::get('/signup', ['as' => 'signup', 'uses' => 'Auth\AuthController@getRegister']); -Route::post('/signup', ['as' => 'signup', 'uses' => 'Auth\AuthController@postRegister']); -Route::get('/login', ['as' => 'login', 'uses' => 'Auth\AuthController@getLoginWrapper']); -Route::get('/logout', ['as' => 'logout', 'uses' => 'Auth\AuthController@getLogoutWrapper']); -Route::get('/recover_password', ['as' => 'forgot', 'uses' => 'Auth\PasswordController@getEmailWrapper']); -Route::get('/password/reset/{token}', ['as' => 'forgot', 'uses' => 'Auth\PasswordController@getReset']); -Route::get('/auth/{provider}', 'Auth\AuthController@authLogin'); +Route::get('/login', ['as' => 'login', 'uses' => 'Auth\LoginController@getLoginWrapper']); +Route::get('/logout', ['as' => 'logout', 'uses' => 'Auth\LoginController@getLogoutWrapper']); +Route::get('/recover_password', ['as' => 'forgot', 'uses' => 'Auth\ForgotPasswordController@showLinkRequestForm']); +Route::get('/password/reset/{token}', ['as' => 'forgot', 'uses' => 'Auth\ResetPasswordController@showResetForm']); +Route::get('/auth/{provider}', 'Auth\AuthController@oauthLogin'); Route::group(['middleware' => ['lookup:user']], function () { Route::get('/user/confirm/{confirmation_code}', 'UserController@confirm'); - Route::post('/login', ['as' => 'login', 'uses' => 'Auth\AuthController@postLoginWrapper']); - Route::post('/recover_password', ['as' => 'forgot', 'uses' => 'Auth\PasswordController@postEmail']); - Route::post('/password/reset', ['as' => 'forgot', 'uses' => 'Auth\PasswordController@postReset']); + Route::post('/login', ['as' => 'login', 'uses' => 'Auth\LoginController@postLoginWrapper']); + Route::post('/recover_password', ['as' => 'forgot', 'uses' => 'Auth\ForgotPasswordController@sendResetLinkEmail']); + Route::post('/password/reset', ['as' => 'forgot', 'uses' => 'Auth\ResetPasswordController@reset']); }); // Client auth -Route::get('/client/login', ['as' => 'login', 'uses' => 'ClientAuth\AuthController@getLogin']); -Route::get('/client/logout', ['as' => 'logout', 'uses' => 'ClientAuth\AuthController@getLogout']); -Route::get('/client/sessionexpired', ['as' => 'logout', 'uses' => 'ClientAuth\AuthController@getSessionExpired']); -Route::get('/client/recover_password', ['as' => 'forgot', 'uses' => 'ClientAuth\PasswordController@getEmail']); -Route::get('/client/password/reset/{token}', ['as' => 'forgot', 'uses' => 'ClientAuth\PasswordController@getReset']); +Route::get('/client/login', ['as' => 'login', 'uses' => 'ClientAuth\LoginController@showLoginForm']); +Route::get('/client/logout', ['as' => 'logout', 'uses' => 'ClientAuth\LoginController@getLogout']); +Route::get('/client/session_expired', ['as' => 'logout', 'uses' => 'ClientAuth\LoginController@getSessionExpired']); +Route::get('/client/recover_password', ['as' => 'forgot', 'uses' => 'ClientAuth\ForgotPasswordController@showLinkRequestForm']); +Route::get('/client/password/reset/{token}', ['as' => 'forgot', 'uses' => 'Auth\ResetPasswordController@showResetForm']); Route::group(['middleware' => ['lookup:contact']], function () { - Route::post('/client/login', ['as' => 'login', 'uses' => 'ClientAuth\AuthController@postLogin']); - Route::post('/client/recover_password', ['as' => 'forgot', 'uses' => 'ClientAuth\PasswordController@postEmail']); - Route::post('/client/password/reset', ['as' => 'forgot', 'uses' => 'ClientAuth\PasswordController@postReset']); + Route::post('/client/login', ['as' => 'login', 'uses' => 'ClientAuth\LoginController@login']); + Route::post('/client/recover_password', ['as' => 'forgot', 'uses' => 'ClientAuth\ForgotPasswordController@sendResetLinkEmail']); + Route::post('/client/password/reset', ['as' => 'forgot', 'uses' => 'ClientAuth\ResetPasswordController@reset']); }); if (Utils::isReseller()) { @@ -137,7 +135,7 @@ Route::group(['middleware' => ['lookup:user', 'auth:user']], function () { Route::post('signup/validate', 'AccountController@checkEmail'); Route::post('signup/submit', 'AccountController@submitSignup'); - Route::get('auth_unlink', 'Auth\AuthController@authUnlink'); + Route::get('auth_unlink', 'Auth\AuthController@oauthUnlink'); Route::get('settings/user_details', 'AccountController@showUserDetails'); Route::post('settings/user_details', 'AccountController@saveUserDetails'); diff --git a/app/Models/Contact.php b/app/Models/Contact.php index fffc93c6d753..e651671e5e9d 100644 --- a/app/Models/Contact.php +++ b/app/Models/Contact.php @@ -9,13 +9,20 @@ use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract; use Illuminate\Database\Eloquent\SoftDeletes; use App\Models\LookupContact; +use Illuminate\Notifications\Notifiable; /** * Class Contact. */ class Contact extends EntityModel implements AuthenticatableContract, CanResetPasswordContract { - use SoftDeletes, Authenticatable, CanResetPassword; + use SoftDeletes; + use Authenticatable; + use CanResetPassword; + use Notifiable; + + protected $guard = 'client'; + /** * @var array */ @@ -42,6 +49,17 @@ class Contact extends EntityModel implements AuthenticatableContract, CanResetPa 'custom_value2', ]; + /** + * The attributes excluded from the model's JSON form. + * + * @var array + */ + protected $hidden = [ + 'password', + 'remember_token', + 'confirmation_code', + ]; + /** * @var string */ diff --git a/app/Models/User.php b/app/Models/User.php index bdc21dcdcff0..19bd048eb2d4 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -11,6 +11,7 @@ use Illuminate\Foundation\Auth\User as Authenticatable; use Laracasts\Presenter\PresentableTrait; use Session; use App\Models\LookupUser; +use Illuminate\Notifications\Notifiable; /** * Class User. @@ -19,6 +20,7 @@ class User extends Authenticatable { use PresentableTrait; use SoftDeletes; + use Notifiable; /** * @var string diff --git a/app/Ninja/Repositories/DashboardRepository.php b/app/Ninja/Repositories/DashboardRepository.php index 68507de7cd83..1897a269e915 100644 --- a/app/Ninja/Repositories/DashboardRepository.php +++ b/app/Ninja/Repositories/DashboardRepository.php @@ -159,7 +159,7 @@ class DashboardRepository $records->select(DB::raw('sum(expenses.amount + (expenses.amount * expenses.tax_rate1 / 100) + (expenses.amount * expenses.tax_rate2 / 100)) as total, count(expenses.id) as count, '.$timeframe.' as '.$groupBy)); } - return $records->get(); + return $records->get()->all(); } public function totals($accountId, $userId, $viewAll) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index b7255fd4420c..f723c2c48875 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -10,6 +10,8 @@ use Utils; use Validator; use Queue; use Illuminate\Queue\Events\JobProcessing; +use Illuminate\Support\Facades\Route; + /** * Class AppServiceProvider. @@ -23,7 +25,9 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - // support selecting job database + Route::singularResourceParameters(false); + + // support selecting job database Queue::before(function (JobProcessing $event) { $body = $event->job->getRawBody(); preg_match('/db-ninja-[\d+]/', $body, $matches); diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 4ed077e8443d..54b9df70e60a 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -2,6 +2,7 @@ namespace App\Providers; +use Gate; use Illuminate\Contracts\Auth\Access\Gate as GateContract; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; @@ -41,12 +42,12 @@ class AuthServiceProvider extends ServiceProvider * * @return void */ - public function boot(GateContract $gate) + public function boot() { foreach (get_class_methods(new \App\Policies\GenericEntityPolicy()) as $method) { - $gate->define($method, "App\Policies\GenericEntityPolicy@{$method}"); + Gate::define($method, "App\Policies\GenericEntityPolicy@{$method}"); } - $this->registerPolicies($gate); + $this->registerPolicies(); } } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index ecde08cd356a..2b266bbbad06 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -2,7 +2,6 @@ namespace App\Providers; -use Illuminate\Contracts\Events\Dispatcher as DispatcherContract; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; class EventServiceProvider extends ServiceProvider @@ -222,9 +221,9 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot(DispatcherContract $events) + public function boot() { - parent::boot($events); + parent::boot(); // } diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index ccbd59cd67ee..cedd02f1dd18 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -27,9 +27,9 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - public function boot(Router $router) + public function boot() { - parent::boot($router); + parent::boot(); } /** diff --git a/composer.json b/composer.json index f5856c0f31be..2f1d65f8751d 100644 --- a/composer.json +++ b/composer.json @@ -14,90 +14,60 @@ ], "require": { "php": ">=5.5.9", + "laravel/framework": "5.3.*", + "laravelcollective/bus": "5.3.*", + "laravelcollective/html": "5.3.*", + "symfony/css-selector": "~3.1", + "invoiceninja/omnipay-collection": "0.4@dev", "ext-gd": "*", "ext-gmp": "*", - "Dwolla/omnipay-dwolla": "dev-master", - "abdala/omnipay-pagseguro": "0.2", - "agmscode/omnipay-agms": "~1.0", - "alfaproject/omnipay-skrill": "dev-master", "anahkiasen/former": "4.0.*@dev", - "andreas22/omnipay-fasapay": "1.*", "asgrim/ofxparser": "^1.1", "bacon/bacon-qr-code": "^1.0", "barracudanetworks/archivestream-php": "^1.0", "barryvdh/laravel-cors": "^0.9.1", "barryvdh/laravel-debugbar": "~2.2", "barryvdh/laravel-ide-helper": "~2.2", - "cardgate/omnipay-cardgate": "~2.0", "cerdic/css-tidy": "~v1.5", "chumper/datatable": "dev-develop#04ef2bf", "codedge/laravel-selfupdater": "5.x-dev", - "collizo4sky/omnipay-wepay": "dev-address-fix", - "delatbabel/omnipay-fatzebra": "dev-master", - "dercoder/omnipay-ecopayz": "~1.0", - "dercoder/omnipay-paysafecard": "dev-master", - "descubraomundo/omnipay-pagarme": "dev-master", - "digitickets/omnipay-barclays-epdq": "~3.0", - "digitickets/omnipay-datacash": "~3.0", - "digitickets/omnipay-gocardlessv2": "dev-payment-fix", - "digitickets/omnipay-realex": "~5.0", - "dioscouri/omnipay-cybersource": "dev-master", "doctrine/dbal": "2.5.x", "ezyang/htmlpurifier": "~v4.7", - "fotografde/omnipay-checkoutcom": "~2.0", - "fruitcakestudio/omnipay-sisow": "~2.0", "fzaninotto/faker": "^1.5", "gatepay/FedACHdir": "dev-master@dev", "google/apiclient": "^2.0", "guzzlehttp/guzzle": "~6.0", - "incube8/omnipay-multicards": "dev-master", "intervention/image": "dev-master", "jaybizzle/laravel-crawler-detect": "1.*", "jlapp/swaggervel": "master-dev", "jonnyw/php-phantomjs": "4.*", - "justinbusschau/omnipay-secpay": "~2.0", "laracasts/presenter": "dev-master", - "laravel/framework": "5.2.*", "laravel/socialite": "~2.0", - "laravelcollective/bus": "5.2.*", - "laravelcollective/html": "5.2.*", "league/flysystem-aws-s3-v3": "~1.0", "league/flysystem-rackspace": "~1.0", "league/fractal": "0.13.*", - "lokielse/omnipay-alipay": "~1.4", "maatwebsite/excel": "~2.0", - "meebio/omnipay-creditcall": "dev-master", - "meebio/omnipay-secure-trading": "dev-master", - "mfauveau/omnipay-pacnet": "~2.0", "mpdf/mpdf": "6.1.3", "nwidart/laravel-modules": "^1.14", - "omnipay/2checkout": "dev-master#e9c079c2dde0d7ba461903b3b7bd5caf6dee1248", - "omnipay/authorizenet": "dev-solution-id as 2.5.0", - "omnipay/bitpay": "dev-master", - "omnipay/braintree": "~2.0@dev", - "omnipay/gocardless": "dev-master", - "omnipay/mollie": "3.*", - "omnipay/omnipay": "~2.3", - "omnipay/stripe": "dev-master", "patricktalmadge/bootstrapper": "5.5.x", "pragmarx/google2fa-laravel": "^0.1.2", "predis/predis": "^1.1", "simshaun/recurr": "dev-master", - "softcommerce/omnipay-paytrace": "~1.0", - "symfony/css-selector": "~3.0", "turbo124/laravel-push-notification": "2.*", - "vink/omnipay-komoju": "~1.0", "webpatser/laravel-countries": "dev-master", "websight/l5-google-cloud-storage": "dev-master", "wepay/php-sdk": "^0.2", - "wildbit/laravel-postmark-provider": "3.0" + "wildbit/laravel-postmark-provider": "3.0", + "omnipay/authorizenet": "dev-solution-id as 2.5.0", + "digitickets/omnipay-gocardlessv2": "dev-payment-fix", + "collizo4sky/omnipay-wepay": "dev-address-fix" }, "require-dev": { + "symfony/dom-crawler": "~3.1", "codeception/c3": "~2.0", "codeception/codeception": "2.3.3", "phpspec/phpspec": "~2.1", - "phpunit/phpunit": "~4.0", - "symfony/dom-crawler": "~3.0" + "phpunit/phpunit": "~4.0" }, "autoload": { "classmap": [ @@ -137,6 +107,8 @@ "php artisan key:generate" ] }, + "minimum-stability": "dev", + "prefer-stable": true, "config": { "preferred-install": "dist", "sort-packages": true, @@ -161,11 +133,11 @@ }, { "type": "vcs", - "url": "https://github.com/hillelcoren/omnipay-wepay" + "url": "https://github.com/hillelcoren/l5-google-cloud-storage" }, { "type": "vcs", - "url": "https://github.com/hillelcoren/l5-google-cloud-storage" + "url": "https://github.com/hillelcoren/omnipay-wepay" }, { "type": "vcs", diff --git a/composer.lock b/composer.lock index bfef2b142e7e..ba05d401973b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "80f6d3f1c26c0eb84d0d9ee5aa88aaa1", - "content-hash": "0891783210a35e9c83addbcdbb691993", + "hash": "627f199185222a0ab01efcb55a0956de", + "content-hash": "4ec49f8cba7092b4c8294ea4c551de5f", "packages": [ { "name": "abdala/omnipay-pagseguro", @@ -169,16 +169,16 @@ }, { "name": "anahkiasen/former", - "version": "4.0.x-dev", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/formers/former.git", - "reference": "96363d8a0e7a58b80117a68e564104a431cdb49e" + "reference": "1ad9b332e8d8f5b23159aabbca89084276938382" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/formers/former/zipball/96363d8a0e7a58b80117a68e564104a431cdb49e", - "reference": "96363d8a0e7a58b80117a68e564104a431cdb49e", + "url": "https://api.github.com/repos/formers/former/zipball/1ad9b332e8d8f5b23159aabbca89084276938382", + "reference": "1ad9b332e8d8f5b23159aabbca89084276938382", "shasum": "" }, "require": { @@ -224,7 +224,7 @@ "foundation", "laravel" ], - "time": "2017-02-09 23:05:49" + "time": "2016-07-28 19:36:11" }, { "name": "anahkiasen/html-object", @@ -380,16 +380,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.36.28", + "version": "3.38.1", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "65ca98c303ea1489b2719b6d892d800dd604d4b2" + "reference": "9f704274f4748d2039a16d45b3388ed8dde74e89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/65ca98c303ea1489b2719b6d892d800dd604d4b2", - "reference": "65ca98c303ea1489b2719b6d892d800dd604d4b2", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/9f704274f4748d2039a16d45b3388ed8dde74e89", + "reference": "9f704274f4748d2039a16d45b3388ed8dde74e89", "shasum": "" }, "require": { @@ -456,7 +456,7 @@ "s3", "sdk" ], - "time": "2017-10-17 19:51:40" + "time": "2017-11-09 19:15:59" }, { "name": "bacon/bacon-qr-code", @@ -546,33 +546,38 @@ }, { "name": "barryvdh/laravel-cors", - "version": "v0.9.2", + "version": "v0.9.3", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-cors.git", - "reference": "0b758188dadda20f4a17f1f4fe03c22ea92ce8e4" + "reference": "2551489de60486471434b0c7050f7fc65f9c9119" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-cors/zipball/0b758188dadda20f4a17f1f4fe03c22ea92ce8e4", - "reference": "0b758188dadda20f4a17f1f4fe03c22ea92ce8e4", + "url": "https://api.github.com/repos/barryvdh/laravel-cors/zipball/2551489de60486471434b0c7050f7fc65f9c9119", + "reference": "2551489de60486471434b0c7050f7fc65f9c9119", "shasum": "" }, "require": { - "illuminate/support": "5.1.x|5.2.x|5.3.x|5.4.x", + "illuminate/support": "5.3.x|5.4.x|5.5.x", "php": ">=5.5.9", - "symfony/http-foundation": "~2.7|~3.0", - "symfony/http-kernel": "~2.7|~3.0" + "symfony/http-foundation": "~3.1", + "symfony/http-kernel": "~3.1" }, "require-dev": { "orchestra/testbench": "3.x", - "phpunit/phpunit": "^4.8|^5.2" + "phpunit/phpunit": "^4.8|^5.2", + "squizlabs/php_codesniffer": "^2.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.9-dev", - "dev-develop": "1.0-dev" + "dev-master": "0.9-dev" + }, + "laravel": { + "providers": [ + "Barryvdh\\Cors\\ServiceProvider" + ] } }, "autoload": { @@ -600,7 +605,7 @@ "crossdomain", "laravel" ], - "time": "2017-03-22 08:40:10" + "time": "2017-08-28 11:42:05" }, { "name": "barryvdh/laravel-debugbar", @@ -857,7 +862,7 @@ ], "authors": [ { - "name": "Cardgate", + "name": "CardGate", "email": "tech@cardgate.com" }, { @@ -1009,7 +1014,7 @@ "laravel" ], "abandoned": "OpenSkill/Datatable", - "time": "2015-04-29 07:00:36" + "time": "2017-01-26 10:04:06" }, { "name": "classpreloader/classpreloader", @@ -2533,8 +2538,7 @@ "reference": "origin/master", "shasum": null }, - "type": "library", - "time": "2016-10-12 12:00:38" + "type": "library" }, { "name": "gocardless/gocardless-pro", @@ -2590,16 +2594,16 @@ }, { "name": "google/apiclient", - "version": "v2.2.0", + "version": "v2.2.1", "source": { "type": "git", "url": "https://github.com/google/google-api-php-client.git", - "reference": "f3fadd538315d62ebd1191d89ac791468c617260" + "reference": "b69b8ac4bf6501793c389d4e013a79d09c85c5f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/google-api-php-client/zipball/f3fadd538315d62ebd1191d89ac791468c617260", - "reference": "f3fadd538315d62ebd1191d89ac791468c617260", + "url": "https://api.github.com/repos/google/google-api-php-client/zipball/b69b8ac4bf6501793c389d4e013a79d09c85c5f2", + "reference": "b69b8ac4bf6501793c389d4e013a79d09c85c5f2", "shasum": "" }, "require": { @@ -2645,20 +2649,20 @@ "keywords": [ "google" ], - "time": "2017-07-10 15:34:54" + "time": "2017-11-03 01:19:53" }, { "name": "google/apiclient-services", - "version": "v0.30", + "version": "v0.33", "source": { "type": "git", "url": "https://github.com/google/google-api-php-client-services.git", - "reference": "a7d43aa8748d74e7a8fd1617e4ec9e7af4974bec" + "reference": "6399eb82c725aef79124cd6b543e1984cd13d207" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/google-api-php-client-services/zipball/a7d43aa8748d74e7a8fd1617e4ec9e7af4974bec", - "reference": "a7d43aa8748d74e7a8fd1617e4ec9e7af4974bec", + "url": "https://api.github.com/repos/google/google-api-php-client-services/zipball/6399eb82c725aef79124cd6b543e1984cd13d207", + "reference": "6399eb82c725aef79124cd6b543e1984cd13d207", "shasum": "" }, "require": { @@ -2682,7 +2686,7 @@ "keywords": [ "google" ], - "time": "2017-10-14 00:23:32" + "time": "2017-11-06 00:24:21" }, { "name": "google/auth", @@ -2731,22 +2735,22 @@ }, { "name": "google/cloud", - "version": "v0.40.0", + "version": "v0.43.0", "source": { "type": "git", "url": "https://github.com/GoogleCloudPlatform/google-cloud-php.git", - "reference": "eb00fd13f31d9540c4e6584b120333f169038be9" + "reference": "4ce0b3f16187933f737912745d68630429c6afa3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GoogleCloudPlatform/google-cloud-php/zipball/eb00fd13f31d9540c4e6584b120333f169038be9", - "reference": "eb00fd13f31d9540c4e6584b120333f169038be9", + "url": "https://api.github.com/repos/GoogleCloudPlatform/google-cloud-php/zipball/4ce0b3f16187933f737912745d68630429c6afa3", + "reference": "4ce0b3f16187933f737912745d68630429c6afa3", "shasum": "" }, "require": { "google/auth": "~0.9|^1.0", - "google/gax": "^0.24", - "google/proto-client": "^0.24", + "google/gax": "^0.25", + "google/proto-client": "^0.25", "guzzlehttp/guzzle": "^5.3|^6.0", "guzzlehttp/psr7": "^1.2", "monolog/monolog": "~1", @@ -2756,29 +2760,29 @@ "rize/uri-template": "~0.3" }, "replace": { - "google/cloud-bigquery": "0.3.0", - "google/cloud-core": "1.10.0", - "google/cloud-datastore": "1.0.1", - "google/cloud-dlp": "0.2.0", - "google/cloud-error-reporting": "0.5.0", - "google/cloud-language": "0.6.0", - "google/cloud-logging": "1.5.0", - "google/cloud-monitoring": "0.5.0", - "google/cloud-pubsub": "0.8.0", - "google/cloud-spanner": "0.7.0", + "google/cloud-bigquery": "0.3.1", + "google/cloud-core": "1.12.0", + "google/cloud-datastore": "1.0.3", + "google/cloud-dlp": "0.3.0", + "google/cloud-error-reporting": "0.6.0", + "google/cloud-language": "0.9.0", + "google/cloud-logging": "1.6.1", + "google/cloud-monitoring": "0.6.0", + "google/cloud-pubsub": "0.9.1", + "google/cloud-spanner": "0.8.1", "google/cloud-speech": "0.8.0", - "google/cloud-storage": "1.2.0", - "google/cloud-trace": "0.3.2", - "google/cloud-translate": "1.0.1", - "google/cloud-videointelligence": "0.5.0", - "google/cloud-vision": "0.5.0" + "google/cloud-storage": "1.2.1", + "google/cloud-trace": "0.3.3", + "google/cloud-translate": "1.0.2", + "google/cloud-videointelligence": "0.6.0", + "google/cloud-vision": "0.6.0" }, "require-dev": { "erusev/parsedown": "^1.6", "league/json-guard": "^0.3", "phpdocumentor/reflection": "^3.0", "phpseclib/phpseclib": "^2", - "phpunit/phpunit": "4.8.*", + "phpunit/phpunit": "^4.8.36", "squizlabs/php_codesniffer": "2.*", "symfony/console": "^3.0", "symfony/lock": "3.3.x-dev#1ba6ac9", @@ -2848,20 +2852,20 @@ "translation", "vision" ], - "time": "2017-10-17 17:11:46" + "time": "2017-11-11 01:52:19" }, { "name": "google/gax", - "version": "0.24.0", + "version": "0.25.0", "source": { "type": "git", "url": "https://github.com/googleapis/gax-php.git", - "reference": "94c4cf52f55115b7ee528474d72c7ed7829e1365" + "reference": "bca9e3de6fe537761c89db5115f45878243c11ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/gax-php/zipball/94c4cf52f55115b7ee528474d72c7ed7829e1365", - "reference": "94c4cf52f55115b7ee528474d72c7ed7829e1365", + "url": "https://api.github.com/repos/googleapis/gax-php/zipball/bca9e3de6fe537761c89db5115f45878243c11ba", + "reference": "bca9e3de6fe537761c89db5115f45878243c11ba", "shasum": "" }, "require": { @@ -2892,28 +2896,28 @@ "keywords": [ "google" ], - "time": "2017-09-19 20:06:14" + "time": "2017-10-30 16:05:52" }, { "name": "google/proto-client", - "version": "0.24.0", + "version": "0.25.0", "source": { "type": "git", "url": "https://github.com/googleapis/proto-client-php.git", - "reference": "2f36eaa4a2fa1ee6f66525c8f40741acb27cec52" + "reference": "fb7f1f7bf750ed0121df6ffcb39add0c8639713a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/proto-client-php/zipball/2f36eaa4a2fa1ee6f66525c8f40741acb27cec52", - "reference": "2f36eaa4a2fa1ee6f66525c8f40741acb27cec52", + "url": "https://api.github.com/repos/googleapis/proto-client-php/zipball/fb7f1f7bf750ed0121df6ffcb39add0c8639713a", + "reference": "fb7f1f7bf750ed0121df6ffcb39add0c8639713a", "shasum": "" }, "require": { - "google/protobuf": "^3.3.2", + "google/protobuf": "^3.4", "php": ">=5.5" }, "require-dev": { - "google/gax": ">=0.20.0", + "google/gax": ">=0.25.0", "phpunit/phpunit": "4.8.*" }, "type": "library", @@ -2932,7 +2936,7 @@ "keywords": [ "google" ], - "time": "2017-09-18 19:35:44" + "time": "2017-10-30 23:07:46" }, { "name": "google/protobuf", @@ -3466,46 +3470,65 @@ "time": "2017-09-21 16:33:42" }, { - "name": "ircmaxell/password-compat", - "version": "v1.0.4", + "name": "invoiceninja/omnipay-collection", + "version": "v0.4", "source": { "type": "git", - "url": "https://github.com/ircmaxell/password_compat.git", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" + "url": "https://github.com/invoiceninja/omnipay-collection.git", + "reference": "eb2d739440efdea418152a68c80fd7d9ca00140d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", + "url": "https://api.github.com/repos/invoiceninja/omnipay-collection/zipball/eb2d739440efdea418152a68c80fd7d9ca00140d", + "reference": "eb2d739440efdea418152a68c80fd7d9ca00140d", "shasum": "" }, - "require-dev": { - "phpunit/phpunit": "4.*" + "require": { + "abdala/omnipay-pagseguro": "0.2", + "agmscode/omnipay-agms": "~1.0", + "alfaproject/omnipay-skrill": "dev-master", + "andreas22/omnipay-fasapay": "1.*", + "cardgate/omnipay-cardgate": "~2.0", + "delatbabel/omnipay-fatzebra": "dev-master", + "dercoder/omnipay-ecopayz": "~1.0", + "dercoder/omnipay-paysafecard": "dev-master", + "descubraomundo/omnipay-pagarme": "dev-master", + "digitickets/omnipay-barclays-epdq": "~3.0", + "digitickets/omnipay-datacash": "~3.0", + "digitickets/omnipay-realex": "~5.0", + "dioscouri/omnipay-cybersource": "dev-master", + "dwolla/omnipay-dwolla": "dev-master", + "fotografde/omnipay-checkoutcom": "~2.0", + "fruitcakestudio/omnipay-sisow": "~2.0", + "incube8/omnipay-multicards": "dev-master", + "justinbusschau/omnipay-secpay": "~2.0", + "lokielse/omnipay-alipay": "~1.4", + "meebio/omnipay-creditcall": "dev-master", + "meebio/omnipay-secure-trading": "dev-master", + "mfauveau/omnipay-pacnet": "~2.0", + "omnipay/2checkout": "dev-master#e9c079c2dde0d7ba461903b3b7bd5caf6dee1248", + "omnipay/bitpay": "dev-master", + "omnipay/braintree": "~2.0@dev", + "omnipay/gocardless": "dev-master", + "omnipay/mollie": "3.*", + "omnipay/omnipay": "~2.3", + "omnipay/stripe": "dev-master", + "softcommerce/omnipay-paytrace": "~1.0", + "vink/omnipay-komoju": "~1.0" }, "type": "library", - "autoload": { - "files": [ - "lib/password.php" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Anthony Ferrara", - "email": "ircmaxell@php.net", - "homepage": "http://blog.ircmaxell.com" + "name": "Hillel Coren", + "email": "hillelcoren@gmail.com" } ], - "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", - "homepage": "https://github.com/ircmaxell/password_compat", - "keywords": [ - "hashing", - "password" - ], - "time": "2014-11-20 16:49:30" + "description": "Collection of Omnipay drivers", + "time": "2017-11-11 19:43:09" }, { "name": "jakoch/phantomjs-installer", @@ -3637,16 +3660,16 @@ }, { "name": "jaybizzle/crawler-detect", - "version": "v1.2.53", + "version": "v1.2.54", "source": { "type": "git", "url": "https://github.com/JayBizzle/Crawler-Detect.git", - "reference": "a6ce29ecaeb411a9963ea48f4b221c70d242c27f" + "reference": "9af25770d9382917b680009a88497162405bbe48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/a6ce29ecaeb411a9963ea48f4b221c70d242c27f", - "reference": "a6ce29ecaeb411a9963ea48f4b221c70d242c27f", + "url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/9af25770d9382917b680009a88497162405bbe48", + "reference": "9af25770d9382917b680009a88497162405bbe48", "shasum": "" }, "require": { @@ -3682,7 +3705,7 @@ "crawlerdetect", "php crawler detect" ], - "time": "2017-10-17 20:08:27" + "time": "2017-10-28 13:05:55" }, { "name": "jaybizzle/laravel-crawler-detect", @@ -4010,16 +4033,16 @@ }, { "name": "laravel/framework", - "version": "v5.2.45", + "version": "v5.3.31", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "2a79f920d5584ec6df7cf996d922a742d11095d1" + "reference": "e641e75fc5b26ad0ba8c19b7e83b08cad1d03b89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/2a79f920d5584ec6df7cf996d922a742d11095d1", - "reference": "2a79f920d5584ec6df7cf996d922a742d11095d1", + "url": "https://api.github.com/repos/laravel/framework/zipball/e641e75fc5b26ad0ba8c19b7e83b08cad1d03b89", + "reference": "e641e75fc5b26ad0ba8c19b7e83b08cad1d03b89", "shasum": "" }, "require": { @@ -4032,20 +4055,20 @@ "monolog/monolog": "~1.11", "mtdowling/cron-expression": "~1.0", "nesbot/carbon": "~1.20", - "paragonie/random_compat": "~1.4", - "php": ">=5.5.9", - "psy/psysh": "0.7.*", - "swiftmailer/swiftmailer": "~5.1", - "symfony/console": "2.8.*|3.0.*", - "symfony/debug": "2.8.*|3.0.*", - "symfony/finder": "2.8.*|3.0.*", - "symfony/http-foundation": "2.8.*|3.0.*", - "symfony/http-kernel": "2.8.*|3.0.*", - "symfony/polyfill-php56": "~1.0", - "symfony/process": "2.8.*|3.0.*", - "symfony/routing": "2.8.*|3.0.*", - "symfony/translation": "2.8.*|3.0.*", - "symfony/var-dumper": "2.8.*|3.0.*", + "paragonie/random_compat": "~1.4|~2.0", + "php": ">=5.6.4", + "psy/psysh": "0.7.*|0.8.*", + "ramsey/uuid": "~3.0", + "swiftmailer/swiftmailer": "~5.4", + "symfony/console": "3.1.*", + "symfony/debug": "3.1.*", + "symfony/finder": "3.1.*", + "symfony/http-foundation": "3.1.*", + "symfony/http-kernel": "3.1.*", + "symfony/process": "3.1.*", + "symfony/routing": "3.1.*", + "symfony/translation": "3.1.*", + "symfony/var-dumper": "3.1.*", "vlucas/phpdotenv": "~2.2" }, "replace": { @@ -4067,6 +4090,7 @@ "illuminate/http": "self.version", "illuminate/log": "self.version", "illuminate/mail": "self.version", + "illuminate/notifications": "self.version", "illuminate/pagination": "self.version", "illuminate/pipeline": "self.version", "illuminate/queue": "self.version", @@ -4083,10 +4107,10 @@ "aws/aws-sdk-php": "~3.0", "mockery/mockery": "~0.9.4", "pda/pheanstalk": "~3.0", - "phpunit/phpunit": "~4.1", + "phpunit/phpunit": "~5.4", "predis/predis": "~1.0", - "symfony/css-selector": "2.8.*|3.0.*", - "symfony/dom-crawler": "2.8.*|3.0.*" + "symfony/css-selector": "3.1.*", + "symfony/dom-crawler": "3.1.*" }, "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (~3.0).", @@ -4098,20 +4122,17 @@ "pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).", "predis/predis": "Required to use the redis cache and queue drivers (~1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).", - "symfony/css-selector": "Required to use some of the crawler integration testing tools (2.8.*|3.0.*).", - "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (2.8.*|3.0.*).", + "symfony/css-selector": "Required to use some of the crawler integration testing tools (3.1.*).", + "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (3.1.*).", "symfony/psr-http-message-bridge": "Required to use psr7 bridging features (0.2.*)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.2-dev" + "dev-master": "5.3-dev" } }, "autoload": { - "classmap": [ - "src/Illuminate/Queue/IlluminateQueueClosure.php" - ], "files": [ "src/Illuminate/Foundation/helpers.php", "src/Illuminate/Support/helpers.php" @@ -4127,16 +4148,16 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "description": "The Laravel Framework.", - "homepage": "http://laravel.com", + "homepage": "https://laravel.com", "keywords": [ "framework", "laravel" ], - "time": "2016-08-26 11:44:52" + "time": "2017-03-24 16:31:06" }, { "name": "laravel/socialite", @@ -4194,28 +4215,28 @@ }, { "name": "laravelcollective/bus", - "version": "v5.2", + "version": "v5.3.0", "source": { "type": "git", "url": "https://github.com/LaravelCollective/bus.git", - "reference": "e48b4d44d49f820e1b85ff16b9402e01c770c83a" + "reference": "720298af5ddaa09e1ddb846d02c2a911e92c3574" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/LaravelCollective/bus/zipball/e48b4d44d49f820e1b85ff16b9402e01c770c83a", - "reference": "e48b4d44d49f820e1b85ff16b9402e01c770c83a", + "url": "https://api.github.com/repos/LaravelCollective/bus/zipball/720298af5ddaa09e1ddb846d02c2a911e92c3574", + "reference": "720298af5ddaa09e1ddb846d02c2a911e92c3574", "shasum": "" }, "require": { - "illuminate/container": "5.2.*", - "illuminate/contracts": "5.2.*", - "illuminate/pipeline": "5.2.*", - "illuminate/support": "5.2.*", - "php": ">=5.5.9" + "illuminate/container": "5.3.*", + "illuminate/contracts": "5.3.*", + "illuminate/pipeline": "5.3.*", + "illuminate/support": "5.3.*", + "php": ">=5.6.4" }, "require-dev": { - "mockery/mockery": "~0.9", - "phpunit/phpunit": "~4.0" + "mockery/mockery": "~0.9.4", + "phpunit/phpunit": "~5.4" }, "type": "library", "autoload": { @@ -4231,38 +4252,42 @@ { "name": "Taylor Otwell", "email": "taylorotwell@gmail.com" + }, + { + "name": "Adam Engebretson", + "email": "adam@laravelcollective.com" } ], - "description": "The Laravel Bus (5.1) package for use in Laravel 5.2.", + "description": "The Laravel Bus (5.1) package for use in Laravel 5.3.", "homepage": "http://laravelcollective.com", - "time": "2015-12-23 07:43:33" + "time": "2016-08-28 00:02:50" }, { "name": "laravelcollective/html", - "version": "v5.2.6", + "version": "v5.3.2", "source": { "type": "git", "url": "https://github.com/LaravelCollective/html.git", - "reference": "4f6701c7c3f6ff2aee1f4ed205ed6820e1e3048e" + "reference": "299f3dccd61c3f6d89ebb9b10f36fb2a9aee5206" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/LaravelCollective/html/zipball/4f6701c7c3f6ff2aee1f4ed205ed6820e1e3048e", - "reference": "4f6701c7c3f6ff2aee1f4ed205ed6820e1e3048e", + "url": "https://api.github.com/repos/LaravelCollective/html/zipball/299f3dccd61c3f6d89ebb9b10f36fb2a9aee5206", + "reference": "299f3dccd61c3f6d89ebb9b10f36fb2a9aee5206", "shasum": "" }, "require": { - "illuminate/http": "5.2.*", - "illuminate/routing": "5.2.*", - "illuminate/session": "5.2.*", - "illuminate/support": "5.2.*", - "illuminate/view": "5.2.*", - "php": ">=5.5.9" + "illuminate/http": "5.3.*", + "illuminate/routing": "5.3.*", + "illuminate/session": "5.3.*", + "illuminate/support": "5.3.*", + "illuminate/view": "5.3.*", + "php": ">=5.6.4" }, "require-dev": { - "illuminate/database": "5.2.*", - "mockery/mockery": "~0.9", - "phpunit/phpunit": "~4.0" + "illuminate/database": "5.3.*", + "mockery/mockery": "~0.9.4", + "phpunit/phpunit": "~5.4" }, "type": "library", "autoload": { @@ -4289,7 +4314,7 @@ ], "description": "HTML and Form Builders for the Laravel Framework", "homepage": "http://laravelcollective.com", - "time": "2017-05-21 18:02:21" + "time": "2017-05-21 22:00:10" }, { "name": "league/flysystem", @@ -5166,7 +5191,7 @@ }, { "name": "mtdowling/cron-expression", - "version": "v1.2.0", + "version": "v1.2.1", "source": { "type": "git", "url": "https://github.com/mtdowling/cron-expression.git", @@ -5318,24 +5343,24 @@ }, { "name": "nikic/php-parser", - "version": "v2.1.1", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4dd659edadffdc2143e4753df655d866dbfeedf0" + "reference": "08131e7ff29de6bb9f12275c7d35df71f25f4d89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4dd659edadffdc2143e4753df655d866dbfeedf0", - "reference": "4dd659edadffdc2143e4753df655d866dbfeedf0", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/08131e7ff29de6bb9f12275c7d35df71f25f4d89", + "reference": "08131e7ff29de6bb9f12275c7d35df71f25f4d89", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.4" + "php": ">=5.5" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.0|~5.0" }, "bin": [ "bin/php-parse" @@ -5343,7 +5368,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -5365,7 +5390,7 @@ "parser", "php" ], - "time": "2016-09-16 12:04:44" + "time": "2017-11-04 11:48:34" }, { "name": "nwidart/laravel-modules", @@ -5439,12 +5464,12 @@ "source": { "type": "git", "url": "https://github.com/thephpleague/omnipay-2checkout.git", - "reference": "e9c079c2dde0d7ba461903b3b7bd5caf6dee1248" + "reference": "b27d2823d052f5c227eeb29324bb564cfdb8f9af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/omnipay-2checkout/zipball/e9c079c2dde0d7ba461903b3b7bd5caf6dee1248", - "reference": "e9c079c2dde0d7ba461903b3b7bd5caf6dee1248", + "url": "https://api.github.com/repos/thephpleague/omnipay-2checkout/zipball/b27d2823d052f5c227eeb29324bb564cfdb8f9af", + "reference": "b27d2823d052f5c227eeb29324bb564cfdb8f9af", "shasum": "" }, "require": { @@ -5490,7 +5515,7 @@ "payment", "twocheckout" ], - "time": "2014-09-17 00:35:37" + "time": "2016-03-25 10:39:58" }, { "name": "omnipay/authorizenet", @@ -5848,35 +5873,36 @@ }, { "name": "omnipay/common", - "version": "v2.3.4", + "version": "2.5.2", "source": { "type": "git", "url": "https://github.com/thephpleague/omnipay-common.git", - "reference": "fcd5a606713d11536c89315a5ae02d965a737c21" + "reference": "54910f2ece6b1be64f5e53e2111dd1254d50ee49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/omnipay-common/zipball/fcd5a606713d11536c89315a5ae02d965a737c21", - "reference": "fcd5a606713d11536c89315a5ae02d965a737c21", + "url": "https://api.github.com/repos/thephpleague/omnipay-common/zipball/54910f2ece6b1be64f5e53e2111dd1254d50ee49", + "reference": "54910f2ece6b1be64f5e53e2111dd1254d50ee49", "shasum": "" }, "require": { "guzzle/guzzle": "~3.9", "php": ">=5.3.2", - "symfony/http-foundation": "~2.1" + "symfony/http-foundation": "~2.1|~3.0" }, "require-dev": { - "omnipay/tests": "~2.0" + "omnipay/tests": "~2.0", + "squizlabs/php_codesniffer": "~1.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.5.x-dev" }, "gateways": [ "AuthorizeNet_AIM", "AuthorizeNet_SIM", - "Buckaroo", + "Buckaroo_CreditCard", "Buckaroo_Ideal", "Buckaroo_PayPal", "CardSave", @@ -5906,26 +5932,7 @@ "TargetPay_Directebanking", "TargetPay_Ideal", "TargetPay_Mrcash", - "TwoCheckout", - "WorldPay", - "Alipay Bank", - "AliPay Dual Func", - "Alipay Express", - "Alipay Mobile Express", - "Alipay Secured", - "Alipay Wap Express", - "Cybersource", - "DataCash", - "Ecopayz", - "Neteller", - "Pacnet", - "PaymentSense", - "Realex Remote", - "SecPay (PayPoint.net)", - "Sisow", - "Skrill", - "YandexMoney", - "YandexMoneyIndividual" + "WorldPay" ] }, "autoload": { @@ -5960,7 +5967,7 @@ "payment", "purchase" ], - "time": "2015-03-30 14:34:46" + "time": "2016-11-07 06:10:23" }, { "name": "omnipay/dummy", @@ -6078,16 +6085,16 @@ }, { "name": "omnipay/firstdata", - "version": "v2.3.0", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/thephpleague/omnipay-firstdata.git", - "reference": "e33826821db88d90886cad6c81a29452d3cf91a2" + "reference": "c0123a03bec861e0c00fa19772582dc3639fbb6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/omnipay-firstdata/zipball/e33826821db88d90886cad6c81a29452d3cf91a2", - "reference": "e33826821db88d90886cad6c81a29452d3cf91a2", + "url": "https://api.github.com/repos/thephpleague/omnipay-firstdata/zipball/c0123a03bec861e0c00fa19772582dc3639fbb6e", + "reference": "c0123a03bec861e0c00fa19772582dc3639fbb6e", "shasum": "" }, "require": { @@ -6132,7 +6139,7 @@ "pay", "payment" ], - "time": "2016-01-14 06:24:28" + "time": "2017-07-14 09:26:59" }, { "name": "omnipay/gocardless", @@ -6538,16 +6545,16 @@ }, { "name": "omnipay/omnipay", - "version": "2.3.2", + "version": "2.3.x-dev", "source": { "type": "git", "url": "https://github.com/thephpleague/omnipay.git", - "reference": "e9e6d95a2e7c3641ba31c985334d82e39dbd6078" + "reference": "cc04bd22b4149c94c52b002181d4993e4f8fe812" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/omnipay/zipball/e9e6d95a2e7c3641ba31c985334d82e39dbd6078", - "reference": "e9e6d95a2e7c3641ba31c985334d82e39dbd6078", + "url": "https://api.github.com/repos/thephpleague/omnipay/zipball/cc04bd22b4149c94c52b002181d4993e4f8fe812", + "reference": "cc04bd22b4149c94c52b002181d4993e4f8fe812", "shasum": "" }, "require": { @@ -6556,7 +6563,7 @@ "omnipay/buckaroo": "~2.0", "omnipay/cardsave": "~2.0", "omnipay/coinbase": "~2.0", - "omnipay/common": "~2.3.0", + "omnipay/common": "~2.3", "omnipay/dummy": "~2.0", "omnipay/eway": "~2.0", "omnipay/firstdata": "~2.0", @@ -6581,6 +6588,38 @@ "require-dev": { "omnipay/tests": "~2.0" }, + "suggest": { + "academe/omnipay-helcim": "Helcim", + "agmscode/omnipay-agms": "Agms", + "alfaproject/omnipay-neteller": "Neteller", + "alfaproject/omnipay-skrill": "Skrill", + "andreas22/omnipay-fasapay": "Fasapay", + "andylibrian/omnipay-veritrans": "Veritrans", + "cardgate/omnipay-cardgate": "CardGate", + "coatesap/omnipay-datacash": "DataCash", + "coatesap/omnipay-paymentsense": "PaymentSense", + "coatesap/omnipay-realex": "Realex", + "dabsquared/omnipay-cybersource-soap": "Cybersource SOAP", + "delatbabel/omnipay-fatzebra": "Fat Zebra", + "dercoder/omnipay-ecopayz": "ecoPayz", + "dercoder/omnipay-globalcloudpay": "Globalcloudpay", + "descubraomundo/omnipay-pagarme": "Pagar.me", + "dioscouri/omnipay-cybersource": "Cybersource", + "fotografde/omnipay-checkoutcom": "Checkout.com", + "fruitcakestudio/omnipay-sisow": "Sisow", + "igaponov/omnipay-wirecard": "Wirecard", + "justinbusschau/omnipay-secpay": "SecPay", + "lokielse/omnipay-alipay": "Alipay", + "lokielse/omnipay-global-alipay": "Global Alipay", + "lokielse/omnipay-unionpay": "UnionPay", + "lokielse/omnipay-wechatpay": "WechatPay", + "mfauveau/omnipay-nmi": "Network Merchants Inc. (NMI)", + "mfauveau/omnipay-pacnet": "Pacnet", + "omnipay/payu": "PayU", + "paypronl/omnipay-paypro": "PayPro", + "samvaughton/omnipay-barclays-epdq": "Barclays ePDQ", + "teaandcode/omnipay-worldpay-xml": "WorldPay XML Direct" + }, "type": "metapackage", "extra": { "branch-alias": { @@ -6596,6 +6635,10 @@ "name": "Adrian Macneil", "email": "adrian@adrianmacneil.com" }, + { + "name": "Kayla Daniels", + "email": "kayladnls@gmail.com" + }, { "name": "Omnipay Community", "homepage": "https://github.com/thephpleague/omnipay/graphs/contributors" @@ -6611,8 +6654,10 @@ "authorize.net", "buckaroo", "cardsave", + "checkoutcom", "coinbase", "commweb", + "cybersource", "dps", "egate", "eway", @@ -6628,12 +6673,15 @@ "multisafepay", "netaxept", "netbanx", + "pagarme", "pay", "payfast", "payflow", "payment", "paymentexpress", + "payone", "paypal", + "payu", "pin", "purchase", "rapid", @@ -6646,7 +6694,7 @@ "twocheckout", "worldpay" ], - "time": "2014-12-10 13:55:00" + "time": "2017-03-21 09:24:49" }, { "name": "omnipay/payfast", @@ -6707,16 +6755,16 @@ }, { "name": "omnipay/payflow", - "version": "v2.2.2", + "version": "v2.3", "source": { "type": "git", "url": "https://github.com/thephpleague/omnipay-payflow.git", - "reference": "8dbfaf9accc1c2b388c9ab89c4b30176396c973a" + "reference": "2348f82f7eda1e9fb991767d61a3534e4935e9ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/omnipay-payflow/zipball/8dbfaf9accc1c2b388c9ab89c4b30176396c973a", - "reference": "8dbfaf9accc1c2b388c9ab89c4b30176396c973a", + "url": "https://api.github.com/repos/thephpleague/omnipay-payflow/zipball/2348f82f7eda1e9fb991767d61a3534e4935e9ba", + "reference": "2348f82f7eda1e9fb991767d61a3534e4935e9ba", "shasum": "" }, "require": { @@ -6760,7 +6808,7 @@ "payflow", "payment" ], - "time": "2017-05-12 08:10:23" + "time": "2017-11-10 08:14:36" }, { "name": "omnipay/paymentexpress", @@ -7172,16 +7220,16 @@ }, { "name": "omnipay/worldpay", - "version": "v2.2.1", + "version": "v2.2.2", "source": { "type": "git", "url": "https://github.com/thephpleague/omnipay-worldpay.git", - "reference": "be0b5c31f5a0457b913281aa2d6072b62fd9e65c" + "reference": "522fbac76b1baa65cb62192fedff227fe37a8cf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/omnipay-worldpay/zipball/be0b5c31f5a0457b913281aa2d6072b62fd9e65c", - "reference": "be0b5c31f5a0457b913281aa2d6072b62fd9e65c", + "url": "https://api.github.com/repos/thephpleague/omnipay-worldpay/zipball/522fbac76b1baa65cb62192fedff227fe37a8cf0", + "reference": "522fbac76b1baa65cb62192fedff227fe37a8cf0", "shasum": "" }, "require": { @@ -7225,7 +7273,7 @@ "payment", "worldpay" ], - "time": "2017-06-15 07:04:25" + "time": "2017-10-23 08:31:50" }, { "name": "paragonie/constant_time_encoding", @@ -7291,16 +7339,16 @@ }, { "name": "paragonie/random_compat", - "version": "v1.4.2", + "version": "v2.0.11", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "965cdeb01fdcab7653253aa81d40441d261f1e66" + "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/965cdeb01fdcab7653253aa81d40441d261f1e66", - "reference": "965cdeb01fdcab7653253aa81d40441d261f1e66", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/5da4d3c796c275c55f057af5a643ae297d96b4d8", + "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8", "shasum": "" }, "require": { @@ -7335,7 +7383,7 @@ "pseudorandom", "random" ], - "time": "2017-03-13 16:22:52" + "time": "2017-09-27 21:40:39" }, { "name": "patricktalmadge/bootstrapper", @@ -7455,16 +7503,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "2.0.6", + "version": "2.0.7", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "34a7699e6f31b1ef4035ee36444407cecf9f56aa" + "reference": "f4b6a522dfa1fd1e477c9cfe5909d5b31f098c0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/34a7699e6f31b1ef4035ee36444407cecf9f56aa", - "reference": "34a7699e6f31b1ef4035ee36444407cecf9f56aa", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/f4b6a522dfa1fd1e477c9cfe5909d5b31f098c0b", + "reference": "f4b6a522dfa1fd1e477c9cfe5909d5b31f098c0b", "shasum": "" }, "require": { @@ -7543,7 +7591,7 @@ "x.509", "x509" ], - "time": "2017-06-05 06:31:10" + "time": "2017-10-23 05:04:54" }, { "name": "pragmarx/google2fa", @@ -7920,37 +7968,38 @@ }, { "name": "psy/psysh", - "version": "v0.7.2", + "version": "v0.8.14", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "e64e10b20f8d229cac76399e1f3edddb57a0f280" + "reference": "91e53c16560bdb8b9592544bb38429ae00d6baee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/e64e10b20f8d229cac76399e1f3edddb57a0f280", - "reference": "e64e10b20f8d229cac76399e1f3edddb57a0f280", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/91e53c16560bdb8b9592544bb38429ae00d6baee", + "reference": "91e53c16560bdb8b9592544bb38429ae00d6baee", "shasum": "" }, "require": { "dnoegel/php-xdg-base-dir": "0.1", "jakub-onderka/php-console-highlighter": "0.3.*", - "nikic/php-parser": "^1.2.1|~2.0", + "nikic/php-parser": "~1.3|~2.0|~3.0", "php": ">=5.3.9", "symfony/console": "~2.3.10|^2.4.2|~3.0", "symfony/var-dumper": "~2.7|~3.0" }, "require-dev": { - "fabpot/php-cs-fixer": "~1.5", - "phpunit/phpunit": "~3.7|~4.0|~5.0", - "squizlabs/php_codesniffer": "~2.0", + "friendsofphp/php-cs-fixer": "~1.11", + "hoa/console": "~3.16|~1.14", + "phpunit/phpunit": "~4.4|~5.0", "symfony/finder": "~2.1|~3.0" }, "suggest": { "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", "ext-pdo-sqlite": "The doc command requires SQLite to work.", "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", - "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history." + "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", + "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." }, "bin": [ "bin/psysh" @@ -7988,7 +8037,7 @@ "interactive", "shell" ], - "time": "2016-03-09 05:03:14" + "time": "2017-11-04 16:06:49" }, { "name": "rackspace/php-opencloud", @@ -8384,16 +8433,16 @@ }, { "name": "symfony/class-loader", - "version": "v3.3.10", + "version": "v3.3.11", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "7572c904b209fa9907c69a6a9a68243c265a4d01" + "reference": "df173ac2af96ce202bf8bb5a3fc0bec8a4fdd4d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/7572c904b209fa9907c69a6a9a68243c265a4d01", - "reference": "7572c904b209fa9907c69a6a9a68243c265a4d01", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/df173ac2af96ce202bf8bb5a3fc0bec8a4fdd4d1", + "reference": "df173ac2af96ce202bf8bb5a3fc0bec8a4fdd4d1", "shasum": "" }, "require": { @@ -8436,7 +8485,7 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2017-10-02 06:42:24" + "time": "2017-11-05 15:47:03" }, { "name": "symfony/config", @@ -8496,20 +8545,21 @@ }, { "name": "symfony/console", - "version": "v3.0.9", + "version": "v3.1.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "926061e74229e935d3c5b4e9ba87237316c6693f" + "reference": "047f16485d68c083bd5d9b73ff16f9cb9c1a9f52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/926061e74229e935d3c5b4e9ba87237316c6693f", - "reference": "926061e74229e935d3c5b4e9ba87237316c6693f", + "url": "https://api.github.com/repos/symfony/console/zipball/047f16485d68c083bd5d9b73ff16f9cb9c1a9f52", + "reference": "047f16485d68c083bd5d9b73ff16f9cb9c1a9f52", "shasum": "" }, "require": { "php": ">=5.5.9", + "symfony/debug": "~2.8|~3.0", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { @@ -8525,7 +8575,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -8552,20 +8602,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-07-30 07:22:48" + "time": "2017-01-08 20:43:43" }, { "name": "symfony/css-selector", - "version": "v3.3.10", + "version": "v3.3.11", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "07447650225ca9223bd5c97180fe7c8267f7d332" + "reference": "66e6e046032ebdf1f562c26928549f613d428bd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/07447650225ca9223bd5c97180fe7c8267f7d332", - "reference": "07447650225ca9223bd5c97180fe7c8267f7d332", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/66e6e046032ebdf1f562c26928549f613d428bd1", + "reference": "66e6e046032ebdf1f562c26928549f613d428bd1", "shasum": "" }, "require": { @@ -8605,20 +8655,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-10-02 06:42:24" + "time": "2017-11-05 15:47:03" }, { "name": "symfony/debug", - "version": "v3.0.9", + "version": "v3.1.10", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a" + "reference": "c6661361626b3cf5cf2089df98b3b5006a197e85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a", - "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a", + "url": "https://api.github.com/repos/symfony/debug/zipball/c6661361626b3cf5cf2089df98b3b5006a197e85", + "reference": "c6661361626b3cf5cf2089df98b3b5006a197e85", "shasum": "" }, "require": { @@ -8635,7 +8685,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -8662,7 +8712,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-07-30 07:22:48" + "time": "2017-01-28 00:04:57" }, { "name": "symfony/dependency-injection", @@ -8729,16 +8779,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.8.28", + "version": "v2.8.29", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "7fe089232554357efb8d4af65ce209fc6e5a2186" + "reference": "b59aacf238fadda50d612c9de73b74751872a903" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7fe089232554357efb8d4af65ce209fc6e5a2186", - "reference": "7fe089232554357efb8d4af65ce209fc6e5a2186", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b59aacf238fadda50d612c9de73b74751872a903", + "reference": "b59aacf238fadda50d612c9de73b74751872a903", "shasum": "" }, "require": { @@ -8785,20 +8835,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-10-01 21:00:16" + "time": "2017-11-05 15:25:56" }, { "name": "symfony/filesystem", - "version": "v3.3.10", + "version": "v3.3.11", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1" + "reference": "77db266766b54db3ee982fe51868328b887ce15c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/90bc45abf02ae6b7deb43895c1052cb0038506f1", - "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/77db266766b54db3ee982fe51868328b887ce15c", + "reference": "77db266766b54db3ee982fe51868328b887ce15c", "shasum": "" }, "require": { @@ -8834,20 +8884,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-10-03 13:33:10" + "time": "2017-11-07 14:12:55" }, { "name": "symfony/finder", - "version": "v3.0.9", + "version": "v3.1.10", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9" + "reference": "59687a255d1562f2c17b012418273862083d85f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", - "reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", + "url": "https://api.github.com/repos/symfony/finder/zipball/59687a255d1562f2c17b012418273862083d85f7", + "reference": "59687a255d1562f2c17b012418273862083d85f7", "shasum": "" }, "require": { @@ -8856,7 +8906,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -8883,35 +8933,33 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2016-06-29 05:40:00" + "time": "2017-01-02 20:31:54" }, { "name": "symfony/http-foundation", - "version": "v2.8.28", + "version": "v3.1.10", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "e6e0170e134bf25d03030b71a19ca409e036157a" + "reference": "cef0ad49a2e90455cfc649522025b5a2929648c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e6e0170e134bf25d03030b71a19ca409e036157a", - "reference": "e6e0170e134bf25d03030b71a19ca409e036157a", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/cef0ad49a2e90455cfc649522025b5a2929648c0", + "reference": "cef0ad49a2e90455cfc649522025b5a2929648c0", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php54": "~1.0", - "symfony/polyfill-php55": "~1.0" + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { - "symfony/expression-language": "~2.4|~3.0.0" + "symfony/expression-language": "~2.8|~3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -8938,20 +8986,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2017-10-05 23:06:47" + "time": "2017-01-08 20:43:43" }, { "name": "symfony/http-kernel", - "version": "v3.0.9", + "version": "v3.1.10", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3" + "reference": "c830387dec1b48c100473d10a6a356c3c3ae2a13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/d97ba4425e36e79c794e7d14ff36f00f081b37b3", - "reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/c830387dec1b48c100473d10a6a356c3c3ae2a13", + "reference": "c830387dec1b48c100473d10a6a356c3c3ae2a13", "shasum": "" }, "require": { @@ -8959,7 +9007,7 @@ "psr/log": "~1.0", "symfony/debug": "~2.8|~3.0", "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/http-foundation": "~2.8.8|~3.0.8|~3.1.2|~3.2" + "symfony/http-foundation": "~2.8.13|~3.1.6|~3.2" }, "conflict": { "symfony/config": "<2.8" @@ -8993,7 +9041,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -9020,20 +9068,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2016-07-30 09:10:37" + "time": "2017-01-28 02:53:17" }, { "name": "symfony/options-resolver", - "version": "v3.3.10", + "version": "v3.3.11", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "ee4e22978fe885b54ee5da8c7964f0a5301abfb6" + "reference": "623d9c210a137205f7e6e98166105625402cbb2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/ee4e22978fe885b54ee5da8c7964f0a5301abfb6", - "reference": "ee4e22978fe885b54ee5da8c7964f0a5301abfb6", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/623d9c210a137205f7e6e98166105625402cbb2f", + "reference": "623d9c210a137205f7e6e98166105625402cbb2f", "shasum": "" }, "require": { @@ -9074,7 +9122,7 @@ "configuration", "options" ], - "time": "2017-07-29 21:54:42" + "time": "2017-11-05 15:47:03" }, { "name": "symfony/polyfill-mbstring", @@ -9135,120 +9183,6 @@ ], "time": "2017-10-11 12:05:26" }, - { - "name": "symfony/polyfill-php54", - "version": "v1.6.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php54.git", - "reference": "d7810a14b2c6c1aff415e1bb755f611b3d5327bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/d7810a14b2c6c1aff415e1bb755f611b3d5327bc", - "reference": "d7810a14b2c6c1aff415e1bb755f611b3d5327bc", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php54\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2017-10-11 12:05:26" - }, - { - "name": "symfony/polyfill-php55", - "version": "v1.6.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php55.git", - "reference": "b64e7f0c37ecf144ecc16668936eef94e628fbfd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/b64e7f0c37ecf144ecc16668936eef94e628fbfd", - "reference": "b64e7f0c37ecf144ecc16668936eef94e628fbfd", - "shasum": "" - }, - "require": { - "ircmaxell/password-compat": "~1.0", - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php55\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2017-10-11 12:05:26" - }, { "name": "symfony/polyfill-php56", "version": "v1.6.0", @@ -9359,16 +9293,16 @@ }, { "name": "symfony/process", - "version": "v3.0.9", + "version": "v3.1.10", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "768debc5996f599c4372b322d9061dba2a4bf505" + "reference": "2605753c5f8c531623d24d002825ebb1d6a22248" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/768debc5996f599c4372b322d9061dba2a4bf505", - "reference": "768debc5996f599c4372b322d9061dba2a4bf505", + "url": "https://api.github.com/repos/symfony/process/zipball/2605753c5f8c531623d24d002825ebb1d6a22248", + "reference": "2605753c5f8c531623d24d002825ebb1d6a22248", "shasum": "" }, "require": { @@ -9377,7 +9311,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -9404,20 +9338,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-07-28 11:13:34" + "time": "2017-01-21 17:13:55" }, { "name": "symfony/routing", - "version": "v3.0.9", + "version": "v3.1.10", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "9038984bd9c05ab07280121e9e10f61a7231457b" + "reference": "f25581d4eb0a82962c291917f826166f0dcd8a9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/9038984bd9c05ab07280121e9e10f61a7231457b", - "reference": "9038984bd9c05ab07280121e9e10f61a7231457b", + "url": "https://api.github.com/repos/symfony/routing/zipball/f25581d4eb0a82962c291917f826166f0dcd8a9a", + "reference": "f25581d4eb0a82962c291917f826166f0dcd8a9a", "shasum": "" }, "require": { @@ -9446,7 +9380,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -9479,20 +9413,20 @@ "uri", "url" ], - "time": "2016-06-29 05:40:00" + "time": "2017-01-28 00:04:57" }, { "name": "symfony/translation", - "version": "v3.0.9", + "version": "v3.1.10", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26" + "reference": "d5a20fab5f63f44c233c69b3041c3cb1d4945e45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26", - "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26", + "url": "https://api.github.com/repos/symfony/translation/zipball/d5a20fab5f63f44c233c69b3041c3cb1d4945e45", + "reference": "d5a20fab5f63f44c233c69b3041c3cb1d4945e45", "shasum": "" }, "require": { @@ -9516,7 +9450,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -9543,20 +9477,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2016-07-30 07:22:48" + "time": "2017-01-21 17:01:39" }, { "name": "symfony/var-dumper", - "version": "v3.0.9", + "version": "v3.1.10", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "1f7e071aafc6676fcb6e3f0497f87c2397247377" + "reference": "16df11647e5b992d687cb4eeeb9a882d5f5c26b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1f7e071aafc6676fcb6e3f0497f87c2397247377", - "reference": "1f7e071aafc6676fcb6e3f0497f87c2397247377", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/16df11647e5b992d687cb4eeeb9a882d5f5c26b9", + "reference": "16df11647e5b992d687cb4eeeb9a882d5f5c26b9", "shasum": "" }, "require": { @@ -9572,7 +9506,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -9606,20 +9540,20 @@ "debug", "dump" ], - "time": "2016-07-26 08:03:56" + "time": "2017-01-24 13:02:38" }, { "name": "symfony/yaml", - "version": "v3.3.10", + "version": "v3.3.11", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46" + "reference": "0938408c4faa518d95230deabb5f595bf0de31b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", - "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", + "url": "https://api.github.com/repos/symfony/yaml/zipball/0938408c4faa518d95230deabb5f595bf0de31b9", + "reference": "0938408c4faa518d95230deabb5f595bf0de31b9", "shasum": "" }, "require": { @@ -9661,7 +9595,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-10-05 14:43:42" + "time": "2017-11-10 18:26:04" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -10758,22 +10692,22 @@ }, { "name": "zircote/swagger-php", - "version": "2.0.11", + "version": "2.0.12", "source": { "type": "git", "url": "https://github.com/zircote/swagger-php.git", - "reference": "d010ab67536784f8b578cb4ba7d15c906f3e1a45" + "reference": "5393727e0c2fe822252f82230a5975572ca32d45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zircote/swagger-php/zipball/d010ab67536784f8b578cb4ba7d15c906f3e1a45", - "reference": "d010ab67536784f8b578cb4ba7d15c906f3e1a45", + "url": "https://api.github.com/repos/zircote/swagger-php/zipball/5393727e0c2fe822252f82230a5975572ca32d45", + "reference": "5393727e0c2fe822252f82230a5975572ca32d45", "shasum": "" }, "require": { "doctrine/annotations": "*", "php": ">=5.6", - "symfony/finder": "*" + "symfony/finder": ">=2.2" }, "require-dev": { "phpunit/phpunit": ">=4.8 <=5.6", @@ -10816,7 +10750,7 @@ "rest", "service discovery" ], - "time": "2017-08-16 08:32:59" + "time": "2017-10-27 13:08:09" } ], "packages-dev": [ @@ -10881,16 +10815,16 @@ }, { "name": "codeception/c3", - "version": "2.0.12", + "version": "2.0.14", "source": { "type": "git", "url": "https://github.com/Codeception/c3.git", - "reference": "f08f20b0b6191f0c58be022c6f20d5b1cdc1004c" + "reference": "777e3b626d9a5ecdfea3eff3d3de437045b41c92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/c3/zipball/f08f20b0b6191f0c58be022c6f20d5b1cdc1004c", - "reference": "f08f20b0b6191f0c58be022c6f20d5b1cdc1004c", + "url": "https://api.github.com/repos/Codeception/c3/zipball/777e3b626d9a5ecdfea3eff3d3de437045b41c92", + "reference": "777e3b626d9a5ecdfea3eff3d3de437045b41c92", "shasum": "" }, "require": { @@ -10927,7 +10861,7 @@ "code coverage", "codecoverage" ], - "time": "2017-04-06 00:08:55" + "time": "2017-10-29 23:14:30" }, { "name": "codeception/codeception", @@ -11079,32 +11013,37 @@ }, { "name": "facebook/webdriver", - "version": "1.2.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/facebook/php-webdriver.git", - "reference": "af21de3ae5306a8ca0bcc02a19735dadc43e83f3" + "reference": "eadb0b7a7c3e6578185197fd40158b08c3164c83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/af21de3ae5306a8ca0bcc02a19735dadc43e83f3", - "reference": "af21de3ae5306a8ca0bcc02a19735dadc43e83f3", + "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/eadb0b7a7c3e6578185197fd40158b08c3164c83", + "reference": "eadb0b7a7c3e6578185197fd40158b08c3164c83", "shasum": "" }, "require": { "ext-curl": "*", - "php": "^5.5 || ~7.0" + "ext-zip": "*", + "php": "^5.5 || ~7.0", + "symfony/process": "^2.8 || ^3.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^1.11", + "friendsofphp/php-cs-fixer": "^2.0", "php-mock/php-mock-phpunit": "^1.1", "phpunit/phpunit": "4.6.* || ~5.0", + "satooshi/php-coveralls": "^1.0", "squizlabs/php_codesniffer": "^2.6" }, - "suggest": { - "phpdocumentor/phpdocumentor": "2.*" - }, "type": "library", + "extra": { + "branch-alias": { + "dev-community": "1.5-dev" + } + }, "autoload": { "psr-4": { "Facebook\\WebDriver\\": "lib/" @@ -11114,7 +11053,7 @@ "license": [ "Apache-2.0" ], - "description": "A PHP client for WebDriver", + "description": "A PHP client for Selenium WebDriver", "homepage": "https://github.com/facebook/php-webdriver", "keywords": [ "facebook", @@ -11122,7 +11061,7 @@ "selenium", "webdriver" ], - "time": "2016-10-14 15:16:51" + "time": "2017-04-28 14:54:49" }, { "name": "phpdocumentor/reflection-common", @@ -12240,16 +12179,16 @@ }, { "name": "symfony/browser-kit", - "version": "v3.3.10", + "version": "v3.3.11", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "317d5bdf0127f06db7ea294186132b4f5b036839" + "reference": "03f957cd24bf939524f07b8b910c89cfcad722a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/317d5bdf0127f06db7ea294186132b4f5b036839", - "reference": "317d5bdf0127f06db7ea294186132b4f5b036839", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/03f957cd24bf939524f07b8b910c89cfcad722a8", + "reference": "03f957cd24bf939524f07b8b910c89cfcad722a8", "shasum": "" }, "require": { @@ -12293,20 +12232,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-10-02 06:42:24" + "time": "2017-11-07 14:12:55" }, { "name": "symfony/dom-crawler", - "version": "v3.3.10", + "version": "v3.3.11", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "40dafd42d5dad7fe5ad4e958413d92a207522ac1" + "reference": "cebe3c068867956e012d9135282ba6a05d8a259e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/40dafd42d5dad7fe5ad4e958413d92a207522ac1", - "reference": "40dafd42d5dad7fe5ad4e958413d92a207522ac1", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/cebe3c068867956e012d9135282ba6a05d8a259e", + "reference": "cebe3c068867956e012d9135282ba6a05d8a259e", "shasum": "" }, "require": { @@ -12349,7 +12288,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-10-02 06:42:24" + "time": "2017-11-05 15:47:03" }, { "name": "webmozart/assert", @@ -12410,37 +12349,24 @@ "package": "omnipay/authorizenet" } ], - "minimum-stability": "stable", + "minimum-stability": "dev", "stability-flags": { - "dwolla/omnipay-dwolla": 20, - "alfaproject/omnipay-skrill": 20, + "invoiceninja/omnipay-collection": 20, "anahkiasen/former": 20, "chumper/datatable": 20, "codedge/laravel-selfupdater": 20, - "collizo4sky/omnipay-wepay": 20, - "delatbabel/omnipay-fatzebra": 20, - "dercoder/omnipay-paysafecard": 20, - "descubraomundo/omnipay-pagarme": 20, - "digitickets/omnipay-gocardlessv2": 20, - "dioscouri/omnipay-cybersource": 20, "gatepay/fedachdir": 20, - "incube8/omnipay-multicards": 20, "intervention/image": 20, "jlapp/swaggervel": 20, "laracasts/presenter": 20, - "meebio/omnipay-creditcall": 20, - "meebio/omnipay-secure-trading": 20, - "omnipay/2checkout": 20, - "omnipay/authorizenet": 20, - "omnipay/bitpay": 20, - "omnipay/braintree": 20, - "omnipay/gocardless": 20, - "omnipay/stripe": 20, "simshaun/recurr": 20, "webpatser/laravel-countries": 20, - "websight/l5-google-cloud-storage": 20 + "websight/l5-google-cloud-storage": 20, + "omnipay/authorizenet": 20, + "digitickets/omnipay-gocardlessv2": 20, + "collizo4sky/omnipay-wepay": 20 }, - "prefer-stable": false, + "prefer-stable": true, "prefer-lowest": false, "platform": { "php": ">=5.5.9", diff --git a/config/app.php b/config/app.php index 6ca510703771..adcd953d58e3 100644 --- a/config/app.php +++ b/config/app.php @@ -4,6 +4,8 @@ use App\Libraries\Utils; return [ + 'name' => env('APP_NAME', 'Invoice Ninja'), + /* |-------------------------------------------------------------------------- | Application Debug Mode @@ -139,6 +141,7 @@ return [ 'Illuminate\Validation\ValidationServiceProvider', 'Illuminate\View\ViewServiceProvider', 'Illuminate\Broadcasting\BroadcastServiceProvider', + 'Illuminate\Notifications\NotificationServiceProvider', /* * Additional Providers diff --git a/config/auth.php b/config/auth.php index 7b08fd473147..fce3eda0eb7d 100644 --- a/config/auth.php +++ b/config/auth.php @@ -39,10 +39,10 @@ return [ 'driver' => 'session', 'provider' => 'users', ], - + 'client' => [ 'driver' => 'session', - 'provider' => 'client', + 'provider' => 'clients', ], 'api' => [ @@ -73,8 +73,8 @@ return [ 'driver' => 'eloquent', 'model' => App\Models\User::class, ], - - 'client' => [ + + 'clients' => [ 'driver' => 'eloquent', 'model' => App\Models\Contact::class, ] @@ -102,16 +102,14 @@ return [ 'passwords' => [ 'users' => [ 'provider' => 'users', - 'email' => 'emails.password', 'table' => 'password_resets', 'expire' => 60, ], - 'client' => [ - 'provider' => 'client', - 'email' => 'emails.client_password', + 'clients' => [ + 'provider' => 'clients', 'table' => 'password_resets', 'expire' => 60, ], ], -]; \ No newline at end of file +]; diff --git a/resources/views/auth/password.blade.php b/resources/views/auth/passwords/email.blade.php similarity index 100% rename from resources/views/auth/password.blade.php rename to resources/views/auth/passwords/email.blade.php diff --git a/resources/views/auth/reset.blade.php b/resources/views/auth/passwords/reset.blade.php similarity index 100% rename from resources/views/auth/reset.blade.php rename to resources/views/auth/passwords/reset.blade.php diff --git a/resources/views/clientauth/login.blade.php b/resources/views/clientauth/login.blade.php index 07d5b7899b13..8835c6525bcb 100644 --- a/resources/views/clientauth/login.blade.php +++ b/resources/views/clientauth/login.blade.php @@ -2,7 +2,7 @@ @section('form') - @include('partials.warn_session', ['redirectTo' => '/client/sessionexpired']) + @include('partials.warn_session', ['redirectTo' => '/client/session_expired'])
diff --git a/resources/views/clientauth/password.blade.php b/resources/views/clientauth/passwords/email.blade.php similarity index 98% rename from resources/views/clientauth/password.blade.php rename to resources/views/clientauth/passwords/email.blade.php index 26fadf17a827..32bd361d1b95 100644 --- a/resources/views/clientauth/password.blade.php +++ b/resources/views/clientauth/passwords/email.blade.php @@ -1,7 +1,7 @@ @extends('login') @section('form') - @include('partials.warn_session', ['redirectTo' => '/client/sessionexpired']) + @include('partials.warn_session', ['redirectTo' => '/client/session_expired'])
{!! Former::open('client/recover_password')->addClass('form-signin') !!} diff --git a/resources/views/clientauth/reset.blade.php b/resources/views/clientauth/passwords/reset.blade.php similarity index 100% rename from resources/views/clientauth/reset.blade.php rename to resources/views/clientauth/passwords/reset.blade.php From c1adf2ca8582fd81e2c53909dc1f5864354ddea3 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 11:48:06 +0200 Subject: [PATCH 010/167] Working on L5.3 --- .../2014_10_13_054100_add_invoice_number_settings.php | 4 ++-- database/migrations/2016_04_16_103943_enterprise_plan.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/database/migrations/2014_10_13_054100_add_invoice_number_settings.php b/database/migrations/2014_10_13_054100_add_invoice_number_settings.php index c47f1b4835a0..26a33912d1fb 100644 --- a/database/migrations/2014_10_13_054100_add_invoice_number_settings.php +++ b/database/migrations/2014_10_13_054100_add_invoice_number_settings.php @@ -22,10 +22,10 @@ class AddInvoiceNumberSettings extends Migration }); // set initial counter value for accounts with invoices - $accounts = DB::table('accounts')->lists('id'); + $accounts = DB::table('accounts')->pluck('id'); foreach ($accounts as $accountId) { - $invoiceNumbers = DB::table('invoices')->where('account_id', $accountId)->lists('invoice_number'); + $invoiceNumbers = DB::table('invoices')->where('account_id', $accountId)->pluck('invoice_number'); $max = 0; foreach ($invoiceNumbers as $invoiceNumber) { diff --git a/database/migrations/2016_04_16_103943_enterprise_plan.php b/database/migrations/2016_04_16_103943_enterprise_plan.php index 15d75ef0777b..dfc808c71579 100644 --- a/database/migrations/2016_04_16_103943_enterprise_plan.php +++ b/database/migrations/2016_04_16_103943_enterprise_plan.php @@ -71,7 +71,7 @@ class EnterprisePlan extends Migration $query->whereNull('users.public_id'); $query->orWhere('users.public_id', '=', 0); }) - ->lists('users.account_id'); + ->pluck('users.account_id'); if (count($single_account_ids)) { foreach (Account::find($single_account_ids) as $account) { @@ -207,7 +207,7 @@ class EnterprisePlan extends Migration $query->whereNotNull('companies.plan_paid'); $query->orWhereNotNull('companies.trial_started'); }) - ->lists('companies.id'); + ->pluck('companies.id'); $company_ids = array_unique($company_ids); From 5ae5c30f4d6a3b61fbf7400ec58f89bced2909ec Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 14 Nov 2017 20:56:41 +1100 Subject: [PATCH 011/167] Stubs for Apple iOS subscription notifications (#1739) --- app/Http/Controllers/AccountApiController.php | 7 +++++++ app/Http/Middleware/ApiCheck.php | 3 ++- app/Http/routes.php | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/AccountApiController.php b/app/Http/Controllers/AccountApiController.php index a5f8af6adf2a..dc6c335cc887 100644 --- a/app/Http/Controllers/AccountApiController.php +++ b/app/Http/Controllers/AccountApiController.php @@ -247,4 +247,11 @@ class AccountApiController extends BaseAPIController return $this->errorResponse(['message' => 'Invalid credentials'], 401); } + + public function iosSubscriptionStatus() { + + //stubbed for iOS callbacks + + } + } diff --git a/app/Http/Middleware/ApiCheck.php b/app/Http/Middleware/ApiCheck.php index 2638323ee5e9..310ebaaf60aa 100644 --- a/app/Http/Middleware/ApiCheck.php +++ b/app/Http/Middleware/ApiCheck.php @@ -28,7 +28,8 @@ class ApiCheck { $loggingIn = $request->is('api/v1/login') || $request->is('api/v1/register') - || $request->is('api/v1/oauth_login'); + || $request->is('api/v1/oauth_login') + || $request->is('api/v1/ios_subscription_status'); $headers = Utils::getApiHeaders(); $hasApiSecret = false; diff --git a/app/Http/routes.php b/app/Http/routes.php index 8bf3ac11c412..728ce8fe6101 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -360,6 +360,7 @@ Route::group(['middleware' => ['lookup:api', 'api'], 'prefix' => 'api/v1'], func Route::resource('documents', 'DocumentAPIController'); Route::resource('vendors', 'VendorApiController'); Route::resource('expense_categories', 'ExpenseCategoryApiController'); + Route::post('ios_subscription_status', 'AccountApiController@iosSubscriptionStatus'); }); // Redirects for legacy links From c26a3c236b4b91f78c98bb1134dafe9cf9fd20b2 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 12:34:34 +0200 Subject: [PATCH 012/167] Added laravel/legacy-encrypter --- composer.json | 19 +++++++------- composer.lock | 68 +++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 68 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index 2f1d65f8751d..3f235974ef10 100644 --- a/composer.json +++ b/composer.json @@ -14,11 +14,6 @@ ], "require": { "php": ">=5.5.9", - "laravel/framework": "5.3.*", - "laravelcollective/bus": "5.3.*", - "laravelcollective/html": "5.3.*", - "symfony/css-selector": "~3.1", - "invoiceninja/omnipay-collection": "0.4@dev", "ext-gd": "*", "ext-gmp": "*", "anahkiasen/former": "4.0.*@dev", @@ -31,6 +26,8 @@ "cerdic/css-tidy": "~v1.5", "chumper/datatable": "dev-develop#04ef2bf", "codedge/laravel-selfupdater": "5.x-dev", + "collizo4sky/omnipay-wepay": "dev-address-fix", + "digitickets/omnipay-gocardlessv2": "dev-payment-fix", "doctrine/dbal": "2.5.x", "ezyang/htmlpurifier": "~v4.7", "fzaninotto/faker": "^1.5", @@ -38,29 +35,33 @@ "google/apiclient": "^2.0", "guzzlehttp/guzzle": "~6.0", "intervention/image": "dev-master", + "invoiceninja/omnipay-collection": "0.4@dev", "jaybizzle/laravel-crawler-detect": "1.*", "jlapp/swaggervel": "master-dev", "jonnyw/php-phantomjs": "4.*", "laracasts/presenter": "dev-master", + "laravel/framework": "5.3.*", + "laravel/legacy-encrypter": "^1.0", "laravel/socialite": "~2.0", + "laravelcollective/bus": "5.3.*", + "laravelcollective/html": "5.3.*", "league/flysystem-aws-s3-v3": "~1.0", "league/flysystem-rackspace": "~1.0", "league/fractal": "0.13.*", "maatwebsite/excel": "~2.0", "mpdf/mpdf": "6.1.3", "nwidart/laravel-modules": "^1.14", + "omnipay/authorizenet": "dev-solution-id as 2.5.0", "patricktalmadge/bootstrapper": "5.5.x", "pragmarx/google2fa-laravel": "^0.1.2", "predis/predis": "^1.1", "simshaun/recurr": "dev-master", + "symfony/css-selector": "~3.1", "turbo124/laravel-push-notification": "2.*", "webpatser/laravel-countries": "dev-master", "websight/l5-google-cloud-storage": "dev-master", "wepay/php-sdk": "^0.2", - "wildbit/laravel-postmark-provider": "3.0", - "omnipay/authorizenet": "dev-solution-id as 2.5.0", - "digitickets/omnipay-gocardlessv2": "dev-payment-fix", - "collizo4sky/omnipay-wepay": "dev-address-fix" + "wildbit/laravel-postmark-provider": "3.0" }, "require-dev": { "symfony/dom-crawler": "~3.1", diff --git a/composer.lock b/composer.lock index ba05d401973b..97946ba44fff 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "627f199185222a0ab01efcb55a0956de", - "content-hash": "4ec49f8cba7092b4c8294ea4c551de5f", + "hash": "4e21badbba68d5feb34f05eaa12ccfe1", + "content-hash": "2d294b7828cf14adaf1deeb66426acc3", "packages": [ { "name": "abdala/omnipay-pagseguro", @@ -862,7 +862,7 @@ ], "authors": [ { - "name": "CardGate", + "name": "Cardgate", "email": "tech@cardgate.com" }, { @@ -1014,7 +1014,7 @@ "laravel" ], "abandoned": "OpenSkill/Datatable", - "time": "2017-01-26 10:04:06" + "time": "2015-11-23 21:33:41" }, { "name": "classpreloader/classpreloader", @@ -2538,7 +2538,8 @@ "reference": "origin/master", "shasum": null }, - "type": "library" + "type": "library", + "time": "2016-05-12 12:00:45" }, { "name": "gocardless/gocardless-pro", @@ -4159,6 +4160,53 @@ ], "time": "2017-03-24 16:31:06" }, + { + "name": "laravel/legacy-encrypter", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/legacy-encrypter.git", + "reference": "4047fc1e6a9346501ba48ba3f79509534875dea3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/legacy-encrypter/zipball/4047fc1e6a9346501ba48ba3f79509534875dea3", + "reference": "4047fc1e6a9346501ba48ba3f79509534875dea3", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-openssl": "*", + "illuminate/contracts": "5.3.*", + "illuminate/support": "5.3.*", + "paragonie/random_compat": "~1.4|~2.0", + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\LegacyEncrypter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The legacy version of the Laravel mcrypt encrypter.", + "homepage": "http://laravel.com", + "time": "2016-08-03 21:22:03" + }, { "name": "laravel/socialite", "version": "v2.0.21", @@ -12351,20 +12399,20 @@ ], "minimum-stability": "dev", "stability-flags": { - "invoiceninja/omnipay-collection": 20, "anahkiasen/former": 20, "chumper/datatable": 20, "codedge/laravel-selfupdater": 20, + "collizo4sky/omnipay-wepay": 20, + "digitickets/omnipay-gocardlessv2": 20, "gatepay/fedachdir": 20, "intervention/image": 20, + "invoiceninja/omnipay-collection": 20, "jlapp/swaggervel": 20, "laracasts/presenter": 20, + "omnipay/authorizenet": 20, "simshaun/recurr": 20, "webpatser/laravel-countries": 20, - "websight/l5-google-cloud-storage": 20, - "omnipay/authorizenet": 20, - "digitickets/omnipay-gocardlessv2": 20, - "collizo4sky/omnipay-wepay": 20 + "websight/l5-google-cloud-storage": 20 }, "prefer-stable": true, "prefer-lowest": false, From 0d05042a15001fca29c0a8fe31286199086d8703 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 13:08:04 +0200 Subject: [PATCH 013/167] Add legacy option to updatekey --- app/Console/Commands/UpdateKey.php | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/app/Console/Commands/UpdateKey.php b/app/Console/Commands/UpdateKey.php index 5625822488a9..2ec8f4bc3bc5 100644 --- a/app/Console/Commands/UpdateKey.php +++ b/app/Console/Commands/UpdateKey.php @@ -7,11 +7,11 @@ use Symfony\Component\Console\Input\InputOption; use App\Models\AccountGateway; use App\Models\BankAccount; use Artisan; -use Crypt; use Illuminate\Encryption\Encrypter; +use Laravel\LegacyEncrypter\McryptEncrypter; /** - * Class PruneData. + * Class UpdateKey */ class UpdateKey extends Command { @@ -34,16 +34,29 @@ class UpdateKey extends Command exit; } + $legacy = false; + if ($this->option('legacy') == 'true') { + $legacy = new McryptEncrypter(env('APP_KEY')); + } + // load the current values $gatewayConfigs = []; $bankUsernames = []; foreach (AccountGateway::all() as $gateway) { - $gatewayConfigs[$gateway->id] = $gateway->getConfig(); + if ($legacy) { + $gatewayConfigs[$gateway->id] = json_decode($legacy->decrypt($gateway->config)); + } else { + $gatewayConfigs[$gateway->id] = $gateway->getConfig(); + } } foreach (BankAccount::all() as $bank) { - $bankUsernames[$bank->id] = $bank->getUsername(); + if ($legacy) { + $bankUsernames[$bank->id] = $legacy->decrypt($bank->username); + } else { + $bankUsernames[$bank->id] = $bank->getUsername(); + } } // check if we can write to the .env file @@ -92,6 +105,8 @@ class UpdateKey extends Command */ protected function getOptions() { - return []; + return [ + ['legacy', null, InputOption::VALUE_OPTIONAL, 'Legacy', null], + ]; } } From d860a4ef1b5f43179270963937a2096ff96fc533 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 13:16:25 +0200 Subject: [PATCH 014/167] working on tests --- .travis.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 33fed981d380..ab20f68bfb5b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,20 +74,20 @@ before_script: - php artisan db:seed --no-interaction --class=UserTableSeeder # development seed script: - - php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance ExpenseCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance QuoteCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance OnlinePaymentCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance GatewayFeesCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance ExpenseCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance QuoteCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance OnlinePaymentCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance GatewayFeesCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php #- sed -i 's/NINJA_DEV=true/NINJA_PROD=true/g' .env #- php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php From 3662bb11b0eb8c976e8dabd096aa8c945ec50cee Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 13:24:33 +0200 Subject: [PATCH 015/167] Working on tests --- .travis.yml | 4 ++-- app/Http/Middleware/StartupCheck.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ab20f68bfb5b..1950888d8aef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -75,9 +75,9 @@ before_script: script: #- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance ExpenseCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php diff --git a/app/Http/Middleware/StartupCheck.php b/app/Http/Middleware/StartupCheck.php index 5db83b89b0c0..9862b2ba3fb6 100644 --- a/app/Http/Middleware/StartupCheck.php +++ b/app/Http/Middleware/StartupCheck.php @@ -191,6 +191,7 @@ class StartupCheck Session::flash('message', 'Cache cleared'); } foreach ($cachedTables as $name => $class) { + \Log::info("Cache for {$name} is " . (Cache::has($name) ? 'SET' : 'NOT SET')); if (Input::has('clear_cache') || ! Cache::has($name)) { // check that the table exists in case the migration is pending if (! Schema::hasTable((new $class())->getTable())) { @@ -207,6 +208,7 @@ class StartupCheck } $tableData = $class::orderBy($orderBy)->get(); if (count($tableData)) { + \Log::info("Setting cache for {$name}"); Cache::forever($name, $tableData); } } From dae38e31072505f15f125a3aeda63ce0d4487251 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 13:29:43 +0200 Subject: [PATCH 016/167] New vendor publish files --- .../notifications/email-plain.blade.php | 22 ++ .../vendor/notifications/email.blade.php | 192 ++++++++++++++++++ .../vendor/pagination/bootstrap-4.blade.php | 36 ++++ .../views/vendor/pagination/default.blade.php | 36 ++++ .../pagination/simple-bootstrap-4.blade.php | 17 ++ .../pagination/simple-default.blade.php | 17 ++ 6 files changed, 320 insertions(+) create mode 100644 resources/views/vendor/notifications/email-plain.blade.php create mode 100644 resources/views/vendor/notifications/email.blade.php create mode 100644 resources/views/vendor/pagination/bootstrap-4.blade.php create mode 100644 resources/views/vendor/pagination/default.blade.php create mode 100644 resources/views/vendor/pagination/simple-bootstrap-4.blade.php create mode 100644 resources/views/vendor/pagination/simple-default.blade.php diff --git a/resources/views/vendor/notifications/email-plain.blade.php b/resources/views/vendor/notifications/email-plain.blade.php new file mode 100644 index 000000000000..acefa652383d --- /dev/null +++ b/resources/views/vendor/notifications/email-plain.blade.php @@ -0,0 +1,22 @@ + + + + + + + + + + + 'margin: 0; padding: 0; width: 100%; background-color: #F2F4F6;', + 'email-wrapper' => 'width: 100%; margin: 0; padding: 0; background-color: #F2F4F6;', + + /* Masthead ----------------------- */ + + 'email-masthead' => 'padding: 25px 0; text-align: center;', + 'email-masthead_name' => 'font-size: 16px; font-weight: bold; color: #2F3133; text-decoration: none; text-shadow: 0 1px 0 white;', + + 'email-body' => 'width: 100%; margin: 0; padding: 0; border-top: 1px solid #EDEFF2; border-bottom: 1px solid #EDEFF2; background-color: #FFF;', + 'email-body_inner' => 'width: auto; max-width: 570px; margin: 0 auto; padding: 0;', + 'email-body_cell' => 'padding: 35px;', + + 'email-footer' => 'width: auto; max-width: 570px; margin: 0 auto; padding: 0; text-align: center;', + 'email-footer_cell' => 'color: #AEAEAE; padding: 35px; text-align: center;', + + /* Body ------------------------------ */ + + 'body_action' => 'width: 100%; margin: 30px auto; padding: 0; text-align: center;', + 'body_sub' => 'margin-top: 25px; padding-top: 25px; border-top: 1px solid #EDEFF2;', + + /* Type ------------------------------ */ + + 'anchor' => 'color: #3869D4;', + 'header-1' => 'margin-top: 0; color: #2F3133; font-size: 19px; font-weight: bold; text-align: left;', + 'paragraph' => 'margin-top: 0; color: #74787E; font-size: 16px; line-height: 1.5em;', + 'paragraph-sub' => 'margin-top: 0; color: #74787E; font-size: 12px; line-height: 1.5em;', + 'paragraph-center' => 'text-align: center;', + + /* Buttons ------------------------------ */ + + 'button' => 'display: block; display: inline-block; width: 200px; min-height: 20px; padding: 10px; + background-color: #3869D4; border-radius: 3px; color: #ffffff; font-size: 15px; line-height: 25px; + text-align: center; text-decoration: none; -webkit-text-size-adjust: none;', + + 'button--green' => 'background-color: #22BC66;', + 'button--red' => 'background-color: #dc4d2f;', + 'button--blue' => 'background-color: #3869D4;', +]; +?> + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + {{ config('app.name') }} + +
+ + + + +
+ +

+ @if (! empty($greeting)) + {{ $greeting }} + @else + @if ($level == 'error') + Whoops! + @else + Hello! + @endif + @endif +

+ + + @foreach ($introLines as $line) +

+ {{ $line }} +

+ @endforeach + + + @if (isset($actionText)) + + + + +
+ + + + {{ $actionText }} + +
+ @endif + + + @foreach ($outroLines as $line) +

+ {{ $line }} +

+ @endforeach + + +

+ Regards,
{{ config('app.name') }} +

+ + + @if (isset($actionText)) + + + + +
+

+ If you’re having trouble clicking the "{{ $actionText }}" button, + copy and paste the URL below into your web browser: +

+ +

+ + {{ $actionUrl }} + +

+
+ @endif +
+
+ + + + +
+

+ © {{ date('Y') }} + {{ config('app.name') }}. + All rights reserved. +

+
+
+
+ + diff --git a/resources/views/vendor/pagination/bootstrap-4.blade.php b/resources/views/vendor/pagination/bootstrap-4.blade.php new file mode 100644 index 000000000000..3f984557b48a --- /dev/null +++ b/resources/views/vendor/pagination/bootstrap-4.blade.php @@ -0,0 +1,36 @@ +@if ($paginator->hasPages()) +
    + {{-- Previous Page Link --}} + @if ($paginator->onFirstPage()) +
  • «
  • + @else +
  • + @endif + + {{-- Pagination Elements --}} + @foreach ($elements as $element) + {{-- "Three Dots" Separator --}} + @if (is_string($element)) +
  • {{ $element }}
  • + @endif + + {{-- Array Of Links --}} + @if (is_array($element)) + @foreach ($element as $page => $url) + @if ($page == $paginator->currentPage()) +
  • {{ $page }}
  • + @else +
  • {{ $page }}
  • + @endif + @endforeach + @endif + @endforeach + + {{-- Next Page Link --}} + @if ($paginator->hasMorePages()) +
  • + @else +
  • »
  • + @endif +
+@endif diff --git a/resources/views/vendor/pagination/default.blade.php b/resources/views/vendor/pagination/default.blade.php new file mode 100644 index 000000000000..4e795ff41a9c --- /dev/null +++ b/resources/views/vendor/pagination/default.blade.php @@ -0,0 +1,36 @@ +@if ($paginator->hasPages()) +
    + {{-- Previous Page Link --}} + @if ($paginator->onFirstPage()) +
  • «
  • + @else +
  • + @endif + + {{-- Pagination Elements --}} + @foreach ($elements as $element) + {{-- "Three Dots" Separator --}} + @if (is_string($element)) +
  • {{ $element }}
  • + @endif + + {{-- Array Of Links --}} + @if (is_array($element)) + @foreach ($element as $page => $url) + @if ($page == $paginator->currentPage()) +
  • {{ $page }}
  • + @else +
  • {{ $page }}
  • + @endif + @endforeach + @endif + @endforeach + + {{-- Next Page Link --}} + @if ($paginator->hasMorePages()) +
  • + @else +
  • »
  • + @endif +
+@endif diff --git a/resources/views/vendor/pagination/simple-bootstrap-4.blade.php b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php new file mode 100644 index 000000000000..98653d31ae7e --- /dev/null +++ b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php @@ -0,0 +1,17 @@ +@if ($paginator->hasPages()) +
    + {{-- Previous Page Link --}} + @if ($paginator->onFirstPage()) +
  • «
  • + @else +
  • + @endif + + {{-- Next Page Link --}} + @if ($paginator->hasMorePages()) +
  • + @else +
  • »
  • + @endif +
+@endif diff --git a/resources/views/vendor/pagination/simple-default.blade.php b/resources/views/vendor/pagination/simple-default.blade.php new file mode 100644 index 000000000000..cf53b8971b4a --- /dev/null +++ b/resources/views/vendor/pagination/simple-default.blade.php @@ -0,0 +1,17 @@ +@if ($paginator->hasPages()) +
    + {{-- Previous Page Link --}} + @if ($paginator->onFirstPage()) +
  • «
  • + @else +
  • + @endif + + {{-- Next Page Link --}} + @if ($paginator->hasMorePages()) +
  • + @else +
  • »
  • + @endif +
+@endif From 4d5a26f6e11de1e84ed8ed80d26d048dc37541e7 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 13:36:03 +0200 Subject: [PATCH 017/167] Working on tests --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1950888d8aef..70cf6a74dbb7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -114,6 +114,8 @@ after_script: - mysql -u root -e 'select * from credits;' ninja - mysql -u root -e 'select * from expenses;' ninja - mysql -u root -e 'select * from accounts;' ninja + - mysql -u root -e 'select * from fonts;' ninja + - mysql -u root -e 'select * from banks;' ninja - cat storage/logs/laravel-error.log - cat storage/logs/laravel-info.log - FILES=$(find tests/_output -type f -name '*.png' | sort -nr) From 9d80deca9c6b7fbd848a807ebcb46d3ba835b3f8 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 14:04:31 +0200 Subject: [PATCH 018/167] working on tests --- database/seeds/BanksSeeder.php | 2 +- database/seeds/FontsSeeder.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/database/seeds/BanksSeeder.php b/database/seeds/BanksSeeder.php index 894cb74609c9..85f13ca491f2 100644 --- a/database/seeds/BanksSeeder.php +++ b/database/seeds/BanksSeeder.php @@ -21,7 +21,7 @@ class BanksSeeder extends Seeder $banks = json_decode($banks); foreach ($banks as $bank) { - if (! DB::table('banks')->where('remote_id', '=', $bank->id)->get()) { + if (! DB::table('banks')->where('remote_id', '=', $bank->id)->count()) { if (! isset($bank->fid) || ! isset($bank->org)) { continue; } diff --git a/database/seeds/FontsSeeder.php b/database/seeds/FontsSeeder.php index c1b569b57c97..ebb097a82d1a 100644 --- a/database/seeds/FontsSeeder.php +++ b/database/seeds/FontsSeeder.php @@ -245,7 +245,7 @@ class FontsSeeder extends Seeder ]; foreach ($fonts as $font) { - if (! DB::table('fonts')->where('name', '=', $font['name'])->get()) { + if (! DB::table('fonts')->where('name', '=', $font['name'])->count()) { Font::create($font); } } From 0649f2a3310be399c00ad9cce73608380f23cbb8 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 14:14:25 +0200 Subject: [PATCH 019/167] Working on tests... --- .travis.yml | 26 +++++++++++++------------- app/Http/Middleware/StartupCheck.php | 2 -- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 70cf6a74dbb7..91a6651bf13f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,20 +74,20 @@ before_script: - php artisan db:seed --no-interaction --class=UserTableSeeder # development seed script: - #- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance ExpenseCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance QuoteCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance OnlinePaymentCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance GatewayFeesCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance ExpenseCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance QuoteCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance OnlinePaymentCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance GatewayFeesCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php #- sed -i 's/NINJA_DEV=true/NINJA_PROD=true/g' .env #- php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php diff --git a/app/Http/Middleware/StartupCheck.php b/app/Http/Middleware/StartupCheck.php index 9862b2ba3fb6..5db83b89b0c0 100644 --- a/app/Http/Middleware/StartupCheck.php +++ b/app/Http/Middleware/StartupCheck.php @@ -191,7 +191,6 @@ class StartupCheck Session::flash('message', 'Cache cleared'); } foreach ($cachedTables as $name => $class) { - \Log::info("Cache for {$name} is " . (Cache::has($name) ? 'SET' : 'NOT SET')); if (Input::has('clear_cache') || ! Cache::has($name)) { // check that the table exists in case the migration is pending if (! Schema::hasTable((new $class())->getTable())) { @@ -208,7 +207,6 @@ class StartupCheck } $tableData = $class::orderBy($orderBy)->get(); if (count($tableData)) { - \Log::info("Setting cache for {$name}"); Cache::forever($name, $tableData); } } From 5c7fcdd4177365d9d6af863d0b1f0b8824a9c21b Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 14:24:50 +0200 Subject: [PATCH 020/167] Fixed Postmark --- composer.json | 2 +- composer.lock | 164 +++++++++++++++++++++++++++----------------------- 2 files changed, 90 insertions(+), 76 deletions(-) diff --git a/composer.json b/composer.json index 3f235974ef10..d4b3dad2fac5 100644 --- a/composer.json +++ b/composer.json @@ -61,7 +61,7 @@ "webpatser/laravel-countries": "dev-master", "websight/l5-google-cloud-storage": "dev-master", "wepay/php-sdk": "^0.2", - "wildbit/laravel-postmark-provider": "3.0" + "wildbit/laravel-postmark-provider": "dev-master#134f359" }, "require-dev": { "symfony/dom-crawler": "~3.1", diff --git a/composer.lock b/composer.lock index 97946ba44fff..82604aefd251 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "4e21badbba68d5feb34f05eaa12ccfe1", - "content-hash": "2d294b7828cf14adaf1deeb66426acc3", + "hash": "f2043c8ce923c8af3c99ba7c5bcf5d5e", + "content-hash": "dbc2b358c79e0abe0a58d2bd02310966", "packages": [ { "name": "abdala/omnipay-pagseguro", @@ -1747,21 +1747,21 @@ }, { "name": "doctrine/annotations", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" + "reference": "5beebb01b025c94e93686b7a0ed3edae81fe3e7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/5beebb01b025c94e93686b7a0ed3edae81fe3e7f", + "reference": "5beebb01b025c94e93686b7a0ed3edae81fe3e7f", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "require-dev": { "doctrine/cache": "1.*", @@ -1770,7 +1770,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.5.x-dev" } }, "autoload": { @@ -1811,37 +1811,41 @@ "docblock", "parser" ], - "time": "2017-02-24 16:22:25" + "time": "2017-07-22 10:58:02" }, { "name": "doctrine/cache", - "version": "v1.6.2", + "version": "v1.7.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b" + "reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/eb152c5100571c7a45470ff2a35095ab3f3b900b", - "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b", + "url": "https://api.github.com/repos/doctrine/cache/zipball/b3217d58609e9c8e661cd41357a54d926c4a2a1a", + "reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a", "shasum": "" }, "require": { - "php": "~5.5|~7.0" + "php": "~7.1" }, "conflict": { "doctrine/common": ">2.2,<2.4" }, "require-dev": { - "phpunit/phpunit": "~4.8|~5.0", - "predis/predis": "~1.0", - "satooshi/php-coveralls": "~0.6" + "alcaeus/mongo-php-adapter": "^1.1", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^5.7", + "predis/predis": "~1.0" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -1881,24 +1885,24 @@ "cache", "caching" ], - "time": "2017-07-22 12:49:21" + "time": "2017-08-25 07:02:50" }, { "name": "doctrine/collections", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba" + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba", - "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba", + "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf", + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "require-dev": { "doctrine/coding-standard": "~0.1@dev", @@ -1948,7 +1952,7 @@ "collections", "iterator" ], - "time": "2017-01-03 10:49:41" + "time": "2017-07-22 10:37:32" }, { "name": "doctrine/common", @@ -2539,7 +2543,7 @@ "shasum": null }, "type": "library", - "time": "2016-05-12 12:00:45" + "time": "2017-11-13 12:00:28" }, { "name": "gocardless/gocardless-pro", @@ -2654,16 +2658,16 @@ }, { "name": "google/apiclient-services", - "version": "v0.33", + "version": "v0.34", "source": { "type": "git", "url": "https://github.com/google/google-api-php-client-services.git", - "reference": "6399eb82c725aef79124cd6b543e1984cd13d207" + "reference": "4d0d438e323929579cabf0b4d420177a96835c6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/google-api-php-client-services/zipball/6399eb82c725aef79124cd6b543e1984cd13d207", - "reference": "6399eb82c725aef79124cd6b543e1984cd13d207", + "url": "https://api.github.com/repos/google/google-api-php-client-services/zipball/4d0d438e323929579cabf0b4d420177a96835c6d", + "reference": "4d0d438e323929579cabf0b4d420177a96835c6d", "shasum": "" }, "require": { @@ -2687,7 +2691,7 @@ "keywords": [ "google" ], - "time": "2017-11-06 00:24:21" + "time": "2017-11-11 00:27:24" }, { "name": "google/auth", @@ -2941,16 +2945,16 @@ }, { "name": "google/protobuf", - "version": "v3.4.1", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/google/protobuf.git", - "reference": "b04e5cba356212e4e8c66c61bbe0c3a20537c5b9" + "reference": "2761122b810fe8861004ae785cc3ab39f384d342" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/protobuf/zipball/b04e5cba356212e4e8c66c61bbe0c3a20537c5b9", - "reference": "b04e5cba356212e4e8c66c61bbe0c3a20537c5b9", + "url": "https://api.github.com/repos/google/protobuf/zipball/2761122b810fe8861004ae785cc3ab39f384d342", + "reference": "2761122b810fe8861004ae785cc3ab39f384d342", "shasum": "" }, "require": { @@ -2978,7 +2982,7 @@ "keywords": [ "proto" ], - "time": "2017-09-14 19:24:28" + "time": "2017-11-13 18:47:29" }, { "name": "grpc/grpc", @@ -3533,23 +3537,32 @@ }, { "name": "jakoch/phantomjs-installer", - "version": "2.1.1", + "version": "2.1.1-p08", "source": { "type": "git", "url": "https://github.com/jakoch/phantomjs-installer.git", - "reference": "b8ee2aac9b95f9a9ee30a05a4df4a0984a8a8b85" + "reference": "7775820cf5eae8962cf68ab44757238e4d3136cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jakoch/phantomjs-installer/zipball/b8ee2aac9b95f9a9ee30a05a4df4a0984a8a8b85", - "reference": "b8ee2aac9b95f9a9ee30a05a4df4a0984a8a8b85", + "url": "https://api.github.com/repos/jakoch/phantomjs-installer/zipball/7775820cf5eae8962cf68ab44757238e4d3136cc", + "reference": "7775820cf5eae8962cf68ab44757238e4d3136cc", "shasum": "" }, "require": { - "ext-openssl": "*" + "ext-bz2": "*", + "ext-openssl": "*", + "php": ">5.3" + }, + "require-dev": { + "composer/composer": "^1.2", + "phpunit/phpunit": "^4.8" }, "type": "custom-installer", "autoload": { + "psr-4": { + "PhantomInstaller\\Test\\": "tests/" + }, "psr-0": { "PhantomInstaller\\": "src/" } @@ -3570,7 +3583,7 @@ "headless", "phantomjs" ], - "time": "2016-01-25 16:30:30" + "time": "2017-01-10 09:56:38" }, { "name": "jakub-onderka/php-console-color", @@ -3877,20 +3890,20 @@ }, { "name": "jonnyw/php-phantomjs", - "version": "v4.5.1", + "version": "v4.6.0", "source": { "type": "git", "url": "https://github.com/jonnnnyw/php-phantomjs.git", - "reference": "cf8d9a221f4c624aa1537c55a2e181f4b50367d7" + "reference": "b3c3e20857caf9a36eb90fb1a7cf1e1f1ec4b672" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jonnnnyw/php-phantomjs/zipball/cf8d9a221f4c624aa1537c55a2e181f4b50367d7", - "reference": "cf8d9a221f4c624aa1537c55a2e181f4b50367d7", + "url": "https://api.github.com/repos/jonnnnyw/php-phantomjs/zipball/b3c3e20857caf9a36eb90fb1a7cf1e1f1ec4b672", + "reference": "b3c3e20857caf9a36eb90fb1a7cf1e1f1ec4b672", "shasum": "" }, "require": { - "jakoch/phantomjs-installer": "2.1.1", + "jakoch/phantomjs-installer": "2.1.1-p08", "php": ">=5.3.0", "symfony/config": "~2.3|~3.0", "symfony/dependency-injection": "~2.3|~3.0", @@ -3929,7 +3942,7 @@ "phantomjs", "testing" ], - "time": "2016-06-28 16:00:15" + "time": "2017-04-22 21:24:02" }, { "name": "justinbusschau/omnipay-secpay", @@ -8325,12 +8338,12 @@ "source": { "type": "git", "url": "https://github.com/simshaun/recurr.git", - "reference": "7d0e8942cb1d00d4bc11d5eb87fa990d77b0de61" + "reference": "7679f92be8e6046c40668b34dbf87000e4ab430f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simshaun/recurr/zipball/7d0e8942cb1d00d4bc11d5eb87fa990d77b0de61", - "reference": "7d0e8942cb1d00d4bc11d5eb87fa990d77b0de61", + "url": "https://api.github.com/repos/simshaun/recurr/zipball/7679f92be8e6046c40668b34dbf87000e4ab430f", + "reference": "7679f92be8e6046c40668b34dbf87000e4ab430f", "shasum": "" }, "require": { @@ -8371,7 +8384,7 @@ "recurring", "rrule" ], - "time": "2017-08-03 23:25:58" + "time": "2017-11-13 18:18:52" }, { "name": "softcommerce/omnipay-paytrace", @@ -8481,7 +8494,7 @@ }, { "name": "symfony/class-loader", - "version": "v3.3.11", + "version": "v3.3.12", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", @@ -8654,7 +8667,7 @@ }, { "name": "symfony/css-selector", - "version": "v3.3.11", + "version": "v3.3.12", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -8827,7 +8840,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.8.29", + "version": "v2.8.30", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -8887,7 +8900,7 @@ }, { "name": "symfony/filesystem", - "version": "v3.3.11", + "version": "v3.3.12", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -9120,7 +9133,7 @@ }, { "name": "symfony/options-resolver", - "version": "v3.3.11", + "version": "v3.3.12", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", @@ -9592,7 +9605,7 @@ }, { "name": "symfony/yaml", - "version": "v3.3.11", + "version": "v3.3.12", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -10220,16 +10233,16 @@ }, { "name": "wildbit/laravel-postmark-provider", - "version": "3.0.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/wildbit/laravel-postmark-provider.git", - "reference": "b80815602f618abe24030ea6d3f117da49a72885" + "reference": "134f359" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wildbit/laravel-postmark-provider/zipball/b80815602f618abe24030ea6d3f117da49a72885", - "reference": "b80815602f618abe24030ea6d3f117da49a72885", + "url": "https://api.github.com/repos/wildbit/laravel-postmark-provider/zipball/134f359", + "reference": "134f359", "shasum": "" }, "require": { @@ -10247,7 +10260,7 @@ "MIT" ], "description": "An officially supported mail provider to send mail from Laravel through Postmark, see instructions for integrating it here: https://github.com/wildbit/laravel-postmark-provider/blob/master/README.md", - "time": "2016-02-10 14:15:58" + "time": "2017-01-19 19:52:38" }, { "name": "wildbit/swiftmailer-postmark", @@ -11007,32 +11020,32 @@ }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -11057,7 +11070,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2017-07-22 11:58:36" }, { "name": "facebook/webdriver", @@ -12227,7 +12240,7 @@ }, { "name": "symfony/browser-kit", - "version": "v3.3.11", + "version": "v3.3.12", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", @@ -12284,7 +12297,7 @@ }, { "name": "symfony/dom-crawler", - "version": "v3.3.11", + "version": "v3.3.12", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", @@ -12412,7 +12425,8 @@ "omnipay/authorizenet": 20, "simshaun/recurr": 20, "webpatser/laravel-countries": 20, - "websight/l5-google-cloud-storage": 20 + "websight/l5-google-cloud-storage": 20, + "wildbit/laravel-postmark-provider": 20 }, "prefer-stable": true, "prefer-lowest": false, From b1bd223cabb6ae60160218c5ac4d3d5f6c3778a8 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 15:58:50 +0200 Subject: [PATCH 021/167] Fix for login page --- app/Http/Controllers/Auth/LoginController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 9145743d015c..aff9502a31f9 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -10,6 +10,7 @@ use Illuminate\Foundation\Auth\AuthenticatesUsers; use Illuminate\Contracts\Auth\Authenticatable; use Event; use Cache; +use Lang; use App\Events\UserLoggedIn; use App\Http\Requests\ValidateTwoFactorRequest; @@ -186,7 +187,7 @@ class LoginController extends Controller $reason = htmlentities(request()->reason); if (!empty($reason) && Lang::has("texts.{$reason}_logout")) { - sesion()->flash('warning', trans("texts.{$reason}_logout")); + session()->flash('warning', trans("texts.{$reason}_logout")); } return $response; From 435fd5b89ea4618d390eeb7e040b5854c817db3a Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 16:04:29 +0200 Subject: [PATCH 022/167] Update version --- app/Constants.php | 2 +- docs/conf.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Constants.php b/app/Constants.php index 1a82695a2574..b1634af99de4 100644 --- a/app/Constants.php +++ b/app/Constants.php @@ -310,7 +310,7 @@ if (! defined('APP_NAME')) { define('NINJA_APP_URL', env('NINJA_APP_URL', 'https://app.invoiceninja.com')); define('NINJA_DOCS_URL', env('NINJA_DOCS_URL', 'http://docs.invoiceninja.com/en/latest')); define('NINJA_DATE', '2000-01-01'); - define('NINJA_VERSION', '3.9.0' . env('NINJA_VERSION_SUFFIX')); + define('NINJA_VERSION', '3.9.1' . env('NINJA_VERSION_SUFFIX')); define('SOCIAL_LINK_FACEBOOK', env('SOCIAL_LINK_FACEBOOK', 'https://www.facebook.com/invoiceninja')); define('SOCIAL_LINK_TWITTER', env('SOCIAL_LINK_TWITTER', 'https://twitter.com/invoiceninja')); diff --git a/docs/conf.py b/docs/conf.py index 35f226f87d61..8e400cae5317 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -59,7 +59,7 @@ author = u'Invoice Ninja' # The short X.Y version. version = u'3.9' # The full version, including alpha/beta/rc tags. -release = u'3.9.0' +release = u'3.9.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From 7dd7fd16babac593cabb964d35af7aceabead73e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 20:07:58 +0200 Subject: [PATCH 023/167] Working in tests... --- app/Models/PaymentMethod.php | 2 +- tests/_support/AcceptanceTester.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/PaymentMethod.php b/app/Models/PaymentMethod.php index 76dce0891bf0..c4efaac6a6ab 100644 --- a/app/Models/PaymentMethod.php +++ b/app/Models/PaymentMethod.php @@ -256,7 +256,7 @@ class PaymentMethod extends EntityModel PaymentMethod::deleting(function ($paymentMethod) { $accountGatewayToken = $paymentMethod->account_gateway_token; if ($accountGatewayToken->default_payment_method_id == $paymentMethod->id) { - $newDefault = $accountGatewayToken->payment_methods->first(function ($i, $paymentMethdod) use ($accountGatewayToken) { + $newDefault = $accountGatewayToken->payment_methods->first(function ($paymentMethdod) use ($accountGatewayToken) { return $paymentMethdod->id != $accountGatewayToken->default_payment_method_id; }); $accountGatewayToken->default_payment_method_id = $newDefault ? $newDefault->id : null; diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php index 7e675fc98381..ce3efc36d1ec 100644 --- a/tests/_support/AcceptanceTester.php +++ b/tests/_support/AcceptanceTester.php @@ -132,7 +132,7 @@ class AcceptanceTester extends \Codeception\Actor $I->selectOption('#expiration_month', 12); $I->selectOption('#expiration_year', date('Y')); $I->click('.btn-success'); - $I->wait(3); + $I->wait(5); $I->see('Successfully applied payment'); }); } From 38d322389b289ae12b07a88ae4ef5d8fed10069d Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Nov 2017 22:34:56 +0200 Subject: [PATCH 024/167] Fix client reset password --- .../ClientAuth/ResetPasswordController.php | 5 +++-- app/Http/routes.php | 2 +- app/Models/Contact.php | 6 ++++++ app/Models/User.php | 6 ++++++ app/Ninja/Mailers/ContactMailer.php | 15 +++++++++++++++ app/Ninja/Mailers/UserMailer.php | 15 +++++++++++++++ resources/lang/en/texts.php | 1 + .../views/clientauth/passwords/reset.blade.php | 1 + ...d.blade.php => client_password_html.blade.php} | 0 .../views/emails/client_password_text.blade.php | 10 ++++++++++ ...password.blade.php => password_html.blade.php} | 0 resources/views/emails/password_text.blade.php | 8 ++++++++ 12 files changed, 66 insertions(+), 3 deletions(-) rename resources/views/emails/{client_password.blade.php => client_password_html.blade.php} (100%) create mode 100644 resources/views/emails/client_password_text.blade.php rename resources/views/emails/{password.blade.php => password_html.blade.php} (100%) create mode 100644 resources/views/emails/password_text.blade.php diff --git a/app/Http/Controllers/ClientAuth/ResetPasswordController.php b/app/Http/Controllers/ClientAuth/ResetPasswordController.php index 6a53f42a33ef..511c10cfa92e 100644 --- a/app/Http/Controllers/ClientAuth/ResetPasswordController.php +++ b/app/Http/Controllers/ClientAuth/ResetPasswordController.php @@ -6,6 +6,7 @@ use Password; use Config; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\ResetsPasswords; +use Illuminate\Http\Request; class ResetPasswordController extends Controller { @@ -48,13 +49,13 @@ class ResetPasswordController extends Controller protected function guard() { - return auth()->guard('clients'); + return auth()->guard('client'); } public function showResetForm(Request $request, $token = null) { return view('clientauth.passwords.reset')->with( - ['token' => $token, 'email' => $request->email] + ['token' => $token] ); } diff --git a/app/Http/routes.php b/app/Http/routes.php index 728ce8fe6101..bec7a83eec16 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -104,7 +104,7 @@ Route::get('/client/login', ['as' => 'login', 'uses' => 'ClientAuth\LoginControl Route::get('/client/logout', ['as' => 'logout', 'uses' => 'ClientAuth\LoginController@getLogout']); Route::get('/client/session_expired', ['as' => 'logout', 'uses' => 'ClientAuth\LoginController@getSessionExpired']); Route::get('/client/recover_password', ['as' => 'forgot', 'uses' => 'ClientAuth\ForgotPasswordController@showLinkRequestForm']); -Route::get('/client/password/reset/{token}', ['as' => 'forgot', 'uses' => 'Auth\ResetPasswordController@showResetForm']); +Route::get('/client/password/reset/{token}', ['as' => 'forgot', 'uses' => 'ClientAuth\ResetPasswordController@showResetForm']); Route::group(['middleware' => ['lookup:contact']], function () { Route::post('/client/login', ['as' => 'login', 'uses' => 'ClientAuth\LoginController@login']); diff --git a/app/Models/Contact.php b/app/Models/Contact.php index e651671e5e9d..799f8e8e80bc 100644 --- a/app/Models/Contact.php +++ b/app/Models/Contact.php @@ -183,6 +183,12 @@ class Contact extends EntityModel implements AuthenticatableContract, CanResetPa return "{$url}/client/dashboard/{$this->contact_key}"; } + + public function sendPasswordResetNotification($token) + { + //$this->notify(new ResetPasswordNotification($token)); + app('App\Ninja\Mailers\ContactMailer')->sendPasswordReset($this, $token); + } } Contact::creating(function ($contact) diff --git a/app/Models/User.php b/app/Models/User.php index 19bd048eb2d4..321d71f304e1 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -421,6 +421,12 @@ class User extends Authenticatable { return $this->account->company->accounts->sortBy('id')->first(); } + + public function sendPasswordResetNotification($token) + { + //$this->notify(new ResetPasswordNotification($token)); + app('App\Ninja\Mailers\UserMailer')->sendPasswordReset($this, $token); + } } User::created(function ($user) diff --git a/app/Ninja/Mailers/ContactMailer.php b/app/Ninja/Mailers/ContactMailer.php index 5507ef2ccfce..6647f56d5ebc 100644 --- a/app/Ninja/Mailers/ContactMailer.php +++ b/app/Ninja/Mailers/ContactMailer.php @@ -327,4 +327,19 @@ class ContactMailer extends Mailer $this->sendTo($email, CONTACT_EMAIL, CONTACT_NAME, $subject, $view, $data); } + + public function sendPasswordReset($contact, $token) + { + if (! $contact->email) { + return; + } + + $subject = trans('texts.your_password_reset_link'); + $view = 'client_password'; + $data = [ + 'token' => $token, + ]; + + $this->sendTo($contact->email, CONTACT_EMAIL, CONTACT_NAME, $subject, $view, $data); + } } diff --git a/app/Ninja/Mailers/UserMailer.php b/app/Ninja/Mailers/UserMailer.php index bc464525e438..c2f9fd37b460 100644 --- a/app/Ninja/Mailers/UserMailer.php +++ b/app/Ninja/Mailers/UserMailer.php @@ -154,4 +154,19 @@ class UserMailer extends Mailer $this->sendTo($user->email, CONTACT_EMAIL, CONTACT_NAME, $subject, $view, $data); } + + public function sendPasswordReset($user, $token) + { + if (! $user->email) { + return; + } + + $subject = trans('texts.your_password_reset_link'); + $view = 'password'; + $data = [ + 'token' => $token, + ]; + + $this->sendTo($user->email, CONTACT_EMAIL, CONTACT_NAME, $subject, $view, $data); + } } diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 2f1d5be30aa1..315cbc56786c 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2521,6 +2521,7 @@ $LANG = array( 'self_host_login' => 'Self-Host Login', 'set_self_hoat_url' => 'Self-Host URL', 'local_storage_required' => 'Error: local storage is not available.', + 'your_password_reset_link' => 'Your Password Reset Link', ); diff --git a/resources/views/clientauth/passwords/reset.blade.php b/resources/views/clientauth/passwords/reset.blade.php index 62f7336eea4d..8261983a512d 100644 --- a/resources/views/clientauth/passwords/reset.blade.php +++ b/resources/views/clientauth/passwords/reset.blade.php @@ -35,6 +35,7 @@
+ {!! Former::text('email')->placeholder(trans('texts.email'))->raw() !!} {!! Former::password('password')->placeholder(trans('texts.password'))->raw() !!} {!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->raw() !!}
diff --git a/resources/views/emails/client_password.blade.php b/resources/views/emails/client_password_html.blade.php similarity index 100% rename from resources/views/emails/client_password.blade.php rename to resources/views/emails/client_password_html.blade.php diff --git a/resources/views/emails/client_password_text.blade.php b/resources/views/emails/client_password_text.blade.php new file mode 100644 index 000000000000..178ed24c1273 --- /dev/null +++ b/resources/views/emails/client_password_text.blade.php @@ -0,0 +1,10 @@ +{{ trans('texts.reset_password') }} + +{!! URL::to(SITE_URL . "/client/password/reset/{$token}") !!} + +@if (Utils::isNinja() || ! Utils::isWhiteLabel()) + {{ trans('texts.email_signature') }}
+ {{ trans('texts.email_from') }} +@endif + +{{ trans('texts.reset_password_footer', ['email' => env('CONTACT_EMAIL', CONTACT_EMAIL)]) }} diff --git a/resources/views/emails/password.blade.php b/resources/views/emails/password_html.blade.php similarity index 100% rename from resources/views/emails/password.blade.php rename to resources/views/emails/password_html.blade.php diff --git a/resources/views/emails/password_text.blade.php b/resources/views/emails/password_text.blade.php new file mode 100644 index 000000000000..15f449af8f53 --- /dev/null +++ b/resources/views/emails/password_text.blade.php @@ -0,0 +1,8 @@ +{{ trans('texts.reset_password') }} + +{!! URL::to(SITE_URL . "/password/reset/{$token}") !!} + +{{ trans('texts.email_signature') }} +{{ trans('texts.email_from') }} + +{{ trans('texts.reset_password_footer', ['email' => env('CONTACT_EMAIL', CONTACT_EMAIL)]) }} From 6dde9de1915e16d23231312eb16813035edeb63d Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 09:51:49 +0200 Subject: [PATCH 025/167] Working on password reset --- .../Controllers/Auth/ResetPasswordController.php | 10 ++++++++++ .../ClientAuth/ResetPasswordController.php | 6 +++++- app/Models/PasswordReset.php | 13 +++++++++++++ resources/views/auth/passwords/reset.blade.php | 13 +++++++++---- .../views/clientauth/passwords/reset.blade.php | 13 +++++++++---- resources/views/partials/autocomplete_fix.blade.php | 2 +- 6 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 app/Models/PasswordReset.php diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index a07a372f8642..4303afa40a04 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -54,4 +54,14 @@ class ResetPasswordController extends Controller return $this->traitSendResetResponse($response); } } + + public function showResetForm(Request $request, $token = null) + { + $passwordReset = PasswordReset::whereToken($token)->first(); + $email = $passwordReset ? $passwordReset->email : ''; + + return view('auth.passwords.reset')->with( + ['token' => $token, 'email' => $email] + ); + } } diff --git a/app/Http/Controllers/ClientAuth/ResetPasswordController.php b/app/Http/Controllers/ClientAuth/ResetPasswordController.php index 511c10cfa92e..a2b379a4191d 100644 --- a/app/Http/Controllers/ClientAuth/ResetPasswordController.php +++ b/app/Http/Controllers/ClientAuth/ResetPasswordController.php @@ -7,6 +7,7 @@ use Config; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\ResetsPasswords; use Illuminate\Http\Request; +use App\Models\PasswordReset; class ResetPasswordController extends Controller { @@ -54,8 +55,11 @@ class ResetPasswordController extends Controller public function showResetForm(Request $request, $token = null) { + $passwordReset = PasswordReset::whereToken($token)->first(); + $email = $passwordReset ? $passwordReset->email : ''; + return view('clientauth.passwords.reset')->with( - ['token' => $token] + ['token' => $token, 'email' => $email] ); } diff --git a/app/Models/PasswordReset.php b/app/Models/PasswordReset.php new file mode 100644 index 000000000000..468c9901e72b --- /dev/null +++ b/app/Models/PasswordReset.php @@ -0,0 +1,13 @@ + - {!! Former::open('/password/reset')->addClass('form-signin')->rules(array( + {!! Former::open('/password/reset') + ->addClass('form-signin') + ->autocomplete('off') + ->rules(array( 'password' => 'required', 'password_confirmation' => 'required', )) !!} + @include('partials.autocomplete_fix') +
@@ -35,9 +40,9 @@
- {!! Former::text('email')->placeholder(trans('texts.email'))->raw() !!} - {!! Former::password('password')->placeholder(trans('texts.password'))->raw() !!} - {!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->raw() !!} + {!! Former::text('email')->placeholder(trans('texts.password'))->value($email)->raw() !!} + {!! Former::password('password')->placeholder(trans('texts.password'))->autocomplete('new-password')->raw() !!} + {!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->autocomplete('new-password')->raw() !!}

{!! Button::success(trans('texts.save'))->large()->submit()->withAttributes(['class' => 'green'])->block() !!}

diff --git a/resources/views/clientauth/passwords/reset.blade.php b/resources/views/clientauth/passwords/reset.blade.php index 8261983a512d..0c2a50005e8a 100644 --- a/resources/views/clientauth/passwords/reset.blade.php +++ b/resources/views/clientauth/passwords/reset.blade.php @@ -3,11 +3,16 @@ @section('form')
- {!! Former::open('/client/password/reset')->addClass('form-signin')->rules(array( + {!! Former::open('/client/password/reset') + ->addClass('form-signin') + ->autocomplete('false') + ->rules(array( 'password' => 'required', 'password_confirmation' => 'required', )) !!} + @include('partials.autocomplete_fix') +
@@ -35,9 +40,9 @@
- {!! Former::text('email')->placeholder(trans('texts.email'))->raw() !!} - {!! Former::password('password')->placeholder(trans('texts.password'))->raw() !!} - {!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->raw() !!} + {!! Former::text('email')->placeholder(trans('texts.password'))->value($email)->raw() !!} + {!! Former::password('password')->placeholder(trans('texts.password'))->autocomplete('new-password')->raw() !!} + {!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->autocomplete('new-password')->raw() !!}

{!! Button::success(trans('texts.save'))->large()->submit()->withAttributes(['class' => 'green'])->block() !!}

diff --git a/resources/views/partials/autocomplete_fix.blade.php b/resources/views/partials/autocomplete_fix.blade.php index ec3f8c5cdb9b..cc0f61d3f7a1 100644 --- a/resources/views/partials/autocomplete_fix.blade.php +++ b/resources/views/partials/autocomplete_fix.blade.php @@ -1,4 +1,4 @@
-
\ No newline at end of file +
From 0f5f1b6d19e12ae35504b3dfff7dedf87400d002 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 11:25:41 +0200 Subject: [PATCH 026/167] working on password reset --- app/Http/Controllers/Auth/ResetPasswordController.php | 9 +++++++-- .../Controllers/ClientAuth/ResetPasswordController.php | 8 ++++++-- resources/views/auth/passwords/reset.blade.php | 4 ++-- resources/views/clientauth/passwords/reset.blade.php | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index 4303afa40a04..b19a40cde50f 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -3,6 +3,8 @@ namespace App\Http\Controllers\Auth; use Event; +use Illuminate\Http\Request; +use App\Models\PasswordReset; use App\Events\UserLoggedIn; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\ResetsPasswords; @@ -58,10 +60,13 @@ class ResetPasswordController extends Controller public function showResetForm(Request $request, $token = null) { $passwordReset = PasswordReset::whereToken($token)->first(); - $email = $passwordReset ? $passwordReset->email : ''; + + if (! $passwordReset) { + return redirect('login')->withMessage(trans('texts.invalid_code')); + } return view('auth.passwords.reset')->with( - ['token' => $token, 'email' => $email] + ['token' => $token, 'email' => $passwordReset->email] ); } } diff --git a/app/Http/Controllers/ClientAuth/ResetPasswordController.php b/app/Http/Controllers/ClientAuth/ResetPasswordController.php index a2b379a4191d..33b8f85e38ba 100644 --- a/app/Http/Controllers/ClientAuth/ResetPasswordController.php +++ b/app/Http/Controllers/ClientAuth/ResetPasswordController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers\ClientAuth; use Password; use Config; +use App\Models\PasswordReset; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\ResetsPasswords; use Illuminate\Http\Request; @@ -56,10 +57,13 @@ class ResetPasswordController extends Controller public function showResetForm(Request $request, $token = null) { $passwordReset = PasswordReset::whereToken($token)->first(); - $email = $passwordReset ? $passwordReset->email : ''; + + if (! $passwordReset) { + return redirect('login')->withMessage(trans('texts.invalid_code')); + } return view('clientauth.passwords.reset')->with( - ['token' => $token, 'email' => $email] + ['token' => $token, 'email' => $passwordReset->email] ); } diff --git a/resources/views/auth/passwords/reset.blade.php b/resources/views/auth/passwords/reset.blade.php index 8d9df7cb83f2..46ff102143bf 100644 --- a/resources/views/auth/passwords/reset.blade.php +++ b/resources/views/auth/passwords/reset.blade.php @@ -40,7 +40,7 @@
- {!! Former::text('email')->placeholder(trans('texts.password'))->value($email)->raw() !!} + {!! Former::text('email')->placeholder(trans('texts.email'))->value($email)->readonly(true)->raw() !!} {!! Former::password('password')->placeholder(trans('texts.password'))->autocomplete('new-password')->raw() !!} {!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->autocomplete('new-password')->raw() !!}
@@ -52,7 +52,7 @@
diff --git a/resources/views/clientauth/passwords/reset.blade.php b/resources/views/clientauth/passwords/reset.blade.php index 0c2a50005e8a..f0a0b05aaf39 100644 --- a/resources/views/clientauth/passwords/reset.blade.php +++ b/resources/views/clientauth/passwords/reset.blade.php @@ -40,7 +40,7 @@
- {!! Former::text('email')->placeholder(trans('texts.password'))->value($email)->raw() !!} + {!! Former::text('email')->placeholder(trans('texts.email'))->value($email)->readonly(true)->raw() !!} {!! Former::password('password')->placeholder(trans('texts.password'))->autocomplete('new-password')->raw() !!} {!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->autocomplete('new-password')->raw() !!}
From 9010938f1b143f6083cd7caaa2134290512faa9e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 11:54:23 +0200 Subject: [PATCH 027/167] Update min php to 7 --- README.md | 2 +- app/Http/Controllers/AppController.php | 6 +++ app/Http/Controllers/Auth/LoginController.php | 15 +++++++ .../ClientAuth/LoginController.php | 15 +++++++ app/Http/Middleware/StartupCheck.php | 4 +- composer.json | 4 +- composer.lock | 44 ++++++++++--------- docs/install.rst | 2 +- docs/update.rst | 8 +++- resources/views/setup.blade.php | 4 +- 10 files changed, 75 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 0649db5d86bd..5b8a581004a2 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ The self-host zip includes all third party libraries whereas downloading the cod ## Requirements -* PHP >= 5.5.9 +* PHP 7 * MySQL ## Recommended Providers diff --git a/app/Http/Controllers/AppController.php b/app/Http/Controllers/AppController.php index ba0dc4cea421..f7240d317def 100644 --- a/app/Http/Controllers/AppController.php +++ b/app/Http/Controllers/AppController.php @@ -272,6 +272,12 @@ class AppController extends BaseController try { set_time_limit(60 * 5); $this->checkInnoDB(); + + $cacheCompiled = base_path('bootstrap/cache/compiled.php'); + if (file_exists($cacheCompiled)) { unlink ($cacheCompiled); } + $cacheServices = base_path('bootstrap/cache/services.json'); + if (file_exists($cacheServices)) { unlink ($cacheServices); } + Artisan::call('clear-compiled'); Artisan::call('cache:clear'); Artisan::call('debugbar:clear'); diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index aff9502a31f9..e1840d57fb80 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -110,6 +110,21 @@ class LoginController extends Controller return $response; } + /** + * Get the failed login response instance. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\RedirectResponse + */ + protected function sendFailedLoginResponse(Request $request) + { + return redirect()->back() + ->withInput($request->only($this->username(), 'remember')) + ->withErrors([ + $this->username() => trans('texts.invalid_credentials'), + ]); + } + /** * Send the post-authentication response. * diff --git a/app/Http/Controllers/ClientAuth/LoginController.php b/app/Http/Controllers/ClientAuth/LoginController.php index befc498cfa57..becb723d593d 100644 --- a/app/Http/Controllers/ClientAuth/LoginController.php +++ b/app/Http/Controllers/ClientAuth/LoginController.php @@ -88,6 +88,21 @@ class LoginController extends Controller return $credentials; } + /** + * Get the failed login response instance. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\RedirectResponse + */ + protected function sendFailedLoginResponse(Request $request) + { + return redirect()->back() + ->withInput($request->only($this->username(), 'remember')) + ->withErrors([ + $this->username() => trans('texts.invalid_credentials'), + ]); + } + /** * Validate the user login request - don't require the email * diff --git a/app/Http/Middleware/StartupCheck.php b/app/Http/Middleware/StartupCheck.php index 5db83b89b0c0..9c82abad036c 100644 --- a/app/Http/Middleware/StartupCheck.php +++ b/app/Http/Middleware/StartupCheck.php @@ -55,8 +55,8 @@ class StartupCheck $file = storage_path() . '/version.txt'; $version = @file_get_contents($file); if ($version != NINJA_VERSION) { - if (version_compare(phpversion(), '5.5.9', '<')) { - dd('Please update PHP to >= 5.5.9'); + if (version_compare(phpversion(), '7.0.0', '<')) { + dd('Please update PHP to >= 7.0.0'); } $handle = fopen($file, 'w'); fwrite($handle, NINJA_VERSION); diff --git a/composer.json b/composer.json index d4b3dad2fac5..5946f95f3717 100644 --- a/composer.json +++ b/composer.json @@ -13,10 +13,10 @@ } ], "require": { - "php": ">=5.5.9", + "php": ">=7.0.0", "ext-gd": "*", "ext-gmp": "*", - "anahkiasen/former": "4.0.*@dev", + "anahkiasen/former": "4.*", "asgrim/ofxparser": "^1.1", "bacon/bacon-qr-code": "^1.0", "barracudanetworks/archivestream-php": "^1.0", diff --git a/composer.lock b/composer.lock index 82604aefd251..77dbcbae5c05 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "f2043c8ce923c8af3c99ba7c5bcf5d5e", - "content-hash": "dbc2b358c79e0abe0a58d2bd02310966", + "hash": "303fbf170906bca5a5354e7bbb92c94d", + "content-hash": "a1aaf83c53c00ce8dbb3ec13d70a42b3", "packages": [ { "name": "abdala/omnipay-pagseguro", @@ -169,16 +169,16 @@ }, { "name": "anahkiasen/former", - "version": "4.0.6", + "version": "4.1.1", "source": { "type": "git", "url": "https://github.com/formers/former.git", - "reference": "1ad9b332e8d8f5b23159aabbca89084276938382" + "reference": "56fd10035d7e7c34e2761e0458b92ca8890e6a9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/formers/former/zipball/1ad9b332e8d8f5b23159aabbca89084276938382", - "reference": "1ad9b332e8d8f5b23159aabbca89084276938382", + "url": "https://api.github.com/repos/formers/former/zipball/56fd10035d7e7c34e2761e0458b92ca8890e6a9a", + "reference": "56fd10035d7e7c34e2761e0458b92ca8890e6a9a", "shasum": "" }, "require": { @@ -197,6 +197,11 @@ "phpunit/phpunit": "~4" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.5.x-dev" + } + }, "autoload": { "psr-4": { "Former\\": [ @@ -217,14 +222,14 @@ } ], "description": "A powerful form builder", - "homepage": "http://anahkiasen.github.com/former/", + "homepage": "http://formers.github.io/former/", "keywords": [ "bootstrap", "form", "foundation", "laravel" ], - "time": "2016-07-28 19:36:11" + "time": "2017-05-30 18:43:09" }, { "name": "anahkiasen/html-object", @@ -380,16 +385,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.38.1", + "version": "3.38.2", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "9f704274f4748d2039a16d45b3388ed8dde74e89" + "reference": "7b13de0b39f29833a977176ce58eed990e1487ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/9f704274f4748d2039a16d45b3388ed8dde74e89", - "reference": "9f704274f4748d2039a16d45b3388ed8dde74e89", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/7b13de0b39f29833a977176ce58eed990e1487ba", + "reference": "7b13de0b39f29833a977176ce58eed990e1487ba", "shasum": "" }, "require": { @@ -456,7 +461,7 @@ "s3", "sdk" ], - "time": "2017-11-09 19:15:59" + "time": "2017-11-14 23:47:41" }, { "name": "bacon/bacon-qr-code", @@ -2547,16 +2552,16 @@ }, { "name": "gocardless/gocardless-pro", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/gocardless/gocardless-pro-php.git", - "reference": "d2d4adb7cde53722858f1e7e5508697fefdb5390" + "reference": "16ac38c2531e08c15e54b4a82d44854349cbfcf6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/gocardless/gocardless-pro-php/zipball/d2d4adb7cde53722858f1e7e5508697fefdb5390", - "reference": "d2d4adb7cde53722858f1e7e5508697fefdb5390", + "url": "https://api.github.com/repos/gocardless/gocardless-pro-php/zipball/16ac38c2531e08c15e54b4a82d44854349cbfcf6", + "reference": "16ac38c2531e08c15e54b4a82d44854349cbfcf6", "shasum": "" }, "require": { @@ -2595,7 +2600,7 @@ "direct debit", "gocardless" ], - "time": "2017-09-18 15:08:13" + "time": "2017-11-14 15:46:50" }, { "name": "google/apiclient", @@ -12412,7 +12417,6 @@ ], "minimum-stability": "dev", "stability-flags": { - "anahkiasen/former": 20, "chumper/datatable": 20, "codedge/laravel-selfupdater": 20, "collizo4sky/omnipay-wepay": 20, @@ -12431,7 +12435,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=5.5.9", + "php": ">=7.0.0", "ext-gd": "*", "ext-gmp": "*" }, diff --git a/docs/install.rst b/docs/install.rst index 6cd6b3e5487b..cf4955fded75 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -3,7 +3,7 @@ Install Thanks for taking the time to setup Invoice Ninja. -.. Note:: The applications requires PHP >= 5.5.9 and MySQL. +.. Note:: The applications requires PHP >= 7.0.0 and MySQL. Detailed Guides ^^^^^^^^^^^^^^^ diff --git a/docs/update.rst b/docs/update.rst index c8af0f37d3d7..ecc2797d53be 100644 --- a/docs/update.rst +++ b/docs/update.rst @@ -24,6 +24,11 @@ If the auto-update fails you can manually run the update with the following comm .. TIP:: You can see the detailed changes for each release on our `GitHub release notes `_. +Version 4.0 +""""""""""""" + +The minimum PHP version is now 7.0.0 + Version 3.2 """"""""""" @@ -36,7 +41,8 @@ Make sure the .env file includes ``APP_CIPHER=rijndael-128`` Version 2.5.1 """"""""""""" -Minimum PHP version is now 5.5.9 + +The minimum PHP version is now 5.5.9 Version 2.0 """"""""""" diff --git a/resources/views/setup.blade.php b/resources/views/setup.blade.php index b4a4969e78e6..b1520c233eca 100644 --- a/resources/views/setup.blade.php +++ b/resources/views/setup.blade.php @@ -26,8 +26,8 @@

Invoice Ninja Setup

- @if (version_compare(phpversion(), '5.5.9', '<')) -
Warning: The application requires PHP >= 5.5.9
+ @if (version_compare(phpversion(), '7.0.0', '<')) +
Warning: The application requires PHP >= 7.0.0
@endif @if (!function_exists('proc_open'))
Warning: proc_open must be enabled.
From 63f8a299d354dc83707329781dbc3612f2ec62d3 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 12:07:10 +0200 Subject: [PATCH 028/167] Update readme --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5b8a581004a2..0652ef89939f 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,11 @@ All Pro and Enterprise features from the hosted app are included in the open-sou The self-host zip includes all third party libraries whereas downloading the code from GitHub requires using Composer to install the dependencies. ## Affiliates Programs -* Referral program (we pay you): $100 per sign up paid over 3 years - [Learn more](https://www.invoiceninja.com/referral-program/) -* White-label reseller (you pay us): $500 sign up fee and either 10% of revenue or $1 per user per month +* Referral program (we pay you) + * $100 per sign up paid over 3 years - [Learn more](https://www.invoiceninja.com/referral-program/) +* White-label reseller (you pay us) + * Hosted: $500 sign up fee and either 10% of revenue or $1/user/month + * Self-Hosted: Contact us for volume license pricing ### Installation Options * [Self-Host Zip](http://docs.invoiceninja.com/en/latest/install.html) From 817908e9cef54b0e5c23d92fd950bba38491edef Mon Sep 17 00:00:00 2001 From: Jos de Jong Date: Wed, 15 Nov 2017 12:11:34 +0100 Subject: [PATCH 029/167] Explicit version number for jsoneditor v5.10.1 --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index bc99469934a8..9bf2abf3a244 100644 --- a/bower.json +++ b/bower.json @@ -21,7 +21,7 @@ "handsontable": "*", "pdfmake": "0.1.31", "moment": "*", - "jsoneditor": "*", + "jsoneditor": "5.10.1", "moment-timezone": "~0.4.0", "quill": "~0.20.0", "datetimepicker": "~2.4.5", From 851064b75b5b6f57e3f90a24ee2700acd12d3263 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 13:16:59 +0200 Subject: [PATCH 030/167] Update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0652ef89939f..8249bb6e1ef7 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ All Pro and Enterprise features from the hosted app are included in the open-sou The self-host zip includes all third party libraries whereas downloading the code from GitHub requires using Composer to install the dependencies. ## Affiliates Programs -* Referral program (we pay you) +* Referral Program (we pay you) * $100 per sign up paid over 3 years - [Learn more](https://www.invoiceninja.com/referral-program/) -* White-label reseller (you pay us) +* White-Label Reseller (you pay us) * Hosted: $500 sign up fee and either 10% of revenue or $1/user/month * Self-Hosted: Contact us for volume license pricing From 5ff37e70e0a42fea775e9ebc5066f3e2b8d1a921 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 13:39:24 +0200 Subject: [PATCH 031/167] Use new route files --- app/Http/Kernel.php | 54 ++-- app/Http/Middleware/EncryptCookies.php | 17 ++ app/Http/routes.php | 8 +- app/Providers/RouteServiceProvider.php | 55 +++- routes/api.php | 36 +++ routes/web.php | 368 +++++++++++++++++++++++++ 6 files changed, 506 insertions(+), 32 deletions(-) create mode 100644 app/Http/Middleware/EncryptCookies.php create mode 100644 routes/api.php create mode 100644 routes/web.php diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index c19fce2245e5..5762a895c229 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -9,33 +9,53 @@ class Kernel extends HttpKernel /** * The application's global HTTP middleware stack. * + * These middleware are run during every request to your application. + * * @var array */ protected $middleware = [ - 'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode', - 'Illuminate\Cookie\Middleware\EncryptCookies', - 'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse', - 'Illuminate\Session\Middleware\StartSession', - 'Illuminate\View\Middleware\ShareErrorsFromSession', - 'App\Http\Middleware\VerifyCsrfToken', - 'App\Http\Middleware\DuplicateSubmissionCheck', - 'App\Http\Middleware\QueryLogging', - 'App\Http\Middleware\StartupCheck', + \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, + ]; + + /** + * The application's route middleware groups. + * + * @var array + */ + protected $middlewareGroups = [ + 'web' => [ + \App\Http\Middleware\EncryptCookies::class, + \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, + \Illuminate\Session\Middleware\StartSession::class, + \Illuminate\View\Middleware\ShareErrorsFromSession::class, + \App\Http\Middleware\VerifyCsrfToken::class, + //\Illuminate\Routing\Middleware\SubstituteBindings::class, + \App\Http\Middleware\DuplicateSubmissionCheck::class, + \App\Http\Middleware\QueryLogging::class, + \App\Http\Middleware\StartupCheck::class, + ], + 'api' => [ + 'throttle:60,1', + 'bindings', + ], ]; /** * The application's route middleware. * + * These middleware may be assigned to groups or used individually. + * * @var array */ protected $routeMiddleware = [ - 'lookup' => 'App\Http\Middleware\DatabaseLookup', - 'auth' => 'App\Http\Middleware\Authenticate', - 'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth', - 'permissions.required' => 'App\Http\Middleware\PermissionsRequired', - 'guest' => 'App\Http\Middleware\RedirectIfAuthenticated', - 'api' => 'App\Http\Middleware\ApiCheck', - 'cors' => '\Barryvdh\Cors\HandleCors', - 'throttle' => 'Illuminate\Routing\Middleware\ThrottleRequests', + 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, + 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, + 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, + 'can' => \Illuminate\Auth\Middleware\Authorize::class, + 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, + 'lookup' => \App\Http\Middleware\DatabaseLookup::class, + 'permissions.required' => \App\Http\Middleware\PermissionsRequired::class, + 'api' => \App\Http\Middleware\ApiCheck::class, ]; } diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php new file mode 100644 index 000000000000..3aa15f8dd91d --- /dev/null +++ b/app/Http/Middleware/EncryptCookies.php @@ -0,0 +1,17 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + + // + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. * * @return void */ - public function map(Router $router) + protected function mapWebRoutes() { - $router->group(['namespace' => $this->namespace], function ($router) { - require app_path('Http/routes.php'); + Route::group([ + 'middleware' => 'web', + 'namespace' => $this->namespace, + ], function ($router) { + require base_path('routes/web.php'); + }); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::group([ + 'middleware' => 'api', + 'namespace' => $this->namespace, + 'prefix' => 'api', + ], function ($router) { + require base_path('routes/api.php'); }); } } diff --git a/routes/api.php b/routes/api.php new file mode 100644 index 000000000000..492eb892562b --- /dev/null +++ b/routes/api.php @@ -0,0 +1,36 @@ + ['lookup:api', 'api'], 'prefix' => 'api/v1'], function () { + Route::get('ping', 'AccountApiController@ping'); + Route::post('login', 'AccountApiController@login'); + Route::post('oauth_login', 'AccountApiController@oauthLogin'); + Route::post('register', 'AccountApiController@register'); + Route::get('static', 'AccountApiController@getStaticData'); + Route::get('accounts', 'AccountApiController@show'); + Route::put('accounts', 'AccountApiController@update'); + Route::resource('clients', 'ClientApiController'); + Route::resource('contacts', 'ContactApiController'); + Route::get('quotes', 'QuoteApiController@index'); + Route::get('download/{invoice_id}', 'InvoiceApiController@download'); + Route::resource('invoices', 'InvoiceApiController'); + Route::resource('payments', 'PaymentApiController'); + Route::resource('tasks', 'TaskApiController'); + Route::resource('credits', 'CreditApiController'); + Route::post('hooks', 'IntegrationController@subscribe'); + Route::post('email_invoice', 'InvoiceApiController@emailInvoice'); + Route::get('user_accounts', 'AccountApiController@getUserAccounts'); + Route::resource('products', 'ProductApiController'); + Route::resource('projects', 'ProjectApiController'); + Route::resource('tax_rates', 'TaxRateApiController'); + Route::resource('users', 'UserApiController'); + Route::resource('expenses', 'ExpenseApiController'); + Route::post('add_token', 'AccountApiController@addDeviceToken'); + Route::post('remove_token', 'AccountApiController@removeDeviceToken'); + Route::post('update_notifications', 'AccountApiController@updatePushNotifications'); + Route::get('dashboard', 'DashboardApiController@index'); + Route::resource('documents', 'DocumentAPIController'); + Route::resource('vendors', 'VendorApiController'); + Route::resource('expense_categories', 'ExpenseCategoryApiController'); + Route::post('ios_subscription_status', 'AccountApiController@iosSubscriptionStatus'); +}); diff --git a/routes/web.php b/routes/web.php new file mode 100644 index 000000000000..ffc39e757199 --- /dev/null +++ b/routes/web.php @@ -0,0 +1,368 @@ + ['lookup:contact', 'auth:client']], function () { + Route::get('view/{invitation_key}', 'ClientPortalController@view'); + Route::get('download/{invitation_key}', 'ClientPortalController@download'); + Route::put('sign/{invitation_key}', 'ClientPortalController@sign'); + Route::get('view', 'HomeController@viewLogo'); + Route::get('approve/{invitation_key}', 'QuoteController@approve'); + Route::get('payment/{invitation_key}/{gateway_type?}/{source_id?}', 'OnlinePaymentController@showPayment'); + Route::post('payment/{invitation_key}', 'OnlinePaymentController@doPayment'); + Route::get('complete_source/{invitation_key}/{gateway_type}', 'OnlinePaymentController@completeSource'); + Route::match(['GET', 'POST'], 'complete/{invitation_key?}/{gateway_type?}', 'OnlinePaymentController@offsitePayment'); + Route::get('bank/{routing_number}', 'OnlinePaymentController@getBankInfo'); + Route::get('client/payment_methods', 'ClientPortalController@paymentMethods'); + Route::post('client/payment_methods/verify', 'ClientPortalController@verifyPaymentMethod'); + Route::post('client/payment_methods/default', 'ClientPortalController@setDefaultPaymentMethod'); + Route::post('client/payment_methods/{source_id}/remove', 'ClientPortalController@removePaymentMethod'); + Route::get('client/quotes', 'ClientPortalController@quoteIndex'); + Route::get('client/credits', 'ClientPortalController@creditIndex'); + Route::get('client/invoices', 'ClientPortalController@invoiceIndex'); + Route::get('client/invoices/recurring', 'ClientPortalController@recurringInvoiceIndex'); + Route::post('client/invoices/auto_bill', 'ClientPortalController@setAutoBill'); + Route::get('client/documents', 'ClientPortalController@documentIndex'); + Route::get('client/payments', 'ClientPortalController@paymentIndex'); + Route::get('client/dashboard/{contact_key?}', 'ClientPortalController@dashboard'); + Route::get('client/documents/js/{documents}/{filename}', 'ClientPortalController@getDocumentVFSJS'); + Route::get('client/documents/{invitation_key}/{documents}/{filename?}', 'ClientPortalController@getDocument'); + Route::get('client/documents/{invitation_key}/{filename?}', 'ClientPortalController@getInvoiceDocumentsZip'); + + Route::get('api/client.quotes', ['as' => 'api.client.quotes', 'uses' => 'ClientPortalController@quoteDatatable']); + Route::get('api/client.credits', ['as' => 'api.client.credits', 'uses' => 'ClientPortalController@creditDatatable']); + Route::get('api/client.invoices', ['as' => 'api.client.invoices', 'uses' => 'ClientPortalController@invoiceDatatable']); + Route::get('api/client.recurring_invoices', ['as' => 'api.client.recurring_invoices', 'uses' => 'ClientPortalController@recurringInvoiceDatatable']); + Route::get('api/client.documents', ['as' => 'api.client.documents', 'uses' => 'ClientPortalController@documentDatatable']); + Route::get('api/client.payments', ['as' => 'api.client.payments', 'uses' => 'ClientPortalController@paymentDatatable']); + Route::get('api/client.activity', ['as' => 'api.client.activity', 'uses' => 'ClientPortalController@activityDatatable']); +}); + +Route::group(['middleware' => 'lookup:license'], function () { + Route::get('license', 'NinjaController@show_license_payment'); + Route::post('license', 'NinjaController@do_license_payment'); + Route::get('claim_license', 'NinjaController@claim_license'); + if (Utils::isNinja()) { + Route::post('/signup/register', 'AccountController@doRegister'); + Route::get('/news_feed/{user_type}/{version}/', 'HomeController@newsFeed'); + } +}); + +Route::group(['middleware' => 'lookup:postmark'], function () { + Route::post('/hook/email_bounced', 'AppController@emailBounced'); + Route::post('/hook/email_opened', 'AppController@emailOpened'); +}); + +Route::group(['middleware' => 'lookup:account'], function () { + Route::post('/payment_hook/{account_key}/{gateway_id}', 'OnlinePaymentController@handlePaymentWebhook'); + Route::match(['GET', 'POST', 'OPTIONS'], '/buy_now/{gateway_type?}', 'OnlinePaymentController@handleBuyNow'); + Route::get('validate_two_factor/{account_key}', 'Auth\LoginController@getValidateToken'); + Route::post('validate_two_factor/{account_key}', ['middleware' => 'throttle:5', 'uses' => 'Auth\LoginController@postValidateToken']); +}); + +//Route::post('/hook/bot/{platform?}', 'BotController@handleMessage'); + +// Laravel auth routes +Route::get('/login', ['as' => 'login', 'uses' => 'Auth\LoginController@getLoginWrapper']); +Route::get('/logout', ['as' => 'logout', 'uses' => 'Auth\LoginController@getLogoutWrapper']); +Route::get('/recover_password', ['as' => 'forgot', 'uses' => 'Auth\ForgotPasswordController@showLinkRequestForm']); +Route::get('/password/reset/{token}', ['as' => 'forgot', 'uses' => 'Auth\ResetPasswordController@showResetForm']); +Route::get('/auth/{provider}', 'Auth\AuthController@oauthLogin'); + +Route::group(['middleware' => ['lookup:user']], function () { + Route::get('/user/confirm/{confirmation_code}', 'UserController@confirm'); + Route::post('/login', ['as' => 'login', 'uses' => 'Auth\LoginController@postLoginWrapper']); + Route::post('/recover_password', ['as' => 'forgot', 'uses' => 'Auth\ForgotPasswordController@sendResetLinkEmail']); + Route::post('/password/reset', ['as' => 'forgot', 'uses' => 'Auth\ResetPasswordController@reset']); +}); + +// Client auth +Route::get('/client/login', ['as' => 'login', 'uses' => 'ClientAuth\LoginController@showLoginForm']); +Route::get('/client/logout', ['as' => 'logout', 'uses' => 'ClientAuth\LoginController@getLogout']); +Route::get('/client/session_expired', ['as' => 'logout', 'uses' => 'ClientAuth\LoginController@getSessionExpired']); +Route::get('/client/recover_password', ['as' => 'forgot', 'uses' => 'ClientAuth\ForgotPasswordController@showLinkRequestForm']); +Route::get('/client/password/reset/{token}', ['as' => 'forgot', 'uses' => 'ClientAuth\ResetPasswordController@showResetForm']); + +Route::group(['middleware' => ['lookup:contact']], function () { + Route::post('/client/login', ['as' => 'login', 'uses' => 'ClientAuth\LoginController@login']); + Route::post('/client/recover_password', ['as' => 'forgot', 'uses' => 'ClientAuth\ForgotPasswordController@sendResetLinkEmail']); + Route::post('/client/password/reset', ['as' => 'forgot', 'uses' => 'ClientAuth\ResetPasswordController@reset']); +}); + +if (Utils::isReseller()) { + Route::post('/reseller_stats', 'AppController@stats'); +} + +if (Utils::isTravis()) { + Route::get('/check_data', 'AppController@checkData'); +} + +Route::group(['middleware' => ['lookup:user', 'auth:user']], function () { + Route::get('logged_in', 'HomeController@loggedIn'); + Route::get('dashboard', 'DashboardController@index'); + Route::get('dashboard_chart_data/{group_by}/{start_date}/{end_date}/{currency_id}/{include_expenses}', 'DashboardController@chartData'); + Route::get('set_entity_filter/{entity_type}/{filter?}', 'AccountController@setEntityFilter'); + Route::get('hide_message', 'HomeController@hideMessage'); + Route::get('force_inline_pdf', 'UserController@forcePDFJS'); + Route::get('account/get_search_data', ['as' => 'get_search_data', 'uses' => 'AccountController@getSearchData']); + Route::get('check_invoice_number/{invoice_id?}', 'InvoiceController@checkInvoiceNumber'); + Route::post('save_sidebar_state', 'UserController@saveSidebarState'); + Route::post('contact_us', 'HomeController@contactUs'); + Route::post('handle_command', 'BotController@handleCommand'); + + Route::post('signup/validate', 'AccountController@checkEmail'); + Route::post('signup/submit', 'AccountController@submitSignup'); + Route::get('auth_unlink', 'Auth\AuthController@oauthUnlink'); + + Route::get('settings/user_details', 'AccountController@showUserDetails'); + Route::post('settings/user_details', 'AccountController@saveUserDetails'); + Route::post('settings/payment_gateway_limits', 'AccountGatewayController@savePaymentGatewayLimits'); + Route::post('users/change_password', 'UserController@changePassword'); + Route::get('settings/enable_two_factor', 'TwoFactorController@setupTwoFactor'); + Route::post('settings/enable_two_factor', 'TwoFactorController@enableTwoFactor'); + + Route::resource('clients', 'ClientController'); + Route::get('api/clients', 'ClientController@getDatatable'); + Route::get('api/activities/{client_id?}', 'ActivityController@getDatatable'); + Route::post('clients/bulk', 'ClientController@bulk'); + Route::get('clients/statement/{client_id}/{status_id?}/{start_date?}/{end_date?}', 'ClientController@statement'); + + Route::get('time_tracker', 'TimeTrackerController@index'); + Route::resource('tasks', 'TaskController'); + Route::get('api/tasks/{client_id?}', 'TaskController@getDatatable'); + Route::get('tasks/create/{client_id?}/{project_id?}', 'TaskController@create'); + Route::post('tasks/bulk', 'TaskController@bulk'); + Route::get('projects', 'ProjectController@index'); + Route::get('api/projects', 'ProjectController@getDatatable'); + Route::get('projects/create/{client_id?}', 'ProjectController@create'); + Route::post('projects', 'ProjectController@store'); + Route::put('projects/{projects}', 'ProjectController@update'); + Route::get('projects/{projects}/edit', 'ProjectController@edit'); + Route::get('projects/{projects}', 'ProjectController@edit'); + Route::post('projects/bulk', 'ProjectController@bulk'); + + Route::get('api/recurring_invoices/{client_id?}', 'InvoiceController@getRecurringDatatable'); + + Route::get('invoices/invoice_history/{invoice_id}', 'InvoiceController@invoiceHistory'); + Route::get('quotes/quote_history/{invoice_id}', 'InvoiceController@invoiceHistory'); + + Route::resource('invoices', 'InvoiceController'); + Route::get('api/invoices/{client_id?}', 'InvoiceController@getDatatable'); + Route::get('invoices/create/{client_id?}', 'InvoiceController@create'); + Route::get('recurring_invoices/create/{client_id?}', 'InvoiceController@createRecurring'); + Route::get('recurring_invoices', 'RecurringInvoiceController@index'); + Route::get('recurring_invoices/{invoices}/edit', 'InvoiceController@edit'); + Route::get('recurring_invoices/{invoices}', 'InvoiceController@edit'); + Route::get('invoices/{invoices}/clone', 'InvoiceController@cloneInvoice'); + Route::post('invoices/bulk', 'InvoiceController@bulk'); + Route::post('recurring_invoices/bulk', 'InvoiceController@bulk'); + + Route::get('recurring_expenses', 'RecurringExpenseController@index'); + Route::get('api/recurring_expenses', 'RecurringExpenseController@getDatatable'); + Route::get('recurring_expenses/create/{vendor_id?}/{client_id?}/{category_id?}', 'RecurringExpenseController@create'); + Route::post('recurring_expenses', 'RecurringExpenseController@store'); + Route::put('recurring_expenses/{recurring_expenses}', 'RecurringExpenseController@update'); + Route::get('recurring_expenses/{recurring_expenses}/edit', 'RecurringExpenseController@edit'); + Route::get('recurring_expenses/{recurring_expenses}', 'RecurringExpenseController@edit'); + Route::post('recurring_expenses/bulk', 'RecurringExpenseController@bulk'); + + Route::get('documents/{documents}/{filename?}', 'DocumentController@get'); + Route::get('documents/js/{documents}/{filename}', 'DocumentController@getVFSJS'); + Route::get('documents/preview/{documents}/{filename?}', 'DocumentController@getPreview'); + Route::post('documents', 'DocumentController@postUpload'); + Route::delete('documents/{documents}', 'DocumentController@delete'); + + Route::get('quotes/create/{client_id?}', 'QuoteController@create'); + Route::get('quotes/{invoices}/clone', 'InvoiceController@cloneQuote'); + Route::get('quotes/{invoices}/edit', 'InvoiceController@edit'); + Route::put('quotes/{invoices}', 'InvoiceController@update'); + Route::get('quotes/{invoices}', 'InvoiceController@edit'); + Route::post('quotes', 'InvoiceController@store'); + Route::get('quotes', 'QuoteController@index'); + Route::get('api/quotes/{client_id?}', 'QuoteController@getDatatable'); + Route::post('quotes/bulk', 'QuoteController@bulk'); + + Route::resource('payments', 'PaymentController'); + Route::get('payments/create/{client_id?}/{invoice_id?}', 'PaymentController@create'); + Route::get('api/payments/{client_id?}', 'PaymentController@getDatatable'); + Route::post('payments/bulk', 'PaymentController@bulk'); + + Route::resource('credits', 'CreditController'); + Route::get('credits/create/{client_id?}/{invoice_id?}', 'CreditController@create'); + Route::get('api/credits/{client_id?}', 'CreditController@getDatatable'); + Route::post('credits/bulk', 'CreditController@bulk'); + + Route::get('api/products', 'ProductController@getDatatable'); + Route::resource('products', 'ProductController'); + Route::post('products/bulk', 'ProductController@bulk'); + + Route::get('/resend_confirmation', 'AccountController@resendConfirmation'); + Route::post('/update_setup', 'AppController@updateSetup'); + + // vendor + Route::resource('vendors', 'VendorController'); + Route::get('api/vendors', 'VendorController@getDatatable'); + Route::post('vendors/bulk', 'VendorController@bulk'); + + // Expense + Route::resource('expenses', 'ExpenseController'); + Route::get('expenses/create/{vendor_id?}/{client_id?}/{category_id?}', 'ExpenseController@create'); + Route::get('expenses/{expenses}/clone', 'ExpenseController@cloneExpense'); + Route::get('api/expenses', 'ExpenseController@getDatatable'); + Route::get('api/expenses/{id}', 'ExpenseController@getDatatableVendor'); + Route::post('expenses/bulk', 'ExpenseController@bulk'); + Route::get('expense_categories', 'ExpenseCategoryController@index'); + Route::get('api/expense_categories', 'ExpenseCategoryController@getDatatable'); + Route::get('expense_categories/create', 'ExpenseCategoryController@create'); + Route::post('expense_categories', 'ExpenseCategoryController@store'); + Route::put('expense_categories/{expense_categories}', 'ExpenseCategoryController@update'); + Route::get('expense_categories/{expense_categories}/edit', 'ExpenseCategoryController@edit'); + Route::post('expense_categories/bulk', 'ExpenseCategoryController@bulk'); + + // BlueVine + Route::post('bluevine/signup', 'BlueVineController@signup'); + Route::get('bluevine/hide_message', 'BlueVineController@hideMessage'); + Route::get('bluevine/completed', 'BlueVineController@handleCompleted'); + + Route::get('white_label/hide_message', 'NinjaController@hideWhiteLabelMessage'); + Route::get('white_label/purchase', 'NinjaController@purchaseWhiteLabel'); + + Route::get('reports', 'ReportController@showReports'); + Route::post('reports', 'ReportController@showReports'); + Route::get('calendar', 'CalendarController@showCalendar'); + Route::get('calendar_events', 'CalendarController@loadEvents'); +}); + +Route::group([ + 'middleware' => ['lookup:user', 'auth:user', 'permissions.required'], + 'permissions' => 'admin', +], function () { + Route::get('api/users', 'UserController@getDatatable'); + Route::resource('users', 'UserController'); + Route::post('users/bulk', 'UserController@bulk'); + Route::get('send_confirmation/{user_id}', 'UserController@sendConfirmation'); + Route::get('/switch_account/{user_id}', 'UserController@switchAccount'); + Route::get('/account/{account_key}', 'UserController@viewAccountByKey'); + Route::get('/unlink_account/{user_account_id}/{user_id}', 'UserController@unlinkAccount'); + Route::get('/manage_companies', 'UserController@manageCompanies'); + Route::get('/errors', 'AppController@errors'); + + Route::get('api/tokens', 'TokenController@getDatatable'); + Route::resource('tokens', 'TokenController'); + Route::post('tokens/bulk', 'TokenController@bulk'); + + Route::get('api/tax_rates', 'TaxRateController@getDatatable'); + Route::resource('tax_rates', 'TaxRateController'); + Route::post('tax_rates/bulk', 'TaxRateController@bulk'); + + Route::get('settings/email_preview', 'AccountController@previewEmail'); + Route::post('settings/client_portal', 'AccountController@saveClientPortalSettings'); + Route::post('settings/email_settings', 'AccountController@saveEmailSettings'); + Route::get('company/{section}/{subSection?}', 'AccountController@redirectLegacy'); + Route::get('settings/data_visualizations', 'ReportController@d3'); + + Route::post('settings/change_plan', 'AccountController@changePlan'); + Route::post('settings/cancel_account', 'AccountController@cancelAccount'); + Route::post('settings/purge_data', 'AccountController@purgeData'); + Route::post('settings/company_details', 'AccountController@updateDetails'); + Route::post('settings/{section?}', 'AccountController@doSection'); + + Route::post('user/setTheme', 'UserController@setTheme'); + Route::post('remove_logo', 'AccountController@removeLogo'); + + Route::post('/export', 'ExportController@doExport'); + Route::post('/import', 'ImportController@doImport'); + Route::get('/cancel_import', 'ImportController@cancelImport'); + Route::post('/import_csv', 'ImportController@doImportCSV'); + + Route::get('gateways/create/{show_wepay?}', 'AccountGatewayController@create'); + Route::resource('gateways', 'AccountGatewayController'); + Route::get('gateways/{public_id}/resend_confirmation', 'AccountGatewayController@resendConfirmation'); + Route::get('api/gateways', 'AccountGatewayController@getDatatable'); + Route::post('account_gateways/bulk', 'AccountGatewayController@bulk'); + + Route::get('payment_terms', 'PaymentTermController@index'); + Route::get('api/payment_terms', 'PaymentTermController@getDatatable'); + Route::get('payment_terms/create', 'PaymentTermController@create'); + Route::post('payment_terms', 'PaymentTermController@store'); + Route::put('payment_terms/{payment_terms}', 'PaymentTermController@update'); + Route::get('payment_terms/{payment_terms}/edit', 'PaymentTermController@edit'); + Route::post('payment_terms/bulk', 'PaymentTermController@bulk'); + + Route::get('bank_accounts/import_ofx', 'BankAccountController@showImportOFX'); + Route::post('bank_accounts/import_ofx', 'BankAccountController@doImportOFX'); + Route::resource('bank_accounts', 'BankAccountController'); + Route::get('api/bank_accounts', 'BankAccountController@getDatatable'); + Route::post('bank_accounts/bulk', 'BankAccountController@bulk'); + Route::post('bank_accounts/validate', 'BankAccountController@validateAccount'); + Route::post('bank_accounts/import_expenses/{bank_id}', 'BankAccountController@importExpenses'); + Route::get('self-update', 'SelfUpdateController@index'); + Route::post('self-update', 'SelfUpdateController@update'); + Route::get('self-update/download', 'SelfUpdateController@download'); +}); + +Route::group(['middleware' => ['lookup:user', 'auth:user']], function () { + Route::get('settings/{section?}', 'AccountController@showSection'); +}); + +// Redirects for legacy links +Route::get('/rocksteady', function () { + return Redirect::to(NINJA_WEB_URL, 301); +}); +Route::get('/about', function () { + return Redirect::to(NINJA_WEB_URL, 301); +}); +Route::get('/contact', function () { + return Redirect::to(NINJA_WEB_URL.'/contact', 301); +}); +Route::get('/plans', function () { + return Redirect::to(NINJA_WEB_URL.'/pricing', 301); +}); +Route::get('/faq', function () { + return Redirect::to(NINJA_WEB_URL.'/how-it-works', 301); +}); +Route::get('/features', function () { + return Redirect::to(NINJA_WEB_URL.'/features', 301); +}); +Route::get('/testimonials', function () { + return Redirect::to(NINJA_WEB_URL, 301); +}); +Route::get('/compare-online-invoicing{sites?}', function () { + return Redirect::to(NINJA_WEB_URL, 301); +}); +Route::get('/forgot', function () { + return Redirect::to(NINJA_APP_URL.'/recover_password', 301); +}); +Route::get('/feed', function () { + return Redirect::to(NINJA_WEB_URL.'/feed', 301); +}); +Route::get('/comments/feed', function () { + return Redirect::to(NINJA_WEB_URL.'/comments/feed', 301); +}); +Route::get('/terms', function () { + return Redirect::to(NINJA_WEB_URL.'/terms', 301); +}); + +/* +if (Utils::isNinjaDev()) +{ + //ini_set('memory_limit','1024M'); + //set_time_limit(0); + Auth::loginUsingId(1); +} +*/ + +// Include static app constants +require_once app_path() . '/Constants.php'; From 3439aa9a06e00094067461667bde6c8b23bb52a5 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 14:51:02 +0200 Subject: [PATCH 032/167] Check subdomain is uniuqe across dbs --- app/Console/Commands/InitLookup.php | 34 +++++++++++++++++-- app/Http/Controllers/AccountController.php | 13 +++++-- app/Models/LookupAccount.php | 22 ++++++++++++ ..._11_15_114422_add_subdomain_to_lookups.php | 32 +++++++++++++++++ resources/lang/en/texts.php | 1 + 5 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 database/migrations/2017_11_15_114422_add_subdomain_to_lookups.php diff --git a/app/Console/Commands/InitLookup.php b/app/Console/Commands/InitLookup.php index aa52ec4f4a35..f37de078be2f 100644 --- a/app/Console/Commands/InitLookup.php +++ b/app/Console/Commands/InitLookup.php @@ -21,7 +21,7 @@ class InitLookup extends Command * * @var string */ - protected $signature = 'ninja:init-lookup {--truncate=} {--validate=} {--update=} {--company_id=} {--page_size=100} {--database=db-ninja-1}'; + protected $signature = 'ninja:init-lookup {--truncate=} {--subdomain} {--validate=} {--update=} {--company_id=} {--page_size=100} {--database=db-ninja-1}'; /** * The console command description. @@ -57,9 +57,12 @@ class InitLookup extends Command $database = $this->option('database'); $dbServer = DbServer::whereName($database)->first(); - if ($this->option('truncate')) { + if ($this->option('subdomain')) { + $this->logMessage('Updating subdomains...'); + $this->popuplateSubdomains(); + } else if ($this->option('truncate')) { + $this->logMessage('Truncating data...'); $this->truncateTables(); - $this->logMessage('Truncated'); } else { config(['database.default' => $this->option('database')]); @@ -87,6 +90,30 @@ class InitLookup extends Command } } + private function popuplateSubdomains() + { + $data = []; + + config(['database.default' => $this->option('database')]); + + $accounts = DB::table('accounts') + ->orderBy('id') + ->where('subdomain', '!=', '') + ->get(['account_key', 'subdomain']); + foreach ($accounts as $account) { + $data[$account->account_key] = $account->subdomain; + } + + config(['database.default' => DB_NINJA_LOOKUP]); + + $validate = $this->option('validate'); + $update = $this->option('update'); + + foreach ($data as $accountKey => $subdomain) { + LookupAccount::whereAccountKey($accountKey)->update(['subdomain' => $subdomain]); + } + } + private function initCompanies($dbServerId, $offset = 0) { $data = []; @@ -340,6 +367,7 @@ class InitLookup extends Command protected function getOptions() { return [ + ['subdomain', null, InputOption::VALUE_OPTIONAL, 'Subdomain', null], ['truncate', null, InputOption::VALUE_OPTIONAL, 'Truncate', null], ['company_id', null, InputOption::VALUE_OPTIONAL, 'Company Id', null], ['page_size', null, InputOption::VALUE_OPTIONAL, 'Page Size', null], diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index f41b9e4cadf3..64b553e58732 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -769,11 +769,20 @@ class AccountController extends BaseController */ public function saveClientPortalSettings(SaveClientPortalSettings $request) { - $account = $request->user()->account; - if($account->subdomain !== $request->subdomain) + // check subdomain is unique in the lookup tables + if (request()->subdomain) { + if (! \App\Models\LookupAccount::validateField('subdomain', request()->subdomain, $account)) { + return Redirect::to('settings/' . ACCOUNT_CLIENT_PORTAL) + ->withError(trans('texts.subdomain_taken')) + ->withInput(); + } + } + + if ($account->subdomain !== $request->subdomain) { event(new SubdomainWasUpdated($account)); + } $account->fill($request->all()); $account->client_view_css = $request->client_view_css; diff --git a/app/Models/LookupAccount.php b/app/Models/LookupAccount.php index 7d5cd8e8c12d..605769de00c6 100644 --- a/app/Models/LookupAccount.php +++ b/app/Models/LookupAccount.php @@ -55,4 +55,26 @@ class LookupAccount extends LookupModel return $this->lookupCompany->dbServer->name; } + public static function validateField($field, $value, $account = false) + { + if (! env('MULTI_DB_ENABLED')) { + return true; + } + + $current = config('database.default'); + + config(['database.default' => DB_NINJA_LOOKUP]); + + $lookupAccount = LookupAccount::where($field, '=', $value)->first(); + + if ($account) { + $isValid = ! $lookupAccount || ($lookupAccount->account_key == $account->account_key); + } else { + $isValid = ! $lookupAccount; + } + + config(['database.default' => $current]); + + return $isValid; + } } diff --git a/database/migrations/2017_11_15_114422_add_subdomain_to_lookups.php b/database/migrations/2017_11_15_114422_add_subdomain_to_lookups.php new file mode 100644 index 000000000000..ce88a26b08e4 --- /dev/null +++ b/database/migrations/2017_11_15_114422_add_subdomain_to_lookups.php @@ -0,0 +1,32 @@ +string('subdomain')->nullable()->unique(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('lookup_accounts', function ($table) { + $table->dropColumn('subdomain'); + }); + } +} diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 315cbc56786c..cda9b7ff7225 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2522,6 +2522,7 @@ $LANG = array( 'set_self_hoat_url' => 'Self-Host URL', 'local_storage_required' => 'Error: local storage is not available.', 'your_password_reset_link' => 'Your Password Reset Link', + 'subdomain_taken' => 'The subdomain is already in use', ); From 82286a23394fc64f6d4740995526c4329d6ccee7 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 14:59:20 +0200 Subject: [PATCH 033/167] Check subdomain is uniuqe across dbs --- .../Requests/SaveClientPortalSettings.php | 2 +- app/Models/Account.php | 7 +++++++ app/Models/LookupAccount.php | 20 ++++++++++++++++++- .../views/accounts/client_portal.blade.php | 2 +- 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/app/Http/Requests/SaveClientPortalSettings.php b/app/Http/Requests/SaveClientPortalSettings.php index cd81bf7d31dd..00a239c590b7 100644 --- a/app/Http/Requests/SaveClientPortalSettings.php +++ b/app/Http/Requests/SaveClientPortalSettings.php @@ -44,7 +44,7 @@ class SaveClientPortalSettings extends Request if (Utils::isNinja()) { if ($this->custom_link == 'subdomain') { $subdomain = substr(strtolower($input['subdomain']), 0, MAX_SUBDOMAIN_LENGTH); - $input['subdomain'] = preg_replace('/[^a-zA-Z0-9_\-\.]/', '', $subdomain); + $input['subdomain'] = preg_replace('/[^a-zA-Z0-9\-\.]/', '', $subdomain); $input['iframe_url'] = null; } else { $iframeURL = substr(strtolower($input['iframe_url']), 0, MAX_IFRAME_URL_LENGTH); diff --git a/app/Models/Account.php b/app/Models/Account.php index 61643b68df36..118dedc22880 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -1711,6 +1711,13 @@ Account::creating(function ($account) LookupAccount::createAccount($account->account_key, $account->company_id); }); +Account::updating(function ($account) { + $dirty = $account->getDirty(); + if (array_key_exists('subdomain', $dirty)) { + LookupAccount::updateAccount($account->account_key, $account); + } +}); + Account::updated(function ($account) { // prevent firing event if the invoice/quote counter was changed // TODO: remove once counters are moved to separate table diff --git a/app/Models/LookupAccount.php b/app/Models/LookupAccount.php index 605769de00c6..65c45360786c 100644 --- a/app/Models/LookupAccount.php +++ b/app/Models/LookupAccount.php @@ -55,6 +55,24 @@ class LookupAccount extends LookupModel return $this->lookupCompany->dbServer->name; } + public static function updateAccount($accountKey, $account) + { + if (! env('MULTI_DB_ENABLED')) { + return; + } + + $current = config('database.default'); + config(['database.default' => DB_NINJA_LOOKUP]); + + $lookupAccount = LookupAccount::whereAccountKey($accountKey) + ->firstOrFail(); + + $lookupAccount->subdomain = $account->subdomain; + $lookupAccount->save(); + + config(['database.default' => $current]); + } + public static function validateField($field, $value, $account = false) { if (! env('MULTI_DB_ENABLED')) { @@ -62,7 +80,7 @@ class LookupAccount extends LookupModel } $current = config('database.default'); - + config(['database.default' => DB_NINJA_LOOKUP]); $lookupAccount = LookupAccount::where($field, '=', $value)->first(); diff --git a/resources/views/accounts/client_portal.blade.php b/resources/views/accounts/client_portal.blade.php index 26a1e5d86803..ce767f19a826 100644 --- a/resources/views/accounts/client_portal.blade.php +++ b/resources/views/accounts/client_portal.blade.php @@ -467,7 +467,7 @@ iframe.src = '{{ rtrim(SITE_URL ,'/') }}/view/' var input = $('#subdomain'); var val = input.val(); if (!val) return; - val = val.replace(/[^a-zA-Z0-9_\-]/g, '').toLowerCase().substring(0, {{ MAX_SUBDOMAIN_LENGTH }}); + val = val.replace(/[^a-zA-Z0-9\-]/g, '').toLowerCase().substring(0, {{ MAX_SUBDOMAIN_LENGTH }}); input.val(val); } From 6f84163914baa0210a45a4e3ec802646b1054df6 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 16:08:29 +0200 Subject: [PATCH 034/167] Update login page text --- resources/lang/en/texts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 315cbc56786c..bb06ded51e62 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2110,7 +2110,7 @@ $LANG = array( // Updated login screen 'ninja_tagline' => 'Create. Send. Get Paid.', - 'login_or_existing' => 'Or login with an existing account.', + 'login_or_existing' => 'Or login with a connected account.', 'sign_up_now' => 'Sign Up Now', 'not_a_member_yet' => 'Not a member yet?', 'login_create_an_account' => 'Create an Account!', From ca3523f93e74d858d81ae52eb54dc7127d7f36ba Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 16:17:06 +0200 Subject: [PATCH 035/167] Route fixes --- app/Http/Kernel.php | 6 ++- app/Providers/RouteServiceProvider.php | 4 +- routes/api.php | 66 +++++++++++++------------- 3 files changed, 39 insertions(+), 37 deletions(-) diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 5762a895c229..00d43c9831b3 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -34,10 +34,15 @@ class Kernel extends HttpKernel \App\Http\Middleware\QueryLogging::class, \App\Http\Middleware\StartupCheck::class, ], + 'api' => [ + \App\Http\Middleware\ApiCheck::class, + ], + /* 'api' => [ 'throttle:60,1', 'bindings', ], + */ ]; /** @@ -56,6 +61,5 @@ class Kernel extends HttpKernel 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'lookup' => \App\Http\Middleware\DatabaseLookup::class, 'permissions.required' => \App\Http\Middleware\PermissionsRequired::class, - 'api' => \App\Http\Middleware\ApiCheck::class, ]; } diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 87ffb05a9faf..7331eed87370 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -69,9 +69,9 @@ class RouteServiceProvider extends ServiceProvider protected function mapApiRoutes() { Route::group([ - 'middleware' => 'api', + 'middleware' => ['lookup:api', 'api'], 'namespace' => $this->namespace, - 'prefix' => 'api', + 'prefix' => 'api/v1', ], function ($router) { require base_path('routes/api.php'); }); diff --git a/routes/api.php b/routes/api.php index 492eb892562b..ac10161238ff 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,36 +1,34 @@ ['lookup:api', 'api'], 'prefix' => 'api/v1'], function () { - Route::get('ping', 'AccountApiController@ping'); - Route::post('login', 'AccountApiController@login'); - Route::post('oauth_login', 'AccountApiController@oauthLogin'); - Route::post('register', 'AccountApiController@register'); - Route::get('static', 'AccountApiController@getStaticData'); - Route::get('accounts', 'AccountApiController@show'); - Route::put('accounts', 'AccountApiController@update'); - Route::resource('clients', 'ClientApiController'); - Route::resource('contacts', 'ContactApiController'); - Route::get('quotes', 'QuoteApiController@index'); - Route::get('download/{invoice_id}', 'InvoiceApiController@download'); - Route::resource('invoices', 'InvoiceApiController'); - Route::resource('payments', 'PaymentApiController'); - Route::resource('tasks', 'TaskApiController'); - Route::resource('credits', 'CreditApiController'); - Route::post('hooks', 'IntegrationController@subscribe'); - Route::post('email_invoice', 'InvoiceApiController@emailInvoice'); - Route::get('user_accounts', 'AccountApiController@getUserAccounts'); - Route::resource('products', 'ProductApiController'); - Route::resource('projects', 'ProjectApiController'); - Route::resource('tax_rates', 'TaxRateApiController'); - Route::resource('users', 'UserApiController'); - Route::resource('expenses', 'ExpenseApiController'); - Route::post('add_token', 'AccountApiController@addDeviceToken'); - Route::post('remove_token', 'AccountApiController@removeDeviceToken'); - Route::post('update_notifications', 'AccountApiController@updatePushNotifications'); - Route::get('dashboard', 'DashboardApiController@index'); - Route::resource('documents', 'DocumentAPIController'); - Route::resource('vendors', 'VendorApiController'); - Route::resource('expense_categories', 'ExpenseCategoryApiController'); - Route::post('ios_subscription_status', 'AccountApiController@iosSubscriptionStatus'); -}); +Route::get('ping', 'AccountApiController@ping'); +Route::post('login', 'AccountApiController@login'); +Route::post('oauth_login', 'AccountApiController@oauthLogin'); +Route::post('register', 'AccountApiController@register'); +Route::get('static', 'AccountApiController@getStaticData'); +Route::get('accounts', 'AccountApiController@show'); +Route::put('accounts', 'AccountApiController@update'); + +Route::resource('clients', 'ClientApiController'); +Route::resource('contacts', 'ContactApiController'); +Route::get('quotes', 'QuoteApiController@index'); +Route::get('download/{invoice_id}', 'InvoiceApiController@download'); +Route::resource('invoices', 'InvoiceApiController'); +Route::resource('payments', 'PaymentApiController'); +Route::resource('tasks', 'TaskApiController'); +Route::resource('credits', 'CreditApiController'); +Route::post('hooks', 'IntegrationController@subscribe'); +Route::post('email_invoice', 'InvoiceApiController@emailInvoice'); +Route::get('user_accounts', 'AccountApiController@getUserAccounts'); +Route::resource('products', 'ProductApiController'); +Route::resource('projects', 'ProjectApiController'); +Route::resource('tax_rates', 'TaxRateApiController'); +Route::resource('users', 'UserApiController'); +Route::resource('expenses', 'ExpenseApiController'); +Route::post('add_token', 'AccountApiController@addDeviceToken'); +Route::post('remove_token', 'AccountApiController@removeDeviceToken'); +Route::post('update_notifications', 'AccountApiController@updatePushNotifications'); +Route::get('dashboard', 'DashboardApiController@index'); +Route::resource('documents', 'DocumentAPIController'); +Route::resource('vendors', 'VendorApiController'); +Route::resource('expense_categories', 'ExpenseCategoryApiController'); +Route::post('ios_subscription_status', 'AccountApiController@iosSubscriptionStatus'); From 7c1c8898a0b9a7a7fc65b1a6f87a57b4bf51fd2e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 20:05:31 +0200 Subject: [PATCH 036/167] Fix tests --- app/Http/Kernel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 00d43c9831b3..e5053551dcd6 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -53,7 +53,7 @@ class Kernel extends HttpKernel * @var array */ protected $routeMiddleware = [ - 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, + 'auth' => \App\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, From bf1f540fdf950cd6c17d4b297ccdb8f42beb7588 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 20:26:51 +0200 Subject: [PATCH 037/167] Support clients logging in with email/password --- .../ClientAuth/LoginController.php | 75 +++++++++++++++---- .../Controllers/ClientPortalController.php | 2 +- app/Http/Middleware/DatabaseLookup.php | 2 + app/Models/LookupAccount.php | 2 +- app/Ninja/Presenters/AccountPresenter.php | 27 +++++++ resources/lang/en/texts.php | 3 +- .../views/accounts/client_portal.blade.php | 4 + resources/views/clientauth/login.blade.php | 5 +- 8 files changed, 100 insertions(+), 20 deletions(-) diff --git a/app/Http/Controllers/ClientAuth/LoginController.php b/app/Http/Controllers/ClientAuth/LoginController.php index becb723d593d..a6a779b43936 100644 --- a/app/Http/Controllers/ClientAuth/LoginController.php +++ b/app/Http/Controllers/ClientAuth/LoginController.php @@ -2,10 +2,13 @@ namespace App\Http\Controllers\ClientAuth; +use Utils; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\Contact; +use App\Models\Account; use Illuminate\Foundation\Auth\AuthenticatesUsers; +use Illuminate\Contracts\Auth\Authenticatable; class LoginController extends Controller { @@ -54,15 +57,22 @@ class LoginController extends Controller */ public function showLoginForm() { + $subdomain = Utils::getSubdomain(\Request::server('HTTP_HOST')); + $hasAccountIndentifier = request()->account_key || ($subdomain && $subdomain != 'app'); + if (! session('contact_key')) { - return redirect('/client/session_expired'); + if (Utils::isNinja()) { + if (! $hasAccountIndentifier) { + return redirect('/client/session_expired'); + } + } else { + if (! $hasAccountIndentifier && Account::count() > 1) { + return redirect('/client/session_expired'); + } + } } - $data = [ - 'clientauth' => true, - ]; - - return view('clientauth.login')->with($data); + return view('clientauth.login')->with(['clientauth' => true]); } /** @@ -74,20 +84,47 @@ class LoginController extends Controller */ protected function credentials(Request $request) { - $credentials = $request->only('password'); - $credentials['id'] = null; + if ($contactKey = session('contact_key')) { + $credentials = $request->only('password'); + $credentials['contact_key'] = $contactKey; + } else { + $credentials = $request->only('email', 'password'); + $account = false; - $contactKey = session('contact_key'); - if ($contactKey) { - $contact = Contact::where('contact_key', '=', $contactKey)->first(); - if ($contact && ! $contact->is_deleted) { - $credentials['id'] = $contact->id; + // resovle the email to a contact/account + if ($accountKey = request()->account_key) { + $account = Account::whereAccountKey($accountKey)->first(); + } else { + $subdomain = Utils::getSubdomain(\Request::server('HTTP_HOST')); + if ($subdomain != 'app') { + $account = Account::whereSubdomain($subdomain)->first(); + } + } + + if ($account) { + $credentials['account_id'] = $account->id; + } else { + abort(500, 'Account not resolved in client login'); } } return $credentials; } + /** + * Send the post-authentication response. + * + * @param \Illuminate\Http\Request $request + * @param \Illuminate\Contracts\Auth\Authenticatable $user + * @return \Illuminate\Http\Response + */ + private function authenticated(Request $request, Authenticatable $contact) + { + session(['contact_key' => $contact->contact_key]); + + return redirect()->intended($this->redirectPath()); + } + /** * Get the failed login response instance. * @@ -101,7 +138,7 @@ class LoginController extends Controller ->withErrors([ $this->username() => trans('texts.invalid_credentials'), ]); - } + } /** * Validate the user login request - don't require the email @@ -112,9 +149,15 @@ class LoginController extends Controller */ protected function validateLogin(Request $request) { - $this->validate($request, [ + $rules = [ 'password' => 'required', - ]); + ]; + + if (! session('contact_key')) { + $rules['email'] = 'required|email'; + } + + $this->validate($request, $rules); } /** diff --git a/app/Http/Controllers/ClientPortalController.php b/app/Http/Controllers/ClientPortalController.php index 6d0d5b1ad0cd..0a874a514a4d 100644 --- a/app/Http/Controllers/ClientPortalController.php +++ b/app/Http/Controllers/ClientPortalController.php @@ -601,7 +601,7 @@ class ClientPortalController extends BaseController return response()->view('error', [ 'error' => $error ?: trans('texts.invoice_not_found'), 'hideHeader' => true, - 'account' => $this->getContact()->account, + 'account' => $this->getContact() ? $this->getContact()->account : false, ]); } diff --git a/app/Http/Middleware/DatabaseLookup.php b/app/Http/Middleware/DatabaseLookup.php index 27f2d648300a..d76f56e69515 100644 --- a/app/Http/Middleware/DatabaseLookup.php +++ b/app/Http/Middleware/DatabaseLookup.php @@ -44,6 +44,8 @@ class DatabaseLookup LookupInvitation::setServerByField('invitation_key', $key); } elseif ($key = request()->contact_key ?: session('contact_key')) { LookupContact::setServerByField('contact_key', $key); + } elseif ($key = request()->account_key) { + LookupAccount::setServerByField('account_key', $key); } } elseif ($guard == 'postmark') { LookupInvitation::setServerByField('message_id', request()->MessageID); diff --git a/app/Models/LookupAccount.php b/app/Models/LookupAccount.php index 65c45360786c..ae682bcf56c5 100644 --- a/app/Models/LookupAccount.php +++ b/app/Models/LookupAccount.php @@ -67,7 +67,7 @@ class LookupAccount extends LookupModel $lookupAccount = LookupAccount::whereAccountKey($accountKey) ->firstOrFail(); - $lookupAccount->subdomain = $account->subdomain; + $lookupAccount->subdomain = $account->subdomain ?: null; $lookupAccount->save(); config(['database.default' => $current]); diff --git a/app/Ninja/Presenters/AccountPresenter.php b/app/Ninja/Presenters/AccountPresenter.php index b3f3e07ad2c0..df806c981c79 100644 --- a/app/Ninja/Presenters/AccountPresenter.php +++ b/app/Ninja/Presenters/AccountPresenter.php @@ -236,4 +236,31 @@ class AccountPresenter extends Presenter return $data; } + + public function clientLoginUrl() + { + $account = $this->entity; + + if (Utils::isNinjaProd()) { + $url = 'https://'; + $url .= $account->subdomain ?: 'app'; + $url .= '.' . Domain::getDomainFromId($account->domain_id); + } else { + $url = SITE_URL; + } + + $url .= '/client/login'; + + if (Utils::isNinja()) { + if (! $account->subdomain) { + $url .= '?account_key=' . $account->account_key; + } + } else { + if (Account::count() > 1) { + $url .= '?account_key=' . $account->account_key; + } + } + + return $url; + } } diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 2ccb13ff2882..f00c4d867bb7 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -1050,7 +1050,7 @@ $LANG = array( // Client Passwords 'enable_portal_password' => 'Password Protect Invoices', 'enable_portal_password_help' => 'Allows you to set a password for each contact. If a password is set, the contact will be required to enter a password before viewing invoices.', - 'send_portal_password' => 'Generate Password Automatically', + 'send_portal_password' => 'Generate Automatically', 'send_portal_password_help' => 'If no password is set, one will be generated and sent with the first invoice.', 'expired' => 'Expired', @@ -2523,6 +2523,7 @@ $LANG = array( 'local_storage_required' => 'Error: local storage is not available.', 'your_password_reset_link' => 'Your Password Reset Link', 'subdomain_taken' => 'The subdomain is already in use', + 'client_login' => 'Client Login', ); diff --git a/resources/views/accounts/client_portal.blade.php b/resources/views/accounts/client_portal.blade.php index ce767f19a826..8a10a53d6e25 100644 --- a/resources/views/accounts/client_portal.blade.php +++ b/resources/views/accounts/client_portal.blade.php @@ -170,6 +170,10 @@ ->label(trans('texts.send_portal_password')) ->value(1) !!}
+
+ {!! Former::plaintext('client_login') + ->value(link_to($account->present()->clientLoginUrl, null, ['target' => '_blank'])) !!} +
diff --git a/resources/views/clientauth/login.blade.php b/resources/views/clientauth/login.blade.php index 8835c6525bcb..860869d3b7a4 100644 --- a/resources/views/clientauth/login.blade.php +++ b/resources/views/clientauth/login.blade.php @@ -6,7 +6,7 @@
- {!! Former::open('client/login') + {!! Former::open() ->rules(['password' => 'required']) ->addClass('form-signin') !!} @@ -37,6 +37,9 @@ {{ Former::populateField('remember', 'true') }}
+ @if (! session('contact_key')) + {!! Former::text('email')->placeholder(trans('texts.email'))->raw() !!} + @endif {!! Former::password('password')->placeholder(trans('texts.password'))->raw() !!}
{!! Former::hidden('remember')->raw() !!} From c8192f392b862bbea9b2dc4b044fa399e9083e49 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 21:09:43 +0200 Subject: [PATCH 038/167] Use subdomain in db lookup --- app/Http/Middleware/DatabaseLookup.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Http/Middleware/DatabaseLookup.php b/app/Http/Middleware/DatabaseLookup.php index d76f56e69515..345a063805a2 100644 --- a/app/Http/Middleware/DatabaseLookup.php +++ b/app/Http/Middleware/DatabaseLookup.php @@ -10,6 +10,7 @@ use App\Models\LookupInvitation; use App\Models\LookupAccountToken; use App\Models\LookupUser; use Auth; +use Utils; class DatabaseLookup { @@ -46,6 +47,11 @@ class DatabaseLookup LookupContact::setServerByField('contact_key', $key); } elseif ($key = request()->account_key) { LookupAccount::setServerByField('account_key', $key); + } else { + $subdomain = Utils::getSubdomain(\Request::server('HTTP_HOST')); + if ($subdomain != 'app') { + LookupAccount::setServerByField('subdomain', $subdomain); + } } } elseif ($guard == 'postmark') { LookupInvitation::setServerByField('message_id', request()->MessageID); From 2d49c472c07540837e1cb2513b5f5f6e777f3e59 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 21:49:42 +0200 Subject: [PATCH 039/167] Allow projects with the same name --- app/Http/Requests/CreateProjectRequest.php | 2 +- app/Http/Requests/UpdateProjectRequest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Requests/CreateProjectRequest.php b/app/Http/Requests/CreateProjectRequest.php index cf6d6da316fc..2d354a100a76 100644 --- a/app/Http/Requests/CreateProjectRequest.php +++ b/app/Http/Requests/CreateProjectRequest.php @@ -22,7 +22,7 @@ class CreateProjectRequest extends ProjectRequest public function rules() { return [ - 'name' => sprintf('required|unique:projects,name,,id,account_id,%s', $this->user()->account_id), + 'name' => 'required', 'client_id' => 'required', ]; } diff --git a/app/Http/Requests/UpdateProjectRequest.php b/app/Http/Requests/UpdateProjectRequest.php index 84639fd18d88..bf6b3117fee6 100644 --- a/app/Http/Requests/UpdateProjectRequest.php +++ b/app/Http/Requests/UpdateProjectRequest.php @@ -26,7 +26,7 @@ class UpdateProjectRequest extends ProjectRequest } return [ - 'name' => sprintf('required|unique:projects,name,%s,id,account_id,%s', $this->entity()->id, $this->user()->account_id), + 'name' => 'required', ]; } } From f1453fe9a32945ff779cf608974ba538b3c17c26 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 16 Nov 2017 20:58:06 +0200 Subject: [PATCH 040/167] Credit card limits not respected in 3.9? #1745 --- app/Models/EntityModel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/EntityModel.php b/app/Models/EntityModel.php index 96ebdd2f527d..79175a43d79e 100644 --- a/app/Models/EntityModel.php +++ b/app/Models/EntityModel.php @@ -161,7 +161,7 @@ class EntityModel extends Eloquent $query->where($this->getTable() .'.account_id', '=', $accountId); - if (func_num_args() > 1 && ! $publicId) { + if (func_num_args() > 1 && ! $publicId && ! $accountId) { $query->where('id', '=', 0); return $query; } From dbf136ba4177d46b1b2f748157337c0155d24fb7 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 16 Nov 2017 21:02:36 +0200 Subject: [PATCH 041/167] Add comment --- app/Models/EntityModel.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Models/EntityModel.php b/app/Models/EntityModel.php index 79175a43d79e..ba7a9ce088c4 100644 --- a/app/Models/EntityModel.php +++ b/app/Models/EntityModel.php @@ -161,6 +161,7 @@ class EntityModel extends Eloquent $query->where($this->getTable() .'.account_id', '=', $accountId); + // If 'false' is passed as the publicId return nothing rather than everything if (func_num_args() > 1 && ! $publicId && ! $accountId) { $query->where('id', '=', 0); return $query; From 57757cdb0002a28016ba720b3c37c1569eddb0c7 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 17 Nov 2017 13:56:10 +0200 Subject: [PATCH 042/167] Support converting payment currency --- app/Models/Payment.php | 11 + app/Ninja/Repositories/PaymentRepository.php | 7 +- ..._11_15_114422_add_subdomain_to_lookups.php | 15 ++ public/built.js | 46 ++-- public/built.js.map | 2 +- resources/assets/js/script.js | 95 -------- resources/views/expenses/edit.blade.php | 5 +- resources/views/payments/edit.blade.php | 210 +++++++++++++++++- 8 files changed, 264 insertions(+), 127 deletions(-) diff --git a/app/Models/Payment.php b/app/Models/Payment.php index e1556b7d6046..e7332f5e047b 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -23,7 +23,10 @@ class Payment extends EntityModel * @var array */ protected $fillable = [ + 'transaction_reference', 'private_notes', + 'exchange_rate', + 'exchange_currency_id', ]; public static $statusClasses = [ @@ -303,6 +306,14 @@ class Payment extends EntityModel return $this->getCompletedAmount() > 0 && ($this->isCompleted() || $this->isPartiallyRefunded()); } + /** + * @return bool + */ + public function isExchanged() + { + return $this->exchange_currency_id || $this->exchange_rate != 1; + } + /** * @return mixed|null|\stdClass|string */ diff --git a/app/Ninja/Repositories/PaymentRepository.php b/app/Ninja/Repositories/PaymentRepository.php index 1cb48cb64819..06f019a143ac 100644 --- a/app/Ninja/Repositories/PaymentRepository.php +++ b/app/Ninja/Repositories/PaymentRepository.php @@ -187,12 +187,7 @@ class PaymentRepository extends BaseRepository $payment->payment_date = date('Y-m-d'); } - if (isset($input['transaction_reference'])) { - $payment->transaction_reference = trim($input['transaction_reference']); - } - if (isset($input['private_notes'])) { - $payment->private_notes = trim($input['private_notes']); - } + $payment->fill(request()->all()); if (! $publicId) { $clientId = $input['client_id']; diff --git a/database/migrations/2017_11_15_114422_add_subdomain_to_lookups.php b/database/migrations/2017_11_15_114422_add_subdomain_to_lookups.php index ce88a26b08e4..773e4c2981db 100644 --- a/database/migrations/2017_11_15_114422_add_subdomain_to_lookups.php +++ b/database/migrations/2017_11_15_114422_add_subdomain_to_lookups.php @@ -16,6 +16,16 @@ class AddSubdomainToLookups extends Migration Schema::table('lookup_accounts', function ($table) { $table->string('subdomain')->nullable()->unique(); }); + + Schema::table('payments', function ($table) { + $table->decimal('exchange_rate', 13, 4)->default(1); + $table->unsignedInteger('exchange_currency_id')->nullable(false); + }); + + Schema::table('expenses', function ($table) { + $table->decimal('exchange_rate', 13, 4)->default(1)->change(); + }); + } /** @@ -28,5 +38,10 @@ class AddSubdomainToLookups extends Migration Schema::table('lookup_accounts', function ($table) { $table->dropColumn('subdomain'); }); + + Schema::table('payments', function ($table) { + $table->dropColumn('exchange_rate'); + $table->dropColumn('exchange_currency_id'); + }); } } diff --git a/public/built.js b/public/built.js index 6007b2b89e15..4f0abe5b02b7 100644 --- a/public/built.js +++ b/public/built.js @@ -1,26 +1,26 @@ -function generatePDF(t,e,n,i){if(t&&e){if(!n)return refreshTimer&&clearTimeout(refreshTimer),void(refreshTimer=setTimeout(function(){generatePDF(t,e,!0,i)},500));refreshTimer=null,t=calculateAmounts(t);var o=GetPdfMake(t,e,i);return i&&o.getDataUrl(i),o}}function copyObject(t){return!!t&&JSON.parse(JSON.stringify(t))}function processVariables(t){if(!t)return"";for(var e=["MONTH","QUARTER","YEAR"],n=0;n1?c=r.split("+")[1]:r.split("-").length>1&&(c=parseInt(r.split("-")[1])*-1),t=t.replace(r,getDatePart(i,c))}}return t}function getDatePart(t,e){return e=parseInt(e),e||(e=0),"MONTH"==t?getMonth(e):"QUARTER"==t?getQuarter(e):"YEAR"==t?getYear(e):void 0}function getMonth(t){var e=new Date,n=["January","February","March","April","May","June","July","August","September","October","November","December"],i=e.getMonth();return i=parseInt(i)+t,i%=12,i<0&&(i+=12),n[i]}function getYear(t){var e=new Date,n=e.getFullYear();return parseInt(n)+t}function getQuarter(t){var e=new Date,n=Math.floor((e.getMonth()+3)/3);return n+=t,n%=4,0==n&&(n=4),"Q"+n}function isStorageSupported(){try{return"localStorage"in window&&null!==window.localStorage}catch(t){return!1}}function isValidEmailAddress(t){var e=new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);return e.test(t)}function enableHoverClick(t,e,n){}function setAsLink(t,e){e?(t.css("text-decoration","underline"),t.css("cursor","pointer")):(t.css("text-decoration","none"),t.css("cursor","text"))}function setComboboxValue(t,e,n){t.find("input").val(e),t.find("input.form-control").val(n),e&&n?(t.find("select").combobox("setSelected"),t.find(".combobox-container").addClass("combobox-selected")):t.find(".combobox-container").removeClass("combobox-selected")}function convertDataURIToBinary(t){var e=t.indexOf(BASE64_MARKER)+BASE64_MARKER.length,n=t.substring(e);return base64DecToArr(n)}function comboboxHighlighter(t){var e=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),n=t.replace(new RegExp("
","g"),"\n");return n=_.escape(n),n=n.replace(new RegExp("("+e+")","ig"),function(t,n){return n?""+n+"":e}),n.replace(new RegExp("\n","g"),"
")}function inIframe(){try{return window.self!==window.top}catch(t){return!0}}function getContactDisplayName(t){return t.first_name||t.last_name?$.trim((t.first_name||"")+" "+(t.last_name||"")):t.email}function getContactDisplayNameWithEmail(t){var e="";return(t.first_name||t.last_name)&&(e+=$.trim((t.first_name||"")+" "+(t.last_name||""))),t.email&&(e&&(e+=" - "),e+=t.email),$.trim(e)}function getClientDisplayName(t){var e=!!t.contacts&&t.contacts[0];return t.name?t.name:e?getContactDisplayName(e):""}function populateInvoiceComboboxes(t,e){for(var n={},i={},o={},a=$("select#client"),s=0;s1?t+=", ":n64&&t<91?t-65:t>96&&t<123?t-71:t>47&&t<58?t+4:43===t?62:47===t?63:0}function base64DecToArr(t,e){for(var n,i,o=t.replace(/[^A-Za-z0-9\+\/]/g,""),a=o.length,s=e?Math.ceil((3*a+1>>2)/e)*e:3*a+1>>2,r=new Uint8Array(s),c=0,l=0,u=0;u>>(16>>>n&24)&255;c=0}return r}function uint6ToB64(t){return t<26?t+65:t<52?t+71:t<62?t-4:62===t?43:63===t?47:65}function base64EncArr(t){for(var e=2,n="",i=t.length,o=0,a=0;a0&&4*a/3%76===0&&(n+="\r\n"),o|=t[a]<<(16>>>e&24),2!==e&&t.length-a!==1||(n+=String.fromCharCode(uint6ToB64(o>>>18&63),uint6ToB64(o>>>12&63),uint6ToB64(o>>>6&63),uint6ToB64(63&o)),o=0);return n.substr(0,n.length-2+e)+(2===e?"":1===e?"=":"==")}function UTF8ArrToStr(t){for(var e,n="",i=t.length,o=0;o251&&e<254&&o+5247&&e<252&&o+4239&&e<248&&o+3223&&e<240&&o+2191&&e<224&&o+1>>6),e[s++]=128+(63&n)):n<65536?(e[s++]=224+(n>>>12),e[s++]=128+(n>>>6&63),e[s++]=128+(63&n)):n<2097152?(e[s++]=240+(n>>>18),e[s++]=128+(n>>>12&63),e[s++]=128+(n>>>6&63),e[s++]=128+(63&n)):n<67108864?(e[s++]=248+(n>>>24),e[s++]=128+(n>>>18&63),e[s++]=128+(n>>>12&63),e[s++]=128+(n>>>6&63),e[s++]=128+(63&n)):(e[s++]=252+n/1073741824,e[s++]=128+(n>>>24&63),e[s++]=128+(n>>>18&63),e[s++]=128+(n>>>12&63),e[s++]=128+(n>>>6&63),e[s++]=128+(63&n));return e}function hexToR(t){return parseInt(cutHex(t).substring(0,2),16)}function hexToG(t){return parseInt(cutHex(t).substring(2,4),16)}function hexToB(t){return parseInt(cutHex(t).substring(4,6),16)}function cutHex(t){return"#"==t.charAt(0)?t.substring(1,7):t}function setDocHexColor(t,e){var n=hexToR(e),i=hexToG(e),o=hexToB(e);return t.setTextColor(n,i,o)}function setDocHexFill(t,e){var n=hexToR(e),i=hexToG(e),o=hexToB(e);return t.setFillColor(n,i,o)}function setDocHexDraw(t,e){var n=hexToR(e),i=hexToG(e),o=hexToB(e);return t.setDrawColor(n,i,o)}function toggleDatePicker(t){$("#"+t).datepicker("show")}function getPrecision(t){return roundToPrecision(t,3)!=t?4:roundToPrecision(t,2)!=t?3:2}function roundSignificant(t,e){var n=getPrecision(t),i=roundToPrecision(t,n)||0;return e?i.toFixed(n):i}function roundToTwo(t,e){var n=roundToPrecision(t,2)||0;return e?n.toFixed(2):n}function roundToFour(t,e){var n=roundToPrecision(t,4)||0;return e?n.toFixed(4):n}function roundToPrecision(t,e){var n=t<0;return n&&(t*=-1),t=+(Math.round(t+"e+"+e)+"e-"+e),n&&(t*=-1),t}function truncate(t,e){return t&&t.length>e?t.substr(0,e-1)+"...":t}function endsWith(t,e){return t.indexOf(e,t.length-e.length)!==-1}function secondsToTime(t){t=Math.round(t);var e=Math.floor(t/3600),n=t%3600,i=Math.floor(n/60),o=n%60,a=Math.ceil(o),s={h:e,m:i,s:a};return s}function twoDigits(t){return t<10?"0"+t:t}function toSnakeCase(t){return t?t.replace(/([A-Z])/g,function(t){return"_"+t.toLowerCase()}):""}function snakeToCamel(t){return t.replace(/_([a-z])/g,function(t){return t[1].toUpperCase()})}function getDescendantProp(t,e){for(var n=e.split(".");n.length&&(t=t[n.shift()]););return t}function doubleDollarSign(t){return t?t.replace?t.replace(/\$/g,"$$$"):t:""}function truncate(t,e){return t.length>e?t.substring(0,e)+"...":t}function actionListHandler(){$("tbody tr .tr-action").closest("tr").mouseover(function(){$(this).closest("tr").find(".tr-action").show(),$(this).closest("tr").find(".tr-status").hide()}).mouseout(function(){$dropdown=$(this).closest("tr").find(".tr-action"),$dropdown.hasClass("open")||($dropdown.hide(),$(this).closest("tr").find(".tr-status").show())})}function loadImages(t){$(t+" img").each(function(t,e){var n=$(e).attr("data-src");$(e).attr("src",n),$(e).attr("data-src",n)})}function prettyJson(t){return"string"!=typeof t&&(t=JSON.stringify(t,void 0,2)),t=t.replace(/&/g,"&").replace(//g,">"),t.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(t){var e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),t=snakeToCamel(t),''+t+""})}function searchData(t,e,n){return function(i,o){var a;if(n){var s={keys:[e]},r=new Fuse(t,s);a=r.search(i)}else a=[],substrRegex=new RegExp(escapeRegExp(i),"i"),$.each(t,function(t,n){substrRegex.test(n[e])&&a.push(n)});o(a)}}function escapeRegExp(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function firstJSONError(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];for(var i in n)if(n.hasOwnProperty(i))return n[i]}return!1}function pad(t,e,n){return n=n||"0",t+="",t.length>=e?t:new Array(e-t.length+1).join(n)+t}function brewerColor(t){var e=["#1c9f77","#d95d02","#716cb1","#e62a8b","#5fa213","#e6aa04","#a87821","#676767"],t=(t-1)%e.length;return e[t]}function formatXml(t){var e="",n=/(>)(<)(\/*)/g;t=t.replace(n,"$1\r\n$2$3");var i=0;return jQuery.each(t.split("\r\n"),function(t,n){var o=0;n.match(/.+<\/\w[^>]*>$/)?o=0:n.match(/^<\/\w/)?0!=i&&(i-=1):o=n.match(/^<\w[^>]*[^\/]>.*$/)?1:0;for(var a="",s=0;s0&&e-1 in t))}function i(t,e,n){if(ot.isFunction(e))return ot.grep(t,function(t,i){return!!e.call(t,i,t)!==n});if(e.nodeType)return ot.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(dt.test(e))return ot.filter(e,t,n);e=ot.filter(e,t)}return ot.grep(t,function(t){return ot.inArray(t,e)>=0!==n})}function o(t,e){do t=t[e];while(t&&1!==t.nodeType);return t}function a(t){var e=yt[t]={};return ot.each(t.match(Mt)||[],function(t,n){e[n]=!0}),e}function s(){ft.addEventListener?(ft.removeEventListener("DOMContentLoaded",r,!1),t.removeEventListener("load",r,!1)):(ft.detachEvent("onreadystatechange",r),t.detachEvent("onload",r))}function r(){(ft.addEventListener||"load"===event.type||"complete"===ft.readyState)&&(s(),ot.ready())}function c(t,e,n){if(void 0===n&&1===t.nodeType){var i="data-"+e.replace(wt,"-$1").toLowerCase();if(n=t.getAttribute(i),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:Tt.test(n)?ot.parseJSON(n):n)}catch(o){}ot.data(t,e,n)}else n=void 0}return n}function l(t){var e;for(e in t)if(("data"!==e||!ot.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function u(t,e,n,i){if(ot.acceptData(t)){var o,a,s=ot.expando,r=t.nodeType,c=r?ot.cache:t,l=r?t[s]:t[s]&&s;if(l&&c[l]&&(i||c[l].data)||void 0!==n||"string"!=typeof e)return l||(l=r?t[s]=Y.pop()||ot.guid++:s),c[l]||(c[l]=r?{}:{toJSON:ot.noop}),"object"!=typeof e&&"function"!=typeof e||(i?c[l]=ot.extend(c[l],e):c[l].data=ot.extend(c[l].data,e)),a=c[l],i||(a.data||(a.data={}),a=a.data),void 0!==n&&(a[ot.camelCase(e)]=n),"string"==typeof e?(o=a[e],null==o&&(o=a[ot.camelCase(e)])):o=a,o}}function h(t,e,n){if(ot.acceptData(t)){var i,o,a=t.nodeType,s=a?ot.cache:t,r=a?t[ot.expando]:ot.expando;if(s[r]){if(e&&(i=n?s[r]:s[r].data)){ot.isArray(e)?e=e.concat(ot.map(e,ot.camelCase)):e in i?e=[e]:(e=ot.camelCase(e),e=e in i?[e]:e.split(" ")),o=e.length;for(;o--;)delete i[e[o]];if(n?!l(i):!ot.isEmptyObject(i))return}(n||(delete s[r].data,l(s[r])))&&(a?ot.cleanData([t],!0):nt.deleteExpando||s!=s.window?delete s[r]:s[r]=null)}}}function d(){return!0}function p(){return!1}function f(){try{return ft.activeElement}catch(t){}}function m(t){var e=Et.split("|"),n=t.createDocumentFragment();if(n.createElement)for(;e.length;)n.createElement(e.pop());return n}function g(t,e){var n,i,o=0,a=typeof t.getElementsByTagName!==zt?t.getElementsByTagName(e||"*"):typeof t.querySelectorAll!==zt?t.querySelectorAll(e||"*"):void 0;if(!a)for(a=[],n=t.childNodes||t;null!=(i=n[o]);o++)!e||ot.nodeName(i,e)?a.push(i):ot.merge(a,g(i,e));return void 0===e||e&&ot.nodeName(t,e)?ot.merge([t],a):a}function b(t){xt.test(t.type)&&(t.defaultChecked=t.checked)}function v(t,e){return ot.nodeName(t,"table")&&ot.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function M(t){return t.type=(null!==ot.find.attr(t,"type"))+"/"+t.type,t}function y(t){var e=Vt.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function A(t,e){for(var n,i=0;null!=(n=t[i]);i++)ot._data(n,"globalEval",!e||ot._data(e[i],"globalEval"))}function _(t,e){if(1===e.nodeType&&ot.hasData(t)){var n,i,o,a=ot._data(t),s=ot._data(e,a),r=a.events;if(r){delete s.handle,s.events={};for(n in r)for(i=0,o=r[n].length;i")).appendTo(e.documentElement),e=(Qt[0].contentWindow||Qt[0].contentDocument).document,e.write(),e.close(),n=T(t,e),Qt.detach()),Zt[t]=n),n}function C(t,e){return{get:function(){var n=t();if(null!=n)return n?void delete this.get:(this.get=e).apply(this,arguments)}}}function O(t,e){if(e in t)return e;for(var n=e.charAt(0).toUpperCase()+e.slice(1),i=e,o=de.length;o--;)if(e=de[o]+n,e in t)return e;return i}function N(t,e){for(var n,i,o,a=[],s=0,r=t.length;s=0&&n=0},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},isPlainObject:function(t){var e;if(!t||"object"!==ot.type(t)||t.nodeType||ot.isWindow(t))return!1;try{if(t.constructor&&!et.call(t,"constructor")&&!et.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(nt.ownLast)for(e in t)return et.call(t,e);for(e in t);return void 0===e||et.call(t,e)},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?Z[tt.call(t)]||"object":typeof t},globalEval:function(e){e&&ot.trim(e)&&(t.execScript||function(e){t.eval.call(t,e)})(e)},camelCase:function(t){return t.replace(st,"ms-").replace(rt,ct)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,i){var o,a=0,s=t.length,r=n(t);if(i){if(r)for(;a_.cacheLength&&delete t[e.shift()],t[n+" "]=i}var e=[];return t}function i(t){return t[P]=!0,t}function o(t){var e=D.createElement("div");try{return!!t(e)}catch(n){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function a(t,e){for(var n=t.split("|"),i=t.length;i--;)_.attrHandle[n[i]]=e}function s(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||V)-(~t.sourceIndex||V);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function r(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function c(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function l(t){return i(function(e){return e=+e,i(function(n,i){for(var o,a=t([],n.length,e),s=a.length;s--;)n[o=a[s]]&&(n[o]=!(i[o]=n[o]))})})}function u(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function h(){}function d(t){for(var e=0,n=t.length,i="";e1?function(e,n,i){for(var o=t.length;o--;)if(!t[o](e,n,i))return!1;return!0}:t[0]}function m(t,n,i){for(var o=0,a=n.length;o-1&&(i[l]=!(s[l]=h))}}else M=g(M===s?M.splice(f,M.length):M),a?a(null,s,M,c):Q.apply(s,M)})}function v(t){for(var e,n,i,o=t.length,a=_.relative[t[0].type],s=a||_.relative[" "],r=a?1:0,c=p(function(t){return t===e},s,!0),l=p(function(t){return tt(e,t)>-1},s,!0),u=[function(t,n,i){var o=!a&&(i||n!==N)||((e=n).nodeType?c(t,n,i):l(t,n,i));return e=null,o}];r1&&f(u),r>1&&d(t.slice(0,r-1).concat({value:" "===t[r-2].type?"*":""})).replace(ct,"$1"),n,r0,a=t.length>0,s=function(i,s,r,c,l){var u,h,d,p=0,f="0",m=i&&[],b=[],v=N,M=i||a&&_.find.TAG("*",l),y=R+=null==v?1:Math.random()||.1,A=M.length;for(l&&(N=s!==D&&s);f!==A&&null!=(u=M[f]);f++){if(a&&u){for(h=0;d=t[h++];)if(d(u,s,r)){c.push(u);break}l&&(R=y)}o&&((u=!d&&u)&&p--,i&&m.push(u))}if(p+=f,o&&f!==p){for(h=0;d=n[h++];)d(m,b,s,r);if(i){if(p>0)for(;f--;)m[f]||b[f]||(b[f]=K.call(c));b=g(b)}Q.apply(c,b),l&&!i&&b.length>0&&p+n.length>1&&e.uniqueSort(c)}return l&&(R=y,N=v),m};return o?i(s):s}var y,A,_,z,T,w,C,O,N,S,x,L,D,k,q,W,E,B,I,P="sizzle"+1*new Date,X=t.document,R=0,F=0,H=n(),j=n(),U=n(),$=function(t,e){return t===e&&(x=!0),0},V=1<<31,Y={}.hasOwnProperty,J=[],K=J.pop,G=J.push,Q=J.push,Z=J.slice,tt=function(t,e){for(var n=0,i=t.length;n+~]|"+nt+")"+nt+"*"),ht=new RegExp("="+nt+"*([^\\]'\"]*?)"+nt+"*\\]","g"),dt=new RegExp(st),pt=new RegExp("^"+ot+"$"),ft={ID:new RegExp("^#("+it+")"),CLASS:new RegExp("^\\.("+it+")"),TAG:new RegExp("^("+it.replace("w","w*")+")"),ATTR:new RegExp("^"+at),PSEUDO:new RegExp("^"+st),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+nt+"*(even|odd|(([+-]|)(\\d*)n|)"+nt+"*(?:([+-]|)"+nt+"*(\\d+)|))"+nt+"*\\)|)","i"),bool:new RegExp("^(?:"+et+")$","i"),needsContext:new RegExp("^"+nt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+nt+"*((?:-\\d)?\\d*)"+nt+"*\\)|)(?=[^-]|$)","i")},mt=/^(?:input|select|textarea|button)$/i,gt=/^h\d$/i,bt=/^[^{]+\{\s*\[native \w/,vt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Mt=/[+~]/,yt=/'|\\/g,At=new RegExp("\\\\([\\da-f]{1,6}"+nt+"?|("+nt+")|.)","ig"),_t=function(t,e,n){var i="0x"+e-65536;return i!==i||n?e:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},zt=function(){L()};try{Q.apply(J=Z.call(X.childNodes),X.childNodes),J[X.childNodes.length].nodeType}catch(Tt){Q={apply:J.length?function(t,e){G.apply(t,Z.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}A=e.support={},T=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},L=e.setDocument=function(t){var e,n,i=t?t.ownerDocument||t:X;return i!==D&&9===i.nodeType&&i.documentElement?(D=i,k=i.documentElement,n=i.defaultView,n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",zt,!1):n.attachEvent&&n.attachEvent("onunload",zt)),q=!T(i),A.attributes=o(function(t){return t.className="i",!t.getAttribute("className")}),A.getElementsByTagName=o(function(t){return t.appendChild(i.createComment("")),!t.getElementsByTagName("*").length}),A.getElementsByClassName=bt.test(i.getElementsByClassName),A.getById=o(function(t){return k.appendChild(t).id=P,!i.getElementsByName||!i.getElementsByName(P).length}),A.getById?(_.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&q){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},_.filter.ID=function(t){var e=t.replace(At,_t);return function(t){return t.getAttribute("id")===e}}):(delete _.find.ID,_.filter.ID=function(t){var e=t.replace(At,_t);return function(t){var n="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}}),_.find.TAG=A.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):A.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],o=0,a=e.getElementsByTagName(t);if("*"===t){for(;n=a[o++];)1===n.nodeType&&i.push(n);return i}return a},_.find.CLASS=A.getElementsByClassName&&function(t,e){if(q)return e.getElementsByClassName(t)},E=[],W=[],(A.qsa=bt.test(i.querySelectorAll))&&(o(function(t){k.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&W.push("[*^$]="+nt+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||W.push("\\["+nt+"*(?:value|"+et+")"),t.querySelectorAll("[id~="+P+"-]").length||W.push("~="),t.querySelectorAll(":checked").length||W.push(":checked"),t.querySelectorAll("a#"+P+"+*").length||W.push(".#.+[+~]")}),o(function(t){var e=i.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&W.push("name"+nt+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||W.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),W.push(",.*:")})),(A.matchesSelector=bt.test(B=k.matches||k.webkitMatchesSelector||k.mozMatchesSelector||k.oMatchesSelector||k.msMatchesSelector))&&o(function(t){A.disconnectedMatch=B.call(t,"div"),B.call(t,"[s!='']:x"),E.push("!=",st)}),W=W.length&&new RegExp(W.join("|")),E=E.length&&new RegExp(E.join("|")),e=bt.test(k.compareDocumentPosition),I=e||bt.test(k.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?function(t,e){if(t===e)return x=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n?n:(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&n||!A.sortDetached&&e.compareDocumentPosition(t)===n?t===i||t.ownerDocument===X&&I(X,t)?-1:e===i||e.ownerDocument===X&&I(X,e)?1:S?tt(S,t)-tt(S,e):0:4&n?-1:1)}:function(t,e){if(t===e)return x=!0,0;var n,o=0,a=t.parentNode,r=e.parentNode,c=[t],l=[e];if(!a||!r)return t===i?-1:e===i?1:a?-1:r?1:S?tt(S,t)-tt(S,e):0;if(a===r)return s(t,e);for(n=t;n=n.parentNode;)c.unshift(n);for(n=e;n=n.parentNode;)l.unshift(n);for(;c[o]===l[o];)o++;return o?s(c[o],l[o]):c[o]===X?-1:l[o]===X?1:0},i):D},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==D&&L(t),n=n.replace(ht,"='$1']"),A.matchesSelector&&q&&(!E||!E.test(n))&&(!W||!W.test(n)))try{var i=B.call(t,n);if(i||A.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(o){}return e(n,D,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==D&&L(t),I(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==D&&L(t);var n=_.attrHandle[e.toLowerCase()],i=n&&Y.call(_.attrHandle,e.toLowerCase())?n(t,e,!q):void 0;return void 0!==i?i:A.attributes||!q?t.getAttribute(e):(i=t.getAttributeNode(e))&&i.specified?i.value:null},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,n=[],i=0,o=0;if(x=!A.detectDuplicates,S=!A.sortStable&&t.slice(0),t.sort($),x){for(;e=t[o++];)e===t[o]&&(i=n.push(o));for(;i--;)t.splice(n[i],1)}return S=null,t},z=e.getText=function(t){var e,n="",i=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=z(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[i++];)n+=z(e);return n},_=e.selectors={cacheLength:50,createPseudo:i,match:ft,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(At,_t),t[3]=(t[3]||t[4]||t[5]||"").replace(At,_t),"~="===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]||e.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]&&e.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return ft.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&dt.test(n)&&(e=w(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(At,_t).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=H[t+" "];return e||(e=new RegExp("(^|"+nt+")"+t+"("+nt+"|$)"))&&H(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,n,i){return function(o){var a=e.attr(o,t);return null==a?"!="===n:!n||(a+="","="===n?a===i:"!="===n?a!==i:"^="===n?i&&0===a.indexOf(i):"*="===n?i&&a.indexOf(i)>-1:"$="===n?i&&a.slice(-i.length)===i:"~="===n?(" "+a.replace(rt," ")+" ").indexOf(i)>-1:"|="===n&&(a===i||a.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,n,i,o){var a="nth"!==t.slice(0,3),s="last"!==t.slice(-4),r="of-type"===e;return 1===i&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var l,u,h,d,p,f,m=a!==s?"nextSibling":"previousSibling",g=e.parentNode,b=r&&e.nodeName.toLowerCase(),v=!c&&!r;if(g){if(a){for(;m;){for(h=e;h=h[m];)if(r?h.nodeName.toLowerCase()===b:1===h.nodeType)return!1;f=m="only"===t&&!f&&"nextSibling"}return!0}if(f=[s?g.firstChild:g.lastChild],s&&v){for(u=g[P]||(g[P]={}),l=u[t]||[],p=l[0]===R&&l[1],d=l[0]===R&&l[2],h=p&&g.childNodes[p];h=++p&&h&&h[m]||(d=p=0)||f.pop();)if(1===h.nodeType&&++d&&h===e){u[t]=[R,p,d];break}}else if(v&&(l=(e[P]||(e[P]={}))[t])&&l[0]===R)d=l[1];else for(;(h=++p&&h&&h[m]||(d=p=0)||f.pop())&&((r?h.nodeName.toLowerCase()!==b:1!==h.nodeType)||!++d||(v&&((h[P]||(h[P]={}))[t]=[R,d]),h!==e)););return d-=o,d===i||d%i===0&&d/i>=0}}},PSEUDO:function(t,n){var o,a=_.pseudos[t]||_.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return a[P]?a(n):a.length>1?(o=[t,t,"",n],_.setFilters.hasOwnProperty(t.toLowerCase())?i(function(t,e){for(var i,o=a(t,n),s=o.length;s--;)i=tt(t,o[s]),t[i]=!(e[i]=o[s])}):function(t){return a(t,0,o)}):a}},pseudos:{not:i(function(t){var e=[],n=[],o=C(t.replace(ct,"$1"));return o[P]?i(function(t,e,n,i){for(var a,s=o(t,null,i,[]),r=t.length;r--;)(a=s[r])&&(t[r]=!(e[r]=a))}):function(t,i,a){return e[0]=t,o(e,null,a,n),e[0]=null,!n.pop()}}),has:i(function(t){return function(n){return e(t,n).length>0}}),contains:i(function(t){return t=t.replace(At,_t),function(e){return(e.textContent||e.innerText||z(e)).indexOf(t)>-1}}),lang:i(function(t){return pt.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(At,_t).toLowerCase(),function(e){var n;do if(n=q?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===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===k},focus:function(t){return t===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!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,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!_.pseudos.empty(t)},header:function(t){return gt.test(t.nodeName)},input:function(t){return mt.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:l(function(){return[0]}),last:l(function(t,e){return[e-1]}),eq:l(function(t,e,n){return[n<0?n+e:n]}),even:l(function(t,e){for(var n=0;n=0;)t.push(i);return t}),gt:l(function(t,e,n){for(var i=n<0?n+e:n;++i2&&"ID"===(s=a[0]).type&&A.getById&&9===e.nodeType&&q&&_.relative[a[1].type]){if(e=(_.find.ID(s.matches[0].replace(At,_t),e)||[])[0],!e)return n;l&&(e=e.parentNode),t=t.slice(a.shift().value.length)}for(o=ft.needsContext.test(t)?0:a.length;o--&&(s=a[o],!_.relative[r=s.type]);)if((c=_.find[r])&&(i=c(s.matches[0].replace(At,_t),Mt.test(a[0].type)&&u(e.parentNode)||e))){if(a.splice(o,1),t=i.length&&d(a),!t)return Q.apply(n,i),n;break}}return(l||C(t,h))(i,e,!q,n,Mt.test(t)&&u(e.parentNode)||e),n},A.sortStable=P.split("").sort($).join("")===P,A.detectDuplicates=!!x,L(),A.sortDetached=o(function(t){return 1&t.compareDocumentPosition(D.createElement("div"))}),o(function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")})||a("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),A.attributes&&o(function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||a("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),o(function(t){return null==t.getAttribute("disabled")})||a(et,function(t,e,n){var i;if(!n)return t[e]===!0?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null}),e}(t);ot.find=lt,ot.expr=lt.selectors,ot.expr[":"]=ot.expr.pseudos,ot.unique=lt.uniqueSort,ot.text=lt.getText,ot.isXMLDoc=lt.isXML,ot.contains=lt.contains;var ut=ot.expr.match.needsContext,ht=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,dt=/^.[^:#\[\.,]*$/;ot.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?ot.find.matchesSelector(i,t)?[i]:[]:ot.find.matches(t,ot.grep(e,function(t){return 1===t.nodeType}))},ot.fn.extend({find:function(t){var e,n=[],i=this,o=i.length;if("string"!=typeof t)return this.pushStack(ot(t).filter(function(){for(e=0;e1?ot.unique(n):n),n.selector=this.selector?this.selector+" "+t:t,n},filter:function(t){return this.pushStack(i(this,t||[],!1))},not:function(t){return this.pushStack(i(this,t||[],!0))},is:function(t){return!!i(this,"string"==typeof t&&ut.test(t)?ot(t):t||[],!1).length}});var pt,ft=t.document,mt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,gt=ot.fn.init=function(t,e){var n,i;if(!t)return this;if("string"==typeof t){if(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:mt.exec(t),!n||!n[1]&&e)return!e||e.jquery?(e||pt).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof ot?e[0]:e,ot.merge(this,ot.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:ft,!0)),ht.test(n[1])&&ot.isPlainObject(e))for(n in e)ot.isFunction(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}if(i=ft.getElementById(n[2]),i&&i.parentNode){if(i.id!==n[2])return pt.find(t);this.length=1,this[0]=i}return this.context=ft,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):ot.isFunction(t)?"undefined"!=typeof pt.ready?pt.ready(t):t(ot):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),ot.makeArray(t,this))};gt.prototype=ot.fn,pt=ot(ft);var bt=/^(?:parents|prev(?:Until|All))/,vt={children:!0,contents:!0,next:!0,prev:!0};ot.extend({dir:function(t,e,n){for(var i=[],o=t[e];o&&9!==o.nodeType&&(void 0===n||1!==o.nodeType||!ot(o).is(n));)1===o.nodeType&&i.push(o),o=o[e];return i},sibling:function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n}}),ot.fn.extend({has:function(t){var e,n=ot(t,this),i=n.length;return this.filter(function(){for(e=0;e-1:1===n.nodeType&&ot.find.matchesSelector(n,t))){a.push(n);break}return this.pushStack(a.length>1?ot.unique(a):a)},index:function(t){return t?"string"==typeof t?ot.inArray(this[0],ot(t)):ot.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(ot.unique(ot.merge(this.get(),ot(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),ot.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return ot.dir(t,"parentNode")},parentsUntil:function(t,e,n){return ot.dir(t,"parentNode",n)},next:function(t){return o(t,"nextSibling")},prev:function(t){return o(t,"previousSibling")},nextAll:function(t){return ot.dir(t,"nextSibling")},prevAll:function(t){return ot.dir(t,"previousSibling")},nextUntil:function(t,e,n){return ot.dir(t,"nextSibling",n)},prevUntil:function(t,e,n){return ot.dir(t,"previousSibling",n)},siblings:function(t){return ot.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return ot.sibling(t.firstChild)},contents:function(t){return ot.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:ot.merge([],t.childNodes)}},function(t,e){ot.fn[t]=function(n,i){var o=ot.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(o=ot.filter(i,o)),this.length>1&&(vt[t]||(o=ot.unique(o)),bt.test(t)&&(o=o.reverse())),this.pushStack(o)}});var Mt=/\S+/g,yt={};ot.Callbacks=function(t){t="string"==typeof t?yt[t]||a(t):ot.extend({},t);var e,n,i,o,s,r,c=[],l=!t.once&&[],u=function(a){for(n=t.memory&&a,i=!0,s=r||0,r=0,o=c.length,e=!0;c&&s-1;)c.splice(i,1),e&&(i<=o&&o--,i<=s&&s--)}),this},has:function(t){return t?ot.inArray(t,c)>-1:!(!c||!c.length)},empty:function(){return c=[],o=0,this},disable:function(){return c=l=n=void 0,this},disabled:function(){return!c},lock:function(){return l=void 0,n||h.disable(),this},locked:function(){return!l},fireWith:function(t,n){return!c||i&&!l||(n=n||[],n=[t,n.slice?n.slice():n],e?l.push(n):u(n)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!i}};return h},ot.extend({Deferred:function(t){var e=[["resolve","done",ot.Callbacks("once memory"),"resolved"],["reject","fail",ot.Callbacks("once memory"),"rejected"],["notify","progress",ot.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var t=arguments;return ot.Deferred(function(n){ot.each(e,function(e,a){var s=ot.isFunction(t[e])&&t[e];o[a[1]](function(){var t=s&&s.apply(this,arguments);t&&ot.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a[0]+"With"](this===i?n.promise():this,s?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?ot.extend(t,i):i}},o={};return i.pipe=i.then,ot.each(e,function(t,a){var s=a[2],r=a[3];i[a[1]]=s.add,r&&s.add(function(){n=r},e[1^t][2].disable,e[2][2].lock),o[a[0]]=function(){return o[a[0]+"With"](this===o?i:this,arguments),this},o[a[0]+"With"]=s.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(t){var e,n,i,o=0,a=J.call(arguments),s=a.length,r=1!==s||t&&ot.isFunction(t.promise)?s:0,c=1===r?t:ot.Deferred(),l=function(t,n,i){return function(o){n[t]=this,i[t]=arguments.length>1?J.call(arguments):o,i===e?c.notifyWith(n,i):--r||c.resolveWith(n,i)}};if(s>1)for(e=new Array(s),n=new Array(s),i=new Array(s);o0||(At.resolveWith(ft,[ot]),ot.fn.triggerHandler&&(ot(ft).triggerHandler("ready"),ot(ft).off("ready")))}}}),ot.ready.promise=function(e){if(!At)if(At=ot.Deferred(),"complete"===ft.readyState)setTimeout(ot.ready);else if(ft.addEventListener)ft.addEventListener("DOMContentLoaded",r,!1),t.addEventListener("load",r,!1);else{ft.attachEvent("onreadystatechange",r),t.attachEvent("onload",r);var n=!1;try{n=null==t.frameElement&&ft.documentElement}catch(i){}n&&n.doScroll&&!function o(){if(!ot.isReady){try{n.doScroll("left")}catch(t){return setTimeout(o,50)}s(),ot.ready()}}()}return At.promise(e)};var _t,zt="undefined";for(_t in ot(nt))break;nt.ownLast="0"!==_t,nt.inlineBlockNeedsLayout=!1,ot(function(){var t,e,n,i;n=ft.getElementsByTagName("body")[0],n&&n.style&&(e=ft.createElement("div"),i=ft.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(e),typeof e.style.zoom!==zt&&(e.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",nt.inlineBlockNeedsLayout=t=3===e.offsetWidth,t&&(n.style.zoom=1)),n.removeChild(i))}),function(){var t=ft.createElement("div");if(null==nt.deleteExpando){nt.deleteExpando=!0;try{delete t.test}catch(e){nt.deleteExpando=!1}}t=null}(),ot.acceptData=function(t){var e=ot.noData[(t.nodeName+" ").toLowerCase()],n=+t.nodeType||1;return(1===n||9===n)&&(!e||e!==!0&&t.getAttribute("classid")===e)};var Tt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,wt=/([A-Z])/g;ot.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(t){return t=t.nodeType?ot.cache[t[ot.expando]]:t[ot.expando],!!t&&!l(t)},data:function(t,e,n){return u(t,e,n)},removeData:function(t,e){return h(t,e)},_data:function(t,e,n){return u(t,e,n,!0)},_removeData:function(t,e){return h(t,e,!0)}}),ot.fn.extend({data:function(t,e){var n,i,o,a=this[0],s=a&&a.attributes;if(void 0===t){if(this.length&&(o=ot.data(a),1===a.nodeType&&!ot._data(a,"parsedAttrs"))){for(n=s.length;n--;)s[n]&&(i=s[n].name,0===i.indexOf("data-")&&(i=ot.camelCase(i.slice(5)),c(a,i,o[i])));ot._data(a,"parsedAttrs",!0)}return o}return"object"==typeof t?this.each(function(){ot.data(this,t)}):arguments.length>1?this.each(function(){ot.data(this,t,e)}):a?c(a,t,ot.data(a,t)):void 0},removeData:function(t){return this.each(function(){ot.removeData(this,t)})}}),ot.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=ot._data(t,e),n&&(!i||ot.isArray(n)?i=ot._data(t,e,ot.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=ot.queue(t,e),i=n.length,o=n.shift(),a=ot._queueHooks(t,e),s=function(){ot.dequeue(t,e)};"inprogress"===o&&(o=n.shift(),i--),o&&("fx"===e&&n.unshift("inprogress"),delete a.stop,o.call(t,s,a)),!i&&a&&a.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return ot._data(t,n)||ot._data(t,n,{empty:ot.Callbacks("once memory").add(function(){ot._removeData(t,e+"queue"),ot._removeData(t,n)})})}}),ot.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length
a",nt.leadingWhitespace=3===e.firstChild.nodeType,nt.tbody=!e.getElementsByTagName("tbody").length,nt.htmlSerialize=!!e.getElementsByTagName("link").length,nt.html5Clone="<:nav>"!==ft.createElement("nav").cloneNode(!0).outerHTML,t.type="checkbox",t.checked=!0,n.appendChild(t),nt.appendChecked=t.checked,e.innerHTML="",nt.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,n.appendChild(e),e.innerHTML="",nt.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,nt.noCloneEvent=!0,e.attachEvent&&(e.attachEvent("onclick",function(){nt.noCloneEvent=!1}),e.cloneNode(!0).click()),null==nt.deleteExpando){nt.deleteExpando=!0;try{delete e.test}catch(i){nt.deleteExpando=!1}}}(),function(){var e,n,i=ft.createElement("div");for(e in{submit:!0,change:!0,focusin:!0})n="on"+e,(nt[e+"Bubbles"]=n in t)||(i.setAttribute(n,"t"),nt[e+"Bubbles"]=i.attributes[n].expando===!1);i=null}();var Lt=/^(?:input|select|textarea)$/i,Dt=/^key/,kt=/^(?:mouse|pointer|contextmenu)|click/,qt=/^(?:focusinfocus|focusoutblur)$/,Wt=/^([^.]*)(?:\.(.+)|)$/;ot.event={global:{},add:function(t,e,n,i,o){var a,s,r,c,l,u,h,d,p,f,m,g=ot._data(t);if(g){for(n.handler&&(c=n,n=c.handler,o=c.selector),n.guid||(n.guid=ot.guid++),(s=g.events)||(s=g.events={}),(u=g.handle)||(u=g.handle=function(t){return typeof ot===zt||t&&ot.event.triggered===t.type?void 0:ot.event.dispatch.apply(u.elem,arguments)},u.elem=t),e=(e||"").match(Mt)||[""],r=e.length;r--;)a=Wt.exec(e[r])||[],p=m=a[1],f=(a[2]||"").split(".").sort(),p&&(l=ot.event.special[p]||{},p=(o?l.delegateType:l.bindType)||p, -l=ot.event.special[p]||{},h=ot.extend({type:p,origType:m,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&ot.expr.match.needsContext.test(o),namespace:f.join(".")},c),(d=s[p])||(d=s[p]=[],d.delegateCount=0,l.setup&&l.setup.call(t,i,f,u)!==!1||(t.addEventListener?t.addEventListener(p,u,!1):t.attachEvent&&t.attachEvent("on"+p,u))),l.add&&(l.add.call(t,h),h.handler.guid||(h.handler.guid=n.guid)),o?d.splice(d.delegateCount++,0,h):d.push(h),ot.event.global[p]=!0);t=null}},remove:function(t,e,n,i,o){var a,s,r,c,l,u,h,d,p,f,m,g=ot.hasData(t)&&ot._data(t);if(g&&(u=g.events)){for(e=(e||"").match(Mt)||[""],l=e.length;l--;)if(r=Wt.exec(e[l])||[],p=m=r[1],f=(r[2]||"").split(".").sort(),p){for(h=ot.event.special[p]||{},p=(i?h.delegateType:h.bindType)||p,d=u[p]||[],r=r[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),c=a=d.length;a--;)s=d[a],!o&&m!==s.origType||n&&n.guid!==s.guid||r&&!r.test(s.namespace)||i&&i!==s.selector&&("**"!==i||!s.selector)||(d.splice(a,1),s.selector&&d.delegateCount--,h.remove&&h.remove.call(t,s));c&&!d.length&&(h.teardown&&h.teardown.call(t,f,g.handle)!==!1||ot.removeEvent(t,p,g.handle),delete u[p])}else for(p in u)ot.event.remove(t,p+e[l],n,i,!0);ot.isEmptyObject(u)&&(delete g.handle,ot._removeData(t,"events"))}},trigger:function(e,n,i,o){var a,s,r,c,l,u,h,d=[i||ft],p=et.call(e,"type")?e.type:e,f=et.call(e,"namespace")?e.namespace.split("."):[];if(r=u=i=i||ft,3!==i.nodeType&&8!==i.nodeType&&!qt.test(p+ot.event.triggered)&&(p.indexOf(".")>=0&&(f=p.split("."),p=f.shift(),f.sort()),s=p.indexOf(":")<0&&"on"+p,e=e[ot.expando]?e:new ot.Event(p,"object"==typeof e&&e),e.isTrigger=o?2:3,e.namespace=f.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),n=null==n?[e]:ot.makeArray(n,[e]),l=ot.event.special[p]||{},o||!l.trigger||l.trigger.apply(i,n)!==!1)){if(!o&&!l.noBubble&&!ot.isWindow(i)){for(c=l.delegateType||p,qt.test(c+p)||(r=r.parentNode);r;r=r.parentNode)d.push(r),u=r;u===(i.ownerDocument||ft)&&d.push(u.defaultView||u.parentWindow||t)}for(h=0;(r=d[h++])&&!e.isPropagationStopped();)e.type=h>1?c:l.bindType||p,a=(ot._data(r,"events")||{})[e.type]&&ot._data(r,"handle"),a&&a.apply(r,n),a=s&&r[s],a&&a.apply&&ot.acceptData(r)&&(e.result=a.apply(r,n),e.result===!1&&e.preventDefault());if(e.type=p,!o&&!e.isDefaultPrevented()&&(!l._default||l._default.apply(d.pop(),n)===!1)&&ot.acceptData(i)&&s&&i[p]&&!ot.isWindow(i)){u=i[s],u&&(i[s]=null),ot.event.triggered=p;try{i[p]()}catch(m){}ot.event.triggered=void 0,u&&(i[s]=u)}return e.result}},dispatch:function(t){t=ot.event.fix(t);var e,n,i,o,a,s=[],r=J.call(arguments),c=(ot._data(this,"events")||{})[t.type]||[],l=ot.event.special[t.type]||{};if(r[0]=t,t.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,t)!==!1){for(s=ot.event.handlers.call(this,t,c),e=0;(o=s[e++])&&!t.isPropagationStopped();)for(t.currentTarget=o.elem,a=0;(i=o.handlers[a++])&&!t.isImmediatePropagationStopped();)t.namespace_re&&!t.namespace_re.test(i.namespace)||(t.handleObj=i,t.data=i.data,n=((ot.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,r),void 0!==n&&(t.result=n)===!1&&(t.preventDefault(),t.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,t),t.result}},handlers:function(t,e){var n,i,o,a,s=[],r=e.delegateCount,c=t.target;if(r&&c.nodeType&&(!t.button||"click"!==t.type))for(;c!=this;c=c.parentNode||this)if(1===c.nodeType&&(c.disabled!==!0||"click"!==t.type)){for(o=[],a=0;a=0:ot.find(n,this,null,[c]).length),o[n]&&o.push(i);o.length&&s.push({elem:c,handlers:o})}return r]","i"),Pt=/^\s+/,Xt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Rt=/<([\w:]+)/,Ft=/\s*$/g,Jt={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:nt.htmlSerialize?[0,"",""]:[1,"X
","
"]},Kt=m(ft),Gt=Kt.appendChild(ft.createElement("div"));Jt.optgroup=Jt.option,Jt.tbody=Jt.tfoot=Jt.colgroup=Jt.caption=Jt.thead,Jt.th=Jt.td,ot.extend({clone:function(t,e,n){var i,o,a,s,r,c=ot.contains(t.ownerDocument,t);if(nt.html5Clone||ot.isXMLDoc(t)||!It.test("<"+t.nodeName+">")?a=t.cloneNode(!0):(Gt.innerHTML=t.outerHTML,Gt.removeChild(a=Gt.firstChild)),!(nt.noCloneEvent&&nt.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||ot.isXMLDoc(t)))for(i=g(a),r=g(t),s=0;null!=(o=r[s]);++s)i[s]&&z(o,i[s]);if(e)if(n)for(r=r||g(t),i=i||g(a),s=0;null!=(o=r[s]);s++)_(o,i[s]);else _(t,a);return i=g(a,"script"),i.length>0&&A(i,!c&&g(t,"script")),i=r=o=null,a},buildFragment:function(t,e,n,i){for(var o,a,s,r,c,l,u,h=t.length,d=m(e),p=[],f=0;f")+u[2],o=u[0];o--;)r=r.lastChild;if(!nt.leadingWhitespace&&Pt.test(a)&&p.push(e.createTextNode(Pt.exec(a)[0])),!nt.tbody)for(a="table"!==c||Ft.test(a)?""!==u[1]||Ft.test(a)?0:r:r.firstChild,o=a&&a.childNodes.length;o--;)ot.nodeName(l=a.childNodes[o],"tbody")&&!l.childNodes.length&&a.removeChild(l);for(ot.merge(p,r.childNodes),r.textContent="";r.firstChild;)r.removeChild(r.firstChild);r=d.lastChild}else p.push(e.createTextNode(a));for(r&&d.removeChild(r),nt.appendChecked||ot.grep(g(p,"input"),b),f=0;a=p[f++];)if((!i||ot.inArray(a,i)===-1)&&(s=ot.contains(a.ownerDocument,a),r=g(d.appendChild(a),"script"),s&&A(r),n))for(o=0;a=r[o++];)$t.test(a.type||"")&&n.push(a);return r=null,d},cleanData:function(t,e){for(var n,i,o,a,s=0,r=ot.expando,c=ot.cache,l=nt.deleteExpando,u=ot.event.special;null!=(n=t[s]);s++)if((e||ot.acceptData(n))&&(o=n[r],a=o&&c[o])){if(a.events)for(i in a.events)u[i]?ot.event.remove(n,i):ot.removeEvent(n,i,a.handle);c[o]&&(delete c[o],l?delete n[r]:typeof n.removeAttribute!==zt?n.removeAttribute(r):n[r]=null,Y.push(o))}}}),ot.fn.extend({text:function(t){return St(this,function(t){return void 0===t?ot.text(this):this.empty().append((this[0]&&this[0].ownerDocument||ft).createTextNode(t))},null,t,arguments.length)},append:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=v(this,t);e.appendChild(t)}})},prepend:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=v(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},remove:function(t,e){for(var n,i=t?ot.filter(t,this):this,o=0;null!=(n=i[o]);o++)e||1!==n.nodeType||ot.cleanData(g(n)),n.parentNode&&(e&&ot.contains(n.ownerDocument,n)&&A(g(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++){for(1===t.nodeType&&ot.cleanData(g(t,!1));t.firstChild;)t.removeChild(t.firstChild);t.options&&ot.nodeName(t,"select")&&(t.options.length=0)}return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return ot.clone(this,t,e)})},html:function(t){return St(this,function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t)return 1===e.nodeType?e.innerHTML.replace(Bt,""):void 0;if("string"==typeof t&&!jt.test(t)&&(nt.htmlSerialize||!It.test(t))&&(nt.leadingWhitespace||!Pt.test(t))&&!Jt[(Rt.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(Xt,"<$1>");try{for(;n1&&"string"==typeof d&&!nt.checkClone&&Ut.test(d))return this.each(function(n){var i=u.eq(n);p&&(t[0]=d.call(this,n,i.html())),i.domManip(t,e)});if(l&&(r=ot.buildFragment(t,this[0].ownerDocument,!1,this),n=r.firstChild,1===r.childNodes.length&&(r=n),n)){for(a=ot.map(g(r,"script"),M),o=a.length;c
t
",o=e.getElementsByTagName("td"),o[0].style.cssText="margin:0;border:0;padding:0;display:none",r=0===o[0].offsetHeight,r&&(o[0].style.display="",o[1].style.display="none",r=0===o[0].offsetHeight),n.removeChild(i))}var n,i,o,a,s,r,c;n=ft.createElement("div"),n.innerHTML="
a",o=n.getElementsByTagName("a")[0],i=o&&o.style,i&&(i.cssText="float:left;opacity:.5",nt.opacity="0.5"===i.opacity,nt.cssFloat=!!i.cssFloat,n.style.backgroundClip="content-box",n.cloneNode(!0).style.backgroundClip="",nt.clearCloneStyle="content-box"===n.style.backgroundClip,nt.boxSizing=""===i.boxSizing||""===i.MozBoxSizing||""===i.WebkitBoxSizing,ot.extend(nt,{reliableHiddenOffsets:function(){return null==r&&e(),r},boxSizingReliable:function(){return null==s&&e(),s},pixelPosition:function(){return null==a&&e(),a},reliableMarginRight:function(){return null==c&&e(),c}}))}(),ot.swap=function(t,e,n,i){var o,a,s={};for(a in e)s[a]=t.style[a],t.style[a]=e[a];o=n.apply(t,i||[]);for(a in e)t.style[a]=s[a];return o};var ae=/alpha\([^)]*\)/i,se=/opacity\s*=\s*([^)]*)/,re=/^(none|table(?!-c[ea]).+)/,ce=new RegExp("^("+Ct+")(.*)$","i"),le=new RegExp("^([+-])=("+Ct+")","i"),ue={position:"absolute",visibility:"hidden",display:"block"},he={letterSpacing:"0",fontWeight:"400"},de=["Webkit","O","Moz","ms"];ot.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=ee(t,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":nt.cssFloat?"cssFloat":"styleFloat"},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,a,s,r=ot.camelCase(e),c=t.style;if(e=ot.cssProps[r]||(ot.cssProps[r]=O(c,r)),s=ot.cssHooks[e]||ot.cssHooks[r],void 0===n)return s&&"get"in s&&void 0!==(o=s.get(t,!1,i))?o:c[e];if(a=typeof n,"string"===a&&(o=le.exec(n))&&(n=(o[1]+1)*o[2]+parseFloat(ot.css(t,e)),a="number"),null!=n&&n===n&&("number"!==a||ot.cssNumber[r]||(n+="px"),nt.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),!(s&&"set"in s&&void 0===(n=s.set(t,n,i)))))try{c[e]=n}catch(l){}}},css:function(t,e,n,i){var o,a,s,r=ot.camelCase(e);return e=ot.cssProps[r]||(ot.cssProps[r]=O(t.style,r)),s=ot.cssHooks[e]||ot.cssHooks[r],s&&"get"in s&&(a=s.get(t,!0,n)),void 0===a&&(a=ee(t,e,i)),"normal"===a&&e in he&&(a=he[e]),""===n||n?(o=parseFloat(a),n===!0||ot.isNumeric(o)?o||0:a):a}}),ot.each(["height","width"],function(t,e){ot.cssHooks[e]={get:function(t,n,i){if(n)return re.test(ot.css(t,"display"))&&0===t.offsetWidth?ot.swap(t,ue,function(){return L(t,e,i)}):L(t,e,i)},set:function(t,n,i){var o=i&&te(t);return S(t,n,i?x(t,e,i,nt.boxSizing&&"border-box"===ot.css(t,"boxSizing",!1,o),o):0)}}}),nt.opacity||(ot.cssHooks.opacity={get:function(t,e){return se.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var n=t.style,i=t.currentStyle,o=ot.isNumeric(e)?"alpha(opacity="+100*e+")":"",a=i&&i.filter||n.filter||"";n.zoom=1,(e>=1||""===e)&&""===ot.trim(a.replace(ae,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===e||i&&!i.filter)||(n.filter=ae.test(a)?a.replace(ae,o):a+" "+o)}}),ot.cssHooks.marginRight=C(nt.reliableMarginRight,function(t,e){if(e)return ot.swap(t,{display:"inline-block"},ee,[t,"marginRight"])}),ot.each({margin:"",padding:"",border:"Width"},function(t,e){ot.cssHooks[t+e]={expand:function(n){for(var i=0,o={},a="string"==typeof n?n.split(" "):[n];i<4;i++)o[t+Ot[i]+e]=a[i]||a[i-2]||a[0];return o}},ne.test(t)||(ot.cssHooks[t+e].set=S)}),ot.fn.extend({css:function(t,e){return St(this,function(t,e,n){var i,o,a={},s=0;if(ot.isArray(e)){for(i=te(t),o=e.length;s1)},show:function(){return N(this,!0)},hide:function(){return N(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Nt(this)?ot(this).show():ot(this).hide()})}}),ot.Tween=D,D.prototype={constructor:D,init:function(t,e,n,i,o,a){this.elem=t,this.prop=n,this.easing=o||"swing",this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=a||(ot.cssNumber[n]?"":"px")},cur:function(){var t=D.propHooks[this.prop];return t&&t.get?t.get(this):D.propHooks._default.get(this)},run:function(t){var e,n=D.propHooks[this.prop];return this.options.duration?this.pos=e=ot.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):D.propHooks._default.set(this),this}},D.prototype.init.prototype=D.prototype,D.propHooks={_default:{get:function(t){var e;return null==t.elem[t.prop]||t.elem.style&&null!=t.elem.style[t.prop]?(e=ot.css(t.elem,t.prop,""),e&&"auto"!==e?e:0):t.elem[t.prop]},set:function(t){ot.fx.step[t.prop]?ot.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[ot.cssProps[t.prop]]||ot.cssHooks[t.prop])?ot.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}},D.propHooks.scrollTop=D.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},ot.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}},ot.fx=D.prototype.init,ot.fx.step={};var pe,fe,me=/^(?:toggle|show|hide)$/,ge=new RegExp("^(?:([+-])=|)("+Ct+")([a-z%]*)$","i"),be=/queueHooks$/,ve=[E],Me={"*":[function(t,e){var n=this.createTween(t,e),i=n.cur(),o=ge.exec(e),a=o&&o[3]||(ot.cssNumber[t]?"":"px"),s=(ot.cssNumber[t]||"px"!==a&&+i)&&ge.exec(ot.css(n.elem,t)),r=1,c=20;if(s&&s[3]!==a){a=a||s[3],o=o||[],s=+i||1;do r=r||".5",s/=r,ot.style(n.elem,t,s+a);while(r!==(r=n.cur()/i)&&1!==r&&--c)}return o&&(s=n.start=+s||+i||0,n.unit=a,n.end=o[1]?s+(o[1]+1)*o[2]:+o[2]),n}]};ot.Animation=ot.extend(I,{tweener:function(t,e){ot.isFunction(t)?(e=t,t=["*"]):t=t.split(" ");for(var n,i=0,o=t.length;i
a",i=e.getElementsByTagName("a")[0],n=ft.createElement("select"),o=n.appendChild(ft.createElement("option")),t=e.getElementsByTagName("input")[0],i.style.cssText="top:1px",nt.getSetAttribute="t"!==e.className,nt.style=/top/.test(i.getAttribute("style")),nt.hrefNormalized="/a"===i.getAttribute("href"),nt.checkOn=!!t.value,nt.optSelected=o.selected,nt.enctype=!!ft.createElement("form").enctype,n.disabled=!0,nt.optDisabled=!o.disabled,t=ft.createElement("input"),t.setAttribute("value",""),nt.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),nt.radioValue="t"===t.value}();var ye=/\r/g;ot.fn.extend({val:function(t){var e,n,i,o=this[0];{if(arguments.length)return i=ot.isFunction(t),this.each(function(n){var o;1===this.nodeType&&(o=i?t.call(this,n,ot(this).val()):t,null==o?o="":"number"==typeof o?o+="":ot.isArray(o)&&(o=ot.map(o,function(t){return null==t?"":t+""})),e=ot.valHooks[this.type]||ot.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))});if(o)return e=ot.valHooks[o.type]||ot.valHooks[o.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(n=e.get(o,"value"))?n:(n=o.value,"string"==typeof n?n.replace(ye,""):null==n?"":n)}}}),ot.extend({valHooks:{option:{get:function(t){var e=ot.find.attr(t,"value");return null!=e?e:ot.trim(ot.text(t))}},select:{get:function(t){for(var e,n,i=t.options,o=t.selectedIndex,a="select-one"===t.type||o<0,s=a?null:[],r=a?o+1:i.length,c=o<0?r:a?o:0;c=0)try{i.selected=n=!0}catch(r){i.scrollHeight}else i.selected=!1;return n||(t.selectedIndex=-1),o}}}}),ot.each(["radio","checkbox"],function(){ot.valHooks[this]={set:function(t,e){if(ot.isArray(e))return t.checked=ot.inArray(ot(t).val(),e)>=0}},nt.checkOn||(ot.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var Ae,_e,ze=ot.expr.attrHandle,Te=/^(?:checked|selected)$/i,we=nt.getSetAttribute,Ce=nt.input;ot.fn.extend({attr:function(t,e){return St(this,ot.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){ot.removeAttr(this,t)})}}),ot.extend({attr:function(t,e,n){var i,o,a=t.nodeType;if(t&&3!==a&&8!==a&&2!==a)return typeof t.getAttribute===zt?ot.prop(t,e,n):(1===a&&ot.isXMLDoc(t)||(e=e.toLowerCase(),i=ot.attrHooks[e]||(ot.expr.match.bool.test(e)?_e:Ae)),void 0===n?i&&"get"in i&&null!==(o=i.get(t,e))?o:(o=ot.find.attr(t,e),null==o?void 0:o):null!==n?i&&"set"in i&&void 0!==(o=i.set(t,n,e))?o:(t.setAttribute(e,n+""),n):void ot.removeAttr(t,e))},removeAttr:function(t,e){var n,i,o=0,a=e&&e.match(Mt);if(a&&1===t.nodeType)for(;n=a[o++];)i=ot.propFix[n]||n,ot.expr.match.bool.test(n)?Ce&&we||!Te.test(n)?t[i]=!1:t[ot.camelCase("default-"+n)]=t[i]=!1:ot.attr(t,n,""),t.removeAttribute(we?n:i)},attrHooks:{type:{set:function(t,e){if(!nt.radioValue&&"radio"===e&&ot.nodeName(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}}}),_e={set:function(t,e,n){return e===!1?ot.removeAttr(t,n):Ce&&we||!Te.test(n)?t.setAttribute(!we&&ot.propFix[n]||n,n):t[ot.camelCase("default-"+n)]=t[n]=!0,n}},ot.each(ot.expr.match.bool.source.match(/\w+/g),function(t,e){var n=ze[e]||ot.find.attr;ze[e]=Ce&&we||!Te.test(e)?function(t,e,i){var o,a;return i||(a=ze[e],ze[e]=o,o=null!=n(t,e,i)?e.toLowerCase():null,ze[e]=a),o}:function(t,e,n){if(!n)return t[ot.camelCase("default-"+e)]?e.toLowerCase():null}}),Ce&&we||(ot.attrHooks.value={set:function(t,e,n){return ot.nodeName(t,"input")?void(t.defaultValue=e):Ae&&Ae.set(t,e,n)}}),we||(Ae={set:function(t,e,n){var i=t.getAttributeNode(n);if(i||t.setAttributeNode(i=t.ownerDocument.createAttribute(n)),i.value=e+="","value"===n||e===t.getAttribute(n))return e}},ze.id=ze.name=ze.coords=function(t,e,n){var i;if(!n)return(i=t.getAttributeNode(e))&&""!==i.value?i.value:null},ot.valHooks.button={get:function(t,e){var n=t.getAttributeNode(e);if(n&&n.specified)return n.value},set:Ae.set},ot.attrHooks.contenteditable={ -set:function(t,e,n){Ae.set(t,""!==e&&e,n)}},ot.each(["width","height"],function(t,e){ot.attrHooks[e]={set:function(t,n){if(""===n)return t.setAttribute(e,"auto"),n}}})),nt.style||(ot.attrHooks.style={get:function(t){return t.style.cssText||void 0},set:function(t,e){return t.style.cssText=e+""}});var Oe=/^(?:input|select|textarea|button|object)$/i,Ne=/^(?:a|area)$/i;ot.fn.extend({prop:function(t,e){return St(this,ot.prop,t,e,arguments.length>1)},removeProp:function(t){return t=ot.propFix[t]||t,this.each(function(){try{this[t]=void 0,delete this[t]}catch(e){}})}}),ot.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(t,e,n){var i,o,a,s=t.nodeType;if(t&&3!==s&&8!==s&&2!==s)return a=1!==s||!ot.isXMLDoc(t),a&&(e=ot.propFix[e]||e,o=ot.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=ot.find.attr(t,"tabindex");return e?parseInt(e,10):Oe.test(t.nodeName)||Ne.test(t.nodeName)&&t.href?0:-1}}}}),nt.hrefNormalized||ot.each(["href","src"],function(t,e){ot.propHooks[e]={get:function(t){return t.getAttribute(e,4)}}}),nt.optSelected||(ot.propHooks.selected={get:function(t){var e=t.parentNode;return e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex),null}}),ot.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ot.propFix[this.toLowerCase()]=this}),nt.enctype||(ot.propFix.enctype="encoding");var Se=/[\t\r\n\f]/g;ot.fn.extend({addClass:function(t){var e,n,i,o,a,s,r=0,c=this.length,l="string"==typeof t&&t;if(ot.isFunction(t))return this.each(function(e){ot(this).addClass(t.call(this,e,this.className))});if(l)for(e=(t||"").match(Mt)||[];r=0;)i=i.replace(" "+o+" "," ");s=t?ot.trim(i):"",n.className!==s&&(n.className=s)}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):ot.isFunction(t)?this.each(function(n){ot(this).toggleClass(t.call(this,n,this.className,e),e)}):this.each(function(){if("string"===n)for(var e,i=0,o=ot(this),a=t.match(Mt)||[];e=a[i++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else n!==zt&&"boolean"!==n||(this.className&&ot._data(this,"__className__",this.className),this.className=this.className||t===!1?"":ot._data(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",n=0,i=this.length;n=0)return!0;return!1}}),ot.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(t,e){ot.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}),ot.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)},bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}});var xe=ot.now(),Le=/\?/,De=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;ot.parseJSON=function(e){if(t.JSON&&t.JSON.parse)return t.JSON.parse(e+"");var n,i=null,o=ot.trim(e+"");return o&&!ot.trim(o.replace(De,function(t,e,o,a){return n&&e&&(i=0),0===i?t:(n=o||e,i+=!a-!o,"")}))?Function("return "+o)():ot.error("Invalid JSON: "+e)},ot.parseXML=function(e){var n,i;if(!e||"string"!=typeof e)return null;try{t.DOMParser?(i=new DOMParser,n=i.parseFromString(e,"text/xml")):(n=new ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(e))}catch(o){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||ot.error("Invalid XML: "+e),n};var ke,qe,We=/#.*$/,Ee=/([?&])_=[^&]*/,Be=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ie=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Pe=/^(?:GET|HEAD)$/,Xe=/^\/\//,Re=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Fe={},He={},je="*/".concat("*");try{qe=location.href}catch(Ue){qe=ft.createElement("a"),qe.href="",qe=qe.href}ke=Re.exec(qe.toLowerCase())||[],ot.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qe,type:"GET",isLocal:Ie.test(ke[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":je,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":ot.parseJSON,"text xml":ot.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?R(R(t,ot.ajaxSettings),e):R(ot.ajaxSettings,t)},ajaxPrefilter:P(Fe),ajaxTransport:P(He),ajax:function(t,e){function n(t,e,n,i){var o,u,b,v,y,_=e;2!==M&&(M=2,r&&clearTimeout(r),l=void 0,s=i||"",A.readyState=t>0?4:0,o=t>=200&&t<300||304===t,n&&(v=F(h,A,n)),v=H(h,v,A,o),o?(h.ifModified&&(y=A.getResponseHeader("Last-Modified"),y&&(ot.lastModified[a]=y),y=A.getResponseHeader("etag"),y&&(ot.etag[a]=y)),204===t||"HEAD"===h.type?_="nocontent":304===t?_="notmodified":(_=v.state,u=v.data,b=v.error,o=!b)):(b=_,!t&&_||(_="error",t<0&&(t=0))),A.status=t,A.statusText=(e||_)+"",o?f.resolveWith(d,[u,_,A]):f.rejectWith(d,[A,_,b]),A.statusCode(g),g=void 0,c&&p.trigger(o?"ajaxSuccess":"ajaxError",[A,h,o?u:b]),m.fireWith(d,[A,_]),c&&(p.trigger("ajaxComplete",[A,h]),--ot.active||ot.event.trigger("ajaxStop")))}"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,o,a,s,r,c,l,u,h=ot.ajaxSetup({},e),d=h.context||h,p=h.context&&(d.nodeType||d.jquery)?ot(d):ot.event,f=ot.Deferred(),m=ot.Callbacks("once memory"),g=h.statusCode||{},b={},v={},M=0,y="canceled",A={readyState:0,getResponseHeader:function(t){var e;if(2===M){if(!u)for(u={};e=Be.exec(s);)u[e[1].toLowerCase()]=e[2];e=u[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===M?s:null},setRequestHeader:function(t,e){var n=t.toLowerCase();return M||(t=v[n]=v[n]||t,b[t]=e),this},overrideMimeType:function(t){return M||(h.mimeType=t),this},statusCode:function(t){var e;if(t)if(M<2)for(e in t)g[e]=[g[e],t[e]];else A.always(t[A.status]);return this},abort:function(t){var e=t||y;return l&&l.abort(e),n(0,e),this}};if(f.promise(A).complete=m.add,A.success=A.done,A.error=A.fail,h.url=((t||h.url||qe)+"").replace(We,"").replace(Xe,ke[1]+"//"),h.type=e.method||e.type||h.method||h.type,h.dataTypes=ot.trim(h.dataType||"*").toLowerCase().match(Mt)||[""],null==h.crossDomain&&(i=Re.exec(h.url.toLowerCase()),h.crossDomain=!(!i||i[1]===ke[1]&&i[2]===ke[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(ke[3]||("http:"===ke[1]?"80":"443")))),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=ot.param(h.data,h.traditional)),X(Fe,h,e,A),2===M)return A;c=ot.event&&h.global,c&&0===ot.active++&&ot.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Pe.test(h.type),a=h.url,h.hasContent||(h.data&&(a=h.url+=(Le.test(a)?"&":"?")+h.data,delete h.data),h.cache===!1&&(h.url=Ee.test(a)?a.replace(Ee,"$1_="+xe++):a+(Le.test(a)?"&":"?")+"_="+xe++)),h.ifModified&&(ot.lastModified[a]&&A.setRequestHeader("If-Modified-Since",ot.lastModified[a]),ot.etag[a]&&A.setRequestHeader("If-None-Match",ot.etag[a])),(h.data&&h.hasContent&&h.contentType!==!1||e.contentType)&&A.setRequestHeader("Content-Type",h.contentType),A.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+je+"; q=0.01":""):h.accepts["*"]);for(o in h.headers)A.setRequestHeader(o,h.headers[o]);if(h.beforeSend&&(h.beforeSend.call(d,A,h)===!1||2===M))return A.abort();y="abort";for(o in{success:1,error:1,complete:1})A[o](h[o]);if(l=X(He,h,e,A)){A.readyState=1,c&&p.trigger("ajaxSend",[A,h]),h.async&&h.timeout>0&&(r=setTimeout(function(){A.abort("timeout")},h.timeout));try{M=1,l.send(b,n)}catch(_){if(!(M<2))throw _;n(-1,_)}}else n(-1,"No Transport");return A},getJSON:function(t,e,n){return ot.get(t,e,n,"json")},getScript:function(t,e){return ot.get(t,void 0,e,"script")}}),ot.each(["get","post"],function(t,e){ot[e]=function(t,n,i,o){return ot.isFunction(n)&&(o=o||i,i=n,n=void 0),ot.ajax({url:t,type:e,dataType:o,data:n,success:i})}}),ot._evalUrl=function(t){return ot.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},ot.fn.extend({wrapAll:function(t){if(ot.isFunction(t))return this.each(function(e){ot(this).wrapAll(t.call(this,e))});if(this[0]){var e=ot(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstChild&&1===t.firstChild.nodeType;)t=t.firstChild;return t}).append(this)}return this},wrapInner:function(t){return ot.isFunction(t)?this.each(function(e){ot(this).wrapInner(t.call(this,e))}):this.each(function(){var e=ot(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=ot.isFunction(t);return this.each(function(n){ot(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){ot.nodeName(this,"body")||ot(this).replaceWith(this.childNodes)}).end()}}),ot.expr.filters.hidden=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0||!nt.reliableHiddenOffsets()&&"none"===(t.style&&t.style.display||ot.css(t,"display"))},ot.expr.filters.visible=function(t){return!ot.expr.filters.hidden(t)};var $e=/%20/g,Ve=/\[\]$/,Ye=/\r?\n/g,Je=/^(?:submit|button|image|reset|file)$/i,Ke=/^(?:input|select|textarea|keygen)/i;ot.param=function(t,e){var n,i=[],o=function(t,e){e=ot.isFunction(e)?e():null==e?"":e,i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=ot.ajaxSettings&&ot.ajaxSettings.traditional),ot.isArray(t)||t.jquery&&!ot.isPlainObject(t))ot.each(t,function(){o(this.name,this.value)});else for(n in t)j(n,t[n],e,o);return i.join("&").replace($e,"+")},ot.fn.extend({serialize:function(){return ot.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=ot.prop(this,"elements");return t?ot.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!ot(this).is(":disabled")&&Ke.test(this.nodeName)&&!Je.test(t)&&(this.checked||!xt.test(t))}).map(function(t,e){var n=ot(this).val();return null==n?null:ot.isArray(n)?ot.map(n,function(t){return{name:e.name,value:t.replace(Ye,"\r\n")}}):{name:e.name,value:n.replace(Ye,"\r\n")}}).get()}}),ot.ajaxSettings.xhr=void 0!==t.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&U()||$()}:U;var Ge=0,Qe={},Ze=ot.ajaxSettings.xhr();t.attachEvent&&t.attachEvent("onunload",function(){for(var t in Qe)Qe[t](void 0,!0)}),nt.cors=!!Ze&&"withCredentials"in Ze,Ze=nt.ajax=!!Ze,Ze&&ot.ajaxTransport(function(t){if(!t.crossDomain||nt.cors){var e;return{send:function(n,i){var o,a=t.xhr(),s=++Ge;if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(o in n)void 0!==n[o]&&a.setRequestHeader(o,n[o]+"");a.send(t.hasContent&&t.data||null),e=function(n,o){var r,c,l;if(e&&(o||4===a.readyState))if(delete Qe[s],e=void 0,a.onreadystatechange=ot.noop,o)4!==a.readyState&&a.abort();else{l={},r=a.status,"string"==typeof a.responseText&&(l.text=a.responseText);try{c=a.statusText}catch(u){c=""}r||!t.isLocal||t.crossDomain?1223===r&&(r=204):r=l.text?200:404}l&&i(r,c,l,a.getAllResponseHeaders())},t.async?4===a.readyState?setTimeout(e):a.onreadystatechange=Qe[s]=e:e()},abort:function(){e&&e(void 0,!0)}}}}),ot.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){return ot.globalEval(t),t}}}),ot.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET",t.global=!1)}),ot.ajaxTransport("script",function(t){if(t.crossDomain){var e,n=ft.head||ot("head")[0]||ft.documentElement;return{send:function(i,o){e=ft.createElement("script"),e.async=!0,t.scriptCharset&&(e.charset=t.scriptCharset),e.src=t.url,e.onload=e.onreadystatechange=function(t,n){(n||!e.readyState||/loaded|complete/.test(e.readyState))&&(e.onload=e.onreadystatechange=null,e.parentNode&&e.parentNode.removeChild(e),e=null,n||o(200,"success"))},n.insertBefore(e,n.firstChild)},abort:function(){e&&e.onload(void 0,!0)}}}});var tn=[],en=/(=)\?(?=&|$)|\?\?/;ot.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=tn.pop()||ot.expando+"_"+xe++;return this[t]=!0,t}}),ot.ajaxPrefilter("json jsonp",function(e,n,i){var o,a,s,r=e.jsonp!==!1&&(en.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&en.test(e.data)&&"data");if(r||"jsonp"===e.dataTypes[0])return o=e.jsonpCallback=ot.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,r?e[r]=e[r].replace(en,"$1"+o):e.jsonp!==!1&&(e.url+=(Le.test(e.url)?"&":"?")+e.jsonp+"="+o),e.converters["script json"]=function(){return s||ot.error(o+" was not called"),s[0]},e.dataTypes[0]="json",a=t[o],t[o]=function(){s=arguments},i.always(function(){t[o]=a,e[o]&&(e.jsonpCallback=n.jsonpCallback,tn.push(o)),s&&ot.isFunction(a)&&a(s[0]),s=a=void 0}),"script"}),ot.parseHTML=function(t,e,n){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(n=e,e=!1),e=e||ft;var i=ht.exec(t),o=!n&&[];return i?[e.createElement(i[1])]:(i=ot.buildFragment([t],e,o),o&&o.length&&ot(o).remove(),ot.merge([],i.childNodes))};var nn=ot.fn.load;ot.fn.load=function(t,e,n){if("string"!=typeof t&&nn)return nn.apply(this,arguments);var i,o,a,s=this,r=t.indexOf(" ");return r>=0&&(i=ot.trim(t.slice(r,t.length)),t=t.slice(0,r)),ot.isFunction(e)?(n=e,e=void 0):e&&"object"==typeof e&&(a="POST"),s.length>0&&ot.ajax({url:t,type:a,dataType:"html",data:e}).done(function(t){o=arguments,s.html(i?ot("
").append(ot.parseHTML(t)).find(i):t)}).complete(n&&function(t,e){s.each(n,o||[t.responseText,e,t])}),this},ot.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){ot.fn[e]=function(t){return this.on(e,t)}}),ot.expr.filters.animated=function(t){return ot.grep(ot.timers,function(e){return t===e.elem}).length};var on=t.document.documentElement;ot.offset={setOffset:function(t,e,n){var i,o,a,s,r,c,l,u=ot.css(t,"position"),h=ot(t),d={};"static"===u&&(t.style.position="relative"),r=h.offset(),a=ot.css(t,"top"),c=ot.css(t,"left"),l=("absolute"===u||"fixed"===u)&&ot.inArray("auto",[a,c])>-1,l?(i=h.position(),s=i.top,o=i.left):(s=parseFloat(a)||0,o=parseFloat(c)||0),ot.isFunction(e)&&(e=e.call(t,n,r)),null!=e.top&&(d.top=e.top-r.top+s),null!=e.left&&(d.left=e.left-r.left+o),"using"in e?e.using.call(t,d):h.css(d)}},ot.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ot.offset.setOffset(this,t,e)});var e,n,i={top:0,left:0},o=this[0],a=o&&o.ownerDocument;if(a)return e=a.documentElement,ot.contains(e,o)?(typeof o.getBoundingClientRect!==zt&&(i=o.getBoundingClientRect()),n=V(a),{top:i.top+(n.pageYOffset||e.scrollTop)-(e.clientTop||0),left:i.left+(n.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}):i},position:function(){if(this[0]){var t,e,n={top:0,left:0},i=this[0];return"fixed"===ot.css(i,"position")?e=i.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),ot.nodeName(t[0],"html")||(n=t.offset()),n.top+=ot.css(t[0],"borderTopWidth",!0),n.left+=ot.css(t[0],"borderLeftWidth",!0)),{top:e.top-n.top-ot.css(i,"marginTop",!0),left:e.left-n.left-ot.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||on;t&&!ot.nodeName(t,"html")&&"static"===ot.css(t,"position");)t=t.offsetParent;return t||on})}}),ot.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var n=/Y/.test(e);ot.fn[t]=function(i){return St(this,function(t,i,o){var a=V(t);return void 0===o?a?e in a?a[e]:a.document.documentElement[i]:t[i]:void(a?a.scrollTo(n?ot(a).scrollLeft():o,n?o:ot(a).scrollTop()):t[i]=o)},t,i,arguments.length,null)}}),ot.each(["top","left"],function(t,e){ot.cssHooks[e]=C(nt.pixelPosition,function(t,n){if(n)return n=ee(t,e),ie.test(n)?ot(t).position()[e]+"px":n})}),ot.each({Height:"height",Width:"width"},function(t,e){ot.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,i){ot.fn[i]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(i===!0||o===!0?"margin":"border");return St(this,function(e,n,i){var o;return ot.isWindow(e)?e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===i?ot.css(e,n,s):ot.style(e,n,i,s)},e,a?i:void 0,a,null)}})}),ot.fn.size=function(){return this.length},ot.fn.andSelf=ot.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return ot});var an=t.jQuery,sn=t.$;return ot.noConflict=function(e){return t.$===ot&&(t.$=sn),e&&t.jQuery===ot&&(t.jQuery=an),ot},typeof e===zt&&(t.jQuery=t.$=ot),ot}),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){function e(e,i){var o,a,s,r=e.nodeName.toLowerCase();return"area"===r?(o=e.parentNode,a=o.name,!(!e.href||!a||"map"!==o.nodeName.toLowerCase())&&(s=t("img[usemap='#"+a+"']")[0],!!s&&n(s))):(/input|select|textarea|button|object/.test(r)?!e.disabled:"a"===r?e.href||i:i)&&n(e)}function n(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}function i(t){for(var e,n;t.length&&t[0]!==document;){if(e=t.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(n=parseInt(t.css("zIndex"),10),!isNaN(n)&&0!==n))return n;t=t.parent()}return 0}function o(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=a(t("
"))}function a(e){var n="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(n,"mouseout",function(){t(this).removeClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!==-1&&t(this).removeClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!==-1&&t(this).removeClass("ui-datepicker-next-hover")}).delegate(n,"mouseover",s)}function s(){t.datepicker._isDisabledDatepicker(b.inline?b.dpDiv.parent()[0]:b.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!==-1&&t(this).addClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!==-1&&t(this).addClass("ui-datepicker-next-hover"))}function r(e,n){t.extend(e,n);for(var i in n)null==n[i]&&(e[i]=n[i]);return e}function c(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.ui=t.ui||{},t.extend(t.ui,{version:"1.11.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({scrollParent:function(e){var n=this.css("position"),i="absolute"===n,o=e?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var e=t(this);return(!i||"static"!==e.css("position"))&&o.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==n&&a.length?a:t(this[0].ownerDocument||document)},uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(n){return!!t.data(n,e)}}):function(e,n,i){return!!t.data(e,i[3])},focusable:function(n){return e(n,!isNaN(t.attr(n,"tabindex")))},tabbable:function(n){var i=t.attr(n,"tabindex"),o=isNaN(i);return(o||i>=0)&&e(n,!o)}}),t("").outerWidth(1).jquery||t.each(["Width","Height"],function(e,n){function i(e,n,i,a){return t.each(o,function(){n-=parseFloat(t.css(e,"padding"+this))||0,i&&(n-=parseFloat(t.css(e,"border"+this+"Width"))||0),a&&(n-=parseFloat(t.css(e,"margin"+this))||0)}),n}var o="Width"===n?["Left","Right"]:["Top","Bottom"],a=n.toLowerCase(),s={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+n]=function(e){return void 0===e?s["inner"+n].call(this):this.each(function(){t(this).css(a,i(this,e)+"px")})},t.fn["outer"+n]=function(e,o){return"number"!=typeof e?s["outer"+n].call(this,e):this.each(function(){t(this).css(a,i(this,e,!0,o)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(n){return arguments.length?e.call(this,t.camelCase(n)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.fn.extend({focus:function(e){return function(n,i){return"number"==typeof n?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),i&&i.call(e)},n)}):e.apply(this,arguments)}}(t.fn.focus),disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(e){if(void 0!==e)return this.css("zIndex",e);if(this.length)for(var n,i,o=t(this[0]);o.length&&o[0]!==document;){if(n=o.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(i=parseInt(o.css("zIndex"),10),!isNaN(i)&&0!==i))return i;o=o.parent()}return 0}}),t.ui.plugin={add:function(e,n,i){var o,a=t.ui[e].prototype;for(o in i)a.plugins[o]=a.plugins[o]||[],a.plugins[o].push([n,i[o]])},call:function(t,e,n,i){var o,a=t.plugins[e];if(a&&(i||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(o=0;o",options:{disabled:!1,create:null},_createWidget:function(e,n){n=t(n||this.defaultElement||this)[0],this.element=t(n),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),n!==this&&(t.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===n&&this.destroy()}}),this.document=t(n.style?n.ownerDocument:n.document||n),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(e,n){var i,o,a,s=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(s={},i=e.split("."),e=i.shift(),i.length){for(o=s[e]=t.widget.extend({},this.options[e]),a=0;a=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}});!function(){function e(t,e,n){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?n/100:1)]}function n(e,n){return parseInt(t.css(e,n),10)||0}function i(e){var n=e[0];return 9===n.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(n)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var o,a,s=Math.max,r=Math.abs,c=Math.round,l=/left|center|right/,u=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==o)return o;var e,n,i=t("
"),a=i.children()[0];return t("body").append(i),e=a.offsetWidth,i.css("overflow","scroll"),n=a.offsetWidth,e===n&&(n=i[0].clientWidth),i.remove(),o=e-n},getScrollInfo:function(e){var n=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),i=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),o="scroll"===n||"auto"===n&&e.width0?"right":"center",vertical:a<0?"top":i>0?"bottom":"middle"};ms(r(i),r(a))?c.important="horizontal":c.important="vertical",o.using.call(this,t,c)}),u.offset(t.extend(O,{using:l}))})},t.ui.position={fit:{left:function(t,e){var n,i=e.within,o=i.isWindow?i.scrollLeft:i.offset.left,a=i.width,r=t.left-e.collisionPosition.marginLeft,c=o-r,l=r+e.collisionWidth-a-o;e.collisionWidth>a?c>0&&l<=0?(n=t.left+c+e.collisionWidth-a-o,t.left+=c-n):l>0&&c<=0?t.left=o:c>l?t.left=o+a-e.collisionWidth:t.left=o:c>0?t.left+=c:l>0?t.left-=l:t.left=s(t.left-r,t.left)},top:function(t,e){var n,i=e.within,o=i.isWindow?i.scrollTop:i.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,c=o-r,l=r+e.collisionHeight-a-o;e.collisionHeight>a?c>0&&l<=0?(n=t.top+c+e.collisionHeight-a-o,t.top+=c-n):l>0&&c<=0?t.top=o:c>l?t.top=o+a-e.collisionHeight:t.top=o:c>0?t.top+=c:l>0?t.top-=l:t.top=s(t.top-r,t.top)}},flip:{left:function(t,e){var n,i,o=e.within,a=o.offset.left+o.scrollLeft,s=o.width,c=o.isWindow?o.scrollLeft:o.offset.left,l=t.left-e.collisionPosition.marginLeft,u=l-c,h=l+e.collisionWidth-s-c,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];u<0?(n=t.left+d+p+f+e.collisionWidth-s-a,(n<0||n0&&(i=t.left-e.collisionPosition.marginLeft+d+p+f-c,(i>0||r(i)u&&(i<0||i0&&(n=t.top-e.collisionPosition.marginTop+p+f+m-c,t.top+p+f+m>h&&(n>0||r(n)10&&o<11,e.innerHTML="",n.removeChild(e)}()}();t.ui.position,t.widget("ui.accordion",{version:"1.11.2",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),e.active<0&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?void this._activate(e):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),void("disabled"===t&&(this.element.toggleClass("ui-state-disabled",!!e).attr("aria-disabled",e),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e))))},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var n=t.ui.keyCode,i=this.headers.length,o=this.headers.index(e.target),a=!1;switch(e.keyCode){case n.RIGHT:case n.DOWN:a=this.headers[(o+1)%i];break;case n.LEFT:case n.UP:a=this.headers[(o-1+i)%i];break;case n.SPACE:case n.ENTER:this._eventHandler(e);break;case n.HOME:a=this.headers[0];break;case n.END:a=this.headers[i-1]}a&&(t(e.target).attr("tabIndex",-1),t(a).attr("tabIndex",0),a.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var e,n=this.options,i=n.heightStyle,o=this.element.parent();this.active=this._findActive(n.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var e=t(this),n=e.uniqueId().attr("id"),i=e.next(),o=i.uniqueId().attr("id");e.attr("aria-controls",o),i.attr("aria-labelledby",n)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(n.event),"fill"===i?(e=o.height(),this.element.siblings(":visible").each(function(){var n=t(this),i=n.css("position");"absolute"!==i&&"fixed"!==i&&(e-=n.outerHeight(!0))}),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===i&&(e=0,this.headers.next().each(function(){e=Math.max(e,t(this).css("height","").height())}).height(e))},_activate:function(e){var n=this._findActive(e)[0];n!==this.active[0]&&(n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var n={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){n[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,n),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var n=this.options,i=this.active,o=t(e.currentTarget),a=o[0]===i[0],s=a&&n.collapsible,r=s?t():o.next(),c=i.next(),l={oldHeader:i,oldPanel:c,newHeader:s?t():o,newPanel:r};e.preventDefault(),a&&!n.collapsible||this._trigger("beforeActivate",e,l)===!1||(n.active=!s&&this.headers.index(o),this.active=a?t():o,this._toggle(l),i.removeClass("ui-accordion-header-active ui-state-active"),n.icons&&i.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header),a||(o.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),n.icons&&o.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader),o.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var n=e.newPanel,i=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=i,this.options.animate?this._animate(n,i,e):(i.hide(),n.show(),this._toggleComplete(e)),i.attr({"aria-hidden":"true"}),i.prev().attr("aria-selected","false"),n.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):n.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),n.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(t,e,n){var i,o,a,s=this,r=0,c=t.length&&(!e.length||t.index()",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var n=t(e.target);!this.mouseHandled&&n.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),n.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&t(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var n=t(e.currentTarget);n.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(e,n)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var n=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,n)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){var n,i,o,a,s=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:s=!1,i=this.previousFilter||"",o=String.fromCharCode(e.keyCode),a=!1,clearTimeout(this.filterTimer),o===i?a=!0:o=i+o,n=this._filterMenuItems(o),n=a&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n,n.length||(o=String.fromCharCode(e.keyCode),n=this._filterMenuItems(o)),n.length?(this.focus(e,n),this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}s&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(t):this.select(t))},refresh:function(){var e,n,i=this,o=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),n=e.parent(),i=t("").addClass("ui-menu-icon ui-icon "+o).data("ui-menu-submenu-carat",!0);n.attr("aria-haspopup","true").prepend(i),e.attr("aria-labelledby",n.attr("id"))}),e=a.add(this.element),n=e.find(this.options.items),n.not(".ui-menu-item").each(function(){var e=t(this);i._isDivider(e)&&e.addClass("ui-widget-content ui-menu-divider")}),n.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),n.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),"disabled"===t&&this.element.toggleClass("ui-state-disabled",!!e).attr("aria-disabled",e),this._super(t,e)},focus:function(t,e){var n,i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=e.children(".ui-menu"),n.length&&t&&/^mouse/.test(t.type)&&this._startOpening(n),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var n,i,o,a,s,r;this._hasScroll()&&(n=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,i=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,o=e.offset().top-this.activeMenu.offset().top-n-i,a=this.activeMenu.scrollTop(),s=this.activeMenu.height(),r=e.outerHeight(),o<0?this.activeMenu.scrollTop(a+o):o+r>s&&this.activeMenu.scrollTop(a+o-s+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var n=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(e,n){clearTimeout(this.timer),this.timer=this._delay(function(){var i=n?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));i.length||(i=this.element),this._close(i),this.blur(e),this.activeMenu=i},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,n){var i;this.active&&(i="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),i&&i.length&&this.active||(i=this.activeMenu.find(this.options.items)[e]()),this.focus(n,i)},nextPage:function(e){var n,i,o;return this.active?void(this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,o=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=t(this),n.offset().top-i-o<0}),this.focus(e,n)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]()))):void this.next(e)},previousPage:function(e){var n,i,o;return this.active?void(this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,o=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=t(this),n.offset().top-i+o>0}),this.focus(e,n)):this.focus(e,this.activeMenu.find(this.options.items).first()))):void this.next(e)},_hasScroll:function(){return this.element.outerHeight()",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,n,i,o=this.element[0].nodeName.toLowerCase(),a="textarea"===o,s="input"===o;this.isMultiLine=!!a||!s&&this.element.prop("isContentEditable"),this.valueMethod=this.element[a||s?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(o){if(this.element.prop("readOnly"))return e=!0,i=!0,void(n=!0);e=!1,i=!1,n=!1;var a=t.ui.keyCode;switch(o.keyCode){case a.PAGE_UP:e=!0,this._move("previousPage",o);break;case a.PAGE_DOWN:e=!0,this._move("nextPage",o);break;case a.UP:e=!0,this._keyEvent("previous",o);break;case a.DOWN:e=!0,this._keyEvent("next",o);break;case a.ENTER:this.menu.active&&(e=!0,o.preventDefault(),this.menu.select(o));break;case a.TAB:this.menu.active&&this.menu.select(o);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(o),o.preventDefault());break;default:n=!0,this._searchTimeout(o)}},keypress:function(i){if(e)return e=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||i.preventDefault());if(!n){var o=t.ui.keyCode;switch(i.keyCode){case o.PAGE_UP:this._move("previousPage",i);break;case o.PAGE_DOWN:this._move("nextPage",i);break;case o.UP:this._keyEvent("previous",i);break;case o.DOWN:this._keyEvent("next",i)}}},input:function(t){return i?(i=!1,void t.preventDefault()):void this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?void delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),void this._change(t))}}),this._initSource(),this.menu=t("
");var r=t("a",n),c=r[0],l=r[1],u=r[2],h=r[3];e.oApi._fnBindAction(c,{action:"first"},s),e.oApi._fnBindAction(l,{action:"previous"},s),e.oApi._fnBindAction(u,{action:"next"},s),e.oApi._fnBindAction(h,{action:"last"},s),e.aanFeatures.p||(n.id=e.sTableId+"_paginate",c.id=e.sTableId+"_first",l.id=e.sTableId+"_previous",u.id=e.sTableId+"_next",h.id=e.sTableId+"_last")},fnUpdate:function(e,n){if(e.aanFeatures.p){var i,o,a,s,r,c=e.oInstance.fnPagingInfo(),l=t.fn.dataTableExt.oPagination.iFullNumbersShowPages,u=Math.floor(l/2),h=Math.ceil(e.fnRecordsDisplay()/e._iDisplayLength),d=Math.ceil(e._iDisplayStart/e._iDisplayLength)+1,p="",f=(e.oClasses,e.aanFeatures.p);for(e._iDisplayLength===-1?(i=1,o=1,d=1):h=h-u?(i=h-l+1,o=h):(i=d-Math.ceil(l/2)+1,o=i+l-1),a=i;a<=o;a++)p+=d!==a?'
  • '+e.fnFormatNumber(a)+"
  • ":'
  • '+e.fnFormatNumber(a)+"
  • ";for(a=0,s=f.length;a",o[0];);return 4h.a.l(e,t[n])&&e.push(t[n]);return e},ya:function(t,e){t=t||[];for(var n=[],i=0,o=t.length;ii?n&&t.push(e):n||t.splice(i,1)},na:l,extend:r,ra:c,sa:l?c:r,A:s,Oa:function(t,e){if(!t)return t;var n,i={};for(n in t)t.hasOwnProperty(n)&&(i[n]=e(t[n],n,t));return i},Fa:function(t){for(;t.firstChild;)h.removeNode(t.firstChild)},ec:function(t){t=h.a.R(t);for(var e=n.createElement("div"),i=0,o=t.length;if?t.setAttribute("selected",e):t.selected=e},ta:function(e){return null===e||e===t?"":e.trim?e.trim():e.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},oc:function(t,e){for(var n=[],i=(t||"").split(e),o=0,a=i.length;ot.length)&&t.substring(0,e.length)===e},Sb:function(t,e){if(t===e)return!0;if(11===t.nodeType)return!1;if(e.contains)return e.contains(3===t.nodeType?t.parentNode:t);if(e.compareDocumentPosition)return 16==(16&e.compareDocumentPosition(t));for(;t&&t!=e;)t=t.parentNode;return!!t},Ea:function(t){return h.a.Sb(t,t.ownerDocument.documentElement)},eb:function(t){return!!h.a.hb(t,h.a.Ea)},B:function(t){return t&&t.tagName&&t.tagName.toLowerCase()},q:function(t,e,n){var i=f&&p[e];if(!i&&o)o(t).bind(e,n);else if(i||"function"!=typeof t.addEventListener){if("undefined"==typeof t.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var a=function(e){n.call(t,e)},s="on"+e;t.attachEvent(s,a),h.a.u.ja(t,function(){t.detachEvent(s,a)})}else t.addEventListener(e,n,!1)},ha:function(t,i){if(!t||!t.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var a;if("input"===h.a.B(t)&&t.type&&"click"==i.toLowerCase()?(a=t.type,a="checkbox"==a||"radio"==a):a=!1,o&&!a)o(t).trigger(i);else if("function"==typeof n.createEvent){if("function"!=typeof t.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");a=n.createEvent(d[i]||"HTMLEvents"),a.initEvent(i,!0,!0,e,0,0,0,0,0,!1,!1,!1,!1,0,t),t.dispatchEvent(a)}else if(a&&t.click)t.click();else{if("undefined"==typeof t.fireEvent)throw Error("Browser doesn't support triggering events");t.fireEvent("on"+i)}},c:function(t){return h.v(t)?t():t},Sa:function(t){return h.v(t)?t.o():t},ua:function(t,e,n){if(e){var i=/\S+/g,o=t.className.match(i)||[];h.a.r(e.match(i),function(t){h.a.Y(o,t,n)}),t.className=o.join(" ")}},Xa:function(e,n){var i=h.a.c(n);null!==i&&i!==t||(i="");var o=h.e.firstChild(e);!o||3!=o.nodeType||h.e.nextSibling(o)?h.e.U(e,[e.ownerDocument.createTextNode(i)]):o.data=i, -h.a.Vb(e)},Cb:function(t,e){if(t.name=e,7>=f)try{t.mergeAttributes(n.createElement(""),!1)}catch(i){}},Vb:function(t){9<=f&&(t=1==t.nodeType?t:t.parentNode,t.style&&(t.style.zoom=t.style.zoom))},Tb:function(t){if(f){var e=t.style.width;t.style.width=0,t.style.width=e}},ic:function(t,e){t=h.a.c(t),e=h.a.c(e);for(var n=[],i=t;i<=e;i++)n.push(i);return n},R:function(t){for(var e=[],n=0,i=t.length;n",""]||!a.indexOf("",""]||(!a.indexOf("",""]||[0,"",""],t="ignored
    "+a[1]+t+a[2]+"
    ","function"==typeof e.innerShiv?i.appendChild(e.innerShiv(t)):i.innerHTML=t;a[0]--;)i=i.lastChild;i=h.a.R(i.lastChild.childNodes)}return i},h.a.Va=function(e,n){if(h.a.Fa(e),n=h.a.c(n),null!==n&&n!==t)if("string"!=typeof n&&(n=n.toString()),o)o(e).html(n);else for(var i=h.a.Qa(n),a=0;a"},Hb:function(e,i){var o=n[e];if(o===t)throw Error("Couldn't find any memo with ID "+e+". Perhaps it's already been unmemoized.");try{return o.apply(null,i||[]),!0}finally{delete n[e]}},Ib:function(t,n){var i=[];e(t,i);for(var o=0,a=i.length;oa[0]?c+a[0]:a[0]),c);for(var c=1===l?c:Math.min(e+(a[1]||0),c),l=e+l-2,u=Math.max(c,l),d=[],p=[],f=2;ee;e++)t=t();return t})},h.toJSON=function(t,e,n){return t=h.Gb(t),h.a.Ya(t,e,n)},i.prototype={save:function(t,e){var n=h.a.l(this.keys,t);0<=n?this.ab[n]=e:(this.keys.push(t),this.ab.push(e))},get:function(e){return e=h.a.l(this.keys,e),0<=e?this.ab[e]:t}}}(),h.b("toJS",h.Gb),h.b("toJSON",h.toJSON),function(){h.i={p:function(e){switch(h.a.B(e)){case"option":return!0===e.__ko__hasDomDataOptionValue__?h.a.f.get(e,h.d.options.Pa):7>=h.a.oa?e.getAttributeNode("value")&&e.getAttributeNode("value").specified?e.value:e.text:e.value;case"select":return 0<=e.selectedIndex?h.i.p(e.options[e.selectedIndex]):t;default:return e.value}},X:function(e,n,i){switch(h.a.B(e)){case"option":switch(typeof n){case"string":h.a.f.set(e,h.d.options.Pa,t),"__ko__hasDomDataOptionValue__"in e&&delete e.__ko__hasDomDataOptionValue__,e.value=n;break;default:h.a.f.set(e,h.d.options.Pa,n),e.__ko__hasDomDataOptionValue__=!0,e.value="number"==typeof n?n:""}break;case"select":""!==n&&null!==n||(n=t);for(var o,a=-1,s=0,r=e.options.length;s=c){e&&s.push(n?{key:e,value:n.join("")}:{unknown:e}),e=n=c=0;continue}}else if(58===d){if(!n)continue}else if(47===d&&u&&1"===n.createComment("test").text,s=a?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,r=a?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,c={ul:!0,ol:!0};h.e={Q:{},childNodes:function(e){return t(e)?i(e):e.childNodes},da:function(e){if(t(e)){e=h.e.childNodes(e);for(var n=0,i=e.length;n=h.a.oa&&n in g?(n=g[n],o?e.removeAttribute(n):e[n]=i):o||e.setAttribute(n,i.toString()),"name"===n&&h.a.Cb(e,o?"":i.toString())})}},function(){h.d.checked={after:["value","attr"],init:function(e,n,i){function o(){return i.has("checkedValue")?h.a.c(i.get("checkedValue")):e.value}function a(){var t=e.checked,a=d?o():t;if(!h.ca.pa()&&(!c||t)){var s=h.k.t(n);l?u!==a?(t&&(h.a.Y(s,a,!0),h.a.Y(s,u,!1)),u=a):h.a.Y(s,a,t):h.g.va(s,i,"checked",a,!0)}}function s(){var t=h.a.c(n());e.checked=l?0<=h.a.l(t,o()):r?t:o()===t}var r="checkbox"==e.type,c="radio"==e.type;if(r||c){var l=r&&h.a.c(n())instanceof Array,u=l?o():t,d=c||l;c&&!e.name&&h.d.uniqueName.init(e,function(){return!0}),h.ba(a,null,{G:e}),h.a.q(e,"click",a),h.ba(s,null,{G:e})}}},h.g.W.checked=!0,h.d.checkedValue={update:function(t,e){t.value=h.a.c(e())}}}(),h.d.css={update:function(t,e){var n=h.a.c(e());"object"==typeof n?h.a.A(n,function(e,n){n=h.a.c(n),h.a.ua(t,e,n)}):(n=String(n||""),h.a.ua(t,t.__ko__cssValue,!1),t.__ko__cssValue=n,h.a.ua(t,n,!0))}},h.d.enable={update:function(t,e){var n=h.a.c(e());n&&t.disabled?t.removeAttribute("disabled"):n||t.disabled||(t.disabled=!0)}},h.d.disable={update:function(t,e){h.d.enable.update(t,function(){return!h.a.c(e())})}},h.d.event={init:function(t,e,n,i,o){var a=e()||{};h.a.A(a,function(a){"string"==typeof a&&h.a.q(t,a,function(t){var s,r=e()[a];if(r){try{var c=h.a.R(arguments);i=o.$data,c.unshift(i),s=r.apply(i,c)}finally{!0!==s&&(t.preventDefault?t.preventDefault():t.returnValue=!1)}!1===n.get(a+"Bubble")&&(t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation())}})})}},h.d.foreach={vb:function(t){return function(){var e=t(),n=h.a.Sa(e);return n&&"number"!=typeof n.length?(h.a.c(e),{foreach:n.data,as:n.as,includeDestroyed:n.includeDestroyed,afterAdd:n.afterAdd,beforeRemove:n.beforeRemove,afterRender:n.afterRender,beforeMove:n.beforeMove,afterMove:n.afterMove,templateEngine:h.K.Ja}):{foreach:e,templateEngine:h.K.Ja}}},init:function(t,e){return h.d.template.init(t,h.d.foreach.vb(e))},update:function(t,e,n,i,o){return h.d.template.update(t,h.d.foreach.vb(e),n,i,o)}},h.g.aa.foreach=!1,h.e.Q.foreach=!0,h.d.hasfocus={init:function(t,e,n){function i(i){t.__ko_hasfocusUpdating=!0;var o=t.ownerDocument;if("activeElement"in o){var a;try{a=o.activeElement}catch(s){a=o.body}i=a===t}o=e(),h.g.va(o,n,"hasfocus",i,!0),t.__ko_hasfocusLastValue=i,t.__ko_hasfocusUpdating=!1}var o=i.bind(null,!0),a=i.bind(null,!1);h.a.q(t,"focus",o),h.a.q(t,"focusin",o),h.a.q(t,"blur",a),h.a.q(t,"focusout",a)},update:function(t,e){var n=!!h.a.c(e());t.__ko_hasfocusUpdating||t.__ko_hasfocusLastValue===n||(n?t.focus():t.blur(),h.k.t(h.a.ha,null,[t,n?"focusin":"focusout"]))}},h.g.W.hasfocus=!0,h.d.hasFocus=h.d.hasfocus,h.g.W.hasFocus=!0,h.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(t,e){h.a.Va(t,e())}},u("if"),u("ifnot",!1,!0),u("with",!0,!1,function(t,e){return t.createChildContext(e)});var b={};h.d.options={init:function(t){if("select"!==h.a.B(t))throw Error("options binding applies only to SELECT elements");for(;0","#comment",o)})},Mb:function(t,e){return h.w.Na(function(n,i){var o=n.nextSibling;o&&o.nodeName.toLowerCase()===e&&h.xa(o,t,i)})}}}(),h.b("__tr_ambtns",h.Za.Mb),function(){h.n={},h.n.j=function(t){this.j=t},h.n.j.prototype.text=function(){var t=h.a.B(this.j),t="script"===t?"text":"textarea"===t?"value":"innerHTML";if(0==arguments.length)return this.j[t];var e=arguments[0];"innerHTML"===t?h.a.Va(this.j,e):this.j[t]=e};var e=h.a.f.L()+"_";h.n.j.prototype.data=function(t){return 1===arguments.length?h.a.f.get(this.j,e+t):void h.a.f.set(this.j,e+t,arguments[1])};var n=h.a.f.L();h.n.Z=function(t){this.j=t},h.n.Z.prototype=new h.n.j,h.n.Z.prototype.text=function(){if(0==arguments.length){var e=h.a.f.get(this.j,n)||{};return e.$a===t&&e.Ba&&(e.$a=e.Ba.innerHTML),e.$a}h.a.f.set(this.j,n,{$a:arguments[0]})},h.n.j.prototype.nodes=function(){return 0==arguments.length?(h.a.f.get(this.j,n)||{}).Ba:void h.a.f.set(this.j,n,{Ba:arguments[0]})},h.b("templateSources",h.n),h.b("templateSources.domElement",h.n.j),h.b("templateSources.anonymousTemplate",h.n.Z)}(),function(){function e(t,e,n){var i;for(e=h.e.nextSibling(e);t&&(i=t)!==e;)t=h.e.nextSibling(i),n(i,t)}function n(t,n){if(t.length){var i=t[0],o=t[t.length-1],a=i.parentNode,s=h.J.instance,r=s.preprocessNode;if(r){if(e(i,o,function(t,e){var n=t.previousSibling,a=r.call(s,t);a&&(t===i&&(i=a[0]||e),t===o&&(o=a[a.length-1]||n))}),t.length=0,!i)return;i===o?t.push(i):(t.push(i,o),h.a.ea(t,a))}e(i,o,function(t){1!==t.nodeType&&8!==t.nodeType||h.fb(n,t)}),e(i,o,function(t){1!==t.nodeType&&8!==t.nodeType||h.w.Ib(t,[n])}),h.a.ea(t,a)}}function i(t){return t.nodeType?t:0h.a.oa?0:t.nodes)?t.nodes():null;return e?h.a.R(e.cloneNode(!0).childNodes):(t=t.text(),h.a.Qa(t))},h.K.Ja=new h.K,h.Wa(h.K.Ja),h.b("nativeTemplateEngine",h.K),function(){h.La=function(){var t=this.ac=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(t){}return 1}();this.renderTemplateSource=function(e,i,a){if(a=a||{},2>t)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var s=e.data("precompiled");return s||(s=e.text()||"",s=o.template(null,"{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}"),e.data("precompiled",s)),e=[i.$data],i=o.extend({koBindingContext:i},a.templateOptions),i=o.tmpl(s,e,i),i.appendTo(n.createElement("div")),o.fragments={},i},this.createJavaScriptEvaluatorBlock=function(t){return"{{ko_code ((function() { return "+t+" })()) }}"},this.addTemplate=function(t,e){n.write("")},0=0&&(u&&(u.splice(m,1),t.processAllDeferredBindingUpdates&&t.processAllDeferredBindingUpdates()),p.splice(g,0,A)),l(v,n,null),t.processAllDeferredBindingUpdates&&t.processAllDeferredBindingUpdates(),T.afterMove&&T.afterMove.call(this,b,s,r)}y&&y.apply(this,arguments)},connectWith:!!T.connectClass&&"."+T.connectClass})),void 0!==T.isEnabled&&t.computed({read:function(){A.sortable(r(T.isEnabled)?"enable":"disable")},disposeWhenNodeIsRemoved:u})},0);return t.utils.domNodeDisposal.addDisposeCallback(u,function(){(A.data("ui-sortable")||A.data("sortable"))&&A.sortable("destroy"),clearTimeout(w)}),{controlsDescendantBindings:!0}},update:function(e,n,i,a,s){var r=p(n,"foreach");l(e,o,r.foreach),t.bindingHandlers.template.update(e,function(){return r},i,a,s)},connectClass:"ko_container",allowDrop:!0,afterMove:null,beforeMove:null,options:{}},t.bindingHandlers.draggable={init:function(n,i,o,a,c){var u=r(i())||{},h=u.options||{},d=t.utils.extend({},t.bindingHandlers.draggable.options),f=p(i,"data"),m=u.connectClass||t.bindingHandlers.draggable.connectClass,g=void 0!==u.isEnabled?u.isEnabled:t.bindingHandlers.draggable.isEnabled;return u="data"in u?u.data:u,l(n,s,u),t.utils.extend(d,h),d.connectToSortable=!!m&&"."+m,e(n).draggable(d),void 0!==g&&t.computed({read:function(){e(n).draggable(r(g)?"enable":"disable")},disposeWhenNodeIsRemoved:n}),t.bindingHandlers.template.init(n,function(){return f},o,a,c)},update:function(e,n,i,o,a){var s=p(n,"data");return t.bindingHandlers.template.update(e,function(){return s},i,o,a)},connectClass:t.bindingHandlers.sortable.connectClass,options:{helper:"clone"}}}),function(){var t=this,e=t._,n=Array.prototype,i=Object.prototype,o=Function.prototype,a=n.push,s=n.slice,r=n.concat,c=i.toString,l=i.hasOwnProperty,u=Array.isArray,h=Object.keys,d=o.bind,p=function(t){return t instanceof p?t:this instanceof p?void(this._wrapped=t):new p(t)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=p),exports._=p):t._=p,p.VERSION="1.7.0";var f=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,o){return t.call(e,n,i,o)};case 4:return function(n,i,o,a){return t.call(e,n,i,o,a)}}return function(){return t.apply(e,arguments)}};p.iteratee=function(t,e,n){return null==t?p.identity:p.isFunction(t)?f(t,e,n):p.isObject(t)?p.matches(t):p.property(t)},p.each=p.forEach=function(t,e,n){if(null==t)return t;e=f(e,n);var i,o=t.length;if(o===+o)for(i=0;i=0)},p.invoke=function(t,e){var n=s.call(arguments,2),i=p.isFunction(e);return p.map(t,function(t){return(i?e:t[e]).apply(t,n)})},p.pluck=function(t,e){return p.map(t,p.property(e))},p.where=function(t,e){return p.filter(t,p.matches(e))},p.findWhere=function(t,e){return p.find(t,p.matches(e))},p.max=function(t,e,n){var i,o,a=-(1/0),s=-(1/0);if(null==e&&null!=t){t=t.length===+t.length?t:p.values(t);for(var r=0,c=t.length;ra&&(a=i)}else e=p.iteratee(e,n),p.each(t,function(t,n,i){o=e(t,n,i),(o>s||o===-(1/0)&&a===-(1/0))&&(a=t,s=o)});return a},p.min=function(t,e,n){var i,o,a=1/0,s=1/0;if(null==e&&null!=t){t=t.length===+t.length?t:p.values(t);for(var r=0,c=t.length;ri||void 0===n)return 1;if(n>>1;n(t[r])=0;)if(t[i]===e)return i;return-1},p.range=function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=n||1;for(var i=Math.max(Math.ceil((e-t)/n),0),o=Array(i),a=0;ae?(clearTimeout(s),s=null,r=l,a=t.apply(i,o),s||(i=o=null)):s||n.trailing===!1||(s=setTimeout(c,u)),a}},p.debounce=function(t,e,n){var i,o,a,s,r,c=function(){var l=p.now()-s;l0?i=setTimeout(c,e-l):(i=null,n||(r=t.apply(a,o),i||(a=o=null)))};return function(){a=this,o=arguments,s=p.now();var l=n&&!i;return i||(i=setTimeout(c,e)),l&&(r=t.apply(a,o),a=o=null),r}},p.wrap=function(t,e){return p.partial(e,t)},p.negate=function(t){return function(){return!t.apply(this,arguments)}},p.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,i=t[e].apply(this,arguments);n--;)i=t[n].call(this,i);return i}},p.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},p.before=function(t,e){ -var n;return function(){return--t>0?n=e.apply(this,arguments):e=null,n}},p.once=p.partial(p.before,2),p.keys=function(t){if(!p.isObject(t))return[];if(h)return h(t);var e=[];for(var n in t)p.has(t,n)&&e.push(n);return e},p.values=function(t){for(var e=p.keys(t),n=e.length,i=Array(n),o=0;o":">",'"':""","'":"'","`":"`"},A=p.invert(y),_=function(t){var e=function(e){return t[e]},n="(?:"+p.keys(t).join("|")+")",i=RegExp(n),o=RegExp(n,"g");return function(t){return t=null==t?"":""+t,i.test(t)?t.replace(o,e):t}};p.escape=_(y),p.unescape=_(A),p.result=function(t,e){if(null!=t){var n=t[e];return p.isFunction(n)?t[e]():n}};var z=0;p.uniqueId=function(t){var e=++z+"";return t?t+e:e},p.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,w={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},C=/\\|'|\r|\n|\u2028|\u2029/g,O=function(t){return"\\"+w[t]};p.template=function(t,e,n){!e&&n&&(e=n),e=p.defaults({},e,p.templateSettings);var i=RegExp([(e.escape||T).source,(e.interpolate||T).source,(e.evaluate||T).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(i,function(e,n,i,s,r){return a+=t.slice(o,r).replace(C,O),o=r+e.length,n?a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?a+="'+\n((__t=("+i+"))==null?'':__t)+\n'":s&&(a+="';\n"+s+"\n__p+='"),e}),a+="';\n",e.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{var s=new Function(e.variable||"obj","_",a)}catch(r){throw r.source=a,r}var c=function(t){return s.call(this,t,p)},l=e.variable||"obj";return c.source="function("+l+"){\n"+a+"}",c},p.chain=function(t){var e=p(t);return e._chain=!0,e};var N=function(t){return this._chain?p(t).chain():t};p.mixin=function(t){p.each(p.functions(t),function(e){var n=p[e]=t[e];p.prototype[e]=function(){var t=[this._wrapped];return a.apply(t,arguments),N.call(this,n.apply(p,t))}})},p.mixin(p),p.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=n[t];p.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],N.call(this,n)}}),p.each(["concat","join","slice"],function(t){var e=n[t];p.prototype[t]=function(){return N.call(this,e.apply(this._wrapped,arguments))}}),p.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return p})}.call(this),function(t,e){function n(){return new Date(Date.UTC.apply(Date,arguments))}function i(){var t=new Date;return n(t.getFullYear(),t.getMonth(),t.getDate())}function o(t,e){return t.getUTCFullYear()===e.getUTCFullYear()&&t.getUTCMonth()===e.getUTCMonth()&&t.getUTCDate()===e.getUTCDate()}function a(t){return function(){return this[t].apply(this,arguments)}}function s(e,n){function i(t,e){return e.toLowerCase()}var o,a=t(e).data(),s={},r=new RegExp("^"+n.toLowerCase()+"([A-Z])");n=new RegExp("^"+n.toLowerCase());for(var c in a)n.test(c)&&(o=c.replace(r,i),s[o]=a[c]);return s}function r(e){var n={};if(m[e]||(e=e.split("-")[0],m[e])){var i=m[e];return t.each(f,function(t,e){e in i&&(n[e]=i[e])}),n}}var c=function(){var e={get:function(t){return this.slice(t)[0]},contains:function(t){for(var e=t&&t.valueOf(),n=0,i=this.length;no?(this.picker.addClass("datepicker-orient-right"),p=u.left+d-e):this.picker.addClass("datepicker-orient-left");var m,g,b=this.o.orientation.y;if("auto"===b&&(m=-s+f-n,g=s+a-(f+h+n),b=Math.max(m,g)===g?"top":"bottom"),this.picker.addClass("datepicker-orient-"+b),"top"===b?f+=h:f-=n+parseInt(this.picker.css("padding-top")),this.o.rtl){var v=o-(p+d);this.picker.css({top:f,right:v,zIndex:l})}else this.picker.css({top:f,left:p,zIndex:l});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var e=this.dates.copy(),n=[],i=!1;return arguments.length?(t.each(arguments,t.proxy(function(t,e){e instanceof Date&&(e=this._local_to_utc(e)),n.push(e)},this)),i=!0):(n=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),n=n&&this.o.multidate?n.split(this.o.multidateSeparator):[n],delete this.element.data().date),n=t.map(n,t.proxy(function(t){return g.parseDate(t,this.o.format,this.o.language)},this)),n=t.grep(n,t.proxy(function(t){return tthis.o.endDate||!t},this),!0),this.dates.replace(n),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDatethis.o.endDate&&(this.viewDate=new Date(this.o.endDate)),i?this.setValue():n.length&&String(e)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&e.length&&this._trigger("clearDate"),this.fill(),this},fillDow:function(){var t=this.o.weekStart,e="";if(this.o.calendarWeeks){this.picker.find(".datepicker-days thead tr:first-child .datepicker-switch").attr("colspan",function(t,e){return parseInt(e)+1});var n=' ';e+=n}for(;t'+m[this.o.language].daysMin[t++%7]+"";e+="",this.picker.find(".datepicker-days thead").append(e)},fillMonths:function(){for(var t="",e=0;e<12;)t+=''+m[this.o.language].monthsShort[e++]+"";this.picker.find(".datepicker-months td").html(t)},setRange:function(e){e&&e.length?this.range=t.map(e,function(t){return t.valueOf()}):delete this.range,this.fill()},getClassNames:function(e){var n=[],i=this.viewDate.getUTCFullYear(),a=this.viewDate.getUTCMonth(),s=new Date;return e.getUTCFullYear()i||e.getUTCFullYear()===i&&e.getUTCMonth()>a)&&n.push("new"),this.focusDate&&e.valueOf()===this.focusDate.valueOf()&&n.push("focused"),this.o.todayHighlight&&e.getUTCFullYear()===s.getFullYear()&&e.getUTCMonth()===s.getMonth()&&e.getUTCDate()===s.getDate()&&n.push("today"),this.dates.contains(e)!==-1&&n.push("active"),(e.valueOf()this.o.endDate||t.inArray(e.getUTCDay(),this.o.daysOfWeekDisabled)!==-1)&&n.push("disabled"),this.o.datesDisabled.length>0&&t.grep(this.o.datesDisabled,function(t){return o(e,t)}).length>0&&n.push("disabled","disabled-date"),this.range&&(e>this.range[0]&&e"),this.o.calendarWeeks)){var y=new Date(+p+(this.o.weekStart-p.getUTCDay()-7)%7*864e5),A=new Date(Number(y)+(11-y.getUTCDay())%7*864e5),_=new Date(Number(_=n(A.getUTCFullYear(),0,1))+(11-_.getUTCDay())%7*864e5),z=(A-_)/864e5/7+1;M.push(''+z+"")}if(v=this.getClassNames(p),v.push("day"),this.o.beforeShowDay!==t.noop){var T=this.o.beforeShowDay(this._utc_to_local(p));T===e?T={}:"boolean"==typeof T?T={enabled:T}:"string"==typeof T&&(T={classes:T}),T.enabled===!1&&v.push("disabled"),T.classes&&(v=v.concat(T.classes.split(/\s+/))),T.tooltip&&(i=T.tooltip)}v=t.unique(v),M.push('"+p.getUTCDate()+""),i=null,p.getUTCDay()===this.o.weekEnd&&M.push(""),p.setUTCDate(p.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(M.join(""));var w=this.picker.find(".datepicker-months").find("th:eq(1)").text(a).end().find("span").removeClass("active");if(t.each(this.dates,function(t,e){e.getUTCFullYear()===a&&w.eq(e.getUTCMonth()).addClass("active")}),(al)&&w.addClass("disabled"),a===r&&w.slice(0,c).addClass("disabled"),a===l&&w.slice(u+1).addClass("disabled"),this.o.beforeShowMonth!==t.noop){var C=this;t.each(w,function(e,n){if(!t(n).hasClass("disabled")){var i=new Date(a,e,1),o=C.o.beforeShowMonth(i);o===!1&&t(n).addClass("disabled")}})}M="",a=10*parseInt(a/10,10);var O=this.picker.find(".datepicker-years").find("th:eq(1)").text(a+"-"+(a+9)).end().find("td");a-=1;for(var N,S=t.map(this.dates,function(t){return t.getUTCFullYear()}),x=-1;x<11;x++)N=["year"],x===-1?N.push("old"):10===x&&N.push("new"),t.inArray(a,S)!==-1&&N.push("active"),(al)&&N.push("disabled"),M+=''+a+"",a+=1;O.html(M)}},updateNavArrows:function(){if(this._allow_update){var t=new Date(this.viewDate),e=t.getUTCFullYear(),n=t.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-(1/0)&&e<=this.o.startDate.getUTCFullYear()&&n<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==1/0&&e>=this.o.endDate.getUTCFullYear()&&n>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-(1/0)&&e<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==1/0&&e>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(e){e.preventDefault();var i,o,a,s=t(e.target).closest("span, td, th");if(1===s.length)switch(s[0].nodeName.toLowerCase()){case"th":switch(s[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":var r=g.modes[this.viewMode].navStep*("prev"===s[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,r),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,r),1===this.viewMode&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"today":var c=new Date;c=n(c.getFullYear(),c.getMonth(),c.getDate(),0,0,0),this.showMode(-2);var l="linked"===this.o.todayBtn?null:"view";this._setDate(c,l);break;case"clear":this.clearDates()}break;case"span":s.hasClass("disabled")||(this.viewDate.setUTCDate(1),s.hasClass("month")?(a=1,o=s.parent().find("span").index(s),i=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(o),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode&&this._setDate(n(i,o,a))):(a=1,o=0,i=parseInt(s.text(),10)||0,this.viewDate.setUTCFullYear(i),this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(n(i,o,a))),this.showMode(-1),this.fill());break;case"td":s.hasClass("day")&&!s.hasClass("disabled")&&(a=parseInt(s.text(),10)||1,i=this.viewDate.getUTCFullYear(),o=this.viewDate.getUTCMonth(),s.hasClass("old")?0===o?(o=11,i-=1):o-=1:s.hasClass("new")&&(11===o?(o=0,i+=1):o+=1),this._setDate(n(i,o,a)))}this.picker.is(":visible")&&this._focused_from&&t(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(t){var e=this.dates.contains(t);if(t||this.dates.clear(),e!==-1?(this.o.multidate===!0||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(e):this.o.multidate===!1?(this.dates.clear(),this.dates.push(t)):this.dates.push(t),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(t,e){e&&"date"!==e||this._toggle_multidate(t&&new Date(t)),e&&"view"!==e||(this.viewDate=t&&new Date(t)),this.fill(),this.setValue(),e&&"view"===e||this._trigger("changeDate");var n;this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&n.change(),!this.o.autoclose||e&&"date"!==e||this.hide()},moveMonth:function(t,n){if(!t)return e;if(!n)return t;var i,o,a=new Date(t.valueOf()),s=a.getUTCDate(),r=a.getUTCMonth(),c=Math.abs(n);if(n=n>0?1:-1,1===c)o=n===-1?function(){return a.getUTCMonth()===r}:function(){return a.getUTCMonth()!==i},i=r+n,a.setUTCMonth(i),(i<0||i>11)&&(i=(i+12)%12);else{for(var l=0;l=this.o.startDate&&t<=this.o.endDate},keydown:function(t){if(!this.picker.is(":visible"))return void(27===t.keyCode&&this.show());var e,n,o,a=!1,s=this.focusDate||this.viewDate;switch(t.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),t.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;e=37===t.keyCode?-1:1,t.ctrlKey?(n=this.moveYear(this.dates.get(-1)||i(),e),o=this.moveYear(s,e),this._trigger("changeYear",this.viewDate)):t.shiftKey?(n=this.moveMonth(this.dates.get(-1)||i(),e),o=this.moveMonth(s,e),this._trigger("changeMonth",this.viewDate)):(n=new Date(this.dates.get(-1)||i()),n.setUTCDate(n.getUTCDate()+e),o=new Date(s),o.setUTCDate(s.getUTCDate()+e)),this.dateWithinRange(o)&&(this.focusDate=this.viewDate=o,this.setValue(),this.fill(),t.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;e=38===t.keyCode?-1:1,t.ctrlKey?(n=this.moveYear(this.dates.get(-1)||i(),e),o=this.moveYear(s,e),this._trigger("changeYear",this.viewDate)):t.shiftKey?(n=this.moveMonth(this.dates.get(-1)||i(),e),o=this.moveMonth(s,e),this._trigger("changeMonth",this.viewDate)):(n=new Date(this.dates.get(-1)||i()),n.setUTCDate(n.getUTCDate()+7*e),o=new Date(s),o.setUTCDate(s.getUTCDate()+7*e)),this.dateWithinRange(o)&&(this.focusDate=this.viewDate=o,this.setValue(),this.fill(),t.preventDefault());break;case 32:break;case 13:s=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(s),a=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(t.preventDefault(),"function"==typeof t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}if(a){this.dates.length?this._trigger("changeDate"):this._trigger("clearDate");var r;this.isInput?r=this.element:this.component&&(r=this.element.find("input")),r&&r.change()}},showMode:function(t){t&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+t))),this.picker.children("div").hide().filter(".datepicker-"+g.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var u=function(e,n){this.element=t(e),this.inputs=t.map(n.inputs,function(t){return t.jquery?t[0]:t}),delete n.inputs,d.call(t(this.inputs),n).bind("changeDate",t.proxy(this.dateUpdated,this)),this.pickers=t.map(this.inputs,function(e){return t(e).data("datepicker")}),this.updateDates()};u.prototype={updateDates:function(){this.dates=t.map(this.pickers,function(t){return t.getUTCDate()}),this.updateRanges()},updateRanges:function(){var e=t.map(this.dates,function(t){return t.valueOf()});t.each(this.pickers,function(t,n){n.setRange(e)})},dateUpdated:function(e){if(!this.updating){this.updating=!0;var n=t(e.target).data("datepicker"),i=n.getUTCDate(),o=t.inArray(e.target,this.inputs),a=o-1,s=o+1,r=this.inputs.length;if(o!==-1){if(t.each(this.pickers,function(t,e){e.getUTCDate()||e.setUTCDate(i)}),i=0&&ithis.dates[s])for(;sthis.dates[s];)this.pickers[s++].setUTCDate(i);this.updateDates(),delete this.updating}}},remove:function(){t.map(this.pickers,function(t){t.remove()}),delete this.element.data().datepicker}};var h=t.fn.datepicker,d=function(n){var i=Array.apply(null,arguments);i.shift();var o;return this.each(function(){var a=t(this),c=a.data("datepicker"),h="object"==typeof n&&n;if(!c){var d=s(this,"date"),f=t.extend({},p,d,h),m=r(f.language),g=t.extend({},p,m,d,h);if(a.hasClass("input-daterange")||g.inputs){var b={inputs:g.inputs||a.find("input").toArray()};a.data("datepicker",c=new u(this,t.extend(g,b)))}else a.data("datepicker",c=new l(this,g))}if("string"==typeof n&&"function"==typeof c[n]&&(o=c[n].apply(c,i),o!==e))return!1}),o!==e?o:this};t.fn.datepicker=d;var p=t.fn.datepicker.defaults={autoclose:!1,beforeShowDay:t.noop,beforeShowMonth:t.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-(1/0),startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,container:"body"},f=t.fn.datepicker.locale_opts=["format","rtl","weekStart"];t.fn.datepicker.Constructor=l;var m=t.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},g={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(t){return t%4===0&&t%100!==0||t%400===0},getDaysInMonth:function(t,e){return[31,g.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(t){var e=t.replace(this.validParts,"\0").split("\0"),n=t.match(this.validParts);if(!e||!e.length||!n||0===n.length)throw new Error("Invalid date format."); -return{separators:e,parts:n}},parseDate:function(i,o,a){function s(){var t=this.slice(0,d[u].length),e=d[u].slice(0,t.length);return t.toLowerCase()===e.toLowerCase()}if(!i)return e;if(i instanceof Date)return i;"string"==typeof o&&(o=g.parseFormat(o));var r,c,u,h=/([\-+]\d+)([dmwy])/,d=i.match(/([\-+]\d+)([dmwy])/g);if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(i)){for(i=new Date,u=0;u«»',contTemplate:'',footTemplate:''};g.template='
    '+g.headTemplate+""+g.footTemplate+'
    '+g.headTemplate+g.contTemplate+g.footTemplate+'
    '+g.headTemplate+g.contTemplate+g.footTemplate+"
    ",t.fn.datepicker.DPGlobal=g,t.fn.datepicker.noConflict=function(){return t.fn.datepicker=h,this},t.fn.datepicker.version="1.4.0",t(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(e){var n=t(this);n.data("datepicker")||(e.preventDefault(),d.call(n,"show"))}),t(function(){d.call(t('[data-provide="datepicker-inline"]'))})}(window.jQuery),!function(t){t.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],daysShort:["Son","Mon","Die","Mit","Don","Fre","Sam","Son"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa","So"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",clear:"Löschen",weekStart:1,format:"dd.mm.yyyy"}}(jQuery),!function(t){t.fn.datepicker.dates.da={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",clear:"Nulstil"}}(jQuery),!function(t){t.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}(jQuery),!function(t){t.fn.datepicker.dates.nl={days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag","zondag"],daysShort:["zo","ma","di","wo","do","vr","za","zo"],daysMin:["zo","ma","di","wo","do","vr","za","zo"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],monthsShort:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],today:"Vandaag",clear:"Wissen",weekStart:1,format:"dd-mm-yyyy"}}(jQuery),!function(t){t.fn.datepicker.dates.fr={days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi","dimanche"],daysShort:["dim.","lun.","mar.","mer.","jeu.","ven.","sam.","dim."],daysMin:["d","l","ma","me","j","v","s","d"],months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthsShort:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.","déc."],today:"Aujourd'hui",clear:"Effacer",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),!function(t){t.fn.datepicker.dates.it={days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab","Dom"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa","Do"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),!function(t){t.fn.datepicker.dates.lt={days:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis","Sekmadienis"],daysShort:["S","Pr","A","T","K","Pn","Š","S"],daysMin:["Sk","Pr","An","Tr","Ke","Pn","Št","Sk"],months:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthsShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],today:"Šiandien",weekStart:1}}(jQuery),!function(t){t.fn.datepicker.dates.no={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],today:"I dag",clear:"Nullstill",weekStart:1,format:"dd.mm.yyyy"}}(jQuery),!function(t){t.fn.datepicker.dates.es={days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"],daysShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb","Dom"],daysMin:["Do","Lu","Ma","Mi","Ju","Vi","Sa","Do"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],today:"Hoy",clear:"Borrar",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),!function(t){t.fn.datepicker.dates.sv={days:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],daysShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör","Sön"],daysMin:["Sö","Må","Ti","On","To","Fr","Lö","Sö"],months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Idag",format:"yyyy-mm-dd",weekStart:1,clear:"Rensa"}}(jQuery),function(){var t,e,n,i,o,a,s,r,c=[].slice,l={}.hasOwnProperty,u=function(t,e){function n(){this.constructor=t}for(var i in e)l.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};s=function(){},e=function(){function t(){}return t.prototype.addEventListener=t.prototype.on,t.prototype.on=function(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]||(this._callbacks[t]=[]),this._callbacks[t].push(e),this},t.prototype.emit=function(){var t,e,n,i,o,a;if(i=arguments[0],t=2<=arguments.length?c.call(arguments,1):[],this._callbacks=this._callbacks||{},n=this._callbacks[i])for(o=0,a=n.length;o
    '),this.element.appendChild(e)),i=e.getElementsByTagName("span")[0],i&&(null!=i.textContent?i.textContent=this.options.dictFallbackMessage:null!=i.innerText&&(i.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(t){var e,n,i;return e={srcX:0,srcY:0,srcWidth:t.width,srcHeight:t.height},n=t.width/t.height,e.optWidth=this.options.thumbnailWidth,e.optHeight=this.options.thumbnailHeight,null==e.optWidth&&null==e.optHeight?(e.optWidth=e.srcWidth,e.optHeight=e.srcHeight):null==e.optWidth?e.optWidth=n*e.optHeight:null==e.optHeight&&(e.optHeight=1/n*e.optWidth),i=e.optWidth/e.optHeight,t.heighti?(e.srcHeight=t.height,e.srcWidth=e.srcHeight*i):(e.srcWidth=t.width,e.srcHeight=e.srcWidth/i),e.srcX=(t.width-e.srcWidth)/2,e.srcY=(t.height-e.srcHeight)/2,e},drop:function(t){return this.element.classList.remove("dz-drag-hover")},dragstart:s,dragend:function(t){return this.element.classList.remove("dz-drag-hover")},dragenter:function(t){return this.element.classList.add("dz-drag-hover")},dragover:function(t){return this.element.classList.add("dz-drag-hover")},dragleave:function(t){return this.element.classList.remove("dz-drag-hover")},paste:s,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(t){var e,i,o,a,s,r,c,l,u,h,d,p,f;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(t.previewElement=n.createElement(this.options.previewTemplate.trim()),t.previewTemplate=t.previewElement,this.previewsContainer.appendChild(t.previewElement),h=t.previewElement.querySelectorAll("[data-dz-name]"),a=0,c=h.length;a'+this.options.dictRemoveFile+""),t.previewElement.appendChild(t._removeLink)),i=function(e){return function(i){return i.preventDefault(),i.stopPropagation(),t.status===n.UPLOADING?n.confirm(e.options.dictCancelUploadConfirmation,function(){return e.removeFile(t)}):e.options.dictRemoveFileConfirmation?n.confirm(e.options.dictRemoveFileConfirmation,function(){return e.removeFile(t)}):e.removeFile(t)}}(this),p=t.previewElement.querySelectorAll("[data-dz-remove]"),f=[],r=0,u=p.length;r\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n \n Check\n \n \n \n \n \n
    \n
    \n \n Error\n \n \n \n \n \n \n \n
    \n
    '},i=function(){var t,e,n,i,o,a,s;for(i=arguments[0],n=2<=arguments.length?c.call(arguments,1):[],a=0,s=n.length;a'+this.options.dictDefaultMessage+"")),this.clickableElements.length&&(i=function(t){return function(){return t.hiddenFileInput&&t.hiddenFileInput.parentNode.removeChild(t.hiddenFileInput),t.hiddenFileInput=document.createElement("input"),t.hiddenFileInput.setAttribute("type","file"),(null==t.options.maxFiles||t.options.maxFiles>1)&&t.hiddenFileInput.setAttribute("multiple","multiple"),t.hiddenFileInput.className="dz-hidden-input",null!=t.options.acceptedFiles&&t.hiddenFileInput.setAttribute("accept",t.options.acceptedFiles),null!=t.options.capture&&t.hiddenFileInput.setAttribute("capture",t.options.capture),t.hiddenFileInput.style.visibility="hidden",t.hiddenFileInput.style.position="absolute",t.hiddenFileInput.style.top="0",t.hiddenFileInput.style.left="0",t.hiddenFileInput.style.height="0",t.hiddenFileInput.style.width="0",document.querySelector(t.options.hiddenInputContainer).appendChild(t.hiddenFileInput),t.hiddenFileInput.addEventListener("change",function(){var e,n,o,a;if(n=t.hiddenFileInput.files,n.length)for(o=0,a=n.length;o',this.options.dictFallbackText&&(i+="

    "+this.options.dictFallbackText+"

    "),i+='',e=n.createElement(i),"FORM"!==this.element.tagName?(o=n.createElement('
    '),o.appendChild(e)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=o?o:e)},n.prototype.getExistingFallback=function(){var t,e,n,i,o,a;for(e=function(t){var e,n,i;for(n=0,i=t.length;n0){for(s=["TB","GB","MB","KB","b"],n=r=0,c=s.length;r=e){i=t/Math.pow(this.options.filesizeBase,4-n),o=a;break}i=Math.round(10*i)/10}return""+i+" "+o},n.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},n.prototype.drop=function(t){var e,n;t.dataTransfer&&(this.emit("drop",t),e=t.dataTransfer.files,this.emit("addedfiles",e),e.length&&(n=t.dataTransfer.items,n&&n.length&&null!=n[0].webkitGetAsEntry?this._addFilesFromItems(n):this.handleFiles(e)))},n.prototype.paste=function(t){var e,n;if(null!=(null!=t&&null!=(n=t.clipboardData)?n.items:void 0))return this.emit("paste",t),e=t.clipboardData.items,e.length?this._addFilesFromItems(e):void 0},n.prototype.handleFiles=function(t){var e,n,i,o;for(o=[],n=0,i=t.length;n0){for(a=0,s=n.length;a1024*this.options.maxFilesize*1024?e(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(t.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):n.isValidFile(t,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(e(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",t)):this.options.accept.call(this,t,e):e(this.options.dictInvalidFileType)},n.prototype.addFile=function(t){return t.upload={progress:0,total:t.size,bytesSent:0},this.files.push(t),t.status=n.ADDED,this.emit("addedfile",t),this._enqueueThumbnail(t),this.accept(t,function(e){return function(n){return n?(t.accepted=!1,e._errorProcessing([t],n)):(t.accepted=!0,e.options.autoQueue&&e.enqueueFile(t)),e._updateMaxFilesReachedClass()}}(this))},n.prototype.enqueueFiles=function(t){var e,n,i;for(n=0,i=t.length;n=e)&&(i=this.getQueuedFiles(),i.length>0)){if(this.options.uploadMultiple)return this.processFiles(i.slice(0,e-n));for(;t=B;u=0<=B?++L:--L)a.append(this._getParamName(u),t[u],this._renameFilename(t[u].name));return this.submitRequest(_,a,t)},n.prototype.submitRequest=function(t,e,n){return t.send(e)},n.prototype._finished=function(t,e,i){var o,a,s;for(a=0,s=t.length;au;)e=o[4*(c-1)+3],0===e?a=c:u=c,c=a+u>>1;return l=c/s,0===l?1:l},a=function(t,e,n,i,a,s,r,c,l,u){var h;return h=o(e),t.drawImage(e,n,i,a,s,r,c,l,u/h)},i=function(t,e){var n,i,o,a,s,r,c,l,u;if(o=!1,u=!0,i=t.document,l=i.documentElement,n=i.addEventListener?"addEventListener":"attachEvent",c=i.addEventListener?"removeEventListener":"detachEvent",r=i.addEventListener?"":"on",a=function(n){if("readystatechange"!==n.type||"complete"===i.readyState)return("load"===n.type?t:i)[c](r+n.type,a,!1),!o&&(o=!0)?e.call(t,n.type||n):void 0},s=function(){var t;try{l.doScroll("left")}catch(e){return t=e,void setTimeout(s,50)}return a("poll")},"complete"!==i.readyState){if(i.createEventObject&&l.doScroll){try{u=!t.frameElement}catch(h){}u&&s()}return i[n](r+"DOMContentLoaded",a,!1),i[n](r+"readystatechange",a,!1),t[n](r+"load",a,!1)}},t._autoDiscoverFunction=function(){if(t.autoDiscover)return t.discover()},i(window,t._autoDiscoverFunction)}.call(this),function(t,e){"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],function(t){return e(t)}):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(this,function(t){var e=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:t.isArray,isFunction:t.isFunction,isObject:t.isPlainObject,isUndefined:function(t){return"undefined"==typeof t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(e){return e instanceof t},toStr:function(t){return e.isUndefined(t)||null===t?"":t+""},bind:t.proxy,each:function(e,n){function i(t,e){return n(e,t)}t.each(e,i)},map:t.map,filter:t.grep,every:function(e,n){var i=!0;return e?(t.each(e,function(t,o){if(!(i=n.call(null,o,t,e)))return!1}),!!i):i},some:function(e,n){var i=!1;return e?(t.each(e,function(t,o){if(i=n.call(null,o,t,e))return!1}),!!i):i},mixin:t.extend,identity:function(t){return t},clone:function(e){return t.extend(!0,{},e)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(e){function n(){return String(e)}return t.isFunction(e)?e:n},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var i,o;return function(){var a,s,r=this,c=arguments;return a=function(){i=null,n||(o=t.apply(r,c))},s=n&&!i,clearTimeout(i),i=setTimeout(a,e),s&&(o=t.apply(r,c)),o}},throttle:function(t,e){var n,i,o,a,s,r;return s=0,r=function(){s=new Date,o=null,a=t.apply(n,i)},function(){var c=new Date,l=e-(c-s);return n=this,i=arguments,l<=0?(clearTimeout(o),o=null,s=c,a=t.apply(n,i)):o||(o=setTimeout(r,l)),a}},stringify:function(t){return e.isString(t)?t:JSON.stringify(t)},noop:function(){}}}(),n=function(){"use strict";function t(t){var s,r;return r=e.mixin({},a,t),s={css:o(),classes:r,html:n(r),selectors:i(r)},{css:s.css,html:s.html,classes:s.classes,selectors:s.selectors,mixin:function(t){e.mixin(t,s)}}}function n(t){return{wrapper:'',menu:'
    '}}function i(t){var n={};return e.each(t,function(t,e){n[e]="."+t}),n}function o(){var t={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return e.isMsie()&&e.mixin(t.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),t}var a={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return t}(),i=function(){"use strict";function n(e){e&&e.el||t.error("EventBus initialized without el"),this.$el=t(e.el)}var i,o;return i="typeahead:",o={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},e.mixin(n.prototype,{_trigger:function(e,n){var o;return o=t.Event(i+e),(n=n||[]).unshift(o),this.$el.trigger.apply(this.$el,n),o},before:function(t){var e,n;return e=[].slice.call(arguments,1),n=this._trigger("before"+t,e),n.isDefaultPrevented()},trigger:function(t){var e;this._trigger(t,[].slice.call(arguments,1)),(e=o[t])&&this._trigger(e,[].slice.call(arguments,1))}}),n}(),o=function(){"use strict";function t(t,e,n,i){var o;if(!n)return this;for(e=e.split(c),n=i?r(n,i):n,this._callbacks=this._callbacks||{};o=e.shift();)this._callbacks[o]=this._callbacks[o]||{sync:[],async:[]},this._callbacks[o][t].push(n);return this}function e(e,n,i){return t.call(this,"async",e,n,i)}function n(e,n,i){return t.call(this,"sync",e,n,i)}function i(t){var e;if(!this._callbacks)return this;for(t=t.split(c);e=t.shift();)delete this._callbacks[e];return this}function o(t){var e,n,i,o,s;if(!this._callbacks)return this;for(t=t.split(c),i=[].slice.call(arguments,1);(e=t.shift())&&(n=this._callbacks[e]);)o=a(n.sync,this,[e].concat(i)),s=a(n.async,this,[e].concat(i)),o()&&l(s);return this}function a(t,e,n){function i(){for(var i,o=0,a=t.length;!i&&o