Advanced Custom Fields - Version 5.7.3

Version Description

Release Date - 20 August 2018

  • New - Added Dark Mode styles for the Dark Mode Plugin.
  • New - Added "Value Contains" condition to the Select field type.
  • New - Added support for the WooCommerce product type dropdown to trigger "update metaboxes".
  • Tweak - Improved acf.screen model responsible for "updating metaboxes" when changing post data.
  • Tweak - Removed user fields from the multisite "Add New User" page.
  • Fix - Fixed bug preventing some tinymce customizations from working.
  • Fix - Fixed JS bug throwing "preference" error in console.
  • Dev - Added action 'acf/enqueue_uploader' triggered after the hidden "ACF Content" editor is rendered.
Download this release

Release Info

Developer elliotcondon
Plugin Icon 128x128 Advanced Custom Fields
Version 5.7.3
Comparing to
See all releases

Code changes from version 5.7.2 to 5.7.3

acf.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Advanced Custom Fields
4
  Plugin URI: https://www.advancedcustomfields.com/
5
  Description: Customise WordPress with powerful, professional and intuitive fields.
6
- Version: 5.7.2
7
  Author: Elliot Condon
8
  Author URI: http://www.elliotcondon.com/
9
  Copyright: Elliot Condon
@@ -18,7 +18,7 @@ if( ! class_exists('ACF') ) :
18
  class ACF {
19
 
20
  /** @var string The plugin version number */
21
- var $version = '5.7.2';
22
 
23
  /** @var array The plugin settings array */
24
  var $settings = array();
@@ -155,6 +155,7 @@ class ACF {
155
 
156
  // ajax
157
  acf_include('includes/ajax/class-acf-ajax.php');
 
158
  acf_include('includes/ajax/class-acf-ajax-user-setting.php');
159
  acf_include('includes/ajax/class-acf-ajax-query.php');
160
  acf_include('includes/ajax/class-acf-ajax-query-terms.php');
3
  Plugin Name: Advanced Custom Fields
4
  Plugin URI: https://www.advancedcustomfields.com/
5
  Description: Customise WordPress with powerful, professional and intuitive fields.
6
+ Version: 5.7.3
7
  Author: Elliot Condon
8
  Author URI: http://www.elliotcondon.com/
9
  Copyright: Elliot Condon
18
  class ACF {
19
 
20
  /** @var string The plugin version number */
21
+ var $version = '5.7.3';
22
 
23
  /** @var array The plugin settings array */
24
  var $settings = array();
155
 
156
  // ajax
157
  acf_include('includes/ajax/class-acf-ajax.php');
158
+ acf_include('includes/ajax/class-acf-ajax-check-screen.php');
159
  acf_include('includes/ajax/class-acf-ajax-user-setting.php');
160
  acf_include('includes/ajax/class-acf-ajax-query.php');
161
  acf_include('includes/ajax/class-acf-ajax-query-terms.php');
assets/_build/css/acf-dark.less ADDED
@@ -0,0 +1,401 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * acf-dark.scss
3
+ *
4
+ * Dark Mode Styles for ACF.
5
+ * WordPress plugin: https://en-au.wordpress.org/plugins/dark-mode/
6
+ * Github Documentation: https://github.com/danieltj27/Dark-Mode/wiki/Help:-Plugin-Compatibility-Guide
7
+ *
8
+ * @date 14/8/18
9
+ * @since 5.7.3
10
+ */
11
+
12
+ @white: #ffffff;
13
+ @black: #000000;
14
+ @blue: #0073aa;
15
+ @medium-blue: #00a0d2;
16
+ @clear: transparent;
17
+
18
+ @accent-red: #dc3232;
19
+ @accent-orange: #f56e28;
20
+ @accent-yellow: #ffb900;
21
+ @accent-green: #46b450;
22
+ @accent-blue: @blue;
23
+ @accent-purple: #826eb4;
24
+
25
+ @base-grey: #23282d;
26
+ @light-grey: #bbc8d4;
27
+ @heavy-grey: #37444c;
28
+ @dark-grey: #32373c;
29
+ @ultra-grey: #191f25;
30
+ @dark-silver: #50626f;
31
+ @base-blue: #2e74aa;
32
+ @light-blue: #4092d2;
33
+ @dark-blue: #2c5f88;
34
+ @ultra-blue: #1f3f58;
35
+ @bright-blue: #30ceff;
36
+
37
+ @editor-lavender: #c678dd;
38
+ @editor-sunglo: #e06c75;
39
+ @editor-olivine: #98c379;
40
+
41
+ @body_text: #bbc8d4;
42
+ @body_background: #23282d;
43
+ @body_background2: #191f25;
44
+ @postbox_background: #32373c;
45
+ @postbox_border: #191f25;
46
+ @postbox_divider: #23282d;
47
+ @input_background: #50626f;
48
+ @input_text: #fff;
49
+ @input_border: #191f25;
50
+
51
+ .dark-text() {
52
+ color: @body_text;
53
+ }
54
+ .dark-heading() {
55
+ color: @body_text;
56
+ }
57
+ .dark-border() {
58
+ border-color: @postbox_border;
59
+ }
60
+ .dark-background() {
61
+ background: @body_background;
62
+ }
63
+ .darker-background() {
64
+ background: darken(@body_background, 5%);
65
+ }
66
+ .dark-postbox() {
67
+ background-color: @postbox_background;
68
+ border-color: @postbox_border;
69
+ color: @body_text;
70
+ }
71
+ .dark-postbox-block() {
72
+ background-color: #2d3136;
73
+ border-color: @postbox_divider;
74
+ }
75
+ .dark-divider() {
76
+ border-color: @postbox_divider;
77
+ }
78
+ .dark-input() {
79
+ background-color: @input_background;
80
+ border-color: @input_border;
81
+ color: @input_text;
82
+ }
83
+
84
+
85
+ /*---------------------------------------------------------------------------------------------
86
+ *
87
+ * Global
88
+ *
89
+ *---------------------------------------------------------------------------------------------*/
90
+
91
+ // acf-box
92
+ .acf-box {
93
+ .dark-postbox();
94
+
95
+ .title,
96
+ .footer {
97
+ .dark-divider();
98
+ }
99
+
100
+ h2 {
101
+ .dark-heading();
102
+ }
103
+
104
+ table, tbody, tr {
105
+ background: transparent !important;
106
+ }
107
+ }
108
+
109
+ // thead
110
+ .acf-thead {
111
+ .dark-heading();
112
+ .dark-border();
113
+ }
114
+ .acf-tfoot {
115
+ .dark-postbox-block();
116
+ }
117
+
118
+ // table clear
119
+ .acf-table.-clear,
120
+ .acf-table.-clear tr {
121
+ background: transparent !important;
122
+ }
123
+
124
+ // loading overlay
125
+ .acf-loading-overlay {
126
+ background: rgba(0,0,0,0.5);
127
+ }
128
+
129
+
130
+ /*---------------------------------------------------------------------------------------------
131
+ *
132
+ * Fields
133
+ *
134
+ *---------------------------------------------------------------------------------------------*/
135
+
136
+ // fields
137
+ .acf-fields {
138
+
139
+ // field
140
+ > .acf-field {
141
+ .dark-divider();
142
+ }
143
+ }
144
+
145
+ // fields (left)
146
+ .acf-fields.-left {
147
+
148
+ > .acf-field {
149
+ &:before {
150
+ background: rgba(0,0,0,0.1);
151
+ .dark-divider();
152
+ }
153
+ }
154
+ }
155
+
156
+ // fields (border)
157
+ .acf-fields.-border {
158
+ .dark-postbox();
159
+ }
160
+
161
+ // width
162
+ .acf-field[data-width] + .acf-field[data-width] {
163
+ .dark-divider();
164
+ }
165
+
166
+ // text
167
+ .acf-input-prepend,
168
+ .acf-input-append {
169
+ .dark-postbox();
170
+ }
171
+
172
+ // tab
173
+ .acf-tab-wrap {
174
+
175
+
176
+ }
177
+
178
+ .acf-fields > .acf-tab-wrap {
179
+ .dark-postbox();
180
+
181
+ .acf-tab-group {
182
+ .dark-postbox-block();
183
+
184
+ li {
185
+ a {
186
+ .dark-postbox-block();
187
+
188
+ &:hover {
189
+ .dark-postbox-block();
190
+ .dark-text();
191
+ }
192
+ }
193
+
194
+ &.active a {
195
+ .dark-postbox();
196
+ }
197
+ }
198
+
199
+ }
200
+ }
201
+
202
+ // file
203
+ .acf-file-uploader {
204
+
205
+ .show-if-value {
206
+ .dark-postbox();
207
+
208
+ .file-icon {
209
+ .dark-postbox-block();
210
+ }
211
+ }
212
+ }
213
+
214
+ // acf-oembed
215
+ .acf-oembed {
216
+ .dark-postbox-block();
217
+
218
+ .title {
219
+ .dark-input();
220
+ }
221
+ }
222
+
223
+ // gallery
224
+ .acf-gallery {
225
+ .dark-postbox-block();
226
+
227
+ .acf-gallery-main {
228
+ .dark-background();
229
+ }
230
+
231
+ .acf-gallery-attachment {
232
+ .margin {
233
+ .dark-postbox-block();
234
+ }
235
+ }
236
+
237
+ .acf-gallery-side {
238
+ .dark-postbox-block();
239
+
240
+ .acf-gallery-side-info {
241
+ .dark-postbox-block();
242
+ }
243
+ }
244
+
245
+ .acf-gallery-toolbar {
246
+ .dark-postbox-block();
247
+ }
248
+ }
249
+
250
+ // button group
251
+ .acf-button-group {
252
+
253
+ label:not(.selected) {
254
+ .dark-postbox-block();
255
+ }
256
+ }
257
+
258
+ // switch
259
+ .acf-switch:not(.-on) {
260
+ .dark-postbox-block();
261
+ .acf-switch-slider {
262
+ .dark-input();
263
+ }
264
+ }
265
+
266
+ // link
267
+ .acf-link .link-wrap {
268
+ .dark-postbox-block();
269
+ }
270
+
271
+ // relationship
272
+ .acf-relationship {
273
+ .filters {
274
+ .dark-postbox();
275
+ }
276
+ .selection {
277
+ .dark-postbox-block();
278
+ .choices,
279
+ .choices-list,
280
+ .values {
281
+ .dark-postbox-block();
282
+ }
283
+ }
284
+ }
285
+
286
+ // checkbox
287
+ .acf-taxonomy-field .categorychecklist-holder {
288
+ .dark-postbox-block();
289
+ }
290
+
291
+ // google map
292
+ .acf-google-map {
293
+ .dark-postbox-block();
294
+
295
+ .title {
296
+ .dark-input();
297
+ }
298
+ }
299
+
300
+ // accordion
301
+ .acf-accordion {
302
+ .dark-postbox();
303
+ }
304
+ .acf-field.acf-accordion .acf-accordion-content > .acf-fields {
305
+ .dark-border();
306
+ }
307
+
308
+ // flexible content
309
+ .acf-flexible-content {
310
+ .layout {
311
+ .dark-postbox();
312
+
313
+ .acf-fc-layout-handle {
314
+ .dark-postbox-block();
315
+ }
316
+ }
317
+ }
318
+
319
+ // repeater
320
+ #wpbody .acf-repeater {
321
+ > .acf-table {
322
+ .dark-postbox-block();
323
+
324
+ > tbody,
325
+ > thead {
326
+ > tr {
327
+ background: transparent;
328
+
329
+ > td,
330
+ > th {
331
+ .dark-border();
332
+ }
333
+ }
334
+ }
335
+ }
336
+ }
337
+
338
+ /*---------------------------------------------------------------------------------------------
339
+ *
340
+ * Field Group
341
+ *
342
+ *---------------------------------------------------------------------------------------------*/
343
+
344
+ // fields
345
+ #acf-field-group-fields {
346
+
347
+ // field list
348
+ .acf-field-list-wrap {
349
+ .dark-postbox();
350
+ }
351
+
352
+ // field
353
+ .acf-field-object {
354
+ .dark-postbox();
355
+ .dark-divider();
356
+
357
+
358
+ table, tbody, tr, td, th {
359
+ background: transparent;
360
+ .dark-divider();
361
+ }
362
+
363
+ .acf-field {
364
+ .acf-label {
365
+ .dark-postbox-block();
366
+ }
367
+ }
368
+
369
+ // sortable
370
+ &.ui-sortable-helper {
371
+ .dark-border();
372
+ box-shadow: none;
373
+ }
374
+
375
+ &.ui-sortable-placeholder {
376
+ .dark-postbox-block();
377
+ box-shadow: none;
378
+ }
379
+ }
380
+
381
+ .acf-field-object + .acf-field-object-tab::before,
382
+ .acf-field-object + .acf-field-object-accordion::before {
383
+ .dark-postbox-block();
384
+ }
385
+ }
386
+
387
+
388
+ /*---------------------------------------------------------------------------------------------
389
+ *
390
+ * Admin: Tools
391
+ *
392
+ *---------------------------------------------------------------------------------------------*/
393
+
394
+ // tools
395
+ .acf-meta-box-wrap {
396
+
397
+ .acf-fields {
398
+ .dark-input();
399
+ background: transparent;
400
+ }
401
+ }
assets/_build/css/global.less CHANGED
@@ -600,7 +600,6 @@ a.acf-icon.-cancel.grey:hover {
600
  border-bottom: 1px solid #EEEEEE;
601
  margin: 0;
602
  padding: 15px;
603
- background: #FFFFFF;
604
 
605
  h3 {
606
  font-size: 14px;
@@ -643,7 +642,6 @@ a.acf-icon.-cancel.grey:hover {
643
 
644
  /* footer */
645
  .footer {
646
- background: #fff;
647
  border-top: 1px solid #eee;
648
  padding: 12px;
649
  font-size: 13px;
@@ -1021,15 +1019,14 @@ a.acf-icon.-cancel.grey:hover {
1021
 
1022
 
1023
  .acf-thead {
1024
- background: #FFFFFF;
1025
  border-bottom: #E1E1E1 solid 1px;
 
1026
  }
1027
 
1028
  .acf-thead > li {
1029
  font-size: 14px;
1030
  line-height: 1.4em;
1031
  font-family: "Open Sans",sans-serif;
1032
- color: #222222;
1033
  font-weight: bold;
1034
  }
1035
 
@@ -1044,12 +1041,6 @@ a.acf-icon.-cancel.grey:hover {
1044
  line-height: 27px;
1045
  }
1046
 
1047
- .acf-tfoot > li.comic-sans {
1048
- font-family: Comic Sans MS, sans-serif;
1049
- font-size: 11px;
1050
- }
1051
-
1052
-
1053
  /*--------------------------------------------------------------------------------------------
1054
  *
1055
  * Settings
@@ -1773,7 +1764,6 @@ html[dir="rtl"] .acf-table > tbody > tr > td.order + td {
1773
  }
1774
  }
1775
 
1776
-
1777
  /*---------------------------------------------------------------------------------------------
1778
  *
1779
  * Retina
600
  border-bottom: 1px solid #EEEEEE;
601
  margin: 0;
602
  padding: 15px;
 
603
 
604
  h3 {
605
  font-size: 14px;
642
 
643
  /* footer */
644
  .footer {
 
645
  border-top: 1px solid #eee;
646
  padding: 12px;
647
  font-size: 13px;
1019
 
1020
 
1021
  .acf-thead {
 
1022
  border-bottom: #E1E1E1 solid 1px;
1023
+ color: #23282d;
1024
  }
1025
 
1026
  .acf-thead > li {
1027
  font-size: 14px;
1028
  line-height: 1.4em;
1029
  font-family: "Open Sans",sans-serif;
 
1030
  font-weight: bold;
1031
  }
1032
 
1041
  line-height: 27px;
1042
  }
1043
 
 
 
 
 
 
 
1044
  /*--------------------------------------------------------------------------------------------
1045
  *
1046
  * Settings
1764
  }
1765
  }
1766
 
 
1767
  /*---------------------------------------------------------------------------------------------
1768
  *
1769
  * Retina
assets/_build/js/acf-compatibility.js CHANGED
@@ -746,7 +746,8 @@
746
  acf.newCompatibility(acf.screen, {
747
  update: function(){
748
  return this.set.apply(this, arguments);
749
- }
 
750
  });
751
  _acf.ajax = acf.screen;
752
 
746
  acf.newCompatibility(acf.screen, {
747
  update: function(){
748
  return this.set.apply(this, arguments);
749
+ },
750
+ fetch: acf.screen.check
751
  });
752
  _acf.ajax = acf.screen;
753
 
assets/_build/js/acf-condition-types.js CHANGED
@@ -190,7 +190,7 @@
190
  type: 'contains',
191
  operator: '==contains',
192
  label: __('Value contains'),
193
- fieldTypes: [ 'text', 'textarea', 'number', 'email', 'url', 'password', 'wysiwyg', 'oembed' ],
194
  match: function( rule, field ){
195
  return containsString( field.val(), rule.value );
196
  },
190
  type: 'contains',
191
  operator: '==contains',
192
  label: __('Value contains'),
193
+ fieldTypes: [ 'text', 'textarea', 'number', 'email', 'url', 'password', 'wysiwyg', 'oembed', 'select' ],
194
  match: function( rule, field ){
195
  return containsString( field.val(), rule.value );
196
  },
assets/_build/js/acf-field-google-map.js CHANGED
@@ -57,8 +57,8 @@
57
  val[ $(this).data('name') ] = $(this).val();
58
  });
59
 
60
- // return false if no address
61
- if( !val.address ) {
62
  val = false;
63
  }
64
 
@@ -80,8 +80,8 @@
80
  acf.val( this.$input(name), val[name] );
81
  }
82
 
83
- // return false if no address
84
- if( !val.address ) {
85
  val = false;
86
  }
87
 
57
  val[ $(this).data('name') ] = $(this).val();
58
  });
59
 
60
+ // return false if no lat/lng
61
+ if( !val.lat || !val.lng ) {
62
  val = false;
63
  }
64
 
80
  acf.val( this.$input(name), val[name] );
81
  }
82
 
83
+ // return false if no lat/lng
84
+ if( !val.lat || !val.lng ) {
85
  val = false;
86
  }
87
 
assets/_build/js/acf-helpers.js CHANGED
@@ -297,6 +297,11 @@
297
  $row = $();
298
  }
299
 
 
 
 
 
 
300
  // add classes
301
  if( thisTop == 0 ) {
302
  $field.addClass('-r0');
297
  $row = $();
298
  }
299
 
300
+ // rtl
301
+ if( acf.get('rtl') ) {
302
+ thisLeft = Math.ceil( $field.parent().width() - (position.left + $field.outerWidth()) );
303
+ }
304
+
305
  // add classes
306
  if( thisTop == 0 ) {
307
  $field.addClass('-r0');
assets/_build/js/acf-screen.js CHANGED
@@ -6,34 +6,184 @@
6
 
7
  xhr: false,
8
 
9
- wait: 'ready',
 
 
10
 
11
  events: {
12
- 'change #page_template': 'onChangeTemplate',
13
- 'change #parent_id': 'onChangeParent',
14
- 'change #post-formats-select input': 'onChangeFormat',
15
- 'change .categorychecklist input': 'onChangeTerm',
16
- 'change .categorychecklist select': 'onChangeTerm',
17
- 'change .acf-taxonomy-field[data-save="1"] input': 'onChangeTerm',
18
- 'change .acf-taxonomy-field[data-save="1"] select': 'onChangeTerm'
19
  },
20
 
21
- data: {
22
- //'post_id': 0,
23
- //'page_template': 0,
24
- //'page_parent': 0,
25
- //'page_type': 0,
26
- //'post_format': 0,
27
- //'post_taxonomy': 0
28
- },
29
-
30
- fetch: function(){
31
 
32
- // bail early if not active
 
33
  if( !this.active ) {
 
 
 
 
 
34
  return;
35
  }
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  // bail early if not for post
38
  if( acf.get('screen') !== 'post' ) {
39
  return;
@@ -46,16 +196,44 @@
46
 
47
  // vars
48
  var ajaxData = acf.parseArgs(this.data, {
49
- post_id: acf.get('post_id')
 
 
50
  });
51
 
52
- // add action url
53
- ajaxData.action = 'acf/post/get_field_groups';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
- // add ignore
56
- ajaxData.exists = [];
 
 
 
 
57
  $('.acf-postbox').not('.acf-hidden').each(function(){
58
- ajaxData.exists.push( $(this).attr('id').substr(4) );
59
  });
60
 
61
  // success
@@ -125,139 +303,51 @@
125
  });
126
  },
127
 
128
- syncTaxonomyTerms: function(){
129
-
130
- // vars
131
- var values = [''];
132
-
133
- // loop over term lists
134
- $('.categorychecklist, .acf-taxonomy-field').each(function(){
135
-
136
- // vars
137
- var $el = $(this),
138
- $checkbox = $el.find('input[type="checkbox"]').not(':disabled'),
139
- $radio = $el.find('input[type="radio"]').not(':disabled'),
140
- $select = $el.find('select').not(':disabled'),
141
- $hidden = $el.find('input[type="hidden"]').not(':disabled');
142
-
143
-
144
- // bail early if not a field which saves taxonomy terms to post
145
- if( $el.is('.acf-taxonomy-field') && $el.attr('data-save') != '1' ) {
146
-
147
- return;
148
-
149
- }
150
-
151
-
152
- // bail early if in attachment
153
- if( $el.closest('.media-frame').exists() ) {
154
-
155
- return;
156
-
157
- }
158
-
159
-
160
- // checkbox
161
- if( $checkbox.exists() ) {
162
-
163
- $checkbox.filter(':checked').each(function(){
164
-
165
- values.push( $(this).val() );
166
-
167
- });
168
-
169
- } else if( $radio.exists() ) {
170
-
171
- $radio.filter(':checked').each(function(){
172
-
173
- values.push( $(this).val() );
174
-
175
- });
176
-
177
- } else if( $select.exists() ) {
178
-
179
- $select.find('option:selected').each(function(){
180
-
181
- values.push( $(this).val() );
182
-
183
- });
184
-
185
- } else if( $hidden.exists() ) {
186
-
187
- $hidden.each(function(){
188
-
189
- // ignor blank values
190
- if( ! $(this).val() ) {
191
-
192
- return;
193
-
194
- }
195
-
196
- values.push( $(this).val() );
197
-
198
- });
199
-
200
- }
201
-
202
- });
203
 
204
-
205
- // filter duplicates
206
- values = values.filter(function(item, pos, self) {
207
- return self.indexOf(item) == pos;
208
- });
209
-
210
-
211
- // update screen
212
- this.set( 'post_taxonomy', values ).fetch();
213
- },
214
-
215
- onChangeTemplate: function( e, $el ){
216
-
217
- // update & fetch
218
- this.set('page_template', $el.val()).fetch();
219
- },
220
-
221
- onChangeParent: function( e, $el ){
222
-
223
- // vars
224
- var pageType = 'parent';
225
- var pageParent = 0;
226
-
227
- // if is child
228
- if( $el.val() != "" ) {
229
- pageType = 'child';
230
- pageParent = $el.val();
231
- }
232
-
233
- // update & fetch
234
- this.set('page_type', pageType).set('page_parent', pageParent).fetch();
235
- },
236
-
237
- onChangeFormat: function( e, $el ){
238
-
239
- // vars
240
- var postFormat = $el.val();
241
-
242
- // default
243
- if( postFormat == '0' ) {
244
- postFormat = 'standard';
245
- }
246
-
247
- // update & fetch
248
- this.set('post_format', postFormat).fetch();
249
- },
250
-
251
- onChangeTerm: function( e, $el ){
252
-
253
- // bail early if within media popup
254
- if( $el.closest('.media-frame').exists() ) {
255
- return;
256
  }
257
-
258
- // set timeout to fix issue with chrome which does not register the change has yet happened
259
- this.setTimeout(this.syncTaxonomyTerms, 1);
260
  }
261
  });
262
 
 
 
 
 
 
 
263
  })(jQuery);
6
 
7
  xhr: false,
8
 
9
+ timeout: false,
10
+
11
+ wait: 'load',
12
 
13
  events: {
14
+ 'change #page_template': 'onChange',
15
+ 'change #parent_id': 'onChange',
16
+ 'change #post-formats-select': 'onChange',
17
+ 'change .categorychecklist': 'onChange',
18
+ 'change .tagsdiv': 'onChange',
19
+ 'change .acf-taxonomy-field[data-save="1"]': 'onChange',
20
+ 'change #product-type': 'onChange'
21
  },
22
 
23
+ initialize: function(){
 
 
 
 
 
 
 
 
 
24
 
25
+ /*
26
+ // disable if not active
27
  if( !this.active ) {
28
+ this.events = {};
29
+ }
30
+
31
+ // bail early if not for post
32
+ if( acf.get('screen') !== 'post' ) {
33
  return;
34
  }
35
 
36
+ 'check_screen_data'
37
+
38
+ 'check_screen_events'
39
+
40
+ */
41
+ },
42
+ /*
43
+
44
+ checkScreenEvents: function(){
45
+
46
+ // vars
47
+ var events = [
48
+ 'change #page_template',
49
+ 'change #parent_id',
50
+ 'change #post-formats-select input',
51
+ 'change .categorychecklist input',
52
+ 'change .categorychecklist select',
53
+ 'change .acf-taxonomy-field[data-save="1"] input',
54
+ 'change .acf-taxonomy-field[data-save="1"] select',
55
+ 'change #product-type'
56
+ ];
57
+
58
+ acf.screen.on('change', '#product-type', 'fetch');
59
+ },
60
+ */
61
+
62
+
63
+ isPost: function(){
64
+ return acf.get('screen') === 'post';
65
+ },
66
+
67
+ isUser: function(){
68
+ return acf.get('screen') === 'user';
69
+ },
70
+
71
+ isTaxonomy: function(){
72
+ return acf.get('screen') === 'taxonomy';
73
+ },
74
+
75
+ isAttachment: function(){
76
+ return acf.get('screen') === 'attachment';
77
+ },
78
+
79
+ isNavMenu: function(){
80
+ return acf.get('screen') === 'nav_menu';
81
+ },
82
+
83
+ isWidget: function(){
84
+ return acf.get('screen') === 'widget';
85
+ },
86
+
87
+ isComment: function(){
88
+ return acf.get('screen') === 'comment';
89
+ },
90
+
91
+ getPageTemplate: function(){
92
+ var $el = $('#page_template');
93
+ return $el.length ? $el.val() : null;
94
+ },
95
+
96
+ getPageParent: function( e, $el ){
97
+ var $el = $('#parent_id');
98
+ return $el.length ? $el.val() : null;
99
+ },
100
+
101
+ getPageType: function( e, $el ){
102
+ return this.getPageParent() ? 'child' : 'parent';
103
+ },
104
+
105
+ getPostFormat: function( e, $el ){
106
+ var $el = $('#post-formats-select input:checked');
107
+ if( $el.length ) {
108
+ var val = $el.val();
109
+ return (val == '0') ? 'standard' : val;
110
+ }
111
+ return null;
112
+ },
113
+
114
+ getPostTerms: function(){
115
+
116
+ // vars
117
+ var terms = {};
118
+
119
+ // serialize WP taxonomy postboxes
120
+ var data = acf.serialize( $('.categorydiv, .tagsdiv') );
121
+
122
+ // use tax_input (tag, custom-taxonomy) when possible.
123
+ // this data is already formatted in taxonomy => [terms].
124
+ if( data.tax_input ) {
125
+ terms = data.tax_input;
126
+ }
127
+
128
+ // append "category" which uses a different name
129
+ if( data.post_category ) {
130
+ terms.category = data.post_category;
131
+ }
132
+
133
+ // convert any string values (tags) into array format
134
+ for( var tax in terms ) {
135
+ if( !acf.isArray(terms[tax]) ) {
136
+ terms[tax] = terms[tax].split(', ');
137
+ }
138
+ }
139
+
140
+ // loop over taxonomy fields and add their values
141
+ acf.getFields({type: 'taxonomy'}).map(function( field ){
142
+
143
+ // ignore fields that don't save
144
+ if( !field.get('save') ) {
145
+ return;
146
+ }
147
+
148
+ // vars
149
+ var val = field.val();
150
+ var tax = field.get('taxonomy');
151
+
152
+ // check val
153
+ if( val ) {
154
+
155
+ // ensure terms exists
156
+ terms[ tax ] = terms[ tax ] || [];
157
+
158
+ // ensure val is an array
159
+ val = acf.isArray(val) ? val : [val];
160
+
161
+ // append
162
+ terms[ tax ] = terms[ tax ].concat( val );
163
+ }
164
+ });
165
+
166
+ // add WC product type
167
+ if( (productType = this.getProductType()) !== null ) {
168
+ terms.product_type = [productType];
169
+ }
170
+
171
+ // remove duplicate values
172
+ for( var tax in terms ) {
173
+ terms[tax] = acf.uniqueArray(terms[tax]);
174
+ }
175
+
176
+ // return
177
+ return terms;
178
+ },
179
+
180
+ getProductType: function(){
181
+ var $el = $('#product-type');
182
+ return $el.length ? $el.val() : null;
183
+ },
184
+
185
+ check: function(){
186
+
187
  // bail early if not for post
188
  if( acf.get('screen') !== 'post' ) {
189
  return;
196
 
197
  // vars
198
  var ajaxData = acf.parseArgs(this.data, {
199
+ action: 'acf/ajax/check_screen',
200
+ screen: acf.get('screen'),
201
+ exclude: []
202
  });
203
 
204
+ // post id
205
+ if( this.isPost() ) {
206
+ ajaxData.post_id = acf.get('post_id');
207
+ }
208
+
209
+ // page template
210
+ if( (pageTemplate = this.getPageTemplate()) !== null ) {
211
+ ajaxData.page_template = pageTemplate;
212
+ }
213
+
214
+ // page parent
215
+ if( (pageParent = this.getPageParent()) !== null ) {
216
+ ajaxData.page_parent = pageParent;
217
+ }
218
+
219
+ // page type
220
+ if( (pageType = this.getPageType()) !== null ) {
221
+ ajaxData.page_type = pageType;
222
+ }
223
+
224
+ // post format
225
+ if( (postFormat = this.getPostFormat()) !== null ) {
226
+ ajaxData.post_format = postFormat;
227
+ }
228
 
229
+ // post terms
230
+ if( (postTerms = this.getPostTerms()) !== null ) {
231
+ ajaxData.post_terms = postTerms;
232
+ }
233
+
234
+ // exclude existing postboxes
235
  $('.acf-postbox').not('.acf-hidden').each(function(){
236
+ ajaxData.exclude.push( $(this).attr('id').substr(4) );
237
  });
238
 
239
  // success
303
  });
304
  },
305
 
306
+ onChange: function( e, $el ){
307
+ this.setTimeout(this.check, 1);
308
+ }
309
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
 
311
+ /*
312
+ // tests
313
+ acf.registerScreenChange('#page_template', function( e, $el ){
314
+ return $('#page_template').val();
315
+ });
316
+
317
+ acf.registerScreenData({
318
+ name: 'page_template',
319
+ change: '#page_template',
320
+ val: function(){
321
+ var $input = $(this.el);
322
+ return $input.length ? $input.val() : null;
323
+ }
324
+ });
325
+
326
+ acf.registerScreenData({
327
+ name: 'post_terms',
328
+ change: '.acf-taxonomy-field[data-save="1"]',
329
+ val: function(){
330
+ var $input = $(this.el);
331
+ return $input.length ? $input.val() : null;
332
+ }
333
+ });
334
+
335
+ acf.registerScreenData({
336
+ name: 'post_terms',
337
+ change: '#product-type',
338
+ val: function( terms ){
339
+ var $select = $('#product-type');
340
+ if( $select.length ) {
341
+ terms.push('product_cat:'+$select.val());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  }
343
+ return terms;
 
 
344
  }
345
  });
346
 
347
+
348
+ acf.screen.get('post_terms');
349
+ acf.screen.getPostTerms();
350
+
351
+ */
352
+
353
  })(jQuery);
assets/_build/js/acf-tinymce.js CHANGED
@@ -105,7 +105,7 @@
105
 
106
  // toolbar
107
  var toolbar = args.toolbar;
108
- if( toolbar && typeof toolbars[toolbar] !== 'undefined' ) {
109
 
110
  for( var i = 1; i <= 4; i++ ) {
111
  init[ 'toolbar' + i ] = toolbars[toolbar][i] || '';
105
 
106
  // toolbar
107
  var toolbar = args.toolbar;
108
+ if( toolbar && toolbars && toolbars[toolbar] ) {
109
 
110
  for( var i = 1; i <= 4; i++ ) {
111
  init[ 'toolbar' + i ] = toolbars[toolbar][i] || '';
assets/_build/js/acf.js CHANGED
@@ -474,7 +474,7 @@
474
 
475
  // extra
476
  ' ': '_',
477
- '\'': '',
478
  '?': '',
479
  '/': '',
480
  '\\': '',
@@ -496,7 +496,7 @@
496
  // vars
497
  var nonWord = /\W/g;
498
  var mapping = function (c) {
499
- return map[c] || c;
500
  };
501
 
502
  // replace
@@ -684,7 +684,7 @@
684
  */
685
 
686
  var buildObject = function( obj, name, value ){
687
- //console.log('buildObject', obj, name);
688
  // replace [] with placeholder
689
  name = name.replace('[]', '[%%index%%]');
690
 
@@ -731,15 +731,14 @@
731
  // crawl
732
  ref = ref[ key ];
733
  }
734
- //console.log('ref:', ref);
735
  }
736
  };
737
 
738
  acf.serialize = function( $el, prefix ){
739
- //console.time('serialize');
740
  // vars
741
  var obj = {};
742
- var inputs = $el.find('select, textarea, input').serializeArray();
743
 
744
  // prefix
745
  if( prefix !== undefined ) {
@@ -757,12 +756,90 @@
757
  for( var i = 0; i < inputs.length; i++ ) {
758
  buildObject( obj, inputs[i].name, inputs[i].value );
759
  }
760
- //console.timeEnd('serialize');
761
 
762
  // return
763
  return obj;
764
  };
765
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
766
 
767
  /**
768
  * addAction
@@ -1451,7 +1528,7 @@
1451
  acf.updateUserSetting = function( name, value ){
1452
 
1453
  var ajaxData = {
1454
- action: 'acf/update_user_setting',
1455
  name: name,
1456
  value: value
1457
  };
@@ -1757,7 +1834,7 @@
1757
 
1758
  acf.isset = function( obj /*, level1, level2, ... */ ) {
1759
  for( var i = 1; i < arguments.length; i++ ) {
1760
- if( !obj.hasOwnProperty(arguments[i]) ) {
1761
  return false;
1762
  }
1763
  obj = obj[ arguments[i] ];
@@ -1779,7 +1856,7 @@
1779
 
1780
  acf.isget = function( obj /*, level1, level2, ... */ ) {
1781
  for( var i = 1; i < arguments.length; i++ ) {
1782
- if( !obj.hasOwnProperty(arguments[i]) ) {
1783
  return null;
1784
  }
1785
  obj = obj[ arguments[i] ];
474
 
475
  // extra
476
  ' ': '_',
477
+ "'": '',
478
  '?': '',
479
  '/': '',
480
  '\\': '',
496
  // vars
497
  var nonWord = /\W/g;
498
  var mapping = function (c) {
499
+ return (map[c] !== undefined) ? map[c] : c;
500
  };
501
 
502
  // replace
684
  */
685
 
686
  var buildObject = function( obj, name, value ){
687
+
688
  // replace [] with placeholder
689
  name = name.replace('[]', '[%%index%%]');
690
 
731
  // crawl
732
  ref = ref[ key ];
733
  }
 
734
  }
735
  };
736
 
737
  acf.serialize = function( $el, prefix ){
738
+
739
  // vars
740
  var obj = {};
741
+ var inputs = acf.serializeArray( $el );
742
 
743
  // prefix
744
  if( prefix !== undefined ) {
756
  for( var i = 0; i < inputs.length; i++ ) {
757
  buildObject( obj, inputs[i].name, inputs[i].value );
758
  }
 
759
 
760
  // return
761
  return obj;
762
  };
763
 
764
+ /**
765
+ * acf.serializeArray
766
+ *
767
+ * Similar to $.serializeArray() but works with a parent wrapping element.
768
+ *
769
+ * @date 19/8/18
770
+ * @since 5.7.3
771
+ *
772
+ * @param jQuery $el The element or form to serialize.
773
+ * @return array
774
+ */
775
+
776
+ acf.serializeArray = function( $el ){
777
+ return $el.find('select, textarea, input').serializeArray();
778
+ }
779
+
780
+
781
+ /**
782
+ * acf.serializeAjax
783
+ *
784
+ * Returns an object containing name => value data ready to be encoded for Ajax.
785
+ *
786
+ * @date 15/8/18
787
+ * @since 5.7.3
788
+ *
789
+ * @param jQUery $el The element or form to serialize.
790
+ * @param string prefix The input prefix to scope to.
791
+ * @return object
792
+ */
793
+
794
+ /*
795
+ acf.serializeAjax = function( $el, prefix ){
796
+
797
+ // vars
798
+ var data = {};
799
+ var index = {};
800
+ var inputs = $el.find('select, textarea, input').serializeArray();
801
+
802
+ // remove prefix
803
+ if( prefix !== undefined ) {
804
+
805
+ // filter and modify
806
+ inputs = inputs.filter(function( item ){
807
+ return item.name.indexOf(prefix) === 0;
808
+ }).map(function( item ){
809
+
810
+ // remove prefix from name
811
+ item.name = item.name.slice(prefix.length);
812
+
813
+ // fix [foo][bar] to foo[bar]
814
+ if( item.name.slice(0, 1) == '[' ) {
815
+ item.name = item.name.slice(1).replace(']', '');
816
+ }
817
+ return item;
818
+ });
819
+ }
820
+
821
+ // build object
822
+ inputs.map(function( item ){
823
+
824
+ // fix foo[] to foo[0], foo[1], etc
825
+ if( item.name.slice(-2) === '[]' ) {
826
+
827
+ // ensure index exists
828
+ index[ item.name ] = index[ item.name ] || 0;
829
+ index[ item.name ]++;
830
+
831
+ // replace [] with [0]
832
+ item.name = item.name.replace('[]', '[' + (index[ item.name ]-1) + ']');
833
+ }
834
+
835
+ // append to data
836
+ data[ item.name ] = item.value;
837
+ });
838
+
839
+ // return
840
+ return data;
841
+ };
842
+ */
843
 
844
  /**
845
  * addAction
1528
  acf.updateUserSetting = function( name, value ){
1529
 
1530
  var ajaxData = {
1531
+ action: 'acf/ajax/user_setting',
1532
  name: name,
1533
  value: value
1534
  };
1834
 
1835
  acf.isset = function( obj /*, level1, level2, ... */ ) {
1836
  for( var i = 1; i < arguments.length; i++ ) {
1837
+ if( !obj || !obj.hasOwnProperty(arguments[i]) ) {
1838
  return false;
1839
  }
1840
  obj = obj[ arguments[i] ];
1856
 
1857
  acf.isget = function( obj /*, level1, level2, ... */ ) {
1858
  for( var i = 1; i < arguments.length; i++ ) {
1859
+ if( !obj || !obj.hasOwnProperty(arguments[i]) ) {
1860
  return null;
1861
  }
1862
  obj = obj[ arguments[i] ];
assets/css/acf-dark.css ADDED
@@ -0,0 +1 @@
 
1
+ .acf-box{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-box .footer,.acf-box .title{border-color:#23282d}.acf-box h2{color:#bbc8d4}.acf-box table,.acf-box tbody,.acf-box tr{background:0 0!important}.acf-thead{color:#bbc8d4;border-color:#191f25}.acf-tfoot{background-color:#2d3136;border-color:#23282d}.acf-table.-clear,.acf-table.-clear tr{background:0 0!important}.acf-loading-overlay{background:rgba(0,0,0,.5)}.acf-fields>.acf-field{border-color:#23282d}.acf-fields.-left>.acf-field:before{background:rgba(0,0,0,.1);border-color:#23282d}.acf-fields.-border{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-field[data-width]+.acf-field[data-width]{border-color:#23282d}.acf-input-append,.acf-input-prepend{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-fields>.acf-tab-wrap{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-fields>.acf-tab-wrap .acf-tab-group{background-color:#2d3136;border-color:#23282d}.acf-fields>.acf-tab-wrap .acf-tab-group li a{background-color:#2d3136;border-color:#23282d}.acf-fields>.acf-tab-wrap .acf-tab-group li a:hover{background-color:#2d3136;border-color:#23282d;color:#bbc8d4}.acf-fields>.acf-tab-wrap .acf-tab-group li.active a{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-file-uploader .show-if-value{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-file-uploader .show-if-value .file-icon{background-color:#2d3136;border-color:#23282d}.acf-oembed{background-color:#2d3136;border-color:#23282d}.acf-oembed .title{background-color:#50626f;border-color:#191f25;color:#fff}.acf-gallery{background-color:#2d3136;border-color:#23282d}.acf-gallery .acf-gallery-main{background:#23282d}.acf-gallery .acf-gallery-attachment .margin{background-color:#2d3136;border-color:#23282d}.acf-gallery .acf-gallery-side{background-color:#2d3136;border-color:#23282d}.acf-gallery .acf-gallery-side .acf-gallery-side-info{background-color:#2d3136;border-color:#23282d}.acf-gallery .acf-gallery-toolbar{background-color:#2d3136;border-color:#23282d}.acf-button-group label:not(.selected){background-color:#2d3136;border-color:#23282d}.acf-switch:not(.-on){background-color:#2d3136;border-color:#23282d}.acf-switch:not(.-on) .acf-switch-slider{background-color:#50626f;border-color:#191f25;color:#fff}.acf-link .link-wrap{background-color:#2d3136;border-color:#23282d}.acf-relationship .filters{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-relationship .selection{background-color:#2d3136;border-color:#23282d}.acf-relationship .selection .choices,.acf-relationship .selection .choices-list,.acf-relationship .selection .values{background-color:#2d3136;border-color:#23282d}.acf-taxonomy-field .categorychecklist-holder{background-color:#2d3136;border-color:#23282d}.acf-google-map{background-color:#2d3136;border-color:#23282d}.acf-google-map .title{background-color:#50626f;border-color:#191f25;color:#fff}.acf-accordion{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-field.acf-accordion .acf-accordion-content>.acf-fields{border-color:#191f25}.acf-flexible-content .layout{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-flexible-content .layout .acf-fc-layout-handle{background-color:#2d3136;border-color:#23282d}#wpbody .acf-repeater>.acf-table{background-color:#2d3136;border-color:#23282d}#wpbody .acf-repeater>.acf-table>tbody>tr,#wpbody .acf-repeater>.acf-table>thead>tr{background:0 0}#wpbody .acf-repeater>.acf-table>tbody>tr>td,#wpbody .acf-repeater>.acf-table>tbody>tr>th,#wpbody .acf-repeater>.acf-table>thead>tr>td,#wpbody .acf-repeater>.acf-table>thead>tr>th{border-color:#191f25}#acf-field-group-fields .acf-field-list-wrap{background-color:#32373c;border-color:#191f25;color:#bbc8d4}#acf-field-group-fields .acf-field-object{background-color:#32373c;border-color:#191f25;color:#bbc8d4;border-color:#23282d}#acf-field-group-fields .acf-field-object table,#acf-field-group-fields .acf-field-object tbody,#acf-field-group-fields .acf-field-object td,#acf-field-group-fields .acf-field-object th,#acf-field-group-fields .acf-field-object tr{background:0 0;border-color:#23282d}#acf-field-group-fields .acf-field-object .acf-field .acf-label{background-color:#2d3136;border-color:#23282d}#acf-field-group-fields .acf-field-object.ui-sortable-helper{border-color:#191f25;box-shadow:none}#acf-field-group-fields .acf-field-object.ui-sortable-placeholder{background-color:#2d3136;border-color:#23282d;box-shadow:none}#acf-field-group-fields .acf-field-object+.acf-field-object-accordion::before,#acf-field-group-fields .acf-field-object+.acf-field-object-tab::before{background-color:#2d3136;border-color:#23282d}.acf-meta-box-wrap .acf-fields{background-color:#50626f;border-color:#191f25;color:#fff;background:0 0}
assets/css/acf-global.css CHANGED
@@ -600,7 +600,6 @@ a.acf-icon.-cancel.grey:hover {
600
  border-bottom: 1px solid #EEEEEE;
601
  margin: 0;
602
  padding: 15px;
603
- background: #FFFFFF;
604
  }
605
  .acf-box .title h3 {
606
  font-size: 14px;
@@ -631,7 +630,6 @@ a.acf-icon.-cancel.grey:hover {
631
  margin-top: -1px;
632
  }
633
  .acf-box .footer {
634
- background: #fff;
635
  border-top: 1px solid #eee;
636
  padding: 12px;
637
  font-size: 13px;
@@ -906,14 +904,13 @@ html[dir="rtl"] .acf-columns-2 .acf-column-2 {
906
  line-height: 14px;
907
  }
908
  .acf-thead {
909
- background: #FFFFFF;
910
  border-bottom: #E1E1E1 solid 1px;
 
911
  }
912
  .acf-thead > li {
913
  font-size: 14px;
914
  line-height: 1.4em;
915
  font-family: "Open Sans", sans-serif;
916
- color: #222222;
917
  font-weight: bold;
918
  }
919
  .acf-tfoot {
@@ -925,10 +922,6 @@ html[dir="rtl"] .acf-columns-2 .acf-column-2 {
925
  font-size: 12px;
926
  line-height: 27px;
927
  }
928
- .acf-tfoot > li.comic-sans {
929
- font-family: Comic Sans MS, sans-serif;
930
- font-size: 11px;
931
- }
932
  /*--------------------------------------------------------------------------------------------
933
  *
934
  * Settings
600
  border-bottom: 1px solid #EEEEEE;
601
  margin: 0;
602
  padding: 15px;
 
603
  }
604
  .acf-box .title h3 {
605
  font-size: 14px;
630
  margin-top: -1px;
631
  }
632
  .acf-box .footer {
 
633
  border-top: 1px solid #eee;
634
  padding: 12px;
635
  font-size: 13px;
904
  line-height: 14px;
905
  }
906
  .acf-thead {
 
907
  border-bottom: #E1E1E1 solid 1px;
908
+ color: #23282d;
909
  }
910
  .acf-thead > li {
911
  font-size: 14px;
912
  line-height: 1.4em;
913
  font-family: "Open Sans", sans-serif;
 
914
  font-weight: bold;
915
  }
916
  .acf-tfoot {
922
  font-size: 12px;
923
  line-height: 27px;
924
  }
 
 
 
 
925
  /*--------------------------------------------------------------------------------------------
926
  *
927
  * Settings
assets/js/acf-input.js CHANGED
@@ -474,7 +474,7 @@
474
 
475
  // extra
476
  ' ': '_',
477
- '\'': '',
478
  '?': '',
479
  '/': '',
480
  '\\': '',
@@ -496,7 +496,7 @@
496
  // vars
497
  var nonWord = /\W/g;
498
  var mapping = function (c) {
499
- return map[c] || c;
500
  };
501
 
502
  // replace
@@ -684,7 +684,7 @@
684
  */
685
 
686
  var buildObject = function( obj, name, value ){
687
- //console.log('buildObject', obj, name);
688
  // replace [] with placeholder
689
  name = name.replace('[]', '[%%index%%]');
690
 
@@ -731,15 +731,14 @@
731
  // crawl
732
  ref = ref[ key ];
733
  }
734
- //console.log('ref:', ref);
735
  }
736
  };
737
 
738
  acf.serialize = function( $el, prefix ){
739
- //console.time('serialize');
740
  // vars
741
  var obj = {};
742
- var inputs = $el.find('select, textarea, input').serializeArray();
743
 
744
  // prefix
745
  if( prefix !== undefined ) {
@@ -757,12 +756,90 @@
757
  for( var i = 0; i < inputs.length; i++ ) {
758
  buildObject( obj, inputs[i].name, inputs[i].value );
759
  }
760
- //console.timeEnd('serialize');
761
 
762
  // return
763
  return obj;
764
  };
765
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
766
 
767
  /**
768
  * addAction
@@ -1451,7 +1528,7 @@
1451
  acf.updateUserSetting = function( name, value ){
1452
 
1453
  var ajaxData = {
1454
- action: 'acf/update_user_setting',
1455
  name: name,
1456
  value: value
1457
  };
@@ -1757,7 +1834,7 @@
1757
 
1758
  acf.isset = function( obj /*, level1, level2, ... */ ) {
1759
  for( var i = 1; i < arguments.length; i++ ) {
1760
- if( !obj.hasOwnProperty(arguments[i]) ) {
1761
  return false;
1762
  }
1763
  obj = obj[ arguments[i] ];
@@ -1779,7 +1856,7 @@
1779
 
1780
  acf.isget = function( obj /*, level1, level2, ... */ ) {
1781
  for( var i = 1; i < arguments.length; i++ ) {
1782
- if( !obj.hasOwnProperty(arguments[i]) ) {
1783
  return null;
1784
  }
1785
  obj = obj[ arguments[i] ];
@@ -5657,8 +5734,8 @@
5657
  val[ $(this).data('name') ] = $(this).val();
5658
  });
5659
 
5660
- // return false if no address
5661
- if( !val.address ) {
5662
  val = false;
5663
  }
5664
 
@@ -5680,8 +5757,8 @@
5680
  acf.val( this.$input(name), val[name] );
5681
  }
5682
 
5683
- // return false if no address
5684
- if( !val.address ) {
5685
  val = false;
5686
  }
5687
 
@@ -9332,7 +9409,7 @@
9332
  type: 'contains',
9333
  operator: '==contains',
9334
  label: __('Value contains'),
9335
- fieldTypes: [ 'text', 'textarea', 'number', 'email', 'url', 'password', 'wysiwyg', 'oembed' ],
9336
  match: function( rule, field ){
9337
  return containsString( field.val(), rule.value );
9338
  },
@@ -10391,34 +10468,184 @@
10391
 
10392
  xhr: false,
10393
 
10394
- wait: 'ready',
 
 
10395
 
10396
  events: {
10397
- 'change #page_template': 'onChangeTemplate',
10398
- 'change #parent_id': 'onChangeParent',
10399
- 'change #post-formats-select input': 'onChangeFormat',
10400
- 'change .categorychecklist input': 'onChangeTerm',
10401
- 'change .categorychecklist select': 'onChangeTerm',
10402
- 'change .acf-taxonomy-field[data-save="1"] input': 'onChangeTerm',
10403
- 'change .acf-taxonomy-field[data-save="1"] select': 'onChangeTerm'
10404
  },
10405
 
10406
- data: {
10407
- //'post_id': 0,
10408
- //'page_template': 0,
10409
- //'page_parent': 0,
10410
- //'page_type': 0,
10411
- //'post_format': 0,
10412
- //'post_taxonomy': 0
10413
- },
10414
-
10415
- fetch: function(){
10416
 
10417
- // bail early if not active
 
10418
  if( !this.active ) {
 
 
 
 
 
10419
  return;
10420
  }
10421
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10422
  // bail early if not for post
10423
  if( acf.get('screen') !== 'post' ) {
10424
  return;
@@ -10431,16 +10658,44 @@
10431
 
10432
  // vars
10433
  var ajaxData = acf.parseArgs(this.data, {
10434
- post_id: acf.get('post_id')
 
 
10435
  });
10436
 
10437
- // add action url
10438
- ajaxData.action = 'acf/post/get_field_groups';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10439
 
10440
- // add ignore
10441
- ajaxData.exists = [];
 
 
 
 
 
 
 
 
 
10442
  $('.acf-postbox').not('.acf-hidden').each(function(){
10443
- ajaxData.exists.push( $(this).attr('id').substr(4) );
10444
  });
10445
 
10446
  // success
@@ -10510,141 +10765,53 @@
10510
  });
10511
  },
10512
 
10513
- syncTaxonomyTerms: function(){
10514
-
10515
- // vars
10516
- var values = [''];
10517
-
10518
- // loop over term lists
10519
- $('.categorychecklist, .acf-taxonomy-field').each(function(){
10520
-
10521
- // vars
10522
- var $el = $(this),
10523
- $checkbox = $el.find('input[type="checkbox"]').not(':disabled'),
10524
- $radio = $el.find('input[type="radio"]').not(':disabled'),
10525
- $select = $el.find('select').not(':disabled'),
10526
- $hidden = $el.find('input[type="hidden"]').not(':disabled');
10527
-
10528
-
10529
- // bail early if not a field which saves taxonomy terms to post
10530
- if( $el.is('.acf-taxonomy-field') && $el.attr('data-save') != '1' ) {
10531
-
10532
- return;
10533
-
10534
- }
10535
-
10536
-
10537
- // bail early if in attachment
10538
- if( $el.closest('.media-frame').exists() ) {
10539
-
10540
- return;
10541
-
10542
- }
10543
-
10544
-
10545
- // checkbox
10546
- if( $checkbox.exists() ) {
10547
-
10548
- $checkbox.filter(':checked').each(function(){
10549
-
10550
- values.push( $(this).val() );
10551
-
10552
- });
10553
-
10554
- } else if( $radio.exists() ) {
10555
-
10556
- $radio.filter(':checked').each(function(){
10557
-
10558
- values.push( $(this).val() );
10559
-
10560
- });
10561
-
10562
- } else if( $select.exists() ) {
10563
-
10564
- $select.find('option:selected').each(function(){
10565
-
10566
- values.push( $(this).val() );
10567
-
10568
- });
10569
-
10570
- } else if( $hidden.exists() ) {
10571
-
10572
- $hidden.each(function(){
10573
-
10574
- // ignor blank values
10575
- if( ! $(this).val() ) {
10576
-
10577
- return;
10578
-
10579
- }
10580
-
10581
- values.push( $(this).val() );
10582
-
10583
- });
10584
-
10585
- }
10586
-
10587
- });
10588
 
10589
-
10590
- // filter duplicates
10591
- values = values.filter(function(item, pos, self) {
10592
- return self.indexOf(item) == pos;
10593
- });
10594
-
10595
-
10596
- // update screen
10597
- this.set( 'post_taxonomy', values ).fetch();
10598
- },
10599
-
10600
- onChangeTemplate: function( e, $el ){
10601
-
10602
- // update & fetch
10603
- this.set('page_template', $el.val()).fetch();
10604
- },
10605
-
10606
- onChangeParent: function( e, $el ){
10607
-
10608
- // vars
10609
- var pageType = 'parent';
10610
- var pageParent = 0;
10611
-
10612
- // if is child
10613
- if( $el.val() != "" ) {
10614
- pageType = 'child';
10615
- pageParent = $el.val();
10616
- }
10617
-
10618
- // update & fetch
10619
- this.set('page_type', pageType).set('page_parent', pageParent).fetch();
10620
- },
10621
-
10622
- onChangeFormat: function( e, $el ){
10623
-
10624
- // vars
10625
- var postFormat = $el.val();
10626
-
10627
- // default
10628
- if( postFormat == '0' ) {
10629
- postFormat = 'standard';
10630
- }
10631
-
10632
- // update & fetch
10633
- this.set('post_format', postFormat).fetch();
10634
- },
10635
-
10636
- onChangeTerm: function( e, $el ){
10637
-
10638
- // bail early if within media popup
10639
- if( $el.closest('.media-frame').exists() ) {
10640
- return;
10641
  }
10642
-
10643
- // set timeout to fix issue with chrome which does not register the change has yet happened
10644
- this.setTimeout(this.syncTaxonomyTerms, 1);
10645
  }
10646
  });
10647
 
 
 
 
 
 
 
10648
  })(jQuery);
10649
 
10650
  (function($, undefined){
@@ -11548,7 +11715,7 @@
11548
 
11549
  // toolbar
11550
  var toolbar = args.toolbar;
11551
- if( toolbar && typeof toolbars[toolbar] !== 'undefined' ) {
11552
 
11553
  for( var i = 1; i <= 4; i++ ) {
11554
  init[ 'toolbar' + i ] = toolbars[toolbar][i] || '';
@@ -12708,6 +12875,11 @@
12708
  $row = $();
12709
  }
12710
 
 
 
 
 
 
12711
  // add classes
12712
  if( thisTop == 0 ) {
12713
  $field.addClass('-r0');
@@ -13486,7 +13658,8 @@
13486
  acf.newCompatibility(acf.screen, {
13487
  update: function(){
13488
  return this.set.apply(this, arguments);
13489
- }
 
13490
  });
13491
  _acf.ajax = acf.screen;
13492
 
474
 
475
  // extra
476
  ' ': '_',
477
+ "'": '',
478
  '?': '',
479
  '/': '',
480
  '\\': '',
496
  // vars
497
  var nonWord = /\W/g;
498
  var mapping = function (c) {
499
+ return (map[c] !== undefined) ? map[c] : c;
500
  };
501
 
502
  // replace
684
  */
685
 
686
  var buildObject = function( obj, name, value ){
687
+
688
  // replace [] with placeholder
689
  name = name.replace('[]', '[%%index%%]');
690
 
731
  // crawl
732
  ref = ref[ key ];
733
  }
 
734
  }
735
  };
736
 
737
  acf.serialize = function( $el, prefix ){
738
+
739
  // vars
740
  var obj = {};
741
+ var inputs = acf.serializeArray( $el );
742
 
743
  // prefix
744
  if( prefix !== undefined ) {
756
  for( var i = 0; i < inputs.length; i++ ) {
757
  buildObject( obj, inputs[i].name, inputs[i].value );
758
  }
 
759
 
760
  // return
761
  return obj;
762
  };
763
 
764
+ /**
765
+ * acf.serializeArray
766
+ *
767
+ * Similar to $.serializeArray() but works with a parent wrapping element.
768
+ *
769
+ * @date 19/8/18
770
+ * @since 5.7.3
771
+ *
772
+ * @param jQuery $el The element or form to serialize.
773
+ * @return array
774
+ */
775
+
776
+ acf.serializeArray = function( $el ){
777
+ return $el.find('select, textarea, input').serializeArray();
778
+ }
779
+
780
+
781
+ /**
782
+ * acf.serializeAjax
783
+ *
784
+ * Returns an object containing name => value data ready to be encoded for Ajax.
785
+ *
786
+ * @date 15/8/18
787
+ * @since 5.7.3
788
+ *
789
+ * @param jQUery $el The element or form to serialize.
790
+ * @param string prefix The input prefix to scope to.
791
+ * @return object
792
+ */
793
+
794
+ /*
795
+ acf.serializeAjax = function( $el, prefix ){
796
+
797
+ // vars
798
+ var data = {};
799
+ var index = {};
800
+ var inputs = $el.find('select, textarea, input').serializeArray();
801
+
802
+ // remove prefix
803
+ if( prefix !== undefined ) {
804
+
805
+ // filter and modify
806
+ inputs = inputs.filter(function( item ){
807
+ return item.name.indexOf(prefix) === 0;
808
+ }).map(function( item ){
809
+
810
+ // remove prefix from name
811
+ item.name = item.name.slice(prefix.length);
812
+
813
+ // fix [foo][bar] to foo[bar]
814
+ if( item.name.slice(0, 1) == '[' ) {
815
+ item.name = item.name.slice(1).replace(']', '');
816
+ }
817
+ return item;
818
+ });
819
+ }
820
+
821
+ // build object
822
+ inputs.map(function( item ){
823
+
824
+ // fix foo[] to foo[0], foo[1], etc
825
+ if( item.name.slice(-2) === '[]' ) {
826
+
827
+ // ensure index exists
828
+ index[ item.name ] = index[ item.name ] || 0;
829
+ index[ item.name ]++;
830
+
831
+ // replace [] with [0]
832
+ item.name = item.name.replace('[]', '[' + (index[ item.name ]-1) + ']');
833
+ }
834
+
835
+ // append to data
836
+ data[ item.name ] = item.value;
837
+ });
838
+
839
+ // return
840
+ return data;
841
+ };
842
+ */
843
 
844
  /**
845
  * addAction
1528
  acf.updateUserSetting = function( name, value ){
1529
 
1530
  var ajaxData = {
1531
+ action: 'acf/ajax/user_setting',
1532
  name: name,
1533
  value: value
1534
  };
1834
 
1835
  acf.isset = function( obj /*, level1, level2, ... */ ) {
1836
  for( var i = 1; i < arguments.length; i++ ) {
1837
+ if( !obj || !obj.hasOwnProperty(arguments[i]) ) {
1838
  return false;
1839
  }
1840
  obj = obj[ arguments[i] ];
1856
 
1857
  acf.isget = function( obj /*, level1, level2, ... */ ) {
1858
  for( var i = 1; i < arguments.length; i++ ) {
1859
+ if( !obj || !obj.hasOwnProperty(arguments[i]) ) {
1860
  return null;
1861
  }
1862
  obj = obj[ arguments[i] ];
5734
  val[ $(this).data('name') ] = $(this).val();
5735
  });
5736
 
5737
+ // return false if no lat/lng
5738
+ if( !val.lat || !val.lng ) {
5739
  val = false;
5740
  }
5741
 
5757
  acf.val( this.$input(name), val[name] );
5758
  }
5759
 
5760
+ // return false if no lat/lng
5761
+ if( !val.lat || !val.lng ) {
5762
  val = false;
5763
  }
5764
 
9409
  type: 'contains',
9410
  operator: '==contains',
9411
  label: __('Value contains'),
9412
+ fieldTypes: [ 'text', 'textarea', 'number', 'email', 'url', 'password', 'wysiwyg', 'oembed', 'select' ],
9413
  match: function( rule, field ){
9414
  return containsString( field.val(), rule.value );
9415
  },
10468
 
10469
  xhr: false,
10470
 
10471
+ timeout: false,
10472
+
10473
+ wait: 'load',
10474
 
10475
  events: {
10476
+ 'change #page_template': 'onChange',
10477
+ 'change #parent_id': 'onChange',
10478
+ 'change #post-formats-select': 'onChange',
10479
+ 'change .categorychecklist': 'onChange',
10480
+ 'change .tagsdiv': 'onChange',
10481
+ 'change .acf-taxonomy-field[data-save="1"]': 'onChange',
10482
+ 'change #product-type': 'onChange'
10483
  },
10484
 
10485
+ initialize: function(){
 
 
 
 
 
 
 
 
 
10486
 
10487
+ /*
10488
+ // disable if not active
10489
  if( !this.active ) {
10490
+ this.events = {};
10491
+ }
10492
+
10493
+ // bail early if not for post
10494
+ if( acf.get('screen') !== 'post' ) {
10495
  return;
10496
  }
10497
 
10498
+ 'check_screen_data'
10499
+
10500
+ 'check_screen_events'
10501
+
10502
+ */
10503
+ },
10504
+ /*
10505
+
10506
+ checkScreenEvents: function(){
10507
+
10508
+ // vars
10509
+ var events = [
10510
+ 'change #page_template',
10511
+ 'change #parent_id',
10512
+ 'change #post-formats-select input',
10513
+ 'change .categorychecklist input',
10514
+ 'change .categorychecklist select',
10515
+ 'change .acf-taxonomy-field[data-save="1"] input',
10516
+ 'change .acf-taxonomy-field[data-save="1"] select',
10517
+ 'change #product-type'
10518
+ ];
10519
+
10520
+ acf.screen.on('change', '#product-type', 'fetch');
10521
+ },
10522
+ */
10523
+
10524
+
10525
+ isPost: function(){
10526
+ return acf.get('screen') === 'post';
10527
+ },
10528
+
10529
+ isUser: function(){
10530
+ return acf.get('screen') === 'user';
10531
+ },
10532
+
10533
+ isTaxonomy: function(){
10534
+ return acf.get('screen') === 'taxonomy';
10535
+ },
10536
+
10537
+ isAttachment: function(){
10538
+ return acf.get('screen') === 'attachment';
10539
+ },
10540
+
10541
+ isNavMenu: function(){
10542
+ return acf.get('screen') === 'nav_menu';
10543
+ },
10544
+
10545
+ isWidget: function(){
10546
+ return acf.get('screen') === 'widget';
10547
+ },
10548
+
10549
+ isComment: function(){
10550
+ return acf.get('screen') === 'comment';
10551
+ },
10552
+
10553
+ getPageTemplate: function(){
10554
+ var $el = $('#page_template');
10555
+ return $el.length ? $el.val() : null;
10556
+ },
10557
+
10558
+ getPageParent: function( e, $el ){
10559
+ var $el = $('#parent_id');
10560
+ return $el.length ? $el.val() : null;
10561
+ },
10562
+
10563
+ getPageType: function( e, $el ){
10564
+ return this.getPageParent() ? 'child' : 'parent';
10565
+ },
10566
+
10567
+ getPostFormat: function( e, $el ){
10568
+ var $el = $('#post-formats-select input:checked');
10569
+ if( $el.length ) {
10570
+ var val = $el.val();
10571
+ return (val == '0') ? 'standard' : val;
10572
+ }
10573
+ return null;
10574
+ },
10575
+
10576
+ getPostTerms: function(){
10577
+
10578
+ // vars
10579
+ var terms = {};
10580
+
10581
+ // serialize WP taxonomy postboxes
10582
+ var data = acf.serialize( $('.categorydiv, .tagsdiv') );
10583
+
10584
+ // use tax_input (tag, custom-taxonomy) when possible.
10585
+ // this data is already formatted in taxonomy => [terms].
10586
+ if( data.tax_input ) {
10587
+ terms = data.tax_input;
10588
+ }
10589
+
10590
+ // append "category" which uses a different name
10591
+ if( data.post_category ) {
10592
+ terms.category = data.post_category;
10593
+ }
10594
+
10595
+ // convert any string values (tags) into array format
10596
+ for( var tax in terms ) {
10597
+ if( !acf.isArray(terms[tax]) ) {
10598
+ terms[tax] = terms[tax].split(', ');
10599
+ }
10600
+ }
10601
+
10602
+ // loop over taxonomy fields and add their values
10603
+ acf.getFields({type: 'taxonomy'}).map(function( field ){
10604
+
10605
+ // ignore fields that don't save
10606
+ if( !field.get('save') ) {
10607
+ return;
10608
+ }
10609
+
10610
+ // vars
10611
+ var val = field.val();
10612
+ var tax = field.get('taxonomy');
10613
+
10614
+ // check val
10615
+ if( val ) {
10616
+
10617
+ // ensure terms exists
10618
+ terms[ tax ] = terms[ tax ] || [];
10619
+
10620
+ // ensure val is an array
10621
+ val = acf.isArray(val) ? val : [val];
10622
+
10623
+ // append
10624
+ terms[ tax ] = terms[ tax ].concat( val );
10625
+ }
10626
+ });
10627
+
10628
+ // add WC product type
10629
+ if( (productType = this.getProductType()) !== null ) {
10630
+ terms.product_type = [productType];
10631
+ }
10632
+
10633
+ // remove duplicate values
10634
+ for( var tax in terms ) {
10635
+ terms[tax] = acf.uniqueArray(terms[tax]);
10636
+ }
10637
+
10638
+ // return
10639
+ return terms;
10640
+ },
10641
+
10642
+ getProductType: function(){
10643
+ var $el = $('#product-type');
10644
+ return $el.length ? $el.val() : null;
10645
+ },
10646
+
10647
+ check: function(){
10648
+
10649
  // bail early if not for post
10650
  if( acf.get('screen') !== 'post' ) {
10651
  return;
10658
 
10659
  // vars
10660
  var ajaxData = acf.parseArgs(this.data, {
10661
+ action: 'acf/ajax/check_screen',
10662
+ screen: acf.get('screen'),
10663
+ exclude: []
10664
  });
10665
 
10666
+ // post id
10667
+ if( this.isPost() ) {
10668
+ ajaxData.post_id = acf.get('post_id');
10669
+ }
10670
+
10671
+ // page template
10672
+ if( (pageTemplate = this.getPageTemplate()) !== null ) {
10673
+ ajaxData.page_template = pageTemplate;
10674
+ }
10675
+
10676
+ // page parent
10677
+ if( (pageParent = this.getPageParent()) !== null ) {
10678
+ ajaxData.page_parent = pageParent;
10679
+ }
10680
+
10681
+ // page type
10682
+ if( (pageType = this.getPageType()) !== null ) {
10683
+ ajaxData.page_type = pageType;
10684
+ }
10685
 
10686
+ // post format
10687
+ if( (postFormat = this.getPostFormat()) !== null ) {
10688
+ ajaxData.post_format = postFormat;
10689
+ }
10690
+
10691
+ // post terms
10692
+ if( (postTerms = this.getPostTerms()) !== null ) {
10693
+ ajaxData.post_terms = postTerms;
10694
+ }
10695
+
10696
+ // exclude existing postboxes
10697
  $('.acf-postbox').not('.acf-hidden').each(function(){
10698
+ ajaxData.exclude.push( $(this).attr('id').substr(4) );
10699
  });
10700
 
10701
  // success
10765
  });
10766
  },
10767
 
10768
+ onChange: function( e, $el ){
10769
+ this.setTimeout(this.check, 1);
10770
+ }
10771
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10772
 
10773
+ /*
10774
+ // tests
10775
+ acf.registerScreenChange('#page_template', function( e, $el ){
10776
+ return $('#page_template').val();
10777
+ });
10778
+
10779
+ acf.registerScreenData({
10780
+ name: 'page_template',
10781
+ change: '#page_template',
10782
+ val: function(){
10783
+ var $input = $(this.el);
10784
+ return $input.length ? $input.val() : null;
10785
+ }
10786
+ });
10787
+
10788
+ acf.registerScreenData({
10789
+ name: 'post_terms',
10790
+ change: '.acf-taxonomy-field[data-save="1"]',
10791
+ val: function(){
10792
+ var $input = $(this.el);
10793
+ return $input.length ? $input.val() : null;
10794
+ }
10795
+ });
10796
+
10797
+ acf.registerScreenData({
10798
+ name: 'post_terms',
10799
+ change: '#product-type',
10800
+ val: function( terms ){
10801
+ var $select = $('#product-type');
10802
+ if( $select.length ) {
10803
+ terms.push('product_cat:'+$select.val());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10804
  }
10805
+ return terms;
 
 
10806
  }
10807
  });
10808
 
10809
+
10810
+ acf.screen.get('post_terms');
10811
+ acf.screen.getPostTerms();
10812
+
10813
+ */
10814
+
10815
  })(jQuery);
10816
 
10817
  (function($, undefined){
11715
 
11716
  // toolbar
11717
  var toolbar = args.toolbar;
11718
+ if( toolbar && toolbars && toolbars[toolbar] ) {
11719
 
11720
  for( var i = 1; i <= 4; i++ ) {
11721
  init[ 'toolbar' + i ] = toolbars[toolbar][i] || '';
12875
  $row = $();
12876
  }
12877
 
12878
+ // rtl
12879
+ if( acf.get('rtl') ) {
12880
+ thisLeft = Math.ceil( $field.parent().width() - (position.left + $field.outerWidth()) );
12881
+ }
12882
+
12883
  // add classes
12884
  if( thisTop == 0 ) {
12885
  $field.addClass('-r0');
13658
  acf.newCompatibility(acf.screen, {
13659
  update: function(){
13660
  return this.set.apply(this, arguments);
13661
+ },
13662
+ fetch: acf.screen.check
13663
  });
13664
  _acf.ajax = acf.screen;
13665
 
assets/js/acf-input.min.js CHANGED
@@ -1,4 +1,4 @@
1
- !function($,t){var e={};window.acf=e,e.data={},e.get=function(t){return this.data[t]||null},e.has=function(t){return null!==this.get(t)},e.set=function(t,e){return this.data[t]=e,this};var i=0;e.uniqueId=function(t){var e=++i+"";return t?t+e:e},e.uniqueArray=function(t){function e(t,e,i){return i.indexOf(t)===e}return t.filter(e)};var n="";e.uniqid=function(t,e){void 0===t&&(t="");var i,a=function(t,e){return t=parseInt(t,10).toString(16),e<t.length?t.slice(t.length-e):e>t.length?Array(e-t.length+1).join("0")+t:t};return n||(n=Math.floor(123456789*Math.random())),n++,i=t,i+=a(parseInt((new Date).getTime()/1e3,10),8),i+=a(n,5),e&&(i+=(10*Math.random()).toFixed(8).toString()),i},e.strReplace=function(t,e,i){return i.split(t).join(e)},e.strCamelCase=function(t){return t=t.replace(/[_-]/g," "),t=t.replace(/(?:^\w|\b\w|\s+)/g,function(t,e){return 0==+t?"":0==e?t.toLowerCase():t.toUpperCase()})},e.strPascalCase=function(t){var i=e.strCamelCase(t);return i.charAt(0).toUpperCase()+i.slice(1)},e.strSlugify=function(t){return e.strReplace("_","-",t.toLowerCase())},e.strSanitize=function(t){var e={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","ß":"s","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","ĝ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o"," ":"_","'":"","?":"","/":"","\\":"",".":"",",":"","`":"",">":"","<":"",'"':"","[":"","]":"","|":"","{":"","}":"","(":"",")":""},i=/\W/g,n=function(t){return e[t]||t};return t=t.replace(i,n),t=t.toLowerCase()},e.strMatch=function(t,e){for(var i=0,n=Math.min(t.length,e.length),a=0;a<n&&t[a]===e[a];a++)i++;return i},e.decode=function(t){return $("<textarea/>").html(t).text()},e.strEscape=function(t){var e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})},e.parseArgs=function(t,e){return"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={}),$.extend({},e,t)},void 0==window.acfL10n&&(acfL10n={}),e.__=function(t){return acfL10n[t]||t},e._x=function(t,e){return acfL10n[t+"."+e]||acfL10n[t]||t},e._n=function(t,i,n){return 1==n?e.__(t):e.__(i)},e.isArray=function(t){return Array.isArray(t)},e.isObject=function(t){return"object"==typeof t};var a=function(t,i,n){i=i.replace("[]","[%%index%%]");var a=i.match(/([^\[\]])+/g);if(a)for(var r=a.length,o=t,s=0;s<r;s++){var c=String(a[s]);s==r-1?"%%index%%"===c?o.push(n):o[c]=n:("%%index%%"===a[s+1]?e.isArray(o[c])||(o[c]=[]):e.isObject(o[c])||(o[c]={}),o=o[c])}};e.serialize=function(t,e){var i={},n=t.find("select, textarea, input").serializeArray();void 0!==e&&(n=n.filter(function(t){return 0===t.name.indexOf(e)}).map(function(t){return t.name=t.name.slice(e.length),t}));for(var r=0;r<n.length;r++)a(i,n[r].name,n[r].value);return i},e.addAction=function(t,i,n,a){return e.hooks.addAction.apply(this,arguments),this},e.removeAction=function(t,i){return e.hooks.removeAction.apply(this,arguments),this};var r={};e.doAction=function(t){return r[t]=1,e.hooks.doAction.apply(this,arguments),r[t]=0,this},e.doingAction=function(t){return 1===r[t]},e.didAction=function(t){return void 0!==r[t]},e.currentAction=function(){for(var t in r)if(r[t])return t;return!1},e.addFilter=function(t){return e.hooks.addFilter.apply(this,arguments),this},e.removeFilter=function(t){return e.hooks.removeFilter.apply(this,arguments),this},e.applyFilters=function(t){return e.hooks.applyFilters.apply(this,arguments)},e.arrayArgs=function(t){return Array.prototype.slice.call(t)};try{var o=JSON.parse(localStorage.getItem("acf"))||{}}catch(t){var o={}}var s=function(t){return"this."===t.substr(0,5)&&(t=t.substr(5)+"-"+e.get("post_id")),t};e.getPreference=function(t){return t=s(t),o[t]||null},e.setPreference=function(t,e){t=s(t),null===e?delete o[t]:o[t]=e,localStorage.setItem("acf",JSON.stringify(o))},e.removePreference=function(t){e.setPreference(t,null)},e.remove=function(t){t instanceof jQuery&&(t={target:t}),t=e.parseArgs(t,{target:!1,endHeight:0,complete:function(){}}),e.doAction("remove",t.target),t.target.is("tr")?l(t):c(t)};var c=function(t){var e=t.target,i=e.height(),n=e.width(),a=e.css("margin"),r=e.outerHeight(!0),o=e.attr("style")+"";e.wrap('<div class="acf-temp-remove" style="height:'+r+'px"></div>');var s=e.parent();e.css({height:i,width:n,margin:a,position:"absolute"}),setTimeout(function(){s.css({opacity:0,height:t.endHeight})},50),setTimeout(function(){e.attr("style",o),s.remove(),t.complete()},301)},l=function(t){var e=t.target,i=e.height(),n=e.children().length,a=$('<td class="acf-temp-remove" style="padding:0; height:'+i+'px" colspan="'+n+'"></td>');e.addClass("acf-remove-element"),setTimeout(function(){e.html(a)},251),setTimeout(function(){e.removeClass("acf-remove-element"),a.css({height:t.endHeight})},300),setTimeout(function(){e.remove(),t.complete()},451)};e.duplicate=function(t){t instanceof jQuery&&(t={target:t});var i=0;t=e.parseArgs(t,{target:!1,search:"",replace:"",before:function(t){},after:function(t,e){},append:function(t,e){t.after(e),i=1}}),t.target=t.target||t.$el;var n=t.target;t.search=t.search||n.attr("data-id"),t.replace=t.replace||e.uniqid(),t.before(n),e.doAction("before_duplicate",n);var a=n.clone();return e.rename({target:a,search:t.search,replace:t.replace}),a.removeClass("acf-clone"),a.find(".ui-sortable").removeClass("ui-sortable"),t.after(n,a),e.doAction("after_duplicate",n,a),t.append(n,a),e.doAction("append",a),a},e.rename=function(t){t instanceof jQuery&&(t={target:t}),t=e.parseArgs(t,{target:!1,destructive:!1,search:"",replace:""});var i=t.target,n=t.search||i.attr("data-id"),a=t.replace||e.uniqid("acf"),r=function(t,e){return e.replace(n,a)};if(t.destructive){var o=i.outerHTML();o=e.strReplace(n,a,o),i.replaceWith(o)}else i.attr("data-id",a),i.find('[id*="'+n+'"]').attr("id",r),i.find('[for*="'+n+'"]').attr("for",r),i.find('[name*="'+n+'"]').attr("name",r);return i},e.prepareForAjax=function(t){return t.nonce=e.get("nonce"),t.post_id=e.get("post_id"),t=e.applyFilters("prepare_for_ajax",t)},e.startButtonLoading=function(t){t.prop("disabled",!0),t.after(' <i class="acf-loading"></i>')},e.stopButtonLoading=function(t){t.prop("disabled",!1),t.next(".acf-loading").remove()},e.showLoading=function(t){t.append('<div class="acf-loading-overlay"><i class="acf-loading"></i></div>')},e.hideLoading=function(t){t.children(".acf-loading-overlay").remove()},e.updateUserSetting=function(t,i){var n={action:"acf/update_user_setting",name:t,value:i};$.ajax({url:e.get("ajaxurl"),data:e.prepareForAjax(n),type:"post",dataType:"html"})},e.val=function(t,e,i){var n=t.val();return e!==n&&(t.val(e),t.is("select")&&null===t.val()?(t.val(n),!1):(!0!==i&&t.trigger("change"),!0))},e.show=function(t,i){return i&&e.unlock(t,"hidden",i),!e.isLocked(t,"hidden")&&(!!t.hasClass("acf-hidden")&&(t.removeClass("acf-hidden"),!0))},e.hide=function(t,i){return i&&e.lock(t,"hidden",i),!t.hasClass("acf-hidden")&&(t.addClass("acf-hidden"),!0)},e.isHidden=function(t){return t.hasClass("acf-hidden")},e.isVisible=function(t){return!e.isHidden(t)};var d=function(t,i){return!t.hasClass("acf-disabled")&&(i&&e.unlock(t,"disabled",i),!e.isLocked(t,"disabled")&&(!!t.prop("disabled")&&(t.prop("disabled",!1),!0)))};e.enable=function(t,e){if(t.attr("name"))return d(t,e);var i=!1;return t.find("[name]").each(function(){d($(this),e)&&(i=!0)}),i};var u=function(t,i){return i&&e.lock(t,"disabled",i),!t.prop("disabled")&&(t.prop("disabled",!0),!0)};e.disable=function(t,e){if(t.attr("name"))return u(t,e);var i=!1;return t.find("[name]").each(function(){u($(this),e)&&(i=!0)}),i},e.isset=function(t){for(var e=1;e<arguments.length;e++){if(!t.hasOwnProperty(arguments[e]))return!1;t=t[arguments[e]]}return!0},e.isget=function(t){for(var e=1;e<arguments.length;e++){if(!t.hasOwnProperty(arguments[e]))return null;t=t[arguments[e]]}return t},e.getFileInputData=function(t,i){var n=t.val();if(!n)return!1;var a={url:n},r=e.isget(t[0],"files",0);if(r)if(a.size=r.size,a.type=r.type,r.type.indexOf("image")>-1){var o=window.URL||window.webkitURL,s=new Image;s.onload=function(){a.width=this.width,a.height=this.height,i(a)},s.src=o.createObjectURL(r)}else i(a);else i(a)},e.isAjaxSuccess=function(t){return t&&t.success},e.getAjaxMessage=function(t){return e.isget(t,"data","message")},e.getAjaxError=function(t){return e.isget(t,"data","error")},e.renderSelect=function(t,i){var n=t.val(),a=[],r=function(t){var i="";return t.map(function(t){var n=t.text||t.label||"",o=t.id||t.value||"";a.push(o),t.children?i+='<optgroup label="'+e.strEscape(n)+'">'+r(t.children)+"</optgroup>":i+='<option value="'+o+'"'+(t.disabled?' disabled="disabled"':"")+">"+e.strEscape(n)+"</option>"}),i};return t.html(r(i)),a.indexOf(n)>-1&&t.val(n),t.val()};var f=function(t,e){return t.data("acf-lock-"+e)||[]},h=function(t,e,i){t.data("acf-lock-"+e,i)};e.lock=function(t,e,i){var n=f(t,e);n.indexOf(i)<0&&(n.push(i),h(t,e,n))},e.unlock=function(t,e,i){var n=f(t,e),a=n.indexOf(i);return a>-1&&(n.splice(a,1),h(t,e,n)),0===n.length},e.isLocked=function(t,e){return f(t,e).length>0},$.fn.exists=function(){return $(this).length>0},$.fn.outerHTML=function(){return $(this).get(0).outerHTML},Array.prototype.indexOf||(Array.prototype.indexOf=function(t){return $.inArray(t,this)}),$(document).ready(function(){e.doAction("ready")}),$(window).on("load",function(){e.doAction("load")}),$(window).on("beforeunload",function(){e.doAction("unload")}),$(window).on("resize",function(){e.doAction("resize")}),$(document).on("sortstart",function(t,i){e.doAction("sortstart",i.item,i.placeholder)}),$(document).on("sortstop",function(t,i){e.doAction("sortstop",i.item,i.placeholder)})}(jQuery),function(t,e){"use strict";var i=function(){function t(){return f}function e(t,e,i,n){return"string"==typeof t&&"function"==typeof e&&(i=parseInt(i||10,10),c("actions",t,e,i,n)),u}function i(){var t=Array.prototype.slice.call(arguments),e=t.shift();return"string"==typeof e&&d("actions",e,t),u}function n(t,e){return"string"==typeof t&&s("actions",t,e),u}function a(t,e,i,n){return"string"==typeof t&&"function"==typeof e&&(i=parseInt(i||10,10),c("filters",t,e,i,n)),u}function r(){var t=Array.prototype.slice.call(arguments),e=t.shift();return"string"==typeof e?d("filters",e,t):u}function o(t,e){return"string"==typeof t&&s("filters",t,e),u}function s(t,e,i,n){if(f[t][e])if(i){var a=f[t][e],r;if(n)for(r=a.length;r--;){var o=a[r];o.callback===i&&o.context===n&&a.splice(r,1)}else for(r=a.length;r--;)a[r].callback===i&&a.splice(r,1)}else f[t][e]=[]}function c(t,e,i,n,a){var r={callback:i,priority:n,context:a},o=f[t][e];o?(o.push(r),o=l(o)):o=[r],f[t][e]=o}function l(t){for(var e,i,n,a=1,r=t.length;a<r;a++){for(e=t[a],i=a;(n=t[i-1])&&n.priority>e.priority;)t[i]=t[i-1],--i;t[i]=e}return t}function d(t,e,i){var n=f[t][e];if(!n)return"filters"===t&&i[0];var a=0,r=n.length;if("filters"===t)for(;a<r;a++)i[0]=n[a].callback.apply(n[a].context,i);else for(;a<r;a++)n[a].callback.apply(n[a].context,i);return"filters"!==t||i[0]}var u={removeFilter:o,applyFilters:r,addFilter:a,removeAction:n,doAction:i,addAction:e,storage:t},f={actions:{},filters:{}};return u};acf.hooks=new i}(window),function($,t){var e=/^(\S+)\s*(.*)$/,i=function(t){var e=this,i;return i=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},$.extend(i,e),i.prototype=Object.create(e.prototype),$.extend(i.prototype,t),i.prototype.constructor=i,i},n=acf.Model=function(){this.cid=acf.uniqueId("acf"),this.data=$.extend(!0,{},this.data),this.setup.apply(this,arguments),this.$el&&!this.$el.data("acf")&&this.$el.data("acf",this);var t=function(){this.initialize(),this.addEvents(),this.addActions(),this.addFilters()};this.wait&&!acf.didAction(this.wait)?this.addAction(this.wait,t):t.apply(this)};$.extend(n.prototype,{id:"",cid:"",$el:null,data:{},busy:!1,changed:!1,events:{},actions:{},filters:{},eventScope:"",wait:!1,priority:10,get:function(t){return this.data[t]},has:function(t){return null!=this.get(t)},set:function(t,e,i){return this.get(t)==e?this:(this.data[t]=e,i||(this.changed=!0,this.trigger("changed:"+t,[e]),this.trigger("changed",[t,e])),this)},inherit:function(t){return t instanceof jQuery&&(t=t.data()),$.extend(this.data,t),this},prop:function(){return this.$el.prop.apply(this.$el,arguments)},setup:function(t){$.extend(this,t)},initialize:function(){},addElements:function(t){if(!(t=t||this.elements||null)||!Object.keys(t).length)return!1;for(var e in t)this.addElement(e,t[e])},addElement:function(t,e){this["$"+t]=this.$(e)},addEvents:function(t){if(!(t=t||this.events||null))return!1;for(var i in t){var n=i.match(e);this.on(n[1],n[2],t[i])}},removeEvents:function(t){if(!(t=t||this.events||null))return!1;for(var i in t){var n=i.match(e);this.off(n[1],n[2],t[i])}},getEventTarget:function(t,e){return t||this.$el||$(document)},validateEvent:function(t){return!this.eventScope||$(t.target).closest(this.eventScope).is(this.$el)},proxyEvent:function(t){return this.proxy(function(e){if(this.validateEvent(e)){var i=acf.arrayArgs(arguments),n=i.slice(1),a=[e,$(e.currentTarget)].concat(n);t.apply(this,a)}})},on:function(t,e,i,n){var a,r,o,s,c;t instanceof jQuery?n?(a=t,r=e,o=i,s=n):(a=t,r=e,s=i):i?(r=t,o=e,s=i):(r=t,s=e),a=this.getEventTarget(a),"string"==typeof s&&(s=this.proxyEvent(this[s])),r=r+"."+this.cid,c=o?[r,o,s]:[r,s],a.on.apply(a,c)},off:function(t,e,i){var n,a,r,o;t instanceof jQuery?i?(n=t,a=e,r=i):(n=t,a=e):e?(a=t,r=e):a=t,n=this.getEventTarget(n),a=a+"."+this.cid,o=r?[a,r]:[a],n.off.apply(n,o)},trigger:function(t,e,i){var n=this.getEventTarget();return i?n.trigger.apply(n,arguments):n.triggerHandler.apply(n,arguments),this},addActions:function(t){if(!(t=t||this.actions||null))return!1;for(var e in t)this.addAction(e,t[e])},removeActions:function(t){if(!(t=t||this.actions||null))return!1;for(var e in t)this.removeAction(e,t[e])},addAction:function(t,e,i){i=i||this.priority,"string"==typeof e&&(e=this[e]),acf.addAction(t,e,i,this)},removeAction:function(t,e){acf.removeAction(t,this[e])},addFilters:function(t){if(!(t=t||this.filters||null))return!1;for(var e in t)this.addFilter(e,t[e])},addFilter:function(t,e,i){i=i||this.priority,"string"==typeof e&&(e=this[e]),acf.addFilter(t,e,i,this)},removeFilters:function(t){if(!(t=t||this.filters||null))return!1;for(var e in t)this.removeFilter(e,t[e])},removeFilter:function(t,e){acf.removeFilter(t,this[e])},$:function(t){return this.$el.find(t)},remove:function(){this.removeEvents(),this.removeActions(),this.removeFilters(),this.$el.remove()},setTimeout:function(t,e){return setTimeout(this.proxy(t),e)},time:function(){console.time(this.id||this.cid)},timeEnd:function(){console.timeEnd(this.id||this.cid)},show:function(){acf.show(this.$el)},hide:function(){acf.hide(this.$el)},proxy:function(t){return $.proxy(t,this)}}),n.extend=i,acf.models={},acf.getInstance=function(t){return t.data("acf")},acf.getInstances=function(t){var e=[];return t.each(function(){e.push(acf.getInstance($(this)))}),e}}(jQuery),function($,t){acf.models.Popup=acf.Model.extend({data:{title:"",content:"",width:0,height:0,loading:!1},events:{'click [data-event="close"]':"onClickClose","click .acf-close-popup":"onClickClose"},setup:function(t){$.extend(this.data,t),this.$el=$(this.tmpl())},initialize:function(){this.render(),this.open()},tmpl:function(){return['<div id="acf-popup">','<div class="acf-popup-box acf-box">','<div class="title"><h3></h3><a href="#" class="acf-icon -cancel grey" data-event="close"></a></div>','<div class="inner"></div>','<div class="loading"><i class="acf-loading"></i></div>',"</div>",'<div class="bg" data-event="close"></div>',"</div>"].join("")},render:function(){var t=this.get("title"),e=this.get("content"),i=this.get("loading"),n=this.get("width"),a=this.get("height");this.title(t),this.content(e),n&&this.$(".acf-popup-box").css("width",n),a&&this.$(".acf-popup-box").css("min-height",a),this.loading(i),acf.doAction("append",this.$el)},update:function(t){this.data=acf.parseArgs(t,this.data),this.render()},title:function(t){this.$(".title:first h3").html(t)},content:function(t){this.$(".inner:first").html(t)},loading:function(t){var e=this.$(".loading:first");t?e.show():e.hide()},open:function(){$("body").append(this.$el)},close:function(){this.remove()},onClickClose:function(t,e){t.preventDefault(),this.close()}}),acf.newPopup=function(t){return new acf.models.Popup(t)}}(jQuery),function($,t){acf.unload=new acf.Model({wait:"load",active:!0,changed:!1,actions:{change_field:"startListening",validation_failure:"startListening"},events:{"submit form":"stopListening"},reset:function(){this.stopListening()},startListening:function(){!this.changed&&this.active&&(this.changed=!0,$(window).on("beforeunload",this.onUnload))},stopListening:function(){this.changed=!1,$(window).off("beforeunload",this.onUnload)},onUnload:function(){return acf.__("The changes you made will be lost if you navigate away from this page")}})}(jQuery),function($,t){var e=new acf.Model({events:{"click .acf-panel-title":"onClick"},onClick:function(t,e){t.preventDefault(),this.toggle(e.parent())},isOpen:function(t){return t.hasClass("-open")},toggle:function(t){this.isOpen(t)?this.close(t):this.open(t)},open:function(t){t.addClass("-open"),t.find(".acf-panel-title i").attr("class","dashicons dashicons-arrow-down")},close:function(t){t.removeClass("-open"),t.find(".acf-panel-title i").attr("class","dashicons dashicons-arrow-right")}})}(jQuery),function($,t){var e=acf.Model.extend({data:{text:"",type:"",timeout:0,dismiss:!0,target:!1,close:function(){}},events:{"click .acf-notice-dismiss":"onClickClose"},tmpl:function(){return'<div class="acf-notice"></div>'},setup:function(t){$.extend(this.data,t),this.$el=$(this.tmpl())},initialize:function(){this.render(),this.show()},render:function(){this.type(this.get("type")),this.html("<p>"+this.get("text")+"</p>"),this.get("dismiss")&&(this.$el.append('<a href="#" class="acf-notice-dismiss acf-icon -cancel small"></a>'),this.$el.addClass("-dismiss"));var t=this.get("timeout");t&&this.away(t)},update:function(t){$.extend(this.data,t),this.initialize()},show:function(){var t=this.get("target");t&&t.prepend(this.$el)},hide:function(){this.$el.remove()},away:function(t){this.setTimeout(function(){acf.remove(this.$el)},t)},type:function(t){var e=this.get("type");e&&this.$el.removeClass("-"+e),this.$el.addClass("-"+t),"error"==t&&this.$el.addClass("acf-error-message")},html:function(t){this.$el.html(t)},text:function(t){this.$("p").html(t)},onClickClose:function(t,e){t.preventDefault(),this.get("close").apply(this,arguments),this.remove()}});acf.newNotice=function(t){return"object"!=typeof t&&(t={text:t}),new e(t)};var i=new acf.Model({wait:"prepare",priority:1,initialize:function(){var t=$(".acf-admin-notice");t.length&&$("h1:first").after(t)}})}(jQuery),function($,t){acf.models.Postbox=acf.Model.extend({data:{id:"",key:"",style:"default",label:"top",editLink:"",editTitle:"",visibility:!0},setup:function(t){$.extend(this.data,t)},initialize:function(){var t=this.get("id"),e=$("#"+t),i=$("#"+t+"-hide"),n=i.parent();e.addClass("acf-postbox"),n.addClass("acf-postbox-toggle"),e.removeClass("hide-if-js"),n.removeClass("hide-if-js");var a=this.get("style");"default"!==a&&e.addClass(a),e.children(".inside").addClass("acf-fields").addClass("-"+this.get("label")),this.get("visibility")?i.prop("checked",!0):(e.addClass("acf-hidden"),n.addClass("acf-hidden"));var r=this.get("editLink"),o=this.get("editTitle");r&&e.children(".hndle").append('<a href="'+r+'" class="dashicons dashicons-admin-generic acf-hndle-cog acf-js-tooltip" title="'+o+'"></a>')}}),acf.newPostbox=function(t){return new acf.models.Postbox(t)}}(jQuery),function($,t){acf.newTooltip=function(t){return"object"!=typeof t&&(t={text:t}),void 0!==t.confirmRemove?(t.textConfirm=acf.__("Remove"),t.textCancel=acf.__("Cancel"),new i(t)):void 0!==t.confirm?new i(t):new e(t)};var e=acf.Model.extend({data:{text:"",timeout:0,target:null},tmpl:function(){return'<div class="acf-tooltip"></div>'},setup:function(t){$.extend(this.data,t),this.$el=$(this.tmpl())},initialize:function(){this.render(),this.show(),this.position();var t=this.get("timeout");t&&setTimeout($.proxy(this.fade,this),t)},update:function(t){$.extend(this.data,t),this.initialize()},render:function(){this.html(this.get("text"))},show:function(){$("body").append(this.$el)},hide:function(){this.$el.remove()},fade:function(){this.$el.addClass("acf-fade-up"),this.setTimeout(function(){this.remove()},250)},html:function(t){this.$el.html(t)},position:function(){var t=this.$el,e=this.get("target");if(e){t.removeClass("right left bottom top");var i=10,n=e.outerWidth(),a=e.outerHeight(),r=e.offset().top,o=e.offset().left,s=t.outerWidth(),c=t.outerHeight(),l=r-c,d=o+n/2-s/2;d<10?(t.addClass("right"),d=o+n,l=r+a/2-c/2):d+s+10>$(window).width()?(t.addClass("left"),d=o-s,l=r+a/2-c/2):l-$(window).scrollTop()<10?(t.addClass("bottom"),l=r+a):t.addClass("top"),t.css({top:l,left:d})}}}),i=e.extend({data:{text:"",textConfirm:"",textCancel:"",target:null,targetConfirm:!0,confirm:function(){},cancel:function(){},context:!1},events:{'click [data-event="cancel"]':"onCancel",'click [data-event="confirm"]':"onConfirm"},addEvents:function(){acf.Model.prototype.addEvents.apply(this);var t=$(document),e=this.get("target");this.setTimeout(function(){this.on(t,"click","onCancel")}),this.get("targetConfirm")&&this.on(e,"click","onConfirm")},removeEvents:function(){acf.Model.prototype.removeEvents.apply(this);var t=$(document),e=this.get("target");this.off(t,"click"),this.off(e,"click")},render:function(){var t=this.get("text")||acf.__("Are you sure?"),e=this.get("textConfirm")||acf.__("Yes"),i=this.get("textCancel")||acf.__("No"),n=[t,'<a href="#" data-event="confirm">'+e+"</a>",'<a href="#" data-event="cancel">'+i+"</a>"].join(" ");this.html(n),this.$el.addClass("-confirm")},onCancel:function(t,e){t.preventDefault(),t.stopImmediatePropagation();var i=this.get("cancel"),n=this.get("context")||this;i.apply(n,arguments),this.remove()},onConfirm:function(t,e){t.preventDefault(),t.stopImmediatePropagation();var i=this.get("confirm"),n=this.get("context")||this;i.apply(n,arguments),this.remove()}});acf.models.Tooltip=e,acf.models.TooltipConfirm=i;var n=new acf.Model({tooltip:!1,events:{"mouseenter .acf-js-tooltip":"showTitle","mouseup .acf-js-tooltip":"hideTitle","mouseleave .acf-js-tooltip":"hideTitle"},showTitle:function(t,e){var i=e.attr("title");i&&(e.attr("title",""),this.tooltip?this.tooltip.update({text:i,target:e}):this.tooltip=acf.newTooltip({text:i,target:e}))},hideTitle:function(t,e){this.tooltip.hide(),e.attr("title",this.tooltip.get("text"))}})}(jQuery),function($,t){var e=[];acf.Field=acf.Model.extend({type:"",eventScope:".acf-field",wait:"ready",setup:function(t){this.$el=t,this.inherit(t),this.inherit(this.$control())},val:function(t){return void 0!==t?this.setValue(t):this.prop("disabled")?null:this.getValue()},getValue:function(){return this.$input().val()},setValue:function(t){return acf.val(this.$input(),t)},__:function(t){return acf._e(this.type,t)},$control:function(){return!1},$input:function(){return this.$("[name]:first")},$inputWrap:function(){return this.$(".acf-input:first")},$labelWrap:function(){return this.$(".acf-label:first")},getInputName:function(){return this.$input().attr("name")||""},parent:function(){var t=this.parents();return!!t.length&&t[0]},parents:function(){var t=this.$el.parents(".acf-field");return acf.getFields(t)},show:function(t,e){var i=acf.show(this.$el,t);return i&&(this.prop("hidden",!1),acf.doAction("show_field",this,e)),i},hide:function(t,e){var i=acf.hide(this.$el,t);return i&&(this.prop("hidden",!0),acf.doAction("hide_field",this,e)),i},enable:function(t,e){var i=acf.enable(this.$el,t);return i&&(this.prop("disabled",!1),acf.doAction("enable_field",this,e)),i},disable:function(t,e){var i=acf.disable(this.$el,t);return i&&(this.prop("disabled",!0),acf.doAction("disable_field",this,e)),i},showEnable:function(t,e){return this.enable.apply(this,arguments),this.show.apply(this,arguments)},hideDisable:function(t,e){return this.disable.apply(this,arguments),this.hide.apply(this,arguments)},showNotice:function(t){"object"!=typeof t&&(t={text:t}),this.notice&&this.notice.remove(),t.target=this.$inputWrap(),this.notice=acf.newNotice(t)},removeNotice:function(t){this.notice&&(this.notice.away(t||0),this.notice=!1)},showError:function(t){this.$el.addClass("acf-error"),void 0!==t&&this.showNotice({text:t,type:"error",dismiss:!1}),acf.doAction("invalid_field",this),this.$el.one("focus change","input, select, textarea",$.proxy(this.removeError,this))},removeError:function(){this.$el.removeClass("acf-error"),this.removeNotice(250),acf.doAction("valid_field",this)},trigger:function(t,e,i){return"invalidField"==t&&(i=!0),acf.Model.prototype.trigger.apply(this,[t,e,i])}}),acf.newField=function(t){var e=t.data("type"),n=i(e),a=acf.models[n]||acf.Field,r=new a(t);return acf.doAction("new_field",r),r};var i=function(t){return acf.strPascalCase(t||"")+"Field"};acf.registerFieldType=function(t){var n=t.prototype,a=n.type,r=i(a);acf.models[r]=t,e.push(a)},acf.getFieldType=function(t){var e=i(t);return acf.models[e]||!1},acf.getFieldTypes=function(t){t=acf.parseArgs(t,{category:""});var i=[];return e.map(function(e){var n=acf.getFieldType(e),a=n.prototype;t.category&&a.category!==t.category||i.push(n)}),i}}(jQuery),function($,t){acf.findFields=function(t){var e=".acf-field",i=!1;return t=acf.parseArgs(t,{key:"",name:"",type:"",is:"",parent:!1,sibling:!1,limit:!1,visible:!1,suppressFilters:!1}),t.suppressFilters||(t=acf.applyFilters("find_fields_args",t)),t.key&&(e+='[data-key="'+t.key+'"]'),t.type&&(e+='[data-type="'+t.type+'"]'),t.name&&(e+='[data-name="'+t.name+'"]'),t.is&&(e+=t.is),t.visible&&(e+=":visible"),i=t.parent?t.parent.find(e):t.sibling?t.sibling.siblings(e):$(e),t.suppressFilters||(i=i.not(".acf-clone .acf-field"),i=acf.applyFilters("find_fields",i)),t.limit&&(i=i.slice(0,t.limit)),i},acf.findField=function(t,e){return acf.findFields({key:t,limit:1,parent:e,suppressFilters:!0})},acf.getField=function(t){t instanceof jQuery||(t=acf.findField(t));var e=t.data("acf");return e||(e=acf.newField(t)),e},acf.getFields=function(t){t instanceof jQuery||(t=acf.findFields(t));var e=[];return t.each(function(){var t=acf.getField($(this));e.push(t)}),e},acf.findClosestField=function(t){return t.closest(".acf-field")},acf.getClosestField=function(t){var e=acf.findClosestField(t);return this.getField(e)};var e=function(t){var e=t,n=t+"_fields",a=t+"_field",r=function(t){var e=acf.arrayArgs(arguments),i=e.slice(1),a=acf.getFields({parent:t});if(a.length){var r=[n,a].concat(i);acf.doAction.apply(null,r)}},o=function(t){var e=acf.arrayArgs(arguments),i=e.slice(1);t.map(function(t,e){var n=[a,t].concat(i);acf.doAction.apply(null,n)})};acf.addAction(e,r),acf.addAction(n,o),i(t)},i=function(t){var e=t+"_field",i=t+"Field",n=function(n){var a=acf.arrayArgs(arguments),o=a.slice(1);["type","name","key"].map(function(t){var i="/"+t+"="+n.get(t);a=[e+i,n].concat(o),acf.doAction.apply(null,a)}),r.indexOf(t)>-1&&n.trigger(i,o)};acf.addAction(e,n)},n=["prepare","ready","load","append","remove","sortstart","sortstop","show","hide","unload"],a=["valid","invalid","enable","disable","new"],r=["remove","sortstart","sortstop","show","hide","unload","valid","invalid","enable","disable"];n.map(e),a.map(i);var o=new acf.Model({id:"fieldsEventManager",events:{'click .acf-field a[href="#"]':"onClick","change .acf-field":"onChange"},onClick:function(t){t.preventDefault()},onChange:function(){$("#_acf_changed").val(1)}})}(jQuery),function($,t){var e=0,i=acf.Field.extend({type:"accordion",wait:"",$control:function(){return this.$(".acf-fields:first")},initialize:function(){if(!this.$el.is("td")){if(this.get("endpoint"))return this.remove();var t=this.$el,i=this.$labelWrap(),n=this.$inputWrap(),a=this.$control(),r=n.children(".description");if(r.length&&i.append(r),this.$el.is("tr")){var o=this.$el.closest("table"),s=$('<div class="acf-accordion-title"/>'),c=$('<div class="acf-accordion-content"/>'),l=$('<table class="'+o.attr("class")+'"/>'),d=$("<tbody/>");s.append(i.html()),l.append(d),c.append(l),n.append(s),n.append(c),i.remove(),a.remove(),n.attr("colspan",2),i=s,n=c,a=d}t.addClass("acf-accordion"),i.addClass("acf-accordion-title"),n.addClass("acf-accordion-content"),e++,this.get("multi_expand")&&t.attr("multi-expand",1);var u=acf.getPreference("this.accordions")||[];void 0!==u[e-1]&&this.set("open",u[e-1]),this.get("open")&&(t.addClass("-open"),n.css("display","block")),i.prepend('<i class="acf-accordion-icon dashicons dashicons-arrow-'+(this.get("open")?"down":"right")+'"></i>');var f=t.parent();a.addClass(f.hasClass("-left")?"-left":""),a.addClass(f.hasClass("-clear")?"-clear":""),a.append(t.nextUntil(".acf-field-accordion",".acf-field")),a.removeAttr("data-open data-multi_expand data-endpoint")}}});acf.registerFieldType(i);var n=new acf.Model({actions:{unload:"onUnload"},events:{"click .acf-accordion-title":"onClick","invalidField .acf-accordion":"onInvalidField"},isOpen:function(t){return t.hasClass("-open")},toggle:function(t){this.isOpen(t)?this.close(t):this.open(t)},open:function(t){t.find(".acf-accordion-content:first").slideDown().css("display","block"),t.find(".acf-accordion-icon:first").removeClass("dashicons-arrow-right").addClass("dashicons-arrow-down"),t.addClass("-open"),acf.doAction("show",t),t.attr("multi-expand")||t.siblings(".acf-accordion.-open").each(function(){n.close($(this))})},close:function(t){t.find(".acf-accordion-content:first").slideUp(),t.find(".acf-accordion-icon:first").removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right"),t.removeClass("-open"),acf.doAction("hide",t)},onClick:function(t,e){t.preventDefault(),this.toggle(e.parent())},onInvalidField:function(t,e){this.busy||(this.busy=!0,this.setTimeout(function(){this.busy=!1},1e3),this.open(e))},onUnload:function(t){var e=[];$(".acf-accordion").each(function(){var t=$(this).hasClass("-open")?1:0;e.push(t)}),e.length&&acf.setPreference("this.accordions",e)}})}(jQuery),function($,t){var e=acf.Field.extend({type:"button_group",events:{'click input[type="radio"]':"onClick"},$control:function(){return this.$(".acf-button-group")},$input:function(){return this.$("input:checked")},setValue:function(t){this.$('input[value="'+t+'"]').prop("checked",!0).trigger("change")},onClick:function(t,e){
2
- var i=e.parent("label"),n=i.hasClass("selected");this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"))}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"checkbox",events:{"change input":"onChange","click .acf-add-checkbox":"onClickAdd","click .acf-checkbox-toggle":"onClickToggle","click .acf-checkbox-custom":"onClickCustom"},$control:function(){return this.$(".acf-checkbox-list")},$toggle:function(){return this.$(".acf-checkbox-toggle")},$input:function(){return this.$('input[type="hidden"]')},$inputs:function(){return this.$('input[type="checkbox"]').not(".acf-checkbox-toggle")},getValue:function(){var t=[];return this.$(":checked").each(function(){t.push($(this).val())}),!!t.length&&t},onChange:function(t,e){var i=e.prop("checked"),n=this.$toggle();if(i?e.parent().addClass("selected"):e.parent().removeClass("selected"),n.length){0==this.$inputs().not(":checked").length?n.prop("checked",!0):n.prop("checked",!1)}},onClickAdd:function(t,e){var i='<li><input class="acf-checkbox-custom" type="checkbox" checked="checked" /><input type="text" name="'+this.getInputName()+'[]" /></li>';e.parent("li").before(i)},onClickToggle:function(t,e){var i=e.prop("checked");this.$inputs().prop("checked",i)},onClickCustom:function(t,e){var i=e.prop("checked"),n=e.next('input[type="text"]');i?n.prop("disabled",!1):(n.prop("disabled",!0),""==n.val()&&e.parent("li").remove())}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"color_picker",wait:"load",$control:function(){return this.$(".acf-color-picker")},$input:function(){return this.$('input[type="hidden"]')},$inputText:function(){return this.$('input[type="text"]')},initialize:function(){var t=this.$input(),e=this.$inputText(),i=function(i){setTimeout(function(){acf.val(t,e.val())},1)},n={defaultColor:!1,palettes:!0,hide:!0,change:i,clear:i},n=acf.applyFilters("color_picker_args",n,this);e.wpColorPicker(n)}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"date_picker",events:{'blur input[type="text"]':"onBlur"},$control:function(){return this.$(".acf-date-picker")},$input:function(){return this.$('input[type="hidden"]')},$inputText:function(){return this.$('input[type="text"]')},initialize:function(){if(this.has("save_format"))return this.initializeCompatibility();var t=this.$input(),e=this.$inputText(),i={dateFormat:this.get("date_format"),altField:t,altFormat:"yymmdd",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day")};i=acf.applyFilters("date_picker_args",i,this),acf.newDatePicker(e,i),acf.doAction("date_picker_init",e,i,this)},initializeCompatibility:function(){var t=this.$input(),e=this.$inputText();e.val(t.val());var i={dateFormat:this.get("date_format"),altField:t,altFormat:this.get("save_format"),changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day")};i=acf.applyFilters("date_picker_args",i,this);var n=i.dateFormat;i.dateFormat=this.get("save_format"),acf.newDatePicker(e,i),e.datepicker("option","dateFormat",n),acf.doAction("date_picker_init",e,i,this)},onBlur:function(){this.$inputText().val()||acf.val(this.$input(),"")}});acf.registerFieldType(e);var i=new acf.Model({priority:5,wait:"ready",initialize:function(){var t=acf.get("locale"),e=acf.get("rtl"),i=acf.get("datePickerL10n");return!!i&&(void 0!==$.datepicker&&(i.isRTL=e,$.datepicker.regional[t]=i,void $.datepicker.setDefaults(i)))}});acf.newDatePicker=function(t,e){if(void 0===$.datepicker)return!1;e=e||{},t.datepicker(e),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function($,t){var e=acf.models.DatePickerField.extend({type:"date_time_picker",$control:function(){return this.$(".acf-date-time-picker")},initialize:function(){var t=this.$input(),e=this.$inputText(),i={dateFormat:this.get("date_format"),timeFormat:this.get("time_format"),altField:t,altFieldTimeOnly:!1,altFormat:"yy-mm-dd",altTimeFormat:"HH:mm:ss",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day"),controlType:"select",oneLine:!0};i=acf.applyFilters("date_time_picker_args",i,this),acf.newDateTimePicker(e,i),acf.doAction("date_time_picker_init",e,i,this)}});acf.registerFieldType(e);var i=new acf.Model({priority:5,wait:"ready",initialize:function(){var t=acf.get("locale"),e=acf.get("rtl"),i=acf.get("dateTimePickerL10n");return!!i&&(void 0!==$.timepicker&&(i.isRTL=e,$.timepicker.regional[t]=i,void $.timepicker.setDefaults(i)))}});acf.newDateTimePicker=function(t,e){if(void 0===$.timepicker)return!1;e=e||{},t.datetimepicker(e),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function($,t){var e=acf.Field.extend({type:"google_map",map:!1,wait:"load",events:{'click a[data-name="clear"]':"onClickClear",'click a[data-name="locate"]':"onClickLocate",'click a[data-name="search"]':"onClickSearch","keydown .search":"onKeydownSearch","keyup .search":"onKeyupSearch","focus .search":"onFocusSearch","blur .search":"onBlurSearch",showField:"onShow"},$control:function(){return this.$(".acf-google-map")},$input:function(t){return this.$('input[data-name="'+(t||"address")+'"]')},$search:function(){return this.$(".search")},$canvas:function(){return this.$(".canvas")},addClass:function(t){this.$control().addClass(t)},removeClass:function(t){this.$control().removeClass(t)},getValue:function(){var t={lat:"",lng:"",address:""};return this.$('input[type="hidden"]').each(function(){t[$(this).data("name")]=$(this).val()}),t.address||(t=!1),t},setValue:function(t){t=acf.parseArgs(t,{lat:"",lng:"",address:""});for(var e in t)acf.val(this.$input(e),t[e]);t.address||(t=!1),this.renderVal(t)},renderVal:function(t){t?(this.addClass("-value"),this.setPosition(t.lat,t.lng),this.map.marker.setVisible(!0)):(this.removeClass("-value"),this.map.marker.setVisible(!1)),this.$search().val(t.address)},setPosition:function(t,e){var i=this.newLatLng(t,e);return this.map.marker.setPosition(i),this.map.marker.setVisible(!0),acf.doAction("google_map_change",i,this.map,this),this.center(),this},center:function(){var t=this.map.marker.getPosition(),e=this.get("lat"),i=this.get("lng");t&&(e=t.lat(),i=t.lng());var n=this.newLatLng(e,i);this.map.setCenter(n)},getSearchVal:function(){return this.$search().val()},initialize:function(){if(!i.isReady())return void i.ready(this.initializeMap,this);this.initializeMap()},newLatLng:function(t,e){return new google.maps.LatLng(parseFloat(t),parseFloat(e))},initializeMap:function(){var t=this.get("zoom"),e=this.get("lat"),i=this.get("lng"),n={scrollwheel:!1,zoom:parseInt(t),center:this.newLatLng(e,i),mapTypeId:google.maps.MapTypeId.ROADMAP,marker:{draggable:!0,raiseOnDrag:!0},autocomplete:{}};n=acf.applyFilters("google_map_args",n,this);var a=new google.maps.Map(this.$canvas()[0],n);this.addMapEvents(a,this);var r=acf.parseArgs(n.marker,{draggable:!0,raiseOnDrag:!0,map:a});r=acf.applyFilters("google_map_marker_args",r,this);var o=new google.maps.Marker(r);this.addMarkerEvents(o,this),a.acf=this,a.marker=o,this.map=a,acf.doAction("google_map_init",a,o,this);var s=this.getValue();this.renderVal(s)},addMapEvents:function(t,e){if(acf.isset(window,"google","maps","places","Autocomplete")){var i=t.autocomplete||{},n=new google.maps.places.Autocomplete(this.$search()[0],i);n.bindTo("bounds",t),google.maps.event.addListener(n,"place_changed",function(){var t=this.getPlace();t.address=e.getSearchVal(),e.setPlace(t)})}google.maps.event.addListener(t,"click",function(t){var i=t.latLng.lat(),n=t.latLng.lng();e.searchPosition(i,n)})},addMarkerEvents:function(t,e){google.maps.event.addListener(t,"dragend",function(){var t=this.getPosition(),i=t.lat(),n=t.lng();e.searchPosition(i,n)})},searchPosition:function(t,e){var n=this.newLatLng(t,e),a=this.$control();this.setPosition(t,e),a.addClass("-loading");var r=$.proxy(function(i,n){a.removeClass("-loading");var r="";n!=google.maps.GeocoderStatus.OK?console.log("Geocoder failed due to: "+n):i[0]?r=i[0].formatted_address:console.log("No results found"),this.val({lat:t,lng:e,address:r})},this);i.geocoder.geocode({latLng:n},r)},setPlace:function(t){if(!t)return this;if(t.name&&!t.geometry)return this.searchAddress(t.name),this;var e=t.geometry.location.lat(),i=t.geometry.location.lng(),n=t.address||t.formatted_address;return this.setValue({lat:e,lng:i,address:n}),this},searchAddress:function(t){var e=t.split(",");if(2==e.length){var n=e[0],a=e[1];if($.isNumeric(n)&&$.isNumeric(a))return this.searchPosition(n,a)}var r=this.$control();r.addClass("-loading");var o=this.proxy(function(e,i){r.removeClass("-loading");var n="",a="";i!=google.maps.GeocoderStatus.OK?console.log("Geocoder failed due to: "+i):e[0]?(n=e[0].geometry.location.lat(),a=e[0].geometry.location.lng()):console.log("No results found"),this.val({lat:n,lng:a,address:t})});i.geocoder.geocode({address:t},o)},searchLocation:function(){if(!navigator.geolocation)return alert(acf.__("Sorry, this browser does not support geolocation"));var t=this.$control();t.addClass("-loading");var e=$.proxy(function(e,i){t.removeClass("-loading");var n=e.coords.latitude,a=e.coords.longitude;this.searchPosition(n,a)},this),i=function(e){t.removeClass("-loading")};navigator.geolocation.getCurrentPosition(e,i)},onClickClear:function(t,e){this.val(!1)},onClickLocate:function(t,e){this.searchLocation()},onClickSearch:function(t,e){this.searchAddress(this.$search().val())},onFocusSearch:function(t,e){this.removeClass("-value"),this.onKeyupSearch.apply(this,arguments)},onBlurSearch:function(t,e){this.setTimeout(function(){this.removeClass("-search"),e.val()&&this.addClass("-value")},100)},onKeyupSearch:function(t,e){e.val()?this.addClass("-search"):this.removeClass("-search")},onKeydownSearch:function(t,e){13==t.which&&t.preventDefault()},onMousedown:function(){},onShow:function(){if(!this.map)return!1;this.setTimeout(this.center,10)}});acf.registerFieldType(e);var i=new acf.Model({geocoder:!1,data:{status:!1},getStatus:function(){return this.get("status")},setStatus:function(t){return this.set("status",t)},isReady:function(){if("ready"==this.getStatus())return!0;if("loading"==this.getStatus())return!1;if(acf.isset(window,"google","maps","places"))return this.setStatus("ready"),!0;var t=acf.get("google_map_api");return t&&(this.setStatus("loading"),$.ajax({url:t,dataType:"script",cache:!0,context:this,success:function(){this.setStatus("ready"),this.geocoder=new google.maps.Geocoder,acf.doAction("google_map_api_loaded")}})),!1},ready:function(t,e){acf.addAction("google_map_api_loaded",t,10,e)}})}(jQuery),function($,t){var e=acf.Field.extend({type:"image",$control:function(){return this.$(".acf-image-uploader")},$input:function(){return this.$('input[type="hidden"]')},events:{'click a[data-name="add"]':"onClickAdd",'click a[data-name="edit"]':"onClickEdit",'click a[data-name="remove"]':"onClickRemove",'change input[type="file"]':"onChange"},initialize:function(){"basic"===this.get("uploader")&&this.$el.closest("form").attr("enctype","multipart/form-data")},validateAttachment:function(t){t=t||{},void 0!==t.id&&(t=t.attributes),t=acf.parseArgs(t,{url:"",alt:"",title:"",caption:"",description:"",width:0,height:0});var e=acf.isget(t,"sizes",this.get("preview_size"),"url");return null!==e&&(t.url=e),t},render:function(t){t=this.validateAttachment(t),this.$("img").attr({src:t.url,alt:t.alt,title:t.title});var e=t.id||"";this.val(e),e?this.$control().addClass("has-value"):this.$control().removeClass("has-value")},append:function(t,e){var i=function(t,e){for(var i=acf.getFields({key:t.get("key"),parent:e.$el}),n=0;n<i.length;n++)if(!i[n].val())return i[n];return!1},n=i(this,e);n||(e.$(".acf-button:last").trigger("click"),n=i(this,e)),n&&n.render(t)},selectAttachment:function(){var t=this.parent(),e=t&&"repeater"===t.get("type"),i=acf.newMediaPopup({mode:"select",type:"image",title:acf.__("Select Image"),field:this.get("key"),multiple:e,library:this.get("library"),allowedTypes:this.get("mime_types"),select:$.proxy(function(e,i){i>0?this.append(e,t):this.render(e)},this)})},editAttachment:function(){var t=this.val();if(t)var e=acf.newMediaPopup({mode:"edit",title:acf.__("Edit Image"),button:acf.__("Update Image"),attachment:t,field:this.get("key"),select:$.proxy(function(t,e){this.render(t)},this)})},removeAttachment:function(){this.render(!1)},onClickAdd:function(t,e){this.selectAttachment()},onClickEdit:function(t,e){this.editAttachment()},onClickRemove:function(t,e){this.removeAttachment()},onChange:function(t,e){var i=this.$input();acf.getFileInputData(e,function(t){i.val($.param(t))})}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.models.ImageField.extend({type:"file",$control:function(){return this.$(".acf-file-uploader")},$input:function(){return this.$('input[type="hidden"]')},validateAttachment:function(t){return t=t||{},void 0!==t.id&&(t=t.attributes),t=acf.parseArgs(t,{url:"",alt:"",title:"",filename:"",filesizeHumanReadable:"",icon:"/wp-includes/images/media/default.png"})},render:function(t){t=this.validateAttachment(t),this.$("img").attr({src:t.icon,alt:t.alt,title:t.title}),this.$('[data-name="title"]').text(t.title),this.$('[data-name="filename"]').text(t.filename).attr("href",t.url),this.$('[data-name="filesize"]').text(t.filesizeHumanReadable);var e=t.id||"";acf.val(this.$input(),e),e?this.$control().addClass("has-value"):this.$control().removeClass("has-value")},selectAttachment:function(){var t=this.parent(),e=t&&"repeater"===t.get("type"),i=acf.newMediaPopup({mode:"select",title:acf.__("Select File"),field:this.get("key"),multiple:e,library:this.get("library"),allowedTypes:this.get("mime_types"),select:$.proxy(function(e,i){i>0?this.append(e,t):this.render(e)},this)})},editAttachment:function(){var t=this.val();if(!t)return!1;var e=acf.newMediaPopup({mode:"edit",title:acf.__("Edit File"),button:acf.__("Update File"),attachment:t,field:this.get("key"),select:$.proxy(function(t,e){this.render(t)},this)})}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"link",events:{'click a[data-name="add"]':"onClickEdit",'click a[data-name="edit"]':"onClickEdit",'click a[data-name="remove"]':"onClickRemove","change .link-node":"onChange"},$control:function(){return this.$(".acf-link")},$node:function(){return this.$(".link-node")},getValue:function(){var t=this.$node();return!!t.attr("href")&&{title:t.html(),url:t.attr("href"),target:t.attr("target")}},setValue:function(t){t=acf.parseArgs(t,{title:"",url:"",target:""});var e=this.$control(),i=this.$node();e.removeClass("-value -external"),t.url&&e.addClass("-value"),"_blank"===t.target&&e.addClass("-external"),this.$(".link-title").html(t.title),this.$(".link-url").attr("href",t.url).html(t.url),i.html(t.title),i.attr("href",t.url),i.attr("target",t.target),this.$(".input-title").val(t.title),this.$(".input-target").val(t.target),this.$(".input-url").val(t.url).trigger("change")},onClickEdit:function(t,e){acf.wpLink.open(this.$node())},onClickRemove:function(t,e){this.setValue(!1)},onChange:function(t,e){var i=this.getValue();this.setValue(i)}});acf.registerFieldType(e),acf.wpLink=new acf.Model({getNodeValue:function(){var t=this.get("node");return{title:t.html(),url:t.attr("href"),target:t.attr("target")}},setNodeValue:function(t){var e=this.get("node");e.html(t.title),e.attr("href",t.url),e.attr("target",t.target),e.trigger("change")},getInputValue:function(){return{title:$("#wp-link-text").val(),url:$("#wp-link-url").val(),target:$("#wp-link-target").prop("checked")?"_blank":""}},setInputValue:function(t){$("#wp-link-text").val(t.title),$("#wp-link-url").val(t.url),$("#wp-link-target").prop("checked","_blank"===t.target)},open:function(t){this.on("wplink-open","onOpen"),this.on("wplink-close","onClose"),this.set("node",t);var e=$('<textarea id="acf-link-textarea" style="display:none;"></textarea>');$("body").append(e);var i=this.getNodeValue();wpLink.open("acf-link-textarea",i.url,i.title,null)},onOpen:function(){$("#wp-link-wrap").addClass("has-text-field");var t=this.getNodeValue();this.setInputValue(t)},close:function(){wpLink.close()},onClose:function(){if(!this.has("node"))return!1;this.off("wplink-open"),this.off("wplink-close");var t=this.getInputValue();this.setNodeValue(t),$("#acf-link-textarea").remove(),this.set("node",null)}})}(jQuery),function($,t){var e=acf.Field.extend({type:"oembed",events:{'click [data-name="clear-button"]':"onClickClear","keypress .input-search":"onKeypressSearch","keyup .input-search":"onKeyupSearch","change .input-search":"onChangeSearch"},$control:function(){return this.$(".acf-oembed")},$input:function(){return this.$(".input-value")},$search:function(){return this.$(".input-search")},getValue:function(){return this.$input().val()},getSearchVal:function(){return this.$search().val()},setValue:function(t){t?this.$control().addClass("has-value"):this.$control().removeClass("has-value"),acf.val(this.$input(),t)},showLoading:function(t){acf.showLoading(this.$(".canvas"))},hideLoading:function(){acf.hideLoading(this.$(".canvas"))},maybeSearch:function(){var t=this.val(),e=this.getSearchVal();if(!e)return this.clear();if("http"!=e.substr(0,4)&&(e="http://"+e),e!==t){var i=this.get("timeout");i&&clearTimeout(i);var n=$.proxy(this.search,this,e);this.set("timeout",setTimeout(n,300))}},search:function(t){var e={action:"acf/fields/oembed/search",s:t,field_key:this.get("key")},i=this.get("xhr");i&&i.abort(),this.showLoading();var i=$.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(e),type:"post",dataType:"json",context:this,success:function(t){t&&t.html||(t={url:!1,html:""}),this.val(t.url),this.$(".canvas-media").html(t.html)},complete:function(){this.hideLoading()}});this.set("xhr",i)},clear:function(){this.val(""),this.$search().val(""),this.$(".canvas-media").html("")},onClickClear:function(t,e){this.clear()},onKeypressSearch:function(t,e){13==t.which&&(t.preventDefault(),this.maybeSearch())},onKeyupSearch:function(t,e){e.val()&&this.maybeSearch()},onChangeSearch:function(t,e){this.maybeSearch()}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"radio",events:{'click input[type="radio"]':"onClick"},$control:function(){return this.$(".acf-radio-list")},$input:function(){return this.$("input:checked")},$inputText:function(){return this.$('input[type="text"]')},getValue:function(){var t=this.$input().val();return"other"===t&&this.get("other_choice")&&(t=this.$inputText().val()),t},onClick:function(t,e){var i=e.parent("label"),n=i.hasClass("selected"),a=e.val();this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"),a=!1),this.get("other_choice")&&("other"===a?this.$inputText().prop("disabled",!1):this.$inputText().prop("disabled",!0))}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"range",events:{'input input[type="range"]':"onChange","change input":"onChange"},$input:function(){return this.$('input[type="range"]')},$inputAlt:function(){return this.$('input[type="number"]')},setValue:function(t){this.busy=!0,acf.val(this.$input(),t),acf.val(this.$inputAlt(),t,!0),this.busy=!1},onChange:function(t,e){this.busy||this.setValue(e.val())}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"relationship",events:{"keypress [data-filter]":"onKeypressFilter","change [data-filter]":"onChangeFilter","keyup [data-filter]":"onChangeFilter","click .choices-list .acf-rel-item":"onClickAdd",'click [data-name="remove_item"]':"onClickRemove",mouseover:"onHover"},$control:function(){return this.$(".acf-relationship")},$list:function(t){return this.$("."+t+"-list")},$listItems:function(t){return this.$list(t).find(".acf-rel-item")},$listItem:function(t,e){return this.$list(t).find('.acf-rel-item[data-id="'+e+'"]')},getValue:function(){var t=[];return this.$listItems("values").each(function(){t.push($(this).data("id"))}),!!t.length&&t},newChoice:function(t){return["<li>",'<span data-id="'+t.id+'" class="acf-rel-item">'+t.text+"</span>","</li>"].join("")},newValue:function(t){return["<li>",'<input type="hidden" name="'+this.getInputName()+'[]" value="'+t.id+'" />','<span data-id="'+t.id+'" class="acf-rel-item">'+t.text,'<a href="#" class="acf-icon -minus small dark" data-name="remove_item"></a>',"</span>","</li>"].join("")},addSortable:function(t){this.$list("values").sortable({items:"li",forceHelperSize:!0,forcePlaceholderSize:!0,scroll:!0,update:function(){t.$input().trigger("change")}})},initialize:function(){var t=this.proxy(function(t){if(!this.get("loading")&&this.get("more")){var e=this.$list("choices"),i=Math.ceil(e.scrollTop()),n=Math.ceil(e[0].scrollHeight),a=Math.ceil(e.innerHeight()),r=this.get("paged")||1;i+a>=n&&(this.set("paged",r+1),this.fetch())}});this.$list("choices").scrollTop(0).on("scroll",t),this.fetch()},onHover:function(t){$().off(t),this.addSortable(this)},onKeypressFilter:function(t,e){13==t.which&&t.preventDefault()},onChangeFilter:function(t,e){var i=e.val(),n=e.data("filter");this.get(n)!==i&&(this.set(n,i),this.set("paged",1),e.is("select")?this.fetch():this.maybeFetch())},onClickAdd:function(t,e){var i=this.val(),n=parseInt(this.get("max"));if(e.hasClass("disabled"))return!1;if(n>0&&i&&i.length>=n)return this.showNotice({text:acf.__("Maximum values reached ( {max} values )").replace("{max}",n),type:"warning"}),!1;e.addClass("disabled");var a=this.newValue({id:e.data("id"),text:e.html()});this.$list("values").append(a),this.$input().trigger("change")},onClickRemove:function(t,e){var i=e.parent(),n=i.parent(),a=i.data("id");setTimeout(function(){n.remove()},1),this.$listItem("choices",a).removeClass("disabled"),this.$input().trigger("change")},maybeFetch:function(){var t=this.get("timeout");t&&clearTimeout(t),t=this.setTimeout(this.fetch,300),this.set("timeout",t)},getAjaxData:function(){var t=this.$control().data();for(var e in t)t[e]=this.get(e);return t.action="acf/fields/relationship/query",t.field_key=this.get("key"),t},fetch:function(){var t=this.get("xhr");t&&t.abort();var e=this.getAjaxData(),i=this.$list("choices");1==e.paged&&i.html("");var n=$('<li><i class="acf-loading"></i> '+acf.__("Loading")+"</li>");i.append(n),this.set("loading",!0);var a=function(){this.set("loading",!1),n.remove()},r=function(t){if(!t||!t.results||!t.results.length)return this.set("more",!1),void(1==this.get("paged")&&this.$list("choices").append("<li>"+acf.__("No matches found")+"</li>"));this.set("more",t.more);var e=this.walkChoices(t.results),n=$(e),a=this.val();a&&a.length&&a.map(function(t){n.find('.acf-rel-item[data-id="'+t+'"]').addClass("disabled")}),i.append(n);var r=!1,o=!1;i.find(".acf-rel-label").each(function(){var t=$(this),e=t.siblings("ul");if(r&&r.text()==t.text())return o.append(e.children()),void $(this).parent().remove();r=t,o=e})},t=$.ajax({url:acf.get("ajaxurl"),dataType:"json",type:"post",data:acf.prepareForAjax(e),context:this,success:r,complete:a});this.set("xhr",t)},walkChoices:function(t){var e=function(t){var i="";return $.isArray(t)?t.map(function(t){i+=e(t)}):$.isPlainObject(t)&&(void 0!==t.children?(i+='<li><span class="acf-rel-label">'+t.text+'</span><ul class="acf-bl">',i+=e(t.children),i+="</ul></li>"):i+='<li><span class="acf-rel-item" data-id="'+t.id+'">'+t.text+"</span></li>"),i};return e(t)}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"select",select2:!1,wait:"load",events:{removeField:"onRemove"},$input:function(){return this.$("select")},initialize:function(){var t=this.$input();if(this.inherit(t),this.get("ui")){var e=this.get("ajax_action");e||(e="acf/fields/"+this.get("type")+"/query"),this.select2=acf.newSelect2(t,{field:this,ajax:this.get("ajax"),multiple:this.get("multiple"),placeholder:this.get("placeholder"),allowNull:this.get("allow_null"),ajaxAction:e})}},onRemove:function(){this.select2&&this.select2.destroy()}});acf.registerFieldType(e)}(jQuery),function($,t){var e="tab",i=acf.Field.extend({type:"tab",wait:"",tabs:!1,tab:!1,findFields:function(){return this.$el.nextUntil(".acf-field-tab",".acf-field")},getFields:function(){return acf.getFields(this.findFields())},findTabs:function(){return this.$el.prevAll(".acf-tab-wrap:first")},findTab:function(){return this.$(".acf-tab-button")},initialize:function(){if(this.$el.is("td"))return this.events={},!1;var t=this.findTabs(),e=this.findTab(),i=acf.parseArgs(e.data(),{endpoint:!1,placement:"",before:this.$el});!t.length||i.endpoint?this.tabs=new a(i):this.tabs=t.data("acf"),this.tab=this.tabs.addTab(e,this)},isActive:function(){return this.tab.isActive()},showFields:function(){this.getFields().map(function(t){t.show(this.cid,"tab"),t.hiddenByTab=!1},this)},hideFields:function(){this.getFields().map(function(t){t.hide(this.cid,"tab"),t.hiddenByTab=this.tab},this)},show:function(t){var e=acf.Field.prototype.show.apply(this,arguments);return e&&(this.tab.show(),this.tabs.refresh()),e},hide:function(t){var e=acf.Field.prototype.hide.apply(this,arguments);return e&&(this.tab.hide(),this.isActive()&&this.tabs.reset()),e},enable:function(t){this.getFields().map(function(t){t.enable("tab")})},disable:function(t){this.getFields().map(function(t){t.disable("tab")})}});acf.registerFieldType(i);var n=0,a=acf.Model.extend({tabs:[],active:!1,actions:{refresh:"onRefresh"},data:{before:!1,placement:"top",index:0,initialized:!1},setup:function(t){$.extend(this.data,t),this.tabs=[],this.active=!1;var e=this.get("placement"),i=this.get("before"),a=i.parent();"left"==e&&a.hasClass("acf-fields")&&a.addClass("-sidebar"),i.is("tr")?this.$el=$('<tr class="acf-tab-wrap"><td colspan="2"><ul class="acf-hl acf-tab-group"></ul></td></tr>'):this.$el=$('<div class="acf-tab-wrap -'+e+'"><ul class="acf-hl acf-tab-group"></ul></div>'),i.before(this.$el),this.set("index",n,!0),n++},initializeTabs:function(){var t=this.getVisible().shift(),e=acf.getPreference("this.tabs")||[],i=this.get("index"),n=e[i];this.tabs[n]&&this.tabs[n].isVisible()&&(t=this.tabs[n]),t?this.selectTab(t):this.closeTabs(),this.set("initialized",!0)},getVisible:function(){return this.tabs.filter(function(t){return t.isVisible()})},getActive:function(){return this.active},setActive:function(t){return this.active=t},hasActive:function(){return!1!==this.active},isActive:function(t){var e=this.getActive();return e&&e.cid===t.cid},closeActive:function(){this.hasActive()&&this.closeTab(this.getActive())},openTab:function(t){this.closeActive(),t.open(),this.setActive(t)},closeTab:function(t){t.close(),this.setActive(!1)},closeTabs:function(){this.tabs.map(this.closeTab,this)},selectTab:function(t){this.tabs.map(function(e){t.cid!==e.cid&&this.closeTab(e)},this),this.openTab(t)},addTab:function(t,e){var i=$("<li></li>");i.append(t),this.$("ul").append(i);var n=new r({$el:i,field:e,group:this});return this.tabs.push(n),n},reset:function(){return this.closeActive(),this.refresh()},refresh:function(){if(this.hasActive())return!1;var t=this.getVisible().shift();return t&&this.openTab(t),t},onRefresh:function(){if("left"===this.get("placement")){var t=this.$el.parent(),e=this.$el.children("ul"),i=t.is("td")?"height":"min-height",n=e.position().top+e.outerHeight(!0)-1;t.css(i,n)}}}),r=acf.Model.extend({group:!1,field:!1,events:{"click a":"onClick"},index:function(){return this.$el.index()},isVisible:function(){return acf.isVisible(this.$el)},isActive:function(){return this.$el.hasClass("active")},open:function(){this.$el.addClass("active"),this.field.showFields()},close:function(){this.$el.removeClass("active"),this.field.hideFields()},onClick:function(t,e){t.preventDefault(),this.toggle()},toggle:function(){this.isActive()||this.group.openTab(this)}}),o=new acf.Model({priority:50,actions:{prepare:"render",append:"render",unload:"onUnload",invalid_field:"onInvalidField"},findTabs:function(){return $(".acf-tab-wrap")},getTabs:function(){return acf.getInstances(this.findTabs())},render:function(t){this.getTabs().map(function(t){t.get("initialized")||t.initializeTabs()})},onInvalidField:function(t){this.busy||t.hiddenByTab&&(t.hiddenByTab.toggle(),this.busy=!0,this.setTimeout(function(){this.busy=!1},100))},onUnload:function(){var t=[];this.getTabs().map(function(e){var i=e.hasActive()?e.getActive().index():0;t.push(i)}),t.length&&acf.setPreference("this.tabs",t)}})}(jQuery),function($,t){var e=acf.models.SelectField.extend({type:"post_object"});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.models.SelectField.extend({type:"page_link"});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.models.SelectField.extend({type:"user"});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"taxonomy",data:{ftype:"select"},select2:!1,wait:"load",events:{'click a[data-name="add"]':"onClickAdd",'click input[type="radio"]':"onClickRadio"},$control:function(){return this.$(".acf-taxonomy-field")},$input:function(){return this.getRelatedPrototype().$input.apply(this,arguments)},getRelatedType:function(){var t=this.get("ftype");return"multi_select"==t&&(t="select"),t},getRelatedPrototype:function(){return acf.getFieldType(this.getRelatedType()).prototype},getValue:function(){return this.getRelatedPrototype().getValue.apply(this,arguments)},setValue:function(){return this.getRelatedPrototype().setValue.apply(this,arguments)},initialize:function(){this.getRelatedPrototype().initialize.apply(this,arguments)},onRemove:function(){this.select2&&this.select2.destroy()},onClickAdd:function(t,e){var i=this,n=!1,a=!1,r=!1,o=!1,s=!1,c=!1,l=!1,d=function(t){n.loading(!1),n.content(t),a=n.$("form"),r=n.$('input[name="term_name"]'),o=n.$('select[name="term_parent"]'),s=n.$(".acf-submit-button"),r.focus(),n.on("submit","form",u)},u=function(t,e){if(t.preventDefault(),""===r.val())return r.focus(),!1;acf.startButtonLoading(s);var n={action:"acf/fields/taxonomy/add_term",field_key:i.get("key"),term_name:r.val(),term_parent:o.length?o.val():0};$.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(n),type:"post",dataType:"json",success:f})},f=function(t){acf.stopButtonLoading(s),l&&l.remove(),acf.isAjaxSuccess(t)?(r.val(""),h(t.data),l=acf.newNotice({type:"success",text:acf.getAjaxMessage(t),target:a,timeout:2e3,dismiss:!1})):l=acf.newNotice({type:"error",text:acf.getAjaxError(t),target:a,timeout:2e3,dismiss:!1}),r.focus()},h=function(t){var e=$('<option value="'+t.term_id+'">'+t.term_label+"</option>");t.term_parent?o.children('option[value="'+t.term_parent+'"]').after(e):o.append(e),acf.getFields({type:"taxonomy"}).map(function(e){e.get("taxonomy")==i.get("taxonomy")&&e.appendTerm(t)}),i.selectTerm(t.term_id)};!function(){n=acf.newPopup({title:e.attr("title"),loading:!0,width:"300px"});var t={action:"acf/fields/taxonomy/add_term",field_key:i.get("key")};$.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(t),type:"post",dataType:"html",success:d})}()},appendTerm:function(t){"select"==this.getRelatedType()?this.appendTermSelect(t):this.appendTermCheckbox(t)},appendTermSelect:function(t){this.select2.addOption({id:t.term_id,text:t.term_label})},appendTermCheckbox:function(t){var e=this.$("[name]:first").attr("name"),i=this.$("ul:first");"checkbox"==this.getRelatedType()&&(e+="[]");var n=$(['<li data-id="'+t.term_id+'">',"<label>",'<input type="'+this.get("ftype")+'" value="'+t.term_id+'" name="'+e+'" /> ',"<span>"+t.term_name+"</span>","</label>","</li>"].join(""));if(t.term_parent){var a=i.find('li[data-id="'+t.term_parent+'"]');i=a.children("ul"),i.exists()||(i=$('<ul class="children acf-bl"></ul>'),a.append(i))}i.append(n)},selectTerm:function(t){if("select"==this.getRelatedType())this.select2.selectOption(t);else{this.$('input[value="'+t+'"]').prop("checked",!0).trigger("change")}},onClickRadio:function(t,e){
3
- var i=e.parent("label"),n=i.hasClass("selected");this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"))}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.models.DatePickerField.extend({type:"time_picker",$control:function(){return this.$(".acf-time-picker")},initialize:function(){var t=this.$input(),e=this.$inputText(),i={timeFormat:this.get("time_format"),altField:t,altFieldTimeOnly:!1,altTimeFormat:"HH:mm:ss",showButtonPanel:!0,controlType:"select",oneLine:!0,closeText:acf.get("dateTimePickerL10n").selectText,timeOnly:!0};i.onClose=function(t,e,i){var n=e.dpDiv.find(".ui-datepicker-close");!t&&n.is(":hover")&&i._updateDateTime()},i=acf.applyFilters("time_picker_args",i,this),acf.newTimePicker(e,i),acf.doAction("time_picker_init",e,i,this)}});acf.registerFieldType(e),acf.newTimePicker=function(t,e){if(void 0===$.timepicker)return!1;e=e||{},t.timepicker(e),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function($,t){var e=acf.Field.extend({type:"true_false",events:{"change .acf-switch-input":"onChange","focus .acf-switch-input":"onFocus","blur .acf-switch-input":"onBlur","keypress .acf-switch-input":"onKeypress"},$input:function(){return this.$('input[type="checkbox"]')},$switch:function(){return this.$(".acf-switch")},getValue:function(){return this.$input().prop("checked")?1:0},initialize:function(){this.render()},render:function(){var t=this.$switch();if(t.length){var e=t.children(".acf-switch-on"),i=t.children(".acf-switch-off"),n=Math.max(e.width(),i.width());n&&(e.css("min-width",n),i.css("min-width",n))}},switchOn:function(){this.$input().prop("checked",!0),this.$switch().addClass("-on")},switchOff:function(){this.$input().prop("checked",!1),this.$switch().removeClass("-on")},onChange:function(t,e){e.prop("checked")?this.switchOn():this.switchOff()},onFocus:function(t,e){this.$switch().addClass("-focus")},onBlur:function(t,e){this.$switch().removeClass("-focus")},onKeypress:function(t,e){return 37===t.keyCode?this.switchOff():39===t.keyCode?this.switchOn():void 0}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"url",events:{'keyup input[type="url"]':"onkeyup"},$control:function(){return this.$(".acf-input-wrap")},$input:function(){return this.$('input[type="url"]')},initialize:function(){this.render()},isValid:function(){var t=this.val();return!!t&&(-1!==t.indexOf("://")||0===t.indexOf("//"))},render:function(){this.isValid()?this.$control().addClass("-valid"):this.$control().removeClass("-valid")},onkeyup:function(t,e){this.render()}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"wysiwyg",wait:"load",events:{"mousedown .acf-editor-wrap.delay":"onMousedown",sortstartField:"disableEditor",sortstopField:"enableEditor",removeField:"disableEditor"},$control:function(){return this.$(".acf-editor-wrap")},$input:function(){return this.$("textarea")},getMode:function(){return this.$control().hasClass("tmce-active")?"visual":"text"},initialize:function(){this.$control().hasClass("delay")||this.initializeEditor()},initializeEditor:function(){var t=this.$control(),e=this.$input(),i={tinymce:!0,quicktags:!0,toolbar:this.get("toolbar"),mode:this.getMode(),field:this},n=e.attr("id"),a=acf.uniqueId("acf-editor-");acf.rename({target:t,search:n,replace:a,destructive:!0}),this.set("id",a,!0),acf.tinymce.initialize(a,i)},onMousedown:function(t){t.preventDefault();var e=this.$control();e.removeClass("delay"),e.find(".acf-editor-toolbar").remove(),this.initializeEditor()},enableEditor:function(){"visual"==this.getMode()&&acf.tinymce.enable(this.get("id"))},disableEditor:function(){acf.tinymce.destroy(this.get("id"))}});acf.registerFieldType(e)}(jQuery),function($,t){var e=[];acf.Condition=acf.Model.extend({type:"",operator:"==",label:"",choiceType:"input",fieldTypes:[],data:{conditions:!1,field:!1,rule:{}},events:{change:"change",keyup:"change",enableField:"change",disableField:"change"},setup:function(t){$.extend(this.data,t)},getEventTarget:function(t,e){return t||this.get("field").$el},change:function(t,e){this.get("conditions").change(t)},match:function(t,e){return!1},calculate:function(){return this.match(this.get("rule"),this.get("field"))},choices:function(t){return'<intput type="text" />'}}),acf.newCondition=function(t,e){var i=e.get("field"),n=i.getField(t.field);if(!i||!n)return!1;var a={rule:t,target:i,conditions:e,field:n},r=n.get("type"),o=t.operator;return new(acf.getConditionTypes({fieldType:r,operator:o})[0]||acf.Condition)(a)};var i=function(t){return acf.strPascalCase(t||"")+"Condition"};acf.registerConditionType=function(t){var n=t.prototype,a=n.type,r=i(a);acf.models[r]=t,e.push(a)},acf.getConditionType=function(t){var e=i(t);return acf.models[e]||!1},acf.registerConditionForFieldType=function(t,e){var i=acf.getConditionType(t);i&&i.prototype.fieldTypes.push(e)},acf.getConditionTypes=function(t){t=acf.parseArgs(t,{fieldType:"",operator:""});var i=[];return e.map(function(e){var n=acf.getConditionType(e),a=n.prototype.fieldTypes,r=n.prototype.operator;t.fieldType&&-1===a.indexOf(t.fieldType)||t.operator&&r!==t.operator||i.push(n)}),i}}(jQuery),function($,t){var e="conditional_logic",i=new acf.Model({id:"conditionsManager",priority:20,actions:{new_field:"onNewField"},onNewField:function(t){t.has("conditions")&&t.getConditions().render()}}),n=function(t,e){var i=acf.getFields({key:e,sibling:t.$el,suppressFilters:!0});return i.length||(i=acf.getFields({key:e,parent:t.$el.parent(),suppressFilters:!0})),!!i.length&&i[0]};acf.Field.prototype.getField=function(t){var e=n(this,t);if(e)return e;for(var i=this.parents(),a=0;a<i.length;a++)if(e=n(i[a],t))return e;return!1},acf.Field.prototype.getConditions=function(){return this.conditions||(this.conditions=new r(this)),this.conditions};var a=!1,r=acf.Model.extend({id:"Conditions",data:{field:!1,timeStamp:!1,groups:[]},setup:function(t){this.data.field=t;var e=t.get("conditions");e instanceof Array?e[0]instanceof Array?e.map(function(t,e){this.addRules(t,e)},this):this.addRules(e):this.addRule(e)},change:function(t){if(this.get("timeStamp")===t.timeStamp)return!1;this.set("timeStamp",t.timeStamp,!0);var e=this.render()},render:function(){return this.calculate()?this.show():this.hide()},show:function(){return this.get("field").showEnable(this.cid,e)},hide:function(){return this.get("field").hideDisable(this.cid,e)},calculate:function(){var t=!1;return this.getGroups().map(function(e){if(!t){e.filter(function(t){return t.calculate()}).length==e.length&&(t=!0)}}),t},hasGroups:function(){return null!=this.data.groups},getGroups:function(){return this.data.groups},addGroup:function(){var t=[];return this.data.groups.push(t),t},hasGroup:function(t){return null!=this.data.groups[t]},getGroup:function(t){return this.data.groups[t]},removeGroup:function(t){return this.data.groups[t].delete,this},addRules:function(t,e){t.map(function(t){this.addRule(t,e)},this)},addRule:function(t,e){e=e||0;var i;i=this.hasGroup(e)?this.getGroup(e):this.addGroup();var n=acf.newCondition(t,this);if(!n)return!1;i.push(n)},hasRule:function(){},getRule:function(t,e){return t=t||0,e=e||0,this.data.groups[e][t]},removeRule:function(){}})}(jQuery),function($,t){var e=acf.__,i=function(t){return t?""+t:""},n=function(t,e){return i(t).toLowerCase()===i(e).toLowerCase()},a=function(t,e){return parseFloat(t)===parseFloat(e)},r=function(t,e){return parseFloat(t)>parseFloat(e)},o=function(t,e){return parseFloat(t)<parseFloat(e)},s=function(t,e){return e=e.map(function(t){return i(t)}),e.indexOf(t)>-1},c=function(t,e){return i(t).indexOf(i(e))>-1},l=function(t,e){var n=new RegExp(i(e),"gi");return i(t).match(n)},d=acf.Condition.extend({type:"hasValue",operator:"!=empty",label:e("Has any value"),fieldTypes:["text","textarea","number","range","email","url","password","image","file","wysiwyg","oembed","select","checkbox","radio","button_group","link","post_object","page_link","relationship","taxonomy","user","google_map","date_picker","date_time_picker","time_picker","color_picker"],match:function(t,e){return!!e.val()},choices:function(t){return'<input type="text" disabled="" />'}});acf.registerConditionType(d);var u=d.extend({type:"hasNoValue",operator:"==empty",label:e("Has no value"),match:function(t,e){return!d.prototype.match.apply(this,arguments)}});acf.registerConditionType(u);var f=acf.Condition.extend({type:"equalTo",operator:"==",label:e("Value is equal to"),fieldTypes:["text","textarea","number","range","email","url","password"],match:function(t,e){return $.isNumeric(t.value)?a(t.value,e.val()):n(t.value,e.val())},choices:function(t){return'<input type="text" />'}});acf.registerConditionType(f);var h=f.extend({type:"notEqualTo",operator:"!=",label:e("Value is not equal to"),match:function(t,e){return!f.prototype.match.apply(this,arguments)}});acf.registerConditionType(h);var p=acf.Condition.extend({type:"patternMatch",operator:"==pattern",label:e("Value matches pattern"),fieldTypes:["text","textarea","email","url","password","wysiwyg"],match:function(t,e){return l(e.val(),t.value)},choices:function(t){return'<input type="text" placeholder="[a-z0-9]" />'}});acf.registerConditionType(p);var g=acf.Condition.extend({type:"contains",operator:"==contains",label:e("Value contains"),fieldTypes:["text","textarea","number","email","url","password","wysiwyg","oembed"],match:function(t,e){return c(e.val(),t.value)},choices:function(t){return'<input type="text" />'}});acf.registerConditionType(g);var m=f.extend({type:"trueFalseEqualTo",choiceType:"select",fieldTypes:["true_false"],choices:function(t){return[{id:1,text:e("Checked")}]}});acf.registerConditionType(m);var v=h.extend({type:"trueFalseNotEqualTo",choiceType:"select",fieldTypes:["true_false"],choices:function(t){return[{id:1,text:e("Checked")}]}});acf.registerConditionType(v);var y=acf.Condition.extend({type:"selectEqualTo",operator:"==",label:e("Value is equal to"),fieldTypes:["select","checkbox","radio","button_group"],match:function(t,e){var i=e.val();return i instanceof Array?s(t.value,i):n(t.value,i)},choices:function(t){var i=[],n=t.$setting("choices textarea").val().split("\n");return t.$input("allow_null").prop("checked")&&i.push({id:"",text:e("Null")}),n.map(function(t){t=t.split(":"),t[1]=t[1]||t[0],i.push({id:$.trim(t[0]),text:$.trim(t[1])})}),i}});acf.registerConditionType(y);var b=y.extend({type:"selectNotEqualTo",operator:"!=",label:e("Value is not equal to"),match:function(t,e){return!y.prototype.match.apply(this,arguments)}});acf.registerConditionType(b);var x=acf.Condition.extend({type:"greaterThan",operator:">",label:e("Value is greater than"),fieldTypes:["number","range"],match:function(t,e){var i=e.val();return i instanceof Array&&(i=i.length),r(i,t.value)},choices:function(t){return'<input type="number" />'}});acf.registerConditionType(x);var w=x.extend({type:"lessThan",operator:"<",label:e("Value is less than"),match:function(t,e){var i=e.val();return i instanceof Array&&(i=i.length),o(i,t.value)},choices:function(t){return'<input type="number" />'}});acf.registerConditionType(w);var _=x.extend({type:"selectionGreaterThan",label:e("Selection is greater than"),fieldTypes:["checkbox","select","post_object","page_link","relationship","taxonomy","user"]});acf.registerConditionType(_);var k=w.extend({type:"selectionLessThan",label:e("Selection is less than"),fieldTypes:["checkbox","select","post_object","page_link","relationship","taxonomy","user"]});acf.registerConditionType(k)}(jQuery),function($,t){acf.newMediaPopup=function(t){var e=null,t=acf.parseArgs(t,{mode:"select",title:"",button:"",type:"",field:!1,allowedTypes:"",library:"all",multiple:!1,attachment:0,autoOpen:!0,open:function(){},select:function(){},close:function(){}});return e="edit"==t.mode?new acf.models.EditMediaPopup(t):new acf.models.SelectMediaPopup(t),t.autoOpen&&setTimeout(function(){e.open()},1),acf.doAction("new_media_popup",e),e};var e=function(){var t=acf.get("post_id");return $.isNumeric(t)?t:0};acf.getMimeTypes=function(){return this.get("mimeTypes")},acf.getMimeType=function(t){var e=acf.getMimeTypes();if(void 0!==e[t])return e[t];for(var i in e)if(-1!==i.indexOf(t))return e[i];return!1};var i=acf.Model.extend({id:"MediaPopup",data:{},defaults:{},frame:!1,setup:function(t){$.extend(this.data,t)},initialize:function(){var t=this.getFrameOptions();this.addFrameStates(t);var e=wp.media(t);e.acf=this,this.addFrameEvents(e,t),this.frame=e},open:function(){this.frame.open()},close:function(){this.frame.close()},remove:function(){this.frame.detach(),this.frame.remove()},getFrameOptions:function(){var t={title:this.get("title"),multiple:this.get("multiple"),library:{},states:[]};return this.get("type")&&(t.library.type=this.get("type")),"uploadedTo"===this.get("library")&&(t.library.uploadedTo=e()),this.get("attachment")&&(t.library.post__in=[this.get("attachment")]),this.get("button")&&(t.button={text:this.get("button")}),t},addFrameStates:function(t){var e=wp.media.query(t.library);this.get("field")&&acf.isset(e,"mirroring","args")&&(e.mirroring.args._acfuploader=this.get("field")),t.states.push(new wp.media.controller.Library({library:e,multiple:this.get("multiple"),title:this.get("title"),priority:20,filterable:"all",editable:!0,allowLocalEdits:!0})),acf.isset(wp,"media","controller","EditImage")&&t.states.push(new wp.media.controller.EditImage)},addFrameEvents:function(t,e){t.on("open",function(){this.$el.closest(".media-modal").addClass("acf-media-modal -"+this.acf.get("mode"))},t),t.on("content:render:edit-image",function(){var t=this.state().get("image"),e=new wp.media.view.EditImage({model:t,controller:this}).render();this.content.set(e),e.loadEditor()},t),t.on("select",function(){var e=t.state().get("selection");e&&e.each(function(e,i){t.acf.get("select").apply(t.acf,[e,i])})}),t.on("close",function(){setTimeout(function(){t.acf.get("close").apply(t.acf),t.acf.remove()},1)})}});acf.models.SelectMediaPopup=i.extend({id:"SelectMediaPopup",setup:function(t){t.button||(t.button=acf._x("Select","verb")),i.prototype.setup.apply(this,arguments)},addFrameEvents:function(t,e){acf.isset(_wpPluploadSettings,"defaults","multipart_params")&&(_wpPluploadSettings.defaults.multipart_params._acfuploader=this.get("field"),t.on("open",function(){delete _wpPluploadSettings.defaults.multipart_params._acfuploader})),t.on("content:activate:browse",function(){var e=!1;try{e=t.content.get().toolbar}catch(t){return void console.log(t)}t.acf.customizeFilters.apply(t.acf,[e])}),i.prototype.addFrameEvents.apply(this,arguments)},customizeFilters:function(t){var e=t.get("filters");if("image"==this.get("type")&&(e.filters.all.text=acf.__("All images"),delete e.filters.audio,delete e.filters.video,delete e.filters.image,$.each(e.filters,function(t,e){e.props.type=e.props.type||"image"})),this.get("allowedTypes")){this.get("allowedTypes").split(" ").join("").split(".").join("").split(",").map(function(t){var i=acf.getMimeType(t);if(i){var n={text:i,props:{status:null,type:i,uploadedTo:null,orderby:"date",order:"DESC"},priority:20};e.filters[i]=n}})}if("uploadedTo"===this.get("library")){var i=this.frame.options.library.uploadedTo;delete e.filters.unattached,delete e.filters.uploaded,$.each(e.filters,function(t,e){e.text+=" ("+acf.__("Uploaded to this post")+")",e.props.uploadedTo=i})}var n=this.get("field");$.each(e.filters,function(t,e){e.props._acfuploader=n}),t.get("search").model.attributes._acfuploader=n,e.renderFilters&&e.renderFilters()}}),acf.models.EditMediaPopup=i.extend({id:"SelectMediaPopup",setup:function(t){t.button||(t.button=acf._x("Update","verb")),i.prototype.setup.apply(this,arguments)},addFrameEvents:function(t,e){t.on("open",function(){this.$el.closest(".media-modal").addClass("acf-expanded"),"browse"!=this.content.mode()&&this.content.mode("browse");var e=this.state(),i=e.get("selection"),n=wp.media.attachment(t.acf.get("attachment"));i.add(n)},t),i.prototype.addFrameEvents.apply(this,arguments)}});var n=new acf.Model({id:"customizePrototypes",wait:"ready",initialize:function(){if(acf.isset(window,"wp","media","view")){var t=e();t&&acf.isset(wp,"media","view","settings","post")&&(wp.media.view.settings.post.id=t),this.customizeAttachmentsRouter(),this.customizeAttachmentFilters(),this.customizeAttachmentCompat(),this.customizeAttachmentLibrary()}},customizeAttachmentsRouter:function(){if(acf.isset(wp,"media","view","Router")){var t=wp.media.view.Router;wp.media.view.Router=t.extend({addExpand:function(){var t=$(['<a href="#" class="acf-expand-details">','<span class="is-closed"><span class="acf-icon -left small grey"></span>'+acf.__("Expand Details")+"</span>",'<span class="is-open"><span class="acf-icon -right small grey"></span>'+acf.__("Collapse Details")+"</span>","</a>"].join(""));t.on("click",function(t){t.preventDefault();var e=$(this).closest(".media-modal");e.hasClass("acf-expanded")?e.removeClass("acf-expanded"):e.addClass("acf-expanded")}),this.$el.append(t)},initialize:function(){return t.prototype.initialize.apply(this,arguments),this.addExpand(),this}})}},customizeAttachmentFilters:function(){if(acf.isset(wp,"media","view","AttachmentFilters","All")){wp.media.view.AttachmentFilters.All.prototype.renderFilters=function(){this.$el.html(_.chain(this.filters).map(function(t,e){return{el:$("<option></option>").val(e).html(t.text)[0],priority:t.priority||50}},this).sortBy("priority").pluck("el").value())}}},customizeAttachmentCompat:function(){if(acf.isset(wp,"media","view","AttachmentCompat")){var t=wp.media.view.AttachmentCompat,e=!1;wp.media.view.AttachmentCompat=t.extend({render:function(){return this.rendered?this:(t.prototype.render.apply(this,arguments),this.$("#acf-form-data").length?(clearTimeout(e),e=setTimeout($.proxy(function(){this.rendered=!0,acf.doAction("append",this.$el)},this),50),this):this)}})}},customizeAttachmentLibrary:function(){if(acf.isset(wp,"media","view","Attachment","Library")){var t=wp.media.view.Attachment.Library;wp.media.view.Attachment.Library=t.extend({render:function(){var e=acf.isget(this,"controller","acf"),i=acf.isget(this,"model","attributes");if(e&&i){i.acf_errors&&this.$el.addClass("acf-disabled");var n=e.get("selected");n&&n.indexOf(i.id)>-1&&this.$el.addClass("acf-selected")}return t.prototype.render.apply(this,arguments)},toggleSelection:function(e){var i=this.collection,n=this.options.selection,a=this.model,r=n.single(),o=this.controller,s=acf.isget(this,"model","attributes","acf_errors"),c=o.$el.find(".media-frame-content .media-sidebar");if(c.children(".acf-selection-error").remove(),c.children().removeClass("acf-hidden"),o&&s){var l=acf.isget(this,"model","attributes","filename");return c.children().addClass("acf-hidden"),c.prepend(['<div class="acf-selection-error">','<span class="selection-error-label">'+acf.__("Restricted")+"</span>",'<span class="selection-error-filename">'+l+"</span>",'<span class="selection-error-message">'+s+"</span>","</div>"].join("")),n.reset(),void n.single(a)}return t.prototype.toggleSelection.apply(this,arguments)}})}}})}(jQuery),function($,t){acf.screen=new acf.Model({active:!0,xhr:!1,wait:"ready",events:{"change #page_template":"onChangeTemplate","change #parent_id":"onChangeParent","change #post-formats-select input":"onChangeFormat","change .categorychecklist input":"onChangeTerm","change .categorychecklist select":"onChangeTerm",'change .acf-taxonomy-field[data-save="1"] input':"onChangeTerm",'change .acf-taxonomy-field[data-save="1"] select':"onChangeTerm"},data:{},fetch:function(){if(this.active&&"post"===acf.get("screen")){this.xhr&&this.xhr.abort();var t=acf.parseArgs(this.data,{post_id:acf.get("post_id")});t.action="acf/post/get_field_groups",t.exists=[],$(".acf-postbox").not(".acf-hidden").each(function(){t.exists.push($(this).attr("id").substr(4))});var e=function(t){acf.isAjaxSuccess(t)&&($(".acf-postbox").addClass("acf-hidden"),$(".acf-postbox-toggle").addClass("acf-hidden"),$("#acf-style").html(""),t.data.map(function(t,e){var i=$("#acf-"+t.key),n=$("#acf-"+t.key+"-hide"),a=n.parent();i.removeClass("acf-hidden hide-if-js").show(),a.removeClass("acf-hidden hide-if-js").show(),n.prop("checked",!0);var r=i.find(".acf-replace-with-fields");r.exists()&&(r.replaceWith(t.html),acf.doAction("append",i)),0===e&&$("#acf-style").html(t.style),acf.enable(i,"postbox")}))},i=function(t){$(".acf-postbox.acf-hidden").each(function(){acf.disable($(this),"postbox")})};this.xhr=$.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(t),type:"post",dataType:"json",context:this,success:e,complete:i})}},syncTaxonomyTerms:function(){var t=[""];$(".categorychecklist, .acf-taxonomy-field").each(function(){var e=$(this),i=e.find('input[type="checkbox"]').not(":disabled"),n=e.find('input[type="radio"]').not(":disabled"),a=e.find("select").not(":disabled"),r=e.find('input[type="hidden"]').not(":disabled");e.is(".acf-taxonomy-field")&&"1"!=e.attr("data-save")||e.closest(".media-frame").exists()||(i.exists()?i.filter(":checked").each(function(){t.push($(this).val())}):n.exists()?n.filter(":checked").each(function(){t.push($(this).val())}):a.exists()?a.find("option:selected").each(function(){t.push($(this).val())}):r.exists()&&r.each(function(){$(this).val()&&t.push($(this).val())}))}),t=t.filter(function(t,e,i){return i.indexOf(t)==e}),this.set("post_taxonomy",t).fetch()},onChangeTemplate:function(t,e){this.set("page_template",e.val()).fetch()},onChangeParent:function(t,e){var i="parent",n=0;""!=e.val()&&(i="child",n=e.val()),this.set("page_type",i).set("page_parent",n).fetch()},onChangeFormat:function(t,e){var i=e.val();"0"==i&&(i="standard"),this.set("post_format",i).fetch()},onChangeTerm:function(t,e){e.closest(".media-frame").exists()||this.setTimeout(this.syncTaxonomyTerms,1)}})}(jQuery),function($,t){function e(){return acf.isset(window,"jQuery","fn","select2","amd")?4:!!acf.isset(window,"Select2")&&3}acf.newSelect2=function(t,i){if(i=acf.parseArgs(i,{allowNull:!1,placeholder:"",multiple:!1,field:!1,ajax:!1,ajaxAction:"",ajaxData:function(t){return t},ajaxResults:function(t){return t}}),4==e())var r=new n(t,i);else var r=new a(t,i);return acf.doAction("new_select2",r),r};var i=acf.Model.extend({setup:function(t,e){$.extend(this.data,e),this.$el=t},initialize:function(){},selectOption:function(t){var e=this.getOption(t);e.prop("selected")||e.prop("selected",!0).trigger("change")},unselectOption:function(t){var e=this.getOption(t);e.prop("selected")&&e.prop("selected",!1).trigger("change")},getOption:function(t){return this.$('option[value="'+t+'"]')},addOption:function(t){t=acf.parseArgs(t,{id:"",text:"",selected:!1});var e=this.getOption(t.id);return e.length||(e=$("<option></option>"),e.html(t.text),e.attr("value",t.id),e.prop("selected",t.selected),this.$el.append(e)),e},getValue:function(){var t=[],e=this.$el.find("option:selected");return e.exists()?(e=e.sort(function(t,e){return+t.getAttribute("data-i")-+e.getAttribute("data-i")}),e.each(function(){var e=$(this);t.push({$el:e,id:e.attr("value"),text:e.text()})}),t):t},mergeOptions:function(){},getChoices:function(){var t=function(e){var i=[];return e.children().each(function(){var e=$(this);e.is("optgroup")?i.push({text:e.attr("label"),children:t(e)}):i.push({id:e.attr("value"),text:e.text()})}),i};return t(this.$el)},decodeChoices:function(t){var e=function(t){return t.map(function(t){return t.text=acf.decode(t.text),t.children&&(t.children=e(t.children)),t}),t};return e(t)},getAjaxData:function(t){var e={action:this.get("ajaxAction"),s:t.term||"",paged:t.page||1},i=this.get("field");i&&(e.field_key=i.get("key"));var n=this.get("ajaxData");return n&&(e=n.apply(this,[e,t])),e=acf.applyFilters("select2_ajax_data",e,this.data,this.$el,i||!1,this),acf.prepareForAjax(e)},getAjaxResults:function(t,e){t=acf.parseArgs(t,{results:!1,more:!1}),t.results&&(t.results=this.decodeChoices(t.results));var i=this.get("ajaxResults");return i&&(t=i.apply(this,[t,e])),t=acf.applyFilters("select2_ajax_results",t,e,this)},processAjaxResults:function(t,e){var t=this.getAjaxResults(t,e);return t.more&&(t.pagination={more:!0}),setTimeout($.proxy(this.mergeOptions,this),1),t},destroy:function(){this.$el.data("select2")&&this.$el.select2("destroy"),this.$el.siblings(".select2-container").remove()}}),n=i.extend({initialize:function(){var t=this.$el,e={width:"100%",allowClear:this.get("allowNull"),placeholder:this.get("placeholder"),multiple:this.get("multiple"),data:[],escapeMarkup:function(t){return t}};e.multiple&&this.getValue().map(function(e){e.$el.detach().appendTo(t)}),t.removeData("ajax"),t.removeAttr("data-ajax"),this.get("ajax")&&(e.ajax={url:acf.get("ajaxurl"),delay:250,dataType:"json",type:"post",cache:!1,data:$.proxy(this.getAjaxData,this),processResults:$.proxy(this.processAjaxResults,this)});var i=this.get("field");e=acf.applyFilters("select2_args",e,t,this.data,i||!1,this),t.select2(e);var n=t.next(".select2-container");if(e.multiple){var a=n.find("ul");a.sortable({stop:function(e){a.find(".select2-selection__choice").each(function(){$($(this).data("data").element).detach().appendTo(t)}),t.trigger("change")}}),t.on("select2:select",this.proxy(function(t){this.getOption(t.params.data.id).detach().appendTo(this.$el)}))}n.addClass("-acf"),acf.doAction("select2_init",t,e,this.data,i||!1,this)},mergeOptions:function(){var t=!1,e=!1;$('.select2-results__option[role="group"]').each(function(){var i=$(this).children("ul"),n=$(this).children("strong");if(e&&e.text()===n.text())return t.append(i.children()),void $(this).remove();t=i,e=n})}}),a=i.extend({initialize:function(){var t=this.$el,e=this.getValue(),i=this.get("multiple"),n={width:"100%",allowClear:this.get("allowNull"),placeholder:this.get("placeholder"),separator:"||",multiple:this.get("multiple"),data:this.getChoices(),escapeMarkup:function(t){return t},dropdownCss:{"z-index":"999999999"},initSelection:function(t,n){n(i?e:e.shift())}},a=t.siblings("input");a.length||(a=$('<input type="hidden" />'),t.before(a)),inputValue=e.map(function(t){return t.id}).join("||"),a.val(inputValue),n.multiple&&e.map(function(e){e.$el.detach().appendTo(t)}),n.allowClear&&(n.data=n.data.filter(function(t){return""!==t.id})),t.removeData("ajax"),t.removeAttr("data-ajax"),this.get("ajax")&&(n.ajax={url:acf.get("ajaxurl"),quietMillis:250,dataType:"json",type:"post",cache:!1,data:$.proxy(this.getAjaxData,this),results:$.proxy(this.processAjaxResults,this)});var r=this.get("field");n=acf.applyFilters("select2_args",n,t,this.data,r||!1,this),a.select2(n);var o=a.select2("container"),s=$.proxy(this.getOption,this);if(n.multiple){var c=o.find("ul");c.sortable({stop:function(){c.find(".select2-search-choice").each(function(){var e=$(this).data("select2Data");s(e.id).detach().appendTo(t)}),t.trigger("change")}})}a.on("select2-selecting",function(e){var i=e.choice,n=s(i.id);n.length||(n=$('<option value="'+i.id+'">'+i.text+"</option>")),n.detach().appendTo(t)}),o.addClass("-acf"),acf.doAction("select2_init",t,n,this.data,r||!1,this),a.on("change",function(){var e=a.val();e.indexOf("||")&&(e=e.split("||")),t.val(e).trigger("change")}),t.hide()},mergeOptions:function(){var t=!1,e=!1;$("#select2-drop .select2-result-with-children").each(function(){var i=$(this).children("ul"),n=$(this).children(".select2-result-label");if(e&&e.text()===n.text())return e.append(i.children()),void $(this).remove();t=i,e=n})},getAjaxData:function(t,e){var n={term:t,page:e};return i.prototype.getAjaxData.apply(this,[n])}}),r=new acf.Model({priority:5,wait:"prepare",initialize:function(){var t=acf.get("locale"),i=acf.get("rtl"),n=acf.get("select2L10n"),a=e();return!!n&&(0!==t.indexOf("en")&&void(4==a?this.addTranslations4():3==a&&this.addTranslations3()))},addTranslations4:function(){var t=acf.get("select2L10n"),e=acf.get("locale");e=e.replace("_","-");var i={errorLoading:function(){return t.load_fail},inputTooLong:function(e){var i=e.input.length-e.maximum;return i>1?t.input_too_long_n.replace("%d",i):t.input_too_long_1},inputTooShort:function(e){var i=e.minimum-e.input.length;return i>1?t.input_too_short_n.replace("%d",i):t.input_too_short_1},loadingMore:function(){return t.load_more},maximumSelected:function(e){var i=e.maximum;return i>1?t.selection_too_long_n.replace("%d",i):t.selection_too_long_1},noResults:function(){return t.matches_0},searching:function(){return t.searching}};jQuery.fn.select2.amd.define("select2/i18n/"+e,[],function(){return i})},addTranslations3:function(){var t=acf.get("select2L10n"),e=acf.get("locale");e=e.replace("_","-");var i={formatMatches:function(e){return e>1?t.matches_n.replace("%d",e):t.matches_1},formatNoMatches:function(){return t.matches_0},formatAjaxError:function(){return t.load_fail},formatInputTooShort:function(e,i){var n=i-e.length;return n>1?t.input_too_short_n.replace("%d",n):t.input_too_short_1},formatInputTooLong:function(e,i){var n=e.length-i;return n>1?t.input_too_long_n.replace("%d",n):t.input_too_long_1},formatSelectionTooBig:function(e){return e>1?t.selection_too_long_n.replace("%d",e):t.selection_too_long_1},formatLoadMore:function(){return t.load_more},formatSearching:function(){return t.searching}};$.fn.select2.locales=$.fn.select2.locales||{},$.fn.select2.locales[e]=i,$.extend($.fn.select2.defaults,i)}})}(jQuery),function($,t){acf.tinymce={defaults:function(){return"undefined"!=typeof tinyMCEPreInit&&{tinymce:tinyMCEPreInit.mceInit.acf_content,quicktags:tinyMCEPreInit.qtInit.acf_content}},initialize:function(t,e){e=acf.parseArgs(e,{tinymce:!0,quicktags:!0,toolbar:"full",mode:"visual",field:!1}),e.tinymce&&this.initializeTinymce(t,e),e.quicktags&&this.initializeQuicktags(t,e)},initializeTinymce:function(t,e){var i=$("#"+t),n=this.defaults(),a=acf.get("toolbars"),r=e.field||!1,o=r.$el||!1;if("undefined"==typeof tinymce)return!1;if(!n)return!1;if(tinymce.get(t))return this.enable(t);var s=$.extend({},n.tinymce,e.tinymce);s.id=t,s.selector="#"+t;var c=e.toolbar;if(c&&void 0!==a[c])for(var l=1;l<=4;l++)s["toolbar"+l]=a[c][l]||"";if(s.setup=function(e){e.on("change",function(t){e.save(),i.trigger("change")}),$(e.getWin()).on("unload",function(){acf.tinymce.remove(t)})},s.wp_autoresize_on=!1,s=acf.applyFilters("wysiwyg_tinymce_settings",s,t,r),tinyMCEPreInit.mceInit[t]=s,"visual"==e.mode){var d=tinymce.init(s),u=tinymce.get(t);if(!u)return!1;u.acf=e.field,acf.doAction("wysiwyg_tinymce_init",u,u.id,s,r)}},initializeQuicktags:function(t,e){var i=this.defaults();if("undefined"==typeof quicktags)return!1;if(!i)return!1;var n=$.extend({},i.quicktags,e.quicktags);n.id=t;var a=e.field||!1,r=a.$el||!1;n=acf.applyFilters("wysiwyg_quicktags_settings",n,n.id,a),tinyMCEPreInit.qtInit[t]=n;var o=quicktags(n);if(!o)return!1;this.buildQuicktags(o),acf.doAction("wysiwyg_quicktags_init",o,o.id,n,a)},buildQuicktags:function(t){var e,i,n,a,r,t,o,s,c,l,d=",strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,";e=t.canvas,i=t.name,n=t.settings,r="",a={},c="",l=t.id,n.buttons&&(c=","+n.buttons+",");for(s in edButtons)edButtons[s]&&(o=edButtons[s].id,c&&-1!==d.indexOf(","+o+",")&&-1===c.indexOf(","+o+",")||edButtons[s].instance&&edButtons[s].instance!==l||(a[o]=edButtons[s],edButtons[s].html&&(r+=edButtons[s].html(i+"_"))));c&&-1!==c.indexOf(",dfw,")&&(a.dfw=new QTags.DFWButton,r+=a.dfw.html(i+"_")),"rtl"===document.getElementsByTagName("html")[0].dir&&(a.textdirection=new QTags.TextDirectionButton,r+=a.textdirection.html(i+"_")),t.toolbar.innerHTML=r,t.theButtons=a,"undefined"!=typeof jQuery&&jQuery(document).triggerHandler("quicktags-init",[t])},disable:function(t){this.destroyTinymce(t)},remove:function(t){this.destroyTinymce(t)},destroy:function(t){this.destroyTinymce(t)},destroyTinymce:function(t){if("undefined"==typeof tinymce)return!1;var e=tinymce.get(t);return!!e&&(e.save(),e.destroy(),!0)},enable:function(t){this.enableTinymce(t)},enableTinymce:function(t){
4
- return"undefined"!=typeof switchEditors&&(void 0!==tinyMCEPreInit.mceInit[t]&&(switchEditors.go(t,"tmce"),!0))}};var e=new acf.Model({priority:5,actions:{prepare:"onPrepare",ready:"onReady"},onPrepare:function(){var t=$("#acf-hidden-wp-editor");t.exists()&&t.appendTo("body")},onReady:function(){acf.isset(window,"tinymce","on")&&tinymce.on("AddEditor",function(t){var e=t.editor;"acf"===e.id.substr(0,3)&&(e=tinymce.editors.content||e,tinymce.activeEditor=e,wpActiveEditor=e.id)})}})}(jQuery),function($,t){acf.validation=new acf.Model({active:!0,ignore:!1,errors:[],form:!1,wait:"prepare",actions:{ready:"addInputEvents",append:"addInputEvents"},events:{'click input[type="submit"]':"onClickSubmit",'click button[type="submit"]':"onClickSubmit","click #save-post":"onClickSave","submit form":"onSubmit"},initialize:function(){acf.get("validation")||(this.disable(),this.actions={},this.events={})},getForm:function(t){var i=t.data("acf");return i||(i=new e(t)),this.form=i,i},enable:function(){this.active=!0},disable:function(){this.active=!1},pass:function(){this.ignore=!0,this.setTimeout(function(){this.ignore=!1},100)},reset:function(){this.ignore=!1,this.errors=[],this.form=!1},getErrors:function(){return this.errors},hasErrors:function(){return this.errors.length},addErrors:function(t){t.map(this.addError,this)},addError:function(t){this.errors.push(t)},getFieldErrors:function(){var t=[],e=[];return this.getErrors().map(function(i){if(i.input){var n=e.indexOf(i.input);n>-1?t[n]=i:(t.push(i),e.push(i.input))}}),t},getGlobalErrors:function(){return this.getErrors().filter(function(t){return!t.input})},showErrors:function(t){if(this.hasErrors()){var e=this.getForm(t),i=this.getFieldErrors(),n=this.getGlobalErrors(),a=0,r=!1;i.map(function(e){var i=t.find('[name="'+e.input+'"]').first();if(i.exists()||(i=t.find('[name^="'+e.input+'"]').first()),i.exists()){a++;var n=acf.getClosestField(i);n.showError(e.message),r||(r=n.$el)}},this);var o=acf.__("Validation failed");1==a?o+=". "+acf.__("1 field requires attention"):a>1&&(o+=". "+acf.__("%d fields require attention").replace("%d",a)),e.notice?e.notice.update({type:"error",text:o}):e.notice=acf.newNotice({type:"error",text:o,target:t}),r||(r=e.notice.$el),setTimeout(function(){$("html, body").animate({scrollTop:r.offset().top-$(window).height()/2},500)},10)}},fetch:function(t){if(!this.busy){this.busy=1,t=acf.parseArgs(t,{form:!1,event:!1,lock:!0,loading:function(){},complete:function(){},failure:function(){},success:function(t){t.submit()}});var e=t.form,i=this.getForm(e);if(t.event){var n=$.Event(null,t.event);t.success=function(){$(n.target).trigger(n)}}acf.doAction("validation_begin",e);var a=acf.serialize(e);a.action="acf/validate_save_post",this.lockForm(e),t.loading(e);var r=function(t){acf.isAjaxSuccess(t)&&(a=acf.applyFilters("validation_complete",t.data,e),a.valid||this.addErrors(a.errors))},o=function(){this.busy=0,this.unlockForm(e),this.hasErrors()?(acf.doAction("validation_failure",e),this.showErrors(e),t.failure(e)):(this.pass(),i.notice&&i.notice.update({type:"success",text:acf.__("Validation successful"),timeout:1e3}),acf.doAction("validation_success",e),acf.doAction("submit",e),t.success(e),t.lock&&this.lockForm(e)),this.reset(),t.complete(e)};$.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(a),type:"post",dataType:"json",context:this,success:r,complete:o})}},addInputEvents:function(t){var e=$(".acf-field [name]",t);e.length&&this.on(e,"invalid","onInvalid")},onInvalid:function(t,e){var i=e.closest("form");this.addError({input:e.attr("name"),message:t.target.validationMessage}),t.preventDefault(),i.submit()},onClickSubmit:function(t,e){this.set("originalEvent",t)},onClickSave:function(t,e){this.pass()},onSubmit:function(t,e){acf.validateForm({form:e,event:this.get("originalEvent")})||t.preventDefault()},showSpinner:function(t){t.addClass("is-active"),t.css("display","inline-block")},hideSpinner:function(t){t.removeClass("is-active"),t.css("display","none")},disableSubmit:function(t){t.prop("disabled",!0).addClass("disabled")},enableSubmit:function(t){t.prop("disabled",!1).removeClass("disabled")},findSubmitWrap:function(t){var e=$("#submitdiv");if(e.length)return e;var e=$("#submitpost");if(e.length)return e;var e=t.find("p.submit").last();if(e.length)return e;var e=t.find(".acf-form-submit");return e.length?e:t},lockForm:function(t){var e=this.findSubmitWrap(t),i=e.find('.button, [type="submit"]'),n=e.find(".spinner, .acf-spinner");this.hideSpinner(n),this.disableSubmit(i),this.showSpinner(n.last())},unlockForm:function(t){var e=this.findSubmitWrap(t),i=e.find('.button, [type="submit"]'),n=e.find(".spinner, .acf-spinner");this.enableSubmit(i),this.hideSpinner(n)}});var e=acf.Model.extend({notice:!1,setup:function(t){this.$el=t},lock:function(){acf.validation.lockForm(this.$el)},unlock:function(){acf.validation.unlockForm(this.$el)}});acf.validateForm=function(t){if(!t.form)return!0;var e=acf.validation.getForm(t.form);return!acf.validation.active||(!!acf.validation.ignore||(e.$("#wp-preview").val()?(e.unlock(),!0):!e.$("#acf-form-data").length||(acf.validation.fetch(t),!1)))}}(jQuery),function($,t){var e=new acf.Model({priority:90,timeout:0,actions:{new_field:"refresh",show_field:"refresh",hide_field:"refresh",remove_field:"refresh"},refresh:function(){clearTimeout(this.timeout),this.timeout=setTimeout(function(){acf.doAction("refresh")},0)}}),i=new acf.Model({actions:{sortstart:"onSortstart"},onSortstart:function(t,e){t.is("tr")&&(t.css("position","relative"),t.children().each(function(){$(this).width($(this).width())}),t.css("position","absolute"),e.html('<td style="height:'+t.height()+'px; padding:0;" colspan="'+t.children("td").length+'"></td>'))}}),n=new acf.Model({actions:{after_duplicate:"onAfterDuplicate"},onAfterDuplicate:function(t,e){var i=[];t.find("select").each(function(t){i.push($(this).val())}),e.find("select").each(function(t){$(this).val(i[t])})}}),a=new acf.Model({id:"tableHelper",priority:20,actions:{refresh:"renderTables"},renderTables:function(t){var e=this;$(".acf-table:visible").each(function(){e.renderTable($(this))})},renderTable:function(t){var e=t.find("> thead > tr:visible > th[data-key]"),i=t.find("> tbody > tr:visible > td[data-key]");if(!e.length||!i.length)return!1;e.each(function(t){var e=$(this),n=e.data("key"),a=i.filter('[data-key="'+n+'"]'),r=a.filter(".acf-hidden");a.removeClass("acf-empty"),a.length===r.length?acf.hide(e):(acf.show(e),r.addClass("acf-empty"))}),e.css("width","auto"),e=e.not(".acf-hidden");var n=100,a=e.length;e.filter("[data-width]").each(function(){var t=$(this).data("width");$(this).css("width",t+"%"),n-=t});var r=e.not("[data-width]");if(r.length){var o=n/r.length;r.css("width",o+"%"),n=0}n>0&&e.last().css("width","auto"),i.filter(".-collapsed-target").each(function(){var t=$(this);t.parent().hasClass("-collapsed")?t.attr("colspan",e.length):t.removeAttr("colspan")})}}),r=new acf.Model({id:"fieldsHelper",priority:30,actions:{refresh:"renderGroups"},renderGroups:function(){var t=this;$(".acf-fields:visible").each(function(){t.renderGroup($(this))})},renderGroup:function(t){var e=0,i=0,n=$(),a=t.children(".acf-field[data-width]:visible");return!!a.length&&(t.hasClass("-left")?(a.removeAttr("data-width"),a.css("width","auto"),!1):(a.removeClass("-r0 -c0").css({"min-height":0}),a.each(function(t){var a=$(this),r=a.position(),o=Math.ceil(r.top),s=Math.ceil(r.left);n.length&&o>e&&(n.css({"min-height":i+"px"}),r=a.position(),o=Math.ceil(r.top),s=Math.ceil(r.left),e=0,i=0,n=$()),0==o?a.addClass("-r0"):0==s&&a.addClass("-c0");var c=Math.ceil(a.outerHeight())+1;i=Math.max(i,c),e=Math.max(e,o),n=n.add(a)}),void(n.length&&n.css({"min-height":i+"px"}))))}})}(jQuery),function($,t){acf.newCompatibility=function(t,e){return e=e||{},e.__proto__=t.__proto__,t.__proto__=e,t.compatibility=e,e},acf.getCompatibility=function(t){return t.compatibility||null};var e=acf.newCompatibility(acf,{l10n:{},o:{},fields:{},update:acf.set,add_action:acf.addAction,remove_action:acf.removeAction,do_action:acf.doAction,add_filter:acf.addFilter,remove_filter:acf.removeFilter,apply_filters:acf.applyFilters,parse_args:acf.parseArgs,disable_el:acf.disable,disable_form:acf.disable,enable_el:acf.enable,enable_form:acf.enable,update_user_setting:acf.updateUserSetting,prepare_for_ajax:acf.prepareForAjax,is_ajax_success:acf.isAjaxSuccess,remove_el:acf.remove,remove_tr:acf.remove,str_replace:acf.strReplace,render_select:acf.renderSelect,get_uniqid:acf.uniqid,serialize_form:acf.serialize,esc_html:acf.strEscape,str_sanitize:acf.strSanitize});e._e=function(t,e){t=t||"",e=e||"";var i=e?t+"."+e:t,n={"image.select":"Select Image","image.edit":"Edit Image","image.update":"Update Image"};if(n[i])return acf.__(n[i]);var a=this.l10n[t]||"";return e&&(a=a[e]||""),a},e.get_selector=function(t){var e=".acf-field";if(!t)return e;if($.isPlainObject(t)){if($.isEmptyObject(t))return e;for(var i in t){t=t[i];break}}return e+="-"+t,e=acf.strReplace("_","-",e),e=acf.strReplace("field-field-","field-",e)},e.get_fields=function(t,e,i){var n={is:t||"",parent:e||!1,suppressFilters:i||!1};return n.is&&(n.is=this.get_selector(n.is)),acf.findFields(n)},e.get_field=function(t,e){var i=this.get_fields.apply(this,arguments);return!!i.length&&i.first()},e.get_closest_field=function(t,e){return t.closest(this.get_selector(e))},e.get_field_wrap=function(t){return t.closest(this.get_selector())},e.get_field_key=function(t){return t.data("key")},e.get_field_type=function(t){return t.data("type")},e.get_data=function(t,e){return acf.parseArgs(t.data(),e)},e.maybe_get=function(t,e,i){void 0===i&&(i=null),keys=String(e).split(".");for(var n=0;n<keys.length;n++){if(!t.hasOwnProperty(keys[n]))return i;t=t[keys[n]]}return t};var i=function(t){return t instanceof acf.Field?t.$el:t},n=function(t){return acf.arrayArgs(t).map(i)},a=function(t){return function(){if(arguments.length)var e=n(arguments);else var e=[$(document)];return t.apply(this,e)}};e.add_action=function(t,i,n,r){var o=t.split(" "),s=o.length;if(s>1){for(var c=0;c<s;c++)t=o[c],e.add_action.apply(this,arguments);return this}var i=a(i);return acf.addAction.apply(this,arguments)},e.add_filter=function(t,e,i,n){var e=a(e);return acf.addFilter.apply(this,arguments)},e.model={actions:{},filters:{},events:{},extend:function(t){var e=$.extend({},this,t);return $.each(e.actions,function(t,i){e._add_action(t,i)}),$.each(e.filters,function(t,i){e._add_filter(t,i)}),$.each(e.events,function(t,i){e._add_event(t,i)}),e},_add_action:function(t,e){var i=this,n=t.split(" "),t=n[0]||"",a=n[1]||10;acf.add_action(t,i[e],a,i)},_add_filter:function(t,e){var i=this,n=t.split(" "),t=n[0]||"",a=n[1]||10;acf.add_filter(t,i[e],a,i)},_add_event:function(t,e){var i=this,n=t.indexOf(" "),a=n>0?t.substr(0,n):t,r=n>0?t.substr(n+1):"",o=function(t){t.$el=$(this),acf.field_group&&(t.$field=t.$el.closest(".acf-field-object")),"function"==typeof i.event&&(t=i.event(t)),i[e].apply(i,arguments)};r?$(document).on(a,r,o):$(document).on(a,o)},get:function(t,e){return e=e||null,void 0!==this[t]&&(e=this[t]),e},set:function(t,e){return this[t]=e,"function"==typeof this["_set_"+t]&&this["_set_"+t].apply(this),this}},e.field=acf.model.extend({type:"",o:{},$field:null,_add_action:function(t,e){var i=this;t=t+"_field/type="+i.type,acf.add_action(t,function(t){i.set("$field",t),i[e].apply(i,arguments)})},_add_filter:function(t,e){var i=this;t=t+"_field/type="+i.type,acf.add_filter(t,function(t){i.set("$field",t),i[e].apply(i,arguments)})},_add_event:function(t,e){var i=this,n=t.substr(0,t.indexOf(" ")),a=t.substr(t.indexOf(" ")+1),r=acf.get_selector(i.type);$(document).on(n,r+" "+a,function(t){var n=$(this),a=acf.get_closest_field(n,i.type);a.length&&(a.is(i.$field)||i.set("$field",a),t.$el=n,t.$field=a,i[e].apply(i,[t]))})},_set_$field:function(){"function"==typeof this.focus&&this.focus()},doFocus:function(t){return this.set("$field",t)}});var r=acf.newCompatibility(acf.validation,{remove_error:function(t){acf.getField(t).removeError()},add_warning:function(t,e){acf.getField(t).showNotice({text:e,type:"warning",timeout:1e3})}});e.tooltip={tooltip:function(t,e){return acf.newTooltip({text:t,target:e}).$el},temp:function(t,e){var i=acf.newTooltip({text:t,target:e,timeout:250})},confirm:function(t,e,i,n,a){var r=acf.newTooltip({confirm:!0,text:i,target:t,confirm:function(){e(!0)},cancel:function(){e(!1)}})},confirm_remove:function(t,e){var i=acf.newTooltip({confirmRemove:!0,target:t,confirm:function(){e(!0)},cancel:function(){e(!1)}})}},e.media=new acf.Model({activeFrame:!1,actions:{new_media_popup:"onNewMediaPopup"},frame:function(){return this.activeFrame},onNewMediaPopup:function(t){this.activeFrame=t.frame},popup:function(t){return t.mime_types&&(t.allowedTypes=t.mime_types),t.id&&(t.attachment=t.id),acf.newMediaPopup(t).frame}}),e.select2={init:function(t,e,i){return e.allow_null&&(e.allowNull=e.allow_null),e.ajax_action&&(e.ajaxAction=e.ajax_action),i&&(e.field=acf.getField(i)),acf.newSelect2(t,e)},destroy:function(t){return acf.getInstance(t).destroy()}},e.postbox={render:function(t){return t.edit_url&&(t.editLink=t.edit_url),t.edit_title&&(t.editTitle=t.edit_title),acf.newPostbox(t)}},acf.newCompatibility(acf.screen,{update:function(){return this.set.apply(this,arguments)}}),e.ajax=acf.screen}(jQuery);
1
+ !function($,t){var e={};window.acf=e,e.data={},e.get=function(t){return this.data[t]||null},e.has=function(t){return null!==this.get(t)},e.set=function(t,e){return this.data[t]=e,this};var i=0;e.uniqueId=function(t){var e=++i+"";return t?t+e:e},e.uniqueArray=function(t){function e(t,e,i){return i.indexOf(t)===e}return t.filter(e)};var n="";e.uniqid=function(t,e){void 0===t&&(t="");var i,a=function(t,e){return t=parseInt(t,10).toString(16),e<t.length?t.slice(t.length-e):e>t.length?Array(e-t.length+1).join("0")+t:t};return n||(n=Math.floor(123456789*Math.random())),n++,i=t,i+=a(parseInt((new Date).getTime()/1e3,10),8),i+=a(n,5),e&&(i+=(10*Math.random()).toFixed(8).toString()),i},e.strReplace=function(t,e,i){return i.split(t).join(e)},e.strCamelCase=function(t){return t=t.replace(/[_-]/g," "),t=t.replace(/(?:^\w|\b\w|\s+)/g,function(t,e){return 0==+t?"":0==e?t.toLowerCase():t.toUpperCase()})},e.strPascalCase=function(t){var i=e.strCamelCase(t);return i.charAt(0).toUpperCase()+i.slice(1)},e.strSlugify=function(t){return e.strReplace("_","-",t.toLowerCase())},e.strSanitize=function(t){var e={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","ß":"s","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","ĝ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o"," ":"_","'":"","?":"","/":"","\\":"",".":"",",":"","`":"",">":"","<":"",'"':"","[":"","]":"","|":"","{":"","}":"","(":"",")":""},i=/\W/g,n=function(t){return void 0!==e[t]?e[t]:t};return t=t.replace(i,n),t=t.toLowerCase()},e.strMatch=function(t,e){for(var i=0,n=Math.min(t.length,e.length),a=0;a<n&&t[a]===e[a];a++)i++;return i},e.decode=function(t){return $("<textarea/>").html(t).text()},e.strEscape=function(t){var e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})},e.parseArgs=function(t,e){return"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={}),$.extend({},e,t)},void 0==window.acfL10n&&(acfL10n={}),e.__=function(t){return acfL10n[t]||t},e._x=function(t,e){return acfL10n[t+"."+e]||acfL10n[t]||t},e._n=function(t,i,n){return 1==n?e.__(t):e.__(i)},e.isArray=function(t){return Array.isArray(t)},e.isObject=function(t){return"object"==typeof t};var a=function(t,i,n){i=i.replace("[]","[%%index%%]");var a=i.match(/([^\[\]])+/g);if(a)for(var r=a.length,o=t,s=0;s<r;s++){var c=String(a[s]);s==r-1?"%%index%%"===c?o.push(n):o[c]=n:("%%index%%"===a[s+1]?e.isArray(o[c])||(o[c]=[]):e.isObject(o[c])||(o[c]={}),o=o[c])}};e.serialize=function(t,i){var n={},r=e.serializeArray(t);void 0!==i&&(r=r.filter(function(t){return 0===t.name.indexOf(i)}).map(function(t){return t.name=t.name.slice(i.length),t}));for(var o=0;o<r.length;o++)a(n,r[o].name,r[o].value);return n},e.serializeArray=function(t){return t.find("select, textarea, input").serializeArray()},e.addAction=function(t,i,n,a){return e.hooks.addAction.apply(this,arguments),this},e.removeAction=function(t,i){return e.hooks.removeAction.apply(this,arguments),this};var r={};e.doAction=function(t){return r[t]=1,e.hooks.doAction.apply(this,arguments),r[t]=0,this},e.doingAction=function(t){return 1===r[t]},e.didAction=function(t){return void 0!==r[t]},e.currentAction=function(){for(var t in r)if(r[t])return t;return!1},e.addFilter=function(t){return e.hooks.addFilter.apply(this,arguments),this},e.removeFilter=function(t){return e.hooks.removeFilter.apply(this,arguments),this},e.applyFilters=function(t){return e.hooks.applyFilters.apply(this,arguments)},e.arrayArgs=function(t){return Array.prototype.slice.call(t)};try{var o=JSON.parse(localStorage.getItem("acf"))||{}}catch(t){var o={}}var s=function(t){return"this."===t.substr(0,5)&&(t=t.substr(5)+"-"+e.get("post_id")),t};e.getPreference=function(t){return t=s(t),o[t]||null},e.setPreference=function(t,e){t=s(t),null===e?delete o[t]:o[t]=e,localStorage.setItem("acf",JSON.stringify(o))},e.removePreference=function(t){e.setPreference(t,null)},e.remove=function(t){t instanceof jQuery&&(t={target:t}),t=e.parseArgs(t,{target:!1,endHeight:0,complete:function(){}}),e.doAction("remove",t.target),t.target.is("tr")?l(t):c(t)};var c=function(t){var e=t.target,i=e.height(),n=e.width(),a=e.css("margin"),r=e.outerHeight(!0),o=e.attr("style")+"";e.wrap('<div class="acf-temp-remove" style="height:'+r+'px"></div>');var s=e.parent();e.css({height:i,width:n,margin:a,position:"absolute"}),setTimeout(function(){s.css({opacity:0,height:t.endHeight})},50),setTimeout(function(){e.attr("style",o),s.remove(),t.complete()},301)},l=function(t){var e=t.target,i=e.height(),n=e.children().length,a=$('<td class="acf-temp-remove" style="padding:0; height:'+i+'px" colspan="'+n+'"></td>');e.addClass("acf-remove-element"),setTimeout(function(){e.html(a)},251),setTimeout(function(){e.removeClass("acf-remove-element"),a.css({height:t.endHeight})},300),setTimeout(function(){e.remove(),t.complete()},451)};e.duplicate=function(t){t instanceof jQuery&&(t={target:t});var i=0;t=e.parseArgs(t,{target:!1,search:"",replace:"",before:function(t){},after:function(t,e){},append:function(t,e){t.after(e),i=1}}),t.target=t.target||t.$el;var n=t.target;t.search=t.search||n.attr("data-id"),t.replace=t.replace||e.uniqid(),t.before(n),e.doAction("before_duplicate",n);var a=n.clone();return e.rename({target:a,search:t.search,replace:t.replace}),a.removeClass("acf-clone"),a.find(".ui-sortable").removeClass("ui-sortable"),t.after(n,a),e.doAction("after_duplicate",n,a),t.append(n,a),e.doAction("append",a),a},e.rename=function(t){t instanceof jQuery&&(t={target:t}),t=e.parseArgs(t,{target:!1,destructive:!1,search:"",replace:""});var i=t.target,n=t.search||i.attr("data-id"),a=t.replace||e.uniqid("acf"),r=function(t,e){return e.replace(n,a)};if(t.destructive){var o=i.outerHTML();o=e.strReplace(n,a,o),i.replaceWith(o)}else i.attr("data-id",a),i.find('[id*="'+n+'"]').attr("id",r),i.find('[for*="'+n+'"]').attr("for",r),i.find('[name*="'+n+'"]').attr("name",r);return i},e.prepareForAjax=function(t){return t.nonce=e.get("nonce"),t.post_id=e.get("post_id"),t=e.applyFilters("prepare_for_ajax",t)},e.startButtonLoading=function(t){t.prop("disabled",!0),t.after(' <i class="acf-loading"></i>')},e.stopButtonLoading=function(t){t.prop("disabled",!1),t.next(".acf-loading").remove()},e.showLoading=function(t){t.append('<div class="acf-loading-overlay"><i class="acf-loading"></i></div>')},e.hideLoading=function(t){t.children(".acf-loading-overlay").remove()},e.updateUserSetting=function(t,i){var n={action:"acf/ajax/user_setting",name:t,value:i};$.ajax({url:e.get("ajaxurl"),data:e.prepareForAjax(n),type:"post",dataType:"html"})},e.val=function(t,e,i){var n=t.val();return e!==n&&(t.val(e),t.is("select")&&null===t.val()?(t.val(n),!1):(!0!==i&&t.trigger("change"),!0))},e.show=function(t,i){return i&&e.unlock(t,"hidden",i),!e.isLocked(t,"hidden")&&(!!t.hasClass("acf-hidden")&&(t.removeClass("acf-hidden"),!0))},e.hide=function(t,i){return i&&e.lock(t,"hidden",i),!t.hasClass("acf-hidden")&&(t.addClass("acf-hidden"),!0)},e.isHidden=function(t){return t.hasClass("acf-hidden")},e.isVisible=function(t){return!e.isHidden(t)};var d=function(t,i){return!t.hasClass("acf-disabled")&&(i&&e.unlock(t,"disabled",i),!e.isLocked(t,"disabled")&&(!!t.prop("disabled")&&(t.prop("disabled",!1),!0)))};e.enable=function(t,e){if(t.attr("name"))return d(t,e);var i=!1;return t.find("[name]").each(function(){d($(this),e)&&(i=!0)}),i};var u=function(t,i){return i&&e.lock(t,"disabled",i),!t.prop("disabled")&&(t.prop("disabled",!0),!0)};e.disable=function(t,e){if(t.attr("name"))return u(t,e);var i=!1;return t.find("[name]").each(function(){u($(this),e)&&(i=!0)}),i},e.isset=function(t){for(var e=1;e<arguments.length;e++){if(!t||!t.hasOwnProperty(arguments[e]))return!1;t=t[arguments[e]]}return!0},e.isget=function(t){for(var e=1;e<arguments.length;e++){if(!t||!t.hasOwnProperty(arguments[e]))return null;t=t[arguments[e]]}return t},e.getFileInputData=function(t,i){var n=t.val();if(!n)return!1;var a={url:n},r=e.isget(t[0],"files",0);if(r)if(a.size=r.size,a.type=r.type,r.type.indexOf("image")>-1){var o=window.URL||window.webkitURL,s=new Image;s.onload=function(){a.width=this.width,a.height=this.height,i(a)},s.src=o.createObjectURL(r)}else i(a);else i(a)},e.isAjaxSuccess=function(t){return t&&t.success},e.getAjaxMessage=function(t){return e.isget(t,"data","message")},e.getAjaxError=function(t){return e.isget(t,"data","error")},e.renderSelect=function(t,i){var n=t.val(),a=[],r=function(t){var i="";return t.map(function(t){var n=t.text||t.label||"",o=t.id||t.value||"";a.push(o),t.children?i+='<optgroup label="'+e.strEscape(n)+'">'+r(t.children)+"</optgroup>":i+='<option value="'+o+'"'+(t.disabled?' disabled="disabled"':"")+">"+e.strEscape(n)+"</option>"}),i};return t.html(r(i)),a.indexOf(n)>-1&&t.val(n),t.val()};var f=function(t,e){return t.data("acf-lock-"+e)||[]},h=function(t,e,i){t.data("acf-lock-"+e,i)};e.lock=function(t,e,i){var n=f(t,e);n.indexOf(i)<0&&(n.push(i),h(t,e,n))},e.unlock=function(t,e,i){var n=f(t,e),a=n.indexOf(i);return a>-1&&(n.splice(a,1),h(t,e,n)),0===n.length},e.isLocked=function(t,e){return f(t,e).length>0},$.fn.exists=function(){return $(this).length>0},$.fn.outerHTML=function(){return $(this).get(0).outerHTML},Array.prototype.indexOf||(Array.prototype.indexOf=function(t){return $.inArray(t,this)}),$(document).ready(function(){e.doAction("ready")}),$(window).on("load",function(){e.doAction("load")}),$(window).on("beforeunload",function(){e.doAction("unload")}),$(window).on("resize",function(){e.doAction("resize")}),$(document).on("sortstart",function(t,i){e.doAction("sortstart",i.item,i.placeholder)}),$(document).on("sortstop",function(t,i){e.doAction("sortstop",i.item,i.placeholder)})}(jQuery),function(t,e){"use strict";var i=function(){function t(){return f}function e(t,e,i,n){return"string"==typeof t&&"function"==typeof e&&(i=parseInt(i||10,10),c("actions",t,e,i,n)),u}function i(){var t=Array.prototype.slice.call(arguments),e=t.shift();return"string"==typeof e&&d("actions",e,t),u}function n(t,e){return"string"==typeof t&&s("actions",t,e),u}function a(t,e,i,n){return"string"==typeof t&&"function"==typeof e&&(i=parseInt(i||10,10),c("filters",t,e,i,n)),u}function r(){var t=Array.prototype.slice.call(arguments),e=t.shift();return"string"==typeof e?d("filters",e,t):u}function o(t,e){return"string"==typeof t&&s("filters",t,e),u}function s(t,e,i,n){if(f[t][e])if(i){var a=f[t][e],r;if(n)for(r=a.length;r--;){var o=a[r];o.callback===i&&o.context===n&&a.splice(r,1)}else for(r=a.length;r--;)a[r].callback===i&&a.splice(r,1)}else f[t][e]=[]}function c(t,e,i,n,a){var r={callback:i,priority:n,context:a},o=f[t][e];o?(o.push(r),o=l(o)):o=[r],f[t][e]=o}function l(t){for(var e,i,n,a=1,r=t.length;a<r;a++){for(e=t[a],i=a;(n=t[i-1])&&n.priority>e.priority;)t[i]=t[i-1],--i;t[i]=e}return t}function d(t,e,i){var n=f[t][e];if(!n)return"filters"===t&&i[0];var a=0,r=n.length;if("filters"===t)for(;a<r;a++)i[0]=n[a].callback.apply(n[a].context,i);else for(;a<r;a++)n[a].callback.apply(n[a].context,i);return"filters"!==t||i[0]}var u={removeFilter:o,applyFilters:r,addFilter:a,removeAction:n,doAction:i,addAction:e,storage:t},f={actions:{},filters:{}};return u};acf.hooks=new i}(window),function($,t){var e=/^(\S+)\s*(.*)$/,i=function(t){var e=this,i;return i=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},$.extend(i,e),i.prototype=Object.create(e.prototype),$.extend(i.prototype,t),i.prototype.constructor=i,i},n=acf.Model=function(){this.cid=acf.uniqueId("acf"),this.data=$.extend(!0,{},this.data),this.setup.apply(this,arguments),this.$el&&!this.$el.data("acf")&&this.$el.data("acf",this);var t=function(){this.initialize(),this.addEvents(),this.addActions(),this.addFilters()};this.wait&&!acf.didAction(this.wait)?this.addAction(this.wait,t):t.apply(this)};$.extend(n.prototype,{id:"",cid:"",$el:null,data:{},busy:!1,changed:!1,events:{},actions:{},filters:{},eventScope:"",wait:!1,priority:10,get:function(t){return this.data[t]},has:function(t){return null!=this.get(t)},set:function(t,e,i){return this.get(t)==e?this:(this.data[t]=e,i||(this.changed=!0,this.trigger("changed:"+t,[e]),this.trigger("changed",[t,e])),this)},inherit:function(t){return t instanceof jQuery&&(t=t.data()),$.extend(this.data,t),this},prop:function(){return this.$el.prop.apply(this.$el,arguments)},setup:function(t){$.extend(this,t)},initialize:function(){},addElements:function(t){if(!(t=t||this.elements||null)||!Object.keys(t).length)return!1;for(var e in t)this.addElement(e,t[e])},addElement:function(t,e){this["$"+t]=this.$(e)},addEvents:function(t){if(!(t=t||this.events||null))return!1;for(var i in t){var n=i.match(e);this.on(n[1],n[2],t[i])}},removeEvents:function(t){if(!(t=t||this.events||null))return!1;for(var i in t){var n=i.match(e);this.off(n[1],n[2],t[i])}},getEventTarget:function(t,e){return t||this.$el||$(document)},validateEvent:function(t){return!this.eventScope||$(t.target).closest(this.eventScope).is(this.$el)},proxyEvent:function(t){return this.proxy(function(e){if(this.validateEvent(e)){var i=acf.arrayArgs(arguments),n=i.slice(1),a=[e,$(e.currentTarget)].concat(n);t.apply(this,a)}})},on:function(t,e,i,n){var a,r,o,s,c;t instanceof jQuery?n?(a=t,r=e,o=i,s=n):(a=t,r=e,s=i):i?(r=t,o=e,s=i):(r=t,s=e),a=this.getEventTarget(a),"string"==typeof s&&(s=this.proxyEvent(this[s])),r=r+"."+this.cid,c=o?[r,o,s]:[r,s],a.on.apply(a,c)},off:function(t,e,i){var n,a,r,o;t instanceof jQuery?i?(n=t,a=e,r=i):(n=t,a=e):e?(a=t,r=e):a=t,n=this.getEventTarget(n),a=a+"."+this.cid,o=r?[a,r]:[a],n.off.apply(n,o)},trigger:function(t,e,i){var n=this.getEventTarget();return i?n.trigger.apply(n,arguments):n.triggerHandler.apply(n,arguments),this},addActions:function(t){if(!(t=t||this.actions||null))return!1;for(var e in t)this.addAction(e,t[e])},removeActions:function(t){if(!(t=t||this.actions||null))return!1;for(var e in t)this.removeAction(e,t[e])},addAction:function(t,e,i){i=i||this.priority,"string"==typeof e&&(e=this[e]),acf.addAction(t,e,i,this)},removeAction:function(t,e){acf.removeAction(t,this[e])},addFilters:function(t){if(!(t=t||this.filters||null))return!1;for(var e in t)this.addFilter(e,t[e])},addFilter:function(t,e,i){i=i||this.priority,"string"==typeof e&&(e=this[e]),acf.addFilter(t,e,i,this)},removeFilters:function(t){if(!(t=t||this.filters||null))return!1;for(var e in t)this.removeFilter(e,t[e])},removeFilter:function(t,e){acf.removeFilter(t,this[e])},$:function(t){return this.$el.find(t)},remove:function(){this.removeEvents(),this.removeActions(),this.removeFilters(),this.$el.remove()},setTimeout:function(t,e){return setTimeout(this.proxy(t),e)},time:function(){console.time(this.id||this.cid)},timeEnd:function(){console.timeEnd(this.id||this.cid)},show:function(){acf.show(this.$el)},hide:function(){acf.hide(this.$el)},proxy:function(t){return $.proxy(t,this)}}),n.extend=i,acf.models={},acf.getInstance=function(t){return t.data("acf")},acf.getInstances=function(t){var e=[];return t.each(function(){e.push(acf.getInstance($(this)))}),e}}(jQuery),function($,t){acf.models.Popup=acf.Model.extend({data:{title:"",content:"",width:0,height:0,loading:!1},events:{'click [data-event="close"]':"onClickClose","click .acf-close-popup":"onClickClose"},setup:function(t){$.extend(this.data,t),this.$el=$(this.tmpl())},initialize:function(){this.render(),this.open()},tmpl:function(){return['<div id="acf-popup">','<div class="acf-popup-box acf-box">','<div class="title"><h3></h3><a href="#" class="acf-icon -cancel grey" data-event="close"></a></div>','<div class="inner"></div>','<div class="loading"><i class="acf-loading"></i></div>',"</div>",'<div class="bg" data-event="close"></div>',"</div>"].join("")},render:function(){var t=this.get("title"),e=this.get("content"),i=this.get("loading"),n=this.get("width"),a=this.get("height");this.title(t),this.content(e),n&&this.$(".acf-popup-box").css("width",n),a&&this.$(".acf-popup-box").css("min-height",a),this.loading(i),acf.doAction("append",this.$el)},update:function(t){this.data=acf.parseArgs(t,this.data),this.render()},title:function(t){this.$(".title:first h3").html(t)},content:function(t){this.$(".inner:first").html(t)},loading:function(t){var e=this.$(".loading:first");t?e.show():e.hide()},open:function(){$("body").append(this.$el)},close:function(){this.remove()},onClickClose:function(t,e){t.preventDefault(),this.close()}}),acf.newPopup=function(t){return new acf.models.Popup(t)}}(jQuery),function($,t){acf.unload=new acf.Model({wait:"load",active:!0,changed:!1,actions:{change_field:"startListening",validation_failure:"startListening"},events:{"submit form":"stopListening"},reset:function(){this.stopListening()},startListening:function(){!this.changed&&this.active&&(this.changed=!0,$(window).on("beforeunload",this.onUnload))},stopListening:function(){this.changed=!1,$(window).off("beforeunload",this.onUnload)},onUnload:function(){return acf.__("The changes you made will be lost if you navigate away from this page")}})}(jQuery),function($,t){var e=new acf.Model({events:{"click .acf-panel-title":"onClick"},onClick:function(t,e){t.preventDefault(),this.toggle(e.parent())},isOpen:function(t){return t.hasClass("-open")},toggle:function(t){this.isOpen(t)?this.close(t):this.open(t)},open:function(t){t.addClass("-open"),t.find(".acf-panel-title i").attr("class","dashicons dashicons-arrow-down")},close:function(t){t.removeClass("-open"),t.find(".acf-panel-title i").attr("class","dashicons dashicons-arrow-right")}})}(jQuery),function($,t){var e=acf.Model.extend({data:{text:"",type:"",timeout:0,dismiss:!0,target:!1,close:function(){}},events:{"click .acf-notice-dismiss":"onClickClose"},tmpl:function(){return'<div class="acf-notice"></div>'},setup:function(t){$.extend(this.data,t),this.$el=$(this.tmpl())},initialize:function(){this.render(),this.show()},render:function(){this.type(this.get("type")),this.html("<p>"+this.get("text")+"</p>"),this.get("dismiss")&&(this.$el.append('<a href="#" class="acf-notice-dismiss acf-icon -cancel small"></a>'),this.$el.addClass("-dismiss"));var t=this.get("timeout");t&&this.away(t)},update:function(t){$.extend(this.data,t),this.initialize()},show:function(){var t=this.get("target");t&&t.prepend(this.$el)},hide:function(){this.$el.remove()},away:function(t){this.setTimeout(function(){acf.remove(this.$el)},t)},type:function(t){var e=this.get("type");e&&this.$el.removeClass("-"+e),this.$el.addClass("-"+t),"error"==t&&this.$el.addClass("acf-error-message")},html:function(t){this.$el.html(t)},text:function(t){this.$("p").html(t)},onClickClose:function(t,e){t.preventDefault(),this.get("close").apply(this,arguments),this.remove()}});acf.newNotice=function(t){return"object"!=typeof t&&(t={text:t}),new e(t)};var i=new acf.Model({wait:"prepare",priority:1,initialize:function(){var t=$(".acf-admin-notice");t.length&&$("h1:first").after(t)}})}(jQuery),function($,t){acf.models.Postbox=acf.Model.extend({data:{id:"",key:"",style:"default",label:"top",editLink:"",editTitle:"",visibility:!0},setup:function(t){$.extend(this.data,t)},initialize:function(){var t=this.get("id"),e=$("#"+t),i=$("#"+t+"-hide"),n=i.parent();e.addClass("acf-postbox"),n.addClass("acf-postbox-toggle"),e.removeClass("hide-if-js"),n.removeClass("hide-if-js");var a=this.get("style");"default"!==a&&e.addClass(a),e.children(".inside").addClass("acf-fields").addClass("-"+this.get("label")),this.get("visibility")?i.prop("checked",!0):(e.addClass("acf-hidden"),n.addClass("acf-hidden"));var r=this.get("editLink"),o=this.get("editTitle");r&&e.children(".hndle").append('<a href="'+r+'" class="dashicons dashicons-admin-generic acf-hndle-cog acf-js-tooltip" title="'+o+'"></a>')}}),acf.newPostbox=function(t){return new acf.models.Postbox(t)}}(jQuery),function($,t){acf.newTooltip=function(t){return"object"!=typeof t&&(t={text:t}),void 0!==t.confirmRemove?(t.textConfirm=acf.__("Remove"),t.textCancel=acf.__("Cancel"),new i(t)):void 0!==t.confirm?new i(t):new e(t)};var e=acf.Model.extend({data:{text:"",timeout:0,target:null},tmpl:function(){return'<div class="acf-tooltip"></div>'},setup:function(t){$.extend(this.data,t),this.$el=$(this.tmpl())},initialize:function(){this.render(),this.show(),this.position();var t=this.get("timeout");t&&setTimeout($.proxy(this.fade,this),t)},update:function(t){$.extend(this.data,t),this.initialize()},render:function(){this.html(this.get("text"))},show:function(){$("body").append(this.$el)},hide:function(){this.$el.remove()},fade:function(){this.$el.addClass("acf-fade-up"),this.setTimeout(function(){this.remove()},250)},html:function(t){this.$el.html(t)},position:function(){var t=this.$el,e=this.get("target");if(e){t.removeClass("right left bottom top");var i=10,n=e.outerWidth(),a=e.outerHeight(),r=e.offset().top,o=e.offset().left,s=t.outerWidth(),c=t.outerHeight(),l=r-c,d=o+n/2-s/2;d<10?(t.addClass("right"),d=o+n,l=r+a/2-c/2):d+s+10>$(window).width()?(t.addClass("left"),d=o-s,l=r+a/2-c/2):l-$(window).scrollTop()<10?(t.addClass("bottom"),l=r+a):t.addClass("top"),t.css({top:l,left:d})}}}),i=e.extend({data:{text:"",textConfirm:"",textCancel:"",target:null,targetConfirm:!0,confirm:function(){},cancel:function(){},context:!1},events:{'click [data-event="cancel"]':"onCancel",'click [data-event="confirm"]':"onConfirm"},addEvents:function(){acf.Model.prototype.addEvents.apply(this);var t=$(document),e=this.get("target");this.setTimeout(function(){this.on(t,"click","onCancel")}),this.get("targetConfirm")&&this.on(e,"click","onConfirm")},removeEvents:function(){acf.Model.prototype.removeEvents.apply(this);var t=$(document),e=this.get("target");this.off(t,"click"),this.off(e,"click")},render:function(){var t=this.get("text")||acf.__("Are you sure?"),e=this.get("textConfirm")||acf.__("Yes"),i=this.get("textCancel")||acf.__("No"),n=[t,'<a href="#" data-event="confirm">'+e+"</a>",'<a href="#" data-event="cancel">'+i+"</a>"].join(" ");this.html(n),this.$el.addClass("-confirm")},onCancel:function(t,e){t.preventDefault(),t.stopImmediatePropagation();var i=this.get("cancel"),n=this.get("context")||this;i.apply(n,arguments),this.remove()},onConfirm:function(t,e){t.preventDefault(),t.stopImmediatePropagation();var i=this.get("confirm"),n=this.get("context")||this;i.apply(n,arguments),this.remove()}});acf.models.Tooltip=e,acf.models.TooltipConfirm=i;var n=new acf.Model({tooltip:!1,events:{"mouseenter .acf-js-tooltip":"showTitle","mouseup .acf-js-tooltip":"hideTitle","mouseleave .acf-js-tooltip":"hideTitle"},showTitle:function(t,e){var i=e.attr("title");i&&(e.attr("title",""),this.tooltip?this.tooltip.update({text:i,target:e}):this.tooltip=acf.newTooltip({text:i,target:e}))},hideTitle:function(t,e){this.tooltip.hide(),e.attr("title",this.tooltip.get("text"))}})}(jQuery),function($,t){var e=[];acf.Field=acf.Model.extend({type:"",eventScope:".acf-field",wait:"ready",setup:function(t){this.$el=t,this.inherit(t),this.inherit(this.$control())},val:function(t){return void 0!==t?this.setValue(t):this.prop("disabled")?null:this.getValue()},getValue:function(){return this.$input().val()},setValue:function(t){return acf.val(this.$input(),t)},__:function(t){return acf._e(this.type,t)},$control:function(){return!1},$input:function(){return this.$("[name]:first")},$inputWrap:function(){return this.$(".acf-input:first")},$labelWrap:function(){return this.$(".acf-label:first")},getInputName:function(){return this.$input().attr("name")||""},parent:function(){var t=this.parents();return!!t.length&&t[0]},parents:function(){var t=this.$el.parents(".acf-field");return acf.getFields(t)},show:function(t,e){var i=acf.show(this.$el,t);return i&&(this.prop("hidden",!1),acf.doAction("show_field",this,e)),i},hide:function(t,e){var i=acf.hide(this.$el,t);return i&&(this.prop("hidden",!0),acf.doAction("hide_field",this,e)),i},enable:function(t,e){var i=acf.enable(this.$el,t);return i&&(this.prop("disabled",!1),acf.doAction("enable_field",this,e)),i},disable:function(t,e){var i=acf.disable(this.$el,t);return i&&(this.prop("disabled",!0),acf.doAction("disable_field",this,e)),i},showEnable:function(t,e){return this.enable.apply(this,arguments),this.show.apply(this,arguments)},hideDisable:function(t,e){return this.disable.apply(this,arguments),this.hide.apply(this,arguments)},showNotice:function(t){"object"!=typeof t&&(t={text:t}),this.notice&&this.notice.remove(),t.target=this.$inputWrap(),this.notice=acf.newNotice(t)},removeNotice:function(t){this.notice&&(this.notice.away(t||0),this.notice=!1)},showError:function(t){this.$el.addClass("acf-error"),void 0!==t&&this.showNotice({text:t,type:"error",dismiss:!1}),acf.doAction("invalid_field",this),this.$el.one("focus change","input, select, textarea",$.proxy(this.removeError,this))},removeError:function(){this.$el.removeClass("acf-error"),this.removeNotice(250),acf.doAction("valid_field",this)},trigger:function(t,e,i){return"invalidField"==t&&(i=!0),acf.Model.prototype.trigger.apply(this,[t,e,i])}}),acf.newField=function(t){var e=t.data("type"),n=i(e),a=acf.models[n]||acf.Field,r=new a(t);return acf.doAction("new_field",r),r};var i=function(t){return acf.strPascalCase(t||"")+"Field"};acf.registerFieldType=function(t){var n=t.prototype,a=n.type,r=i(a);acf.models[r]=t,e.push(a)},acf.getFieldType=function(t){var e=i(t);return acf.models[e]||!1},acf.getFieldTypes=function(t){t=acf.parseArgs(t,{category:""});var i=[];return e.map(function(e){var n=acf.getFieldType(e),a=n.prototype;t.category&&a.category!==t.category||i.push(n)}),i}}(jQuery),function($,t){acf.findFields=function(t){var e=".acf-field",i=!1;return t=acf.parseArgs(t,{key:"",name:"",type:"",is:"",parent:!1,sibling:!1,limit:!1,visible:!1,suppressFilters:!1}),t.suppressFilters||(t=acf.applyFilters("find_fields_args",t)),t.key&&(e+='[data-key="'+t.key+'"]'),t.type&&(e+='[data-type="'+t.type+'"]'),t.name&&(e+='[data-name="'+t.name+'"]'),t.is&&(e+=t.is),t.visible&&(e+=":visible"),i=t.parent?t.parent.find(e):t.sibling?t.sibling.siblings(e):$(e),t.suppressFilters||(i=i.not(".acf-clone .acf-field"),i=acf.applyFilters("find_fields",i)),t.limit&&(i=i.slice(0,t.limit)),i},acf.findField=function(t,e){return acf.findFields({key:t,limit:1,parent:e,suppressFilters:!0})},acf.getField=function(t){t instanceof jQuery||(t=acf.findField(t));var e=t.data("acf");return e||(e=acf.newField(t)),e},acf.getFields=function(t){t instanceof jQuery||(t=acf.findFields(t));var e=[];return t.each(function(){var t=acf.getField($(this));e.push(t)}),e},acf.findClosestField=function(t){return t.closest(".acf-field")},acf.getClosestField=function(t){var e=acf.findClosestField(t);return this.getField(e)};var e=function(t){var e=t,n=t+"_fields",a=t+"_field",r=function(t){var e=acf.arrayArgs(arguments),i=e.slice(1),a=acf.getFields({parent:t});if(a.length){var r=[n,a].concat(i);acf.doAction.apply(null,r)}},o=function(t){var e=acf.arrayArgs(arguments),i=e.slice(1);t.map(function(t,e){var n=[a,t].concat(i);acf.doAction.apply(null,n)})};acf.addAction(e,r),acf.addAction(n,o),i(t)},i=function(t){var e=t+"_field",i=t+"Field",n=function(n){var a=acf.arrayArgs(arguments),o=a.slice(1);["type","name","key"].map(function(t){var i="/"+t+"="+n.get(t);a=[e+i,n].concat(o),acf.doAction.apply(null,a)}),r.indexOf(t)>-1&&n.trigger(i,o)};acf.addAction(e,n)},n=["prepare","ready","load","append","remove","sortstart","sortstop","show","hide","unload"],a=["valid","invalid","enable","disable","new"],r=["remove","sortstart","sortstop","show","hide","unload","valid","invalid","enable","disable"];n.map(e),a.map(i);var o=new acf.Model({id:"fieldsEventManager",events:{'click .acf-field a[href="#"]':"onClick","change .acf-field":"onChange"},onClick:function(t){t.preventDefault()},onChange:function(){$("#_acf_changed").val(1)}})}(jQuery),function($,t){var e=0,i=acf.Field.extend({type:"accordion",wait:"",$control:function(){return this.$(".acf-fields:first")},initialize:function(){if(!this.$el.is("td")){if(this.get("endpoint"))return this.remove();var t=this.$el,i=this.$labelWrap(),n=this.$inputWrap(),a=this.$control(),r=n.children(".description");if(r.length&&i.append(r),this.$el.is("tr")){var o=this.$el.closest("table"),s=$('<div class="acf-accordion-title"/>'),c=$('<div class="acf-accordion-content"/>'),l=$('<table class="'+o.attr("class")+'"/>'),d=$("<tbody/>");s.append(i.html()),l.append(d),c.append(l),n.append(s),n.append(c),i.remove(),a.remove(),n.attr("colspan",2),i=s,n=c,a=d}t.addClass("acf-accordion"),i.addClass("acf-accordion-title"),n.addClass("acf-accordion-content"),e++,this.get("multi_expand")&&t.attr("multi-expand",1);var u=acf.getPreference("this.accordions")||[];void 0!==u[e-1]&&this.set("open",u[e-1]),this.get("open")&&(t.addClass("-open"),n.css("display","block")),i.prepend('<i class="acf-accordion-icon dashicons dashicons-arrow-'+(this.get("open")?"down":"right")+'"></i>');var f=t.parent();a.addClass(f.hasClass("-left")?"-left":""),a.addClass(f.hasClass("-clear")?"-clear":""),a.append(t.nextUntil(".acf-field-accordion",".acf-field")),a.removeAttr("data-open data-multi_expand data-endpoint")}}});acf.registerFieldType(i);var n=new acf.Model({actions:{unload:"onUnload"},events:{"click .acf-accordion-title":"onClick","invalidField .acf-accordion":"onInvalidField"},isOpen:function(t){return t.hasClass("-open")},toggle:function(t){this.isOpen(t)?this.close(t):this.open(t)},open:function(t){t.find(".acf-accordion-content:first").slideDown().css("display","block"),t.find(".acf-accordion-icon:first").removeClass("dashicons-arrow-right").addClass("dashicons-arrow-down"),t.addClass("-open"),acf.doAction("show",t),t.attr("multi-expand")||t.siblings(".acf-accordion.-open").each(function(){n.close($(this))})},close:function(t){t.find(".acf-accordion-content:first").slideUp(),t.find(".acf-accordion-icon:first").removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right"),t.removeClass("-open"),acf.doAction("hide",t)},onClick:function(t,e){t.preventDefault(),this.toggle(e.parent())},onInvalidField:function(t,e){this.busy||(this.busy=!0,this.setTimeout(function(){this.busy=!1},1e3),this.open(e))},onUnload:function(t){var e=[];$(".acf-accordion").each(function(){var t=$(this).hasClass("-open")?1:0;e.push(t)}),e.length&&acf.setPreference("this.accordions",e)}})}(jQuery),function($,t){var e=acf.Field.extend({type:"button_group",events:{'click input[type="radio"]':"onClick"},$control:function(){return this.$(".acf-button-group")},$input:function(){return this.$("input:checked")},setValue:function(t){
2
+ this.$('input[value="'+t+'"]').prop("checked",!0).trigger("change")},onClick:function(t,e){var i=e.parent("label"),n=i.hasClass("selected");this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"))}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"checkbox",events:{"change input":"onChange","click .acf-add-checkbox":"onClickAdd","click .acf-checkbox-toggle":"onClickToggle","click .acf-checkbox-custom":"onClickCustom"},$control:function(){return this.$(".acf-checkbox-list")},$toggle:function(){return this.$(".acf-checkbox-toggle")},$input:function(){return this.$('input[type="hidden"]')},$inputs:function(){return this.$('input[type="checkbox"]').not(".acf-checkbox-toggle")},getValue:function(){var t=[];return this.$(":checked").each(function(){t.push($(this).val())}),!!t.length&&t},onChange:function(t,e){var i=e.prop("checked"),n=this.$toggle();if(i?e.parent().addClass("selected"):e.parent().removeClass("selected"),n.length){0==this.$inputs().not(":checked").length?n.prop("checked",!0):n.prop("checked",!1)}},onClickAdd:function(t,e){var i='<li><input class="acf-checkbox-custom" type="checkbox" checked="checked" /><input type="text" name="'+this.getInputName()+'[]" /></li>';e.parent("li").before(i)},onClickToggle:function(t,e){var i=e.prop("checked");this.$inputs().prop("checked",i)},onClickCustom:function(t,e){var i=e.prop("checked"),n=e.next('input[type="text"]');i?n.prop("disabled",!1):(n.prop("disabled",!0),""==n.val()&&e.parent("li").remove())}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"color_picker",wait:"load",$control:function(){return this.$(".acf-color-picker")},$input:function(){return this.$('input[type="hidden"]')},$inputText:function(){return this.$('input[type="text"]')},initialize:function(){var t=this.$input(),e=this.$inputText(),i=function(i){setTimeout(function(){acf.val(t,e.val())},1)},n={defaultColor:!1,palettes:!0,hide:!0,change:i,clear:i},n=acf.applyFilters("color_picker_args",n,this);e.wpColorPicker(n)}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"date_picker",events:{'blur input[type="text"]':"onBlur"},$control:function(){return this.$(".acf-date-picker")},$input:function(){return this.$('input[type="hidden"]')},$inputText:function(){return this.$('input[type="text"]')},initialize:function(){if(this.has("save_format"))return this.initializeCompatibility();var t=this.$input(),e=this.$inputText(),i={dateFormat:this.get("date_format"),altField:t,altFormat:"yymmdd",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day")};i=acf.applyFilters("date_picker_args",i,this),acf.newDatePicker(e,i),acf.doAction("date_picker_init",e,i,this)},initializeCompatibility:function(){var t=this.$input(),e=this.$inputText();e.val(t.val());var i={dateFormat:this.get("date_format"),altField:t,altFormat:this.get("save_format"),changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day")};i=acf.applyFilters("date_picker_args",i,this);var n=i.dateFormat;i.dateFormat=this.get("save_format"),acf.newDatePicker(e,i),e.datepicker("option","dateFormat",n),acf.doAction("date_picker_init",e,i,this)},onBlur:function(){this.$inputText().val()||acf.val(this.$input(),"")}});acf.registerFieldType(e);var i=new acf.Model({priority:5,wait:"ready",initialize:function(){var t=acf.get("locale"),e=acf.get("rtl"),i=acf.get("datePickerL10n");return!!i&&(void 0!==$.datepicker&&(i.isRTL=e,$.datepicker.regional[t]=i,void $.datepicker.setDefaults(i)))}});acf.newDatePicker=function(t,e){if(void 0===$.datepicker)return!1;e=e||{},t.datepicker(e),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function($,t){var e=acf.models.DatePickerField.extend({type:"date_time_picker",$control:function(){return this.$(".acf-date-time-picker")},initialize:function(){var t=this.$input(),e=this.$inputText(),i={dateFormat:this.get("date_format"),timeFormat:this.get("time_format"),altField:t,altFieldTimeOnly:!1,altFormat:"yy-mm-dd",altTimeFormat:"HH:mm:ss",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day"),controlType:"select",oneLine:!0};i=acf.applyFilters("date_time_picker_args",i,this),acf.newDateTimePicker(e,i),acf.doAction("date_time_picker_init",e,i,this)}});acf.registerFieldType(e);var i=new acf.Model({priority:5,wait:"ready",initialize:function(){var t=acf.get("locale"),e=acf.get("rtl"),i=acf.get("dateTimePickerL10n");return!!i&&(void 0!==$.timepicker&&(i.isRTL=e,$.timepicker.regional[t]=i,void $.timepicker.setDefaults(i)))}});acf.newDateTimePicker=function(t,e){if(void 0===$.timepicker)return!1;e=e||{},t.datetimepicker(e),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function($,t){var e=acf.Field.extend({type:"google_map",map:!1,wait:"load",events:{'click a[data-name="clear"]':"onClickClear",'click a[data-name="locate"]':"onClickLocate",'click a[data-name="search"]':"onClickSearch","keydown .search":"onKeydownSearch","keyup .search":"onKeyupSearch","focus .search":"onFocusSearch","blur .search":"onBlurSearch",showField:"onShow"},$control:function(){return this.$(".acf-google-map")},$input:function(t){return this.$('input[data-name="'+(t||"address")+'"]')},$search:function(){return this.$(".search")},$canvas:function(){return this.$(".canvas")},addClass:function(t){this.$control().addClass(t)},removeClass:function(t){this.$control().removeClass(t)},getValue:function(){var t={lat:"",lng:"",address:""};return this.$('input[type="hidden"]').each(function(){t[$(this).data("name")]=$(this).val()}),t.lat&&t.lng||(t=!1),t},setValue:function(t){t=acf.parseArgs(t,{lat:"",lng:"",address:""});for(var e in t)acf.val(this.$input(e),t[e]);t.lat&&t.lng||(t=!1),this.renderVal(t)},renderVal:function(t){t?(this.addClass("-value"),this.setPosition(t.lat,t.lng),this.map.marker.setVisible(!0)):(this.removeClass("-value"),this.map.marker.setVisible(!1)),this.$search().val(t.address)},setPosition:function(t,e){var i=this.newLatLng(t,e);return this.map.marker.setPosition(i),this.map.marker.setVisible(!0),acf.doAction("google_map_change",i,this.map,this),this.center(),this},center:function(){var t=this.map.marker.getPosition(),e=this.get("lat"),i=this.get("lng");t&&(e=t.lat(),i=t.lng());var n=this.newLatLng(e,i);this.map.setCenter(n)},getSearchVal:function(){return this.$search().val()},initialize:function(){if(!i.isReady())return void i.ready(this.initializeMap,this);this.initializeMap()},newLatLng:function(t,e){return new google.maps.LatLng(parseFloat(t),parseFloat(e))},initializeMap:function(){var t=this.get("zoom"),e=this.get("lat"),i=this.get("lng"),n={scrollwheel:!1,zoom:parseInt(t),center:this.newLatLng(e,i),mapTypeId:google.maps.MapTypeId.ROADMAP,marker:{draggable:!0,raiseOnDrag:!0},autocomplete:{}};n=acf.applyFilters("google_map_args",n,this);var a=new google.maps.Map(this.$canvas()[0],n);this.addMapEvents(a,this);var r=acf.parseArgs(n.marker,{draggable:!0,raiseOnDrag:!0,map:a});r=acf.applyFilters("google_map_marker_args",r,this);var o=new google.maps.Marker(r);this.addMarkerEvents(o,this),a.acf=this,a.marker=o,this.map=a,acf.doAction("google_map_init",a,o,this);var s=this.getValue();this.renderVal(s)},addMapEvents:function(t,e){if(acf.isset(window,"google","maps","places","Autocomplete")){var i=t.autocomplete||{},n=new google.maps.places.Autocomplete(this.$search()[0],i);n.bindTo("bounds",t),google.maps.event.addListener(n,"place_changed",function(){var t=this.getPlace();t.address=e.getSearchVal(),e.setPlace(t)})}google.maps.event.addListener(t,"click",function(t){var i=t.latLng.lat(),n=t.latLng.lng();e.searchPosition(i,n)})},addMarkerEvents:function(t,e){google.maps.event.addListener(t,"dragend",function(){var t=this.getPosition(),i=t.lat(),n=t.lng();e.searchPosition(i,n)})},searchPosition:function(t,e){var n=this.newLatLng(t,e),a=this.$control();this.setPosition(t,e),a.addClass("-loading");var r=$.proxy(function(i,n){a.removeClass("-loading");var r="";n!=google.maps.GeocoderStatus.OK?console.log("Geocoder failed due to: "+n):i[0]?r=i[0].formatted_address:console.log("No results found"),this.val({lat:t,lng:e,address:r})},this);i.geocoder.geocode({latLng:n},r)},setPlace:function(t){if(!t)return this;if(t.name&&!t.geometry)return this.searchAddress(t.name),this;var e=t.geometry.location.lat(),i=t.geometry.location.lng(),n=t.address||t.formatted_address;return this.setValue({lat:e,lng:i,address:n}),this},searchAddress:function(t){var e=t.split(",");if(2==e.length){var n=e[0],a=e[1];if($.isNumeric(n)&&$.isNumeric(a))return this.searchPosition(n,a)}var r=this.$control();r.addClass("-loading");var o=this.proxy(function(e,i){r.removeClass("-loading");var n="",a="";i!=google.maps.GeocoderStatus.OK?console.log("Geocoder failed due to: "+i):e[0]?(n=e[0].geometry.location.lat(),a=e[0].geometry.location.lng()):console.log("No results found"),this.val({lat:n,lng:a,address:t})});i.geocoder.geocode({address:t},o)},searchLocation:function(){if(!navigator.geolocation)return alert(acf.__("Sorry, this browser does not support geolocation"));var t=this.$control();t.addClass("-loading");var e=$.proxy(function(e,i){t.removeClass("-loading");var n=e.coords.latitude,a=e.coords.longitude;this.searchPosition(n,a)},this),i=function(e){t.removeClass("-loading")};navigator.geolocation.getCurrentPosition(e,i)},onClickClear:function(t,e){this.val(!1)},onClickLocate:function(t,e){this.searchLocation()},onClickSearch:function(t,e){this.searchAddress(this.$search().val())},onFocusSearch:function(t,e){this.removeClass("-value"),this.onKeyupSearch.apply(this,arguments)},onBlurSearch:function(t,e){this.setTimeout(function(){this.removeClass("-search"),e.val()&&this.addClass("-value")},100)},onKeyupSearch:function(t,e){e.val()?this.addClass("-search"):this.removeClass("-search")},onKeydownSearch:function(t,e){13==t.which&&t.preventDefault()},onMousedown:function(){},onShow:function(){if(!this.map)return!1;this.setTimeout(this.center,10)}});acf.registerFieldType(e);var i=new acf.Model({geocoder:!1,data:{status:!1},getStatus:function(){return this.get("status")},setStatus:function(t){return this.set("status",t)},isReady:function(){if("ready"==this.getStatus())return!0;if("loading"==this.getStatus())return!1;if(acf.isset(window,"google","maps","places"))return this.setStatus("ready"),!0;var t=acf.get("google_map_api");return t&&(this.setStatus("loading"),$.ajax({url:t,dataType:"script",cache:!0,context:this,success:function(){this.setStatus("ready"),this.geocoder=new google.maps.Geocoder,acf.doAction("google_map_api_loaded")}})),!1},ready:function(t,e){acf.addAction("google_map_api_loaded",t,10,e)}})}(jQuery),function($,t){var e=acf.Field.extend({type:"image",$control:function(){return this.$(".acf-image-uploader")},$input:function(){return this.$('input[type="hidden"]')},events:{'click a[data-name="add"]':"onClickAdd",'click a[data-name="edit"]':"onClickEdit",'click a[data-name="remove"]':"onClickRemove",'change input[type="file"]':"onChange"},initialize:function(){"basic"===this.get("uploader")&&this.$el.closest("form").attr("enctype","multipart/form-data")},validateAttachment:function(t){t=t||{},void 0!==t.id&&(t=t.attributes),t=acf.parseArgs(t,{url:"",alt:"",title:"",caption:"",description:"",width:0,height:0});var e=acf.isget(t,"sizes",this.get("preview_size"),"url");return null!==e&&(t.url=e),t},render:function(t){t=this.validateAttachment(t),this.$("img").attr({src:t.url,alt:t.alt,title:t.title});var e=t.id||"";this.val(e),e?this.$control().addClass("has-value"):this.$control().removeClass("has-value")},append:function(t,e){var i=function(t,e){for(var i=acf.getFields({key:t.get("key"),parent:e.$el}),n=0;n<i.length;n++)if(!i[n].val())return i[n];return!1},n=i(this,e);n||(e.$(".acf-button:last").trigger("click"),n=i(this,e)),n&&n.render(t)},selectAttachment:function(){var t=this.parent(),e=t&&"repeater"===t.get("type"),i=acf.newMediaPopup({mode:"select",type:"image",title:acf.__("Select Image"),field:this.get("key"),multiple:e,library:this.get("library"),allowedTypes:this.get("mime_types"),select:$.proxy(function(e,i){i>0?this.append(e,t):this.render(e)},this)})},editAttachment:function(){var t=this.val();if(t)var e=acf.newMediaPopup({mode:"edit",title:acf.__("Edit Image"),button:acf.__("Update Image"),attachment:t,field:this.get("key"),select:$.proxy(function(t,e){this.render(t)},this)})},removeAttachment:function(){this.render(!1)},onClickAdd:function(t,e){this.selectAttachment()},onClickEdit:function(t,e){this.editAttachment()},onClickRemove:function(t,e){this.removeAttachment()},onChange:function(t,e){var i=this.$input();acf.getFileInputData(e,function(t){i.val($.param(t))})}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.models.ImageField.extend({type:"file",$control:function(){return this.$(".acf-file-uploader")},$input:function(){return this.$('input[type="hidden"]')},validateAttachment:function(t){return t=t||{},void 0!==t.id&&(t=t.attributes),t=acf.parseArgs(t,{url:"",alt:"",title:"",filename:"",filesizeHumanReadable:"",icon:"/wp-includes/images/media/default.png"})},render:function(t){t=this.validateAttachment(t),this.$("img").attr({src:t.icon,alt:t.alt,title:t.title}),this.$('[data-name="title"]').text(t.title),this.$('[data-name="filename"]').text(t.filename).attr("href",t.url),this.$('[data-name="filesize"]').text(t.filesizeHumanReadable);var e=t.id||"";acf.val(this.$input(),e),e?this.$control().addClass("has-value"):this.$control().removeClass("has-value")},selectAttachment:function(){var t=this.parent(),e=t&&"repeater"===t.get("type"),i=acf.newMediaPopup({mode:"select",title:acf.__("Select File"),field:this.get("key"),multiple:e,library:this.get("library"),allowedTypes:this.get("mime_types"),select:$.proxy(function(e,i){i>0?this.append(e,t):this.render(e)},this)})},editAttachment:function(){var t=this.val();if(!t)return!1;var e=acf.newMediaPopup({mode:"edit",title:acf.__("Edit File"),button:acf.__("Update File"),attachment:t,field:this.get("key"),select:$.proxy(function(t,e){this.render(t)},this)})}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"link",events:{'click a[data-name="add"]':"onClickEdit",'click a[data-name="edit"]':"onClickEdit",'click a[data-name="remove"]':"onClickRemove","change .link-node":"onChange"},$control:function(){return this.$(".acf-link")},$node:function(){return this.$(".link-node")},getValue:function(){var t=this.$node();return!!t.attr("href")&&{title:t.html(),url:t.attr("href"),target:t.attr("target")}},setValue:function(t){t=acf.parseArgs(t,{title:"",url:"",target:""});var e=this.$control(),i=this.$node();e.removeClass("-value -external"),t.url&&e.addClass("-value"),"_blank"===t.target&&e.addClass("-external"),this.$(".link-title").html(t.title),this.$(".link-url").attr("href",t.url).html(t.url),i.html(t.title),i.attr("href",t.url),i.attr("target",t.target),this.$(".input-title").val(t.title),this.$(".input-target").val(t.target),this.$(".input-url").val(t.url).trigger("change")},onClickEdit:function(t,e){acf.wpLink.open(this.$node())},onClickRemove:function(t,e){this.setValue(!1)},onChange:function(t,e){var i=this.getValue();this.setValue(i)}});acf.registerFieldType(e),acf.wpLink=new acf.Model({getNodeValue:function(){var t=this.get("node");return{title:t.html(),url:t.attr("href"),target:t.attr("target")}},setNodeValue:function(t){var e=this.get("node");e.html(t.title),e.attr("href",t.url),e.attr("target",t.target),e.trigger("change")},getInputValue:function(){return{title:$("#wp-link-text").val(),url:$("#wp-link-url").val(),target:$("#wp-link-target").prop("checked")?"_blank":""}},setInputValue:function(t){$("#wp-link-text").val(t.title),$("#wp-link-url").val(t.url),$("#wp-link-target").prop("checked","_blank"===t.target)},open:function(t){this.on("wplink-open","onOpen"),this.on("wplink-close","onClose"),this.set("node",t);var e=$('<textarea id="acf-link-textarea" style="display:none;"></textarea>');$("body").append(e);var i=this.getNodeValue();wpLink.open("acf-link-textarea",i.url,i.title,null)},onOpen:function(){$("#wp-link-wrap").addClass("has-text-field");var t=this.getNodeValue();this.setInputValue(t)},close:function(){wpLink.close()},onClose:function(){if(!this.has("node"))return!1;this.off("wplink-open"),this.off("wplink-close");var t=this.getInputValue();this.setNodeValue(t),$("#acf-link-textarea").remove(),this.set("node",null)}})}(jQuery),function($,t){var e=acf.Field.extend({type:"oembed",events:{'click [data-name="clear-button"]':"onClickClear","keypress .input-search":"onKeypressSearch","keyup .input-search":"onKeyupSearch","change .input-search":"onChangeSearch"},$control:function(){return this.$(".acf-oembed")},$input:function(){return this.$(".input-value")},$search:function(){return this.$(".input-search")},getValue:function(){return this.$input().val()},getSearchVal:function(){return this.$search().val()},setValue:function(t){t?this.$control().addClass("has-value"):this.$control().removeClass("has-value"),acf.val(this.$input(),t)},showLoading:function(t){acf.showLoading(this.$(".canvas"))},hideLoading:function(){acf.hideLoading(this.$(".canvas"))},maybeSearch:function(){var t=this.val(),e=this.getSearchVal();if(!e)return this.clear();if("http"!=e.substr(0,4)&&(e="http://"+e),e!==t){var i=this.get("timeout");i&&clearTimeout(i);var n=$.proxy(this.search,this,e);this.set("timeout",setTimeout(n,300))}},search:function(t){var e={action:"acf/fields/oembed/search",s:t,field_key:this.get("key")},i=this.get("xhr");i&&i.abort(),this.showLoading();var i=$.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(e),type:"post",dataType:"json",context:this,success:function(t){t&&t.html||(t={url:!1,html:""}),this.val(t.url),this.$(".canvas-media").html(t.html)},complete:function(){this.hideLoading()}});this.set("xhr",i)},clear:function(){this.val(""),this.$search().val(""),this.$(".canvas-media").html("")},onClickClear:function(t,e){this.clear()},onKeypressSearch:function(t,e){13==t.which&&(t.preventDefault(),this.maybeSearch())},onKeyupSearch:function(t,e){e.val()&&this.maybeSearch()},onChangeSearch:function(t,e){this.maybeSearch()}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"radio",events:{'click input[type="radio"]':"onClick"},$control:function(){return this.$(".acf-radio-list")},$input:function(){return this.$("input:checked")},$inputText:function(){return this.$('input[type="text"]')},getValue:function(){var t=this.$input().val();return"other"===t&&this.get("other_choice")&&(t=this.$inputText().val()),t},onClick:function(t,e){var i=e.parent("label"),n=i.hasClass("selected"),a=e.val();this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"),a=!1),this.get("other_choice")&&("other"===a?this.$inputText().prop("disabled",!1):this.$inputText().prop("disabled",!0))}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"range",events:{'input input[type="range"]':"onChange","change input":"onChange"},$input:function(){return this.$('input[type="range"]')},$inputAlt:function(){return this.$('input[type="number"]')},setValue:function(t){this.busy=!0,acf.val(this.$input(),t),acf.val(this.$inputAlt(),t,!0),this.busy=!1},onChange:function(t,e){this.busy||this.setValue(e.val())}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"relationship",events:{"keypress [data-filter]":"onKeypressFilter","change [data-filter]":"onChangeFilter","keyup [data-filter]":"onChangeFilter","click .choices-list .acf-rel-item":"onClickAdd",'click [data-name="remove_item"]':"onClickRemove",mouseover:"onHover"},$control:function(){return this.$(".acf-relationship")},$list:function(t){return this.$("."+t+"-list")},$listItems:function(t){return this.$list(t).find(".acf-rel-item")},$listItem:function(t,e){return this.$list(t).find('.acf-rel-item[data-id="'+e+'"]')},getValue:function(){var t=[];return this.$listItems("values").each(function(){t.push($(this).data("id"))}),!!t.length&&t},newChoice:function(t){return["<li>",'<span data-id="'+t.id+'" class="acf-rel-item">'+t.text+"</span>","</li>"].join("")},newValue:function(t){return["<li>",'<input type="hidden" name="'+this.getInputName()+'[]" value="'+t.id+'" />','<span data-id="'+t.id+'" class="acf-rel-item">'+t.text,'<a href="#" class="acf-icon -minus small dark" data-name="remove_item"></a>',"</span>","</li>"].join("")},addSortable:function(t){this.$list("values").sortable({items:"li",forceHelperSize:!0,forcePlaceholderSize:!0,scroll:!0,update:function(){t.$input().trigger("change")}})},initialize:function(){var t=this.proxy(function(t){if(!this.get("loading")&&this.get("more")){var e=this.$list("choices"),i=Math.ceil(e.scrollTop()),n=Math.ceil(e[0].scrollHeight),a=Math.ceil(e.innerHeight()),r=this.get("paged")||1;i+a>=n&&(this.set("paged",r+1),this.fetch())}});this.$list("choices").scrollTop(0).on("scroll",t),this.fetch()},onHover:function(t){$().off(t),this.addSortable(this)},onKeypressFilter:function(t,e){13==t.which&&t.preventDefault()},onChangeFilter:function(t,e){var i=e.val(),n=e.data("filter");this.get(n)!==i&&(this.set(n,i),this.set("paged",1),e.is("select")?this.fetch():this.maybeFetch())},onClickAdd:function(t,e){var i=this.val(),n=parseInt(this.get("max"));if(e.hasClass("disabled"))return!1;if(n>0&&i&&i.length>=n)return this.showNotice({text:acf.__("Maximum values reached ( {max} values )").replace("{max}",n),type:"warning"}),!1;e.addClass("disabled");var a=this.newValue({id:e.data("id"),text:e.html()});this.$list("values").append(a),this.$input().trigger("change")},onClickRemove:function(t,e){var i=e.parent(),n=i.parent(),a=i.data("id");setTimeout(function(){n.remove()},1),this.$listItem("choices",a).removeClass("disabled"),this.$input().trigger("change")},maybeFetch:function(){var t=this.get("timeout");t&&clearTimeout(t),t=this.setTimeout(this.fetch,300),this.set("timeout",t)},getAjaxData:function(){var t=this.$control().data();for(var e in t)t[e]=this.get(e);return t.action="acf/fields/relationship/query",t.field_key=this.get("key"),t},fetch:function(){var t=this.get("xhr");t&&t.abort();var e=this.getAjaxData(),i=this.$list("choices");1==e.paged&&i.html("");var n=$('<li><i class="acf-loading"></i> '+acf.__("Loading")+"</li>");i.append(n),this.set("loading",!0);var a=function(){this.set("loading",!1),n.remove()},r=function(t){if(!t||!t.results||!t.results.length)return this.set("more",!1),void(1==this.get("paged")&&this.$list("choices").append("<li>"+acf.__("No matches found")+"</li>"));this.set("more",t.more);var e=this.walkChoices(t.results),n=$(e),a=this.val();a&&a.length&&a.map(function(t){n.find('.acf-rel-item[data-id="'+t+'"]').addClass("disabled")}),i.append(n);var r=!1,o=!1;i.find(".acf-rel-label").each(function(){var t=$(this),e=t.siblings("ul");if(r&&r.text()==t.text())return o.append(e.children()),void $(this).parent().remove();r=t,o=e})},t=$.ajax({url:acf.get("ajaxurl"),dataType:"json",type:"post",data:acf.prepareForAjax(e),context:this,success:r,complete:a});this.set("xhr",t)},walkChoices:function(t){var e=function(t){var i="";return $.isArray(t)?t.map(function(t){i+=e(t)}):$.isPlainObject(t)&&(void 0!==t.children?(i+='<li><span class="acf-rel-label">'+t.text+'</span><ul class="acf-bl">',i+=e(t.children),i+="</ul></li>"):i+='<li><span class="acf-rel-item" data-id="'+t.id+'">'+t.text+"</span></li>"),i};return e(t)}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"select",select2:!1,wait:"load",events:{removeField:"onRemove"},$input:function(){return this.$("select")},initialize:function(){var t=this.$input();if(this.inherit(t),this.get("ui")){var e=this.get("ajax_action");e||(e="acf/fields/"+this.get("type")+"/query"),this.select2=acf.newSelect2(t,{field:this,ajax:this.get("ajax"),multiple:this.get("multiple"),placeholder:this.get("placeholder"),allowNull:this.get("allow_null"),ajaxAction:e})}},onRemove:function(){this.select2&&this.select2.destroy()}});acf.registerFieldType(e)}(jQuery),function($,t){var e="tab",i=acf.Field.extend({type:"tab",wait:"",tabs:!1,tab:!1,findFields:function(){return this.$el.nextUntil(".acf-field-tab",".acf-field")},getFields:function(){return acf.getFields(this.findFields())},findTabs:function(){return this.$el.prevAll(".acf-tab-wrap:first")},findTab:function(){return this.$(".acf-tab-button")},initialize:function(){if(this.$el.is("td"))return this.events={},!1;var t=this.findTabs(),e=this.findTab(),i=acf.parseArgs(e.data(),{endpoint:!1,placement:"",before:this.$el});!t.length||i.endpoint?this.tabs=new a(i):this.tabs=t.data("acf"),this.tab=this.tabs.addTab(e,this)},isActive:function(){return this.tab.isActive()},showFields:function(){this.getFields().map(function(t){t.show(this.cid,"tab"),t.hiddenByTab=!1},this)},hideFields:function(){this.getFields().map(function(t){t.hide(this.cid,"tab"),t.hiddenByTab=this.tab},this)},show:function(t){var e=acf.Field.prototype.show.apply(this,arguments);return e&&(this.tab.show(),this.tabs.refresh()),e},hide:function(t){var e=acf.Field.prototype.hide.apply(this,arguments);return e&&(this.tab.hide(),this.isActive()&&this.tabs.reset()),e},enable:function(t){this.getFields().map(function(t){t.enable("tab")})},disable:function(t){this.getFields().map(function(t){t.disable("tab")})}});acf.registerFieldType(i);var n=0,a=acf.Model.extend({tabs:[],active:!1,actions:{refresh:"onRefresh"},data:{before:!1,placement:"top",index:0,initialized:!1},setup:function(t){$.extend(this.data,t),this.tabs=[],this.active=!1;var e=this.get("placement"),i=this.get("before"),a=i.parent();"left"==e&&a.hasClass("acf-fields")&&a.addClass("-sidebar"),i.is("tr")?this.$el=$('<tr class="acf-tab-wrap"><td colspan="2"><ul class="acf-hl acf-tab-group"></ul></td></tr>'):this.$el=$('<div class="acf-tab-wrap -'+e+'"><ul class="acf-hl acf-tab-group"></ul></div>'),i.before(this.$el),this.set("index",n,!0),n++},initializeTabs:function(){var t=this.getVisible().shift(),e=acf.getPreference("this.tabs")||[],i=this.get("index"),n=e[i];this.tabs[n]&&this.tabs[n].isVisible()&&(t=this.tabs[n]),t?this.selectTab(t):this.closeTabs(),this.set("initialized",!0)},getVisible:function(){return this.tabs.filter(function(t){return t.isVisible()})},getActive:function(){return this.active},setActive:function(t){return this.active=t},hasActive:function(){return!1!==this.active},isActive:function(t){var e=this.getActive();return e&&e.cid===t.cid},closeActive:function(){this.hasActive()&&this.closeTab(this.getActive())},openTab:function(t){this.closeActive(),t.open(),this.setActive(t)},closeTab:function(t){t.close(),this.setActive(!1)},closeTabs:function(){this.tabs.map(this.closeTab,this)},selectTab:function(t){this.tabs.map(function(e){t.cid!==e.cid&&this.closeTab(e)},this),this.openTab(t)},addTab:function(t,e){var i=$("<li></li>");i.append(t),this.$("ul").append(i);var n=new r({$el:i,field:e,group:this});return this.tabs.push(n),n},reset:function(){return this.closeActive(),this.refresh()},refresh:function(){if(this.hasActive())return!1;var t=this.getVisible().shift();return t&&this.openTab(t),t},onRefresh:function(){if("left"===this.get("placement")){var t=this.$el.parent(),e=this.$el.children("ul"),i=t.is("td")?"height":"min-height",n=e.position().top+e.outerHeight(!0)-1;t.css(i,n)}}}),r=acf.Model.extend({group:!1,field:!1,events:{"click a":"onClick"},index:function(){return this.$el.index()},isVisible:function(){return acf.isVisible(this.$el)},isActive:function(){return this.$el.hasClass("active")},open:function(){this.$el.addClass("active"),this.field.showFields()},close:function(){this.$el.removeClass("active"),this.field.hideFields()},onClick:function(t,e){t.preventDefault(),this.toggle()},toggle:function(){this.isActive()||this.group.openTab(this)}}),o=new acf.Model({priority:50,actions:{prepare:"render",append:"render",unload:"onUnload",invalid_field:"onInvalidField"},findTabs:function(){return $(".acf-tab-wrap")},getTabs:function(){return acf.getInstances(this.findTabs())},render:function(t){this.getTabs().map(function(t){t.get("initialized")||t.initializeTabs()})},onInvalidField:function(t){this.busy||t.hiddenByTab&&(t.hiddenByTab.toggle(),this.busy=!0,this.setTimeout(function(){this.busy=!1},100))},onUnload:function(){var t=[];this.getTabs().map(function(e){var i=e.hasActive()?e.getActive().index():0;t.push(i)}),t.length&&acf.setPreference("this.tabs",t)}})}(jQuery),function($,t){var e=acf.models.SelectField.extend({type:"post_object"});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.models.SelectField.extend({type:"page_link"});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.models.SelectField.extend({type:"user"});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"taxonomy",data:{ftype:"select"},select2:!1,wait:"load",events:{'click a[data-name="add"]':"onClickAdd",'click input[type="radio"]':"onClickRadio"},$control:function(){return this.$(".acf-taxonomy-field")},$input:function(){return this.getRelatedPrototype().$input.apply(this,arguments)},getRelatedType:function(){var t=this.get("ftype");return"multi_select"==t&&(t="select"),t},getRelatedPrototype:function(){return acf.getFieldType(this.getRelatedType()).prototype},getValue:function(){return this.getRelatedPrototype().getValue.apply(this,arguments)},setValue:function(){return this.getRelatedPrototype().setValue.apply(this,arguments)},initialize:function(){this.getRelatedPrototype().initialize.apply(this,arguments)},onRemove:function(){this.select2&&this.select2.destroy()},onClickAdd:function(t,e){var i=this,n=!1,a=!1,r=!1,o=!1,s=!1,c=!1,l=!1,d=function(t){n.loading(!1),n.content(t),a=n.$("form"),r=n.$('input[name="term_name"]'),o=n.$('select[name="term_parent"]'),s=n.$(".acf-submit-button"),r.focus(),n.on("submit","form",u)},u=function(t,e){if(t.preventDefault(),""===r.val())return r.focus(),!1;acf.startButtonLoading(s);var n={action:"acf/fields/taxonomy/add_term",field_key:i.get("key"),term_name:r.val(),term_parent:o.length?o.val():0};$.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(n),type:"post",dataType:"json",success:f})},f=function(t){acf.stopButtonLoading(s),l&&l.remove(),acf.isAjaxSuccess(t)?(r.val(""),h(t.data),l=acf.newNotice({type:"success",text:acf.getAjaxMessage(t),target:a,timeout:2e3,dismiss:!1})):l=acf.newNotice({type:"error",text:acf.getAjaxError(t),target:a,timeout:2e3,dismiss:!1}),r.focus()},h=function(t){var e=$('<option value="'+t.term_id+'">'+t.term_label+"</option>");t.term_parent?o.children('option[value="'+t.term_parent+'"]').after(e):o.append(e),acf.getFields({type:"taxonomy"}).map(function(e){e.get("taxonomy")==i.get("taxonomy")&&e.appendTerm(t)}),i.selectTerm(t.term_id)};!function(){n=acf.newPopup({title:e.attr("title"),loading:!0,width:"300px"});var t={action:"acf/fields/taxonomy/add_term",field_key:i.get("key")};$.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(t),type:"post",dataType:"html",success:d})}()},appendTerm:function(t){"select"==this.getRelatedType()?this.appendTermSelect(t):this.appendTermCheckbox(t)},appendTermSelect:function(t){this.select2.addOption({id:t.term_id,text:t.term_label})},appendTermCheckbox:function(t){var e=this.$("[name]:first").attr("name"),i=this.$("ul:first");"checkbox"==this.getRelatedType()&&(e+="[]");var n=$(['<li data-id="'+t.term_id+'">',"<label>",'<input type="'+this.get("ftype")+'" value="'+t.term_id+'" name="'+e+'" /> ',"<span>"+t.term_name+"</span>","</label>","</li>"].join(""));if(t.term_parent){var a=i.find('li[data-id="'+t.term_parent+'"]');i=a.children("ul"),i.exists()||(i=$('<ul class="children acf-bl"></ul>'),a.append(i))}i.append(n)},selectTerm:function(t){if("select"==this.getRelatedType())this.select2.selectOption(t);else{
3
+ this.$('input[value="'+t+'"]').prop("checked",!0).trigger("change")}},onClickRadio:function(t,e){var i=e.parent("label"),n=i.hasClass("selected");this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"))}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.models.DatePickerField.extend({type:"time_picker",$control:function(){return this.$(".acf-time-picker")},initialize:function(){var t=this.$input(),e=this.$inputText(),i={timeFormat:this.get("time_format"),altField:t,altFieldTimeOnly:!1,altTimeFormat:"HH:mm:ss",showButtonPanel:!0,controlType:"select",oneLine:!0,closeText:acf.get("dateTimePickerL10n").selectText,timeOnly:!0};i.onClose=function(t,e,i){var n=e.dpDiv.find(".ui-datepicker-close");!t&&n.is(":hover")&&i._updateDateTime()},i=acf.applyFilters("time_picker_args",i,this),acf.newTimePicker(e,i),acf.doAction("time_picker_init",e,i,this)}});acf.registerFieldType(e),acf.newTimePicker=function(t,e){if(void 0===$.timepicker)return!1;e=e||{},t.timepicker(e),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function($,t){var e=acf.Field.extend({type:"true_false",events:{"change .acf-switch-input":"onChange","focus .acf-switch-input":"onFocus","blur .acf-switch-input":"onBlur","keypress .acf-switch-input":"onKeypress"},$input:function(){return this.$('input[type="checkbox"]')},$switch:function(){return this.$(".acf-switch")},getValue:function(){return this.$input().prop("checked")?1:0},initialize:function(){this.render()},render:function(){var t=this.$switch();if(t.length){var e=t.children(".acf-switch-on"),i=t.children(".acf-switch-off"),n=Math.max(e.width(),i.width());n&&(e.css("min-width",n),i.css("min-width",n))}},switchOn:function(){this.$input().prop("checked",!0),this.$switch().addClass("-on")},switchOff:function(){this.$input().prop("checked",!1),this.$switch().removeClass("-on")},onChange:function(t,e){e.prop("checked")?this.switchOn():this.switchOff()},onFocus:function(t,e){this.$switch().addClass("-focus")},onBlur:function(t,e){this.$switch().removeClass("-focus")},onKeypress:function(t,e){return 37===t.keyCode?this.switchOff():39===t.keyCode?this.switchOn():void 0}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"url",events:{'keyup input[type="url"]':"onkeyup"},$control:function(){return this.$(".acf-input-wrap")},$input:function(){return this.$('input[type="url"]')},initialize:function(){this.render()},isValid:function(){var t=this.val();return!!t&&(-1!==t.indexOf("://")||0===t.indexOf("//"))},render:function(){this.isValid()?this.$control().addClass("-valid"):this.$control().removeClass("-valid")},onkeyup:function(t,e){this.render()}});acf.registerFieldType(e)}(jQuery),function($,t){var e=acf.Field.extend({type:"wysiwyg",wait:"load",events:{"mousedown .acf-editor-wrap.delay":"onMousedown",sortstartField:"disableEditor",sortstopField:"enableEditor",removeField:"disableEditor"},$control:function(){return this.$(".acf-editor-wrap")},$input:function(){return this.$("textarea")},getMode:function(){return this.$control().hasClass("tmce-active")?"visual":"text"},initialize:function(){this.$control().hasClass("delay")||this.initializeEditor()},initializeEditor:function(){var t=this.$control(),e=this.$input(),i={tinymce:!0,quicktags:!0,toolbar:this.get("toolbar"),mode:this.getMode(),field:this},n=e.attr("id"),a=acf.uniqueId("acf-editor-");acf.rename({target:t,search:n,replace:a,destructive:!0}),this.set("id",a,!0),acf.tinymce.initialize(a,i)},onMousedown:function(t){t.preventDefault();var e=this.$control();e.removeClass("delay"),e.find(".acf-editor-toolbar").remove(),this.initializeEditor()},enableEditor:function(){"visual"==this.getMode()&&acf.tinymce.enable(this.get("id"))},disableEditor:function(){acf.tinymce.destroy(this.get("id"))}});acf.registerFieldType(e)}(jQuery),function($,t){var e=[];acf.Condition=acf.Model.extend({type:"",operator:"==",label:"",choiceType:"input",fieldTypes:[],data:{conditions:!1,field:!1,rule:{}},events:{change:"change",keyup:"change",enableField:"change",disableField:"change"},setup:function(t){$.extend(this.data,t)},getEventTarget:function(t,e){return t||this.get("field").$el},change:function(t,e){this.get("conditions").change(t)},match:function(t,e){return!1},calculate:function(){return this.match(this.get("rule"),this.get("field"))},choices:function(t){return'<intput type="text" />'}}),acf.newCondition=function(t,e){var i=e.get("field"),n=i.getField(t.field);if(!i||!n)return!1;var a={rule:t,target:i,conditions:e,field:n},r=n.get("type"),o=t.operator;return new(acf.getConditionTypes({fieldType:r,operator:o})[0]||acf.Condition)(a)};var i=function(t){return acf.strPascalCase(t||"")+"Condition"};acf.registerConditionType=function(t){var n=t.prototype,a=n.type,r=i(a);acf.models[r]=t,e.push(a)},acf.getConditionType=function(t){var e=i(t);return acf.models[e]||!1},acf.registerConditionForFieldType=function(t,e){var i=acf.getConditionType(t);i&&i.prototype.fieldTypes.push(e)},acf.getConditionTypes=function(t){t=acf.parseArgs(t,{fieldType:"",operator:""});var i=[];return e.map(function(e){var n=acf.getConditionType(e),a=n.prototype.fieldTypes,r=n.prototype.operator;t.fieldType&&-1===a.indexOf(t.fieldType)||t.operator&&r!==t.operator||i.push(n)}),i}}(jQuery),function($,t){var e="conditional_logic",i=new acf.Model({id:"conditionsManager",priority:20,actions:{new_field:"onNewField"},onNewField:function(t){t.has("conditions")&&t.getConditions().render()}}),n=function(t,e){var i=acf.getFields({key:e,sibling:t.$el,suppressFilters:!0});return i.length||(i=acf.getFields({key:e,parent:t.$el.parent(),suppressFilters:!0})),!!i.length&&i[0]};acf.Field.prototype.getField=function(t){var e=n(this,t);if(e)return e;for(var i=this.parents(),a=0;a<i.length;a++)if(e=n(i[a],t))return e;return!1},acf.Field.prototype.getConditions=function(){return this.conditions||(this.conditions=new r(this)),this.conditions};var a=!1,r=acf.Model.extend({id:"Conditions",data:{field:!1,timeStamp:!1,groups:[]},setup:function(t){this.data.field=t;var e=t.get("conditions");e instanceof Array?e[0]instanceof Array?e.map(function(t,e){this.addRules(t,e)},this):this.addRules(e):this.addRule(e)},change:function(t){if(this.get("timeStamp")===t.timeStamp)return!1;this.set("timeStamp",t.timeStamp,!0);var e=this.render()},render:function(){return this.calculate()?this.show():this.hide()},show:function(){return this.get("field").showEnable(this.cid,e)},hide:function(){return this.get("field").hideDisable(this.cid,e)},calculate:function(){var t=!1;return this.getGroups().map(function(e){if(!t){e.filter(function(t){return t.calculate()}).length==e.length&&(t=!0)}}),t},hasGroups:function(){return null!=this.data.groups},getGroups:function(){return this.data.groups},addGroup:function(){var t=[];return this.data.groups.push(t),t},hasGroup:function(t){return null!=this.data.groups[t]},getGroup:function(t){return this.data.groups[t]},removeGroup:function(t){return this.data.groups[t].delete,this},addRules:function(t,e){t.map(function(t){this.addRule(t,e)},this)},addRule:function(t,e){e=e||0;var i;i=this.hasGroup(e)?this.getGroup(e):this.addGroup();var n=acf.newCondition(t,this);if(!n)return!1;i.push(n)},hasRule:function(){},getRule:function(t,e){return t=t||0,e=e||0,this.data.groups[e][t]},removeRule:function(){}})}(jQuery),function($,t){var e=acf.__,i=function(t){return t?""+t:""},n=function(t,e){return i(t).toLowerCase()===i(e).toLowerCase()},a=function(t,e){return parseFloat(t)===parseFloat(e)},r=function(t,e){return parseFloat(t)>parseFloat(e)},o=function(t,e){return parseFloat(t)<parseFloat(e)},s=function(t,e){return e=e.map(function(t){return i(t)}),e.indexOf(t)>-1},c=function(t,e){return i(t).indexOf(i(e))>-1},l=function(t,e){var n=new RegExp(i(e),"gi");return i(t).match(n)},d=acf.Condition.extend({type:"hasValue",operator:"!=empty",label:e("Has any value"),fieldTypes:["text","textarea","number","range","email","url","password","image","file","wysiwyg","oembed","select","checkbox","radio","button_group","link","post_object","page_link","relationship","taxonomy","user","google_map","date_picker","date_time_picker","time_picker","color_picker"],match:function(t,e){return!!e.val()},choices:function(t){return'<input type="text" disabled="" />'}});acf.registerConditionType(d);var u=d.extend({type:"hasNoValue",operator:"==empty",label:e("Has no value"),match:function(t,e){return!d.prototype.match.apply(this,arguments)}});acf.registerConditionType(u);var f=acf.Condition.extend({type:"equalTo",operator:"==",label:e("Value is equal to"),fieldTypes:["text","textarea","number","range","email","url","password"],match:function(t,e){return $.isNumeric(t.value)?a(t.value,e.val()):n(t.value,e.val())},choices:function(t){return'<input type="text" />'}});acf.registerConditionType(f);var h=f.extend({type:"notEqualTo",operator:"!=",label:e("Value is not equal to"),match:function(t,e){return!f.prototype.match.apply(this,arguments)}});acf.registerConditionType(h);var p=acf.Condition.extend({type:"patternMatch",operator:"==pattern",label:e("Value matches pattern"),fieldTypes:["text","textarea","email","url","password","wysiwyg"],match:function(t,e){return l(e.val(),t.value)},choices:function(t){return'<input type="text" placeholder="[a-z0-9]" />'}});acf.registerConditionType(p);var g=acf.Condition.extend({type:"contains",operator:"==contains",label:e("Value contains"),fieldTypes:["text","textarea","number","email","url","password","wysiwyg","oembed","select"],match:function(t,e){return c(e.val(),t.value)},choices:function(t){return'<input type="text" />'}});acf.registerConditionType(g);var m=f.extend({type:"trueFalseEqualTo",choiceType:"select",fieldTypes:["true_false"],choices:function(t){return[{id:1,text:e("Checked")}]}});acf.registerConditionType(m);var v=h.extend({type:"trueFalseNotEqualTo",choiceType:"select",fieldTypes:["true_false"],choices:function(t){return[{id:1,text:e("Checked")}]}});acf.registerConditionType(v);var y=acf.Condition.extend({type:"selectEqualTo",operator:"==",label:e("Value is equal to"),fieldTypes:["select","checkbox","radio","button_group"],match:function(t,e){var i=e.val();return i instanceof Array?s(t.value,i):n(t.value,i)},choices:function(t){var i=[],n=t.$setting("choices textarea").val().split("\n");return t.$input("allow_null").prop("checked")&&i.push({id:"",text:e("Null")}),n.map(function(t){t=t.split(":"),t[1]=t[1]||t[0],i.push({id:$.trim(t[0]),text:$.trim(t[1])})}),i}});acf.registerConditionType(y);var b=y.extend({type:"selectNotEqualTo",operator:"!=",label:e("Value is not equal to"),match:function(t,e){return!y.prototype.match.apply(this,arguments)}});acf.registerConditionType(b);var x=acf.Condition.extend({type:"greaterThan",operator:">",label:e("Value is greater than"),fieldTypes:["number","range"],match:function(t,e){var i=e.val();return i instanceof Array&&(i=i.length),r(i,t.value)},choices:function(t){return'<input type="number" />'}});acf.registerConditionType(x);var _=x.extend({type:"lessThan",operator:"<",label:e("Value is less than"),match:function(t,e){var i=e.val();return i instanceof Array&&(i=i.length),o(i,t.value)},choices:function(t){return'<input type="number" />'}});acf.registerConditionType(_);var w=x.extend({type:"selectionGreaterThan",label:e("Selection is greater than"),fieldTypes:["checkbox","select","post_object","page_link","relationship","taxonomy","user"]});acf.registerConditionType(w);var k=_.extend({type:"selectionLessThan",label:e("Selection is less than"),fieldTypes:["checkbox","select","post_object","page_link","relationship","taxonomy","user"]});acf.registerConditionType(k)}(jQuery),function($,t){acf.newMediaPopup=function(t){var e=null,t=acf.parseArgs(t,{mode:"select",title:"",button:"",type:"",field:!1,allowedTypes:"",library:"all",multiple:!1,attachment:0,autoOpen:!0,open:function(){},select:function(){},close:function(){}});return e="edit"==t.mode?new acf.models.EditMediaPopup(t):new acf.models.SelectMediaPopup(t),t.autoOpen&&setTimeout(function(){e.open()},1),acf.doAction("new_media_popup",e),e};var e=function(){var t=acf.get("post_id");return $.isNumeric(t)?t:0};acf.getMimeTypes=function(){return this.get("mimeTypes")},acf.getMimeType=function(t){var e=acf.getMimeTypes();if(void 0!==e[t])return e[t];for(var i in e)if(-1!==i.indexOf(t))return e[i];return!1};var i=acf.Model.extend({id:"MediaPopup",data:{},defaults:{},frame:!1,setup:function(t){$.extend(this.data,t)},initialize:function(){var t=this.getFrameOptions();this.addFrameStates(t);var e=wp.media(t);e.acf=this,this.addFrameEvents(e,t),this.frame=e},open:function(){this.frame.open()},close:function(){this.frame.close()},remove:function(){this.frame.detach(),this.frame.remove()},getFrameOptions:function(){var t={title:this.get("title"),multiple:this.get("multiple"),library:{},states:[]};return this.get("type")&&(t.library.type=this.get("type")),"uploadedTo"===this.get("library")&&(t.library.uploadedTo=e()),this.get("attachment")&&(t.library.post__in=[this.get("attachment")]),this.get("button")&&(t.button={text:this.get("button")}),t},addFrameStates:function(t){var e=wp.media.query(t.library);this.get("field")&&acf.isset(e,"mirroring","args")&&(e.mirroring.args._acfuploader=this.get("field")),t.states.push(new wp.media.controller.Library({library:e,multiple:this.get("multiple"),title:this.get("title"),priority:20,filterable:"all",editable:!0,allowLocalEdits:!0})),acf.isset(wp,"media","controller","EditImage")&&t.states.push(new wp.media.controller.EditImage)},addFrameEvents:function(t,e){t.on("open",function(){this.$el.closest(".media-modal").addClass("acf-media-modal -"+this.acf.get("mode"))},t),t.on("content:render:edit-image",function(){var t=this.state().get("image"),e=new wp.media.view.EditImage({model:t,controller:this}).render();this.content.set(e),e.loadEditor()},t),t.on("select",function(){var e=t.state().get("selection");e&&e.each(function(e,i){t.acf.get("select").apply(t.acf,[e,i])})}),t.on("close",function(){setTimeout(function(){t.acf.get("close").apply(t.acf),t.acf.remove()},1)})}});acf.models.SelectMediaPopup=i.extend({id:"SelectMediaPopup",setup:function(t){t.button||(t.button=acf._x("Select","verb")),i.prototype.setup.apply(this,arguments)},addFrameEvents:function(t,e){acf.isset(_wpPluploadSettings,"defaults","multipart_params")&&(_wpPluploadSettings.defaults.multipart_params._acfuploader=this.get("field"),t.on("open",function(){delete _wpPluploadSettings.defaults.multipart_params._acfuploader})),t.on("content:activate:browse",function(){var e=!1;try{e=t.content.get().toolbar}catch(t){return void console.log(t)}t.acf.customizeFilters.apply(t.acf,[e])}),i.prototype.addFrameEvents.apply(this,arguments)},customizeFilters:function(t){var e=t.get("filters");if("image"==this.get("type")&&(e.filters.all.text=acf.__("All images"),delete e.filters.audio,delete e.filters.video,delete e.filters.image,$.each(e.filters,function(t,e){e.props.type=e.props.type||"image"})),this.get("allowedTypes")){this.get("allowedTypes").split(" ").join("").split(".").join("").split(",").map(function(t){var i=acf.getMimeType(t);if(i){var n={text:i,props:{status:null,type:i,uploadedTo:null,orderby:"date",order:"DESC"},priority:20};e.filters[i]=n}})}if("uploadedTo"===this.get("library")){var i=this.frame.options.library.uploadedTo;delete e.filters.unattached,delete e.filters.uploaded,$.each(e.filters,function(t,e){e.text+=" ("+acf.__("Uploaded to this post")+")",e.props.uploadedTo=i})}var n=this.get("field");$.each(e.filters,function(t,e){e.props._acfuploader=n}),t.get("search").model.attributes._acfuploader=n,e.renderFilters&&e.renderFilters()}}),acf.models.EditMediaPopup=i.extend({id:"SelectMediaPopup",setup:function(t){t.button||(t.button=acf._x("Update","verb")),i.prototype.setup.apply(this,arguments)},addFrameEvents:function(t,e){t.on("open",function(){this.$el.closest(".media-modal").addClass("acf-expanded"),"browse"!=this.content.mode()&&this.content.mode("browse");var e=this.state(),i=e.get("selection"),n=wp.media.attachment(t.acf.get("attachment"));i.add(n)},t),i.prototype.addFrameEvents.apply(this,arguments)}});var n=new acf.Model({id:"customizePrototypes",wait:"ready",initialize:function(){if(acf.isset(window,"wp","media","view")){var t=e();t&&acf.isset(wp,"media","view","settings","post")&&(wp.media.view.settings.post.id=t),this.customizeAttachmentsRouter(),this.customizeAttachmentFilters(),this.customizeAttachmentCompat(),this.customizeAttachmentLibrary()}},customizeAttachmentsRouter:function(){if(acf.isset(wp,"media","view","Router")){var t=wp.media.view.Router;wp.media.view.Router=t.extend({addExpand:function(){var t=$(['<a href="#" class="acf-expand-details">','<span class="is-closed"><span class="acf-icon -left small grey"></span>'+acf.__("Expand Details")+"</span>",'<span class="is-open"><span class="acf-icon -right small grey"></span>'+acf.__("Collapse Details")+"</span>","</a>"].join(""));t.on("click",function(t){t.preventDefault();var e=$(this).closest(".media-modal");e.hasClass("acf-expanded")?e.removeClass("acf-expanded"):e.addClass("acf-expanded")}),this.$el.append(t)},initialize:function(){return t.prototype.initialize.apply(this,arguments),this.addExpand(),this}})}},customizeAttachmentFilters:function(){if(acf.isset(wp,"media","view","AttachmentFilters","All")){wp.media.view.AttachmentFilters.All.prototype.renderFilters=function(){this.$el.html(_.chain(this.filters).map(function(t,e){return{el:$("<option></option>").val(e).html(t.text)[0],priority:t.priority||50}},this).sortBy("priority").pluck("el").value())}}},customizeAttachmentCompat:function(){if(acf.isset(wp,"media","view","AttachmentCompat")){var t=wp.media.view.AttachmentCompat,e=!1;wp.media.view.AttachmentCompat=t.extend({render:function(){return this.rendered?this:(t.prototype.render.apply(this,arguments),this.$("#acf-form-data").length?(clearTimeout(e),e=setTimeout($.proxy(function(){this.rendered=!0,acf.doAction("append",this.$el)},this),50),this):this)}})}},customizeAttachmentLibrary:function(){if(acf.isset(wp,"media","view","Attachment","Library")){var t=wp.media.view.Attachment.Library;wp.media.view.Attachment.Library=t.extend({render:function(){var e=acf.isget(this,"controller","acf"),i=acf.isget(this,"model","attributes");if(e&&i){i.acf_errors&&this.$el.addClass("acf-disabled");var n=e.get("selected");n&&n.indexOf(i.id)>-1&&this.$el.addClass("acf-selected")}return t.prototype.render.apply(this,arguments)},toggleSelection:function(e){var i=this.collection,n=this.options.selection,a=this.model,r=n.single(),o=this.controller,s=acf.isget(this,"model","attributes","acf_errors"),c=o.$el.find(".media-frame-content .media-sidebar");if(c.children(".acf-selection-error").remove(),c.children().removeClass("acf-hidden"),o&&s){var l=acf.isget(this,"model","attributes","filename");return c.children().addClass("acf-hidden"),c.prepend(['<div class="acf-selection-error">','<span class="selection-error-label">'+acf.__("Restricted")+"</span>",'<span class="selection-error-filename">'+l+"</span>",'<span class="selection-error-message">'+s+"</span>","</div>"].join("")),n.reset(),void n.single(a)}return t.prototype.toggleSelection.apply(this,arguments)}})}}})}(jQuery),function($,t){acf.screen=new acf.Model({active:!0,xhr:!1,timeout:!1,wait:"load",events:{"change #page_template":"onChange","change #parent_id":"onChange","change #post-formats-select":"onChange","change .categorychecklist":"onChange","change .tagsdiv":"onChange",'change .acf-taxonomy-field[data-save="1"]':"onChange","change #product-type":"onChange"},initialize:function(){},isPost:function(){return"post"===acf.get("screen")},isUser:function(){return"user"===acf.get("screen")},isTaxonomy:function(){return"taxonomy"===acf.get("screen")},isAttachment:function(){return"attachment"===acf.get("screen")},isNavMenu:function(){return"nav_menu"===acf.get("screen")},isWidget:function(){return"widget"===acf.get("screen")},isComment:function(){return"comment"===acf.get("screen")},getPageTemplate:function(){var t=$("#page_template");return t.length?t.val():null},getPageParent:function(t,e){var e=$("#parent_id");return e.length?e.val():null},getPageType:function(t,e){return this.getPageParent()?"child":"parent"},getPostFormat:function(t,e){var e=$("#post-formats-select input:checked");if(e.length){var i=e.val();return"0"==i?"standard":i}return null},getPostTerms:function(){var t={},e=acf.serialize($(".categorydiv, .tagsdiv"));e.tax_input&&(t=e.tax_input),e.post_category&&(t.category=e.post_category);for(var i in t)acf.isArray(t[i])||(t[i]=t[i].split(", "));acf.getFields({type:"taxonomy"}).map(function(e){if(e.get("save")){var i=e.val(),n=e.get("taxonomy");i&&(t[n]=t[n]||[],i=acf.isArray(i)?i:[i],t[n]=t[n].concat(i))}}),null!==(productType=this.getProductType())&&(t.product_type=[productType]);for(var i in t)t[i]=acf.uniqueArray(t[i]);return t},getProductType:function(){var t=$("#product-type");return t.length?t.val():null},check:function(){if("post"===acf.get("screen")){this.xhr&&this.xhr.abort();var t=acf.parseArgs(this.data,{action:"acf/ajax/check_screen",screen:acf.get("screen"),exclude:[]});this.isPost()&&(t.post_id=acf.get("post_id")),null!==(pageTemplate=this.getPageTemplate())&&(t.page_template=pageTemplate),null!==(pageParent=this.getPageParent())&&(t.page_parent=pageParent),null!==(pageType=this.getPageType())&&(t.page_type=pageType),null!==(postFormat=this.getPostFormat())&&(t.post_format=postFormat),null!==(postTerms=this.getPostTerms())&&(t.post_terms=postTerms),$(".acf-postbox").not(".acf-hidden").each(function(){t.exclude.push($(this).attr("id").substr(4))});var e=function(t){acf.isAjaxSuccess(t)&&($(".acf-postbox").addClass("acf-hidden"),$(".acf-postbox-toggle").addClass("acf-hidden"),$("#acf-style").html(""),t.data.map(function(t,e){var i=$("#acf-"+t.key),n=$("#acf-"+t.key+"-hide"),a=n.parent();i.removeClass("acf-hidden hide-if-js").show(),a.removeClass("acf-hidden hide-if-js").show(),n.prop("checked",!0);var r=i.find(".acf-replace-with-fields");r.exists()&&(r.replaceWith(t.html),acf.doAction("append",i)),0===e&&$("#acf-style").html(t.style),acf.enable(i,"postbox")}))},i=function(t){$(".acf-postbox.acf-hidden").each(function(){acf.disable($(this),"postbox")})};this.xhr=$.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(t),type:"post",dataType:"json",context:this,success:e,complete:i})}},onChange:function(t,e){this.setTimeout(this.check,1)}})}(jQuery),function($,t){function e(){return acf.isset(window,"jQuery","fn","select2","amd")?4:!!acf.isset(window,"Select2")&&3}acf.newSelect2=function(t,i){if(i=acf.parseArgs(i,{allowNull:!1,placeholder:"",multiple:!1,field:!1,ajax:!1,ajaxAction:"",ajaxData:function(t){return t},ajaxResults:function(t){return t}}),4==e())var r=new n(t,i);else var r=new a(t,i);return acf.doAction("new_select2",r),r};var i=acf.Model.extend({setup:function(t,e){$.extend(this.data,e),this.$el=t},initialize:function(){},selectOption:function(t){var e=this.getOption(t);e.prop("selected")||e.prop("selected",!0).trigger("change")},unselectOption:function(t){var e=this.getOption(t);e.prop("selected")&&e.prop("selected",!1).trigger("change")},getOption:function(t){return this.$('option[value="'+t+'"]')},addOption:function(t){t=acf.parseArgs(t,{id:"",text:"",selected:!1});var e=this.getOption(t.id);return e.length||(e=$("<option></option>"),e.html(t.text),e.attr("value",t.id),e.prop("selected",t.selected),this.$el.append(e)),e},getValue:function(){var t=[],e=this.$el.find("option:selected");return e.exists()?(e=e.sort(function(t,e){return+t.getAttribute("data-i")-+e.getAttribute("data-i")}),e.each(function(){var e=$(this);t.push({$el:e,id:e.attr("value"),text:e.text()})}),t):t},mergeOptions:function(){},getChoices:function(){var t=function(e){var i=[];return e.children().each(function(){var e=$(this);e.is("optgroup")?i.push({text:e.attr("label"),children:t(e)}):i.push({id:e.attr("value"),text:e.text()})}),i};return t(this.$el)},decodeChoices:function(t){var e=function(t){return t.map(function(t){return t.text=acf.decode(t.text),t.children&&(t.children=e(t.children)),t}),t};return e(t)},getAjaxData:function(t){var e={action:this.get("ajaxAction"),s:t.term||"",paged:t.page||1},i=this.get("field");i&&(e.field_key=i.get("key"));var n=this.get("ajaxData");return n&&(e=n.apply(this,[e,t])),e=acf.applyFilters("select2_ajax_data",e,this.data,this.$el,i||!1,this),acf.prepareForAjax(e)},getAjaxResults:function(t,e){t=acf.parseArgs(t,{results:!1,more:!1}),t.results&&(t.results=this.decodeChoices(t.results));var i=this.get("ajaxResults");return i&&(t=i.apply(this,[t,e])),t=acf.applyFilters("select2_ajax_results",t,e,this)},processAjaxResults:function(t,e){var t=this.getAjaxResults(t,e);return t.more&&(t.pagination={more:!0}),setTimeout($.proxy(this.mergeOptions,this),1),t},destroy:function(){this.$el.data("select2")&&this.$el.select2("destroy"),this.$el.siblings(".select2-container").remove()}}),n=i.extend({initialize:function(){var t=this.$el,e={width:"100%",allowClear:this.get("allowNull"),placeholder:this.get("placeholder"),multiple:this.get("multiple"),data:[],escapeMarkup:function(t){return t}};e.multiple&&this.getValue().map(function(e){e.$el.detach().appendTo(t)}),t.removeData("ajax"),t.removeAttr("data-ajax"),this.get("ajax")&&(e.ajax={url:acf.get("ajaxurl"),delay:250,dataType:"json",type:"post",cache:!1,data:$.proxy(this.getAjaxData,this),processResults:$.proxy(this.processAjaxResults,this)});var i=this.get("field");e=acf.applyFilters("select2_args",e,t,this.data,i||!1,this),t.select2(e);var n=t.next(".select2-container");if(e.multiple){var a=n.find("ul");a.sortable({stop:function(e){a.find(".select2-selection__choice").each(function(){$($(this).data("data").element).detach().appendTo(t)}),t.trigger("change")}}),t.on("select2:select",this.proxy(function(t){this.getOption(t.params.data.id).detach().appendTo(this.$el)}))}n.addClass("-acf"),acf.doAction("select2_init",t,e,this.data,i||!1,this)},mergeOptions:function(){var t=!1,e=!1;$('.select2-results__option[role="group"]').each(function(){var i=$(this).children("ul"),n=$(this).children("strong");if(e&&e.text()===n.text())return t.append(i.children()),void $(this).remove();t=i,e=n})}}),a=i.extend({initialize:function(){var t=this.$el,e=this.getValue(),i=this.get("multiple"),n={width:"100%",allowClear:this.get("allowNull"),placeholder:this.get("placeholder"),separator:"||",multiple:this.get("multiple"),data:this.getChoices(),escapeMarkup:function(t){return t},dropdownCss:{"z-index":"999999999"},initSelection:function(t,n){n(i?e:e.shift())}},a=t.siblings("input");a.length||(a=$('<input type="hidden" />'),t.before(a)),inputValue=e.map(function(t){return t.id}).join("||"),a.val(inputValue),n.multiple&&e.map(function(e){e.$el.detach().appendTo(t)}),n.allowClear&&(n.data=n.data.filter(function(t){return""!==t.id})),t.removeData("ajax"),t.removeAttr("data-ajax"),this.get("ajax")&&(n.ajax={url:acf.get("ajaxurl"),quietMillis:250,dataType:"json",type:"post",cache:!1,data:$.proxy(this.getAjaxData,this),results:$.proxy(this.processAjaxResults,this)});var r=this.get("field");n=acf.applyFilters("select2_args",n,t,this.data,r||!1,this),a.select2(n);var o=a.select2("container"),s=$.proxy(this.getOption,this);if(n.multiple){var c=o.find("ul");c.sortable({stop:function(){c.find(".select2-search-choice").each(function(){var e=$(this).data("select2Data");s(e.id).detach().appendTo(t)}),t.trigger("change")}})}a.on("select2-selecting",function(e){var i=e.choice,n=s(i.id);n.length||(n=$('<option value="'+i.id+'">'+i.text+"</option>")),n.detach().appendTo(t)}),o.addClass("-acf"),acf.doAction("select2_init",t,n,this.data,r||!1,this),a.on("change",function(){var e=a.val();e.indexOf("||")&&(e=e.split("||")),t.val(e).trigger("change")}),t.hide()},mergeOptions:function(){var t=!1,e=!1;$("#select2-drop .select2-result-with-children").each(function(){var i=$(this).children("ul"),n=$(this).children(".select2-result-label");if(e&&e.text()===n.text())return e.append(i.children()),void $(this).remove();t=i,e=n})},getAjaxData:function(t,e){var n={term:t,page:e};return i.prototype.getAjaxData.apply(this,[n])}}),r=new acf.Model({priority:5,wait:"prepare",initialize:function(){var t=acf.get("locale"),i=acf.get("rtl"),n=acf.get("select2L10n"),a=e();return!!n&&(0!==t.indexOf("en")&&void(4==a?this.addTranslations4():3==a&&this.addTranslations3()))},addTranslations4:function(){var t=acf.get("select2L10n"),e=acf.get("locale");e=e.replace("_","-");var i={errorLoading:function(){return t.load_fail},inputTooLong:function(e){var i=e.input.length-e.maximum;return i>1?t.input_too_long_n.replace("%d",i):t.input_too_long_1},inputTooShort:function(e){var i=e.minimum-e.input.length;return i>1?t.input_too_short_n.replace("%d",i):t.input_too_short_1},loadingMore:function(){return t.load_more},maximumSelected:function(e){var i=e.maximum;return i>1?t.selection_too_long_n.replace("%d",i):t.selection_too_long_1},noResults:function(){return t.matches_0},searching:function(){return t.searching}};jQuery.fn.select2.amd.define("select2/i18n/"+e,[],function(){return i})},addTranslations3:function(){var t=acf.get("select2L10n"),e=acf.get("locale");e=e.replace("_","-");var i={formatMatches:function(e){return e>1?t.matches_n.replace("%d",e):t.matches_1},formatNoMatches:function(){return t.matches_0},formatAjaxError:function(){return t.load_fail},formatInputTooShort:function(e,i){var n=i-e.length;return n>1?t.input_too_short_n.replace("%d",n):t.input_too_short_1},formatInputTooLong:function(e,i){var n=e.length-i;return n>1?t.input_too_long_n.replace("%d",n):t.input_too_long_1},formatSelectionTooBig:function(e){return e>1?t.selection_too_long_n.replace("%d",e):t.selection_too_long_1},formatLoadMore:function(){return t.load_more},formatSearching:function(){return t.searching}};$.fn.select2.locales=$.fn.select2.locales||{},$.fn.select2.locales[e]=i,$.extend($.fn.select2.defaults,i)}})}(jQuery),function($,t){acf.tinymce={defaults:function(){return"undefined"!=typeof tinyMCEPreInit&&{tinymce:tinyMCEPreInit.mceInit.acf_content,quicktags:tinyMCEPreInit.qtInit.acf_content}},initialize:function(t,e){e=acf.parseArgs(e,{tinymce:!0,quicktags:!0,toolbar:"full",mode:"visual",field:!1}),e.tinymce&&this.initializeTinymce(t,e),e.quicktags&&this.initializeQuicktags(t,e)},initializeTinymce:function(t,e){var i=$("#"+t),n=this.defaults(),a=acf.get("toolbars"),r=e.field||!1,o=r.$el||!1;if("undefined"==typeof tinymce)return!1;if(!n)return!1;if(tinymce.get(t))return this.enable(t);var s=$.extend({},n.tinymce,e.tinymce);s.id=t,s.selector="#"+t;var c=e.toolbar;if(c&&a&&a[c])for(var l=1;l<=4;l++)s["toolbar"+l]=a[c][l]||"";if(s.setup=function(e){e.on("change",function(t){e.save(),i.trigger("change")}),$(e.getWin()).on("unload",function(){acf.tinymce.remove(t)})},s.wp_autoresize_on=!1,s=acf.applyFilters("wysiwyg_tinymce_settings",s,t,r),tinyMCEPreInit.mceInit[t]=s,"visual"==e.mode){var d=tinymce.init(s),u=tinymce.get(t);if(!u)return!1;u.acf=e.field,acf.doAction("wysiwyg_tinymce_init",u,u.id,s,r)}},initializeQuicktags:function(t,e){var i=this.defaults();if("undefined"==typeof quicktags)return!1;if(!i)return!1;var n=$.extend({},i.quicktags,e.quicktags);n.id=t;var a=e.field||!1,r=a.$el||!1;n=acf.applyFilters("wysiwyg_quicktags_settings",n,n.id,a),tinyMCEPreInit.qtInit[t]=n;var o=quicktags(n);if(!o)return!1;this.buildQuicktags(o),acf.doAction("wysiwyg_quicktags_init",o,o.id,n,a)},buildQuicktags:function(t){var e,i,n,a,r,t,o,s,c,l,d=",strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,";e=t.canvas,i=t.name,n=t.settings,r="",a={},c="",l=t.id,n.buttons&&(c=","+n.buttons+",");for(s in edButtons)edButtons[s]&&(o=edButtons[s].id,c&&-1!==d.indexOf(","+o+",")&&-1===c.indexOf(","+o+",")||edButtons[s].instance&&edButtons[s].instance!==l||(a[o]=edButtons[s],edButtons[s].html&&(r+=edButtons[s].html(i+"_"))));c&&-1!==c.indexOf(",dfw,")&&(a.dfw=new QTags.DFWButton,r+=a.dfw.html(i+"_")),
4
+ "rtl"===document.getElementsByTagName("html")[0].dir&&(a.textdirection=new QTags.TextDirectionButton,r+=a.textdirection.html(i+"_")),t.toolbar.innerHTML=r,t.theButtons=a,"undefined"!=typeof jQuery&&jQuery(document).triggerHandler("quicktags-init",[t])},disable:function(t){this.destroyTinymce(t)},remove:function(t){this.destroyTinymce(t)},destroy:function(t){this.destroyTinymce(t)},destroyTinymce:function(t){if("undefined"==typeof tinymce)return!1;var e=tinymce.get(t);return!!e&&(e.save(),e.destroy(),!0)},enable:function(t){this.enableTinymce(t)},enableTinymce:function(t){return"undefined"!=typeof switchEditors&&(void 0!==tinyMCEPreInit.mceInit[t]&&(switchEditors.go(t,"tmce"),!0))}};var e=new acf.Model({priority:5,actions:{prepare:"onPrepare",ready:"onReady"},onPrepare:function(){var t=$("#acf-hidden-wp-editor");t.exists()&&t.appendTo("body")},onReady:function(){acf.isset(window,"tinymce","on")&&tinymce.on("AddEditor",function(t){var e=t.editor;"acf"===e.id.substr(0,3)&&(e=tinymce.editors.content||e,tinymce.activeEditor=e,wpActiveEditor=e.id)})}})}(jQuery),function($,t){acf.validation=new acf.Model({active:!0,ignore:!1,errors:[],form:!1,wait:"prepare",actions:{ready:"addInputEvents",append:"addInputEvents"},events:{'click input[type="submit"]':"onClickSubmit",'click button[type="submit"]':"onClickSubmit","click #save-post":"onClickSave","submit form":"onSubmit"},initialize:function(){acf.get("validation")||(this.disable(),this.actions={},this.events={})},getForm:function(t){var i=t.data("acf");return i||(i=new e(t)),this.form=i,i},enable:function(){this.active=!0},disable:function(){this.active=!1},pass:function(){this.ignore=!0,this.setTimeout(function(){this.ignore=!1},100)},reset:function(){this.ignore=!1,this.errors=[],this.form=!1},getErrors:function(){return this.errors},hasErrors:function(){return this.errors.length},addErrors:function(t){t.map(this.addError,this)},addError:function(t){this.errors.push(t)},getFieldErrors:function(){var t=[],e=[];return this.getErrors().map(function(i){if(i.input){var n=e.indexOf(i.input);n>-1?t[n]=i:(t.push(i),e.push(i.input))}}),t},getGlobalErrors:function(){return this.getErrors().filter(function(t){return!t.input})},showErrors:function(t){if(this.hasErrors()){var e=this.getForm(t),i=this.getFieldErrors(),n=this.getGlobalErrors(),a=0,r=!1;i.map(function(e){var i=t.find('[name="'+e.input+'"]').first();if(i.exists()||(i=t.find('[name^="'+e.input+'"]').first()),i.exists()){a++;var n=acf.getClosestField(i);n.showError(e.message),r||(r=n.$el)}},this);var o=acf.__("Validation failed");1==a?o+=". "+acf.__("1 field requires attention"):a>1&&(o+=". "+acf.__("%d fields require attention").replace("%d",a)),e.notice?e.notice.update({type:"error",text:o}):e.notice=acf.newNotice({type:"error",text:o,target:t}),r||(r=e.notice.$el),setTimeout(function(){$("html, body").animate({scrollTop:r.offset().top-$(window).height()/2},500)},10)}},fetch:function(t){if(!this.busy){this.busy=1,t=acf.parseArgs(t,{form:!1,event:!1,lock:!0,loading:function(){},complete:function(){},failure:function(){},success:function(t){t.submit()}});var e=t.form,i=this.getForm(e);if(t.event){var n=$.Event(null,t.event);t.success=function(){$(n.target).trigger(n)}}acf.doAction("validation_begin",e);var a=acf.serialize(e);a.action="acf/validate_save_post",this.lockForm(e),t.loading(e);var r=function(t){acf.isAjaxSuccess(t)&&(a=acf.applyFilters("validation_complete",t.data,e),a.valid||this.addErrors(a.errors))},o=function(){this.busy=0,this.unlockForm(e),this.hasErrors()?(acf.doAction("validation_failure",e),this.showErrors(e),t.failure(e)):(this.pass(),i.notice&&i.notice.update({type:"success",text:acf.__("Validation successful"),timeout:1e3}),acf.doAction("validation_success",e),acf.doAction("submit",e),t.success(e),t.lock&&this.lockForm(e)),this.reset(),t.complete(e)};$.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(a),type:"post",dataType:"json",context:this,success:r,complete:o})}},addInputEvents:function(t){var e=$(".acf-field [name]",t);e.length&&this.on(e,"invalid","onInvalid")},onInvalid:function(t,e){var i=e.closest("form");this.addError({input:e.attr("name"),message:t.target.validationMessage}),t.preventDefault(),i.submit()},onClickSubmit:function(t,e){this.set("originalEvent",t)},onClickSave:function(t,e){this.pass()},onSubmit:function(t,e){acf.validateForm({form:e,event:this.get("originalEvent")})||t.preventDefault()},showSpinner:function(t){t.addClass("is-active"),t.css("display","inline-block")},hideSpinner:function(t){t.removeClass("is-active"),t.css("display","none")},disableSubmit:function(t){t.prop("disabled",!0).addClass("disabled")},enableSubmit:function(t){t.prop("disabled",!1).removeClass("disabled")},findSubmitWrap:function(t){var e=$("#submitdiv");if(e.length)return e;var e=$("#submitpost");if(e.length)return e;var e=t.find("p.submit").last();if(e.length)return e;var e=t.find(".acf-form-submit");return e.length?e:t},lockForm:function(t){var e=this.findSubmitWrap(t),i=e.find('.button, [type="submit"]'),n=e.find(".spinner, .acf-spinner");this.hideSpinner(n),this.disableSubmit(i),this.showSpinner(n.last())},unlockForm:function(t){var e=this.findSubmitWrap(t),i=e.find('.button, [type="submit"]'),n=e.find(".spinner, .acf-spinner");this.enableSubmit(i),this.hideSpinner(n)}});var e=acf.Model.extend({notice:!1,setup:function(t){this.$el=t},lock:function(){acf.validation.lockForm(this.$el)},unlock:function(){acf.validation.unlockForm(this.$el)}});acf.validateForm=function(t){if(!t.form)return!0;var e=acf.validation.getForm(t.form);return!acf.validation.active||(!!acf.validation.ignore||(e.$("#wp-preview").val()?(e.unlock(),!0):!e.$("#acf-form-data").length||(acf.validation.fetch(t),!1)))}}(jQuery),function($,t){var e=new acf.Model({priority:90,timeout:0,actions:{new_field:"refresh",show_field:"refresh",hide_field:"refresh",remove_field:"refresh"},refresh:function(){clearTimeout(this.timeout),this.timeout=setTimeout(function(){acf.doAction("refresh")},0)}}),i=new acf.Model({actions:{sortstart:"onSortstart"},onSortstart:function(t,e){t.is("tr")&&(t.css("position","relative"),t.children().each(function(){$(this).width($(this).width())}),t.css("position","absolute"),e.html('<td style="height:'+t.height()+'px; padding:0;" colspan="'+t.children("td").length+'"></td>'))}}),n=new acf.Model({actions:{after_duplicate:"onAfterDuplicate"},onAfterDuplicate:function(t,e){var i=[];t.find("select").each(function(t){i.push($(this).val())}),e.find("select").each(function(t){$(this).val(i[t])})}}),a=new acf.Model({id:"tableHelper",priority:20,actions:{refresh:"renderTables"},renderTables:function(t){var e=this;$(".acf-table:visible").each(function(){e.renderTable($(this))})},renderTable:function(t){var e=t.find("> thead > tr:visible > th[data-key]"),i=t.find("> tbody > tr:visible > td[data-key]");if(!e.length||!i.length)return!1;e.each(function(t){var e=$(this),n=e.data("key"),a=i.filter('[data-key="'+n+'"]'),r=a.filter(".acf-hidden");a.removeClass("acf-empty"),a.length===r.length?acf.hide(e):(acf.show(e),r.addClass("acf-empty"))}),e.css("width","auto"),e=e.not(".acf-hidden");var n=100,a=e.length;e.filter("[data-width]").each(function(){var t=$(this).data("width");$(this).css("width",t+"%"),n-=t});var r=e.not("[data-width]");if(r.length){var o=n/r.length;r.css("width",o+"%"),n=0}n>0&&e.last().css("width","auto"),i.filter(".-collapsed-target").each(function(){var t=$(this);t.parent().hasClass("-collapsed")?t.attr("colspan",e.length):t.removeAttr("colspan")})}}),r=new acf.Model({id:"fieldsHelper",priority:30,actions:{refresh:"renderGroups"},renderGroups:function(){var t=this;$(".acf-fields:visible").each(function(){t.renderGroup($(this))})},renderGroup:function(t){var e=0,i=0,n=$(),a=t.children(".acf-field[data-width]:visible");return!!a.length&&(t.hasClass("-left")?(a.removeAttr("data-width"),a.css("width","auto"),!1):(a.removeClass("-r0 -c0").css({"min-height":0}),a.each(function(t){var a=$(this),r=a.position(),o=Math.ceil(r.top),s=Math.ceil(r.left);n.length&&o>e&&(n.css({"min-height":i+"px"}),r=a.position(),o=Math.ceil(r.top),s=Math.ceil(r.left),e=0,i=0,n=$()),acf.get("rtl")&&(s=Math.ceil(a.parent().width()-(r.left+a.outerWidth()))),0==o?a.addClass("-r0"):0==s&&a.addClass("-c0");var c=Math.ceil(a.outerHeight())+1;i=Math.max(i,c),e=Math.max(e,o),n=n.add(a)}),void(n.length&&n.css({"min-height":i+"px"}))))}})}(jQuery),function($,t){acf.newCompatibility=function(t,e){return e=e||{},e.__proto__=t.__proto__,t.__proto__=e,t.compatibility=e,e},acf.getCompatibility=function(t){return t.compatibility||null};var e=acf.newCompatibility(acf,{l10n:{},o:{},fields:{},update:acf.set,add_action:acf.addAction,remove_action:acf.removeAction,do_action:acf.doAction,add_filter:acf.addFilter,remove_filter:acf.removeFilter,apply_filters:acf.applyFilters,parse_args:acf.parseArgs,disable_el:acf.disable,disable_form:acf.disable,enable_el:acf.enable,enable_form:acf.enable,update_user_setting:acf.updateUserSetting,prepare_for_ajax:acf.prepareForAjax,is_ajax_success:acf.isAjaxSuccess,remove_el:acf.remove,remove_tr:acf.remove,str_replace:acf.strReplace,render_select:acf.renderSelect,get_uniqid:acf.uniqid,serialize_form:acf.serialize,esc_html:acf.strEscape,str_sanitize:acf.strSanitize});e._e=function(t,e){t=t||"",e=e||"";var i=e?t+"."+e:t,n={"image.select":"Select Image","image.edit":"Edit Image","image.update":"Update Image"};if(n[i])return acf.__(n[i]);var a=this.l10n[t]||"";return e&&(a=a[e]||""),a},e.get_selector=function(t){var e=".acf-field";if(!t)return e;if($.isPlainObject(t)){if($.isEmptyObject(t))return e;for(var i in t){t=t[i];break}}return e+="-"+t,e=acf.strReplace("_","-",e),e=acf.strReplace("field-field-","field-",e)},e.get_fields=function(t,e,i){var n={is:t||"",parent:e||!1,suppressFilters:i||!1};return n.is&&(n.is=this.get_selector(n.is)),acf.findFields(n)},e.get_field=function(t,e){var i=this.get_fields.apply(this,arguments);return!!i.length&&i.first()},e.get_closest_field=function(t,e){return t.closest(this.get_selector(e))},e.get_field_wrap=function(t){return t.closest(this.get_selector())},e.get_field_key=function(t){return t.data("key")},e.get_field_type=function(t){return t.data("type")},e.get_data=function(t,e){return acf.parseArgs(t.data(),e)},e.maybe_get=function(t,e,i){void 0===i&&(i=null),keys=String(e).split(".");for(var n=0;n<keys.length;n++){if(!t.hasOwnProperty(keys[n]))return i;t=t[keys[n]]}return t};var i=function(t){return t instanceof acf.Field?t.$el:t},n=function(t){return acf.arrayArgs(t).map(i)},a=function(t){return function(){if(arguments.length)var e=n(arguments);else var e=[$(document)];return t.apply(this,e)}};e.add_action=function(t,i,n,r){var o=t.split(" "),s=o.length;if(s>1){for(var c=0;c<s;c++)t=o[c],e.add_action.apply(this,arguments);return this}var i=a(i);return acf.addAction.apply(this,arguments)},e.add_filter=function(t,e,i,n){var e=a(e);return acf.addFilter.apply(this,arguments)},e.model={actions:{},filters:{},events:{},extend:function(t){var e=$.extend({},this,t);return $.each(e.actions,function(t,i){e._add_action(t,i)}),$.each(e.filters,function(t,i){e._add_filter(t,i)}),$.each(e.events,function(t,i){e._add_event(t,i)}),e},_add_action:function(t,e){var i=this,n=t.split(" "),t=n[0]||"",a=n[1]||10;acf.add_action(t,i[e],a,i)},_add_filter:function(t,e){var i=this,n=t.split(" "),t=n[0]||"",a=n[1]||10;acf.add_filter(t,i[e],a,i)},_add_event:function(t,e){var i=this,n=t.indexOf(" "),a=n>0?t.substr(0,n):t,r=n>0?t.substr(n+1):"",o=function(t){t.$el=$(this),acf.field_group&&(t.$field=t.$el.closest(".acf-field-object")),"function"==typeof i.event&&(t=i.event(t)),i[e].apply(i,arguments)};r?$(document).on(a,r,o):$(document).on(a,o)},get:function(t,e){return e=e||null,void 0!==this[t]&&(e=this[t]),e},set:function(t,e){return this[t]=e,"function"==typeof this["_set_"+t]&&this["_set_"+t].apply(this),this}},e.field=acf.model.extend({type:"",o:{},$field:null,_add_action:function(t,e){var i=this;t=t+"_field/type="+i.type,acf.add_action(t,function(t){i.set("$field",t),i[e].apply(i,arguments)})},_add_filter:function(t,e){var i=this;t=t+"_field/type="+i.type,acf.add_filter(t,function(t){i.set("$field",t),i[e].apply(i,arguments)})},_add_event:function(t,e){var i=this,n=t.substr(0,t.indexOf(" ")),a=t.substr(t.indexOf(" ")+1),r=acf.get_selector(i.type);$(document).on(n,r+" "+a,function(t){var n=$(this),a=acf.get_closest_field(n,i.type);a.length&&(a.is(i.$field)||i.set("$field",a),t.$el=n,t.$field=a,i[e].apply(i,[t]))})},_set_$field:function(){"function"==typeof this.focus&&this.focus()},doFocus:function(t){return this.set("$field",t)}});var r=acf.newCompatibility(acf.validation,{remove_error:function(t){acf.getField(t).removeError()},add_warning:function(t,e){acf.getField(t).showNotice({text:e,type:"warning",timeout:1e3})}});e.tooltip={tooltip:function(t,e){return acf.newTooltip({text:t,target:e}).$el},temp:function(t,e){var i=acf.newTooltip({text:t,target:e,timeout:250})},confirm:function(t,e,i,n,a){var r=acf.newTooltip({confirm:!0,text:i,target:t,confirm:function(){e(!0)},cancel:function(){e(!1)}})},confirm_remove:function(t,e){var i=acf.newTooltip({confirmRemove:!0,target:t,confirm:function(){e(!0)},cancel:function(){e(!1)}})}},e.media=new acf.Model({activeFrame:!1,actions:{new_media_popup:"onNewMediaPopup"},frame:function(){return this.activeFrame},onNewMediaPopup:function(t){this.activeFrame=t.frame},popup:function(t){return t.mime_types&&(t.allowedTypes=t.mime_types),t.id&&(t.attachment=t.id),acf.newMediaPopup(t).frame}}),e.select2={init:function(t,e,i){return e.allow_null&&(e.allowNull=e.allow_null),e.ajax_action&&(e.ajaxAction=e.ajax_action),i&&(e.field=acf.getField(i)),acf.newSelect2(t,e)},destroy:function(t){return acf.getInstance(t).destroy()}},e.postbox={render:function(t){return t.edit_url&&(t.editLink=t.edit_url),t.edit_title&&(t.editTitle=t.edit_title),acf.newPostbox(t)}},acf.newCompatibility(acf.screen,{update:function(){return this.set.apply(this,arguments)},fetch:acf.screen.check}),e.ajax=acf.screen}(jQuery);
includes/ajax/class-acf-ajax-check-screen.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
+ if( ! class_exists('ACF_Ajax_Check_Screen') ) :
6
+
7
+ class ACF_Ajax_Check_Screen extends ACF_Ajax {
8
+
9
+ /** @var string The AJAX action name */
10
+ var $action = 'acf/ajax/check_screen';
11
+
12
+ /** @var bool Prevents access for non-logged in users */
13
+ var $public = false;
14
+
15
+ /**
16
+ * get_response
17
+ *
18
+ * The actual logic for this AJAX request.
19
+ *
20
+ * @date 31/7/18
21
+ * @since 5.7.2
22
+ *
23
+ * @param void
24
+ * @return mixed The response data to send back or WP_Error.
25
+ */
26
+
27
+ function response() {
28
+
29
+ // vars
30
+ $args = acf_parse_args($this->request, array(
31
+ 'post_id' => 0,
32
+ 'ajax' => 1,
33
+ 'exclude' => array()
34
+ ));
35
+
36
+ // vars
37
+ $json = array();
38
+
39
+ // get field groups
40
+ $field_groups = acf_get_field_groups( $args );
41
+
42
+ // loop through field groups
43
+ if( $field_groups ) {
44
+ foreach( $field_groups as $i => $field_group ) {
45
+
46
+ // vars
47
+ $item = array(
48
+ 'key' => $field_group['key'],
49
+ 'title' => $field_group['title'],
50
+ 'html' => '',
51
+ 'style' => ''
52
+ );
53
+
54
+ // style
55
+ if( $i == 0 ) {
56
+ $item['style'] = acf_get_field_group_style( $field_group );
57
+ }
58
+
59
+ // html
60
+ if( !in_array($field_group['key'], $args['exclude']) ) {
61
+
62
+ // load fields
63
+ $fields = acf_get_fields( $field_group );
64
+
65
+ // get field HTML
66
+ ob_start();
67
+
68
+ // render
69
+ acf_render_fields( $fields, $args['post_id'], 'div', $field_group['instruction_placement'] );
70
+
71
+ $item['html'] = ob_get_clean();
72
+ }
73
+
74
+ // append
75
+ $json[] = $item;
76
+ }}
77
+
78
+ // return
79
+ return $json;
80
+ }
81
+ }
82
+
83
+ acf_new_instance('ACF_Ajax_Check_Screen');
84
+
85
+ endif; // class_exists check
86
+
87
+ ?>
includes/ajax/class-acf-ajax-user-setting.php CHANGED
@@ -4,10 +4,10 @@ if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  if( ! class_exists('ACF_Ajax_User_Setting') ) :
6
 
7
- class ACF_Ajax_User_Setting extends ACF_Ajax{
8
 
9
  /** @var string The AJAX action name */
10
- var $action = 'acf/update_user_setting';
11
 
12
  /** @var bool Prevents access for non-logged in users */
13
  var $public = true;
4
 
5
  if( ! class_exists('ACF_Ajax_User_Setting') ) :
6
 
7
+ class ACF_Ajax_User_Setting extends ACF_Ajax {
8
 
9
  /** @var string The AJAX action name */
10
+ var $action = 'acf/ajax/user_setting';
11
 
12
  /** @var bool Prevents access for non-logged in users */
13
  var $public = true;
includes/api/api-helpers.php CHANGED
@@ -4859,7 +4859,7 @@ function acf_send_ajax_results( $response ) {
4859
 
4860
  // validate
4861
  $response = wp_parse_args($response, array(
4862
- 'results' => false,
4863
  'more' => false,
4864
  'limit' => 0
4865
  ));
4859
 
4860
  // validate
4861
  $response = wp_parse_args($response, array(
4862
+ 'results' => array(),
4863
  'more' => false,
4864
  'limit' => 0
4865
  ));
includes/api/api-term.php CHANGED
@@ -233,4 +233,31 @@ function acf_get_pretty_taxonomies( $taxonomies = array() ) {
233
  return acf_get_taxonomy_labels( $taxonomies );
234
  }
235
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  ?>
233
  return acf_get_taxonomy_labels( $taxonomies );
234
  }
235
 
236
+ /**
237
+ * acf_get_term
238
+ *
239
+ * Similar to get_term() but with some extra functionality.
240
+ *
241
+ * @date 19/8/18
242
+ * @since 5.7.3
243
+ *
244
+ * @param mixed $term_id The term ID or a string of "slug:taxonomy".
245
+ * @param string $taxonomy The taxonomyname.
246
+ * @return WP_Term
247
+ */
248
+
249
+ function acf_get_term( $term_id, $taxonomy = '' ) {
250
+
251
+ // allow $term_id parameter to be a string of "slug:taxonomy" of "slug:id"
252
+ if( is_string($term_id) && strpos($term_id, ':') ) {
253
+ list( $taxonomy, $term_id ) = explode(':', $term_id);
254
+ $term = get_term_by( 'slug', $term_id, $taxonomy );
255
+ if( $term ) return $term;
256
+ }
257
+
258
+ // return
259
+ return get_term( $term_id, $taxonomy );
260
+ }
261
+
262
+
263
  ?>
includes/assets.php CHANGED
@@ -396,6 +396,9 @@ acf.doAction('prepare');
396
  <?php wp_editor( '', 'acf_content' ); ?>
397
  </div>
398
  <?php
 
 
 
399
  }
400
  }
401
 
396
  <?php wp_editor( '', 'acf_content' ); ?>
397
  </div>
398
  <?php
399
+
400
+ // action
401
+ do_action('acf/enqueue_uploader');
402
  }
403
  }
404
 
includes/fields/class-acf-field-range.php CHANGED
@@ -101,8 +101,11 @@ class acf_field_range extends acf_field_number {
101
  // range
102
  $html .= acf_get_text_input( $atts );
103
 
104
- // input
105
  $len = strlen( (string) $field['max'] );
 
 
 
106
  $html .= acf_get_text_input(array(
107
  'type' => 'number',
108
  'id' => $atts['id'] . '-alt',
101
  // range
102
  $html .= acf_get_text_input( $atts );
103
 
104
+ // calculate input width based on character length (+1 char if using decimals)
105
  $len = strlen( (string) $field['max'] );
106
+ if( $atts['step'] < 1 ) $len++;
107
+
108
+ // input
109
  $html .= acf_get_text_input(array(
110
  'type' => 'number',
111
  'id' => $atts['id'] . '-alt',
includes/fields/class-acf-field-wysiwyg.php CHANGED
@@ -35,6 +35,9 @@ class acf_field_wysiwyg extends acf_field {
35
 
36
  // add acf_the_content filters
37
  $this->add_filters();
 
 
 
38
  }
39
 
40
 
@@ -104,41 +107,28 @@ class acf_field_wysiwyg extends acf_field {
104
  */
105
 
106
  function get_toolbars() {
107
-
108
- // vars
109
- $editor_id = 'acf_content';
110
-
111
-
112
- // toolbars
113
- $toolbars = array();
114
- $mce_buttons = 'formatselect, bold, italic, bullist, numlist, blockquote, alignleft, aligncenter, alignright, link, unlink, wp_more, spellchecker, fullscreen, wp_adv';
115
- $mce_buttons_2 = 'strikethrough, hr, forecolor, pastetext, removeformat, charmap, outdent, indent, undo, redo, wp_help';
116
- $teeny_mce_buttons = 'bold, italic, underline, blockquote, strikethrough, bullist, numlist, alignleft, aligncenter, alignright, undo, redo, link, unlink, fullscreen';
117
-
118
-
119
- // WP < 3.9
120
- if( acf_version_compare('wp', '<', '3.9') ) {
121
-
122
- $mce_buttons = 'bold, italic, strikethrough, bullist, numlist, blockquote, justifyleft, justifycenter, justifyright, link, unlink, wp_more, spellchecker, fullscreen, wp_adv';
123
- $mce_buttons_2 = 'formatselect, underline, justifyfull, forecolor, pastetext, pasteword, removeformat, charmap, outdent, indent, undo, redo, wp_help';
124
- $teeny_mce_buttons = 'bold, italic, underline, blockquote, strikethrough, bullist, numlist, justifyleft, justifycenter, justifyright, undo, redo, link, unlink, fullscreen';
125
-
126
- // WP < 4.7
127
- } elseif( acf_version_compare('wp', '<', '4.7') ) {
128
-
129
- $mce_buttons = 'bold, italic, strikethrough, bullist, numlist, blockquote, hr, alignleft, aligncenter, alignright, link, unlink, wp_more, spellchecker, fullscreen, wp_adv';
130
- $mce_buttons_2 = 'formatselect, underline, alignjustify, forecolor, pastetext, removeformat, charmap, outdent, indent, undo, redo, wp_help';
131
- //$teeny_mce_buttons = 'bold, italic, underline, blockquote, strikethrough, bullist, numlist, alignleft, aligncenter, alignright, undo, redo, link, unlink, fullscreen';
132
-
133
  }
134
-
135
-
136
- // explode
137
- $mce_buttons = explode(', ', $mce_buttons);
138
- $mce_buttons_2 = explode(', ', $mce_buttons_2);
139
- $teeny_mce_buttons = explode(', ', $teeny_mce_buttons);
140
-
141
-
142
  // Full
143
  $toolbars['Full'] = array(
144
  1 => apply_filters('mce_buttons', $mce_buttons, $editor_id),
@@ -165,32 +155,26 @@ class acf_field_wysiwyg extends acf_field {
165
 
166
 
167
  /*
168
- * input_admin_enqueue_scripts
169
  *
170
- * description
171
  *
172
  * @type function
173
  * @date 16/12/2015
174
  * @since 5.3.2
175
  *
176
- * @param $post_id (int)
177
- * @return $post_id (int)
178
  */
179
 
180
- function input_admin_enqueue_scripts() {
181
 
182
  // vars
183
  $data = array();
184
  $toolbars = $this->get_toolbars();
185
 
186
-
187
- // bail ealry if no toolbars
188
- if( empty($toolbars) ) {
189
- return;
190
- }
191
-
192
-
193
  // loop
 
194
  foreach( $toolbars as $label => $rows ) {
195
 
196
  // vars
@@ -207,7 +191,7 @@ class acf_field_wysiwyg extends acf_field {
207
  $data[ $key ][ $i ] = implode(',', $row);
208
  }
209
  }
210
- }
211
 
212
  // localize
213
  acf_localize_data(array(
35
 
36
  // add acf_the_content filters
37
  $this->add_filters();
38
+
39
+ // actions
40
+ add_action('acf/enqueue_uploader', array($this, 'acf_enqueue_uploader'));
41
  }
42
 
43
 
107
  */
108
 
109
  function get_toolbars() {
110
+
111
+ // vars
112
+ $editor_id = 'acf_content';
113
+ $toolbars = array();
114
+
115
+
116
+ // mce buttons (Full)
117
+ $mce_buttons = array( 'formatselect', 'bold', 'italic', 'bullist', 'numlist', 'blockquote', 'alignleft', 'aligncenter', 'alignright', 'link', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' );
118
+ $mce_buttons_2 = array( 'strikethrough', 'hr', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' );
119
+
120
+ // mce buttons (Basic)
121
+ $teeny_mce_buttons = array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'fullscreen');
122
+
123
+
124
+ // WP < 4.7
125
+ if( acf_version_compare('wp', '<', '4.7') ) {
126
+
127
+ $mce_buttons = array( 'bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' );
128
+ $mce_buttons_2 = array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' );
 
 
 
 
 
 
 
129
  }
130
+
131
+
 
 
 
 
 
 
132
  // Full
133
  $toolbars['Full'] = array(
134
  1 => apply_filters('mce_buttons', $mce_buttons, $editor_id),
155
 
156
 
157
  /*
158
+ * acf_enqueue_uploader
159
  *
160
+ * Registers toolbars data for the WYSIWYG field.
161
  *
162
  * @type function
163
  * @date 16/12/2015
164
  * @since 5.3.2
165
  *
166
+ * @param void
167
+ * @return void
168
  */
169
 
170
+ function acf_enqueue_uploader() {
171
 
172
  // vars
173
  $data = array();
174
  $toolbars = $this->get_toolbars();
175
 
 
 
 
 
 
 
 
176
  // loop
177
+ if( $toolbars ) {
178
  foreach( $toolbars as $label => $rows ) {
179
 
180
  // vars
191
  $data[ $key ][ $i ] = implode(',', $row);
192
  }
193
  }
194
+ }}
195
 
196
  // localize
197
  acf_localize_data(array(
includes/forms/form-customizer.php CHANGED
@@ -288,7 +288,7 @@ class acf_form_customizer {
288
  }
289
 
290
  // return
291
- return $value;
292
  }
293
 
294
 
288
  }
289
 
290
  // return
291
+ return $field_key;
292
  }
293
 
294
 
includes/forms/form-post.php CHANGED
@@ -42,10 +42,6 @@ class ACF_Form_Post {
42
  add_filter('wp_insert_post_empty_content', array($this, 'wp_insert_post_empty_content'), 10, 2);
43
  add_action('save_post', array($this, 'save_post'), 10, 2);
44
 
45
-
46
- // ajax
47
- add_action('wp_ajax_acf/post/get_field_groups', array($this, 'get_field_groups'));
48
-
49
  }
50
 
51
 
@@ -364,106 +360,7 @@ if( typeof acf !== 'undefined' ) {
364
  echo '<style type="text/css" id="acf-style">' . $this->style . '</style>';
365
 
366
  }
367
-
368
-
369
- /*
370
- * get_field_groups
371
- *
372
- * This function will return all the JSON data needed to render new metaboxes
373
- *
374
- * @type function
375
- * @date 21/10/13
376
- * @since 5.0.0
377
- *
378
- * @param n/a
379
- * @return n/a
380
- */
381
-
382
- function get_field_groups() {
383
-
384
- // options
385
- $options = acf_parse_args($_POST, array(
386
- 'nonce' => '',
387
- 'post_id' => 0,
388
- 'ajax' => 1,
389
- 'exists' => array()
390
- ));
391
-
392
-
393
- // vars
394
- $json = array();
395
- $exists = acf_extract_var( $options, 'exists' );
396
-
397
-
398
- // verify nonce
399
- if( !acf_verify_ajax() ) die();
400
-
401
-
402
- // get field groups
403
- $field_groups = acf_get_field_groups( $options );
404
-
405
-
406
- // bail early if no field groups
407
- if( empty($field_groups) ) {
408
-
409
- wp_send_json_success( $json );
410
-
411
- }
412
 
413
-
414
- // loop through field groups
415
- foreach( $field_groups as $i => $field_group ) {
416
-
417
- // vars
418
- $item = array(
419
- //'ID' => $field_group['ID'], - JSON does not have ID (not used by JS anyway)
420
- 'key' => $field_group['key'],
421
- 'title' => $field_group['title'],
422
- 'html' => '',
423
- 'style' => ''
424
- );
425
-
426
-
427
- // style
428
- if( $i == 0 ) {
429
-
430
- $item['style'] = acf_get_field_group_style( $field_group );
431
-
432
- }
433
-
434
-
435
- // html
436
- if( !in_array($field_group['key'], $exists) ) {
437
-
438
- // load fields
439
- $fields = acf_get_fields( $field_group );
440
-
441
-
442
- // get field HTML
443
- ob_start();
444
-
445
-
446
- // render
447
- acf_render_fields( $fields, $options['post_id'], 'div', $field_group['instruction_placement'] );
448
-
449
-
450
- $item['html'] = ob_get_clean();
451
-
452
-
453
- }
454
-
455
-
456
- // append
457
- $json[] = $item;
458
-
459
- }
460
-
461
-
462
- // return
463
- wp_send_json_success( $json );
464
-
465
- }
466
-
467
 
468
  /*
469
  * wp_insert_post_empty_content
42
  add_filter('wp_insert_post_empty_content', array($this, 'wp_insert_post_empty_content'), 10, 2);
43
  add_action('save_post', array($this, 'save_post'), 10, 2);
44
 
 
 
 
 
45
  }
46
 
47
 
360
  echo '<style type="text/css" id="acf-style">' . $this->style . '</style>';
361
 
362
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
363
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
364
 
365
  /*
366
  * wp_insert_post_empty_content
includes/forms/form-user.php CHANGED
@@ -154,6 +154,11 @@ class ACF_Form_User {
154
 
155
  function render_new() {
156
 
 
 
 
 
 
157
  // render
158
  $this->render(array(
159
  'user_id' => 0,
154
 
155
  function render_new() {
156
 
157
+ // Multisite uses a different 'user-new.php' form. Don't render fields here
158
+ if( is_multisite() ) {
159
+ return;
160
+ }
161
+
162
  // render
163
  $this->render(array(
164
  'user_id' => 0,
includes/locations/class-acf-location-post-taxonomy.php CHANGED
@@ -48,74 +48,43 @@ class acf_location_post_taxonomy extends acf_location {
48
 
49
  // vars
50
  $post_id = acf_maybe_get( $screen, 'post_id' );
51
- $terms = acf_maybe_get( $screen, 'post_taxonomy' );
52
-
53
 
54
  // bail early if not a post
55
  if( !$post_id ) return false;
56
 
57
-
58
- // get term data
59
- $data = acf_decode_taxonomy_term( $rule['value'] );
60
- $term = get_term_by( 'slug', $data['term'], $data['taxonomy'] );
61
-
62
-
63
- // attempt get term via ID (ACF4 uses ID)
64
- if( !$term && is_numeric($data['term']) ) {
65
-
66
- $term = get_term_by( 'id', $data['term'], $data['taxonomy'] );
67
-
68
- }
69
-
70
 
71
  // bail early if no term
72
- if( !$term ) return false;
73
 
 
 
 
74
 
75
- // not ajax, load real post's terms
76
- if( $terms === null ) {
77
-
78
- $terms = wp_get_post_terms( $post_id, $term->taxonomy, array('fields' => 'ids') );
79
-
80
  }
81
 
82
-
83
  // If no terms, this is a new post and should be treated as if it has the "Uncategorized" (1) category ticked
84
- if( empty($terms) ) {
85
-
86
- // get post type
87
- $post_type = get_post_type( $post_id );
88
-
89
-
90
- // if is category
91
- if( is_object_in_taxonomy($post_type, 'category') ) {
92
-
93
- $terms = array( 1 );
94
-
95
- }
96
-
97
  }
98
 
99
-
100
- // match
101
- if( !empty($terms) ) {
102
-
103
- $result = in_array( $term->term_id, $terms );
104
-
105
  }
106
 
107
-
108
- // reverse if 'not equal to'
109
- if( $rule['operator'] === '!=' ) {
110
-
111
- $result = !$result;
112
-
113
  }
114
 
115
-
116
  // return
117
  return $result;
118
-
119
  }
120
 
121
 
48
 
49
  // vars
50
  $post_id = acf_maybe_get( $screen, 'post_id' );
51
+ $post_terms = acf_maybe_get( $screen, 'post_terms' );
 
52
 
53
  // bail early if not a post
54
  if( !$post_id ) return false;
55
 
56
+ // get selected term from rule
57
+ $term = acf_get_term( $rule['value'] );
 
 
 
 
 
 
 
 
 
 
 
58
 
59
  // bail early if no term
60
+ if( !$term || is_wp_error($term) ) return false;
61
 
62
+ // if ajax, find the terms for the correct category
63
+ if( $post_terms !== null ) {
64
+ $post_terms = acf_maybe_get( $post_terms, $term->taxonomy, array() );
65
 
66
+ // if not ajax, load post's terms
67
+ } else {
68
+ $post_terms = wp_get_post_terms( $post_id, $term->taxonomy, array('fields' => 'ids') );
 
 
69
  }
70
 
 
71
  // If no terms, this is a new post and should be treated as if it has the "Uncategorized" (1) category ticked
72
+ if( !$post_terms && $term->taxonomy == 'category' ) {
73
+ $post_terms = array( 1 );
 
 
 
 
 
 
 
 
 
 
 
74
  }
75
 
76
+ // compare term IDs and slugs
77
+ if( in_array($term->term_id, $post_terms) || in_array($term->slug, $post_terms) ) {
78
+ $result = true;
 
 
 
79
  }
80
 
81
+ // reverse if 'not equal to'
82
+ if( $rule['operator'] == '!=' ) {
83
+ $result = !$result;
 
 
 
84
  }
85
 
 
86
  // return
87
  return $result;
 
88
  }
89
 
90
 
includes/third-party.php CHANGED
@@ -45,6 +45,11 @@ class acf_third_party {
45
  if( function_exists('espresso_version') ) {
46
  add_filter('acf/get_post_types', array($this, 'ee_get_post_types'), 10, 2);
47
  }
 
 
 
 
 
48
  }
49
 
50
 
@@ -182,7 +187,23 @@ class acf_third_party {
182
  // return
183
  return $pages;
184
 
185
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
 
187
  }
188
 
45
  if( function_exists('espresso_version') ) {
46
  add_filter('acf/get_post_types', array($this, 'ee_get_post_types'), 10, 2);
47
  }
48
+
49
+ // Dark Mode
50
+ if( class_exists('Dark_Mode') ) {
51
+ add_action('doing_dark_mode', array($this, 'doing_dark_mode'));
52
+ }
53
  }
54
 
55
 
187
  // return
188
  return $pages;
189
 
190
+ }
191
+
192
+ /**
193
+ * doing_dark_mode
194
+ *
195
+ * Runs during 'admin_enqueue_scripts' if dark mode is enabled
196
+ *
197
+ * @date 13/8/18
198
+ * @since 5.7.3
199
+ *
200
+ * @param void
201
+ * @return void
202
+ */
203
+
204
+ function doing_dark_mode() {
205
+ wp_enqueue_style('acf-dark', acf_get_url('assets/css/acf-dark.css'), array(), ACF_VERSION );
206
+ }
207
 
208
  }
209
 
includes/wpml.php CHANGED
@@ -432,28 +432,13 @@ class acf_wpml_compatibility {
432
 
433
  function verify_ajax() {
434
 
435
- // globals
436
- global $sitepress;
437
-
438
-
439
- // vars
440
- $lang = acf_maybe_get($_POST, 'lang');
441
-
442
-
443
- // bail early if no lang
444
- if( !$lang ) return;
445
-
446
-
447
- // switch lang
448
  // this will allow get_posts to work as expected (load posts from the correct language)
449
- $sitepress->switch_lang( $_REQUEST['lang'] );
450
-
451
-
452
- // remove post_id
453
- // this will prevent WPML from setting the current language based on the current post being edited
454
- // in theory, WPML is correct, however, when adding a new post, the post's lang is not found and will default to 'en'
455
- unset( $_REQUEST['post_id'] );
456
-
457
  }
458
 
459
 
432
 
433
  function verify_ajax() {
434
 
435
+ // set the language for this AJAX request
 
 
 
 
 
 
 
 
 
 
 
 
436
  // this will allow get_posts to work as expected (load posts from the correct language)
437
+ if( isset($_REQUEST['lang']) ) {
438
+ global $sitepress;
439
+ $sitepress->switch_lang( $_REQUEST['lang'] );
440
+ //$sitepress->set_default_language($_REQUEST['lang']);
441
+ }
 
 
 
442
  }
443
 
444
 
readme.txt CHANGED
@@ -66,6 +66,18 @@ From your WordPress dashboard
66
 
67
  == Changelog ==
68
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  = 5.7.2 =
70
  *Release Date - 6 August 2018*
71
 
66
 
67
  == Changelog ==
68
 
69
+ = 5.7.3 =
70
+ *Release Date - 20 August 2018*
71
+
72
+ * New - Added Dark Mode styles for the [Dark Mode Plugin](https://en-au.wordpress.org/plugins/dark-mode/).
73
+ * New - Added "Value Contains" condition to the Select field type.
74
+ * New - Added support for the WooCommerce product type dropdown to trigger "update metaboxes".
75
+ * Tweak - Improved acf.screen model responsible for "updating metaboxes" when changing post data.
76
+ * Tweak - Removed user fields from the multisite "Add New User" page.
77
+ * Fix - Fixed bug preventing some tinymce customizations from working.
78
+ * Fix - Fixed JS bug throwing "preference" error in console.
79
+ * Dev - Added action 'acf/enqueue_uploader' triggered after the hidden "ACF Content" editor is rendered.
80
+
81
  = 5.7.2 =
82
  *Release Date - 6 August 2018*
83