New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hoodcms

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hoodcms - npm Package Compare versions

Comparing version 3.2.0 to 3.2.1

102

js/admin/content.js
if (!$.hood)
$.hood = {};
$.hood.Content = {
Init: function () {
Init: function() {
$('body').on('click', '.content-delete', $.hood.Content.Delete);

@@ -18,3 +18,3 @@ $('body').on('click', '.content-meta-delete', $.hood.Content.Meta.Delete);

$('body').on('keyup', '#Slug', function () {
$('body').on('keyup', '#Slug', function() {
$('.slug-display').html($(this).val());

@@ -33,6 +33,6 @@ });

Content: {
Loaded: function (data) {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#content-list').doesExist())

@@ -43,6 +43,6 @@ $.hood.Inline.Reload($('#content-list'), complete);

Categories: {
Loaded: function (data) {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#content-categories-list').doesExist())

@@ -53,6 +53,6 @@ $.hood.Inline.Reload($('#content-categories-list'), complete);

Fields: {
Loaded: function (data) {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#content-meta-list').doesExist())

@@ -63,6 +63,6 @@ $.hood.Inline.Reload($('#content-meta-list'), complete);

Media: {
Loaded: function (data) {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#content-media-list').doesExist())

@@ -74,9 +74,9 @@ $.hood.Inline.Reload($('#content-media-list'), complete);

Delete: function (e) {
Delete: function(e) {
e.preventDefault();
let $tag = $(this);
let deleteContentCallback = function (isConfirm) {
let deleteContentCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -87,3 +87,3 @@ $.hood.Content.Lists.Content.Reload();

$.hood.Alerts.Success(`<strong>Content deleted, redirecting...</strong><br />Just taking you back to the content list.`);
setTimeout(function () {
setTimeout(function() {
window.location = $tag.data('redirect');

@@ -106,9 +106,9 @@ }, 1500);

SetStatus: function (e) {
SetStatus: function(e) {
e.preventDefault();
let $tag = $(this);
let publishContentCallback = function (isConfirm) {
let publishContentCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), $tag.data('status'), function (data) {
$.post($tag.attr('href'), $tag.data('status'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -128,9 +128,9 @@ $.hood.Content.Lists.Content.Reload();

Clone: function (e) {
Clone: function(e) {
e.preventDefault();
let $tag = $(this);
let duplicateContentCallback = function (isConfirm) {
let duplicateContentCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), $tag.data('status'), function (data) {
$.post($tag.attr('href'), $tag.data('status'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -150,3 +150,3 @@ $.hood.Content.Lists.Content.Reload();

Create: function () {
Create: function() {
$('#content-create-form').find('.datepicker').datetimepicker({

@@ -171,3 +171,3 @@ locale: 'en-gb',

submitUrl: $('#content-create-form').attr('action'),
submitFunction: function (data) {
submitFunction: function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -180,3 +180,3 @@ $.hood.Content.Lists.Content.Reload();

Edit: {
Init: function () {
Init: function() {
$('.datepicker').datetimepicker({

@@ -196,3 +196,3 @@ locale: 'en-gb',

},
InitImageUploader: function () {
InitImageUploader: function() {
if (!$('#content-gallery-add').doesExist())

@@ -219,3 +219,3 @@ return;

myDropzone.on("success", function (file, data) {
myDropzone.on("success", function(file, data) {
$.hood.Helpers.ProcessResponse(data);

@@ -225,3 +225,3 @@ $.hood.Content.Lists.Media.Reload();

myDropzone.on("addedfile", function (file) {
myDropzone.on("addedfile", function(file) {
$('#content-gallery-total-progress .progress-bar').css({ width: 0 + "%" });

@@ -232,3 +232,3 @@ $('#content-gallery-total-progress .progress-bar .percentage').html(0 + "%");

// Update the total progress bar
myDropzone.on("totaluploadprogress", function (progress) {
myDropzone.on("totaluploadprogress", function(progress) {
$('#content-gallery-total-progress .progress-bar').css({ width: progress + "%" });

@@ -238,3 +238,3 @@ $('#content-gallery-total-progress .progress-bar .percentage').html(progress + "%");

myDropzone.on("sending", function (file) {
myDropzone.on("sending", function(file) {
// Show the total progress bar when upload starts

@@ -247,3 +247,3 @@ $('#content-gallery-total-progress').fadeIn();

// Hide the total progress bar when nothing's uploading anymore
myDropzone.on("complete", function (file) {
myDropzone.on("complete", function(file) {
$.hood.Content.Lists.Media.Reload();

@@ -253,3 +253,3 @@ });

// Hide the total progress bar when nothing's uploading anymore
myDropzone.on("queuecomplete", function (progress) {
myDropzone.on("queuecomplete", function(progress) {
$('#content-gallery-total-progress').hide();

@@ -262,3 +262,3 @@ $.hood.Content.Lists.Media.Reload();

Categories: {
Editor: function () {
Editor: function() {
$('#content-categories-edit-form').hoodValidator({

@@ -275,3 +275,3 @@ validationRules: {

submitUrl: $('#content-categories-edit-form').attr('action'),
submitFunction: function (data) {
submitFunction: function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -282,4 +282,4 @@ $.hood.Content.Lists.Categories.Reload();

},
ToggleCategory: function () {
$.post($(this).data('url'), { categoryId: $(this).val(), add: $(this).is(':checked') }, function (data) {
ToggleCategory: function() {
$.post($(this).data('url'), { categoryId: $(this).val(), add: $(this).is(':checked') }, function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -289,9 +289,9 @@ $.hood.Content.Lists.Categories.Reload();

},
Delete: function (e) {
Delete: function(e) {
e.preventDefault();
let $tag = $(this);
let deleteCategoryCallback = function (isConfirm) {
let deleteCategoryCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -315,3 +315,3 @@ $.hood.Content.Lists.Categories.Reload();

Meta: {
Create: function () {
Create: function() {
$('#add-field-form').hoodValidator({

@@ -328,3 +328,3 @@ validationRules: {

submitUrl: '/admin/content/addmeta',
submitFunction: function (data) {
submitFunction: function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -335,9 +335,9 @@ $.hood.Content.Lists.Fields.Reload();

},
Delete: function (e) {
Delete: function(e) {
e.preventDefault();
let $tag = $(this);
let deleteCategoryCallback = function (isConfirm) {
let deleteCategoryCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -362,9 +362,9 @@ $.hood.Content.Lists.Fields.Reload();

Media: {
Delete: function (e) {
Delete: function(e) {
e.preventDefault();
let $tag = $(this);
let deleteMediaCallback = function (isConfirm) {
let deleteMediaCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -389,7 +389,7 @@ $.hood.Content.Lists.Media.Reload();

Types: {
AddField: function () {
AddField: function() {
let name = $('#custom-field-name-' + $(this).data('id')).val();
let fields = $.hood.Content.Types.GetFieldsList($(this).data('id'));
let exists = false;
$.each(fields, function (key, value) {
$.each(fields, function(key, value) {
if (value.Name === name)

@@ -422,6 +422,6 @@ exists = true;

},
DeleteField: function () {
DeleteField: function() {
let fields = $.hood.Content.Types.GetFieldsList($(this).data('id'));
let name = $(this).data('name');
fields = $.grep(fields, function (e) {
fields = $.grep(fields, function(e) {
return e.Name !== name;

@@ -433,3 +433,3 @@ });

},
GetFieldsList: function (id) {
GetFieldsList: function(id) {
// Take the contents of the fields input.

@@ -450,3 +450,3 @@ let fieldsInput = $('#custom-fields-' + id).val();

},
ReRenderFields: function (arr, id) {
ReRenderFields: function(arr, id) {
let newList = $('#field-list-' + id).empty();

@@ -453,0 +453,0 @@ for (i = 0; i < arr.length; i++) {

@@ -1,1 +0,1 @@

"use strict";$.hood||($.hood={}),$.hood.Content={Init:function(){$("body").on("click",".content-delete",$.hood.Content.Delete),$("body").on("click",".content-meta-delete",$.hood.Content.Meta.Delete),$("body").on("click",".content-clone",$.hood.Content.Clone),$("body").on("click",".content-set-status",$.hood.Content.SetStatus),$("body").on("click",".content-media-delete",$.hood.Content.Media.Delete),$("body").on("click",".content-categories-delete",$.hood.Content.Categories.Delete),$("body").on("change",".content-categories-check",$.hood.Content.Categories.ToggleCategory),$("body").on("click",".add-custom-field",$.hood.Content.Types.AddField),$("body").on("click",".delete-custom-field",$.hood.Content.Types.DeleteField),$("body").on("keyup","#Slug",function(){$(".slug-display").html($(this).val())}),$("#content-edit-form").doesExist()&&$.hood.Content.Edit.Init(),$("#content-meta-form").doesExist()&&$.hood.Content.Meta.Init()},Lists:{Content:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#content-list").doesExist()&&$.hood.Inline.Reload($("#content-list"),e)}},Categories:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#content-categories-list").doesExist()&&$.hood.Inline.Reload($("#content-categories-list"),e)}},Fields:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#content-meta-list").doesExist()&&$.hood.Inline.Reload($("#content-meta-list"),e)}},Media:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#content-media-list").doesExist()&&$.hood.Inline.Reload($("#content-media-list"),e)}}},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Content.Reload(),e.Success&&t&&t.data("redirect")&&($.hood.Alerts.Success("<strong>Content deleted, redirecting...</strong><br />Just taking you back to the content list."),setTimeout(function(){window.location=t.data("redirect")},1500))})};$.hood.Alerts.Confirm("The content will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},SetStatus:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),t.data("status"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Content.Reload()})};$.hood.Alerts.Confirm("The item will be immediately visible on the website.","Are you sure?",o,"warning")},Clone:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),t.data("status"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Content.Reload()})};$.hood.Alerts.Confirm("This will duplicate the content and everything inside it.","Are you sure?",o,"warning")},Create:function(){$("#content-create-form").find(".datepicker").datetimepicker({locale:"en-gb",format:"L"}),$("#content-create-form").hoodValidator({validationRules:{Title:{required:!0},Except:{required:!0},PublishDate:{required:!0,ukdate:!0}},submitButtonTag:$("#content-create-submit"),submitUrl:$("#content-create-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Content.Reload()}})},Edit:{Init:function(){$(".datepicker").datetimepicker({locale:"en-gb",format:"L"}),$(".timepicker").datetimepicker({locale:"en-gb",format:"LT"}),$(".datetimepicker").datetimepicker({locale:"en-gb",sideBySide:!0}),$.hood.Content.Edit.InitImageUploader()},InitImageUploader:function(){if($("#content-gallery-add").doesExist()){$("#content-gallery-total-progress").hide(),Dropzone.autoDiscover=!1;var e=new Dropzone("#content-gallery-upload",{url:$("#content-gallery-upload").data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:!1,paramName:"files",autoProcessQueue:!0,previewsContainer:!1,clickable:"#content-gallery-add",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!"});e.on("success",function(e,t){$.hood.Helpers.ProcessResponse(t),$.hood.Content.Lists.Media.Reload()}),e.on("addedfile",function(e){$("#content-gallery-total-progress .progress-bar").css({width:"0%"}),$("#content-gallery-total-progress .progress-bar .percentage").html("0%")}),e.on("totaluploadprogress",function(e){$("#content-gallery-total-progress .progress-bar").css({width:e+"%"}),$("#content-gallery-total-progress .progress-bar .percentage").html(e+"%")}),e.on("sending",function(e){$("#content-gallery-total-progress").fadeIn(),$("#content-gallery-total-progress .progress-bar").css({width:"0%"}),$("#content-gallery-total-progress .progress-bar .percentage").html("0%")}),e.on("complete",function(e){$.hood.Content.Lists.Media.Reload()}),e.on("queuecomplete",function(e){$("#content-gallery-total-progress").hide(),$.hood.Content.Lists.Media.Reload()})}}},Categories:{Editor:function(){$("#content-categories-edit-form").hoodValidator({validationRules:{DisplayName:{required:!0},Slug:{required:!0}},submitButtonTag:$("#content-categories-edit-submit"),submitUrl:$("#content-categories-edit-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Categories.Reload()}})},ToggleCategory:function(){$.post($(this).data("url"),{categoryId:$(this).val(),add:$(this).is(":checked")},function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Categories.Reload()})},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Categories.Reload()})};$.hood.Alerts.Confirm("The category will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')}},Meta:{Create:function(){$("#add-field-form").hoodValidator({validationRules:{cfName:{required:!0},cfType:{required:!0}},submitButtonTag:$("#add-field-submit"),submitUrl:"/admin/content/addmeta",submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Fields.Reload()}})},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Fields.Reload()})};$.hood.Alerts.Confirm("The field will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')}},Media:{Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Media.Reload()})};$.hood.Alerts.Confirm("The image/media will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong><br /><span class="text-warning">If this is set as a featured image, this may cause issues, make sure to set another image as featured before deleting this one.</span></span>')}},Types:{AddField:function(){var e=$("#custom-field-name-"+$(this).data("id")).val(),t=$.hood.Content.Types.GetFieldsList($(this).data("id")),o=!1;if($.each(t,function(t,n){n.Name===e&&(o=!0)}),!e)return void $.hood.Alerts.Error("You have to name the field.");if(!t)return void $.hood.Alerts.Error("The field list is empty.");if(o)return void $.hood.Alerts.Error("Cannot insert two fields with the same key.");var n={Name:$("#custom-field-name-"+$(this).data("id")).data("prefix")+$("#custom-field-name-"+$(this).data("id")).val(),Default:$("#custom-field-default-"+$(this).data("id")).val(),Type:$("#custom-field-type-"+$(this).data("id")).val(),System:!1};t.push(n),$.hood.Content.Types.ReRenderFields(t,$(this).data("id")),$("#custom-fields-"+$(this).data("id")).val(JSON.stringify(t)),$.hood.Alerts.Success("Added field.")},DeleteField:function(){var e=$.hood.Content.Types.GetFieldsList($(this).data("id")),t=$(this).data("name");e=$.grep(e,function(e){return e.Name!==t}),$.hood.Content.Types.ReRenderFields(e,$(this).data("id")),$("#custom-fields-"+$(this).data("id")).val(JSON.stringify(e)),$.hood.Alerts.Success("Deleted field.")},GetFieldsList:function(e){var t=$("#custom-fields-"+e).val();if(null!==t&&""!==t){var o=JSON.parse(t);for(var n in o)if(o[n].hasOwnProperty("Name"))return o}return new Array},ReRenderFields:function(e,t){var o=$("#field-list-"+t).empty();for(i=0;i<e.length;i++){var n="<tr><td class='col-xs-8'><strong>"+e[i].Name+"</strong> "+e[i].Type+"</td><td class='col-xs-4 text-right'>";n+=e[i].System?'<span class="label label-default">System Field</span>':"<a class='delete-custom-field btn btn-xs bg-color-red txt-color-white' data-name='"+e[i].Name+"' data-id='"+t+"'><i class='fa fa-trash-o'></i></a>",n+="</td></tr>",o.append(n)}}}},$(document).ready($.hood.Content.Init);
"use strict";$.hood||($.hood={}),$.hood.Content={Init:function(){$("body").on("click",".content-delete",$.hood.Content.Delete),$("body").on("click",".content-meta-delete",$.hood.Content.Meta.Delete),$("body").on("click",".content-clone",$.hood.Content.Clone),$("body").on("click",".content-set-status",$.hood.Content.SetStatus),$("body").on("click",".content-media-delete",$.hood.Content.Media.Delete),$("body").on("click",".content-categories-delete",$.hood.Content.Categories.Delete),$("body").on("change",".content-categories-check",$.hood.Content.Categories.ToggleCategory),$("body").on("click",".add-custom-field",$.hood.Content.Types.AddField),$("body").on("click",".delete-custom-field",$.hood.Content.Types.DeleteField),$("body").on("keyup","#Slug",function(){$(".slug-display").html($(this).val())}),$("#content-edit-form").doesExist()&&$.hood.Content.Edit.Init(),$("#content-meta-form").doesExist()&&$.hood.Content.Meta.Init()},Lists:{Content:{Loaded:function(e,t){$.hood.Loader(!1)},Reload:function(e){$("#content-list").doesExist()&&$.hood.Inline.Reload($("#content-list"),e)}},Categories:{Loaded:function(e,t){$.hood.Loader(!1)},Reload:function(e){$("#content-categories-list").doesExist()&&$.hood.Inline.Reload($("#content-categories-list"),e)}},Fields:{Loaded:function(e,t){$.hood.Loader(!1)},Reload:function(e){$("#content-meta-list").doesExist()&&$.hood.Inline.Reload($("#content-meta-list"),e)}},Media:{Loaded:function(e,t){$.hood.Loader(!1)},Reload:function(e){$("#content-media-list").doesExist()&&$.hood.Inline.Reload($("#content-media-list"),e)}}},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Content.Reload(),e.Success&&t&&t.data("redirect")&&($.hood.Alerts.Success("<strong>Content deleted, redirecting...</strong><br />Just taking you back to the content list."),setTimeout(function(){window.location=t.data("redirect")},1500))})};$.hood.Alerts.Confirm("The content will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},SetStatus:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),t.data("status"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Content.Reload()})};$.hood.Alerts.Confirm("The item will be immediately visible on the website.","Are you sure?",o,"warning")},Clone:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),t.data("status"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Content.Reload()})};$.hood.Alerts.Confirm("This will duplicate the content and everything inside it.","Are you sure?",o,"warning")},Create:function(){$("#content-create-form").find(".datepicker").datetimepicker({locale:"en-gb",format:"L"}),$("#content-create-form").hoodValidator({validationRules:{Title:{required:!0},Except:{required:!0},PublishDate:{required:!0,ukdate:!0}},submitButtonTag:$("#content-create-submit"),submitUrl:$("#content-create-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Content.Reload()}})},Edit:{Init:function(){$(".datepicker").datetimepicker({locale:"en-gb",format:"L"}),$(".timepicker").datetimepicker({locale:"en-gb",format:"LT"}),$(".datetimepicker").datetimepicker({locale:"en-gb",sideBySide:!0}),$.hood.Content.Edit.InitImageUploader()},InitImageUploader:function(){if($("#content-gallery-add").doesExist()){$("#content-gallery-total-progress").hide(),Dropzone.autoDiscover=!1;var e=new Dropzone("#content-gallery-upload",{url:$("#content-gallery-upload").data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:!1,paramName:"files",autoProcessQueue:!0,previewsContainer:!1,clickable:"#content-gallery-add",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!"});e.on("success",function(e,t){$.hood.Helpers.ProcessResponse(t),$.hood.Content.Lists.Media.Reload()}),e.on("addedfile",function(e){$("#content-gallery-total-progress .progress-bar").css({width:"0%"}),$("#content-gallery-total-progress .progress-bar .percentage").html("0%")}),e.on("totaluploadprogress",function(e){$("#content-gallery-total-progress .progress-bar").css({width:e+"%"}),$("#content-gallery-total-progress .progress-bar .percentage").html(e+"%")}),e.on("sending",function(e){$("#content-gallery-total-progress").fadeIn(),$("#content-gallery-total-progress .progress-bar").css({width:"0%"}),$("#content-gallery-total-progress .progress-bar .percentage").html("0%")}),e.on("complete",function(e){$.hood.Content.Lists.Media.Reload()}),e.on("queuecomplete",function(e){$("#content-gallery-total-progress").hide(),$.hood.Content.Lists.Media.Reload()})}}},Categories:{Editor:function(){$("#content-categories-edit-form").hoodValidator({validationRules:{DisplayName:{required:!0},Slug:{required:!0}},submitButtonTag:$("#content-categories-edit-submit"),submitUrl:$("#content-categories-edit-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Categories.Reload()}})},ToggleCategory:function(){$.post($(this).data("url"),{categoryId:$(this).val(),add:$(this).is(":checked")},function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Categories.Reload()})},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Categories.Reload()})};$.hood.Alerts.Confirm("The category will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')}},Meta:{Create:function(){$("#add-field-form").hoodValidator({validationRules:{cfName:{required:!0},cfType:{required:!0}},submitButtonTag:$("#add-field-submit"),submitUrl:"/admin/content/addmeta",submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Fields.Reload()}})},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Fields.Reload()})};$.hood.Alerts.Confirm("The field will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')}},Media:{Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Content.Lists.Media.Reload()})};$.hood.Alerts.Confirm("The image/media will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong><br /><span class="text-warning">If this is set as a featured image, this may cause issues, make sure to set another image as featured before deleting this one.</span></span>')}},Types:{AddField:function(){var e=$("#custom-field-name-"+$(this).data("id")).val(),t=$.hood.Content.Types.GetFieldsList($(this).data("id")),o=!1;if($.each(t,function(t,n){n.Name===e&&(o=!0)}),!e)return void $.hood.Alerts.Error("You have to name the field.");if(!t)return void $.hood.Alerts.Error("The field list is empty.");if(o)return void $.hood.Alerts.Error("Cannot insert two fields with the same key.");var n={Name:$("#custom-field-name-"+$(this).data("id")).data("prefix")+$("#custom-field-name-"+$(this).data("id")).val(),Default:$("#custom-field-default-"+$(this).data("id")).val(),Type:$("#custom-field-type-"+$(this).data("id")).val(),System:!1};t.push(n),$.hood.Content.Types.ReRenderFields(t,$(this).data("id")),$("#custom-fields-"+$(this).data("id")).val(JSON.stringify(t)),$.hood.Alerts.Success("Added field.")},DeleteField:function(){var e=$.hood.Content.Types.GetFieldsList($(this).data("id")),t=$(this).data("name");e=$.grep(e,function(e){return e.Name!==t}),$.hood.Content.Types.ReRenderFields(e,$(this).data("id")),$("#custom-fields-"+$(this).data("id")).val(JSON.stringify(e)),$.hood.Alerts.Success("Deleted field.")},GetFieldsList:function(e){var t=$("#custom-fields-"+e).val();if(null!==t&&""!==t){var o=JSON.parse(t);for(var n in o)if(o[n].hasOwnProperty("Name"))return o}return new Array},ReRenderFields:function(e,t){var o=$("#field-list-"+t).empty();for(i=0;i<e.length;i++){var n="<tr><td class='col-xs-8'><strong>"+e[i].Name+"</strong> "+e[i].Type+"</td><td class='col-xs-4 text-right'>";n+=e[i].System?'<span class="label label-default">System Field</span>':"<a class='delete-custom-field btn btn-xs bg-color-red txt-color-white' data-name='"+e[i].Name+"' data-id='"+t+"'><i class='fa fa-trash-o'></i></a>",n+="</td></tr>",o.append(n)}}}},$(document).ready($.hood.Content.Init);
if (!$.hood)
$.hood = {};
$.hood.Forums = {
Init: function () {
Init: function() {
$('body').on('click', '.forum-delete', $.hood.Forums.Delete);

@@ -12,3 +12,3 @@ $('body').on('click', '.forum-archive', $.hood.Forums.Archive);

$('body').on('keyup', '#Slug', function () {
$('body').on('keyup', '#Slug', function() {
$('.slug-display').html($(this).val());

@@ -23,6 +23,6 @@ });

Forums: {
Loaded: function (data) {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#forum-list').doesExist())

@@ -33,6 +33,6 @@ $.hood.Inline.Reload($('#forum-list'), complete);

Categories: {
Loaded: function (data) {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#forum-categories-list').doesExist())

@@ -44,9 +44,9 @@ $.hood.Inline.Reload($('#forum-categories-list'), complete);

Delete: function (e) {
Delete: function(e) {
e.preventDefault();
let $tag = $(this);
let deleteForumCallback = function (isConfirm) {
let deleteForumCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -57,3 +57,3 @@ $.hood.Forums.Lists.Forums.Reload();

$.hood.Alerts.Success(`<strong>Forum deleted, redirecting...</strong><br />Just taking you back to the forum list.`);
setTimeout(function () {
setTimeout(function() {
window.location = $tag.data('redirect');

@@ -76,3 +76,3 @@ }, 1500);

Publish: function (e) {
Publish: function(e) {
var $this = $(this);

@@ -91,6 +91,6 @@ swal({

},
function (isConfirm) {
function(isConfirm) {
if (isConfirm) {
// delete functionality
$.post('/admin/forums/publish/' + $this.data('id'), null, function (data) {
$.post('/admin/forums/publish/' + $this.data('id'), null, function(data) {
if (data.Success) {

@@ -103,3 +103,3 @@ swal({

});
setTimeout(function () {
setTimeout(function() {
window.location = data.Url;

@@ -121,3 +121,3 @@ }, 500);

},
Archive: function (e) {
Archive: function(e) {
var $this = $(this);

@@ -136,5 +136,5 @@ swal({

},
function (isConfirm) {
function(isConfirm) {
if (isConfirm) {
$.post('/admin/forums/archive/' + $this.data('id'), null, function (data) {
$.post('/admin/forums/archive/' + $this.data('id'), null, function(data) {
if (data.Success) {

@@ -147,3 +147,3 @@ swal({

});
setTimeout(function () {
setTimeout(function() {
window.location = data.Url;

@@ -166,3 +166,3 @@ }, 500);

Create: function () {
Create: function() {
$('#forum-create-form').find('.datepicker').datetimepicker({

@@ -183,3 +183,3 @@ locale: 'en-gb',

submitUrl: $('#forum-create-form').attr('action'),
submitFunction: function (data) {
submitFunction: function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -192,3 +192,3 @@ $.hood.Forums.Lists.Forums.Reload();

Edit: {
Init: function () {
Init: function() {
$('.datepicker').datetimepicker({

@@ -206,3 +206,3 @@ locale: 'en-gb',

Categories: {
Editor: function () {
Editor: function() {
$('#forum-categories-edit-form').hoodValidator({

@@ -219,3 +219,3 @@ validationRules: {

submitUrl: $('#forum-categories-edit-form').attr('action'),
submitFunction: function (data) {
submitFunction: function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -226,4 +226,4 @@ $.hood.Forums.Lists.Categories.Reload();

},
ToggleCategory: function () {
$.post($(this).data('url'), { categoryId: $(this).val(), add: $(this).is(':checked') }, function (data) {
ToggleCategory: function() {
$.post($(this).data('url'), { categoryId: $(this).val(), add: $(this).is(':checked') }, function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -233,9 +233,9 @@ $.hood.Forums.Lists.Categories.Reload();

},
Delete: function (e) {
Delete: function(e) {
e.preventDefault();
let $tag = $(this);
let deleteCategoryCallback = function (isConfirm) {
let deleteCategoryCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -242,0 +242,0 @@ $.hood.Forums.Lists.Categories.Reload();

@@ -1,1 +0,1 @@

"use strict";$.hood||($.hood={}),$.hood.Forums={Init:function(){$("body").on("click",".forum-delete",$.hood.Forums.Delete),$("body").on("click",".forum-archive",$.hood.Forums.Archive),$("body").on("click",".forum-publish",$.hood.Forums.Publish),$("body").on("click",".forum-categories-delete",$.hood.Forums.Categories.Delete),$("body").on("change",".forum-categories-check",$.hood.Forums.Categories.ToggleCategory),$("body").on("keyup","#Slug",function(){$(".slug-display").html($(this).val())}),$("#edit-forum").doesExist()&&$.hood.Forums.Edit.Init()},Lists:{Forums:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#forum-list").doesExist()&&$.hood.Inline.Reload($("#forum-list"),e)}},Categories:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#forum-categories-list").doesExist()&&$.hood.Inline.Reload($("#forum-categories-list"),e)}}},Delete:function(e){e.preventDefault();var o=$(this),t=function(e){e&&$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Forums.Lists.Forums.Reload(),e.Success&&o&&o.data("redirect")&&($.hood.Alerts.Success("<strong>Forum deleted, redirecting...</strong><br />Just taking you back to the forum list."),setTimeout(function(){window.location=o.data("redirect")},1500))})};$.hood.Alerts.Confirm("The forum will be permanently removed.","Are you sure?",t,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},Publish:function(e){var o=$(this);swal({title:"Are you sure?",text:"The item will be visible on the website.",type:"warning",confirmButtonColor:"#DD6B55",confirmButtonText:"Yes, go ahead.",cancelButtonText:"No, cancel!",showCancelButton:!0,closeOnConfirm:!1,showLoaderOnConfirm:!0,closeOnCancel:!1},function(e){e?$.post("/admin/forums/publish/"+o.data("id"),null,function(e){e.Success?(swal({title:"Published!",text:"The item has now been published.",timer:1300,type:"success"}),setTimeout(function(){window.location=e.Url},500)):swal({title:"Error!",text:"There was a problem publishing the item: "+e.Errors,timer:5e3,type:"error"})}):swal("Cancelled","It's all good in the hood!","error")})},Archive:function(e){var o=$(this);swal({title:"Are you sure?",text:"The item will be hidden from the website.",type:"warning",confirmButtonColor:"#DD6B55",confirmButtonText:"Yes, go ahead.",cancelButtonText:"No, cancel!",showCancelButton:!0,closeOnConfirm:!1,showLoaderOnConfirm:!0,closeOnCancel:!1},function(e){e?$.post("/admin/forums/archive/"+o.data("id"),null,function(e){e.Success?(swal({title:"Archived!",text:"The item has now been archived.",timer:1300,type:"success"}),setTimeout(function(){window.location=e.Url},500)):swal({title:"Error!",text:"There was a problem archiving the item: "+e.Errors,timer:5e3,type:"error"})}):swal("Cancelled","It's all good in the hood!","error")})},Create:function(){$("#forum-create-form").find(".datepicker").datetimepicker({locale:"en-gb",format:"L"}),$("#forum-create-form").hoodValidator({validationRules:{Title:{required:!0},Description:{required:!0}},submitButtonTag:$("#forum-create-submit"),submitUrl:$("#forum-create-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Forums.Lists.Forums.Reload()}})},Edit:{Init:function(){$(".datepicker").datetimepicker({locale:"en-gb",format:"L"}),$(".datetimepicker").datetimepicker({locale:"en-gb",format:"LT"})}},Categories:{Editor:function(){$("#forum-categories-edit-form").hoodValidator({validationRules:{DisplayName:{required:!0},Slug:{required:!0}},submitButtonTag:$("#forum-categories-edit-submit"),submitUrl:$("#forum-categories-edit-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Forums.Lists.Categories.Reload()}})},ToggleCategory:function(){$.post($(this).data("url"),{categoryId:$(this).val(),add:$(this).is(":checked")},function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Forums.Lists.Categories.Reload()})},Delete:function(e){e.preventDefault();var o=$(this),t=function(e){e&&$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Forums.Lists.Categories.Reload()})};$.hood.Alerts.Confirm("The category will be permanently removed.","Are you sure?",t,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')}}},$(document).ready($.hood.Forums.Init);
"use strict";$.hood||($.hood={}),$.hood.Forums={Init:function(){$("body").on("click",".forum-delete",$.hood.Forums.Delete),$("body").on("click",".forum-archive",$.hood.Forums.Archive),$("body").on("click",".forum-publish",$.hood.Forums.Publish),$("body").on("click",".forum-categories-delete",$.hood.Forums.Categories.Delete),$("body").on("change",".forum-categories-check",$.hood.Forums.Categories.ToggleCategory),$("body").on("keyup","#Slug",function(){$(".slug-display").html($(this).val())}),$("#edit-forum").doesExist()&&$.hood.Forums.Edit.Init()},Lists:{Forums:{Loaded:function(e,o){$.hood.Loader(!1)},Reload:function(e){$("#forum-list").doesExist()&&$.hood.Inline.Reload($("#forum-list"),e)}},Categories:{Loaded:function(e,o){$.hood.Loader(!1)},Reload:function(e){$("#forum-categories-list").doesExist()&&$.hood.Inline.Reload($("#forum-categories-list"),e)}}},Delete:function(e){e.preventDefault();var o=$(this),t=function(e){e&&$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Forums.Lists.Forums.Reload(),e.Success&&o&&o.data("redirect")&&($.hood.Alerts.Success("<strong>Forum deleted, redirecting...</strong><br />Just taking you back to the forum list."),setTimeout(function(){window.location=o.data("redirect")},1500))})};$.hood.Alerts.Confirm("The forum will be permanently removed.","Are you sure?",t,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},Publish:function(e){var o=$(this);swal({title:"Are you sure?",text:"The item will be visible on the website.",type:"warning",confirmButtonColor:"#DD6B55",confirmButtonText:"Yes, go ahead.",cancelButtonText:"No, cancel!",showCancelButton:!0,closeOnConfirm:!1,showLoaderOnConfirm:!0,closeOnCancel:!1},function(e){e?$.post("/admin/forums/publish/"+o.data("id"),null,function(e){e.Success?(swal({title:"Published!",text:"The item has now been published.",timer:1300,type:"success"}),setTimeout(function(){window.location=e.Url},500)):swal({title:"Error!",text:"There was a problem publishing the item: "+e.Errors,timer:5e3,type:"error"})}):swal("Cancelled","It's all good in the hood!","error")})},Archive:function(e){var o=$(this);swal({title:"Are you sure?",text:"The item will be hidden from the website.",type:"warning",confirmButtonColor:"#DD6B55",confirmButtonText:"Yes, go ahead.",cancelButtonText:"No, cancel!",showCancelButton:!0,closeOnConfirm:!1,showLoaderOnConfirm:!0,closeOnCancel:!1},function(e){e?$.post("/admin/forums/archive/"+o.data("id"),null,function(e){e.Success?(swal({title:"Archived!",text:"The item has now been archived.",timer:1300,type:"success"}),setTimeout(function(){window.location=e.Url},500)):swal({title:"Error!",text:"There was a problem archiving the item: "+e.Errors,timer:5e3,type:"error"})}):swal("Cancelled","It's all good in the hood!","error")})},Create:function(){$("#forum-create-form").find(".datepicker").datetimepicker({locale:"en-gb",format:"L"}),$("#forum-create-form").hoodValidator({validationRules:{Title:{required:!0},Description:{required:!0}},submitButtonTag:$("#forum-create-submit"),submitUrl:$("#forum-create-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Forums.Lists.Forums.Reload()}})},Edit:{Init:function(){$(".datepicker").datetimepicker({locale:"en-gb",format:"L"}),$(".datetimepicker").datetimepicker({locale:"en-gb",format:"LT"})}},Categories:{Editor:function(){$("#forum-categories-edit-form").hoodValidator({validationRules:{DisplayName:{required:!0},Slug:{required:!0}},submitButtonTag:$("#forum-categories-edit-submit"),submitUrl:$("#forum-categories-edit-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Forums.Lists.Categories.Reload()}})},ToggleCategory:function(){$.post($(this).data("url"),{categoryId:$(this).val(),add:$(this).is(":checked")},function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Forums.Lists.Categories.Reload()})},Delete:function(e){e.preventDefault();var o=$(this),t=function(e){e&&$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Forums.Lists.Categories.Reload()})};$.hood.Alerts.Confirm("The category will be permanently removed.","Are you sure?",t,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')}}},$(document).ready($.hood.Forums.Init);

@@ -7,13 +7,13 @@ if (!$.hood)

UpdateInterval: -1,
Init: function () {
Init: function() {
if ($('#import-property-start').doesExist()) {
$.hood.Import.Property.Update();
$('#import-property-start').click(function () {
$('#import-property-start').click(function() {
$.ajax({
url: $('#import-property-start').data('url'),
type: "POST",
error: function (jqXHR, textStatus, errorThrown) {
error: function(jqXHR, textStatus, errorThrown) {
$.hood.Import.Property.View.ShowError("There was an error, " + jqXHR + "<br />" + textStatus + "<br />" + errorThrown);
},
success: function (result) {
success: function(result) {
$.hood.Import.Property.Update();

@@ -23,10 +23,10 @@ }

});
$('#import-property-cancel').click(function () {
$('#import-property-cancel').click(function() {
$.ajax({
url: $('#import-property-cancel').data('url'),
type: "POST",
error: function (jqXHR, textStatus, errorThrown) {
error: function(jqXHR, textStatus, errorThrown) {
$.hood.Import.Property.View.ShowError("There was an error, " + jqXHR + "<br />" + textStatus + "<br />" + errorThrown);
},
success: function (result) {
success: function(result) {
$.hood.Import.Property.Update();

@@ -38,10 +38,10 @@ }

},
Update: function () {
Update: function() {
$.ajax({
url: $('#import-property-status').data('url'),
type: "POST",
error: function (jqXHR, textStatus, errorThrown) {
error: function(jqXHR, textStatus, errorThrown) {
$.hood.Import.Property.View.ShowError("There was an error, " + jqXHR + "<br />" + textStatus + "<br />" + errorThrown);
},
success: function (result) {
success: function(result) {
if (result.Importer.Running) {

@@ -92,3 +92,3 @@ $.hood.Import.Property.View.ShowInfo();

View: {
HideInfo: function () {
HideInfo: function() {
$('#import-property-start').removeAttr('disabled');

@@ -99,3 +99,3 @@ $('#import-property-cancel').attr('disabled', 'disabled');

},
ShowInfo: function () {
ShowInfo: function() {
$('#import-property-cancel').removeAttr('disabled');

@@ -106,3 +106,3 @@ $('#import-property-start').attr('disabled', 'disabled');

},
ShowError: function (string) {
ShowError: function(string) {
$('#import-property-error-message').html(string).addClass('alert').addClass('alert-danger').addClass('m-t-lg');

@@ -109,0 +109,0 @@ }

@@ -8,3 +8,3 @@ if (!$.hood)

Loaded: function (data) {
Loaded: function(sender, data) {
$.hood.Loader(false);

@@ -11,0 +11,0 @@ },

@@ -1,1 +0,1 @@

"use strict";$.hood||($.hood={}),$.hood.Logs={Init:function(){$("body").on("change",".logs-inline",$.hood.Logs.InlineToggle)},Loaded:function(o){$.hood.Loader(!1)},Reload:function(o){$("#logs-list").doesExist()&&$.hood.Inline.Reload($("#logs-list"),o)},ReloadInterval:null,InlineToggle:function(o){$(this).is(":checked")?$.hood.Logs.ReloadInterval=setInterval($.hood.Logs.Reload,5e3):$.hood.Logs.ReloadInterval=setInterval($.hood.Logs.Reload,5e3)}},$(document).ready($.hood.Logs.Init);
"use strict";$.hood||($.hood={}),$.hood.Logs={Init:function(){$("body").on("change",".logs-inline",$.hood.Logs.InlineToggle)},Loaded:function(o,e){$.hood.Loader(!1)},Reload:function(o){$("#logs-list").doesExist()&&$.hood.Inline.Reload($("#logs-list"),o)},ReloadInterval:null,InlineToggle:function(o){$(this).is(":checked")?$.hood.Logs.ReloadInterval=setInterval($.hood.Logs.Reload,5e3):$.hood.Logs.ReloadInterval=setInterval($.hood.Logs.Reload,5e3)}},$(document).ready($.hood.Logs.Init);
if (!$.hood)
$.hood = {};
$.hood.Property = {
Init: function () {
Init: function() {
$('body').on('click', '.property-delete', $.hood.Property.Delete);

@@ -18,7 +18,7 @@ $('body').on('click', '.property-delete-all', $.hood.Property.DeleteAll);

Property: {
Loaded: function (data) {
Loaded: function(sender, data) {
$.hood.Loader(false);
$.hood.Google.ClusteredMap();
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#property-list').doesExist())

@@ -29,6 +29,6 @@ $.hood.Inline.Reload($('#property-list'), complete);

Media: {
Loaded: function (data) {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#property-gallery-list').doesExist())

@@ -39,6 +39,6 @@ $.hood.Inline.Reload($('#property-gallery-list'), complete);

Floorplans: {
Loaded: function (data) {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#property-floorplans-list').doesExist())

@@ -49,6 +49,6 @@ $.hood.Inline.Reload($('#property-floorplans-list'), complete);

Floorareas: {
Loaded: function (data) {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#property-floors-list').doesExist())

@@ -60,9 +60,9 @@ $.hood.Inline.Reload($('#property-floors-list'), complete);

Delete: function (e) {
Delete: function(e) {
e.preventDefault();
let $tag = $(this);
let deletePropertyCallback = function (isConfirm) {
let deletePropertyCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -73,3 +73,3 @@ $.hood.Property.Lists.Property.Reload();

$.hood.Alerts.Success(`<strong>Property deleted, redirecting...</strong><br />Just taking you back to the property list.`);
setTimeout(function () {
setTimeout(function() {
window.location = $tag.data('redirect');

@@ -92,3 +92,3 @@ }, 1500);

DeleteAll: function (e) {
DeleteAll: function(e) {
e.preventDefault();

@@ -111,3 +111,3 @@ let $tag = $(this);

var url = $tag.attr('href');
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -118,3 +118,3 @@ $.hood.Property.Lists.Property.Reload();

$.hood.Alerts.Success(`<strong>Properties deleted, redirecting...</strong><br />Just taking you back to the property list.`);
setTimeout(function () {
setTimeout(function() {
window.location = $tag.data('redirect');

@@ -139,9 +139,9 @@ }, 1500);

SetStatus: function (e) {
SetStatus: function(e) {
e.preventDefault();
let $tag = $(this);
let publishPropertyCallback = function (isConfirm) {
let publishPropertyCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), $tag.data('status'), function (data) {
$.post($tag.attr('href'), $tag.data('status'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -161,3 +161,3 @@ $.hood.Property.Lists.Property.Reload();

Create: function () {
Create: function() {
$('#property-create-form').find('.datepicker').datetimepicker({

@@ -194,3 +194,3 @@ locale: 'en-gb',

submitUrl: $('#property-create-form').attr('action'),
submitFunction: function (data) {
submitFunction: function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -203,3 +203,3 @@ $.hood.Property.Lists.Property.Reload();

CreateFloorArea: function () {
CreateFloorArea: function() {
$('#property-floorArea-create-form').hoodValidator({

@@ -222,3 +222,3 @@ validationRules: {

submitUrl: $('#property-floorArea-create-form').attr('action'),
submitFunction: function (data) {
submitFunction: function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -230,3 +230,3 @@ $.hood.Property.Lists.Floorareas.Reload();

},
RecalcFloor: function (e) {
RecalcFloor: function(e) {
if (this.id === "SquareMetres")

@@ -238,9 +238,9 @@ $('#property-floorArea-create-form #SquareFeet').val(Number($(this).val()) * 10.7639);

},
DeleteFloorArea: function (e) {
DeleteFloorArea: function(e) {
e.preventDefault();
let $tag = $(this);
let deleteFloorAreaCallback = function (isConfirm) {
let deleteFloorAreaCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -262,3 +262,3 @@ $.hood.Property.Lists.Floorareas.Reload();

Edit: {
Init: function () {
Init: function() {
$('.datepicker').datetimepicker({

@@ -275,3 +275,3 @@ locale: 'en-gb',

Upload: {
InitImageUploader: function () {
InitImageUploader: function() {
if (!$('#property-gallery-add').doesExist())

@@ -298,3 +298,3 @@ return;

myDropzone.on("success", function (file, data) {
myDropzone.on("success", function(file, data) {
$.hood.Helpers.ProcessResponse(data);

@@ -304,3 +304,3 @@ $.hood.Property.Lists.Media.Reload();

myDropzone.on("addedfile", function (file) {
myDropzone.on("addedfile", function(file) {
$('#property-gallery-total-progress .progress-bar').css({ width: 0 + "%" });

@@ -311,3 +311,3 @@ $('#property-gallery-total-progress .progress-bar .percentage').html(0 + "%");

// Update the total progress bar
myDropzone.on("totaluploadprogress", function (progress) {
myDropzone.on("totaluploadprogress", function(progress) {
$('#property-gallery-total-progress .progress-bar').css({ width: progress + "%" });

@@ -317,3 +317,3 @@ $('#property-gallery-total-progress .progress-bar .percentage').html(progress + "%");

myDropzone.on("sending", function (file) {
myDropzone.on("sending", function(file) {
// Show the total progress bar when upload starts

@@ -326,3 +326,3 @@ $('#property-gallery-total-progress').fadeIn();

// Hide the total progress bar when nothing's uploading anymore
myDropzone.on("complete", function (file) {
myDropzone.on("complete", function(file) {
$.hood.Property.Lists.Media.Reload();

@@ -332,3 +332,3 @@ });

// Hide the total progress bar when nothing's uploading anymore
myDropzone.on("queuecomplete", function (progress) {
myDropzone.on("queuecomplete", function(progress) {
$('#property-gallery-total-progress').hide();

@@ -338,3 +338,3 @@ $.hood.Property.Lists.Media.Reload();

},
InitFloorplanUploader: function () {
InitFloorplanUploader: function() {
if (!$('#property-floorplans-add').doesExist())

@@ -361,3 +361,3 @@ return;

myDropzone.on("success", function (file, data) {
myDropzone.on("success", function(file, data) {
$.hood.Helpers.ProcessResponse(data);

@@ -367,3 +367,3 @@ $.hood.Property.Lists.Floorplans.Reload();

myDropzone.on("addedfile", function (file) {
myDropzone.on("addedfile", function(file) {
$('#property-floorplans-total-progress .progress-bar').css({ width: 0 + "%" });

@@ -374,3 +374,3 @@ $('#property-floorplans-total-progress .progress-bar .percentage').html(0 + "%");

// Update the total progress bar
myDropzone.on("totaluploadprogress", function (progress) {
myDropzone.on("totaluploadprogress", function(progress) {
$('#property-floorplans-total-progress .progress-bar').css({ width: progress + "%" });

@@ -380,3 +380,3 @@ $('#property-floorplans-total-progress .progress-bar .percentage').html(progress + "%");

myDropzone.on("sending", function (file) {
myDropzone.on("sending", function(file) {
// Show the total progress bar when upload starts

@@ -389,3 +389,3 @@ $('#property-floorplans-total-progress').fadeIn();

// Hide the total progress bar when nothing's uploading anymore
myDropzone.on("complete", function (file) {
myDropzone.on("complete", function(file) {
$.hood.Property.Lists.Floorplans.Reload();

@@ -395,3 +395,3 @@ });

// Hide the total progress bar when nothing's uploading anymore
myDropzone.on("queuecomplete", function (progress) {
myDropzone.on("queuecomplete", function(progress) {
$('#property-floorplans-total-progress').hide();

@@ -404,9 +404,9 @@ $.hood.Property.Lists.Floorplans.Reload();

Media: {
Delete: function (e) {
Delete: function(e) {
e.preventDefault();
let $tag = $(this);
let deleteMediaCallback = function (isConfirm) {
let deleteMediaCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -413,0 +413,0 @@ $.hood.Property.Lists.Media.Reload();

@@ -1,1 +0,1 @@

"use strict";$.hood||($.hood={}),$.hood.Property={Init:function(){$("body").on("click",".property-delete",$.hood.Property.Delete),$("body").on("click",".property-delete-all",$.hood.Property.DeleteAll),$("body").on("click",".property-delete-floor",$.hood.Property.DeleteFloorArea),$("body").on("click",".property-set-status",$.hood.Property.SetStatus),$("body").on("click",".property-media-delete",$.hood.Property.Media.Delete),$("#property-edit-form").doesExist()&&$.hood.Property.Edit.Init()},Lists:{Property:{Loaded:function(e){$.hood.Loader(!1),$.hood.Google.ClusteredMap()},Reload:function(e){$("#property-list").doesExist()&&$.hood.Inline.Reload($("#property-list"),e)}},Media:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#property-gallery-list").doesExist()&&$.hood.Inline.Reload($("#property-gallery-list"),e)}},Floorplans:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#property-floorplans-list").doesExist()&&$.hood.Inline.Reload($("#property-floorplans-list"),e)}},Floorareas:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#property-floors-list").doesExist()&&$.hood.Inline.Reload($("#property-floors-list"),e)}}},Delete:function(e){e.preventDefault();var o=$(this),r=function(e){e&&$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Property.Lists.Property.Reload(),e.Success&&o&&o.data("redirect")&&($.hood.Alerts.Success("<strong>Property deleted, redirecting...</strong><br />Just taking you back to the property list."),setTimeout(function(){window.location=o.data("redirect")},1500))})};$.hood.Alerts.Confirm("The property will be permanently removed.","Are you sure?",r,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},DeleteAll:function(e){e.preventDefault();var o=$(this);Swal.fire({title:"Are you sure?",html:"ALL of the properties will be permanently removed. Type 'DELETE' to continue.",input:"text",inputAttributes:{autocapitalize:"off"},footer:'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This can take a few minutes to complete and CANNOT be undone.</strong></span>',showCancelButton:!0,confirmButtonText:"Delete",showLoaderOnConfirm:!0,preConfirm:function(e){if("delete"!==e.toLowerCase())return Swal.showValidationMessage("You did not type DELETE."),!1;o.attr("href");$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Property.Lists.Property.Reload(),e.Success&&o&&o.data("redirect")&&($.hood.Alerts.Success("<strong>Properties deleted, redirecting...</strong><br />Just taking you back to the property list."),setTimeout(function(){window.location=o.data("redirect")},1500)),swal.close()}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},allowOutsideClick:function(){return!Swal.isLoading()}})},SetStatus:function(e){e.preventDefault();var o=$(this),r=function(e){e&&$.post(o.attr("href"),o.data("status"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Property.Lists.Property.Reload()})};$.hood.Alerts.Confirm("The item will be immediately visible on the website.","Are you sure?",r,"warning")},Create:function(){$("#property-create-form").find(".datepicker").datetimepicker({locale:"en-gb",format:"L"}),$("#property-create-form").hoodValidator({validationRules:{Title:{required:!0},Address1:{required:!0},City:{required:!0},County:{required:!0},Country:{required:!0},Postcode:{required:!0},PublishDate:{required:!0,ukdate:!0}},submitButtonTag:$("#property-create-submit"),submitUrl:$("#property-create-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Property.Lists.Property.Reload()}}),$.hood.Google.Addresses.InitAutocomplete()},CreateFloorArea:function(){$("#property-floorArea-create-form").hoodValidator({validationRules:{Name:{required:!0},Number:{required:!0},SquareFeet:{required:!0},SquareMetres:{required:!0}},submitButtonTag:$("#property-floorArea-create-submit"),submitUrl:$("#property-floorArea-create-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Property.Lists.Floorareas.Reload()}}),$("body").on("change",".recalc-floor",$.hood.Property.RecalcFloor)},RecalcFloor:function(e){"SquareMetres"===this.id?$("#property-floorArea-create-form #SquareFeet").val(10.7639*Number($(this).val())):$("#property-floorArea-create-form #SquareMetres").val(Number($(this).val())/10.7639)},DeleteFloorArea:function(e){e.preventDefault();var o=$(this),r=function(e){e&&$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Property.Lists.Floorareas.Reload()})};$.hood.Alerts.Confirm("The floor will be permanently removed.","Are you sure?",r,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},Edit:{Init:function(){$(".datepicker").datetimepicker({locale:"en-gb",format:"L"}),$.hood.Property.Upload.InitImageUploader(),$.hood.Property.Upload.InitFloorplanUploader()}},Upload:{InitImageUploader:function(){if($("#property-gallery-add").doesExist()){$("#property-gallery-total-progress").hide(),Dropzone.autoDiscover=!1;var e=new Dropzone("#property-gallery-upload",{url:$("#property-gallery-upload").data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:!1,paramName:"files",autoProcessQueue:!0,previewsContainer:!1,clickable:"#property-gallery-add",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!"});e.on("success",function(e,o){$.hood.Helpers.ProcessResponse(o),$.hood.Property.Lists.Media.Reload()}),e.on("addedfile",function(e){$("#property-gallery-total-progress .progress-bar").css({width:"0%"}),$("#property-gallery-total-progress .progress-bar .percentage").html("0%")}),e.on("totaluploadprogress",function(e){$("#property-gallery-total-progress .progress-bar").css({width:e+"%"}),$("#property-gallery-total-progress .progress-bar .percentage").html(e+"%")}),e.on("sending",function(e){$("#property-gallery-total-progress").fadeIn(),$("#property-gallery-total-progress .progress-bar").css({width:"0%"}),$("#property-gallery-total-progress .progress-bar .percentage").html("0%")}),e.on("complete",function(e){$.hood.Property.Lists.Media.Reload()}),e.on("queuecomplete",function(e){$("#property-gallery-total-progress").hide(),$.hood.Property.Lists.Media.Reload()})}},InitFloorplanUploader:function(){if($("#property-floorplans-add").doesExist()){$("#property-floorplans-total-progress").hide(),Dropzone.autoDiscover=!1;var e=new Dropzone("#property-floorplans-upload",{url:$("#property-floorplans-upload").data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:!1,paramName:"files",autoProcessQueue:!0,previewsContainer:!1,clickable:"#property-floorplans-add",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!"});e.on("success",function(e,o){$.hood.Helpers.ProcessResponse(o),$.hood.Property.Lists.Floorplans.Reload()}),e.on("addedfile",function(e){$("#property-floorplans-total-progress .progress-bar").css({width:"0%"}),$("#property-floorplans-total-progress .progress-bar .percentage").html("0%")}),e.on("totaluploadprogress",function(e){$("#property-floorplans-total-progress .progress-bar").css({width:e+"%"}),$("#property-floorplans-total-progress .progress-bar .percentage").html(e+"%")}),e.on("sending",function(e){$("#property-floorplans-total-progress").fadeIn(),$("#property-floorplans-total-progress .progress-bar").css({width:"0%"}),$("#property-floorplans-total-progress .progress-bar .percentage").html("0%")}),e.on("complete",function(e){$.hood.Property.Lists.Floorplans.Reload()}),e.on("queuecomplete",function(e){$("#property-floorplans-total-progress").hide(),$.hood.Property.Lists.Floorplans.Reload()})}}},Media:{Delete:function(e){e.preventDefault();var o=$(this),r=function(e){e&&$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Property.Lists.Media.Reload(),$.hood.Property.Lists.Floorplans.Reload()})};$.hood.Alerts.Confirm("The image/media will be permanently removed.","Are you sure?",r,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong><br /><span class="text-warning">If this is set as a featured image, this may cause issues, make sure to set another image as featured before deleting this one.</span></span>')}}},$(document).ready($.hood.Property.Init);
"use strict";$.hood||($.hood={}),$.hood.Property={Init:function(){$("body").on("click",".property-delete",$.hood.Property.Delete),$("body").on("click",".property-delete-all",$.hood.Property.DeleteAll),$("body").on("click",".property-delete-floor",$.hood.Property.DeleteFloorArea),$("body").on("click",".property-set-status",$.hood.Property.SetStatus),$("body").on("click",".property-media-delete",$.hood.Property.Media.Delete),$("#property-edit-form").doesExist()&&$.hood.Property.Edit.Init()},Lists:{Property:{Loaded:function(e,o){$.hood.Loader(!1),$.hood.Google.ClusteredMap()},Reload:function(e){$("#property-list").doesExist()&&$.hood.Inline.Reload($("#property-list"),e)}},Media:{Loaded:function(e,o){$.hood.Loader(!1)},Reload:function(e){$("#property-gallery-list").doesExist()&&$.hood.Inline.Reload($("#property-gallery-list"),e)}},Floorplans:{Loaded:function(e,o){$.hood.Loader(!1)},Reload:function(e){$("#property-floorplans-list").doesExist()&&$.hood.Inline.Reload($("#property-floorplans-list"),e)}},Floorareas:{Loaded:function(e,o){$.hood.Loader(!1)},Reload:function(e){$("#property-floors-list").doesExist()&&$.hood.Inline.Reload($("#property-floors-list"),e)}}},Delete:function(e){e.preventDefault();var o=$(this),r=function(e){e&&$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Property.Lists.Property.Reload(),e.Success&&o&&o.data("redirect")&&($.hood.Alerts.Success("<strong>Property deleted, redirecting...</strong><br />Just taking you back to the property list."),setTimeout(function(){window.location=o.data("redirect")},1500))})};$.hood.Alerts.Confirm("The property will be permanently removed.","Are you sure?",r,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},DeleteAll:function(e){e.preventDefault();var o=$(this);Swal.fire({title:"Are you sure?",html:"ALL of the properties will be permanently removed. Type 'DELETE' to continue.",input:"text",inputAttributes:{autocapitalize:"off"},footer:'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This can take a few minutes to complete and CANNOT be undone.</strong></span>',showCancelButton:!0,confirmButtonText:"Delete",showLoaderOnConfirm:!0,preConfirm:function(e){if("delete"!==e.toLowerCase())return Swal.showValidationMessage("You did not type DELETE."),!1;o.attr("href");$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Property.Lists.Property.Reload(),e.Success&&o&&o.data("redirect")&&($.hood.Alerts.Success("<strong>Properties deleted, redirecting...</strong><br />Just taking you back to the property list."),setTimeout(function(){window.location=o.data("redirect")},1500)),swal.close()}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},allowOutsideClick:function(){return!Swal.isLoading()}})},SetStatus:function(e){e.preventDefault();var o=$(this),r=function(e){e&&$.post(o.attr("href"),o.data("status"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Property.Lists.Property.Reload()})};$.hood.Alerts.Confirm("The item will be immediately visible on the website.","Are you sure?",r,"warning")},Create:function(){$("#property-create-form").find(".datepicker").datetimepicker({locale:"en-gb",format:"L"}),$("#property-create-form").hoodValidator({validationRules:{Title:{required:!0},Address1:{required:!0},City:{required:!0},County:{required:!0},Country:{required:!0},Postcode:{required:!0},PublishDate:{required:!0,ukdate:!0}},submitButtonTag:$("#property-create-submit"),submitUrl:$("#property-create-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Property.Lists.Property.Reload()}}),$.hood.Google.Addresses.InitAutocomplete()},CreateFloorArea:function(){$("#property-floorArea-create-form").hoodValidator({validationRules:{Name:{required:!0},Number:{required:!0},SquareFeet:{required:!0},SquareMetres:{required:!0}},submitButtonTag:$("#property-floorArea-create-submit"),submitUrl:$("#property-floorArea-create-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Property.Lists.Floorareas.Reload()}}),$("body").on("change",".recalc-floor",$.hood.Property.RecalcFloor)},RecalcFloor:function(e){"SquareMetres"===this.id?$("#property-floorArea-create-form #SquareFeet").val(10.7639*Number($(this).val())):$("#property-floorArea-create-form #SquareMetres").val(Number($(this).val())/10.7639)},DeleteFloorArea:function(e){e.preventDefault();var o=$(this),r=function(e){e&&$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Property.Lists.Floorareas.Reload()})};$.hood.Alerts.Confirm("The floor will be permanently removed.","Are you sure?",r,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},Edit:{Init:function(){$(".datepicker").datetimepicker({locale:"en-gb",format:"L"}),$.hood.Property.Upload.InitImageUploader(),$.hood.Property.Upload.InitFloorplanUploader()}},Upload:{InitImageUploader:function(){if($("#property-gallery-add").doesExist()){$("#property-gallery-total-progress").hide(),Dropzone.autoDiscover=!1;var e=new Dropzone("#property-gallery-upload",{url:$("#property-gallery-upload").data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:!1,paramName:"files",autoProcessQueue:!0,previewsContainer:!1,clickable:"#property-gallery-add",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!"});e.on("success",function(e,o){$.hood.Helpers.ProcessResponse(o),$.hood.Property.Lists.Media.Reload()}),e.on("addedfile",function(e){$("#property-gallery-total-progress .progress-bar").css({width:"0%"}),$("#property-gallery-total-progress .progress-bar .percentage").html("0%")}),e.on("totaluploadprogress",function(e){$("#property-gallery-total-progress .progress-bar").css({width:e+"%"}),$("#property-gallery-total-progress .progress-bar .percentage").html(e+"%")}),e.on("sending",function(e){$("#property-gallery-total-progress").fadeIn(),$("#property-gallery-total-progress .progress-bar").css({width:"0%"}),$("#property-gallery-total-progress .progress-bar .percentage").html("0%")}),e.on("complete",function(e){$.hood.Property.Lists.Media.Reload()}),e.on("queuecomplete",function(e){$("#property-gallery-total-progress").hide(),$.hood.Property.Lists.Media.Reload()})}},InitFloorplanUploader:function(){if($("#property-floorplans-add").doesExist()){$("#property-floorplans-total-progress").hide(),Dropzone.autoDiscover=!1;var e=new Dropzone("#property-floorplans-upload",{url:$("#property-floorplans-upload").data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:!1,paramName:"files",autoProcessQueue:!0,previewsContainer:!1,clickable:"#property-floorplans-add",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!"});e.on("success",function(e,o){$.hood.Helpers.ProcessResponse(o),$.hood.Property.Lists.Floorplans.Reload()}),e.on("addedfile",function(e){$("#property-floorplans-total-progress .progress-bar").css({width:"0%"}),$("#property-floorplans-total-progress .progress-bar .percentage").html("0%")}),e.on("totaluploadprogress",function(e){$("#property-floorplans-total-progress .progress-bar").css({width:e+"%"}),$("#property-floorplans-total-progress .progress-bar .percentage").html(e+"%")}),e.on("sending",function(e){$("#property-floorplans-total-progress").fadeIn(),$("#property-floorplans-total-progress .progress-bar").css({width:"0%"}),$("#property-floorplans-total-progress .progress-bar .percentage").html("0%")}),e.on("complete",function(e){$.hood.Property.Lists.Floorplans.Reload()}),e.on("queuecomplete",function(e){$("#property-floorplans-total-progress").hide(),$.hood.Property.Lists.Floorplans.Reload()})}}},Media:{Delete:function(e){e.preventDefault();var o=$(this),r=function(e){e&&$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Property.Lists.Media.Reload(),$.hood.Property.Lists.Floorplans.Reload()})};$.hood.Alerts.Confirm("The image/media will be permanently removed.","Are you sure?",r,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong><br /><span class="text-warning">If this is set as a featured image, this may cause issues, make sure to set another image as featured before deleting this one.</span></span>')}}},$(document).ready($.hood.Property.Init);
if (!$.hood)
$.hood = {};
$.hood.Subscriptions = {
Init: function () {
Init: function() {
$('body').on('click', '.subscriptions-subs-delete', $.hood.Subscriptions.Subscriptions.Delete);

@@ -21,6 +21,6 @@

Plans: {
Loaded: function () {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#subscriptions-plans-list').doesExist())

@@ -31,6 +31,6 @@ $.hood.Inline.Reload($('#subscriptions-plans-list'), complete);

Stripe: {
Loaded: function () {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#subscriptions-stripe-list').doesExist())

@@ -41,6 +41,6 @@ $.hood.Inline.Reload($('#subscriptions-stripe-list'), complete);

StripeProducts: {
Loaded: function () {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#subscriptions-stripe-products-list').doesExist())

@@ -51,6 +51,6 @@ $.hood.Inline.Reload($('#subscriptions-stripe-products-list'), complete);

Products: {
Loaded: function () {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#subscriptions-products-list').doesExist())

@@ -61,6 +61,6 @@ $.hood.Inline.Reload($('#subscriptions-products-list'), complete);

Subscribers: {
Loaded: function () {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#subscriptions-subscribers-list').doesExist())

@@ -73,9 +73,9 @@ $.hood.Inline.Reload($('#subscriptions-subscribers-list'), complete);

Subscriptions: {
Delete: function (e) {
Delete: function(e) {
e.preventDefault();
let $tag = $(this);
let deleteSubscriptionCallback = function (isConfirm) {
let deleteSubscriptionCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -86,3 +86,3 @@ $.hood.Subscriptions.Lists.Subscribers.Reload();

$.hood.Alerts.Success(`<strong>Subscription deleted, redirecting...</strong><br />Just taking you back to the subscription list.`);
setTimeout(function () {
setTimeout(function() {
window.location = $tag.data('redirect');

@@ -107,9 +107,9 @@ }, 1500);

Plans: {
Delete: function (e) {
Delete: function(e) {
e.preventDefault();
let $tag = $(this);
let deletePlanCallback = function (isConfirm) {
let deletePlanCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -120,3 +120,3 @@ $.hood.Subscriptions.Lists.Plans.Reload();

$.hood.Alerts.Success(`<strong>Plan deleted, redirecting...</strong><br />Just taking you back to the subscription plan list.`);
setTimeout(function () {
setTimeout(function() {
window.location = $tag.data('redirect');

@@ -138,3 +138,3 @@ }, 1500);

},
Create: function () {
Create: function() {
$('#subscriptions-plans-create-form').hoodValidator({

@@ -163,3 +163,3 @@ validationRules: {

submitUrl: $('#subscriptions-plans-create-form').attr('action'),
submitFunction: function (data) {
submitFunction: function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -173,9 +173,9 @@ $.hood.Subscriptions.Lists.Plans.Reload();

Products: {
Delete: function (e) {
Delete: function(e) {
e.preventDefault();
let $tag = $(this);
let deleteProductCallback = function (isConfirm) {
let deleteProductCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -186,3 +186,3 @@ $.hood.Subscriptions.Lists.Products.Reload();

$.hood.Alerts.Success(`<strong>Product deleted, redirecting...</strong><br />Just taking you back to the subscription product list.`);
setTimeout(function () {
setTimeout(function() {
window.location = $tag.data('redirect');

@@ -204,3 +204,3 @@ }, 1500);

},
Create: function () {
Create: function() {
$('#susbcriptions-products-create-form').find('.datepicker').datetimepicker({

@@ -218,3 +218,3 @@ locale: 'en-gb',

submitUrl: $('#susbcriptions-products-create-form').attr('action'),
submitFunction: function (data) {
submitFunction: function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -221,0 +221,0 @@ $.hood.Subscriptions.Lists.Products.Reload();

@@ -1,1 +0,1 @@

"use strict";$.hood||($.hood={}),$.hood.Subscriptions={Init:function(){$("body").on("click",".subscriptions-subs-delete",$.hood.Subscriptions.Subscriptions.Delete),$("body").on("click",".subscriptions-plans-delete",$.hood.Subscriptions.Plans.Delete),$("#subscriptions-plans-edit-form").doesExist()&&$.hood.Subscriptions.Plans.Edit(),$("body").on("click",".subscriptions-products-delete",$.hood.Subscriptions.Products.Delete),$("#subscriptions-products-edit-form").doesExist()&&$.hood.Subscriptions.Products.Edit(),$("#subscriptions-stripe-edit-form").doesExist()&&$.hood.Subscriptions.Stripe.Edit()},Lists:{Plans:{Loaded:function(){$.hood.Loader(!1)},Reload:function(s){$("#subscriptions-plans-list").doesExist()&&$.hood.Inline.Reload($("#subscriptions-plans-list"),s)}},Stripe:{Loaded:function(){$.hood.Loader(!1)},Reload:function(s){$("#subscriptions-stripe-list").doesExist()&&$.hood.Inline.Reload($("#subscriptions-stripe-list"),s)}},StripeProducts:{Loaded:function(){$.hood.Loader(!1)},Reload:function(s){$("#subscriptions-stripe-products-list").doesExist()&&$.hood.Inline.Reload($("#subscriptions-stripe-products-list"),s)}},Products:{Loaded:function(){$.hood.Loader(!1)},Reload:function(s){$("#subscriptions-products-list").doesExist()&&$.hood.Inline.Reload($("#subscriptions-products-list"),s)}},Subscribers:{Loaded:function(){$.hood.Loader(!1)},Reload:function(s){$("#subscriptions-subscribers-list").doesExist()&&$.hood.Inline.Reload($("#subscriptions-subscribers-list"),s)}}},Subscriptions:{Delete:function(s){s.preventDefault();var o=$(this),t=function(s){s&&$.post(o.attr("href"),function(s){$.hood.Helpers.ProcessResponse(s),$.hood.Subscriptions.Lists.Subscribers.Reload(),s.Success&&o&&o.data("redirect")&&($.hood.Alerts.Success("<strong>Subscription deleted, redirecting...</strong><br />Just taking you back to the subscription list."),setTimeout(function(){window.location=o.data("redirect")},1500))})};$.hood.Alerts.Confirm("The subscription will be removed from the site, however record of the subscription will remain in your Stripe account.","Are you sure?",t,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')}},Plans:{Delete:function(s){s.preventDefault();var o=$(this),t=function(s){s&&$.post(o.attr("href"),function(s){$.hood.Helpers.ProcessResponse(s),$.hood.Subscriptions.Lists.Plans.Reload(),s.Success&&o&&o.data("redirect")&&($.hood.Alerts.Success("<strong>Plan deleted, redirecting...</strong><br />Just taking you back to the subscription plan list."),setTimeout(function(){window.location=o.data("redirect")},1500))})};$.hood.Alerts.Confirm("The plan will be permanently removed.","Are you sure?",t,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},Create:function(){$("#subscriptions-plans-create-form").hoodValidator({validationRules:{Name:{required:!0},Description:{required:!0},CreatePrice:{required:!0},Currency:{required:!0},Interval:{required:!0},IntervalCount:{required:!0}},submitButtonTag:$("#subscriptions-plans-create-submit"),submitUrl:$("#subscriptions-plans-create-form").attr("action"),submitFunction:function(s){$.hood.Helpers.ProcessResponse(s),$.hood.Subscriptions.Lists.Plans.Reload()}})}},Products:{Delete:function(s){s.preventDefault();var o=$(this),t=function(s){s&&$.post(o.attr("href"),function(s){$.hood.Helpers.ProcessResponse(s),$.hood.Subscriptions.Lists.Products.Reload(),s.Success&&o&&o.data("redirect")&&($.hood.Alerts.Success("<strong>Product deleted, redirecting...</strong><br />Just taking you back to the subscription product list."),setTimeout(function(){window.location=o.data("redirect")},1500))})};$.hood.Alerts.Confirm("The product will be permanently removed.","Are you sure?",t,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},Create:function(){$("#susbcriptions-products-create-form").find(".datepicker").datetimepicker({locale:"en-gb",format:"L"}),$("#susbcriptions-products-create-form").hoodValidator({validationRules:{DisplayName:{required:!0}},submitButtonTag:$("#susbcriptions-products-create-submit"),submitUrl:$("#susbcriptions-products-create-form").attr("action"),submitFunction:function(s){$.hood.Helpers.ProcessResponse(s),$.hood.Subscriptions.Lists.Products.Reload()}})}}},$(document).ready($.hood.Subscriptions.Init);
"use strict";$.hood||($.hood={}),$.hood.Subscriptions={Init:function(){$("body").on("click",".subscriptions-subs-delete",$.hood.Subscriptions.Subscriptions.Delete),$("body").on("click",".subscriptions-plans-delete",$.hood.Subscriptions.Plans.Delete),$("#subscriptions-plans-edit-form").doesExist()&&$.hood.Subscriptions.Plans.Edit(),$("body").on("click",".subscriptions-products-delete",$.hood.Subscriptions.Products.Delete),$("#subscriptions-products-edit-form").doesExist()&&$.hood.Subscriptions.Products.Edit(),$("#subscriptions-stripe-edit-form").doesExist()&&$.hood.Subscriptions.Stripe.Edit()},Lists:{Plans:{Loaded:function(s,o){$.hood.Loader(!1)},Reload:function(s){$("#subscriptions-plans-list").doesExist()&&$.hood.Inline.Reload($("#subscriptions-plans-list"),s)}},Stripe:{Loaded:function(s,o){$.hood.Loader(!1)},Reload:function(s){$("#subscriptions-stripe-list").doesExist()&&$.hood.Inline.Reload($("#subscriptions-stripe-list"),s)}},StripeProducts:{Loaded:function(s,o){$.hood.Loader(!1)},Reload:function(s){$("#subscriptions-stripe-products-list").doesExist()&&$.hood.Inline.Reload($("#subscriptions-stripe-products-list"),s)}},Products:{Loaded:function(s,o){$.hood.Loader(!1)},Reload:function(s){$("#subscriptions-products-list").doesExist()&&$.hood.Inline.Reload($("#subscriptions-products-list"),s)}},Subscribers:{Loaded:function(s,o){$.hood.Loader(!1)},Reload:function(s){$("#subscriptions-subscribers-list").doesExist()&&$.hood.Inline.Reload($("#subscriptions-subscribers-list"),s)}}},Subscriptions:{Delete:function(s){s.preventDefault();var o=$(this),t=function(s){s&&$.post(o.attr("href"),function(s){$.hood.Helpers.ProcessResponse(s),$.hood.Subscriptions.Lists.Subscribers.Reload(),s.Success&&o&&o.data("redirect")&&($.hood.Alerts.Success("<strong>Subscription deleted, redirecting...</strong><br />Just taking you back to the subscription list."),setTimeout(function(){window.location=o.data("redirect")},1500))})};$.hood.Alerts.Confirm("The subscription will be removed from the site, however record of the subscription will remain in your Stripe account.","Are you sure?",t,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')}},Plans:{Delete:function(s){s.preventDefault();var o=$(this),t=function(s){s&&$.post(o.attr("href"),function(s){$.hood.Helpers.ProcessResponse(s),$.hood.Subscriptions.Lists.Plans.Reload(),s.Success&&o&&o.data("redirect")&&($.hood.Alerts.Success("<strong>Plan deleted, redirecting...</strong><br />Just taking you back to the subscription plan list."),setTimeout(function(){window.location=o.data("redirect")},1500))})};$.hood.Alerts.Confirm("The plan will be permanently removed.","Are you sure?",t,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},Create:function(){$("#subscriptions-plans-create-form").hoodValidator({validationRules:{Name:{required:!0},Description:{required:!0},CreatePrice:{required:!0},Currency:{required:!0},Interval:{required:!0},IntervalCount:{required:!0}},submitButtonTag:$("#subscriptions-plans-create-submit"),submitUrl:$("#subscriptions-plans-create-form").attr("action"),submitFunction:function(s){$.hood.Helpers.ProcessResponse(s),$.hood.Subscriptions.Lists.Plans.Reload()}})}},Products:{Delete:function(s){s.preventDefault();var o=$(this),t=function(s){s&&$.post(o.attr("href"),function(s){$.hood.Helpers.ProcessResponse(s),$.hood.Subscriptions.Lists.Products.Reload(),s.Success&&o&&o.data("redirect")&&($.hood.Alerts.Success("<strong>Product deleted, redirecting...</strong><br />Just taking you back to the subscription product list."),setTimeout(function(){window.location=o.data("redirect")},1500))})};$.hood.Alerts.Confirm("The product will be permanently removed.","Are you sure?",t,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},Create:function(){$("#susbcriptions-products-create-form").find(".datepicker").datetimepicker({locale:"en-gb",format:"L"}),$("#susbcriptions-products-create-form").hoodValidator({validationRules:{DisplayName:{required:!0}},submitButtonTag:$("#susbcriptions-products-create-submit"),submitUrl:$("#susbcriptions-products-create-form").attr("action"),submitFunction:function(s){$.hood.Helpers.ProcessResponse(s),$.hood.Subscriptions.Lists.Products.Reload()}})}}},$(document).ready($.hood.Subscriptions.Init);
if (!$.hood)
$.hood = {};
$.hood.Themes = {
Init: function () {
Init: function() {
$('body').on('click', '.activate-theme', $.hood.Themes.Activate);
},
Loaded: function (data) {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#themes-list').doesExist())

@@ -16,11 +16,11 @@ $.hood.Inline.Reload($('#themes-list'), complete);

Activate: function (e) {
Activate: function(e) {
e.preventDefault();
let $tag = $(this);
let activateThemeCallback = function (isConfirm) {
let activateThemeCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);
setTimeout(function () { $.hood.Themes.Reload(); }, 2000);
setTimeout(function() { $.hood.Themes.Reload(); }, 2000);
});

@@ -27,0 +27,0 @@ }

@@ -1,1 +0,1 @@

"use strict";$.hood||($.hood={}),$.hood.Themes={Init:function(){$("body").on("click",".activate-theme",$.hood.Themes.Activate)},Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#themes-list").doesExist()&&$.hood.Inline.Reload($("#themes-list"),e)},Activate:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),setTimeout(function(){$.hood.Themes.Reload()},2e3)})};$.hood.Alerts.Confirm("The site will change themes, and the selected theme will be live right away.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process will take effect immediately!</strong></span>')}},$(document).ready($.hood.Themes.Init);
"use strict";$.hood||($.hood={}),$.hood.Themes={Init:function(){$("body").on("click",".activate-theme",$.hood.Themes.Activate)},Loaded:function(e,t){$.hood.Loader(!1)},Reload:function(e){$("#themes-list").doesExist()&&$.hood.Inline.Reload($("#themes-list"),e)},Activate:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),setTimeout(function(){$.hood.Themes.Reload()},2e3)})};$.hood.Alerts.Confirm("The site will change themes, and the selected theme will be live right away.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process will take effect immediately!</strong></span>')}},$(document).ready($.hood.Themes.Init);
if (!$.hood)
$.hood = {};
$.hood.Users = {
Init: function () {
Init: function() {
$('body').on('click', '.user-delete', $.hood.Users.Delete);

@@ -16,6 +16,6 @@

Loaded: function (data) {
Loaded: function(sender, data) {
$.hood.Loader(false);
},
Reload: function (complete) {
Reload: function(complete) {
if ($('#user-list').doesExist())

@@ -25,9 +25,9 @@ $.hood.Inline.Reload($('#user-list'), complete);

Delete: function (e) {
Delete: function(e) {
e.preventDefault();
let $tag = $(this);
let deleteUserCallback = function (isConfirm) {
let deleteUserCallback = function(isConfirm) {
if (isConfirm) {
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -38,3 +38,3 @@ $.hood.Users.Reload();

$.hood.Alerts.Success(`<strong>User deleted, redirecting...</strong><br />Just taking you back to the user list.`);
setTimeout(function () {
setTimeout(function() {
window.location = $tag.data('redirect');

@@ -58,3 +58,3 @@ }, 1500);

Create: {
Loaded: function (e) {
Loaded: function(e) {
$('#user-create-form').hoodValidator({

@@ -78,3 +78,3 @@ validationRules: {

submitUrl: $('#user-create-form').attr('action'),
submitFunction: function (data) {
submitFunction: function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -85,3 +85,3 @@ $.hood.Users.Reload();

},
GeneratePassword: function () {
GeneratePassword: function() {
if ($(this).is(':checked')) {

@@ -98,11 +98,12 @@ $('#user-create-form #Password').val($.hood.Helpers.GenerateRandomString(0));

Edit: {
ResetPassword: function (e) {
ResetPassword: function(e) {
e.preventDefault();
let $tag = $(this);
let resetPasswordCallback = function (inputValue) {
let resetPasswordCallback = function(inputValue) {
if (inputValue === false) return false; if (inputValue === "") {
swal.showInputError("You didn't supply a new password, we can't reset the password without it!"); return false
swal.showInputError("You didn't supply a new password, we can't reset the password without it!");
return false;
}
$.post($tag.attr('href'), { password: inputValue }, function (data) {
$.post($tag.attr('href'), { password: inputValue }, function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -120,7 +121,7 @@ });

Notes: {
Add: function (e) {
Add: function(e) {
e.preventDefault();
let $tag = $(this);
let addNoteCallback = function (inputValue) {
let addNoteCallback = function(inputValue) {
if (inputValue === false || inputValue === "") {

@@ -130,3 +131,3 @@ swal.showInputError("You enter anything!");

}
$.post($tag.attr('href'), { note: inputValue }, function (data) {
$.post($tag.attr('href'), { note: inputValue }, function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -145,10 +146,10 @@ $.hood.Inline.Reload('#user-notes');

},
Delete: function (e) {
Delete: function(e) {
e.preventDefault();
let $tag = $(this);
let deleteUserNoteCallback = function (isConfirm) {
let deleteUserNoteCallback = function(isConfirm) {
if (isConfirm) {
// delete functionality
$.post($tag.attr('href'), function (data) {
$.post($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -170,9 +171,9 @@ $.hood.Inline.Reload('#user-notes');

},
ToggleRole: function () {
ToggleRole: function() {
if ($(this).is(':checked')) {
$.post($(this).data('url'), { role: $(this).val(), add: true }, function (data) {
$.post($(this).data('url'), { role: $(this).val(), add: true }, function(data) {
$.hood.Helpers.ProcessResponse(data);
});
} else {
$.post($(this).data('url'), { role: $(this).val(), add: false }, function (data) {
$.post($(this).data('url'), { role: $(this).val(), add: false }, function(data) {
$.hood.Helpers.ProcessResponse(data);

@@ -179,0 +180,0 @@ });

@@ -1,1 +0,1 @@

"use strict";$.hood||($.hood={}),$.hood.Users={Init:function(){$("body").on("click",".user-delete",$.hood.Users.Delete),$("body").on("click",".user-reset-password",$.hood.Users.Edit.ResetPassword),$("body").on("click",".user-notes-add",$.hood.Users.Edit.Notes.Add),$("body").on("click",".user-notes-delete",$.hood.Users.Edit.Notes.Delete),$("body").on("change","#user-create-form #GeneratePassword",$.hood.Users.Create.GeneratePassword),$("body").on("change",".user-role-check",$.hood.Users.Edit.ToggleRole)},Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#user-list").doesExist()&&$.hood.Inline.Reload($("#user-list"),e)},Delete:function(e){e.preventDefault();var o=$(this),s=function(e){e&&$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Users.Reload(),e.Success&&o&&o.data("redirect")&&($.hood.Alerts.Success("<strong>User deleted, redirecting...</strong><br />Just taking you back to the user list."),setTimeout(function(){window.location=o.data("redirect")},1500))})};$.hood.Alerts.Confirm("The user will be permanently removed, any site content will be reassigned to the ownership of the site owner, any user content (Forum Topics & Posts) will be deleted from the system and all associated media files.","Are you sure?",s,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong><br />This process will also cancel any active subscriptions.</span>')},Create:{Loaded:function(e){$("#user-create-form").hoodValidator({validationRules:{FirstName:{required:!0},LastName:{required:!0},UserName:{required:!0,email:!0},Password:{required:!0}},submitButtonTag:$("#user-create-submit"),submitUrl:$("#user-create-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Users.Reload()}})},GeneratePassword:function(){$(this).is(":checked")?($("#user-create-form #Password").val($.hood.Helpers.GenerateRandomString(0)),$("#user-create-form #Password").attr("type","text")):($("#user-create-form #Password").val(""),$("#user-create-form #Password").attr("type","password"))}},Edit:{ResetPassword:function(e){e.preventDefault();var o=$(this),s=function(e){return e!==!1&&(""===e?(swal.showInputError("You didn't supply a new password, we can't reset the password without it!"),!1):void $.post(o.attr("href"),{password:e},function(e){$.hood.Helpers.ProcessResponse(e)}))};$.hood.Alerts.Prompt("Please enter a new password for the user...","Reset password",s)},Notes:{Add:function(e){e.preventDefault();var o=$(this),s=function(e){return e===!1||""===e?(swal.showInputError("You enter anything!"),!1):void $.post(o.attr("href"),{note:e},function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Inline.Reload("#user-notes")})};$.hood.Alerts.Prompt("Enter and store a note about this user. These are internal, and are not shown to the user.","Add a note",s,"textarea")},Delete:function(e){e.preventDefault();var o=$(this),s=function(e){e?$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Inline.Reload("#user-notes")}):swal("Cancelled","It's all good in the hood!","error")};$.hood.Alerts.Confirm("Are you sure?","The note will be removed permanently.",s)}},ToggleRole:function(){$(this).is(":checked")?$.post($(this).data("url"),{role:$(this).val(),add:!0},function(e){$.hood.Helpers.ProcessResponse(e)}):$.post($(this).data("url"),{role:$(this).val(),add:!1},function(e){$.hood.Helpers.ProcessResponse(e)})}}},$(document).ready($.hood.Users.Init);
"use strict";$.hood||($.hood={}),$.hood.Users={Init:function(){$("body").on("click",".user-delete",$.hood.Users.Delete),$("body").on("click",".user-reset-password",$.hood.Users.Edit.ResetPassword),$("body").on("click",".user-notes-add",$.hood.Users.Edit.Notes.Add),$("body").on("click",".user-notes-delete",$.hood.Users.Edit.Notes.Delete),$("body").on("change","#user-create-form #GeneratePassword",$.hood.Users.Create.GeneratePassword),$("body").on("change",".user-role-check",$.hood.Users.Edit.ToggleRole)},Loaded:function(e,o){$.hood.Loader(!1)},Reload:function(e){$("#user-list").doesExist()&&$.hood.Inline.Reload($("#user-list"),e)},Delete:function(e){e.preventDefault();var o=$(this),s=function(e){e&&$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Users.Reload(),e.Success&&o&&o.data("redirect")&&($.hood.Alerts.Success("<strong>User deleted, redirecting...</strong><br />Just taking you back to the user list."),setTimeout(function(){window.location=o.data("redirect")},1500))})};$.hood.Alerts.Confirm("The user will be permanently removed, any site content will be reassigned to the ownership of the site owner, any user content (Forum Topics & Posts) will be deleted from the system and all associated media files.","Are you sure?",s,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong><br />This process will also cancel any active subscriptions.</span>')},Create:{Loaded:function(e){$("#user-create-form").hoodValidator({validationRules:{FirstName:{required:!0},LastName:{required:!0},UserName:{required:!0,email:!0},Password:{required:!0}},submitButtonTag:$("#user-create-submit"),submitUrl:$("#user-create-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Users.Reload()}})},GeneratePassword:function(){$(this).is(":checked")?($("#user-create-form #Password").val($.hood.Helpers.GenerateRandomString(0)),$("#user-create-form #Password").attr("type","text")):($("#user-create-form #Password").val(""),$("#user-create-form #Password").attr("type","password"))}},Edit:{ResetPassword:function(e){e.preventDefault();var o=$(this),s=function(e){return e!==!1&&(""===e?(swal.showInputError("You didn't supply a new password, we can't reset the password without it!"),!1):void $.post(o.attr("href"),{password:e},function(e){$.hood.Helpers.ProcessResponse(e)}))};$.hood.Alerts.Prompt("Please enter a new password for the user...","Reset password",s)},Notes:{Add:function(e){e.preventDefault();var o=$(this),s=function(e){return e===!1||""===e?(swal.showInputError("You enter anything!"),!1):void $.post(o.attr("href"),{note:e},function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Inline.Reload("#user-notes")})};$.hood.Alerts.Prompt("Enter and store a note about this user. These are internal, and are not shown to the user.","Add a note",s,"textarea")},Delete:function(e){e.preventDefault();var o=$(this),s=function(e){e?$.post(o.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Inline.Reload("#user-notes")}):swal("Cancelled","It's all good in the hood!","error")};$.hood.Alerts.Confirm("Are you sure?","The note will be removed permanently.",s)}},ToggleRole:function(){$(this).is(":checked")?$.post($(this).data("url"),{role:$(this).val(),add:!0},function(e){$.hood.Helpers.ProcessResponse(e)}):$.post($(this).data("url"),{role:$(this).val(),add:!1},function(e){$.hood.Helpers.ProcessResponse(e)})}}},$(document).ready($.hood.Users.Init);

@@ -1,2 +0,2 @@

"use strict";var console={};console.log=function(){},window.console=console,$.hood||($.hood={}),$.body=$("body");var console=window.console||{};console.log=console.log||function(){},console.warn=console.warn||function(){},console.error=console.error||function(){},console.info=console.info||function(){},$.fn.exists=function(){return $(this).length},$.fn.doesExist=function(){return $(this).length},$.fn.restrictToSlug=function(e){var t=$(this),o=e||/[^0-9a-zA-Z]*/g,n=function(){var e=$(this).val(),t=e.replace(o,"");e!==t&&$(this).val(t)};t.on("keyup",n),t.on("paste",n),t.on("change",n)},$(".restrict-to-slug").restrictToSlug(),$.fn.restrictToPageSlug=function(e){var t=$(this),o=e||/[^0-9a-zA-Z-\/\/]*/g,n=function(){var e=$(this).val(),t=e.replace(o,"");if((t.match(new RegExp("/","g"))||[]).length>4){var n=t.lastIndexOf("/");t=t.substring(0,n)+t.substring(n+1),$.hood.Alerts.Warning("You can only have up to 4 '/' characters in a url slug.")}e!==t&&$(this).val(t)};t.on("keyup",n),t.on("paste",n),t.on("change",n)},$(".restrict-to-page-slug").restrictToPageSlug(),$.fn.restrictToMetaSlug=function(e){var t=$(this),o=e||/[^0-9a-zA-Z.]*/g,n=function(){var e=$(this).val(),t=e.replace(o,"");if((t.match(new RegExp(".","g"))||[]).length>1){var n=t.lastIndexOf(".");t=t.substring(0,n)+t.substring(n+1),$.hood.Alerts.Warning("You can only have up to 1 '.' characters in a meta slug.")}e!==t&&$(this).val(t)};t.on("keyup",n),t.on("paste",n),t.on("change",n)},$(".restrict-to-meta-slug").restrictToMetaSlug(),$.fn.characterCounter=function(e){var t=$(this),o=function(){var e=$(this).data("counter"),t=Number($(this).attr("maxlength")),o=$(this).val().length;$(e).text(t-o);var n="text-success";t-o<t/10&&(n="text-danger"),$(e).parent().removeClass("text-success").removeClass("text-danger").addClass(n)};t.on("keyup",o),t.on("paste",o),t.on("change",o)},$(".character-counter").characterCounter(),$(".character-counter").trigger("change"),$.fn.addLoader=function(){$(this).data("loadercontent",$(this).html()),$(this).addClass("loading").append('<i class="fa fa-refresh fa-spin m-l-sm"></i>')},$.fn.removeLoader=function(){$(this).empty().html($(this).data("loadercontent")),$(this).removeClass("loading")},$.fn.warningAlert=function(){var e=$(this),t=function(e){e.preventDefault();var t=function(t){if(t){var o=$(e.currentTarget).attr("href");window.location=o}};return $.hood.Alerts.Confirm($(e.currentTarget).data("warning"),$(e.currentTarget).data("title"),t,"warning",$(e.currentTarget).data("footer"),"Ok","Cancel"),!1};e.on("click",t)},$(".warning-alert").warningAlert(),$.commonHeight=function(e,t){var o=0;e.children(t).each(function(){var e=$(this).children();e.hasClass("max-height")?o=e.outerHeight():e.outerHeight()>o&&(o=e.outerHeight())}),e.children(t).each(function(){$(this).height(o)})},$.loadCss=function(e,t){$("link#"+e).length||$("<link/>",{id:e,rel:"stylesheet",type:"text/css",href:t}).appendTo("head")},$.getUrlVars=function(){for(var e,t=[],o=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),n=0;n<o.length;n++)e=o[n].split("="),t.push(e[0]),t[e[0]]=e[1];return t},$.decodeUrl=function(e){return decodeURIComponent(e).replace("+"," ")},$.numberWithCommas=function(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},$.validator&&($.validator.addMethod("time",function(e,t){return this.optional(t)||/^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(:([0-5]?[0-9]))?$/i.test(e)},"Please enter a valid time."),$.validator.addMethod("ukdate",function(e,t){return e.match(/^\d\d?\/\d\d?\/\d\d\d\d$/)},"Please enter a date in the format dd/mm/yyyy.")),$.mobile={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},Any:function(){return $.mobile.Android()||$.mobile.BlackBerry()||$.mobile.iOS()||$.mobile.Opera()||$.mobile.Windows()}},$.mobile.Android?$.mobile.BlackBerry?$.mobile.iOS?$.mobile.Opera?$.mobile.Windows?($.body.addClass("desktop-device"),$.device="desktop"):($.body.addClass("windows-device"),$.device="windows"):($.body.addClass("opera-device"),$.device="opera"):($.body.addClass("ios-device"),$.device="ios"):($.body.addClass("blackberry-device"),$.device="blackberry"):($.body.addClass("android-device"),$.device="android"),function(){var e={password:"0",username:"0"};$("body").on("change",".prevent-autocomplete",function(t){var o=$(this).attr("id");"0"!==e[o]&&e[o]===$(this).val()||$(this).val("")}),$("body").on("keyup",".prevent-autocomplete",function(t){var o=$(this).attr("id");e[o]=$(this).val()})}(),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var o=document.createEvent("CustomEvent");return o.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),o}return"function"!=typeof window.CustomEvent&&(e.prototype=window.Event.prototype,void(window.CustomEvent=e))}(),$.hood.LinkClasses=[{title:"None",value:""},{title:"Button link",value:"btn btn-default"},{title:"Theme coloured button link",value:"btn btn-primary"},{title:"Popup image/video",value:"colorbox-iframe"},{title:"Button popup link",value:"btn btn-default colorbox-iframe"},{title:"Theme coloured button popup link",value:"btn btn-primary colorbox-iframe"},{title:"Large link",value:"font-lg"},{title:"Large button link",value:"btn btn-default btn-lg"},{title:"Large theme coloured button link",value:"btn btn-primary btn-lg"},{title:"Large popup image/video",value:"font-lg colorbox-iframe"},{title:"Large Button popup link",value:"btn btn-default btn-lg colorbox-iframe"},{title:"Theme coloured button popup link",value:"btn btn-primary btn-lg colorbox-iframe"}],$.hood.ImageClasses=[{title:"None",value:""},{title:"Full Width",value:"user-image full"},{title:"Left Aligned",value:"user-image left"},{title:"Centered",value:"user-image center"},{title:"Right Aligned",value:"user-image right"},{title:"Inline with text, top aligned",value:"user-image inline top"},{title:"Inline with text, middle aligned",value:"user-image inline"},{title:"Inline with text, bottom aligned",value:"user-image inline bottom"},{title:"Pulled Left",value:"user-image pull-left"},{title:"Pulled Right",value:"user-image pull-right"}],new CustomEvent("loader-show"),new CustomEvent("loader-hide"),$.hood.Loader=function(e){e?$("body").trigger("loader-show"):$("body").trigger("loader-hide")},$.hood||($.hood={}),$.hood.Helpers={IsNullOrUndefined:function(e){var t=!1;return null!==e&&"undefined"!=typeof e&&""!==e||(t=!0),t},IsSet:function(e){var t=!1;return null!==e&&"undefined"!=typeof e&&""!==e||(t=!0),!t},IsEventSupported:function(e){var t=document.createElement("div");e="on"+e;var o=e in t;return o||(t.setAttribute(e,"return;"),o="function"==typeof t[e]),t=null,o},IsFunction:function(e){return e&&"[object Function]"==={}.toString.call(e)},IsUrlExternal:function(e){var t=e.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof t[1]&&t[1].length>0&&t[1].toLowerCase()!==location.protocol||"string"==typeof t[2]&&t[2].length>0&&t[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host},IsInIframe:function(){try{return window.self!==window.top}catch(e){return!0}},HtmlEncode:function(e){return $("<div/>").text(e).html()},HtmlDecode:function(e){return $("<div/>").html(e).text()},FormatCurrency:function(e,t){return t+" "+e.toFixed(2).replace(/./g,function(e,t,o){return t>0&&"."!==e&&(o.length-t)%3===0?","+e:e})},FormatKilobytes:function(e){return e/=1024,e.toFixed(2).replace(/./g,function(e,t,o){return t>0&&"."!==e&&(o.length-t)%3===0?","+e:e})},FormatMegabytes:function(e){return e/=1024,e/=1024,currency+" "+e.toFixed(2).replace(/./g,function(e,t,o){return t>0&&"."!==e&&(o.length-t)%3===0?","+e:e})},ProcessResponse:function(e){var t="";e.Title&&(t="<strong>".concat(e.Title,"</strong><br />")),e.Success?$.hood.Alerts.Success("".concat(t).concat(e.Message)):$.hood.Alerts.Error("".concat(t).concat(e.Errors))},GetQueryStringParamByName:function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)","i"),o=t.exec(location.search);return null===o?"":decodeURIComponent(o[1].replace(/\+/g," "))},InsertQueryStringParam:function(e,t){e=escape(e),t=escape(t);var o=document.location.search.substr(1).split("&");if(""===o)document.location.search="?"+e+"="+t;else{for(var n,a=o.length;a--;)if(n=o[a].split("="),n[0]===e){n[1]=t,o[a]=n.join("=");break}a<0&&(o[o.length]=[e,t].join("=")),document.location.search=o.join("&")}},InsertQueryStringParamToUrl:function(e,t,o){t=escape(t),o=escape(o);var n=e.search.substr(1).split("&");if(""===n)e.search="?"+t+"="+o;else{for(var a,r=n.length;r--;)if(a=n[r].split("="),a[0]===t){a[1]=o,n[r]=a.join("=");break}r<0&&(n[n.length]=[t,o].join("=")),e.search=n.join("&")}return e},UrlToLocationObject:function(e){var t=document.createElement("a");return t.href=e,t},FindAndRemoveFromArray:function(e,t,o){$.each(e,function(n,a){a[t]===o&&e.splice(n,1)})},FindAndReturnFromArray:function(e,t,o){var n=null;return $.each(e,function(e,a){a[t]===o&&(n=a)}),n},LeftPad:function(e,t){for(var o=e+"";o.length<t;)o="0"+o;return o},DateAdd:function(e,t,o){var n=new Date(e);switch(t.toLowerCase()){case"year":n.setFullYear(n.getFullYear()+o);break;case"quarter":n.setMonth(n.getMonth()+3*o);break;case"month":n.setMonth(n.getMonth()+o);break;case"week":n.setDate(n.getDate()+7*o);break;case"day":n.setDate(n.getDate()+o);break;case"hour":n.setTime(n.getTime()+36e5*o);break;case"minute":n.setTime(n.getTime()+6e4*o);break;case"second":n.setTime(n.getTime()+1e3*o);break;default:n=void 0}return n},GenerateRandomString:function(e){var t="!@#$&*",o="abcdefghijklmnopqrstuvwxyz",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",a="0123456789",r=o+n+a,i=(t.pick(1)+o.pick(1)+n.pick(1)+r.pick(5,10)).shuffle();return i}},$.hood||($.hood={}),$.hood.Handlers={Init:function(){$("body").on("click",".select-text",$.hood.Handlers.SelectTextContent),$("body").on("click",".btn.click-select[data-target][data-value]",$.hood.Handlers.ClickSelect),$("body").on("click",".click-select.show-selected[data-target][data-value]",$.hood.Handlers.ClickSelect),$("body").on("click",".click-select:not(.show-selected)[data-target][data-value]",$.hood.Handlers.ClickSelectClean),$("body").on("click",".slide-link",$.hood.Handlers.SlideToAnchor),$("body").on("click",".scroll-target, .scroll-to-target",$.hood.Handlers.ScrollToTarget),$("body").on("click",".scroll-top, .scroll-to-top",$.hood.Handlers.ScrollToTop),$("body").on("change","input[type=checkbox][data-input]",$.hood.Handlers.CheckboxChange),$("body").on("change",".submit-on-change",$.hood.Handlers.SubmitOnChange),$("select[data-selected]").each($.hood.Handlers.SelectSetup),$("body").on("change",".inline-date",$.hood.Handlers.DateChange),$.hood.Handlers.Uploaders.Init(),$.hood.Handlers.ColorPickers()},ScrollToTop:function(e){return e&&e.preventDefault(),$("html, body").animate({scrollTop:0},800),!1},ScrollToTarget:function(e){e&&e.preventDefault();var t=$(this).attr("href").split("#")[0];if(t===window.location.pathname||""===t){var o=this.hash,n=$(o),a=$("header.header"),r=0;a&&(r=a.height()),$(this).data("offset")?$("html, body").stop().animate({scrollTop:n.offset().top-$(this).data("offset")},900,"swing"):$("html, body").stop().animate({scrollTop:n.offset().top-r},900,"swing")}},SubmitOnChange:function(e){e&&e.preventDefault(),$(this).parents("form").submit()},DateChange:function(e){e&&e.preventDefault();var t=$(this).parents(".hood-date").find(".date-output"),o=t.parents(".hood-date").find(".date-value").val(),n=/^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/;n.test(o)||(o="01/01/2001");var a=t.parents(".hood-date").find(".hour-value").val();$.isNumeric(a)||(a="00");var r=t.parents(".hood-date").find(".minute-value").val();$.isNumeric(r)||(r="00"),t.val(o+" "+a+":"+r+":00"),t.attr("value",o+" "+a+":"+r+":00")},CheckboxChange:function(e){e&&e.preventDefault();var t=new Array;$('input[data-input="'+$(this).data("input")+'"]').each(function(){$(this).is(":checked")&&t.push($(this).val())});var o="#"+$(this).data("input"),n=JSON.stringify(t);$(o).val(n)},SelectSetup:function(){$(this).data("selected");if("undefined"!==$(this).data("selected")&&""!==$(this).data("selected")){var e=String($(this).data("selected"));$(this).val(e)}},ClickSelect:function(){var e=$(this),t="#"+e.data("target");$(t).val(e.data("value")),$(t).trigger("change"),$('.click-select[data-target="'+e.data("target")+'"]').each(function(){$(this).html($(this).data("temp")).removeClass("active")}),$('.click-select[data-target="'+e.data("target")+'"][data-value="'+e.data("value")+'"]').each(function(){$(this).data("temp",$(this).html()).html("Selected").addClass("active")})},ClickSelectClean:function(){var e=$(this),t="#"+e.data("target");$(t).val(e.data("value")),$(t).trigger("change"),$('.click-select.clean[data-target="'+e.data("target")+'"]').each(function(){$(this).removeClass("active")}),$('.click-select.clean[data-target="'+e.data("target")+'"][data-value="'+e.data("value")+'"]').each(function(){$(this).addClass("active")})},SelectTextContent:function(){var e=$(this);e.select(),e.mouseup(function(){return e.unbind("mouseup"),!1})},SlideToAnchor:function(){var e=$("body").scrollTop(),t=$($.attr(this,"href")).offset().top;return $("html, body").animate({scrollTop:t},Math.abs(t-e)),!1},Uploaders:{Init:function(){($(".image-uploader").length||$(".gallery-uploader").length)&&($(".upload-progress-bar").hide(),$.getScript("/lib/dropzone/min/dropzone.min.js",$.proxy(function(){$(".image-uploader").each(function(){$.hood.Handlers.Uploaders.SingleImage($(this).attr("id"),$(this).data("json"))}),$(".gallery-uploader").each(function(){$.hood.Handlers.Uploaders.Gallery($(this).attr("id"),$(this).data("json"))})},this)))},RefreshImage:function(e){$("."+e.Class).css({"background-image":"url("+e.Image+")"}),$("."+e.Class).find("img").attr("src",e.Image)},SingleImage:function(e,t){e="#"+e;$(e);Dropzone.autoDiscover=!1;var o=new Dropzone(e,{url:$(e).data("url"),maxFiles:1,paramName:"file",parallelUploads:1,autoProcessQueue:!0,previewsContainer:!1,clickable:e});o.on("addedfile",function(){}),o.on("totaluploadprogress",function(t){$(".upload-progress-bar."+e.replace("#","")+" .progress-bar").css({width:t+"%"})}),o.on("sending",function(t){$(".upload-progress-bar."+e.replace("#","")).show(),$($(e).data("preview")).addClass("loading")}),o.on("queuecomplete",function(t){$(".upload-progress-bar."+e.replace("#","")).hide()}),o.on("success",function(n,a){a.Success?(a.Media&&($(t).val(JSON.stringify(a.Media)),$($(e).data("preview")).css({"background-image":"url("+a.Media.SmallUrl+")"}),$($(e).data("preview")).find("img").attr("src",a.Media.SmallUrl)),$.hood.Alerts.Success("New image added!")):$.hood.Alerts.Error("There was a problem adding the image: "+a.Error),o.removeFile(n),$($(e).data("preview")).removeClass("loading")})},Gallery:function(e){Dropzone.autoDiscover=!1;var t=document.querySelector(e+"-template");t.id="";var o=t.parentNode.innerHTML;t.parentNode.removeChild(t);var n=new Dropzone(e,{url:$(e).data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:o,paramName:"files",autoProcessQueue:!0,previewsContainer:"#previews",clickable:".fileinput-button",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!"});$(e+" .cancel").hide(),n.on("addedfile",function(t){$(t.previewElement.querySelector(".complete")).hide(),$(t.previewElement.querySelector(".cancel")).show(),$(e+" .cancel").show()}),n.on("totaluploadprogress",function(e){document.querySelector("#total-progress .progress-bar").style.width=e+"%"}),n.on("sending",function(e){document.querySelector("#total-progress").style.opacity="1"}),n.on("complete",function(e){$(e.previewElement.querySelector(".cancel")).hide(),$(e.previewElement.querySelector(".progress")).hide(),$(e.previewElement.querySelector(".complete")).show(),$.hood.Inline.Refresh(".gallery")}),n.on("queuecomplete",function(t){document.querySelector("#total-progress").style.opacity="0",$(e+" .cancel").hide()}),n.on("success",function(e,t){$.hood.Inline.Refresh(".gallery"),t.Success?$.hood.Alerts.Success("New images added!"):$.hood.Alerts.Error("There was a problem adding the profile image: "+t.Error)}),document.querySelector(".actions .cancel").onclick=function(){n.removeAllFiles(!0)}}},ColorPickers:function(){var e=function(e,t){var o=$(t._root.button).parent().data("target");$(t._root.button).css({"background-color":e.toHEXA().toString()});var n=t.getColor().toHEXA(),a="";for(i=n.length-1;i>=0;i--)a=n[i]+a;$(o).val("#"+a)},t=[];$(".color-picker").each(function(o,n){var a=Pickr.create({el:n.children[0],appClass:"custom-class",theme:"monolith",useAsButton:!0,defaultRepresentation:"HEXA",position:"bottom-end",components:{opacity:!0,hue:!0,interaction:{hex:!1,rgba:!1,hsva:!1,input:!0,clear:!0}}}).on("init",function(t){var o=$(t._root.button).parent().data("target"),n=$(o).val();$(o).on("click",$.proxy(function(){this.show()},t)),t.setColor(n),e(t.getColor(),t)}).on("clear",function(t){var o=$(t._root.button).parent().data("target");t.setColor("transparent"),e(t.getColor(),t),$(o).val("")}).on("change",e);t.push(a)})}},$(document).ready($.hood.Handlers.Init),String.prototype.contains=function(e){return this.indexOf(e)!==-1},String.prototype.pick=function(e,t){var o,n="";o="undefined"==typeof t?e:e+Math.floor(Math.random()*(t-e));for(var a=0;a<o;a++)n+=this.charAt(Math.floor(Math.random()*this.length));return n},String.prototype.shuffle=function(){var e,t,o=this.split(""),n=o.length;if(n)for(;--n;)t=Math.floor(Math.random()*(n+1)),e=o[t],o[t]=o[n],o[n]=e;return o.join("")},String.prototype.toSeoUrl=function(){var e=this.replace(/[^a-zA-Z0-9]/g," ").replace(/\s+/g,"-").toLowerCase();"-"===e.charAt(0)&&(e=e.substring(1));var t=e.length-1;return"-"===e.charAt(t)&&(e=e.substring(0,t)),e},$.hood||($.hood={}),$.hood.FormValidator=function(e,t){this.Options=$.extend({formTag:e,validationRules:null,validationMessages:{},placeBelow:!0,submitButtonTag:null,submitUrl:null,submitFunction:null,serializationFunction:function(){var e=$(this.formTag).serialize();return e}},t||{}),this.LoadValidation=function(){$.hood.Helpers.IsNullOrUndefined(this.Options.formTag)||($(this.Options.formTag).find("input, textarea, select").keypress($.proxy(function(e){if(13===e.which)return $.proxy(this.submitForm(),this),e.preventDefault(),!1},this)),$(this.Options.formTag).validate({submitHandler:function(e){e.preventDefault()},errorClass:this.Options.errorClass,focusInvalid:!1,rules:this.Options.validationRules,messages:this.Options.validationMessages}),$.hood.Helpers.IsNullOrUndefined(this.Options.submitButtonTag)||$(this.Options.submitButtonTag).click($.proxy(this.submitForm,this)))},this.submitForm=function(){$(this.Options.formTag).valid()&&(this.TempButtonContent=$(this.Options.submitButtonTag).removeClass("btn-primary").addClass("btn-default").html(),$(this.Options.submitButtonTag).removeClass("btn-primary").addClass("btn-default").html('<i class="fa fa-refresh fa-spin"></i>&nbsp;Loading...'),$(this.Options.formTag).find("input[type=checkbox]").each(function(){$(this).is(":checked")&&$(this).val("true")}),$.post(this.Options.submitUrl,this.Options.serializationFunction(),$.proxy(function(e){$(this.Options.submitButtonTag).removeClass("btn-default").addClass("btn-primary").html(this.TempButtonContent),this.Options.submitFunction(e)},this)))},this.LoadValidation(),this.Options.placeBelow&&$(this.Options.formTag).addClass("validation-below")},$.fn.hoodValidator=function(e){return this.each(function(){var t=$(this);if(!t.data("hoodValidator")){var o=new $.hood.FormValidator(this,e);t.data("hoodValidator",o)}})},$.hood||($.hood={}),$.hood.Addresses={Init:function(){$("body").on("click",".address-set-billing",$.hood.Addresses.SetBilling),$("body").on("click",".address-set-delivery",$.hood.Addresses.SetDelivery),$("body").on("click",".address-delete",$.hood.Addresses.Delete)},Lists:{Address:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#address-list").doesExist()&&$.hood.Inline.Reload($("#address-list"),e)}}},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload(),e.Success&&t&&t.data("redirect")&&($.hood.Alerts.Success("<strong>Address deleted, redirecting...</strong><br />Just taking you back to the address list."),setTimeout(function(){window.location=t.data("redirect")},1500))})};$.hood.Alerts.Confirm("The address will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},CreateOrEdit:function(){$.hood.Google.Addresses.InitAutocomplete(),$("#address-form").hoodValidator({validationRules:{Number:{required:!0},Address1:{required:!0},City:{required:!0},County:{required:!0},Postcode:{required:!0},Country:{required:!0}},submitButtonTag:$("#address-form-submit"),submitUrl:$("#address-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload(),e.Success&&$.hood.Inline.CloseModal()}})},SetBilling:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload()})};$.hood.Alerts.Confirm("The current billing address will be overwritten.","Are you sure?",o,"error")},SetDelivery:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload()})};$.hood.Alerts.Confirm("The current delivery address will be overwritten.","Are you sure?",o,"error")}},$(document).ready($.hood.Addresses.Init);var swalWithBootstrapButtons=Swal.mixin({customClass:{confirmButton:"btn btn-success btn-lg m-1 pl-4 pr-4",cancelButton:"btn btn-danger btn-lg m-1"},buttonsStyling:!1}),Toast=Swal.mixin({toast:!0,position:"top-end",showConfirmButton:!0});$.hood||($.hood={}),$.hood.Alerts={Error:function(e,t,o,n,a,r,i){o===!0?this.SweetAlert(e,t,"error",n,a,r,i):this.Alert(e,t,"error")},Warning:function(e,t,o,n,a,r,i){o===!0?this.SweetAlert(e,t,"warning",n,a,r,i):this.Alert(e,t,"warning")},Message:function(e,t,o,n,a,r,i){o===!0?this.SweetAlert(e,t,"info",n,a,r,i):this.Alert(e,t,"info")},Success:function(e,t,o,n,a,r,i){o===!0?this.SweetAlert(e,t,"success",n,a,r,i):this.Alert(e,t,"success")},Alert:function(e,t,o){Toast.fire({type:o||"info",html:e,title:t})},SweetAlert:function(e,t,o,n,a,r,i){swalWithBootstrapButtons.fire({title:t,html:e,type:o||"info",footer:n,showConfirmButton:a,timer:r}).then(function(e){e.dismiss||i(e)})},Confirm:function(e,t,o,n,a,r,i){swalWithBootstrapButtons.fire({title:t||"Woah!",html:e||"Are you sure you want to do this?",type:n||"warning",footer:a||'<span class="text-warning"><i class="fa fa-exclamation-triangle"></i> This cannot be undone.</span>',showCancelButton:!0,confirmButtonText:r||"Ok",cancelButtonText:i||"Cancel"}).then(function(e){e.dismiss||o(e.value)})},Prompt:function(e,t,o,n,a,r,i,s,d){swalWithBootstrapButtons.fire({input:n||"text",inputAttributes:d||{autocapitalize:"off"},title:t||"Enter a value",html:e||"Fill in the field and press Ok to continue.",type:a||"info",footer:r,showCancelButton:!0,confirmButtonText:i||"Ok",cancelButtonText:s||"Cancel"}).then(function(e){e.dismiss||o(e.value)})}},$.hood||($.hood={}),$.hood.Forms={Init:function(){$(".floating-label > label").each(function(){var e=$(this);e.parent().append(e)})},GetAllowedExtensions:function(e){switch(e){case"Image":return["png","jpg","jpeg","bmp","gif"];case"Document":return["doc","docx","pdf","rtf"];case"All":return""}},GetAllowedFiles:function(e){switch(e){case"Image":return"image/png,jpg,image/jpeg,image/gif";case"Document":return"application/msword,application/pdf,text/rtf";case"All":return""}}},$(document).ready($.hood.Forms.Init),$.hood||($.hood={}),$.hood.Inline={Tags:{},Init:function(){$(".hood-inline:not(.refresh)").each($.hood.Inline.Load),$("body").on("click",".hood-inline-task",$.hood.Inline.Task),$("body").on("click",".hood-modal",function(e){e.preventDefault(),$.hood.Inline.Modal($(this).attr("href"),$(this).data("complete"))}),$.hood.Inline.DataList.Init()},Refresh:function(e){$(e||".hood-inline").each($.hood.Inline.Load)},Load:function(){$.hood.Inline.Reload(this)},Reload:function(e,t){var o=$(e);o.addClass("loading"),t||(t=o.data("complete"));var n=o.data("url");$.get(n,$.proxy(function(e){$(this).html(e),$(this).removeClass("loading")},o)).done(function(){$.hood.Inline.RunComplete(t)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},CurrentModal:null,Modal:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o&&$.hood.Inline.CurrentModal&&$.hood.Inline.CurrentModal.modal("hide"),$.get(e,function(e){var t="#"+$(e).attr("id");$(e).addClass("hood-inline-modal"),$(t).length&&$(t).remove(),$("body").append(e),$.hood.Inline.CurrentModal=$(t),$(t).modal(),$(t).on("shown.bs.modal",function(){$(document).off("focusin.modal")}),$(t).on("hidden.bs.modal",function(e){$(this).remove()})}).done(function(){$.hood.Inline.RunComplete(t)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},CloseModal:function(){$.hood.Inline.CurrentModal&&$.hood.Inline.CurrentModal.modal("hide")},Task:function(e){e.preventDefault();var t=$(e.currentTarget);t.addClass("loading"),complete=t.data("complete"),$.get(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),e.Success&&t&&t.data("redirect")&&setTimeout(function(){window.location=t.data("redirect")},1500),t.removeClass("loading")}).done(function(){$.hood.Inline.RunComplete(complete)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},DataList:{Init:function(){$(".hood-inline-list.query").each(function(){$(this).data("url",$(this).data("url")+window.location.search)}),$(".hood-inline-list:not(.refresh)").each($.hood.Inline.Load),$("body").on("click",".hood-inline-list .pagination a",function(e){e.preventDefault(),$.hood.Loader(!0);var t=document.createElement("a");t.href=$(this).attr("href");var o=$(this).parents(".hood-inline-list"),n=document.createElement("a");n.href=o.data("url"),n.search=t.search,$.hood.Inline.DataList.Reload(o,n)}),$("body").on("submit",".hood-inline-list form",function(e){e.preventDefault(),$.hood.Loader(!0);var t=$(this),o=t.parents(".hood-inline-list"),n=document.createElement("a");n.href=o.data("url"),n.search="?"+t.serialize(),$.hood.Inline.DataList.Reload(o,n)}),$("body").on("submit","form.inline",function(e){e.preventDefault(),$.hood.Loader(!0);var t=$(this),o=$(t.data("target")),n=document.createElement("a");n.href=o.data("url"),n.search="?"+t.serialize(),$.hood.Inline.DataList.Reload(o,n)}),$("body").on("change","form.inline .refresh-on-change, .hood-inline-list form",function(e){e.preventDefault(),$.hood.Loader(!0);var t=$(this).parents("form"),o=$(t.data("target")),n=document.createElement("a");n.href=o.data("url"),n.search="?"+t.serialize(),$.hood.Inline.DataList.Reload(o,n)})},Reload:function(e,t){if(history.pushState&&e.hasClass("query")){var o=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+t.href.substring(t.href.indexOf("?")+1);window.history.pushState({path:o},"",o)}e.data("url",$.hood.Helpers.InsertQueryStringParamToUrl(t,"inline","true")),$.hood.Inline.Reload(e)}},HandleError:function(e){500===e.status?$.hood.Alerts.Error("<strong>Error "+e.status+"</strong><br />There was an error processing the content, please contact an administrator if this continues.<br/>"):404===e.status?$.hood.Alerts.Error("<strong>Error "+e.status+"</strong><br />The content could not be found.<br/>"):401===e.status&&($.hood.Alerts.Error("<strong>Error "+e.status+"</strong><br />You are not allowed to view this resource, are you logged in correctly?<br/>"),window.location=window.location)},Finish:function(e){$.hood.Loader(!1)},RunComplete:function RunComplete(complete){if(!$.hood.Helpers.IsNullOrUndefined(complete)){var func=eval(complete);"function"==typeof func&&func()}}},$(document).ready($.hood.Inline.Init),$.hood.Modals={Open:$.hood.Inline.Modal},$.hood||($.hood={}),$.hood.Media={Init:function(){$("body").on("click",".media-delete",$.hood.Media.Delete),$("body").on("click",".media-directories-delete",$.hood.Media.Directories.Delete),$.hood.Media.Upload.Init(),$.hood.Media.Actions.Init()},Loaded:function(e){$.hood.Loader(!1)},BladeLoaded:function(e){$.hood.Media.LoadMediaPlayers()},Reload:function(e){$.hood.Inline.Reload($("#media-list"),e)},ReloadDirectories:function(e){$.hood.Inline.Reload($("#media-directories-list"),e)},Actions:{Init:function(){$("body").on("click",".hood-image-attach",$.hood.Media.Actions.Load.Attach),$("body").on("click",".hood-image-clear",$.hood.Media.Actions.Complete.Clear),$("body").on("click",".hood-image-insert",$.hood.Media.Actions.Load.Insert),$("body").on("click",".hood-media-select",$.hood.Media.Actions.Load.Select)},Target:null,Json:null,Current:{Attach:null},Load:{Attach:function(e){e.preventDefault(),$.hood.Media.Actions.Target=$($(this).data("tag")),$.hood.Media.Actions.Json=$($(this).data("json")),$.hood.Inline.Modal($(this).data("url"),function(){$.hood.Media.Reload(function(){$("body").off("click",".media-attach"),$("body").on("click",".media-attach",$.hood.Media.Actions.Complete.Attach)}),$.hood.Media.Upload.Init()})},Insert:function(e){var t=$("#"+e.id);t.data("imagesUrl")&&e.addButton("hoodimage",{text:"Insert image...",icon:!1,onclick:$.proxy(function(t){$.hood.Inline.Modal($(this).data("imagesUrl"),function(){$.hood.Media.Reload(function(){$("body").off("click"),$("body").on("click",".media-insert",$.proxy($.hood.Media.Actions.Complete.Insert,e))}),$.hood.Media.Upload.Init()})},t)})},Select:function(e){$.hood.Media.Actions.Target=$($(this).data("target")),$.hood.Inline.Modal($(this).data("url"),function(){$.hood.Media.Reload(function(){$("body").off("click",".media-select"),$("body").on("click",".media-select",$.hood.Media.Actions.Complete.Select)}),$.hood.Media.Upload.Init()})}},Complete:{Attach:function(e){e.preventDefault();var t=$.hood.Media.Actions.Target,o=$.hood.Media.Actions.Json;$.post($(this).data("url"),function(e){if($.hood.Helpers.ProcessResponse(e),e.Success){var n=e.Media.Icon;"Image"===e.Media.GeneralFileType&&(n=e.Media.MediumUrl),$.hood.Helpers.IsNullOrUndefined(t)||(t.css({"background-image":"url("+n+")"}),t.find("img").attr("src",n),t.removeClass("loading")),$.hood.Helpers.IsNullOrUndefined(o)||o.val(e.MediaJson)}}).done(function(){$("#media-select-modal").modal("hide")}).fail($.hood.Inline.HandleError)},Insert:function(e){var t=$(e.target),o=this;o.insertContent('<img alt="'+t.data("title")+'" src="'+t.data("url")+'"/>'),$.hood.Inline.CloseModal()},Select:function(e){var t=$(this).data("url"),o=$.hood.Media.Actions.Target;$(o).each(function(){$(this).is("input")?$(this).val(t):($(this).attr("src",t),$(this).css({"background-image":"url("+t+")"}),$(this).find("img").attr("src",t))}),$.hood.Alerts.Success("Image URL has been inserted.<br /><strong>Remember to press save!</strong>"),$("#media-select-modal").modal("hide")},Clear:function(e){e.preventDefault();var t=$($(this).data("tag")),o=$($(this).data("json"));$.post($(this).data("url"),function(e){$.hood.Helpers.ProcessResponse(e),e.Success&&(icon=e.Media.Icon,"Image"===e.Media.GeneralFileType&&(icon=e.Media.MediumUrl),$.hood.Helpers.IsNullOrUndefined(t)||(t.css({"background-image":"url("+icon+")"}),t.find("img").attr("src",icon),t.removeClass("loading")),$.hood.Helpers.IsNullOrUndefined(o)||o.val(e.Json))}).fail($.hood.Inline.HandleError)}},RefreshImage:function(e,t,o){
var n=$(e);n.addClass("loading"),$.get(t,{id:o},$.proxy(function(e){n.css({"background-image":"url("+e.SmallUrl+")"}),n.find("img").attr("src",e.SmallUrl),n.removeClass("loading")},this))}},Upload:{Init:function(){if($("#media-add").doesExist()){$("#media-total-progress").hide(),Dropzone.autoDiscover=!1;var e=new Dropzone("#media-upload",{url:$.hood.Media.Upload.UploadUrl,thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:!1,paramName:"files",autoProcessQueue:!0,previewsContainer:!1,clickable:"#media-add",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!"});e.on("success",function(e,t){$.hood.Helpers.ProcessResponse(t)}),e.on("addedfile",function(e){$("#media-total-progress .progress-bar").css({width:"0%"}),$("#media-total-progress .progress-bar .percentage").html("0%")}),e.on("totaluploadprogress",function(e){$("#media-total-progress .progress-bar").css({width:e+"%"}),$("#media-total-progress .progress-bar .percentage").html(e+"%")}),e.on("sending",function(e){$("#media-total-progress").fadeIn(),$("#media-total-progress .progress-bar").css({width:"0%"}),$("#media-total-progress .progress-bar .percentage").html("0%")}),e.on("complete",function(e){$.hood.Media.Reload()}),e.on("queuecomplete",function(e){$("#media-total-progress").hide(),$.hood.Media.Reload()})}},UploadUrl:function(){return $("#media-upload").data("url")+"?directoryId="+$("input[type='radio'][name='dir']:checked").val()}},Delete:function(e){var t=$(this),o=function(e){e&&$.post("/admin/media/delete",{id:t.data("id")},function(e){$.hood.Helpers.ProcessResponse(e),e.Success&&($.hood.Media.Reload(),$(".modal-backdrop").remove(),$(".modal").modal("hide"))})};$.hood.Alerts.Confirm("The media file will be permanently removed. This cannot be undone.","Are you sure?",o,"warning",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> Ensure this file is not attached to any posts, pages or features of the site, or it will appear as a broken image or file.</span>',"Ok","Cancel")},RestrictDir:function(){var e=/[^0-9A-Za-z- ]*/g,t=$(this).val(),o=t.replace(e,"");t!==o&&$(this).val(o)},Directories:{Editor:function(){$("#content-directories-edit-form").hoodValidator({validationRules:{DisplayName:{required:!0},Slug:{required:!0}},submitButtonTag:$("#content-directories-edit-submit"),submitUrl:$("#content-directories-edit-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Media.ReloadDirectories(),$.hood.Media.Reload()}})},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Media.ReloadDirectories(),$.hood.Media.Reload()})};$.hood.Alerts.Confirm("The directory and all files will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle mr-2"></i><strong>This cannot be undone!</strong><br />Ensure these files are not attached to any posts, pages or features of the site, or it will appear as a broken image or file.</span>')}},Players:{},LoadMediaPlayers:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".hood-media",t={techOrder:["azureHtml5JS","flashSS","html5FairPlayHLS","silverlightSS","html5"],nativeControlsForTouch:!1,controls:!0,autoplay:!1,seeking:!0};$(e).each(function(){try{if(player=$.hood.Media.Players[$(this).data("id")],player)try{player.dispose()}catch(e){console.log("There was a problem disposing the old media player: ".concat(e))}$.hood.Media.Players[$(this).data("id")]=amp($(this).attr("id"),t),player=$.hood.Media.Players[$(this).data("id")],player.src([{src:$(this).data("file"),type:$(this).data("type")}])}catch(e){console.log("There was a problem playing the media file: ".concat(e))}})}},$(document).ready($.hood.Media.Init),$.hood||($.hood={}),$.hood.Cart={Init:function(){$("#CheckoutProgress").fadeOut(),$("body").on("click",".cart-add",$.hood.Cart.Add),$("body").on("click",".cart-clear",$.hood.Cart.Clear),$("body").on("click",".cart-update",$.hood.Cart.Update),$("body").on("click",".cart-remove",$.hood.Cart.Remove),$("body").on("change",".delivery-select",function(){$("#DeliveryAddressId").val($(this).val())}),$("body").on("change",".billing-select",function(){$("#BillingAddressId").val($(this).val())})},Add:function(e){$(this).data("temp",$(this).html()),$(this).addClass("btn-loading").append('<i class="fa fa-refresh fa-spin m-l-xs"></i>'),$.post("/cart/add",{productID:$(this).data("id"),qty:1},function(e){$(".btn-loading").each(function(){$(this).removeClass("btn-loading").html($(this).data("temp"))}),e.Success?($.hood.Alerts.Success("Added to your cart!"),$.hood.Cart.ReloadMiniCart()):($.hood.Alerts.Error("Couldn't add to your cart..."),$.hood.Cart.ReloadMiniCart())}),e.preventDefault()},Update:function(e){$.post("/cart/update",{productID:$(this).data("id"),qty:$(this).data("change")},function(e){e.Success?($.hood.Alerts.Success("Your shopping cart has been updated!"),$.hood.Cart.ReloadMiniCart()):$.hood.Alerts.Error("Couldn't update your cart...")}),e.preventDefault()},Remove:function(e){$.post("/cart/remove",{productID:$(this).data("id")},function(e){e.Success?($.hood.Alerts.Success("Your shopping cart has been updated!"),$.hood.Cart.ReloadMiniCart()):$.hood.Alerts.Error("Couldn't update your cart...")}),e.preventDefault()},Clear:function(e){$.post("/cart/clear",{},function(e){e.Success?($.hood.Alerts.Success("Your shopping cart has been cleared!"),$.hood.Cart.ReloadMiniCart()):$.hood.Alerts.Error("Couldn't clear your cart...")}),e.preventDefault()},ReloadMiniCart:function(e){$(".hood-inline-cart").each(function(){$.hood.Inline.Reload(this)})}},$.hood.Cart.Init(),$.hood||($.hood={}),$.hood.Stripe={Init:function(){$("body").on("click",".payment-method-setdefault",$.hood.Stripe.PaymentMethods.SetDefault),$("body").on("click",".payment-method-delete",$.hood.Stripe.PaymentMethods.Delete),$("#card-add-form").doesExist()&&$.hood.Stripe.PaymentMethods.Add(),$("#buy-plan-form").doesExist()&&$.hood.Stripe.Subscriptions.Buy()},Lists:{PaymentMethods:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#payment-method-list").doesExist()&&$.hood.Inline.Reload($("#payment-method-list"),e)}}},PaymentMethods:{Stripe:null,CardElement:null,Add:function(){$.hood.Stripe.PaymentMethods.Stripe=Stripe($("#card-add-form").data("stripe"));var e=$.hood.Stripe.PaymentMethods.Stripe.elements();$.hood.Stripe.PaymentMethods.CardElement=e.create("card"),$.hood.Stripe.PaymentMethods.CardElement.mount("#card-add-element"),$("#card-add-form").validate({rules:{CardholderName:"required"}}),$("body").on("click","#card-add-submit",$.hood.Stripe.PaymentMethods.SubmitCardForm)},SubmitCardForm:function(e){return e.preventDefault(),$("#card-add-consent").is(":checked")?void($("#card-add-form").valid()&&!$("#card-add-submit").hasClass("processing")&&($.hood.Stripe.PaymentMethods.ToggleButton(!0),$.hood.Stripe.PaymentMethods.Stripe.handleCardSetup($("#card-add-submit").data("secret"),$.hood.Stripe.PaymentMethods.CardElement,{payment_method_data:{billing_details:{name:$("#card-add-cardholdername").val()}}}).then(function(e){e.error?($.hood.Stripe.PaymentMethods.ShowError(response.error),$.hood.Stripe.PaymentMethods.ToggleButton(!1)):($.hood.Stripe.PaymentMethods.ShowSuccess("Confirming your card..."),$.hood.Stripe.PaymentMethods.ConfirmIntent(e))}))):($.hood.Stripe.PaymentMethods.ShowError("You cannot add a card without agreeing to the customer agreement."),void $.hood.Stripe.PaymentMethods.ToggleButton(!1))},HandleServerResponse:function(e){e.error?($.hood.Stripe.PaymentMethods.ShowError(e.error),$.hood.Stripe.PaymentMethods.ToggleButton(!1)):e.requires_action?($.hood.Stripe.PaymentMethods.ShowError("We require confirmation from your card issuer to continue..."),$.hood.Stripe.PaymentMethods.Stripe.handleCardAction(e.payment_intent_client_secret).then(function(e){e.error?($.hood.Stripe.PaymentMethods.ShowError(e.error),$.hood.Stripe.PaymentMethods.ToggleButton(!1)):($.hood.Stripe.PaymentMethods.ShowSuccess("Confirming your card..."),$.hood.Stripe.PaymentMethods.ConfirmIntent(e))})):($.hood.Stripe.PaymentMethods.ShowSuccess("Card added successfully, please wait..."),$.hood.Stripe.PaymentMethods.ToggleButton(!1),$.hood.Stripe.Lists.PaymentMethods.Reload(),$.hood.Inline.CloseModal())},ConfirmIntent:function(e){fetch($("#card-add-submit").data("url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Id:e.setupIntent.id})}).then(function(e){return e.json().then($.hood.Stripe.PaymentMethods.HandleServerResponse)})},ToggleButton:function(e){e?($("#card-add-submit").addClass("processing"),$("#card-add-submit").html('<i class="fa fa-spin fa-sync-alt"></i>&nbsp;Processing...')):($("#card-add-submit").removeClass("processing"),$("#card-add-submit").html("Add card to wallet"))},SetDefault:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Stripe.Lists.PaymentMethods.Reload(),$(".card-modal").modal("hide")})};$.hood.Alerts.Confirm("The card will be used for all transactions from this point onwards.","Are you sure?",o,"warning",'<span class="text-info"><i class="fa fa-exclamation-triangle"></i> <strong>You can change this at any time.</strong></span>')},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Stripe.Lists.PaymentMethods.Reload(),$(".card-modal").modal("hide")})};$.hood.Alerts.Confirm("The card will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},ShowError:function(e){$("#card-add-success").html(""),e.message?$("#card-add-errors").html(e.message):$("#card-add-errors").html(e)},ShowSuccess:function(e){$("#card-add-errors").html(""),$("#card-add-success").html(e)}},Subscriptions:{Stripe:null,CardElement:null,Buy:function(){$("body").on("change",".buy-plan-method",$.hood.Stripe.Subscriptions.ToggleNewCardForm),$.hood.Stripe.Subscriptions.Stripe=Stripe($("#buy-plan-form").data("stripe"));var e=$.hood.Stripe.Subscriptions.Stripe.elements();$.hood.Stripe.Subscriptions.CardElement=e.create("card"),$.hood.Stripe.Subscriptions.CardElement.mount("#buy-plan-element"),$.hood.Stripe.Subscriptions.CardElement.addEventListener("change",function(e){e.error?$.hood.Stripe.Subscriptions.ShowError(result.error):$.hood.Stripe.Subscriptions.ShowError("")}),$("#buy-plan-form").validate({rules:{CardholderName:"required"}}),$("body").on("click","#buy-plan-submit",$.hood.Stripe.Subscriptions.CompletePurchase)},CompletePurchase:function(e){var t=$("input[name='buy-plan-method']:checked").val();return t?$("#buy-plan-consent").is(":checked")?"new-card"===t?$.hood.Stripe.Subscriptions.BuyWithNewCard(e):$.hood.Stripe.Subscriptions.BuyWithExisting(e):($.hood.Stripe.Subscriptions.ShowError("You cannot purchase a subscription without agreeing to the customer agreement."),void $.hood.Stripe.Subscriptions.ToggleButton(!1)):($.hood.Stripe.Subscriptions.ShowError("You have to select a payment method to continue with your purchase."),void $.hood.Stripe.Subscriptions.ToggleButton(!1))},ToggleNewCardForm:function(e){var t=$("input[name='buy-plan-method']:checked").val();"new-card"===t?$("#buy-plan-add-card-form").slideDown():$("#buy-plan-add-card-form").slideUp(),$.hood.Stripe.Subscriptions.ShowError("")},BuyWithExisting:function(e){e.preventDefault(),$("#buy-plan-submit").hasClass("processing")?$.hood.Stripe.Subscriptions.ToggleButton(!1):($.hood.Stripe.Subscriptions.ToggleButton(!0),fetch($("#buy-plan-submit").data("url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({PlanId:$("#buy-plan-id").val(),PaymentMethodId:$("input[name='buy-plan-method']:checked").val()})}).then(function(e){return e.json()}).then($.hood.Stripe.Subscriptions.HandleServerResponse))},BuyWithNewCard:function(e){e.preventDefault(),$("#buy-plan-form").valid()&&!$("#buy-plan-submit").hasClass("processing")?($.hood.Stripe.Subscriptions.ToggleButton(!0),$.hood.Stripe.Subscriptions.Stripe.createToken($.hood.Stripe.Subscriptions.CardElement).then(function(e){e.error?($.hood.Stripe.Subscriptions.ShowError(e.error),$.hood.Stripe.Subscriptions.ToggleButton(!1)):($.hood.Stripe.PaymentMethods.ShowSuccess("Confirming your card..."),fetch($("#buy-plan-submit").data("url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({PlanId:$("#buy-plan-id").val(),Token:e.token.id})}).then(function(e){return e.json()}).then($.hood.Stripe.Subscriptions.HandleServerResponse))})):$.hood.Stripe.Subscriptions.ToggleButton(!1)},HandleServerResponse:function(e){e.error?($.hood.Stripe.Subscriptions.ShowError(e.error),$.hood.Stripe.Subscriptions.ToggleButton(!1)):e.requires_action?$.hood.Stripe.Subscriptions.Stripe.handleCardPayment(e.payment_intent_client_secret).then(function(e){e.error?($.hood.Stripe.Subscriptions.ShowError(e.error),$.hood.Stripe.Subscriptions.ToggleButton(!1)):($.hood.Stripe.PaymentMethods.ShowSuccess("Confirming your card..."),$.hood.Stripe.Subscriptions.ConfirmIntent(e))}):($.hood.Stripe.Subscriptions.ShowSuccess("Subscription created successfully, please wait..."),$.hood.Stripe.Subscriptions.ToggleButton(!1),e.url&&(window.location=e.url))},ConfirmIntent:function(e){fetch($("#buy-plan-submit").data("url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({PlanId:$("#buy-plan-id").val(),IntentId:e.paymentIntent.id})}).then(function(e){return e.json().then($.hood.Stripe.Subscriptions.HandleServerResponse)})},ToggleButton:function(e){e?($("#buy-plan-submit").addClass("processing"),$("#buy-plan-submit").html('<i class="fa fa-spin fa-sync-alt"></i>&nbsp;Processing...')):($("#buy-plan-submit").removeClass("processing"),$("#buy-plan-submit").html("Confirm &amp; Pay"))},ShowError:function(e){$("#buy-plan-success").html(""),e.message?$("#buy-plan-errors").html(e.message):$("#buy-plan-errors").html(e)},ShowSuccess:function(e){$("#buy-plan-errors").html(""),$("#buy-plan-success").html(e)}}},$.hood.Stripe.Init(),$.window=$(window),$.hood||($.hood={}),$.hood.App={Options:{Header:{Target:"#header",Sticky:!0,StickyClass:"sticky-header"},Alerts:!0,Colorbox:!0,ContactForms:!0,Forums:!0,PaymentPages:!0,RichTextEditors:$(".tinymce-public").length},Init:function(e){$.hood.App.Options=$.extend($.hood.App.Options,e||{}),e&&e.Header&&($.hood.App.Options.Header=$.extend($.hood.App.Options.Header,e.Header||{})),$.hood.App.Header.Init(),$.hood.App.Options.PaymentPages&&$.hood.App.PaymentPages.Init(),$.hood.App.Options.FitVids&&$.hood.App.ResizeVideos(),$.hood.App.Options.ContactForms&&$.hood.App.ContactForms.Init(),$.hood.App.Options.Colorbox&&$.hood.App.Colorbox(),$.hood.App.Options.LoadSharers&&$.hood.App.Sharers(),$.hood.App.Options.RichTextEditors&&$.hood.App.RichTextEditors()},Ready:function(){$.hood.App.Init(),$.hood.App.Resize()},Load:function(){},Resize:function(){},Header:{Init:function(){$.hood.App.Options.Header.Sticky&&($.hood.App.Header.StickyMenu(),$.window.on("scroll",function(){$.hood.App.Header.StickyMenu()}))},StickyMenu:function(){var e=0,t=$($.hood.App.Options.Header.Target);t.length>0&&(e=t.offset().top);var o=t.height(),n=$.window.height()+2*o,a=$(document).height();$.window.scrollTop()>e&&a>n?t.addClass($.hood.App.Options.Header.StickyClass):$.hood.App.Header.RemoveStickyness()},RemoveStickyness:function(){var e=$($.hood.App.Options.Header.Target);e.hasClass($.hood.App.Options.Header.StickyClass)&&e.removeClass($.hood.App.Options.Header.StickyClass)}},ContactForms:{Init:function(){$(".contact-form .thank-you").hide(),$(".contact-form .form-submit").show(),$("body").on("submit",".contact-form",function(e){return e.preventDefault(),$(this).addClass("loading"),$.hood.App.ContactForms.Submit(this),!1})},Submit:function(e){var t=$(e);return t.valid()&&$.post(t.attr("action"),t.serialize(),function(e){e.Success?(t.attr("data-redirect")&&(window.location=t.attr("data-redirect")),t.attr("data-alert-message")&&$.hood.Alerts.Success(t.attr("data-alert-message"),"Success",null,!0),t.find(".form").hide(),t.find(".thank-you").show()):t.attr("data-alert-error")?$.hood.Alerts.Error(t.attr("data-alert-error"),"Error",null,!0):$.hood.Alerts.Error("There was an error sending the message: "+e.Errors,"Error",null,!0),t.removeClass("loading")}),!1}},Alerts:function(){$(".alert.auto-dismiss").fadeTo(5e3,500).slideUp(500,function(){$(".alert.auto-dismiss").slideUp(500)})},Colorbox:function(){$(".colorbox").colorbox({rel:"gallery",maxWidth:"95%",maxHeight:"95%"}),$(".colorbox-iframe").colorbox({iframe:!0,maxWidth:"95%",maxHeight:"95%",innerWidth:640,innerHeight:390})},Forums:{Init:function(){var e=$.getUrlVars().highlight;if($.isNumeric(e)){var t=$("#post-"+e);$("html,body").animate({scrollTop:t.offset().top},"slow"),t.addClass("highlight"),"Created"===$.getUrlVars().message&&t.addClass("created")}var o=$.getUrlVars().reply;if($.isNumeric(o)){var n=$("#forum-post-form");$("html,body").animate({scrollTop:n.offset().top},"slow")}$(".forum").on("click",".edit-post",function(e){$(this).parents(".post").find(".post-view").slideToggle(),$(this).parents(".post").find(".edit-view").slideToggle()})}},ResizeVideos:function(){return $().fitVids?void $("body").fitVids({customSelector:"iframe[src^='http://www.dailymotion.com/embed'], iframe[src*='maps.google.com'], iframe[src*='google.com/maps']",ignore:".no-fv"}):(console.log("resizeVideos: FitVids not Defined."),!0)},PaymentPages:{Init:function(){$("body").on("click",".btn.price-select[data-target][data-value]",$.hood.App.PaymentPages.PriceSelect),$("body").on("click",".change-price-option",$.hood.App.PaymentPages.ChangePrice)},ChangePrice:function(){$("#price-panel").collapse("show"),$("#billing-panel").collapse("hide"),$("#confirm-panel").collapse("hide")},PriceSelect:function(){var e=$(this);targetId="#"+e.data("target"),$(targetId).val(e.data("value")),$(".selected-price-text").html($(targetId).find(":selected").text()),$('.price-select[data-target="'+e.data("target")+'"]').each(function(){$(this).html($(this).data("temp")).removeClass("active")}),$('.price-select[data-target="'+e.data("target")+'"][data-value="'+e.data("value")+'"]').each(function(){$(this).data("temp",$(this).html()).html("Selected").addClass("active")}),$("#price-panel").collapse("hide"),$("#billing-panel").collapse("show"),$("#confirm-panel").collapse("hide")}},RichTextEditors:function(){tinymce.init({selector:".tinymce-public",height:250,plugins:["advlist autolink lists link image charmap print preview anchor media","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste emoticons"],menubar:!1,toolbar:"styleselect | bold italic | bullist numlist outdent indent | undo redo | link image media emoticons",image_dimensions:!1,body_class:"tiny-mce-body",content_css:"/css/site.css"})},Property:{Loaded:function(e){$.hood.Loader(!1),$.hood.Google.ClusteredMap()},Reload:function(e){$("#property-list").doesExist()&&$.hood.Inline.Reload($("#property-list"),e)}}},$(function(){$.hood.App.Ready()}),$(window).on("load",$.hood.App.Load),$(window).on("resize",$.hood.App.Resize);
"use strict";var console={};console.log=function(){},window.console=console,$.hood||($.hood={}),$.body=$("body");var console=window.console||{};console.log=console.log||function(){},console.warn=console.warn||function(){},console.error=console.error||function(){},console.info=console.info||function(){},$.fn.exists=function(){return $(this).length},$.fn.doesExist=function(){return $(this).length},$.fn.restrictToSlug=function(e){var t=$(this),o=e||/[^0-9a-zA-Z]*/g,n=function(){var e=$(this).val(),t=e.replace(o,"");e!==t&&$(this).val(t)};t.on("keyup",n),t.on("paste",n),t.on("change",n)},$(".restrict-to-slug").restrictToSlug(),$.fn.restrictToPageSlug=function(e){var t=$(this),o=e||/[^0-9a-zA-Z-\/\/]*/g,n=function(){var e=$(this).val(),t=e.replace(o,"");if((t.match(new RegExp("/","g"))||[]).length>4){var n=t.lastIndexOf("/");t=t.substring(0,n)+t.substring(n+1),$.hood.Alerts.Warning("You can only have up to 4 '/' characters in a url slug.")}e!==t&&$(this).val(t)};t.on("keyup",n),t.on("paste",n),t.on("change",n)},$(".restrict-to-page-slug").restrictToPageSlug(),$.fn.restrictToMetaSlug=function(e){var t=$(this),o=e||/[^0-9a-zA-Z.]*/g,n=function(){var e=$(this).val(),t=e.replace(o,"");if((t.match(new RegExp(".","g"))||[]).length>1){var n=t.lastIndexOf(".");t=t.substring(0,n)+t.substring(n+1),$.hood.Alerts.Warning("You can only have up to 1 '.' characters in a meta slug.")}e!==t&&$(this).val(t)};t.on("keyup",n),t.on("paste",n),t.on("change",n)},$(".restrict-to-meta-slug").restrictToMetaSlug(),$.fn.characterCounter=function(e){var t=$(this),o=function(){var e=$(this).data("counter"),t=Number($(this).attr("maxlength")),o=$(this).val().length;$(e).text(t-o);var n="text-success";t-o<t/10&&(n="text-danger"),$(e).parent().removeClass("text-success").removeClass("text-danger").addClass(n)};t.on("keyup",o),t.on("paste",o),t.on("change",o)},$(".character-counter").characterCounter(),$(".character-counter").trigger("change"),$.fn.addLoader=function(){$(this).data("loadercontent",$(this).html()),$(this).addClass("loading").append('<i class="fa fa-refresh fa-spin m-l-sm"></i>')},$.fn.removeLoader=function(){$(this).empty().html($(this).data("loadercontent")),$(this).removeClass("loading")},$.fn.warningAlert=function(){var e=$(this),t=function(e){e.preventDefault();var t=function(t){if(t){var o=$(e.currentTarget).attr("href");window.location=o}};return $.hood.Alerts.Confirm($(e.currentTarget).data("warning"),$(e.currentTarget).data("title"),t,"warning",$(e.currentTarget).data("footer"),"Ok","Cancel"),!1};e.on("click",t)},$(".warning-alert").warningAlert(),$.commonHeight=function(e,t){var o=0;e.children(t).each(function(){var e=$(this).children();e.hasClass("max-height")?o=e.outerHeight():e.outerHeight()>o&&(o=e.outerHeight())}),e.children(t).each(function(){$(this).height(o)})},$.loadCss=function(e,t){$("link#"+e).length||$("<link/>",{id:e,rel:"stylesheet",type:"text/css",href:t}).appendTo("head")},$.getUrlVars=function(){for(var e,t=[],o=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),n=0;n<o.length;n++)e=o[n].split("="),t.push(e[0]),t[e[0]]=e[1];return t},$.decodeUrl=function(e){return decodeURIComponent(e).replace("+"," ")},$.numberWithCommas=function(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},$.validator&&($.validator.addMethod("time",function(e,t){return this.optional(t)||/^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(:([0-5]?[0-9]))?$/i.test(e)},"Please enter a valid time."),$.validator.addMethod("ukdate",function(e,t){return e.match(/^\d\d?\/\d\d?\/\d\d\d\d$/)},"Please enter a date in the format dd/mm/yyyy.")),$.mobile={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},Any:function(){return $.mobile.Android()||$.mobile.BlackBerry()||$.mobile.iOS()||$.mobile.Opera()||$.mobile.Windows()}},$.mobile.Android?$.mobile.BlackBerry?$.mobile.iOS?$.mobile.Opera?$.mobile.Windows?($.body.addClass("desktop-device"),$.device="desktop"):($.body.addClass("windows-device"),$.device="windows"):($.body.addClass("opera-device"),$.device="opera"):($.body.addClass("ios-device"),$.device="ios"):($.body.addClass("blackberry-device"),$.device="blackberry"):($.body.addClass("android-device"),$.device="android"),function(){var e={password:"0",username:"0"};$("body").on("change",".prevent-autocomplete",function(t){var o=$(this).attr("id");"0"!==e[o]&&e[o]===$(this).val()||$(this).val("")}),$("body").on("keyup",".prevent-autocomplete",function(t){var o=$(this).attr("id");e[o]=$(this).val()})}(),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var o=document.createEvent("CustomEvent");return o.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),o}return"function"!=typeof window.CustomEvent&&(e.prototype=window.Event.prototype,void(window.CustomEvent=e))}(),$.hood.LinkClasses=[{title:"None",value:""},{title:"Button link",value:"btn btn-default"},{title:"Theme coloured button link",value:"btn btn-primary"},{title:"Popup image/video",value:"colorbox-iframe"},{title:"Button popup link",value:"btn btn-default colorbox-iframe"},{title:"Theme coloured button popup link",value:"btn btn-primary colorbox-iframe"},{title:"Large link",value:"font-lg"},{title:"Large button link",value:"btn btn-default btn-lg"},{title:"Large theme coloured button link",value:"btn btn-primary btn-lg"},{title:"Large popup image/video",value:"font-lg colorbox-iframe"},{title:"Large Button popup link",value:"btn btn-default btn-lg colorbox-iframe"},{title:"Theme coloured button popup link",value:"btn btn-primary btn-lg colorbox-iframe"}],$.hood.ImageClasses=[{title:"None",value:""},{title:"Full Width",value:"user-image full"},{title:"Left Aligned",value:"user-image left"},{title:"Centered",value:"user-image center"},{title:"Right Aligned",value:"user-image right"},{title:"Inline with text, top aligned",value:"user-image inline top"},{title:"Inline with text, middle aligned",value:"user-image inline"},{title:"Inline with text, bottom aligned",value:"user-image inline bottom"},{title:"Pulled Left",value:"user-image pull-left"},{title:"Pulled Right",value:"user-image pull-right"}],new CustomEvent("loader-show"),new CustomEvent("loader-hide"),$.hood.Loader=function(e){e?$("body").trigger("loader-show"):$("body").trigger("loader-hide")},$.hood||($.hood={}),$.hood.Helpers={IsNullOrUndefined:function(e){var t=!1;return null!==e&&"undefined"!=typeof e&&""!==e||(t=!0),t},IsSet:function(e){var t=!1;return null!==e&&"undefined"!=typeof e&&""!==e||(t=!0),!t},IsEventSupported:function(e){var t=document.createElement("div");e="on"+e;var o=e in t;return o||(t.setAttribute(e,"return;"),o="function"==typeof t[e]),t=null,o},IsFunction:function(e){return e&&"[object Function]"==={}.toString.call(e)},IsUrlExternal:function(e){var t=e.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof t[1]&&t[1].length>0&&t[1].toLowerCase()!==location.protocol||"string"==typeof t[2]&&t[2].length>0&&t[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host},IsInIframe:function(){try{return window.self!==window.top}catch(e){return!0}},HtmlEncode:function(e){return $("<div/>").text(e).html()},HtmlDecode:function(e){return $("<div/>").html(e).text()},FormatCurrency:function(e,t){return t+" "+e.toFixed(2).replace(/./g,function(e,t,o){return t>0&&"."!==e&&(o.length-t)%3===0?","+e:e})},FormatKilobytes:function(e){return e/=1024,e.toFixed(2).replace(/./g,function(e,t,o){return t>0&&"."!==e&&(o.length-t)%3===0?","+e:e})},FormatMegabytes:function(e){return e/=1024,e/=1024,currency+" "+e.toFixed(2).replace(/./g,function(e,t,o){return t>0&&"."!==e&&(o.length-t)%3===0?","+e:e})},ProcessResponse:function(e){var t="";e.Title&&(t="<strong>".concat(e.Title,"</strong><br />")),e.Success?$.hood.Alerts.Success("".concat(t).concat(e.Message)):$.hood.Alerts.Error("".concat(t).concat(e.Errors))},GetQueryStringParamByName:function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)","i"),o=t.exec(location.search);return null===o?"":decodeURIComponent(o[1].replace(/\+/g," "))},InsertQueryStringParam:function(e,t){e=escape(e),t=escape(t);var o=document.location.search.substr(1).split("&");if(""===o)document.location.search="?"+e+"="+t;else{for(var n,a=o.length;a--;)if(n=o[a].split("="),n[0]===e){n[1]=t,o[a]=n.join("=");break}a<0&&(o[o.length]=[e,t].join("=")),document.location.search=o.join("&")}},InsertQueryStringParamToUrl:function(e,t,o){t=escape(t),o=escape(o);var n=e.search.substr(1).split("&");if(""===n)e.search="?"+t+"="+o;else{for(var a,r=n.length;r--;)if(a=n[r].split("="),a[0]===t){a[1]=o,n[r]=a.join("=");break}r<0&&(n[n.length]=[t,o].join("=")),e.search=n.join("&")}return e},UrlToLocationObject:function(e){var t=document.createElement("a");return t.href=e,t},FindAndRemoveFromArray:function(e,t,o){$.each(e,function(n,a){a[t]===o&&e.splice(n,1)})},FindAndReturnFromArray:function(e,t,o){var n=null;return $.each(e,function(e,a){a[t]===o&&(n=a)}),n},LeftPad:function(e,t){for(var o=e+"";o.length<t;)o="0"+o;return o},DateAdd:function(e,t,o){var n=new Date(e);switch(t.toLowerCase()){case"year":n.setFullYear(n.getFullYear()+o);break;case"quarter":n.setMonth(n.getMonth()+3*o);break;case"month":n.setMonth(n.getMonth()+o);break;case"week":n.setDate(n.getDate()+7*o);break;case"day":n.setDate(n.getDate()+o);break;case"hour":n.setTime(n.getTime()+36e5*o);break;case"minute":n.setTime(n.getTime()+6e4*o);break;case"second":n.setTime(n.getTime()+1e3*o);break;default:n=void 0}return n},GenerateRandomString:function(e){var t="!@#$&*",o="abcdefghijklmnopqrstuvwxyz",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",a="0123456789",r=o+n+a,i=(t.pick(1)+o.pick(1)+n.pick(1)+r.pick(5,10)).shuffle();return i}},$.hood||($.hood={}),$.hood.Handlers={Init:function(){$("body").on("click",".select-text",$.hood.Handlers.SelectTextContent),$("body").on("click",".btn.click-select[data-target][data-value]",$.hood.Handlers.ClickSelect),$("body").on("click",".click-select.show-selected[data-target][data-value]",$.hood.Handlers.ClickSelect),$("body").on("click",".click-select:not(.show-selected)[data-target][data-value]",$.hood.Handlers.ClickSelectClean),$("body").on("click",".slide-link",$.hood.Handlers.SlideToAnchor),$("body").on("click",".scroll-target, .scroll-to-target",$.hood.Handlers.ScrollToTarget),$("body").on("click",".scroll-top, .scroll-to-top",$.hood.Handlers.ScrollToTop),$("body").on("change","input[type=checkbox][data-input]",$.hood.Handlers.CheckboxChange),$("body").on("change",".submit-on-change",$.hood.Handlers.SubmitOnChange),$("select[data-selected]").each($.hood.Handlers.SelectSetup),$("body").on("change",".inline-date",$.hood.Handlers.DateChange),$.hood.Handlers.Uploaders.Init(),$.hood.Handlers.ColorPickers()},ScrollToTop:function(e){return e&&e.preventDefault(),$("html, body").animate({scrollTop:0},800),!1},ScrollToTarget:function(e){e&&e.preventDefault();var t=$(this).attr("href").split("#")[0];if(t===window.location.pathname||""===t){var o=this.hash,n=$(o),a=$("header.header"),r=0;a&&(r=a.height()),$(this).data("offset")?$("html, body").stop().animate({scrollTop:n.offset().top-$(this).data("offset")},900,"swing"):$("html, body").stop().animate({scrollTop:n.offset().top-r},900,"swing")}},SubmitOnChange:function(e){e&&e.preventDefault(),$(this).parents("form").submit()},DateChange:function(e){e&&e.preventDefault();var t=$(this).parents(".hood-date").find(".date-output"),o=t.parents(".hood-date").find(".date-value").val(),n=/^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/;n.test(o)||(o="01/01/2001");var a=t.parents(".hood-date").find(".hour-value").val();$.isNumeric(a)||(a="00");var r=t.parents(".hood-date").find(".minute-value").val();$.isNumeric(r)||(r="00"),t.val(o+" "+a+":"+r+":00"),t.attr("value",o+" "+a+":"+r+":00")},CheckboxChange:function(e){e&&e.preventDefault();var t=new Array;$('input[data-input="'+$(this).data("input")+'"]').each(function(){$(this).is(":checked")&&t.push($(this).val())});var o="#"+$(this).data("input"),n=JSON.stringify(t);$(o).val(n)},SelectSetup:function(){$(this).data("selected");if("undefined"!==$(this).data("selected")&&""!==$(this).data("selected")){var e=String($(this).data("selected"));$(this).val(e)}},ClickSelect:function(){var e=$(this),t="#"+e.data("target");$(t).val(e.data("value")),$(t).trigger("change"),$('.click-select[data-target="'+e.data("target")+'"]').each(function(){$(this).html($(this).data("temp")).removeClass("active")}),$('.click-select[data-target="'+e.data("target")+'"][data-value="'+e.data("value")+'"]').each(function(){$(this).data("temp",$(this).html()).html("Selected").addClass("active")})},ClickSelectClean:function(){var e=$(this),t="#"+e.data("target");$(t).val(e.data("value")),$(t).trigger("change"),$('.click-select.clean[data-target="'+e.data("target")+'"]').each(function(){$(this).removeClass("active")}),$('.click-select.clean[data-target="'+e.data("target")+'"][data-value="'+e.data("value")+'"]').each(function(){$(this).addClass("active")})},SelectTextContent:function(){var e=$(this);e.select(),e.mouseup(function(){return e.unbind("mouseup"),!1})},SlideToAnchor:function(){var e=$("body").scrollTop(),t=$($.attr(this,"href")).offset().top;return $("html, body").animate({scrollTop:t},Math.abs(t-e)),!1},Uploaders:{Init:function(){($(".image-uploader").length||$(".gallery-uploader").length)&&($(".upload-progress-bar").hide(),$.getScript("/lib/dropzone/min/dropzone.min.js",$.proxy(function(){$(".image-uploader").each(function(){$.hood.Handlers.Uploaders.SingleImage($(this).attr("id"),$(this).data("json"))}),$(".gallery-uploader").each(function(){$.hood.Handlers.Uploaders.Gallery($(this).attr("id"),$(this).data("json"))})},this)))},RefreshImage:function(e){$("."+e.Class).css({"background-image":"url("+e.Image+")"}),$("."+e.Class).find("img").attr("src",e.Image)},SingleImage:function(e,t){e="#"+e;$(e);Dropzone.autoDiscover=!1;var o=new Dropzone(e,{url:$(e).data("url"),maxFiles:1,paramName:"file",parallelUploads:1,autoProcessQueue:!0,previewsContainer:!1,clickable:e});o.on("addedfile",function(){}),o.on("totaluploadprogress",function(t){$(".upload-progress-bar."+e.replace("#","")+" .progress-bar").css({width:t+"%"})}),o.on("sending",function(t){$(".upload-progress-bar."+e.replace("#","")).show(),$($(e).data("preview")).addClass("loading")}),o.on("queuecomplete",function(t){$(".upload-progress-bar."+e.replace("#","")).hide()}),o.on("success",function(n,a){a.Success?(a.Media&&($(t).val(JSON.stringify(a.Media)),$($(e).data("preview")).css({"background-image":"url("+a.Media.SmallUrl+")"}),$($(e).data("preview")).find("img").attr("src",a.Media.SmallUrl)),$.hood.Alerts.Success("New image added!")):$.hood.Alerts.Error("There was a problem adding the image: "+a.Error),o.removeFile(n),$($(e).data("preview")).removeClass("loading")})},Gallery:function(e){Dropzone.autoDiscover=!1;var t=document.querySelector(e+"-template");t.id="";var o=t.parentNode.innerHTML;t.parentNode.removeChild(t);var n=new Dropzone(e,{url:$(e).data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:o,paramName:"files",autoProcessQueue:!0,previewsContainer:"#previews",clickable:".fileinput-button",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!"});$(e+" .cancel").hide(),n.on("addedfile",function(t){$(t.previewElement.querySelector(".complete")).hide(),$(t.previewElement.querySelector(".cancel")).show(),$(e+" .cancel").show()}),n.on("totaluploadprogress",function(e){document.querySelector("#total-progress .progress-bar").style.width=e+"%"}),n.on("sending",function(e){document.querySelector("#total-progress").style.opacity="1"}),n.on("complete",function(e){$(e.previewElement.querySelector(".cancel")).hide(),$(e.previewElement.querySelector(".progress")).hide(),$(e.previewElement.querySelector(".complete")).show(),$.hood.Inline.Refresh(".gallery")}),n.on("queuecomplete",function(t){document.querySelector("#total-progress").style.opacity="0",$(e+" .cancel").hide()}),n.on("success",function(e,t){$.hood.Inline.Refresh(".gallery"),t.Success?$.hood.Alerts.Success("New images added!"):$.hood.Alerts.Error("There was a problem adding the profile image: "+t.Error)}),document.querySelector(".actions .cancel").onclick=function(){n.removeAllFiles(!0)}}},ColorPickers:function(){var e=function(e,t){var o=$(t._root.button).parent().data("target");$(t._root.button).css({"background-color":e.toHEXA().toString()});var n=t.getColor().toHEXA(),a="";for(i=n.length-1;i>=0;i--)a=n[i]+a;$(o).val("#"+a)},t=[];$(".color-picker").each(function(o,n){var a=Pickr.create({el:n.children[0],appClass:"custom-class",theme:"monolith",useAsButton:!0,defaultRepresentation:"HEXA",position:"bottom-end",components:{opacity:!0,hue:!0,interaction:{hex:!1,rgba:!1,hsva:!1,input:!0,clear:!0}}}).on("init",function(t){var o=$(t._root.button).parent().data("target"),n=$(o).val();$(o).on("click",$.proxy(function(){this.show()},t)),t.setColor(n),e(t.getColor(),t)}).on("clear",function(t){var o=$(t._root.button).parent().data("target");t.setColor("transparent"),e(t.getColor(),t),$(o).val("")}).on("change",e);t.push(a)})}},$(document).ready($.hood.Handlers.Init),String.prototype.contains=function(e){return this.indexOf(e)!==-1},String.prototype.pick=function(e,t){var o,n="";o="undefined"==typeof t?e:e+Math.floor(Math.random()*(t-e));for(var a=0;a<o;a++)n+=this.charAt(Math.floor(Math.random()*this.length));return n},String.prototype.shuffle=function(){var e,t,o=this.split(""),n=o.length;if(n)for(;--n;)t=Math.floor(Math.random()*(n+1)),e=o[t],o[t]=o[n],o[n]=e;return o.join("")},String.prototype.toSeoUrl=function(){var e=this.replace(/[^a-zA-Z0-9]/g," ").replace(/\s+/g,"-").toLowerCase();"-"===e.charAt(0)&&(e=e.substring(1));var t=e.length-1;return"-"===e.charAt(t)&&(e=e.substring(0,t)),e},$.hood||($.hood={}),$.hood.FormValidator=function(e,t){this.Options=$.extend({formTag:e,validationRules:null,validationMessages:{},placeBelow:!0,submitButtonTag:null,submitUrl:null,submitFunction:null,serializationFunction:function(){var e=$(this.formTag).serialize();return e}},t||{}),this.LoadValidation=function(){$.hood.Helpers.IsNullOrUndefined(this.Options.formTag)||($(this.Options.formTag).find("input, textarea, select").keypress($.proxy(function(e){if(13===e.which)return $.proxy(this.submitForm(),this),e.preventDefault(),!1},this)),$(this.Options.formTag).validate({submitHandler:function(e){e.preventDefault()},errorClass:this.Options.errorClass,focusInvalid:!1,rules:this.Options.validationRules,messages:this.Options.validationMessages}),$.hood.Helpers.IsNullOrUndefined(this.Options.submitButtonTag)||$(this.Options.submitButtonTag).click($.proxy(this.submitForm,this)))},this.submitForm=function(){$(this.Options.formTag).valid()&&(this.TempButtonContent=$(this.Options.submitButtonTag).removeClass("btn-primary").addClass("btn-default").html(),$(this.Options.submitButtonTag).removeClass("btn-primary").addClass("btn-default").html('<i class="fa fa-refresh fa-spin"></i>&nbsp;Loading...'),$(this.Options.formTag).find("input[type=checkbox]").each(function(){$(this).is(":checked")&&$(this).val("true")}),$.post(this.Options.submitUrl,this.Options.serializationFunction(),$.proxy(function(e){$(this.Options.submitButtonTag).removeClass("btn-default").addClass("btn-primary").html(this.TempButtonContent),this.Options.submitFunction(e)},this)))},this.LoadValidation(),this.Options.placeBelow&&$(this.Options.formTag).addClass("validation-below")},$.fn.hoodValidator=function(e){return this.each(function(){var t=$(this);if(!t.data("hoodValidator")){var o=new $.hood.FormValidator(this,e);t.data("hoodValidator",o)}})},$.hood||($.hood={}),$.hood.Addresses={Init:function(){$("body").on("click",".address-set-billing",$.hood.Addresses.SetBilling),$("body").on("click",".address-set-delivery",$.hood.Addresses.SetDelivery),$("body").on("click",".address-delete",$.hood.Addresses.Delete)},Lists:{Address:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#address-list").doesExist()&&$.hood.Inline.Reload($("#address-list"),e)}}},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload(),e.Success&&t&&t.data("redirect")&&($.hood.Alerts.Success("<strong>Address deleted, redirecting...</strong><br />Just taking you back to the address list."),setTimeout(function(){window.location=t.data("redirect")},1500))})};$.hood.Alerts.Confirm("The address will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},CreateOrEdit:function(){$.hood.Google.Addresses.InitAutocomplete(),$("#address-form").hoodValidator({validationRules:{Number:{required:!0},Address1:{required:!0},City:{required:!0},County:{required:!0},Postcode:{required:!0},Country:{required:!0}},submitButtonTag:$("#address-form-submit"),submitUrl:$("#address-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload(),e.Success&&$.hood.Inline.CloseModal()}})},SetBilling:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload()})};$.hood.Alerts.Confirm("The current billing address will be overwritten.","Are you sure?",o,"error")},SetDelivery:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload()})};$.hood.Alerts.Confirm("The current delivery address will be overwritten.","Are you sure?",o,"error")}},$(document).ready($.hood.Addresses.Init);var swalWithBootstrapButtons=Swal.mixin({customClass:{confirmButton:"btn btn-success btn-lg m-1 pl-4 pr-4",cancelButton:"btn btn-danger btn-lg m-1"},buttonsStyling:!1}),Toast=Swal.mixin({toast:!0,position:"top-end",showConfirmButton:!0});$.hood||($.hood={}),$.hood.Alerts={Error:function(e,t,o,n,a,r,i){o===!0?this.SweetAlert(e,t,"error",n,a,r,i):this.Alert(e,t,"error")},Warning:function(e,t,o,n,a,r,i){o===!0?this.SweetAlert(e,t,"warning",n,a,r,i):this.Alert(e,t,"warning")},Message:function(e,t,o,n,a,r,i){o===!0?this.SweetAlert(e,t,"info",n,a,r,i):this.Alert(e,t,"info")},Success:function(e,t,o,n,a,r,i){o===!0?this.SweetAlert(e,t,"success",n,a,r,i):this.Alert(e,t,"success")},Alert:function(e,t,o){Toast.fire({type:o||"info",html:e,title:t})},SweetAlert:function(e,t,o,n,a,r,i){swalWithBootstrapButtons.fire({title:t,html:e,type:o||"info",footer:n,showConfirmButton:a,timer:r}).then(function(e){e.dismiss||i(e)})},Confirm:function(e,t,o,n,a,r,i){swalWithBootstrapButtons.fire({title:t||"Woah!",html:e||"Are you sure you want to do this?",type:n||"warning",footer:a||'<span class="text-warning"><i class="fa fa-exclamation-triangle"></i> This cannot be undone.</span>',showCancelButton:!0,confirmButtonText:r||"Ok",cancelButtonText:i||"Cancel"}).then(function(e){e.dismiss||o(e.value)})},Prompt:function(e,t,o,n,a,r,i,s,d){swalWithBootstrapButtons.fire({input:n||"text",inputAttributes:d||{autocapitalize:"off"},title:t||"Enter a value",html:e||"Fill in the field and press Ok to continue.",type:a||"info",footer:r,showCancelButton:!0,confirmButtonText:i||"Ok",cancelButtonText:s||"Cancel"}).then(function(e){e.dismiss||o(e.value)})}},$.hood||($.hood={}),$.hood.Forms={Init:function(){$(".floating-label > label").each(function(){var e=$(this);e.parent().append(e)})},GetAllowedExtensions:function(e){switch(e){case"Image":return["png","jpg","jpeg","bmp","gif"];case"Document":return["doc","docx","pdf","rtf"];case"All":return""}},GetAllowedFiles:function(e){switch(e){case"Image":return"image/png,jpg,image/jpeg,image/gif";case"Document":return"application/msword,application/pdf,text/rtf";case"All":return""}}},$(document).ready($.hood.Forms.Init),$.hood||($.hood={}),$.hood.Inline={Tags:{},Init:function(){$(".hood-inline:not(.refresh)").each($.hood.Inline.Load),$("body").on("click",".hood-inline-task",$.hood.Inline.Task),$("body").on("click",".hood-modal",function(e){e.preventDefault(),$.hood.Inline.Modal($(this).attr("href"),$(this).data("complete"))}),$.hood.Inline.DataList.Init()},Refresh:function(e){$(e||".hood-inline").each($.hood.Inline.Load)},Load:function(){$.hood.Inline.Reload(this)},Reload:function(e,t){var o=$(e);o.addClass("loading"),t||(t=o.data("complete"));var n=o.data("url");$.get(n,$.proxy(function(e){o.html(e),o.removeClass("loading"),t&&$.hood.Inline.RunComplete(t,o,e)},o)).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},CurrentModal:null,Modal:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o&&$.hood.Inline.CurrentModal&&$.hood.Inline.CurrentModal.modal("hide"),$.get(e,function(e){var o="#"+$(e).attr("id");$(e).addClass("hood-inline-modal"),$(o).length&&$(o).remove(),$("body").append(e),$.hood.Inline.CurrentModal=$(o),$(o).modal(),$(o).on("shown.bs.modal",function(){$(document).off("focusin.modal")}),$(o).on("hidden.bs.modal",function(e){$(this).remove()}),t&&$.hood.Inline.RunComplete(t,$(o),e)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},CloseModal:function(){$.hood.Inline.CurrentModal&&$.hood.Inline.CurrentModal.modal("hide")},Task:function(e){e.preventDefault();var t=$(e.currentTarget);t.addClass("loading"),complete=t.data("complete"),$.get(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),e.Success&&t&&t.data("redirect")&&setTimeout(function(){window.location=t.data("redirect")},1500),t.removeClass("loading"),complete&&$.hood.Inline.RunComplete(complete,t,e)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},DataList:{Init:function(){$(".hood-inline-list.query").each(function(){$(this).data("url",$(this).data("url")+window.location.search)}),$(".hood-inline-list:not(.refresh)").each($.hood.Inline.Load),$("body").on("click",".hood-inline-list .pagination a",function(e){e.preventDefault(),$.hood.Loader(!0);var t=document.createElement("a");t.href=$(this).attr("href");var o=$(this).parents(".hood-inline-list"),n=document.createElement("a");n.href=o.data("url"),n.search=t.search,$.hood.Inline.DataList.Reload(o,n)}),$("body").on("submit",".hood-inline-list form",function(e){e.preventDefault(),$.hood.Loader(!0);var t=$(this),o=t.parents(".hood-inline-list"),n=document.createElement("a");n.href=o.data("url"),n.search="?"+t.serialize(),$.hood.Inline.DataList.Reload(o,n)}),$("body").on("submit","form.inline",function(e){e.preventDefault(),$.hood.Loader(!0);var t=$(this),o=$(t.data("target")),n=document.createElement("a");n.href=o.data("url"),n.search="?"+t.serialize(),$.hood.Inline.DataList.Reload(o,n)}),$("body").on("change","form.inline .refresh-on-change, .hood-inline-list form",function(e){e.preventDefault(),$.hood.Loader(!0);var t=$(this).parents("form"),o=$(t.data("target")),n=document.createElement("a");n.href=o.data("url"),n.search="?"+t.serialize(),$.hood.Inline.DataList.Reload(o,n)})},Reload:function(e,t){if(history.pushState&&e.hasClass("query")){var o=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+t.href.substring(t.href.indexOf("?")+1);window.history.pushState({path:o},"",o)}e.data("url",$.hood.Helpers.InsertQueryStringParamToUrl(t,"inline","true")),$.hood.Inline.Reload(e)}},HandleError:function(e){500===e.status?$.hood.Alerts.Error("<strong>Error "+e.status+"</strong><br />There was an error processing the content, please contact an administrator if this continues.<br/>"):404===e.status?$.hood.Alerts.Error("<strong>Error "+e.status+"</strong><br />The content could not be found.<br/>"):401===e.status&&($.hood.Alerts.Error("<strong>Error "+e.status+"</strong><br />You are not allowed to view this resource, are you logged in correctly?<br/>"),window.location=window.location)},Finish:function(e){$.hood.Loader(!1)},RunComplete:function RunComplete(complete,sender,data){if(!$.hood.Helpers.IsNullOrUndefined(complete)){var func=eval(complete);"function"==typeof func&&func(element,data)}}},$(document).ready($.hood.Inline.Init),$.hood.Modals={Open:$.hood.Inline.Modal},$.hood||($.hood={}),$.hood.Media={Init:function(){$("body").on("click",".media-delete",$.hood.Media.Delete),$("body").on("click",".media-directories-delete",$.hood.Media.Directories.Delete),$.hood.Media.Upload.Init(),$.hood.Media.Actions.Init()},Loaded:function(e){$.hood.Loader(!1)},BladeLoaded:function(e){$.hood.Media.LoadMediaPlayers()},Reload:function(e){$.hood.Inline.Reload($("#media-list"),e)},ReloadDirectories:function(e){$.hood.Inline.Reload($("#media-directories-list"),e)},Actions:{Init:function(){$("body").on("click",".hood-image-attach",$.hood.Media.Actions.Load.Attach),$("body").on("click",".hood-image-clear",$.hood.Media.Actions.Complete.Clear),$("body").on("click",".hood-image-insert",$.hood.Media.Actions.Load.Insert),$("body").on("click",".hood-media-select",$.hood.Media.Actions.Load.Select)},Target:null,Json:null,Current:{Attach:null},Load:{Attach:function(e){e.preventDefault(),$.hood.Media.Actions.Target=$($(this).data("tag")),$.hood.Media.Actions.Json=$($(this).data("json")),$.hood.Inline.Modal($(this).data("url"),function(){$.hood.Media.Reload(function(){$("body").off("click",".media-attach"),$("body").on("click",".media-attach",$.hood.Media.Actions.Complete.Attach)}),$.hood.Media.Upload.Init()})},Insert:function(e){var t=$("#"+e.id);t.data("imagesUrl")&&e.addButton("hoodimage",{text:"Insert image...",icon:!1,onclick:$.proxy(function(t){$.hood.Inline.Modal($(this).data("imagesUrl"),function(){$.hood.Media.Reload(function(){$("body").off("click"),$("body").on("click",".media-insert",$.proxy($.hood.Media.Actions.Complete.Insert,e))}),$.hood.Media.Upload.Init()})},t)})},Select:function(e){$.hood.Media.Actions.Target=$($(this).data("target")),$.hood.Inline.Modal($(this).data("url"),function(){$.hood.Media.Reload(function(){$("body").off("click",".media-select"),$("body").on("click",".media-select",$.hood.Media.Actions.Complete.Select)}),$.hood.Media.Upload.Init()})}},Complete:{Attach:function(e){e.preventDefault();var t=$.hood.Media.Actions.Target,o=$.hood.Media.Actions.Json;$.post($(this).data("url"),function(e){if($.hood.Helpers.ProcessResponse(e),e.Success){var n=e.Media.Icon;"Image"===e.Media.GeneralFileType&&(n=e.Media.MediumUrl),$.hood.Helpers.IsNullOrUndefined(t)||(t.css({"background-image":"url("+n+")"}),t.find("img").attr("src",n),t.removeClass("loading")),$.hood.Helpers.IsNullOrUndefined(o)||o.val(e.MediaJson)}}).done(function(){$("#media-select-modal").modal("hide")}).fail($.hood.Inline.HandleError)},Insert:function(e){var t=$(e.target),o=this;o.insertContent('<img alt="'+t.data("title")+'" src="'+t.data("url")+'"/>'),$.hood.Inline.CloseModal()},Select:function(e){var t=$(this).data("url"),o=$.hood.Media.Actions.Target;$(o).each(function(){$(this).is("input")?$(this).val(t):($(this).attr("src",t),$(this).css({"background-image":"url("+t+")"}),$(this).find("img").attr("src",t))}),$.hood.Alerts.Success("Image URL has been inserted.<br /><strong>Remember to press save!</strong>"),$("#media-select-modal").modal("hide")},Clear:function(e){e.preventDefault();var t=$($(this).data("tag")),o=$($(this).data("json"));$.post($(this).data("url"),function(e){$.hood.Helpers.ProcessResponse(e),e.Success&&(icon=e.Media.Icon,"Image"===e.Media.GeneralFileType&&(icon=e.Media.MediumUrl),$.hood.Helpers.IsNullOrUndefined(t)||(t.css({"background-image":"url("+icon+")"}),t.find("img").attr("src",icon),t.removeClass("loading")),$.hood.Helpers.IsNullOrUndefined(o)||o.val(e.Json))}).fail($.hood.Inline.HandleError)}},RefreshImage:function(e,t,o){var n=$(e);
n.addClass("loading"),$.get(t,{id:o},$.proxy(function(e){n.css({"background-image":"url("+e.SmallUrl+")"}),n.find("img").attr("src",e.SmallUrl),n.removeClass("loading")},this))}},Upload:{Init:function(){if($("#media-add").doesExist()){$("#media-total-progress").hide(),Dropzone.autoDiscover=!1;var e=new Dropzone("#media-upload",{url:$.hood.Media.Upload.UploadUrl,thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:!1,paramName:"files",autoProcessQueue:!0,previewsContainer:!1,clickable:"#media-add",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!"});e.on("success",function(e,t){$.hood.Helpers.ProcessResponse(t)}),e.on("addedfile",function(e){$("#media-total-progress .progress-bar").css({width:"0%"}),$("#media-total-progress .progress-bar .percentage").html("0%")}),e.on("totaluploadprogress",function(e){$("#media-total-progress .progress-bar").css({width:e+"%"}),$("#media-total-progress .progress-bar .percentage").html(e+"%")}),e.on("sending",function(e){$("#media-total-progress").fadeIn(),$("#media-total-progress .progress-bar").css({width:"0%"}),$("#media-total-progress .progress-bar .percentage").html("0%")}),e.on("complete",function(e){$.hood.Media.Reload()}),e.on("queuecomplete",function(e){$("#media-total-progress").hide(),$.hood.Media.Reload()})}},UploadUrl:function(){return $("#media-upload").data("url")+"?directoryId="+$("input[type='radio'][name='dir']:checked").val()}},Delete:function(e){var t=$(this),o=function(e){e&&$.post("/admin/media/delete",{id:t.data("id")},function(e){$.hood.Helpers.ProcessResponse(e),e.Success&&($.hood.Media.Reload(),$(".modal-backdrop").remove(),$(".modal").modal("hide"))})};$.hood.Alerts.Confirm("The media file will be permanently removed. This cannot be undone.","Are you sure?",o,"warning",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> Ensure this file is not attached to any posts, pages or features of the site, or it will appear as a broken image or file.</span>',"Ok","Cancel")},RestrictDir:function(){var e=/[^0-9A-Za-z- ]*/g,t=$(this).val(),o=t.replace(e,"");t!==o&&$(this).val(o)},Directories:{Editor:function(){$("#content-directories-edit-form").hoodValidator({validationRules:{DisplayName:{required:!0},Slug:{required:!0}},submitButtonTag:$("#content-directories-edit-submit"),submitUrl:$("#content-directories-edit-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Media.ReloadDirectories(),$.hood.Media.Reload()}})},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Media.ReloadDirectories(),$.hood.Media.Reload()})};$.hood.Alerts.Confirm("The directory and all files will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle mr-2"></i><strong>This cannot be undone!</strong><br />Ensure these files are not attached to any posts, pages or features of the site, or it will appear as a broken image or file.</span>')}},Players:{},LoadMediaPlayers:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".hood-media",t={techOrder:["azureHtml5JS","flashSS","html5FairPlayHLS","silverlightSS","html5"],nativeControlsForTouch:!1,controls:!0,autoplay:!1,seeking:!0};$(e).each(function(){try{if(player=$.hood.Media.Players[$(this).data("id")],player)try{player.dispose()}catch(e){console.log("There was a problem disposing the old media player: ".concat(e))}$.hood.Media.Players[$(this).data("id")]=amp($(this).attr("id"),t),player=$.hood.Media.Players[$(this).data("id")],player.src([{src:$(this).data("file"),type:$(this).data("type")}])}catch(e){console.log("There was a problem playing the media file: ".concat(e))}})}},$(document).ready($.hood.Media.Init),$.hood||($.hood={}),$.hood.Cart={Init:function(){$("#CheckoutProgress").fadeOut(),$("body").on("click",".cart-add",$.hood.Cart.Add),$("body").on("click",".cart-clear",$.hood.Cart.Clear),$("body").on("click",".cart-update",$.hood.Cart.Update),$("body").on("click",".cart-remove",$.hood.Cart.Remove),$("body").on("change",".delivery-select",function(){$("#DeliveryAddressId").val($(this).val())}),$("body").on("change",".billing-select",function(){$("#BillingAddressId").val($(this).val())})},Add:function(e){$(this).data("temp",$(this).html()),$(this).addClass("btn-loading").append('<i class="fa fa-refresh fa-spin m-l-xs"></i>'),$.post("/cart/add",{productID:$(this).data("id"),qty:1},function(e){$(".btn-loading").each(function(){$(this).removeClass("btn-loading").html($(this).data("temp"))}),e.Success?($.hood.Alerts.Success("Added to your cart!"),$.hood.Cart.ReloadMiniCart()):($.hood.Alerts.Error("Couldn't add to your cart..."),$.hood.Cart.ReloadMiniCart())}),e.preventDefault()},Update:function(e){$.post("/cart/update",{productID:$(this).data("id"),qty:$(this).data("change")},function(e){e.Success?($.hood.Alerts.Success("Your shopping cart has been updated!"),$.hood.Cart.ReloadMiniCart()):$.hood.Alerts.Error("Couldn't update your cart...")}),e.preventDefault()},Remove:function(e){$.post("/cart/remove",{productID:$(this).data("id")},function(e){e.Success?($.hood.Alerts.Success("Your shopping cart has been updated!"),$.hood.Cart.ReloadMiniCart()):$.hood.Alerts.Error("Couldn't update your cart...")}),e.preventDefault()},Clear:function(e){$.post("/cart/clear",{},function(e){e.Success?($.hood.Alerts.Success("Your shopping cart has been cleared!"),$.hood.Cart.ReloadMiniCart()):$.hood.Alerts.Error("Couldn't clear your cart...")}),e.preventDefault()},ReloadMiniCart:function(e){$(".hood-inline-cart").each(function(){$.hood.Inline.Reload(this)})}},$.hood.Cart.Init(),$.hood||($.hood={}),$.hood.Stripe={Init:function(){$("body").on("click",".payment-method-setdefault",$.hood.Stripe.PaymentMethods.SetDefault),$("body").on("click",".payment-method-delete",$.hood.Stripe.PaymentMethods.Delete),$("#card-add-form").doesExist()&&$.hood.Stripe.PaymentMethods.Add(),$("#buy-plan-form").doesExist()&&$.hood.Stripe.Subscriptions.Buy()},Lists:{PaymentMethods:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#payment-method-list").doesExist()&&$.hood.Inline.Reload($("#payment-method-list"),e)}}},PaymentMethods:{Stripe:null,CardElement:null,Add:function(){$.hood.Stripe.PaymentMethods.Stripe=Stripe($("#card-add-form").data("stripe"));var e=$.hood.Stripe.PaymentMethods.Stripe.elements();$.hood.Stripe.PaymentMethods.CardElement=e.create("card"),$.hood.Stripe.PaymentMethods.CardElement.mount("#card-add-element"),$("#card-add-form").validate({rules:{CardholderName:"required"}}),$("body").on("click","#card-add-submit",$.hood.Stripe.PaymentMethods.SubmitCardForm)},SubmitCardForm:function(e){return e.preventDefault(),$("#card-add-consent").is(":checked")?void($("#card-add-form").valid()&&!$("#card-add-submit").hasClass("processing")&&($.hood.Stripe.PaymentMethods.ToggleButton(!0),$.hood.Stripe.PaymentMethods.Stripe.handleCardSetup($("#card-add-submit").data("secret"),$.hood.Stripe.PaymentMethods.CardElement,{payment_method_data:{billing_details:{name:$("#card-add-cardholdername").val()}}}).then(function(e){e.error?($.hood.Stripe.PaymentMethods.ShowError(response.error),$.hood.Stripe.PaymentMethods.ToggleButton(!1)):($.hood.Stripe.PaymentMethods.ShowSuccess("Confirming your card..."),$.hood.Stripe.PaymentMethods.ConfirmIntent(e))}))):($.hood.Stripe.PaymentMethods.ShowError("You cannot add a card without agreeing to the customer agreement."),void $.hood.Stripe.PaymentMethods.ToggleButton(!1))},HandleServerResponse:function(e){e.error?($.hood.Stripe.PaymentMethods.ShowError(e.error),$.hood.Stripe.PaymentMethods.ToggleButton(!1)):e.requires_action?($.hood.Stripe.PaymentMethods.ShowError("We require confirmation from your card issuer to continue..."),$.hood.Stripe.PaymentMethods.Stripe.handleCardAction(e.payment_intent_client_secret).then(function(e){e.error?($.hood.Stripe.PaymentMethods.ShowError(e.error),$.hood.Stripe.PaymentMethods.ToggleButton(!1)):($.hood.Stripe.PaymentMethods.ShowSuccess("Confirming your card..."),$.hood.Stripe.PaymentMethods.ConfirmIntent(e))})):($.hood.Stripe.PaymentMethods.ShowSuccess("Card added successfully, please wait..."),$.hood.Stripe.PaymentMethods.ToggleButton(!1),$.hood.Stripe.Lists.PaymentMethods.Reload(),$.hood.Inline.CloseModal())},ConfirmIntent:function(e){fetch($("#card-add-submit").data("url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Id:e.setupIntent.id})}).then(function(e){return e.json().then($.hood.Stripe.PaymentMethods.HandleServerResponse)})},ToggleButton:function(e){e?($("#card-add-submit").addClass("processing"),$("#card-add-submit").html('<i class="fa fa-spin fa-sync-alt"></i>&nbsp;Processing...')):($("#card-add-submit").removeClass("processing"),$("#card-add-submit").html("Add card to wallet"))},SetDefault:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Stripe.Lists.PaymentMethods.Reload(),$(".card-modal").modal("hide")})};$.hood.Alerts.Confirm("The card will be used for all transactions from this point onwards.","Are you sure?",o,"warning",'<span class="text-info"><i class="fa fa-exclamation-triangle"></i> <strong>You can change this at any time.</strong></span>')},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Stripe.Lists.PaymentMethods.Reload(),$(".card-modal").modal("hide")})};$.hood.Alerts.Confirm("The card will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},ShowError:function(e){$("#card-add-success").html(""),e.message?$("#card-add-errors").html(e.message):$("#card-add-errors").html(e)},ShowSuccess:function(e){$("#card-add-errors").html(""),$("#card-add-success").html(e)}},Subscriptions:{Stripe:null,CardElement:null,Buy:function(){$("body").on("change",".buy-plan-method",$.hood.Stripe.Subscriptions.ToggleNewCardForm),$.hood.Stripe.Subscriptions.Stripe=Stripe($("#buy-plan-form").data("stripe"));var e=$.hood.Stripe.Subscriptions.Stripe.elements();$.hood.Stripe.Subscriptions.CardElement=e.create("card"),$.hood.Stripe.Subscriptions.CardElement.mount("#buy-plan-element"),$.hood.Stripe.Subscriptions.CardElement.addEventListener("change",function(e){e.error?$.hood.Stripe.Subscriptions.ShowError(result.error):$.hood.Stripe.Subscriptions.ShowError("")}),$("#buy-plan-form").validate({rules:{CardholderName:"required"}}),$("body").on("click","#buy-plan-submit",$.hood.Stripe.Subscriptions.CompletePurchase)},CompletePurchase:function(e){var t=$("input[name='buy-plan-method']:checked").val();return t?$("#buy-plan-consent").is(":checked")?"new-card"===t?$.hood.Stripe.Subscriptions.BuyWithNewCard(e):$.hood.Stripe.Subscriptions.BuyWithExisting(e):($.hood.Stripe.Subscriptions.ShowError("You cannot purchase a subscription without agreeing to the customer agreement."),void $.hood.Stripe.Subscriptions.ToggleButton(!1)):($.hood.Stripe.Subscriptions.ShowError("You have to select a payment method to continue with your purchase."),void $.hood.Stripe.Subscriptions.ToggleButton(!1))},ToggleNewCardForm:function(e){var t=$("input[name='buy-plan-method']:checked").val();"new-card"===t?$("#buy-plan-add-card-form").slideDown():$("#buy-plan-add-card-form").slideUp(),$.hood.Stripe.Subscriptions.ShowError("")},BuyWithExisting:function(e){e.preventDefault(),$("#buy-plan-submit").hasClass("processing")?$.hood.Stripe.Subscriptions.ToggleButton(!1):($.hood.Stripe.Subscriptions.ToggleButton(!0),fetch($("#buy-plan-submit").data("url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({PlanId:$("#buy-plan-id").val(),PaymentMethodId:$("input[name='buy-plan-method']:checked").val()})}).then(function(e){return e.json()}).then($.hood.Stripe.Subscriptions.HandleServerResponse))},BuyWithNewCard:function(e){e.preventDefault(),$("#buy-plan-form").valid()&&!$("#buy-plan-submit").hasClass("processing")?($.hood.Stripe.Subscriptions.ToggleButton(!0),$.hood.Stripe.Subscriptions.Stripe.createToken($.hood.Stripe.Subscriptions.CardElement).then(function(e){e.error?($.hood.Stripe.Subscriptions.ShowError(e.error),$.hood.Stripe.Subscriptions.ToggleButton(!1)):($.hood.Stripe.PaymentMethods.ShowSuccess("Confirming your card..."),fetch($("#buy-plan-submit").data("url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({PlanId:$("#buy-plan-id").val(),Token:e.token.id})}).then(function(e){return e.json()}).then($.hood.Stripe.Subscriptions.HandleServerResponse))})):$.hood.Stripe.Subscriptions.ToggleButton(!1)},HandleServerResponse:function(e){e.error?($.hood.Stripe.Subscriptions.ShowError(e.error),$.hood.Stripe.Subscriptions.ToggleButton(!1)):e.requires_action?$.hood.Stripe.Subscriptions.Stripe.handleCardPayment(e.payment_intent_client_secret).then(function(e){e.error?($.hood.Stripe.Subscriptions.ShowError(e.error),$.hood.Stripe.Subscriptions.ToggleButton(!1)):($.hood.Stripe.PaymentMethods.ShowSuccess("Confirming your card..."),$.hood.Stripe.Subscriptions.ConfirmIntent(e))}):($.hood.Stripe.Subscriptions.ShowSuccess("Subscription created successfully, please wait..."),$.hood.Stripe.Subscriptions.ToggleButton(!1),e.url&&(window.location=e.url))},ConfirmIntent:function(e){fetch($("#buy-plan-submit").data("url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({PlanId:$("#buy-plan-id").val(),IntentId:e.paymentIntent.id})}).then(function(e){return e.json().then($.hood.Stripe.Subscriptions.HandleServerResponse)})},ToggleButton:function(e){e?($("#buy-plan-submit").addClass("processing"),$("#buy-plan-submit").html('<i class="fa fa-spin fa-sync-alt"></i>&nbsp;Processing...')):($("#buy-plan-submit").removeClass("processing"),$("#buy-plan-submit").html("Confirm &amp; Pay"))},ShowError:function(e){$("#buy-plan-success").html(""),e.message?$("#buy-plan-errors").html(e.message):$("#buy-plan-errors").html(e)},ShowSuccess:function(e){$("#buy-plan-errors").html(""),$("#buy-plan-success").html(e)}}},$.hood.Stripe.Init(),$.window=$(window),$.hood||($.hood={}),$.hood.App={Options:{Header:{Target:"#header",Sticky:!0,StickyClass:"sticky-header"},Alerts:!0,Colorbox:!0,ContactForms:!0,Forums:!0,PaymentPages:!0,RichTextEditors:$(".tinymce-public").length},Init:function(e){$.hood.App.Options=$.extend($.hood.App.Options,e||{}),e&&e.Header&&($.hood.App.Options.Header=$.extend($.hood.App.Options.Header,e.Header||{})),$.hood.App.Header.Init(),$.hood.App.Options.PaymentPages&&$.hood.App.PaymentPages.Init(),$.hood.App.Options.FitVids&&$.hood.App.ResizeVideos(),$.hood.App.Options.ContactForms&&$.hood.App.ContactForms.Init(),$.hood.App.Options.Colorbox&&$.hood.App.Colorbox(),$.hood.App.Options.LoadSharers&&$.hood.App.Sharers(),$.hood.App.Options.RichTextEditors&&$.hood.App.RichTextEditors()},Ready:function(){$.hood.App.Init(),$.hood.App.Resize()},Load:function(){},Resize:function(){},Header:{Init:function(){$.hood.App.Options.Header.Sticky&&($.hood.App.Header.StickyMenu(),$.window.on("scroll",function(){$.hood.App.Header.StickyMenu()}))},StickyMenu:function(){var e=0,t=$($.hood.App.Options.Header.Target);t.length>0&&(e=t.offset().top);var o=t.height(),n=$.window.height()+2*o,a=$(document).height();$.window.scrollTop()>e&&a>n?t.addClass($.hood.App.Options.Header.StickyClass):$.hood.App.Header.RemoveStickyness()},RemoveStickyness:function(){var e=$($.hood.App.Options.Header.Target);e.hasClass($.hood.App.Options.Header.StickyClass)&&e.removeClass($.hood.App.Options.Header.StickyClass)}},ContactForms:{Init:function(){$(".contact-form .thank-you").hide(),$(".contact-form .form-submit").show(),$("body").on("submit",".contact-form",function(e){return e.preventDefault(),$(this).addClass("loading"),$.hood.App.ContactForms.Submit(this),!1})},Submit:function(e){var t=$(e);return t.valid()&&$.post(t.attr("action"),t.serialize(),function(e){e.Success?(t.attr("data-redirect")&&(window.location=t.attr("data-redirect")),t.attr("data-alert-message")&&$.hood.Alerts.Success(t.attr("data-alert-message"),"Success",null,!0),t.find(".form").hide(),t.find(".thank-you").show()):t.attr("data-alert-error")?$.hood.Alerts.Error(t.attr("data-alert-error"),"Error",null,!0):$.hood.Alerts.Error("There was an error sending the message: "+e.Errors,"Error",null,!0),t.removeClass("loading")}),!1}},Alerts:function(){$(".alert.auto-dismiss").fadeTo(5e3,500).slideUp(500,function(){$(".alert.auto-dismiss").slideUp(500)})},Colorbox:function(){$(".colorbox").colorbox({rel:"gallery",maxWidth:"95%",maxHeight:"95%"}),$(".colorbox-iframe").colorbox({iframe:!0,maxWidth:"95%",maxHeight:"95%",innerWidth:640,innerHeight:390})},Forums:{Init:function(){var e=$.getUrlVars().highlight;if($.isNumeric(e)){var t=$("#post-"+e);$("html,body").animate({scrollTop:t.offset().top},"slow"),t.addClass("highlight"),"Created"===$.getUrlVars().message&&t.addClass("created")}var o=$.getUrlVars().reply;if($.isNumeric(o)){var n=$("#forum-post-form");$("html,body").animate({scrollTop:n.offset().top},"slow")}$(".forum").on("click",".edit-post",function(e){$(this).parents(".post").find(".post-view").slideToggle(),$(this).parents(".post").find(".edit-view").slideToggle()})}},ResizeVideos:function(){return $().fitVids?void $("body").fitVids({customSelector:"iframe[src^='http://www.dailymotion.com/embed'], iframe[src*='maps.google.com'], iframe[src*='google.com/maps']",ignore:".no-fv"}):(console.log("resizeVideos: FitVids not Defined."),!0)},PaymentPages:{Init:function(){$("body").on("click",".btn.price-select[data-target][data-value]",$.hood.App.PaymentPages.PriceSelect),$("body").on("click",".change-price-option",$.hood.App.PaymentPages.ChangePrice)},ChangePrice:function(){$("#price-panel").collapse("show"),$("#billing-panel").collapse("hide"),$("#confirm-panel").collapse("hide")},PriceSelect:function(){var e=$(this);targetId="#"+e.data("target"),$(targetId).val(e.data("value")),$(".selected-price-text").html($(targetId).find(":selected").text()),$('.price-select[data-target="'+e.data("target")+'"]').each(function(){$(this).html($(this).data("temp")).removeClass("active")}),$('.price-select[data-target="'+e.data("target")+'"][data-value="'+e.data("value")+'"]').each(function(){$(this).data("temp",$(this).html()).html("Selected").addClass("active")}),$("#price-panel").collapse("hide"),$("#billing-panel").collapse("show"),$("#confirm-panel").collapse("hide")}},RichTextEditors:function(){tinymce.init({selector:".tinymce-public",height:250,plugins:["advlist autolink lists link image charmap print preview anchor media","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste emoticons"],menubar:!1,toolbar:"styleselect | bold italic | bullist numlist outdent indent | undo redo | link image media emoticons",image_dimensions:!1,body_class:"tiny-mce-body",content_css:"/css/site.css"})},Property:{Loaded:function(e){$.hood.Loader(!1),$.hood.Google.ClusteredMap()},Reload:function(e){$("#property-list").doesExist()&&$.hood.Inline.Reload($("#property-list"),e)}}},$(function(){$.hood.App.Ready()}),$(window).on("load",$.hood.App.Load),$(window).on("resize",$.hood.App.Resize);

@@ -1296,7 +1296,9 @@ "use strict";

$.get(urlLoad, $.proxy(function (data) {
$(this).html(data);
$(this).removeClass('loading');
}, $tag)).done(function () {
$.hood.Inline.RunComplete(complete);
}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish);
$tag.html(data);
$tag.removeClass('loading');
if (complete) {
$.hood.Inline.RunComplete(complete, $tag, data);
}
}, $tag)).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish);
},

@@ -1329,4 +1331,6 @@ CurrentModal: null,

});
}).done(function () {
$.hood.Inline.RunComplete(complete);
if (complete) {
$.hood.Inline.RunComplete(complete, $(modalId), data);
}
}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish);

@@ -1356,4 +1360,6 @@ },

$tag.removeClass('loading');
}).done(function () {
$.hood.Inline.RunComplete(complete);
if (complete) {
$.hood.Inline.RunComplete(complete, $tag, data);
}
}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish);

@@ -1435,3 +1441,3 @@ },

},
RunComplete: function RunComplete(complete) {
RunComplete: function RunComplete(complete, sender, data) {
if (!$.hood.Helpers.IsNullOrUndefined(complete)) {

@@ -1441,3 +1447,3 @@ var func = eval(complete);

if (typeof func === 'function') {
func();
func(element, data);
}

@@ -1444,0 +1450,0 @@ }

@@ -1,2 +0,2 @@

"use strict";var console={};console.log=function(){},window.console=console,$.hood||($.hood={}),$.body=$("body");var console=window.console||{};console.log=console.log||function(){},console.warn=console.warn||function(){},console.error=console.error||function(){},console.info=console.info||function(){},$.fn.exists=function(){return $(this).length},$.fn.doesExist=function(){return $(this).length},$.fn.restrictToSlug=function(e){var t=$(this),o=e||/[^0-9a-zA-Z]*/g,n=function(){var e=$(this).val(),t=e.replace(o,"");e!==t&&$(this).val(t)};t.on("keyup",n),t.on("paste",n),t.on("change",n)},$(".restrict-to-slug").restrictToSlug(),$.fn.restrictToPageSlug=function(e){var t=$(this),o=e||/[^0-9a-zA-Z-\/\/]*/g,n=function(){var e=$(this).val(),t=e.replace(o,"");if((t.match(new RegExp("/","g"))||[]).length>4){var n=t.lastIndexOf("/");t=t.substring(0,n)+t.substring(n+1),$.hood.Alerts.Warning("You can only have up to 4 '/' characters in a url slug.")}e!==t&&$(this).val(t)};t.on("keyup",n),t.on("paste",n),t.on("change",n)},$(".restrict-to-page-slug").restrictToPageSlug(),$.fn.restrictToMetaSlug=function(e){var t=$(this),o=e||/[^0-9a-zA-Z.]*/g,n=function(){var e=$(this).val(),t=e.replace(o,"");if((t.match(new RegExp(".","g"))||[]).length>1){var n=t.lastIndexOf(".");t=t.substring(0,n)+t.substring(n+1),$.hood.Alerts.Warning("You can only have up to 1 '.' characters in a meta slug.")}e!==t&&$(this).val(t)};t.on("keyup",n),t.on("paste",n),t.on("change",n)},$(".restrict-to-meta-slug").restrictToMetaSlug(),$.fn.characterCounter=function(e){var t=$(this),o=function(){var e=$(this).data("counter"),t=Number($(this).attr("maxlength")),o=$(this).val().length;$(e).text(t-o);var n="text-success";t-o<t/10&&(n="text-danger"),$(e).parent().removeClass("text-success").removeClass("text-danger").addClass(n)};t.on("keyup",o),t.on("paste",o),t.on("change",o)},$(".character-counter").characterCounter(),$(".character-counter").trigger("change"),$.fn.addLoader=function(){$(this).data("loadercontent",$(this).html()),$(this).addClass("loading").append('<i class="fa fa-refresh fa-spin m-l-sm"></i>')},$.fn.removeLoader=function(){$(this).empty().html($(this).data("loadercontent")),$(this).removeClass("loading")},$.fn.warningAlert=function(){var e=$(this),t=function(e){e.preventDefault();var t=function(t){if(t){var o=$(e.currentTarget).attr("href");window.location=o}};return $.hood.Alerts.Confirm($(e.currentTarget).data("warning"),$(e.currentTarget).data("title"),t,"warning",$(e.currentTarget).data("footer"),"Ok","Cancel"),!1};e.on("click",t)},$(".warning-alert").warningAlert(),$.commonHeight=function(e,t){var o=0;e.children(t).each(function(){var e=$(this).children();e.hasClass("max-height")?o=e.outerHeight():e.outerHeight()>o&&(o=e.outerHeight())}),e.children(t).each(function(){$(this).height(o)})},$.loadCss=function(e,t){$("link#"+e).length||$("<link/>",{id:e,rel:"stylesheet",type:"text/css",href:t}).appendTo("head")},$.getUrlVars=function(){for(var e,t=[],o=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),n=0;n<o.length;n++)e=o[n].split("="),t.push(e[0]),t[e[0]]=e[1];return t},$.decodeUrl=function(e){return decodeURIComponent(e).replace("+"," ")},$.numberWithCommas=function(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},$.validator&&($.validator.addMethod("time",function(e,t){return this.optional(t)||/^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(:([0-5]?[0-9]))?$/i.test(e)},"Please enter a valid time."),$.validator.addMethod("ukdate",function(e,t){return e.match(/^\d\d?\/\d\d?\/\d\d\d\d$/)},"Please enter a date in the format dd/mm/yyyy.")),$.mobile={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},Any:function(){return $.mobile.Android()||$.mobile.BlackBerry()||$.mobile.iOS()||$.mobile.Opera()||$.mobile.Windows()}},$.mobile.Android?$.mobile.BlackBerry?$.mobile.iOS?$.mobile.Opera?$.mobile.Windows?($.body.addClass("desktop-device"),$.device="desktop"):($.body.addClass("windows-device"),$.device="windows"):($.body.addClass("opera-device"),$.device="opera"):($.body.addClass("ios-device"),$.device="ios"):($.body.addClass("blackberry-device"),$.device="blackberry"):($.body.addClass("android-device"),$.device="android"),function(){var e={password:"0",username:"0"};$("body").on("change",".prevent-autocomplete",function(t){var o=$(this).attr("id");"0"!==e[o]&&e[o]===$(this).val()||$(this).val("")}),$("body").on("keyup",".prevent-autocomplete",function(t){var o=$(this).attr("id");e[o]=$(this).val()})}(),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var o=document.createEvent("CustomEvent");return o.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),o}return"function"!=typeof window.CustomEvent&&(e.prototype=window.Event.prototype,void(window.CustomEvent=e))}(),$.hood.LinkClasses=[{title:"None",value:""},{title:"Button link",value:"btn btn-default"},{title:"Theme coloured button link",value:"btn btn-primary"},{title:"Popup image/video",value:"colorbox-iframe"},{title:"Button popup link",value:"btn btn-default colorbox-iframe"},{title:"Theme coloured button popup link",value:"btn btn-primary colorbox-iframe"},{title:"Large link",value:"font-lg"},{title:"Large button link",value:"btn btn-default btn-lg"},{title:"Large theme coloured button link",value:"btn btn-primary btn-lg"},{title:"Large popup image/video",value:"font-lg colorbox-iframe"},{title:"Large Button popup link",value:"btn btn-default btn-lg colorbox-iframe"},{title:"Theme coloured button popup link",value:"btn btn-primary btn-lg colorbox-iframe"}],$.hood.ImageClasses=[{title:"None",value:""},{title:"Full Width",value:"user-image full"},{title:"Left Aligned",value:"user-image left"},{title:"Centered",value:"user-image center"},{title:"Right Aligned",value:"user-image right"},{title:"Inline with text, top aligned",value:"user-image inline top"},{title:"Inline with text, middle aligned",value:"user-image inline"},{title:"Inline with text, bottom aligned",value:"user-image inline bottom"},{title:"Pulled Left",value:"user-image pull-left"},{title:"Pulled Right",value:"user-image pull-right"}],new CustomEvent("loader-show"),new CustomEvent("loader-hide"),$.hood.Loader=function(e){e?$("body").trigger("loader-show"):$("body").trigger("loader-hide")},$.hood||($.hood={}),$.hood.Helpers={IsNullOrUndefined:function(e){var t=!1;return null!==e&&"undefined"!=typeof e&&""!==e||(t=!0),t},IsSet:function(e){var t=!1;return null!==e&&"undefined"!=typeof e&&""!==e||(t=!0),!t},IsEventSupported:function(e){var t=document.createElement("div");e="on"+e;var o=e in t;return o||(t.setAttribute(e,"return;"),o="function"==typeof t[e]),t=null,o},IsFunction:function(e){return e&&"[object Function]"==={}.toString.call(e)},IsUrlExternal:function(e){var t=e.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof t[1]&&t[1].length>0&&t[1].toLowerCase()!==location.protocol||"string"==typeof t[2]&&t[2].length>0&&t[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host},IsInIframe:function(){try{return window.self!==window.top}catch(e){return!0}},HtmlEncode:function(e){return $("<div/>").text(e).html()},HtmlDecode:function(e){return $("<div/>").html(e).text()},FormatCurrency:function(e,t){return t+" "+e.toFixed(2).replace(/./g,function(e,t,o){return t>0&&"."!==e&&(o.length-t)%3===0?","+e:e})},FormatKilobytes:function(e){return e/=1024,e.toFixed(2).replace(/./g,function(e,t,o){return t>0&&"."!==e&&(o.length-t)%3===0?","+e:e})},FormatMegabytes:function(e){return e/=1024,e/=1024,currency+" "+e.toFixed(2).replace(/./g,function(e,t,o){return t>0&&"."!==e&&(o.length-t)%3===0?","+e:e})},ProcessResponse:function(e){var t="";e.Title&&(t="<strong>".concat(e.Title,"</strong><br />")),e.Success?$.hood.Alerts.Success("".concat(t).concat(e.Message)):$.hood.Alerts.Error("".concat(t).concat(e.Errors))},GetQueryStringParamByName:function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)","i"),o=t.exec(location.search);return null===o?"":decodeURIComponent(o[1].replace(/\+/g," "))},InsertQueryStringParam:function(e,t){e=escape(e),t=escape(t);var o=document.location.search.substr(1).split("&");if(""===o)document.location.search="?"+e+"="+t;else{for(var n,a=o.length;a--;)if(n=o[a].split("="),n[0]===e){n[1]=t,o[a]=n.join("=");break}a<0&&(o[o.length]=[e,t].join("=")),document.location.search=o.join("&")}},InsertQueryStringParamToUrl:function(e,t,o){t=escape(t),o=escape(o);var n=e.search.substr(1).split("&");if(""===n)e.search="?"+t+"="+o;else{for(var a,i=n.length;i--;)if(a=n[i].split("="),a[0]===t){a[1]=o,n[i]=a.join("=");break}i<0&&(n[n.length]=[t,o].join("=")),e.search=n.join("&")}return e},UrlToLocationObject:function(e){var t=document.createElement("a");return t.href=e,t},FindAndRemoveFromArray:function(e,t,o){$.each(e,function(n,a){a[t]===o&&e.splice(n,1)})},FindAndReturnFromArray:function(e,t,o){var n=null;return $.each(e,function(e,a){a[t]===o&&(n=a)}),n},LeftPad:function(e,t){for(var o=e+"";o.length<t;)o="0"+o;return o},DateAdd:function(e,t,o){var n=new Date(e);switch(t.toLowerCase()){case"year":n.setFullYear(n.getFullYear()+o);break;case"quarter":n.setMonth(n.getMonth()+3*o);break;case"month":n.setMonth(n.getMonth()+o);break;case"week":n.setDate(n.getDate()+7*o);break;case"day":n.setDate(n.getDate()+o);break;case"hour":n.setTime(n.getTime()+36e5*o);break;case"minute":n.setTime(n.getTime()+6e4*o);break;case"second":n.setTime(n.getTime()+1e3*o);break;default:n=void 0}return n},GenerateRandomString:function(e){var t="!@#$&*",o="abcdefghijklmnopqrstuvwxyz",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",a="0123456789",i=o+n+a,r=(t.pick(1)+o.pick(1)+n.pick(1)+i.pick(5,10)).shuffle();return r}},$.hood||($.hood={}),$.hood.Handlers={Init:function(){$("body").on("click",".select-text",$.hood.Handlers.SelectTextContent),$("body").on("click",".btn.click-select[data-target][data-value]",$.hood.Handlers.ClickSelect),$("body").on("click",".click-select.show-selected[data-target][data-value]",$.hood.Handlers.ClickSelect),$("body").on("click",".click-select:not(.show-selected)[data-target][data-value]",$.hood.Handlers.ClickSelectClean),$("body").on("click",".slide-link",$.hood.Handlers.SlideToAnchor),$("body").on("click",".scroll-target, .scroll-to-target",$.hood.Handlers.ScrollToTarget),$("body").on("click",".scroll-top, .scroll-to-top",$.hood.Handlers.ScrollToTop),$("body").on("change","input[type=checkbox][data-input]",$.hood.Handlers.CheckboxChange),$("body").on("change",".submit-on-change",$.hood.Handlers.SubmitOnChange),$("select[data-selected]").each($.hood.Handlers.SelectSetup),$("body").on("change",".inline-date",$.hood.Handlers.DateChange),$.hood.Handlers.Uploaders.Init(),$.hood.Handlers.ColorPickers()},ScrollToTop:function(e){return e&&e.preventDefault(),$("html, body").animate({scrollTop:0},800),!1},ScrollToTarget:function(e){e&&e.preventDefault();var t=$(this).attr("href").split("#")[0];if(t===window.location.pathname||""===t){var o=this.hash,n=$(o),a=$("header.header"),i=0;a&&(i=a.height()),$(this).data("offset")?$("html, body").stop().animate({scrollTop:n.offset().top-$(this).data("offset")},900,"swing"):$("html, body").stop().animate({scrollTop:n.offset().top-i},900,"swing")}},SubmitOnChange:function(e){e&&e.preventDefault(),$(this).parents("form").submit()},DateChange:function(e){e&&e.preventDefault();var t=$(this).parents(".hood-date").find(".date-output"),o=t.parents(".hood-date").find(".date-value").val(),n=/^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/;n.test(o)||(o="01/01/2001");var a=t.parents(".hood-date").find(".hour-value").val();$.isNumeric(a)||(a="00");var i=t.parents(".hood-date").find(".minute-value").val();$.isNumeric(i)||(i="00"),t.val(o+" "+a+":"+i+":00"),t.attr("value",o+" "+a+":"+i+":00")},CheckboxChange:function(e){e&&e.preventDefault();var t=new Array;$('input[data-input="'+$(this).data("input")+'"]').each(function(){$(this).is(":checked")&&t.push($(this).val())});var o="#"+$(this).data("input"),n=JSON.stringify(t);$(o).val(n)},SelectSetup:function(){$(this).data("selected");if("undefined"!==$(this).data("selected")&&""!==$(this).data("selected")){var e=String($(this).data("selected"));$(this).val(e)}},ClickSelect:function(){var e=$(this),t="#"+e.data("target");$(t).val(e.data("value")),$(t).trigger("change"),$('.click-select[data-target="'+e.data("target")+'"]').each(function(){$(this).html($(this).data("temp")).removeClass("active")}),$('.click-select[data-target="'+e.data("target")+'"][data-value="'+e.data("value")+'"]').each(function(){$(this).data("temp",$(this).html()).html("Selected").addClass("active")})},ClickSelectClean:function(){var e=$(this),t="#"+e.data("target");$(t).val(e.data("value")),$(t).trigger("change"),$('.click-select.clean[data-target="'+e.data("target")+'"]').each(function(){$(this).removeClass("active")}),$('.click-select.clean[data-target="'+e.data("target")+'"][data-value="'+e.data("value")+'"]').each(function(){$(this).addClass("active")})},SelectTextContent:function(){var e=$(this);e.select(),e.mouseup(function(){return e.unbind("mouseup"),!1})},SlideToAnchor:function(){var e=$("body").scrollTop(),t=$($.attr(this,"href")).offset().top;return $("html, body").animate({scrollTop:t},Math.abs(t-e)),!1},Uploaders:{Init:function(){($(".image-uploader").length||$(".gallery-uploader").length)&&($(".upload-progress-bar").hide(),$.getScript("/lib/dropzone/min/dropzone.min.js",$.proxy(function(){$(".image-uploader").each(function(){$.hood.Handlers.Uploaders.SingleImage($(this).attr("id"),$(this).data("json"))}),$(".gallery-uploader").each(function(){$.hood.Handlers.Uploaders.Gallery($(this).attr("id"),$(this).data("json"))})},this)))},RefreshImage:function(e){$("."+e.Class).css({"background-image":"url("+e.Image+")"}),$("."+e.Class).find("img").attr("src",e.Image)},SingleImage:function(e,t){e="#"+e;$(e);Dropzone.autoDiscover=!1;var o=new Dropzone(e,{url:$(e).data("url"),maxFiles:1,paramName:"file",parallelUploads:1,autoProcessQueue:!0,previewsContainer:!1,clickable:e});o.on("addedfile",function(){}),o.on("totaluploadprogress",function(t){$(".upload-progress-bar."+e.replace("#","")+" .progress-bar").css({width:t+"%"})}),o.on("sending",function(t){$(".upload-progress-bar."+e.replace("#","")).show(),$($(e).data("preview")).addClass("loading")}),o.on("queuecomplete",function(t){$(".upload-progress-bar."+e.replace("#","")).hide()}),o.on("success",function(n,a){a.Success?(a.Media&&($(t).val(JSON.stringify(a.Media)),$($(e).data("preview")).css({"background-image":"url("+a.Media.SmallUrl+")"}),$($(e).data("preview")).find("img").attr("src",a.Media.SmallUrl)),$.hood.Alerts.Success("New image added!")):$.hood.Alerts.Error("There was a problem adding the image: "+a.Error),o.removeFile(n),$($(e).data("preview")).removeClass("loading")})},Gallery:function(e){Dropzone.autoDiscover=!1;var t=document.querySelector(e+"-template");t.id="";var o=t.parentNode.innerHTML;t.parentNode.removeChild(t);var n=new Dropzone(e,{url:$(e).data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:o,paramName:"files",autoProcessQueue:!0,previewsContainer:"#previews",clickable:".fileinput-button",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!"});$(e+" .cancel").hide(),n.on("addedfile",function(t){$(t.previewElement.querySelector(".complete")).hide(),$(t.previewElement.querySelector(".cancel")).show(),$(e+" .cancel").show()}),n.on("totaluploadprogress",function(e){document.querySelector("#total-progress .progress-bar").style.width=e+"%"}),n.on("sending",function(e){document.querySelector("#total-progress").style.opacity="1"}),n.on("complete",function(e){$(e.previewElement.querySelector(".cancel")).hide(),$(e.previewElement.querySelector(".progress")).hide(),$(e.previewElement.querySelector(".complete")).show(),$.hood.Inline.Refresh(".gallery")}),n.on("queuecomplete",function(t){document.querySelector("#total-progress").style.opacity="0",$(e+" .cancel").hide()}),n.on("success",function(e,t){$.hood.Inline.Refresh(".gallery"),t.Success?$.hood.Alerts.Success("New images added!"):$.hood.Alerts.Error("There was a problem adding the profile image: "+t.Error)}),document.querySelector(".actions .cancel").onclick=function(){n.removeAllFiles(!0)}}},ColorPickers:function(){var e=function(e,t){var o=$(t._root.button).parent().data("target");$(t._root.button).css({"background-color":e.toHEXA().toString()});var n=t.getColor().toHEXA(),a="";for(i=n.length-1;i>=0;i--)a=n[i]+a;$(o).val("#"+a)},t=[];$(".color-picker").each(function(o,n){var a=Pickr.create({el:n.children[0],appClass:"custom-class",theme:"monolith",useAsButton:!0,defaultRepresentation:"HEXA",position:"bottom-end",components:{opacity:!0,hue:!0,interaction:{hex:!1,rgba:!1,hsva:!1,input:!0,clear:!0}}}).on("init",function(t){var o=$(t._root.button).parent().data("target"),n=$(o).val();$(o).on("click",$.proxy(function(){this.show()},t)),t.setColor(n),e(t.getColor(),t)}).on("clear",function(t){var o=$(t._root.button).parent().data("target");t.setColor("transparent"),e(t.getColor(),t),$(o).val("")}).on("change",e);t.push(a)})}},$(document).ready($.hood.Handlers.Init),String.prototype.contains=function(e){return this.indexOf(e)!==-1},String.prototype.pick=function(e,t){var o,n="";o="undefined"==typeof t?e:e+Math.floor(Math.random()*(t-e));for(var a=0;a<o;a++)n+=this.charAt(Math.floor(Math.random()*this.length));return n},String.prototype.shuffle=function(){var e,t,o=this.split(""),n=o.length;if(n)for(;--n;)t=Math.floor(Math.random()*(n+1)),e=o[t],o[t]=o[n],o[n]=e;return o.join("")},String.prototype.toSeoUrl=function(){var e=this.replace(/[^a-zA-Z0-9]/g," ").replace(/\s+/g,"-").toLowerCase();"-"===e.charAt(0)&&(e=e.substring(1));var t=e.length-1;return"-"===e.charAt(t)&&(e=e.substring(0,t)),e},$.hood||($.hood={}),$.hood.FormValidator=function(e,t){this.Options=$.extend({formTag:e,validationRules:null,validationMessages:{},placeBelow:!0,submitButtonTag:null,submitUrl:null,submitFunction:null,serializationFunction:function(){var e=$(this.formTag).serialize();return e}},t||{}),this.LoadValidation=function(){$.hood.Helpers.IsNullOrUndefined(this.Options.formTag)||($(this.Options.formTag).find("input, textarea, select").keypress($.proxy(function(e){if(13===e.which)return $.proxy(this.submitForm(),this),e.preventDefault(),!1},this)),$(this.Options.formTag).validate({submitHandler:function(e){e.preventDefault()},errorClass:this.Options.errorClass,focusInvalid:!1,rules:this.Options.validationRules,messages:this.Options.validationMessages}),$.hood.Helpers.IsNullOrUndefined(this.Options.submitButtonTag)||$(this.Options.submitButtonTag).click($.proxy(this.submitForm,this)))},this.submitForm=function(){$(this.Options.formTag).valid()&&(this.TempButtonContent=$(this.Options.submitButtonTag).removeClass("btn-primary").addClass("btn-default").html(),$(this.Options.submitButtonTag).removeClass("btn-primary").addClass("btn-default").html('<i class="fa fa-refresh fa-spin"></i>&nbsp;Loading...'),$(this.Options.formTag).find("input[type=checkbox]").each(function(){$(this).is(":checked")&&$(this).val("true")}),$.post(this.Options.submitUrl,this.Options.serializationFunction(),$.proxy(function(e){$(this.Options.submitButtonTag).removeClass("btn-default").addClass("btn-primary").html(this.TempButtonContent),this.Options.submitFunction(e)},this)))},this.LoadValidation(),this.Options.placeBelow&&$(this.Options.formTag).addClass("validation-below")},$.fn.hoodValidator=function(e){return this.each(function(){var t=$(this);if(!t.data("hoodValidator")){var o=new $.hood.FormValidator(this,e);t.data("hoodValidator",o)}})},$.hood||($.hood={}),$.hood.Addresses={Init:function(){$("body").on("click",".address-set-billing",$.hood.Addresses.SetBilling),$("body").on("click",".address-set-delivery",$.hood.Addresses.SetDelivery),$("body").on("click",".address-delete",$.hood.Addresses.Delete)},Lists:{Address:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#address-list").doesExist()&&$.hood.Inline.Reload($("#address-list"),e)}}},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload(),e.Success&&t&&t.data("redirect")&&($.hood.Alerts.Success("<strong>Address deleted, redirecting...</strong><br />Just taking you back to the address list."),setTimeout(function(){window.location=t.data("redirect")},1500))})};$.hood.Alerts.Confirm("The address will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},CreateOrEdit:function(){$.hood.Google.Addresses.InitAutocomplete(),$("#address-form").hoodValidator({validationRules:{Number:{required:!0},Address1:{required:!0},City:{required:!0},County:{required:!0},Postcode:{required:!0},Country:{required:!0}},submitButtonTag:$("#address-form-submit"),submitUrl:$("#address-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload(),e.Success&&$.hood.Inline.CloseModal()}})},SetBilling:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload()})};$.hood.Alerts.Confirm("The current billing address will be overwritten.","Are you sure?",o,"error")},SetDelivery:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload()})};$.hood.Alerts.Confirm("The current delivery address will be overwritten.","Are you sure?",o,"error")}},$(document).ready($.hood.Addresses.Init);var swalWithBootstrapButtons=Swal.mixin({customClass:{confirmButton:"btn btn-success btn-lg m-1 pl-4 pr-4",cancelButton:"btn btn-danger btn-lg m-1"},buttonsStyling:!1}),Toast=Swal.mixin({toast:!0,position:"top-end",showConfirmButton:!0});$.hood||($.hood={}),$.hood.Alerts={Error:function(e,t,o,n,a,i,r){o===!0?this.SweetAlert(e,t,"error",n,a,i,r):this.Alert(e,t,"error")},Warning:function(e,t,o,n,a,i,r){o===!0?this.SweetAlert(e,t,"warning",n,a,i,r):this.Alert(e,t,"warning")},Message:function(e,t,o,n,a,i,r){o===!0?this.SweetAlert(e,t,"info",n,a,i,r):this.Alert(e,t,"info")},Success:function(e,t,o,n,a,i,r){o===!0?this.SweetAlert(e,t,"success",n,a,i,r):this.Alert(e,t,"success")},Alert:function(e,t,o){Toast.fire({type:o||"info",html:e,title:t})},SweetAlert:function(e,t,o,n,a,i,r){swalWithBootstrapButtons.fire({title:t,html:e,type:o||"info",footer:n,showConfirmButton:a,timer:i}).then(function(e){e.dismiss||r(e)})},Confirm:function(e,t,o,n,a,i,r){swalWithBootstrapButtons.fire({title:t||"Woah!",html:e||"Are you sure you want to do this?",type:n||"warning",footer:a||'<span class="text-warning"><i class="fa fa-exclamation-triangle"></i> This cannot be undone.</span>',showCancelButton:!0,confirmButtonText:i||"Ok",cancelButtonText:r||"Cancel"}).then(function(e){e.dismiss||o(e.value)})},Prompt:function(e,t,o,n,a,i,r,s,l){swalWithBootstrapButtons.fire({input:n||"text",inputAttributes:l||{autocapitalize:"off"},title:t||"Enter a value",html:e||"Fill in the field and press Ok to continue.",type:a||"info",footer:i,showCancelButton:!0,confirmButtonText:r||"Ok",cancelButtonText:s||"Cancel"}).then(function(e){e.dismiss||o(e.value)})}},$.hood||($.hood={}),$.hood.Forms={Init:function(){$(".floating-label > label").each(function(){var e=$(this);e.parent().append(e)})},GetAllowedExtensions:function(e){switch(e){case"Image":return["png","jpg","jpeg","bmp","gif"];case"Document":return["doc","docx","pdf","rtf"];case"All":return""}},GetAllowedFiles:function(e){switch(e){case"Image":return"image/png,jpg,image/jpeg,image/gif";case"Document":return"application/msword,application/pdf,text/rtf";case"All":return""}}},$(document).ready($.hood.Forms.Init),$.hood||($.hood={}),$.hood.Inline={Tags:{},Init:function(){$(".hood-inline:not(.refresh)").each($.hood.Inline.Load),$("body").on("click",".hood-inline-task",$.hood.Inline.Task),$("body").on("click",".hood-modal",function(e){e.preventDefault(),$.hood.Inline.Modal($(this).attr("href"),$(this).data("complete"))}),$.hood.Inline.DataList.Init()},Refresh:function(e){$(e||".hood-inline").each($.hood.Inline.Load)},Load:function(){$.hood.Inline.Reload(this)},Reload:function(e,t){var o=$(e);o.addClass("loading"),t||(t=o.data("complete"));var n=o.data("url");$.get(n,$.proxy(function(e){$(this).html(e),$(this).removeClass("loading")},o)).done(function(){$.hood.Inline.RunComplete(t)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},CurrentModal:null,Modal:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o&&$.hood.Inline.CurrentModal&&$.hood.Inline.CurrentModal.modal("hide"),$.get(e,function(e){var t="#"+$(e).attr("id");$(e).addClass("hood-inline-modal"),$(t).length&&$(t).remove(),$("body").append(e),$.hood.Inline.CurrentModal=$(t),$(t).modal(),$(t).on("shown.bs.modal",function(){$(document).off("focusin.modal")}),$(t).on("hidden.bs.modal",function(e){$(this).remove()})}).done(function(){$.hood.Inline.RunComplete(t)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},CloseModal:function(){$.hood.Inline.CurrentModal&&$.hood.Inline.CurrentModal.modal("hide")},Task:function(e){e.preventDefault();var t=$(e.currentTarget);t.addClass("loading"),complete=t.data("complete"),$.get(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),e.Success&&t&&t.data("redirect")&&setTimeout(function(){window.location=t.data("redirect")},1500),t.removeClass("loading")}).done(function(){$.hood.Inline.RunComplete(complete)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},DataList:{Init:function(){$(".hood-inline-list.query").each(function(){$(this).data("url",$(this).data("url")+window.location.search)}),$(".hood-inline-list:not(.refresh)").each($.hood.Inline.Load),$("body").on("click",".hood-inline-list .pagination a",function(e){e.preventDefault(),$.hood.Loader(!0);var t=document.createElement("a");t.href=$(this).attr("href");var o=$(this).parents(".hood-inline-list"),n=document.createElement("a");n.href=o.data("url"),n.search=t.search,$.hood.Inline.DataList.Reload(o,n)}),$("body").on("submit",".hood-inline-list form",function(e){e.preventDefault(),$.hood.Loader(!0);var t=$(this),o=t.parents(".hood-inline-list"),n=document.createElement("a");n.href=o.data("url"),n.search="?"+t.serialize(),$.hood.Inline.DataList.Reload(o,n)}),$("body").on("submit","form.inline",function(e){e.preventDefault(),$.hood.Loader(!0);var t=$(this),o=$(t.data("target")),n=document.createElement("a");n.href=o.data("url"),n.search="?"+t.serialize(),$.hood.Inline.DataList.Reload(o,n)}),$("body").on("change","form.inline .refresh-on-change, .hood-inline-list form",function(e){e.preventDefault(),$.hood.Loader(!0);var t=$(this).parents("form"),o=$(t.data("target")),n=document.createElement("a");n.href=o.data("url"),n.search="?"+t.serialize(),$.hood.Inline.DataList.Reload(o,n)})},Reload:function(e,t){if(history.pushState&&e.hasClass("query")){var o=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+t.href.substring(t.href.indexOf("?")+1);window.history.pushState({path:o},"",o)}e.data("url",$.hood.Helpers.InsertQueryStringParamToUrl(t,"inline","true")),$.hood.Inline.Reload(e)}},HandleError:function(e){500===e.status?$.hood.Alerts.Error("<strong>Error "+e.status+"</strong><br />There was an error processing the content, please contact an administrator if this continues.<br/>"):404===e.status?$.hood.Alerts.Error("<strong>Error "+e.status+"</strong><br />The content could not be found.<br/>"):401===e.status&&($.hood.Alerts.Error("<strong>Error "+e.status+"</strong><br />You are not allowed to view this resource, are you logged in correctly?<br/>"),window.location=window.location)},Finish:function(e){$.hood.Loader(!1)},RunComplete:function RunComplete(complete){if(!$.hood.Helpers.IsNullOrUndefined(complete)){var func=eval(complete);"function"==typeof func&&func()}}},$(document).ready($.hood.Inline.Init),$.hood.Modals={Open:$.hood.Inline.Modal},$.hood||($.hood={}),$.hood.Media={Init:function(){$("body").on("click",".media-delete",$.hood.Media.Delete),$("body").on("click",".media-directories-delete",$.hood.Media.Directories.Delete),$.hood.Media.Upload.Init(),$.hood.Media.Actions.Init()},Loaded:function(e){$.hood.Loader(!1)},BladeLoaded:function(e){$.hood.Media.LoadMediaPlayers()},Reload:function(e){$.hood.Inline.Reload($("#media-list"),e)},ReloadDirectories:function(e){$.hood.Inline.Reload($("#media-directories-list"),e)},Actions:{Init:function(){$("body").on("click",".hood-image-attach",$.hood.Media.Actions.Load.Attach),$("body").on("click",".hood-image-clear",$.hood.Media.Actions.Complete.Clear),$("body").on("click",".hood-image-insert",$.hood.Media.Actions.Load.Insert),$("body").on("click",".hood-media-select",$.hood.Media.Actions.Load.Select)},Target:null,Json:null,Current:{Attach:null},Load:{Attach:function(e){e.preventDefault(),$.hood.Media.Actions.Target=$($(this).data("tag")),$.hood.Media.Actions.Json=$($(this).data("json")),$.hood.Inline.Modal($(this).data("url"),function(){$.hood.Media.Reload(function(){$("body").off("click",".media-attach"),$("body").on("click",".media-attach",$.hood.Media.Actions.Complete.Attach)}),$.hood.Media.Upload.Init()})},Insert:function(e){var t=$("#"+e.id);t.data("imagesUrl")&&e.addButton("hoodimage",{text:"Insert image...",icon:!1,onclick:$.proxy(function(t){$.hood.Inline.Modal($(this).data("imagesUrl"),function(){$.hood.Media.Reload(function(){$("body").off("click"),$("body").on("click",".media-insert",$.proxy($.hood.Media.Actions.Complete.Insert,e))}),$.hood.Media.Upload.Init()})},t)})},Select:function(e){$.hood.Media.Actions.Target=$($(this).data("target")),$.hood.Inline.Modal($(this).data("url"),function(){$.hood.Media.Reload(function(){$("body").off("click",".media-select"),$("body").on("click",".media-select",$.hood.Media.Actions.Complete.Select)}),$.hood.Media.Upload.Init()})}},Complete:{Attach:function(e){e.preventDefault();var t=$.hood.Media.Actions.Target,o=$.hood.Media.Actions.Json;$.post($(this).data("url"),function(e){if($.hood.Helpers.ProcessResponse(e),e.Success){var n=e.Media.Icon;"Image"===e.Media.GeneralFileType&&(n=e.Media.MediumUrl),$.hood.Helpers.IsNullOrUndefined(t)||(t.css({"background-image":"url("+n+")"}),t.find("img").attr("src",n),t.removeClass("loading")),$.hood.Helpers.IsNullOrUndefined(o)||o.val(e.MediaJson)}}).done(function(){$("#media-select-modal").modal("hide")}).fail($.hood.Inline.HandleError)},Insert:function(e){var t=$(e.target),o=this;o.insertContent('<img alt="'+t.data("title")+'" src="'+t.data("url")+'"/>'),$.hood.Inline.CloseModal()},Select:function(e){var t=$(this).data("url"),o=$.hood.Media.Actions.Target;$(o).each(function(){$(this).is("input")?$(this).val(t):($(this).attr("src",t),$(this).css({"background-image":"url("+t+")"}),$(this).find("img").attr("src",t))}),$.hood.Alerts.Success("Image URL has been inserted.<br /><strong>Remember to press save!</strong>"),$("#media-select-modal").modal("hide")},Clear:function(e){e.preventDefault();var t=$($(this).data("tag")),o=$($(this).data("json"));$.post($(this).data("url"),function(e){$.hood.Helpers.ProcessResponse(e),e.Success&&(icon=e.Media.Icon,"Image"===e.Media.GeneralFileType&&(icon=e.Media.MediumUrl),$.hood.Helpers.IsNullOrUndefined(t)||(t.css({"background-image":"url("+icon+")"}),t.find("img").attr("src",icon),t.removeClass("loading")),$.hood.Helpers.IsNullOrUndefined(o)||o.val(e.Json))}).fail($.hood.Inline.HandleError)}},RefreshImage:function(e,t,o){
var n=$(e);n.addClass("loading"),$.get(t,{id:o},$.proxy(function(e){n.css({"background-image":"url("+e.SmallUrl+")"}),n.find("img").attr("src",e.SmallUrl),n.removeClass("loading")},this))}},Upload:{Init:function(){if($("#media-add").doesExist()){$("#media-total-progress").hide(),Dropzone.autoDiscover=!1;var e=new Dropzone("#media-upload",{url:$.hood.Media.Upload.UploadUrl,thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:!1,paramName:"files",autoProcessQueue:!0,previewsContainer:!1,clickable:"#media-add",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!"});e.on("success",function(e,t){$.hood.Helpers.ProcessResponse(t)}),e.on("addedfile",function(e){$("#media-total-progress .progress-bar").css({width:"0%"}),$("#media-total-progress .progress-bar .percentage").html("0%")}),e.on("totaluploadprogress",function(e){$("#media-total-progress .progress-bar").css({width:e+"%"}),$("#media-total-progress .progress-bar .percentage").html(e+"%")}),e.on("sending",function(e){$("#media-total-progress").fadeIn(),$("#media-total-progress .progress-bar").css({width:"0%"}),$("#media-total-progress .progress-bar .percentage").html("0%")}),e.on("complete",function(e){$.hood.Media.Reload()}),e.on("queuecomplete",function(e){$("#media-total-progress").hide(),$.hood.Media.Reload()})}},UploadUrl:function(){return $("#media-upload").data("url")+"?directoryId="+$("input[type='radio'][name='dir']:checked").val()}},Delete:function(e){var t=$(this),o=function(e){e&&$.post("/admin/media/delete",{id:t.data("id")},function(e){$.hood.Helpers.ProcessResponse(e),e.Success&&($.hood.Media.Reload(),$(".modal-backdrop").remove(),$(".modal").modal("hide"))})};$.hood.Alerts.Confirm("The media file will be permanently removed. This cannot be undone.","Are you sure?",o,"warning",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> Ensure this file is not attached to any posts, pages or features of the site, or it will appear as a broken image or file.</span>',"Ok","Cancel")},RestrictDir:function(){var e=/[^0-9A-Za-z- ]*/g,t=$(this).val(),o=t.replace(e,"");t!==o&&$(this).val(o)},Directories:{Editor:function(){$("#content-directories-edit-form").hoodValidator({validationRules:{DisplayName:{required:!0},Slug:{required:!0}},submitButtonTag:$("#content-directories-edit-submit"),submitUrl:$("#content-directories-edit-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Media.ReloadDirectories(),$.hood.Media.Reload()}})},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Media.ReloadDirectories(),$.hood.Media.Reload()})};$.hood.Alerts.Confirm("The directory and all files will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle mr-2"></i><strong>This cannot be undone!</strong><br />Ensure these files are not attached to any posts, pages or features of the site, or it will appear as a broken image or file.</span>')}},Players:{},LoadMediaPlayers:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".hood-media",t={techOrder:["azureHtml5JS","flashSS","html5FairPlayHLS","silverlightSS","html5"],nativeControlsForTouch:!1,controls:!0,autoplay:!1,seeking:!0};$(e).each(function(){try{if(player=$.hood.Media.Players[$(this).data("id")],player)try{player.dispose()}catch(e){console.log("There was a problem disposing the old media player: ".concat(e))}$.hood.Media.Players[$(this).data("id")]=amp($(this).attr("id"),t),player=$.hood.Media.Players[$(this).data("id")],player.src([{src:$(this).data("file"),type:$(this).data("type")}])}catch(e){console.log("There was a problem playing the media file: ".concat(e))}})}},$(document).ready($.hood.Media.Init);
"use strict";var console={};console.log=function(){},window.console=console,$.hood||($.hood={}),$.body=$("body");var console=window.console||{};console.log=console.log||function(){},console.warn=console.warn||function(){},console.error=console.error||function(){},console.info=console.info||function(){},$.fn.exists=function(){return $(this).length},$.fn.doesExist=function(){return $(this).length},$.fn.restrictToSlug=function(e){var t=$(this),o=e||/[^0-9a-zA-Z]*/g,n=function(){var e=$(this).val(),t=e.replace(o,"");e!==t&&$(this).val(t)};t.on("keyup",n),t.on("paste",n),t.on("change",n)},$(".restrict-to-slug").restrictToSlug(),$.fn.restrictToPageSlug=function(e){var t=$(this),o=e||/[^0-9a-zA-Z-\/\/]*/g,n=function(){var e=$(this).val(),t=e.replace(o,"");if((t.match(new RegExp("/","g"))||[]).length>4){var n=t.lastIndexOf("/");t=t.substring(0,n)+t.substring(n+1),$.hood.Alerts.Warning("You can only have up to 4 '/' characters in a url slug.")}e!==t&&$(this).val(t)};t.on("keyup",n),t.on("paste",n),t.on("change",n)},$(".restrict-to-page-slug").restrictToPageSlug(),$.fn.restrictToMetaSlug=function(e){var t=$(this),o=e||/[^0-9a-zA-Z.]*/g,n=function(){var e=$(this).val(),t=e.replace(o,"");if((t.match(new RegExp(".","g"))||[]).length>1){var n=t.lastIndexOf(".");t=t.substring(0,n)+t.substring(n+1),$.hood.Alerts.Warning("You can only have up to 1 '.' characters in a meta slug.")}e!==t&&$(this).val(t)};t.on("keyup",n),t.on("paste",n),t.on("change",n)},$(".restrict-to-meta-slug").restrictToMetaSlug(),$.fn.characterCounter=function(e){var t=$(this),o=function(){var e=$(this).data("counter"),t=Number($(this).attr("maxlength")),o=$(this).val().length;$(e).text(t-o);var n="text-success";t-o<t/10&&(n="text-danger"),$(e).parent().removeClass("text-success").removeClass("text-danger").addClass(n)};t.on("keyup",o),t.on("paste",o),t.on("change",o)},$(".character-counter").characterCounter(),$(".character-counter").trigger("change"),$.fn.addLoader=function(){$(this).data("loadercontent",$(this).html()),$(this).addClass("loading").append('<i class="fa fa-refresh fa-spin m-l-sm"></i>')},$.fn.removeLoader=function(){$(this).empty().html($(this).data("loadercontent")),$(this).removeClass("loading")},$.fn.warningAlert=function(){var e=$(this),t=function(e){e.preventDefault();var t=function(t){if(t){var o=$(e.currentTarget).attr("href");window.location=o}};return $.hood.Alerts.Confirm($(e.currentTarget).data("warning"),$(e.currentTarget).data("title"),t,"warning",$(e.currentTarget).data("footer"),"Ok","Cancel"),!1};e.on("click",t)},$(".warning-alert").warningAlert(),$.commonHeight=function(e,t){var o=0;e.children(t).each(function(){var e=$(this).children();e.hasClass("max-height")?o=e.outerHeight():e.outerHeight()>o&&(o=e.outerHeight())}),e.children(t).each(function(){$(this).height(o)})},$.loadCss=function(e,t){$("link#"+e).length||$("<link/>",{id:e,rel:"stylesheet",type:"text/css",href:t}).appendTo("head")},$.getUrlVars=function(){for(var e,t=[],o=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),n=0;n<o.length;n++)e=o[n].split("="),t.push(e[0]),t[e[0]]=e[1];return t},$.decodeUrl=function(e){return decodeURIComponent(e).replace("+"," ")},$.numberWithCommas=function(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},$.validator&&($.validator.addMethod("time",function(e,t){return this.optional(t)||/^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(:([0-5]?[0-9]))?$/i.test(e)},"Please enter a valid time."),$.validator.addMethod("ukdate",function(e,t){return e.match(/^\d\d?\/\d\d?\/\d\d\d\d$/)},"Please enter a date in the format dd/mm/yyyy.")),$.mobile={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},Any:function(){return $.mobile.Android()||$.mobile.BlackBerry()||$.mobile.iOS()||$.mobile.Opera()||$.mobile.Windows()}},$.mobile.Android?$.mobile.BlackBerry?$.mobile.iOS?$.mobile.Opera?$.mobile.Windows?($.body.addClass("desktop-device"),$.device="desktop"):($.body.addClass("windows-device"),$.device="windows"):($.body.addClass("opera-device"),$.device="opera"):($.body.addClass("ios-device"),$.device="ios"):($.body.addClass("blackberry-device"),$.device="blackberry"):($.body.addClass("android-device"),$.device="android"),function(){var e={password:"0",username:"0"};$("body").on("change",".prevent-autocomplete",function(t){var o=$(this).attr("id");"0"!==e[o]&&e[o]===$(this).val()||$(this).val("")}),$("body").on("keyup",".prevent-autocomplete",function(t){var o=$(this).attr("id");e[o]=$(this).val()})}(),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var o=document.createEvent("CustomEvent");return o.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),o}return"function"!=typeof window.CustomEvent&&(e.prototype=window.Event.prototype,void(window.CustomEvent=e))}(),$.hood.LinkClasses=[{title:"None",value:""},{title:"Button link",value:"btn btn-default"},{title:"Theme coloured button link",value:"btn btn-primary"},{title:"Popup image/video",value:"colorbox-iframe"},{title:"Button popup link",value:"btn btn-default colorbox-iframe"},{title:"Theme coloured button popup link",value:"btn btn-primary colorbox-iframe"},{title:"Large link",value:"font-lg"},{title:"Large button link",value:"btn btn-default btn-lg"},{title:"Large theme coloured button link",value:"btn btn-primary btn-lg"},{title:"Large popup image/video",value:"font-lg colorbox-iframe"},{title:"Large Button popup link",value:"btn btn-default btn-lg colorbox-iframe"},{title:"Theme coloured button popup link",value:"btn btn-primary btn-lg colorbox-iframe"}],$.hood.ImageClasses=[{title:"None",value:""},{title:"Full Width",value:"user-image full"},{title:"Left Aligned",value:"user-image left"},{title:"Centered",value:"user-image center"},{title:"Right Aligned",value:"user-image right"},{title:"Inline with text, top aligned",value:"user-image inline top"},{title:"Inline with text, middle aligned",value:"user-image inline"},{title:"Inline with text, bottom aligned",value:"user-image inline bottom"},{title:"Pulled Left",value:"user-image pull-left"},{title:"Pulled Right",value:"user-image pull-right"}],new CustomEvent("loader-show"),new CustomEvent("loader-hide"),$.hood.Loader=function(e){e?$("body").trigger("loader-show"):$("body").trigger("loader-hide")},$.hood||($.hood={}),$.hood.Helpers={IsNullOrUndefined:function(e){var t=!1;return null!==e&&"undefined"!=typeof e&&""!==e||(t=!0),t},IsSet:function(e){var t=!1;return null!==e&&"undefined"!=typeof e&&""!==e||(t=!0),!t},IsEventSupported:function(e){var t=document.createElement("div");e="on"+e;var o=e in t;return o||(t.setAttribute(e,"return;"),o="function"==typeof t[e]),t=null,o},IsFunction:function(e){return e&&"[object Function]"==={}.toString.call(e)},IsUrlExternal:function(e){var t=e.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof t[1]&&t[1].length>0&&t[1].toLowerCase()!==location.protocol||"string"==typeof t[2]&&t[2].length>0&&t[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host},IsInIframe:function(){try{return window.self!==window.top}catch(e){return!0}},HtmlEncode:function(e){return $("<div/>").text(e).html()},HtmlDecode:function(e){return $("<div/>").html(e).text()},FormatCurrency:function(e,t){return t+" "+e.toFixed(2).replace(/./g,function(e,t,o){return t>0&&"."!==e&&(o.length-t)%3===0?","+e:e})},FormatKilobytes:function(e){return e/=1024,e.toFixed(2).replace(/./g,function(e,t,o){return t>0&&"."!==e&&(o.length-t)%3===0?","+e:e})},FormatMegabytes:function(e){return e/=1024,e/=1024,currency+" "+e.toFixed(2).replace(/./g,function(e,t,o){return t>0&&"."!==e&&(o.length-t)%3===0?","+e:e})},ProcessResponse:function(e){var t="";e.Title&&(t="<strong>".concat(e.Title,"</strong><br />")),e.Success?$.hood.Alerts.Success("".concat(t).concat(e.Message)):$.hood.Alerts.Error("".concat(t).concat(e.Errors))},GetQueryStringParamByName:function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)","i"),o=t.exec(location.search);return null===o?"":decodeURIComponent(o[1].replace(/\+/g," "))},InsertQueryStringParam:function(e,t){e=escape(e),t=escape(t);var o=document.location.search.substr(1).split("&");if(""===o)document.location.search="?"+e+"="+t;else{for(var n,a=o.length;a--;)if(n=o[a].split("="),n[0]===e){n[1]=t,o[a]=n.join("=");break}a<0&&(o[o.length]=[e,t].join("=")),document.location.search=o.join("&")}},InsertQueryStringParamToUrl:function(e,t,o){t=escape(t),o=escape(o);var n=e.search.substr(1).split("&");if(""===n)e.search="?"+t+"="+o;else{for(var a,i=n.length;i--;)if(a=n[i].split("="),a[0]===t){a[1]=o,n[i]=a.join("=");break}i<0&&(n[n.length]=[t,o].join("=")),e.search=n.join("&")}return e},UrlToLocationObject:function(e){var t=document.createElement("a");return t.href=e,t},FindAndRemoveFromArray:function(e,t,o){$.each(e,function(n,a){a[t]===o&&e.splice(n,1)})},FindAndReturnFromArray:function(e,t,o){var n=null;return $.each(e,function(e,a){a[t]===o&&(n=a)}),n},LeftPad:function(e,t){for(var o=e+"";o.length<t;)o="0"+o;return o},DateAdd:function(e,t,o){var n=new Date(e);switch(t.toLowerCase()){case"year":n.setFullYear(n.getFullYear()+o);break;case"quarter":n.setMonth(n.getMonth()+3*o);break;case"month":n.setMonth(n.getMonth()+o);break;case"week":n.setDate(n.getDate()+7*o);break;case"day":n.setDate(n.getDate()+o);break;case"hour":n.setTime(n.getTime()+36e5*o);break;case"minute":n.setTime(n.getTime()+6e4*o);break;case"second":n.setTime(n.getTime()+1e3*o);break;default:n=void 0}return n},GenerateRandomString:function(e){var t="!@#$&*",o="abcdefghijklmnopqrstuvwxyz",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",a="0123456789",i=o+n+a,r=(t.pick(1)+o.pick(1)+n.pick(1)+i.pick(5,10)).shuffle();return r}},$.hood||($.hood={}),$.hood.Handlers={Init:function(){$("body").on("click",".select-text",$.hood.Handlers.SelectTextContent),$("body").on("click",".btn.click-select[data-target][data-value]",$.hood.Handlers.ClickSelect),$("body").on("click",".click-select.show-selected[data-target][data-value]",$.hood.Handlers.ClickSelect),$("body").on("click",".click-select:not(.show-selected)[data-target][data-value]",$.hood.Handlers.ClickSelectClean),$("body").on("click",".slide-link",$.hood.Handlers.SlideToAnchor),$("body").on("click",".scroll-target, .scroll-to-target",$.hood.Handlers.ScrollToTarget),$("body").on("click",".scroll-top, .scroll-to-top",$.hood.Handlers.ScrollToTop),$("body").on("change","input[type=checkbox][data-input]",$.hood.Handlers.CheckboxChange),$("body").on("change",".submit-on-change",$.hood.Handlers.SubmitOnChange),$("select[data-selected]").each($.hood.Handlers.SelectSetup),$("body").on("change",".inline-date",$.hood.Handlers.DateChange),$.hood.Handlers.Uploaders.Init(),$.hood.Handlers.ColorPickers()},ScrollToTop:function(e){return e&&e.preventDefault(),$("html, body").animate({scrollTop:0},800),!1},ScrollToTarget:function(e){e&&e.preventDefault();var t=$(this).attr("href").split("#")[0];if(t===window.location.pathname||""===t){var o=this.hash,n=$(o),a=$("header.header"),i=0;a&&(i=a.height()),$(this).data("offset")?$("html, body").stop().animate({scrollTop:n.offset().top-$(this).data("offset")},900,"swing"):$("html, body").stop().animate({scrollTop:n.offset().top-i},900,"swing")}},SubmitOnChange:function(e){e&&e.preventDefault(),$(this).parents("form").submit()},DateChange:function(e){e&&e.preventDefault();var t=$(this).parents(".hood-date").find(".date-output"),o=t.parents(".hood-date").find(".date-value").val(),n=/^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/;n.test(o)||(o="01/01/2001");var a=t.parents(".hood-date").find(".hour-value").val();$.isNumeric(a)||(a="00");var i=t.parents(".hood-date").find(".minute-value").val();$.isNumeric(i)||(i="00"),t.val(o+" "+a+":"+i+":00"),t.attr("value",o+" "+a+":"+i+":00")},CheckboxChange:function(e){e&&e.preventDefault();var t=new Array;$('input[data-input="'+$(this).data("input")+'"]').each(function(){$(this).is(":checked")&&t.push($(this).val())});var o="#"+$(this).data("input"),n=JSON.stringify(t);$(o).val(n)},SelectSetup:function(){$(this).data("selected");if("undefined"!==$(this).data("selected")&&""!==$(this).data("selected")){var e=String($(this).data("selected"));$(this).val(e)}},ClickSelect:function(){var e=$(this),t="#"+e.data("target");$(t).val(e.data("value")),$(t).trigger("change"),$('.click-select[data-target="'+e.data("target")+'"]').each(function(){$(this).html($(this).data("temp")).removeClass("active")}),$('.click-select[data-target="'+e.data("target")+'"][data-value="'+e.data("value")+'"]').each(function(){$(this).data("temp",$(this).html()).html("Selected").addClass("active")})},ClickSelectClean:function(){var e=$(this),t="#"+e.data("target");$(t).val(e.data("value")),$(t).trigger("change"),$('.click-select.clean[data-target="'+e.data("target")+'"]').each(function(){$(this).removeClass("active")}),$('.click-select.clean[data-target="'+e.data("target")+'"][data-value="'+e.data("value")+'"]').each(function(){$(this).addClass("active")})},SelectTextContent:function(){var e=$(this);e.select(),e.mouseup(function(){return e.unbind("mouseup"),!1})},SlideToAnchor:function(){var e=$("body").scrollTop(),t=$($.attr(this,"href")).offset().top;return $("html, body").animate({scrollTop:t},Math.abs(t-e)),!1},Uploaders:{Init:function(){($(".image-uploader").length||$(".gallery-uploader").length)&&($(".upload-progress-bar").hide(),$.getScript("/lib/dropzone/min/dropzone.min.js",$.proxy(function(){$(".image-uploader").each(function(){$.hood.Handlers.Uploaders.SingleImage($(this).attr("id"),$(this).data("json"))}),$(".gallery-uploader").each(function(){$.hood.Handlers.Uploaders.Gallery($(this).attr("id"),$(this).data("json"))})},this)))},RefreshImage:function(e){$("."+e.Class).css({"background-image":"url("+e.Image+")"}),$("."+e.Class).find("img").attr("src",e.Image)},SingleImage:function(e,t){e="#"+e;$(e);Dropzone.autoDiscover=!1;var o=new Dropzone(e,{url:$(e).data("url"),maxFiles:1,paramName:"file",parallelUploads:1,autoProcessQueue:!0,previewsContainer:!1,clickable:e});o.on("addedfile",function(){}),o.on("totaluploadprogress",function(t){$(".upload-progress-bar."+e.replace("#","")+" .progress-bar").css({width:t+"%"})}),o.on("sending",function(t){$(".upload-progress-bar."+e.replace("#","")).show(),$($(e).data("preview")).addClass("loading")}),o.on("queuecomplete",function(t){$(".upload-progress-bar."+e.replace("#","")).hide()}),o.on("success",function(n,a){a.Success?(a.Media&&($(t).val(JSON.stringify(a.Media)),$($(e).data("preview")).css({"background-image":"url("+a.Media.SmallUrl+")"}),$($(e).data("preview")).find("img").attr("src",a.Media.SmallUrl)),$.hood.Alerts.Success("New image added!")):$.hood.Alerts.Error("There was a problem adding the image: "+a.Error),o.removeFile(n),$($(e).data("preview")).removeClass("loading")})},Gallery:function(e){Dropzone.autoDiscover=!1;var t=document.querySelector(e+"-template");t.id="";var o=t.parentNode.innerHTML;t.parentNode.removeChild(t);var n=new Dropzone(e,{url:$(e).data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:o,paramName:"files",autoProcessQueue:!0,previewsContainer:"#previews",clickable:".fileinput-button",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!"});$(e+" .cancel").hide(),n.on("addedfile",function(t){$(t.previewElement.querySelector(".complete")).hide(),$(t.previewElement.querySelector(".cancel")).show(),$(e+" .cancel").show()}),n.on("totaluploadprogress",function(e){document.querySelector("#total-progress .progress-bar").style.width=e+"%"}),n.on("sending",function(e){document.querySelector("#total-progress").style.opacity="1"}),n.on("complete",function(e){$(e.previewElement.querySelector(".cancel")).hide(),$(e.previewElement.querySelector(".progress")).hide(),$(e.previewElement.querySelector(".complete")).show(),$.hood.Inline.Refresh(".gallery")}),n.on("queuecomplete",function(t){document.querySelector("#total-progress").style.opacity="0",$(e+" .cancel").hide()}),n.on("success",function(e,t){$.hood.Inline.Refresh(".gallery"),t.Success?$.hood.Alerts.Success("New images added!"):$.hood.Alerts.Error("There was a problem adding the profile image: "+t.Error)}),document.querySelector(".actions .cancel").onclick=function(){n.removeAllFiles(!0)}}},ColorPickers:function(){var e=function(e,t){var o=$(t._root.button).parent().data("target");$(t._root.button).css({"background-color":e.toHEXA().toString()});var n=t.getColor().toHEXA(),a="";for(i=n.length-1;i>=0;i--)a=n[i]+a;$(o).val("#"+a)},t=[];$(".color-picker").each(function(o,n){var a=Pickr.create({el:n.children[0],appClass:"custom-class",theme:"monolith",useAsButton:!0,defaultRepresentation:"HEXA",position:"bottom-end",components:{opacity:!0,hue:!0,interaction:{hex:!1,rgba:!1,hsva:!1,input:!0,clear:!0}}}).on("init",function(t){var o=$(t._root.button).parent().data("target"),n=$(o).val();$(o).on("click",$.proxy(function(){this.show()},t)),t.setColor(n),e(t.getColor(),t)}).on("clear",function(t){var o=$(t._root.button).parent().data("target");t.setColor("transparent"),e(t.getColor(),t),$(o).val("")}).on("change",e);t.push(a)})}},$(document).ready($.hood.Handlers.Init),String.prototype.contains=function(e){return this.indexOf(e)!==-1},String.prototype.pick=function(e,t){var o,n="";o="undefined"==typeof t?e:e+Math.floor(Math.random()*(t-e));for(var a=0;a<o;a++)n+=this.charAt(Math.floor(Math.random()*this.length));return n},String.prototype.shuffle=function(){var e,t,o=this.split(""),n=o.length;if(n)for(;--n;)t=Math.floor(Math.random()*(n+1)),e=o[t],o[t]=o[n],o[n]=e;return o.join("")},String.prototype.toSeoUrl=function(){var e=this.replace(/[^a-zA-Z0-9]/g," ").replace(/\s+/g,"-").toLowerCase();"-"===e.charAt(0)&&(e=e.substring(1));var t=e.length-1;return"-"===e.charAt(t)&&(e=e.substring(0,t)),e},$.hood||($.hood={}),$.hood.FormValidator=function(e,t){this.Options=$.extend({formTag:e,validationRules:null,validationMessages:{},placeBelow:!0,submitButtonTag:null,submitUrl:null,submitFunction:null,serializationFunction:function(){var e=$(this.formTag).serialize();return e}},t||{}),this.LoadValidation=function(){$.hood.Helpers.IsNullOrUndefined(this.Options.formTag)||($(this.Options.formTag).find("input, textarea, select").keypress($.proxy(function(e){if(13===e.which)return $.proxy(this.submitForm(),this),e.preventDefault(),!1},this)),$(this.Options.formTag).validate({submitHandler:function(e){e.preventDefault()},errorClass:this.Options.errorClass,focusInvalid:!1,rules:this.Options.validationRules,messages:this.Options.validationMessages}),$.hood.Helpers.IsNullOrUndefined(this.Options.submitButtonTag)||$(this.Options.submitButtonTag).click($.proxy(this.submitForm,this)))},this.submitForm=function(){$(this.Options.formTag).valid()&&(this.TempButtonContent=$(this.Options.submitButtonTag).removeClass("btn-primary").addClass("btn-default").html(),$(this.Options.submitButtonTag).removeClass("btn-primary").addClass("btn-default").html('<i class="fa fa-refresh fa-spin"></i>&nbsp;Loading...'),$(this.Options.formTag).find("input[type=checkbox]").each(function(){$(this).is(":checked")&&$(this).val("true")}),$.post(this.Options.submitUrl,this.Options.serializationFunction(),$.proxy(function(e){$(this.Options.submitButtonTag).removeClass("btn-default").addClass("btn-primary").html(this.TempButtonContent),this.Options.submitFunction(e)},this)))},this.LoadValidation(),this.Options.placeBelow&&$(this.Options.formTag).addClass("validation-below")},$.fn.hoodValidator=function(e){return this.each(function(){var t=$(this);if(!t.data("hoodValidator")){var o=new $.hood.FormValidator(this,e);t.data("hoodValidator",o)}})},$.hood||($.hood={}),$.hood.Addresses={Init:function(){$("body").on("click",".address-set-billing",$.hood.Addresses.SetBilling),$("body").on("click",".address-set-delivery",$.hood.Addresses.SetDelivery),$("body").on("click",".address-delete",$.hood.Addresses.Delete)},Lists:{Address:{Loaded:function(e){$.hood.Loader(!1)},Reload:function(e){$("#address-list").doesExist()&&$.hood.Inline.Reload($("#address-list"),e)}}},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload(),e.Success&&t&&t.data("redirect")&&($.hood.Alerts.Success("<strong>Address deleted, redirecting...</strong><br />Just taking you back to the address list."),setTimeout(function(){window.location=t.data("redirect")},1500))})};$.hood.Alerts.Confirm("The address will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> <strong>This process CANNOT be undone!</strong></span>')},CreateOrEdit:function(){$.hood.Google.Addresses.InitAutocomplete(),$("#address-form").hoodValidator({validationRules:{Number:{required:!0},Address1:{required:!0},City:{required:!0},County:{required:!0},Postcode:{required:!0},Country:{required:!0}},submitButtonTag:$("#address-form-submit"),submitUrl:$("#address-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload(),e.Success&&$.hood.Inline.CloseModal()}})},SetBilling:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload()})};$.hood.Alerts.Confirm("The current billing address will be overwritten.","Are you sure?",o,"error")},SetDelivery:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Addresses.Lists.Address.Reload()})};$.hood.Alerts.Confirm("The current delivery address will be overwritten.","Are you sure?",o,"error")}},$(document).ready($.hood.Addresses.Init);var swalWithBootstrapButtons=Swal.mixin({customClass:{confirmButton:"btn btn-success btn-lg m-1 pl-4 pr-4",cancelButton:"btn btn-danger btn-lg m-1"},buttonsStyling:!1}),Toast=Swal.mixin({toast:!0,position:"top-end",showConfirmButton:!0});$.hood||($.hood={}),$.hood.Alerts={Error:function(e,t,o,n,a,i,r){o===!0?this.SweetAlert(e,t,"error",n,a,i,r):this.Alert(e,t,"error")},Warning:function(e,t,o,n,a,i,r){o===!0?this.SweetAlert(e,t,"warning",n,a,i,r):this.Alert(e,t,"warning")},Message:function(e,t,o,n,a,i,r){o===!0?this.SweetAlert(e,t,"info",n,a,i,r):this.Alert(e,t,"info")},Success:function(e,t,o,n,a,i,r){o===!0?this.SweetAlert(e,t,"success",n,a,i,r):this.Alert(e,t,"success")},Alert:function(e,t,o){Toast.fire({type:o||"info",html:e,title:t})},SweetAlert:function(e,t,o,n,a,i,r){swalWithBootstrapButtons.fire({title:t,html:e,type:o||"info",footer:n,showConfirmButton:a,timer:i}).then(function(e){e.dismiss||r(e)})},Confirm:function(e,t,o,n,a,i,r){swalWithBootstrapButtons.fire({title:t||"Woah!",html:e||"Are you sure you want to do this?",type:n||"warning",footer:a||'<span class="text-warning"><i class="fa fa-exclamation-triangle"></i> This cannot be undone.</span>',showCancelButton:!0,confirmButtonText:i||"Ok",cancelButtonText:r||"Cancel"}).then(function(e){e.dismiss||o(e.value)})},Prompt:function(e,t,o,n,a,i,r,s,l){swalWithBootstrapButtons.fire({input:n||"text",inputAttributes:l||{autocapitalize:"off"},title:t||"Enter a value",html:e||"Fill in the field and press Ok to continue.",type:a||"info",footer:i,showCancelButton:!0,confirmButtonText:r||"Ok",cancelButtonText:s||"Cancel"}).then(function(e){e.dismiss||o(e.value)})}},$.hood||($.hood={}),$.hood.Forms={Init:function(){$(".floating-label > label").each(function(){var e=$(this);e.parent().append(e)})},GetAllowedExtensions:function(e){switch(e){case"Image":return["png","jpg","jpeg","bmp","gif"];case"Document":return["doc","docx","pdf","rtf"];case"All":return""}},GetAllowedFiles:function(e){switch(e){case"Image":return"image/png,jpg,image/jpeg,image/gif";case"Document":return"application/msword,application/pdf,text/rtf";case"All":return""}}},$(document).ready($.hood.Forms.Init),$.hood||($.hood={}),$.hood.Inline={Tags:{},Init:function(){$(".hood-inline:not(.refresh)").each($.hood.Inline.Load),$("body").on("click",".hood-inline-task",$.hood.Inline.Task),$("body").on("click",".hood-modal",function(e){e.preventDefault(),$.hood.Inline.Modal($(this).attr("href"),$(this).data("complete"))}),$.hood.Inline.DataList.Init()},Refresh:function(e){$(e||".hood-inline").each($.hood.Inline.Load)},Load:function(){$.hood.Inline.Reload(this)},Reload:function(e,t){var o=$(e);o.addClass("loading"),t||(t=o.data("complete"));var n=o.data("url");$.get(n,$.proxy(function(e){o.html(e),o.removeClass("loading"),t&&$.hood.Inline.RunComplete(t,o,e)},o)).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},CurrentModal:null,Modal:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o&&$.hood.Inline.CurrentModal&&$.hood.Inline.CurrentModal.modal("hide"),$.get(e,function(e){var o="#"+$(e).attr("id");$(e).addClass("hood-inline-modal"),$(o).length&&$(o).remove(),$("body").append(e),$.hood.Inline.CurrentModal=$(o),$(o).modal(),$(o).on("shown.bs.modal",function(){$(document).off("focusin.modal")}),$(o).on("hidden.bs.modal",function(e){$(this).remove()}),t&&$.hood.Inline.RunComplete(t,$(o),e)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},CloseModal:function(){$.hood.Inline.CurrentModal&&$.hood.Inline.CurrentModal.modal("hide")},Task:function(e){e.preventDefault();var t=$(e.currentTarget);t.addClass("loading"),complete=t.data("complete"),$.get(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),e.Success&&t&&t.data("redirect")&&setTimeout(function(){window.location=t.data("redirect")},1500),t.removeClass("loading"),complete&&$.hood.Inline.RunComplete(complete,t,e)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},DataList:{Init:function(){$(".hood-inline-list.query").each(function(){$(this).data("url",$(this).data("url")+window.location.search)}),$(".hood-inline-list:not(.refresh)").each($.hood.Inline.Load),$("body").on("click",".hood-inline-list .pagination a",function(e){e.preventDefault(),$.hood.Loader(!0);var t=document.createElement("a");t.href=$(this).attr("href");var o=$(this).parents(".hood-inline-list"),n=document.createElement("a");n.href=o.data("url"),n.search=t.search,$.hood.Inline.DataList.Reload(o,n)}),$("body").on("submit",".hood-inline-list form",function(e){e.preventDefault(),$.hood.Loader(!0);var t=$(this),o=t.parents(".hood-inline-list"),n=document.createElement("a");n.href=o.data("url"),n.search="?"+t.serialize(),$.hood.Inline.DataList.Reload(o,n)}),$("body").on("submit","form.inline",function(e){e.preventDefault(),$.hood.Loader(!0);var t=$(this),o=$(t.data("target")),n=document.createElement("a");n.href=o.data("url"),n.search="?"+t.serialize(),$.hood.Inline.DataList.Reload(o,n)}),$("body").on("change","form.inline .refresh-on-change, .hood-inline-list form",function(e){e.preventDefault(),$.hood.Loader(!0);var t=$(this).parents("form"),o=$(t.data("target")),n=document.createElement("a");n.href=o.data("url"),n.search="?"+t.serialize(),$.hood.Inline.DataList.Reload(o,n)})},Reload:function(e,t){if(history.pushState&&e.hasClass("query")){var o=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+t.href.substring(t.href.indexOf("?")+1);window.history.pushState({path:o},"",o)}e.data("url",$.hood.Helpers.InsertQueryStringParamToUrl(t,"inline","true")),$.hood.Inline.Reload(e)}},HandleError:function(e){500===e.status?$.hood.Alerts.Error("<strong>Error "+e.status+"</strong><br />There was an error processing the content, please contact an administrator if this continues.<br/>"):404===e.status?$.hood.Alerts.Error("<strong>Error "+e.status+"</strong><br />The content could not be found.<br/>"):401===e.status&&($.hood.Alerts.Error("<strong>Error "+e.status+"</strong><br />You are not allowed to view this resource, are you logged in correctly?<br/>"),window.location=window.location)},Finish:function(e){$.hood.Loader(!1)},RunComplete:function RunComplete(complete,sender,data){if(!$.hood.Helpers.IsNullOrUndefined(complete)){var func=eval(complete);"function"==typeof func&&func(element,data)}}},$(document).ready($.hood.Inline.Init),$.hood.Modals={Open:$.hood.Inline.Modal},$.hood||($.hood={}),$.hood.Media={Init:function(){$("body").on("click",".media-delete",$.hood.Media.Delete),$("body").on("click",".media-directories-delete",$.hood.Media.Directories.Delete),$.hood.Media.Upload.Init(),$.hood.Media.Actions.Init()},Loaded:function(e){$.hood.Loader(!1)},BladeLoaded:function(e){$.hood.Media.LoadMediaPlayers()},Reload:function(e){$.hood.Inline.Reload($("#media-list"),e)},ReloadDirectories:function(e){$.hood.Inline.Reload($("#media-directories-list"),e)},Actions:{Init:function(){$("body").on("click",".hood-image-attach",$.hood.Media.Actions.Load.Attach),$("body").on("click",".hood-image-clear",$.hood.Media.Actions.Complete.Clear),$("body").on("click",".hood-image-insert",$.hood.Media.Actions.Load.Insert),$("body").on("click",".hood-media-select",$.hood.Media.Actions.Load.Select)},Target:null,Json:null,Current:{Attach:null},Load:{Attach:function(e){e.preventDefault(),$.hood.Media.Actions.Target=$($(this).data("tag")),$.hood.Media.Actions.Json=$($(this).data("json")),$.hood.Inline.Modal($(this).data("url"),function(){$.hood.Media.Reload(function(){$("body").off("click",".media-attach"),$("body").on("click",".media-attach",$.hood.Media.Actions.Complete.Attach)}),$.hood.Media.Upload.Init()})},Insert:function(e){var t=$("#"+e.id);t.data("imagesUrl")&&e.addButton("hoodimage",{text:"Insert image...",icon:!1,onclick:$.proxy(function(t){$.hood.Inline.Modal($(this).data("imagesUrl"),function(){$.hood.Media.Reload(function(){$("body").off("click"),$("body").on("click",".media-insert",$.proxy($.hood.Media.Actions.Complete.Insert,e))}),$.hood.Media.Upload.Init()})},t)})},Select:function(e){$.hood.Media.Actions.Target=$($(this).data("target")),$.hood.Inline.Modal($(this).data("url"),function(){$.hood.Media.Reload(function(){$("body").off("click",".media-select"),$("body").on("click",".media-select",$.hood.Media.Actions.Complete.Select)}),$.hood.Media.Upload.Init()})}},Complete:{Attach:function(e){e.preventDefault();var t=$.hood.Media.Actions.Target,o=$.hood.Media.Actions.Json;$.post($(this).data("url"),function(e){if($.hood.Helpers.ProcessResponse(e),e.Success){var n=e.Media.Icon;"Image"===e.Media.GeneralFileType&&(n=e.Media.MediumUrl),$.hood.Helpers.IsNullOrUndefined(t)||(t.css({"background-image":"url("+n+")"}),t.find("img").attr("src",n),t.removeClass("loading")),$.hood.Helpers.IsNullOrUndefined(o)||o.val(e.MediaJson)}}).done(function(){$("#media-select-modal").modal("hide")}).fail($.hood.Inline.HandleError)},Insert:function(e){var t=$(e.target),o=this;o.insertContent('<img alt="'+t.data("title")+'" src="'+t.data("url")+'"/>'),$.hood.Inline.CloseModal()},Select:function(e){var t=$(this).data("url"),o=$.hood.Media.Actions.Target;$(o).each(function(){$(this).is("input")?$(this).val(t):($(this).attr("src",t),$(this).css({"background-image":"url("+t+")"}),$(this).find("img").attr("src",t))}),$.hood.Alerts.Success("Image URL has been inserted.<br /><strong>Remember to press save!</strong>"),$("#media-select-modal").modal("hide")},Clear:function(e){e.preventDefault();var t=$($(this).data("tag")),o=$($(this).data("json"));$.post($(this).data("url"),function(e){$.hood.Helpers.ProcessResponse(e),e.Success&&(icon=e.Media.Icon,"Image"===e.Media.GeneralFileType&&(icon=e.Media.MediumUrl),$.hood.Helpers.IsNullOrUndefined(t)||(t.css({"background-image":"url("+icon+")"}),t.find("img").attr("src",icon),t.removeClass("loading")),$.hood.Helpers.IsNullOrUndefined(o)||o.val(e.Json))}).fail($.hood.Inline.HandleError)}},RefreshImage:function(e,t,o){var n=$(e);
n.addClass("loading"),$.get(t,{id:o},$.proxy(function(e){n.css({"background-image":"url("+e.SmallUrl+")"}),n.find("img").attr("src",e.SmallUrl),n.removeClass("loading")},this))}},Upload:{Init:function(){if($("#media-add").doesExist()){$("#media-total-progress").hide(),Dropzone.autoDiscover=!1;var e=new Dropzone("#media-upload",{url:$.hood.Media.Upload.UploadUrl,thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:!1,paramName:"files",autoProcessQueue:!0,previewsContainer:!1,clickable:"#media-add",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!"});e.on("success",function(e,t){$.hood.Helpers.ProcessResponse(t)}),e.on("addedfile",function(e){$("#media-total-progress .progress-bar").css({width:"0%"}),$("#media-total-progress .progress-bar .percentage").html("0%")}),e.on("totaluploadprogress",function(e){$("#media-total-progress .progress-bar").css({width:e+"%"}),$("#media-total-progress .progress-bar .percentage").html(e+"%")}),e.on("sending",function(e){$("#media-total-progress").fadeIn(),$("#media-total-progress .progress-bar").css({width:"0%"}),$("#media-total-progress .progress-bar .percentage").html("0%")}),e.on("complete",function(e){$.hood.Media.Reload()}),e.on("queuecomplete",function(e){$("#media-total-progress").hide(),$.hood.Media.Reload()})}},UploadUrl:function(){return $("#media-upload").data("url")+"?directoryId="+$("input[type='radio'][name='dir']:checked").val()}},Delete:function(e){var t=$(this),o=function(e){e&&$.post("/admin/media/delete",{id:t.data("id")},function(e){$.hood.Helpers.ProcessResponse(e),e.Success&&($.hood.Media.Reload(),$(".modal-backdrop").remove(),$(".modal").modal("hide"))})};$.hood.Alerts.Confirm("The media file will be permanently removed. This cannot be undone.","Are you sure?",o,"warning",'<span class="text-danger"><i class="fa fa-exclamation-triangle"></i> Ensure this file is not attached to any posts, pages or features of the site, or it will appear as a broken image or file.</span>',"Ok","Cancel")},RestrictDir:function(){var e=/[^0-9A-Za-z- ]*/g,t=$(this).val(),o=t.replace(e,"");t!==o&&$(this).val(o)},Directories:{Editor:function(){$("#content-directories-edit-form").hoodValidator({validationRules:{DisplayName:{required:!0},Slug:{required:!0}},submitButtonTag:$("#content-directories-edit-submit"),submitUrl:$("#content-directories-edit-form").attr("action"),submitFunction:function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Media.ReloadDirectories(),$.hood.Media.Reload()}})},Delete:function(e){e.preventDefault();var t=$(this),o=function(e){e&&$.post(t.attr("href"),function(e){$.hood.Helpers.ProcessResponse(e),$.hood.Media.ReloadDirectories(),$.hood.Media.Reload()})};$.hood.Alerts.Confirm("The directory and all files will be permanently removed.","Are you sure?",o,"error",'<span class="text-danger"><i class="fa fa-exclamation-triangle mr-2"></i><strong>This cannot be undone!</strong><br />Ensure these files are not attached to any posts, pages or features of the site, or it will appear as a broken image or file.</span>')}},Players:{},LoadMediaPlayers:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".hood-media",t={techOrder:["azureHtml5JS","flashSS","html5FairPlayHLS","silverlightSS","html5"],nativeControlsForTouch:!1,controls:!0,autoplay:!1,seeking:!0};$(e).each(function(){try{if(player=$.hood.Media.Players[$(this).data("id")],player)try{player.dispose()}catch(e){console.log("There was a problem disposing the old media player: ".concat(e))}$.hood.Media.Players[$(this).data("id")]=amp($(this).attr("id"),t),player=$.hood.Media.Players[$(this).data("id")],player.src([{src:$(this).data("file"),type:$(this).data("type")}])}catch(e){console.log("There was a problem playing the media file: ".concat(e))}})}},$(document).ready($.hood.Media.Init);

@@ -6,6 +6,6 @@ if (!$.hood)

Tags: {},
Init: function () {
Init: function() {
$('.hood-inline:not(.refresh)').each($.hood.Inline.Load);
$('body').on('click', '.hood-inline-task', $.hood.Inline.Task);
$('body').on('click', '.hood-modal', function (e) {
$('body').on('click', '.hood-modal', function(e) {
e.preventDefault();

@@ -16,9 +16,9 @@ $.hood.Inline.Modal($(this).attr('href'), $(this).data('complete'));

},
Refresh: function (tag) {
Refresh: function(tag) {
$(tag || '.hood-inline').each($.hood.Inline.Load);
},
Load: function () {
Load: function() {
$.hood.Inline.Reload(this);
},
Reload: function (tag, complete) {
Reload: function(tag, complete) {
let $tag = $(tag);

@@ -28,8 +28,10 @@ $tag.addClass('loading');

complete = $tag.data('complete');
var urlLoad = $tag.data('url');
$.get(urlLoad, $.proxy(function (data) {
$(this).html(data);
$(this).removeClass('loading');
let urlLoad = $tag.data('url');
$.get(urlLoad, $.proxy(function(data) {
$tag.html(data);
$tag.removeClass('loading');
if (complete) {
$.hood.Inline.RunComplete(complete, $tag, data);
}
}, $tag))
.done(function () { $.hood.Inline.RunComplete(complete); })
.fail($.hood.Inline.HandleError)

@@ -39,7 +41,7 @@ .always($.hood.Inline.Finish);

CurrentModal: null,
Modal: function (url, complete, closePrevious = false) {
Modal: function(url, complete, closePrevious = false) {
if (closePrevious && $.hood.Inline.CurrentModal) {
$.hood.Inline.CurrentModal.modal('hide');
}
$.get(url, function (data) {
$.get(url, function(data) {
let modalId = '#' + $(data).attr('id');

@@ -57,15 +59,17 @@ $(data).addClass('hood-inline-modal');

// Workaround for sweetalert popups.
$(modalId).on('shown.bs.modal', function () {
$(modalId).on('shown.bs.modal', function() {
$(document).off('focusin.modal');
});
$(modalId).on('hidden.bs.modal', function (e) {
$(modalId).on('hidden.bs.modal', function(e) {
$(this).remove();
});
if (complete) {
$.hood.Inline.RunComplete(complete, $(modalId), data);
}
})
.done(function () { $.hood.Inline.RunComplete(complete); })
.fail($.hood.Inline.HandleError)
.always($.hood.Inline.Finish);
},
CloseModal: function () {
CloseModal: function() {
if ($.hood.Inline.CurrentModal) {

@@ -75,12 +79,12 @@ $.hood.Inline.CurrentModal.modal('hide');

},
Task: function (e) {
Task: function(e) {
e.preventDefault();
var $tag = $(e.currentTarget);
let $tag = $(e.currentTarget);
$tag.addClass('loading');
complete = $tag.data('complete');
$.get($tag.attr('href'), function (data) {
$.get($tag.attr('href'), function(data) {
$.hood.Helpers.ProcessResponse(data);
if (data.Success) {
if ($tag && $tag.data('redirect')) {
setTimeout(function () {
setTimeout(function() {
window.location = $tag.data('redirect');

@@ -91,4 +95,6 @@ }, 1500);

$tag.removeClass('loading');
if (complete) {
$.hood.Inline.RunComplete(complete, $tag, data);
}
})
.done(function () { $.hood.Inline.RunComplete(complete); })
.fail($.hood.Inline.HandleError)

@@ -98,8 +104,8 @@ .always($.hood.Inline.Finish);

DataList: {
Init: function () {
$('.hood-inline-list.query').each(function () {
Init: function() {
$('.hood-inline-list.query').each(function() {
$(this).data('url', $(this).data('url') + window.location.search);
});
$('.hood-inline-list:not(.refresh)').each($.hood.Inline.Load);
$('body').on('click', '.hood-inline-list .pagination a', function (e) {
$('body').on('click', '.hood-inline-list .pagination a', function(e) {
e.preventDefault();

@@ -115,3 +121,3 @@ $.hood.Loader(true);

});
$('body').on('submit', '.hood-inline-list form', function (e) {
$('body').on('submit', '.hood-inline-list form', function(e) {
e.preventDefault();

@@ -126,3 +132,3 @@ $.hood.Loader(true);

});
$('body').on('submit', 'form.inline', function (e) {
$('body').on('submit', 'form.inline', function(e) {
e.preventDefault();

@@ -137,3 +143,3 @@ $.hood.Loader(true);

});
$('body').on('change', 'form.inline .refresh-on-change, .hood-inline-list form', function (e) {
$('body').on('change', 'form.inline .refresh-on-change, .hood-inline-list form', function(e) {
e.preventDefault();

@@ -149,3 +155,3 @@ $.hood.Loader(true);

},
Reload: function (list, url) {
Reload: function(list, url) {
if (history.pushState && list.hasClass('query')) {

@@ -159,3 +165,3 @@ let newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + '?' + url.href.substring(url.href.indexOf('?') + 1);

},
HandleError: function (xhr) {
HandleError: function(xhr) {
if (xhr.status === 500) {

@@ -170,11 +176,11 @@ $.hood.Alerts.Error("<strong>Error " + xhr.status + "</strong><br />There was an error processing the content, please contact an administrator if this continues.<br/>");

},
Finish: function (data) {
Finish: function(data) {
// Function can be overridden, to add global functionality to end of inline loads.
$.hood.Loader(false);
},
RunComplete: function (complete) {
RunComplete: function(complete, sender, data) {
if (!$.hood.Helpers.IsNullOrUndefined(complete)) {
let func = eval(complete);
if (typeof func === 'function') {
func();
func(element, data);
}

@@ -181,0 +187,0 @@ }

@@ -1,1 +0,1 @@

"use strict";$.hood||($.hood={}),$.hood.Inline={Tags:{},Init:function(){$(".hood-inline:not(.refresh)").each($.hood.Inline.Load),$("body").on("click",".hood-inline-task",$.hood.Inline.Task),$("body").on("click",".hood-modal",function(o){o.preventDefault(),$.hood.Inline.Modal($(this).attr("href"),$(this).data("complete"))}),$.hood.Inline.DataList.Init()},Refresh:function(o){$(o||".hood-inline").each($.hood.Inline.Load)},Load:function(){$.hood.Inline.Reload(this)},Reload:function(o,n){var e=$(o);e.addClass("loading"),n||(n=e.data("complete"));var t=e.data("url");$.get(t,$.proxy(function(o){$(this).html(o),$(this).removeClass("loading")},e)).done(function(){$.hood.Inline.RunComplete(n)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},CurrentModal:null,Modal:function(o,n){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e&&$.hood.Inline.CurrentModal&&$.hood.Inline.CurrentModal.modal("hide"),$.get(o,function(o){var n="#"+$(o).attr("id");$(o).addClass("hood-inline-modal"),$(n).length&&$(n).remove(),$("body").append(o),$.hood.Inline.CurrentModal=$(n),$(n).modal(),$(n).on("shown.bs.modal",function(){$(document).off("focusin.modal")}),$(n).on("hidden.bs.modal",function(o){$(this).remove()})}).done(function(){$.hood.Inline.RunComplete(n)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},CloseModal:function(){$.hood.Inline.CurrentModal&&$.hood.Inline.CurrentModal.modal("hide")},Task:function(o){o.preventDefault();var n=$(o.currentTarget);n.addClass("loading"),complete=n.data("complete"),$.get(n.attr("href"),function(o){$.hood.Helpers.ProcessResponse(o),o.Success&&n&&n.data("redirect")&&setTimeout(function(){window.location=n.data("redirect")},1500),n.removeClass("loading")}).done(function(){$.hood.Inline.RunComplete(complete)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},DataList:{Init:function(){$(".hood-inline-list.query").each(function(){$(this).data("url",$(this).data("url")+window.location.search)}),$(".hood-inline-list:not(.refresh)").each($.hood.Inline.Load),$("body").on("click",".hood-inline-list .pagination a",function(o){o.preventDefault(),$.hood.Loader(!0);var n=document.createElement("a");n.href=$(this).attr("href");var e=$(this).parents(".hood-inline-list"),t=document.createElement("a");t.href=e.data("url"),t.search=n.search,$.hood.Inline.DataList.Reload(e,t)}),$("body").on("submit",".hood-inline-list form",function(o){o.preventDefault(),$.hood.Loader(!0);var n=$(this),e=n.parents(".hood-inline-list"),t=document.createElement("a");t.href=e.data("url"),t.search="?"+n.serialize(),$.hood.Inline.DataList.Reload(e,t)}),$("body").on("submit","form.inline",function(o){o.preventDefault(),$.hood.Loader(!0);var n=$(this),e=$(n.data("target")),t=document.createElement("a");t.href=e.data("url"),t.search="?"+n.serialize(),$.hood.Inline.DataList.Reload(e,t)}),$("body").on("change","form.inline .refresh-on-change, .hood-inline-list form",function(o){o.preventDefault(),$.hood.Loader(!0);var n=$(this).parents("form"),e=$(n.data("target")),t=document.createElement("a");t.href=e.data("url"),t.search="?"+n.serialize(),$.hood.Inline.DataList.Reload(e,t)})},Reload:function(o,n){if(history.pushState&&o.hasClass("query")){var e=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+n.href.substring(n.href.indexOf("?")+1);window.history.pushState({path:e},"",e)}o.data("url",$.hood.Helpers.InsertQueryStringParamToUrl(n,"inline","true")),$.hood.Inline.Reload(o)}},HandleError:function(o){500===o.status?$.hood.Alerts.Error("<strong>Error "+o.status+"</strong><br />There was an error processing the content, please contact an administrator if this continues.<br/>"):404===o.status?$.hood.Alerts.Error("<strong>Error "+o.status+"</strong><br />The content could not be found.<br/>"):401===o.status&&($.hood.Alerts.Error("<strong>Error "+o.status+"</strong><br />You are not allowed to view this resource, are you logged in correctly?<br/>"),window.location=window.location)},Finish:function(o){$.hood.Loader(!1)},RunComplete:function RunComplete(complete){if(!$.hood.Helpers.IsNullOrUndefined(complete)){var func=eval(complete);"function"==typeof func&&func()}}},$(document).ready($.hood.Inline.Init),$.hood.Modals={Open:$.hood.Inline.Modal};
"use strict";$.hood||($.hood={}),$.hood.Inline={Tags:{},Init:function(){$(".hood-inline:not(.refresh)").each($.hood.Inline.Load),$("body").on("click",".hood-inline-task",$.hood.Inline.Task),$("body").on("click",".hood-modal",function(o){o.preventDefault(),$.hood.Inline.Modal($(this).attr("href"),$(this).data("complete"))}),$.hood.Inline.DataList.Init()},Refresh:function(o){$(o||".hood-inline").each($.hood.Inline.Load)},Load:function(){$.hood.Inline.Reload(this)},Reload:function(o,e){var n=$(o);n.addClass("loading"),e||(e=n.data("complete"));var t=n.data("url");$.get(t,$.proxy(function(o){n.html(o),n.removeClass("loading"),e&&$.hood.Inline.RunComplete(e,n,o)},n)).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},CurrentModal:null,Modal:function(o,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n&&$.hood.Inline.CurrentModal&&$.hood.Inline.CurrentModal.modal("hide"),$.get(o,function(o){var n="#"+$(o).attr("id");$(o).addClass("hood-inline-modal"),$(n).length&&$(n).remove(),$("body").append(o),$.hood.Inline.CurrentModal=$(n),$(n).modal(),$(n).on("shown.bs.modal",function(){$(document).off("focusin.modal")}),$(n).on("hidden.bs.modal",function(o){$(this).remove()}),e&&$.hood.Inline.RunComplete(e,$(n),o)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},CloseModal:function(){$.hood.Inline.CurrentModal&&$.hood.Inline.CurrentModal.modal("hide")},Task:function(o){o.preventDefault();var e=$(o.currentTarget);e.addClass("loading"),complete=e.data("complete"),$.get(e.attr("href"),function(o){$.hood.Helpers.ProcessResponse(o),o.Success&&e&&e.data("redirect")&&setTimeout(function(){window.location=e.data("redirect")},1500),e.removeClass("loading"),complete&&$.hood.Inline.RunComplete(complete,e,o)}).fail($.hood.Inline.HandleError).always($.hood.Inline.Finish)},DataList:{Init:function(){$(".hood-inline-list.query").each(function(){$(this).data("url",$(this).data("url")+window.location.search)}),$(".hood-inline-list:not(.refresh)").each($.hood.Inline.Load),$("body").on("click",".hood-inline-list .pagination a",function(o){o.preventDefault(),$.hood.Loader(!0);var e=document.createElement("a");e.href=$(this).attr("href");var n=$(this).parents(".hood-inline-list"),t=document.createElement("a");t.href=n.data("url"),t.search=e.search,$.hood.Inline.DataList.Reload(n,t)}),$("body").on("submit",".hood-inline-list form",function(o){o.preventDefault(),$.hood.Loader(!0);var e=$(this),n=e.parents(".hood-inline-list"),t=document.createElement("a");t.href=n.data("url"),t.search="?"+e.serialize(),$.hood.Inline.DataList.Reload(n,t)}),$("body").on("submit","form.inline",function(o){o.preventDefault(),$.hood.Loader(!0);var e=$(this),n=$(e.data("target")),t=document.createElement("a");t.href=n.data("url"),t.search="?"+e.serialize(),$.hood.Inline.DataList.Reload(n,t)}),$("body").on("change","form.inline .refresh-on-change, .hood-inline-list form",function(o){o.preventDefault(),$.hood.Loader(!0);var e=$(this).parents("form"),n=$(e.data("target")),t=document.createElement("a");t.href=n.data("url"),t.search="?"+e.serialize(),$.hood.Inline.DataList.Reload(n,t)})},Reload:function(o,e){if(history.pushState&&o.hasClass("query")){var n=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+e.href.substring(e.href.indexOf("?")+1);window.history.pushState({path:n},"",n)}o.data("url",$.hood.Helpers.InsertQueryStringParamToUrl(e,"inline","true")),$.hood.Inline.Reload(o)}},HandleError:function(o){500===o.status?$.hood.Alerts.Error("<strong>Error "+o.status+"</strong><br />There was an error processing the content, please contact an administrator if this continues.<br/>"):404===o.status?$.hood.Alerts.Error("<strong>Error "+o.status+"</strong><br />The content could not be found.<br/>"):401===o.status&&($.hood.Alerts.Error("<strong>Error "+o.status+"</strong><br />You are not allowed to view this resource, are you logged in correctly?<br/>"),window.location=window.location)},Finish:function(o){$.hood.Loader(!1)},RunComplete:function RunComplete(complete,sender,data){if(!$.hood.Helpers.IsNullOrUndefined(complete)){var func=eval(complete);"function"==typeof func&&func(element,data)}}},$(document).ready($.hood.Inline.Init),$.hood.Modals={Open:$.hood.Inline.Modal};
{
"name": "hoodcms",
"version": "3.2.0",
"version": "3.2.1",
"description": "Hood Digital's own content management system, built in ASP.NET Core 2.2, with JS and SCSS.",

@@ -5,0 +5,0 @@ "dependencies": {},

@@ -27,3 +27,3 @@ # Hood CMS

"destination": "wwwroot/hood",
"library": "hoodcms@3.2.0",
"library": "hoodcms@3.2.1",
"provider": "jsdelivr"

@@ -30,0 +30,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc