SiteOrigin Widgets Bundle - Version 1.17.11

Version Description

  • 09 December 2020 ==
  • Google Maps: Added Map Style button styling.
  • Accordion: Submitted contact forms added to Accordion will now open the panel on load.
  • Tabs: Prevented the Scroll To setting from affecting the currently selected tab.
  • Image Grid: Use image title as item label if set.
  • Developer: jQuery updates for WordPress 5.6.
  • Developer: Set Slider background image loading to Eager.
  • Developer: Exposed Google Maps instances. Once set up, maps can be accessed via sowb.SiteOriginGoogleMapInstances.
  • Developer: Add a Google Maps maps_loaded event that triggers after all of the Google Maps have finished being set up.

=

Download this release

Release Info

Developer SiteOrigin
Plugin Icon 128x128 SiteOrigin Widgets Bundle
Version 1.17.11
Comparing to
See all releases

Code changes from version 1.17.10 to 1.17.11

Files changed (62) hide show
  1. admin/admin.js +13 -13
  2. admin/admin.min.js +1 -1
  3. admin/trianglify.js +1 -1
  4. admin/trianglify.min.js +1 -1
  5. base/inc/fields/js/autocomplete-field.js +5 -5
  6. base/inc/fields/js/autocomplete-field.min.js +1 -1
  7. base/inc/fields/js/code-field.js +3 -3
  8. base/inc/fields/js/code-field.min.js +1 -1
  9. base/inc/fields/js/date-range-field.js +4 -4
  10. base/inc/fields/js/date-range-field.min.js +1 -1
  11. base/inc/fields/js/icon-field.js +8 -8
  12. base/inc/fields/js/icon-field.min.js +1 -1
  13. base/inc/fields/js/media-field.js +22 -20
  14. base/inc/fields/js/media-field.min.js +1 -1
  15. base/inc/fields/js/multi-measurement-field.js +1 -1
  16. base/inc/fields/js/multi-measurement-field.min.js +1 -1
  17. base/inc/fields/js/order-field.js +1 -1
  18. base/inc/fields/js/order-field.min.js +1 -1
  19. base/inc/fields/js/posts-field.js +1 -1
  20. base/inc/fields/js/posts-field.min.js +1 -1
  21. base/inc/fields/js/presets-field.js +2 -2
  22. base/inc/fields/js/presets-field.min.js +1 -1
  23. base/inc/fields/media.class.php +1 -0
  24. base/inc/string-utils.php +5 -1
  25. base/js/admin.js +34 -33
  26. base/js/admin.min.js +1 -1
  27. compat/block-editor/widget-block.js +16 -9
  28. compat/block-editor/widget-block.min.js +1 -1
  29. compat/visual-composer/sowb-vc-widget.js +1 -1
  30. compat/visual-composer/sowb-vc-widget.min.js +1 -1
  31. js/jquery.cycle.js +27 -24
  32. js/jquery.cycle.min.js +6 -6
  33. js/lib/slick.js +11 -11
  34. js/lib/slick.min.js +1 -1
  35. js/slider/jquery.slider.js +11 -11
  36. js/slider/jquery.slider.min.js +1 -1
  37. js/sow.google-map.js +11 -3
  38. js/sow.google-map.min.js +1 -1
  39. lang/so-widgets-bundle.pot +48 -40
  40. readme.txt +14 -4
  41. so-widgets-bundle.php +2 -2
  42. widgets/contact/js/contact.js +3 -3
  43. widgets/contact/js/contact.min.js +1 -1
  44. widgets/cta/js/cta.js +1 -1
  45. widgets/cta/js/cta.min.js +1 -1
  46. widgets/google-map/google-map.php +7 -2
  47. widgets/google-map/styles/default.less +41 -15
  48. widgets/image-grid/image-grid.php +22 -10
  49. widgets/image-grid/js/image-grid.js +2 -2
  50. widgets/image-grid/js/image-grid.min.js +1 -1
  51. widgets/image/image.php +28 -11
  52. widgets/post-carousel/js/carousel.js +6 -1
  53. widgets/post-carousel/js/carousel.min.js +1 -1
  54. widgets/post-carousel/post-carousel.php +1 -0
  55. widgets/price-table/js/pricetable.js +2 -2
  56. widgets/price-table/js/pricetable.min.js +1 -1
  57. widgets/simple-masonry/js/simple-masonry.js +1 -1
  58. widgets/simple-masonry/js/simple-masonry.min.js +1 -1
  59. widgets/simple-masonry/simple-masonry.php +28 -0
  60. widgets/slider/slider.php +2 -2
  61. widgets/tabs/js/tabs.js +16 -9
  62. widgets/tabs/js/tabs.min.js +1 -1
admin/admin.js CHANGED
@@ -2,7 +2,7 @@
2
 
3
  jQuery( function( $ ){
4
 
5
- $('.so-widget-toggle-active button').click( function(){
6
  var $$ = $(this),
7
  s = $$.data('status'),
8
  $w = $$.closest('.so-widget');
@@ -48,7 +48,7 @@ jQuery( function( $ ){
48
  else {
49
  if( $img.width() > 128 ) {
50
  // Deal with wide banner images
51
- $img.css('margin-left', -($img.width()-128)/2 );
52
  }
53
  }
54
  } );
@@ -78,7 +78,7 @@ jQuery( function( $ ){
78
  search: widgetSearch
79
  });
80
 
81
- $(window).resize(function() {
82
  var $descriptions = $('.so-widget-text').css('height', 'auto');
83
  var largestHeight = 0;
84
 
@@ -87,13 +87,13 @@ jQuery( function( $ ){
87
  });
88
 
89
  $descriptions.each(function () {
90
- $(this).css('height', largestHeight);
91
  });
92
 
93
- }).resize();
94
 
95
  // Handle the tabs
96
- $('#sow-widgets-page .page-nav a').click(function(e){
97
  e.preventDefault();
98
  var $$ = $(this);
99
  var href = $$.attr('href');
@@ -119,7 +119,7 @@ jQuery( function( $ ){
119
  break;
120
  }
121
 
122
- $(window).resize();
123
  });
124
 
125
  // Enable css3 animations on the widgets list
@@ -128,7 +128,7 @@ jQuery( function( $ ){
128
  // Handle the dialog
129
  var dialog = $('#sow-settings-dialog');
130
 
131
- $( '#widgets-list .so-widget-settings' ).click( function( e ){
132
  var $$ = $(this);
133
  e.preventDefault();
134
 
@@ -146,21 +146,21 @@ jQuery( function( $ ){
146
  dialog.show();
147
  } );
148
 
149
- dialog.find('.so-close').click( function( e ){
150
  e.preventDefault();
151
  dialog.hide();
152
  } );
153
 
154
- dialog.find('.so-save').click( function( e ){
155
  e.preventDefault();
156
 
157
  var $$ = $( this );
158
  $$.prop( 'disabled', true );
159
 
160
- dialog.find( 'form' ).submit( function() {
161
  $$.prop( 'disabled', false );
162
  dialog.hide();
163
- } ).submit();
164
  } );
165
 
166
  // Enable all widget settings button after the save iframe has loaded.
@@ -171,7 +171,7 @@ jQuery( function( $ ){
171
  // Automatically open settings modal based on hash
172
  if( window.location.hash && window.location.hash.substring(0, 10) === '#settings-' ) {
173
  var openSettingsId = window.location.hash.substring(10);
174
- $('div[data-id="' + openSettingsId + '"] button.so-widget-settings').click();
175
  }
176
 
177
  } );
2
 
3
  jQuery( function( $ ){
4
 
5
+ $( '.so-widget-toggle-active button' ).on( 'click', function() {
6
  var $$ = $(this),
7
  s = $$.data('status'),
8
  $w = $$.closest('.so-widget');
48
  else {
49
  if( $img.width() > 128 ) {
50
  // Deal with wide banner images
51
+ $img.css( 'margin-left', - ( $img.width() - 128 ) / 2 + 'px' );
52
  }
53
  }
54
  } );
78
  search: widgetSearch
79
  });
80
 
81
+ $( window ).on( 'resize', function() {
82
  var $descriptions = $('.so-widget-text').css('height', 'auto');
83
  var largestHeight = 0;
84
 
87
  });
88
 
89
  $descriptions.each(function () {
90
+ $( this ).css( 'height', largestHeight + "px" );
91
  });
92
 
93
+ } ).trigger( 'resize' );
94
 
95
  // Handle the tabs
96
+ $( '#sow-widgets-page .page-nav a' ).on( 'click', function( e ) {
97
  e.preventDefault();
98
  var $$ = $(this);
99
  var href = $$.attr('href');
119
  break;
120
  }
121
 
122
+ $( window ).trigger( 'resize' );
123
  });
124
 
125
  // Enable css3 animations on the widgets list
128
  // Handle the dialog
129
  var dialog = $('#sow-settings-dialog');
130
 
131
+ $( '#widgets-list .so-widget-settings' ).on( 'click', function( e ) {
132
  var $$ = $(this);
133
  e.preventDefault();
134
 
146
  dialog.show();
147
  } );
148
 
149
+ dialog.find( '.so-close' ).on( 'click', function( e ) {
150
  e.preventDefault();
151
  dialog.hide();
152
  } );
153
 
154
+ dialog.find( '.so-save' ).on( 'click', function( e ) {
155
  e.preventDefault();
156
 
157
  var $$ = $( this );
158
  $$.prop( 'disabled', true );
159
 
160
+ dialog.find( 'form' ).on( 'submit', function() {
161
  $$.prop( 'disabled', false );
162
  dialog.hide();
163
+ } ).trigger( 'submit' );
164
  } );
165
 
166
  // Enable all widget settings button after the save iframe has loaded.
171
  // Automatically open settings modal based on hash
172
  if( window.location.hash && window.location.hash.substring(0, 10) === '#settings-' ) {
173
  var openSettingsId = window.location.hash.substring(10);
174
+ $('div[data-id="' + openSettingsId + '"] button.so-widget-settings').trigger( 'click' );
175
  }
176
 
177
  } );
admin/admin.min.js CHANGED
@@ -1 +1 @@
1
- jQuery((function(i){i(".so-widget-toggle-active button").click((function(){var t=i(this),s=t.data("status"),e=t.closest(".so-widget");s?e.addClass("so-widget-is-active").removeClass("so-widget-is-inactive"):e.removeClass("so-widget-is-active").addClass("so-widget-is-inactive"),i.post(soWidgetsAdmin.toggleUrl,{widget:e.data("id"),active:s},(function(i){}))})),i(".so-widget-banner").each((function(){var t=i(this),s=t.find("img");if(s.length)s.width()>128&&s.css("margin-left",-(s.width()-128)/2);else{var e=Trianglify({width:128,height:128,variance:1,cell_size:32,seed:t.data("seed")});t.append(e.svg())}}));var t=function(){var t=i(this).val().toLowerCase();""===t?i(".so-widget-wrap").show():i(".so-widget").each((function(){var s=i(this);s.find("h3").html().toLowerCase().indexOf(t)>-1?s.parent().show():s.parent().hide()}))};i("#sow-widget-search input").on({keyup:t,search:t}),i(window).resize((function(){var t=i(".so-widget-text").css("height","auto"),s=0;t.each((function(){s=Math.max(s,i(this).height())})),t.each((function(){i(this).css("height",s)}))})).resize(),i("#sow-widgets-page .page-nav a").click((function(t){t.preventDefault();var s=i(this),e=s.attr("href"),a=s.closest("li");switch(i("#sow-widgets-page .page-nav li").not(a).removeClass("active"),a.addClass("active"),e){case"#all":i(".so-widget-wrap").show();break;case"#enabled":i(".so-widget-wrap").hide(),i(".so-widget-wrap .so-widget-is-active").each((function(){i(this).closest(".so-widget-wrap").show()})),i(".so-widget-wrap .so-widget-is-inactive").each((function(){i(this).closest(".so-widget-wrap").hide()}));break;case"#disabled":i(".so-widget-wrap .so-widget-is-active").each((function(){i(this).closest(".so-widget-wrap").hide()})),i(".so-widget-wrap .so-widget-is-inactive").each((function(){i(this).closest(".so-widget-wrap").show()}))}i(window).resize()})),i("#widgets-list").addClass("so-animated");var s=i("#sow-settings-dialog");if(i("#widgets-list .so-widget-settings").click((function(t){var e=i(this);t.preventDefault(),$content=s.find(".so-content"),$content.empty().addClass("so-loading"),i.get(e.data("form-url"),(function(i){$content.html(i).removeClass("so-loading")})),s.show()})),s.find(".so-close").click((function(i){i.preventDefault(),s.hide()})),s.find(".so-save").click((function(t){t.preventDefault();var e=i(this);e.prop("disabled",!0),s.find("form").submit((function(){e.prop("disabled",!1),s.hide()})).submit()})),i("#so-widget-settings-save").on("load",(function(){i("#widgets-list .so-widget-settings").prop("disabled",!1)})),window.location.hash&&"#settings-"===window.location.hash.substring(0,10)){var e=window.location.hash.substring(10);i('div[data-id="'+e+'"] button.so-widget-settings').click()}}));
1
+ jQuery((function(i){i(".so-widget-toggle-active button").on("click",(function(){var t=i(this),e=t.data("status"),s=t.closest(".so-widget");e?s.addClass("so-widget-is-active").removeClass("so-widget-is-inactive"):s.removeClass("so-widget-is-active").addClass("so-widget-is-inactive"),i.post(soWidgetsAdmin.toggleUrl,{widget:s.data("id"),active:e},(function(i){}))})),i(".so-widget-banner").each((function(){var t=i(this),e=t.find("img");if(e.length)e.width()>128&&e.css("margin-left",-(e.width()-128)/2+"px");else{var s=Trianglify({width:128,height:128,variance:1,cell_size:32,seed:t.data("seed")});t.append(s.svg())}}));var t=function(){var t=i(this).val().toLowerCase();""===t?i(".so-widget-wrap").show():i(".so-widget").each((function(){var e=i(this);e.find("h3").html().toLowerCase().indexOf(t)>-1?e.parent().show():e.parent().hide()}))};i("#sow-widget-search input").on({keyup:t,search:t}),i(window).on("resize",(function(){var t=i(".so-widget-text").css("height","auto"),e=0;t.each((function(){e=Math.max(e,i(this).height())})),t.each((function(){i(this).css("height",e+"px")}))})).trigger("resize"),i("#sow-widgets-page .page-nav a").on("click",(function(t){t.preventDefault();var e=i(this),s=e.attr("href"),a=e.closest("li");switch(i("#sow-widgets-page .page-nav li").not(a).removeClass("active"),a.addClass("active"),s){case"#all":i(".so-widget-wrap").show();break;case"#enabled":i(".so-widget-wrap").hide(),i(".so-widget-wrap .so-widget-is-active").each((function(){i(this).closest(".so-widget-wrap").show()})),i(".so-widget-wrap .so-widget-is-inactive").each((function(){i(this).closest(".so-widget-wrap").hide()}));break;case"#disabled":i(".so-widget-wrap .so-widget-is-active").each((function(){i(this).closest(".so-widget-wrap").hide()})),i(".so-widget-wrap .so-widget-is-inactive").each((function(){i(this).closest(".so-widget-wrap").show()}))}i(window).trigger("resize")})),i("#widgets-list").addClass("so-animated");var e=i("#sow-settings-dialog");if(i("#widgets-list .so-widget-settings").on("click",(function(t){var s=i(this);t.preventDefault(),$content=e.find(".so-content"),$content.empty().addClass("so-loading"),i.get(s.data("form-url"),(function(i){$content.html(i).removeClass("so-loading")})),e.show()})),e.find(".so-close").on("click",(function(i){i.preventDefault(),e.hide()})),e.find(".so-save").on("click",(function(t){t.preventDefault();var s=i(this);s.prop("disabled",!0),e.find("form").on("submit",(function(){s.prop("disabled",!1),e.hide()})).trigger("submit")})),i("#so-widget-settings-save").on("load",(function(){i("#widgets-list .so-widget-settings").prop("disabled",!1)})),window.location.hash&&"#settings-"===window.location.hash.substring(0,10)){var s=window.location.hash.substring(10);i('div[data-id="'+s+'"] button.so-widget-settings').trigger("click")}}));
admin/trianglify.js CHANGED
@@ -226,7 +226,7 @@
226
  */
227
 
228
  // conditionally load jsdom if we don't have a browser environment available.
229
- var doc = (typeof document !== "undefined") ? document : require('jsdom').jsdom('<html/>');
230
 
231
  function Pattern(polys, opts) {
232
 
226
  */
227
 
228
  // conditionally load jsdom if we don't have a browser environment available.
229
+ var doc = (typeof document !== "undefined") ? document : require('jsdom').jsdom('<html></html>');
230
 
231
  function Pattern(polys, opts) {
232
 
admin/trianglify.min.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Trianglify=e()}}((function(){return function e(r,n,t){function f(o,i){if(!n[o]){if(!r[o]){var s="function"==typeof require&&require;if(!i&&s)return s(o,!0);if(a)return a(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var c=n[o]={exports:{}};r[o][0].call(c.exports,(function(e){var n=r[o][1][e];return f(n||e)}),c,c.exports,e,r,n,t)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<t.length;o++)f(t[o]);return f}({"./lib/trianglify.js":[function(e,r,n){var t=e("delaunay-fast"),f=e("seedrandom"),a=e("chroma-js"),o=e("./colorbrewer"),i=e("./pattern"),s={width:600,height:400,cell_size:75,variance:.75,seed:null,x_colors:"random",y_colors:"match_x",palette:o,color_space:"lab",color_function:null,stroke_width:1.51};function d(e){if(e=function(e,r){var n={};for(var t in e)n[t]=e[t];for(t in r){if(!e.hasOwnProperty(t))throw new Error(t+" is not a configuration option for Trianglify. Check your spelling?");n[t]=r[t]}return n}(s,e),rand=f(e.seed),"random"===e.x_colors&&(e.x_colors=U()),"random"===e.y_colors&&(e.y_colors=U()),"match_x"===e.y_colors&&(e.y_colors=e.x_colors),!(e.width>0&&e.height>0))throw new Error("Width and height must be numbers greater than 0");if(e.cell_size<2)throw new Error("Cell size must be greater than 2.");var r;if(e.color_function)r=function(r,n){return a(e.color_function(r,n))};else{var n=a.scale(e.x_colors).mode(e.color_space),o=a.scale(e.y_colors).mode(e.color_space);r=function(r,t){return a.interpolate(n(r),o(t),.5,e.color_space)}}for(var d,c,u,l=e.width,b=e.height,h=Math.floor((l+4*e.cell_size)/e.cell_size),g=Math.floor((b+4*e.cell_size)/e.cell_size),p=(h*e.cell_size-l)/2,m=(g*e.cell_size-b)/2,y=e.cell_size*e.variance/2,w=function(r,n){for(var t=[],f=-p;f<r+p;f+=e.cell_size)for(var a=-m;a<n+m;a+=e.cell_size){var o=f+e.cell_size/2+D(rand(),[0,1],[-y,y]),i=a+e.cell_size/2+D(rand(),[0,1],[-y,y]);t.push([o,i].map(Math.floor))}return t}(l,b),v=t.triangulate(w),x=[],_=function(e){return w[e]},k=0;k<v.length;k+=3){var j=[v[k],v[k+1],v[k+2]].map(_),M={x:((u=j)[0][0]+u[1][0]+u[2][0])/3,y:(u[0][1]+u[1][1]+u[2][1])/3},N=r((c=M.x,D(c,[-p,l+p],[0,1])),(d=M.y,D(d,[-m,b+m],[0,1]))).hex();x.push([N,j])}return i(x,e);function D(e,r,n){return(e-r[0])*(n[1]-n[0])/(r[1]-r[0])+n[0]}function U(){if(e.palette instanceof Array)return e.palette[Math.floor(rand()*e.palette.length)];var r=Object.keys(e.palette);return e.palette[r[Math.floor(rand()*r.length)]]}}d.colorbrewer=o,d.defaults=s,r.exports=d},{"./colorbrewer":"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js","./pattern":"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js","chroma-js":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js","delaunay-fast":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js",seedrandom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js"}],"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js":[function(e,r,n){r.exports={YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]}},{}],"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js":[function(e,r,n){(function(n){var t="undefined"!=typeof document?document:e("jsdom").jsdom("<html/>");r.exports=function(r,f){function a(a){if(void 0!==n)try{e("canvas")}catch(e){throw Error("The optional node-canvas dependency is needed for Trianglify to render using canvas in node.")}return a||(a=t.createElement("canvas")),a.setAttribute("width",f.width),a.setAttribute("height",f.height),ctx=a.getContext("2d"),ctx.canvas.width=f.width,ctx.canvas.height=f.height,r.forEach((function(e){ctx.fillStyle=ctx.strokeStyle=e[0],ctx.lineWidth=f.stroke_width,ctx.beginPath(),ctx.moveTo.apply(ctx,e[1][0]),ctx.lineTo.apply(ctx,e[1][1]),ctx.lineTo.apply(ctx,e[1][2]),ctx.fill(),ctx.stroke()})),a}return{polys:r,opts:f,svg:function(){var e=t.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width",f.width),e.setAttribute("height",f.height),r.forEach((function(r){var n=t.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d","M"+r[1].join("L")+"Z"),n.setAttribute("fill",r[0]),n.setAttribute("stroke",r[0]),n.setAttribute("stroke-width",f.stroke_width),e.appendChild(n)})),e},canvas:a,png:function(){return a().toDataURL("image/png")}}}}).call(this,e("_process"))},{_process:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js",canvas:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js",jsdom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js":[function(e,r,n){},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js":[function(e,r,n){var t=r.exports={},f=[],a=!1;function o(){if(!a){var e;a=!0;for(var r=f.length;r;){e=f,f=[];for(var n=-1;++n<r;)e[n]();r=f.length}a=!1}}function i(){}t.nextTick=function(e){f.push(e),a||setTimeout(o,0)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=i,t.addListener=i,t.once=i,t.off=i,t.removeListener=i,t.removeAllListeners=i,t.emit=i,t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js":[function(e,r,n){
2
  /** echo * @license echo * while read i do echo * done echo
3
  */
4
  (function(){var e,t,f,a,o,i,s,d,c,u,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,z,G,E,B;s=function(r,n,t,f){return new e(r,n,t,f)},null!=r&&null!=r.exports&&(r.exports=s),(null!=n?n:this).chroma=s,s.color=function(r,n,t,f){return new e(r,n,t,f)},s.hsl=function(r,n,t,f){return new e(r,n,t,f,"hsl")},s.hsv=function(r,n,t,f){return new e(r,n,t,f,"hsv")},s.rgb=function(r,n,t,f){return new e(r,n,t,f,"rgb")},s.hex=function(r){return new e(r)},s.css=function(r){return new e(r)},s.lab=function(r,n,t){return new e(r,n,t,"lab")},s.lch=function(r,n,t){return new e(r,n,t,"lch")},s.hsi=function(r,n,t){return new e(r,n,t,"hsi")},s.gl=function(r,n,t,f){return new e(255*r,255*n,255*t,f,"gl")},s.mix=s.interpolate=function(r,n,t,f){return null==r||null==n?"#000":("string"===z(r)&&(r=new e(r)),"string"===z(n)&&(n=new e(n)),r.interpolate(t,n,f))},s.contrast=function(r,n){var t,f;return"string"===z(r)&&(r=new e(r)),"string"===z(n)&&(n=new e(n)),(t=r.luminance())>(f=n.luminance())?(t+.05)/(f+.05):(f+.05)/(t+.05)},s.luminance=function(e){return s(e).luminance()},s._Color=e,e=function(){function e(){var e,r,n,t,f,a,o,i,s,c,u,p,y,w,x;for(f=this,n=[],s=0,c=arguments.length;s<c;s++)null!=(r=arguments[s])&&n.push(r);if(0===n.length)a=(u=[255,0,255,1,"rgb"])[0],o=u[1],i=u[2],e=u[3],t=u[4];else if("array"===z(n[0])){if(3===n[0].length)a=(p=n[0])[0],o=p[1],i=p[2],e=1;else{if(4!==n[0].length)throw"unknown input argument";a=(y=n[0])[0],o=y[1],i=y[2],e=y[3]}t=null!=(w=n[1])?w:"rgb"}else"string"===z(n[0])?(a=n[0],t="hex"):"object"===z(n[0])?(a=(x=n[0]._rgb)[0],o=x[1],i=x[2],e=x[3],t="rgb"):n.length>=3&&(a=n[0],o=n[1],i=n[2]);3===n.length?(t="rgb",e=1):4===n.length?"string"===z(n[3])?(t=n[3],e=1):"number"===z(n[3])&&(t="rgb",e=n[3]):5===n.length&&(e=n[3],t=n[4]),null==e&&(e=1),"rgb"===t?f._rgb=[a,o,i,e]:"gl"===t?f._rgb=[255*a,255*o,255*i,e]:"hsl"===t?(f._rgb=h(a,o,i),f._rgb[3]=e):"hsv"===t?(f._rgb=g(a,o,i),f._rgb[3]=e):"hex"===t?f._rgb=l(a):"lab"===t?(f._rgb=m(a,o,i),f._rgb[3]=e):"lch"===t?(f._rgb=v(a,o,i),f._rgb[3]=e):"hsi"===t&&(f._rgb=b(a,o,i),f._rgb[3]=e),d(f._rgb)}return e.prototype.rgb=function(){return this._rgb.slice(0,3)},e.prototype.rgba=function(){return this._rgb},e.prototype.hex=function(){return j(this._rgb)},e.prototype.toString=function(){return this.name()},e.prototype.hsl=function(){return N(this._rgb)},e.prototype.hsv=function(){return D(this._rgb)},e.prototype.lab=function(){return U(this._rgb)},e.prototype.lch=function(){return A(this._rgb)},e.prototype.hsi=function(){return M(this._rgb)},e.prototype.gl=function(){return[this._rgb[0]/255,this._rgb[1]/255,this._rgb[2]/255,this._rgb[3]]},e.prototype.luminance=function(r,n){var t,f,a,o;return null==n&&(n="rgb"),arguments.length?(0===r&&(this._rgb=[0,0,0,this._rgb[3]]),1===r&&(this._rgb=[255,255,255,this._rgb[3]]),t=_(this._rgb),f=1e-7,a=20,o=function(e,t){var i,s;return i=(s=e.interpolate(.5,t,n)).luminance(),Math.abs(r-i)<f||!a--?s:i>r?o(e,s):o(s,t)},this._rgb=(t>r?o(new e("black"),this):o(this,new e("white"))).rgba(),this):_(this._rgb)},e.prototype.name=function(){var e,r;for(r in e=this.hex(),s.colors)if(e===s.colors[r])return r;return e},e.prototype.alpha=function(e){return arguments.length?(this._rgb[3]=e,this):this._rgb[3]},e.prototype.css=function(e){var r,n,t;return null==e&&(e="rgb"),this,n=this._rgb,3===e.length&&n[3]<1&&(e+="a"),"rgb"===e?e+"("+n.slice(0,3).map(Math.round).join(",")+")":"rgba"===e?e+"("+n.slice(0,3).map(Math.round).join(",")+","+n[3]+")":"hsl"===e||"hsla"===e?(t=function(e){return Math.round(100*e)/100},(r=this.hsl())[0]=t(r[0]),r[1]=t(100*r[1])+"%",r[2]=t(100*r[2])+"%",4===e.length&&(r[3]=n[3]),e+"("+r.join(",")+")"):void 0},e.prototype.interpolate=function(r,n,t){var f,a,o,i,s,d,c,u,l,b,h,g,p;if(c=this,null==t&&(t="rgb"),"string"===z(n)&&(n=new e(n)),"hsl"===t||"hsv"===t||"lch"===t||"hsi"===t)"hsl"===t?(g=c.hsl(),p=n.hsl()):"hsv"===t?(g=c.hsv(),p=n.hsv()):"hsi"===t?(g=c.hsi(),p=n.hsi()):"lch"===t&&(g=c.lch(),p=n.lch()),"h"===t.substr(0,1)?(a=g[0],b=g[1],s=g[2],o=p[0],h=p[1],d=p[2]):(s=g[0],b=g[1],a=g[2],d=p[0],h=p[1],o=p[2]),isNaN(a)||isNaN(o)?isNaN(a)?isNaN(o)?f=Number.NaN:(f=o,1!==s&&0!==s||"hsv"===t||(l=h)):(f=a,1!==d&&0!==d||"hsv"===t||(l=b)):f=a+r*(o>a&&o-a>180?o-(a+360):o<a&&a-o>180?o+360-a:o-a),null==l&&(l=b+r*(h-b)),i=s+r*(d-s),u="h"===t.substr(0,1)?new e(f,l,i,t):new e(i,l,f,t);else if("rgb"===t)g=c._rgb,p=n._rgb,u=new e(g[0]+r*(p[0]-g[0]),g[1]+r*(p[1]-g[1]),g[2]+r*(p[2]-g[2]),t);else{if("lab"!==t)throw"color mode "+t+" is not supported";g=c.lab(),p=n.lab(),u=new e(g[0]+r*(p[0]-g[0]),g[1]+r*(p[1]-g[1]),g[2]+r*(p[2]-g[2]),t)}return u.alpha(c.alpha()+r*(n.alpha()-c.alpha())),u},e.prototype.premultiply=function(){var e,r;return r=this.rgb(),e=this.alpha(),s(r[0]*e,r[1]*e,r[2]*e,e)},e.prototype.darken=function(e){var r;return null==e&&(e=20),this,(r=this.lch())[0]-=e,s.lch(r).alpha(this.alpha())},e.prototype.darker=function(e){return this.darken(e)},e.prototype.brighten=function(e){return null==e&&(e=20),this.darken(-e)},e.prototype.brighter=function(e){return this.brighten(e)},e.prototype.saturate=function(e){var r;return null==e&&(e=20),this,(r=this.lch())[1]+=e,s.lch(r).alpha(this.alpha())},e.prototype.desaturate=function(e){return null==e&&(e=20),this.saturate(-e)},e}(),d=function(e){var r;for(r in e)r<3?(e[r]<0&&(e[r]=0),e[r]>255&&(e[r]=255)):3===r&&(e[r]<0&&(e[r]=0),e[r]>1&&(e[r]=1));return e},u=function(e){var r,n,t,f,a,o,i,d;if(e=e.toLowerCase(),null!=s.colors&&s.colors[e])return l(s.colors[e]);if(t=e.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(f=t.slice(1,4),n=a=0;a<=2;n=++a)f[n]=+f[n];f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(f=t.slice(1,5),n=o=0;o<=3;n=++o)f[n]=+f[n];else if(t=e.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(f=t.slice(1,4),n=i=0;i<=2;n=++i)f[n]=Math.round(2.55*f[n]);f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(f=t.slice(1,5),n=d=0;d<=2;n=++d)f[n]=Math.round(2.55*f[n]);f[3]=+f[3]}else(t=e.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(f=h(r))[3]=1):(t=e.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(f=h(r))[3]=+t[4]);return f},l=function(e){var r,n;if(e.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return 4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[(n=parseInt(e,16))>>16,n>>8&255,255&n,1];if(e.match(/^#?([A-Fa-f0-9]{8})$/))return 9===e.length&&(e=e.substr(1)),[(n=parseInt(e,16))>>24&255,n>>16&255,n>>8&255,255&n];if(r=u(e))return r;throw"unknown color: "+e},b=function(e,r,n){var a,o,i,s;return e=(s=G(arguments))[0],r=s[1],n=s[2],(e/=360)<1/3?o=1-((a=(1-r)/3)+(i=(1+r*c(f*e)/c(t-f*e))/3)):e<2/3?a=1-((i=(1-r)/3)+(o=(1+r*c(f*(e-=1/3))/c(t-f*e))/3)):i=1-((o=(1-r)/3)+(a=(1+r*c(f*(e-=2/3))/c(t-f*e))/3)),[255*(i=x(n*i*3)),255*(o=x(n*o*3)),255*(a=x(n*a*3))]},h=function(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b;if(t=(l=G(arguments))[0],i=l[1],a=l[2],0===i)o=n=e=255*a;else{for(r=[0,0,0],s=2*a-(d=a<.5?a*(1+i):a+i-a*i),(c=[0,0,0])[0]=(t/=360)+1/3,c[1]=t,c[2]=t-1/3,f=u=0;u<=2;f=++u)c[f]<0&&(c[f]+=1),c[f]>1&&(c[f]-=1),6*c[f]<1?r[f]=s+6*(d-s)*c[f]:2*c[f]<1?r[f]=d:3*c[f]<2?r[f]=s+(d-s)*(2/3-c[f])*6:r[f]=s;o=(b=[Math.round(255*r[0]),Math.round(255*r[1]),Math.round(255*r[2])])[0],n=b[1],e=b[2]}return[o,n,e]},g=function(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b,h,g,p,m;if(t=(u=G(arguments))[0],s=u[1],c=u[2],c*=255,0===s)i=n=e=c;else switch(360===t&&(t=0),t>360&&(t-=360),t<0&&(t+=360),a=c*(1-s),o=c*(1-s*(r=(t/=60)-(f=Math.floor(t)))),d=c*(1-s*(1-r)),f){case 0:i=(l=[c,d,a])[0],n=l[1],e=l[2];break;case 1:i=(b=[o,c,a])[0],n=b[1],e=b[2];break;case 2:i=(h=[a,c,d])[0],n=h[1],e=h[2];break;case 3:i=(g=[a,o,c])[0],n=g[1],e=g[2];break;case 4:i=(p=[d,a,c])[0],n=p[1],e=p[2];break;case 5:i=(m=[c,a,o])[0],n=m[1],e=m[2]}return[i=Math.round(i),n=Math.round(n),e=Math.round(e)]},a=.95047,o=1.08883,p=function(){var e,r,n,t;return n=(t=G(arguments))[0],e=t[1],r=t[2],[n,Math.sqrt(e*e+r*r),Math.atan2(r,e)/Math.PI*180]},m=function(e,r,n){var t,f,i,s,d,c,u;return void 0!==e&&3===e.length&&(e=(c=e)[0],r=c[1],n=c[2]),void 0!==e&&3===e.length&&(e=(u=e)[0],r=u[1],n=u[2]),d=(s=(e+16)/116)-n/200,i=y(i=s+r/500)*a,s=1*y(s),d=y(d)*o,f=B(3.2404542*i-1.5371385*s-.4985314*d),t=B(-.969266*i+1.8760108*s+.041556*d),n=B(.0556434*i-.2040259*s+1.0572252*d),[x(f,0,255),x(t,0,255),x(n,0,255),1]},y=function(e){return e>.206893034?e*e*e:(e-4/29)/7.787037},B=function(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))},w=function(){var e,r,n,t;return n=(t=G(arguments))[0],e=t[1],r=(r=t[2])*Math.PI/180,[n,Math.cos(r)*e,Math.sin(r)*e]},v=function(e,r,n){var t,f,a,o,i,s,d;return t=(s=w(e,r,n))[0],f=s[1],a=s[2],i=(d=m(t,f,a))[0],o=d[1],a=d[2],[x(i,0,255),x(o,0,255),x(a,0,255)]},_=function(e,r,n){var t;return e=(t=G(arguments))[0],r=t[1],n=t[2],.2126*(e=k(e))+.7152*(r=k(r))+.0722*(n=k(n))},k=function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},j=function(){var e,r;return"#"+(e="000000"+((r=G(arguments))[0]<<16|r[1]<<8|r[2]).toString(16)).substr(e.length-6)},M=function(){var e,r,n,t,f,a,o,i;return a=(i=G(arguments))[0],n=i[1],r=i[2],e=2*Math.PI,a/=255,n/=255,r/=255,0===(o=1-Math.min(a,n,r)/(f=(a+n+r)/3))?t=0:(t=(a-n+(a-r))/2,t/=Math.sqrt((a-n)*(a-n)+(a-r)*(n-r)),t=Math.acos(t),r>n&&(t=e-t),t/=e),[360*t,o,f]},N=function(e,r,n){var t,f,a,o,i,s;return void 0!==e&&e.length>=3&&(e=(s=e)[0],r=s[1],n=s[2]),e/=255,r/=255,n/=255,o=Math.min(e,r,n),f=((a=Math.max(e,r,n))+o)/2,a===o?(i=0,t=Number.NaN):i=f<.5?(a-o)/(a+o):(a-o)/(2-a-o),e===a?t=(r-n)/(a-o):r===a?t=2+(n-e)/(a-o):n===a&&(t=4+(e-r)/(a-o)),(t*=60)<0&&(t+=360),[t,i,f]},D=function(){var e,r,n,t,f,a,o,i,s,d;return o=(d=G(arguments))[0],n=d[1],e=d[2],a=Math.min(o,n,e),r=(f=Math.max(o,n,e))-a,s=f/255,0===f?(t=Number.NaN,i=0):(i=r/f,o===f&&(t=(n-e)/r),n===f&&(t=2+(e-o)/r),e===f&&(t=4+(o-n)/r),(t*=60)<0&&(t+=360)),[t,i,s]},U=function(){var e,r,n,t,f,i;return n=(i=G(arguments))[0],r=i[1],e=i[2],n=P(n),r=P(r),e=P(e),t=E((.4124564*n+.3575761*r+.1804375*e)/a),[116*(f=E((.2126729*n+.7151522*r+.072175*e)/1))-16,500*(t-f),200*(f-E((.0193339*n+.119192*r+.9503041*e)/o))]},P=function(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},E=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},A=function(){var e,r,n,t,f,a,o;return f=(a=G(arguments))[0],n=a[1],r=a[2],t=(o=U(f,n,r))[0],e=o[1],r=o[2],p(t,e,r)},s.scale=function(e,r){var n,t,f,a,o,i,d,c,u,l,b,h,g,p,m,y,w,v,x;return p="rgb",m=s("#ccc"),x=0,!1,b=[0,1],u=[],w=!1,v=[],g=0,h=1,l=!1,y=0,c={},o=function(e,r){var n,t,f,o,i,d,c;if(null==e&&(e=["#ddd","#222"]),null!=e&&"string"===z(e)&&null!=(null!=(i=s.brewer)?i[e]:void 0)&&(e=s.brewer[e]),"array"===z(e)){for(n=f=0,d=(e=e.slice(0)).length-1;0<=d?f<=d:f>=d;n=0<=d?++f:--f)t=e[n],"string"===z(t)&&(e[n]=s(t));if(null!=r)v=r;else for(v=[],n=o=0,c=e.length-1;0<=c?o<=c:o>=c;n=0<=c?++o:--o)v.push(n/(e.length-1))}return a(),u=e},i=function(e){return null==e&&(e=[]),b=e,g=e[0],h=e[e.length-1],a(),y=2===e.length?0:e.length-1},t=function(e){var r,n;if(null!=b){for(n=b.length-1,r=0;r<n&&e>=b[r];)r++;return r-1}return 0},d=function(e){return e},function(e){var r,n,f,a,o;return o=e,b.length>2&&(a=b.length-1,r=t(e),f=b[0]+(b[1]-b[0])*(0+.5*x),n=b[a-1]+(b[a]-b[a-1])*(1-.5*x),o=g+(b[r]+.5*(b[r+1]-b[r])-f)/(n-f)*(h-g)),o},f=function(e,r){var n,f,a,o,i,l,w;if(null==r&&(r=!1),isNaN(e))return m;if(r?i=e:b.length>2?i=t(e)/(y-1):(i=g!==h?(e-g)/(h-g):0,i=(e-g)/(h-g),i=Math.min(1,Math.max(0,i))),r||(i=d(i)),a=Math.floor(1e4*i),c[a])n=c[a];else{if("array"===z(u))for(f=l=0,w=v.length-1;0<=w?l<=w:l>=w;f=0<=w?++l:--l){if(i<=(o=v[f])){n=u[f];break}if(i>=o&&f===v.length-1){n=u[f];break}if(i>o&&i<v[f+1]){i=(i-o)/(v[f+1]-o),n=s.interpolate(u[f],u[f+1],i,p);break}}else"function"===z(u)&&(n=u(i));c[a]=n}return n},a=function(){return c={}},o(e,r),(n=function(e){var r;return r=f(e),w&&r[w]?r[w]():r}).domain=function(e,r,t,f){var a;return null==t&&(t="e"),arguments.length?(null!=r&&(a=s.analyze(e,f),e=0===r?[a.min,a.max]:s.limits(a,t,r)),i(e),n):b},n.mode=function(e){return arguments.length?(p=e,a(),n):p},n.range=function(e,r){return o(e,r),n},n.out=function(e){return w=e,n},n.spread=function(e){return arguments.length?(x=e,n):x},n.correctLightness=function(e){return arguments.length?(l=e,a(),d=l?function(e){var r,n,t,a,o,i,s,d,c;for(r=f(0,!0).lab()[0],n=f(1,!0).lab()[0],s=r>n,t=f(e,!0).lab()[0],a=t-(o=r+(n-r)*e),d=0,c=1,i=20;Math.abs(a)>.01&&i-- >0;)s&&(a*=-1),a<0?(d=e,e+=.5*(c-e)):(c=e,e+=.5*(d-e)),t=f(e,!0).lab()[0],a=t-o;return e}:function(e){return e},n):l},n.colors=function(r){var t,f,a,o,i,s;if(null==r&&(r="hex"),e=[],f=[],b.length>2)for(t=a=1,s=b.length;1<=s?a<s:a>s;t=1<=s?++a:--a)f.push(.5*(b[t-1]+b[t]));else f=b;for(o=0,i=f.length;o<i;o++)t=f[o],e.push(n(t)[r]());return e},n},null==s.scales&&(s.scales={}),s.scales.cool=function(){return s.scale([s.hsl(180,1,.9),s.hsl(250,.7,.4)])},s.scales.hot=function(){return s.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},s.analyze=function(e,r,n){var t,f,a,o,i,d;if(a={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==n&&(n=function(){return!0}),t=function(e){null==e||isNaN(e)||(a.values.push(e),a.sum+=e,e<a.min&&(a.min=e),e>a.max&&(a.max=e),a.count+=1)},o=function(e,f){if(n(e,f))return null!=r&&"function"===z(r)?t(r(e)):null!=r&&"string"===z(r)||"number"===z(r)?t(e[r]):t(e)},"array"===z(e))for(i=0,d=e.length;i<d;i++)o(e[i]);else for(f in e)o(e[f],f);return a.domain=[a.min,a.max],a.limits=function(e,r){return s.limits(a,e,r)},a},s.limits=function(e,r,n){var t,f,a,o,i,d,c,u,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,G,E,B,I,q,R,S,O,C,T,Y,L,F,V,X,W,$,Z,H,J,K,Q,ee,re,ne,te,fe,ae;if(null==r&&(r="equal"),null==n&&(n=7),"array"===z(e)&&(e=s.analyze(e)),p=e.min,h=e.max,e.sum,U=e.values.sort((function(e,r){return e-r})),b=[],"c"===r.substr(0,1)&&(b.push(p),b.push(h)),"e"===r.substr(0,1)){for(b.push(p),c=A=1,C=n-1;1<=C?A<=C:A>=C;c=1<=C?++A:--A)b.push(p+c/n*(h-p));b.push(h)}else if("l"===r.substr(0,1)){if(p<=0)throw"Logarithmic scales are only possible for values > 0";for(m=Math.LOG10E*Math.log(p),g=Math.LOG10E*Math.log(h),b.push(p),c=P=1,W=n-1;1<=W?P<=W:P>=W;c=1<=W?++P:--P)b.push(Math.pow(10,m+c/n*(g-m)));b.push(h)}else if("q"===r.substr(0,1)){for(b.push(p),c=G=1,$=n-1;1<=$?G<=$:G>=$;c=1<=$?++G:--G)_=U.length*c/n,(k=Math.floor(_))===_?b.push(U[k]):(j=_-k,b.push(U[k]*j+U[k+1]*(1-j)));b.push(h)}else if("k"===r.substr(0,1)){for(w=U.length,t=new Array(w),i=new Array(n),M=!0,v=0,a=null,(a=[]).push(p),c=E=1,Z=n-1;1<=Z?E<=Z:E>=Z;c=1<=Z?++E:--E)a.push(p+c/n*(h-p));for(a.push(h);M;){for(u=B=0,H=n-1;0<=H?B<=H:B>=H;u=0<=H?++B:--B)i[u]=0;for(c=I=0,J=w-1;0<=J?I<=J:I>=J;c=0<=J?++I:--I){for(D=U[c],y=Number.MAX_VALUE,u=q=0,K=n-1;0<=K?q<=K:q>=K;u=0<=K?++q:--q)(d=Math.abs(a[u]-D))<y&&(y=d,f=u);i[f]++,t[c]=f}for(x=new Array(n),u=R=0,Q=n-1;0<=Q?R<=Q:R>=Q;u=0<=Q?++R:--R)x[u]=null;for(c=S=0,ee=w-1;0<=ee?S<=ee:S>=ee;c=0<=ee?++S:--S)null===x[o=t[c]]?x[o]=U[c]:x[o]+=U[c];for(u=O=0,T=n-1;0<=T?O<=T:O>=T;u=0<=T?++O:--O)x[u]*=1/i[u];for(M=!1,u=re=0,Y=n-1;0<=Y?re<=Y:re>=Y;u=0<=Y?++re:--re)if(x[u]!==a[c]){M=!0;break}a=x,++v>200&&(M=!1)}for(l={},u=ne=0,L=n-1;0<=L?ne<=L:ne>=L;u=0<=L?++ne:--ne)l[u]=[];for(c=te=0,F=w-1;0<=F?te<=F:te>=F;c=0<=F?++te:--te)l[o=t[c]].push(U[c]);for(N=[],u=fe=0,V=n-1;0<=V?fe<=V:fe>=V;u=0<=V?++fe:--fe)N.push(l[u][0]),N.push(l[u][l[u].length-1]);for(N=N.sort((function(e,r){return e-r})),b.push(N[0]),c=ae=1,X=N.length-1;ae<=X;c=ae+=2)isNaN(N[c])||b.push(N[c])}return b},
1
+ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Trianglify=e()}}((function(){return function e(r,n,t){function f(o,i){if(!n[o]){if(!r[o]){var s="function"==typeof require&&require;if(!i&&s)return s(o,!0);if(a)return a(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var c=n[o]={exports:{}};r[o][0].call(c.exports,(function(e){var n=r[o][1][e];return f(n||e)}),c,c.exports,e,r,n,t)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<t.length;o++)f(t[o]);return f}({"./lib/trianglify.js":[function(e,r,n){var t=e("delaunay-fast"),f=e("seedrandom"),a=e("chroma-js"),o=e("./colorbrewer"),i=e("./pattern"),s={width:600,height:400,cell_size:75,variance:.75,seed:null,x_colors:"random",y_colors:"match_x",palette:o,color_space:"lab",color_function:null,stroke_width:1.51};function d(e){if(e=function(e,r){var n={};for(var t in e)n[t]=e[t];for(t in r){if(!e.hasOwnProperty(t))throw new Error(t+" is not a configuration option for Trianglify. Check your spelling?");n[t]=r[t]}return n}(s,e),rand=f(e.seed),"random"===e.x_colors&&(e.x_colors=U()),"random"===e.y_colors&&(e.y_colors=U()),"match_x"===e.y_colors&&(e.y_colors=e.x_colors),!(e.width>0&&e.height>0))throw new Error("Width and height must be numbers greater than 0");if(e.cell_size<2)throw new Error("Cell size must be greater than 2.");var r;if(e.color_function)r=function(r,n){return a(e.color_function(r,n))};else{var n=a.scale(e.x_colors).mode(e.color_space),o=a.scale(e.y_colors).mode(e.color_space);r=function(r,t){return a.interpolate(n(r),o(t),.5,e.color_space)}}for(var d,c,u,l=e.width,b=e.height,h=Math.floor((l+4*e.cell_size)/e.cell_size),g=Math.floor((b+4*e.cell_size)/e.cell_size),p=(h*e.cell_size-l)/2,m=(g*e.cell_size-b)/2,y=e.cell_size*e.variance/2,w=function(r,n){for(var t=[],f=-p;f<r+p;f+=e.cell_size)for(var a=-m;a<n+m;a+=e.cell_size){var o=f+e.cell_size/2+D(rand(),[0,1],[-y,y]),i=a+e.cell_size/2+D(rand(),[0,1],[-y,y]);t.push([o,i].map(Math.floor))}return t}(l,b),v=t.triangulate(w),x=[],_=function(e){return w[e]},k=0;k<v.length;k+=3){var j=[v[k],v[k+1],v[k+2]].map(_),M={x:((u=j)[0][0]+u[1][0]+u[2][0])/3,y:(u[0][1]+u[1][1]+u[2][1])/3},N=r((c=M.x,D(c,[-p,l+p],[0,1])),(d=M.y,D(d,[-m,b+m],[0,1]))).hex();x.push([N,j])}return i(x,e);function D(e,r,n){return(e-r[0])*(n[1]-n[0])/(r[1]-r[0])+n[0]}function U(){if(e.palette instanceof Array)return e.palette[Math.floor(rand()*e.palette.length)];var r=Object.keys(e.palette);return e.palette[r[Math.floor(rand()*r.length)]]}}d.colorbrewer=o,d.defaults=s,r.exports=d},{"./colorbrewer":"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js","./pattern":"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js","chroma-js":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js","delaunay-fast":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js",seedrandom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js"}],"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js":[function(e,r,n){r.exports={YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]}},{}],"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js":[function(e,r,n){(function(n){var t="undefined"!=typeof document?document:e("jsdom").jsdom("<html></html>");r.exports=function(r,f){function a(a){if(void 0!==n)try{e("canvas")}catch(e){throw Error("The optional node-canvas dependency is needed for Trianglify to render using canvas in node.")}return a||(a=t.createElement("canvas")),a.setAttribute("width",f.width),a.setAttribute("height",f.height),ctx=a.getContext("2d"),ctx.canvas.width=f.width,ctx.canvas.height=f.height,r.forEach((function(e){ctx.fillStyle=ctx.strokeStyle=e[0],ctx.lineWidth=f.stroke_width,ctx.beginPath(),ctx.moveTo.apply(ctx,e[1][0]),ctx.lineTo.apply(ctx,e[1][1]),ctx.lineTo.apply(ctx,e[1][2]),ctx.fill(),ctx.stroke()})),a}return{polys:r,opts:f,svg:function(){var e=t.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width",f.width),e.setAttribute("height",f.height),r.forEach((function(r){var n=t.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d","M"+r[1].join("L")+"Z"),n.setAttribute("fill",r[0]),n.setAttribute("stroke",r[0]),n.setAttribute("stroke-width",f.stroke_width),e.appendChild(n)})),e},canvas:a,png:function(){return a().toDataURL("image/png")}}}}).call(this,e("_process"))},{_process:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js",canvas:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js",jsdom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js":[function(e,r,n){},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js":[function(e,r,n){var t=r.exports={},f=[],a=!1;function o(){if(!a){var e;a=!0;for(var r=f.length;r;){e=f,f=[];for(var n=-1;++n<r;)e[n]();r=f.length}a=!1}}function i(){}t.nextTick=function(e){f.push(e),a||setTimeout(o,0)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=i,t.addListener=i,t.once=i,t.off=i,t.removeListener=i,t.removeAllListeners=i,t.emit=i,t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js":[function(e,r,n){
2
  /** echo * @license echo * while read i do echo * done echo
3
  */
4
  (function(){var e,t,f,a,o,i,s,d,c,u,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,z,G,E,B;s=function(r,n,t,f){return new e(r,n,t,f)},null!=r&&null!=r.exports&&(r.exports=s),(null!=n?n:this).chroma=s,s.color=function(r,n,t,f){return new e(r,n,t,f)},s.hsl=function(r,n,t,f){return new e(r,n,t,f,"hsl")},s.hsv=function(r,n,t,f){return new e(r,n,t,f,"hsv")},s.rgb=function(r,n,t,f){return new e(r,n,t,f,"rgb")},s.hex=function(r){return new e(r)},s.css=function(r){return new e(r)},s.lab=function(r,n,t){return new e(r,n,t,"lab")},s.lch=function(r,n,t){return new e(r,n,t,"lch")},s.hsi=function(r,n,t){return new e(r,n,t,"hsi")},s.gl=function(r,n,t,f){return new e(255*r,255*n,255*t,f,"gl")},s.mix=s.interpolate=function(r,n,t,f){return null==r||null==n?"#000":("string"===z(r)&&(r=new e(r)),"string"===z(n)&&(n=new e(n)),r.interpolate(t,n,f))},s.contrast=function(r,n){var t,f;return"string"===z(r)&&(r=new e(r)),"string"===z(n)&&(n=new e(n)),(t=r.luminance())>(f=n.luminance())?(t+.05)/(f+.05):(f+.05)/(t+.05)},s.luminance=function(e){return s(e).luminance()},s._Color=e,e=function(){function e(){var e,r,n,t,f,a,o,i,s,c,u,p,y,w,x;for(f=this,n=[],s=0,c=arguments.length;s<c;s++)null!=(r=arguments[s])&&n.push(r);if(0===n.length)a=(u=[255,0,255,1,"rgb"])[0],o=u[1],i=u[2],e=u[3],t=u[4];else if("array"===z(n[0])){if(3===n[0].length)a=(p=n[0])[0],o=p[1],i=p[2],e=1;else{if(4!==n[0].length)throw"unknown input argument";a=(y=n[0])[0],o=y[1],i=y[2],e=y[3]}t=null!=(w=n[1])?w:"rgb"}else"string"===z(n[0])?(a=n[0],t="hex"):"object"===z(n[0])?(a=(x=n[0]._rgb)[0],o=x[1],i=x[2],e=x[3],t="rgb"):n.length>=3&&(a=n[0],o=n[1],i=n[2]);3===n.length?(t="rgb",e=1):4===n.length?"string"===z(n[3])?(t=n[3],e=1):"number"===z(n[3])&&(t="rgb",e=n[3]):5===n.length&&(e=n[3],t=n[4]),null==e&&(e=1),"rgb"===t?f._rgb=[a,o,i,e]:"gl"===t?f._rgb=[255*a,255*o,255*i,e]:"hsl"===t?(f._rgb=h(a,o,i),f._rgb[3]=e):"hsv"===t?(f._rgb=g(a,o,i),f._rgb[3]=e):"hex"===t?f._rgb=l(a):"lab"===t?(f._rgb=m(a,o,i),f._rgb[3]=e):"lch"===t?(f._rgb=v(a,o,i),f._rgb[3]=e):"hsi"===t&&(f._rgb=b(a,o,i),f._rgb[3]=e),d(f._rgb)}return e.prototype.rgb=function(){return this._rgb.slice(0,3)},e.prototype.rgba=function(){return this._rgb},e.prototype.hex=function(){return j(this._rgb)},e.prototype.toString=function(){return this.name()},e.prototype.hsl=function(){return N(this._rgb)},e.prototype.hsv=function(){return D(this._rgb)},e.prototype.lab=function(){return U(this._rgb)},e.prototype.lch=function(){return A(this._rgb)},e.prototype.hsi=function(){return M(this._rgb)},e.prototype.gl=function(){return[this._rgb[0]/255,this._rgb[1]/255,this._rgb[2]/255,this._rgb[3]]},e.prototype.luminance=function(r,n){var t,f,a,o;return null==n&&(n="rgb"),arguments.length?(0===r&&(this._rgb=[0,0,0,this._rgb[3]]),1===r&&(this._rgb=[255,255,255,this._rgb[3]]),t=_(this._rgb),f=1e-7,a=20,o=function(e,t){var i,s;return i=(s=e.interpolate(.5,t,n)).luminance(),Math.abs(r-i)<f||!a--?s:i>r?o(e,s):o(s,t)},this._rgb=(t>r?o(new e("black"),this):o(this,new e("white"))).rgba(),this):_(this._rgb)},e.prototype.name=function(){var e,r;for(r in e=this.hex(),s.colors)if(e===s.colors[r])return r;return e},e.prototype.alpha=function(e){return arguments.length?(this._rgb[3]=e,this):this._rgb[3]},e.prototype.css=function(e){var r,n,t;return null==e&&(e="rgb"),this,n=this._rgb,3===e.length&&n[3]<1&&(e+="a"),"rgb"===e?e+"("+n.slice(0,3).map(Math.round).join(",")+")":"rgba"===e?e+"("+n.slice(0,3).map(Math.round).join(",")+","+n[3]+")":"hsl"===e||"hsla"===e?(t=function(e){return Math.round(100*e)/100},(r=this.hsl())[0]=t(r[0]),r[1]=t(100*r[1])+"%",r[2]=t(100*r[2])+"%",4===e.length&&(r[3]=n[3]),e+"("+r.join(",")+")"):void 0},e.prototype.interpolate=function(r,n,t){var f,a,o,i,s,d,c,u,l,b,h,g,p;if(c=this,null==t&&(t="rgb"),"string"===z(n)&&(n=new e(n)),"hsl"===t||"hsv"===t||"lch"===t||"hsi"===t)"hsl"===t?(g=c.hsl(),p=n.hsl()):"hsv"===t?(g=c.hsv(),p=n.hsv()):"hsi"===t?(g=c.hsi(),p=n.hsi()):"lch"===t&&(g=c.lch(),p=n.lch()),"h"===t.substr(0,1)?(a=g[0],b=g[1],s=g[2],o=p[0],h=p[1],d=p[2]):(s=g[0],b=g[1],a=g[2],d=p[0],h=p[1],o=p[2]),isNaN(a)||isNaN(o)?isNaN(a)?isNaN(o)?f=Number.NaN:(f=o,1!==s&&0!==s||"hsv"===t||(l=h)):(f=a,1!==d&&0!==d||"hsv"===t||(l=b)):f=a+r*(o>a&&o-a>180?o-(a+360):o<a&&a-o>180?o+360-a:o-a),null==l&&(l=b+r*(h-b)),i=s+r*(d-s),u="h"===t.substr(0,1)?new e(f,l,i,t):new e(i,l,f,t);else if("rgb"===t)g=c._rgb,p=n._rgb,u=new e(g[0]+r*(p[0]-g[0]),g[1]+r*(p[1]-g[1]),g[2]+r*(p[2]-g[2]),t);else{if("lab"!==t)throw"color mode "+t+" is not supported";g=c.lab(),p=n.lab(),u=new e(g[0]+r*(p[0]-g[0]),g[1]+r*(p[1]-g[1]),g[2]+r*(p[2]-g[2]),t)}return u.alpha(c.alpha()+r*(n.alpha()-c.alpha())),u},e.prototype.premultiply=function(){var e,r;return r=this.rgb(),e=this.alpha(),s(r[0]*e,r[1]*e,r[2]*e,e)},e.prototype.darken=function(e){var r;return null==e&&(e=20),this,(r=this.lch())[0]-=e,s.lch(r).alpha(this.alpha())},e.prototype.darker=function(e){return this.darken(e)},e.prototype.brighten=function(e){return null==e&&(e=20),this.darken(-e)},e.prototype.brighter=function(e){return this.brighten(e)},e.prototype.saturate=function(e){var r;return null==e&&(e=20),this,(r=this.lch())[1]+=e,s.lch(r).alpha(this.alpha())},e.prototype.desaturate=function(e){return null==e&&(e=20),this.saturate(-e)},e}(),d=function(e){var r;for(r in e)r<3?(e[r]<0&&(e[r]=0),e[r]>255&&(e[r]=255)):3===r&&(e[r]<0&&(e[r]=0),e[r]>1&&(e[r]=1));return e},u=function(e){var r,n,t,f,a,o,i,d;if(e=e.toLowerCase(),null!=s.colors&&s.colors[e])return l(s.colors[e]);if(t=e.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(f=t.slice(1,4),n=a=0;a<=2;n=++a)f[n]=+f[n];f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(f=t.slice(1,5),n=o=0;o<=3;n=++o)f[n]=+f[n];else if(t=e.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(f=t.slice(1,4),n=i=0;i<=2;n=++i)f[n]=Math.round(2.55*f[n]);f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(f=t.slice(1,5),n=d=0;d<=2;n=++d)f[n]=Math.round(2.55*f[n]);f[3]=+f[3]}else(t=e.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(f=h(r))[3]=1):(t=e.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(f=h(r))[3]=+t[4]);return f},l=function(e){var r,n;if(e.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return 4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[(n=parseInt(e,16))>>16,n>>8&255,255&n,1];if(e.match(/^#?([A-Fa-f0-9]{8})$/))return 9===e.length&&(e=e.substr(1)),[(n=parseInt(e,16))>>24&255,n>>16&255,n>>8&255,255&n];if(r=u(e))return r;throw"unknown color: "+e},b=function(e,r,n){var a,o,i,s;return e=(s=G(arguments))[0],r=s[1],n=s[2],(e/=360)<1/3?o=1-((a=(1-r)/3)+(i=(1+r*c(f*e)/c(t-f*e))/3)):e<2/3?a=1-((i=(1-r)/3)+(o=(1+r*c(f*(e-=1/3))/c(t-f*e))/3)):i=1-((o=(1-r)/3)+(a=(1+r*c(f*(e-=2/3))/c(t-f*e))/3)),[255*(i=x(n*i*3)),255*(o=x(n*o*3)),255*(a=x(n*a*3))]},h=function(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b;if(t=(l=G(arguments))[0],i=l[1],a=l[2],0===i)o=n=e=255*a;else{for(r=[0,0,0],s=2*a-(d=a<.5?a*(1+i):a+i-a*i),(c=[0,0,0])[0]=(t/=360)+1/3,c[1]=t,c[2]=t-1/3,f=u=0;u<=2;f=++u)c[f]<0&&(c[f]+=1),c[f]>1&&(c[f]-=1),6*c[f]<1?r[f]=s+6*(d-s)*c[f]:2*c[f]<1?r[f]=d:3*c[f]<2?r[f]=s+(d-s)*(2/3-c[f])*6:r[f]=s;o=(b=[Math.round(255*r[0]),Math.round(255*r[1]),Math.round(255*r[2])])[0],n=b[1],e=b[2]}return[o,n,e]},g=function(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b,h,g,p,m;if(t=(u=G(arguments))[0],s=u[1],c=u[2],c*=255,0===s)i=n=e=c;else switch(360===t&&(t=0),t>360&&(t-=360),t<0&&(t+=360),a=c*(1-s),o=c*(1-s*(r=(t/=60)-(f=Math.floor(t)))),d=c*(1-s*(1-r)),f){case 0:i=(l=[c,d,a])[0],n=l[1],e=l[2];break;case 1:i=(b=[o,c,a])[0],n=b[1],e=b[2];break;case 2:i=(h=[a,c,d])[0],n=h[1],e=h[2];break;case 3:i=(g=[a,o,c])[0],n=g[1],e=g[2];break;case 4:i=(p=[d,a,c])[0],n=p[1],e=p[2];break;case 5:i=(m=[c,a,o])[0],n=m[1],e=m[2]}return[i=Math.round(i),n=Math.round(n),e=Math.round(e)]},a=.95047,o=1.08883,p=function(){var e,r,n,t;return n=(t=G(arguments))[0],e=t[1],r=t[2],[n,Math.sqrt(e*e+r*r),Math.atan2(r,e)/Math.PI*180]},m=function(e,r,n){var t,f,i,s,d,c,u;return void 0!==e&&3===e.length&&(e=(c=e)[0],r=c[1],n=c[2]),void 0!==e&&3===e.length&&(e=(u=e)[0],r=u[1],n=u[2]),d=(s=(e+16)/116)-n/200,i=y(i=s+r/500)*a,s=1*y(s),d=y(d)*o,f=B(3.2404542*i-1.5371385*s-.4985314*d),t=B(-.969266*i+1.8760108*s+.041556*d),n=B(.0556434*i-.2040259*s+1.0572252*d),[x(f,0,255),x(t,0,255),x(n,0,255),1]},y=function(e){return e>.206893034?e*e*e:(e-4/29)/7.787037},B=function(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))},w=function(){var e,r,n,t;return n=(t=G(arguments))[0],e=t[1],r=(r=t[2])*Math.PI/180,[n,Math.cos(r)*e,Math.sin(r)*e]},v=function(e,r,n){var t,f,a,o,i,s,d;return t=(s=w(e,r,n))[0],f=s[1],a=s[2],i=(d=m(t,f,a))[0],o=d[1],a=d[2],[x(i,0,255),x(o,0,255),x(a,0,255)]},_=function(e,r,n){var t;return e=(t=G(arguments))[0],r=t[1],n=t[2],.2126*(e=k(e))+.7152*(r=k(r))+.0722*(n=k(n))},k=function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},j=function(){var e,r;return"#"+(e="000000"+((r=G(arguments))[0]<<16|r[1]<<8|r[2]).toString(16)).substr(e.length-6)},M=function(){var e,r,n,t,f,a,o,i;return a=(i=G(arguments))[0],n=i[1],r=i[2],e=2*Math.PI,a/=255,n/=255,r/=255,0===(o=1-Math.min(a,n,r)/(f=(a+n+r)/3))?t=0:(t=(a-n+(a-r))/2,t/=Math.sqrt((a-n)*(a-n)+(a-r)*(n-r)),t=Math.acos(t),r>n&&(t=e-t),t/=e),[360*t,o,f]},N=function(e,r,n){var t,f,a,o,i,s;return void 0!==e&&e.length>=3&&(e=(s=e)[0],r=s[1],n=s[2]),e/=255,r/=255,n/=255,o=Math.min(e,r,n),f=((a=Math.max(e,r,n))+o)/2,a===o?(i=0,t=Number.NaN):i=f<.5?(a-o)/(a+o):(a-o)/(2-a-o),e===a?t=(r-n)/(a-o):r===a?t=2+(n-e)/(a-o):n===a&&(t=4+(e-r)/(a-o)),(t*=60)<0&&(t+=360),[t,i,f]},D=function(){var e,r,n,t,f,a,o,i,s,d;return o=(d=G(arguments))[0],n=d[1],e=d[2],a=Math.min(o,n,e),r=(f=Math.max(o,n,e))-a,s=f/255,0===f?(t=Number.NaN,i=0):(i=r/f,o===f&&(t=(n-e)/r),n===f&&(t=2+(e-o)/r),e===f&&(t=4+(o-n)/r),(t*=60)<0&&(t+=360)),[t,i,s]},U=function(){var e,r,n,t,f,i;return n=(i=G(arguments))[0],r=i[1],e=i[2],n=P(n),r=P(r),e=P(e),t=E((.4124564*n+.3575761*r+.1804375*e)/a),[116*(f=E((.2126729*n+.7151522*r+.072175*e)/1))-16,500*(t-f),200*(f-E((.0193339*n+.119192*r+.9503041*e)/o))]},P=function(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},E=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},A=function(){var e,r,n,t,f,a,o;return f=(a=G(arguments))[0],n=a[1],r=a[2],t=(o=U(f,n,r))[0],e=o[1],r=o[2],p(t,e,r)},s.scale=function(e,r){var n,t,f,a,o,i,d,c,u,l,b,h,g,p,m,y,w,v,x;return p="rgb",m=s("#ccc"),x=0,!1,b=[0,1],u=[],w=!1,v=[],g=0,h=1,l=!1,y=0,c={},o=function(e,r){var n,t,f,o,i,d,c;if(null==e&&(e=["#ddd","#222"]),null!=e&&"string"===z(e)&&null!=(null!=(i=s.brewer)?i[e]:void 0)&&(e=s.brewer[e]),"array"===z(e)){for(n=f=0,d=(e=e.slice(0)).length-1;0<=d?f<=d:f>=d;n=0<=d?++f:--f)t=e[n],"string"===z(t)&&(e[n]=s(t));if(null!=r)v=r;else for(v=[],n=o=0,c=e.length-1;0<=c?o<=c:o>=c;n=0<=c?++o:--o)v.push(n/(e.length-1))}return a(),u=e},i=function(e){return null==e&&(e=[]),b=e,g=e[0],h=e[e.length-1],a(),y=2===e.length?0:e.length-1},t=function(e){var r,n;if(null!=b){for(n=b.length-1,r=0;r<n&&e>=b[r];)r++;return r-1}return 0},d=function(e){return e},function(e){var r,n,f,a,o;return o=e,b.length>2&&(a=b.length-1,r=t(e),f=b[0]+(b[1]-b[0])*(0+.5*x),n=b[a-1]+(b[a]-b[a-1])*(1-.5*x),o=g+(b[r]+.5*(b[r+1]-b[r])-f)/(n-f)*(h-g)),o},f=function(e,r){var n,f,a,o,i,l,w;if(null==r&&(r=!1),isNaN(e))return m;if(r?i=e:b.length>2?i=t(e)/(y-1):(i=g!==h?(e-g)/(h-g):0,i=(e-g)/(h-g),i=Math.min(1,Math.max(0,i))),r||(i=d(i)),a=Math.floor(1e4*i),c[a])n=c[a];else{if("array"===z(u))for(f=l=0,w=v.length-1;0<=w?l<=w:l>=w;f=0<=w?++l:--l){if(i<=(o=v[f])){n=u[f];break}if(i>=o&&f===v.length-1){n=u[f];break}if(i>o&&i<v[f+1]){i=(i-o)/(v[f+1]-o),n=s.interpolate(u[f],u[f+1],i,p);break}}else"function"===z(u)&&(n=u(i));c[a]=n}return n},a=function(){return c={}},o(e,r),(n=function(e){var r;return r=f(e),w&&r[w]?r[w]():r}).domain=function(e,r,t,f){var a;return null==t&&(t="e"),arguments.length?(null!=r&&(a=s.analyze(e,f),e=0===r?[a.min,a.max]:s.limits(a,t,r)),i(e),n):b},n.mode=function(e){return arguments.length?(p=e,a(),n):p},n.range=function(e,r){return o(e,r),n},n.out=function(e){return w=e,n},n.spread=function(e){return arguments.length?(x=e,n):x},n.correctLightness=function(e){return arguments.length?(l=e,a(),d=l?function(e){var r,n,t,a,o,i,s,d,c;for(r=f(0,!0).lab()[0],n=f(1,!0).lab()[0],s=r>n,t=f(e,!0).lab()[0],a=t-(o=r+(n-r)*e),d=0,c=1,i=20;Math.abs(a)>.01&&i-- >0;)s&&(a*=-1),a<0?(d=e,e+=.5*(c-e)):(c=e,e+=.5*(d-e)),t=f(e,!0).lab()[0],a=t-o;return e}:function(e){return e},n):l},n.colors=function(r){var t,f,a,o,i,s;if(null==r&&(r="hex"),e=[],f=[],b.length>2)for(t=a=1,s=b.length;1<=s?a<s:a>s;t=1<=s?++a:--a)f.push(.5*(b[t-1]+b[t]));else f=b;for(o=0,i=f.length;o<i;o++)t=f[o],e.push(n(t)[r]());return e},n},null==s.scales&&(s.scales={}),s.scales.cool=function(){return s.scale([s.hsl(180,1,.9),s.hsl(250,.7,.4)])},s.scales.hot=function(){return s.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},s.analyze=function(e,r,n){var t,f,a,o,i,d;if(a={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==n&&(n=function(){return!0}),t=function(e){null==e||isNaN(e)||(a.values.push(e),a.sum+=e,e<a.min&&(a.min=e),e>a.max&&(a.max=e),a.count+=1)},o=function(e,f){if(n(e,f))return null!=r&&"function"===z(r)?t(r(e)):null!=r&&"string"===z(r)||"number"===z(r)?t(e[r]):t(e)},"array"===z(e))for(i=0,d=e.length;i<d;i++)o(e[i]);else for(f in e)o(e[f],f);return a.domain=[a.min,a.max],a.limits=function(e,r){return s.limits(a,e,r)},a},s.limits=function(e,r,n){var t,f,a,o,i,d,c,u,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,G,E,B,I,q,R,S,O,C,T,Y,L,F,V,X,W,$,Z,H,J,K,Q,ee,re,ne,te,fe,ae;if(null==r&&(r="equal"),null==n&&(n=7),"array"===z(e)&&(e=s.analyze(e)),p=e.min,h=e.max,e.sum,U=e.values.sort((function(e,r){return e-r})),b=[],"c"===r.substr(0,1)&&(b.push(p),b.push(h)),"e"===r.substr(0,1)){for(b.push(p),c=A=1,C=n-1;1<=C?A<=C:A>=C;c=1<=C?++A:--A)b.push(p+c/n*(h-p));b.push(h)}else if("l"===r.substr(0,1)){if(p<=0)throw"Logarithmic scales are only possible for values > 0";for(m=Math.LOG10E*Math.log(p),g=Math.LOG10E*Math.log(h),b.push(p),c=P=1,W=n-1;1<=W?P<=W:P>=W;c=1<=W?++P:--P)b.push(Math.pow(10,m+c/n*(g-m)));b.push(h)}else if("q"===r.substr(0,1)){for(b.push(p),c=G=1,$=n-1;1<=$?G<=$:G>=$;c=1<=$?++G:--G)_=U.length*c/n,(k=Math.floor(_))===_?b.push(U[k]):(j=_-k,b.push(U[k]*j+U[k+1]*(1-j)));b.push(h)}else if("k"===r.substr(0,1)){for(w=U.length,t=new Array(w),i=new Array(n),M=!0,v=0,a=null,(a=[]).push(p),c=E=1,Z=n-1;1<=Z?E<=Z:E>=Z;c=1<=Z?++E:--E)a.push(p+c/n*(h-p));for(a.push(h);M;){for(u=B=0,H=n-1;0<=H?B<=H:B>=H;u=0<=H?++B:--B)i[u]=0;for(c=I=0,J=w-1;0<=J?I<=J:I>=J;c=0<=J?++I:--I){for(D=U[c],y=Number.MAX_VALUE,u=q=0,K=n-1;0<=K?q<=K:q>=K;u=0<=K?++q:--q)(d=Math.abs(a[u]-D))<y&&(y=d,f=u);i[f]++,t[c]=f}for(x=new Array(n),u=R=0,Q=n-1;0<=Q?R<=Q:R>=Q;u=0<=Q?++R:--R)x[u]=null;for(c=S=0,ee=w-1;0<=ee?S<=ee:S>=ee;c=0<=ee?++S:--S)null===x[o=t[c]]?x[o]=U[c]:x[o]+=U[c];for(u=O=0,T=n-1;0<=T?O<=T:O>=T;u=0<=T?++O:--O)x[u]*=1/i[u];for(M=!1,u=re=0,Y=n-1;0<=Y?re<=Y:re>=Y;u=0<=Y?++re:--re)if(x[u]!==a[c]){M=!0;break}a=x,++v>200&&(M=!1)}for(l={},u=ne=0,L=n-1;0<=L?ne<=L:ne>=L;u=0<=L?++ne:--ne)l[u]=[];for(c=te=0,F=w-1;0<=F?te<=F:te>=F;c=0<=F?++te:--te)l[o=t[c]].push(U[c]);for(N=[],u=fe=0,V=n-1;0<=V?fe<=V:fe>=V;u=0<=V?++fe:--fe)N.push(l[u][0]),N.push(l[u][l[u].length-1]);for(N=N.sort((function(e,r){return e-r})),b.push(N[0]),c=ae=1,X=N.length-1;ae<=X;c=ae+=2)isNaN(N[c])||b.push(N[c])}return b},
base/inc/fields/js/autocomplete-field.js CHANGED
@@ -66,7 +66,7 @@
66
  );
67
  };
68
 
69
- $$.find('.siteorigin-widget-autocomplete-input').click(function () {
70
  var $s = $$.find('.existing-content-selector');
71
  $s.show();
72
 
@@ -84,14 +84,14 @@
84
  $$.find('.existing-content-selector').hide();
85
  };
86
 
87
- $(window).mousedown(function (event) {
88
  var mouseDownOutside = $$.find(event.target).length === 0;
89
  if ( mouseDownOutside ) {
90
  closeContent();
91
  }
92
  });
93
 
94
- $$.find('.button-close').click( closeContent );
95
 
96
  // Clicking on one of the url items
97
  $$.on( 'click', '.items li', function(e) {
@@ -111,11 +111,11 @@
111
  }
112
  var $input = $$.find('input.siteorigin-widget-input');
113
  $input.val( selectedItems.join(',') );
114
- $input.change();
115
  } );
116
 
117
  var interval = null;
118
- $$.find('.content-text-search').keyup( function(){
119
  if( interval !== null ) {
120
  clearTimeout(interval);
121
  }
66
  );
67
  };
68
 
69
+ $$.find( '.siteorigin-widget-autocomplete-input' ).on( 'click', function () {
70
  var $s = $$.find('.existing-content-selector');
71
  $s.show();
72
 
84
  $$.find('.existing-content-selector').hide();
85
  };
86
 
87
+ $( window ).on( 'mousedown', function( event ) {
88
  var mouseDownOutside = $$.find(event.target).length === 0;
89
  if ( mouseDownOutside ) {
90
  closeContent();
91
  }
92
  });
93
 
94
+ $$.find('.button-close').on( 'click', closeContent );
95
 
96
  // Clicking on one of the url items
97
  $$.on( 'click', '.items li', function(e) {
111
  }
112
  var $input = $$.find('input.siteorigin-widget-input');
113
  $input.val( selectedItems.join(',') );
114
+ $input.trigger( 'change' );
115
  } );
116
 
117
  var interval = null;
118
+ $$.find('.content-text-search').on( 'keyup', function() {
119
  if( interval !== null ) {
120
  clearTimeout(interval);
121
  }
base/inc/fields/js/autocomplete-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-autocomplete",(function(t){var i=e(this);if(!i.data("initialized")){var n=function(){var e=i.find("input.siteorigin-widget-input").val();return 0===e.length?[]:e.split(",")},a=function(){var t=n();i.find("ul.items > li").each((function(i,n){var a=e(this);t.indexOf(a.data("value"))>-1?a.addClass("selected"):a.removeClass("selected")}))},s=function(){var t=i.find(".content-text-search"),n=t.val(),a=t.data("source"),s=t.data("postTypes"),l={action:"so_widgets_search_"+a};"posts"===a?(l.query=n,l.postTypes=s):"terms"===a&&(l.term=n);var o=i.find("ul.items").empty().addClass("loading");return e.get(soWidgets.ajaxurl,l,(function(t){t.forEach((function(t){""===t.label&&(t.label="&nbsp;"),o.append(e("<li>").html(t.label+"<span>("+t.type+")</span>").data(t))})),o.removeClass("loading")}))};i.find(".siteorigin-widget-autocomplete-input").click((function(){var t=i.find(".existing-content-selector");t.show();var n=new e.Deferred;t.is(":visible")&&0===t.find("ul.items li").length?n=s():n.resolve(),n.done(a)}));var l=function(){i.find(".existing-content-selector").hide()};e(window).mousedown((function(e){0===i.find(e.target).length&&l()})),i.find(".button-close").click(l),i.on("click",".items li",(function(t){t.preventDefault();var a=e(this),s=n(),l=a.data("value"),o=s.indexOf(l);o>-1?(s.splice(o,1),a.removeClass("selected")):(s.push(l),a.addClass("selected"));var d=i.find("input.siteorigin-widget-input");d.val(s.join(",")),d.change()}));var o=null;i.find(".content-text-search").keyup((function(){null!==o&&clearTimeout(o),o=setTimeout((function(){s()}),500)})),i.data("initialized",!0)}}))}(jQuery);
1
+ !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-autocomplete",(function(t){var i=e(this);if(!i.data("initialized")){var n=function(){var e=i.find("input.siteorigin-widget-input").val();return 0===e.length?[]:e.split(",")},a=function(){var t=n();i.find("ul.items > li").each((function(i,n){var a=e(this);t.indexOf(a.data("value"))>-1?a.addClass("selected"):a.removeClass("selected")}))},o=function(){var t=i.find(".content-text-search"),n=t.val(),a=t.data("source"),o=t.data("postTypes"),s={action:"so_widgets_search_"+a};"posts"===a?(s.query=n,s.postTypes=o):"terms"===a&&(s.term=n);var l=i.find("ul.items").empty().addClass("loading");return e.get(soWidgets.ajaxurl,s,(function(t){t.forEach((function(t){""===t.label&&(t.label="&nbsp;"),l.append(e("<li>").html(t.label+"<span>("+t.type+")</span>").data(t))})),l.removeClass("loading")}))};i.find(".siteorigin-widget-autocomplete-input").on("click",(function(){var t=i.find(".existing-content-selector");t.show();var n=new e.Deferred;t.is(":visible")&&0===t.find("ul.items li").length?n=o():n.resolve(),n.done(a)}));var s=function(){i.find(".existing-content-selector").hide()};e(window).on("mousedown",(function(e){0===i.find(e.target).length&&s()})),i.find(".button-close").on("click",s),i.on("click",".items li",(function(t){t.preventDefault();var a=e(this),o=n(),s=a.data("value"),l=o.indexOf(s);l>-1?(o.splice(l,1),a.removeClass("selected")):(o.push(s),a.addClass("selected"));var d=i.find("input.siteorigin-widget-input");d.val(o.join(",")),d.trigger("change")}));var l=null;i.find(".content-text-search").on("keyup",(function(){null!==l&&clearTimeout(l),l=setTimeout((function(){o()}),500)})),i.data("initialized",!0)}}))}(jQuery);
base/inc/fields/js/code-field.js CHANGED
@@ -191,14 +191,14 @@
191
  end = start;
192
  }
193
  if (defaults.textarea.setSelectionRange) {
194
- defaults.textarea.focus();
195
  defaults.textarea.setSelectionRange(start, end);
196
  } else if (defaults.textarea.createTextRange) {
197
  var range = defaults.textarea.createTextRange();
198
  range.collapse(true);
199
  range.moveEnd('character', end);
200
  range.moveStart('character', start);
201
- range.select();
202
  }
203
  },
204
  selection: function(){
@@ -643,4 +643,4 @@
643
  });
644
  } );
645
 
646
- } )( jQuery );
191
  end = start;
192
  }
193
  if (defaults.textarea.setSelectionRange) {
194
+ defaults.textarea.trigger( 'focus' );
195
  defaults.textarea.setSelectionRange(start, end);
196
  } else if (defaults.textarea.createTextRange) {
197
  var range = defaults.textarea.createTextRange();
198
  range.collapse(true);
199
  range.moveEnd('character', end);
200
  range.moveStart('character', start);
201
+ range.trigger( 'select' );
202
  }
203
  },
204
  selection: function(){
643
  });
644
  } );
645
 
646
+ } )( jQuery );
base/inc/fields/js/code-field.min.js CHANGED
@@ -1 +1 @@
1
- (function(e){"use strict";var t,r=r||(t={},{add:function(e,r){var n;if("object"==typeof e)for(n=0;n<e.length;n++){var a=e[n];t[a]||(t[a]=[]),t[a].push(r)}else t[e]||(t[e]=[]),t[e].push(r)},get:function(e){if(t[e])return t[e]}}),n=n||function(t){"function"!=typeof String.prototype.repeat&&(String.prototype.repeat=function(e){if(e<1)return"";if(e%2)return this.repeat(e-1)+this;var t=this.repeat(e/2);return t+t}),"function"!=typeof Array.prototype.filter&&(Array.prototype.filter=function(e){if(null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=[],a=arguments[1],o=0;o<r;o++)if(o in t){var i=t[o];e.call(a,i,o,t)&&n.push(i)}return n});var n,a,o,i={textarea:null,replaceTab:!0,softTabs:!0,tabSize:4,autoOpen:!0,overwrite:!0,autoStrip:!0,autoIndent:!0,fence:!1},s={keyMap:[{open:'"',close:'"',canBreak:!1},{open:"'",close:"'",canBreak:!1},{open:"(",close:")",canBreak:!1},{open:"[",close:"]",canBreak:!0},{open:"{",close:"}",canBreak:!0}]},c={_callHook:function(t,n){var a=r.get(t);if(n="boolean"!=typeof n||!1!==n,a)if(n){var o,s=i.textarea,l=s.value,u=c.cursor.get();for(o=0;o<a.length;o++)a[o].call(e,{editor:{element:s,text:l,levelsDeep:c.levelsDeep()},caret:{pos:u},lines:{current:c.cursor.getLine(l,u),total:c.editor.getLines(l)}})}else for(o=0;o<a.length;o++)a[o].call(e)},defineNewLine:function(){var e=document.createElement("textarea");e.value="\n",a=2==e.value.length?"\r\n":"\n"},defineTabSize:function(e){void 0===i.textarea.style.OTabSize?void 0===i.textarea.style.MozTabSize?void 0===i.textarea.style.tabSize||(i.textarea.style.tabSize=e):i.textarea.style.MozTabSize=e:i.textarea.style.OTabSize=e},cursor:{getLine:function(e,t){return e.substring(0,t).split("\n").length},get:function(){if("number"==typeof document.createElement("textarea").selectionStart)return i.textarea.selectionStart;if(document.selection){var e=0,t=i.textarea.createTextRange(),r=document.selection.createRange().duplicate().getBookmark();for(t.moveToBookmark(r);0!==t.moveStart("character",-1);)e++;return e}},set:function(e,t){if(t||(t=e),i.textarea.setSelectionRange)i.textarea.focus(),i.textarea.setSelectionRange(e,t);else if(i.textarea.createTextRange){var r=i.textarea.createTextRange();r.collapse(!0),r.moveEnd("character",t),r.moveStart("character",e),r.select()}},selection:function(){var e,t,r,n,o,s=i.textarea,l=0,u=0;return"number"==typeof s.selectionStart&&"number"==typeof s.selectionEnd?(l=s.selectionStart,u=s.selectionEnd):(t=document.selection.createRange())&&t.parentElement()==s&&(n=(e=c.editor.get()).length,(r=s.createTextRange()).moveToBookmark(t.getBookmark()),(o=s.createTextRange()).collapse(!1),r.compareEndPoints("StartToEnd",o)>-1?l=u=n:(l=-r.moveStart("character",-n),l+=e.slice(0,l).split(a).length-1,r.compareEndPoints("EndToEnd",o)>-1?u=n:(u=-r.moveEnd("character",-n),u+=e.slice(0,u).split(a).length-1))),l!=u&&{start:l,end:u}}},editor:{getLines:function(e){return e.split("\n").length},get:function(){return i.textarea.value.replace(/\r/g,"")},set:function(e){i.textarea.value=e}},fenceRange:function(){if("string"==typeof i.fence){for(var e=c.editor.get(),t=c.cursor.get(),r=0,n=e.indexOf(i.fence),a=0;n>=0&&(a++,!(t<n+r));)r+=n+i.fence.length,n=(e=e.substring(n+i.fence.length)).indexOf(i.fence);return r<t&&n+r>t&&a%2==0}return!0},isEven:function(e,t){return t%2},levelsDeep:function(){var e,t,r=c.cursor.get(),n=c.editor.get().substring(0,r),a=0;for(e=0;e<n.length;e++)for(t=0;t<s.keyMap.length;t++)s.keyMap[t].canBreak&&(s.keyMap[t].open==n.charAt(e)&&a++,s.keyMap[t].close==n.charAt(e)&&a--);var o=0,i=["'",'"'];for(e=0;e<s.keyMap.length;e++)if(s.keyMap[e].canBreak)for(t in i)o+=n.split(i[t]).filter(c.isEven).join("").split(s.keyMap[e].open).length-1;var l=a-o;return l>=0?l:0},deepExtend:function(e,t){for(var r in t)t[r]&&t[r].constructor&&t[r].constructor===Object?(e[r]=e[r]||{},c.deepExtend(e[r],t[r])):e[r]=t[r];return e},addEvent:function(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent&&e.attachEvent("on"+t,r)},removeEvent:function(e,t,r){e.addEventListener?e.removeEventListener(t,r,!1):e.attachEvent&&e.detachEvent("on"+t,r)},preventDefaultEvent:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}},l=function(e){if(c.fenceRange()){if(9==e.keyCode){c.preventDefaultEvent(e);var t=!0;c._callHook("tab:before");var r=c.cursor.selection(),a=c.cursor.get(),o=c.editor.get();if(r){for(var i=r.start;i--;)if("\n"==o.charAt(i)){r.start=i+1;break}var s,l=o.substring(r.start,r.end),u=l.split("\n");if(e.shiftKey){for(s=0;s<u.length;s++)u[s].substring(0,n.length)==n&&(u[s]=u[s].substring(n.length));l=u.join("\n"),c.editor.set(o.substring(0,r.start)+l+o.substring(r.end)),c.cursor.set(r.start,r.start+l.length)}else{for(s in u)u[s]=n+u[s];l=u.join("\n"),c.editor.set(o.substring(0,r.start)+l+o.substring(r.end)),c.cursor.set(r.start,r.start+l.length)}}else{var f=o.substring(0,a),d=o.substring(a),g=f+n+d;e.shiftKey?o.substring(a-n.length,a)==n&&(g=o.substring(0,a-n.length)+d,c.editor.set(g),c.cursor.set(a-n.length)):(c.editor.set(g),c.cursor.set(a+n.length),t=!1)}c._callHook("tab:after")}return t}},u=function(e){if(c.fenceRange()&&13==e.keyCode){c.preventDefaultEvent(e),c._callHook("enter:before");var t,r,o=c.cursor.get(),i=c.editor.get(),l=i.substring(0,o),u=i.substring(o),f=l.charAt(l.length-1),d=u.charAt(0),g=c.levelsDeep(),p="",v="";if(g){for(;g--;)p+=n;for(t=(p=p).length+1,r=0;r<s.keyMap.length;r++)s.keyMap[r].open==f&&s.keyMap[r].close==d&&(v=a)}else t=1;var h=l+a+p+v+p.substring(0,p.length-n.length)+u;c.editor.set(h),c.cursor.set(o+t),c._callHook("enter:after")}},f=function(e){if(c.fenceRange()&&8==e.keyCode){c.preventDefaultEvent(e),c._callHook("delete:before");var t,r=c.cursor.get(),n=c.editor.get(),a=n.substring(0,r),o=n.substring(r),i=a.charAt(a.length-1),l=o.charAt(0);if(!1===c.cursor.selection()){for(t=0;t<s.keyMap.length;t++)if(s.keyMap[t].open==i&&s.keyMap[t].close==l){var u=n.substring(0,r-1)+n.substring(r+1);return c.editor.set(u),void c.cursor.set(r-1)}u=n.substring(0,r-1)+n.substring(r);c.editor.set(u),c.cursor.set(r-1)}else{var f=c.cursor.selection();u=n.substring(0,f.start)+n.substring(f.end);c.editor.set(u),c.cursor.set(r)}c._callHook("delete:after")}},d=function(e,t){c.preventDefaultEvent(t),c._callHook("openChar:before");var r=c.cursor.get(),n=c.editor.get(),a=n.substring(0,r),o=n.substring(r),s=a+e.open+e.close+o;i.textarea.value=s,c.cursor.set(r+1),c._callHook("openChar:after")},g=function(e,t){var r=c.cursor.get();return c.editor.get().substring(r,r+1)==e.close&&(c.preventDefaultEvent(t),c._callHook("closeChar:before"),c.cursor.set(c.cursor.get()+1),c._callHook("closeChar:after"),!0)},p={filter:function(e){if(c.fenceRange()){var t=e.which||e.keyCode;if(39!=t&&(40!=t||0!==e.which)){var r,n=String.fromCharCode(t);for(r=0;r<s.keyMap.length;r++){if(s.keyMap[r].close==n)!(i.overwrite&&g(s.keyMap[r],e))&&s.keyMap[r].open==n&&i.autoOpen&&d(s.keyMap[r],e);else s.keyMap[r].open==n&&i.autoOpen&&d(s.keyMap[r],e)}}}},listen:function(){i.replaceTab&&c.addEvent(i.textarea,"keydown",l),i.autoIndent&&c.addEvent(i.textarea,"keydown",u),i.autoStrip&&c.addEvent(i.textarea,"keydown",f),c.addEvent(i.textarea,"keypress",p.filter),c.addEvent(i.textarea,"keydown",(function(){c._callHook("keydown")})),c.addEvent(i.textarea,"keyup",(function(){c._callHook("keyup")}))}};this.destroy=function(){c.removeEvent(i.textarea,"keydown",l),c.removeEvent(i.textarea,"keydown",u),c.removeEvent(i.textarea,"keydown",f),c.removeEvent(i.textarea,"keypress",p.filter)},(o=t).textarea&&(c._callHook("init:before",!1),c.deepExtend(i,o),c.defineNewLine(),i.softTabs?n=" ".repeat(i.tabSize):(n="\t",c.defineTabSize(i.tabSize)),p.listen(),c._callHook("init:after",!1))};"undefined"!=typeof module&&module.exports&&(module.exports=n),"undefined"==typeof ender&&(this.Behave=n,this.BehaveHooks=r),"function"==typeof define&&define.amd&&define("behave",[],(function(){return n}))}).call(this),function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-code",(function(t){var r=e(this);new Behave({textarea:r.find(".siteorigin-widget-code-input").get(0)})}))}(jQuery);
1
+ (function(e){"use strict";var t,r=r||(t={},{add:function(e,r){var n;if("object"==typeof e)for(n=0;n<e.length;n++){var a=e[n];t[a]||(t[a]=[]),t[a].push(r)}else t[e]||(t[e]=[]),t[e].push(r)},get:function(e){if(t[e])return t[e]}}),n=n||function(t){"function"!=typeof String.prototype.repeat&&(String.prototype.repeat=function(e){if(e<1)return"";if(e%2)return this.repeat(e-1)+this;var t=this.repeat(e/2);return t+t}),"function"!=typeof Array.prototype.filter&&(Array.prototype.filter=function(e){if(null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=[],a=arguments[1],o=0;o<r;o++)if(o in t){var i=t[o];e.call(a,i,o,t)&&n.push(i)}return n});var n,a,o,i={textarea:null,replaceTab:!0,softTabs:!0,tabSize:4,autoOpen:!0,overwrite:!0,autoStrip:!0,autoIndent:!0,fence:!1},s={keyMap:[{open:'"',close:'"',canBreak:!1},{open:"'",close:"'",canBreak:!1},{open:"(",close:")",canBreak:!1},{open:"[",close:"]",canBreak:!0},{open:"{",close:"}",canBreak:!0}]},c={_callHook:function(t,n){var a=r.get(t);if(n="boolean"!=typeof n||!1!==n,a)if(n){var o,s=i.textarea,l=s.value,u=c.cursor.get();for(o=0;o<a.length;o++)a[o].call(e,{editor:{element:s,text:l,levelsDeep:c.levelsDeep()},caret:{pos:u},lines:{current:c.cursor.getLine(l,u),total:c.editor.getLines(l)}})}else for(o=0;o<a.length;o++)a[o].call(e)},defineNewLine:function(){var e=document.createElement("textarea");e.value="\n",a=2==e.value.length?"\r\n":"\n"},defineTabSize:function(e){void 0===i.textarea.style.OTabSize?void 0===i.textarea.style.MozTabSize?void 0===i.textarea.style.tabSize||(i.textarea.style.tabSize=e):i.textarea.style.MozTabSize=e:i.textarea.style.OTabSize=e},cursor:{getLine:function(e,t){return e.substring(0,t).split("\n").length},get:function(){if("number"==typeof document.createElement("textarea").selectionStart)return i.textarea.selectionStart;if(document.selection){var e=0,t=i.textarea.createTextRange(),r=document.selection.createRange().duplicate().getBookmark();for(t.moveToBookmark(r);0!==t.moveStart("character",-1);)e++;return e}},set:function(e,t){if(t||(t=e),i.textarea.setSelectionRange)i.textarea.trigger("focus"),i.textarea.setSelectionRange(e,t);else if(i.textarea.createTextRange){var r=i.textarea.createTextRange();r.collapse(!0),r.moveEnd("character",t),r.moveStart("character",e),r.trigger("select")}},selection:function(){var e,t,r,n,o,s=i.textarea,l=0,u=0;return"number"==typeof s.selectionStart&&"number"==typeof s.selectionEnd?(l=s.selectionStart,u=s.selectionEnd):(t=document.selection.createRange())&&t.parentElement()==s&&(n=(e=c.editor.get()).length,(r=s.createTextRange()).moveToBookmark(t.getBookmark()),(o=s.createTextRange()).collapse(!1),r.compareEndPoints("StartToEnd",o)>-1?l=u=n:(l=-r.moveStart("character",-n),l+=e.slice(0,l).split(a).length-1,r.compareEndPoints("EndToEnd",o)>-1?u=n:(u=-r.moveEnd("character",-n),u+=e.slice(0,u).split(a).length-1))),l!=u&&{start:l,end:u}}},editor:{getLines:function(e){return e.split("\n").length},get:function(){return i.textarea.value.replace(/\r/g,"")},set:function(e){i.textarea.value=e}},fenceRange:function(){if("string"==typeof i.fence){for(var e=c.editor.get(),t=c.cursor.get(),r=0,n=e.indexOf(i.fence),a=0;n>=0&&(a++,!(t<n+r));)r+=n+i.fence.length,n=(e=e.substring(n+i.fence.length)).indexOf(i.fence);return r<t&&n+r>t&&a%2==0}return!0},isEven:function(e,t){return t%2},levelsDeep:function(){var e,t,r=c.cursor.get(),n=c.editor.get().substring(0,r),a=0;for(e=0;e<n.length;e++)for(t=0;t<s.keyMap.length;t++)s.keyMap[t].canBreak&&(s.keyMap[t].open==n.charAt(e)&&a++,s.keyMap[t].close==n.charAt(e)&&a--);var o=0,i=["'",'"'];for(e=0;e<s.keyMap.length;e++)if(s.keyMap[e].canBreak)for(t in i)o+=n.split(i[t]).filter(c.isEven).join("").split(s.keyMap[e].open).length-1;var l=a-o;return l>=0?l:0},deepExtend:function(e,t){for(var r in t)t[r]&&t[r].constructor&&t[r].constructor===Object?(e[r]=e[r]||{},c.deepExtend(e[r],t[r])):e[r]=t[r];return e},addEvent:function(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent&&e.attachEvent("on"+t,r)},removeEvent:function(e,t,r){e.addEventListener?e.removeEventListener(t,r,!1):e.attachEvent&&e.detachEvent("on"+t,r)},preventDefaultEvent:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}},l=function(e){if(c.fenceRange()){if(9==e.keyCode){c.preventDefaultEvent(e);var t=!0;c._callHook("tab:before");var r=c.cursor.selection(),a=c.cursor.get(),o=c.editor.get();if(r){for(var i=r.start;i--;)if("\n"==o.charAt(i)){r.start=i+1;break}var s,l=o.substring(r.start,r.end),u=l.split("\n");if(e.shiftKey){for(s=0;s<u.length;s++)u[s].substring(0,n.length)==n&&(u[s]=u[s].substring(n.length));l=u.join("\n"),c.editor.set(o.substring(0,r.start)+l+o.substring(r.end)),c.cursor.set(r.start,r.start+l.length)}else{for(s in u)u[s]=n+u[s];l=u.join("\n"),c.editor.set(o.substring(0,r.start)+l+o.substring(r.end)),c.cursor.set(r.start,r.start+l.length)}}else{var f=o.substring(0,a),d=o.substring(a),g=f+n+d;e.shiftKey?o.substring(a-n.length,a)==n&&(g=o.substring(0,a-n.length)+d,c.editor.set(g),c.cursor.set(a-n.length)):(c.editor.set(g),c.cursor.set(a+n.length),t=!1)}c._callHook("tab:after")}return t}},u=function(e){if(c.fenceRange()&&13==e.keyCode){c.preventDefaultEvent(e),c._callHook("enter:before");var t,r,o=c.cursor.get(),i=c.editor.get(),l=i.substring(0,o),u=i.substring(o),f=l.charAt(l.length-1),d=u.charAt(0),g=c.levelsDeep(),p="",v="";if(g){for(;g--;)p+=n;for(t=(p=p).length+1,r=0;r<s.keyMap.length;r++)s.keyMap[r].open==f&&s.keyMap[r].close==d&&(v=a)}else t=1;var h=l+a+p+v+p.substring(0,p.length-n.length)+u;c.editor.set(h),c.cursor.set(o+t),c._callHook("enter:after")}},f=function(e){if(c.fenceRange()&&8==e.keyCode){c.preventDefaultEvent(e),c._callHook("delete:before");var t,r=c.cursor.get(),n=c.editor.get(),a=n.substring(0,r),o=n.substring(r),i=a.charAt(a.length-1),l=o.charAt(0);if(!1===c.cursor.selection()){for(t=0;t<s.keyMap.length;t++)if(s.keyMap[t].open==i&&s.keyMap[t].close==l){var u=n.substring(0,r-1)+n.substring(r+1);return c.editor.set(u),void c.cursor.set(r-1)}u=n.substring(0,r-1)+n.substring(r);c.editor.set(u),c.cursor.set(r-1)}else{var f=c.cursor.selection();u=n.substring(0,f.start)+n.substring(f.end);c.editor.set(u),c.cursor.set(r)}c._callHook("delete:after")}},d=function(e,t){c.preventDefaultEvent(t),c._callHook("openChar:before");var r=c.cursor.get(),n=c.editor.get(),a=n.substring(0,r),o=n.substring(r),s=a+e.open+e.close+o;i.textarea.value=s,c.cursor.set(r+1),c._callHook("openChar:after")},g=function(e,t){var r=c.cursor.get();return c.editor.get().substring(r,r+1)==e.close&&(c.preventDefaultEvent(t),c._callHook("closeChar:before"),c.cursor.set(c.cursor.get()+1),c._callHook("closeChar:after"),!0)},p={filter:function(e){if(c.fenceRange()){var t=e.which||e.keyCode;if(39!=t&&(40!=t||0!==e.which)){var r,n=String.fromCharCode(t);for(r=0;r<s.keyMap.length;r++){if(s.keyMap[r].close==n)!(i.overwrite&&g(s.keyMap[r],e))&&s.keyMap[r].open==n&&i.autoOpen&&d(s.keyMap[r],e);else s.keyMap[r].open==n&&i.autoOpen&&d(s.keyMap[r],e)}}}},listen:function(){i.replaceTab&&c.addEvent(i.textarea,"keydown",l),i.autoIndent&&c.addEvent(i.textarea,"keydown",u),i.autoStrip&&c.addEvent(i.textarea,"keydown",f),c.addEvent(i.textarea,"keypress",p.filter),c.addEvent(i.textarea,"keydown",(function(){c._callHook("keydown")})),c.addEvent(i.textarea,"keyup",(function(){c._callHook("keyup")}))}};this.destroy=function(){c.removeEvent(i.textarea,"keydown",l),c.removeEvent(i.textarea,"keydown",u),c.removeEvent(i.textarea,"keydown",f),c.removeEvent(i.textarea,"keypress",p.filter)},(o=t).textarea&&(c._callHook("init:before",!1),c.deepExtend(i,o),c.defineNewLine(),i.softTabs?n=" ".repeat(i.tabSize):(n="\t",c.defineTabSize(i.tabSize)),p.listen(),c._callHook("init:after",!1))};"undefined"!=typeof module&&module.exports&&(module.exports=n),"undefined"==typeof ender&&(this.Behave=n,this.BehaveHooks=r),"function"==typeof define&&define.amd&&define("behave",[],(function(){return n}))}).call(this),function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-code",(function(t){var r=e(this);new Behave({textarea:r.find(".siteorigin-widget-code-input").get(0)})}))}(jQuery);
base/inc/fields/js/date-range-field.js CHANGED
@@ -47,7 +47,7 @@
47
  onSelect: updateValField,
48
  } );
49
 
50
- $field.change( function ( event ) {
51
  var dateVal = parse( $field.val() );
52
  updateValField( dateVal );
53
 
@@ -66,7 +66,7 @@
66
  var afterPicker = createPikadayInput( 'after', initRange.after );
67
  var beforePicker = createPikadayInput( 'before', initRange.before );
68
 
69
- valField.change( function ( event, data ) {
70
  if ( ! ( data && data.silent ) ) {
71
  var newRange = valField.val() === '' ? { after: '', before: '' } : JSON.parse( valField.val() );
72
  afterPicker.setDate( newRange.after );
@@ -78,7 +78,7 @@
78
  $dateRangeField.find( '.sowb-relative-date' ).each( function () {
79
  var $name = $( this ).data( 'name' );
80
 
81
- $( this ).change( function () {
82
  var range = valField.val() === '' ? {} : JSON.parse( valField.val() );
83
 
84
  if ( ! range.hasOwnProperty( $name ) ) {
@@ -92,7 +92,7 @@
92
  valField.trigger( 'change', { silent: true } );
93
  }.bind( this ) );
94
 
95
- valField.change( function ( event, data ) {
96
  if ( ! ( data && data.silent ) ) {
97
  var range = valField.val() === '' ? { from: {}, to: {} } : JSON.parse( valField.val() );
98
 
47
  onSelect: updateValField,
48
  } );
49
 
50
+ $field.on( 'change', function( event ) {
51
  var dateVal = parse( $field.val() );
52
  updateValField( dateVal );
53
 
66
  var afterPicker = createPikadayInput( 'after', initRange.after );
67
  var beforePicker = createPikadayInput( 'before', initRange.before );
68
 
69
+ valField.on( 'change', function( event, data ) {
70
  if ( ! ( data && data.silent ) ) {
71
  var newRange = valField.val() === '' ? { after: '', before: '' } : JSON.parse( valField.val() );
72
  afterPicker.setDate( newRange.after );
78
  $dateRangeField.find( '.sowb-relative-date' ).each( function () {
79
  var $name = $( this ).data( 'name' );
80
 
81
+ $( this ).on( 'change', function() {
82
  var range = valField.val() === '' ? {} : JSON.parse( valField.val() );
83
 
84
  if ( ! range.hasOwnProperty( $name ) ) {
92
  valField.trigger( 'change', { silent: true } );
93
  }.bind( this ) );
94
 
95
+ valField.on( 'change', function( event, data ) {
96
  if ( ! ( data && data.silent ) ) {
97
  var range = valField.val() === '' ? { from: {}, to: {} } : JSON.parse( valField.val() );
98
 
base/inc/fields/js/date-range-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-date-range",(function(t){var i=e(this),a=i.find('input[type="hidden"][class="siteorigin-widget-input"]');if(!i.data("initialized")){if(i.find('[class*="sowb-specific-date"]').length>0){var n=function(e,t){var n=i.find("."+e+"-picker"),r=function(e,t){if(!isNaN(e.valueOf())){var i=e.getDate();i=i<10?"0"+i.toString():i.toString();var a=e.getMonth()+1;return a=a<10?"0"+a.toString():a.toString(),e.getFullYear()+"-"+a+"-"+i}return""},l=function(e,t){var i=e.split("-"),a=parseInt(i[2]),n=parseInt(i[1])-1,r=parseInt(i[0]);return new Date(r,n,a)},s=function(t){var i=""===a.val()?{}:JSON.parse(a.val());i[e]=r(t),n.val(i[e]),a.val(JSON.stringify(i)),a.trigger("change",{silent:!0})},f=new Pikaday({field:n[0],blurFieldOnSelect:!1,toString:r,parse:l,onSelect:s});return n.change((function(e){var t=l(n.val());return s(t),e.preventDefault(),!1})),t&&n.val(t),f}.bind(this),r=""===a.val()?{after:"",before:""}:JSON.parse(a.val()),l=n("after",r.after),s=n("before",r.before);a.change((function(e,t){if(!t||!t.silent){var i=""===a.val()?{after:"",before:""}:JSON.parse(a.val());l.setDate(i.after),s.setDate(i.before)}}))}else i.find(".sowb-relative-date").length>0&&i.find(".sowb-relative-date").each((function(){var t=e(this).data("name");e(this).change(function(){var i=""===a.val()?{}:JSON.parse(a.val());i.hasOwnProperty(t)||(i[t]={}),i[t].value=e(this).find("> input").val(),i[t].unit=e(this).find("> select").val(),a.val(JSON.stringify(i)),a.trigger("change",{silent:!0})}.bind(this)),a.change(function(i,n){if(!n||!n.silent){var r=""===a.val()?{from:{},to:{}}:JSON.parse(a.val());r.hasOwnProperty(t)&&(e(this).find("> input").val(r[t].value),e(this).find("> select").val(r[t].unit))}}.bind(this))}));i.data("initialized",!0)}}))}(jQuery);
1
+ !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-date-range",(function(t){var i=e(this),n=i.find('input[type="hidden"][class="siteorigin-widget-input"]');if(!i.data("initialized")){if(i.find('[class*="sowb-specific-date"]').length>0){var a=function(e,t){var a=i.find("."+e+"-picker"),r=function(e,t){if(!isNaN(e.valueOf())){var i=e.getDate();i=i<10?"0"+i.toString():i.toString();var n=e.getMonth()+1;return n=n<10?"0"+n.toString():n.toString(),e.getFullYear()+"-"+n+"-"+i}return""},l=function(e,t){var i=e.split("-"),n=parseInt(i[2]),a=parseInt(i[1])-1,r=parseInt(i[0]);return new Date(r,a,n)},s=function(t){var i=""===n.val()?{}:JSON.parse(n.val());i[e]=r(t),a.val(i[e]),n.val(JSON.stringify(i)),n.trigger("change",{silent:!0})},f=new Pikaday({field:a[0],blurFieldOnSelect:!1,toString:r,parse:l,onSelect:s});return a.on("change",(function(e){var t=l(a.val());return s(t),e.preventDefault(),!1})),t&&a.val(t),f}.bind(this),r=""===n.val()?{after:"",before:""}:JSON.parse(n.val()),l=a("after",r.after),s=a("before",r.before);n.on("change",(function(e,t){if(!t||!t.silent){var i=""===n.val()?{after:"",before:""}:JSON.parse(n.val());l.setDate(i.after),s.setDate(i.before)}}))}else i.find(".sowb-relative-date").length>0&&i.find(".sowb-relative-date").each((function(){var t=e(this).data("name");e(this).on("change",function(){var i=""===n.val()?{}:JSON.parse(n.val());i.hasOwnProperty(t)||(i[t]={}),i[t].value=e(this).find("> input").val(),i[t].unit=e(this).find("> select").val(),n.val(JSON.stringify(i)),n.trigger("change",{silent:!0})}.bind(this)),n.on("change",function(i,a){if(!a||!a.silent){var r=""===n.val()?{from:{},to:{}}:JSON.parse(n.val());r.hasOwnProperty(t)&&(e(this).find("> input").val(r[t].value),e(this).find("> select").val(r[t].unit))}}.bind(this))}));i.data("initialized",!0)}}))}(jQuery);
base/inc/fields/js/icon-field.js CHANGED
@@ -17,18 +17,18 @@
17
  }
18
 
19
  // Clicking on the button should display the icon selector
20
- $b.click( function(){
21
  $is.slideToggle();
22
  $search.val( '' );
23
  searchIcons();
24
  } );
25
 
26
  // Clicking on the remove button
27
- $remove.click( function( e ){
28
  e.preventDefault();
29
 
30
  // Trigger a click on the existing icon to remove it.
31
- $$.find('.siteorigin-widget-active').click();
32
  } );
33
 
34
  var searchIcons = function(){
@@ -52,7 +52,7 @@
52
  }
53
  };
54
 
55
- $search.keyup( searchIcons ).change( searchIcons );
56
 
57
  var renderStylesSelect = function ( init ) {
58
  var $familySelect = $is.find( 'select.siteorigin-widget-icon-family' );
@@ -116,11 +116,11 @@
116
  }
117
  var familyStyle = 'sow-icon-' + family + ( style ? ' ' + style : '' );
118
  var familyValue = family + ( style ? '-' + style : '' ) + '-' + i;
119
- var $icon = $('<div data-sow-icon="' + unicode + '"/>')
120
  .attr('data-value', familyValue )
121
  .addClass( familyStyle )
122
  .addClass( 'siteorigin-widget-icon-icons-icon' )
123
- .click(function(){
124
  var $$ = $(this);
125
 
126
  if( $$.hasClass('siteorigin-widget-active') ) {
@@ -212,12 +212,12 @@
212
  };
213
  changeIconFamily( true );
214
 
215
- $is.find('select.siteorigin-widget-icon-family').change(function(){
216
  $is.find('.siteorigin-widget-icon-icons').empty();
217
  changeIconFamily();
218
  });
219
 
220
- $v.change( function ( event, data ) {
221
  if ( ! ( data && data.isRendering ) ) {
222
  rerenderIcons();
223
  }
17
  }
18
 
19
  // Clicking on the button should display the icon selector
20
+ $b.on( 'click', function() {
21
  $is.slideToggle();
22
  $search.val( '' );
23
  searchIcons();
24
  } );
25
 
26
  // Clicking on the remove button
27
+ $remove.on( 'click', function( e ) {
28
  e.preventDefault();
29
 
30
  // Trigger a click on the existing icon to remove it.
31
+ $$.find('.siteorigin-widget-active').trigger( 'click' );
32
  } );
33
 
34
  var searchIcons = function(){
52
  }
53
  };
54
 
55
+ $search.keyup( searchIcons ).on( 'change', searchIcons );
56
 
57
  var renderStylesSelect = function ( init ) {
58
  var $familySelect = $is.find( 'select.siteorigin-widget-icon-family' );
116
  }
117
  var familyStyle = 'sow-icon-' + family + ( style ? ' ' + style : '' );
118
  var familyValue = family + ( style ? '-' + style : '' ) + '-' + i;
119
+ var $icon = $( '<div data-sow-icon="' + unicode + '"></div>' )
120
  .attr('data-value', familyValue )
121
  .addClass( familyStyle )
122
  .addClass( 'siteorigin-widget-icon-icons-icon' )
123
+ .on( 'click', function() {
124
  var $$ = $(this);
125
 
126
  if( $$.hasClass('siteorigin-widget-active') ) {
212
  };
213
  changeIconFamily( true );
214
 
215
+ $is.find( 'select.siteorigin-widget-icon-family' ).on( 'change', function() {
216
  $is.find('.siteorigin-widget-icon-icons').empty();
217
  changeIconFamily();
218
  });
219
 
220
+ $v.on( 'change', function ( event, data ) {
221
  if ( ! ( data && data.isRendering ) ) {
222
  rerenderIcons();
223
  }
base/inc/fields/js/icon-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(i){var e={};i(document).on("sowsetupformfield",".siteorigin-widget-field-type-icon",(function(t){var n=i(this),s=n.find(".siteorigin-widget-icon-selector"),o=s.find(".siteorigin-widget-icon-icon"),a=n.find(".siteorigin-widget-icon-selector-current"),d=n.find(".so-icon-remove"),c=n.find(".siteorigin-widget-icon-search");if(!n.data("initialized")){a.click((function(){s.slideToggle(),c.val(""),r()})),d.click((function(i){i.preventDefault(),n.find(".siteorigin-widget-active").click()}));var r=function(){var e=c.val().toLowerCase();""===e?s.find(".siteorigin-widget-icon-icons-icon").show():s.find(".siteorigin-widget-icon-icons-icon").each((function(){var t=i(this),n=t.attr("data-value");-1===(n=n.replace(/-/," ")).indexOf(e)?t.hide():t.show()}))};c.keyup(r).change(r);var l=function(){var t=s.find("select.siteorigin-widget-icon-family").val(),n=s.find(".siteorigin-widget-icon-icons");if(void 0!==e[t]){n.empty();var c,l=e[t],g=l.icons;for(var f in l.hasOwnProperty("styles")&&l.styles&&(c=s.find(".siteorigin-widget-icon-family-styles").val()),0===i("#siteorigin-widget-font-"+t).length&&i("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+t).attr("href",e[t].style_uri).appendTo("head"),g){var v=g[f],w=v.hasOwnProperty("unicode")?v.unicode:v;if(!v.hasOwnProperty("styles")||-1!==v.styles.indexOf(c)){var y="sow-icon-"+t+(c?" "+c:""),h=t+(c?"-"+c:"")+"-"+f,u=i('<div data-sow-icon="'+w+'"/>').attr("data-value",h).addClass(y).addClass("siteorigin-widget-icon-icons-icon").click((function(){var e=i(this);e.hasClass("siteorigin-widget-active")?(e.removeClass("siteorigin-widget-active"),o.val(""),a.find("span").hide(),d.hide()):(n.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),e.addClass("siteorigin-widget-active"),o.val(e.data("value")),a.find("span").show().attr("data-sow-icon",e.attr("data-sow-icon")).attr("class","").addClass(y),d.show()),o.trigger("change",{isRendering:!0}),s.slideUp()}));n.append(u),o.val()===h&&(a.find("span").show().attr("data-sow-icon",u.attr("data-sow-icon")).attr("class","").addClass(y),u.addClass("siteorigin-widget-active"))}}n.prepend(n.find(".siteorigin-widget-active")),r()}},g=function(t){var n=s.find("select.siteorigin-widget-icon-family").val(),o=s.find("select.siteorigin-widget-icon-family option:selected").data("icons");if(null!==o&&(e[n]=o),void 0!==n&&""!==n)if(void 0===e[n]){var a=s.find(".siteorigin-widget-icon-icons");a.addClass("loading"),i.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:s.find("select.siteorigin-widget-icon-family").val()},(function(o){e[n]=o,function(t){var n=s.find("select.siteorigin-widget-icon-family"),o=n.val();if(void 0!==e[o]){var a=s.find(".siteorigin-widget-icon-family-styles");if(!t){a.off("change",l),a.remove();var d=e[o];if(d.hasOwnProperty("styles")&&d.styles){var c="";for(var r in d.styles)c+='<option value="'+r+'">'+d.styles[r]+"</option>";c&&(a=i('<select class="siteorigin-widget-icon-family-styles"></select>').append(c),n.after(a))}}a.on("change",l)}}(t),a.removeClass("loading"),l()}))}else l()};g(!0),s.find("select.siteorigin-widget-icon-family").change((function(){s.find(".siteorigin-widget-icon-icons").empty(),g()})),o.change((function(i,e){e&&e.isRendering||l()})),n.data("initialized",!0)}}))}(jQuery);
1
+ !function(i){var e={};i(document).on("sowsetupformfield",".siteorigin-widget-field-type-icon",(function(n){var t=i(this),o=t.find(".siteorigin-widget-icon-selector"),s=o.find(".siteorigin-widget-icon-icon"),a=t.find(".siteorigin-widget-icon-selector-current"),d=t.find(".so-icon-remove"),c=t.find(".siteorigin-widget-icon-search");if(!t.data("initialized")){a.on("click",(function(){o.slideToggle(),c.val(""),r()})),d.on("click",(function(i){i.preventDefault(),t.find(".siteorigin-widget-active").trigger("click")}));var r=function(){var e=c.val().toLowerCase();""===e?o.find(".siteorigin-widget-icon-icons-icon").show():o.find(".siteorigin-widget-icon-icons-icon").each((function(){var n=i(this),t=n.attr("data-value");-1===(t=t.replace(/-/," ")).indexOf(e)?n.hide():n.show()}))};c.keyup(r).on("change",r);var l=function(){var n=o.find("select.siteorigin-widget-icon-family").val(),t=o.find(".siteorigin-widget-icon-icons");if(void 0!==e[n]){t.empty();var c,l=e[n],g=l.icons;for(var f in l.hasOwnProperty("styles")&&l.styles&&(c=o.find(".siteorigin-widget-icon-family-styles").val()),0===i("#siteorigin-widget-font-"+n).length&&i("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+n).attr("href",e[n].style_uri).appendTo("head"),g){var v=g[f],w=v.hasOwnProperty("unicode")?v.unicode:v;if(!v.hasOwnProperty("styles")||-1!==v.styles.indexOf(c)){var y="sow-icon-"+n+(c?" "+c:""),h=n+(c?"-"+c:"")+"-"+f,u=i('<div data-sow-icon="'+w+'"></div>').attr("data-value",h).addClass(y).addClass("siteorigin-widget-icon-icons-icon").on("click",(function(){var e=i(this);e.hasClass("siteorigin-widget-active")?(e.removeClass("siteorigin-widget-active"),s.val(""),a.find("span").hide(),d.hide()):(t.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),e.addClass("siteorigin-widget-active"),s.val(e.data("value")),a.find("span").show().attr("data-sow-icon",e.attr("data-sow-icon")).attr("class","").addClass(y),d.show()),s.trigger("change",{isRendering:!0}),o.slideUp()}));t.append(u),s.val()===h&&(a.find("span").show().attr("data-sow-icon",u.attr("data-sow-icon")).attr("class","").addClass(y),u.addClass("siteorigin-widget-active"))}}t.prepend(t.find(".siteorigin-widget-active")),r()}},g=function(n){var t=o.find("select.siteorigin-widget-icon-family").val(),s=o.find("select.siteorigin-widget-icon-family option:selected").data("icons");if(null!==s&&(e[t]=s),void 0!==t&&""!==t)if(void 0===e[t]){var a=o.find(".siteorigin-widget-icon-icons");a.addClass("loading"),i.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:o.find("select.siteorigin-widget-icon-family").val()},(function(s){e[t]=s,function(n){var t=o.find("select.siteorigin-widget-icon-family"),s=t.val();if(void 0!==e[s]){var a=o.find(".siteorigin-widget-icon-family-styles");if(!n){a.off("change",l),a.remove();var d=e[s];if(d.hasOwnProperty("styles")&&d.styles){var c="";for(var r in d.styles)c+='<option value="'+r+'">'+d.styles[r]+"</option>";c&&(a=i('<select class="siteorigin-widget-icon-family-styles"></select>').append(c),t.after(a))}}a.on("change",l)}}(n),a.removeClass("loading"),l()}))}else l()};g(!0),o.find("select.siteorigin-widget-icon-family").on("change",(function(){o.find(".siteorigin-widget-icon-icons").empty(),g()})),s.on("change",(function(i,e){e&&e.isRendering||l()})),t.data("initialized",!0)}}))}(jQuery);
base/inc/fields/js/media-field.js CHANGED
@@ -12,7 +12,7 @@
12
  }
13
 
14
  // Handle the media uploader
15
- $media.find( '.media-upload-button' ).click(function(e){
16
  e.preventDefault();
17
  if( typeof wp.media === 'undefined' ) {
18
  return;
@@ -65,6 +65,7 @@
65
  var attachment = frame.state().get('selection').first().attributes;
66
 
67
  $field.find('.current .thumbnail' ).attr( 'title', attachment.title );
 
68
  $inputField.val(attachment.id);
69
  $inputField.trigger( 'change', { silent: true } );
70
 
@@ -91,10 +92,11 @@
91
  frame.open();
92
  });
93
 
94
- $field.find('a.media-remove-button' )
95
- .click( function( e ){
96
  e.preventDefault();
97
  $inputField.val('');
 
98
  $inputField.trigger( 'change', { silent: true } );
99
  $field.find('.current .thumbnail' ).fadeOut('fast');
100
  $(this).addClass('remove-hide');
@@ -115,17 +117,17 @@
115
  resultWidth = spare / perRow + 260;
116
 
117
  results.find( '.so-widgets-result-image' ).css( {
118
- 'width' : resultWidth,
119
- 'height' : resultWidth / 1.4
120
  } );
121
  };
122
- $(window).resize( reflowDialog );
123
 
124
  var setupDialog = function(){
125
  if( ! dialog ) {
126
  // Create the dialog
127
  dialog = $( $('#so-widgets-bundle-tpl-image-search-dialog').html().trim() ).appendTo( 'body' );
128
- dialog.find( '.close' ).click( function(){
129
  dialog.hide();
130
  } );
131
 
@@ -206,7 +208,7 @@
206
  };
207
 
208
  // Setup the search
209
- dialog.find('#so-widgets-image-search-form').submit( function( e ){
210
  e.preventDefault();
211
 
212
  // Perform the search
@@ -220,15 +222,15 @@
220
  } );
221
 
222
  // Clicking on the related search buttons
223
- dialog.on( 'click', '.so-keywords-list a', function( e ){
224
  e.preventDefault();
225
- var $$ = $(this).blur();
226
  dialog.find('.so-widgets-search-input').val( $$.data( 'keyword' ) );
227
- dialog.find('#so-widgets-image-search-form').submit();
228
  } );
229
 
230
  // Clicking on the more button
231
- dialog.find('.so-widgets-results-more button').click( function(){
232
  var $$ = $(this);
233
  fetchImages( $$.data( 'query' ), $$.data( 'page' ) );
234
  } );
@@ -319,8 +321,8 @@
319
  .find('.so-widgets-preview-window-inside')
320
  .css( {
321
  'background-image' : 'url(' + $$.data('thumbnail') + ')',
322
- 'width' : preview[1] * scalePreview,
323
- 'height' : preview[2] * scalePreview
324
  } )
325
  .append( $( '<img />' ).attr( 'src', preview[0] ) );
326
 
@@ -355,8 +357,8 @@
355
 
356
  // Figure out where the preview needs to go
357
  previewWindow.css({
358
- 'top': top,
359
- 'left': left
360
  });
361
 
362
  }
@@ -364,16 +366,16 @@
364
  }
365
 
366
  dialog.show();
367
- dialog.find( '.so-widgets-search-input' ).focus();
368
  };
369
 
370
  // Handle displaying the image search dialog
371
- $media.find( '.find-image-button' ).click( function(e){
372
  e.preventDefault();
373
  setupDialog();
374
  } );
375
 
376
- $inputField.change( function ( event, data ) {
377
  if ( ! ( data && data.silent ) ) {
378
  var newVal = $inputField.val();
379
  if ( newVal) {
@@ -395,7 +397,7 @@
395
  $field.find('.media-remove-button').removeClass('remove-hide');
396
  } );
397
  } else {
398
- $field.find( 'a.media-remove-button' ).click();
399
  }
400
  }
401
  } );
12
  }
13
 
14
  // Handle the media uploader
15
+ $media.find( '.media-upload-button' ).on( 'click', function( e ) {
16
  e.preventDefault();
17
  if( typeof wp.media === 'undefined' ) {
18
  return;
65
  var attachment = frame.state().get('selection').first().attributes;
66
 
67
  $field.find('.current .thumbnail' ).attr( 'title', attachment.title );
68
+ $field.find('.current .title' ).html( attachment.title );
69
  $inputField.val(attachment.id);
70
  $inputField.trigger( 'change', { silent: true } );
71
 
92
  frame.open();
93
  });
94
 
95
+ $field.find( 'a.media-remove-button' )
96
+ .on( 'click', function( e ) {
97
  e.preventDefault();
98
  $inputField.val('');
99
+ $field.find('.current .title' ).empty();
100
  $inputField.trigger( 'change', { silent: true } );
101
  $field.find('.current .thumbnail' ).fadeOut('fast');
102
  $(this).addClass('remove-hide');
117
  resultWidth = spare / perRow + 260;
118
 
119
  results.find( '.so-widgets-result-image' ).css( {
120
+ 'width' : resultWidth + 'px',
121
+ 'height' : resultWidth / 1.4 + 'px',
122
  } );
123
  };
124
+ $( window ).on( 'resize', reflowDialog );
125
 
126
  var setupDialog = function(){
127
  if( ! dialog ) {
128
  // Create the dialog
129
  dialog = $( $('#so-widgets-bundle-tpl-image-search-dialog').html().trim() ).appendTo( 'body' );
130
+ dialog.find( '.close' ).on( 'click', function() {
131
  dialog.hide();
132
  } );
133
 
208
  };
209
 
210
  // Setup the search
211
+ dialog.find( '#so-widgets-image-search-form' ).on( 'submit', function( e ) {
212
  e.preventDefault();
213
 
214
  // Perform the search
222
  } );
223
 
224
  // Clicking on the related search buttons
225
+ dialog.on( 'click', '.so-keywords-list a', function( e ) {
226
  e.preventDefault();
227
+ var $$ = $( this ).trigger( 'blur' );
228
  dialog.find('.so-widgets-search-input').val( $$.data( 'keyword' ) );
229
+ dialog.find( '#so-widgets-image-search-form' ).trigger( 'submit' );
230
  } );
231
 
232
  // Clicking on the more button
233
+ dialog.find( '.so-widgets-results-more button' ).on( 'click', function() {
234
  var $$ = $(this);
235
  fetchImages( $$.data( 'query' ), $$.data( 'page' ) );
236
  } );
321
  .find('.so-widgets-preview-window-inside')
322
  .css( {
323
  'background-image' : 'url(' + $$.data('thumbnail') + ')',
324
+ 'width' : preview[1] * scalePreview + 'px',
325
+ 'height' : preview[2] * scalePreview + 'px',
326
  } )
327
  .append( $( '<img />' ).attr( 'src', preview[0] ) );
328
 
357
 
358
  // Figure out where the preview needs to go
359
  previewWindow.css({
360
+ 'top': top + 'px',
361
+ 'left': left + 'px',
362
  });
363
 
364
  }
366
  }
367
 
368
  dialog.show();
369
+ dialog.find( '.so-widgets-search-input' ).trigger( 'focus' );
370
  };
371
 
372
  // Handle displaying the image search dialog
373
+ $media.find( '.find-image-button' ).on( 'click', function( e ) {
374
  e.preventDefault();
375
  setupDialog();
376
  } );
377
 
378
+ $inputField.on( 'change', function( event, data ) {
379
  if ( ! ( data && data.silent ) ) {
380
  var newVal = $inputField.val();
381
  if ( newVal) {
397
  $field.find('.media-remove-button').removeClass('remove-hide');
398
  } );
399
  } else {
400
+ $field.find( 'a.media-remove-button' ).trigger( 'click' );
401
  }
402
  }
403
  } );
base/inc/fields/js/media-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-media",(function(i){var t=e(this),a=t.find("> .media-field-wrapper"),s=t.find(".siteorigin-widget-input").not(".media-fallback-external");if(!a.data("initialized")){var n;a.find(".media-upload-button").click((function(i){if(i.preventDefault(),void 0!==wp.media){var a=e(this),n=e(this).data("frame");if(n)return n.open(),!1;(n=wp.media({title:a.data("choose"),library:{type:a.data("library").split(",").map((function(e){return e.trim()}))},button:{text:a.data("update"),close:!1}})).on("open",(function(){var e=n.state().get("selection"),i=t.find('.siteorigin-widget-input[type="hidden"]').val();i&&e.add(wp.media.attachment(i))})),a.data("frame",n),n.on("select",(function(){var e=n.state().get("selection").first().attributes;t.find(".current .thumbnail").attr("title",e.title),s.val(e.id),s.trigger("change",{silent:!0});var i=t.find(".current .thumbnail");void 0!==e.sizes?void 0!==e.sizes.thumbnail?i.attr("src",e.sizes.thumbnail.url).fadeIn():i.attr("src",e.sizes.full.url).fadeIn():i.attr("src",e.icon).fadeIn(),t.find(".media-remove-button").removeClass("remove-hide"),n.close()})),n.open()}})),t.find("a.media-remove-button").click((function(i){i.preventDefault(),s.val(""),s.trigger("change",{silent:!0}),t.find(".current .thumbnail").fadeOut("fast"),e(this).addClass("remove-hide")}));var r=function(){if(n){var e=n.find(".so-widgets-image-results");if(0!==e.length){var i=e.width(),t=Math.floor(i/276),a=(i-276*t)/t+260;e.find(".so-widgets-result-image").css({width:a,height:a/1.4})}}};e(window).resize(r);a.find(".find-image-button").click((function(i){i.preventDefault(),function(){if(!n){(n=e(e("#so-widgets-bundle-tpl-image-search-dialog").html().trim()).appendTo("body")).find(".close").click((function(){n.hide()}));var i,a=n.find(".so-widgets-image-results"),o=function(i,t){n.find(".so-widgets-results-loading").fadeIn("fast"),n.find(".so-widgets-results-loading strong").html(n.find(".so-widgets-results-loading strong").data("loading")),n.find(".so-widgets-results-more").hide(),e.get(ajaxurl,{action:"so_widgets_image_search",q:i,page:t,_sononce:n.find('input[name="_sononce"]').val()},(function(s){s.error?alert(s.message):(a.removeClass("so-loading"),e.each(s.items,(function(i,t){var s=e(e("#so-widgets-bundle-tpl-image-search-result").html().trim()).appendTo(a).addClass("source-"+t.source).find(".so-widgets-result-image");s.css("background-image","url("+t.thumbnail+")"),s.data("thumbnail",t.thumbnail),s.data("preview",t.preview),t.url&&s.attr({href:t.url,target:"_blank"}),t.full_url&&(s.data({full_url:t.full_url,import_signature:t.import_signature}),s.attr("href",t.full_url)),"shutterstock"===t.source&&s.append(e("#so-widgets-bundle-tpl-image-search-result-sponsored").html())})),1===t&&(n.find("#so-widgets-image-search-suggestions ul").empty(),e.each(s.keywords,(function(i,t){n.find("#so-widgets-image-search-suggestions").show(),n.find("#so-widgets-image-search-suggestions ul").append(e("<li></li>").append(e('<a href="#"></a>').html(t).data("keyword",t)))}))),n.find(".so-widgets-results-loading").fadeOut("fast"),r(),n.find(".so-widgets-results-more").show().find("button").data({query:i,page:t+1}))}))};n.find("#so-widgets-image-search-form").submit((function(e){e.preventDefault();var i=n.find(".so-widgets-search-input").val();a.empty(),""!==i&&o(i,1)})),n.on("click",".so-keywords-list a",(function(i){i.preventDefault();var t=e(this).blur();n.find(".so-widgets-search-input").val(t.data("keyword")),n.find("#so-widgets-image-search-form").submit()})),n.find(".so-widgets-results-more button").click((function(){var i=e(this);o(i.data("query"),i.data("page"))})),n.on("click",".so-widgets-result-image",(function(i){var a=e(this);if(a.data("full_url")&&(i.preventDefault(),confirm(n.data("confirm-import")))){n.addClass("so-widgets-importing");var r=e("#post_ID").val();null===r&&(r=""),e.get(ajaxurl,{action:"so_widgets_image_import",full_url:a.data("full_url"),import_signature:a.data("import_signature"),post_id:r,_sononce:n.find('input[name="_sononce"]').val()},(function(e){n.find("#so-widgets-image-search-frame").removeClass("so-widgets-importing"),!1===e.error?(n.hide(),n.find(".so-widgets-results-loading").hide(),s.val(e.attachment_id).trigger("change",{silent:!0}),t.find(".current .thumbnail").attr("src",e.thumb).fadeIn(),t.find(".media-remove-button").removeClass("remove-hide")):(alert(e.message),n.find(".so-widgets-results-loading").hide())})),n.find(".so-widgets-results-loading").fadeIn("fast"),n.find(".so-widgets-results-loading strong").html(n.find(".so-widgets-results-loading strong").data("importing")),n.find(".so-widgets-results-more").hide(),n.find("#so-widgets-image-search-frame").addClass("so-widgets-importing")}}));var d,l,u=n.find(".so-widgets-preview-window");n.on("mouseenter",".so-widgets-result-image",(function(){var t=e(this),a=t.data("preview");clearTimeout(i),i=setTimeout((function(){var i=1,s=1;a[1]>.33*e(window).outerWidth()&&(i=.33*e(window).outerWidth()/a[1]),a[2]>.5*e(window).outerHeight()&&(s=.5*e(window).outerHeight()/a[2]);var r=Math.min(i,s);r>1&&(r=1),u.show().find(".so-widgets-preview-window-inside").css({"background-image":"url("+t.data("thumbnail")+")",width:a[1]*r,height:a[2]*r}).append(e("<img />").attr("src",a[0])),n.trigger("mousemove")}),1e3)})).on("mouseleave",".so-widgets-result-image",(function(){u.hide().find("img").remove(),clearTimeout(i)})),n.on("mousemove",(function(i){if(i.clientX&&(d=i.clientX),i.clientY&&(l=i.clientY),u.is(":visible")){var t=u.outerHeight(),a=u.outerWidth(),s=e(window).outerHeight(),n=e(window).outerWidth(),r=l-t/2;r=Math.max(r,10),r=Math.min(r,s-10-t);var o=d<n/2?d+15:d-15-a;u.css({top:r,left:o})}}))}n.show(),n.find(".so-widgets-search-input").focus()}()})),s.change((function(e,i){if(!i||!i.silent){var a=s.val();if(a){var n=t.find(".current .thumbnail"),r=wp.media.attachment(a);r.fetch().done((function(){if(r.has("sizes")){var e=r.get("sizes");void 0!==e.thumbnail?n.attr("src",e.thumbnail.url).fadeIn():n.attr("src",e.full.url).fadeIn()}else n.attr("src",r.get("icon")).fadeIn();t.find(".media-remove-button").removeClass("remove-hide")}))}else t.find("a.media-remove-button").click()}})),a.data("initialized",!0)}}))}(jQuery);
1
+ !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-media",(function(t){var i=e(this),a=i.find("> .media-field-wrapper"),n=i.find(".siteorigin-widget-input").not(".media-fallback-external");if(!a.data("initialized")){var s;a.find(".media-upload-button").on("click",(function(t){if(t.preventDefault(),void 0!==wp.media){var a=e(this),s=e(this).data("frame");if(s)return s.open(),!1;(s=wp.media({title:a.data("choose"),library:{type:a.data("library").split(",").map((function(e){return e.trim()}))},button:{text:a.data("update"),close:!1}})).on("open",(function(){var e=s.state().get("selection"),t=i.find('.siteorigin-widget-input[type="hidden"]').val();t&&e.add(wp.media.attachment(t))})),a.data("frame",s),s.on("select",(function(){var e=s.state().get("selection").first().attributes;i.find(".current .thumbnail").attr("title",e.title),i.find(".current .title").html(e.title),n.val(e.id),n.trigger("change",{silent:!0});var t=i.find(".current .thumbnail");void 0!==e.sizes?void 0!==e.sizes.thumbnail?t.attr("src",e.sizes.thumbnail.url).fadeIn():t.attr("src",e.sizes.full.url).fadeIn():t.attr("src",e.icon).fadeIn(),i.find(".media-remove-button").removeClass("remove-hide"),s.close()})),s.open()}})),i.find("a.media-remove-button").on("click",(function(t){t.preventDefault(),n.val(""),i.find(".current .title").empty(),n.trigger("change",{silent:!0}),i.find(".current .thumbnail").fadeOut("fast"),e(this).addClass("remove-hide")}));var r=function(){if(s){var e=s.find(".so-widgets-image-results");if(0!==e.length){var t=e.width(),i=Math.floor(t/276),a=(t-276*i)/i+260;e.find(".so-widgets-result-image").css({width:a+"px",height:a/1.4+"px"})}}};e(window).on("resize",r);a.find(".find-image-button").on("click",(function(t){t.preventDefault(),function(){if(!s){(s=e(e("#so-widgets-bundle-tpl-image-search-dialog").html().trim()).appendTo("body")).find(".close").on("click",(function(){s.hide()}));var t,a=s.find(".so-widgets-image-results"),o=function(t,i){s.find(".so-widgets-results-loading").fadeIn("fast"),s.find(".so-widgets-results-loading strong").html(s.find(".so-widgets-results-loading strong").data("loading")),s.find(".so-widgets-results-more").hide(),e.get(ajaxurl,{action:"so_widgets_image_search",q:t,page:i,_sononce:s.find('input[name="_sononce"]').val()},(function(n){n.error?alert(n.message):(a.removeClass("so-loading"),e.each(n.items,(function(t,i){var n=e(e("#so-widgets-bundle-tpl-image-search-result").html().trim()).appendTo(a).addClass("source-"+i.source).find(".so-widgets-result-image");n.css("background-image","url("+i.thumbnail+")"),n.data("thumbnail",i.thumbnail),n.data("preview",i.preview),i.url&&n.attr({href:i.url,target:"_blank"}),i.full_url&&(n.data({full_url:i.full_url,import_signature:i.import_signature}),n.attr("href",i.full_url)),"shutterstock"===i.source&&n.append(e("#so-widgets-bundle-tpl-image-search-result-sponsored").html())})),1===i&&(s.find("#so-widgets-image-search-suggestions ul").empty(),e.each(n.keywords,(function(t,i){s.find("#so-widgets-image-search-suggestions").show(),s.find("#so-widgets-image-search-suggestions ul").append(e("<li></li>").append(e('<a href="#"></a>').html(i).data("keyword",i)))}))),s.find(".so-widgets-results-loading").fadeOut("fast"),r(),s.find(".so-widgets-results-more").show().find("button").data({query:t,page:i+1}))}))};s.find("#so-widgets-image-search-form").on("submit",(function(e){e.preventDefault();var t=s.find(".so-widgets-search-input").val();a.empty(),""!==t&&o(t,1)})),s.on("click",".so-keywords-list a",(function(t){t.preventDefault();var i=e(this).trigger("blur");s.find(".so-widgets-search-input").val(i.data("keyword")),s.find("#so-widgets-image-search-form").trigger("submit")})),s.find(".so-widgets-results-more button").on("click",(function(){var t=e(this);o(t.data("query"),t.data("page"))})),s.on("click",".so-widgets-result-image",(function(t){var a=e(this);if(a.data("full_url")&&(t.preventDefault(),confirm(s.data("confirm-import")))){s.addClass("so-widgets-importing");var r=e("#post_ID").val();null===r&&(r=""),e.get(ajaxurl,{action:"so_widgets_image_import",full_url:a.data("full_url"),import_signature:a.data("import_signature"),post_id:r,_sononce:s.find('input[name="_sononce"]').val()},(function(e){s.find("#so-widgets-image-search-frame").removeClass("so-widgets-importing"),!1===e.error?(s.hide(),s.find(".so-widgets-results-loading").hide(),n.val(e.attachment_id).trigger("change",{silent:!0}),i.find(".current .thumbnail").attr("src",e.thumb).fadeIn(),i.find(".media-remove-button").removeClass("remove-hide")):(alert(e.message),s.find(".so-widgets-results-loading").hide())})),s.find(".so-widgets-results-loading").fadeIn("fast"),s.find(".so-widgets-results-loading strong").html(s.find(".so-widgets-results-loading strong").data("importing")),s.find(".so-widgets-results-more").hide(),s.find("#so-widgets-image-search-frame").addClass("so-widgets-importing")}}));var d,l,u=s.find(".so-widgets-preview-window");s.on("mouseenter",".so-widgets-result-image",(function(){var i=e(this),a=i.data("preview");clearTimeout(t),t=setTimeout((function(){var t=1,n=1;a[1]>.33*e(window).outerWidth()&&(t=.33*e(window).outerWidth()/a[1]),a[2]>.5*e(window).outerHeight()&&(n=.5*e(window).outerHeight()/a[2]);var r=Math.min(t,n);r>1&&(r=1),u.show().find(".so-widgets-preview-window-inside").css({"background-image":"url("+i.data("thumbnail")+")",width:a[1]*r+"px",height:a[2]*r+"px"}).append(e("<img />").attr("src",a[0])),s.trigger("mousemove")}),1e3)})).on("mouseleave",".so-widgets-result-image",(function(){u.hide().find("img").remove(),clearTimeout(t)})),s.on("mousemove",(function(t){if(t.clientX&&(d=t.clientX),t.clientY&&(l=t.clientY),u.is(":visible")){var i=u.outerHeight(),a=u.outerWidth(),n=e(window).outerHeight(),s=e(window).outerWidth(),r=l-i/2;r=Math.max(r,10),r=Math.min(r,n-10-i);var o=d<s/2?d+15:d-15-a;u.css({top:r+"px",left:o+"px"})}}))}s.show(),s.find(".so-widgets-search-input").trigger("focus")}()})),n.on("change",(function(e,t){if(!t||!t.silent){var a=n.val();if(a){var s=i.find(".current .thumbnail"),r=wp.media.attachment(a);r.fetch().done((function(){if(r.has("sizes")){var e=r.get("sizes");void 0!==e.thumbnail?s.attr("src",e.thumbnail.url).fadeIn():s.attr("src",e.full.url).fadeIn()}else s.attr("src",r.get("icon")).fadeIn();i.find(".media-remove-button").removeClass("remove-hide")}))}else i.find("a.media-remove-button").trigger("click")}})),a.data("initialized",!0)}}))}(jQuery);
base/inc/fields/js/multi-measurement-field.js CHANGED
@@ -32,7 +32,7 @@
32
  }
33
  } );
34
 
35
- $inputContainers.change( function ( event ) {
36
  var $valInput = $( event.currentTarget ).find( '> .sow-multi-measurement-input' );
37
  var doAutofill = autoFillEnabled;
38
  if ( autoFillEnabled ) {
32
  }
33
  } );
34
 
35
+ $inputContainers.on( 'change', function( event ) {
36
  var $valInput = $( event.currentTarget ).find( '> .sow-multi-measurement-input' );
37
  var doAutofill = autoFillEnabled;
38
  if ( autoFillEnabled ) {
base/inc/fields/js/multi-measurement-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){t(document).on("sowsetupformfield",".siteorigin-widget-field-type-multi-measurement",(function(i){var e=t(this).find('input[type="hidden"][class="siteorigin-widget-input"]'),n=e.data("separator"),a=e.data("autofill"),l=""===e.val()?[]:e.val().split(n),u=t(this).find(".sow-multi-measurement-input"),s=t(this).find(".sow-multi-measurement-input-container"),r=function(t){var i=""===e.val()?[]:e.val().split(n),a=t.find("+ .sow-multi-measurement-select-unit");i[u.index(t)]=t.val()+(""===t.val()?"":a.val()),e.val(i.join(n))};u.each((function(i,e){if(l.length>i){var n=l[i].match(/(\d+\.?\d*)([a-z%]+)*/);if(n&&n.length){var a=n[1],u=n[2];t(e).val(a),t(e).find("+ .sow-multi-measurement-select-unit").val(u)}}else r(t(e))})),s.change((function(i){var e=t(i.currentTarget).find("> .sow-multi-measurement-input"),n=a;a&&u.each((function(i,a){t(a).attr("id")!==e.eq(0).attr("id")&&(n=n&&!t(a).val())})),n?u.each((function(i,n){t(n).val(e.val()),r(t(n))})):r(e)}))}))}(jQuery);
1
+ !function(t){t(document).on("sowsetupformfield",".siteorigin-widget-field-type-multi-measurement",(function(i){var e=t(this).find('input[type="hidden"][class="siteorigin-widget-input"]'),n=e.data("separator"),a=e.data("autofill"),l=""===e.val()?[]:e.val().split(n),u=t(this).find(".sow-multi-measurement-input"),s=t(this).find(".sow-multi-measurement-input-container"),o=function(t){var i=""===e.val()?[]:e.val().split(n),a=t.find("+ .sow-multi-measurement-select-unit");i[u.index(t)]=t.val()+(""===t.val()?"":a.val()),e.val(i.join(n))};u.each((function(i,e){if(l.length>i){var n=l[i].match(/(\d+\.?\d*)([a-z%]+)*/);if(n&&n.length){var a=n[1],u=n[2];t(e).val(a),t(e).find("+ .sow-multi-measurement-select-unit").val(u)}}else o(t(e))})),s.on("change",(function(i){var e=t(i.currentTarget).find("> .sow-multi-measurement-input"),n=a;a&&u.each((function(i,a){t(a).attr("id")!==e.eq(0).attr("id")&&(n=n&&!t(a).val())})),n?u.each((function(i,n){t(n).val(e.val()),o(t(n))})):o(e)}))}))}(jQuery);
base/inc/fields/js/order-field.js CHANGED
@@ -17,7 +17,7 @@
17
  }
18
  } );
19
 
20
- $$.change( function ( event, params ) {
21
  if ( ! ( params && params.silent ) ) {
22
  var values = $valField.val() === '' ? [] : $valField.val().split(',');
23
  if ( values.length ) {
17
  }
18
  } );
19
 
20
+ $$.on( 'change', function ( event, params ) {
21
  if ( ! ( params && params.silent ) ) {
22
  var values = $valField.val() === '' ? [] : $valField.val().split(',');
23
  if ( values.length ) {
base/inc/fields/js/order-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(i){i(document).on("sowsetupform",(function(t){i(t.target).find(".siteorigin-widget-field-type-order").each((function(){var t=i(this),e=t.find(".siteorigin-widget-input"),n=t.find(".siteorigin-widget-order-items");n.sortable({stop:function(){var t=i(this).sortable("toArray",{attribute:"data-value"});e.val(t.join(",")),e.trigger("change",{silent:!0})}}),t.change((function(i,r){if(!r||!r.silent){var a=""===e.val()?[]:e.val().split(",");if(a.length)for(var o=0;o<a.length;o++){var d=a[o],g=t.find(".siteorigin-widget-order-item[data-value="+d+"]");n.append(g)}}}))}))}))}(jQuery);
1
+ !function(i){i(document).on("sowsetupform",(function(t){i(t.target).find(".siteorigin-widget-field-type-order").each((function(){var t=i(this),e=t.find(".siteorigin-widget-input"),n=t.find(".siteorigin-widget-order-items");n.sortable({stop:function(){var t=i(this).sortable("toArray",{attribute:"data-value"});e.val(t.join(",")),e.trigger("change",{silent:!0})}}),t.on("change",(function(i,r){if(!r||!r.silent){var a=""===e.val()?[]:e.val().split(",");if(a.length)for(var o=0;o<a.length;o++){var d=a[o],g=t.find(".siteorigin-widget-order-item[data-value="+d+"]");n.append(g)}}}))}))}))}(jQuery);
base/inc/fields/js/posts-field.js CHANGED
@@ -4,7 +4,7 @@
4
 
5
  $( document ).on( 'sowsetupform', '.siteorigin-widget-field-type-posts', function ( e ) {
6
  var $postsField = $( this );
7
- $postsField.change( function ( event ) {
8
  var postsValues = sowbForms.getWidgetFormValues( $postsField );
9
  var queryObj = postsValues.hasOwnProperty( 'posts' ) ? postsValues.posts : null;
10
 
4
 
5
  $( document ).on( 'sowsetupform', '.siteorigin-widget-field-type-posts', function ( e ) {
6
  var $postsField = $( this );
7
+ $postsField.on( 'change', function( event ) {
8
  var postsValues = sowbForms.getWidgetFormValues( $postsField );
9
  var queryObj = postsValues.hasOwnProperty( 'posts' ) ? postsValues.posts : null;
10
 
base/inc/fields/js/posts-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){t(document).on("sowsetupform",".siteorigin-widget-field-type-posts",(function(o){var s=t(this);s.change((function(o){var n=sowbForms.getWidgetFormValues(s),e=n.hasOwnProperty("posts")?n.posts:null,i="";for(var r in e)""!==i&&(i+="&"),i+=r+"="+e[r];t.post(soWidgets.ajaxurl,{action:"sow_get_posts_count",query:i},(function(t){s.find(".sow-current-count").text(t.posts_count)}))}))}))}(jQuery);
1
+ !function(o){o(document).on("sowsetupform",".siteorigin-widget-field-type-posts",(function(t){var s=o(this);s.on("change",(function(t){var n=sowbForms.getWidgetFormValues(s),e=n.hasOwnProperty("posts")?n.posts:null,i="";for(var r in e)""!==i&&(i+="&"),i+=r+"="+e[r];o.post(soWidgets.ajaxurl,{action:"sow_get_posts_count",query:i},(function(o){s.find(".sow-current-count").text(o.posts_count)}))}))}))}(jQuery);
base/inc/fields/js/presets-field.js CHANGED
@@ -12,7 +12,7 @@
12
  $undoLink.hide();
13
 
14
  var presets = $presetSelect.data( 'presets' );
15
- $presetSelect.change( function () {
16
 
17
  var selectedPreset = $presetSelect.val();
18
  if ( selectedPreset && presets.hasOwnProperty( selectedPreset ) ) {
@@ -48,7 +48,7 @@
48
  }
49
  if ( $undoLink.not( ':visible' ) ) {
50
  $undoLink.show();
51
- $undoLink.click( function ( event ) {
52
  event.preventDefault();
53
  $undoLink.hide();
54
  sowbForms.setWidgetFormValues( $formContainer, previousValues, true );
12
  $undoLink.hide();
13
 
14
  var presets = $presetSelect.data( 'presets' );
15
+ $presetSelect.on( 'change', function() {
16
 
17
  var selectedPreset = $presetSelect.val();
18
  if ( selectedPreset && presets.hasOwnProperty( selectedPreset ) ) {
48
  }
49
  if ( $undoLink.not( ':visible' ) ) {
50
  $undoLink.show();
51
+ $undoLink.on( 'click', function ( event ) {
52
  event.preventDefault();
53
  $undoLink.hide();
54
  sowbForms.setWidgetFormValues( $formContainer, previousValues, true );
base/inc/fields/js/presets-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-presets",(function(i){var t=e(this).find('select[class="siteorigin-widget-input"]');if(!t.data("initialized")){var s=t.find("+ .sowb-presets-field-undo");s.hide();var r=t.data("presets");t.change((function(){var e=t.val();if(e&&r.hasOwnProperty(e)){var i=r[e].values,a=t.closest(".siteorigin-widget-form-main"),o=t.data("previousValues");if(!o){var n=JSON.parse(JSON.stringify(i)),u=sowbForms.getWidgetFormValues(a),l=0,d=function(e,i){if(++l>10)return i;for(var t in i)if(e.hasOwnProperty(t)){var s=e[t],r=i[t];null!==s&&null!==r&&"object"==typeof s?d(s,r):i[t]=s}return i};o=d(u,n),t.data("previousValues",o)}s.not(":visible")&&(s.show(),s.click((function(e){e.preventDefault(),s.hide(),sowbForms.setWidgetFormValues(a,o,!0),t.removeData("previousValues"),t.val("")}))),sowbForms.setWidgetFormValues(a,i,!0)}})),t.data("initialized",!0)}}))}(jQuery);
1
+ !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-presets",(function(i){var t=e(this).find('select[class="siteorigin-widget-input"]');if(!t.data("initialized")){var s=t.find("+ .sowb-presets-field-undo");s.hide();var r=t.data("presets");t.on("change",(function(){var e=t.val();if(e&&r.hasOwnProperty(e)){var i=r[e].values,a=t.closest(".siteorigin-widget-form-main"),o=t.data("previousValues");if(!o){var n=JSON.parse(JSON.stringify(i)),u=sowbForms.getWidgetFormValues(a),l=0,d=function(e,i){if(++l>10)return i;for(var t in i)if(e.hasOwnProperty(t)){var s=e[t],r=i[t];null!==s&&null!==r&&"object"==typeof s?d(s,r):i[t]=s}return i};o=d(u,n),t.data("previousValues",o)}s.not(":visible")&&(s.show(),s.on("click",(function(e){e.preventDefault(),s.hide(),sowbForms.setWidgetFormValues(a,o,!0),t.removeData("previousValues"),t.val("")}))),sowbForms.setWidgetFormValues(a,i,!0)}})),t.data("initialized",!0)}}))}(jQuery);
base/inc/fields/media.class.php CHANGED
@@ -93,6 +93,7 @@ class SiteOrigin_Widget_Field_Media extends SiteOrigin_Widget_Field_Base {
93
  <div class="current">
94
  <div class="thumbnail-wrapper">
95
  <img src="<?php echo sow_esc_url( $src[0] ) ?>" class="thumbnail" <?php if( empty( $src[0] ) ) echo "style='display:none'" ?> <?php if( !empty( $post ) ) echo 'title="' . esc_attr( $post->post_title ) . '"' ?>/>
 
96
  </div>
97
  </div>
98
  <a href="#" class="media-upload-button" data-choose="<?php echo esc_attr( $this->choose ) ?>"
93
  <div class="current">
94
  <div class="thumbnail-wrapper">
95
  <img src="<?php echo sow_esc_url( $src[0] ) ?>" class="thumbnail" <?php if( empty( $src[0] ) ) echo "style='display:none'" ?> <?php if( !empty( $post ) ) echo 'title="' . esc_attr( $post->post_title ) . '"' ?>/>
96
+ <div class="title"><?php if( !empty( $post ) ) echo esc_attr( $post->post_title ); ?></div>
97
  </div>
98
  </div>
99
  <a href="#" class="media-upload-button" data-choose="<?php echo esc_attr( $this->choose ) ?>"
base/inc/string-utils.php CHANGED
@@ -10,6 +10,10 @@ function siteorigin_widgets_underscores_to_camel_case( $array ) {
10
  $transformed = array();
11
  if ( !empty( $array ) ) {
12
  foreach ( $array as $key => $val ) {
 
 
 
 
13
  $jsKey = preg_replace_callback( '/_(.?)/', 'siteorigin_widgets_match_to_upper', $key );
14
  $transformed[ $jsKey ] = $val;
15
  }
@@ -26,4 +30,4 @@ function siteorigin_widgets_underscores_to_camel_case( $array ) {
26
  */
27
  function siteorigin_widgets_match_to_upper( $matches ) {
28
  return strtoupper( $matches[1] );
29
- }
10
  $transformed = array();
11
  if ( !empty( $array ) ) {
12
  foreach ( $array as $key => $val ) {
13
+ if ( is_array( $val ) ) {
14
+ $val = siteorigin_widgets_underscores_to_camel_case( $val );
15
+ }
16
+
17
  $jsKey = preg_replace_callback( '/_(.?)/', 'siteorigin_widgets_match_to_upper', $key );
18
  $transformed[ $jsKey ] = $val;
19
  }
30
  */
31
  function siteorigin_widgets_match_to_upper( $matches ) {
32
  return strtoupper( $matches[1] );
33
+ }
base/js/admin.js CHANGED
@@ -181,7 +181,7 @@ var sowbForms = window.sowbForms || {};
181
  $mainForm = $el;
182
 
183
  var $teaser = $el.find('.siteorigin-widget-teaser');
184
- $teaser.find('.dashicons-dismiss').click(function () {
185
  var $$ = $(this);
186
  $.get($$.data('dismiss-url'));
187
 
@@ -227,7 +227,7 @@ var sowbForms = window.sowbForms || {};
227
  sessionStorage.removeItem( _sow_form_id );
228
  }
229
  }
230
- $el.change( function () {
231
  $timestampField.val( new Date().getTime() );
232
  var data = sowbForms.getWidgetFormValues( $el );
233
  sessionStorage.setItem( _sow_form_id, JSON.stringify( data ) );
@@ -286,7 +286,7 @@ var sowbForms = window.sowbForms || {};
286
  $(this).toggleClass('siteorigin-widget-section-visible');
287
  $(this).parent().find('> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section')
288
  .slideToggle('fast', function () {
289
- $(window).resize();
290
  $(this).find('> .siteorigin-widget-field-container-state').val($(this).is(':visible') ? 'open' : 'closed');
291
 
292
  if ( $( this ).is( ':visible' ) ) {
@@ -295,8 +295,8 @@ var sowbForms = window.sowbForms || {};
295
  }
296
  } );
297
  };
298
- $fields.filter('.siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section').find('> label').click(expandContainer);
299
- $fields.filter('.siteorigin-widget-field-type-posts').find('.posts-container-label-wrapper').click(expandContainer);
300
 
301
  ///////////////////////////////////////
302
  // Handle the slider fields
@@ -317,7 +317,7 @@ var sowbForms = window.sowbForms || {};
317
  $$.find('.siteorigin-widget-slider-value').html(ui.value);
318
  },
319
  });
320
- $input.change(function(event, data) {
321
  if ( ! ( data && data.silent ) ) {
322
  $c.slider( 'value', parseFloat( $input.val() ) );
323
  }
@@ -365,10 +365,10 @@ var sowbForms = window.sowbForms || {};
365
  };
366
 
367
  // Toggle display of the existing content
368
- $$.find('.select-content-button, .button-close').click(function (e) {
369
  e.preventDefault();
370
 
371
- $(this).blur();
372
  var $s = $$.find('.existing-content-selector');
373
  $s.toggle();
374
 
@@ -383,12 +383,12 @@ var sowbForms = window.sowbForms || {};
383
  e.preventDefault();
384
  var $li = $(this);
385
  $$.find('input.siteorigin-widget-input').val('post: ' + $li.data('value'));
386
- $$.change();
387
  $$.find('.existing-content-selector').toggle();
388
  });
389
 
390
  var interval = null;
391
- $$.find('.content-text-search').keyup(function () {
392
  if (interval !== null) {
393
  clearTimeout(interval);
394
  }
@@ -537,7 +537,7 @@ var sowbForms = window.sowbForms || {};
537
  var $el = $(this);
538
  var previewButton = $el.siblings('.siteorigin-widget-preview');
539
 
540
- previewButton.find('> a').click(function (e) {
541
  e.preventDefault();
542
 
543
  var data = sowbForms.getWidgetFormValues($el);
@@ -549,9 +549,9 @@ var sowbForms = window.sowbForms || {};
549
  modal.find('iframe').on('load', function () {
550
  $(this).css('visibility', 'visible');
551
  });
552
- modal.find('form').submit();
553
 
554
- modal.find('.close').click(function () {
555
  modal.remove();
556
  });
557
  });
@@ -620,7 +620,8 @@ var sowbForms = window.sowbForms || {};
620
  var scrollCount = $el.data('scroll-count') ? parseInt($el.data('scroll-count')) : 0;
621
  if (scrollCount > 0 && $rptrItems.length > scrollCount) {
622
  var itemHeight = $rptrItems.first().outerHeight();
623
- $$.css('max-height', itemHeight * scrollCount).css('overflow', 'auto');
 
624
  }
625
  else {
626
  //TODO: Check whether there was a value before overriding and set it back to that.
@@ -654,19 +655,19 @@ var sowbForms = window.sowbForms || {};
654
  });
655
  $items.trigger('updateFieldPositions');
656
 
657
- $el.find('> .siteorigin-widget-field-repeater-add').disableSelection().click(function (e) {
658
  e.preventDefault();
659
  $el.closest('.siteorigin-widget-field-repeater')
660
  .sowAddRepeaterItem()
661
  .find('> .siteorigin-widget-field-repeater-items').slideDown('fast', function () {
662
- $(window).resize();
663
  });
664
  });
665
 
666
- $el.find('> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand').click(function (e) {
667
  e.preventDefault();
668
  $el.closest('.siteorigin-widget-field-repeater').find('> .siteorigin-widget-field-repeateritems-').slideToggle('fast', function () {
669
- $(window).resize();
670
  });
671
  });
672
  });
@@ -701,22 +702,22 @@ var sowbForms = window.sowbForms || {};
701
  } );
702
 
703
  var readonly = typeof $el.attr('readonly') !== 'undefined';
704
- var item = $('<div class="siteorigin-widget-field-repeater-item ui-draggable" />')
705
  .append(
706
- $('<div class="siteorigin-widget-field-repeater-item-top" />')
707
  .append(
708
- $('<div class="siteorigin-widget-field-expand" />')
709
  )
710
  .append(
711
- readonly ? '' : $('<div class="siteorigin-widget-field-copy" />')
712
  )
713
  .append(
714
- readonly ? '' : $('<div class="siteorigin-widget-field-remove" />')
715
  )
716
- .append($('<h4 />').html($el.data('item-name')))
717
  )
718
  .append(
719
- $('<div class="siteorigin-widget-field-repeater-item-form" />')
720
  .html(repeaterHtml)
721
  );
722
 
@@ -724,7 +725,7 @@ var sowbForms = window.sowbForms || {};
724
  $el.find('> .siteorigin-widget-field-repeater-items').append(item).sortable("refresh").trigger('updateFieldPositions');
725
  item.sowSetupRepeaterItems();
726
  item.hide().slideDown('fast', function () {
727
- $(window).resize();
728
  });
729
  $el.trigger( 'change' );
730
  });
@@ -778,13 +779,13 @@ var sowbForms = window.sowbForms || {};
778
  $el.bind(eventName, updateLabel);
779
  }
780
 
781
- itemTop.click(function (e) {
782
  if (e.target.className === "siteorigin-widget-field-remove" || e.target.className === "siteorigin-widget-field-copy") {
783
  return;
784
  }
785
  e.preventDefault();
786
  $(this).closest('.siteorigin-widget-field-repeater-item').find('.siteorigin-widget-field-repeater-item-form').eq(0).slideToggle('fast', function () {
787
- $(window).resize();
788
  if ($(this).is(':visible')) {
789
  $(this).trigger('slideToggleOpenComplete');
790
 
@@ -803,14 +804,14 @@ var sowbForms = window.sowbForms || {};
803
  });
804
  });
805
 
806
- itemTop.find('.siteorigin-widget-field-remove').click(function (e, params) {
807
  e.preventDefault();
808
  var $s = $( this ).closest( '.siteorigin-widget-field-repeater-items' );
809
  var $item = $( this ).closest( '.siteorigin-widget-field-repeater-item' );
810
  var removeItem = function () {
811
  $item.remove();
812
  $s.sortable( "refresh" ).trigger( 'updateFieldPositions' );
813
- $( window ).resize();
814
  $parentRepeater.trigger( 'change' );
815
  };
816
  if ( params && params.silent ) {
@@ -819,7 +820,7 @@ var sowbForms = window.sowbForms || {};
819
  $item.slideUp('fast', removeItem );
820
  }
821
  });
822
- itemTop.find('.siteorigin-widget-field-copy').click(function (e) {
823
  e.preventDefault();
824
  var $form = $(this).closest('.siteorigin-widget-form-main');
825
  var $item = $(this).closest('.siteorigin-widget-field-repeater-item');
@@ -938,7 +939,7 @@ var sowbForms = window.sowbForms || {};
938
  $items.append($copyItem).sortable("refresh").trigger('updateFieldPositions');
939
  $copyItem.sowSetupRepeaterItems();
940
  $copyItem.hide().slideDown('fast', function () {
941
- $(window).resize();
942
  });
943
  $el.trigger( 'change' );
944
  });
@@ -1181,7 +1182,7 @@ var sowbForms = window.sowbForms || {};
1181
  if ( numItems > numChildren ) {
1182
  // If data items > child items, create extra child items.
1183
  for ( var i = 0; i < numItems - numChildren; i++) {
1184
- $repeater.find( '> .siteorigin-widget-field-repeater-add' ).click();
1185
  }
1186
 
1187
  } else if ( ! skipMissingValues && numItems < numChildren ) {
181
  $mainForm = $el;
182
 
183
  var $teaser = $el.find('.siteorigin-widget-teaser');
184
+ $teaser.find( '.dashicons-dismiss' ).on( 'click', function() {
185
  var $$ = $(this);
186
  $.get($$.data('dismiss-url'));
187
 
227
  sessionStorage.removeItem( _sow_form_id );
228
  }
229
  }
230
+ $el.on( 'change', function() {
231
  $timestampField.val( new Date().getTime() );
232
  var data = sowbForms.getWidgetFormValues( $el );
233
  sessionStorage.setItem( _sow_form_id, JSON.stringify( data ) );
286
  $(this).toggleClass('siteorigin-widget-section-visible');
287
  $(this).parent().find('> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section')
288
  .slideToggle('fast', function () {
289
+ $( window ).trigger( 'resize' );
290
  $(this).find('> .siteorigin-widget-field-container-state').val($(this).is(':visible') ? 'open' : 'closed');
291
 
292
  if ( $( this ).is( ':visible' ) ) {
295
  }
296
  } );
297
  };
298
+ $fields.filter( '.siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section' ).find( '> label' ).on( 'click', expandContainer );
299
+ $fields.filter( '.siteorigin-widget-field-type-posts' ).find( '.posts-container-label-wrapper' ).on( 'click', expandContainer );
300
 
301
  ///////////////////////////////////////
302
  // Handle the slider fields
317
  $$.find('.siteorigin-widget-slider-value').html(ui.value);
318
  },
319
  });
320
+ $input.on( 'change', function( event, data ) {
321
  if ( ! ( data && data.silent ) ) {
322
  $c.slider( 'value', parseFloat( $input.val() ) );
323
  }
365
  };
366
 
367
  // Toggle display of the existing content
368
+ $$.find( '.select-content-button, .button-close' ).on( 'click', function( e ) {
369
  e.preventDefault();
370
 
371
+ $(this).trigger( 'blur' );
372
  var $s = $$.find('.existing-content-selector');
373
  $s.toggle();
374
 
383
  e.preventDefault();
384
  var $li = $(this);
385
  $$.find('input.siteorigin-widget-input').val('post: ' + $li.data('value'));
386
+ $$.trigger( 'change' );
387
  $$.find('.existing-content-selector').toggle();
388
  });
389
 
390
  var interval = null;
391
+ $$.find( '.content-text-search' ).on( 'keyup', function() {
392
  if (interval !== null) {
393
  clearTimeout(interval);
394
  }
537
  var $el = $(this);
538
  var previewButton = $el.siblings('.siteorigin-widget-preview');
539
 
540
+ previewButton.find( '> a' ).on( 'click', function( e ) {
541
  e.preventDefault();
542
 
543
  var data = sowbForms.getWidgetFormValues($el);
549
  modal.find('iframe').on('load', function () {
550
  $(this).css('visibility', 'visible');
551
  });
552
+ modal.find( 'form' ).trigger( 'submit' );
553
 
554
+ modal.find( '.close' ).on( 'click', function() {
555
  modal.remove();
556
  });
557
  });
620
  var scrollCount = $el.data('scroll-count') ? parseInt($el.data('scroll-count')) : 0;
621
  if (scrollCount > 0 && $rptrItems.length > scrollCount) {
622
  var itemHeight = $rptrItems.first().outerHeight();
623
+ $$.css( 'max-height', itemHeight * scrollCount + 'px' );
624
+ $$.css( 'overflow', 'auto' );
625
  }
626
  else {
627
  //TODO: Check whether there was a value before overriding and set it back to that.
655
  });
656
  $items.trigger('updateFieldPositions');
657
 
658
+ $el.find( '> .siteorigin-widget-field-repeater-add' ).disableSelection().on( 'click', function( e ) {
659
  e.preventDefault();
660
  $el.closest('.siteorigin-widget-field-repeater')
661
  .sowAddRepeaterItem()
662
  .find('> .siteorigin-widget-field-repeater-items').slideDown('fast', function () {
663
+ $( window ).trigger( 'resize' );
664
  });
665
  });
666
 
667
+ $el.find( '> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand' ).on( 'click', function( e ) {
668
  e.preventDefault();
669
  $el.closest('.siteorigin-widget-field-repeater').find('> .siteorigin-widget-field-repeateritems-').slideToggle('fast', function () {
670
+ $( window ).trigger( 'resize' );
671
  });
672
  });
673
  });
702
  } );
703
 
704
  var readonly = typeof $el.attr('readonly') !== 'undefined';
705
+ var item = $( '<div class="siteorigin-widget-field-repeater-item ui-draggable"></div>' )
706
  .append(
707
+ $( '<div class="siteorigin-widget-field-repeater-item-top"></div>' )
708
  .append(
709
+ $( '<div class="siteorigin-widget-field-expand"></div>' )
710
  )
711
  .append(
712
+ readonly ? '' : $( '<div class="siteorigin-widget-field-copy"></div>')
713
  )
714
  .append(
715
+ readonly ? '' : $( '<div class="siteorigin-widget-field-remove"></div>' )
716
  )
717
+ .append( $( '<h4></h4>' ).html( $el.data( 'item-name' ) ) )
718
  )
719
  .append(
720
+ $( '<div class="siteorigin-widget-field-repeater-item-form"></div>' )
721
  .html(repeaterHtml)
722
  );
723
 
725
  $el.find('> .siteorigin-widget-field-repeater-items').append(item).sortable("refresh").trigger('updateFieldPositions');
726
  item.sowSetupRepeaterItems();
727
  item.hide().slideDown('fast', function () {
728
+ $( window ).trigger( 'resize' );
729
  });
730
  $el.trigger( 'change' );
731
  });
779
  $el.bind(eventName, updateLabel);
780
  }
781
 
782
+ itemTop.on( 'click', function( e ) {
783
  if (e.target.className === "siteorigin-widget-field-remove" || e.target.className === "siteorigin-widget-field-copy") {
784
  return;
785
  }
786
  e.preventDefault();
787
  $(this).closest('.siteorigin-widget-field-repeater-item').find('.siteorigin-widget-field-repeater-item-form').eq(0).slideToggle('fast', function () {
788
+ $( window ).trigger( 'resize' );
789
  if ($(this).is(':visible')) {
790
  $(this).trigger('slideToggleOpenComplete');
791
 
804
  });
805
  });
806
 
807
+ itemTop.find( '.siteorigin-widget-field-remove' ).on( 'click', function( e, params ) {
808
  e.preventDefault();
809
  var $s = $( this ).closest( '.siteorigin-widget-field-repeater-items' );
810
  var $item = $( this ).closest( '.siteorigin-widget-field-repeater-item' );
811
  var removeItem = function () {
812
  $item.remove();
813
  $s.sortable( "refresh" ).trigger( 'updateFieldPositions' );
814
+ $( window ).trigger( 'resize' );
815
  $parentRepeater.trigger( 'change' );
816
  };
817
  if ( params && params.silent ) {
820
  $item.slideUp('fast', removeItem );
821
  }
822
  });
823
+ itemTop.find( '.siteorigin-widget-field-copy' ).on( 'click', function( e ) {
824
  e.preventDefault();
825
  var $form = $(this).closest('.siteorigin-widget-form-main');
826
  var $item = $(this).closest('.siteorigin-widget-field-repeater-item');
939
  $items.append($copyItem).sortable("refresh").trigger('updateFieldPositions');
940
  $copyItem.sowSetupRepeaterItems();
941
  $copyItem.hide().slideDown('fast', function () {
942
+ $( window ).trigger( 'resize' );
943
  });
944
  $el.trigger( 'change' );
945
  });
1182
  if ( numItems > numChildren ) {
1183
  // If data items > child items, create extra child items.
1184
  for ( var i = 0; i < numItems - numChildren; i++) {
1185
+ $repeater.find( '> .siteorigin-widget-field-repeater-add' ).trigger( 'click' );
1186
  }
1187
 
1188
  } else if ( ! skipMissingValues && numItems < numChildren ) {
base/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- var sowbForms=window.sowbForms||{};!function(e){e.fn.sowSetupForm=function(){return e(this).each((function(i,t){var r,n=e(t),a=!0,s=e("body"),o=n.find("input[name]");if(o.length&&-1!==o.attr("name").indexOf("__i__"))return this;if(n.is(".siteorigin-widget-form-main")){if(!0===n.data("sow-form-setup"))return!0;if(s.hasClass("widgets-php")&&!n.is(":visible")&&0===n.closest(".panel-dialog").length)return!0;n.on("sowstatechange",(function(i,t,r){n.find("[data-state-handler]").each((function(){var i,n,s,o,d,l,g=e(this),f=e.extend({},g.data("state-handler"),a?g.data("state-handler-initial"):{});if(0===Object.keys(f).length)return!0;var c={},p=sowbForms.getContainerFieldId(g,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==p){var u={};for(var w in f)u[w.replace("{$repeater}",p)]=f[w];f=u}var m=sowbForms.getContainerFieldId(g,"widget",".siteorigin-widget-widget");if(!1!==m){var v={};for(var h in f){var b=h.match(/_else\[(.*)\]|(.*)\[(.*)\]/);v[b&&b.length&&void 0===b[1]?b[2]+"_"+m+"["+b[3]+"]":"_else["+b[1]+"_"+m+"]"]=f[h]}f=v}for(var y in f)if(d=!1,null!==(i=y.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/))){if(n={group:"default",name:"",multi:!1},void 0!==i[2]?(n.group=i[1],n.name=i[3]):n.name=i[0],n.multi=void 0!==i[4],"_else"===n.group)n.group=n.name,n.name="",d=n.group===t&&void 0===c[n.group];else{l=n.name.split(",").map((function(e){return e.trim()}));for(var F=0;F<l.length&&!(d=n.group===t&&l[F]===r);F++);}if(d){s=f[y],n.multi||(s=[s]);for(F=0;F<s.length;F++){var k=!1;if((o=void 0!==s[F][1]&&Boolean(s[F][1])?g.find(s[F][1]):g).prop("style").length&&("show"==s[F][0]?(o.fadeIn("fast"),k=!0):"hide"==s[F][0]&&(o.fadeOut("fast"),k=!0)),k||o[s[F][0]].apply(o,void 0!==s[F][2]?s[F][2]:[]),o.is(".siteorigin-widget-field:visible"))if(o.is(".siteorigin-widget-field-type-section"))o.find("> .siteorigin-widget-section > .siteorigin-widget-field").trigger("sowsetupformfield");else o.trigger("sowsetupformfield")}c[n.group]=!0}}}))})),n.sowSetupPreview(),r=n;var d=n.find(".siteorigin-widget-teaser");if(d.find(".dashicons-dismiss").click((function(){var i=e(this);e.get(i.data("dismiss-url")),d.slideUp("normal",(function(){d.remove()}))})),!n.data("backupDisabled")){var l=n.find("> .siteorigin-widgets-form-id").val(),g=n.find("> .siteorigin-widgets-form-timestamp"),f=parseInt(g.val()||0),c=JSON.parse(sessionStorage.getItem(l));c&&(c._sow_form_timestamp>f?sowbForms.displayNotice(n,soWidgets.backup.newerVersion,soWidgets.backup.replaceWarning,[{label:soWidgets.backup.restore,callback:function(e){sowbForms.setWidgetFormValues(r,c),e.slideUp("fast",(function(){e.remove()}))}},{label:soWidgets.backup.dismiss,callback:function(e){e.slideUp("fast",(function(){sessionStorage.removeItem(l),e.remove()}))}}]):sessionStorage.removeItem(l)),n.change((function(){g.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(n);sessionStorage.setItem(l,JSON.stringify(e))}))}}else r=n.closest(".siteorigin-widget-form-main");r.find("> .siteorigin-widgets-form-id").val();var p=n.find("> .siteorigin-widget-field");p.find("> .siteorigin-widget-section").sowSetupForm();var u=p.find("> .siteorigin-widget-widget");u.find("> .siteorigin-widget-section").sowSetupForm(),u.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),p.find(".siteorigin-widget-input").each((function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))})),p.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),n.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),p.find("> .siteorigin-widget-input-color").each((function(){var i=e(this),t={change:function(i,t){setTimeout((function(){e(i.target).trigger("change")}),100)}};i.data("defaultColor")&&(t.defaultColor=i.data("defaultColor")),i.wpColorPicker(t)}));var w=function(){e(this).toggleClass("siteorigin-widget-section-visible"),e(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",(function(){(e(window).resize(),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed"),e(this).is(":visible"))&&e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")}))};p.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(w),p.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").click(w),p.filter(".siteorigin-widget-field-type-slider").each((function(){var i=e(this),t=i.find('input[type="number"]'),r=i.find(".siteorigin-widget-value-slider");r.slider({max:parseFloat(t.attr("max")),min:parseFloat(t.attr("min")),step:parseFloat(t.attr("step")),value:parseFloat(t.val()),slide:function(e,r){t.val(parseFloat(r.value)),t.trigger("change"),i.find(".siteorigin-widget-slider-value").html(r.value)}}),t.change((function(e,i){i&&i.silent||r.slider("value",parseFloat(t.val()))}))})),p.filter(".siteorigin-widget-field-type-link").each((function(){var i=e(this),t=function(){var t=i.find(".content-text-search"),r=t.val(),n=t.data("postTypes"),a=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:r,postTypes:n},(function(i){for(var t=0;t<i.length;t++)""===i[t].label&&(i[t].label="&nbsp;"),a.append(e("<li>").addClass("post").html(i[t].label+"<span>("+i[t].type+")</span>").data(i[t]));a.removeClass("loading")}))};i.find(".select-content-button, .button-close").click((function(r){r.preventDefault(),e(this).blur();var n=i.find(".existing-content-selector");n.toggle(),n.is(":visible")&&0===n.find("ul.posts li").length&&t()})),i.on("click",".posts li",(function(t){t.preventDefault();var r=e(this);i.find("input.siteorigin-widget-input").val("post: "+r.data("value")),i.change(),i.find(".existing-content-selector").toggle()}));var r=null;i.find(".content-text-search").keyup((function(){null!==r&&clearTimeout(r),r=setTimeout((function(){t()}),500)}))})),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&p.filter(".siteorigin-widget-field-type-builder").each((function(){e(this).find("> .siteorigin-page-builder-field").each((function(){var i=e(this);i.soPanelsSetupBuilderWidget({builderType:i.data("type")})}))}));var m=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if(void 0!==t){var n=function(t,r){if(void 0===sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return r;if(i.is('[type="radio"]')&&!i.is(":checked"))return r;var n=sowbForms.getContainerFieldId(i,"repeater",".siteorigin-widget-field-repeater-item");!1!==n&&(t.args=t.args.map((function(e){return e.replace("{$repeater}",n)})));var a=sowbForms.getContainerFieldId(i,"widget",".siteorigin-widget-widget");!1===a||t.hasOwnProperty("widgetFieldId")||(t.widgetFieldId=a,t.args=t.args.map((function(e){return e="conditional"===t.callback?e.replace(/(.*)(\[.*)/,"$1_"+a+"$2"):e+"_"+a})));var s=i.is('[type="checkbox"]')?i.is(":checked"):i.val();return e.extend(r,sowEmitters[t.callback](s,t.args))},a={default:""};void 0===t.length&&(t=[t]);for(var s=0;s<t.length;s++)a=n(t[s],a);var o=r.data("states");for(var d in void 0===o&&(o={default:""}),a)void 0!==o[d]&&a[d]===o[d]||(o[d]=a[d],r.trigger("sowstatechange",[d,a[d]]));r.data("states",o)}};p.filter("[data-state-emitter]").each((function(){var i=e(this).find(".siteorigin-widget-input");i.on("keyup change",m),i.each((function(){var i=e(this);i.is(":radio")?i.is(":checked")&&m.call(i[0]):m.call(i[0])}))})),n.trigger("sowsetupform",p).data("sow-form-setup",!0),p.trigger("sowsetupformfield"),n.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(s.hasClass("wp-customizer")||s.hasClass("widgets-php"))&&n.closest(".ui-sortable").on("sortstop",(function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")})),a=!1}))},e.fn.sowSetupPreview=function(){var i=e(this);i.siblings(".siteorigin-widget-preview").find("> a").click((function(t){t.preventDefault();var r=sowbForms.getWidgetFormValues(i),n=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");n.find('input[name="data"]').val(JSON.stringify(r)),n.find('input[name="class"]').val(i.data("class")),n.find("iframe").on("load",(function(){e(this).css("visibility","visible")})),n.find("form").submit(),n.find(".close").click((function(){n.remove()}))}))},e.fn.sowSetupRepeater=function(){return e(this).each((function(i,t){var r=e(t),n=r.find(".siteorigin-widget-field-repeater-items"),a=r.data("repeater-name");n.bind("updateFieldPositions",(function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each((function(i,t){e(t).find(".siteorigin-widget-input").each((function(t,r){var n=e(r).data("repeater-positions");void 0===n&&(n={}),n[a]=i,e(r).data("repeater-positions",n)}))})),i.find(".siteorigin-widget-input").each((function(i,t){var r=e(t),n=r.data("repeater-positions");if(void 0!==n){var a=r.attr("data-original-name");if(a||(r.attr("data-original-name",r.attr("name")),a=r.attr("name")),!a)return;if(n)for(var s in n)a=a.replace("#"+s+"#",n[s]);r.attr("name",a)}})),i.data("initialSetup")||(i.find(".siteorigin-widget-input").each((function(i,t){var r=e(t);r.prop("checked",r.prop("defaultChecked"))})),i.data("initialSetup",!0));var n=r.data("scroll-count")?parseInt(r.data("scroll-count")):0;if(n>0&&t.length>n){var s=t.first().outerHeight();i.css("max-height",s*n).css("overflow","auto")}else i.css("max-height","").css("overflow","")})),n.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){n.find('input[type="radio"].siteorigin-widget-input').attr("name",""),n.trigger("updateFieldPositions"),r.trigger("change")},sortstop:function(i,t){t.item.is(".siteorigin-widget-field-repeater-item")?t.item.find("> .siteorigin-widget-field-repeater-item-form").each((function(){e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})):t.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield");r.trigger("change")}}),n.trigger("updateFieldPositions"),r.find("> .siteorigin-widget-field-repeater-add").disableSelection().click((function(i){i.preventDefault(),r.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",(function(){e(window).resize()}))})),r.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click((function(i){i.preventDefault(),r.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",(function(){e(window).resize()}))}))}))},e.fn.sowAddRepeaterItem=function(){return e(this).each((function(i,t){var r=e(t),n=r.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+r.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find(".siteorigin-widget-input[data-name]").each((function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))}));var s="";a.find("> .siteorigin-widget-field").each((function(i,t){var r=t.outerHTML;e(t).is(".siteorigin-widget-field-type-repeater")||(r=r.replace(/_id_/g,n)),s+=r}));var o=void 0!==r.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(e('<div class="siteorigin-widget-field-repeater-item-top" />').append(e('<div class="siteorigin-widget-field-expand" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" />')).append(e("<h4 />").html(r.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form" />').html(s));r.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",(function(){e(window).resize()})),r.trigger("change")}))},e.fn.sowRemoveRepeaterItem=function(){return e(this).each((function(i,t){var r=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),r.sortable("refresh").trigger("updateFieldPositions"),e(t).trigger("change")}))},e.fn.sowSetupRepeaterItems=function(){return e(this).each((function(i,t){var r=e(t);if(void 0===r.data("sowrepeater-actions-setup")){var n=r.closest(".siteorigin-widget-field-repeater"),a=r.find("> .siteorigin-widget-field-repeater-item-top"),s=n.data("item-label"),o=r.parents(".siteorigin-widget-field-repeater").data("item-name");if(s&&(s.hasOwnProperty("selector")||s.hasOwnProperty("selectorArray"))){var d=function(){var e,i,t;if(s.hasOwnProperty("selectorArray"))for(var n=0;n<s.selectorArray.length&&(e=(t=s.selectorArray[n]).hasOwnProperty("valueMethod")&&t.valueMethod?t.valueMethod:"val",!(i=r.find(t.selector)[e]()));n++);else e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=r.find(s.selector)[e]();i?(i.length>80&&(i=i.substr(0,79)+"..."),a.find("h4").text(i)):a.find("h4").text(o)};d();var l=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";r.bind(l,d)}a.click((function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",(function(){e(window).resize(),e(this).is(":visible")?(e(this).trigger("slideToggleOpenComplete"),e(this).find(".siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field,> .siteorigin-widget-field").each((function(i,t){var r=e(t);r.is(":visible")&&r.trigger("sowsetupformfield")}))):e(this).trigger("slideToggleCloseComplete")})))})),a.find(".siteorigin-widget-field-remove").click((function(i,t){i.preventDefault();var r=e(this).closest(".siteorigin-widget-field-repeater-items"),a=e(this).closest(".siteorigin-widget-field-repeater-item"),s=function(){a.remove(),r.sortable("refresh").trigger("updateFieldPositions"),e(window).resize(),n.trigger("change")};t&&t.silent?s():confirm(soWidgets.sure)&&a.slideUp("fast",s)})),a.find(".siteorigin-widget-field-copy").click((function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),n=e(this).closest(".siteorigin-widget-field-repeater-item"),a=n.clone(),s=n.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};a.find("*[name]").each((function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var g=tinymce.get(s);g&&i.val(g.getContent())}else if(i.is(".wp-color-picker")){var f=i.closest(".wp-picker-container"),c=i.closest(".siteorigin-widget-field");f.remove(),c.append(i.remove())}else{var p=s?n.find("#"+s):n.find('[name="'+l+'"]');p.length&&null!=p.val()&&i.val(p.val())}if(s){var u,w;if(i.is('[type="radio"]')){u=s.replace(/-\d+-\d+$/,"");var m=s.replace(/-\d+$/,"");if(!d[u]){var v={};d[u]=t.find(".siteorigin-widget-input[id^="+u+"]").not("[id*=_id_]").filter((function(i,t){var r=e(t).attr("name");return!v[r]&&(v[r]=!0,!0)})).length+1}var h=u+"-"+d[u];w=h+s.match(/-\d+$/)[0],a.find("label[for="+m+"]").attr("for",h)}else F=new RegExp("-\\d+$"),u=s.replace(F,""),d[u]||(d[u]=t.find(".siteorigin-widget-input[id^="+u+"]").not("[id*=_id_]").length+1),w=u+"-"+d[u]++;if(i.is(".wp-editor-area")&&(w+=Math.floor(1e3*Math.random()),i.data("tinymce-id",w)),i.attr("id",w),i.is(".wp-editor-area")){var b=i.closest(".siteorigin-widget-tinymce-container"),y=b.data("media-buttons");if(y&&y.html){var F=new RegExp(s,"g");y.html=y.html.replace(F,w),b.data("media-buttons",y)}}a.find("label[for="+s+"]").attr("for",w),a.find("[id*="+s+"]").each((function(){var i=e(this).attr("id").replace(s,w);e(this).attr("id",i)})),"undefined"!=typeof tinymce&&tinymce.get(w)&&tinymce.get(w).remove()}var k=n.parents(".siteorigin-widget-field-repeater").length,_=e("body");(_.hasClass("wp-customizer")||_.hasClass("widgets-php"))&&0===r.closest(".panel-dialog").length&&(k+=1);var C=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(k-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",C),i.data("original-name",C)})),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",(function(){e(window).resize()})),r.trigger("change")})),r.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),r.data("sowrepeater-actions-setup",!0)}}))},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1].split("]["),a=n.length?r:null;n.length;)a=a[n.shift()];return a[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},(function(e){window.sowVars[t]=e,r(window.sowVars[t][i])})):r(window.sowVars[t][i])},sowbForms.getWidgetIdBase=function(e){return e.data("id-base")},sowbForms.getWidgetFormValues=function(i){if(_.isUndefined(i))return null;var t={};return i.find("*[name]").each((function(){var i=e(this);try{var r=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(r))return!0;var n=(r=r[1]).split("][");n=n.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));var a=t,s=null,o=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===o)s=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===o){if(!i.is(":checked"))return;s=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),s=null===d||"function"!=typeof d.getContent||d.isHidden()?i.val():d.getContent()}else if("SELECT"===i.prop("tagName")){var l=i.find("option:selected");1===l.length?s=i.find("option:selected").val():l.length>1&&(s=_.map(i.find("option:selected"),(function(i,t){return e(i).val()})))}else s=i.val();for(var g=0;g<n.length;g++)g===n.length-1?""===n[g]?a.push(s):a[n[g]]=s:(_.isUndefined(a[n[g]])&&(_.isNumber(n[g+1])||""===n[g+1]?a[n[g]]=[]:a[n[g]]={}),a=a[n[g]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}})),t},sowbForms.setWidgetFormValues=function(i,t,r,n){r=r||!1,n=void 0!==n&&n||void 0===n;var a=0,s=function(i,t){10!=++a?(i.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each((function(i,n){var a=e(this),o=a.find("> .siteorigin-widget-field-repeater"),d=o.data("repeaterName"),l=t.hasOwnProperty(d)?t[d]:null;if(a.parent().is(".siteorigin-widget-section")){var g=o.data("element-name");g=g.replace(/\[#.*?#\]/g,"");for(var f=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(g)[1].split("]["),c=f.length?t:null;f.length;){var p=f.shift();c=c.hasOwnProperty(p)?c[p]:c}l=c}if(l&&Array.isArray(l)){var u=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),w=l.length,m=u.length;if(w>m)for(var v=0;v<w-m;v++)o.find("> .siteorigin-widget-field-repeater-add").click();else if(!r&&w<m)for(var h=w;h<m;h++){e(u.eq(h)).find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}u=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var b=0;b<u.length;b++)u.eq(b).find("> .siteorigin-widget-field-repeater-item-form"),s(u.eq(b).find("> .siteorigin-widget-field-repeater-item-form"),l[b])}})),--a):--a};s(i,t),i.find("*[name]").each((function(){var i=e(this),a=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(null==a)return!0;var s=(a=a[1]).split("][");s=s.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));for(var o,d=t,l=0;l<s.length;l++){if(!d.hasOwnProperty(s[l])){if(r)return!0;break}l===s.length-1?o=d[s[l]]:d=d[s[l]]}if("checkbox"===i.attr("type"))i.prop("checked",o);else if("radio"===i.attr("type"))i.prop("checked",o===i.val());else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var g=null;"undefined"!=typeof tinyMCE&&(g=tinyMCE.get(i.attr("id"))),null!==g&&"function"==typeof g.setContent&&!g.isHidden()&&i.parent().is(":visible")?g.initialized?g.setContent(o):g.on("init",(function(){g.setContent(o)})):i.val(o)}else if(i.is(".panels-data")){i.val(o);var f=i.data("builder");f&&f.setDataField(i)}else i.val(o);n&&(i.trigger("change"),this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})))}))},sowbForms.displayNotice=function(i,t,r,n,a){var s=e('<div class="siteorigin-widget-form-notification"></div>');t&&s.append("<span>"+t+"</span>"),n&&n.length&&n.forEach((function(i){var t="";i.classes&&i.classes.length&&(t=" "+i.classes.join(" "));var r=e('<a class="button button-small'+t+'">'+i.label+"</a>");i.url&&r.attr("href",i.url),i.callback&&r.on("click",(function(){i.callback(s)})),s.append(r)})),r&&s.append("<div><small>"+r+"</small></div>"),a?a.before(s):i.prepend(s)},e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",(function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout((function(){i.sowSetupForm()}),200)}));var i=e("body");i.hasClass("wp-customizer")&&e(document).on("widget-added",(function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()})),i.hasClass("block-editor-page")&&e(document).on("panels_setup_preview",(function(){window.hasOwnProperty("sowb")&&e(sowb).trigger("setup_widgets",{preview:!0})})),e(document).on("open_dialog",(function(e,i){i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")&&i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")})),e((function(){e(document).trigger("sowadminloaded")}))}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$").exec(e);if(null===t)return!1;var r="",n="default";return void 0!==t[3]?(n=t[1],r=t[3]):r=t[1],{match:t[4].trim(),group:n,state:r}},_checker:function(e,i,t,r){var n,a={};void 0===i.length&&(i=[i]);for(var s=0;s<i.length;s++)!1!==(n=sowEmitters._match(i[s],t))&&("_true"===n.match||r(e,i,n.match))&&(a[n.group]=n.state);return a},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",(function(val,args,match){return eval(match)}))},in:function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",(function(e,i,t){return-1!==t.split(",").map((function(e){return e.trim()})).indexOf(e)}))}};window.sowbForms=sowbForms;
1
+ var sowbForms=window.sowbForms||{};!function(e){e.fn.sowSetupForm=function(){return e(this).each((function(i,t){var r,n=e(t),a=!0,s=e("body"),o=n.find("input[name]");if(o.length&&-1!==o.attr("name").indexOf("__i__"))return this;if(n.is(".siteorigin-widget-form-main")){if(!0===n.data("sow-form-setup"))return!0;if(s.hasClass("widgets-php")&&!n.is(":visible")&&0===n.closest(".panel-dialog").length)return!0;n.on("sowstatechange",(function(i,t,r){n.find("[data-state-handler]").each((function(){var i,n,s,o,d,l,g=e(this),f=e.extend({},g.data("state-handler"),a?g.data("state-handler-initial"):{});if(0===Object.keys(f).length)return!0;var c={},p=sowbForms.getContainerFieldId(g,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==p){var u={};for(var w in f)u[w.replace("{$repeater}",p)]=f[w];f=u}var m=sowbForms.getContainerFieldId(g,"widget",".siteorigin-widget-widget");if(!1!==m){var v={};for(var h in f){var b=h.match(/_else\[(.*)\]|(.*)\[(.*)\]/);v[b&&b.length&&void 0===b[1]?b[2]+"_"+m+"["+b[3]+"]":"_else["+b[1]+"_"+m+"]"]=f[h]}f=v}for(var y in f)if(d=!1,null!==(i=y.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/))){if(n={group:"default",name:"",multi:!1},void 0!==i[2]?(n.group=i[1],n.name=i[3]):n.name=i[0],n.multi=void 0!==i[4],"_else"===n.group)n.group=n.name,n.name="",d=n.group===t&&void 0===c[n.group];else{l=n.name.split(",").map((function(e){return e.trim()}));for(var F=0;F<l.length&&!(d=n.group===t&&l[F]===r);F++);}if(d){s=f[y],n.multi||(s=[s]);for(F=0;F<s.length;F++){var k=!1;if((o=void 0!==s[F][1]&&Boolean(s[F][1])?g.find(s[F][1]):g).prop("style").length&&("show"==s[F][0]?(o.fadeIn("fast"),k=!0):"hide"==s[F][0]&&(o.fadeOut("fast"),k=!0)),k||o[s[F][0]].apply(o,void 0!==s[F][2]?s[F][2]:[]),o.is(".siteorigin-widget-field:visible"))if(o.is(".siteorigin-widget-field-type-section"))o.find("> .siteorigin-widget-section > .siteorigin-widget-field").trigger("sowsetupformfield");else o.trigger("sowsetupformfield")}c[n.group]=!0}}}))})),n.sowSetupPreview(),r=n;var d=n.find(".siteorigin-widget-teaser");if(d.find(".dashicons-dismiss").on("click",(function(){var i=e(this);e.get(i.data("dismiss-url")),d.slideUp("normal",(function(){d.remove()}))})),!n.data("backupDisabled")){var l=n.find("> .siteorigin-widgets-form-id").val(),g=n.find("> .siteorigin-widgets-form-timestamp"),f=parseInt(g.val()||0),c=JSON.parse(sessionStorage.getItem(l));c&&(c._sow_form_timestamp>f?sowbForms.displayNotice(n,soWidgets.backup.newerVersion,soWidgets.backup.replaceWarning,[{label:soWidgets.backup.restore,callback:function(e){sowbForms.setWidgetFormValues(r,c),e.slideUp("fast",(function(){e.remove()}))}},{label:soWidgets.backup.dismiss,callback:function(e){e.slideUp("fast",(function(){sessionStorage.removeItem(l),e.remove()}))}}]):sessionStorage.removeItem(l)),n.on("change",(function(){g.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(n);sessionStorage.setItem(l,JSON.stringify(e))}))}}else r=n.closest(".siteorigin-widget-form-main");r.find("> .siteorigin-widgets-form-id").val();var p=n.find("> .siteorigin-widget-field");p.find("> .siteorigin-widget-section").sowSetupForm();var u=p.find("> .siteorigin-widget-widget");u.find("> .siteorigin-widget-section").sowSetupForm(),u.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),p.find(".siteorigin-widget-input").each((function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))})),p.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),n.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),p.find("> .siteorigin-widget-input-color").each((function(){var i=e(this),t={change:function(i,t){setTimeout((function(){e(i.target).trigger("change")}),100)}};i.data("defaultColor")&&(t.defaultColor=i.data("defaultColor")),i.wpColorPicker(t)}));var w=function(){e(this).toggleClass("siteorigin-widget-section-visible"),e(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",(function(){(e(window).trigger("resize"),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed"),e(this).is(":visible"))&&e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")}))};p.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").on("click",w),p.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").on("click",w),p.filter(".siteorigin-widget-field-type-slider").each((function(){var i=e(this),t=i.find('input[type="number"]'),r=i.find(".siteorigin-widget-value-slider");r.slider({max:parseFloat(t.attr("max")),min:parseFloat(t.attr("min")),step:parseFloat(t.attr("step")),value:parseFloat(t.val()),slide:function(e,r){t.val(parseFloat(r.value)),t.trigger("change"),i.find(".siteorigin-widget-slider-value").html(r.value)}}),t.on("change",(function(e,i){i&&i.silent||r.slider("value",parseFloat(t.val()))}))})),p.filter(".siteorigin-widget-field-type-link").each((function(){var i=e(this),t=function(){var t=i.find(".content-text-search"),r=t.val(),n=t.data("postTypes"),a=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:r,postTypes:n},(function(i){for(var t=0;t<i.length;t++)""===i[t].label&&(i[t].label="&nbsp;"),a.append(e("<li>").addClass("post").html(i[t].label+"<span>("+i[t].type+")</span>").data(i[t]));a.removeClass("loading")}))};i.find(".select-content-button, .button-close").on("click",(function(r){r.preventDefault(),e(this).trigger("blur");var n=i.find(".existing-content-selector");n.toggle(),n.is(":visible")&&0===n.find("ul.posts li").length&&t()})),i.on("click",".posts li",(function(t){t.preventDefault();var r=e(this);i.find("input.siteorigin-widget-input").val("post: "+r.data("value")),i.trigger("change"),i.find(".existing-content-selector").toggle()}));var r=null;i.find(".content-text-search").on("keyup",(function(){null!==r&&clearTimeout(r),r=setTimeout((function(){t()}),500)}))})),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&p.filter(".siteorigin-widget-field-type-builder").each((function(){e(this).find("> .siteorigin-page-builder-field").each((function(){var i=e(this);i.soPanelsSetupBuilderWidget({builderType:i.data("type")})}))}));var m=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if(void 0!==t){var n=function(t,r){if(void 0===sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return r;if(i.is('[type="radio"]')&&!i.is(":checked"))return r;var n=sowbForms.getContainerFieldId(i,"repeater",".siteorigin-widget-field-repeater-item");!1!==n&&(t.args=t.args.map((function(e){return e.replace("{$repeater}",n)})));var a=sowbForms.getContainerFieldId(i,"widget",".siteorigin-widget-widget");!1===a||t.hasOwnProperty("widgetFieldId")||(t.widgetFieldId=a,t.args=t.args.map((function(e){return e="conditional"===t.callback?e.replace(/(.*)(\[.*)/,"$1_"+a+"$2"):e+"_"+a})));var s=i.is('[type="checkbox"]')?i.is(":checked"):i.val();return e.extend(r,sowEmitters[t.callback](s,t.args))},a={default:""};void 0===t.length&&(t=[t]);for(var s=0;s<t.length;s++)a=n(t[s],a);var o=r.data("states");for(var d in void 0===o&&(o={default:""}),a)void 0!==o[d]&&a[d]===o[d]||(o[d]=a[d],r.trigger("sowstatechange",[d,a[d]]));r.data("states",o)}};p.filter("[data-state-emitter]").each((function(){var i=e(this).find(".siteorigin-widget-input");i.on("keyup change",m),i.each((function(){var i=e(this);i.is(":radio")?i.is(":checked")&&m.call(i[0]):m.call(i[0])}))})),n.trigger("sowsetupform",p).data("sow-form-setup",!0),p.trigger("sowsetupformfield"),n.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(s.hasClass("wp-customizer")||s.hasClass("widgets-php"))&&n.closest(".ui-sortable").on("sortstop",(function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")})),a=!1}))},e.fn.sowSetupPreview=function(){var i=e(this);i.siblings(".siteorigin-widget-preview").find("> a").on("click",(function(t){t.preventDefault();var r=sowbForms.getWidgetFormValues(i),n=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");n.find('input[name="data"]').val(JSON.stringify(r)),n.find('input[name="class"]').val(i.data("class")),n.find("iframe").on("load",(function(){e(this).css("visibility","visible")})),n.find("form").trigger("submit"),n.find(".close").on("click",(function(){n.remove()}))}))},e.fn.sowSetupRepeater=function(){return e(this).each((function(i,t){var r=e(t),n=r.find(".siteorigin-widget-field-repeater-items"),a=r.data("repeater-name");n.bind("updateFieldPositions",(function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each((function(i,t){e(t).find(".siteorigin-widget-input").each((function(t,r){var n=e(r).data("repeater-positions");void 0===n&&(n={}),n[a]=i,e(r).data("repeater-positions",n)}))})),i.find(".siteorigin-widget-input").each((function(i,t){var r=e(t),n=r.data("repeater-positions");if(void 0!==n){var a=r.attr("data-original-name");if(a||(r.attr("data-original-name",r.attr("name")),a=r.attr("name")),!a)return;if(n)for(var s in n)a=a.replace("#"+s+"#",n[s]);r.attr("name",a)}})),i.data("initialSetup")||(i.find(".siteorigin-widget-input").each((function(i,t){var r=e(t);r.prop("checked",r.prop("defaultChecked"))})),i.data("initialSetup",!0));var n=r.data("scroll-count")?parseInt(r.data("scroll-count")):0;if(n>0&&t.length>n){var s=t.first().outerHeight();i.css("max-height",s*n+"px"),i.css("overflow","auto")}else i.css("max-height","").css("overflow","")})),n.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){n.find('input[type="radio"].siteorigin-widget-input').attr("name",""),n.trigger("updateFieldPositions"),r.trigger("change")},sortstop:function(i,t){t.item.is(".siteorigin-widget-field-repeater-item")?t.item.find("> .siteorigin-widget-field-repeater-item-form").each((function(){e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})):t.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield");r.trigger("change")}}),n.trigger("updateFieldPositions"),r.find("> .siteorigin-widget-field-repeater-add").disableSelection().on("click",(function(i){i.preventDefault(),r.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",(function(){e(window).trigger("resize")}))})),r.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").on("click",(function(i){i.preventDefault(),r.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",(function(){e(window).trigger("resize")}))}))}))},e.fn.sowAddRepeaterItem=function(){return e(this).each((function(i,t){var r=e(t),n=r.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+r.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find(".siteorigin-widget-input[data-name]").each((function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))}));var s="";a.find("> .siteorigin-widget-field").each((function(i,t){var r=t.outerHTML;e(t).is(".siteorigin-widget-field-type-repeater")||(r=r.replace(/_id_/g,n)),s+=r}));var o=void 0!==r.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable"></div>').append(e('<div class="siteorigin-widget-field-repeater-item-top"></div>').append(e('<div class="siteorigin-widget-field-expand"></div>')).append(o?"":e('<div class="siteorigin-widget-field-copy"></div>')).append(o?"":e('<div class="siteorigin-widget-field-remove"></div>')).append(e("<h4></h4>").html(r.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form"></div>').html(s));r.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",(function(){e(window).trigger("resize")})),r.trigger("change")}))},e.fn.sowRemoveRepeaterItem=function(){return e(this).each((function(i,t){var r=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),r.sortable("refresh").trigger("updateFieldPositions"),e(t).trigger("change")}))},e.fn.sowSetupRepeaterItems=function(){return e(this).each((function(i,t){var r=e(t);if(void 0===r.data("sowrepeater-actions-setup")){var n=r.closest(".siteorigin-widget-field-repeater"),a=r.find("> .siteorigin-widget-field-repeater-item-top"),s=n.data("item-label"),o=r.parents(".siteorigin-widget-field-repeater").data("item-name");if(s&&(s.hasOwnProperty("selector")||s.hasOwnProperty("selectorArray"))){var d=function(){var e,i,t;if(s.hasOwnProperty("selectorArray"))for(var n=0;n<s.selectorArray.length&&(e=(t=s.selectorArray[n]).hasOwnProperty("valueMethod")&&t.valueMethod?t.valueMethod:"val",!(i=r.find(t.selector)[e]()));n++);else e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=r.find(s.selector)[e]();i?(i.length>80&&(i=i.substr(0,79)+"..."),a.find("h4").text(i)):a.find("h4").text(o)};d();var l=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";r.bind(l,d)}a.on("click",(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",(function(){e(window).trigger("resize"),e(this).is(":visible")?(e(this).trigger("slideToggleOpenComplete"),e(this).find(".siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field,> .siteorigin-widget-field").each((function(i,t){var r=e(t);r.is(":visible")&&r.trigger("sowsetupformfield")}))):e(this).trigger("slideToggleCloseComplete")})))})),a.find(".siteorigin-widget-field-remove").on("click",(function(i,t){i.preventDefault();var r=e(this).closest(".siteorigin-widget-field-repeater-items"),a=e(this).closest(".siteorigin-widget-field-repeater-item"),s=function(){a.remove(),r.sortable("refresh").trigger("updateFieldPositions"),e(window).trigger("resize"),n.trigger("change")};t&&t.silent?s():confirm(soWidgets.sure)&&a.slideUp("fast",s)})),a.find(".siteorigin-widget-field-copy").on("click",(function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),n=e(this).closest(".siteorigin-widget-field-repeater-item"),a=n.clone(),s=n.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};a.find("*[name]").each((function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var g=tinymce.get(s);g&&i.val(g.getContent())}else if(i.is(".wp-color-picker")){var f=i.closest(".wp-picker-container"),c=i.closest(".siteorigin-widget-field");f.remove(),c.append(i.remove())}else{var p=s?n.find("#"+s):n.find('[name="'+l+'"]');p.length&&null!=p.val()&&i.val(p.val())}if(s){var u,w;if(i.is('[type="radio"]')){u=s.replace(/-\d+-\d+$/,"");var m=s.replace(/-\d+$/,"");if(!d[u]){var v={};d[u]=t.find(".siteorigin-widget-input[id^="+u+"]").not("[id*=_id_]").filter((function(i,t){var r=e(t).attr("name");return!v[r]&&(v[r]=!0,!0)})).length+1}var h=u+"-"+d[u];w=h+s.match(/-\d+$/)[0],a.find("label[for="+m+"]").attr("for",h)}else F=new RegExp("-\\d+$"),u=s.replace(F,""),d[u]||(d[u]=t.find(".siteorigin-widget-input[id^="+u+"]").not("[id*=_id_]").length+1),w=u+"-"+d[u]++;if(i.is(".wp-editor-area")&&(w+=Math.floor(1e3*Math.random()),i.data("tinymce-id",w)),i.attr("id",w),i.is(".wp-editor-area")){var b=i.closest(".siteorigin-widget-tinymce-container"),y=b.data("media-buttons");if(y&&y.html){var F=new RegExp(s,"g");y.html=y.html.replace(F,w),b.data("media-buttons",y)}}a.find("label[for="+s+"]").attr("for",w),a.find("[id*="+s+"]").each((function(){var i=e(this).attr("id").replace(s,w);e(this).attr("id",i)})),"undefined"!=typeof tinymce&&tinymce.get(w)&&tinymce.get(w).remove()}var k=n.parents(".siteorigin-widget-field-repeater").length,_=e("body");(_.hasClass("wp-customizer")||_.hasClass("widgets-php"))&&0===r.closest(".panel-dialog").length&&(k+=1);var C=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(k-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",C),i.data("original-name",C)})),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",(function(){e(window).trigger("resize")})),r.trigger("change")})),r.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),r.data("sowrepeater-actions-setup",!0)}}))},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1].split("]["),a=n.length?r:null;n.length;)a=a[n.shift()];return a[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},(function(e){window.sowVars[t]=e,r(window.sowVars[t][i])})):r(window.sowVars[t][i])},sowbForms.getWidgetIdBase=function(e){return e.data("id-base")},sowbForms.getWidgetFormValues=function(i){if(_.isUndefined(i))return null;var t={};return i.find("*[name]").each((function(){var i=e(this);try{var r=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(r))return!0;var n=(r=r[1]).split("][");n=n.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));var a=t,s=null,o=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===o)s=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===o){if(!i.is(":checked"))return;s=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),s=null===d||"function"!=typeof d.getContent||d.isHidden()?i.val():d.getContent()}else if("SELECT"===i.prop("tagName")){var l=i.find("option:selected");1===l.length?s=i.find("option:selected").val():l.length>1&&(s=_.map(i.find("option:selected"),(function(i,t){return e(i).val()})))}else s=i.val();for(var g=0;g<n.length;g++)g===n.length-1?""===n[g]?a.push(s):a[n[g]]=s:(_.isUndefined(a[n[g]])&&(_.isNumber(n[g+1])||""===n[g+1]?a[n[g]]=[]:a[n[g]]={}),a=a[n[g]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}})),t},sowbForms.setWidgetFormValues=function(i,t,r,n){r=r||!1,n=void 0!==n&&n||void 0===n;var a=0,s=function(i,t){10!=++a?(i.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each((function(i,n){var a=e(this),o=a.find("> .siteorigin-widget-field-repeater"),d=o.data("repeaterName"),l=t.hasOwnProperty(d)?t[d]:null;if(a.parent().is(".siteorigin-widget-section")){var g=o.data("element-name");g=g.replace(/\[#.*?#\]/g,"");for(var f=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(g)[1].split("]["),c=f.length?t:null;f.length;){var p=f.shift();c=c.hasOwnProperty(p)?c[p]:c}l=c}if(l&&Array.isArray(l)){var u=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),w=l.length,m=u.length;if(w>m)for(var v=0;v<w-m;v++)o.find("> .siteorigin-widget-field-repeater-add").trigger("click");else if(!r&&w<m)for(var h=w;h<m;h++){e(u.eq(h)).find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}u=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var b=0;b<u.length;b++)u.eq(b).find("> .siteorigin-widget-field-repeater-item-form"),s(u.eq(b).find("> .siteorigin-widget-field-repeater-item-form"),l[b])}})),--a):--a};s(i,t),i.find("*[name]").each((function(){var i=e(this),a=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(null==a)return!0;var s=(a=a[1]).split("][");s=s.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));for(var o,d=t,l=0;l<s.length;l++){if(!d.hasOwnProperty(s[l])){if(r)return!0;break}l===s.length-1?o=d[s[l]]:d=d[s[l]]}if("checkbox"===i.attr("type"))i.prop("checked",o);else if("radio"===i.attr("type"))i.prop("checked",o===i.val());else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var g=null;"undefined"!=typeof tinyMCE&&(g=tinyMCE.get(i.attr("id"))),null!==g&&"function"==typeof g.setContent&&!g.isHidden()&&i.parent().is(":visible")?g.initialized?g.setContent(o):g.on("init",(function(){g.setContent(o)})):i.val(o)}else if(i.is(".panels-data")){i.val(o);var f=i.data("builder");f&&f.setDataField(i)}else i.val(o);n&&(i.trigger("change"),this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})))}))},sowbForms.displayNotice=function(i,t,r,n,a){var s=e('<div class="siteorigin-widget-form-notification"></div>');t&&s.append("<span>"+t+"</span>"),n&&n.length&&n.forEach((function(i){var t="";i.classes&&i.classes.length&&(t=" "+i.classes.join(" "));var r=e('<a class="button button-small'+t+'">'+i.label+"</a>");i.url&&r.attr("href",i.url),i.callback&&r.on("click",(function(){i.callback(s)})),s.append(r)})),r&&s.append("<div><small>"+r+"</small></div>"),a?a.before(s):i.prepend(s)},e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",(function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout((function(){i.sowSetupForm()}),200)}));var i=e("body");i.hasClass("wp-customizer")&&e(document).on("widget-added",(function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()})),i.hasClass("block-editor-page")&&e(document).on("panels_setup_preview",(function(){window.hasOwnProperty("sowb")&&e(sowb).trigger("setup_widgets",{preview:!0})})),e(document).on("open_dialog",(function(e,i){i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")&&i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")})),e((function(){e(document).trigger("sowadminloaded")}))}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$").exec(e);if(null===t)return!1;var r="",n="default";return void 0!==t[3]?(n=t[1],r=t[3]):r=t[1],{match:t[4].trim(),group:n,state:r}},_checker:function(e,i,t,r){var n,a={};void 0===i.length&&(i=[i]);for(var s=0;s<i.length;s++)!1!==(n=sowEmitters._match(i[s],t))&&("_true"===n.match||r(e,i,n.match))&&(a[n.group]=n.state);return a},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",(function(val,args,match){return eval(match)}))},in:function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",(function(e,i,t){return-1!==t.split(",").map((function(e){return e.trim()})).indexOf(e)}))}};window.sowbForms=sowbForms;
compat/block-editor/widget-block.js CHANGED
@@ -1,12 +1,12 @@
1
- ( function ( editor, blocks, i18n, element, components, compose ) {
2
 
3
  var el = element.createElement;
4
  var registerBlockType = blocks.registerBlockType;
5
- var BlockControls = editor.BlockControls;
6
  var SelectControl = components.SelectControl;
7
  var withState = compose.withState;
8
  var Toolbar = components.Toolbar;
9
- var IconButton = components.IconButton;
10
  var Placeholder = components.Placeholder;
11
  var Spinner = components.Spinner;
12
  var __ = i18n.__;
@@ -159,12 +159,17 @@
159
  return [
160
  !! widgetForm && el(
161
  BlockControls,
162
- { key: 'controls' },
 
 
 
163
  el(
164
  Toolbar,
165
- null,
 
 
166
  el(
167
- IconButton,
168
  {
169
  className: 'components-icon-button components-toolbar__control',
170
  label: __( 'Preview widget.', 'so-widgets-bundle' ),
@@ -249,9 +254,11 @@
249
  { key: 'controls' },
250
  el(
251
  Toolbar,
252
- null,
 
 
253
  el(
254
- IconButton,
255
  {
256
  className: 'components-icon-button components-toolbar__control',
257
  label: __( 'Edit widget.', 'so-widgets-bundle' ),
@@ -292,4 +299,4 @@
292
  return null;
293
  }
294
  } );
295
- } )( window.wp.editor, window.wp.blocks, window.wp.i18n, window.wp.element, window.wp.components, window.wp.compose );
1
+ ( function ( editor, blocks, i18n, element, components, compose, blockEditor ) {
2
 
3
  var el = element.createElement;
4
  var registerBlockType = blocks.registerBlockType;
5
+ var BlockControls = blockEditor.BlockControls;
6
  var SelectControl = components.SelectControl;
7
  var withState = compose.withState;
8
  var Toolbar = components.Toolbar;
9
+ var ToolbarButton = components.ToolbarButton;
10
  var Placeholder = components.Placeholder;
11
  var Spinner = components.Spinner;
12
  var __ = i18n.__;
159
  return [
160
  !! widgetForm && el(
161
  BlockControls,
162
+ {
163
+ key: 'controls',
164
+
165
+ },
166
  el(
167
  Toolbar,
168
+ {
169
+ label: __( 'Preview widget.', 'so-widgets-bundle' ),
170
+ },
171
  el(
172
+ ToolbarButton,
173
  {
174
  className: 'components-icon-button components-toolbar__control',
175
  label: __( 'Preview widget.', 'so-widgets-bundle' ),
254
  { key: 'controls' },
255
  el(
256
  Toolbar,
257
+ {
258
+ label: __( 'Preview widget.', 'so-widgets-bundle' ),
259
+ },
260
  el(
261
+ ToolbarButton,
262
  {
263
  className: 'components-icon-button components-toolbar__control',
264
  label: __( 'Edit widget.', 'so-widgets-bundle' ),
299
  return null;
300
  }
301
  } );
302
+ } )( window.wp.editor, window.wp.blocks, window.wp.i18n, window.wp.element, window.wp.components, window.wp.compose, window.wp.blockEditor );
compat/block-editor/widget-block.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t,i,n,o,s){var d=n.createElement,r=t.registerBlockType,a=e.BlockControls,l=o.SelectControl,w=s.withState,g=o.Toolbar,c=o.IconButton,u=o.Placeholder,m=o.Spinner,b=i.__;r("sowb/widget-block",{title:b("SiteOrigin Widget","so-widgets-bundle"),description:b("Select a SiteOrigin widget from the dropdown.","so-widgets-bundle"),icon:function(){return d("span",{className:"widget-icon so-widget-icon so-block-editor-icon"})},category:"widgets",keywords:[sowbBlockEditorAdmin.widgets.reduce((function(e,t){return e.length>0&&(e+=","),e+t.name}),"")],supports:{html:!1},attributes:{widgetClass:{type:"string"},widgetData:{type:"object"}},edit:w({editing:!1,formInitialized:!1,previewInitialized:!1,widgetFormHtml:"",widgetSettingsChanged:!1,widgetPreviewHtml:""})((function(e){function t(){e.setState({editing:!1,previewInitialized:!1})}if(!e.editing&&e.attributes.widgetClass&&e.attributes.widgetData){var i=!e.loadingWidgets&&!e.editing&&!e.widgetPreviewHtml&&e.attributes.widgetClass&&e.attributes.widgetData;i&&jQuery.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/previews",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:e.attributes.widgetClass,widgetData:e.attributes.widgetData||{}}}).done((function(t){e.setState({widgetPreviewHtml:t,previewInitialized:!1})})).fail((function(t){var i="";t.hasOwnProperty("responseJSON")?i=t.responseJSON.message:t.hasOwnProperty("responseText")&&(i=t.responseText),e.setState({widgetPreviewHtml:"<div>"+i+"</div>"})}));var n=e.widgetPreviewHtml?e.widgetPreviewHtml:"";return[d(a,{key:"controls"},d(g,null,d(c,{className:"components-icon-button components-toolbar__control",label:b("Edit widget.","so-widgets-bundle"),onClick:function(){e.setState({editing:!0,formInitialized:!1})},icon:"edit"}))),d("div",{key:"preview",className:"so-widget-preview-container"},i?d("div",{className:"so-widgets-spinner-container"},d("span",null,d(m))):d("div",{dangerouslySetInnerHTML:{__html:n},ref:function(){e.previewInitialized||(jQuery(window.sowb).trigger("setup_widgets",{preview:!0}),e.setState({previewInitialized:!0}))}}))]}var o=[];sowbBlockEditorAdmin.widgets&&(o=sowbBlockEditorAdmin.widgets.map((function(e){return{value:e.class,label:e.name}}))).unshift({value:"",label:b("Select widget type","so-widgets-bundle")});var s=e.attributes.widgetClass&&!e.widgetFormHtml;s&&jQuery.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/forms",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:e.attributes.widgetClass,widgetData:e.attributes.widgetData}}).done((function(t){e.setState({widgetFormHtml:t})})).fail((function(t){var i="";t.hasOwnProperty("responseJSON")?i=t.responseJSON.message:t.hasOwnProperty("responseText")&&(i=t.responseText),e.setState({widgetFormHtml:"<div>"+i+"</div>"})}));var r=e.widgetFormHtml?e.widgetFormHtml:"";return[!!r&&d(a,{key:"controls"},d(g,null,d(c,{className:"components-icon-button components-toolbar__control",label:b("Preview widget.","so-widgets-bundle"),onClick:t,icon:"visibility"}))),d(u,{key:"placeholder",className:"so-widget-placeholder",label:b("SiteOrigin Widget","so-widgets-bundle"),instructions:b("Select the type of widget you want to use:","so-widgets-bundle")},e.loadingWidgets||s?d(m):d("div",{className:"so-widget-block-container"},d(l,{options:o,value:e.attributes.widgetClass,onChange:function(t){if(""!==t){if(e.widgetSettingsChanged&&!confirm(sowbBlockEditorAdmin.confirmChangeWidget))return!1;e.setAttributes({widgetClass:t,widgetData:null}),e.setState({editing:!0,widgetFormHtml:null,formInitialized:!1,widgetSettingsChanged:!1,widgetPreviewHtml:null,previewInitialized:!1})}}}),d("div",{className:"so-widget-block-form-container",dangerouslySetInnerHTML:{__html:r},ref:function(i){var n=jQuery(i).find(".siteorigin-widget-form-main");n.length>0&&!e.formInitialized&&(n.siblings(".siteorigin-widget-preview").find("> a").on("click",(function(e){e.stopImmediatePropagation(),t()})),n.data("backupDisabled",!0),n.sowSetupForm(),e.attributes.widgetData?sowbForms.setWidgetFormValues(n,e.attributes.widgetData):e.setAttributes({widgetData:sowbForms.getWidgetFormValues(n)}),n.on("change",(function(){e.setAttributes({widgetData:sowbForms.getWidgetFormValues(n)}),e.setState({widgetSettingsChanged:!0,widgetPreviewHtml:null,previewInitialized:!1})})),e.setState({formInitialized:!0}))}})))]})),save:function(){return null}})}(window.wp.editor,window.wp.blocks,window.wp.i18n,window.wp.element,window.wp.components,window.wp.compose);
1
+ !function(e,t,i,o,n,s,d){var r=o.createElement,a=t.registerBlockType,l=d.BlockControls,w=n.SelectControl,g=s.withState,c=n.Toolbar,u=n.ToolbarButton,m=n.Placeholder,b=n.Spinner,p=i.__;a("sowb/widget-block",{title:p("SiteOrigin Widget","so-widgets-bundle"),description:p("Select a SiteOrigin widget from the dropdown.","so-widgets-bundle"),icon:function(){return r("span",{className:"widget-icon so-widget-icon so-block-editor-icon"})},category:"widgets",keywords:[sowbBlockEditorAdmin.widgets.reduce((function(e,t){return e.length>0&&(e+=","),e+t.name}),"")],supports:{html:!1},attributes:{widgetClass:{type:"string"},widgetData:{type:"object"}},edit:g({editing:!1,formInitialized:!1,previewInitialized:!1,widgetFormHtml:"",widgetSettingsChanged:!1,widgetPreviewHtml:""})((function(e){function t(){e.setState({editing:!1,previewInitialized:!1})}if(!e.editing&&e.attributes.widgetClass&&e.attributes.widgetData){var i=!e.loadingWidgets&&!e.editing&&!e.widgetPreviewHtml&&e.attributes.widgetClass&&e.attributes.widgetData;i&&jQuery.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/previews",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:e.attributes.widgetClass,widgetData:e.attributes.widgetData||{}}}).done((function(t){e.setState({widgetPreviewHtml:t,previewInitialized:!1})})).fail((function(t){var i="";t.hasOwnProperty("responseJSON")?i=t.responseJSON.message:t.hasOwnProperty("responseText")&&(i=t.responseText),e.setState({widgetPreviewHtml:"<div>"+i+"</div>"})}));var o=e.widgetPreviewHtml?e.widgetPreviewHtml:"";return[r(l,{key:"controls"},r(c,{label:p("Preview widget.","so-widgets-bundle")},r(u,{className:"components-icon-button components-toolbar__control",label:p("Edit widget.","so-widgets-bundle"),onClick:function(){e.setState({editing:!0,formInitialized:!1})},icon:"edit"}))),r("div",{key:"preview",className:"so-widget-preview-container"},i?r("div",{className:"so-widgets-spinner-container"},r("span",null,r(b))):r("div",{dangerouslySetInnerHTML:{__html:o},ref:function(){e.previewInitialized||(jQuery(window.sowb).trigger("setup_widgets",{preview:!0}),e.setState({previewInitialized:!0}))}}))]}var n=[];sowbBlockEditorAdmin.widgets&&(n=sowbBlockEditorAdmin.widgets.map((function(e){return{value:e.class,label:e.name}}))).unshift({value:"",label:p("Select widget type","so-widgets-bundle")});var s=e.attributes.widgetClass&&!e.widgetFormHtml;s&&jQuery.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/forms",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:e.attributes.widgetClass,widgetData:e.attributes.widgetData}}).done((function(t){e.setState({widgetFormHtml:t})})).fail((function(t){var i="";t.hasOwnProperty("responseJSON")?i=t.responseJSON.message:t.hasOwnProperty("responseText")&&(i=t.responseText),e.setState({widgetFormHtml:"<div>"+i+"</div>"})}));var d=e.widgetFormHtml?e.widgetFormHtml:"";return[!!d&&r(l,{key:"controls"},r(c,{label:p("Preview widget.","so-widgets-bundle")},r(u,{className:"components-icon-button components-toolbar__control",label:p("Preview widget.","so-widgets-bundle"),onClick:t,icon:"visibility"}))),r(m,{key:"placeholder",className:"so-widget-placeholder",label:p("SiteOrigin Widget","so-widgets-bundle"),instructions:p("Select the type of widget you want to use:","so-widgets-bundle")},e.loadingWidgets||s?r(b):r("div",{className:"so-widget-block-container"},r(w,{options:n,value:e.attributes.widgetClass,onChange:function(t){if(""!==t){if(e.widgetSettingsChanged&&!confirm(sowbBlockEditorAdmin.confirmChangeWidget))return!1;e.setAttributes({widgetClass:t,widgetData:null}),e.setState({editing:!0,widgetFormHtml:null,formInitialized:!1,widgetSettingsChanged:!1,widgetPreviewHtml:null,previewInitialized:!1})}}}),r("div",{className:"so-widget-block-form-container",dangerouslySetInnerHTML:{__html:d},ref:function(i){var o=jQuery(i).find(".siteorigin-widget-form-main");o.length>0&&!e.formInitialized&&(o.siblings(".siteorigin-widget-preview").find("> a").on("click",(function(e){e.stopImmediatePropagation(),t()})),o.data("backupDisabled",!0),o.sowSetupForm(),e.attributes.widgetData?sowbForms.setWidgetFormValues(o,e.attributes.widgetData):e.setAttributes({widgetData:sowbForms.getWidgetFormValues(o)}),o.on("change",(function(){e.setAttributes({widgetData:sowbForms.getWidgetFormValues(o)}),e.setState({widgetSettingsChanged:!0,widgetPreviewHtml:null,previewInitialized:!1})})),e.setState({formInitialized:!0}))}})))]})),save:function(){return null}})}(window.wp.editor,window.wp.blocks,window.wp.i18n,window.wp.element,window.wp.components,window.wp.compose,window.wp.blockEditor);
compat/visual-composer/sowb-vc-widget.js CHANGED
@@ -17,7 +17,7 @@ sowbForms.setupVcWidgetForm = function () {
17
  } );
18
 
19
  var prevWidget;
20
- $widgetDropdown.mousedown( function () {
21
  prevWidget = $widgetDropdown.find( 'option:selected' );
22
  } );
23
 
17
  } );
18
 
19
  var prevWidget;
20
+ $widgetDropdown.on( 'mousedown', function() {
21
  prevWidget = $widgetDropdown.find( 'option:selected' );
22
  } );
23
 
compat/visual-composer/sowb-vc-widget.min.js CHANGED
@@ -1 +1 @@
1
- var sowbForms=window.sowbForms||{};sowbForms.setupVcWidgetForm=function(){var e,o=jQuery,i=o('[name="so_widget_class"]'),n=o(".siteorigin_widget_form_container"),t=!1;n.on("change",".siteorigin-widget-field",(function(){t=!0;var e=sowbForms.getWidgetFormValues(n),r=i.val(),s=JSON.stringify({widget_class:r,widget_data:e});s=s.replace(/\\/g,"\\\\"),o('[name="so_widget_data"]').val(s)})),i.mousedown((function(){e=i.find("option:selected")})),i.on("change",(function(r){if(!t||confirm(soWidgetsVC.confirmChangeWidget)){t=!1;var s={action:"sowb_vc_widget_render_form",widget:i.val()};o.post(soWidgetsVC.ajaxUrl,s,(function(e){n.html(e),n.trigger("change")}),"html")}else e.attr("selected",!0)})),vc.atts.sowb_json_escaped={parse:function(e){var o=this.content().find(".wpb_vc_param_value[name="+e.param_name+"]");return _.escape(_.escape(o.val().toString()).replace(/\[/g,"&#91;").replace(/\]/g,"&#93;"))},render:function(e,o){return _.unescape(_.unescape(o)).replace(/&#91;/g,"[").replace(/&#93;/g,"]")}},vc.events.on("shortcodeView:updated:siteorigin_widget_vc",(function(){void 0!==vc.frame_window&&void 0!==vc.frame_window.sowb&&(0,vc.frame_window.jQuery)(vc.frame_window.sowb).trigger("setup_widgets",{preview:!0})}))},jQuery((function(e){sowbForms.setupVcWidgetForm()})),window.sowbForms=sowbForms;
1
+ var sowbForms=window.sowbForms||{};sowbForms.setupVcWidgetForm=function(){var e,o=jQuery,n=o('[name="so_widget_class"]'),i=o(".siteorigin_widget_form_container"),t=!1;i.on("change",".siteorigin-widget-field",(function(){t=!0;var e=sowbForms.getWidgetFormValues(i),r=n.val(),s=JSON.stringify({widget_class:r,widget_data:e});s=s.replace(/\\/g,"\\\\"),o('[name="so_widget_data"]').val(s)})),n.on("mousedown",(function(){e=n.find("option:selected")})),n.on("change",(function(r){if(!t||confirm(soWidgetsVC.confirmChangeWidget)){t=!1;var s={action:"sowb_vc_widget_render_form",widget:n.val()};o.post(soWidgetsVC.ajaxUrl,s,(function(e){i.html(e),i.trigger("change")}),"html")}else e.attr("selected",!0)})),vc.atts.sowb_json_escaped={parse:function(e){var o=this.content().find(".wpb_vc_param_value[name="+e.param_name+"]");return _.escape(_.escape(o.val().toString()).replace(/\[/g,"&#91;").replace(/\]/g,"&#93;"))},render:function(e,o){return _.unescape(_.unescape(o)).replace(/&#91;/g,"[").replace(/&#93;/g,"]")}},vc.events.on("shortcodeView:updated:siteorigin_widget_vc",(function(){void 0!==vc.frame_window&&void 0!==vc.frame_window.sowb&&(0,vc.frame_window.jQuery)(vc.frame_window.sowb).trigger("setup_widgets",{preview:!0})}))},jQuery((function(e){sowbForms.setupVcWidgetForm()})),window.sowbForms=sowbForms;
js/jquery.cycle.js CHANGED
@@ -100,7 +100,7 @@
100
  var opts = this.opts();
101
  opts.API.trigger('cycle-pre-initialize', [ opts ]);
102
  var tx = $.fn.cycle.transitions[opts.fx];
103
- if (tx && $.isFunction(tx.preInit))
104
  tx.preInit( opts );
105
  opts._preInitialized = true;
106
  },
@@ -109,7 +109,7 @@
109
  var opts = this.opts();
110
  opts.API.trigger('cycle-post-initialize', [ opts ]);
111
  var tx = $.fn.cycle.transitions[opts.fx];
112
- if (tx && $.isFunction(tx.postInit))
113
  tx.postInit( opts );
114
  },
115
 
@@ -134,10 +134,13 @@
134
  if ( opts.pauseOnHover !== true )
135
  pauseObj = $( opts.pauseOnHover );
136
 
137
- pauseObj.hover(
138
- function(){ opts.API.pause( true ); },
139
- function(){ opts.API.resume( true ); }
140
- );
 
 
 
141
  }
142
 
143
  // stage initial transition
@@ -205,8 +208,8 @@
205
  var startSlideshow = false;
206
  var len;
207
 
208
- if ( $.type(slides) == 'string')
209
- slides = $.trim( slides );
210
 
211
  $( slides ).each(function(i) {
212
  var slideOpts;
@@ -414,7 +417,7 @@
414
  }
415
  if ( opts.continueAuto !== undefined ) {
416
  if ( opts.continueAuto === false ||
417
- ($.isFunction(opts.continueAuto) && opts.continueAuto() === false )) {
418
  opts.API.log('terminating automatic transitions');
419
  opts.timeout = 0;
420
  if ( opts.timeoutId )
@@ -700,7 +703,7 @@
700
 
701
  $(document).on( 'cycle-initialized', function( e, opts ) {
702
  var autoHeight = opts.autoHeight;
703
- var t = $.type( autoHeight );
704
  var resizeThrottle = null;
705
  var ratio;
706
 
@@ -751,7 +754,7 @@
751
  else if ( opts._autoHeightRatio ) {
752
  opts.container.height( opts.container.width() / opts._autoHeightRatio );
753
  }
754
- else if ( autoHeight === 'calc' || ( $.type( autoHeight ) == 'number' && autoHeight >= 0 ) ) {
755
  if ( autoHeight === 'calc' )
756
  sentinelIndex = calcSentinelIndex( e, opts );
757
  else if ( autoHeight >= opts.slides.length )
@@ -873,11 +876,11 @@
873
  var cmd, cmdFn, opts;
874
  var args = $.makeArray( arguments );
875
 
876
- if ( $.type( options ) == 'number' ) {
877
  return this.cycle( 'goto', options );
878
  }
879
 
880
- if ( $.type( options ) == 'string' ) {
881
  return this.each(function() {
882
  var cmdArgs;
883
  cmd = options;
@@ -890,7 +893,7 @@
890
  else {
891
  cmd = cmd == 'goto' ? 'jump' : cmd; // issue #3; change 'goto' to 'jump' internally
892
  cmdFn = opts.API[ cmd ];
893
- if ( $.isFunction( cmdFn )) {
894
  cmdArgs = $.makeArray( args );
895
  cmdArgs.shift();
896
  return cmdFn.apply( opts.API, cmdArgs );
@@ -939,7 +942,7 @@
939
  this.stop(); //#204
940
 
941
  var opts = this.opts();
942
- var clean = $.isFunction( $._data ) ? $._data : $.noop; // hack for #184 and #201
943
  clearTimeout(opts.timeoutId);
944
  opts.timeoutId = 0;
945
  opts.API.stop();
@@ -1123,9 +1126,9 @@
1123
 
1124
  function add( slides, prepend ) {
1125
  var slideArr = [];
1126
- if ( $.type( slides ) == 'string' )
1127
- slides = $.trim( slides );
1128
- else if ( $.type( slides) === 'array' ) {
1129
  for (var i=0; i < slides.length; i++ )
1130
  slides[i] = $(slides[i])[0];
1131
  }
@@ -1156,7 +1159,7 @@
1156
  imageLoaded();
1157
  }
1158
  else {
1159
- $(this).load(function() {
1160
  imageLoaded();
1161
  }).on("error", function() {
1162
  if ( --count === 0 ) {
@@ -1389,18 +1392,18 @@
1389
  var nextFn = API.next;
1390
  var prevFn = API.prev;
1391
  var prepareTxFn = API.prepareTx;
1392
- var type = $.type( opts.progressive );
1393
  var slides, scriptEl;
1394
 
1395
  if ( type == 'array' ) {
1396
  slides = opts.progressive;
1397
  }
1398
- else if ($.isFunction( opts.progressive ) ) {
1399
  slides = opts.progressive( opts );
1400
  }
1401
  else if ( type == 'string' ) {
1402
  scriptEl = $( opts.progressive );
1403
- slides = $.trim( scriptEl.html() );
1404
  if ( !slides )
1405
  return;
1406
  // is it json array?
@@ -1534,7 +1537,7 @@
1534
  prop = obj[str];
1535
  }
1536
 
1537
- if ($.isFunction(prop))
1538
  return prop.apply(obj, args);
1539
  if (prop !== undefined && prop !== null && prop != str)
1540
  return prop;
@@ -1544,4 +1547,4 @@
1544
  }
1545
  });
1546
 
1547
- })(jQuery);
100
  var opts = this.opts();
101
  opts.API.trigger('cycle-pre-initialize', [ opts ]);
102
  var tx = $.fn.cycle.transitions[opts.fx];
103
+ if (tx && typeof tx.preInit === 'function' )
104
  tx.preInit( opts );
105
  opts._preInitialized = true;
106
  },
109
  var opts = this.opts();
110
  opts.API.trigger('cycle-post-initialize', [ opts ]);
111
  var tx = $.fn.cycle.transitions[opts.fx];
112
+ if (tx && typeof tx.postInit === 'function')
113
  tx.postInit( opts );
114
  },
115
 
134
  if ( opts.pauseOnHover !== true )
135
  pauseObj = $( opts.pauseOnHover );
136
 
137
+ pauseObj.on( 'mouseenter', function() {
138
+ opts.API.pause( true );
139
+ } );
140
+
141
+ pauseObj.on( 'mouseleave', function() {
142
+ opts.API.resume( true );
143
+ } );
144
  }
145
 
146
  // stage initial transition
208
  var startSlideshow = false;
209
  var len;
210
 
211
+ if ( typeof slides === 'string' )
212
+ slides = slides.trim();
213
 
214
  $( slides ).each(function(i) {
215
  var slideOpts;
417
  }
418
  if ( opts.continueAuto !== undefined ) {
419
  if ( opts.continueAuto === false ||
420
+ ( typeof opts.continueAuto === 'function' && opts.continueAuto() === false )) {
421
  opts.API.log('terminating automatic transitions');
422
  opts.timeout = 0;
423
  if ( opts.timeoutId )
703
 
704
  $(document).on( 'cycle-initialized', function( e, opts ) {
705
  var autoHeight = opts.autoHeight;
706
+ var t = typeof autoHeight;
707
  var resizeThrottle = null;
708
  var ratio;
709
 
754
  else if ( opts._autoHeightRatio ) {
755
  opts.container.height( opts.container.width() / opts._autoHeightRatio );
756
  }
757
+ else if ( autoHeight === 'calc' || ( typeof autoHeight === 'number' && autoHeight >= 0 ) ) {
758
  if ( autoHeight === 'calc' )
759
  sentinelIndex = calcSentinelIndex( e, opts );
760
  else if ( autoHeight >= opts.slides.length )
876
  var cmd, cmdFn, opts;
877
  var args = $.makeArray( arguments );
878
 
879
+ if ( typeof options === 'number' ) {
880
  return this.cycle( 'goto', options );
881
  }
882
 
883
+ if ( typeof options === 'string' ) {
884
  return this.each(function() {
885
  var cmdArgs;
886
  cmd = options;
893
  else {
894
  cmd = cmd == 'goto' ? 'jump' : cmd; // issue #3; change 'goto' to 'jump' internally
895
  cmdFn = opts.API[ cmd ];
896
+ if ( typeof cmdFn === 'function' ) {
897
  cmdArgs = $.makeArray( args );
898
  cmdArgs.shift();
899
  return cmdFn.apply( opts.API, cmdArgs );
942
  this.stop(); //#204
943
 
944
  var opts = this.opts();
945
+ var clean = typeof $._data === 'function' ? $._data : $.noop; // hack for #184 and #201
946
  clearTimeout(opts.timeoutId);
947
  opts.timeoutId = 0;
948
  opts.API.stop();
1126
 
1127
  function add( slides, prepend ) {
1128
  var slideArr = [];
1129
+ if ( typeof slides == 'string' )
1130
+ slides = slides.trim();
1131
+ else if ( typeof slides === 'array' ) {
1132
  for (var i=0; i < slides.length; i++ )
1133
  slides[i] = $(slides[i])[0];
1134
  }
1159
  imageLoaded();
1160
  }
1161
  else {
1162
+ $( this ).on( 'load', function() {
1163
  imageLoaded();
1164
  }).on("error", function() {
1165
  if ( --count === 0 ) {
1392
  var nextFn = API.next;
1393
  var prevFn = API.prev;
1394
  var prepareTxFn = API.prepareTx;
1395
+ var type = typeof opts.progressive;
1396
  var slides, scriptEl;
1397
 
1398
  if ( type == 'array' ) {
1399
  slides = opts.progressive;
1400
  }
1401
+ else if ( typeof opts.progressive === 'function' ) {
1402
  slides = opts.progressive( opts );
1403
  }
1404
  else if ( type == 'string' ) {
1405
  scriptEl = $( opts.progressive );
1406
+ slides = scriptEl.html().trim();
1407
  if ( !slides )
1408
  return;
1409
  // is it json array?
1537
  prop = obj[str];
1538
  }
1539
 
1540
+ if ( typeof prop === 'function' )
1541
  return prop.apply(obj, args);
1542
  if (prop !== undefined && prop !== null && prop != str)
1543
  return prop;
1547
  }
1548
  });
1549
 
1550
+ })(jQuery);
js/jquery.cycle.min.js CHANGED
@@ -3,22 +3,22 @@
3
  * http://jquery.malsup.com/cycle2/
4
  * Copyright (c) 2014 M. Alsup; Dual licensed: MIT/GPL
5
  */
6
- !function(e){"use strict";function t(e){return(e||"").toLowerCase()}e.fn.cycle=function(i){var n;return 0!==this.length||e.isReady?this.each((function(){var n,s,o,c,l=e(this),a=e.fn.cycle.log;if(!l.data("cycle.opts")){for(var r in(!1===l.data("cycle-log")||i&&!1===i.log||s&&!1===s.log)&&(a=e.noop),a("--c2 init--"),n=l.data())n.hasOwnProperty(r)&&/^cycle[A-Z]+/.test(r)&&(c=n[r],a((o=r.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t))+":",c,"("+typeof c+")"),n[o]=c);(s=e.extend({},e.fn.cycle.defaults,n,i||{})).timeoutId=0,s.paused=s.paused||!1,s.container=l,s._maxZ=s.maxZ,s.API=e.extend({_container:l},e.fn.cycle.API),s.API.log=a,s.API.trigger=function(e,t){return s.container.trigger(e,t),s.API},l.data("cycle.opts",s),l.data("cycle.API",s.API),s.API.trigger("cycle-bootstrap",[s,s.API]),s.API.addInitialSlides(),s.API.preInitSlideshow(),s.slides.length&&s.API.initSlideshow()}})):(n={s:this.selector,c:this.context},e.fn.cycle.log("requeuing slideshow (dom not ready)"),e((function(){e(n.s,n.c).cycle(i)})),this)},e.fn.cycle.API={opts:function(){return this._container.data("cycle.opts")},addInitialSlides:function(){var t=this.opts(),i=t.slides;t.slideCount=0,t.slides=e(),i=i.jquery?i:t.container.find(i),t.random&&i.sort((function(){return Math.random()-.5})),t.API.add(i)},preInitSlideshow:function(){var t=this.opts();t.API.trigger("cycle-pre-initialize",[t]);var i=e.fn.cycle.transitions[t.fx];i&&e.isFunction(i.preInit)&&i.preInit(t),t._preInitialized=!0},postInitSlideshow:function(){var t=this.opts();t.API.trigger("cycle-post-initialize",[t]);var i=e.fn.cycle.transitions[t.fx];i&&e.isFunction(i.postInit)&&i.postInit(t)},initSlideshow:function(){var t,i=this.opts(),n=i.container;i.API.calcFirstSlide(),"static"==i.container.css("position")&&i.container.css("position","relative"),e(i.slides[i.currSlide]).css({opacity:1,display:"block",visibility:"visible"}),i.API.stackSlides(i.slides[i.currSlide],i.slides[i.nextSlide],!i.reverse),i.pauseOnHover&&(!0!==i.pauseOnHover&&(n=e(i.pauseOnHover)),n.hover((function(){i.API.pause(!0)}),(function(){i.API.resume(!0)}))),i.timeout&&(t=i.API.getSlideOpts(i.currSlide),i.API.queueTransition(t,t.timeout+i.delay)),i._initialized=!0,i.API.updateView(!0),i.API.trigger("cycle-initialized",[i]),i.API.postInitSlideshow()},pause:function(t){var i=this.opts(),n=i.API.getSlideOpts(),s=i.hoverPaused||i.paused;t?i.hoverPaused=!0:i.paused=!0,s||(i.container.addClass("cycle-paused"),i.API.trigger("cycle-paused",[i]).log("cycle-paused"),n.timeout&&(clearTimeout(i.timeoutId),i.timeoutId=0,i._remainingTimeout-=e.now()-i._lastQueue,(i._remainingTimeout<0||isNaN(i._remainingTimeout))&&(i._remainingTimeout=void 0)))},resume:function(e){var t=this.opts(),i=!t.hoverPaused&&!t.paused;e?t.hoverPaused=!1:t.paused=!1,i||(t.container.removeClass("cycle-paused"),0===t.slides.filter(":animated").length&&t.API.queueTransition(t.API.getSlideOpts(),t._remainingTimeout),t.API.trigger("cycle-resumed",[t,t._remainingTimeout]).log("cycle-resumed"))},add:function(t,i){var n,s=this.opts(),o=s.slideCount;"string"==e.type(t)&&(t=e.trim(t)),e(t).each((function(t){var n,o=e(this);i?s.container.prepend(o):s.container.append(o),s.slideCount++,n=s.API.buildSlideOpts(o),s.slides=i?e(o).add(s.slides):s.slides.add(o),s.API.initSlide(n,o,--s._maxZ),o.data("cycle.opts",n),s.API.trigger("cycle-slide-added",[s,n,o])})),s.API.updateView(!0),s._preInitialized&&o<2&&s.slideCount>=1&&(s._initialized?s.timeout&&(n=s.slides.length,s.nextSlide=s.reverse?n-1:1,s.timeoutId||s.API.queueTransition(s)):s.API.initSlideshow())},calcFirstSlide:function(){var e,t=this.opts();((e=parseInt(t.startingSlide||0,10))>=t.slides.length||e<0)&&(e=0),t.currSlide=e,t.reverse?(t.nextSlide=e-1,t.nextSlide<0&&(t.nextSlide=t.slides.length-1)):(t.nextSlide=e+1,t.nextSlide==t.slides.length&&(t.nextSlide=0))},calcNextSlide:function(){var e,t=this.opts();t.reverse?(e=t.nextSlide-1<0,t.nextSlide=e?t.slideCount-1:t.nextSlide-1,t.currSlide=e?0:t.nextSlide+1):(e=t.nextSlide+1==t.slides.length,t.nextSlide=e?0:t.nextSlide+1,t.currSlide=e?t.slides.length-1:t.nextSlide-1)},calcTx:function(t,i){var n,s=t;return s._tempFx?n=e.fn.cycle.transitions[s._tempFx]:i&&s.manualFx&&(n=e.fn.cycle.transitions[s.manualFx]),n||(n=e.fn.cycle.transitions[s.fx]),s._tempFx=null,this.opts()._tempFx=null,n||(n=e.fn.cycle.transitions.fade,s.API.log('Transition "'+s.fx+'" not found. Using fade.')),n},prepareTx:function(e,t){var i,n,s,o,c,l=this.opts();l.slideCount<2?l.timeoutId=0:(!e||l.busy&&!l.manualTrump||(l.API.stopTransition(),l.busy=!1,clearTimeout(l.timeoutId),l.timeoutId=0),l.busy||(0!==l.timeoutId||e)&&(n=l.slides[l.currSlide],s=l.slides[l.nextSlide],o=l.API.getSlideOpts(l.nextSlide),c=l.API.calcTx(o,e),l._tx=c,e&&void 0!==o.manualSpeed&&(o.speed=o.manualSpeed),l.nextSlide!=l.currSlide&&(e||!l.paused&&!l.hoverPaused&&l.timeout)?(l.API.trigger("cycle-before",[o,n,s,t]),c.before&&c.before(o,n,s,t),i=function(){l.busy=!1,l.container.data("cycle.opts")&&(c.after&&c.after(o,n,s,t),l.API.trigger("cycle-after",[o,n,s,t]),l.API.queueTransition(o),l.API.updateView(!0))},l.busy=!0,c.transition?c.transition(o,n,s,t,i):l.API.doTransition(o,n,s,t,i),l.API.calcNextSlide(),l.API.updateView()):l.API.queueTransition(o)))},doTransition:function(t,i,n,s,o){var c=t,l=e(i),a=e(n),r=function(){a.animate(c.animIn||{opacity:1},c.speed,c.easeIn||c.easing,o)};a.css(c.cssBefore||{}),l.animate(c.animOut||{},c.speed,c.easeOut||c.easing,(function(){l.css(c.cssAfter||{}),c.sync||r()})),c.sync&&r()},queueTransition:function(t,i){var n=this.opts(),s=void 0!==i?i:t.timeout;return 0===n.nextSlide&&0==--n.loop?(n.API.log("terminating; loop=0"),n.timeout=0,s?setTimeout((function(){n.API.trigger("cycle-finished",[n])}),s):n.API.trigger("cycle-finished",[n]),void(n.nextSlide=n.currSlide)):void 0!==n.continueAuto&&(!1===n.continueAuto||e.isFunction(n.continueAuto)&&!1===n.continueAuto())?(n.API.log("terminating automatic transitions"),n.timeout=0,void(n.timeoutId&&clearTimeout(n.timeoutId))):void(s&&(n._lastQueue=e.now(),void 0===i&&(n._remainingTimeout=t.timeout),n.paused||n.hoverPaused||(n.timeoutId=setTimeout((function(){n.API.prepareTx(!1,!n.reverse)}),s))))},stopTransition:function(){var e=this.opts();e.slides.filter(":animated").length&&(e.slides.stop(!1,!0),e.API.trigger("cycle-transition-stopped",[e])),e._tx&&e._tx.stopTransition&&e._tx.stopTransition(e)},advanceSlide:function(e){var t=this.opts();return clearTimeout(t.timeoutId),t.timeoutId=0,t.nextSlide=t.currSlide+e,t.nextSlide<0?t.nextSlide=t.slides.length-1:t.nextSlide>=t.slides.length&&(t.nextSlide=0),t.API.prepareTx(!0,e>=0),!1},buildSlideOpts:function(i){var n,s,o=this.opts(),c=i.data()||{};for(var l in c)c.hasOwnProperty(l)&&/^cycle[A-Z]+/.test(l)&&(n=c[l],s=l.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t),o.API.log("["+(o.slideCount-1)+"]",s+":",n,"("+typeof n+")"),c[s]=n);(c=e.extend({},e.fn.cycle.defaults,o,c)).slideNum=o.slideCount;try{delete c.API,delete c.slideCount,delete c.currSlide,delete c.nextSlide,delete c.slides}catch(e){}return c},getSlideOpts:function(t){var i=this.opts();void 0===t&&(t=i.currSlide);var n=i.slides[t],s=e(n).data("cycle.opts");return e.extend({},i,s)},initSlide:function(t,i,n){var s=this.opts();i.css(t.slideCss||{}),n>0&&i.css("zIndex",n),isNaN(t.speed)&&(t.speed=e.fx.speeds[t.speed]||e.fx.speeds._default),t.sync||(t.speed=t.speed/2),i.addClass(s.slideClass)},updateView:function(e,t,i){var n=this.opts();if(n._initialized){var s=n.API.getSlideOpts(),o=n.slides[n.currSlide];!e&&!0!==t&&(n.API.trigger("cycle-update-view-before",[n,s,o]),n.updateView<0)||(n.slideActiveClass&&n.slides.removeClass(n.slideActiveClass).eq(n.currSlide).addClass(n.slideActiveClass),e&&n.hideNonActive&&n.slides.filter(":not(."+n.slideActiveClass+")").css("visibility","hidden"),0===n.updateView&&setTimeout((function(){n.API.trigger("cycle-update-view",[n,s,o,e])}),s.speed/(n.sync?2:1)),0!==n.updateView&&n.API.trigger("cycle-update-view",[n,s,o,e]),e&&n.API.trigger("cycle-update-view-after",[n,s,o]))}},getComponent:function(t){var i=this.opts(),n=i[t];return"string"==typeof n?/^\s*[\>|\+|~]/.test(n)?i.container.find(n):e(n):n.jquery?n:e(n)},stackSlides:function(t,i,n){var s,o=this.opts();t||(t=o.slides[o.currSlide],i=o.slides[o.nextSlide],n=!o.reverse),e(t).css("zIndex",o.maxZ);var c=o.maxZ-2,l=o.slideCount;if(n){for(s=o.currSlide+1;s<l;s++)e(o.slides[s]).css("zIndex",c--);for(s=0;s<o.currSlide;s++)e(o.slides[s]).css("zIndex",c--)}else{for(s=o.currSlide-1;s>=0;s--)e(o.slides[s]).css("zIndex",c--);for(s=l-1;s>o.currSlide;s--)e(o.slides[s]).css("zIndex",c--)}e(i).css("zIndex",o.maxZ-1)},getSlideIndex:function(e){return this.opts().slides.index(e)}},e.fn.cycle.log=function(){window.console&&console.log&&console.log("[cycle2] "+Array.prototype.join.call(arguments," "))},e.fn.cycle.version=function(){return"Cycle2: 2.1.6"},e.fn.cycle.transitions={custom:{},none:{before:function(e,t,i,n){e.API.stackSlides(i,t,n),e.cssBefore={opacity:1,visibility:"visible",display:"block"}}},fade:{before:function(t,i,n,s){var o=t.API.getSlideOpts(t.nextSlide).slideCss||{};t.API.stackSlides(i,n,s),t.cssBefore=e.extend(o,{opacity:0,visibility:"visible",display:"block"}),t.animIn={opacity:1},t.animOut={opacity:0}}},fadeout:{before:function(t,i,n,s){var o=t.API.getSlideOpts(t.nextSlide).slideCss||{};t.API.stackSlides(i,n,s),t.cssBefore=e.extend(o,{opacity:1,visibility:"visible",display:"block"}),t.animOut={opacity:0}}},scrollHorz:{before:function(e,t,i,n){e.API.stackSlides(t,i,n);var s=e.container.css("overflow","hidden").width();e.cssBefore={left:n?s:-s,top:0,opacity:1,visibility:"visible",display:"block"},e.cssAfter={zIndex:e._maxZ-2,left:0},e.animIn={left:0},e.animOut={left:n?-s:s}}}},e.fn.cycle.defaults={allowWrap:!0,autoSelector:".cycle-slideshow[data-cycle-auto-init!=false]",delay:0,easing:null,fx:"fade",hideNonActive:!0,loop:0,manualFx:void 0,manualSpeed:void 0,manualTrump:!0,maxZ:100,pauseOnHover:!1,reverse:!1,slideActiveClass:"cycle-slide-active",slideClass:"cycle-slide",slideCss:{position:"absolute",top:0,left:0},slides:"> img",speed:500,startingSlide:0,sync:!0,timeout:4e3,updateView:0},e(document).ready((function(){e(e.fn.cycle.defaults.autoSelector).cycle()}))}(jQuery),
7
  /*! Cycle2 autoheight plugin; Copyright (c) M.Alsup, 2012; version: 20130913 */
8
- function(e){"use strict";function t(t,i){var n,s,o,c=i.autoHeight;if("container"==c)s=e(i.slides[i.currSlide]).outerHeight(),i.container.height(s);else if(i._autoHeightRatio)i.container.height(i.container.width()/i._autoHeightRatio);else if("calc"===c||"number"==e.type(c)&&c>=0){if((o="calc"===c?function(t,i){var n=0,s=-1;return i.slides.each((function(t){var i=e(this).height();i>s&&(s=i,n=t)})),n}(0,i):c>=i.slides.length?0:c)==i._sentinelIndex)return;i._sentinelIndex=o,i._sentinel&&i._sentinel.remove(),(n=e(i.slides[o].cloneNode(!0))).removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel"),n.css({position:"static",visibility:"hidden",display:"block"}).prependTo(i.container).addClass("cycle-sentinel cycle-slide").removeClass("cycle-slide-active"),n.find("*").css("visibility","hidden"),i._sentinel=n}}function i(t,i,n,s,o){var c=e(s).outerHeight();i.container.animate({height:c},i.autoHeightSpeed,i.autoHeightEasing)}function n(s,o){o._autoHeightOnResize&&(e(window).off("resize orientationchange",o._autoHeightOnResize),o._autoHeightOnResize=null),o.container.off("cycle-slide-added cycle-slide-removed",t),o.container.off("cycle-destroyed",n),o.container.off("cycle-before",i),o._sentinel&&(o._sentinel.remove(),o._sentinel=null)}e.extend(e.fn.cycle.defaults,{autoHeight:0,autoHeightSpeed:250,autoHeightEasing:null}),e(document).on("cycle-initialized",(function(s,o){var c,l=o.autoHeight,a=e.type(l),r=null;function d(){t(s,o)}"string"!==a&&"number"!==a||(o.container.on("cycle-slide-added cycle-slide-removed",t),o.container.on("cycle-destroyed",n),"container"==l?o.container.on("cycle-before",i):"string"===a&&/\d+\:\d+/.test(l)&&(c=(c=l.match(/(\d+)\:(\d+)/))[1]/c[2],o._autoHeightRatio=c),"number"!==a&&(o._autoHeightOnResize=function(){clearTimeout(r),r=setTimeout(d,50)},e(window).on("resize orientationchange",o._autoHeightOnResize)),setTimeout(d,30))}))}(jQuery),
9
  /*! caption plugin for Cycle2; version: 20130306 */
10
  function(e){"use strict";e.extend(e.fn.cycle.defaults,{caption:"> .cycle-caption",captionTemplate:"{{slideNum}} / {{slideCount}}",overlay:"> .cycle-overlay",overlayTemplate:"<div>{{title}}</div><div>{{desc}}</div>",captionModule:"caption"}),e(document).on("cycle-update-view",(function(t,i,n,s){"caption"===i.captionModule&&e.each(["caption","overlay"],(function(){var e=n[this+"Template"],t=i.API.getComponent(this);t.length&&e?(t.html(i.API.tmpl(e,n,i,s)),t.show()):t.hide()}))})),e(document).on("cycle-destroyed",(function(t,i){e.each(["caption","overlay"],(function(){var e=i[this+"Template"];i[this]&&e&&i.API.getComponent("caption").empty()}))}))}(jQuery),
11
  /*! command plugin for Cycle2; version: 20140415 */
12
- function(e){"use strict";var t=e.fn.cycle;e.fn.cycle=function(i){var n,s,o,c=e.makeArray(arguments);return"number"==e.type(i)?this.cycle("goto",i):"string"==e.type(i)?this.each((function(){var l;if(n=i,void 0!==(o=e(this).data("cycle.opts")))return n="goto"==n?"jump":n,s=o.API[n],e.isFunction(s)?((l=e.makeArray(c)).shift(),s.apply(o.API,l)):void t.log("unknown command: ",n);t.log('slideshow must be initialized before sending commands; "'+n+'" ignored')})):t.apply(this,arguments)},e.extend(e.fn.cycle,t),e.extend(t.API,{next:function(){var e=this.opts();if(!e.busy||e.manualTrump){var t=e.reverse?-1:1;!1===e.allowWrap&&e.currSlide+t>=e.slideCount||(e.API.advanceSlide(t),e.API.trigger("cycle-next",[e]).log("cycle-next"))}},prev:function(){var e=this.opts();if(!e.busy||e.manualTrump){var t=e.reverse?1:-1;!1===e.allowWrap&&e.currSlide+t<0||(e.API.advanceSlide(t),e.API.trigger("cycle-prev",[e]).log("cycle-prev"))}},destroy:function(){this.stop();var t=this.opts(),i=e.isFunction(e._data)?e._data:e.noop;clearTimeout(t.timeoutId),t.timeoutId=0,t.API.stop(),t.API.trigger("cycle-destroyed",[t]).log("cycle-destroyed"),t.container.removeData(),i(t.container[0],"parsedAttrs",!1),t.retainStylesOnDestroy||(t.container.removeAttr("style"),t.slides.removeAttr("style"),t.slides.removeClass(t.slideActiveClass)),t.slides.each((function(){var n=e(this);n.removeData(),n.removeClass(t.slideClass),i(this,"parsedAttrs",!1)}))},jump:function(e,t){var i,n=this.opts();if(!n.busy||n.manualTrump){var s=parseInt(e,10);isNaN(s)||s<0||s>=n.slides.length?n.API.log("goto: invalid slide index: "+s):s!=n.currSlide?(n.nextSlide=s,clearTimeout(n.timeoutId),n.timeoutId=0,n.API.log("goto: ",s," (zero-index)"),i=n.currSlide<n.nextSlide,n._tempFx=t,n.API.prepareTx(!0,i)):n.API.log("goto: skipping, already on slide",s)}},stop:function(){var t=this.opts(),i=t.container;clearTimeout(t.timeoutId),t.timeoutId=0,t.API.stopTransition(),t.pauseOnHover&&(!0!==t.pauseOnHover&&(i=e(t.pauseOnHover)),i.off("mouseenter mouseleave")),t.API.trigger("cycle-stopped",[t]).log("cycle-stopped")},reinit:function(){var e=this.opts();e.API.destroy(),e.container.cycle()},remove:function(t){for(var i,n,s=this.opts(),o=[],c=1,l=0;l<s.slides.length;l++)i=s.slides[l],l==t?n=i:(o.push(i),e(i).data("cycle.opts").slideNum=c,c++);n&&(s.slides=e(o),s.slideCount--,e(n).remove(),t==s.currSlide?s.API.advanceSlide(1):t<s.currSlide?s.currSlide--:s.currSlide++,s.API.trigger("cycle-slide-removed",[s,t,n]).log("cycle-slide-removed"),s.API.updateView())}}),e(document).on("click.cycle","[data-cycle-cmd]",(function(t){t.preventDefault();var i=e(this),n=i.data("cycle-cmd"),s=i.data("cycle-context")||".cycle-slideshow";e(s).cycle(n,i.data("cycle-arg"))}))}(jQuery),
13
  /*! hash plugin for Cycle2; version: 20130905 */
14
  function(e){"use strict";function t(t,i){var n;t._hashFence?t._hashFence=!1:(n=window.location.hash.substring(1),t.slides.each((function(s){if(e(this).data("cycle-hash")==n){if(!0===i)t.startingSlide=s;else{var o=t.currSlide<s;t.nextSlide=s,t.API.prepareTx(!0,o)}return!1}})))}e(document).on("cycle-pre-initialize",(function(i,n){t(n,!0),n._onHashChange=function(){t(n,!1)},e(window).on("hashchange",n._onHashChange)})),e(document).on("cycle-update-view",(function(e,t,i){i.hash&&"#"+i.hash!=window.location.hash&&(t._hashFence=!0,window.location.hash=i.hash)})),e(document).on("cycle-destroyed",(function(t,i){i._onHashChange&&e(window).off("hashchange",i._onHashChange)}))}(jQuery),
15
  /*! loader plugin for Cycle2; version: 20131121 */
16
- function(e){"use strict";e.extend(e.fn.cycle.defaults,{loader:!1}),e(document).on("cycle-bootstrap",(function(t,i){var n;i.loader&&(n=i.API.add,i.API.add=function(t,s){var o=[];if("string"==e.type(t))t=e.trim(t);else if("array"===e.type(t))for(var c=0;c<t.length;c++)t[c]=e(t[c])[0];var l=(t=e(t)).length;if(!l)return;t.css("visibility","hidden").appendTo("body").each((function(t){var c=0,r=e(this),d=r.is("img")?r:r.find("img");if(r.data("index",t),!(d=d.filter(":not(.cycle-loader-ignore)").filter(':not([src=""])')).length)return--l,void o.push(r);function u(){0==--c&&(--l,function(t){var c;"wait"==i.loader?(o.push(t),0===l&&(o.sort(a),n.apply(i.API,[o,s]),i.container.removeClass("cycle-loading"))):(c=e(i.slides[i.currSlide]),n.apply(i.API,[t,s]),c.show(),i.container.removeClass("cycle-loading"))}(r))}c=d.length,d.each((function(){this.complete?u():e(this).load((function(){u()})).on("error",(function(){0==--c&&(i.API.log("slide skipped; img not loaded:",this.src),0==--l&&"wait"==i.loader&&n.apply(i.API,[o,s]))}))}))})),l&&i.container.addClass("cycle-loading");function a(e,t){return e.data("index")-t.data("index")}})}))}(jQuery),
17
  /*! pager plugin for Cycle2; version: 20140415 */
18
  function(e){"use strict";function t(t,i,n){var s;t.API.getComponent("pager").each((function(){var o=e(this);if(i.pagerTemplate){var c=t.API.tmpl(i.pagerTemplate,i,t,n[0]);s=e(c).appendTo(o)}else s=o.children().eq(t.slideCount-1);s.on(t.pagerEvent,(function(e){t.pagerEventBubble||e.preventDefault(),t.API.page(o,e.currentTarget)}))}))}function i(e,t){var i=this.opts();if(!i.busy||i.manualTrump){var n=e.children().index(t),s=i.currSlide<n;i.currSlide!=n&&(i.nextSlide=n,i._tempFx=i.pagerFx,i.API.prepareTx(!0,s),i.API.trigger("cycle-pager-activated",[i,e,t]))}}e.extend(e.fn.cycle.defaults,{pager:"> .cycle-pager",pagerActiveClass:"cycle-pager-active",pagerEvent:"click.cycle",pagerEventBubble:void 0,pagerTemplate:"<span>&bull;</span>"}),e(document).on("cycle-bootstrap",(function(e,i,n){n.buildPagerLink=t})),e(document).on("cycle-slide-added",(function(e,t,n,s){t.pager&&(t.API.buildPagerLink(t,n,s),t.API.page=i)})),e(document).on("cycle-slide-removed",(function(t,i,n,s){i.pager&&i.API.getComponent("pager").each((function(){var t=e(this);e(t.children()[n]).remove()}))})),e(document).on("cycle-update-view",(function(t,i,n){i.pager&&i.API.getComponent("pager").each((function(){e(this).children().removeClass(i.pagerActiveClass).eq(i.currSlide).addClass(i.pagerActiveClass)}))})),e(document).on("cycle-destroyed",(function(e,t){var i=t.API.getComponent("pager");i&&(i.children().off(t.pagerEvent),t.pagerTemplate&&i.empty())}))}(jQuery),
19
  /*! prevnext plugin for Cycle2; version: 20140408 */
20
  function(e){"use strict";e.extend(e.fn.cycle.defaults,{next:"> .cycle-next",nextEvent:"click.cycle",disabledClass:"disabled",prev:"> .cycle-prev",prevEvent:"click.cycle",swipe:!1}),e(document).on("cycle-initialized",(function(e,t){if(t.API.getComponent("next").on(t.nextEvent,(function(e){e.preventDefault(),t.API.next()})),t.API.getComponent("prev").on(t.prevEvent,(function(e){e.preventDefault(),t.API.prev()})),t.swipe){var i=t.swipeVert?"swipeUp.cycle":"swipeLeft.cycle swipeleft.cycle",n=t.swipeVert?"swipeDown.cycle":"swipeRight.cycle swiperight.cycle";t.container.on(i,(function(e){t._tempFx=t.swipeFx,t.API.next()})),t.container.on(n,(function(){t._tempFx=t.swipeFx,t.API.prev()}))}})),e(document).on("cycle-update-view",(function(e,t,i,n){if(!t.allowWrap){var s=t.disabledClass,o=t.API.getComponent("next"),c=t.API.getComponent("prev"),l=t._prevBoundry||0,a=void 0!==t._nextBoundry?t._nextBoundry:t.slideCount-1;t.currSlide==a?o.addClass(s).prop("disabled",!0):o.removeClass(s).prop("disabled",!1),t.currSlide===l?c.addClass(s).prop("disabled",!0):c.removeClass(s).prop("disabled",!1)}})),e(document).on("cycle-destroyed",(function(e,t){t.API.getComponent("prev").off(t.nextEvent),t.API.getComponent("next").off(t.prevEvent),t.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle")}))}(jQuery),
21
  /*! progressive loader plugin for Cycle2; version: 20130315 */
22
- function(e){"use strict";e.extend(e.fn.cycle.defaults,{progressive:!1}),e(document).on("cycle-pre-initialize",(function(t,i){if(i.progressive){var n,s,o=i.API,c=o.next,l=o.prev,a=o.prepareTx,r=e.type(i.progressive);if("array"==r)n=i.progressive;else if(e.isFunction(i.progressive))n=i.progressive(i);else if("string"==r){if(s=e(i.progressive),!(n=e.trim(s.html())))return;if(/^(\[)/.test(n))try{n=e.parseJSON(n)}catch(e){return void o.log("error parsing progressive slides",e)}else(n=n.split(new RegExp(s.data("cycle-split")||"\n")))[n.length-1]||n.pop()}a&&(o.prepareTx=function(e,t){var s,o;e||0===n.length?a.apply(i.API,[e,t]):t&&i.currSlide==i.slideCount-1?(o=n[0],n=n.slice(1),i.container.one("cycle-slide-added",(function(e,t){setTimeout((function(){t.API.advanceSlide(1)}),50)})),i.API.add(o)):t||0!==i.currSlide?a.apply(i.API,[e,t]):(s=n.length-1,o=n[s],n=n.slice(0,s),i.container.one("cycle-slide-added",(function(e,t){setTimeout((function(){t.currSlide=1,t.API.advanceSlide(-1)}),50)})),i.API.add(o,!0))}),c&&(o.next=function(){var e=this.opts();if(n.length&&e.currSlide==e.slideCount-1){var t=n[0];n=n.slice(1),e.container.one("cycle-slide-added",(function(e,t){c.apply(t.API),t.container.removeClass("cycle-loading")})),e.container.addClass("cycle-loading"),e.API.add(t)}else c.apply(e.API)}),l&&(o.prev=function(){var e=this.opts();if(n.length&&0===e.currSlide){var t=n.length-1,i=n[t];n=n.slice(0,t),e.container.one("cycle-slide-added",(function(e,t){t.currSlide=1,t.API.advanceSlide(-1),t.container.removeClass("cycle-loading")})),e.container.addClass("cycle-loading"),e.API.add(i,!0)}else l.apply(e.API)})}}))}(jQuery),
23
  /*! tmpl plugin for Cycle2; version: 20121227 */
24
- function(e){"use strict";e.extend(e.fn.cycle.defaults,{tmplRegex:"{{((.)?.*?)}}"}),e.extend(e.fn.cycle.API,{tmpl:function(t,i){var n=new RegExp(i.tmplRegex||e.fn.cycle.defaults.tmplRegex,"g"),s=e.makeArray(arguments);return s.shift(),t.replace(n,(function(t,i){var n,o,c,l,a=i.split(".");for(n=0;n<s.length;n++)if(c=s[n]){if(a.length>1)for(l=c,o=0;o<a.length;o++)c=l,l=l[a[o]]||i;else l=c[i];if(e.isFunction(l))return l.apply(c,s);if(null!=l&&l!=i)return l}return i}))}})}(jQuery);
3
  * http://jquery.malsup.com/cycle2/
4
  * Copyright (c) 2014 M. Alsup; Dual licensed: MIT/GPL
5
  */
6
+ !function(e){"use strict";function t(e){return(e||"").toLowerCase()}e.fn.cycle=function(i){var n;return 0!==this.length||e.isReady?this.each((function(){var n,s,o,c,l=e(this),a=e.fn.cycle.log;if(!l.data("cycle.opts")){for(var r in(!1===l.data("cycle-log")||i&&!1===i.log||s&&!1===s.log)&&(a=e.noop),a("--c2 init--"),n=l.data())n.hasOwnProperty(r)&&/^cycle[A-Z]+/.test(r)&&(c=n[r],a((o=r.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t))+":",c,"("+typeof c+")"),n[o]=c);(s=e.extend({},e.fn.cycle.defaults,n,i||{})).timeoutId=0,s.paused=s.paused||!1,s.container=l,s._maxZ=s.maxZ,s.API=e.extend({_container:l},e.fn.cycle.API),s.API.log=a,s.API.trigger=function(e,t){return s.container.trigger(e,t),s.API},l.data("cycle.opts",s),l.data("cycle.API",s.API),s.API.trigger("cycle-bootstrap",[s,s.API]),s.API.addInitialSlides(),s.API.preInitSlideshow(),s.slides.length&&s.API.initSlideshow()}})):(n={s:this.selector,c:this.context},e.fn.cycle.log("requeuing slideshow (dom not ready)"),e((function(){e(n.s,n.c).cycle(i)})),this)},e.fn.cycle.API={opts:function(){return this._container.data("cycle.opts")},addInitialSlides:function(){var t=this.opts(),i=t.slides;t.slideCount=0,t.slides=e(),i=i.jquery?i:t.container.find(i),t.random&&i.sort((function(){return Math.random()-.5})),t.API.add(i)},preInitSlideshow:function(){var t=this.opts();t.API.trigger("cycle-pre-initialize",[t]);var i=e.fn.cycle.transitions[t.fx];i&&"function"==typeof i.preInit&&i.preInit(t),t._preInitialized=!0},postInitSlideshow:function(){var t=this.opts();t.API.trigger("cycle-post-initialize",[t]);var i=e.fn.cycle.transitions[t.fx];i&&"function"==typeof i.postInit&&i.postInit(t)},initSlideshow:function(){var t,i=this.opts(),n=i.container;i.API.calcFirstSlide(),"static"==i.container.css("position")&&i.container.css("position","relative"),e(i.slides[i.currSlide]).css({opacity:1,display:"block",visibility:"visible"}),i.API.stackSlides(i.slides[i.currSlide],i.slides[i.nextSlide],!i.reverse),i.pauseOnHover&&(!0!==i.pauseOnHover&&(n=e(i.pauseOnHover)),n.on("mouseenter",(function(){i.API.pause(!0)})),n.on("mouseleave",(function(){i.API.resume(!0)}))),i.timeout&&(t=i.API.getSlideOpts(i.currSlide),i.API.queueTransition(t,t.timeout+i.delay)),i._initialized=!0,i.API.updateView(!0),i.API.trigger("cycle-initialized",[i]),i.API.postInitSlideshow()},pause:function(t){var i=this.opts(),n=i.API.getSlideOpts(),s=i.hoverPaused||i.paused;t?i.hoverPaused=!0:i.paused=!0,s||(i.container.addClass("cycle-paused"),i.API.trigger("cycle-paused",[i]).log("cycle-paused"),n.timeout&&(clearTimeout(i.timeoutId),i.timeoutId=0,i._remainingTimeout-=e.now()-i._lastQueue,(i._remainingTimeout<0||isNaN(i._remainingTimeout))&&(i._remainingTimeout=void 0)))},resume:function(e){var t=this.opts(),i=!t.hoverPaused&&!t.paused;e?t.hoverPaused=!1:t.paused=!1,i||(t.container.removeClass("cycle-paused"),0===t.slides.filter(":animated").length&&t.API.queueTransition(t.API.getSlideOpts(),t._remainingTimeout),t.API.trigger("cycle-resumed",[t,t._remainingTimeout]).log("cycle-resumed"))},add:function(t,i){var n,s=this.opts(),o=s.slideCount;"string"==typeof t&&(t=t.trim()),e(t).each((function(t){var n,o=e(this);i?s.container.prepend(o):s.container.append(o),s.slideCount++,n=s.API.buildSlideOpts(o),s.slides=i?e(o).add(s.slides):s.slides.add(o),s.API.initSlide(n,o,--s._maxZ),o.data("cycle.opts",n),s.API.trigger("cycle-slide-added",[s,n,o])})),s.API.updateView(!0),s._preInitialized&&o<2&&s.slideCount>=1&&(s._initialized?s.timeout&&(n=s.slides.length,s.nextSlide=s.reverse?n-1:1,s.timeoutId||s.API.queueTransition(s)):s.API.initSlideshow())},calcFirstSlide:function(){var e,t=this.opts();((e=parseInt(t.startingSlide||0,10))>=t.slides.length||e<0)&&(e=0),t.currSlide=e,t.reverse?(t.nextSlide=e-1,t.nextSlide<0&&(t.nextSlide=t.slides.length-1)):(t.nextSlide=e+1,t.nextSlide==t.slides.length&&(t.nextSlide=0))},calcNextSlide:function(){var e,t=this.opts();t.reverse?(e=t.nextSlide-1<0,t.nextSlide=e?t.slideCount-1:t.nextSlide-1,t.currSlide=e?0:t.nextSlide+1):(e=t.nextSlide+1==t.slides.length,t.nextSlide=e?0:t.nextSlide+1,t.currSlide=e?t.slides.length-1:t.nextSlide-1)},calcTx:function(t,i){var n,s=t;return s._tempFx?n=e.fn.cycle.transitions[s._tempFx]:i&&s.manualFx&&(n=e.fn.cycle.transitions[s.manualFx]),n||(n=e.fn.cycle.transitions[s.fx]),s._tempFx=null,this.opts()._tempFx=null,n||(n=e.fn.cycle.transitions.fade,s.API.log('Transition "'+s.fx+'" not found. Using fade.')),n},prepareTx:function(e,t){var i,n,s,o,c,l=this.opts();l.slideCount<2?l.timeoutId=0:(!e||l.busy&&!l.manualTrump||(l.API.stopTransition(),l.busy=!1,clearTimeout(l.timeoutId),l.timeoutId=0),l.busy||(0!==l.timeoutId||e)&&(n=l.slides[l.currSlide],s=l.slides[l.nextSlide],o=l.API.getSlideOpts(l.nextSlide),c=l.API.calcTx(o,e),l._tx=c,e&&void 0!==o.manualSpeed&&(o.speed=o.manualSpeed),l.nextSlide!=l.currSlide&&(e||!l.paused&&!l.hoverPaused&&l.timeout)?(l.API.trigger("cycle-before",[o,n,s,t]),c.before&&c.before(o,n,s,t),i=function(){l.busy=!1,l.container.data("cycle.opts")&&(c.after&&c.after(o,n,s,t),l.API.trigger("cycle-after",[o,n,s,t]),l.API.queueTransition(o),l.API.updateView(!0))},l.busy=!0,c.transition?c.transition(o,n,s,t,i):l.API.doTransition(o,n,s,t,i),l.API.calcNextSlide(),l.API.updateView()):l.API.queueTransition(o)))},doTransition:function(t,i,n,s,o){var c=t,l=e(i),a=e(n),r=function(){a.animate(c.animIn||{opacity:1},c.speed,c.easeIn||c.easing,o)};a.css(c.cssBefore||{}),l.animate(c.animOut||{},c.speed,c.easeOut||c.easing,(function(){l.css(c.cssAfter||{}),c.sync||r()})),c.sync&&r()},queueTransition:function(t,i){var n=this.opts(),s=void 0!==i?i:t.timeout;return 0===n.nextSlide&&0==--n.loop?(n.API.log("terminating; loop=0"),n.timeout=0,s?setTimeout((function(){n.API.trigger("cycle-finished",[n])}),s):n.API.trigger("cycle-finished",[n]),void(n.nextSlide=n.currSlide)):void 0!==n.continueAuto&&(!1===n.continueAuto||"function"==typeof n.continueAuto&&!1===n.continueAuto())?(n.API.log("terminating automatic transitions"),n.timeout=0,void(n.timeoutId&&clearTimeout(n.timeoutId))):void(s&&(n._lastQueue=e.now(),void 0===i&&(n._remainingTimeout=t.timeout),n.paused||n.hoverPaused||(n.timeoutId=setTimeout((function(){n.API.prepareTx(!1,!n.reverse)}),s))))},stopTransition:function(){var e=this.opts();e.slides.filter(":animated").length&&(e.slides.stop(!1,!0),e.API.trigger("cycle-transition-stopped",[e])),e._tx&&e._tx.stopTransition&&e._tx.stopTransition(e)},advanceSlide:function(e){var t=this.opts();return clearTimeout(t.timeoutId),t.timeoutId=0,t.nextSlide=t.currSlide+e,t.nextSlide<0?t.nextSlide=t.slides.length-1:t.nextSlide>=t.slides.length&&(t.nextSlide=0),t.API.prepareTx(!0,e>=0),!1},buildSlideOpts:function(i){var n,s,o=this.opts(),c=i.data()||{};for(var l in c)c.hasOwnProperty(l)&&/^cycle[A-Z]+/.test(l)&&(n=c[l],s=l.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t),o.API.log("["+(o.slideCount-1)+"]",s+":",n,"("+typeof n+")"),c[s]=n);(c=e.extend({},e.fn.cycle.defaults,o,c)).slideNum=o.slideCount;try{delete c.API,delete c.slideCount,delete c.currSlide,delete c.nextSlide,delete c.slides}catch(e){}return c},getSlideOpts:function(t){var i=this.opts();void 0===t&&(t=i.currSlide);var n=i.slides[t],s=e(n).data("cycle.opts");return e.extend({},i,s)},initSlide:function(t,i,n){var s=this.opts();i.css(t.slideCss||{}),n>0&&i.css("zIndex",n),isNaN(t.speed)&&(t.speed=e.fx.speeds[t.speed]||e.fx.speeds._default),t.sync||(t.speed=t.speed/2),i.addClass(s.slideClass)},updateView:function(e,t,i){var n=this.opts();if(n._initialized){var s=n.API.getSlideOpts(),o=n.slides[n.currSlide];!e&&!0!==t&&(n.API.trigger("cycle-update-view-before",[n,s,o]),n.updateView<0)||(n.slideActiveClass&&n.slides.removeClass(n.slideActiveClass).eq(n.currSlide).addClass(n.slideActiveClass),e&&n.hideNonActive&&n.slides.filter(":not(."+n.slideActiveClass+")").css("visibility","hidden"),0===n.updateView&&setTimeout((function(){n.API.trigger("cycle-update-view",[n,s,o,e])}),s.speed/(n.sync?2:1)),0!==n.updateView&&n.API.trigger("cycle-update-view",[n,s,o,e]),e&&n.API.trigger("cycle-update-view-after",[n,s,o]))}},getComponent:function(t){var i=this.opts(),n=i[t];return"string"==typeof n?/^\s*[\>|\+|~]/.test(n)?i.container.find(n):e(n):n.jquery?n:e(n)},stackSlides:function(t,i,n){var s,o=this.opts();t||(t=o.slides[o.currSlide],i=o.slides[o.nextSlide],n=!o.reverse),e(t).css("zIndex",o.maxZ);var c=o.maxZ-2,l=o.slideCount;if(n){for(s=o.currSlide+1;s<l;s++)e(o.slides[s]).css("zIndex",c--);for(s=0;s<o.currSlide;s++)e(o.slides[s]).css("zIndex",c--)}else{for(s=o.currSlide-1;s>=0;s--)e(o.slides[s]).css("zIndex",c--);for(s=l-1;s>o.currSlide;s--)e(o.slides[s]).css("zIndex",c--)}e(i).css("zIndex",o.maxZ-1)},getSlideIndex:function(e){return this.opts().slides.index(e)}},e.fn.cycle.log=function(){window.console&&console.log&&console.log("[cycle2] "+Array.prototype.join.call(arguments," "))},e.fn.cycle.version=function(){return"Cycle2: 2.1.6"},e.fn.cycle.transitions={custom:{},none:{before:function(e,t,i,n){e.API.stackSlides(i,t,n),e.cssBefore={opacity:1,visibility:"visible",display:"block"}}},fade:{before:function(t,i,n,s){var o=t.API.getSlideOpts(t.nextSlide).slideCss||{};t.API.stackSlides(i,n,s),t.cssBefore=e.extend(o,{opacity:0,visibility:"visible",display:"block"}),t.animIn={opacity:1},t.animOut={opacity:0}}},fadeout:{before:function(t,i,n,s){var o=t.API.getSlideOpts(t.nextSlide).slideCss||{};t.API.stackSlides(i,n,s),t.cssBefore=e.extend(o,{opacity:1,visibility:"visible",display:"block"}),t.animOut={opacity:0}}},scrollHorz:{before:function(e,t,i,n){e.API.stackSlides(t,i,n);var s=e.container.css("overflow","hidden").width();e.cssBefore={left:n?s:-s,top:0,opacity:1,visibility:"visible",display:"block"},e.cssAfter={zIndex:e._maxZ-2,left:0},e.animIn={left:0},e.animOut={left:n?-s:s}}}},e.fn.cycle.defaults={allowWrap:!0,autoSelector:".cycle-slideshow[data-cycle-auto-init!=false]",delay:0,easing:null,fx:"fade",hideNonActive:!0,loop:0,manualFx:void 0,manualSpeed:void 0,manualTrump:!0,maxZ:100,pauseOnHover:!1,reverse:!1,slideActiveClass:"cycle-slide-active",slideClass:"cycle-slide",slideCss:{position:"absolute",top:0,left:0},slides:"> img",speed:500,startingSlide:0,sync:!0,timeout:4e3,updateView:0},e(document).ready((function(){e(e.fn.cycle.defaults.autoSelector).cycle()}))}(jQuery),
7
  /*! Cycle2 autoheight plugin; Copyright (c) M.Alsup, 2012; version: 20130913 */
8
+ function(e){"use strict";function t(t,i){var n,s,o,c=i.autoHeight;if("container"==c)s=e(i.slides[i.currSlide]).outerHeight(),i.container.height(s);else if(i._autoHeightRatio)i.container.height(i.container.width()/i._autoHeightRatio);else if("calc"===c||"number"==typeof c&&c>=0){if((o="calc"===c?function(t,i){var n=0,s=-1;return i.slides.each((function(t){var i=e(this).height();i>s&&(s=i,n=t)})),n}(0,i):c>=i.slides.length?0:c)==i._sentinelIndex)return;i._sentinelIndex=o,i._sentinel&&i._sentinel.remove(),(n=e(i.slides[o].cloneNode(!0))).removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel"),n.css({position:"static",visibility:"hidden",display:"block"}).prependTo(i.container).addClass("cycle-sentinel cycle-slide").removeClass("cycle-slide-active"),n.find("*").css("visibility","hidden"),i._sentinel=n}}function i(t,i,n,s,o){var c=e(s).outerHeight();i.container.animate({height:c},i.autoHeightSpeed,i.autoHeightEasing)}function n(s,o){o._autoHeightOnResize&&(e(window).off("resize orientationchange",o._autoHeightOnResize),o._autoHeightOnResize=null),o.container.off("cycle-slide-added cycle-slide-removed",t),o.container.off("cycle-destroyed",n),o.container.off("cycle-before",i),o._sentinel&&(o._sentinel.remove(),o._sentinel=null)}e.extend(e.fn.cycle.defaults,{autoHeight:0,autoHeightSpeed:250,autoHeightEasing:null}),e(document).on("cycle-initialized",(function(s,o){var c,l=o.autoHeight,a=typeof l,r=null;function d(){t(s,o)}"string"!==a&&"number"!==a||(o.container.on("cycle-slide-added cycle-slide-removed",t),o.container.on("cycle-destroyed",n),"container"==l?o.container.on("cycle-before",i):"string"===a&&/\d+\:\d+/.test(l)&&(c=(c=l.match(/(\d+)\:(\d+)/))[1]/c[2],o._autoHeightRatio=c),"number"!==a&&(o._autoHeightOnResize=function(){clearTimeout(r),r=setTimeout(d,50)},e(window).on("resize orientationchange",o._autoHeightOnResize)),setTimeout(d,30))}))}(jQuery),
9
  /*! caption plugin for Cycle2; version: 20130306 */
10
  function(e){"use strict";e.extend(e.fn.cycle.defaults,{caption:"> .cycle-caption",captionTemplate:"{{slideNum}} / {{slideCount}}",overlay:"> .cycle-overlay",overlayTemplate:"<div>{{title}}</div><div>{{desc}}</div>",captionModule:"caption"}),e(document).on("cycle-update-view",(function(t,i,n,s){"caption"===i.captionModule&&e.each(["caption","overlay"],(function(){var e=n[this+"Template"],t=i.API.getComponent(this);t.length&&e?(t.html(i.API.tmpl(e,n,i,s)),t.show()):t.hide()}))})),e(document).on("cycle-destroyed",(function(t,i){e.each(["caption","overlay"],(function(){var e=i[this+"Template"];i[this]&&e&&i.API.getComponent("caption").empty()}))}))}(jQuery),
11
  /*! command plugin for Cycle2; version: 20140415 */
12
+ function(e){"use strict";var t=e.fn.cycle;e.fn.cycle=function(i){var n,s,o,c=e.makeArray(arguments);return"number"==typeof i?this.cycle("goto",i):"string"==typeof i?this.each((function(){var l;if(n=i,void 0!==(o=e(this).data("cycle.opts")))return n="goto"==n?"jump":n,"function"==typeof(s=o.API[n])?((l=e.makeArray(c)).shift(),s.apply(o.API,l)):void t.log("unknown command: ",n);t.log('slideshow must be initialized before sending commands; "'+n+'" ignored')})):t.apply(this,arguments)},e.extend(e.fn.cycle,t),e.extend(t.API,{next:function(){var e=this.opts();if(!e.busy||e.manualTrump){var t=e.reverse?-1:1;!1===e.allowWrap&&e.currSlide+t>=e.slideCount||(e.API.advanceSlide(t),e.API.trigger("cycle-next",[e]).log("cycle-next"))}},prev:function(){var e=this.opts();if(!e.busy||e.manualTrump){var t=e.reverse?1:-1;!1===e.allowWrap&&e.currSlide+t<0||(e.API.advanceSlide(t),e.API.trigger("cycle-prev",[e]).log("cycle-prev"))}},destroy:function(){this.stop();var t=this.opts(),i="function"==typeof e._data?e._data:e.noop;clearTimeout(t.timeoutId),t.timeoutId=0,t.API.stop(),t.API.trigger("cycle-destroyed",[t]).log("cycle-destroyed"),t.container.removeData(),i(t.container[0],"parsedAttrs",!1),t.retainStylesOnDestroy||(t.container.removeAttr("style"),t.slides.removeAttr("style"),t.slides.removeClass(t.slideActiveClass)),t.slides.each((function(){var n=e(this);n.removeData(),n.removeClass(t.slideClass),i(this,"parsedAttrs",!1)}))},jump:function(e,t){var i,n=this.opts();if(!n.busy||n.manualTrump){var s=parseInt(e,10);isNaN(s)||s<0||s>=n.slides.length?n.API.log("goto: invalid slide index: "+s):s!=n.currSlide?(n.nextSlide=s,clearTimeout(n.timeoutId),n.timeoutId=0,n.API.log("goto: ",s," (zero-index)"),i=n.currSlide<n.nextSlide,n._tempFx=t,n.API.prepareTx(!0,i)):n.API.log("goto: skipping, already on slide",s)}},stop:function(){var t=this.opts(),i=t.container;clearTimeout(t.timeoutId),t.timeoutId=0,t.API.stopTransition(),t.pauseOnHover&&(!0!==t.pauseOnHover&&(i=e(t.pauseOnHover)),i.off("mouseenter mouseleave")),t.API.trigger("cycle-stopped",[t]).log("cycle-stopped")},reinit:function(){var e=this.opts();e.API.destroy(),e.container.cycle()},remove:function(t){for(var i,n,s=this.opts(),o=[],c=1,l=0;l<s.slides.length;l++)i=s.slides[l],l==t?n=i:(o.push(i),e(i).data("cycle.opts").slideNum=c,c++);n&&(s.slides=e(o),s.slideCount--,e(n).remove(),t==s.currSlide?s.API.advanceSlide(1):t<s.currSlide?s.currSlide--:s.currSlide++,s.API.trigger("cycle-slide-removed",[s,t,n]).log("cycle-slide-removed"),s.API.updateView())}}),e(document).on("click.cycle","[data-cycle-cmd]",(function(t){t.preventDefault();var i=e(this),n=i.data("cycle-cmd"),s=i.data("cycle-context")||".cycle-slideshow";e(s).cycle(n,i.data("cycle-arg"))}))}(jQuery),
13
  /*! hash plugin for Cycle2; version: 20130905 */
14
  function(e){"use strict";function t(t,i){var n;t._hashFence?t._hashFence=!1:(n=window.location.hash.substring(1),t.slides.each((function(s){if(e(this).data("cycle-hash")==n){if(!0===i)t.startingSlide=s;else{var o=t.currSlide<s;t.nextSlide=s,t.API.prepareTx(!0,o)}return!1}})))}e(document).on("cycle-pre-initialize",(function(i,n){t(n,!0),n._onHashChange=function(){t(n,!1)},e(window).on("hashchange",n._onHashChange)})),e(document).on("cycle-update-view",(function(e,t,i){i.hash&&"#"+i.hash!=window.location.hash&&(t._hashFence=!0,window.location.hash=i.hash)})),e(document).on("cycle-destroyed",(function(t,i){i._onHashChange&&e(window).off("hashchange",i._onHashChange)}))}(jQuery),
15
  /*! loader plugin for Cycle2; version: 20131121 */
16
+ function(e){"use strict";e.extend(e.fn.cycle.defaults,{loader:!1}),e(document).on("cycle-bootstrap",(function(t,i){var n;i.loader&&(n=i.API.add,i.API.add=function(t,s){var o=[];if("string"==typeof t)t=t.trim();else if("array"==typeof t)for(var c=0;c<t.length;c++)t[c]=e(t[c])[0];var l=(t=e(t)).length;if(!l)return;t.css("visibility","hidden").appendTo("body").each((function(t){var c=0,r=e(this),d=r.is("img")?r:r.find("img");if(r.data("index",t),!(d=d.filter(":not(.cycle-loader-ignore)").filter(':not([src=""])')).length)return--l,void o.push(r);function u(){0==--c&&(--l,function(t){var c;"wait"==i.loader?(o.push(t),0===l&&(o.sort(a),n.apply(i.API,[o,s]),i.container.removeClass("cycle-loading"))):(c=e(i.slides[i.currSlide]),n.apply(i.API,[t,s]),c.show(),i.container.removeClass("cycle-loading"))}(r))}c=d.length,d.each((function(){this.complete?u():e(this).on("load",(function(){u()})).on("error",(function(){0==--c&&(i.API.log("slide skipped; img not loaded:",this.src),0==--l&&"wait"==i.loader&&n.apply(i.API,[o,s]))}))}))})),l&&i.container.addClass("cycle-loading");function a(e,t){return e.data("index")-t.data("index")}})}))}(jQuery),
17
  /*! pager plugin for Cycle2; version: 20140415 */
18
  function(e){"use strict";function t(t,i,n){var s;t.API.getComponent("pager").each((function(){var o=e(this);if(i.pagerTemplate){var c=t.API.tmpl(i.pagerTemplate,i,t,n[0]);s=e(c).appendTo(o)}else s=o.children().eq(t.slideCount-1);s.on(t.pagerEvent,(function(e){t.pagerEventBubble||e.preventDefault(),t.API.page(o,e.currentTarget)}))}))}function i(e,t){var i=this.opts();if(!i.busy||i.manualTrump){var n=e.children().index(t),s=i.currSlide<n;i.currSlide!=n&&(i.nextSlide=n,i._tempFx=i.pagerFx,i.API.prepareTx(!0,s),i.API.trigger("cycle-pager-activated",[i,e,t]))}}e.extend(e.fn.cycle.defaults,{pager:"> .cycle-pager",pagerActiveClass:"cycle-pager-active",pagerEvent:"click.cycle",pagerEventBubble:void 0,pagerTemplate:"<span>&bull;</span>"}),e(document).on("cycle-bootstrap",(function(e,i,n){n.buildPagerLink=t})),e(document).on("cycle-slide-added",(function(e,t,n,s){t.pager&&(t.API.buildPagerLink(t,n,s),t.API.page=i)})),e(document).on("cycle-slide-removed",(function(t,i,n,s){i.pager&&i.API.getComponent("pager").each((function(){var t=e(this);e(t.children()[n]).remove()}))})),e(document).on("cycle-update-view",(function(t,i,n){i.pager&&i.API.getComponent("pager").each((function(){e(this).children().removeClass(i.pagerActiveClass).eq(i.currSlide).addClass(i.pagerActiveClass)}))})),e(document).on("cycle-destroyed",(function(e,t){var i=t.API.getComponent("pager");i&&(i.children().off(t.pagerEvent),t.pagerTemplate&&i.empty())}))}(jQuery),
19
  /*! prevnext plugin for Cycle2; version: 20140408 */
20
  function(e){"use strict";e.extend(e.fn.cycle.defaults,{next:"> .cycle-next",nextEvent:"click.cycle",disabledClass:"disabled",prev:"> .cycle-prev",prevEvent:"click.cycle",swipe:!1}),e(document).on("cycle-initialized",(function(e,t){if(t.API.getComponent("next").on(t.nextEvent,(function(e){e.preventDefault(),t.API.next()})),t.API.getComponent("prev").on(t.prevEvent,(function(e){e.preventDefault(),t.API.prev()})),t.swipe){var i=t.swipeVert?"swipeUp.cycle":"swipeLeft.cycle swipeleft.cycle",n=t.swipeVert?"swipeDown.cycle":"swipeRight.cycle swiperight.cycle";t.container.on(i,(function(e){t._tempFx=t.swipeFx,t.API.next()})),t.container.on(n,(function(){t._tempFx=t.swipeFx,t.API.prev()}))}})),e(document).on("cycle-update-view",(function(e,t,i,n){if(!t.allowWrap){var s=t.disabledClass,o=t.API.getComponent("next"),c=t.API.getComponent("prev"),l=t._prevBoundry||0,a=void 0!==t._nextBoundry?t._nextBoundry:t.slideCount-1;t.currSlide==a?o.addClass(s).prop("disabled",!0):o.removeClass(s).prop("disabled",!1),t.currSlide===l?c.addClass(s).prop("disabled",!0):c.removeClass(s).prop("disabled",!1)}})),e(document).on("cycle-destroyed",(function(e,t){t.API.getComponent("prev").off(t.nextEvent),t.API.getComponent("next").off(t.prevEvent),t.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle")}))}(jQuery),
21
  /*! progressive loader plugin for Cycle2; version: 20130315 */
22
+ function(e){"use strict";e.extend(e.fn.cycle.defaults,{progressive:!1}),e(document).on("cycle-pre-initialize",(function(t,i){if(i.progressive){var n,s,o=i.API,c=o.next,l=o.prev,a=o.prepareTx,r=typeof i.progressive;if("array"==r)n=i.progressive;else if("function"==typeof i.progressive)n=i.progressive(i);else if("string"==r){if(s=e(i.progressive),!(n=s.html().trim()))return;if(/^(\[)/.test(n))try{n=e.parseJSON(n)}catch(e){return void o.log("error parsing progressive slides",e)}else(n=n.split(new RegExp(s.data("cycle-split")||"\n")))[n.length-1]||n.pop()}a&&(o.prepareTx=function(e,t){var s,o;e||0===n.length?a.apply(i.API,[e,t]):t&&i.currSlide==i.slideCount-1?(o=n[0],n=n.slice(1),i.container.one("cycle-slide-added",(function(e,t){setTimeout((function(){t.API.advanceSlide(1)}),50)})),i.API.add(o)):t||0!==i.currSlide?a.apply(i.API,[e,t]):(s=n.length-1,o=n[s],n=n.slice(0,s),i.container.one("cycle-slide-added",(function(e,t){setTimeout((function(){t.currSlide=1,t.API.advanceSlide(-1)}),50)})),i.API.add(o,!0))}),c&&(o.next=function(){var e=this.opts();if(n.length&&e.currSlide==e.slideCount-1){var t=n[0];n=n.slice(1),e.container.one("cycle-slide-added",(function(e,t){c.apply(t.API),t.container.removeClass("cycle-loading")})),e.container.addClass("cycle-loading"),e.API.add(t)}else c.apply(e.API)}),l&&(o.prev=function(){var e=this.opts();if(n.length&&0===e.currSlide){var t=n.length-1,i=n[t];n=n.slice(0,t),e.container.one("cycle-slide-added",(function(e,t){t.currSlide=1,t.API.advanceSlide(-1),t.container.removeClass("cycle-loading")})),e.container.addClass("cycle-loading"),e.API.add(i,!0)}else l.apply(e.API)})}}))}(jQuery),
23
  /*! tmpl plugin for Cycle2; version: 20121227 */
24
+ function(e){"use strict";e.extend(e.fn.cycle.defaults,{tmplRegex:"{{((.)?.*?)}}"}),e.extend(e.fn.cycle.API,{tmpl:function(t,i){var n=new RegExp(i.tmplRegex||e.fn.cycle.defaults.tmplRegex,"g"),s=e.makeArray(arguments);return s.shift(),t.replace(n,(function(e,t){var i,n,o,c,l=t.split(".");for(i=0;i<s.length;i++)if(o=s[i]){if(l.length>1)for(c=o,n=0;n<l.length;n++)o=c,c=c[l[n]]||t;else c=o[t];if("function"==typeof c)return c.apply(o,s);if(null!=c&&c!=t)return c}return t}))}})}(jQuery);
js/lib/slick.js CHANGED
@@ -52,7 +52,7 @@
52
  centerPadding: '50px',
53
  cssEase: 'ease',
54
  customPaging: function(slider, i) {
55
- return $('<button type="button" />').text(i + 1);
56
  },
57
  dots: false,
58
  dotsClass: 'slick-dots',
@@ -488,10 +488,10 @@
488
 
489
  _.$slider.addClass('slick-dotted');
490
 
491
- dot = $('<ul />').addClass(_.options.dotsClass);
492
 
493
  for (i = 0; i <= _.getDotCount(); i += 1) {
494
- dot.append($('<li />').append(_.options.customPaging.call(this, _, i)));
495
  }
496
 
497
  _.$dots = dot.appendTo(_.options.appendDots);
@@ -522,11 +522,11 @@
522
  _.$slider.addClass('slick-slider');
523
 
524
  _.$slideTrack = (_.slideCount === 0) ?
525
- $('<div class="slick-track"/>').appendTo(_.$slider) :
526
- _.$slides.wrapAll('<div class="slick-track"/>').parent();
527
 
528
  _.$list = _.$slideTrack.wrap(
529
- '<div class="slick-list"/>').parent();
530
  _.$slideTrack.css('opacity', 0);
531
 
532
  if (_.options.centerMode === true || _.options.swipeToSlide === true) {
@@ -1861,7 +1861,7 @@
1861
  var _ = this, breakpoint, currentBreakpoint, l,
1862
  responsiveSettings = _.options.responsive || null;
1863
 
1864
- if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) {
1865
 
1866
  _.respondTo = _.options.respondTo || 'window';
1867
 
@@ -2125,19 +2125,19 @@
2125
 
2126
  var _ = this, l, item, option, value, refresh = false, type;
2127
 
2128
- if( $.type( arguments[0] ) === 'object' ) {
2129
 
2130
  option = arguments[0];
2131
  refresh = arguments[1];
2132
  type = 'multiple';
2133
 
2134
- } else if ( $.type( arguments[0] ) === 'string' ) {
2135
 
2136
  option = arguments[0];
2137
  value = arguments[1];
2138
  refresh = arguments[2];
2139
 
2140
- if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) {
2141
 
2142
  type = 'responsive';
2143
 
@@ -2167,7 +2167,7 @@
2167
 
2168
  for ( item in value ) {
2169
 
2170
- if( $.type( _.options.responsive ) !== 'array' ) {
2171
 
2172
  _.options.responsive = [ value[item] ];
2173
 
52
  centerPadding: '50px',
53
  cssEase: 'ease',
54
  customPaging: function(slider, i) {
55
+ return $( '<button type="button"></button>' ).text(i + 1);
56
  },
57
  dots: false,
58
  dotsClass: 'slick-dots',
488
 
489
  _.$slider.addClass('slick-dotted');
490
 
491
+ dot = $( '<ul></ul>' ).addClass( _.options.dotsClass );
492
 
493
  for (i = 0; i <= _.getDotCount(); i += 1) {
494
+ dot.append( $( '<li></li>' ).append( _.options.customPaging.call( this, _, i ) ) );
495
  }
496
 
497
  _.$dots = dot.appendTo(_.options.appendDots);
522
  _.$slider.addClass('slick-slider');
523
 
524
  _.$slideTrack = (_.slideCount === 0) ?
525
+ $( '<div class="slick-track"></div>' ).appendTo( _.$slider ) :
526
+ _.$slides.wrapAll( '<div class="slick-track"></div>' ).parent();
527
 
528
  _.$list = _.$slideTrack.wrap(
529
+ '<div class="slick-list"></div>' ).parent();
530
  _.$slideTrack.css('opacity', 0);
531
 
532
  if (_.options.centerMode === true || _.options.swipeToSlide === true) {
1861
  var _ = this, breakpoint, currentBreakpoint, l,
1862
  responsiveSettings = _.options.responsive || null;
1863
 
1864
+ if ( typeof responsiveSettings === 'array' && responsiveSettings.length ) {
1865
 
1866
  _.respondTo = _.options.respondTo || 'window';
1867
 
2125
 
2126
  var _ = this, l, item, option, value, refresh = false, type;
2127
 
2128
+ if( typeof arguments[0] === 'object' ) {
2129
 
2130
  option = arguments[0];
2131
  refresh = arguments[1];
2132
  type = 'multiple';
2133
 
2134
+ } else if ( typeof arguments[0] === 'string' ) {
2135
 
2136
  option = arguments[0];
2137
  value = arguments[1];
2138
  refresh = arguments[2];
2139
 
2140
+ if ( arguments[0] === 'responsive' && typeof arguments[1] === 'array' ) {
2141
 
2142
  type = 'responsive';
2143
 
2167
 
2168
  for ( item in value ) {
2169
 
2170
+ if( typeof _.options.responsive !== 'array' ) {
2171
 
2172
  _.options.responsive = [ value[item] ];
2173
 
js/lib/slick.min.js CHANGED
@@ -1 +1 @@
1
- !function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}((function(i){"use strict";var e,t=window.Slick||{};e=0,(t=function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(t),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(t).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=e++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},t.prototype.addSlide=t.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):!0===o?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each((function(e,t){i(t).attr("data-slick-index",e)})),s.$slidesCache=s.$slides,s.reinit()},t.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},t.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),!0===s.options.rtl&&!1===s.options.vertical&&(e=-e),!1===s.transformsEnabled?!1===s.options.vertical?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):!1===s.cssTransitions?(!0===s.options.rtl&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),!1===s.options.vertical?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),!1===s.options.vertical?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout((function(){s.disableTransition(),t.call()}),s.options.speed))},t.prototype.getNavTarget=function(){var e=this.options.asNavFor;return e&&null!==e&&(e=i(e).not(this.$slider)),e},t.prototype.asNavFor=function(e){var t=this.getNavTarget();null!==t&&"object"==typeof t&&t.each((function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)}))},t.prototype.applyTransition=function(i){var e=this,t={};!1===e.options.fade?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},t.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},t.prototype.autoPlayClear=function(){this.autoPlayTimer&&clearInterval(this.autoPlayTimer)},t.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(e))},t.prototype.buildArrows=function(){var e=this;!0===e.options.arrows&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),!0!==e.options.infinite&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},t.prototype.buildDots=function(){var e,t,o=this;if(!0===o.options.dots&&o.slideCount>o.options.slidesToShow){for(o.$slider.addClass("slick-dotted"),t=i("<ul />").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li />").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active")}},t.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each((function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")})),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"/>').parent(),e.$list=e.$slideTrack.wrap('<div class="slick-list"/>').parent(),e.$slideTrack.css("opacity",0),!0!==e.options.centerMode&&!0!==e.options.swipeToSlide||(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),!0===e.options.draggable&&e.$list.addClass("draggable")},t.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.options.rows>0){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement("div");for(e=0;e<l.options.rows;e++){var a=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},t.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if("window"===r.respondTo?n=a:"slider"===r.respondTo?n=d:"min"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){for(o in s=null,r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(!1===r.originalSettings.mobileFirst?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||!1===l||r.$slider.trigger("breakpoint",[r,l])}},t.prototype.changeSlide=function(e,t){var o,s,n=this,r=i(e.currentTarget);switch(r.is("a")&&e.preventDefault(),r.is("li")||(r=r.closest("li")),o=n.slideCount%n.options.slidesToScroll!=0?0:(n.slideCount-n.currentSlide)%n.options.slidesToScroll,e.data.message){case"previous":s=0===o?n.options.slidesToScroll:n.options.slidesToShow-o,n.slideCount>n.options.slidesToShow&&n.slideHandler(n.currentSlide-s,!1,t);break;case"next":s=0===o?n.options.slidesToScroll:o,n.slideCount>n.options.slidesToShow&&n.slideHandler(n.currentSlide+s,!1,t);break;case"index":var l=0===e.data.index?0:e.data.index||r.index()*n.options.slidesToScroll;n.slideHandler(n.checkNavigable(l),!1,t),r.children().trigger("focus");break;default:return}},t.prototype.checkNavigable=function(i){var e,t;if(t=0,i>(e=this.getNavigableIndexes())[e.length-1])i=e[e.length-1];else for(var o in e){if(i<e[o]){i=t;break}t=e[o]}return i},t.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),!0===e.options.accessibility&&e.$dots.off("keydown.slick",e.keyHandler)),e.$slider.off("focus.slick blur.slick"),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow&&e.$prevArrow.off("keydown.slick",e.keyHandler),e.$nextArrow&&e.$nextArrow.off("keydown.slick",e.keyHandler))),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),!0===e.options.accessibility&&e.$list.off("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition)},t.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},t.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>0&&((i=e.$slides.children().children()).removeAttr("style"),e.$slider.empty().append(i))},t.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},t.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each((function(){i(this).attr("style",i(this).data("originalStyling"))})),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},t.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},t.prototype.fadeSlide=function(i,e){var t=this;!1===t.cssTransitions?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout((function(){t.disableTransition(i),e.call()}),t.options.speed))},t.prototype.fadeSlideOut=function(i){var e=this;!1===e.cssTransitions?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},t.prototype.filterSlides=t.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},t.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",(function(t){t.stopImmediatePropagation();var o=i(this);setTimeout((function(){e.options.pauseOnFocus&&(e.focussed=o.is(":focus"),e.autoPlay())}),0)}))},t.prototype.getCurrent=t.prototype.slickCurrentSlide=function(){return this.currentSlide},t.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(!0===i.options.infinite)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(!0===i.options.centerMode)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},t.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=!1===n.options.vertical?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,!0===n.options.variableWidth&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,!0===n.options.centerMode&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,e+=(n.$list.width()-o.outerWidth())/2)),e},t.prototype.getOption=t.prototype.slickGetOption=function(i){return this.options[i]},t.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(!1===e.options.infinite?i=e.slideCount:(t=-1*e.options.slidesToScroll,o=-1*e.options.slidesToScroll,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},t.prototype.getSlick=function(){return this},t.prototype.getSlideCount=function(){var e,t,o=this;return t=!0===o.options.centerMode?o.slideWidth*Math.floor(o.options.slidesToShow/2):0,!0===o.options.swipeToSlide?(o.$slideTrack.find(".slick-slide").each((function(s,n){if(n.offsetLeft-t+i(n).outerWidth()/2>-1*o.swipeLeft)return e=n,!1})),Math.abs(i(e).attr("data-slick-index")-o.currentSlide)||1):o.options.slidesToScroll},t.prototype.goTo=t.prototype.slickGoTo=function(i,e){this.changeSlide({data:{message:"index",index:parseInt(i)}},e)},t.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),!0===t.options.accessibility&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},t.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter((function(i){return i>=0&&i<e.slideCount}));e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(".slick-cloned")).each((function(t){var s=o.indexOf(t);if(i(this).attr({role:"tabpanel",id:"slick-slide"+e.instanceUid+t,tabindex:-1}),-1!==s){var n="slick-slide-control"+e.instanceUid+s;i("#"+n).length&&i(this).attr({"aria-describedby":n})}})),e.$dots.attr("role","tablist").find("li").each((function(s){var n=o[s];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+e.instanceUid+s,"aria-controls":"slick-slide"+e.instanceUid+n,"aria-label":s+1+" of "+t,"aria-selected":null,tabindex:"-1"})})).eq(e.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.options.focusOnChange?e.$slides.eq(s).attr({tabindex:"0"}):e.$slides.eq(s).removeAttr("tabindex");e.activateADA()},t.prototype.initArrowEvents=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide),!0===i.options.accessibility&&(i.$prevArrow.on("keydown.slick",i.keyHandler),i.$nextArrow.on("keydown.slick",i.keyHandler)))},t.prototype.initDotEvents=function(){var e=this;!0===e.options.dots&&e.slideCount>e.options.slidesToShow&&(i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),!0===e.options.accessibility&&e.$dots.on("keydown.slick",e.keyHandler)),!0===e.options.dots&&!0===e.options.pauseOnDotsHover&&e.slideCount>e.options.slidesToShow&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},t.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},t.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"},e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),!0===e.options.accessibility&&e.$list.on("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(e.setPosition)},t.prototype.initUI=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},t.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===e.options.accessibility?e.changeSlide({data:{message:!0===e.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===e.options.accessibility&&e.changeSlide({data:{message:!0===e.options.rtl?"previous":"next"}}))},t.prototype.lazyLoad=function(){var e,t,o,s=this;function n(e){i("img[data-lazy]",e).each((function(){var e=i(this),t=i(this).attr("data-lazy"),o=i(this).attr("data-srcset"),n=i(this).attr("data-sizes")||s.$slider.attr("data-sizes"),r=document.createElement("img");r.onload=function(){e.animate({opacity:0},100,(function(){o&&(e.attr("srcset",o),n&&e.attr("sizes",n)),e.attr("src",t).animate({opacity:1},200,(function(){e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")})),s.$slider.trigger("lazyLoaded",[s,e,t])}))},r.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),s.$slider.trigger("lazyLoadError",[s,e,t])},r.src=t}))}if(!0===s.options.centerMode?!0===s.options.infinite?o=(t=s.currentSlide+(s.options.slidesToShow/2+1))+s.options.slidesToShow+2:(t=Math.max(0,s.currentSlide-(s.options.slidesToShow/2+1)),o=s.options.slidesToShow/2+1+2+s.currentSlide):(t=s.options.infinite?s.options.slidesToShow+s.currentSlide:s.currentSlide,o=Math.ceil(t+s.options.slidesToShow),!0===s.options.fade&&(t>0&&t--,o<=s.slideCount&&o++)),e=s.$slider.find(".slick-slide").slice(t,o),"anticipated"===s.options.lazyLoad)for(var r=t-1,l=o,d=s.$slider.find(".slick-slide"),a=0;a<s.options.slidesToScroll;a++)r<0&&(r=s.slideCount-1),e=(e=e.add(d.eq(r))).add(d.eq(l)),r--,l++;n(e),s.slideCount<=s.options.slidesToShow?n(s.$slider.find(".slick-slide")):s.currentSlide>=s.slideCount-s.options.slidesToShow?n(s.$slider.find(".slick-cloned").slice(0,s.options.slidesToShow)):0===s.currentSlide&&n(s.$slider.find(".slick-cloned").slice(-1*s.options.slidesToShow))},t.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},t.prototype.next=t.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},t.prototype.orientationChange=function(){this.checkResponsive(),this.setPosition()},t.prototype.pause=t.prototype.slickPause=function(){this.autoPlayClear(),this.paused=!0},t.prototype.play=t.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},t.prototype.postSlide=function(e){var t=this;t.unslicked||(t.$slider.trigger("afterChange",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),!0===t.options.accessibility&&(t.initADA(),t.options.focusOnChange&&i(t.$slides.get(t.currentSlide)).attr("tabindex",0).focus()))},t.prototype.prev=t.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},t.prototype.preventDefault=function(i){i.preventDefault()},t.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i("img[data-lazy]",l.$slider);d.length?(t=d.first(),o=t.attr("data-lazy"),s=t.attr("data-srcset"),n=t.attr("data-sizes")||l.$slider.attr("data-sizes"),(r=document.createElement("img")).onload=function(){s&&(t.attr("srcset",s),n&&t.attr("sizes",n)),t.attr("src",o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===l.options.adaptiveHeight&&l.setPosition(),l.$slider.trigger("lazyLoaded",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout((function(){l.progressiveLazyLoad(e+1)}),500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),l.$slider.trigger("lazyLoadError",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger("allImagesLoaded",[l])},t.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},t.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if("array"===i.type(n)&&n.length){for(e in s.respondTo=s.options.respondTo||"window",n)if(o=s.breakpoints.length-1,n.hasOwnProperty(e)){for(t=n[e].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort((function(i,e){return s.options.mobileFirst?i-e:e-i}))}},t.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},t.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout((function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()}),50))},t.prototype.removeSlide=t.prototype.slickRemove=function(i,e,t){var o=this;if(i="boolean"==typeof i?!0===(e=i)?0:o.slideCount-1:!0===e?--i:i,o.slideCount<1||i<0||i>o.slideCount-1)return!1;o.unload(),!0===t?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,o.reinit()},t.prototype.setCSS=function(i){var e,t,o=this,s={};!0===o.options.rtl&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,!1===o.transformsEnabled?o.$slideTrack.css(s):(s={},!1===o.cssTransitions?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},t.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},t.prototype.setFade=function(){var e,t=this;t.$slides.each((function(o,s){e=t.slideWidth*o*-1,!0===t.options.rtl?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})})),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},t.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},t.prototype.setOption=t.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,(function(i,e){r.options[i]=e}));else if("responsive"===n)for(t in s)if("array"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},t.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),!1===i.options.fade?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},t.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},t.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),!0===n.options.centerMode){var r=n.options.slidesToShow%2==0?1:0;e=Math.floor(n.options.slidesToShow/2),!0===n.options.infinite&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=!0===n.options.infinite?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},t.prototype.setupInfinite=function(){var e,t,o,s=this;if(!0===s.options.fade&&(s.options.centerMode=!1),!0===s.options.infinite&&!1===s.options.fade&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=!0===s.options.centerMode?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each((function(){i(this).attr("id","")}))}},t.prototype.interrupt=function(i){i||this.autoPlay(),this.interrupted=i},t.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));s||(s=0),t.slideCount<=t.options.slidesToShow?t.slideHandler(s,!1,!0):t.slideHandler(s)},t.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d,a=this;if(e=e||!1,!(!0===a.animating&&!0===a.options.waitForAnimate||!0===a.options.fade&&a.currentSlide===i))if(!1===e&&a.asNavFor(i),o=i,l=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,!1===a.options.infinite&&!1===a.options.centerMode&&(i<0||i>a.getDotCount()*a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t&&a.slideCount>a.options.slidesToShow?a.animateSlide(r,(function(){a.postSlide(o)})):a.postSlide(o));else if(!1===a.options.infinite&&!0===a.options.centerMode&&(i<0||i>a.slideCount-a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t&&a.slideCount>a.options.slidesToShow?a.animateSlide(r,(function(){a.postSlide(o)})):a.postSlide(o));else{if(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!=0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!=0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(d=(d=a.getNavTarget()).slick("getSlick")).slideCount<=d.options.slidesToShow&&d.setSlideClasses(a.currentSlide),a.updateDots(),a.updateArrows(),!0===a.options.fade)return!0!==t?(a.fadeSlideOut(n),a.fadeSlide(s,(function(){a.postSlide(s)}))):a.postSlide(s),void a.animateHeight();!0!==t&&a.slideCount>a.options.slidesToShow?a.animateSlide(l,(function(){a.postSlide(s)})):a.postSlide(s)}},t.prototype.startLoad=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},t.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),(o=Math.round(180*t/Math.PI))<0&&(o=360-Math.abs(o)),o<=45&&o>=0?!1===s.options.rtl?"left":"right":o<=360&&o>=315?!1===s.options.rtl?"left":"right":o>=135&&o<=225?!1===s.options.rtl?"right":"left":!0===s.options.verticalSwiping?o>=35&&o<=135?"down":"up":"vertical"},t.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(!0===o.touchObject.edgeHit&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},t.prototype.swipeHandler=function(i){var e=this;if(!(!1===e.options.swipe||"ontouchend"in document&&!1===e.options.swipe||!1===e.options.draggable&&-1!==i.type.indexOf("mouse")))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,!0===e.options.verticalSwiping&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},t.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(!0===l.options.verticalSwiping&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(!1===l.options.rtl?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),!0===l.options.verticalSwiping&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,!1===l.options.infinite&&(0===l.currentSlide&&"right"===t||l.currentSlide>=l.getDotCount()&&"left"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),!1===l.options.vertical?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,!0===l.options.verticalSwiping&&(l.swipeLeft=e+o*s),!0!==l.options.fade&&!1!==l.options.touchMove&&(!0===l.animating?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},t.prototype.swipeStart=function(i){var e,t=this;if(t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow)return t.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,t.dragging=!0},t.prototype.unfilterSlides=t.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},t.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},t.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},t.prototype.updateArrows=function(){var i=this;Math.floor(i.options.slidesToShow/2),!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&!i.options.infinite&&(i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===i.currentSlide?(i.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-i.options.slidesToShow&&!1===i.options.centerMode?(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-1&&!0===i.options.centerMode&&(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},t.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").end(),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active"))},t.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,e,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if("object"==typeof s||void 0===s?o[i].slick=new t(o[i],s):e=o[i].slick[s].apply(o[i].slick,n),void 0!==e)return e;return o}}));
1
+ !function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}((function(i){"use strict";var e,t=window.Slick||{};e=0,(t=function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button"></button>').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(t),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(t).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=e++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},t.prototype.addSlide=t.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):!0===o?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each((function(e,t){i(t).attr("data-slick-index",e)})),s.$slidesCache=s.$slides,s.reinit()},t.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},t.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),!0===s.options.rtl&&!1===s.options.vertical&&(e=-e),!1===s.transformsEnabled?!1===s.options.vertical?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):!1===s.cssTransitions?(!0===s.options.rtl&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),!1===s.options.vertical?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),!1===s.options.vertical?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout((function(){s.disableTransition(),t.call()}),s.options.speed))},t.prototype.getNavTarget=function(){var e=this.options.asNavFor;return e&&null!==e&&(e=i(e).not(this.$slider)),e},t.prototype.asNavFor=function(e){var t=this.getNavTarget();null!==t&&"object"==typeof t&&t.each((function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)}))},t.prototype.applyTransition=function(i){var e=this,t={};!1===e.options.fade?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},t.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},t.prototype.autoPlayClear=function(){this.autoPlayTimer&&clearInterval(this.autoPlayTimer)},t.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(e))},t.prototype.buildArrows=function(){var e=this;!0===e.options.arrows&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),!0!==e.options.infinite&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},t.prototype.buildDots=function(){var e,t,o=this;if(!0===o.options.dots&&o.slideCount>o.options.slidesToShow){for(o.$slider.addClass("slick-dotted"),t=i("<ul></ul>").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li></li>").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active")}},t.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each((function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")})),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"></div>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"></div>').parent(),e.$list=e.$slideTrack.wrap('<div class="slick-list"></div>').parent(),e.$slideTrack.css("opacity",0),!0!==e.options.centerMode&&!0!==e.options.swipeToSlide||(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),!0===e.options.draggable&&e.$list.addClass("draggable")},t.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.options.rows>0){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement("div");for(e=0;e<l.options.rows;e++){var a=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},t.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if("window"===r.respondTo?n=a:"slider"===r.respondTo?n=d:"min"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){for(o in s=null,r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(!1===r.originalSettings.mobileFirst?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||!1===l||r.$slider.trigger("breakpoint",[r,l])}},t.prototype.changeSlide=function(e,t){var o,s,n=this,r=i(e.currentTarget);switch(r.is("a")&&e.preventDefault(),r.is("li")||(r=r.closest("li")),o=n.slideCount%n.options.slidesToScroll!=0?0:(n.slideCount-n.currentSlide)%n.options.slidesToScroll,e.data.message){case"previous":s=0===o?n.options.slidesToScroll:n.options.slidesToShow-o,n.slideCount>n.options.slidesToShow&&n.slideHandler(n.currentSlide-s,!1,t);break;case"next":s=0===o?n.options.slidesToScroll:o,n.slideCount>n.options.slidesToShow&&n.slideHandler(n.currentSlide+s,!1,t);break;case"index":var l=0===e.data.index?0:e.data.index||r.index()*n.options.slidesToScroll;n.slideHandler(n.checkNavigable(l),!1,t),r.children().trigger("focus");break;default:return}},t.prototype.checkNavigable=function(i){var e,t;if(t=0,i>(e=this.getNavigableIndexes())[e.length-1])i=e[e.length-1];else for(var o in e){if(i<e[o]){i=t;break}t=e[o]}return i},t.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),!0===e.options.accessibility&&e.$dots.off("keydown.slick",e.keyHandler)),e.$slider.off("focus.slick blur.slick"),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow&&e.$prevArrow.off("keydown.slick",e.keyHandler),e.$nextArrow&&e.$nextArrow.off("keydown.slick",e.keyHandler))),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),!0===e.options.accessibility&&e.$list.off("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition)},t.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},t.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>0&&((i=e.$slides.children().children()).removeAttr("style"),e.$slider.empty().append(i))},t.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},t.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each((function(){i(this).attr("style",i(this).data("originalStyling"))})),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},t.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},t.prototype.fadeSlide=function(i,e){var t=this;!1===t.cssTransitions?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout((function(){t.disableTransition(i),e.call()}),t.options.speed))},t.prototype.fadeSlideOut=function(i){var e=this;!1===e.cssTransitions?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},t.prototype.filterSlides=t.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},t.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",(function(t){t.stopImmediatePropagation();var o=i(this);setTimeout((function(){e.options.pauseOnFocus&&(e.focussed=o.is(":focus"),e.autoPlay())}),0)}))},t.prototype.getCurrent=t.prototype.slickCurrentSlide=function(){return this.currentSlide},t.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(!0===i.options.infinite)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(!0===i.options.centerMode)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},t.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=!1===n.options.vertical?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,!0===n.options.variableWidth&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,!0===n.options.centerMode&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,e+=(n.$list.width()-o.outerWidth())/2)),e},t.prototype.getOption=t.prototype.slickGetOption=function(i){return this.options[i]},t.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(!1===e.options.infinite?i=e.slideCount:(t=-1*e.options.slidesToScroll,o=-1*e.options.slidesToScroll,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},t.prototype.getSlick=function(){return this},t.prototype.getSlideCount=function(){var e,t,o=this;return t=!0===o.options.centerMode?o.slideWidth*Math.floor(o.options.slidesToShow/2):0,!0===o.options.swipeToSlide?(o.$slideTrack.find(".slick-slide").each((function(s,n){if(n.offsetLeft-t+i(n).outerWidth()/2>-1*o.swipeLeft)return e=n,!1})),Math.abs(i(e).attr("data-slick-index")-o.currentSlide)||1):o.options.slidesToScroll},t.prototype.goTo=t.prototype.slickGoTo=function(i,e){this.changeSlide({data:{message:"index",index:parseInt(i)}},e)},t.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),!0===t.options.accessibility&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},t.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter((function(i){return i>=0&&i<e.slideCount}));e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(".slick-cloned")).each((function(t){var s=o.indexOf(t);if(i(this).attr({role:"tabpanel",id:"slick-slide"+e.instanceUid+t,tabindex:-1}),-1!==s){var n="slick-slide-control"+e.instanceUid+s;i("#"+n).length&&i(this).attr({"aria-describedby":n})}})),e.$dots.attr("role","tablist").find("li").each((function(s){var n=o[s];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+e.instanceUid+s,"aria-controls":"slick-slide"+e.instanceUid+n,"aria-label":s+1+" of "+t,"aria-selected":null,tabindex:"-1"})})).eq(e.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.options.focusOnChange?e.$slides.eq(s).attr({tabindex:"0"}):e.$slides.eq(s).removeAttr("tabindex");e.activateADA()},t.prototype.initArrowEvents=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide),!0===i.options.accessibility&&(i.$prevArrow.on("keydown.slick",i.keyHandler),i.$nextArrow.on("keydown.slick",i.keyHandler)))},t.prototype.initDotEvents=function(){var e=this;!0===e.options.dots&&e.slideCount>e.options.slidesToShow&&(i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),!0===e.options.accessibility&&e.$dots.on("keydown.slick",e.keyHandler)),!0===e.options.dots&&!0===e.options.pauseOnDotsHover&&e.slideCount>e.options.slidesToShow&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},t.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},t.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"},e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),!0===e.options.accessibility&&e.$list.on("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(e.setPosition)},t.prototype.initUI=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},t.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===e.options.accessibility?e.changeSlide({data:{message:!0===e.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===e.options.accessibility&&e.changeSlide({data:{message:!0===e.options.rtl?"previous":"next"}}))},t.prototype.lazyLoad=function(){var e,t,o,s=this;function n(e){i("img[data-lazy]",e).each((function(){var e=i(this),t=i(this).attr("data-lazy"),o=i(this).attr("data-srcset"),n=i(this).attr("data-sizes")||s.$slider.attr("data-sizes"),r=document.createElement("img");r.onload=function(){e.animate({opacity:0},100,(function(){o&&(e.attr("srcset",o),n&&e.attr("sizes",n)),e.attr("src",t).animate({opacity:1},200,(function(){e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")})),s.$slider.trigger("lazyLoaded",[s,e,t])}))},r.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),s.$slider.trigger("lazyLoadError",[s,e,t])},r.src=t}))}if(!0===s.options.centerMode?!0===s.options.infinite?o=(t=s.currentSlide+(s.options.slidesToShow/2+1))+s.options.slidesToShow+2:(t=Math.max(0,s.currentSlide-(s.options.slidesToShow/2+1)),o=s.options.slidesToShow/2+1+2+s.currentSlide):(t=s.options.infinite?s.options.slidesToShow+s.currentSlide:s.currentSlide,o=Math.ceil(t+s.options.slidesToShow),!0===s.options.fade&&(t>0&&t--,o<=s.slideCount&&o++)),e=s.$slider.find(".slick-slide").slice(t,o),"anticipated"===s.options.lazyLoad)for(var r=t-1,l=o,d=s.$slider.find(".slick-slide"),a=0;a<s.options.slidesToScroll;a++)r<0&&(r=s.slideCount-1),e=(e=e.add(d.eq(r))).add(d.eq(l)),r--,l++;n(e),s.slideCount<=s.options.slidesToShow?n(s.$slider.find(".slick-slide")):s.currentSlide>=s.slideCount-s.options.slidesToShow?n(s.$slider.find(".slick-cloned").slice(0,s.options.slidesToShow)):0===s.currentSlide&&n(s.$slider.find(".slick-cloned").slice(-1*s.options.slidesToShow))},t.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},t.prototype.next=t.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},t.prototype.orientationChange=function(){this.checkResponsive(),this.setPosition()},t.prototype.pause=t.prototype.slickPause=function(){this.autoPlayClear(),this.paused=!0},t.prototype.play=t.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},t.prototype.postSlide=function(e){var t=this;t.unslicked||(t.$slider.trigger("afterChange",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),!0===t.options.accessibility&&(t.initADA(),t.options.focusOnChange&&i(t.$slides.get(t.currentSlide)).attr("tabindex",0).focus()))},t.prototype.prev=t.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},t.prototype.preventDefault=function(i){i.preventDefault()},t.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i("img[data-lazy]",l.$slider);d.length?(t=d.first(),o=t.attr("data-lazy"),s=t.attr("data-srcset"),n=t.attr("data-sizes")||l.$slider.attr("data-sizes"),(r=document.createElement("img")).onload=function(){s&&(t.attr("srcset",s),n&&t.attr("sizes",n)),t.attr("src",o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===l.options.adaptiveHeight&&l.setPosition(),l.$slider.trigger("lazyLoaded",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout((function(){l.progressiveLazyLoad(e+1)}),500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),l.$slider.trigger("lazyLoadError",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger("allImagesLoaded",[l])},t.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},t.prototype.registerBreakpoints=function(){var i,e,t,o=this,s=o.options.responsive||null;if("array"==typeof s&&s.length){for(i in o.respondTo=o.options.respondTo||"window",s)if(t=o.breakpoints.length-1,s.hasOwnProperty(i)){for(e=s[i].breakpoint;t>=0;)o.breakpoints[t]&&o.breakpoints[t]===e&&o.breakpoints.splice(t,1),t--;o.breakpoints.push(e),o.breakpointSettings[e]=s[i].settings}o.breakpoints.sort((function(i,e){return o.options.mobileFirst?i-e:e-i}))}},t.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},t.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout((function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()}),50))},t.prototype.removeSlide=t.prototype.slickRemove=function(i,e,t){var o=this;if(i="boolean"==typeof i?!0===(e=i)?0:o.slideCount-1:!0===e?--i:i,o.slideCount<1||i<0||i>o.slideCount-1)return!1;o.unload(),!0===t?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,o.reinit()},t.prototype.setCSS=function(i){var e,t,o=this,s={};!0===o.options.rtl&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,!1===o.transformsEnabled?o.$slideTrack.css(s):(s={},!1===o.cssTransitions?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},t.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},t.prototype.setFade=function(){var e,t=this;t.$slides.each((function(o,s){e=t.slideWidth*o*-1,!0===t.options.rtl?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})})),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},t.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},t.prototype.setOption=t.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"==typeof arguments[0]?(o=arguments[0],l=arguments[1],n="multiple"):"string"==typeof arguments[0]&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"==typeof arguments[1]?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,(function(i,e){r.options[i]=e}));else if("responsive"===n)for(t in s)if("array"!=typeof r.options.responsive)r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},t.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),!1===i.options.fade?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},t.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},t.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),!0===n.options.centerMode){var r=n.options.slidesToShow%2==0?1:0;e=Math.floor(n.options.slidesToShow/2),!0===n.options.infinite&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=!0===n.options.infinite?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},t.prototype.setupInfinite=function(){var e,t,o,s=this;if(!0===s.options.fade&&(s.options.centerMode=!1),!0===s.options.infinite&&!1===s.options.fade&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=!0===s.options.centerMode?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each((function(){i(this).attr("id","")}))}},t.prototype.interrupt=function(i){i||this.autoPlay(),this.interrupted=i},t.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));s||(s=0),t.slideCount<=t.options.slidesToShow?t.slideHandler(s,!1,!0):t.slideHandler(s)},t.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d,a=this;if(e=e||!1,!(!0===a.animating&&!0===a.options.waitForAnimate||!0===a.options.fade&&a.currentSlide===i))if(!1===e&&a.asNavFor(i),o=i,l=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,!1===a.options.infinite&&!1===a.options.centerMode&&(i<0||i>a.getDotCount()*a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t&&a.slideCount>a.options.slidesToShow?a.animateSlide(r,(function(){a.postSlide(o)})):a.postSlide(o));else if(!1===a.options.infinite&&!0===a.options.centerMode&&(i<0||i>a.slideCount-a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t&&a.slideCount>a.options.slidesToShow?a.animateSlide(r,(function(){a.postSlide(o)})):a.postSlide(o));else{if(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!=0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!=0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(d=(d=a.getNavTarget()).slick("getSlick")).slideCount<=d.options.slidesToShow&&d.setSlideClasses(a.currentSlide),a.updateDots(),a.updateArrows(),!0===a.options.fade)return!0!==t?(a.fadeSlideOut(n),a.fadeSlide(s,(function(){a.postSlide(s)}))):a.postSlide(s),void a.animateHeight();!0!==t&&a.slideCount>a.options.slidesToShow?a.animateSlide(l,(function(){a.postSlide(s)})):a.postSlide(s)}},t.prototype.startLoad=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},t.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),(o=Math.round(180*t/Math.PI))<0&&(o=360-Math.abs(o)),o<=45&&o>=0?!1===s.options.rtl?"left":"right":o<=360&&o>=315?!1===s.options.rtl?"left":"right":o>=135&&o<=225?!1===s.options.rtl?"right":"left":!0===s.options.verticalSwiping?o>=35&&o<=135?"down":"up":"vertical"},t.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(!0===o.touchObject.edgeHit&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},t.prototype.swipeHandler=function(i){var e=this;if(!(!1===e.options.swipe||"ontouchend"in document&&!1===e.options.swipe||!1===e.options.draggable&&-1!==i.type.indexOf("mouse")))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,!0===e.options.verticalSwiping&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},t.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(!0===l.options.verticalSwiping&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(!1===l.options.rtl?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),!0===l.options.verticalSwiping&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,!1===l.options.infinite&&(0===l.currentSlide&&"right"===t||l.currentSlide>=l.getDotCount()&&"left"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),!1===l.options.vertical?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,!0===l.options.verticalSwiping&&(l.swipeLeft=e+o*s),!0!==l.options.fade&&!1!==l.options.touchMove&&(!0===l.animating?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},t.prototype.swipeStart=function(i){var e,t=this;if(t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow)return t.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,t.dragging=!0},t.prototype.unfilterSlides=t.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},t.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},t.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},t.prototype.updateArrows=function(){var i=this;Math.floor(i.options.slidesToShow/2),!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&!i.options.infinite&&(i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===i.currentSlide?(i.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-i.options.slidesToShow&&!1===i.options.centerMode?(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-1&&!0===i.options.centerMode&&(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},t.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").end(),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active"))},t.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,e,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if("object"==typeof s||void 0===s?o[i].slick=new t(o[i],s):e=o[i].slick[s].apply(o[i].slick,n),void 0!==e)return e;return o}}));
js/slider/jquery.slider.js CHANGED
@@ -28,7 +28,7 @@ sowb.SiteOriginSlider = function($) {
28
  video = active.find('video.sow-background-element');
29
 
30
  if( speed === undefined ) {
31
- sentinel.css( 'height', active.outerHeight() );
32
  }
33
  else {
34
  sentinel.animate( {height: active.outerHeight()}, speed );
@@ -87,7 +87,7 @@ jQuery( function($){
87
  var urlData = $slide.data('url');
88
 
89
  if( urlData !== undefined && urlData.hasOwnProperty( 'url' ) ) {
90
- $slide.click(function(event) {
91
 
92
  event.preventDefault();
93
  var sliderWindow = window.open(
@@ -96,7 +96,7 @@ jQuery( function($){
96
  );
97
  sliderWindow.opener = null;
98
  } );
99
- $slide.find( 'a' ).click( function ( event ) {
100
  event.stopPropagation();
101
  } );
102
  }
@@ -119,11 +119,11 @@ jQuery( function($){
119
  var resizeFrames = function () {
120
  $$.find( '.sow-slider-image' ).each( function () {
121
  var $i = $( this );
122
- $i.css( 'height', $i.find( '.sow-slider-image-wrapper' ).outerHeight() );
123
  } );
124
  };
125
  // Setup each of the slider frames
126
- $(window).on('resize panelsStretchRows', resizeFrames ).resize();
127
  $(sowb).on('setup_widgets', resizeFrames );
128
 
129
  // Set up the Cycle with videos
@@ -157,7 +157,7 @@ jQuery( function($){
157
  $n.hide();
158
  }
159
 
160
- $(window).resize();
161
 
162
  setTimeout(function() {
163
  resizeFrames();
@@ -189,11 +189,11 @@ jQuery( function($){
189
 
190
  var toHide = false;
191
  $base
192
- .mouseenter(function(){
193
  $p.add($n).clearQueue().fadeIn(150);
194
  toHide = false;
195
  })
196
- .mouseleave(function(){
197
  toHide = true;
198
  setTimeout(function(){
199
  if( toHide ) {
@@ -216,18 +216,18 @@ jQuery( function($){
216
  $( sowb ).on( 'setup_widgets', setupActiveSlide );
217
 
218
  // Setup clicks on the pagination
219
- $p.find( '> li > a' ).click( function(e){
220
  e.preventDefault();
221
  $$.cycle( 'goto', $(this).data('goto') );
222
  } );
223
 
224
  // Clicking on the next and previous navigation buttons
225
- $n.find( '> a' ).click( function(e){
226
  e.preventDefault();
227
  $$.cycle( $(this).data('action') );
228
  } );
229
 
230
- $base.keydown(
231
  function(event) {
232
  if(event.which === 37) {
233
  //left
28
  video = active.find('video.sow-background-element');
29
 
30
  if( speed === undefined ) {
31
+ sentinel.css( 'height', active.outerHeight() + 'px' );
32
  }
33
  else {
34
  sentinel.animate( {height: active.outerHeight()}, speed );
87
  var urlData = $slide.data('url');
88
 
89
  if( urlData !== undefined && urlData.hasOwnProperty( 'url' ) ) {
90
+ $slide.on( 'click', function(event) {
91
 
92
  event.preventDefault();
93
  var sliderWindow = window.open(
96
  );
97
  sliderWindow.opener = null;
98
  } );
99
+ $slide.find( 'a' ).on( 'click', function ( event ) {
100
  event.stopPropagation();
101
  } );
102
  }
119
  var resizeFrames = function () {
120
  $$.find( '.sow-slider-image' ).each( function () {
121
  var $i = $( this );
122
+ $i.css( 'height', $i.find( '.sow-slider-image-wrapper' ).outerHeight() + 'px' );
123
  } );
124
  };
125
  // Setup each of the slider frames
126
+ $( window ).on('resize panelsStretchRows', resizeFrames ).trigger( 'resize' );
127
  $(sowb).on('setup_widgets', resizeFrames );
128
 
129
  // Set up the Cycle with videos
157
  $n.hide();
158
  }
159
 
160
+ $( window ).trigger( 'resize' );
161
 
162
  setTimeout(function() {
163
  resizeFrames();
189
 
190
  var toHide = false;
191
  $base
192
+ .on( 'mouseenter', function() {
193
  $p.add($n).clearQueue().fadeIn(150);
194
  toHide = false;
195
  })
196
+ .on( 'mouseleave', function() {
197
  toHide = true;
198
  setTimeout(function(){
199
  if( toHide ) {
216
  $( sowb ).on( 'setup_widgets', setupActiveSlide );
217
 
218
  // Setup clicks on the pagination
219
+ $p.find( '> li > a' ).on( 'click', function(e){
220
  e.preventDefault();
221
  $$.cycle( 'goto', $(this).data('goto') );
222
  } );
223
 
224
  // Clicking on the next and previous navigation buttons
225
+ $n.find( '> a' ).on( 'click', function(e){
226
  e.preventDefault();
227
  $$.cycle( $(this).data('action') );
228
  } );
229
 
230
+ $base.on( 'keydown',
231
  function(event) {
232
  if(event.which === 37) {
233
  //left
js/slider/jquery.slider.min.js CHANGED
@@ -1 +1 @@
1
- var sowb=window.sowb||{};sowb.SiteOriginSlider=function(e){return{playSlideVideo:function(i){e(i).find("video").each((function(){void 0!==this.play&&this.play()}))},pauseSlideVideo:function(i){e(i).find("video").each((function(){void 0!==this.pause&&this.pause()}))},setupActiveSlide:function(i,t,s){var n=e(i).find(".cycle-sentinel"),o=e(t),d=o.find("video.sow-background-element");(void 0===s?n.css("height",o.outerHeight()):n.animate({height:o.outerHeight()},s),d.length)&&(o.outerWidth()/o.outerHeight()>d.outerWidth()/d.outerHeight()?d.css({width:"100%",height:"auto"}):d.css({width:"auto",height:"100%"}),d.css({"margin-left":-Math.ceil(d.width()/2),"margin-top":-Math.ceil(d.height()/2)}))}}},jQuery((function(e){sowb.setupSliders=sowb.setupSlider=function(){var i=new sowb.SiteOriginSlider(e);e(".sow-slider-images").each((function(){var t=e(this);if(t.data("initialized"))return t;var s=t.siblings(".sow-slider-pagination"),n=t.closest(".sow-slider-base"),o=n.find(".sow-slide-nav"),d=t.find(".sow-slider-image"),a=t.data("settings");d.each((function(i,t){var s=e(t),n=s.data("url");void 0!==n&&n.hasOwnProperty("url")&&(s.click((function(e){e.preventDefault(),window.open(n.url,n.hasOwnProperty("new_window")&&n.new_window?"_blank":"_self").opener=null})),s.find("a").click((function(e){e.stopPropagation()})))}));var l=function(){var c=t.closest(".so-widget-fittext-wrapper");if(c.length>0&&!c.data("fitTextDone"))c.on("fitTextDone",(function(){l()}));else{n.show();var r=function(){t.find(".sow-slider-image").each((function(){var i=e(this);i.css("height",i.find(".sow-slider-image-wrapper").outerHeight())}))};if(e(window).on("resize panelsStretchRows",r).resize(),e(sowb).on("setup_widgets",r),t.on({"cycle-after":function(t,s,n,o,d){var a=e(this);i.playSlideVideo(o),i.setupActiveSlide(a,o),e(o).trigger("sowSlideCycleAfter")},"cycle-before":function(t,n,o,d,a){var l=e(this);s.find("> li").removeClass("sow-active").eq(n.slideNum-1).addClass("sow-active"),i.pauseSlideVideo(o),i.setupActiveSlide(l,d,n.speed),e(d).trigger("sowSlideCycleBefore")},"cycle-initialized":function(n,d){i.playSlideVideo(e(this).find(".cycle-slide-active")),i.setupActiveSlide(t,d.slides[0]),s.find(">li").removeClass("sow-active").eq(0).addClass("sow-active"),e(this).find(".cycle-slide-active").trigger("sowSlideInitial"),d.slideCount<=1&&(s.hide(),o.hide()),e(window).resize(),setTimeout((function(){r(),i.setupActiveSlide(t,d.slides[0]),t.find(".cycle-sentinel").empty()}),200)}}).cycle({slides:"> .sow-slider-image",speed:a.speed,timeout:a.timeout,swipe:a.swipe,paused:a.paused,pauseOnHover:a.pause_on_hover,"swipe-fx":"scrollHorz",log:!1}),t.find("video.sow-background-element").on("loadeddata",(function(){i.setupActiveSlide(t,t.find(".cycle-slide-active"))})),s.add(o).hide(),d.length>1)if(n.hasClass("sow-slider-is-mobile"))a.nav_always_show_mobile&&window.matchMedia("(max-width: "+a.breakpoint+")").matches&&(s.show(),o.show());else{var u=!1;n.mouseenter((function(){s.add(o).clearQueue().fadeIn(150),u=!1})).mouseleave((function(){u=!0,setTimeout((function(){u&&s.add(o).clearQueue().fadeOut(150),u=!1}),750)}))}var w=function(){i.setupActiveSlide(t,t.find(".cycle-slide-active"))};e(window).on("resize",w),e(sowb).on("setup_widgets",w),s.find("> li > a").click((function(i){i.preventDefault(),t.cycle("goto",e(this).data("goto"))})),o.find("> a").click((function(i){i.preventDefault(),t.cycle(e(this).data("action"))})),n.keydown((function(e){37===e.which?t.cycle("prev"):39===e.which&&t.cycle("next")}))}},c=t.find("img.sow-slider-background-image, img.sow-slider-foreground-image"),r=0,u=!1;c.each((function(){e(this);this.complete?r++:e(this).one("load",(function(){++r!==c.length||u||(l(),u=!0)})).attr("src",e(this).attr("src")),r!==c.length||u||(l(),u=!0)})),0===c.length&&l(),t.data("initialized",!0)}))},sowb.setupSliders(),e(sowb).on("setup_widgets",sowb.setupSliders)})),window.sowb=sowb;
1
+ var sowb=window.sowb||{};sowb.SiteOriginSlider=function(e){return{playSlideVideo:function(i){e(i).find("video").each((function(){void 0!==this.play&&this.play()}))},pauseSlideVideo:function(i){e(i).find("video").each((function(){void 0!==this.pause&&this.pause()}))},setupActiveSlide:function(i,t,s){var n=e(i).find(".cycle-sentinel"),o=e(t),d=o.find("video.sow-background-element");(void 0===s?n.css("height",o.outerHeight()+"px"):n.animate({height:o.outerHeight()},s),d.length)&&(o.outerWidth()/o.outerHeight()>d.outerWidth()/d.outerHeight()?d.css({width:"100%",height:"auto"}):d.css({width:"auto",height:"100%"}),d.css({"margin-left":-Math.ceil(d.width()/2),"margin-top":-Math.ceil(d.height()/2)}))}}},jQuery((function(e){sowb.setupSliders=sowb.setupSlider=function(){var i=new sowb.SiteOriginSlider(e);e(".sow-slider-images").each((function(){var t=e(this);if(t.data("initialized"))return t;var s=t.siblings(".sow-slider-pagination"),n=t.closest(".sow-slider-base"),o=n.find(".sow-slide-nav"),d=t.find(".sow-slider-image"),a=t.data("settings");d.each((function(i,t){var s=e(t),n=s.data("url");void 0!==n&&n.hasOwnProperty("url")&&(s.on("click",(function(e){e.preventDefault(),window.open(n.url,n.hasOwnProperty("new_window")&&n.new_window?"_blank":"_self").opener=null})),s.find("a").on("click",(function(e){e.stopPropagation()})))}));var l=function(){var c=t.closest(".so-widget-fittext-wrapper");if(c.length>0&&!c.data("fitTextDone"))c.on("fitTextDone",(function(){l()}));else{n.show();var r=function(){t.find(".sow-slider-image").each((function(){var i=e(this);i.css("height",i.find(".sow-slider-image-wrapper").outerHeight()+"px")}))};if(e(window).on("resize panelsStretchRows",r).trigger("resize"),e(sowb).on("setup_widgets",r),t.on({"cycle-after":function(t,s,n,o,d){var a=e(this);i.playSlideVideo(o),i.setupActiveSlide(a,o),e(o).trigger("sowSlideCycleAfter")},"cycle-before":function(t,n,o,d,a){var l=e(this);s.find("> li").removeClass("sow-active").eq(n.slideNum-1).addClass("sow-active"),i.pauseSlideVideo(o),i.setupActiveSlide(l,d,n.speed),e(d).trigger("sowSlideCycleBefore")},"cycle-initialized":function(n,d){i.playSlideVideo(e(this).find(".cycle-slide-active")),i.setupActiveSlide(t,d.slides[0]),s.find(">li").removeClass("sow-active").eq(0).addClass("sow-active"),e(this).find(".cycle-slide-active").trigger("sowSlideInitial"),d.slideCount<=1&&(s.hide(),o.hide()),e(window).trigger("resize"),setTimeout((function(){r(),i.setupActiveSlide(t,d.slides[0]),t.find(".cycle-sentinel").empty()}),200)}}).cycle({slides:"> .sow-slider-image",speed:a.speed,timeout:a.timeout,swipe:a.swipe,paused:a.paused,pauseOnHover:a.pause_on_hover,"swipe-fx":"scrollHorz",log:!1}),t.find("video.sow-background-element").on("loadeddata",(function(){i.setupActiveSlide(t,t.find(".cycle-slide-active"))})),s.add(o).hide(),d.length>1)if(n.hasClass("sow-slider-is-mobile"))a.nav_always_show_mobile&&window.matchMedia("(max-width: "+a.breakpoint+")").matches&&(s.show(),o.show());else{var u=!1;n.on("mouseenter",(function(){s.add(o).clearQueue().fadeIn(150),u=!1})).on("mouseleave",(function(){u=!0,setTimeout((function(){u&&s.add(o).clearQueue().fadeOut(150),u=!1}),750)}))}var w=function(){i.setupActiveSlide(t,t.find(".cycle-slide-active"))};e(window).on("resize",w),e(sowb).on("setup_widgets",w),s.find("> li > a").on("click",(function(i){i.preventDefault(),t.cycle("goto",e(this).data("goto"))})),o.find("> a").on("click",(function(i){i.preventDefault(),t.cycle(e(this).data("action"))})),n.on("keydown",(function(e){37===e.which?t.cycle("prev"):39===e.which&&t.cycle("next")}))}},c=t.find("img.sow-slider-background-image, img.sow-slider-foreground-image"),r=0,u=!1;c.each((function(){e(this);this.complete?r++:e(this).one("load",(function(){++r!==c.length||u||(l(),u=!0)})).attr("src",e(this).attr("src")),r!==c.length||u||(l(),u=!0)})),0===c.length&&l(),t.data("initialized",!0)}))},sowb.setupSliders(),e(sowb).on("setup_widgets",sowb.setupSliders)})),window.sowb=sowb;
js/sow.google-map.js CHANGED
@@ -1,6 +1,7 @@
1
  /* globals jQuery, google, sowb */
2
 
3
  window.sowb = window.sowb || {};
 
4
 
5
  sowb.SiteOriginGoogleMap = function($) {
6
  return {
@@ -64,6 +65,8 @@ sowb.SiteOriginGoogleMap = function($) {
64
  icon: options.markerIcon,
65
  title: ''
66
  });
 
 
67
  }
68
 
69
  if(options.keepCentered) {
@@ -80,6 +83,8 @@ sowb.SiteOriginGoogleMap = function($) {
80
  this.showMarkers(options.markerPositions, map, options);
81
  this.showDirections(options.directions, map, options);
82
 
 
 
83
  },
84
 
85
  linkAutocompleteField: function (autocomplete, autocompleteElement, map, options) {
@@ -120,7 +125,7 @@ sowb.SiteOriginGoogleMap = function($) {
120
  }
121
  } );
122
 
123
- $autocompleteElement.focusin( function () {
124
  if ( !this.resultsObserver ) {
125
  var autocompleteResultsContainer = document.querySelector( '.pac-container' );
126
  this.resultsObserver = new MutationObserver( function () {
@@ -358,7 +363,10 @@ sowb.SiteOriginGoogleMap = function($) {
358
  }.bind(this))
359
  .fail(function(error){
360
  console.log(error);
361
- });
 
 
 
362
  },
363
  getGeocoder: function () {
364
  if ( !this._geocoder ) {
@@ -505,7 +513,7 @@ jQuery(function ($) {
505
  }
506
 
507
  if ( soWidgetsGoogleMap.map_consent ) {
508
- $( '.sow-google-map-consent button' ).click( function() {
509
  $( '.sow-google-map-consent' ).remove();
510
  $( '.sow-google-map-canvas' ).show();
511
  $( 'body' ).append( '<script async type="text/javascript" src="' + apiUrl + '">' );
1
  /* globals jQuery, google, sowb */
2
 
3
  window.sowb = window.sowb || {};
4
+ sowb.SiteOriginGoogleMapInstances = [];
5
 
6
  sowb.SiteOriginGoogleMap = function($) {
7
  return {
65
  icon: options.markerIcon,
66
  title: ''
67
  });
68
+
69
+ map.centerMarker = this.centerMarker;
70
  }
71
 
72
  if(options.keepCentered) {
83
  this.showMarkers(options.markerPositions, map, options);
84
  this.showDirections(options.directions, map, options);
85
 
86
+ // Expose maps instance.
87
+ sowb.SiteOriginGoogleMapInstances.push( map );
88
  },
89
 
90
  linkAutocompleteField: function (autocomplete, autocompleteElement, map, options) {
125
  }
126
  } );
127
 
128
+ $autocompleteElement.on( 'focusin', function () {
129
  if ( !this.resultsObserver ) {
130
  var autocompleteResultsContainer = document.querySelector( '.pac-container' );
131
  this.resultsObserver = new MutationObserver( function () {
363
  }.bind(this))
364
  .fail(function(error){
365
  console.log(error);
366
+ } )
367
+ .done( function() {
368
+ $( sowb ).trigger( 'maps_loaded' );
369
+ } );
370
  },
371
  getGeocoder: function () {
372
  if ( !this._geocoder ) {
513
  }
514
 
515
  if ( soWidgetsGoogleMap.map_consent ) {
516
+ $( '.sow-google-map-consent button' ).on( 'click', function() {
517
  $( '.sow-google-map-consent' ).remove();
518
  $( '.sow-google-map-canvas' ).show();
519
  $( 'body' ).append( '<script async type="text/javascript" src="' + apiUrl + '">' );
js/sow.google-map.min.js CHANGED
@@ -1 +1 @@
1
- function soGoogleMapInitialize(){new sowb.SiteOriginGoogleMap(jQuery).initMaps()}window.sowb=window.sowb||{},sowb.SiteOriginGoogleMap=function(e){return{DEFAULT_LOCATIONS:["Addo Elephant National Park, R335, Addo","Cape Town, Western Cape, South Africa","San Francisco Bay Area, CA, United States","New York, NY, United States"],showMap:function(e,o,t){var i=Number(t.zoom);i||(i=14),window.matchMedia("(max-width: "+t.breakpoint+"px)").matches&&(i=t.mobileZoom);var n,a={zoom:i,gestureHandling:t.gestureHandling,disableDefaultUI:t.disableUi,zoomControl:t.zoomControl,panControl:t.panControl,center:o,mapTypeControlOptions:{mapTypeIds:[google.maps.MapTypeId.ROADMAP,google.maps.MapTypeId.SATELLITE,"user_map_style"]}},s=new google.maps.Map(e,a),r={name:t.mapName},l=t.mapStyles;if(l){var p=new google.maps.StyledMapType(l,r);s.mapTypes.set("user_map_style",p),s.setMapTypeId("user_map_style")}(t.markerAtCenter&&(this.centerMarker=new google.maps.Marker({position:o,map:s,draggable:t.markersDraggable,icon:t.markerIcon,title:""})),t.keepCentered)&&(google.maps.event.addDomListener(s,"idle",(function(){n=s.getCenter()})),google.maps.event.addDomListener(window,"resize",(function(){s.setCenter(n)})));this.linkAutocompleteField(t.autocomplete,t.autocompleteElement,s,t),this.showMarkers(t.markerPositions,s,t),this.showDirections(t.directions,s,t)},linkAutocompleteField:function(o,t,i,n){if(o&&t){var a=function(e){this.inputAddress!==e&&(this.inputAddress=e,this.getLocation(this.inputAddress).done(function(e){i.setZoom(15),i.setCenter(e),this.centerMarker&&(this.centerMarker.setPosition(e),this.centerMarker.setTitle(this.inputAddress))}.bind(this)))}.bind(this),s=e(t);o.addListener("place_changed",function(){var e=o.getPlace();i.setZoom(15),e.geometry&&(i.setCenter(e.geometry.location),this.centerMarker&&this.centerMarker.setPosition(e.geometry.location))}.bind(this)),google.maps.event.addDomListener(t,"keypress",(function(e){"13"===(e.keyCode||e.which)&&e.preventDefault()})),s.focusin(function(){if(!this.resultsObserver){var o=document.querySelector(".pac-container");this.resultsObserver=new MutationObserver((function(){var o=e(e(".pac-item").get(0)),t=o.find(".pac-item-query").text(),i=o.find("span").not("[class]").text(),n=t+(i?", "+i:"");n&&a(n)}));this.resultsObserver.observe(o,{attributes:!0,childList:!0,characterData:!0})}}.bind(this));var r=function(e){this.getGeocoder().geocode({location:e},function(o,t){if(t===google.maps.GeocoderStatus.OK&&o.length>0){var i=o[0].formatted_address;s.val(i),this.centerMarker&&(this.centerMarker.setPosition(e),this.centerMarker.setTitle(i))}}.bind(this))}.bind(this);i.addListener("click",(function(e){r(e.latLng)})),this.centerMarker.addListener("dragend",(function(e){r(e.latLng)}))}},showMarkers:function(e,o,t){if(e&&e.length){this.infoWindows=[];for(var i=[],n=0;n<e.length;n++){var a=parseInt(n/10);i.length===a&&(i[a]=[]),i[a][n%10]=e[n]}var s=function(e){var i=e.custom_marker_icon,n=e.hasOwnProperty("info")?e.info:null,a=e.hasOwnProperty("info_max_width")?e.info_max_width:null;return this.getLocation(e.place).done(function(e){var s=t.markerIcon;i&&(s=i);var r=new google.maps.Marker({position:e,map:o,draggable:t.markersDraggable,icon:s,title:""});if(n){var l={content:n};a&&(l.maxWidth=a);var p=t.markerInfoDisplay;l.disableAutoPan="always"===p;var c=new google.maps.InfoWindow(l);this.infoWindows.push(c);var d=p;"always"===p&&(d="click",c.open(o,r)),r.addListener(d,function(){c.open(o,r),"always"===p||t.markerInfoMultiple||this.infoWindows.forEach((function(e){e!==c&&e.close()}))}.bind(this)),"mouseover"===p&&r.addListener("mouseout",(function(){setTimeout((function(){c.close()}),100)}))}}.bind(this)).fail((function(e){r=e===google.maps.GeocoderStatus.OVER_QUERY_LIMIT,console.log(e)}))}.bind(this),r=!1,l=function(e,o){for(var t=0,i=0;i<e.length&&!r;i++)s(e[i]).then((function(){++t===e.length&&o.length&&l(o.shift(),o)}))}.bind(this);l(i.shift(),i)}},showDirections:function(e,o){if(e){e.waypoints&&e.waypoints.length&&e.waypoints.map((function(e){e.stopover=Boolean(e.stopover)}));var t=new google.maps.DirectionsRenderer;t.setMap(o),(new google.maps.DirectionsService).route({origin:e.origin,destination:e.destination,travelMode:e.travelMode.toUpperCase(),avoidHighways:e.avoidHighways,avoidTolls:e.avoidTolls,waypoints:e.waypoints,optimizeWaypoints:e.optimizeWaypoints},(function(o,i){i===google.maps.DirectionsStatus.OK&&(t.setOptions({preserveViewport:e.preserveViewport}),t.setDirections(o))}))}},initMaps:function(){var o=e(".sow-google-map-autocomplete"),t=new e.Deferred;0===o.length?t.resolve():o.each(function(o,i){if(void 0!==google.maps.places){var n=new google.maps.places.Autocomplete(i),a=e(i).siblings(".sow-google-map-canvas");if(a.length>0){var s=a.data("options");s.autocomplete=n,s.autocompleteElement=i,this.getLocation(s.address).done(function(e){this.showMap(a.get(0),e,s),a.data("initialized",!0),t.resolve()}.bind(this)).fail((function(){a.append("<div><p><strong>"+soWidgetsGoogleMap.geocode.noResults+"</strong></p></div>"),t.reject()}))}}else t.reject('Sorry, we couldn\'t load the "places" library due to another plugin, so the autocomplete feature is not available.')}.bind(this)),t.always(function(){e(".sow-google-map-canvas").each(function(o,t){var i=e(t);if(i.data("initialized"))return!0;var n=i.data("options"),a=n.address;if(!a){var s=n.markerPositions;s&&s.length&&(a=s[0].place)}this.getLocation(a).done(function(e){this.showMap(i.get(0),e,n),i.data("initialized",!0)}.bind(this)).fail((function(){i.append("<div><p><strong>"+soWidgetsGoogleMap.geocode.noResults+"</strong></p></div>")}))}.bind(this))}.bind(this)).fail((function(e){console.log(e)}))},getGeocoder:function(){return this._geocoder||(this._geocoder=new google.maps.Geocoder),this._geocoder},getLocation:function(o){var t,i=new e.Deferred,n={address:o};if(o&&o.indexOf(",")>-1){var a=o.replace(/[\(\)]/g,"").split(",");a&&2===a.length&&(t=new google.maps.LatLng(a[0],a[1]),isNaN(t.lat())||isNaN(t.lng())||(n={location:{lat:t.lat(),lng:t.lng()}}))}if(n.hasOwnProperty("location"))i.resolve(n.location);else if(n.hasOwnProperty("address")){if(!n.address){var s=parseInt(Math.random()*this.DEFAULT_LOCATIONS.length);n.address=this.DEFAULT_LOCATIONS[s]}var r=0,l=function(e,o){o===google.maps.GeocoderStatus.OK?i.resolve(e[0].geometry.location):o===google.maps.GeocoderStatus.OVER_QUERY_LIMIT?++r<3?setTimeout(function(){this.getGeocoder().geocode.call(this,n,l)}.bind(this),1e3):i.reject(o):o!==google.maps.GeocoderStatus.ZERO_RESULTS&&o!==google.maps.GeocoderStatus.OVER_DAILY_LIMIT||i.reject(o)}.bind(this);this.getGeocoder().geocode(n,l)}return i}}},jQuery((function(e){sowb.setupGoogleMaps=function(){var o,t=[],i=e(".sow-google-map-canvas");if(i.length){i.each((function(i,n){var a=e(n);if(!a.parent().is(":visible")||a.data("apiInitialized"))return a;var s=a.data("options");s&&(void 0!==s.libraries&&null!==s.libraries&&(t=t.concat(s.libraries)),!o&&s.apiKey&&(o=s.apiKey)),a.data("apiInitialized",!0)}));var n=void 0!==window.google&&void 0!==window.google.maps;if(sowb.mapsApiInitialized)var a=setTimeout((function(){n&&(clearTimeout(a),soGoogleMapInitialize())}),100);else{o||(console.warn("SiteOrigin Google Maps: Could not find API key. Google Maps API key is required."),o="");var s="https://maps.googleapis.com/maps/api/js?key="+o+"&callback=soGoogleMapInitialize";if(t&&t.length&&(s+="&libraries="+t.join(",")),window.console&&window.console.error){var r=window.console.error;sowb.onLoadMapsApiError=function(o){var t;"string"==typeof o&&(t=o.match(/^Google Maps API (error|warning): ([^\s]*)\s([^\s]*)(?:\s(.*))?/)),t&&t.length&&t[0]&&e(".sow-google-map-canvas").each((function(o,t){var i=e(t);if(i.data("fallbackImage")){var n=i.data("fallbackImage");n.hasOwnProperty("img")&&i.append(n.img)}})),r.apply(window.console,arguments)},window.console.error=sowb.onLoadMapsApiError}soWidgetsGoogleMap.map_consent?e(".sow-google-map-consent button").click((function(){e(".sow-google-map-consent").remove(),e(".sow-google-map-canvas").show(),e("body").append('<script async type="text/javascript" src="'+s+'">'),sowb.mapsApiInitialized=!0})):(e("body").append('<script async type="text/javascript" src="'+s+'">'),sowb.mapsApiInitialized=!0)}}},sowb.setupGoogleMaps(),e(sowb).on("setup_widgets",sowb.setupGoogleMaps)}));
1
+ function soGoogleMapInitialize(){new sowb.SiteOriginGoogleMap(jQuery).initMaps()}window.sowb=window.sowb||{},sowb.SiteOriginGoogleMapInstances=[],sowb.SiteOriginGoogleMap=function(e){return{DEFAULT_LOCATIONS:["Addo Elephant National Park, R335, Addo","Cape Town, Western Cape, South Africa","San Francisco Bay Area, CA, United States","New York, NY, United States"],showMap:function(e,o,t){var i=Number(t.zoom);i||(i=14),window.matchMedia("(max-width: "+t.breakpoint+"px)").matches&&(i=t.mobileZoom);var n,a={zoom:i,gestureHandling:t.gestureHandling,disableDefaultUI:t.disableUi,zoomControl:t.zoomControl,panControl:t.panControl,center:o,mapTypeControlOptions:{mapTypeIds:[google.maps.MapTypeId.ROADMAP,google.maps.MapTypeId.SATELLITE,"user_map_style"]}},s=new google.maps.Map(e,a),r={name:t.mapName},l=t.mapStyles;if(l){var p=new google.maps.StyledMapType(l,r);s.mapTypes.set("user_map_style",p),s.setMapTypeId("user_map_style")}(t.markerAtCenter&&(this.centerMarker=new google.maps.Marker({position:o,map:s,draggable:t.markersDraggable,icon:t.markerIcon,title:""}),s.centerMarker=this.centerMarker),t.keepCentered)&&(google.maps.event.addDomListener(s,"idle",(function(){n=s.getCenter()})),google.maps.event.addDomListener(window,"resize",(function(){s.setCenter(n)})));this.linkAutocompleteField(t.autocomplete,t.autocompleteElement,s,t),this.showMarkers(t.markerPositions,s,t),this.showDirections(t.directions,s,t),sowb.SiteOriginGoogleMapInstances.push(s)},linkAutocompleteField:function(o,t,i,n){if(o&&t){var a=function(e){this.inputAddress!==e&&(this.inputAddress=e,this.getLocation(this.inputAddress).done(function(e){i.setZoom(15),i.setCenter(e),this.centerMarker&&(this.centerMarker.setPosition(e),this.centerMarker.setTitle(this.inputAddress))}.bind(this)))}.bind(this),s=e(t);o.addListener("place_changed",function(){var e=o.getPlace();i.setZoom(15),e.geometry&&(i.setCenter(e.geometry.location),this.centerMarker&&this.centerMarker.setPosition(e.geometry.location))}.bind(this)),google.maps.event.addDomListener(t,"keypress",(function(e){"13"===(e.keyCode||e.which)&&e.preventDefault()})),s.on("focusin",function(){if(!this.resultsObserver){var o=document.querySelector(".pac-container");this.resultsObserver=new MutationObserver((function(){var o=e(e(".pac-item").get(0)),t=o.find(".pac-item-query").text(),i=o.find("span").not("[class]").text(),n=t+(i?", "+i:"");n&&a(n)}));this.resultsObserver.observe(o,{attributes:!0,childList:!0,characterData:!0})}}.bind(this));var r=function(e){this.getGeocoder().geocode({location:e},function(o,t){if(t===google.maps.GeocoderStatus.OK&&o.length>0){var i=o[0].formatted_address;s.val(i),this.centerMarker&&(this.centerMarker.setPosition(e),this.centerMarker.setTitle(i))}}.bind(this))}.bind(this);i.addListener("click",(function(e){r(e.latLng)})),this.centerMarker.addListener("dragend",(function(e){r(e.latLng)}))}},showMarkers:function(e,o,t){if(e&&e.length){this.infoWindows=[];for(var i=[],n=0;n<e.length;n++){var a=parseInt(n/10);i.length===a&&(i[a]=[]),i[a][n%10]=e[n]}var s=function(e){var i=e.custom_marker_icon,n=e.hasOwnProperty("info")?e.info:null,a=e.hasOwnProperty("info_max_width")?e.info_max_width:null;return this.getLocation(e.place).done(function(e){var s=t.markerIcon;i&&(s=i);var r=new google.maps.Marker({position:e,map:o,draggable:t.markersDraggable,icon:s,title:""});if(n){var l={content:n};a&&(l.maxWidth=a);var p=t.markerInfoDisplay;l.disableAutoPan="always"===p;var c=new google.maps.InfoWindow(l);this.infoWindows.push(c);var d=p;"always"===p&&(d="click",c.open(o,r)),r.addListener(d,function(){c.open(o,r),"always"===p||t.markerInfoMultiple||this.infoWindows.forEach((function(e){e!==c&&e.close()}))}.bind(this)),"mouseover"===p&&r.addListener("mouseout",(function(){setTimeout((function(){c.close()}),100)}))}}.bind(this)).fail((function(e){r=e===google.maps.GeocoderStatus.OVER_QUERY_LIMIT,console.log(e)}))}.bind(this),r=!1,l=function(e,o){for(var t=0,i=0;i<e.length&&!r;i++)s(e[i]).then((function(){++t===e.length&&o.length&&l(o.shift(),o)}))}.bind(this);l(i.shift(),i)}},showDirections:function(e,o){if(e){e.waypoints&&e.waypoints.length&&e.waypoints.map((function(e){e.stopover=Boolean(e.stopover)}));var t=new google.maps.DirectionsRenderer;t.setMap(o),(new google.maps.DirectionsService).route({origin:e.origin,destination:e.destination,travelMode:e.travelMode.toUpperCase(),avoidHighways:e.avoidHighways,avoidTolls:e.avoidTolls,waypoints:e.waypoints,optimizeWaypoints:e.optimizeWaypoints},(function(o,i){i===google.maps.DirectionsStatus.OK&&(t.setOptions({preserveViewport:e.preserveViewport}),t.setDirections(o))}))}},initMaps:function(){var o=e(".sow-google-map-autocomplete"),t=new e.Deferred;0===o.length?t.resolve():o.each(function(o,i){if(void 0!==google.maps.places){var n=new google.maps.places.Autocomplete(i),a=e(i).siblings(".sow-google-map-canvas");if(a.length>0){var s=a.data("options");s.autocomplete=n,s.autocompleteElement=i,this.getLocation(s.address).done(function(e){this.showMap(a.get(0),e,s),a.data("initialized",!0),t.resolve()}.bind(this)).fail((function(){a.append("<div><p><strong>"+soWidgetsGoogleMap.geocode.noResults+"</strong></p></div>"),t.reject()}))}}else t.reject('Sorry, we couldn\'t load the "places" library due to another plugin, so the autocomplete feature is not available.')}.bind(this)),t.always(function(){e(".sow-google-map-canvas").each(function(o,t){var i=e(t);if(i.data("initialized"))return!0;var n=i.data("options"),a=n.address;if(!a){var s=n.markerPositions;s&&s.length&&(a=s[0].place)}this.getLocation(a).done(function(e){this.showMap(i.get(0),e,n),i.data("initialized",!0)}.bind(this)).fail((function(){i.append("<div><p><strong>"+soWidgetsGoogleMap.geocode.noResults+"</strong></p></div>")}))}.bind(this))}.bind(this)).fail((function(e){console.log(e)})).done((function(){e(sowb).trigger("maps_loaded")}))},getGeocoder:function(){return this._geocoder||(this._geocoder=new google.maps.Geocoder),this._geocoder},getLocation:function(o){var t,i=new e.Deferred,n={address:o};if(o&&o.indexOf(",")>-1){var a=o.replace(/[\(\)]/g,"").split(",");a&&2===a.length&&(t=new google.maps.LatLng(a[0],a[1]),isNaN(t.lat())||isNaN(t.lng())||(n={location:{lat:t.lat(),lng:t.lng()}}))}if(n.hasOwnProperty("location"))i.resolve(n.location);else if(n.hasOwnProperty("address")){if(!n.address){var s=parseInt(Math.random()*this.DEFAULT_LOCATIONS.length);n.address=this.DEFAULT_LOCATIONS[s]}var r=0,l=function(e,o){o===google.maps.GeocoderStatus.OK?i.resolve(e[0].geometry.location):o===google.maps.GeocoderStatus.OVER_QUERY_LIMIT?++r<3?setTimeout(function(){this.getGeocoder().geocode.call(this,n,l)}.bind(this),1e3):i.reject(o):o!==google.maps.GeocoderStatus.ZERO_RESULTS&&o!==google.maps.GeocoderStatus.OVER_DAILY_LIMIT||i.reject(o)}.bind(this);this.getGeocoder().geocode(n,l)}return i}}},jQuery((function(e){sowb.setupGoogleMaps=function(){var o,t=[],i=e(".sow-google-map-canvas");if(i.length){i.each((function(i,n){var a=e(n);if(!a.parent().is(":visible")||a.data("apiInitialized"))return a;var s=a.data("options");s&&(void 0!==s.libraries&&null!==s.libraries&&(t=t.concat(s.libraries)),!o&&s.apiKey&&(o=s.apiKey)),a.data("apiInitialized",!0)}));var n=void 0!==window.google&&void 0!==window.google.maps;if(sowb.mapsApiInitialized)var a=setTimeout((function(){n&&(clearTimeout(a),soGoogleMapInitialize())}),100);else{o||(console.warn("SiteOrigin Google Maps: Could not find API key. Google Maps API key is required."),o="");var s="https://maps.googleapis.com/maps/api/js?key="+o+"&callback=soGoogleMapInitialize";if(t&&t.length&&(s+="&libraries="+t.join(",")),window.console&&window.console.error){var r=window.console.error;sowb.onLoadMapsApiError=function(o){var t;"string"==typeof o&&(t=o.match(/^Google Maps API (error|warning): ([^\s]*)\s([^\s]*)(?:\s(.*))?/)),t&&t.length&&t[0]&&e(".sow-google-map-canvas").each((function(o,t){var i=e(t);if(i.data("fallbackImage")){var n=i.data("fallbackImage");n.hasOwnProperty("img")&&i.append(n.img)}})),r.apply(window.console,arguments)},window.console.error=sowb.onLoadMapsApiError}soWidgetsGoogleMap.map_consent?e(".sow-google-map-consent button").on("click",(function(){e(".sow-google-map-consent").remove(),e(".sow-google-map-canvas").show(),e("body").append('<script async type="text/javascript" src="'+s+'">'),sowb.mapsApiInitialized=!0})):(e("body").append('<script async type="text/javascript" src="'+s+'">'),sowb.mapsApiInitialized=!0)}}},sowb.setupGoogleMaps(),e(sowb).on("setup_widgets",sowb.setupGoogleMaps)}));
lang/so-widgets-bundle.pot CHANGED
@@ -324,7 +324,7 @@ msgstr ""
324
  msgid "Closed"
325
  msgstr ""
326
 
327
- #: widgets/accordion/accordion.php:110, widgets/contact/contact.php:326, widgets/cta/cta.php:74, widgets/post-carousel/post-carousel.php:165, widgets/tabs/tabs.php:100, widgets/testimonial/testimonial.php:184
328
  msgid "Design"
329
  msgstr ""
330
 
@@ -828,7 +828,7 @@ msgstr ""
828
  msgid "Challenge type"
829
  msgstr ""
830
 
831
- #: widgets/contact/contact.php:276, widgets/image-grid/image-grid.php:53, widgets/image-grid/image-grid.php:62, widgets/price-table/price-table.php:70, widgets/simple-masonry/simple-masonry.php:64, widgets/testimonial/testimonial.php:72, widgets/testimonial/testimonial.php:189
832
  msgid "Image"
833
  msgstr ""
834
 
@@ -1725,6 +1725,10 @@ msgid "Custom Map"
1725
  msgstr ""
1726
 
1727
  #: widgets/google-map/google-map.php:887
 
 
 
 
1728
  msgid "Get a curated list of predefined map styles with %sSiteOrigin Premium%s"
1729
  msgstr ""
1730
 
@@ -1836,7 +1840,7 @@ msgstr ""
1836
  msgid "Background image"
1837
  msgstr ""
1838
 
1839
- #: widgets/hero/hero.php:100, widgets/image/image.php:39, widgets/image-grid/image-grid.php:91, widgets/testimonial/testimonial.php:132, widgets/testimonial/testimonial.php:161, widgets/testimonial/testimonial.php:203
1840
  msgid "Image size"
1841
  msgstr ""
1842
 
@@ -1984,11 +1988,11 @@ msgstr ""
1984
  msgid "Title position"
1985
  msgstr ""
1986
 
1987
- #: widgets/image/image.php:84, widgets/image-grid/image-grid.php:72
1988
  msgid "Alt text"
1989
  msgstr ""
1990
 
1991
- #: widgets/image/image.php:94, widgets/image-grid/image-grid.php:81, widgets/slider/slider.php:101
1992
  msgid "Open in new window"
1993
  msgstr ""
1994
 
@@ -2008,7 +2012,7 @@ msgstr ""
2008
  msgid "Resize image to fit its container."
2009
  msgstr ""
2010
 
2011
- #: widgets/image/image.php:208, widgets/image-grid/image-grid.php:218
2012
  msgid "Add a Lightbox to your images with %sSiteOrigin Premium%s"
2013
  msgstr ""
2014
 
@@ -2024,31 +2028,31 @@ msgstr ""
2024
  msgid "Images"
2025
  msgstr ""
2026
 
2027
- #: widgets/image-grid/image-grid.php:68, widgets/price-table/price-table.php:75
2028
  msgid "Image title"
2029
  msgstr ""
2030
 
2031
- #: widgets/image-grid/image-grid.php:76, widgets/social-media-buttons/social-media-buttons.php:74, widgets/testimonial/testimonial.php:89
2032
  msgid "URL"
2033
  msgstr ""
2034
 
2035
- #: widgets/image-grid/image-grid.php:88
2036
  msgid "Display"
2037
  msgstr ""
2038
 
2039
- #: widgets/image-grid/image-grid.php:97
2040
  msgid "Maximum image height"
2041
  msgstr ""
2042
 
2043
- #: widgets/image-grid/image-grid.php:102
2044
  msgid "Maximum image width"
2045
  msgstr ""
2046
 
2047
- #: widgets/image-grid/image-grid.php:107
2048
  msgid "Spacing"
2049
  msgstr ""
2050
 
2051
- #: widgets/image-grid/image-grid.php:108
2052
  msgid "Amount of spacing between images."
2053
  msgstr ""
2054
 
@@ -2136,67 +2140,71 @@ msgstr ""
2136
  msgid "Posts per load"
2137
  msgstr ""
2138
 
2139
- #: widgets/post-carousel/post-carousel.php:170
 
 
 
 
2140
  msgid "Thumbnail overlay hover color"
2141
  msgstr ""
2142
 
2143
- #: widgets/post-carousel/post-carousel.php:175
2144
  msgid "Navigation arrow color"
2145
  msgstr ""
2146
 
2147
- #: widgets/post-carousel/post-carousel.php:180
2148
  msgid "Navigation arrow hover color"
2149
  msgstr ""
2150
 
2151
- #: widgets/post-carousel/post-carousel.php:184
2152
  msgid "Navigation background"
2153
  msgstr ""
2154
 
2155
- #: widgets/post-carousel/post-carousel.php:189
2156
  msgid "Navigation hover background"
2157
  msgstr ""
2158
 
2159
- #: widgets/post-carousel/post-carousel.php:196, widgets/testimonial/testimonial.php:115
2160
  msgid "Responsive"
2161
  msgstr ""
2162
 
2163
- #: widgets/post-carousel/post-carousel.php:201
2164
  msgid "Desktop"
2165
  msgstr ""
2166
 
2167
- #: widgets/post-carousel/post-carousel.php:206, widgets/post-carousel/post-carousel.php:229, widgets/post-carousel/post-carousel.php:247, widgets/post-carousel/post-carousel.php:267
2168
  msgid "Slides to scroll"
2169
  msgstr ""
2170
 
2171
- #: widgets/post-carousel/post-carousel.php:207
2172
  msgid "Set the number of slides to scroll per navigation click or swipe on desktop."
2173
  msgstr ""
2174
 
2175
- #: widgets/post-carousel/post-carousel.php:214, widgets/testimonial/testimonial.php:120
2176
  msgid "Tablet"
2177
  msgstr ""
2178
 
2179
- #: widgets/post-carousel/post-carousel.php:219
2180
  msgid "Landscape"
2181
  msgstr ""
2182
 
2183
- #: widgets/post-carousel/post-carousel.php:224, widgets/post-carousel/post-carousel.php:242, widgets/post-carousel/post-carousel.php:262
2184
  msgid "Breakpoint"
2185
  msgstr ""
2186
 
2187
- #: widgets/post-carousel/post-carousel.php:230, widgets/post-carousel/post-carousel.php:248
2188
  msgid "Set the number of slides to scroll per navigation click or swipe on tablet devices."
2189
  msgstr ""
2190
 
2191
- #: widgets/post-carousel/post-carousel.php:237
2192
  msgid "Portrait"
2193
  msgstr ""
2194
 
2195
- #: widgets/post-carousel/post-carousel.php:257
2196
  msgid "Mobile"
2197
  msgstr ""
2198
 
2199
- #: widgets/post-carousel/post-carousel.php:268
2200
  msgid " Set the number of slides to scroll per navigation click or swipe on mobile devices."
2201
  msgstr ""
2202
 
@@ -2360,7 +2368,7 @@ msgstr ""
2360
  msgid "Controls the horizontal flow of the layout. Items can either start positioned on the left or right."
2361
  msgstr ""
2362
 
2363
- #: widgets/simple-masonry/simple-masonry.php:283
2364
  msgid "Add a Lightbox to your masonry images with %sSiteOrigin Premium%s"
2365
  msgstr ""
2366
 
@@ -2725,7 +2733,7 @@ msgstr ""
2725
  msgid "Choose Icon"
2726
  msgstr ""
2727
 
2728
- #: base/inc/fields/icon.class.php:41, base/inc/fields/media.class.php:110
2729
  msgid "Remove"
2730
  msgstr ""
2731
 
@@ -2761,39 +2769,39 @@ msgstr ""
2761
  msgid "You need to <a href=\"%s\">upgrade</a> to WordPress 3.5 to use media fields"
2762
  msgstr ""
2763
 
2764
- #: base/inc/fields/media.class.php:122
2765
  msgid "External URL"
2766
  msgstr ""
2767
 
2768
- #: base/inc/fields/media.class.php:167
2769
  msgid "Would you like to import this image into your media library?"
2770
  msgstr ""
2771
 
2772
- #: base/inc/fields/media.class.php:171, base/inc/fields/media.class.php:179
2773
  msgid "Search For Images"
2774
  msgstr ""
2775
 
2776
- #: base/inc/fields/media.class.php:186
2777
  msgid "Related Searches: "
2778
  msgstr ""
2779
 
2780
- #: base/inc/fields/media.class.php:193
2781
  msgid "Powered by %s"
2782
  msgstr ""
2783
 
2784
- #: base/inc/fields/media.class.php:204
2785
  msgid "Loading Images"
2786
  msgstr ""
2787
 
2788
- #: base/inc/fields/media.class.php:205
2789
  msgid "Downloading Image - Please Wait"
2790
  msgstr ""
2791
 
2792
- #: base/inc/fields/media.class.php:208
2793
  msgid "Load More"
2794
  msgstr ""
2795
 
2796
- #: base/inc/fields/media.class.php:227
2797
  msgid "Sponsored"
2798
  msgstr ""
2799
 
324
  msgid "Closed"
325
  msgstr ""
326
 
327
+ #: widgets/accordion/accordion.php:110, widgets/contact/contact.php:326, widgets/cta/cta.php:74, widgets/post-carousel/post-carousel.php:166, widgets/tabs/tabs.php:100, widgets/testimonial/testimonial.php:184
328
  msgid "Design"
329
  msgstr ""
330
 
828
  msgid "Challenge type"
829
  msgstr ""
830
 
831
+ #: widgets/contact/contact.php:276, widgets/image-grid/image-grid.php:53, widgets/image-grid/image-grid.php:69, widgets/price-table/price-table.php:70, widgets/simple-masonry/simple-masonry.php:64, widgets/testimonial/testimonial.php:72, widgets/testimonial/testimonial.php:189
832
  msgid "Image"
833
  msgstr ""
834
 
1725
  msgstr ""
1726
 
1727
  #: widgets/google-map/google-map.php:887
1728
+ msgid "Get additional map consent design settings with %sSiteOrigin Premium%s"
1729
+ msgstr ""
1730
+
1731
+ #: widgets/google-map/google-map.php:889
1732
  msgid "Get a curated list of predefined map styles with %sSiteOrigin Premium%s"
1733
  msgstr ""
1734
 
1840
  msgid "Background image"
1841
  msgstr ""
1842
 
1843
+ #: widgets/hero/hero.php:100, widgets/image/image.php:39, widgets/image-grid/image-grid.php:98, widgets/testimonial/testimonial.php:132, widgets/testimonial/testimonial.php:161, widgets/testimonial/testimonial.php:203
1844
  msgid "Image size"
1845
  msgstr ""
1846
 
1988
  msgid "Title position"
1989
  msgstr ""
1990
 
1991
+ #: widgets/image/image.php:84, widgets/image-grid/image-grid.php:79
1992
  msgid "Alt text"
1993
  msgstr ""
1994
 
1995
+ #: widgets/image/image.php:94, widgets/image-grid/image-grid.php:88, widgets/slider/slider.php:101
1996
  msgid "Open in new window"
1997
  msgstr ""
1998
 
2012
  msgid "Resize image to fit its container."
2013
  msgstr ""
2014
 
2015
+ #: widgets/image/image.php:225, widgets/image-grid/image-grid.php:230
2016
  msgid "Add a Lightbox to your images with %sSiteOrigin Premium%s"
2017
  msgstr ""
2018
 
2028
  msgid "Images"
2029
  msgstr ""
2030
 
2031
+ #: widgets/image-grid/image-grid.php:75, widgets/price-table/price-table.php:75
2032
  msgid "Image title"
2033
  msgstr ""
2034
 
2035
+ #: widgets/image-grid/image-grid.php:83, widgets/social-media-buttons/social-media-buttons.php:74, widgets/testimonial/testimonial.php:89
2036
  msgid "URL"
2037
  msgstr ""
2038
 
2039
+ #: widgets/image-grid/image-grid.php:95
2040
  msgid "Display"
2041
  msgstr ""
2042
 
2043
+ #: widgets/image-grid/image-grid.php:104
2044
  msgid "Maximum image height"
2045
  msgstr ""
2046
 
2047
+ #: widgets/image-grid/image-grid.php:109
2048
  msgid "Maximum image width"
2049
  msgstr ""
2050
 
2051
+ #: widgets/image-grid/image-grid.php:114
2052
  msgid "Spacing"
2053
  msgstr ""
2054
 
2055
+ #: widgets/image-grid/image-grid.php:115
2056
  msgid "Amount of spacing between images."
2057
  msgstr ""
2058
 
2140
  msgid "Posts per load"
2141
  msgstr ""
2142
 
2143
+ #: widgets/post-carousel/post-carousel.php:159
2144
+ msgid "Set the number of posts preloaded in the background when clicking next. The default is 10."
2145
+ msgstr ""
2146
+
2147
+ #: widgets/post-carousel/post-carousel.php:171
2148
  msgid "Thumbnail overlay hover color"
2149
  msgstr ""
2150
 
2151
+ #: widgets/post-carousel/post-carousel.php:176
2152
  msgid "Navigation arrow color"
2153
  msgstr ""
2154
 
2155
+ #: widgets/post-carousel/post-carousel.php:181
2156
  msgid "Navigation arrow hover color"
2157
  msgstr ""
2158
 
2159
+ #: widgets/post-carousel/post-carousel.php:185
2160
  msgid "Navigation background"
2161
  msgstr ""
2162
 
2163
+ #: widgets/post-carousel/post-carousel.php:190
2164
  msgid "Navigation hover background"
2165
  msgstr ""
2166
 
2167
+ #: widgets/post-carousel/post-carousel.php:197, widgets/testimonial/testimonial.php:115
2168
  msgid "Responsive"
2169
  msgstr ""
2170
 
2171
+ #: widgets/post-carousel/post-carousel.php:202
2172
  msgid "Desktop"
2173
  msgstr ""
2174
 
2175
+ #: widgets/post-carousel/post-carousel.php:207, widgets/post-carousel/post-carousel.php:230, widgets/post-carousel/post-carousel.php:248, widgets/post-carousel/post-carousel.php:268
2176
  msgid "Slides to scroll"
2177
  msgstr ""
2178
 
2179
+ #: widgets/post-carousel/post-carousel.php:208
2180
  msgid "Set the number of slides to scroll per navigation click or swipe on desktop."
2181
  msgstr ""
2182
 
2183
+ #: widgets/post-carousel/post-carousel.php:215, widgets/testimonial/testimonial.php:120
2184
  msgid "Tablet"
2185
  msgstr ""
2186
 
2187
+ #: widgets/post-carousel/post-carousel.php:220
2188
  msgid "Landscape"
2189
  msgstr ""
2190
 
2191
+ #: widgets/post-carousel/post-carousel.php:225, widgets/post-carousel/post-carousel.php:243, widgets/post-carousel/post-carousel.php:263
2192
  msgid "Breakpoint"
2193
  msgstr ""
2194
 
2195
+ #: widgets/post-carousel/post-carousel.php:231, widgets/post-carousel/post-carousel.php:249
2196
  msgid "Set the number of slides to scroll per navigation click or swipe on tablet devices."
2197
  msgstr ""
2198
 
2199
+ #: widgets/post-carousel/post-carousel.php:238
2200
  msgid "Portrait"
2201
  msgstr ""
2202
 
2203
+ #: widgets/post-carousel/post-carousel.php:258
2204
  msgid "Mobile"
2205
  msgstr ""
2206
 
2207
+ #: widgets/post-carousel/post-carousel.php:269
2208
  msgid " Set the number of slides to scroll per navigation click or swipe on mobile devices."
2209
  msgstr ""
2210
 
2368
  msgid "Controls the horizontal flow of the layout. Items can either start positioned on the left or right."
2369
  msgstr ""
2370
 
2371
+ #: widgets/simple-masonry/simple-masonry.php:311
2372
  msgid "Add a Lightbox to your masonry images with %sSiteOrigin Premium%s"
2373
  msgstr ""
2374
 
2733
  msgid "Choose Icon"
2734
  msgstr ""
2735
 
2736
+ #: base/inc/fields/icon.class.php:41, base/inc/fields/media.class.php:111
2737
  msgid "Remove"
2738
  msgstr ""
2739
 
2769
  msgid "You need to <a href=\"%s\">upgrade</a> to WordPress 3.5 to use media fields"
2770
  msgstr ""
2771
 
2772
+ #: base/inc/fields/media.class.php:123
2773
  msgid "External URL"
2774
  msgstr ""
2775
 
2776
+ #: base/inc/fields/media.class.php:168
2777
  msgid "Would you like to import this image into your media library?"
2778
  msgstr ""
2779
 
2780
+ #: base/inc/fields/media.class.php:172, base/inc/fields/media.class.php:180
2781
  msgid "Search For Images"
2782
  msgstr ""
2783
 
2784
+ #: base/inc/fields/media.class.php:187
2785
  msgid "Related Searches: "
2786
  msgstr ""
2787
 
2788
+ #: base/inc/fields/media.class.php:194
2789
  msgid "Powered by %s"
2790
  msgstr ""
2791
 
2792
+ #: base/inc/fields/media.class.php:205
2793
  msgid "Loading Images"
2794
  msgstr ""
2795
 
2796
+ #: base/inc/fields/media.class.php:206
2797
  msgid "Downloading Image - Please Wait"
2798
  msgstr ""
2799
 
2800
+ #: base/inc/fields/media.class.php:209
2801
  msgid "Load More"
2802
  msgstr ""
2803
 
2804
+ #: base/inc/fields/media.class.php:228
2805
  msgid "Sponsored"
2806
  msgstr ""
2807
 
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
  === SiteOrigin Widgets Bundle ===
2
  Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
3
  Requires at least: 4.2
4
- Tested up to: 5.5
5
  Requires PHP: 5.6.20
6
- Stable tag: 1.17.10
7
- Build time: 2020-11-13T15:53:20+02:00
8
  License: GPLv3 or later
9
- Contributors: gpriday, braam-genis
10
  Donate link: https://siteorigin.com/downloads/premium/
11
 
12
  The SiteOrigin Widgets Bundle gives you a collection of widgets that you can use and customize. All the widgets are built on our powerful framework, giving you advanced forms, unlimited colours and 1500+ icons.
@@ -66,6 +66,16 @@ The SiteOrigin Widgets Bundle is the perfect platform to build widgets for your
66
 
67
  == Changelog ==
68
 
 
 
 
 
 
 
 
 
 
 
69
  == 1.17.10 - 13 November 2020 ==
70
  * TinyMCE: Resolved issue with the Add Media button.
71
 
1
  === SiteOrigin Widgets Bundle ===
2
  Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
3
  Requires at least: 4.2
4
+ Tested up to: 5.7
5
  Requires PHP: 5.6.20
6
+ Stable tag: 1.17.11
7
+ Build time: 2020-12-09T15:39:14+02:00
8
  License: GPLv3 or later
9
+ Contributors: gpriday, braam-genis, alexgso
10
  Donate link: https://siteorigin.com/downloads/premium/
11
 
12
  The SiteOrigin Widgets Bundle gives you a collection of widgets that you can use and customize. All the widgets are built on our powerful framework, giving you advanced forms, unlimited colours and 1500+ icons.
66
 
67
  == Changelog ==
68
 
69
+ == 1.17.11 - 09 December 2020 ==
70
+ * Google Maps: Added Map Style button styling.
71
+ * Accordion: Submitted contact forms added to Accordion will now open the panel on load.
72
+ * Tabs: Prevented the Scroll To setting from affecting the currently selected tab.
73
+ * Image Grid: Use image title as item label if set.
74
+ * Developer: jQuery updates for WordPress 5.6.
75
+ * Developer: Set Slider background image loading to Eager.
76
+ * Developer: Exposed Google Maps instances. Once set up, maps can be accessed via `sowb.SiteOriginGoogleMapInstances`.
77
+ * Developer: Add a Google Maps `maps_loaded` event that triggers after all of the Google Maps have finished being set up.
78
+
79
  == 1.17.10 - 13 November 2020 ==
80
  * TinyMCE: Resolved issue with the Add Media button.
81
 
so-widgets-bundle.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: SiteOrigin Widgets Bundle
4
  Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
5
- Version: 1.17.10
6
  Text Domain: so-widgets-bundle
7
  Domain Path: /lang
8
  Author: SiteOrigin
@@ -12,7 +12,7 @@ License: GPL3
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
  */
14
 
15
- define('SOW_BUNDLE_VERSION', '1.17.10');
16
  define('SOW_BUNDLE_BASE_FILE', __FILE__);
17
 
18
  // Allow JS suffix to be pre-set
2
  /*
3
  Plugin Name: SiteOrigin Widgets Bundle
4
  Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
5
+ Version: 1.17.11
6
  Text Domain: so-widgets-bundle
7
  Domain Path: /lang
8
  Author: SiteOrigin
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
  */
14
 
15
+ define('SOW_BUNDLE_VERSION', '1.17.11');
16
  define('SOW_BUNDLE_BASE_FILE', __FILE__);
17
 
18
  // Allow JS suffix to be pre-set
widgets/contact/js/contact.js CHANGED
@@ -19,10 +19,10 @@ sowb.SiteOriginContactForm = {
19
  formPosition = $container.offset().top;
20
  // If the closest visible ancestor is either SOWB Accordion or Tabs widget, try to open the panel.
21
  if ( $container.is( '.sow-accordion-panel' ) ) {
22
- $container.find( '> .sow-accordion-panel-header' ).click();
23
  } else if ( $container.is( '.sow-tabs-panel-container' ) ) {
24
  var tabIndex = $el.closest( '.sow-tabs-panel' ).index();
25
- $container.siblings( '.sow-tabs-tab-container' ).find( '> .sow-tabs-tab' ).eq( tabIndex ).click();
26
  }
27
  }
28
  $( 'html, body' ).scrollTop( formPosition );
@@ -55,7 +55,7 @@ sowb.SiteOriginContactForm = {
55
  }
56
 
57
  // Disable the submit button on click to avoid multiple submits.
58
- $contactForms.submit( function () {
59
  $submitButton.prop( 'disabled', true );
60
  // Preserve existing anchors, if any.
61
  var locationHash = window.location.hash;
19
  formPosition = $container.offset().top;
20
  // If the closest visible ancestor is either SOWB Accordion or Tabs widget, try to open the panel.
21
  if ( $container.is( '.sow-accordion-panel' ) ) {
22
+ $container.find( '> .sow-accordion-panel-header-container > .sow-accordion-panel-header' ).trigger( 'click' );
23
  } else if ( $container.is( '.sow-tabs-panel-container' ) ) {
24
  var tabIndex = $el.closest( '.sow-tabs-panel' ).index();
25
+ $container.siblings( '.sow-tabs-tab-container' ).find( '> .sow-tabs-tab' ).eq( tabIndex ).trigger( 'click' );
26
  }
27
  }
28
  $( 'html, body' ).scrollTop( formPosition );
55
  }
56
 
57
  // Disable the submit button on click to avoid multiple submits.
58
+ $contactForms.on( 'submit', function() {
59
  $submitButton.prop( 'disabled', true );
60
  // Preserve existing anchors, if any.
61
  var locationHash = window.location.hash;
widgets/contact/js/contact.min.js CHANGED
@@ -1 +1 @@
1
- function soContactFormInitialize(){sowb.SiteOriginContactForm.init(window.jQuery,!0)}window.sowb=window.sowb||{},sowb.SiteOriginContactForm={init:function(i,t){var o=i("form.sow-contact-form,.sow-contact-form-success");o.each((function(){var a=i(this),e=a.attr("id"),n=window.location.hash.indexOf(e)>-1,s=a.is(".sow-contact-form-success");if(n){var r=a.offset().top;if(a.is(":hidden")){var c=a.closest(":visible");if(r=c.offset().top,c.is(".sow-accordion-panel"))c.find("> .sow-accordion-panel-header").click();else if(c.is(".sow-tabs-panel-container")){var f=a.closest(".sow-tabs-panel").index();c.siblings(".sow-tabs-tab-container").find("> .sow-tabs-tab").eq(f).click()}}if(i("html, body").scrollTop(r),s)return}var w=i(this).find(".sow-submit-wrapper > input.sow-submit");if(t){var d=a.find(".sow-recaptcha");if(d.length){var p=d.data("config");w.prop("disabled",!0),grecaptcha.render(d.get(0),{sitekey:p.sitekey,theme:p.theme,type:p.type,size:p.size,callback:function(i){w.prop("disabled",!1)}})}}o.submit((function(){w.prop("disabled",!0);var t=window.location.hash;if(t){var o=i(this).attr("action");if(t.indexOf(e)>-1){var a=new RegExp(e+",?","g");t=t.replace(a,"")}i(this).attr("action",o+","+t.replace(/^#/,""))}}))}))}},jQuery((function(i){var t=i("form.sow-contact-form").toArray().some((function(t){return i(t).find("div").hasClass("sow-recaptcha")}));if(t)if(window.recaptcha)sowb.SiteOriginContactForm.init(i,t);else{var o=i('<script type="text/javascript" src="https://www.google.com/recaptcha/api.js?onload=soContactFormInitialize&render=explicit" async defer>');i("body").append(o)}else sowb.SiteOriginContactForm.init(i,t)}));
1
+ function soContactFormInitialize(){sowb.SiteOriginContactForm.init(window.jQuery,!0)}window.sowb=window.sowb||{},sowb.SiteOriginContactForm={init:function(i,t){var o=i("form.sow-contact-form,.sow-contact-form-success");o.each((function(){var e=i(this),a=e.attr("id"),n=window.location.hash.indexOf(a)>-1,s=e.is(".sow-contact-form-success");if(n){var r=e.offset().top;if(e.is(":hidden")){var c=e.closest(":visible");if(r=c.offset().top,c.is(".sow-accordion-panel"))c.find("> .sow-accordion-panel-header-container > .sow-accordion-panel-header").trigger("click");else if(c.is(".sow-tabs-panel-container")){var w=e.closest(".sow-tabs-panel").index();c.siblings(".sow-tabs-tab-container").find("> .sow-tabs-tab").eq(w).trigger("click")}}if(i("html, body").scrollTop(r),s)return}var d=i(this).find(".sow-submit-wrapper > input.sow-submit");if(t){var f=e.find(".sow-recaptcha");if(f.length){var p=f.data("config");d.prop("disabled",!0),grecaptcha.render(f.get(0),{sitekey:p.sitekey,theme:p.theme,type:p.type,size:p.size,callback:function(i){d.prop("disabled",!1)}})}}o.on("submit",(function(){d.prop("disabled",!0);var t=window.location.hash;if(t){var o=i(this).attr("action");if(t.indexOf(a)>-1){var e=new RegExp(a+",?","g");t=t.replace(e,"")}i(this).attr("action",o+","+t.replace(/^#/,""))}}))}))}},jQuery((function(i){var t=i("form.sow-contact-form").toArray().some((function(t){return i(t).find("div").hasClass("sow-recaptcha")}));if(t)if(window.recaptcha)sowb.SiteOriginContactForm.init(i,t);else{var o=i('<script type="text/javascript" src="https://www.google.com/recaptcha/api.js?onload=soContactFormInitialize&render=explicit" async defer>');i("body").append(o)}else sowb.SiteOriginContactForm.init(i,t)}));
widgets/cta/js/cta.js CHANGED
@@ -11,7 +11,7 @@ jQuery( function ( $ ) {
11
  $t = $$.find( '.sow-cta-text' );
12
 
13
  if ( $t.outerHeight() > $b.outerHeight() ) {
14
- $b.css( 'margin-top', ( $t.outerHeight() - $b.outerHeight() ) / 2 );
15
  }
16
  } );
17
  };
11
  $t = $$.find( '.sow-cta-text' );
12
 
13
  if ( $t.outerHeight() > $b.outerHeight() ) {
14
+ $b.css( 'margin-top', ( $t.outerHeight() - $b.outerHeight() ) / 2 + 'px' );
15
  }
16
  } );
17
  };
widgets/cta/js/cta.min.js CHANGED
@@ -1 +1 @@
1
- var sowb=window.sowb||{};jQuery((function(t){var o=function(){t(".sow-cta-base").each((function(){var o=t(this),e=o.find(".so-widget-sow-button"),i=o.find(".sow-cta-text");i.outerHeight()>e.outerHeight()&&e.css("margin-top",(i.outerHeight()-e.outerHeight())/2)}))};o(),t(sowb).on("setup_widgets",o)}));
1
+ var sowb=window.sowb||{};jQuery((function(t){var o=function(){t(".sow-cta-base").each((function(){var o=t(this),e=o.find(".so-widget-sow-button"),i=o.find(".sow-cta-text");i.outerHeight()>e.outerHeight()&&e.css("margin-top",(i.outerHeight()-e.outerHeight())/2+"px")}))};o(),t(sowb).on("setup_widgets",o)}));
widgets/google-map/google-map.php CHANGED
@@ -882,9 +882,14 @@ class SiteOrigin_Widget_GoogleMap_Widget extends SiteOrigin_Widget {
882
 
883
  function get_form_teaser(){
884
  if( class_exists( 'SiteOrigin_Premium' ) ) return false;
885
-
 
 
 
 
 
886
  return sprintf(
887
- __( 'Get a curated list of predefined map styles with %sSiteOrigin Premium%s', 'so-widgets-bundle' ),
888
  '<a href="https://siteorigin.com/downloads/premium/?featured_addon=plugin/map-styles" target="_blank" rel="noopener noreferrer">',
889
  '</a>'
890
  );
882
 
883
  function get_form_teaser(){
884
  if( class_exists( 'SiteOrigin_Premium' ) ) return false;
885
+
886
+ if ( isset( $_GET['action'] ) && $_GET['action'] == 'so_widgets_setting_form' ) {
887
+ $teaser_text = __( 'Get additional map consent design settings with %sSiteOrigin Premium%s', 'so-widgets-bundle' );
888
+ } else {
889
+ $teaser_text = __( 'Get a curated list of predefined map styles with %sSiteOrigin Premium%s', 'so-widgets-bundle' );
890
+ }
891
  return sprintf(
892
+ $teaser_text,
893
  '<a href="https://siteorigin.com/downloads/premium/?featured_addon=plugin/map-styles" target="_blank" rel="noopener noreferrer">',
894
  '</a>'
895
  );
widgets/google-map/styles/default.less CHANGED
@@ -1,10 +1,18 @@
1
  @import "../../../base/less/mixins";
2
 
3
  @height: 480px;
 
4
  @map_consent: default;
5
- @map_consent_notice_text_color: #fff;
6
  @map_consent_notice_text_background: #000;
7
- @responsive_breakpoint: 780px;
 
 
 
 
 
 
 
8
 
9
  .sow-google-map-canvas {
10
  height: @height;
@@ -28,22 +36,40 @@
28
  background: fade( @map_consent_notice_text_background, 85% );
29
  color: @map_consent_notice_text_color;
30
  width: 100%;
31
- }
32
 
33
- .sow-google-map-consent-prompt-inner {
34
- margin: 0 auto;
35
- max-width: 780px;
36
- padding: 50px;
37
- text-align: center;
38
 
39
- @media (max-width: @responsive_breakpoint) {
40
- max-width: none;
41
- padding: 25px;
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
- button {
45
- display: block;
46
- margin: 10px auto 0;
 
 
 
47
  }
48
  }
49
  }
1
  @import "../../../base/less/mixins";
2
 
3
  @height: 480px;
4
+ @responsive_breakpoint: 780px;
5
  @map_consent: default;
6
+
7
  @map_consent_notice_text_background: #000;
8
+ @map_consent_notice_text_color: #fff;
9
+ @map_consent_notice_text_link: #fff;
10
+ @map_consent_notice_text_link_hover: #aaa;
11
+
12
+ @map_consent_notice_button_color: #fff;
13
+ @map_consent_notice_button_color_hover: #eee;
14
+ @map_consent_notice_button_background: #41a9d5;
15
+ @map_consent_notice_button_background_hover: #298fba;
16
 
17
  .sow-google-map-canvas {
18
  height: @height;
36
  background: fade( @map_consent_notice_text_background, 85% );
37
  color: @map_consent_notice_text_color;
38
  width: 100%;
 
39
 
40
+ .sow-google-map-consent-prompt-inner {
41
+ margin: 0 auto;
42
+ max-width: 780px;
43
+ padding: 50px;
44
+ text-align: center;
45
 
46
+ @media (max-width: @responsive_breakpoint) {
47
+ max-width: none;
48
+ padding: 25px;
49
+ }
50
+
51
+ a {
52
+ color: @map_consent_notice_text_link;
53
+ &:focus,
54
+ &:hover {
55
+ color: @map_consent_notice_text_link_hover;
56
+
57
+ }
58
+ }
59
+
60
+ button {
61
+ background: @map_consent_notice_button_background;
62
+ border: none;
63
+ color: @map_consent_notice_button_color;
64
+ display: block;
65
+ margin: 10px auto 0;
66
 
67
+ &:focus,
68
+ &:hover {
69
+ background: @map_consent_notice_button_background_hover;
70
+ color: @map_consent_notice_button_color_hover;
71
+ }
72
+ }
73
  }
74
  }
75
  }
widgets/image-grid/image-grid.php CHANGED
@@ -52,9 +52,16 @@ class SiteOrigin_Widgets_ImageGrid_Widget extends SiteOrigin_Widget {
52
  'label' => __( 'Images', 'so-widgets-bundle' ),
53
  'item_name' => __( 'Image', 'so-widgets-bundle' ),
54
  'item_label' => array(
55
- 'selector' => "[name*='title']",
56
- 'update_event' => 'change',
57
- 'value_method' => 'val'
 
 
 
 
 
 
 
58
  ),
59
  'fields' => array(
60
  'image' => array(
@@ -158,16 +165,21 @@ class SiteOrigin_Widgets_ImageGrid_Widget extends SiteOrigin_Widget {
158
  *
159
  * @return string The title of the image.
160
  */
161
- private function get_image_title($image) {
162
  if ( ! empty( $image['title'] ) ) {
163
  $title = $image['title'];
164
- } else {
165
- // We do not want to use the default image titles as they're based on the file name without the extension
166
- $file_name = pathinfo( get_post_meta( $image['image'], '_wp_attached_file', true ), PATHINFO_FILENAME );
167
- $title = get_the_title( $image['image'] );
168
- if ( $title == $file_name ) {
169
- $title = '';
 
 
 
170
  }
 
 
171
  }
172
 
173
  return $title;
52
  'label' => __( 'Images', 'so-widgets-bundle' ),
53
  'item_name' => __( 'Image', 'so-widgets-bundle' ),
54
  'item_label' => array(
55
+ 'selectorArray' => array(
56
+ array(
57
+ 'selector' => "[id*='title']",
58
+ 'valueMethod' => 'val',
59
+ ),
60
+ array(
61
+ 'selector' => '.media-field-wrapper .current .title',
62
+ 'valueMethod' => 'html'
63
+ ),
64
+ ),
65
  ),
66
  'fields' => array(
67
  'image' => array(
165
  *
166
  * @return string The title of the image.
167
  */
168
+ private function get_image_title( $image ) {
169
  if ( ! empty( $image['title'] ) ) {
170
  $title = $image['title'];
171
+ } else if ( apply_filters( 'siteorigin_widgets_auto_title', true, 'sow-image-grid' ) ) {
172
+ $title = wp_get_attachment_caption( $image['image'] );
173
+ if ( empty( $title ) ) {
174
+ // We do not want to use the default image titles as they're based on the file name without the extension
175
+ $file_name = pathinfo( get_post_meta( $image['image'], '_wp_attached_file', true ), PATHINFO_FILENAME );
176
+ $title = get_the_title( $image['image'] );
177
+ if ( $title == $file_name ) {
178
+ $title = '';
179
+ }
180
  }
181
+ } else {
182
+ $title = '';
183
  }
184
 
185
  return $title;
widgets/image-grid/js/image-grid.js CHANGED
@@ -27,7 +27,7 @@ jQuery( function ( $ ) {
27
 
28
  if ( width.length ) {
29
  width = Math.min.apply( Math, width );
30
- $img.css( 'max-width', width );
31
  }
32
 
33
  } );
@@ -40,7 +40,7 @@ jQuery( function ( $ ) {
40
  };
41
  alignImages();
42
 
43
- $( window ).resize( alignImages );
44
 
45
  var event = document.createEvent('Event');
46
  event.initEvent('layoutComplete', true, true);
27
 
28
  if ( width.length ) {
29
  width = Math.min.apply( Math, width );
30
+ $img.css( 'max-width', width + 'px' );
31
  }
32
 
33
  } );
40
  };
41
  alignImages();
42
 
43
+ $( window ).on( 'resize', alignImages );
44
 
45
  var event = document.createEvent('Event');
46
  event.initEvent('layoutComplete', true, true);
widgets/image-grid/js/image-grid.min.js CHANGED
@@ -1 +1 @@
1
- var sowb=window.sowb||{};jQuery((function(i){sowb.setupImageGrids=function(){i(".sow-image-grid-wrapper").each((function(){var t=i(this);t.imagesLoaded((function(){var a=t.data("max-width"),e=t.data("max-height");void 0!==a||void 0!==e?t.find("img").each((function(){var t=i(this).css("opacity",1),o=t.width()/t.height(),s=[];void 0!==a&&t.width()>a&&s.push(a),void 0!==e&&t.height()>e&&s.push(Math.round(e*o)),s.length&&(s=Math.min.apply(Math,s),t.css("max-width",s))})):t.find("img").css("opacity",1);var o=function(){};i(window).resize(o);var s=document.createEvent("Event");s.initEvent("layoutComplete",!0,!0),t.get(0).dispatchEvent(s)}))}))},sowb.setupImageGrids(),i(sowb).on("setup_widgets",sowb.setupImageGrids)})),window.sowb=sowb;
1
+ var sowb=window.sowb||{};jQuery((function(i){sowb.setupImageGrids=function(){i(".sow-image-grid-wrapper").each((function(){var t=i(this);t.imagesLoaded((function(){var a=t.data("max-width"),e=t.data("max-height");void 0!==a||void 0!==e?t.find("img").each((function(){var t=i(this).css("opacity",1),o=t.width()/t.height(),s=[];void 0!==a&&t.width()>a&&s.push(a),void 0!==e&&t.height()>e&&s.push(Math.round(e*o)),s.length&&(s=Math.min.apply(Math,s),t.css("max-width",s+"px"))})):t.find("img").css("opacity",1);var o=function(){};i(window).on("resize",o);var s=document.createEvent("Event");s.initEvent("layoutComplete",!0,!0),t.get(0).dispatchEvent(s)}))}))},sowb.setupImageGrids(),i(sowb).on("setup_widgets",sowb.setupImageGrids)})),window.sowb=sowb;
widgets/image/image.php CHANGED
@@ -115,17 +115,8 @@ class SiteOrigin_Widget_Image_Widget extends SiteOrigin_Widget {
115
  }
116
 
117
  public function get_template_variables( $instance, $args ) {
118
- // Workout the image title
119
- if ( ! empty( $instance['title'] ) ) {
120
- $title = $instance['title'];
121
- } else {
122
- // We do not want to use the default image titles as they're based on the file name without the extension
123
- $file_name = pathinfo( get_post_meta( $instance['image'], '_wp_attached_file', true ), PATHINFO_FILENAME );
124
- $title = get_the_title( $instance['image'] );
125
- if ( $title == $file_name ) {
126
- $title = '';
127
- }
128
- }
129
  $src = siteorigin_widgets_get_attachment_image_src(
130
  $instance['image'],
131
  $instance['size'],
@@ -187,6 +178,32 @@ class SiteOrigin_Widget_Image_Widget extends SiteOrigin_Widget {
187
  );
188
  }
189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
 
191
  function get_less_variables($instance){
192
  if ( empty( $instance ) ) {
115
  }
116
 
117
  public function get_template_variables( $instance, $args ) {
118
+ $title = $this->get_image_title( $instance );
119
+
 
 
 
 
 
 
 
 
 
120
  $src = siteorigin_widgets_get_attachment_image_src(
121
  $instance['image'],
122
  $instance['size'],
178
  );
179
  }
180
 
181
+ /**
182
+ * Try to figure out an image's title for display.
183
+ *
184
+ * @param $image
185
+ *
186
+ * @return string The title of the image.
187
+ */
188
+ private function get_image_title( $image ) {
189
+ if ( ! empty( $image['title'] ) ) {
190
+ $title = $image['title'];
191
+ } else if ( apply_filters( 'siteorigin_widgets_auto_title', true, 'sow-image' ) ) {
192
+ $title = wp_get_attachment_caption( $image['image'] );
193
+ if ( empty( $title ) ) {
194
+ // We do not want to use the default image titles as they're based on the file name without the extension
195
+ $file_name = pathinfo( get_post_meta( $image['image'], '_wp_attached_file', true ), PATHINFO_FILENAME );
196
+ $title = get_the_title( $image['image'] );
197
+ if ( $title == $file_name ) {
198
+ $title = '';
199
+ }
200
+ }
201
+ } else {
202
+ $title = '';
203
+ }
204
+
205
+ return $title;
206
+ }
207
 
208
  function get_less_variables($instance){
209
  if ( empty( $instance ) ) {
widgets/post-carousel/js/carousel.js CHANGED
@@ -148,11 +148,16 @@ jQuery( function ( $ ) {
148
  return;
149
  }
150
  e.preventDefault();
151
- $( this ).click();
152
  } );
153
 
154
  // Keyboard Navigation of carousel items.
155
  $( document ).on( 'keyup', '.sow-carousel-item', function( e ) {
 
 
 
 
 
156
  // Ensure left/right key was pressed
157
  if ( e.keyCode != 37 && e.keyCode != 39 ) {
158
  return;
148
  return;
149
  }
150
  e.preventDefault();
151
+ $( this ).trigger( 'click' );
152
  } );
153
 
154
  // Keyboard Navigation of carousel items.
155
  $( document ).on( 'keyup', '.sow-carousel-item', function( e ) {
156
+ // Was enter pressed?
157
+ if ( e.keyCode == 13 ) {
158
+ $( this ).find( 'h3 a' )[0].click();
159
+ }
160
+
161
  // Ensure left/right key was pressed
162
  if ( e.keyCode != 37 && e.keyCode != 39 ) {
163
  return;
widgets/post-carousel/js/carousel.min.js CHANGED
@@ -1 +1 @@
1
- var sowb=window.sowb||{};jQuery((function(i){sowb.setupCarousel=function(){i.fn.setSlideTo=function(e){$item=i(this);var s=$item.slick("slickGetOption","slidesToShow"),t=$item.slick("slickGetOption","slidesToScroll");$item.slick("slickSetOption","slidesToShow",1),$item.slick("slickSetOption","slidesToScroll",1),$item.slick("slickGoTo",e),$item.slick("slickSetOption","slidesToShow",s),$item.slick("slickSetOption","slidesToScroll",t)},i(".sow-carousel-wrapper").each((function(){var e=i(this),s=e.find(".sow-carousel-items"),t=e.data("responsive");s.not(".slick-initialized").slick({arrows:!1,infinite:!1,rows:0,rtl:"rtl"==e.data("dir"),touchThreshold:20,variableWidth:!0,accessibility:!1,slidesToScroll:t.desktop_slides,slidesToShow:t.desktop_slides,responsive:[{breakpoint:t.tablet_portrait_breakpoint,settings:{slidesToScroll:t.tablet_portrait_slides,slidesToShow:t.tablet_portrait_slides}},{breakpoint:t.mobile_breakpoint,settings:{slidesToScroll:t.mobile_slides,slidesToShow:t.mobile_slides}}]}),s.on("swipe",(function(i,s,t){e.parent().parent().find(".sow-carousel-"+("left"==t?"next":"prev")).trigger("touchend")})),e.parent().parent().find(".sow-carousel-previous, .sow-carousel-next").on("click touchend",(function(s,t){s.preventDefault();var o=e.find(".sow-carousel-items"),l=o.find(".sow-carousel-item").length,a=l===e.data("post-count"),n=Math.ceil(o.outerWidth()/o.find(".sow-carousel-item").outerWidth(!0)),c=l-n+1,r=o.slick("slickGetOption","slidesToScroll");if(!a&&(o.slick("slickCurrentSlide")+n>=l-1||o.slick("slickCurrentSlide")+r>c-1)&&!e.data("fetching")){e.data("fetching",!0);var d=e.data("page")+1;o.slick("slickAdd",'<div class="sow-carousel-item sow-carousel-loading"></div>'),i.get(e.data("ajax-url"),{action:"sow_carousel_load",paged:d,instance_hash:e.parent().parent().find('input[name="instance_hash"]').val()},(function(i,s){o.find(".sow-carousel-loading").remove(),o.slick("slickAdd",i.html),l=e.find(".sow-carousel-item").length,e.data("fetching",!1),e.data("page",d),t&&o.find('.sow-carousel-item[tabindex="0"]').trigger("focus")}))}i(this).hasClass("sow-carousel-next")?a&&o.slick("slickCurrentSlide")>=c?e.data("loop-posts-enabled")&&o.slick("slickGoTo",0):a&&o.slick("slickCurrentSlide")+n>=c?o.setSlideTo(c):o.slick("slickCurrentSlide")+r>c-1?o.setSlideTo(c):o.slick("slickNext"):i(this).hasClass("sow-carousel-previous")&&(e.data("loop-posts-enabled")&&0==o.slick("slickCurrentSlide")?o.slick("slickGoTo",c):o.slick("slickPrev"))}))})),i(document).on("keydown",".sow-carousel-navigation a",(function(e){13!=e.keyCode&&32!=e.keyCode||(e.preventDefault(),i(this).click())})),i(document).on("keyup",".sow-carousel-item",(function(e){if(37==e.keyCode||39==e.keyCode){var s=i(this).parents(".sow-carousel-wrapper"),t=s.find(".sow-carousel-items"),o=t.find(".sow-carousel-item").length,l=i(this).data("slick-index"),a=o-(o===s.data("post-count")?0:1);if(37==e.keyCode)--l<0&&(l=a);else if(39==e.keyCode&&++l>=a){if(s.data("fetching"))return;s.parent().find(".sow-carousel-next").trigger("click",!0)}t.slick("slickGoTo",l,!0),s.find(".sow-carousel-item").prop("tabindex",-1),s.find('.sow-carousel-item[data-slick-index="'+l+'"]').trigger("focus").prop("tabindex",0)}})),i(window).on("resize load",(function(){i(".sow-carousel-wrapper").each((function(){var e=i(this),s=e.find(".sow-carousel-items.slick-initialized"),t=Math.ceil(s.outerWidth()/s.find(".sow-carousel-item").outerWidth(!0)),o=e.parent().parent().find(".sow-carousel-navigation");t>=e.data("post-count")?(o.hide(),s.slick("slickSetOption","touchMove",!1),s.slick("slickSetOption","draggable",!1)):o.not(":visible")&&(o.show(),s.slick("slickSetOption","touchMove",!0),s.slick("slickSetOption","draggable",!0));var l=e.data("responsive");window.matchMedia("(min-width: "+l.tablet_portrait_breakpoint+"px) and (max-width: "+l.tablet_landscape_breakpoint+"px) and (orientation: landscape)").matches&&(s.slick("slickSetOption","slidesToShow",l.tablet_landscape_slides),s.slick("slickSetOption","slidesToScroll",l.tablet_landscape_slides))})),i(".sow-carousel-item:first-of-type").prop("tabindex",0)}))},sowb.setupCarousel(),i(sowb).on("setup_widgets",sowb.setupCarousel)})),window.sowb=sowb;
1
+ var sowb=window.sowb||{};jQuery((function(i){sowb.setupCarousel=function(){i.fn.setSlideTo=function(e){$item=i(this);var s=$item.slick("slickGetOption","slidesToShow"),t=$item.slick("slickGetOption","slidesToScroll");$item.slick("slickSetOption","slidesToShow",1),$item.slick("slickSetOption","slidesToScroll",1),$item.slick("slickGoTo",e),$item.slick("slickSetOption","slidesToShow",s),$item.slick("slickSetOption","slidesToScroll",t)},i(".sow-carousel-wrapper").each((function(){var e=i(this),s=e.find(".sow-carousel-items"),t=e.data("responsive");s.not(".slick-initialized").slick({arrows:!1,infinite:!1,rows:0,rtl:"rtl"==e.data("dir"),touchThreshold:20,variableWidth:!0,accessibility:!1,slidesToScroll:t.desktop_slides,slidesToShow:t.desktop_slides,responsive:[{breakpoint:t.tablet_portrait_breakpoint,settings:{slidesToScroll:t.tablet_portrait_slides,slidesToShow:t.tablet_portrait_slides}},{breakpoint:t.mobile_breakpoint,settings:{slidesToScroll:t.mobile_slides,slidesToShow:t.mobile_slides}}]}),s.on("swipe",(function(i,s,t){e.parent().parent().find(".sow-carousel-"+("left"==t?"next":"prev")).trigger("touchend")})),e.parent().parent().find(".sow-carousel-previous, .sow-carousel-next").on("click touchend",(function(s,t){s.preventDefault();var o=e.find(".sow-carousel-items"),l=o.find(".sow-carousel-item").length,a=l===e.data("post-count"),n=Math.ceil(o.outerWidth()/o.find(".sow-carousel-item").outerWidth(!0)),c=l-n+1,r=o.slick("slickGetOption","slidesToScroll");if(!a&&(o.slick("slickCurrentSlide")+n>=l-1||o.slick("slickCurrentSlide")+r>c-1)&&!e.data("fetching")){e.data("fetching",!0);var d=e.data("page")+1;o.slick("slickAdd",'<div class="sow-carousel-item sow-carousel-loading"></div>'),i.get(e.data("ajax-url"),{action:"sow_carousel_load",paged:d,instance_hash:e.parent().parent().find('input[name="instance_hash"]').val()},(function(i,s){o.find(".sow-carousel-loading").remove(),o.slick("slickAdd",i.html),l=e.find(".sow-carousel-item").length,e.data("fetching",!1),e.data("page",d),t&&o.find('.sow-carousel-item[tabindex="0"]').trigger("focus")}))}i(this).hasClass("sow-carousel-next")?a&&o.slick("slickCurrentSlide")>=c?e.data("loop-posts-enabled")&&o.slick("slickGoTo",0):a&&o.slick("slickCurrentSlide")+n>=c?o.setSlideTo(c):o.slick("slickCurrentSlide")+r>c-1?o.setSlideTo(c):o.slick("slickNext"):i(this).hasClass("sow-carousel-previous")&&(e.data("loop-posts-enabled")&&0==o.slick("slickCurrentSlide")?o.slick("slickGoTo",c):o.slick("slickPrev"))}))})),i(document).on("keydown",".sow-carousel-navigation a",(function(e){13!=e.keyCode&&32!=e.keyCode||(e.preventDefault(),i(this).trigger("click"))})),i(document).on("keyup",".sow-carousel-item",(function(e){if(13==e.keyCode&&i(this).find("h3 a")[0].click(),37==e.keyCode||39==e.keyCode){var s=i(this).parents(".sow-carousel-wrapper"),t=s.find(".sow-carousel-items"),o=t.find(".sow-carousel-item").length,l=i(this).data("slick-index"),a=o-(o===s.data("post-count")?0:1);if(37==e.keyCode)--l<0&&(l=a);else if(39==e.keyCode&&++l>=a){if(s.data("fetching"))return;s.parent().find(".sow-carousel-next").trigger("click",!0)}t.slick("slickGoTo",l,!0),s.find(".sow-carousel-item").prop("tabindex",-1),s.find('.sow-carousel-item[data-slick-index="'+l+'"]').trigger("focus").prop("tabindex",0)}})),i(window).on("resize load",(function(){i(".sow-carousel-wrapper").each((function(){var e=i(this),s=e.find(".sow-carousel-items.slick-initialized"),t=Math.ceil(s.outerWidth()/s.find(".sow-carousel-item").outerWidth(!0)),o=e.parent().parent().find(".sow-carousel-navigation");t>=e.data("post-count")?(o.hide(),s.slick("slickSetOption","touchMove",!1),s.slick("slickSetOption","draggable",!1)):o.not(":visible")&&(o.show(),s.slick("slickSetOption","touchMove",!0),s.slick("slickSetOption","draggable",!0));var l=e.data("responsive");window.matchMedia("(min-width: "+l.tablet_portrait_breakpoint+"px) and (max-width: "+l.tablet_landscape_breakpoint+"px) and (orientation: landscape)").matches&&(s.slick("slickSetOption","slidesToShow",l.tablet_landscape_slides),s.slick("slickSetOption","slidesToScroll",l.tablet_landscape_slides))})),i(".sow-carousel-item:first-of-type").prop("tabindex",0)}))},sowb.setupCarousel(),i(sowb).on("setup_widgets",sowb.setupCarousel)})),window.sowb=sowb;
widgets/post-carousel/post-carousel.php CHANGED
@@ -156,6 +156,7 @@ class SiteOrigin_Widget_PostCarousel_Widget extends SiteOrigin_Widget {
156
  'fields' => array(
157
  'posts_per_page' => array(
158
  'label' => __( 'Posts per load', 'so-widgets-bundle' ),
 
159
  ),
160
  ),
161
  ),
156
  'fields' => array(
157
  'posts_per_page' => array(
158
  'label' => __( 'Posts per load', 'so-widgets-bundle' ),
159
+ 'description' => __( 'Set the number of posts preloaded in the background when clicking next. The default is 10.', 'so-widgets-bundle' ),
160
  ),
161
  ),
162
  ),
widgets/price-table/js/pricetable.js CHANGED
@@ -43,8 +43,8 @@ jQuery( function ( $ ) {
43
 
44
  if ($('#so-pt-icon-' + icon).length) {
45
  var svg = $('#so-pt-icon-' + icon + ' svg').clone().css({
46
- 'max-width': 24,
47
- 'max-height': 24
48
  });
49
 
50
  if ($$.data('icon-color') !== '') {
43
 
44
  if ($('#so-pt-icon-' + icon).length) {
45
  var svg = $('#so-pt-icon-' + icon + ' svg').clone().css({
46
+ 'max-width': '24px',
47
+ 'max-height': '24px',
48
  });
49
 
50
  if ($$.data('icon-color') !== '') {
widgets/price-table/js/pricetable.min.js CHANGED
@@ -1 +1 @@
1
- var sowb=window.sowb||{};jQuery((function(i){var t=function(){i(".so-widget-sow-price-table").each((function(){var t=i(this);if(!t.is(":visible")||t.data("initialized"))return t;function o(){t.find(".sow-equalize-row-heights").each((function(){var t=i(this),o=function(o){var a=0,n=t.find(o);n.css("height",""),n.each((function(){a=Math.max(a,i(this).height())})),n.height(a)},a=0;t.find(".ow-pt-features").each((function(){a=Math.max(a,i(this).find(".ow-pt-feature").length)}));for(var n=0;n<a;n++)o(".ow-pt-feature-index-"+n);[".ow-pt-title",".ow-pt-details",".ow-pt-image",".ow-pt-features",".ow-pt-button"].forEach(o)})),i(".ow-pt-icon[data-icon]").each((function(){var t=i(this),o=t.data("icon");if(i("#so-pt-icon-"+o).length){var a=i("#so-pt-icon-"+o+" svg").clone().css({"max-width":24,"max-height":24});""!==t.data("icon-color")?a.find("path").css("fill",t.data("icon-color")):a.find("path").css("fill","#333333"),t.append(a)}}))}o(),i(window).on("resize orientationchange",o),t.data("initialized",!0)}))};t(),i(sowb).on("setup_widgets",t)}));
1
+ var sowb=window.sowb||{};jQuery((function(i){var t=function(){i(".so-widget-sow-price-table").each((function(){var t=i(this);if(!t.is(":visible")||t.data("initialized"))return t;function o(){t.find(".sow-equalize-row-heights").each((function(){var t=i(this),o=function(o){var a=0,n=t.find(o);n.css("height",""),n.each((function(){a=Math.max(a,i(this).height())})),n.height(a)},a=0;t.find(".ow-pt-features").each((function(){a=Math.max(a,i(this).find(".ow-pt-feature").length)}));for(var n=0;n<a;n++)o(".ow-pt-feature-index-"+n);[".ow-pt-title",".ow-pt-details",".ow-pt-image",".ow-pt-features",".ow-pt-button"].forEach(o)})),i(".ow-pt-icon[data-icon]").each((function(){var t=i(this),o=t.data("icon");if(i("#so-pt-icon-"+o).length){var a=i("#so-pt-icon-"+o+" svg").clone().css({"max-width":"24px","max-height":"24px"});""!==t.data("icon-color")?a.find("path").css("fill",t.data("icon-color")):a.find("path").css("fill","#333333"),t.append(a)}}))}o(),i(window).on("resize orientationchange",o),t.data("initialized",!0)}))};t(),i(sowb).on("setup_widgets",t)}));
widgets/simple-masonry/js/simple-masonry.js CHANGED
@@ -38,7 +38,7 @@ jQuery( function ( $ ) {
38
  rowSpan = Math.max( Math.min( rowSpan, layout.numColumns ), 1 );
39
  //Use rowHeight if non-zero else fall back to matching columnWidth.
40
  var rowHeight = layout.rowHeight || columnWidth;
41
- $$.css( 'height', ( rowHeight * rowSpan ) + ( layout.gutter * ( rowSpan - 1 ) ) );
42
 
43
  var $img = $$.find( '> img,> a > img' );
44
  var imgAR = $img.height() > 0 ? $img.width() / $img.height() : 1;
38
  rowSpan = Math.max( Math.min( rowSpan, layout.numColumns ), 1 );
39
  //Use rowHeight if non-zero else fall back to matching columnWidth.
40
  var rowHeight = layout.rowHeight || columnWidth;
41
+ $$.css( 'height', ( rowHeight * rowSpan ) + ( layout.gutter * ( rowSpan - 1 ) ) + 'px' );
42
 
43
  var $img = $$.find( '> img,> a > img' );
44
  var imgAR = $img.height() > 0 ? $img.width() / $img.height() : 1;
widgets/simple-masonry/js/simple-masonry.min.js CHANGED
@@ -1 +1 @@
1
- var sowb=window.sowb||{};jQuery((function(t){sowb.setupSimpleMasonries=function(){var i=t(".sow-masonry-grid");if(i.data("initialized"))return i;var a=function(){i.each((function(){var a=t(this),e=a.data("layouts"),s=window.matchMedia("(max-width: "+e.tablet.breakPoint+"px)"),o=window.matchMedia("(max-width: "+e.mobile.breakPoint+"px)"),n=e.desktop;o.matches?n=e.mobile:s.matches&&(n=e.tablet);var r=n.numColumns;a.css("width","auto");var h=n.gutter*(r-1),d=(a.width()-h)/r;a.width(d*r+h),a.imagesLoaded((function(){a.find("> .sow-masonry-grid-item").each((function(){var i=t(this),a=i.data("colSpan");a=Math.max(Math.min(a,n.numColumns),1),i.width(d*a+n.gutter*(a-1));var e=i.data("rowSpan");e=Math.max(Math.min(e,n.numColumns),1);var s=n.rowHeight||d;i.css("height",s*e+n.gutter*(e-1));var o=i.find("> img,> a > img"),r=o.height()>0?o.width()/o.height():1,h=i.height()>0?i.width()/i.height():1;if((r=parseFloat(r.toFixed(3)))>(h=parseFloat(h.toFixed(3)))){o.css("width","auto"),o.css("height","100%"),o.css("margin-top","");var m=-.5*(o.width()-i.width());o.css("margin-left",m+"px")}else{o.css("height","auto"),o.css("width","100%"),o.css("margin-left","");var w=-.5*(o.height()-i.height());o.css("margin-top",w+"px")}})),a.packery({itemSelector:".sow-masonry-grid-item",columnWidth:d,gutter:n.gutter,originLeft:a.data("layout-origin-left")}),i.prev(".sow-masonry-grid-preloader").length&&(i.prev().remove(),i.css("opacity",1))}))}))};t(window).on("resize panelsStretchRows",a),setTimeout((function(){a()}),100),i.data("initialized",!0)},sowb.setupSimpleMasonries(),t(sowb).on("setup_widgets",sowb.setupSimpleMasonries)})),window.sowb=sowb;
1
+ var sowb=window.sowb||{};jQuery((function(t){sowb.setupSimpleMasonries=function(){var i=t(".sow-masonry-grid");if(i.data("initialized"))return i;var a=function(){i.each((function(){var a=t(this),e=a.data("layouts"),s=window.matchMedia("(max-width: "+e.tablet.breakPoint+"px)"),o=window.matchMedia("(max-width: "+e.mobile.breakPoint+"px)"),n=e.desktop;o.matches?n=e.mobile:s.matches&&(n=e.tablet);var r=n.numColumns;a.css("width","auto");var h=n.gutter*(r-1),d=(a.width()-h)/r;a.width(d*r+h),a.imagesLoaded((function(){a.find("> .sow-masonry-grid-item").each((function(){var i=t(this),a=i.data("colSpan");a=Math.max(Math.min(a,n.numColumns),1),i.width(d*a+n.gutter*(a-1));var e=i.data("rowSpan");e=Math.max(Math.min(e,n.numColumns),1);var s=n.rowHeight||d;i.css("height",s*e+n.gutter*(e-1)+"px");var o=i.find("> img,> a > img"),r=o.height()>0?o.width()/o.height():1,h=i.height()>0?i.width()/i.height():1;if((r=parseFloat(r.toFixed(3)))>(h=parseFloat(h.toFixed(3)))){o.css("width","auto"),o.css("height","100%"),o.css("margin-top","");var m=-.5*(o.width()-i.width());o.css("margin-left",m+"px")}else{o.css("height","auto"),o.css("width","100%"),o.css("margin-left","");var w=-.5*(o.height()-i.height());o.css("margin-top",w+"px")}})),a.packery({itemSelector:".sow-masonry-grid-item",columnWidth:d,gutter:n.gutter,originLeft:a.data("layout-origin-left")}),i.prev(".sow-masonry-grid-preloader").length&&(i.prev().remove(),i.css("opacity",1))}))}))};t(window).on("resize panelsStretchRows",a),setTimeout((function(){a()}),100),i.data("initialized",!0)},sowb.setupSimpleMasonries(),t(sowb).on("setup_widgets",sowb.setupSimpleMasonries)})),window.sowb=sowb;
widgets/simple-masonry/simple-masonry.php CHANGED
@@ -229,6 +229,7 @@ class SiteOrigin_Widget_Simple_Masonry_Widget extends SiteOrigin_Widget {
229
  $link_atts['rel'] = 'noopener noreferrer';
230
  }
231
  $item['link_attributes'] = $link_atts;
 
232
  }
233
  return array(
234
  'args' => $args,
@@ -263,6 +264,33 @@ class SiteOrigin_Widget_Simple_Masonry_Widget extends SiteOrigin_Widget {
263
  );
264
  }
265
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  public function get_less_variables( $instance ) {
267
  if ( empty( $instance['preloader'] ) || ! $instance['preloader']['enabled'] ) {
268
  return array();
229
  $link_atts['rel'] = 'noopener noreferrer';
230
  }
231
  $item['link_attributes'] = $link_atts;
232
+ $item['title'] = $this->get_image_title( $item );
233
  }
234
  return array(
235
  'args' => $args,
264
  );
265
  }
266
 
267
+ /**
268
+ * Try to figure out an image's title for display.
269
+ *
270
+ * @param $image
271
+ *
272
+ * @return string The title of the image.
273
+ */
274
+ private function get_image_title( $image ) {
275
+ if ( ! empty( $image['title'] ) ) {
276
+ $title = $image['title'];
277
+ } else if ( apply_filters( 'siteorigin_widgets_auto_title', true, 'sow-simple-masonry' ) ) {
278
+ $title = wp_get_attachment_caption( $image['image'] );
279
+ if ( empty( $title ) ) {
280
+ // We do not want to use the default image titles as they're based on the file name without the extension
281
+ $file_name = pathinfo( get_post_meta( $image['image'], '_wp_attached_file', true ), PATHINFO_FILENAME );
282
+ $title = get_the_title( $image['image'] );
283
+ if ( $title == $file_name ) {
284
+ return;
285
+ }
286
+ }
287
+ } else {
288
+ $title = '';
289
+ }
290
+
291
+ return $title;
292
+ }
293
+
294
  public function get_less_variables( $instance ) {
295
  if ( empty( $instance['preloader'] ) || ! $instance['preloader']['enabled'] ) {
296
  return array();
widgets/slider/slider.php CHANGED
@@ -168,7 +168,7 @@ class SiteOrigin_Widget_Slider_Widget extends SiteOrigin_Widget_Base_Slider {
168
  !empty( $frame['foreground_image_fallback'] ) ? $frame['foreground_image_fallback'] : '',
169
  array(
170
  'class' => 'sow-slider-foreground-image',
171
- 'loading' => true,
172
  )
173
  );
174
  ?>
@@ -198,7 +198,7 @@ class SiteOrigin_Widget_Slider_Widget extends SiteOrigin_Widget_Base_Slider {
198
  !empty( $frame['background_image_fallback'] ) ? $frame['background_image_fallback'] : '',
199
  array(
200
  'class' => 'sow-slider-background-image',
201
- 'loading' => true,
202
  )
203
  );
204
 
168
  !empty( $frame['foreground_image_fallback'] ) ? $frame['foreground_image_fallback'] : '',
169
  array(
170
  'class' => 'sow-slider-foreground-image',
171
+ 'loading' => 'eager',
172
  )
173
  );
174
  ?>
198
  !empty( $frame['background_image_fallback'] ) ? $frame['background_image_fallback'] : '',
199
  array(
200
  'class' => 'sow-slider-background-image',
201
+ 'loading' => 'eager',
202
  )
203
  );
204
 
widgets/tabs/js/tabs.js CHANGED
@@ -35,11 +35,21 @@ jQuery( function ( $ ) {
35
  window.scrollTo( 0, scrollTop );
36
  }
37
  };
38
-
 
 
 
 
 
 
 
 
39
  var selectTab = function ( tab, preventHashChange ) {
40
  var $tab = $( tab );
41
  if ( $tab.is( '.sow-tabs-tab-selected' ) ) {
42
- scrollToTab( true );
 
 
43
  return true;
44
  }
45
  var selectedIndex = $tab.index();
@@ -79,11 +89,8 @@ jQuery( function ( $ ) {
79
  },
80
  complete: function() {
81
  $( this ).trigger( 'show' );
82
- if ( ! sowTabs.scrollto_after_change ) {
83
- return;
84
- }
85
 
86
- if ( $tab.offset().top < window.scrollY || $tab.offset().top + $tab.height() > window.scrollY ) {
87
  scrollToTab( true );
88
  }
89
  }
@@ -98,11 +105,11 @@ jQuery( function ( $ ) {
98
  }
99
  };
100
 
101
- $tabs.click( function() {
102
  selectTab( this );
103
  } );
104
 
105
- $tabs.keyup( function( e ) {
106
  var $currentTab = $( this );
107
 
108
  if ( e.keyCode !== 37 && e.keyCode !== 39 ){
@@ -132,7 +139,7 @@ jQuery( function ( $ ) {
132
  if ( $currentTab === $newTab ){
133
  return;
134
  }
135
- $newTab.focus();
136
  selectTab( $newTab.get(0) );
137
  } );
138
 
35
  window.scrollTo( 0, scrollTop );
36
  }
37
  };
38
+
39
+ var shouldScroll = function( $tab ) {
40
+ return sowTabs.scrollto_after_change &&
41
+ (
42
+ $tab.offset().top < window.scrollY ||
43
+ $tab.offset().top + $tab.height() > window.scrollY
44
+ );
45
+ }
46
+
47
  var selectTab = function ( tab, preventHashChange ) {
48
  var $tab = $( tab );
49
  if ( $tab.is( '.sow-tabs-tab-selected' ) ) {
50
+ if ( shouldScroll( $tab ) ) {
51
+ scrollToTab( true );
52
+ }
53
  return true;
54
  }
55
  var selectedIndex = $tab.index();
89
  },
90
  complete: function() {
91
  $( this ).trigger( 'show' );
 
 
 
92
 
93
+ if ( shouldScroll( $tab ) ) {
94
  scrollToTab( true );
95
  }
96
  }
105
  }
106
  };
107
 
108
+ $tabs.on( 'click', function() {
109
  selectTab( this );
110
  } );
111
 
112
+ $tabs.on( 'keyup', function( e ) {
113
  var $currentTab = $( this );
114
 
115
  if ( e.keyCode !== 37 && e.keyCode !== 39 ){
139
  if ( $currentTab === $newTab ){
140
  return;
141
  }
142
+ $newTab.trigger( 'focus' );
143
  selectTab( $newTab.get(0) );
144
  } );
145
 
widgets/tabs/js/tabs.min.js CHANGED
@@ -1 +1 @@
1
- var sowb=window.sowb||{};jQuery((function(t){sowb.setupTabs=function(){t(".sow-tabs").each((function(e,a){var s=t(a),i=s.closest(".so-widget-sow-tabs");if(i.data("initialized"))return t(this);var o,n=i.data("useAnchorTags"),r=s.find("> .sow-tabs-panel-container"),d=s.find("> .sow-tabs-tab-container > .sow-tabs-tab"),c=s.find(".sow-tabs-tab-selected").index(),w=r.find("> .sow-tabs-panel");w.not(":eq("+c+")").hide();var l=function(e){var a=i.offset().top-90;e?t("body,html").animate({scrollTop:a},200):window.scrollTo(0,a)},b=function(e,a){var s=t(e);if(s.is(".sow-tabs-tab-selected"))return l(!0),!0;var i=s.index();if(i>-1){o&&o.finish();var r=d.filter(".sow-tabs-tab-selected");r.removeClass("sow-tabs-tab-selected");var c=r.index(),b=w.eq(c).children(),f=w.eq(i).children();r.attr("tabindex",-1),r.attr("aria-selected",!1),b.attr("tabindex",-1),s.attr("tabindex",0),s.attr("aria-selected",!0),f.attr("tabindex",0),b.attr("aria-hidden","true"),o=w.eq(c).fadeOut("fast",(function(){t(this).trigger("hide"),f.removeAttr("aria-hidden"),w.eq(i).fadeIn({duration:"fast",start:function(){t(window).trigger("resize"),t(sowb).trigger("setup_widgets")},complete:function(){t(this).trigger("show"),sowTabs.scrollto_after_change&&(s.offset().top<window.scrollY||s.offset().top+s.height()>window.scrollY)&&l(!0)}})})),s.addClass("sow-tabs-tab-selected"),n&&!a&&(window.location.hash=s.data("anchor"))}};if(d.click((function(){b(this)})),d.keyup((function(e){var a,s=t(this);37!==e.keyCode&&39!==e.keyCode||(37===e.keyCode&&(a=s.prev().get(0)?s.prev():s.siblings().last()),39===e.keyCode&&(a=s.next().get(0)?s.next():s.siblings().first()),s!==a&&(a.focus(),b(a.get(0))))})),n){var f=function(){window.location.hash&&window.location.hash.substring(1).split(",").forEach((function(e){var a=d.filter((function(a,s){return decodeURI(e)===decodeURI(t(s).data("anchor"))}));a.length>0&&b(a,!0)}))};t(window).on("hashchange",f),window.location.hash&&f()}i.data("initialized",!0)}))},sowb.setupTabs(),t(sowb).on("setup_widgets",sowb.setupTabs)})),window.sowb=sowb;
1
+ var sowb=window.sowb||{};jQuery((function(t){sowb.setupTabs=function(){t(".sow-tabs").each((function(e,a){var i=t(a),o=i.closest(".so-widget-sow-tabs");if(o.data("initialized"))return t(this);var s,n=o.data("useAnchorTags"),r=i.find("> .sow-tabs-panel-container"),d=i.find("> .sow-tabs-tab-container > .sow-tabs-tab"),c=i.find(".sow-tabs-tab-selected").index(),w=r.find("> .sow-tabs-panel");w.not(":eq("+c+")").hide();var l=function(e){var a=o.offset().top-90;e?t("body,html").animate({scrollTop:a},200):window.scrollTo(0,a)},b=function(t){return sowTabs.scrollto_after_change&&(t.offset().top<window.scrollY||t.offset().top+t.height()>window.scrollY)},f=function(e,a){var i=t(e);if(i.is(".sow-tabs-tab-selected"))return b(i)&&l(!0),!0;var o=i.index();if(o>-1){s&&s.finish();var r=d.filter(".sow-tabs-tab-selected");r.removeClass("sow-tabs-tab-selected");var c=r.index(),f=w.eq(c).children(),h=w.eq(o).children();r.attr("tabindex",-1),r.attr("aria-selected",!1),f.attr("tabindex",-1),i.attr("tabindex",0),i.attr("aria-selected",!0),h.attr("tabindex",0),f.attr("aria-hidden","true"),s=w.eq(c).fadeOut("fast",(function(){t(this).trigger("hide"),h.removeAttr("aria-hidden"),w.eq(o).fadeIn({duration:"fast",start:function(){t(window).trigger("resize"),t(sowb).trigger("setup_widgets")},complete:function(){t(this).trigger("show"),b(i)&&l(!0)}})})),i.addClass("sow-tabs-tab-selected"),n&&!a&&(window.location.hash=i.data("anchor"))}};if(d.on("click",(function(){f(this)})),d.on("keyup",(function(e){var a,i=t(this);37!==e.keyCode&&39!==e.keyCode||(37===e.keyCode&&(a=i.prev().get(0)?i.prev():i.siblings().last()),39===e.keyCode&&(a=i.next().get(0)?i.next():i.siblings().first()),i!==a&&(a.trigger("focus"),f(a.get(0))))})),n){var h=function(){window.location.hash&&window.location.hash.substring(1).split(",").forEach((function(e){var a=d.filter((function(a,i){return decodeURI(e)===decodeURI(t(i).data("anchor"))}));a.length>0&&f(a,!0)}))};t(window).on("hashchange",h),window.location.hash&&h()}o.data("initialized",!0)}))},sowb.setupTabs(),t(sowb).on("setup_widgets",sowb.setupTabs)})),window.sowb=sowb;