ThirstyAffiliates Affiliate Link Manager - Version 3.10.0

Version Description

  • Changed: Admin UI tweaks
  • Bug Fix: Remove styles affecting WP core image block
  • Bug Fix: Notice errors when Elementor is installed
Download this release

Release Info

Developer caseproof
Plugin Icon 128x128 ThirstyAffiliates Affiliate Link Manager
Version 3.10.0
Comparing to
See all releases

Code changes from version 3.9.4 to 3.10.0

Helpers/Helper_Functions.php CHANGED
@@ -662,7 +662,7 @@ class Helper_Functions {
662
  public function is_page_builder_active() {
663
 
664
  $is_bb_active = class_exists( 'FLBuilderModel' ) && \FLBuilderModel::is_builder_active();
665
- $elementor = class_exists( 'Elementor\Editor' ) && isset( $_GET[ 'action' ] ) && $_GET[ 'action' ] == 'elementor';
666
 
667
  return $is_bb_active || $elementor;
668
  }
662
  public function is_page_builder_active() {
663
 
664
  $is_bb_active = class_exists( 'FLBuilderModel' ) && \FLBuilderModel::is_builder_active();
665
+ $elementor = ( class_exists( 'Elementor\Core\Editor\Editor' ) || class_exists( 'Elementor\Editor' ) ) && isset( $_GET[ 'action' ] ) && $_GET[ 'action' ] == 'elementor';
666
 
667
  return $is_bb_active || $elementor;
668
  }
Helpers/Plugin_Constants.php CHANGED
@@ -27,7 +27,7 @@ class Plugin_Constants {
27
  // Plugin configuration constants
28
  const TOKEN = 'ta';
29
  const INSTALLED_VERSION = 'ta_installed_version';
30
- const VERSION = '3.9.4';
31
  const TEXT_DOMAIN = 'thirstyaffiliates';
32
  const THEME_TEMPLATE_PATH = 'thirstyaffiliates';
33
  const META_DATA_PREFIX = '_ta_';
@@ -158,7 +158,7 @@ class Plugin_Constants {
158
 
159
  // HTAccess Module
160
  public function HTACCESS_FILE() {
161
- return ABSPATH . '/.htaccess';
162
  }
163
 
164
  }
27
  // Plugin configuration constants
28
  const TOKEN = 'ta';
29
  const INSTALLED_VERSION = 'ta_installed_version';
30
+ const VERSION = '3.10.0';
31
  const TEXT_DOMAIN = 'thirstyaffiliates';
32
  const THEME_TEMPLATE_PATH = 'thirstyaffiliates';
33
  const META_DATA_PREFIX = '_ta_';
158
 
159
  // HTAccess Module
160
  public function HTACCESS_FILE() {
161
+ return untrailingslashit( ABSPATH ) . '/.htaccess';
162
  }
163
 
164
  }
Models/Marketing.php CHANGED
@@ -213,36 +213,62 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
213
  if ( ! is_admin() || ! current_user_can( 'manage_options' ) || $post_type !== Plugin_Constants::AFFILIATE_LINKS_CPT || get_option( Plugin_Constants::SHOW_REQUEST_REVIEW ) !== 'yes' || ( $review_request_response !== 'review-later' && ! empty( $review_request_response ) ) )
214
  return;
215
 
216
- if ( $this->_helper_functions->is_plugin_active( 'thirstyaffiliates-pro/thirstyaffiliates-pro.php' ) ) {
217
-
218
- $msg = sprintf( __( '<p>We see you have been using ThirstyAffiliates for a couple of weeks now – thank you once again for your purchase and we hope you are enjoying it so far!</p>
219
- <p>We\'d really appreciate it if you could take a few minutes to write a 5-star review of our free plugin on WordPress.org!</p>
220
- <p>Your comment will go a long way to helping us grow and giving new users the confidence to give us a try.</p>
221
- <p>Thanks in advance, we are looking forward to reading it!</p>
222
- <p>PS. If you ever need support, please just <a href="%1$s" target="_blank">get in touch here.</a></p>' , "thirstyaffiliates" ) , 'https://goo.gl/SsDbYD' );
223
-
224
- } else {
225
-
226
- $msg = __( "<p>Thanks for using our free ThirstyAffiliates plugin – we hope you are enjoying it so far.</p>
227
- <p>We’d really appreciate it if you could take a few minutes to write a 5-star review of our plugin on WordPress.org!</p>
228
- <p>Your comment will go a long way to helping us grow and giving new users the confidence to give us a try.</p>
229
- <p>Thanks in advance, we are looking forward to reading it!</p>" , "thirstyaffiliates" );
230
-
231
- } ?>
232
- <div class="ta-review-request notice notice-info">
233
-
234
- <div style="padding: 4px 0;">
235
- <a href="https://thirstyaffiliates.com/" target="_blank"><img src="<?php echo $this->_constants->IMAGES_ROOT_URL() . 'admin-review-notice-logo.png'; ?>"></a>
236
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
 
238
- <?php echo $msg; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
 
240
- <p class="actions">
241
- <a href="#" class="button" data-response="never-show"><?php _e( 'Don\'t show again' , 'thirstyaffiliates' ); ?></a>
242
- <a href="#" class="button" data-response="review-later"><?php _e( 'Review later' , 'thirstyaffiliates' ); ?></a>
243
- <a href="https://goo.gl/RAsxVu" class="button button-primary" data-response="review"><?php _e( 'Review' , 'thirstyaffiliates' ); ?></a>
244
- </p>
245
- </div>
 
 
 
 
 
 
 
246
  <?php
247
  }
248
 
@@ -498,6 +524,27 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
498
  $img = esc_url( $this->_constants->IMAGES_ROOT_URL() . 'sidebar.jpg' );
499
  echo '<a href="' . $url . '" target="_blank"><img src="' . $img . '"></a>';
500
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
501
 
502
 
503
 
@@ -535,7 +582,7 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
535
  add_action( 'wp_ajax_ta_dismiss_tapro_admin_notice' , array( $this , 'ajax_dismiss_tapro_admin_notice' ) );
536
  add_action( 'wp_ajax_ta_dismiss_marketing_notice' , array( $this , 'ajax_dismiss_marketing_notice' ) );
537
  add_action( 'wp_ajax_ta_enable_js_redirect' , array( $this , 'ajax_enable_js_redirect' ) );
538
-
539
  }
540
 
541
  /**
@@ -550,7 +597,7 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
550
  add_action( Plugin_Constants::CRON_REQUEST_REVIEW , array( $this , 'flag_show_review_request' ) );
551
  add_action( Plugin_Constants::CRON_TAPRO_NOTICE , array( $this , 'flag_show_tapro_notice' ) );
552
  add_action( 'admin_notices' , array( $this , 'show_review_request_notice' ) );
553
- add_action( 'admin_notices' , array( $this , 'show_tapro_admin_notice' ) );
554
  add_action( 'admin_notices' , array( $this , 'display_enable_js_redirect_notice' ) );
555
  add_action( 'admin_menu' , array( $this , 'add_pro_features_menu_link' ) , 20 );
556
  add_action( 'admin_head', array( $this , 'add_pro_features_menu_link_target' ) );
213
  if ( ! is_admin() || ! current_user_can( 'manage_options' ) || $post_type !== Plugin_Constants::AFFILIATE_LINKS_CPT || get_option( Plugin_Constants::SHOW_REQUEST_REVIEW ) !== 'yes' || ( $review_request_response !== 'review-later' && ! empty( $review_request_response ) ) )
214
  return;
215
 
216
+ ?>
217
+ <div class="notice notice-info is-dismissible ta-review-notice" id="ta_review_notice">
218
+ <div id="ta_review_intro">
219
+ <p><?php _e( 'Are you enjoying using ThirstyAffiliates?', 'pretty-link' ); ?></p>
220
+ <p><a data-review-selection="yes" class="ta-review-selection" href="#">Yes, I love it</a> 🙂 | <a data-review-selection="no" class="ta-review-selection" href="#">Not really...</a></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  </div>
222
+ <div id="ta_review_yes" style="display: none;">
223
+ <p><?php _e( 'That\'s awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress to help us spread the word and boost our motivation?', 'pretty-link' ); ?></p>
224
+ <p style="font-weight: bold;">~ Blair Williams<br>CEO of ThirstyAffiliates</p>
225
+ <p>
226
+ <a style="display: inline-block; margin-right: 10px;" href="https://wordpress.org/support/plugin/thirstyaffiliates/reviews/?filter=5#new-post" onclick="delayReviewPrompt('remove')" target="_blank"><?php esc_html_e( 'Okay, you deserve it', 'pretty-link' ); ?></a>
227
+ <a style="display: inline-block; margin-right: 10px;" href="#" onclick="delayReviewPrompt('delay')"><?php esc_html_e( 'Nope, maybe later', 'pretty-link' ); ?></a>
228
+ <a href="#" onclick="delayReviewPrompt('remove')"><?php esc_html_e( 'I already did', 'pretty-link' ); ?></a>
229
+ </p>
230
+ </div>
231
+ <div id="ta_review_no" style="display: none;">
232
+ <p><?php _e( 'We\'re sorry to hear you aren\'t enjoying ThirstyAffiliates. We would love a chance to improve. Could you take a minute and let us know what we can do better?', 'pretty-link' ); ?></p>
233
+ <p>
234
+ <a style="display: inline-block; margin-right: 10px;" href="https://thirstyaffiliates.com/plugin-feedback/?utm_source=plugin_admin&utm_medium=link&utm_campaign=in_plugin&utm_content=request_review" onclick="delayReviewPrompt('remove')" target="_blank"><?php esc_html_e( 'Give Feedback', 'pretty-link' ); ?></a>
235
+ <a href="#" onclick="delayReviewPrompt('delay')"><?php esc_html_e( 'No thanks', 'pretty-link' ); ?></a>
236
+ </p>
237
+ </div>
238
+ </div>
239
+ <script>
240
 
241
+ function delayReviewPrompt(type, triggerClick = true) {
242
+ if ( triggerClick ) {
243
+ jQuery('#ta_review_notice').fadeOut();
244
+ }
245
+ jQuery.ajax({
246
+ url: ajaxurl,
247
+ type: 'POST',
248
+ data: {
249
+ action: 'ta_dismiss_review_prompt',
250
+ nonce: "<?php echo wp_create_nonce( 'ta_dismiss_review_prompt' ) ?>",
251
+ type: type
252
+ },
253
+ })
254
+ .done(function(data) {
255
+
256
+ });
257
+ }
258
 
259
+ jQuery(document).ready(function($) {
260
+ $('.ta-review-selection').click(function(event) {
261
+ event.preventDefault();
262
+ var $this = $(this);
263
+ var selection = $this.data('review-selection');
264
+ $('#ta_review_intro').hide();
265
+ $('#ta_review_' + selection).show();
266
+ });
267
+ $('body').on('click', '#ta_review_notice .notice-dismiss', function(event) {
268
+ delayReviewPrompt('delay', false);
269
+ });
270
+ });
271
+ </script>
272
  <?php
273
  }
274
 
524
  $img = esc_url( $this->_constants->IMAGES_ROOT_URL() . 'sidebar.jpg' );
525
  echo '<a href="' . $url . '" target="_blank"><img src="' . $img . '"></a>';
526
  }
527
+
528
+ public function dismiss_review_prompt() {
529
+
530
+ if ( empty( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'ta_dismiss_review_prompt' ) ) {
531
+ die('Failed');
532
+ }
533
+
534
+ if ( ! empty( $_POST['type'] ) ) {
535
+ if ( 'remove' === $_POST['type'] ) {
536
+ update_option( 'ta_review_prompt_removed', true );
537
+ wp_send_json_success( array(
538
+ 'status' => 'removed'
539
+ ) );
540
+ } else if ( 'delay' === $_POST['type'] ) {
541
+ set_transient( 'ta_review_prompt_delay', true, WEEK_IN_SECONDS );
542
+ wp_send_json_success( array(
543
+ 'status' => 'delayed'
544
+ ) );
545
+ }
546
+ }
547
+ }
548
 
549
 
550
 
582
  add_action( 'wp_ajax_ta_dismiss_tapro_admin_notice' , array( $this , 'ajax_dismiss_tapro_admin_notice' ) );
583
  add_action( 'wp_ajax_ta_dismiss_marketing_notice' , array( $this , 'ajax_dismiss_marketing_notice' ) );
584
  add_action( 'wp_ajax_ta_enable_js_redirect' , array( $this , 'ajax_enable_js_redirect' ) );
585
+ add_action( 'wp_ajax_ta_dismiss_review_prompt' , array( $this, 'dismiss_review_prompt' ) );
586
  }
587
 
588
  /**
597
  add_action( Plugin_Constants::CRON_REQUEST_REVIEW , array( $this , 'flag_show_review_request' ) );
598
  add_action( Plugin_Constants::CRON_TAPRO_NOTICE , array( $this , 'flag_show_tapro_notice' ) );
599
  add_action( 'admin_notices' , array( $this , 'show_review_request_notice' ) );
600
+ // add_action( 'admin_notices' , array( $this , 'show_tapro_admin_notice' ) );
601
  add_action( 'admin_notices' , array( $this , 'display_enable_js_redirect_notice' ) );
602
  add_action( 'admin_menu' , array( $this , 'add_pro_features_menu_link' ) , 20 );
603
  add_action( 'admin_head', array( $this , 'add_pro_features_menu_link_target' ) );
Models/Script_Loader.php CHANGED
@@ -149,7 +149,6 @@ class Script_Loader implements Model_Interface {
149
 
150
  wp_enqueue_style( 'selectize' , $this->_constants->JS_ROOT_URL() . 'lib/selectize/selectize.default.css' , array() , Plugin_Constants::VERSION , 'all' );
151
  wp_enqueue_style( 'ta_settings_css' , $this->_constants->CSS_ROOT_URL() . 'admin/ta-settings.css' , array() , Plugin_Constants::VERSION , 'all' );
152
-
153
  wp_enqueue_script( 'selectize', $this->_constants->JS_ROOT_URL() . 'lib/selectize/selectize.min.js' , array( 'jquery' , 'jquery-ui-core' , 'jquery-ui-sortable' ) , Plugin_Constants::VERSION , true );
154
  wp_enqueue_script( 'ta_settings_js', $this->_constants->JS_ROOT_URL() . 'app/ta-settings.js', array( 'jquery' ), Plugin_Constants::VERSION , true );
155
  wp_localize_script( 'ta_settings_js' , 'ta_settings_var' , array(
@@ -244,6 +243,10 @@ class Script_Loader implements Model_Interface {
244
  );
245
  }
246
 
 
 
 
 
247
  }
248
 
249
  /**
@@ -337,6 +340,93 @@ class Script_Loader implements Model_Interface {
337
  return apply_filters( 'ta_absolute_home_url', $scheme . $home_url[ 'host' ] . $port . $path );
338
  }
339
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  /**
341
  * Execute plugin script loader.
342
  *
@@ -353,6 +443,9 @@ class Script_Loader implements Model_Interface {
353
 
354
  // Gutenberg support
355
  add_action( 'enqueue_block_editor_assets' , array( $this , 'gutenberg_backend_scripts' ) );
 
 
 
356
  }
357
 
358
  }
149
 
150
  wp_enqueue_style( 'selectize' , $this->_constants->JS_ROOT_URL() . 'lib/selectize/selectize.default.css' , array() , Plugin_Constants::VERSION , 'all' );
151
  wp_enqueue_style( 'ta_settings_css' , $this->_constants->CSS_ROOT_URL() . 'admin/ta-settings.css' , array() , Plugin_Constants::VERSION , 'all' );
 
152
  wp_enqueue_script( 'selectize', $this->_constants->JS_ROOT_URL() . 'lib/selectize/selectize.min.js' , array( 'jquery' , 'jquery-ui-core' , 'jquery-ui-sortable' ) , Plugin_Constants::VERSION , true );
153
  wp_enqueue_script( 'ta_settings_js', $this->_constants->JS_ROOT_URL() . 'app/ta-settings.js', array( 'jquery' ), Plugin_Constants::VERSION , true );
154
  wp_localize_script( 'ta_settings_js' , 'ta_settings_var' , array(
243
  );
244
  }
245
 
246
+ if ( ! empty( $_GET['post_type'] ) && 'thirstylink' === $_GET['post_type'] ) {
247
+ wp_enqueue_style( 'ta-admin-styles' , $this->_constants->CSS_ROOT_URL() . 'admin/ta-admin.css' , array() , Plugin_Constants::VERSION , 'all' );
248
+ wp_enqueue_script( 'ta-admin-scripts' , $this->_constants->JS_ROOT_URL() . 'app/ta-admin.js' , array( 'jquery' ) , Plugin_Constants::VERSION , true );
249
+ }
250
  }
251
 
252
  /**
340
  return apply_filters( 'ta_absolute_home_url', $scheme . $home_url[ 'host' ] . $port . $path );
341
  }
342
 
343
+ public function support_widget() {
344
+
345
+ if ( empty( $_GET['post_type'] ) || 'thirstylink' !== $_GET['post_type'] ) {
346
+ return;
347
+ }
348
+
349
+ printf(
350
+ '<div id="caseproof-flyout">
351
+ <div id="caseproof-flyout-items">
352
+ %1$s
353
+ </div>
354
+ <a href="#" class="caseproof-flyout-button caseproof-flyout-head">
355
+ <div class="caseproof-flyout-label">%2$s</div>
356
+ <img src="%3$s" alt="%2$s" data-active="%4$s" />
357
+ </a>
358
+ </div>',
359
+ $this->get_items_html(),
360
+ esc_attr__( 'See Quick Links', 'thirstyaffiliates' ),
361
+ esc_url( $this->_constants->IMAGES_ROOT_URL() . 'admin-flyout.svg' ),
362
+ esc_url( $this->_constants->IMAGES_ROOT_URL() . 'admin-flyout.svg' )
363
+ );
364
+ }
365
+
366
+ /**
367
+ * Generate menu items HTML.
368
+ *
369
+ * @since 1.5.7
370
+ *
371
+ * @return string Menu items HTML.
372
+ */
373
+ private function get_items_html() {
374
+
375
+ $items = array_reverse( $this->menu_items() );
376
+ $items_html = '';
377
+
378
+ foreach ( $items as $item_key => $item ) {
379
+ $items_html .= sprintf(
380
+ '<a href="%1$s" target="_blank" rel="noopener noreferrer" class="caseproof-flyout-button caseproof-flyout-item caseproof-flyout-item-%2$d"%5$s%6$s>
381
+ <div class="caseproof-flyout-label">%3$s</div>
382
+ %4$s
383
+ </a>',
384
+ esc_url( $item['url'] ),
385
+ (int) $item_key,
386
+ esc_html( $item['title'] ),
387
+ $item['icon'],
388
+ ! empty( $item['bgcolor'] ) ? ' style="background-color: ' . esc_attr( $item['bgcolor'] ) . '"' : '',
389
+ ! empty( $item['hover_bgcolor'] ) ? ' onMouseOver="this.style.backgroundColor=\'' . esc_attr( $item['hover_bgcolor'] ) . '\'" onMouseOut="this.style.backgroundColor=\'' . esc_attr( $item['bgcolor'] ) . '\'"' : ''
390
+ );
391
+ }
392
+
393
+ return $items_html;
394
+ }
395
+
396
+ /**
397
+ * Menu items data.
398
+ *
399
+ * @since 1.5.7
400
+ */
401
+ private function menu_items() {
402
+
403
+ $items = array(
404
+ array(
405
+ 'title' => esc_html__( 'Upgrade to ThirstyAffiliates Pro', 'thirstyaffiliates' ),
406
+ 'url' => 'https://thirstyaffiliates.com/pricing?utm_source=plugin_admin&utm_medium=link&utm_campaign=in_plugin&utm_content=quick_links_widget',
407
+ 'icon' => '<svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 51 45" xmlns="http://www.w3.org/2000/svg"><g fill="#fff" fill-rule="nonzero" transform="translate(-15.5823 -17.1195)"><path d="m52.6 36.6c-.3-.8-1-1.3-1.8-1.3l-11.5.1-3.3-10.1c-.2-.8-1-1.3-1.8-1.3s-1.5.5-1.9 1.3l-3.3 9.9-11.5.1c-.8 0-1.5.5-1.8 1.2s0 1.6.6 2l8.9 7.5-4.2 12.8s0 .1-.1.1c0 0 0 .1-.1.1v.9s0 .1.1.1c0 .1 0 .1.1.2 0 0 0 .1.1.1l.3.3c.1.1.2.1.2.2h.1c.1 0 .1.1.2.1h.1c.1 0 .1 0 .2.1h.9c.1 0 .2 0 .2-.1h.1c.1 0 .2-.1.3-.1l10.2-8.1 9.6 8.2c.3.3.8.4 1.2.5.4-.1.7-.1 1.1-.3.6-.5 1-1.3.7-2.1l-4.1-12.6 9.3-7.6c.9-.6 1.2-1.4.9-2.2"/><path d="m40.1 25.9 5.1 2.1 2.1 5.1c.2.3.6.5.9.3.1-.1.2-.2.3-.3l2.1-5.1 5.1-2.1c.3-.2.5-.6.3-.9-.1-.1-.2-.2-.3-.3l-5.1-2.1-2.1-5.1c-.2-.3-.6-.5-.9-.3-.1.1-.2.2-.3.3l-2.1 5.1-5.1 2.1c-.3.2-.5.6-.3.9.1.1.2.2.3.3"/><path d="m66 39.7-4.2-1.7-1.7-4.1c-.1-.3-.5-.4-.7-.2-.1.1-.2.1-.2.2l-1.8 4.1-4.1 1.7c-.3.1-.4.5-.2.7.1.1.1.2.2.2l4.1 1.7 1.7 4.1c.1.3.5.4.7.2.1-.1.2-.1.2-.2l1.7-4.1 4.1-1.7c.3-.1.4-.5.2-.7.2 0 .1-.1 0-.2z"/></g></svg>',
408
+ 'bgcolor' => '#FA7E23',
409
+ 'hover_bgcolor' => '#FF9000',
410
+ ),
411
+ array(
412
+ 'title' => esc_html__( 'Support & Docs', 'thirstyaffiliates' ),
413
+ 'url' => 'https://thirstyaffiliates.com/support?utm_source=plugin_admin&utm_medium=link&utm_campaign=in_plugin&utm_content=quick_links_widget',
414
+ 'icon' => '<svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 42 37" xmlns="http://www.w3.org/2000/svg"><path d="m47.9 39.3v2.6c0 .5-.4 1-1 1h-4.6v4.6c0 .5-.4 1-1 1h-2.6c-.5 0-1-.4-1-1v-4.6h-4.6c-.5 0-1-.4-1-1v-2.6c0-.5.4-1 1-1h4.6v-4.6c0-.5.4-1 1-1h2.6c.5 0 1 .4 1 1v4.6h4.6c.5 0 1 .5 1 1m-24.4 13.1c-.3 0-.5-.2-.5-.5v-22.6c0-.3.2-.5.5-.5h33c.3 0 .5.2.5.5v22.6c0 .3-.2.5-.5.5zm12.6-28.8h7.9v1.3h-7.9zm20.9 1.3h-9.2v-1.3c0-2.2-1.8-3.9-3.9-3.9h-7.9c-2.2 0-3.9 1.8-3.9 3.9v1.3h-9.1c-2.2 0-3.9 1.8-3.9 3.9v23.6c0 2.2 1.8 3.9 3.9 3.9h34c2.2 0 3.9-1.8 3.9-3.9v-23.6c0-2.1-1.7-3.9-3.9-3.9" fill="#fff" fill-rule="nonzero" transform="translate(-19.1 -19.7)"/></svg>',
415
+ 'bgcolor' => '#008871',
416
+ 'hover_bgcolor' => '#38AD9C',
417
+ ),
418
+ array(
419
+ 'title' => esc_html__( 'Suggest a Feature', 'thirstyaffiliates' ),
420
+ 'url' => 'https://thirstyaffiliates.com/contact?utm_source=plugin_admin&utm_medium=link&utm_campaign=in_plugin&utm_content=quick_links_widget',
421
+ 'icon' => '<svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 53 43" xmlns="http://www.w3.org/2000/svg"><g fill="#fff" fill-rule="nonzero" transform="translate(-13.5 -19.9)"><path d="m22.8 35.7c0-1.1-.9-2-2-2h-5.3c-1.1 0-2 .9-2 2s.9 2 2 2h5.3c1.1 0 2-.9 2-2"/><path d="m64.5 33.7h-5.3c-1.1 0-2 .9-2 2s.9 2 2 2h5.3c1.1 0 2-.9 2-2s-1-2-2-2"/><path d="m22.4 43.6-4.6 2.6c-1 .5-1.3 1.7-.8 2.7s1.7 1.3 2.7.8h.1l4.6-2.6c.9-.6 1.2-1.8.7-2.7-.6-1-1.8-1.3-2.7-.8"/><path d="m56.6 28.1c.3 0 .7-.1 1-.3l4.6-2.6c.9-.6 1.2-1.8.7-2.7s-1.7-1.2-2.7-.7l-4.6 2.6c-.9.5-1.3 1.8-.7 2.7.3.6 1 1 1.7 1"/><path d="m24.5 24.5-4.6-2.7c-.9-.6-2.2-.3-2.7.7-.6.9-.3 2.2.7 2.7h.1l4.6 2.6c.9.6 2.2.3 2.7-.7s.1-2.1-.8-2.6"/><path d="m49.6 23.5c-2.7-2.3-6.1-3.6-9.6-3.6-8.4 0-14.5 6.9-14.5 14.5 0 3.5 1.3 6.9 3.6 9.6 1.4 1.6 3.5 4.9 4.3 7.6h4c0-.4-.1-.8-.2-1.2-.5-1.5-1.9-5.3-5.1-9.1-1.7-1.9-2.6-4.4-2.6-7 0-6.1 4.9-10.6 10.6-10.6 5.8 0 10.6 4.7 10.6 10.6 0 2.6-.9 5-2.6 7-3.2 3.7-4.7 7.6-5.1 9-.1.4-.2.8-.2 1.2h4c.8-2.8 3-6 4.3-7.6 5.1-6 4.5-15.2-1.5-20.4"/><path d="m33.4 57.8c0 .3.1.5.2.7l2 3c.2.4.7.6 1.1.6h6.5c.4 0 .9-.2 1.1-.6l2-3c.1-.2.2-.5.2-.7v-3.6h-13.1z"/><path d="m62.2 46.2-4.6-2.6c-.9-.6-2.2-.3-2.7.7-.6.9-.3 2.2.7 2.7h.1l4.6 2.6c1 .5 2.2.2 2.7-.8.4-.9.1-2-.8-2.6"/><path d="m40 26.5c-4.4 0-7.9 3.6-7.9 7.9 0 .7.6 1.3 1.3 1.3s1.3-.6 1.3-1.3c0-2.9 2.4-5.3 5.3-5.3.7 0 1.3-.6 1.3-1.3s-.6-1.3-1.3-1.3"/></g></svg>',
422
+ 'bgcolor' => '#008871',
423
+ 'hover_bgcolor' => '#38AD9C',
424
+ ),
425
+ );
426
+
427
+ return $items;
428
+ }
429
+
430
  /**
431
  * Execute plugin script loader.
432
  *
443
 
444
  // Gutenberg support
445
  add_action( 'enqueue_block_editor_assets' , array( $this , 'gutenberg_backend_scripts' ) );
446
+
447
+ // Support widget
448
+ add_action( 'admin_footer', array( $this, 'support_widget' ) );
449
  }
450
 
451
  }
Models/Settings.php CHANGED
@@ -766,6 +766,60 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
766
  array( $this, 'view_settings_page' )
767
  );
768
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
769
  }
770
 
771
  /**
@@ -2085,7 +2139,223 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
2085
 
2086
  add_action( 'wp_ajax_ta_get_global_settings_string' , array( $this , 'ajax_get_global_settings_string' ) );
2087
  add_action( 'wp_ajax_ta_import_settings' , array( $this , 'ajax_import_settings' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2088
 
 
 
 
 
 
 
 
2089
  }
2090
 
2091
  /**
@@ -2109,6 +2379,9 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
2109
 
2110
  add_filter( 'ta_admin_interfaces' , array( $this , 'register_admin_interfaces' ) );
2111
  add_filter( 'ta_menu_items' , array( $this , 'register_admin_menu_items' ) );
 
 
 
2112
  }
2113
 
2114
  }
766
  array( $this, 'view_settings_page' )
767
  );
768
 
769
+ if ( ! is_plugin_active( 'thirstyaffiliates-pro/thirstyaffiliates-pro.php' ) ) {
770
+ add_submenu_page(
771
+ 'edit.php?post_type=thirstylink',
772
+ __( 'Import CSV' , 'thirstyaffiliates' ),
773
+ __( 'Import CSV' , 'thirstyaffiliates' ),
774
+ 'manage_options',
775
+ 'thirsty_import',
776
+ array( $this , 'import_page' )
777
+ );
778
+
779
+ add_submenu_page(
780
+ 'edit.php?post_type=thirstylink',
781
+ __( 'Export CSV' , 'thirstyaffiliates' ),
782
+ __( 'Export CSV' , 'thirstyaffiliates' ),
783
+ 'manage_options',
784
+ 'thirsty_export',
785
+ array( $this , 'export_page' )
786
+ );
787
+
788
+ add_submenu_page(
789
+ 'edit.php?post_type=thirstylink',
790
+ __( 'Amazon Import' , 'thirstyaffiliates' ),
791
+ __( 'Amazon Import' , 'thirstyaffiliates' ),
792
+ 'manage_options',
793
+ 'amazon_import',
794
+ array( $this , 'amazon_import_page' )
795
+ );
796
+
797
+ add_submenu_page(
798
+ 'edit.php?post_type=thirstylink',
799
+ __( 'Event Notifications' , 'thirstyaffiliates' ),
800
+ __( 'Event Notifications' , 'thirstyaffiliates' ),
801
+ 'manage_options',
802
+ 'thirsty_event_notifications',
803
+ array( $this , 'event_notifications_page' )
804
+ );
805
+ }
806
+
807
+ }
808
+
809
+ public function import_page() {
810
+ include_once $this->_constants->VIEWS_ROOT_PATH() . 'importer/importer.php';
811
+ }
812
+
813
+ public function export_page() {
814
+ include_once $this->_constants->VIEWS_ROOT_PATH() . 'exporter/exporter.php';
815
+ }
816
+
817
+ public function amazon_import_page() {
818
+ include_once $this->_constants->VIEWS_ROOT_PATH() . 'amazon-import/amazon-import.php';
819
+ }
820
+
821
+ public function event_notifications_page() {
822
+ include_once $this->_constants->VIEWS_ROOT_PATH() . 'event-notifications/event-notifications.php';
823
  }
824
 
825
  /**
2139
 
2140
  add_action( 'wp_ajax_ta_get_global_settings_string' , array( $this , 'ajax_get_global_settings_string' ) );
2141
  add_action( 'wp_ajax_ta_import_settings' , array( $this , 'ajax_import_settings' ) );
2142
+ add_action( 'wp_ajax_ta_dismiss_upgrade_header', array( $this, 'dismiss_upgrade_header' ) );
2143
+ }
2144
+
2145
+ /**
2146
+ * Dismisses the TA upgrade header bar.
2147
+ *
2148
+ * @return void
2149
+ */
2150
+ public function dismiss_upgrade_header() {
2151
+
2152
+ // Security check
2153
+ if ( empty( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'ta_dismiss_upgrade_header' ) ) {
2154
+ die();
2155
+ }
2156
+
2157
+ update_option( 'ta_dismiss_upgrade_header', true );
2158
+ }
2159
+
2160
+ public function ta_admin_header() {
2161
+
2162
+ if ( is_plugin_active( 'thirstyaffiliates-pro/thirstyaffiliates-pro.php' ) || empty( $_GET['post_type'] ) || 'thirstylink' !== $_GET['post_type'] ) {
2163
+ return;
2164
+ }
2165
+
2166
+ $dismissed = get_option( 'ta_dismiss_upgrade_header', false );
2167
+
2168
+ if ( ! empty( $dismissed ) ) {
2169
+ return;
2170
+ }
2171
+
2172
+ ?>
2173
+
2174
+ <div class="ta-upgrade-header" id="ta-upgrade-header">
2175
+ <span id="close-ta-upgrade-header">X</span>
2176
+ <?php _e( 'You\'re using ThirstyAffiliates Lite. To unlock more features, consider <a href="https://thirstyaffiliates.com/pricing?utm_source=plugin_admin&utm_medium=link&utm_campaign=in_plugin&utm_content=upgrade_header">upgrading to Pro.</a>' ); ?>
2177
+ </div>
2178
+
2179
+ <div id="ta-admin-header"><img class="ta-logo" src="<?php echo $this->_constants->IMAGES_ROOT_URL() . 'TA.svg'; ?>" /></div>
2180
+
2181
+ <script>
2182
+ jQuery(document).ready(function($) {
2183
+ $('#close-ta-upgrade-header').click(function(event) {
2184
+ var upgradeHeader = $('#ta-upgrade-header');
2185
+ upgradeHeader.fadeOut();
2186
+ $.ajax({
2187
+ url: ajaxurl,
2188
+ type: 'POST',
2189
+ data: {
2190
+ action: 'ta_dismiss_upgrade_header',
2191
+ nonce: "<?php echo wp_create_nonce( 'ta_dismiss_upgrade_header' ); ?>"
2192
+ },
2193
+ })
2194
+ .done(function() {
2195
+ console.log("success");
2196
+ })
2197
+ .fail(function() {
2198
+ console.log("error");
2199
+ })
2200
+ .always(function() {
2201
+ console.log("complete");
2202
+ });
2203
+ });
2204
+ });
2205
+ </script>
2206
+
2207
+ <?php
2208
+ }
2209
+
2210
+ public function pro_meta_boxes() {
2211
+
2212
+ if ( empty( $_GET['post_type'] ) || 'thirstylink' !== $_GET['post_type'] || is_plugin_active( 'thirstyaffiliates-pro/thirstyaffiliates-pro.php' ) ) {
2213
+ return;
2214
+ }
2215
+
2216
+ if ( ! in_array( $GLOBALS['pagenow'], array( 'post.php', 'post-new.php' ) ) ) {
2217
+ return;
2218
+ }
2219
+
2220
+ ?>
2221
+
2222
+ <div id="ta-pro-settings" class="ta-blur-wrap">
2223
+ <div class="ta-blur">
2224
+ <div id="tap-autolink-keywords-metabox" class="postbox ">
2225
+ <button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Autolink Keywords</span><span class="toggle-indicator" aria-hidden="true"></span></button>
2226
+ <h2 class="hndle ui-sortable-handle"><span>Autolink Keywords</span></h2>
2227
+ <div class="inside">
2228
+ <p>
2229
+ <label class="info-label block" for="tap_autolink_keyword_list-selectized">Enter a list of keywords you wish to automatically link with this affiliate link (case-insensitive)</label>
2230
+ <div class="selectize-control multi plugin-restore_on_backspace plugin-remove_button plugin-drag_drop" style="width: 100%;">
2231
+ <div class="selectize-input items not-full ui-sortable"><input type="text" autocomplete="off" tabindex="" id="tap_autolink_keyword_list-selectized" style="width: 4px;"></div>
2232
+ </div>
2233
+ <span class="ta-input-description">Note: Place your keywords in order of precedence. eg. If "web design" is mentioned first and "web design course" second, it will link "web design" as first preference. Also, please type your entries rather than copy/pasting from the front end of your site. This will eliminate weird character encoding issues, especially relating to apostrophes. </span>
2234
+ </p>
2235
+ <p>
2236
+ <label class="info-label" for="tap_autolink_keyword_limit">
2237
+ Limit (per keyword): <span class="tooltip"></span>
2238
+ </label>
2239
+ <input type="number" class="ta-form-input" id="tap_autolink_keyword_limit" min="-1" step="1" value="0" placeholder="3" style="width: 100px;">
2240
+ </p>
2241
+ </div>
2242
+ </div>
2243
+ <div id="tap-geolocation-urls-metabox" class="postbox ">
2244
+ <button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Geolocation URLs</span><span class="toggle-indicator" aria-hidden="true"></span></button>
2245
+ <h2 class="hndle ui-sortable-handle"><span>Geolocation URLs</span></h2>
2246
+ <div class="inside">
2247
+ <p>Enter your geolocation URLs, these will override the destination URL above for visitors from these countries:</p>
2248
+ <div class="add-geo-link-form">
2249
+ <div class="field-wrap select-countries">
2250
+ <div class="selectize-control multi">
2251
+ <div class="selectize-input items not-full has-options"><input type="text" autocomplete="off" tabindex="" id="geolink_countries-selectized" placeholder="Select countries" style="width: 102px;"></div>
2252
+ </div>
2253
+ </div>
2254
+ <div class="field-wrap destination-input">
2255
+ <input type="text" id="geolink_destination" placeholder="Destination URL">
2256
+ </div>
2257
+ <div class="field-wrap geolink-button">
2258
+ <button type="button" id="add_geolink_btn" class="button-primary">Add Geolink</button>
2259
+ </div>
2260
+ </div>
2261
+ <table class="tap-geo-links-table">
2262
+ <thead>
2263
+ <tr>
2264
+ <th>Countries</th>
2265
+ <th>Destination URL</th>
2266
+ <th class="actions"></th>
2267
+ </tr>
2268
+ </thead>
2269
+ <tbody>
2270
+ <tr>
2271
+ <td colspan="3" style="text-align: center;">No geolocation links recorded.</td>
2272
+ </tr>
2273
+ </tbody>
2274
+ </table>
2275
+ </div>
2276
+ </div>
2277
+ <div id="tap-link-scheduler-metabox" class="postbox ">
2278
+ <button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Link Scheduler</span><span class="toggle-indicator" aria-hidden="true"></span></button>
2279
+ <h2 class="hndle ui-sortable-handle"><span>Link Scheduler</span></h2>
2280
+ <div class="inside">
2281
+ <p class="link-start-date-field date-field">
2282
+ <label class="info-label" for="ta_link_start_date">Start date:</label>
2283
+ <input type="text" class="ta-form-input range_datepicker start hasDatepicker" id="ta_link_start_date" value="" placeholder="yyyy-mm-dd" pattern="(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))">
2284
+ <span class="dashicons dashicons-calendar-alt"></span>
2285
+ </p>
2286
+ <p class="link-before-start-redirect-field url-field">
2287
+ <label class="info-label" for="ta_before_start_redirect">Before start redirect URL:</label>
2288
+ <input type="url" class="ta-form-input" id="ta_before_start_redirect" value="" placeholder="https://thirstyaffiliates.com/">
2289
+ </p>
2290
+ <p class="link-expire-date-field date-field">
2291
+ <label class="info-label" for="ta_link_expire_date">Expire date:</label>
2292
+ <span class="dashicons dashicons-calendar-alt"></span>
2293
+ <input type="text" class="ta-form-input range_datepicker expire hasDatepicker" id="ta_link_expire_date" value="" placeholder="yyyy-mm-dd" pattern="(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))">
2294
+ </p>
2295
+ <p class="link-after-expire-redirect-field url-field">
2296
+ <label class="info-label" for="ta_after_expire_redirect">Link expiration redirect URL:</label>
2297
+ <input type="url" class="ta-form-input" id="ta_after_expire_redirect" value="" placeholder="https://thirstyaffiliates.com/">
2298
+ </p>
2299
+ </div>
2300
+ </div>
2301
+ <div id="tap-preset-click-data-parameters-metabox" class="postbox ">
2302
+ <button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Preset Click Data Parameters</span><span class="toggle-indicator" aria-hidden="true"></span></button>
2303
+ <h2 class="hndle ui-sortable-handle"><span>Preset Click Data Parameters</span></h2>
2304
+ <div class="inside">
2305
+ <div class="add-preset-click-data-form">
2306
+ <div class="form-input ip-address-input">
2307
+ <label for="preset_ip_address">IP address</label>
2308
+ <input type="text" id="preset_ip_address" value="">
2309
+ </div>
2310
+ <div class="form-input referrer-address-input">
2311
+ <label for="preset_http_referrer">HTTP Referrer</label>
2312
+ <input type="url" id="preset_http_referrer" value="">
2313
+ </div>
2314
+ <div class="form-input keyword-input">
2315
+ <label for="preset_keyword">Keyword</label>
2316
+ <input type="text" id="preset_keyword" value="">
2317
+ </div>
2318
+ <div class="form-input form-submit">
2319
+ <div class="save">
2320
+ <button type="button" class="button-primary save-preset-click-data">Save</button>
2321
+ </div>
2322
+ </div>
2323
+ </div>
2324
+ <div class="preset-click-data-table">
2325
+ <table>
2326
+ <thead>
2327
+ <tr>
2328
+ <th class="qcode">Cloaked URL with code</th>
2329
+ <th class="ip-address">IP Address</th>
2330
+ <th class="referrer">HTTP Referrer</th>
2331
+ <th class="keyword">Keyword</th>
2332
+ <th class="actions"></th>
2333
+ </tr>
2334
+ </thead>
2335
+ <tbody>
2336
+ <tr class="no-result">
2337
+ <td colspan="5">No preset click data parameters saved yet.</td>
2338
+ </tr>
2339
+ </tbody>
2340
+ </table>
2341
+ </div>
2342
+ </div>
2343
+ </div>
2344
+ </div>
2345
+ <?php
2346
+ $section_title = 'Add Affiliate Link Pro features';
2347
+ $upgrade_link = 'https://thirstyaffiliates.com/pricing?utm_source=plugin_admin&utm_medium=link&utm_campaign=in_plugin&utm_content=pro_features';
2348
+ include_once $this->_constants->VIEWS_ROOT_PATH() . 'ta-upgrade.php';
2349
+ ?>
2350
+ </div>
2351
 
2352
+ <script>
2353
+ jQuery(document).ready(function($) {
2354
+ $('#ta-pro-settings').appendTo('#normal-sortables');
2355
+ });
2356
+ </script>
2357
+
2358
+ <?php
2359
  }
2360
 
2361
  /**
2379
 
2380
  add_filter( 'ta_admin_interfaces' , array( $this , 'register_admin_interfaces' ) );
2381
  add_filter( 'ta_menu_items' , array( $this , 'register_admin_menu_items' ) );
2382
+
2383
+ add_action( 'in_admin_header', array( $this, 'ta_admin_header' ), 0 );
2384
+ add_action( 'admin_footer', array( $this, 'pro_meta_boxes' ) );
2385
  }
2386
 
2387
  }
Models/Stats_Reporting.php CHANGED
@@ -189,7 +189,7 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
189
  *
190
  * @param Affiliate_Link $thirstylink Affiliate link object.
191
  * @param string $http_referer HTTP Referrer value.
192
- * @param string cloaked_url Affiliate link cloaked url.
193
  * @param string $redirect_url Link to where user is redirected to.
194
  * @param string $redirect_type Redirect type (301,302, etc.)
195
  * @param string $keyword Affiliate link keyword.
@@ -958,12 +958,16 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
958
  * @since 3.3.3 Moved code to a helper function (DRY).
959
  * @access public
960
  *
961
- * @param boolean $response Default response of filter.
962
- * @return boolean True if needs to be prevented, false otherwise.
963
  */
964
- public function prevent_save_click_if_useragent_is_bot( $response ) {
965
 
966
- return $this->_helper_functions->is_user_agent_bot();
 
 
 
 
967
  }
968
 
969
  /**
189
  *
190
  * @param Affiliate_Link $thirstylink Affiliate link object.
191
  * @param string $http_referer HTTP Referrer value.
192
+ * @param string $cloaked_url Affiliate link cloaked url.
193
  * @param string $redirect_url Link to where user is redirected to.
194
  * @param string $redirect_type Redirect type (301,302, etc.)
195
  * @param string $keyword Affiliate link keyword.
958
  * @since 3.3.3 Moved code to a helper function (DRY).
959
  * @access public
960
  *
961
+ * @param boolean $skip Whether to skip click tracking.
962
+ * @return boolean True if needs to be prevented, false otherwise.
963
  */
964
+ public function prevent_save_click_if_useragent_is_bot( $skip ) {
965
 
966
+ if ( $this->_helper_functions->is_user_agent_bot() ) {
967
+ $skip = true;
968
+ }
969
+
970
+ return $skip;
971
  }
972
 
973
  /**
css/admin/ta-admin.css ADDED
@@ -0,0 +1,373 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ta-upgrade-header {
2
+ text-align: center;
3
+ padding: 5px;
4
+ position: relative;
5
+ }
6
+
7
+ .ta-upgrade-header #close-ta-upgrade-header {
8
+ position: absolute;
9
+ right: 20px;
10
+ top: 3px;
11
+ }
12
+
13
+ .ta-upgrade-header #close-ta-upgrade-header:hover {
14
+ cursor: pointer;
15
+ }
16
+
17
+ .ta-upgrade-header a {
18
+ color: #F59431;
19
+ }
20
+
21
+ .ta-blur-wrap {
22
+ position: relative;
23
+ }
24
+
25
+ .ta-blur {
26
+ filter: blur(2px);
27
+ pointer-events: none;
28
+ }
29
+
30
+ .ta-upgrade {
31
+ position: absolute;
32
+ top: 0;
33
+ z-index: 10;
34
+ background: rgba( 0,0,0,.2 );
35
+ width: 700px;
36
+ left: calc(50% - 350px);
37
+ margin: 0 auto;
38
+ }
39
+
40
+ .ta-upgrade-wrap {
41
+ box-shadow: 0 0 30px #ccc;
42
+ }
43
+
44
+ .ta-upgrade-content .ta-upgrade-logo {
45
+ max-width: 400px;
46
+ margin: 0 auto;
47
+ }
48
+
49
+ .ta-upgrade-content {
50
+ background-color: #fff;
51
+ padding: 20px;
52
+ text-align: center;
53
+ }
54
+
55
+ .ta-upgrade-content h2 {
56
+ font-size: 22px;
57
+ }
58
+
59
+ .ta-upgrade-content h4 {
60
+ font-size: 18px;
61
+ }
62
+
63
+ .ta-upgrade-content .features {
64
+ display: grid;
65
+ grid-template-columns: 1fr 1fr;
66
+ grid-column-gap: 30px;
67
+ grid-row-gap: 10px;
68
+ align-items: center;
69
+ justify-content: center;
70
+ text-align: left;
71
+ padding: 10px;
72
+ max-width: 450px;
73
+ margin: 0 auto;
74
+ }
75
+
76
+ .ta-upgrade-content .features li:before {
77
+ content: "\f147";
78
+ font-family: dashicons;
79
+ color: #38AD9C;
80
+ font-size: 20px;
81
+ position: relative;
82
+ top: 4px;
83
+ margin-right: 10px;
84
+ }
85
+
86
+ .ta-upgrade-cta {
87
+ text-align: center;
88
+ background-color: #f2f2f2;
89
+ padding: 20px;
90
+ }
91
+
92
+ .ta-cta-button {
93
+ display: inline-block;
94
+ margin: 0 auto;
95
+ background-color: #FD9C27;
96
+ color: #fff;
97
+ padding: 15px 25px;
98
+ font-size: 18px;
99
+ font-weight: bold;
100
+ text-decoration: none;
101
+ border-radius: 5px;
102
+ }
103
+
104
+ .ta-upgrade-tr td {
105
+ position: relative;
106
+ }
107
+
108
+ .ta-upgrade-tr td .ta-upgrade {
109
+ top: 0;
110
+ height: 100%;
111
+ }
112
+
113
+ .ta-upgrade-tr.condensed td .ta-upgrade .features {
114
+ grid-row-gap: 0;
115
+ }
116
+
117
+ .ta-upgrade-tr.condensed td .ta-upgrade .features li {
118
+ margin-bottom: 0;
119
+ }
120
+
121
+ .ta-upgrade-tr.condensed td .ta-upgrade .ta-upgrade-content {
122
+ padding-bottom: 0;
123
+ }
124
+
125
+ .ta-upgrade-tr.condensed td .ta-upgrade .ta-upgrade-cta {
126
+ padding: 10px;
127
+ }
128
+
129
+ .ta-upgrade-tr.condensed td .ta-upgrade .ta-cta-button {
130
+ margin-bottom: 0;
131
+ padding: 10px 15px;
132
+ }
133
+
134
+ #wpcontent #ta-admin-header {
135
+ margin-left: -20px;
136
+ padding: 15px;
137
+ padding-left: 22px;
138
+ background-color: #f9f9f9;
139
+ background-repeat: repeat;
140
+ background-size: 1200px 75px;
141
+ min-height: 36px;
142
+ /* border-bottom: 2px solid #00cee6; */
143
+ }
144
+
145
+ #wpcontent #ta-admin-header img.ta-logo {
146
+ height: 36px;
147
+ }
148
+
149
+ #caseproof-flyout {
150
+ position: fixed;
151
+ z-index: 99999;
152
+ transition: all 0.2s ease-in-out;
153
+ right: 40px;
154
+ bottom: 40px;
155
+ opacity: 1;
156
+ }
157
+
158
+ @media (max-width: 959px) {
159
+ #caseproof-flyout {
160
+ display: none;
161
+ }
162
+ }
163
+
164
+ #caseproof-flyout .caseproof-flyout-head {
165
+ display: block;
166
+ }
167
+
168
+ #caseproof-flyout #caseproof-flyout-items svg {
169
+ max-width: 25px;
170
+ margin-top: 10px;
171
+ }
172
+
173
+ #caseproof-flyout .caseproof-flyout-head img {
174
+ width: 54px;
175
+ height: 54px;
176
+ display: block;
177
+ border-radius: 50%;
178
+ overflow: hidden;
179
+ transition: all 0.2s ease-in-out;
180
+ }
181
+
182
+ #caseproof-flyout .caseproof-flyout-head:hover img {
183
+ box-shadow: 0 3px 30px rgba(0, 0, 0, 0.25);
184
+ }
185
+
186
+ #caseproof-flyout .caseproof-flyout-head .caseproof-flyout-label {
187
+ opacity: 0;
188
+ transform: translateY(-50%) scale(0);
189
+ margin-right: -50px;
190
+ }
191
+
192
+ #caseproof-flyout .caseproof-flyout-head:hover .caseproof-flyout-label {
193
+ opacity: 1;
194
+ transform: translateY(-50%) scale(1);
195
+ margin-right: 0;
196
+ }
197
+
198
+ #caseproof-flyout .caseproof-flyout-head:focus {
199
+ box-shadow: none;
200
+ }
201
+
202
+ #caseproof-flyout .caseproof-flyout-head .caseproof-flyout-label {
203
+ right: calc(100% + 15px);
204
+ }
205
+
206
+ #caseproof-flyout .caseproof-flyout-label {
207
+ position: absolute;
208
+ display: block;
209
+ top: 50%;
210
+ right: calc(100% + 25px);
211
+ transform: translateY(-50%);
212
+ -moz-transform: translateY(-50%);
213
+ -webkit-transform: translateY(-50%);
214
+ color: #fff;
215
+ background: #5F5E5E 0 0 no-repeat padding-box;
216
+ font-size: 12px;
217
+ white-space: nowrap;
218
+ padding: 5px 10px;
219
+ height: auto !important;
220
+ line-height: initial;
221
+ transition: all 0.2s ease-out;
222
+ border-radius: 3px;
223
+ -moz-border-radius: 3px;
224
+ -webkit-border-radius: 3px;
225
+ }
226
+
227
+ #caseproof-flyout .caseproof-flyout-item {
228
+ position: absolute;
229
+ left: 10px;
230
+ width: 40px;
231
+ height: 40px;
232
+ opacity: 0;
233
+ visibility: hidden;
234
+ transition: all 0.2s ease-in-out;
235
+ transform: scale(0);
236
+ border-radius: 50%;
237
+ box-shadow: 0 3px 20px rgba(0, 0, 0, 0.2);
238
+ background: #008871 0 0 no-repeat padding-box;
239
+ text-align: center;
240
+ vertical-align: middle;
241
+ }
242
+
243
+ #caseproof-flyout .caseproof-flyout-item.caseproof-flyout-item-0 {
244
+ bottom: 75px;
245
+ }
246
+
247
+ #caseproof-flyout .caseproof-flyout-item.caseproof-flyout-item-1 {
248
+ bottom: 130px;
249
+ }
250
+
251
+ #caseproof-flyout .caseproof-flyout-item.caseproof-flyout-item-2 {
252
+ bottom: 185px;
253
+ }
254
+
255
+ #caseproof-flyout .caseproof-flyout-item.caseproof-flyout-item-3 {
256
+ bottom: 240px;
257
+ }
258
+
259
+ #caseproof-flyout .caseproof-flyout-item.caseproof-flyout-item-4 {
260
+ bottom: 295px;
261
+ }
262
+
263
+ #caseproof-flyout .caseproof-flyout-item:hover {
264
+ box-shadow: 0 3px 30px rgba(0, 0, 0, 0.25);
265
+ background: #0096F0 0 0 no-repeat padding-box;
266
+ }
267
+
268
+ #caseproof-flyout .caseproof-flyout-item:hover .caseproof-flyout-label {
269
+ background: #444444 0 0 no-repeat padding-box;
270
+ }
271
+
272
+ #caseproof-flyout.opened .caseproof-flyout-item {
273
+ opacity: 1;
274
+ visibility: visible;
275
+ transform: scale(1);
276
+ }
277
+
278
+ #caseproof-flyout.opened .caseproof-flyout-head .caseproof-flyout-label {
279
+ display: none;
280
+ }
281
+
282
+ #caseproof-flyout.opened .caseproof-flyout-item-0 {
283
+ transition: transform 0.2s 0ms, background-color 0.2s;
284
+ }
285
+
286
+ #caseproof-flyout.opened .caseproof-flyout-item-1 {
287
+ transition: transform 0.2s 35ms, background-color 0.2s;
288
+ }
289
+
290
+ #caseproof-flyout.opened .caseproof-flyout-item-2 {
291
+ transition: transform 0.2s 70ms, background-color 0.2s;
292
+ }
293
+
294
+ #caseproof-flyout.opened .caseproof-flyout-item-3 {
295
+ transition: transform 0.2s 105ms, background-color 0.2s;
296
+ }
297
+
298
+ #caseproof-flyout.opened .caseproof-flyout-item-4 {
299
+ transition: transform 0.2s 140ms, background-color 0.2s;
300
+ }
301
+
302
+ #caseproof-flyout.out {
303
+ opacity: 0;
304
+ visibility: hidden;
305
+ }
306
+
307
+ #main-controls {
308
+ display: block;
309
+ position: relative;
310
+ padding: 15px;
311
+ background-color: #fff;
312
+ box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
313
+ margin-bottom: 30px;
314
+ }
315
+
316
+ #main-controls #search-controls {
317
+ display: inline-block;
318
+ float: left;
319
+ text-align: left;
320
+ width: 70%;
321
+ }
322
+
323
+ #main-controls #search-controls .title {
324
+ margin-top: 0;
325
+ }
326
+
327
+ #main-controls #legend {
328
+ display: inline-block;
329
+ float: right;
330
+ text-align: left;
331
+ width: 30%;
332
+ }
333
+
334
+ #main-controls #legend .title {
335
+ margin-top: 0;
336
+ }
337
+
338
+ #main-controls #legend ul {
339
+ margin: 0;
340
+ padding: 0;
341
+ display: inline-block;
342
+ }
343
+
344
+ #main-controls #legend ul li {
345
+ display: inline-block;
346
+ margin-right: 10px;
347
+ margin-bottom: 0;
348
+ position: relative;
349
+ }
350
+
351
+ #main-controls #legend ul li.import-link .icon {
352
+ display: inline-block;
353
+ margin-right: 6px;
354
+ background-image: url(../../images/b6a9a66c9b34aeba2f02831641b2a568.png);
355
+ background-position: -15px 0;
356
+ width: 15px;
357
+ height: 20px;
358
+ }
359
+
360
+ #main-controls #legend ul li.quick-import .icon {
361
+ display: inline-block;
362
+ margin-right: 6px;
363
+ background-image: url(../../images/b6a9a66c9b34aeba2f02831641b2a568.png);
364
+ background-position: 0 -20px;
365
+ width: 15px;
366
+ height: 20px;
367
+ }
368
+
369
+ #main-controls #legend ul li.import-link .text {
370
+ display: inline-block;
371
+ top: -5px;
372
+ position: relative;
373
+ }
css/admin/ta-settings.css CHANGED
@@ -110,4 +110,4 @@ td.forminp.toggle-cat .selectize-input {
110
  td.forminp.toggle-cat .desc {
111
  display: inline;
112
  margin-left: 5px;
113
- }
110
  td.forminp.toggle-cat .desc {
111
  display: inline;
112
  margin-left: 5px;
113
+ }
images/TA-PRO.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 3568 469" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="4.37028" x2="768.13728" y1="116.18" y2="116.18"><stop offset="0" stop-color="#468c7d"/><stop offset=".5" stop-color="#408a98"/><stop offset="1" stop-color="#4a7c96"/></linearGradient><g transform="matrix(4.16667 0 0 4.16667 -18.2083 -15.9208)"><path d="m823.115 3.821 2.782 2.169 3.086-1.708 2.409 2.578 3.316-1.203 1.975 2.923 3.463-.671 1.494 3.196 3.525-.12.976 3.39 3.501.433.433 3.501 3.39.976-.12 3.525 3.196 1.494-.67 3.463 2.923 1.976-1.204 3.316 2.578 2.408-1.708 3.087 2.17 2.781-2.17 2.782 1.708 3.087-2.578 2.408 1.204 3.316-2.923 1.975.67 3.464-3.196 1.494.12 3.525-3.39.976-.433 3.5-3.501.434-.976 3.39-3.525-.12-1.494 3.195-3.463-.67-1.975 2.923-3.316-1.203-2.409 2.577-3.086-1.707-2.782 2.169-2.782-2.169-3.087 1.707-2.408-2.577-3.316 1.203-1.975-2.923-3.464.67-1.493-3.195-3.526.12-.975-3.39-3.501-.434-.433-3.5-3.39-.976.12-3.525-3.196-1.494.67-3.464-2.923-1.975 1.204-3.316-2.578-2.408 1.707-3.087-2.169-2.782 2.169-2.781-1.707-3.087 2.578-2.408-1.204-3.316 2.923-1.976-.67-3.463 3.196-1.494-.12-3.525 3.39-.976.433-3.501 3.501-.433.975-3.39 3.526.12 1.493-3.196 3.464.671 1.975-2.923 3.316 1.203 2.408-2.578 3.087 1.708z" fill="#17567e" fill-rule="nonzero"/><path d="m807.285 37.357c0 .987-.252 1.708-.754 2.163s-1.205.683-2.11.683h-3.574v-5.588h3.574c.905 0 1.608.21 2.11.631.502.42.754 1.124.754 2.111zm3.939-.026c0-2.051-.558-3.566-1.675-4.544-1.117-.979-2.615-1.468-4.493-1.468h-8.149v18.978h3.94v-6.824h3.952c2.062 0 3.648-.464 4.759-1.391s1.666-2.51 1.666-4.751zm11.26-2.716c.815 0 1.427.112 1.834.335.726.395 1.089 1.167 1.089 2.317 0 1.065-.375 1.777-1.125 2.137-.424.206-1.06.309-1.908.309h-4.268v-5.098zm.824-3.296h-9.077v18.978h3.875v-7.442h3.873c1.104 0 1.858.202 2.26.605.402.404.611 1.21.627 2.421l.026 1.763c.008.558.064 1.103.167 1.636.051.257.137.596.257 1.017h4.378v-.477c-.384-.231-.628-.592-.732-1.081-.07-.309-.105-.897-.105-1.764v-1.275c0-1.33-.182-2.319-.547-2.967s-.985-1.148-1.86-1.5c1.047-.361 1.798-.977 2.253-1.848.454-.871.682-1.757.682-2.659 0-.746-.117-1.411-.352-1.995-.234-.584-.552-1.116-.954-1.597-.485-.583-1.077-1.025-1.776-1.326-.699-.3-1.697-.463-2.995-.489zm18.006 16.145c-1.571 0-2.824-.579-3.759-1.738-.936-1.159-1.404-2.807-1.404-4.944s.468-3.785 1.404-4.944c.935-1.159 2.188-1.738 3.759-1.738s2.817.581 3.74 1.744c.923 1.164 1.384 2.809 1.384 4.938 0 2.137-.461 3.785-1.384 4.944s-2.169 1.738-3.74 1.738zm9.09-6.682c0-3.476-.957-6.085-2.871-7.828-1.434-1.476-3.507-2.215-6.219-2.215s-4.785.739-6.219 2.215c-1.922 1.743-2.884 4.352-2.884 7.828 0 3.408.962 6.017 2.884 7.828 1.434 1.476 3.507 2.215 6.219 2.215s4.785-.739 6.219-2.215c1.914-1.811 2.871-4.42 2.871-7.828z" fill="#fff" fill-rule="nonzero"/><path d="m10.434 101.426h17.651l12.853-47.973h19.008l4.073-15.388h-55.486l-4.163 15.388h19.008zm44.624 0h17.197l6.97-25.887c.784-2.836 1.901-5.024 3.349-6.563 1.448-1.538 3.379-2.308 5.793-2.308 1.75 0 3.092.453 4.028 1.358.935.905 1.403 2.172 1.403 3.802 0 .543-.045 1.176-.136 1.901-.09.724-.226 1.418-.407 2.081l-6.879 25.616h17.198l7.06-26.611c.422-1.569.77-3.092 1.041-4.571.272-1.478.408-2.881.408-4.209 0-4.526-1.253-8.101-3.757-10.726s-5.989-3.938-10.455-3.938c-2.896 0-5.537.679-7.92 2.037-2.384 1.358-4.421 2.912-6.11 4.661l6.065-22.719h-17.198zm59.377 0h17.198l13.125-48.969h-17.198zm14.03-53.404h17.922l3.44-12.672h-17.922zm14.663 53.404h17.198l3.983-14.754c1.568-5.852 3.876-10.137 6.924-12.853 3.046-2.715 6.925-4.073 11.631-4.073h1.449l4.887-18.103c-3.982-.301-7.453.529-10.409 2.489-2.957 1.962-5.612 4.693-7.965 8.192l2.625-9.867h-17.198zm72.683-.226c2.655-.935 4.873-2.218 6.653-3.847 1.779-1.629 3.107-3.499 3.983-5.612.874-2.111 1.312-4.345 1.312-6.698 0-2.051-.377-3.816-1.131-5.295-.755-1.478-1.765-2.761-3.032-3.847-1.268-1.086-2.731-2.037-4.39-2.851-1.661-.815-3.365-1.584-5.115-2.308-2.534-1.026-4.299-1.84-5.295-2.444-.995-.603-1.493-1.327-1.493-2.173 0-1.869 1.417-2.806 4.254-2.806 2.232 0 4.571.484 7.015 1.449s4.721 2.233 6.834 3.801l8.237-10.319c-2.233-1.81-5.205-3.408-8.916-4.797-3.711-1.387-7.8-2.082-12.265-2.082-3.38 0-6.397.453-9.051 1.358-2.656.905-4.888 2.127-6.698 3.666-1.811 1.539-3.2 3.38-4.164 5.521-.966 2.143-1.448 4.421-1.448 6.834 0 1.932.346 3.621 1.041 5.069.693 1.448 1.658 2.731 2.896 3.847 1.236 1.117 2.7 2.097 4.39 2.942 1.689.845 3.499 1.66 5.431 2.444 2.413.966 4.133 1.765 5.159 2.398 1.026.634 1.539 1.374 1.539 2.218 0 .905-.362 1.629-1.086 2.172s-1.81.815-3.259.815c-2.475 0-5.22-.573-8.237-1.72-3.018-1.145-5.702-2.775-8.055-4.888l-8.509 10.048c2.957 2.656 6.547 4.737 10.771 6.245 4.224 1.507 8.69 2.263 13.397 2.263 3.499 0 6.576-.469 9.232-1.403zm40.414.769c1.72-.303 3.363-.724 4.934-1.267l3.801-14.301c-2.534.905-4.708 1.357-6.517 1.357-2.595 0-3.892-1.025-3.892-3.077 0-.663.15-1.659.452-2.987l4.164-15.388h11.405l3.711-13.849h-11.405l3.349-12.4h-17.198l-3.349 12.4h-5.793l-3.711 13.849h5.793l-4.888 18.103c-.302 1.208-.529 2.324-.678 3.349-.152 1.027-.227 2.053-.227 3.078 0 3.621 1.222 6.458 3.666 8.508 2.444 2.052 6.169 3.078 11.179 3.078 1.749 0 3.485-.152 5.204-.453zm32.541 13.396c2.021-.543 3.968-1.403 5.839-2.579 1.869-1.177 3.666-2.716 5.385-4.617 1.72-1.901 3.454-4.24 5.205-7.015l30.323-48.697h-18.103l-16.474 29.418-1.992-29.418h-17.469l6.336 48.245c-.724.724-1.403 1.206-2.037 1.448-.633.24-1.373.362-2.217.362-2.294 0-4.557-.815-6.789-2.444l-7.694 12.582c1.69 1.086 3.562 1.946 5.612 2.579 2.051.634 4.526.951 7.423.951 2.412 0 4.63-.272 6.652-.815zm72.323-38.921 11.857-18.194 2.263 18.194zm-35.573 24.982h19.099l7.603-11.314h24.439l1.539 11.314h18.465l-9.866-63.813h-17.198zm78.568 0h17.198l9.504-35.12h10.681l3.62-13.577h-11.043l.272-.815c.421-1.568 1.116-2.729 2.082-3.485.964-.753 2.322-1.131 4.073-1.131.844 0 1.795.106 2.851.317 1.055.212 2.037.468 2.942.769l3.168-12.038c-1.629-.543-3.335-.951-5.114-1.222-1.781-.272-3.727-.408-5.838-.408-5.612 0-10.138 1.299-13.578 3.893-3.439 2.595-5.914 6.879-7.422 12.853l-.271.995h-5.703l-3.711 13.849h5.793zm41.004 0h17.198l9.504-35.12h10.681l3.621-13.577h-11.043l.271-.815c.422-1.568 1.116-2.729 2.082-3.485.965-.753 2.323-1.131 4.073-1.131.845 0 1.795.106 2.852.317 1.055.212 2.036.468 2.941.769l3.168-12.038c-1.629-.543-3.334-.951-5.114-1.222-1.78-.272-3.726-.408-5.838-.408-5.612 0-10.138 1.299-13.577 3.893-3.44 2.595-5.915 6.879-7.423 12.853l-.271.995h-5.703l-3.711 13.849h5.793zm38.741 0h17.198l13.124-48.969h-17.197zm14.03-53.404h17.922l3.438-12.672h-17.921zm13.214 53.404h17.198l17.741-66.076h-17.198zm29.055 0h17.198l13.125-48.969h-17.198zm14.03-53.404h17.922l3.44-12.672h-17.922zm32.947 42.588c-.905-.815-1.357-1.915-1.357-3.304 0-2.232.814-3.967 2.444-5.205 1.629-1.236 3.801-1.855 6.517-1.855 1.206 0 2.338.106 3.394.316 1.055.213 2.066.469 3.032.77l-.452 1.629c-.665 2.535-1.946 4.648-3.847 6.336-1.901 1.69-3.969 2.535-6.2 2.535-1.449 0-2.625-.408-3.531-1.222zm3.214 10.137c2.202-1.115 4.359-2.639 6.472-4.571l-1.358 5.25h16.926l7.242-26.973c.663-2.535.995-4.888.995-7.061 0-4.887-1.796-8.703-5.385-11.45-3.591-2.745-9.068-4.118-16.429-4.118-3.561 0-7.015.271-10.364.814-3.349.544-6.322 1.268-8.916 2.173l2.444 12.491c1.75-.663 3.816-1.236 6.2-1.72 2.384-.482 4.721-.724 7.015-.724 3.017 0 5.174.484 6.472 1.448 1.297.966 1.946 2.233 1.946 3.802 0 .604-.045 1.147-.135 1.629-.091.484-.197.936-.317 1.358l-.181.634c-1.932-.603-3.924-1.071-5.974-1.403-2.053-.331-4.195-.498-6.427-.498-3.259 0-6.2.393-8.825 1.176-2.625.785-4.888 1.932-6.789 3.44-1.901 1.509-3.364 3.319-4.39 5.431-1.027 2.113-1.539 4.526-1.539 7.241 0 4.104 1.268 7.347 3.802 9.731s5.823 3.575 9.866 3.575c2.897 0 5.445-.559 7.649-1.675zm58.563 1.222c1.72-.303 3.363-.724 4.933-1.267l3.802-14.301c-2.535.905-4.707 1.357-6.517 1.357-2.596 0-3.893-1.025-3.893-3.077 0-.663.15-1.659.453-2.987l4.164-15.388h11.405l3.711-13.849h-11.405l3.349-12.4h-17.198l-3.349 12.4h-5.793l-3.711 13.849h5.793l-4.888 18.103c-.303 1.208-.529 2.324-.679 3.349-.151 1.027-.226 2.053-.226 3.078 0 3.621 1.222 6.458 3.666 8.508 2.444 2.052 6.169 3.078 11.178 3.078 1.75 0 3.485-.152 5.205-.453zm35.528-29.055c1.025-2.956 2.579-5.174 4.661-6.653 2.082-1.478 4.269-2.218 6.563-2.218 2.292 0 3.982.62 5.068 1.856 1.087 1.237 1.63 2.701 1.63 4.39 0 .846-.152 1.72-.453 2.625zm31.318 8.78c.603-1.569 1.071-3.213 1.403-4.933.331-1.72.498-3.424.498-5.114 0-2.655-.407-5.205-1.222-7.649s-2.068-4.601-3.756-6.472c-1.691-1.869-3.847-3.363-6.472-4.48-2.625-1.116-5.748-1.675-9.369-1.675-4.525 0-8.599.86-12.219 2.58-3.621 1.72-6.714 3.968-9.278 6.743-2.566 2.777-4.526 5.929-5.884 9.459-1.357 3.53-2.036 7.106-2.036 10.726 0 3.32.543 6.307 1.629 8.961 1.086 2.656 2.625 4.933 4.616 6.834 1.992 1.901 4.436 3.364 7.332 4.39 2.897 1.025 6.155 1.539 9.776 1.539 4.284 0 8.056-.679 11.314-2.037 3.259-1.357 6.155-3.122 8.69-5.295l-7.966-9.413c-1.871 1.388-3.636 2.384-5.295 2.987-1.66.604-3.364.905-5.114.905-2.957 0-5.175-.724-6.653-2.173-1.479-1.448-2.308-3.408-2.489-5.883zm34.578 19.506c2.655-.935 4.872-2.218 6.653-3.847 1.779-1.629 3.107-3.499 3.982-5.612.874-2.111 1.313-4.345 1.313-6.698 0-2.051-.378-3.816-1.132-5.295-.755-1.478-1.765-2.761-3.032-3.847s-2.731-2.037-4.39-2.851c-1.66-.815-3.364-1.584-5.114-2.308-2.534-1.026-4.299-1.84-5.295-2.444-.996-.603-1.494-1.327-1.494-2.173 0-1.869 1.418-2.806 4.255-2.806 2.231 0 4.571.484 7.015 1.449s4.721 2.233 6.834 3.801l8.236-10.319c-2.233-1.81-5.204-3.408-8.915-4.797-3.711-1.387-7.8-2.082-12.265-2.082-3.38 0-6.397.453-9.052 1.358-2.656.905-4.888 2.127-6.698 3.666s-3.199 3.38-4.164 5.521c-.966 2.143-1.448 4.421-1.448 6.834 0 1.932.347 3.621 1.041 5.069.693 1.448 1.659 2.731 2.897 3.847 1.236 1.117 2.699 2.097 4.39 2.942 1.688.845 3.499 1.66 5.431 2.444 2.412.966 4.132 1.765 5.159 2.398 1.025.634 1.539 1.374 1.539 2.218 0 .905-.362 1.629-1.086 2.172-.725.543-1.811.815-3.259.815-2.475 0-5.22-.573-8.237-1.72-3.018-1.145-5.702-2.775-8.056-4.888l-8.508 10.048c2.957 2.656 6.547 4.737 10.771 6.245 4.223 1.507 8.69 2.263 13.396 2.263 3.499 0 6.577-.469 9.233-1.403z" fill="url(#a)"/></g></svg>
images/TA.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 3183 340" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="4.37028" x2="768.13728" y1="116.18" y2="116.18"><stop offset="0" stop-color="#468c7d"/><stop offset=".5" stop-color="#408a98"/><stop offset="1" stop-color="#4a7c96"/></linearGradient><path d="m10.434 101.426h17.651l12.853-47.973h19.008l4.073-15.388h-55.486l-4.163 15.388h19.008zm44.624 0h17.197l6.97-25.887c.784-2.836 1.901-5.024 3.349-6.563 1.448-1.538 3.379-2.308 5.793-2.308 1.75 0 3.092.453 4.028 1.358.935.905 1.403 2.172 1.403 3.802 0 .543-.045 1.176-.136 1.901-.09.724-.226 1.418-.407 2.081l-6.879 25.616h17.198l7.06-26.611c.422-1.569.77-3.092 1.041-4.571.272-1.478.408-2.881.408-4.209 0-4.526-1.253-8.101-3.757-10.726s-5.989-3.938-10.455-3.938c-2.896 0-5.537.679-7.92 2.037-2.384 1.358-4.421 2.912-6.11 4.661l6.065-22.719h-17.198zm59.377 0h17.198l13.125-48.969h-17.198zm14.03-53.404h17.922l3.44-12.672h-17.922zm14.663 53.404h17.198l3.983-14.754c1.568-5.852 3.876-10.137 6.924-12.853 3.046-2.715 6.925-4.073 11.631-4.073h1.449l4.887-18.103c-3.982-.301-7.453.529-10.409 2.489-2.957 1.962-5.612 4.693-7.965 8.192l2.625-9.867h-17.198zm72.683-.226c2.655-.935 4.873-2.218 6.653-3.847 1.779-1.629 3.107-3.499 3.983-5.612.874-2.111 1.312-4.345 1.312-6.698 0-2.051-.377-3.816-1.131-5.295-.755-1.478-1.765-2.761-3.032-3.847-1.268-1.086-2.731-2.037-4.39-2.851-1.661-.815-3.365-1.584-5.115-2.308-2.534-1.026-4.299-1.84-5.295-2.444-.995-.603-1.493-1.327-1.493-2.173 0-1.869 1.417-2.806 4.254-2.806 2.232 0 4.571.484 7.015 1.449s4.721 2.233 6.834 3.801l8.237-10.319c-2.233-1.81-5.205-3.408-8.916-4.797-3.711-1.387-7.8-2.082-12.265-2.082-3.38 0-6.397.453-9.051 1.358-2.656.905-4.888 2.127-6.698 3.666-1.811 1.539-3.2 3.38-4.164 5.521-.966 2.143-1.448 4.421-1.448 6.834 0 1.932.346 3.621 1.041 5.069.693 1.448 1.658 2.731 2.896 3.847 1.236 1.117 2.7 2.097 4.39 2.942 1.689.845 3.499 1.66 5.431 2.444 2.413.966 4.133 1.765 5.159 2.398 1.026.634 1.539 1.374 1.539 2.218 0 .905-.362 1.629-1.086 2.172s-1.81.815-3.259.815c-2.475 0-5.22-.573-8.237-1.72-3.018-1.145-5.702-2.775-8.055-4.888l-8.509 10.048c2.957 2.656 6.547 4.737 10.771 6.245 4.224 1.507 8.69 2.263 13.397 2.263 3.499 0 6.576-.469 9.232-1.403zm40.414.769c1.72-.303 3.363-.724 4.934-1.267l3.801-14.301c-2.534.905-4.708 1.357-6.517 1.357-2.595 0-3.892-1.025-3.892-3.077 0-.663.15-1.659.452-2.987l4.164-15.388h11.405l3.711-13.849h-11.405l3.349-12.4h-17.198l-3.349 12.4h-5.793l-3.711 13.849h5.793l-4.888 18.103c-.302 1.208-.529 2.324-.678 3.349-.152 1.027-.227 2.053-.227 3.078 0 3.621 1.222 6.458 3.666 8.508 2.444 2.052 6.169 3.078 11.179 3.078 1.749 0 3.485-.152 5.204-.453zm32.541 13.396c2.021-.543 3.968-1.403 5.839-2.579 1.869-1.177 3.666-2.716 5.385-4.617 1.72-1.901 3.454-4.24 5.205-7.015l30.323-48.697h-18.103l-16.474 29.418-1.992-29.418h-17.469l6.336 48.245c-.724.724-1.403 1.206-2.037 1.448-.633.24-1.373.362-2.217.362-2.294 0-4.557-.815-6.789-2.444l-7.694 12.582c1.69 1.086 3.562 1.946 5.612 2.579 2.051.634 4.526.951 7.423.951 2.412 0 4.63-.272 6.652-.815zm72.323-38.921 11.857-18.194 2.263 18.194zm-35.573 24.982h19.099l7.603-11.314h24.439l1.539 11.314h18.465l-9.866-63.813h-17.198zm78.568 0h17.198l9.504-35.12h10.681l3.62-13.577h-11.043l.272-.815c.421-1.568 1.116-2.729 2.082-3.485.964-.753 2.322-1.131 4.073-1.131.844 0 1.795.106 2.851.317 1.055.212 2.037.468 2.942.769l3.168-12.038c-1.629-.543-3.335-.951-5.114-1.222-1.781-.272-3.727-.408-5.838-.408-5.612 0-10.138 1.299-13.578 3.893-3.439 2.595-5.914 6.879-7.422 12.853l-.271.995h-5.703l-3.711 13.849h5.793zm41.004 0h17.198l9.504-35.12h10.681l3.621-13.577h-11.043l.271-.815c.422-1.568 1.116-2.729 2.082-3.485.965-.753 2.323-1.131 4.073-1.131.845 0 1.795.106 2.852.317 1.055.212 2.036.468 2.941.769l3.168-12.038c-1.629-.543-3.334-.951-5.114-1.222-1.78-.272-3.726-.408-5.838-.408-5.612 0-10.138 1.299-13.577 3.893-3.44 2.595-5.915 6.879-7.423 12.853l-.271.995h-5.703l-3.711 13.849h5.793zm38.741 0h17.198l13.124-48.969h-17.197zm14.03-53.404h17.922l3.438-12.672h-17.921zm13.214 53.404h17.198l17.741-66.076h-17.198zm29.055 0h17.198l13.125-48.969h-17.198zm14.03-53.404h17.922l3.44-12.672h-17.922zm32.947 42.588c-.905-.815-1.357-1.915-1.357-3.304 0-2.232.814-3.967 2.444-5.205 1.629-1.236 3.801-1.855 6.517-1.855 1.206 0 2.338.106 3.394.316 1.055.213 2.066.469 3.032.77l-.452 1.629c-.665 2.535-1.946 4.648-3.847 6.336-1.901 1.69-3.969 2.535-6.2 2.535-1.449 0-2.625-.408-3.531-1.222zm3.214 10.137c2.202-1.115 4.359-2.639 6.472-4.571l-1.358 5.25h16.926l7.242-26.973c.663-2.535.995-4.888.995-7.061 0-4.887-1.796-8.703-5.385-11.45-3.591-2.745-9.068-4.118-16.429-4.118-3.561 0-7.015.271-10.364.814-3.349.544-6.322 1.268-8.916 2.173l2.444 12.491c1.75-.663 3.816-1.236 6.2-1.72 2.384-.482 4.721-.724 7.015-.724 3.017 0 5.174.484 6.472 1.448 1.297.966 1.946 2.233 1.946 3.802 0 .604-.045 1.147-.135 1.629-.091.484-.197.936-.317 1.358l-.181.634c-1.932-.603-3.924-1.071-5.974-1.403-2.053-.331-4.195-.498-6.427-.498-3.259 0-6.2.393-8.825 1.176-2.625.785-4.888 1.932-6.789 3.44-1.901 1.509-3.364 3.319-4.39 5.431-1.027 2.113-1.539 4.526-1.539 7.241 0 4.104 1.268 7.347 3.802 9.731s5.823 3.575 9.866 3.575c2.897 0 5.445-.559 7.649-1.675zm58.563 1.222c1.72-.303 3.363-.724 4.933-1.267l3.802-14.301c-2.535.905-4.707 1.357-6.517 1.357-2.596 0-3.893-1.025-3.893-3.077 0-.663.15-1.659.453-2.987l4.164-15.388h11.405l3.711-13.849h-11.405l3.349-12.4h-17.198l-3.349 12.4h-5.793l-3.711 13.849h5.793l-4.888 18.103c-.303 1.208-.529 2.324-.679 3.349-.151 1.027-.226 2.053-.226 3.078 0 3.621 1.222 6.458 3.666 8.508 2.444 2.052 6.169 3.078 11.178 3.078 1.75 0 3.485-.152 5.205-.453zm35.528-29.055c1.025-2.956 2.579-5.174 4.661-6.653 2.082-1.478 4.269-2.218 6.563-2.218 2.292 0 3.982.62 5.068 1.856 1.087 1.237 1.63 2.701 1.63 4.39 0 .846-.152 1.72-.453 2.625zm31.318 8.78c.603-1.569 1.071-3.213 1.403-4.933.331-1.72.498-3.424.498-5.114 0-2.655-.407-5.205-1.222-7.649s-2.068-4.601-3.756-6.472c-1.691-1.869-3.847-3.363-6.472-4.48-2.625-1.116-5.748-1.675-9.369-1.675-4.525 0-8.599.86-12.219 2.58-3.621 1.72-6.714 3.968-9.278 6.743-2.566 2.777-4.526 5.929-5.884 9.459-1.357 3.53-2.036 7.106-2.036 10.726 0 3.32.543 6.307 1.629 8.961 1.086 2.656 2.625 4.933 4.616 6.834 1.992 1.901 4.436 3.364 7.332 4.39 2.897 1.025 6.155 1.539 9.776 1.539 4.284 0 8.056-.679 11.314-2.037 3.259-1.357 6.155-3.122 8.69-5.295l-7.966-9.413c-1.871 1.388-3.636 2.384-5.295 2.987-1.66.604-3.364.905-5.114.905-2.957 0-5.175-.724-6.653-2.173-1.479-1.448-2.308-3.408-2.489-5.883zm34.578 19.506c2.655-.935 4.872-2.218 6.653-3.847 1.779-1.629 3.107-3.499 3.982-5.612.874-2.111 1.313-4.345 1.313-6.698 0-2.051-.378-3.816-1.132-5.295-.755-1.478-1.765-2.761-3.032-3.847s-2.731-2.037-4.39-2.851c-1.66-.815-3.364-1.584-5.114-2.308-2.534-1.026-4.299-1.84-5.295-2.444-.996-.603-1.494-1.327-1.494-2.173 0-1.869 1.418-2.806 4.255-2.806 2.231 0 4.571.484 7.015 1.449s4.721 2.233 6.834 3.801l8.236-10.319c-2.233-1.81-5.204-3.408-8.915-4.797-3.711-1.387-7.8-2.082-12.265-2.082-3.38 0-6.397.453-9.052 1.358-2.656.905-4.888 2.127-6.698 3.666s-3.199 3.38-4.164 5.521c-.966 2.143-1.448 4.421-1.448 6.834 0 1.932.347 3.621 1.041 5.069.693 1.448 1.659 2.731 2.897 3.847 1.236 1.117 2.699 2.097 4.39 2.942 1.688.845 3.499 1.66 5.431 2.444 2.412.966 4.132 1.765 5.159 2.398 1.025.634 1.539 1.374 1.539 2.218 0 .905-.362 1.629-1.086 2.172-.725.543-1.811.815-3.259.815-2.475 0-5.22-.573-8.237-1.72-3.018-1.145-5.702-2.775-8.056-4.888l-8.508 10.048c2.957 2.656 6.547 4.737 10.771 6.245 4.223 1.507 8.69 2.263 13.396 2.263 3.499 0 6.577-.469 9.233-1.403z" fill="url(#a)" transform="matrix(4.16667 0 0 4.16667 -18.208348 -144.6498)"/></svg>
images/admin-flyout.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg clip-rule="evenodd" fill-rule="evenodd" stroke-linecap="square" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 501 480" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a"><stop offset="0" stop-color="#468c7d"/><stop offset="1" stop-color="#4a7c96"/></linearGradient><linearGradient id="b" gradientUnits="userSpaceOnUse" x1="32.632" x2="88.556" xlink:href="#a" y1="90.9792" y2="90.9792"/><linearGradient id="c" gradientUnits="userSpaceOnUse" x1="37.8319" x2="83.1303" xlink:href="#a" y1="85.0932" y2="85.0932"/><g transform="matrix(4.16667 0 0 4.16667 .03138 -10.4375)"><path d="m88.556 27.62h-53.416l-2.508 14.432h18.524l-8.624 48.928h16.28l8.624-48.928h18.612z" fill="url(#b)"/><path d="m98.658 101.968-5.949-10.307c-.636-1.1-.509-2.482.317-3.448 3.482-4.077 6.155-8.707 7.945-13.761.424-1.198 1.557-1.999 2.828-1.999l11.901-.001c1.762-8.112 1.756-16.799-.098-25.048l-11.797.071c-1.275 0-2.41-.805-2.831-2.008-1.772-5.061-4.442-9.685-7.936-13.744-.832-.966-.962-2.352-.324-3.457l5.939-10.287c-6.183-5.577-13.703-9.919-21.733-12.436l-5.841 10.26c-.635 1.099-1.892 1.68-3.14 1.451-5.265-.967-10.615-.967-15.903 0-1.249.228-2.506-.354-3.14-1.454l-5.929-10.295c-7.945 2.557-15.469 6.894-21.648 12.602l5.971 10.202c.636 1.101.509 2.482-.317 3.448-3.482 4.077-6.155 8.707-7.945 13.762-.424 1.198-1.557 1.998-2.827 1.998l-11.902.001c-1.761 8.113-1.755 16.8.098 25.048l11.797-.071c1.275 0 2.411.806 2.832 2.009 1.771 5.06 4.441 9.684 7.935 13.743.832.966.962 2.353.324 3.457l-5.951 10.308c6.183 5.577 13.703 9.919 21.733 12.436l5.841-10.26c.635-1.099 1.892-1.68 3.14-1.451 5.265.967 10.615.967 15.903 0 1.248-.228 2.504.353 3.138 1.451l5.95 10.308c7.947-2.555 15.471-6.892 21.65-12.6-.003-.003-.028.076-.031.072z" fill="#fff" fill-rule="nonzero"/><path d="m98.658 101.968-5.949-10.307c-.636-1.1-.509-2.482.317-3.448 3.482-4.077 6.155-8.707 7.945-13.761.424-1.198 1.557-1.999 2.828-1.999l11.901-.001c1.762-8.112 1.756-16.799-.098-25.048l-11.797.071c-1.275 0-2.41-.805-2.831-2.008-1.772-5.061-4.442-9.685-7.936-13.744-.832-.966-.962-2.352-.324-3.457l5.939-10.287c-6.183-5.577-13.703-9.919-21.733-12.436l-5.841 10.26c-.635 1.099-1.892 1.68-3.14 1.451-5.265-.967-10.615-.967-15.903 0-1.249.228-2.506-.354-3.14-1.454l-5.929-10.295c-7.945 2.557-15.469 6.894-21.648 12.602l5.971 10.202c.636 1.101.509 2.482-.317 3.448-3.482 4.077-6.155 8.707-7.945 13.762-.424 1.198-1.557 1.998-2.827 1.998l-11.902.001c-1.761 8.113-1.755 16.8.098 25.048l11.797-.071c1.275 0 2.411.806 2.832 2.009 1.771 5.06 4.441 9.684 7.935 13.743.832.966.962 2.353.324 3.457l-5.951 10.308c6.183 5.577 13.703 9.919 21.733 12.436l5.841-10.26c.635-1.099 1.892-1.68 3.14-1.451 5.265.967 10.615.967 15.903 0 1.248-.228 2.504.353 3.138 1.451l5.95 10.308c7.947-2.555 15.471-6.892 21.65-12.6-.003-.003-.028.076-.031.072z" fill="none" stroke="#388d98" stroke-width="6"/><path d="m83.13 33.772h-43.267l-2.032 11.69h15.005l-6.986 39.632h13.187l6.986-39.632h15.075z" fill="url(#c)"/></g></svg>
images/b6a9a66c9b34aeba2f02831641b2a568.png ADDED
Binary file
js/app/gutenberg_support/dist/gutenberg-support.css CHANGED
@@ -1,2 +1,2 @@
1
- .components-toolbar .ta-link-button path{fill:#30b2a6}.components-toolbar .ta-edit-image-button svg,.components-toolbar .ta-unlink-button svg{background:#30b2a6!important;color:#fff!important}.editor-rich-text ta,ta{-webkit-box-shadow:inset 0 -1px 0 #30b2a6;box-shadow:inset 0 -1px 0 #30b2a6;color:#222;text-decoration:none;-webkit-transition:color 80ms ease-in,-webkit-box-shadow .13s ease-in-out;transition:color 80ms ease-in,-webkit-box-shadow .13s ease-in-out;transition:color 80ms ease-in,box-shadow .13s ease-in-out;transition:color 80ms ease-in,box-shadow .13s ease-in-out,-webkit-box-shadow .13s ease-in-out}.editor-rich-text ta:hover,ta:hover{color:#000;-webkit-box-shadow:inset 0 0 0 #30b2a6,0 3px 0 #30b2a6;box-shadow:inset 0 0 0 #30b2a6,0 3px 0 #30b2a6}.wp-block-ta-image ta{-webkit-box-shadow:none;box-shadow:none;color:inherit}.wp-block-ta-image figcaption ta{-webkit-box-shadow:inset 0 -1px 0 #30b2a6;box-shadow:inset 0 -1px 0 #30b2a6}.ta-search-input .components-base-control__field{margin-bottom:0}.ta-url-popover .ta-invalid-link{background:#e35a5b;color:#fff;padding:5px 10px}.editor-styles-wrapper .ta-image-sel-wrap{width:100%}.editor-styles-wrapper .ta-image-sel-wrap h3{font-size:16px;margin:0}.editor-styles-wrapper .ta-image-sel-wrap .ta-image-selection button{background:transparent;border:none;cursor:pointer}.editor-styles-wrapper .ta-image-sel-wrap .ta-image-selection button img{max-width:100px;height:auto;cursor:pointer}.wp-block-image{max-width:100%;margin-bottom:1em;margin-left:0;margin-right:0 img;margin-right-max-width:100%}.wp-block-image.aligncenter{text-align:center}.wp-block-image.alignfull img,.wp-block-image.alignwide img{width:100%}.wp-block-image.aligncenter,.wp-block-image.alignleft,.wp-block-image.alignright{display:table;margin-left:0;margin-right:0}.wp-block-image.aligncenter>figcaption,.wp-block-image.alignleft>figcaption,.wp-block-image.alignright>figcaption{display:table-caption;caption-side:bottom}.wp-block-image.alignleft{float:left;margin-right:1em}.wp-block-image.alignright{float:right;margin-left:1em}.wp-block-image.aligncenter{margin-left:auto;margin-right:auto}[data-type="ta/image"][data-align=center] .editor-block-list__block-edit figure,[data-type="ta/image"][data-align=left] .editor-block-list__block-edit figure,[data-type="ta/image"][data-align=right] .editor-block-list__block-edit figure{margin:0;display:table}[data-type="ta/image"][data-align=center] .editor-block-list__block-edit .editor-rich-text,[data-type="ta/image"][data-align=left] .editor-block-list__block-edit .editor-rich-text,[data-type="ta/image"][data-align=right] .editor-block-list__block-edit .editor-rich-text{display:table-caption;caption-side:bottom}[data-type="ta/image"][data-align=full] figure img,[data-type="ta/image"][data-align=wide] figure img{width:100%}[data-type="ta/image"] .editor-block-list__block-edit figure.is-resized{margin:0;display:table}[data-type="ta/image"] .editor-block-list__block-edit figure.is-resized .editor-rich-text{display:table-caption;caption-side:bottom}.editor-block-list__block[data-type="ta/image"][data-align=center] .wp-block-image,.editor-block-list__block[data-type="ta/image"][data-align=center][data-resized=false] .wp-block-ta-image>div{margin-left:auto;margin-right:auto}
2
  /*# sourceMappingURL=gutenberg-support.css.map*/
1
+ .components-toolbar .ta-link-button path{fill:#30b2a6}.components-toolbar .ta-edit-image-button svg,.components-toolbar .ta-unlink-button svg{background:#30b2a6!important;color:#fff!important}.editor-rich-text ta,ta{-webkit-box-shadow:inset 0 -1px 0 #30b2a6;box-shadow:inset 0 -1px 0 #30b2a6;color:#222;text-decoration:none;-webkit-transition:color 80ms ease-in,-webkit-box-shadow .13s ease-in-out;transition:color 80ms ease-in,-webkit-box-shadow .13s ease-in-out;transition:color 80ms ease-in,box-shadow .13s ease-in-out;transition:color 80ms ease-in,box-shadow .13s ease-in-out,-webkit-box-shadow .13s ease-in-out}.editor-rich-text ta:hover,ta:hover{color:#000;-webkit-box-shadow:inset 0 0 0 #30b2a6,0 3px 0 #30b2a6;box-shadow:inset 0 0 0 #30b2a6,0 3px 0 #30b2a6}.wp-block-ta-image ta{-webkit-box-shadow:none;box-shadow:none;color:inherit}.wp-block-ta-image figcaption ta{-webkit-box-shadow:inset 0 -1px 0 #30b2a6;box-shadow:inset 0 -1px 0 #30b2a6}.ta-search-input .components-base-control__field{margin-bottom:0}.ta-url-popover .ta-invalid-link{background:#e35a5b;color:#fff;padding:5px 10px}.editor-styles-wrapper .ta-image-sel-wrap{width:100%}.editor-styles-wrapper .ta-image-sel-wrap h3{font-size:16px;margin:0}.editor-styles-wrapper .ta-image-sel-wrap .ta-image-selection button{background:transparent;border:none;cursor:pointer}.editor-styles-wrapper .ta-image-sel-wrap .ta-image-selection button img{max-width:100px;height:auto;cursor:pointer}[data-type="ta/image"][data-align=center] .editor-block-list__block-edit figure,[data-type="ta/image"][data-align=left] .editor-block-list__block-edit figure,[data-type="ta/image"][data-align=right] .editor-block-list__block-edit figure{margin:0;display:table}[data-type="ta/image"][data-align=center] .editor-block-list__block-edit .editor-rich-text,[data-type="ta/image"][data-align=left] .editor-block-list__block-edit .editor-rich-text,[data-type="ta/image"][data-align=right] .editor-block-list__block-edit .editor-rich-text{display:table-caption;caption-side:bottom}[data-type="ta/image"][data-align=full] figure img,[data-type="ta/image"][data-align=wide] figure img{width:100%}[data-type="ta/image"] .editor-block-list__block-edit figure.is-resized{margin:0;display:table}[data-type="ta/image"] .editor-block-list__block-edit figure.is-resized .editor-rich-text{display:table-caption;caption-side:bottom}.editor-block-list__block[data-type="ta/image"][data-align=center] .wp-block-image,.editor-block-list__block[data-type="ta/image"][data-align=center][data-resized=false] .wp-block-ta-image>div{margin-left:auto;margin-right:auto}
2
  /*# sourceMappingURL=gutenberg-support.css.map*/
js/app/gutenberg_support/dist/gutenberg-support.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///gutenberg-support.js","webpack:///webpack/bootstrap d99a01d6a74ed422ed81","webpack:///./node_modules/classnames/index.js","webpack:///./src/index.js","webpack:///./src/blocks/index.js","webpack:///./src/blocks/ta-image/index.js","webpack:///./src/blocks/ta-image/edit.js","webpack:///./src/blocks/ta-image/util.js","webpack:///./src/blocks/ta-image/image-size.js","webpack:///./src/blocks/ta-image/search-input.js","webpack:///./src/formats/index.js","webpack:///./src/formats/ta-link/index.js","webpack:///./src/formats/ta-link/inline.js","webpack:///./src/formats/ta-link/utils.js","webpack:///./src/formats/ta-link/url-popover.js","webpack:///./src/formats/ta-link/url-input.js","webpack:///./node_modules/dom-scroll-into-view/lib/index.js","webpack:///./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js","webpack:///./node_modules/dom-scroll-into-view/lib/util.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","classNames","classes","arguments","length","arg","argType","push","Array","isArray","inner","apply","key","hasOwn","join","default","undefined","__webpack_exports__","value","__WEBPACK_IMPORTED_MODULE_0__blocks__","__WEBPACK_IMPORTED_MODULE_1__formats__","__WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss__","registerBlocks","registerFormats","taimage","forEach","block","settings","registerBlockType","__WEBPACK_IMPORTED_MODULE_0__ta_image__","wp","blocks","_defineProperty","obj","writable","__WEBPACK_IMPORTED_MODULE_0_classnames__","__WEBPACK_IMPORTED_MODULE_0_classnames___default","__WEBPACK_IMPORTED_MODULE_1__edit__","Fragment","element","__","i18n","_wp$blocks","getPhrasingContentSchema","createBlock","getBlockAttributes","RichText","editor","_wp$components","components","Path","SVG","blockAttributes","url","type","source","selector","attribute","alt","caption","id","align","width","height","linkid","href","affiliateLink","imageSchema","img","attributes","title","description","icon","createElement","viewBox","xmlns","fill","category","keywords","getEditWrapperProps","data-align","data-resized","edit","save","_ref","_classnames","classnames","image","src","className","figure","Content","tagName","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","setPrototypeOf","__proto__","__WEBPACK_IMPORTED_MODULE_1__util__","__WEBPACK_IMPORTED_MODULE_2__image_size__","__WEBPACK_IMPORTED_MODULE_3__search_input__","_extends","assign","target","_slicedToArray","sliceIterator","arr","_arr","_n","_d","_e","_s","_i","Symbol","iterator","next","done","err","_createClass","defineProperties","props","descriptor","protoProps","staticProps","_lodash","lodash","isEmpty","map","last","pick","compact","getPath","_wp$i18n","sprintf","_wp$element","Component","createRef","_wp$blob","blob","getBlobByURL","revokeBlobURL","isBlobURL","Placeholder","Button","ButtonGroup","IconButton","PanelBody","ResizableBox","SelectControl","Spinner","TextControl","TextareaControl","Toolbar","withNotices","withSelect","ToggleControl","Popover","data","_wp$editor","BlockControls","InspectorControls","BlockAlignmentToolbar","MediaUpload","MediaUploadCheck","MediaPlaceholder","mediaUpload","withViewportMatch","viewport","compose","ALLOWED_MEDIA_TYPES","pickRelevantMediaFiles","imageProps","isTemporaryImage","isExternalImage","ImageEdit","_Component","this","_this","getPrototypeOf","updateAlt","bind","updateAlignment","onFocusCaption","onImageClick","onSelectImage","updateImageURL","updateWidth","updateHeight","updateDimensions","getFilename","toggleIsEditing","onImageError","onChangeInputValue","autocompleteRef","resetInvalidLink","updateImageSelection","onSelectAffiliateImage","editAFfiliateImage","state","captionFocused","isEditing","inputValue","post","showSuggestions","imageSelection","_this2","_props","setAttributes","noticeOperations","_attributes$url","file","filesList","onFileChange","_ref2","_ref3","allowedTypes","onError","message","createErrorNotice","setState","prevProps","_prevProps$attributes","prevID","_prevProps$attributes2","prevURL","_props$attributes","_props$attributes$url","isSelected","media","link","embedBlock","createUpgradedEmbedBlock","onReplace","newAlt","nextAlign","extraUpdatedAttributes","indexOf","parseInt","_this3","path","split","label","_props2","imageSizes","_ref4","slug","sizeUrl","invalidLink","_this4","apiFetch","addQueryArgs","context","_locale","then","source_url","images","_this5","_state","_props3","isLargeViewport","maxWidth","toggleSelection","isRTL","linkDestination","toolbarEditButton","onClick","controls","onChange","instructions","index","wp-block-image","is-transient","is-resized","is-focused","isResizable","imageSizeOptions","getImageSizeOptions","getInspectorControls","imageWidth","imageHeight","help","options","placeholder","min","aria-label","scale","scaledWidth","Math","round","scaledHeight","isCurrent","isSmall","isPrimary","aria-pressed","dirtynessTrigger","sizes","imageWidthWithinContainer","imageHeightWithinContainer","filename","defaultedAlt","style","currentWidth","currentHeight","ratio","minWidth","minHeight","maxWidthBuffer","showRightHandle","showLeftHandle","size","maxHeight","lockAspectRatio","enable","top","right","bottom","left","onResizeStart","onResizeStop","event","direction","elt","delta","unstableOnFocus","inlineToolbar","select","_select","getMedia","_select2","getEditorSettings","_getEditorSettings","includes","renderToString","attributesFromPreview","preview","matchingBlock","findBlock","DEFAULT_EMBED_BLOCK","html","isFromWordPress","noop","withGlobalEvents","ImageSize","bindContainer","calculateSize","ref","container","fetchImageSize","onload","window","Image","clientWidth","exceedMaxWidth","containerWidth","containerHeight","clientHeight","children","resize","withSpokenMessages","withInstanceId","ThirstyURLInput","inputRef","searchAffiliateLinks","suggestionNodes","posts","selectedSuggestion","loading","scrollingIntoView","scrollIntoView","current","onlyScrollIfNeeded","setTimeout","suggestionsRequest","formData","FormData","append","request","fetch","ajaxurl","method","body","response","json","affiliate_links","debouncedSpeak","catch","selectLink","instanceId","autoFocus","_state2","class","onSubmit","displayAffiliateImages","autocomplete","position","focusOnMount","role","tabIndex","bindSuggestionNode","is-selected","handleOnClick","aria-selected","_objectWithoutProperties","keys","taLink","registerFormatType","__WEBPACK_IMPORTED_MODULE_0__ta_link__","richText","__WEBPACK_IMPORTED_MODULE_0__inline__","_wp$richText","getTextContent","applyFormat","removeFormat","slice","isURL","RichTextToolbarButton","RichTextShortcut","getRectangleFromRange","dom","LinkEdit","addLink","stopAddingLink","onRemoveFormat","addingLink","text","speak","selection","getSelection","range","rangeCount","getRangeAt","rect","startContainer","nextElementSibling","nodeType","Node","ELEMENT_NODE","parentNode","closest","getBoundingClientRect","isActive","activeAttributes","anchorRect","getAnchorRect","character","onUse","shortcutType","shortcutCharacter","transform","createLinkFormat","toString","isShowingInput","editLink","__WEBPACK_IMPORTED_MODULE_1__utils__","__WEBPACK_IMPORTED_MODULE_2__url_popover__","__WEBPACK_IMPORTED_MODULE_3__url_input__","ExternalLink","_wp$keycodes","keycodes","LEFT","RIGHT","UP","DOWN","BACKSPACE","ENTER","_wp$url","prependHTTP","safeDecodeURI","filterURLForDisplay","insert","isCollapsed","stopKeyPropagation","stopPropagation","LinkEditor","onKeyDown","submitLink","onKeyPress","LinkViewerUrl","prependedURL","linkClassName","has-invalid-link","isValidHref","LinkViewer","InlineAffiliateLinkUI","onClickOutside","resetState","keyCode","preventDefault","selectedText","format","toInsert","autocompleteElement","contains","_props2$activeAttribu","showInput","onClose","updateLinkId","trimmedHref","trim","test","protocol","getProtocol","isValidProtocol","startsWith","authority","getAuthority","isValidAuthority","isValidPath","queryString","getQueryString","isValidQueryString","fragment","getFragment","isValidFragment","ThirstyURLPopover","toggleSettingsVisibility","isSettingsExpanded","renderSettings","_props$position","_props$focusOnMount","popoverProps","showSettings","aria-expanded","__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view__","__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view___default","throttle","TAB","stopEventPropagation","updateSuggestions","previousIndex","nextIndex","selectionStart","setSelectionRange","focus","_props$value","_props$autoFocus","_state3","required","onInput","aria-autocomplete","aria-owns","aria-activedescendant","noArrow","elem","config","util","getWindow","allowHorizontalScroll","alignWithTop","alignWithLeft","offsetTop","offsetLeft","offsetBottom","offsetRight","isWin","isWindow","elemOffset","offset","eh","outerHeight","ew","outerWidth","containerOffset","ch","cw","containerScroll","diffTop","diffBottom","win","winScroll","ww","wh","scrollLeft","scrollTop","parseFloat","css","getClientPosition","box","x","y","doc","ownerDocument","docElem","documentElement","clientLeft","clientTop","getScroll","w","ret","document","getScrollLeft","getScrollTop","getOffset","el","pos","defaultView","parentWindow","_getComputedStyle","computedStyle_","val","computedStyle","getComputedStyle","getPropertyValue","_getComputedStyleIE","CURRENT_STYLE","_RE_NUM_NO_PX","RE_POS","rsLeft","RUNTIME_STYLE","pixelLeft","PX","each","fn","isBorderBoxFn","getComputedStyleX","swap","callback","old","getPBMWidth","which","prop","j","cssProp","getWH","extra","domUtils","viewportWidth","viewportHeight","docWidth","docHeight","borderBoxValue","offsetWidth","offsetHeight","isBorderBox","cssBoxValue","Number","BORDER_INDEX","CONTENT_INDEX","borderBoxValueOrIsBorderBox","padding","PADDING_INDEX","BOX_MODELS","getWHIgnoreDisplay","args","cssShow","v","_typeof","setOffset","RE_NUM","RegExp","refWin","max","documentElementProp","compatMode","visibility","display","first","charAt","toUpperCase","includeMargin","node","clone","overflow","scrollTo"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,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AAApkB,KAAA8nB,EACA,MAAAvD,GAAAH,EAEA9O,QAAA0T,SAAAlB,EAAAtD,EAAAJ,QACK,CACL,OAAApkB,KAAA8nB,EACA,MAAA1D,GAAAf,UAEAe,GAAAf,WAAAyE,IAGAxE,UAAA,SAAAc,EAAA0D,GACA,GAAA1F,EAAAgC,GAAA,CACA,OAAApkB,KAAA8nB,EACA,MAAAtD,GAAAJ,EAEA9O,QAAA0T,SAAAzE,EAAAH,GAAA0D,OACK,CACL,OAAA9nB,KAAA8nB,EACA,MAAA1D,GAAAd,SAEAc,GAAAd,UAAAwE,IAIAnB,cAAA,EACAC,eAAA,GACCF,IlBgmGK,SAAUlpB,EAAQD","file":"gutenberg-support.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 1);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (true) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n\t\t\treturn classNames;\n\t\t}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__blocks__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__formats__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss__);\n\n\n\n\n\nObject(__WEBPACK_IMPORTED_MODULE_0__blocks__[\"a\" /* default */])();\nObject(__WEBPACK_IMPORTED_MODULE_1__formats__[\"a\" /* default */])();\n\n/***/ }),\n/* 2 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = registerBlocks;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ta_image__ = __webpack_require__(3);\n\n\nvar registerBlockType = wp.blocks.registerBlockType;\n\n/**\n * Register gutenberg blocks.\n * \n * @since 3.6\n */\n\nfunction registerBlocks() {\n\n [__WEBPACK_IMPORTED_MODULE_0__ta_image__].forEach(function (block) {\n if (!block) return;\n\n var name = block.name,\n settings = block.settings;\n\n registerBlockType(name, settings);\n });\n}\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"name\", function() { return name; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"settings\", function() { return settings; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__edit__ = __webpack_require__(4);\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar Fragment = wp.element.Fragment;\nvar __ = wp.i18n.__;\nvar _wp$blocks = wp.blocks,\n createBlock = _wp$blocks.createBlock,\n getBlockAttributes = _wp$blocks.getBlockAttributes,\n getPhrasingContentSchema = _wp$blocks.getPhrasingContentSchema;\nvar RichText = wp.editor.RichText;\nvar _wp$components = wp.components,\n Path = _wp$components.Path,\n SVG = _wp$components.SVG;\n\n\n\n\nvar name = 'ta/image';\n\nvar blockAttributes = {\n\turl: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'src'\n\t},\n\talt: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'alt',\n\t\tdefault: ''\n\t},\n\tcaption: {\n\t\ttype: 'string',\n\t\tsource: 'html',\n\t\tselector: 'figcaption'\n\t},\n\tid: {\n\t\ttype: 'number'\n\t},\n\talign: {\n\t\ttype: 'string'\n\t},\n\twidth: {\n\t\ttype: 'number'\n\t},\n\theight: {\n\t\ttype: 'number'\n\t},\n\tlinkid: {\n\t\ttype: 'number'\n\t},\n\thref: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'ta',\n\t\tattribute: 'href'\n\t},\n\taffiliateLink: {\n\t\ttype: 'object'\n\t}\n};\n\nvar imageSchema = {\n\timg: {\n\t\tattributes: ['src', 'alt'],\n\t\tclasses: ['alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\\d+$/]\n\t}\n};\n\nvar schema = {\n\tfigure: {\n\t\trequire: ['ta', 'img'],\n\t\tchildren: {\n\t\t\tta: {\n\t\t\t\tattributes: ['href', 'linkid'],\n\t\t\t\tchildren: imageSchema\n\t\t\t},\n\t\t\tfigcaption: {\n\t\t\t\tchildren: getPhrasingContentSchema()\n\t\t\t}\n\t\t}\n\t}\n};\n\nfunction getFirstAnchorAttributeFormHTML(html, attributeName) {\n\tvar _document$implementat = document.implementation.createHTMLDocument(''),\n\t body = _document$implementat.body;\n\n\tbody.innerHTML = html;\n\n\tvar firstElementChild = body.firstElementChild;\n\n\n\tif (firstElementChild && firstElementChild.nodeName === 'A') {\n\t\treturn firstElementChild.getAttribute(attributeName) || undefined;\n\t}\n}\n\nvar settings = {\n\ttitle: __('ThirstyAffiliates Image'),\n\n\tdescription: __('Insert an image with an affiliate link to make a visual statement.'),\n\n\ticon: wp.element.createElement(\n\t\tSVG,\n\t\t{ viewBox: \"0 0 24 24\", xmlns: \"http://www.w3.org/2000/svg\" },\n\t\twp.element.createElement(Path, { d: \"M0,0h24v24H0V0z\", fill: \"none\" }),\n\t\twp.element.createElement(Path, { d: \"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z\" }),\n\t\twp.element.createElement(Path, { d: \"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z\" })\n\t),\n\n\tcategory: 'common',\n\n\tkeywords: ['img', // \"img\" is not translated as it is intended to reflect the HTML <img> tag.\n\t__('photo'), __('affiliate')],\n\n\tattributes: blockAttributes,\n\n\tgetEditWrapperProps: function getEditWrapperProps(attributes) {\n\t\tvar align = attributes.align,\n\t\t width = attributes.width;\n\n\t\tif ('left' === align || 'center' === align || 'right' === align || 'wide' === align || 'full' === align) {\n\t\t\treturn { 'data-align': align, 'data-resized': !!width };\n\t\t}\n\t},\n\n\n\tedit: __WEBPACK_IMPORTED_MODULE_1__edit__[\"a\" /* default */],\n\n\tsave: function save(_ref) {\n\t\tvar _classnames;\n\n\t\tvar attributes = _ref.attributes;\n\t\tvar url = attributes.url,\n\t\t alt = attributes.alt,\n\t\t caption = attributes.caption,\n\t\t align = attributes.align,\n\t\t width = attributes.width,\n\t\t height = attributes.height,\n\t\t id = attributes.id,\n\t\t linkid = attributes.linkid,\n\t\t href = attributes.href;\n\n\n\t\tvar classes = __WEBPACK_IMPORTED_MODULE_0_classnames___default()((_classnames = {}, _defineProperty(_classnames, \"align\" + align, align), _defineProperty(_classnames, 'is-resized', width || height), _classnames));\n\n\t\tvar image = wp.element.createElement(\"img\", {\n\t\t\tsrc: url,\n\t\t\talt: alt,\n\t\t\tclassName: id ? \"wp-image-\" + id : null,\n\t\t\twidth: width,\n\t\t\theight: height\n\t\t});\n\n\t\tvar figure = wp.element.createElement(\n\t\t\tFragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\t\"ta\",\n\t\t\t\t{ linkid: linkid, href: href },\n\t\t\t\timage\n\t\t\t),\n\t\t\twp.element.createElement(RichText.Content, { tagName: \"figcaption\", value: caption })\n\t\t);\n\n\t\tif ('left' === align || 'right' === align || 'center' === align) {\n\t\t\treturn wp.element.createElement(\n\t\t\t\t\"div\",\n\t\t\t\t{ className: \"wp-block-image\" },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t\"figure\",\n\t\t\t\t\t{ className: classes },\n\t\t\t\t\tfigure\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn wp.element.createElement(\n\t\t\t\"figure\",\n\t\t\t{ className: \"wp-block-image \" + classes },\n\t\t\tfigure\n\t\t);\n\t}\n};\n\n/***/ }),\n/* 4 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export pickRelevantMediaFiles */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(5);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__image_size__ = __webpack_require__(6);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__search_input__ = __webpack_require__(7);\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nvar _lodash = lodash,\n get = _lodash.get,\n isEmpty = _lodash.isEmpty,\n map = _lodash.map,\n last = _lodash.last,\n pick = _lodash.pick,\n compact = _lodash.compact;\nvar getPath = wp.url.getPath;\nvar _wp$i18n = wp.i18n,\n __ = _wp$i18n.__,\n sprintf = _wp$i18n.sprintf;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n Fragment = _wp$element.Fragment,\n createRef = _wp$element.createRef;\nvar _wp$blob = wp.blob,\n getBlobByURL = _wp$blob.getBlobByURL,\n revokeBlobURL = _wp$blob.revokeBlobURL,\n isBlobURL = _wp$blob.isBlobURL;\nvar _wp$components = wp.components,\n Placeholder = _wp$components.Placeholder,\n Button = _wp$components.Button,\n ButtonGroup = _wp$components.ButtonGroup,\n IconButton = _wp$components.IconButton,\n PanelBody = _wp$components.PanelBody,\n ResizableBox = _wp$components.ResizableBox,\n SelectControl = _wp$components.SelectControl,\n Spinner = _wp$components.Spinner,\n TextControl = _wp$components.TextControl,\n TextareaControl = _wp$components.TextareaControl,\n Toolbar = _wp$components.Toolbar,\n withNotices = _wp$components.withNotices,\n ToggleControl = _wp$components.ToggleControl,\n Popover = _wp$components.Popover;\nvar withSelect = wp.data.withSelect;\nvar _wp$editor = wp.editor,\n RichText = _wp$editor.RichText,\n BlockControls = _wp$editor.BlockControls,\n InspectorControls = _wp$editor.InspectorControls,\n MediaUpload = _wp$editor.MediaUpload,\n MediaUploadCheck = _wp$editor.MediaUploadCheck,\n MediaPlaceholder = _wp$editor.MediaPlaceholder,\n BlockAlignmentToolbar = _wp$editor.BlockAlignmentToolbar,\n mediaUpload = _wp$editor.mediaUpload;\nvar withViewportMatch = wp.viewport.withViewportMatch;\nvar compose = wp.compose.compose;\n\n\n\n\n\n\n/**\n * Module constants\n */\nvar MIN_SIZE = 20;\nvar LINK_DESTINATION_NONE = 'none';\nvar LINK_DESTINATION_MEDIA = 'media';\nvar LINK_DESTINATION_ATTACHMENT = 'attachment';\nvar LINK_DESTINATION_CUSTOM = 'custom';\nvar NEW_TAB_REL = 'noreferrer noopener';\nvar ALLOWED_MEDIA_TYPES = ['image'];\n\nvar pickRelevantMediaFiles = function pickRelevantMediaFiles(image) {\n\tvar imageProps = pick(image, ['alt', 'id', 'link', 'caption']);\n\timageProps.url = get(image, ['sizes', 'large', 'url']) || get(image, ['media_details', 'sizes', 'large', 'source_url']) || image.url;\n\treturn imageProps;\n};\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily\n * while the image is being uploaded and will not have an id yet allocated.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the URL a Blob URL\n */\nvar isTemporaryImage = function isTemporaryImage(id, url) {\n\treturn !id && isBlobURL(url);\n};\n\n/**\n * Is the url for the image hosted externally. An externally hosted image has no id\n * and is not a blob url.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the url an externally hosted url?\n */\nvar isExternalImage = function isExternalImage(id, url) {\n\treturn url && !id && !isBlobURL(url);\n};\n\nvar ImageEdit = function (_Component) {\n\t_inherits(ImageEdit, _Component);\n\n\tfunction ImageEdit(_ref) {\n\t\tvar attributes = _ref.attributes;\n\n\t\t_classCallCheck(this, ImageEdit);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ImageEdit.__proto__ || Object.getPrototypeOf(ImageEdit)).apply(this, arguments));\n\n\t\t_this.updateAlt = _this.updateAlt.bind(_this);\n\t\t_this.updateAlignment = _this.updateAlignment.bind(_this);\n\t\t_this.onFocusCaption = _this.onFocusCaption.bind(_this);\n\t\t_this.onImageClick = _this.onImageClick.bind(_this);\n\t\t_this.onSelectImage = _this.onSelectImage.bind(_this);\n\t\t_this.updateImageURL = _this.updateImageURL.bind(_this);\n\t\t_this.updateWidth = _this.updateWidth.bind(_this);\n\t\t_this.updateHeight = _this.updateHeight.bind(_this);\n\t\t_this.updateDimensions = _this.updateDimensions.bind(_this);\n\t\t_this.getFilename = _this.getFilename.bind(_this);\n\t\t_this.toggleIsEditing = _this.toggleIsEditing.bind(_this);\n\t\t_this.onImageError = _this.onImageError.bind(_this);\n\t\t_this.onChangeInputValue = _this.onChangeInputValue.bind(_this);\n\t\t_this.autocompleteRef = createRef();\n\t\t_this.resetInvalidLink = _this.resetInvalidLink.bind(_this);\n\t\t_this.updateImageSelection = _this.updateImageSelection.bind(_this);\n\t\t_this.onSelectAffiliateImage = _this.onSelectAffiliateImage.bind(_this);\n\t\t_this.editAFfiliateImage = _this.editAFfiliateImage.bind(_this);\n\n\t\t_this.state = {\n\t\t\tcaptionFocused: false,\n\t\t\tisEditing: !attributes.url,\n\t\t\tinputValue: '',\n\t\t\tlinkid: 0,\n\t\t\tpost: null,\n\t\t\tshowSuggestions: false,\n\t\t\timageSelection: [],\n\t\t\taffiliateLink: null\n\t\t};\n\t\treturn _this;\n\t}\n\n\t_createClass(ImageEdit, [{\n\t\tkey: \"componentDidMount\",\n\t\tvalue: function componentDidMount() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar _props = this.props,\n\t\t\t attributes = _props.attributes,\n\t\t\t setAttributes = _props.setAttributes,\n\t\t\t noticeOperations = _props.noticeOperations;\n\t\t\tvar id = attributes.id,\n\t\t\t _attributes$url = attributes.url,\n\t\t\t url = _attributes$url === undefined ? '' : _attributes$url;\n\n\n\t\t\tif (isTemporaryImage(id, url)) {\n\t\t\t\tvar file = getBlobByURL(url);\n\n\t\t\t\tif (file) {\n\t\t\t\t\tmediaUpload({\n\t\t\t\t\t\tfilesList: [file],\n\t\t\t\t\t\tonFileChange: function onFileChange(_ref2) {\n\t\t\t\t\t\t\tvar _ref3 = _slicedToArray(_ref2, 1),\n\t\t\t\t\t\t\t image = _ref3[0];\n\n\t\t\t\t\t\t\tsetAttributes(pickRelevantMediaFiles(image));\n\t\t\t\t\t\t},\n\t\t\t\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\t\t\t\tonError: function onError(message) {\n\t\t\t\t\t\t\tnoticeOperations.createErrorNotice(message);\n\t\t\t\t\t\t\t_this2.setState({ isEditing: true });\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"componentDidUpdate\",\n\t\tvalue: function componentDidUpdate(prevProps) {\n\t\t\tvar _prevProps$attributes = prevProps.attributes,\n\t\t\t prevID = _prevProps$attributes.id,\n\t\t\t _prevProps$attributes2 = _prevProps$attributes.url,\n\t\t\t prevURL = _prevProps$attributes2 === undefined ? '' : _prevProps$attributes2;\n\t\t\tvar _props$attributes = this.props.attributes,\n\t\t\t id = _props$attributes.id,\n\t\t\t _props$attributes$url = _props$attributes.url,\n\t\t\t url = _props$attributes$url === undefined ? '' : _props$attributes$url;\n\n\n\t\t\tif (isTemporaryImage(prevID, prevURL) && !isTemporaryImage(id, url)) {\n\t\t\t\trevokeBlobURL(url);\n\t\t\t}\n\n\t\t\tif (!this.props.isSelected && prevProps.isSelected && this.state.captionFocused) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tcaptionFocused: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"onSelectImage\",\n\t\tvalue: function onSelectImage(media) {\n\n\t\t\tif (!media || !media.url) {\n\t\t\t\tthis.props.setAttributes({\n\t\t\t\t\turl: undefined,\n\t\t\t\t\talt: undefined,\n\t\t\t\t\tid: undefined,\n\t\t\t\t\tcaption: undefined\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar affiliateLink = this.state.affiliateLink;\n\n\n\t\t\tthis.setState({\n\t\t\t\tisEditing: false\n\t\t\t});\n\n\t\t\tthis.props.setAttributes(_extends({}, pickRelevantMediaFiles(media), {\n\t\t\t\tlinkid: affiliateLink.id,\n\t\t\t\thref: affiliateLink.link,\n\t\t\t\taffiliateLink: affiliateLink,\n\t\t\t\twidth: undefined,\n\t\t\t\theight: undefined\n\t\t\t}));\n\t\t}\n\t}, {\n\t\tkey: \"onImageError\",\n\t\tvalue: function onImageError(url) {\n\t\t\t// Check if there's an embed block that handles this URL.\n\t\t\tvar embedBlock = Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"a\" /* createUpgradedEmbedBlock */])({ attributes: { url: url } });\n\t\t\tif (undefined !== embedBlock) {\n\t\t\t\tthis.props.onReplace(embedBlock);\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"onFocusCaption\",\n\t\tvalue: function onFocusCaption() {\n\t\t\tif (!this.state.captionFocused) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tcaptionFocused: true\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"onImageClick\",\n\t\tvalue: function onImageClick() {\n\t\t\tif (this.state.captionFocused) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tcaptionFocused: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"updateAlt\",\n\t\tvalue: function updateAlt(newAlt) {\n\t\t\tthis.props.setAttributes({ alt: newAlt });\n\t\t}\n\t}, {\n\t\tkey: \"updateAlignment\",\n\t\tvalue: function updateAlignment(nextAlign) {\n\t\t\tvar extraUpdatedAttributes = ['wide', 'full'].indexOf(nextAlign) !== -1 ? { width: undefined, height: undefined } : {};\n\t\t\tthis.props.setAttributes(_extends({}, extraUpdatedAttributes, { align: nextAlign }));\n\t\t}\n\t}, {\n\t\tkey: \"updateImageURL\",\n\t\tvalue: function updateImageURL(url) {\n\t\t\tthis.props.setAttributes({ url: url, width: undefined, height: undefined });\n\t\t}\n\t}, {\n\t\tkey: \"updateWidth\",\n\t\tvalue: function updateWidth(width) {\n\t\t\tthis.props.setAttributes({ width: parseInt(width, 10) });\n\t\t}\n\t}, {\n\t\tkey: \"updateHeight\",\n\t\tvalue: function updateHeight(height) {\n\t\t\tthis.props.setAttributes({ height: parseInt(height, 10) });\n\t\t}\n\t}, {\n\t\tkey: \"updateDimensions\",\n\t\tvalue: function updateDimensions() {\n\t\t\tvar _this3 = this;\n\n\t\t\tvar width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\t\t\tvar height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\t\treturn function () {\n\t\t\t\t_this3.props.setAttributes({ width: width, height: height });\n\t\t\t};\n\t\t}\n\t}, {\n\t\tkey: \"getFilename\",\n\t\tvalue: function getFilename(url) {\n\t\t\tvar path = getPath(url);\n\t\t\tif (path) {\n\t\t\t\treturn last(path.split('/'));\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"getLinkDestinationOptions\",\n\t\tvalue: function getLinkDestinationOptions() {\n\t\t\treturn [{ value: LINK_DESTINATION_NONE, label: __('None') }, { value: LINK_DESTINATION_MEDIA, label: __('Media File') }, { value: LINK_DESTINATION_ATTACHMENT, label: __('Attachment Page') }, { value: LINK_DESTINATION_CUSTOM, label: __('Custom URL') }];\n\t\t}\n\t}, {\n\t\tkey: \"toggleIsEditing\",\n\t\tvalue: function toggleIsEditing() {\n\t\t\tthis.setState({\n\t\t\t\tisEditing: !this.state.isEditing\n\t\t\t});\n\t\t}\n\t}, {\n\t\tkey: \"getImageSizeOptions\",\n\t\tvalue: function getImageSizeOptions() {\n\t\t\tvar _props2 = this.props,\n\t\t\t imageSizes = _props2.imageSizes,\n\t\t\t image = _props2.image;\n\n\t\t\treturn compact(map(imageSizes, function (_ref4) {\n\t\t\t\tvar name = _ref4.name,\n\t\t\t\t slug = _ref4.slug;\n\n\t\t\t\tvar sizeUrl = get(image, ['media_details', 'sizes', slug, 'source_url']);\n\t\t\t\tif (!sizeUrl) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tvalue: sizeUrl,\n\t\t\t\t\tlabel: name\n\t\t\t\t};\n\t\t\t}));\n\t\t}\n\t}, {\n\t\tkey: \"onChangeInputValue\",\n\t\tvalue: function onChangeInputValue(inputValue) {\n\t\t\tvar post = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n\t\t\tvar linkid = post ? post.id : 0;\n\t\t\tthis.setState({ inputValue: inputValue, linkid: linkid, post: post });\n\t\t}\n\t}, {\n\t\tkey: \"resetInvalidLink\",\n\t\tvalue: function resetInvalidLink() {\n\t\t\tthis.setState({ invalidLink: false });\n\t\t}\n\t}, {\n\t\tkey: \"updateImageSelection\",\n\t\tvalue: function updateImageSelection(imageSelection, affiliateLink) {\n\t\t\tthis.setState({\n\t\t\t\timageSelection: imageSelection,\n\t\t\t\taffiliateLink: affiliateLink\n\t\t\t});\n\t\t}\n\t}, {\n\t\tkey: \"onSelectAffiliateImage\",\n\t\tvalue: function onSelectAffiliateImage(image) {\n\t\t\tvar _this4 = this;\n\n\t\t\tif (isExternalImage(image.id, image.src)) {\n\t\t\t\timage.url = image.src;\n\t\t\t\tthis.onSelectImage(image);\n\t\t\t} else {\n\t\t\t\tvar request = wp.apiFetch({\n\t\t\t\t\tpath: wp.url.addQueryArgs('/wp/v2/media/' + image.id, {\n\t\t\t\t\t\tcontext: 'edit',\n\t\t\t\t\t\t_locale: 'user'\n\t\t\t\t\t})\n\t\t\t\t});\n\n\t\t\t\trequest.then(function (media) {\n\t\t\t\t\tmedia.url = media.source_url;\n\t\t\t\t\t_this4.onSelectImage(media);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"editAFfiliateImage\",\n\t\tvalue: function editAFfiliateImage() {\n\t\t\tvar attributes = this.props.attributes;\n\t\t\tvar affiliateLink = attributes.affiliateLink;\n\n\n\t\t\tthis.setState({\n\t\t\t\tisEditing: true,\n\t\t\t\timageSelection: affiliateLink.images,\n\t\t\t\taffiliateLink: affiliateLink\n\t\t\t});\n\t\t}\n\t}, {\n\t\tkey: \"render\",\n\t\tvalue: function render() {\n\t\t\tvar _this5 = this;\n\n\t\t\tvar _state = this.state,\n\t\t\t isEditing = _state.isEditing,\n\t\t\t imageSelection = _state.imageSelection,\n\t\t\t affiliateLink = _state.affiliateLink;\n\t\t\tvar _props3 = this.props,\n\t\t\t attributes = _props3.attributes,\n\t\t\t setAttributes = _props3.setAttributes,\n\t\t\t isLargeViewport = _props3.isLargeViewport,\n\t\t\t isSelected = _props3.isSelected,\n\t\t\t className = _props3.className,\n\t\t\t maxWidth = _props3.maxWidth,\n\t\t\t toggleSelection = _props3.toggleSelection,\n\t\t\t isRTL = _props3.isRTL;\n\t\t\tvar url = attributes.url,\n\t\t\t alt = attributes.alt,\n\t\t\t caption = attributes.caption,\n\t\t\t align = attributes.align,\n\t\t\t linkDestination = attributes.linkDestination,\n\t\t\t width = attributes.width,\n\t\t\t height = attributes.height,\n\t\t\t linkid = attributes.linkid,\n\t\t\t href = attributes.href;\n\n\t\t\tvar toolbarEditButton = wp.element.createElement(\n\t\t\t\tToolbar,\n\t\t\t\tnull,\n\t\t\t\twp.element.createElement(IconButton, {\n\t\t\t\t\tclassName: \"ta-edit-image-button components-icon-button components-toolbar__control\",\n\t\t\t\t\tlabel: __('Edit ThirstyAffiliates Image'),\n\t\t\t\t\ticon: \"edit\",\n\t\t\t\t\tonClick: this.editAFfiliateImage\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tvar controls = wp.element.createElement(\n\t\t\t\tBlockControls,\n\t\t\t\tnull,\n\t\t\t\twp.element.createElement(BlockAlignmentToolbar, {\n\t\t\t\t\tvalue: align,\n\t\t\t\t\tonChange: this.updateAlignment\n\t\t\t\t}),\n\t\t\t\ttoolbarEditButton\n\t\t\t);\n\n\t\t\tif (isEditing) {\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\tFragment,\n\t\t\t\t\tnull,\n\t\t\t\t\tcontrols,\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tPlaceholder,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticon: \"format-image\",\n\t\t\t\t\t\t\tlabel: __(\"ThirstyAffiliates Image\"),\n\t\t\t\t\t\t\tinstructions: __(\"Search for an affiliate link and select image to insert.\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\twp.element.createElement(__WEBPACK_IMPORTED_MODULE_3__search_input__[\"a\" /* default */], {\n\t\t\t\t\t\t\tupdateImageSelection: this.updateImageSelection\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t!!imageSelection.length && wp.element.createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t{ className: \"ta-image-sel-wrap\" },\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"h3\",\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\taffiliateLink.title + \" \" + __('attached images:')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t{ className: \"ta-image-selection\" },\n\t\t\t\t\t\t\t\timageSelection.map(function (image, index) {\n\t\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\t\t\"button\",\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\t\t\treturn _this5.onSelectAffiliateImage(image);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\twp.element.createElement(\"img\", { src: image.src })\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tvar classes = __WEBPACK_IMPORTED_MODULE_0_classnames___default()(className, {\n\t\t\t\t'wp-block-image': true,\n\t\t\t\t'is-transient': isBlobURL(url),\n\t\t\t\t'is-resized': !!width || !!height,\n\t\t\t\t'is-focused': isSelected\n\t\t\t});\n\n\t\t\tvar isResizable = ['wide', 'full'].indexOf(align) === -1 && isLargeViewport;\n\t\t\tvar imageSizeOptions = this.getImageSizeOptions();\n\n\t\t\tvar getInspectorControls = function getInspectorControls(imageWidth, imageHeight) {\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\tInspectorControls,\n\t\t\t\t\tnull,\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tPanelBody,\n\t\t\t\t\t\t{ title: __('Image Settings') },\n\t\t\t\t\t\twp.element.createElement(TextareaControl, {\n\t\t\t\t\t\t\tlabel: __('Alt Text (Alternative Text)'),\n\t\t\t\t\t\t\tvalue: alt,\n\t\t\t\t\t\t\tonChange: _this5.updateAlt,\n\t\t\t\t\t\t\thelp: __('Alternative text describes your image to people who can’t see it. Add a short description with its key details.')\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t!isEmpty(imageSizeOptions) && wp.element.createElement(SelectControl, {\n\t\t\t\t\t\t\tlabel: __('Image Size'),\n\t\t\t\t\t\t\tvalue: url,\n\t\t\t\t\t\t\toptions: imageSizeOptions,\n\t\t\t\t\t\t\tonChange: _this5.updateImageURL\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tisResizable && wp.element.createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions\" },\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"p\",\n\t\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions__row\" },\n\t\t\t\t\t\t\t\t__('Image Dimensions')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions__row\" },\n\t\t\t\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\t\tclassName: \"block-library-image__dimensions__width\",\n\t\t\t\t\t\t\t\t\tlabel: __('Width'),\n\t\t\t\t\t\t\t\t\tvalue: width !== undefined ? width : '',\n\t\t\t\t\t\t\t\t\tplaceholder: imageWidth,\n\t\t\t\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\t\t\t\tonChange: _this5.updateWidth\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\t\tclassName: \"block-library-image__dimensions__height\",\n\t\t\t\t\t\t\t\t\tlabel: __('Height'),\n\t\t\t\t\t\t\t\t\tvalue: height !== undefined ? height : '',\n\t\t\t\t\t\t\t\t\tplaceholder: imageHeight,\n\t\t\t\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\t\t\t\tonChange: _this5.updateHeight\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions__row\" },\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\tButtonGroup,\n\t\t\t\t\t\t\t\t\t{ \"aria-label\": __('Image Size') },\n\t\t\t\t\t\t\t\t\t[25, 50, 75, 100].map(function (scale) {\n\t\t\t\t\t\t\t\t\t\tvar scaledWidth = Math.round(imageWidth * (scale / 100));\n\t\t\t\t\t\t\t\t\t\tvar scaledHeight = Math.round(imageHeight * (scale / 100));\n\n\t\t\t\t\t\t\t\t\t\tvar isCurrent = width === scaledWidth && height === scaledHeight;\n\n\t\t\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\t\t\tButton,\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tkey: scale,\n\t\t\t\t\t\t\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\t\t\t\t\t\t\tisPrimary: isCurrent,\n\t\t\t\t\t\t\t\t\t\t\t\t\"aria-pressed\": isCurrent,\n\t\t\t\t\t\t\t\t\t\t\t\tonClick: _this5.updateDimensions(scaledWidth, scaledHeight)\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tscale,\n\t\t\t\t\t\t\t\t\t\t\t\"%\"\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\tButton,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\t\t\t\t\tonClick: _this5.updateDimensions()\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t__('Reset')\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t};\n\n\t\t\t// Disable reason: Each block can be selected by clicking on it\n\t\t\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t\t\treturn wp.element.createElement(\n\t\t\t\tFragment,\n\t\t\t\tnull,\n\t\t\t\tcontrols,\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t\"figure\",\n\t\t\t\t\t{ className: classes },\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t__WEBPACK_IMPORTED_MODULE_2__image_size__[\"a\" /* default */],\n\t\t\t\t\t\t{ src: url, dirtynessTrigger: align },\n\t\t\t\t\t\tfunction (sizes) {\n\t\t\t\t\t\t\tvar imageWidthWithinContainer = sizes.imageWidthWithinContainer,\n\t\t\t\t\t\t\t imageHeightWithinContainer = sizes.imageHeightWithinContainer,\n\t\t\t\t\t\t\t imageWidth = sizes.imageWidth,\n\t\t\t\t\t\t\t imageHeight = sizes.imageHeight;\n\n\n\t\t\t\t\t\t\tvar filename = _this5.getFilename(url);\n\t\t\t\t\t\t\tvar defaultedAlt = void 0;\n\t\t\t\t\t\t\tif (alt) {\n\t\t\t\t\t\t\t\tdefaultedAlt = alt;\n\t\t\t\t\t\t\t} else if (filename) {\n\t\t\t\t\t\t\t\tdefaultedAlt = sprintf(__('This image has an empty alt attribute; its file name is %s'), filename);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdefaultedAlt = __('This image has an empty alt attribute');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar img =\n\t\t\t\t\t\t\t// Disable reason: Image itself is not meant to be interactive, but\n\t\t\t\t\t\t\t// should direct focus to block.\n\t\t\t\t\t\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\tFragment,\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\t\"ta\",\n\t\t\t\t\t\t\t\t\t{ linkid: linkid, href: href },\n\t\t\t\t\t\t\t\t\twp.element.createElement(\"img\", { src: url, alt: defaultedAlt, onClick: _this5.onImageClick, onError: function onError() {\n\t\t\t\t\t\t\t\t\t\t\treturn _this5.onImageError(url);\n\t\t\t\t\t\t\t\t\t\t} })\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tisBlobURL(url) && wp.element.createElement(Spinner, null)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\t;\n\n\t\t\t\t\t\t\tif (!isResizable || !imageWidthWithinContainer) {\n\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\tFragment,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\tgetInspectorControls(imageWidth, imageHeight),\n\t\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t\t\t{ style: { width: width, height: height } },\n\t\t\t\t\t\t\t\t\t\timg\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar currentWidth = width || imageWidthWithinContainer;\n\t\t\t\t\t\t\tvar currentHeight = height || imageHeightWithinContainer;\n\n\t\t\t\t\t\t\tvar ratio = imageWidth / imageHeight;\n\t\t\t\t\t\t\tvar minWidth = imageWidth < imageHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\t\t\t\t\t\t\tvar minHeight = imageHeight < imageWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t\t\t\t\t\t\t// With the current implementation of ResizableBox, an image needs an explicit pixel value for the max-width.\n\t\t\t\t\t\t\t// In absence of being able to set the content-width, this max-width is currently dictated by the vanilla editor style.\n\t\t\t\t\t\t\t// The following variable adds a buffer to this vanilla style, so 3rd party themes have some wiggleroom.\n\t\t\t\t\t\t\t// This does, in most cases, allow you to scale the image beyond the width of the main column, though not infinitely.\n\t\t\t\t\t\t\t// @todo It would be good to revisit this once a content-width variable becomes available.\n\t\t\t\t\t\t\tvar maxWidthBuffer = maxWidth * 2.5;\n\n\t\t\t\t\t\t\tvar showRightHandle = false;\n\t\t\t\t\t\t\tvar showLeftHandle = false;\n\n\t\t\t\t\t\t\t/* eslint-disable no-lonely-if */\n\t\t\t\t\t\t\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\t\t\t\t\t\t\tif (align === 'center') {\n\t\t\t\t\t\t\t\t// When the image is centered, show both handles.\n\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t} else if (isRTL) {\n\t\t\t\t\t\t\t\t// In RTL mode the image is on the right by default.\n\t\t\t\t\t\t\t\t// Show the right handle and hide the left handle only when it is aligned left.\n\t\t\t\t\t\t\t\t// Otherwise always show the left handle.\n\t\t\t\t\t\t\t\tif (align === 'left') {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Show the left handle and hide the right handle only when the image is aligned right.\n\t\t\t\t\t\t\t\t// Otherwise always show the right handle.\n\t\t\t\t\t\t\t\tif (align === 'right') {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/* eslint-enable no-lonely-if */\n\n\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\tFragment,\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\tgetInspectorControls(imageWidth, imageHeight),\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\tResizableBox,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tsize: width && height ? {\n\t\t\t\t\t\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\t\t\t\t\t\theight: height\n\t\t\t\t\t\t\t\t\t\t} : undefined,\n\t\t\t\t\t\t\t\t\t\tminWidth: minWidth,\n\t\t\t\t\t\t\t\t\t\tmaxWidth: maxWidthBuffer,\n\t\t\t\t\t\t\t\t\t\tminHeight: minHeight,\n\t\t\t\t\t\t\t\t\t\tmaxHeight: maxWidthBuffer / ratio,\n\t\t\t\t\t\t\t\t\t\tlockAspectRatio: true,\n\t\t\t\t\t\t\t\t\t\tenable: {\n\t\t\t\t\t\t\t\t\t\t\ttop: false,\n\t\t\t\t\t\t\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\t\t\t\t\t\t\tbottom: true,\n\t\t\t\t\t\t\t\t\t\t\tleft: showLeftHandle\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonResizeStart: function onResizeStart() {\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection(false);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonResizeStop: function onResizeStop(event, direction, elt, delta) {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes({\n\t\t\t\t\t\t\t\t\t\t\t\twidth: parseInt(currentWidth + delta.width, 10),\n\t\t\t\t\t\t\t\t\t\t\t\theight: parseInt(currentHeight + delta.height, 10)\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection(true);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\timg\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\t(!RichText.isEmpty(caption) || isSelected) && wp.element.createElement(RichText, {\n\t\t\t\t\t\ttagName: \"figcaption\",\n\t\t\t\t\t\tplaceholder: __('Write caption…'),\n\t\t\t\t\t\tvalue: caption,\n\t\t\t\t\t\tunstableOnFocus: this.onFocusCaption,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ caption: value });\n\t\t\t\t\t\t},\n\t\t\t\t\t\tisSelected: this.state.captionFocused,\n\t\t\t\t\t\tinlineToolbar: true\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t);\n\t\t\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t\t}\n\t}]);\n\n\treturn ImageEdit;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (compose([withSelect(function (select, props) {\n\tvar _select = select('core'),\n\t getMedia = _select.getMedia;\n\n\tvar _select2 = select('core/editor'),\n\t getEditorSettings = _select2.getEditorSettings;\n\n\tvar id = props.attributes.id;\n\n\tvar _getEditorSettings = getEditorSettings(),\n\t maxWidth = _getEditorSettings.maxWidth,\n\t isRTL = _getEditorSettings.isRTL,\n\t imageSizes = _getEditorSettings.imageSizes;\n\n\treturn {\n\t\timage: id ? getMedia(id) : null,\n\t\tmaxWidth: maxWidth,\n\t\tisRTL: isRTL,\n\t\timageSizes: imageSizes\n\t};\n}), withViewportMatch({ isLargeViewport: 'medium' }), withNotices])(ImageEdit));\n\n/***/ }),\n/* 5 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return createUpgradedEmbedBlock; });\n/* unused harmony export isFromWordPress */\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar WORDPRESS_EMBED_BLOCK = 'core-embed/wordpress';\n\nvar _lodash = lodash,\n includes = _lodash.includes;\nvar renderToString = wp.element.renderToString;\nvar createBlock = wp.blocks.createBlock;\n\n/***\n * Creates a more suitable embed block based on the passed in props\n * and attributes generated from an embed block's preview.\n *\n * We require `attributesFromPreview` to be generated from the latest attributes\n * and preview, and because of the way the react lifecycle operates, we can't\n * guarantee that the attributes contained in the block's props are the latest\n * versions, so we require that these are generated separately.\n * See `getAttributesFromPreview` in the generated embed edit component.\n *\n * @param {Object} props The block's props.\n * @param {Object} attributesFromPreview Attributes generated from the block's most up to date preview.\n * @return {Object|undefined} A more suitable embed block if one exists.\n */\n\nvar createUpgradedEmbedBlock = function createUpgradedEmbedBlock(props, attributesFromPreview) {\n\tvar preview = props.preview,\n\t name = props.name;\n\tvar url = props.attributes.url;\n\n\n\tif (!url) {\n\t\treturn;\n\t}\n\n\tvar matchingBlock = findBlock(url);\n\n\t// WordPress blocks can work on multiple sites, and so don't have patterns,\n\t// so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.\n\tif (WORDPRESS_EMBED_BLOCK !== name && DEFAULT_EMBED_BLOCK !== matchingBlock) {\n\t\t// At this point, we have discovered a more suitable block for this url, so transform it.\n\t\tif (name !== matchingBlock) {\n\t\t\treturn createBlock(matchingBlock, { url: url });\n\t\t}\n\t}\n\n\tif (preview) {\n\t\tvar html = preview.html;\n\n\t\t// We can't match the URL for WordPress embeds, we have to check the HTML instead.\n\n\t\tif (isFromWordPress(html)) {\n\t\t\t// If this is not the WordPress embed block, transform it into one.\n\t\t\tif (WORDPRESS_EMBED_BLOCK !== name) {\n\t\t\t\treturn createBlock(WORDPRESS_EMBED_BLOCK, _extends({\n\t\t\t\t\turl: url\n\t\t\t\t}, attributesFromPreview));\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar isFromWordPress = function isFromWordPress(html) {\n\treturn includes(html, 'class=\"wp-embedded-content\" data-secret');\n};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _lodash = lodash,\n noop = _lodash.noop;\nvar withGlobalEvents = wp.compose.withGlobalEvents;\nvar Component = wp.element.Component;\n\nvar ImageSize = function (_Component) {\n\t_inherits(ImageSize, _Component);\n\n\tfunction ImageSize() {\n\t\t_classCallCheck(this, ImageSize);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ImageSize.__proto__ || Object.getPrototypeOf(ImageSize)).apply(this, arguments));\n\n\t\t_this.state = {\n\t\t\twidth: undefined,\n\t\t\theight: undefined\n\t\t};\n\t\t_this.bindContainer = _this.bindContainer.bind(_this);\n\t\t_this.calculateSize = _this.calculateSize.bind(_this);\n\t\treturn _this;\n\t}\n\n\t_createClass(ImageSize, [{\n\t\tkey: 'bindContainer',\n\t\tvalue: function bindContainer(ref) {\n\t\t\tthis.container = ref;\n\t\t}\n\t}, {\n\t\tkey: 'componentDidUpdate',\n\t\tvalue: function componentDidUpdate(prevProps) {\n\t\t\tif (this.props.src !== prevProps.src) {\n\t\t\t\tthis.setState({\n\t\t\t\t\twidth: undefined,\n\t\t\t\t\theight: undefined\n\t\t\t\t});\n\t\t\t\tthis.fetchImageSize();\n\t\t\t}\n\n\t\t\tif (this.props.dirtynessTrigger !== prevProps.dirtynessTrigger) {\n\t\t\t\tthis.calculateSize();\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'componentDidMount',\n\t\tvalue: function componentDidMount() {\n\t\t\tthis.fetchImageSize();\n\t\t}\n\t}, {\n\t\tkey: 'componentWillUnmount',\n\t\tvalue: function componentWillUnmount() {\n\t\t\tif (this.image) {\n\t\t\t\tthis.image.onload = noop;\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'fetchImageSize',\n\t\tvalue: function fetchImageSize() {\n\t\t\tthis.image = new window.Image();\n\t\t\tthis.image.onload = this.calculateSize;\n\t\t\tthis.image.src = this.props.src;\n\t\t}\n\t}, {\n\t\tkey: 'calculateSize',\n\t\tvalue: function calculateSize() {\n\t\t\tvar maxWidth = this.container.clientWidth;\n\t\t\tvar exceedMaxWidth = this.image.width > maxWidth;\n\t\t\tvar ratio = this.image.height / this.image.width;\n\t\t\tvar width = exceedMaxWidth ? maxWidth : this.image.width;\n\t\t\tvar height = exceedMaxWidth ? maxWidth * ratio : this.image.height;\n\t\t\tthis.setState({ width: width, height: height });\n\t\t}\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar sizes = {\n\t\t\t\timageWidth: this.image && this.image.width,\n\t\t\t\timageHeight: this.image && this.image.height,\n\t\t\t\tcontainerWidth: this.container && this.container.clientWidth,\n\t\t\t\tcontainerHeight: this.container && this.container.clientHeight,\n\t\t\t\timageWidthWithinContainer: this.state.width,\n\t\t\t\timageHeightWithinContainer: this.state.height\n\t\t\t};\n\t\t\treturn wp.element.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ ref: this.bindContainer },\n\t\t\t\tthis.props.children(sizes)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn ImageSize;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withGlobalEvents({\n\tresize: 'calculateSize'\n})(ImageSize));\n\n/***/ }),\n/* 7 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nvar __ = wp.i18n.__;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar _wp$components = wp.components,\n Spinner = _wp$components.Spinner,\n withSpokenMessages = _wp$components.withSpokenMessages,\n Popover = _wp$components.Popover,\n TextControl = _wp$components.TextControl;\nvar withInstanceId = wp.compose.withInstanceId;\n\nvar ThirstyURLInput = function (_Component) {\n\t_inherits(ThirstyURLInput, _Component);\n\n\t/**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tfunction ThirstyURLInput(_ref) {\n\t\tvar autocompleteRef = _ref.autocompleteRef;\n\n\t\t_classCallCheck(this, ThirstyURLInput);\n\n\t\t// this.onChange = this.onChange.bind( this );\n\t\t// this.onKeyDown = this.onKeyDown.bind( this );\n\t\tvar _this = _possibleConstructorReturn(this, (ThirstyURLInput.__proto__ || Object.getPrototypeOf(ThirstyURLInput)).apply(this, arguments));\n\n\t\t_this.autocompleteRef = autocompleteRef || createRef();\n\t\t_this.inputRef = createRef();\n\t\t_this.searchAffiliateLinks = _this.searchAffiliateLinks.bind(_this);\n\t\t// this.updateSuggestions = throttle( this.updateSuggestions.bind( this ), 200 );\n\n\t\t_this.suggestionNodes = [];\n\n\t\t_this.state = {\n\t\t\tposts: [],\n\t\t\tshowSuggestions: false,\n\t\t\tselectedSuggestion: null,\n\t\t\tloading: false\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Component did update method.\n * \n * @since 3.6\n */\n\n\n\t_createClass(ThirstyURLInput, [{\n\t\tkey: \"componentDidUpdate\",\n\t\tvalue: function componentDidUpdate() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar _state = this.state,\n\t\t\t showSuggestions = _state.showSuggestions,\n\t\t\t selectedSuggestion = _state.selectedSuggestion;\n\t\t\t// only have to worry about scrolling selected suggestion into view\n\t\t\t// when already expanded\n\n\t\t\tif (showSuggestions && selectedSuggestion !== null && !this.scrollingIntoView) {\n\t\t\t\tthis.scrollingIntoView = true;\n\t\t\t\tscrollIntoView(this.suggestionNodes[selectedSuggestion], this.autocompleteRef.current, {\n\t\t\t\t\tonlyScrollIfNeeded: true\n\t\t\t\t});\n\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t_this2.scrollingIntoView = false;\n\t\t\t\t}, 100);\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Component unmount method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: \"componentWillUnmount\",\n\t\tvalue: function componentWillUnmount() {\n\t\t\tdelete this.suggestionsRequest;\n\t\t}\n\n\t\t/**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\n\t}, {\n\t\tkey: \"bindSuggestionNode\",\n\t\tvalue: function bindSuggestionNode(index) {\n\t\t\tvar _this3 = this;\n\n\t\t\treturn function (ref) {\n\t\t\t\t_this3.suggestionNodes[index] = ref;\n\t\t\t};\n\t\t}\n\t}, {\n\t\tkey: \"searchAffiliateLinks\",\n\t\tvalue: function searchAffiliateLinks(value) {\n\t\t\tvar _this4 = this;\n\n\t\t\t// Show the suggestions after typing at least 2 characters=\n\t\t\tif (value.length < 2) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tshowSuggestions: false,\n\t\t\t\t\tselectedSuggestion: null,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tshowSuggestions: true,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: true\n\t\t\t});\n\n\t\t\tvar formData = new FormData();\n\t\t\tformData.append(\"action\", \"search_affiliate_links_query\");\n\t\t\tformData.append(\"keyword\", value);\n\t\t\tformData.append(\"paged\", 1);\n\t\t\tformData.append(\"gutenberg\", true);\n\t\t\tformData.append(\"with_images\", true);\n\n\t\t\t// We are getting data via the WP AJAX instead of rest API as it is not possible yet\n\t\t\t// to filter results with category value. This is to prepare next update to add category filter.\n\t\t\tvar request = fetch(ajaxurl, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: formData\n\t\t\t});\n\n\t\t\trequest.then(function (response) {\n\t\t\t\treturn response.json();\n\t\t\t}).then(function (response) {\n\n\t\t\t\tif (!response.affiliate_links) return;\n\n\t\t\t\tvar posts = response.affiliate_links;\n\n\t\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\t\tif (_this4.suggestionsRequest !== request) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t_this4.setState({\n\t\t\t\t\tposts: posts,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\tif (!!posts.length) {\n\t\t\t\t\t_this4.props.debouncedSpeak(sprintf(_n('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', posts.length), posts.length), 'assertive');\n\t\t\t\t} else {\n\t\t\t\t\t_this4.props.debouncedSpeak(__('No results.'), 'assertive');\n\t\t\t\t}\n\t\t\t}).catch(function () {\n\t\t\t\tif (_this4.suggestionsRequest === request) {\n\t\t\t\t\t_this4.setState({\n\t\t\t\t\t\tloading: false\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.suggestionsRequest = request;\n\t\t}\n\n\t\t/**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: \"selectLink\",\n\t\tvalue: function selectLink(post) {\n\t\t\t// this.props.onChange( post.link, post );\n\t\t\tthis.setState({\n\t\t\t\tselectedSuggestion: post,\n\t\t\t\tshowSuggestions: false\n\t\t\t});\n\n\t\t\tthis.props.updateImageSelection(post.images, post);\n\t\t}\n\n\t\t/**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: \"handleOnClick\",\n\t\tvalue: function handleOnClick(post) {\n\t\t\tthis.selectLink(post);\n\t\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\t\t// this.inputRef.current.focus();\n\t\t}\n\t}, {\n\t\tkey: \"render\",\n\t\tvalue: function render() {\n\t\t\tvar _this5 = this;\n\n\t\t\tvar _props = this.props,\n\t\t\t _props$value = _props.value,\n\t\t\t value = _props$value === undefined ? '' : _props$value,\n\t\t\t _props$autoFocus = _props.autoFocus,\n\t\t\t autoFocus = _props$autoFocus === undefined ? true : _props$autoFocus,\n\t\t\t instanceId = _props.instanceId;\n\t\t\tvar _state2 = this.state,\n\t\t\t showSuggestions = _state2.showSuggestions,\n\t\t\t posts = _state2.posts,\n\t\t\t selectedSuggestion = _state2.selectedSuggestion,\n\t\t\t loading = _state2.loading;\n\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\t\"div\",\n\t\t\t\t{ \"class\": \"edit-search-affiliate-links\" },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t\"form\",\n\t\t\t\t\t{\n\t\t\t\t\t\tclassName: \"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover\",\n\t\t\t\t\t\tonSubmit: this.displayAffiliateImages\n\t\t\t\t\t},\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\tclassName: \"ta-search-affiliate-links\",\n\t\t\t\t\t\tplaceholder: __(\"Type to search affiliate links\"),\n\t\t\t\t\t\tonChange: this.searchAffiliateLinks,\n\t\t\t\t\t\tautocomplete: \"off\"\n\t\t\t\t\t}),\n\t\t\t\t\tloading && wp.element.createElement(Spinner, null),\n\t\t\t\t\tshowSuggestions && !!posts.length && wp.element.createElement(\n\t\t\t\t\t\tPopover,\n\t\t\t\t\t\t{ position: \"bottom\", focusOnMount: false },\n\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t{ \"class\": \"affilate-links-suggestions\" },\n\t\t\t\t\t\t\tposts.map(function (post, index) {\n\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\t\"button\",\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tkey: post.id,\n\t\t\t\t\t\t\t\t\t\trole: \"option\",\n\t\t\t\t\t\t\t\t\t\ttabIndex: \"-1\",\n\t\t\t\t\t\t\t\t\t\tid: \"editor-url-input-suggestion-\" + instanceId + \"-\" + index,\n\t\t\t\t\t\t\t\t\t\tref: _this5.bindSuggestionNode(index),\n\t\t\t\t\t\t\t\t\t\tclassName: __WEBPACK_IMPORTED_MODULE_0_classnames___default()('editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\t\treturn _this5.handleOnClick(post);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"aria-selected\": index === selectedSuggestion\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tpost.title || __('(no title)')\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn ThirstyURLInput;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withSpokenMessages(withInstanceId(ThirstyURLInput)));\n\n/***/ }),\n/* 8 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = registerFormats;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ta_link__ = __webpack_require__(9);\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\n\n\nvar registerFormatType = wp.richText.registerFormatType;\n\n/**\n * Register custom formats.\n * \n * @since 3.6\n */\n\nfunction registerFormats() {\n\n [__WEBPACK_IMPORTED_MODULE_0__ta_link__[\"a\" /* taLink */]].forEach(function (_ref) {\n var name = _ref.name,\n settings = _objectWithoutProperties(_ref, [\"name\"]);\n\n return registerFormatType(name, settings);\n });\n}\n\n/***/ }),\n/* 9 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return taLink; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__inline__ = __webpack_require__(10);\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nvar __ = wp.i18n.__;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n Fragment = _wp$element.Fragment;\nvar withSpokenMessages = wp.components.withSpokenMessages;\nvar _wp$richText = wp.richText,\n getTextContent = _wp$richText.getTextContent,\n applyFormat = _wp$richText.applyFormat,\n removeFormat = _wp$richText.removeFormat,\n slice = _wp$richText.slice;\nvar isURL = wp.url.isURL;\nvar _wp$editor = wp.editor,\n RichTextToolbarButton = _wp$editor.RichTextToolbarButton,\n RichTextShortcut = _wp$editor.RichTextShortcut;\nvar _wp$components = wp.components,\n Path = _wp$components.Path,\n SVG = _wp$components.SVG;\nvar getRectangleFromRange = wp.dom.getRectangleFromRange;\n\n\nvar name = \"ta/link\";\n\n/**\n * Custom Affiliate link format. When applied will wrap selected text with <ta href=\"\" linkid=\"\"></ta> custom element.\n * Custom element is implemented here as we are not allowed to use <a> tag due to Gutenberg limitations.\n * Element is converted to normal <a> tag on frontend via PHP script filtered on 'the_content'.\n * \n * @since 3.6\n */\nvar taLink = {\n\tname: name,\n\ttitle: __(\"Affiliate Link\"),\n\ttagName: \"ta\",\n\tclassName: null,\n\tattributes: {\n\t\turl: \"href\",\n\t\ttarget: \"target\"\n\t},\n\tedit: withSpokenMessages(function (_Component) {\n\t\t_inherits(LinkEdit, _Component);\n\n\t\t/**\n * Component constructor.\n * \n * @since 3.6\n */\n\t\tfunction LinkEdit() {\n\t\t\t_classCallCheck(this, LinkEdit);\n\n\t\t\tvar _this = _possibleConstructorReturn(this, (LinkEdit.__proto__ || Object.getPrototypeOf(LinkEdit)).apply(this, arguments));\n\n\t\t\t_this.addLink = _this.addLink.bind(_this);\n\t\t\t_this.stopAddingLink = _this.stopAddingLink.bind(_this);\n\t\t\t_this.onRemoveFormat = _this.onRemoveFormat.bind(_this);\n\t\t\t_this.state = {\n\t\t\t\taddingLink: false\n\t\t\t};\n\t\t\treturn _this;\n\t\t}\n\n\t\t/**\n * Callback to set state to adding link status.\n * \n * @since 3.6\n */\n\n\n\t\t_createClass(LinkEdit, [{\n\t\t\tkey: \"addLink\",\n\t\t\tvalue: function addLink() {\n\t\t\t\tvar _props = this.props,\n\t\t\t\t value = _props.value,\n\t\t\t\t onChange = _props.onChange;\n\n\t\t\t\tvar text = getTextContent(slice(value));\n\n\t\t\t\tif (text && isURL(text)) {\n\t\t\t\t\tonChange(applyFormat(value, { type: name, attributes: { url: text } }));\n\t\t\t\t} else {\n\t\t\t\t\tthis.setState({ addingLink: true });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n * Callback to set state to stop adding link status.\n * \n * @since 3.6\n */\n\n\t\t}, {\n\t\t\tkey: \"stopAddingLink\",\n\t\t\tvalue: function stopAddingLink() {\n\t\t\t\tthis.setState({ addingLink: false });\n\t\t\t}\n\n\t\t\t/**\n * Remove format event callback.\n * \n * @since 3.6\n */\n\n\t\t}, {\n\t\t\tkey: \"onRemoveFormat\",\n\t\t\tvalue: function onRemoveFormat() {\n\t\t\t\tvar _props2 = this.props,\n\t\t\t\t value = _props2.value,\n\t\t\t\t onChange = _props2.onChange,\n\t\t\t\t speak = _props2.speak;\n\n\n\t\t\t\tonChange(removeFormat(value, name));\n\t\t\t\tspeak(__(\"Affiliate Link removed.\"), \"assertive\");\n\t\t\t}\n\n\t\t\t/**\n * Get selected anchor text.\n * \n * @since 3.9\n */\n\n\t\t}, {\n\t\t\tkey: \"getAnchorRect\",\n\t\t\tvalue: function getAnchorRect() {\n\n\t\t\t\tvar selection = window.getSelection();\n\t\t\t\tvar range = selection.rangeCount > 0 ? selection.getRangeAt(0) : null;\n\n\t\t\t\tif (!range) return;\n\n\t\t\t\tvar rect = null;\n\n\t\t\t\tif (this.state.addingLink) {\n\t\t\t\t\trect = getRectangleFromRange(range);\n\t\t\t\t} else {\n\n\t\t\t\t\tvar element = range.startContainer;\n\n\t\t\t\t\t// If the caret is right before the element, select the next element.\n\t\t\t\t\telement = element.nextElementSibling || element;\n\n\t\t\t\t\twhile (element.nodeType !== window.Node.ELEMENT_NODE) {\n\t\t\t\t\t\telement = element.parentNode;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar closest = element.closest('ta');\n\t\t\t\t\tif (closest) {\n\t\t\t\t\t\trect = closest.getBoundingClientRect();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn rect;\n\t\t\t}\n\n\t\t\t/**\n * Component render method.\n * \n * @since 3.6\n */\n\n\t\t}, {\n\t\t\tkey: \"render\",\n\t\t\tvalue: function render() {\n\t\t\t\tvar _props3 = this.props,\n\t\t\t\t isActive = _props3.isActive,\n\t\t\t\t activeAttributes = _props3.activeAttributes,\n\t\t\t\t value = _props3.value,\n\t\t\t\t onChange = _props3.onChange;\n\n\n\t\t\t\tvar anchorRect = this.getAnchorRect();\n\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\tFragment,\n\t\t\t\t\tnull,\n\t\t\t\t\twp.element.createElement(RichTextShortcut, {\n\t\t\t\t\t\ttype: \"access\",\n\t\t\t\t\t\tcharacter: \"s\",\n\t\t\t\t\t\tonUse: this.onRemoveFormat\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(RichTextShortcut, {\n\t\t\t\t\t\ttype: \"primary\",\n\t\t\t\t\t\tcharacter: \"l\",\n\t\t\t\t\t\tonUse: this.addLink\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(RichTextShortcut, {\n\t\t\t\t\t\ttype: \"primaryShift\",\n\t\t\t\t\t\tcharacter: \"l\",\n\t\t\t\t\t\tonUse: this.onRemoveFormat\n\t\t\t\t\t}),\n\t\t\t\t\tisActive && wp.element.createElement(RichTextToolbarButton, {\n\t\t\t\t\t\ticon: \"editor-unlink\",\n\t\t\t\t\t\ttitle: __('Remove Affiliate Link'),\n\t\t\t\t\t\tclassName: \"ta-unlink-button\",\n\t\t\t\t\t\tonClick: this.onRemoveFormat,\n\t\t\t\t\t\tisActive: isActive,\n\t\t\t\t\t\tshortcutType: \"primaryShift\",\n\t\t\t\t\t\tshortcutCharacter: \"l\"\n\t\t\t\t\t}),\n\t\t\t\t\t!isActive && wp.element.createElement(RichTextToolbarButton, {\n\t\t\t\t\t\ticon: wp.element.createElement(\n\t\t\t\t\t\t\tSVG,\n\t\t\t\t\t\t\t{ xmlns: \"http://www.w3.org/2000/svg\", width: \"16.688\", height: \"9.875\", viewBox: \"0 0 16.688 9.875\" },\n\t\t\t\t\t\t\twp.element.createElement(Path, { id: \"TA.svg\", fill: \"black\", \"class\": \"cls-1\", d: \"M2.115,15.12H4.847L6.836,7.7H9.777l0.63-2.381H1.821L1.177,7.7H4.118Zm4.758,0H9.829l1.177-1.751h3.782l0.238,1.751h2.858L16.357,5.245H13.7Zm5.5-3.866,1.835-2.816,0.35,2.816H12.378Z\", transform: \"translate(-1.188 -5.25)\" })\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttitle: __('Affiliate Link'),\n\t\t\t\t\t\tclassName: \"ta-link-button\",\n\t\t\t\t\t\tonClick: this.addLink,\n\t\t\t\t\t\tshortcutType: \"primary\",\n\t\t\t\t\t\tshortcutCharacter: \"l\"\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(__WEBPACK_IMPORTED_MODULE_0__inline__[\"a\" /* default */], {\n\t\t\t\t\t\taddingLink: this.state.addingLink,\n\t\t\t\t\t\tstopAddingLink: this.stopAddingLink,\n\t\t\t\t\t\tisActive: isActive,\n\t\t\t\t\t\tactiveAttributes: activeAttributes,\n\t\t\t\t\t\tanchorRect: anchorRect,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tonChange: onChange\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t}]);\n\n\t\treturn LinkEdit;\n\t}(Component))\n};\n\n/***/ }),\n/* 10 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(11);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__url_popover__ = __webpack_require__(12);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__url_input__ = __webpack_require__(13);\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\n\n\n\nvar __ = wp.i18n.__;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar _wp$components = wp.components,\n ExternalLink = _wp$components.ExternalLink,\n ToggleControl = _wp$components.ToggleControl,\n IconButton = _wp$components.IconButton,\n withSpokenMessages = _wp$components.withSpokenMessages;\nvar _wp$keycodes = wp.keycodes,\n LEFT = _wp$keycodes.LEFT,\n RIGHT = _wp$keycodes.RIGHT,\n UP = _wp$keycodes.UP,\n DOWN = _wp$keycodes.DOWN,\n BACKSPACE = _wp$keycodes.BACKSPACE,\n ENTER = _wp$keycodes.ENTER;\nvar _wp$url = wp.url,\n prependHTTP = _wp$url.prependHTTP,\n safeDecodeURI = _wp$url.safeDecodeURI,\n filterURLForDisplay = _wp$url.filterURLForDisplay;\nvar _wp$richText = wp.richText,\n create = _wp$richText.create,\n insert = _wp$richText.insert,\n isCollapsed = _wp$richText.isCollapsed,\n applyFormat = _wp$richText.applyFormat,\n getTextContent = _wp$richText.getTextContent,\n slice = _wp$richText.slice;\n\n\nvar stopKeyPropagation = function stopKeyPropagation(event) {\n\treturn event.stopPropagation();\n};\n\n/**\n * Generates the format object that will be applied to the link text.\n * \n * @since 3.6\n *\n * @param {string} url The href of the link.\n * @param {boolean} linkid Affiliate link ID.\n * @param {Object} text The text that is being hyperlinked.\n *\n * @return {Object} The final format object.\n */\nfunction createLinkFormat(_ref) {\n\tvar url = _ref.url,\n\t linkid = _ref.linkid,\n\t text = _ref.text;\n\n\tvar format = {\n\t\ttype: \"ta/link\",\n\t\tattributes: {\n\t\t\turl: url,\n\t\t\tlinkid: linkid.toString()\n\t\t}\n\t};\n\n\treturn format;\n}\n\n/**\n * Check if input is being show.\n * \n * @since 3.6\n * \n * @param {Object} props Component props.\n * @param {Object} state Component state.\n */\nfunction isShowingInput(props, state) {\n\treturn props.addingLink || state.editLink;\n}\n\n/**\n * Affiliate Link editor JSX element.\n * \n * @since 3.6\n * \n * @param {Object} param0 Component props (destructred).\n */\nvar LinkEditor = function LinkEditor(_ref2) {\n\tvar value = _ref2.value,\n\t onChangeInputValue = _ref2.onChangeInputValue,\n\t onKeyDown = _ref2.onKeyDown,\n\t submitLink = _ref2.submitLink,\n\t invalidLink = _ref2.invalidLink,\n\t resetInvalidLink = _ref2.resetInvalidLink,\n\t autocompleteRef = _ref2.autocompleteRef;\n\treturn (\n\t\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t\twp.element.createElement(\n\t\t\t'form',\n\t\t\t{\n\t\t\t\tclassName: 'editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover',\n\t\t\t\tonKeyPress: stopKeyPropagation,\n\t\t\t\tonKeyDown: onKeyDown,\n\t\t\t\tonSubmit: submitLink\n\t\t\t},\n\t\t\twp.element.createElement(__WEBPACK_IMPORTED_MODULE_3__url_input__[\"a\" /* default */], {\n\t\t\t\tvalue: value,\n\t\t\t\tonChange: onChangeInputValue,\n\t\t\t\tautocompleteRef: autocompleteRef,\n\t\t\t\tinvalidLink: invalidLink,\n\t\t\t\tresetInvalidLink: resetInvalidLink\n\t\t\t}),\n\t\t\twp.element.createElement(IconButton, { icon: 'editor-break', label: __('Apply'), type: 'submit' })\n\t\t)\n\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n\n\t);\n};\n\n/**\n * Affiliate link url viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nvar LinkViewerUrl = function LinkViewerUrl(_ref3) {\n\tvar url = _ref3.url;\n\n\tvar prependedURL = prependHTTP(url);\n\tvar linkClassName = __WEBPACK_IMPORTED_MODULE_0_classnames___default()('editor-format-toolbar__link-container-value block-editor-format-toolbar__link-container-value', {\n\t\t'has-invalid-link': !Object(__WEBPACK_IMPORTED_MODULE_1__utils__[\"a\" /* isValidHref */])(prependedURL)\n\t});\n\n\tif (!url) {\n\t\treturn wp.element.createElement('span', { className: linkClassName });\n\t}\n\n\treturn wp.element.createElement(\n\t\tExternalLink,\n\t\t{\n\t\t\tclassName: linkClassName,\n\t\t\thref: url\n\t\t},\n\t\tfilterURLForDisplay(safeDecodeURI(url))\n\t);\n};\n\n/**\n * Affiliate link viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nvar LinkViewer = function LinkViewer(_ref4) {\n\tvar url = _ref4.url,\n\t editLink = _ref4.editLink;\n\n\treturn (\n\t\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\t\twp.element.createElement(\n\t\t\t'div',\n\t\t\t{\n\t\t\t\tclassName: 'editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content',\n\t\t\t\tonKeyPress: stopKeyPropagation\n\t\t\t},\n\t\t\twp.element.createElement(LinkViewerUrl, { url: url }),\n\t\t\twp.element.createElement(IconButton, { icon: 'edit', label: __('Edit'), onClick: editLink })\n\t\t)\n\t\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n\n\t);\n};\n\n/**\n * Inline affiliate link UI Component.\n * \n * @since 3.6\n * \n * @param {*} param0 Component props (destructred).\n */\n\nvar InlineAffiliateLinkUI = function (_Component) {\n\t_inherits(InlineAffiliateLinkUI, _Component);\n\n\tfunction InlineAffiliateLinkUI() {\n\t\t_classCallCheck(this, InlineAffiliateLinkUI);\n\n\t\tvar _this = _possibleConstructorReturn(this, (InlineAffiliateLinkUI.__proto__ || Object.getPrototypeOf(InlineAffiliateLinkUI)).apply(this, arguments));\n\n\t\t_this.editLink = _this.editLink.bind(_this);\n\t\t_this.submitLink = _this.submitLink.bind(_this);\n\t\t_this.onKeyDown = _this.onKeyDown.bind(_this);\n\t\t_this.onChangeInputValue = _this.onChangeInputValue.bind(_this);\n\t\t_this.onClickOutside = _this.onClickOutside.bind(_this);\n\t\t_this.resetState = _this.resetState.bind(_this);\n\t\t_this.autocompleteRef = createRef();\n\t\t_this.resetInvalidLink = _this.resetInvalidLink.bind(_this);\n\n\t\t_this.state = {\n\t\t\tinputValue: '',\n\t\t\tlinkid: 0,\n\t\t\tpost: null,\n\t\t\tinvalidLink: false\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Stop the key event from propagating up to ObserveTyping.startTypingInTextField.\n * \n * @since 3.6\n * \n * @param {Object} event Event object.\n */\n\n\n\t_createClass(InlineAffiliateLinkUI, [{\n\t\tkey: 'onKeyDown',\n\t\tvalue: function onKeyDown(event) {\n\t\t\tif ([LEFT, DOWN, RIGHT, UP, BACKSPACE, ENTER].indexOf(event.keyCode) > -1) {\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Callback to set state when input value is changed.\n * \n * @since 3.6\n * \n * @param {*} inputValue \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: 'onChangeInputValue',\n\t\tvalue: function onChangeInputValue(inputValue) {\n\t\t\tvar post = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n\t\t\tvar linkid = post ? post.id : 0;\n\t\t\tthis.setState({ inputValue: inputValue, linkid: linkid, post: post });\n\t\t}\n\n\t\t/**\n * Callback to set state when edit affiliate link (already inserted) is triggered.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'editLink',\n\t\tvalue: function editLink(event) {\n\t\t\tthis.setState({ editLink: true });\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t/**\n * Callback to apply the affiliate link format to the selected text or position in the active block.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'submitLink',\n\t\tvalue: function submitLink(event) {\n\t\t\tvar _props = this.props,\n\t\t\t isActive = _props.isActive,\n\t\t\t value = _props.value,\n\t\t\t onChange = _props.onChange,\n\t\t\t speak = _props.speak;\n\t\t\tvar _state = this.state,\n\t\t\t inputValue = _state.inputValue,\n\t\t\t linkid = _state.linkid,\n\t\t\t post = _state.post;\n\n\t\t\tvar url = prependHTTP(inputValue);\n\t\t\tvar selectedText = getTextContent(slice(value));\n\t\t\tvar format = createLinkFormat({\n\t\t\t\turl: url,\n\t\t\t\tlinkid: linkid,\n\t\t\t\ttext: selectedText\n\t\t\t});\n\n\t\t\tevent.preventDefault();\n\n\t\t\tif (!linkid || !post) {\n\t\t\t\tthis.setState({ invalidLink: true });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isCollapsed(value) && !isActive) {\n\t\t\t\tvar toInsert = applyFormat(create({ text: post.title }), format, 0, url.length);\n\t\t\t\tonChange(insert(value, toInsert));\n\t\t\t} else {\n\t\t\t\tonChange(applyFormat(value, format));\n\t\t\t}\n\n\t\t\tthis.resetState();\n\n\t\t\tif (!Object(__WEBPACK_IMPORTED_MODULE_1__utils__[\"a\" /* isValidHref */])(url)) {\n\t\t\t\tspeak(__('Warning: the link has been inserted but may have errors. Please test it.'), 'assertive');\n\t\t\t} else if (isActive) {\n\t\t\t\tspeak(__('Link edited.'), 'assertive');\n\t\t\t} else {\n\t\t\t\tspeak(__('Link inserted'), 'assertive');\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Callback to run when users clicks outside the popover UI.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'onClickOutside',\n\t\tvalue: function onClickOutside(event) {\n\t\t\t// The autocomplete suggestions list renders in a separate popover (in a portal),\n\t\t\t// so onClickOutside fails to detect that a click on a suggestion occured in the\n\t\t\t// LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and\n\t\t\t// return to avoid the popover being closed.\n\t\t\tvar autocompleteElement = this.autocompleteRef.current;\n\t\t\tif (autocompleteElement && autocompleteElement.contains(event.target)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.resetState();\n\t\t}\n\n\t\t/**\n * Reset state callback.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'resetState',\n\t\tvalue: function resetState() {\n\t\t\tthis.props.stopAddingLink();\n\t\t\tthis.setState({ inputValue: '', editLink: false });\n\t\t\tthis.resetInvalidLink();\n\t\t}\n\n\t\t/**\n * Reset invalid link state callback. Separated as we need to run this independently from resetState() callback.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'resetInvalidLink',\n\t\tvalue: function resetInvalidLink() {\n\t\t\tthis.setState({ invalidLink: false });\n\t\t}\n\n\t\t/**\n * Component render method.\n *\n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _props2 = this.props,\n\t\t\t isActive = _props2.isActive,\n\t\t\t _props2$activeAttribu = _props2.activeAttributes,\n\t\t\t url = _props2$activeAttribu.url,\n\t\t\t linkid = _props2$activeAttribu.linkid,\n\t\t\t addingLink = _props2.addingLink,\n\t\t\t anchorRect = _props2.anchorRect,\n\t\t\t value = _props2.value,\n\t\t\t onChange = _props2.onChange;\n\n\n\t\t\tif (!isActive && !addingLink) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar _state2 = this.state,\n\t\t\t inputValue = _state2.inputValue,\n\t\t\t invalidLink = _state2.invalidLink;\n\n\t\t\tvar showInput = isShowingInput(this.props, this.state);\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\t__WEBPACK_IMPORTED_MODULE_2__url_popover__[\"a\" /* default */],\n\t\t\t\t{\n\t\t\t\t\tonClickOutside: this.onClickOutside,\n\t\t\t\t\tonClose: this.resetState,\n\t\t\t\t\tfocusOnMount: showInput ? 'firstElement' : false,\n\t\t\t\t\tinvalidLink: invalidLink,\n\t\t\t\t\tanchorRect: anchorRect\n\t\t\t\t},\n\t\t\t\tshowInput ? wp.element.createElement(LinkEditor, {\n\t\t\t\t\tvalue: inputValue,\n\t\t\t\t\tonChangeInputValue: this.onChangeInputValue,\n\t\t\t\t\tonKeyDown: this.onKeyDown,\n\t\t\t\t\tsubmitLink: this.submitLink,\n\t\t\t\t\tautocompleteRef: this.autocompleteRef,\n\t\t\t\t\tupdateLinkId: this.updateLinkId,\n\t\t\t\t\tinvalidLink: invalidLink,\n\t\t\t\t\tresetInvalidLink: this.resetInvalidLink\n\t\t\t\t}) : wp.element.createElement(LinkViewer, {\n\t\t\t\t\turl: url,\n\t\t\t\t\teditLink: this.editLink\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn InlineAffiliateLinkUI;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withSpokenMessages(InlineAffiliateLinkUI));\n\n/***/ }),\n/* 11 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = isValidHref;\nvar _lodash = lodash,\n startsWith = _lodash.startsWith;\nvar _wp$url = wp.url,\n getProtocol = _wp$url.getProtocol,\n isValidProtocol = _wp$url.isValidProtocol,\n getAuthority = _wp$url.getAuthority,\n isValidAuthority = _wp$url.isValidAuthority,\n getPath = _wp$url.getPath,\n isValidPath = _wp$url.isValidPath,\n getQueryString = _wp$url.getQueryString,\n isValidQueryString = _wp$url.isValidQueryString,\n getFragment = _wp$url.getFragment,\n isValidFragment = _wp$url.isValidFragment;\n\n/**\n * Check for issues with the provided href.\n * \n * @since 3.6\n *\n * @param {string} href The href.\n * @return {boolean} Is the href invalid?\n */\n\nfunction isValidHref(href) {\n\tif (!href) {\n\t\treturn false;\n\t}\n\n\tvar trimmedHref = href.trim();\n\n\tif (!trimmedHref) {\n\t\treturn false;\n\t}\n\n\t// Does the href start with something that looks like a URL protocol?\n\tif (/^\\S+:/.test(trimmedHref)) {\n\t\tvar protocol = getProtocol(trimmedHref);\n\t\tif (!isValidProtocol(protocol)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Add some extra checks for http(s) URIs, since these are the most common use-case.\n\t\t// This ensures URIs with an http protocol have exactly two forward slashes following the protocol.\n\t\tif (startsWith(protocol, 'http') && !/^https?:\\/\\/[^\\/\\s]/i.test(trimmedHref)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar authority = getAuthority(trimmedHref);\n\t\tif (!isValidAuthority(authority)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar path = getPath(trimmedHref);\n\t\tif (path && !isValidPath(path)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar queryString = getQueryString(trimmedHref);\n\t\tif (queryString && !isValidQueryString(queryString)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar fragment = getFragment(trimmedHref);\n\t\tif (fragment && !isValidFragment(fragment)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Validate anchor links.\n\tif (startsWith(trimmedHref, '#') && !isValidFragment(trimmedHref)) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/***/ }),\n/* 12 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar __ = wp.i18n.__;\nvar Component = wp.element.Component;\nvar _wp$components = wp.components,\n Popover = _wp$components.Popover,\n IconButton = _wp$components.IconButton;\n\n/**\n * Custom URL Popover component.\n * \n * @since 3.6\n */\n\nvar ThirstyURLPopover = function (_Component) {\n\t_inherits(ThirstyURLPopover, _Component);\n\n\t/**\n * Component constructor method.\n * \n * @since 3.6\n */\n\tfunction ThirstyURLPopover() {\n\t\t_classCallCheck(this, ThirstyURLPopover);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ThirstyURLPopover.__proto__ || Object.getPrototypeOf(ThirstyURLPopover)).apply(this, arguments));\n\n\t\t_this.toggleSettingsVisibility = _this.toggleSettingsVisibility.bind(_this);\n\n\t\t_this.state = {\n\t\t\tisSettingsExpanded: false\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Component constructor.\n * \n * @since 3.6\n */\n\n\n\t_createClass(ThirstyURLPopover, [{\n\t\tkey: 'toggleSettingsVisibility',\n\t\tvalue: function toggleSettingsVisibility() {\n\t\t\tthis.setState({\n\t\t\t\tisSettingsExpanded: !this.state.isSettingsExpanded\n\t\t\t});\n\t\t}\n\n\t\t/**\n * Component render method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _props = this.props,\n\t\t\t children = _props.children,\n\t\t\t renderSettings = _props.renderSettings,\n\t\t\t invalidLink = _props.invalidLink,\n\t\t\t _props$position = _props.position,\n\t\t\t position = _props$position === undefined ? 'bottom center' : _props$position,\n\t\t\t _props$focusOnMount = _props.focusOnMount,\n\t\t\t focusOnMount = _props$focusOnMount === undefined ? 'firstElement' : _props$focusOnMount,\n\t\t\t popoverProps = _objectWithoutProperties(_props, ['children', 'renderSettings', 'invalidLink', 'position', 'focusOnMount']);\n\n\t\t\tvar isSettingsExpanded = this.state.isSettingsExpanded;\n\n\n\t\t\tvar showSettings = !!renderSettings && isSettingsExpanded;\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\tPopover,\n\t\t\t\t_extends({\n\t\t\t\t\tclassName: 'ta-url-popover editor-url-popover block-editor-url-popover',\n\t\t\t\t\tfocusOnMount: focusOnMount,\n\t\t\t\t\tposition: position\n\t\t\t\t}, popoverProps),\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'editor-url-popover__row' },\n\t\t\t\t\tchildren,\n\t\t\t\t\t!!renderSettings && wp.element.createElement(IconButton, {\n\t\t\t\t\t\tclassName: 'editor-url-popover__settings-toggle',\n\t\t\t\t\t\ticon: 'ellipsis',\n\t\t\t\t\t\tlabel: __('Link Settings'),\n\t\t\t\t\t\tonClick: this.toggleSettingsVisibility,\n\t\t\t\t\t\t'aria-expanded': isSettingsExpanded\n\t\t\t\t\t})\n\t\t\t\t),\n\t\t\t\tshowSettings && wp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'editor-url-popover__row editor-url-popover__settings' },\n\t\t\t\t\trenderSettings()\n\t\t\t\t),\n\t\t\t\tinvalidLink && wp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ 'class': 'ta-invalid-link' },\n\t\t\t\t\t__('Invalid affiliate link')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn ThirstyURLPopover;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (ThirstyURLPopover);\n\n/***/ }),\n/* 13 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view__ = __webpack_require__(14);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view__);\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\n\nvar __ = wp.i18n.__;\nvar _lodash = lodash,\n throttle = _lodash.throttle;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar _wp$keycodes = wp.keycodes,\n UP = _wp$keycodes.UP,\n DOWN = _wp$keycodes.DOWN,\n ENTER = _wp$keycodes.ENTER,\n TAB = _wp$keycodes.TAB;\nvar _wp$components = wp.components,\n Spinner = _wp$components.Spinner,\n withSpokenMessages = _wp$components.withSpokenMessages,\n Popover = _wp$components.Popover;\nvar withInstanceId = wp.compose.withInstanceId;\n\n// Since URLInput is rendered in the context of other inputs, but should be\n// considered a separate modal node, prevent keyboard events from propagating\n// as being considered from the input.\n\nvar stopEventPropagation = function stopEventPropagation(event) {\n\treturn event.stopPropagation();\n};\n\n/**\n * Custom URL Input component.\n * \n * @since 3.6\n */\n\nvar ThirstyURLInput = function (_Component) {\n\t_inherits(ThirstyURLInput, _Component);\n\n\t/**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tfunction ThirstyURLInput(_ref) {\n\t\tvar autocompleteRef = _ref.autocompleteRef;\n\n\t\t_classCallCheck(this, ThirstyURLInput);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ThirstyURLInput.__proto__ || Object.getPrototypeOf(ThirstyURLInput)).apply(this, arguments));\n\n\t\t_this.onChange = _this.onChange.bind(_this);\n\t\t_this.onKeyDown = _this.onKeyDown.bind(_this);\n\t\t_this.autocompleteRef = autocompleteRef || createRef();\n\t\t_this.inputRef = createRef();\n\t\t_this.updateSuggestions = throttle(_this.updateSuggestions.bind(_this), 200);\n\n\t\t_this.suggestionNodes = [];\n\n\t\t_this.state = {\n\t\t\tposts: [],\n\t\t\tshowSuggestions: false,\n\t\t\tselectedSuggestion: null\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Component did update method.\n * \n * @since 3.6\n */\n\n\n\t_createClass(ThirstyURLInput, [{\n\t\tkey: 'componentDidUpdate',\n\t\tvalue: function componentDidUpdate() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar _state = this.state,\n\t\t\t showSuggestions = _state.showSuggestions,\n\t\t\t selectedSuggestion = _state.selectedSuggestion;\n\t\t\t// only have to worry about scrolling selected suggestion into view\n\t\t\t// when already expanded\n\n\t\t\tif (showSuggestions && selectedSuggestion !== null && !this.scrollingIntoView) {\n\t\t\t\tthis.scrollingIntoView = true;\n\t\t\t\t__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view___default()(this.suggestionNodes[selectedSuggestion], this.autocompleteRef.current, {\n\t\t\t\t\tonlyScrollIfNeeded: true\n\t\t\t\t});\n\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t_this2.scrollingIntoView = false;\n\t\t\t\t}, 100);\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Component unmount method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'componentWillUnmount',\n\t\tvalue: function componentWillUnmount() {\n\t\t\tdelete this.suggestionsRequest;\n\t\t}\n\n\t\t/**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\n\t}, {\n\t\tkey: 'bindSuggestionNode',\n\t\tvalue: function bindSuggestionNode(index) {\n\t\t\tvar _this3 = this;\n\n\t\t\treturn function (ref) {\n\t\t\t\t_this3.suggestionNodes[index] = ref;\n\t\t\t};\n\t\t}\n\n\t\t/**\n * Callback to show suggestions based on value inputted on search field.\n * \n * @since 3.6\n * \n * @param {*} value \n */\n\n\t}, {\n\t\tkey: 'updateSuggestions',\n\t\tvalue: function updateSuggestions(value) {\n\t\t\tvar _this4 = this;\n\n\t\t\t// Show the suggestions after typing at least 2 characters\n\t\t\t// and also for URLs\n\t\t\tif (value.length < 2 || /^https?:/.test(value)) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tshowSuggestions: false,\n\t\t\t\t\tselectedSuggestion: null,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tshowSuggestions: true,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: true\n\t\t\t});\n\n\t\t\tvar formData = new FormData();\n\t\t\tformData.append(\"action\", \"search_affiliate_links_query\");\n\t\t\tformData.append(\"keyword\", value);\n\t\t\tformData.append(\"paged\", 1);\n\t\t\tformData.append(\"gutenberg\", true);\n\n\t\t\t// We are getting data via the WP AJAX instead of rest API as it is not possible yet\n\t\t\t// to filter results with category value. This is to prepare next update to add category filter.\n\t\t\tvar request = fetch(ajaxurl, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: formData\n\t\t\t});\n\n\t\t\trequest.then(function (response) {\n\t\t\t\treturn response.json();\n\t\t\t}).then(function (response) {\n\n\t\t\t\tif (!response.affiliate_links) return;\n\n\t\t\t\tvar posts = response.affiliate_links;\n\n\t\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\t\tif (_this4.suggestionsRequest !== request) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t_this4.setState({\n\t\t\t\t\tposts: posts,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\tif (!!posts.length) {\n\t\t\t\t\t_this4.props.debouncedSpeak(sprintf(_n('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', posts.length), posts.length), 'assertive');\n\t\t\t\t} else {\n\t\t\t\t\t_this4.props.debouncedSpeak(__('No results.'), 'assertive');\n\t\t\t\t}\n\t\t\t}).catch(function () {\n\t\t\t\tif (_this4.suggestionsRequest === request) {\n\t\t\t\t\t_this4.setState({\n\t\t\t\t\t\tloading: false\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.suggestionsRequest = request;\n\t\t}\n\n\t\t/**\n * Search input value change event callback method.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'onChange',\n\t\tvalue: function onChange(event) {\n\t\t\tthis.props.resetInvalidLink();\n\t\t\tvar inputValue = event.target.value;\n\t\t\tthis.props.onChange(inputValue);\n\t\t\tthis.updateSuggestions(inputValue);\n\t\t}\n\n\t\t/**\n * Keydown event callback. Handles selecting result via keyboard.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'onKeyDown',\n\t\tvalue: function onKeyDown(event) {\n\t\t\tvar _state2 = this.state,\n\t\t\t showSuggestions = _state2.showSuggestions,\n\t\t\t selectedSuggestion = _state2.selectedSuggestion,\n\t\t\t posts = _state2.posts,\n\t\t\t loading = _state2.loading;\n\t\t\t// If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n\t\t\t// We shouldn't preventDefault to allow block arrow keys navigation\n\n\t\t\tif (!showSuggestions || !posts.length || loading) {\n\t\t\t\t// In the Windows version of Firefox the up and down arrows don't move the caret\n\t\t\t\t// within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n\t\t\t\t// a form of focus trapping that is disruptive to the user experience. This disruption\n\t\t\t\t// only happens if the caret is not in the first or last position in the text input.\n\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n\t\t\t\tswitch (event.keyCode) {\n\t\t\t\t\t// When UP is pressed, if the caret is at the start of the text, move it to the 0\n\t\t\t\t\t// position.\n\t\t\t\t\tcase UP:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (0 !== event.target.selectionStart) {\n\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t\t\t// Set the input caret to position 0\n\t\t\t\t\t\t\t\tevent.target.setSelectionRange(0, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t// When DOWN is pressed, if the caret is not at the end of the text, move it to the\n\t\t\t\t\t// last position.\n\t\t\t\t\tcase DOWN:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (this.props.value.length !== event.target.selectionStart) {\n\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t\t\t// Set the input caret to the last position\n\t\t\t\t\t\t\t\tevent.target.setSelectionRange(this.props.value.length, this.props.value.length);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar post = this.state.posts[this.state.selectedSuggestion];\n\n\t\t\tswitch (event.keyCode) {\n\t\t\t\tcase UP:\n\t\t\t\t\t{\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tvar previousIndex = !selectedSuggestion ? posts.length - 1 : selectedSuggestion - 1;\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\tselectedSuggestion: previousIndex\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase DOWN:\n\t\t\t\t\t{\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tvar nextIndex = selectedSuggestion === null || selectedSuggestion === posts.length - 1 ? 0 : selectedSuggestion + 1;\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\tselectedSuggestion: nextIndex\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase TAB:\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.state.selectedSuggestion !== null) {\n\t\t\t\t\t\t\tthis.selectLink(post);\n\t\t\t\t\t\t\t// Announce a link has been selected when tabbing away from the input field.\n\t\t\t\t\t\t\tthis.props.speak(__('Link selected'));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase ENTER:\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.state.selectedSuggestion !== null) {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tthis.selectLink(post);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: 'selectLink',\n\t\tvalue: function selectLink(post) {\n\t\t\tthis.props.onChange(post.link, post);\n\t\t\tthis.setState({\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tshowSuggestions: false\n\t\t\t});\n\t\t}\n\n\t\t/**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: 'handleOnClick',\n\t\tvalue: function handleOnClick(post) {\n\t\t\tthis.selectLink(post);\n\t\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\t\tthis.inputRef.current.focus();\n\t\t}\n\n\t\t/**\n * Component render method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _this5 = this;\n\n\t\t\tvar _props = this.props,\n\t\t\t _props$value = _props.value,\n\t\t\t value = _props$value === undefined ? '' : _props$value,\n\t\t\t _props$autoFocus = _props.autoFocus,\n\t\t\t autoFocus = _props$autoFocus === undefined ? true : _props$autoFocus,\n\t\t\t instanceId = _props.instanceId,\n\t\t\t invalidLink = _props.invalidLink;\n\t\t\tvar _state3 = this.state,\n\t\t\t showSuggestions = _state3.showSuggestions,\n\t\t\t posts = _state3.posts,\n\t\t\t selectedSuggestion = _state3.selectedSuggestion,\n\t\t\t loading = _state3.loading;\n\t\t\t/* eslint-disable jsx-a11y/no-autofocus */\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ className: 'editor-url-input block-editor-url-input' },\n\t\t\t\twp.element.createElement('input', {\n\t\t\t\t\tautoFocus: autoFocus,\n\t\t\t\t\ttype: 'text',\n\t\t\t\t\t'aria-label': __('URL'),\n\t\t\t\t\trequired: true,\n\t\t\t\t\tvalue: value,\n\t\t\t\t\tonChange: this.onChange,\n\t\t\t\t\tonInput: stopEventPropagation,\n\t\t\t\t\tplaceholder: __('Paste URL or type to search'),\n\t\t\t\t\tonKeyDown: this.onKeyDown,\n\t\t\t\t\trole: 'combobox',\n\t\t\t\t\t'aria-expanded': showSuggestions,\n\t\t\t\t\t'aria-autocomplete': 'list',\n\t\t\t\t\t'aria-owns': 'editor-url-input-suggestions-' + instanceId,\n\t\t\t\t\t'aria-activedescendant': selectedSuggestion !== null ? 'editor-url-input-suggestion-' + instanceId + '-' + selectedSuggestion : undefined,\n\t\t\t\t\tref: this.inputRef\n\t\t\t\t}),\n\t\t\t\tloading && wp.element.createElement(Spinner, null),\n\t\t\t\tshowSuggestions && !!posts.length && !invalidLink && wp.element.createElement(\n\t\t\t\t\tPopover,\n\t\t\t\t\t{ position: 'bottom', noArrow: true, focusOnMount: false },\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t'div',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclassName: 'editor-url-input__suggestions block-editor-url-input__suggestions',\n\t\t\t\t\t\t\tid: 'editor-url-input-suggestions-' + instanceId,\n\t\t\t\t\t\t\tref: this.autocompleteRef,\n\t\t\t\t\t\t\trole: 'listbox'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tposts.map(function (post, index) {\n\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t'button',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tkey: post.id,\n\t\t\t\t\t\t\t\t\trole: 'option',\n\t\t\t\t\t\t\t\t\ttabIndex: '-1',\n\t\t\t\t\t\t\t\t\tid: 'block-editor-url-input-suggestion-' + instanceId + '-' + index,\n\t\t\t\t\t\t\t\t\tref: _this5.bindSuggestionNode(index),\n\t\t\t\t\t\t\t\t\tclassName: __WEBPACK_IMPORTED_MODULE_0_classnames___default()('editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\treturn _this5.handleOnClick(post);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t'aria-selected': index === selectedSuggestion\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tpost.title || __('(no title)')\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t/* eslint-enable jsx-a11y/no-autofocus */\n\t\t}\n\t}]);\n\n\treturn ThirstyURLInput;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withSpokenMessages(withInstanceId(ThirstyURLInput)));\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = __webpack_require__(15);\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar util = __webpack_require__(16);\n\nfunction scrollIntoView(elem, container, config) {\n config = config || {};\n // document 归一化到 window\n if (container.nodeType === 9) {\n container = util.getWindow(container);\n }\n\n var allowHorizontalScroll = config.allowHorizontalScroll;\n var onlyScrollIfNeeded = config.onlyScrollIfNeeded;\n var alignWithTop = config.alignWithTop;\n var alignWithLeft = config.alignWithLeft;\n var offsetTop = config.offsetTop || 0;\n var offsetLeft = config.offsetLeft || 0;\n var offsetBottom = config.offsetBottom || 0;\n var offsetRight = config.offsetRight || 0;\n\n allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;\n\n var isWin = util.isWindow(container);\n var elemOffset = util.offset(elem);\n var eh = util.outerHeight(elem);\n var ew = util.outerWidth(elem);\n var containerOffset = undefined;\n var ch = undefined;\n var cw = undefined;\n var containerScroll = undefined;\n var diffTop = undefined;\n var diffBottom = undefined;\n var win = undefined;\n var winScroll = undefined;\n var ww = undefined;\n var wh = undefined;\n\n if (isWin) {\n win = container;\n wh = util.height(win);\n ww = util.width(win);\n winScroll = {\n left: util.scrollLeft(win),\n top: util.scrollTop(win)\n };\n // elem 相对 container 可视视窗的距离\n diffTop = {\n left: elemOffset.left - winScroll.left - offsetLeft,\n top: elemOffset.top - winScroll.top - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,\n top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom\n };\n containerScroll = winScroll;\n } else {\n containerOffset = util.offset(container);\n ch = container.clientHeight;\n cw = container.clientWidth;\n containerScroll = {\n left: container.scrollLeft,\n top: container.scrollTop\n };\n // elem 相对 container 可视视窗的距离\n // 注意边框, offset 是边框到根节点\n diffTop = {\n left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft,\n top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight,\n top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom\n };\n }\n\n if (diffTop.top < 0 || diffBottom.top > 0) {\n // 强制向上\n if (alignWithTop === true) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else if (alignWithTop === false) {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n } else {\n // 自动调整\n if (diffTop.top < 0) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;\n if (alignWithTop) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n }\n\n if (allowHorizontalScroll) {\n if (diffTop.left < 0 || diffBottom.left > 0) {\n // 强制向上\n if (alignWithLeft === true) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else if (alignWithLeft === false) {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n } else {\n // 自动调整\n if (diffTop.left < 0) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;\n if (alignWithLeft) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n }\n }\n}\n\nmodule.exports = scrollIntoView;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar RE_NUM = /[\\-+]?(?:\\d*\\.|)\\d+(?:[eE][\\-+]?\\d+|)/.source;\n\nfunction getClientPosition(elem) {\n var box = undefined;\n var x = undefined;\n var y = undefined;\n var doc = elem.ownerDocument;\n var body = doc.body;\n var docElem = doc && doc.documentElement;\n // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式\n box = elem.getBoundingClientRect();\n\n // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop\n // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确\n // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin\n\n x = box.left;\n y = box.top;\n\n // In IE, most of the time, 2 extra pixels are added to the top and left\n // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and\n // IE6 standards mode, this border can be overridden by setting the\n // document element's border to zero -- thus, we cannot rely on the\n // offset always being 2 pixels.\n\n // In quirks mode, the offset can be determined by querying the body's\n // clientLeft/clientTop, but in standards mode, it is found by querying\n // the document element's clientLeft/clientTop. Since we already called\n // getClientBoundingRect we have already forced a reflow, so it is not\n // too expensive just to query them all.\n\n // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的\n // 窗口边框标准是设 documentElement ,quirks 时设置 body\n // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去\n // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置\n // 标准 ie 下 docElem.clientTop 就是 border-top\n // ie7 html 即窗口边框改变不了。永远为 2\n // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0\n\n x -= docElem.clientLeft || body.clientLeft || 0;\n y -= docElem.clientTop || body.clientTop || 0;\n\n return {\n left: x,\n top: y\n };\n}\n\nfunction getScroll(w, top) {\n var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];\n var method = 'scroll' + (top ? 'Top' : 'Left');\n if (typeof ret !== 'number') {\n var d = w.document;\n // ie6,7,8 standard mode\n ret = d.documentElement[method];\n if (typeof ret !== 'number') {\n // quirks mode\n ret = d.body[method];\n }\n }\n return ret;\n}\n\nfunction getScrollLeft(w) {\n return getScroll(w);\n}\n\nfunction getScrollTop(w) {\n return getScroll(w, true);\n}\n\nfunction getOffset(el) {\n var pos = getClientPosition(el);\n var doc = el.ownerDocument;\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScrollLeft(w);\n pos.top += getScrollTop(w);\n return pos;\n}\nfunction _getComputedStyle(elem, name, computedStyle_) {\n var val = '';\n var d = elem.ownerDocument;\n var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);\n\n // https://github.com/kissyteam/kissy/issues/61\n if (computedStyle) {\n val = computedStyle.getPropertyValue(name) || computedStyle[name];\n }\n\n return val;\n}\n\nvar _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');\nvar RE_POS = /^(top|right|bottom|left)$/;\nvar CURRENT_STYLE = 'currentStyle';\nvar RUNTIME_STYLE = 'runtimeStyle';\nvar LEFT = 'left';\nvar PX = 'px';\n\nfunction _getComputedStyleIE(elem, name) {\n // currentStyle maybe null\n // http://msdn.microsoft.com/en-us/library/ms535231.aspx\n var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];\n\n // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值\n // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19\n // 在 ie 下不对,需要直接用 offset 方式\n // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了\n\n // From the awesome hack by Dean Edwards\n // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n // If we're not dealing with a regular pixel number\n // but a number that has a weird ending, we need to convert it to pixels\n // exclude left right for relativity\n if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {\n // Remember the original values\n var style = elem.style;\n var left = style[LEFT];\n var rsLeft = elem[RUNTIME_STYLE][LEFT];\n\n // prevent flashing of content\n elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];\n\n // Put in the new values to get a computed value out\n style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;\n ret = style.pixelLeft + PX;\n\n // Revert the changed values\n style[LEFT] = left;\n\n elem[RUNTIME_STYLE][LEFT] = rsLeft;\n }\n return ret === '' ? 'auto' : ret;\n}\n\nvar getComputedStyleX = undefined;\nif (typeof window !== 'undefined') {\n getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;\n}\n\nfunction each(arr, fn) {\n for (var i = 0; i < arr.length; i++) {\n fn(arr[i]);\n }\n}\n\nfunction isBorderBoxFn(elem) {\n return getComputedStyleX(elem, 'boxSizing') === 'border-box';\n}\n\nvar BOX_MODELS = ['margin', 'border', 'padding'];\nvar CONTENT_INDEX = -1;\nvar PADDING_INDEX = 2;\nvar BORDER_INDEX = 1;\nvar MARGIN_INDEX = 0;\n\nfunction swap(elem, options, callback) {\n var old = {};\n var style = elem.style;\n var name = undefined;\n\n // Remember the old values, and insert the new ones\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n old[name] = style[name];\n style[name] = options[name];\n }\n }\n\n callback.call(elem);\n\n // Revert the old values\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n style[name] = old[name];\n }\n }\n}\n\nfunction getPBMWidth(elem, props, which) {\n var value = 0;\n var prop = undefined;\n var j = undefined;\n var i = undefined;\n for (j = 0; j < props.length; j++) {\n prop = props[j];\n if (prop) {\n for (i = 0; i < which.length; i++) {\n var cssProp = undefined;\n if (prop === 'border') {\n cssProp = prop + which[i] + 'Width';\n } else {\n cssProp = prop + which[i];\n }\n value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;\n }\n }\n }\n return value;\n}\n\n/**\n * A crude way of determining if an object is a window\n * @member util\n */\nfunction isWindow(obj) {\n // must use == for ie8\n /* eslint eqeqeq:0 */\n return obj != null && obj == obj.window;\n}\n\nvar domUtils = {};\n\neach(['Width', 'Height'], function (name) {\n domUtils['doc' + name] = function (refWin) {\n var d = refWin.document;\n return Math.max(\n // firefox chrome documentElement.scrollHeight< body.scrollHeight\n // ie standard mode : documentElement.scrollHeight> body.scrollHeight\n d.documentElement['scroll' + name],\n // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?\n d.body['scroll' + name], domUtils['viewport' + name](d));\n };\n\n domUtils['viewport' + name] = function (win) {\n // pc browser includes scrollbar in window.innerWidth\n var prop = 'client' + name;\n var doc = win.document;\n var body = doc.body;\n var documentElement = doc.documentElement;\n var documentElementProp = documentElement[prop];\n // 标准模式取 documentElement\n // backcompat 取 body\n return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;\n };\n});\n\n/*\n 得到元素的大小信息\n @param elem\n @param name\n @param {String} [extra] 'padding' : (css width) + padding\n 'border' : (css width) + padding + border\n 'margin' : (css width) + padding + border + margin\n */\nfunction getWH(elem, name, extra) {\n if (isWindow(elem)) {\n return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);\n } else if (elem.nodeType === 9) {\n return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);\n }\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem, computedStyle);\n var cssBoxValue = 0;\n if (borderBoxValue == null || borderBoxValue <= 0) {\n borderBoxValue = undefined;\n // Fall back to computed then un computed css if necessary\n cssBoxValue = getComputedStyleX(elem, name);\n if (cssBoxValue == null || Number(cssBoxValue) < 0) {\n cssBoxValue = elem.style[name] || 0;\n }\n // Normalize '', auto, and prepare for extra\n cssBoxValue = parseFloat(cssBoxValue) || 0;\n }\n if (extra === undefined) {\n extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;\n }\n var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;\n var val = borderBoxValue || cssBoxValue;\n if (extra === CONTENT_INDEX) {\n if (borderBoxValueOrIsBorderBox) {\n return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);\n }\n return cssBoxValue;\n }\n if (borderBoxValueOrIsBorderBox) {\n var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);\n return val + (extra === BORDER_INDEX ? 0 : padding);\n }\n return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);\n}\n\nvar cssShow = {\n position: 'absolute',\n visibility: 'hidden',\n display: 'block'\n};\n\n// fix #119 : https://github.com/kissyteam/kissy/issues/119\nfunction getWHIgnoreDisplay(elem) {\n var val = undefined;\n var args = arguments;\n // in case elem is window\n // elem.offsetWidth === undefined\n if (elem.offsetWidth !== 0) {\n val = getWH.apply(undefined, args);\n } else {\n swap(elem, cssShow, function () {\n val = getWH.apply(undefined, args);\n });\n }\n return val;\n}\n\nfunction css(el, name, v) {\n var value = v;\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n for (var i in name) {\n if (name.hasOwnProperty(i)) {\n css(el, i, name[i]);\n }\n }\n return undefined;\n }\n if (typeof value !== 'undefined') {\n if (typeof value === 'number') {\n value += 'px';\n }\n el.style[name] = value;\n return undefined;\n }\n return getComputedStyleX(el, name);\n}\n\neach(['width', 'height'], function (name) {\n var first = name.charAt(0).toUpperCase() + name.slice(1);\n domUtils['outer' + first] = function (el, includeMargin) {\n return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);\n };\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n\n domUtils[name] = function (elem, val) {\n if (val !== undefined) {\n if (elem) {\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem);\n if (isBorderBox) {\n val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);\n }\n return css(elem, name, val);\n }\n return undefined;\n }\n return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);\n };\n});\n\n// 设置 elem 相对 elem.ownerDocument 的坐标\nfunction setOffset(elem, offset) {\n // set position first, in-case top/left are set even on static elem\n if (css(elem, 'position') === 'static') {\n elem.style.position = 'relative';\n }\n\n var old = getOffset(elem);\n var ret = {};\n var current = undefined;\n var key = undefined;\n\n for (key in offset) {\n if (offset.hasOwnProperty(key)) {\n current = parseFloat(css(elem, key)) || 0;\n ret[key] = current + offset[key] - old[key];\n }\n }\n css(elem, ret);\n}\n\nmodule.exports = _extends({\n getWindow: function getWindow(node) {\n var doc = node.ownerDocument || node;\n return doc.defaultView || doc.parentWindow;\n },\n offset: function offset(el, value) {\n if (typeof value !== 'undefined') {\n setOffset(el, value);\n } else {\n return getOffset(el);\n }\n },\n\n isWindow: isWindow,\n each: each,\n css: css,\n clone: function clone(obj) {\n var ret = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret[i] = obj[i];\n }\n }\n var overflow = obj.overflow;\n if (overflow) {\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret.overflow[i] = obj.overflow[i];\n }\n }\n }\n return ret;\n },\n scrollLeft: function scrollLeft(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollLeft(w);\n }\n window.scrollTo(v, getScrollTop(w));\n } else {\n if (v === undefined) {\n return w.scrollLeft;\n }\n w.scrollLeft = v;\n }\n },\n scrollTop: function scrollTop(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollTop(w);\n }\n window.scrollTo(getScrollLeft(w), v);\n } else {\n if (v === undefined) {\n return w.scrollTop;\n }\n w.scrollTop = v;\n }\n },\n\n viewportWidth: 0,\n viewportHeight: 0\n}, domUtils);\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// gutenberg-support.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap d99a01d6a74ed422ed81","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/classnames/index.js\n// module id = 0\n// module chunks = 0","import registerBlocks from \"./blocks\";\nimport registerFormats from \"./formats\";\n\nimport \"./assets/styles/index.scss\";\n\nregisterBlocks();\nregisterFormats();\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","import * as taimage from \"./ta-image\";\n\nconst { registerBlockType } = wp.blocks;\n\n/**\n * Register gutenberg blocks.\n * \n * @since 3.6\n */\nexport default function registerBlocks() {\n\n [\n taimage\n ].forEach( ( block ) => {\n if ( ! block ) return;\n\n const { name , settings } = block;\n registerBlockType( name , settings );\n } );\n}\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/index.js","import classnames from \"classnames\";\n\nconst { Fragment } = wp.element;\nconst { __ } = wp.i18n;\nconst { createBlock, getBlockAttributes, getPhrasingContentSchema } = wp.blocks;\nconst { RichText } = wp.editor;\nconst { Path , SVG } = wp.components;\n\nimport edit from \"./edit\";\n\nexport const name = 'ta/image';\n\nconst blockAttributes = {\n\turl: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'src',\n\t},\n\talt: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'alt',\n\t\tdefault: '',\n\t},\n\tcaption: {\n\t\ttype: 'string',\n\t\tsource: 'html',\n\t\tselector: 'figcaption',\n\t},\n\tid: {\n\t\ttype: 'number',\n\t},\n\talign: {\n\t\ttype: 'string',\n\t},\n\twidth: {\n\t\ttype: 'number',\n\t},\n\theight: {\n\t\ttype: 'number',\n\t},\n\tlinkid: {\n\t\ttype: 'number',\n\t},\n\thref: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'ta',\n\t\tattribute: 'href'\n\t},\n\taffiliateLink: {\n\t\ttype: 'object'\n\t}\n};\n\nconst imageSchema = {\n\timg: {\n\t\tattributes: [ 'src', 'alt' ],\n\t\tclasses: [ 'alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\\d+$/ ],\n\t},\n};\n\nconst schema = {\n\tfigure: {\n\t\trequire: [ 'ta' , 'img' ],\n\t\tchildren: {\n\t\t\tta: {\n\t\t\t\tattributes: [ 'href', 'linkid' ],\n\t\t\t\tchildren: imageSchema,\n\t\t\t},\n\t\t\tfigcaption: {\n\t\t\t\tchildren: getPhrasingContentSchema(),\n\t\t\t},\n\t\t},\n\t},\n};\n\nfunction getFirstAnchorAttributeFormHTML( html, attributeName ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = html;\n\n\tconst { firstElementChild } = body;\n\n\tif (\n\t\tfirstElementChild &&\n\t\tfirstElementChild.nodeName === 'A'\n\t) {\n\t\treturn firstElementChild.getAttribute( attributeName ) || undefined;\n\t}\n}\n\nexport const settings = {\n\ttitle: __( 'ThirstyAffiliates Image' ),\n\n\tdescription: __( 'Insert an image with an affiliate link to make a visual statement.' ),\n\n\ticon: <SVG viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><Path d=\"M0,0h24v24H0V0z\" fill=\"none\" /><Path d=\"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z\" /><Path d=\"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z\" /></SVG>,\n\n\tcategory: 'common',\n\n\tkeywords: [\n\t\t'img', // \"img\" is not translated as it is intended to reflect the HTML <img> tag.\n\t\t__( 'photo' ),\n\t\t__( 'affiliate' )\n\t],\n\n\tattributes: blockAttributes,\n\n\tgetEditWrapperProps( attributes ) {\n\t\tconst { align, width } = attributes;\n\t\tif ( 'left' === align || 'center' === align || 'right' === align || 'wide' === align || 'full' === align ) {\n\t\t\treturn { 'data-align': align, 'data-resized': !! width };\n\t\t}\n\t},\n\n\tedit,\n\n\tsave( { attributes } ) {\n\t\tconst {\n\t\t\turl,\n\t\t\talt,\n\t\t\tcaption,\n\t\t\talign,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tid,\n\t\t\tlinkid,\n\t\t\thref\n\t\t} = attributes;\n\n\t\tconst classes = classnames( {\n\t\t\t[ `align${ align }` ]: align,\n\t\t\t'is-resized': width || height,\n\t\t} );\n\n\t\tconst image = (\n\t\t\t<img\n\t\t\t\tsrc={ url }\n\t\t\t\talt={ alt }\n\t\t\t\tclassName={ id ? `wp-image-${ id }` : null }\n\t\t\t\twidth={ width }\n\t\t\t\theight={ height }\n\t\t\t/>\n\t\t);\n\n\t\tconst figure = (\n\t\t\t<Fragment>\n\t\t\t\t<ta linkid={ linkid } href={ href }>\n\t\t\t\t{ image }\n\t\t\t\t</ta>\n\t\t\t\t<RichText.Content tagName=\"figcaption\" value={ caption } />\n\t\t\t</Fragment>\n\t\t);\n\n\t\tif ( 'left' === align || 'right' === align || 'center' === align ) {\n\t\t\treturn (\n\t\t\t\t<div className='wp-block-image'>\n\t\t\t\t\t<figure className={ classes }>\n\t\t\t\t\t\t{ figure }\n\t\t\t\t\t</figure>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<figure className={ `wp-block-image ${classes}` }>\n\t\t\t\t{ figure }\n\t\t\t</figure>\n\t\t);\n\t}\n};\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/index.js","import classnames from \"classnames\";\n\nconst { get , isEmpty , map , last , pick , compact } = lodash;\nconst { getPath } = wp.url;\nconst { __, sprintf } = wp.i18n;\nconst { Component, Fragment , createRef } = wp.element;\nconst { getBlobByURL, revokeBlobURL, isBlobURL } = wp.blob;\nconst { Placeholder , Button , ButtonGroup , IconButton , PanelBody , ResizableBox , SelectControl , Spinner , TextControl , TextareaControl , Toolbar , withNotices , ToggleControl , Popover } = wp.components;\nconst { withSelect } = wp.data;\nconst { RichText , BlockControls , InspectorControls , MediaUpload , MediaUploadCheck , MediaPlaceholder , BlockAlignmentToolbar , mediaUpload } = wp.editor;\nconst { withViewportMatch } = wp.viewport;\nconst { compose } = wp.compose;\n\nimport { createUpgradedEmbedBlock } from \"./util\";\nimport ImageSize from \"./image-size\";\nimport ThirstyURLInput from './search-input';\n\n/**\n * Module constants\n */\nconst MIN_SIZE = 20;\nconst LINK_DESTINATION_NONE = 'none';\nconst LINK_DESTINATION_MEDIA = 'media';\nconst LINK_DESTINATION_ATTACHMENT = 'attachment';\nconst LINK_DESTINATION_CUSTOM = 'custom';\nconst NEW_TAB_REL = 'noreferrer noopener';\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nexport const pickRelevantMediaFiles = ( image ) => {\n\tconst imageProps = pick( image, [ 'alt', 'id', 'link', 'caption' ] );\n\timageProps.url = get( image, [ 'sizes', 'large', 'url' ] ) || get( image, [ 'media_details', 'sizes', 'large', 'source_url' ] ) || image.url;\n\treturn imageProps;\n};\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily\n * while the image is being uploaded and will not have an id yet allocated.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the URL a Blob URL\n */\nconst isTemporaryImage = ( id, url ) => ! id && isBlobURL( url );\n\n/**\n * Is the url for the image hosted externally. An externally hosted image has no id\n * and is not a blob url.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the url an externally hosted url?\n */\nconst isExternalImage = ( id, url ) => url && ! id && ! isBlobURL( url );\n\nclass ImageEdit extends Component {\n\tconstructor( { attributes } ) {\n\t\tsuper( ...arguments );\n\t\tthis.updateAlt = this.updateAlt.bind( this );\n\t\tthis.updateAlignment = this.updateAlignment.bind( this );\n\t\tthis.onFocusCaption = this.onFocusCaption.bind( this );\n\t\tthis.onImageClick = this.onImageClick.bind( this );\n\t\tthis.onSelectImage = this.onSelectImage.bind( this );\n\t\tthis.updateImageURL = this.updateImageURL.bind( this );\n\t\tthis.updateWidth = this.updateWidth.bind( this );\n\t\tthis.updateHeight = this.updateHeight.bind( this );\n\t\tthis.updateDimensions = this.updateDimensions.bind( this );\n\t\tthis.getFilename = this.getFilename.bind( this );\n\t\tthis.toggleIsEditing = this.toggleIsEditing.bind( this );\n\t\tthis.onImageError = this.onImageError.bind( this );\n\t\tthis.onChangeInputValue = this.onChangeInputValue.bind( this );\n\t\tthis.autocompleteRef = createRef();\n\t\tthis.resetInvalidLink = this.resetInvalidLink.bind( this );\n\t\tthis.updateImageSelection = this.updateImageSelection.bind( this );\n\t\tthis.onSelectAffiliateImage = this.onSelectAffiliateImage.bind( this );\n\t\tthis.editAFfiliateImage = this.editAFfiliateImage.bind( this );\n\n\t\tthis.state = {\n\t\t\tcaptionFocused: false,\n\t\t\tisEditing: ! attributes.url,\n\t\t\tinputValue : '',\n\t\t\tlinkid : 0,\n\t\t\tpost : null,\n\t\t\tshowSuggestions : false,\n\t\t\timageSelection : [],\n\t\t\taffiliateLink : null\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { attributes, setAttributes, noticeOperations } = this.props;\n\t\tconst { id, url = '' } = attributes;\n\n\t\tif ( isTemporaryImage( id, url ) ) {\n\t\t\tconst file = getBlobByURL( url );\n\n\t\t\tif ( file ) {\n\t\t\t\tmediaUpload( {\n\t\t\t\t\tfilesList: [ file ],\n\t\t\t\t\tonFileChange: ( [ image ] ) => {\n\t\t\t\t\t\tsetAttributes( pickRelevantMediaFiles( image ) );\n\t\t\t\t\t},\n\t\t\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\t\t\tonError: ( message ) => {\n\t\t\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t\t\t\tthis.setState( { isEditing: true } );\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { id: prevID, url: prevURL = '' } = prevProps.attributes;\n\t\tconst { id, url = '' } = this.props.attributes;\n\n\t\tif ( isTemporaryImage( prevID, prevURL ) && ! isTemporaryImage( id, url ) ) {\n\t\t\trevokeBlobURL( url );\n\t\t}\n\n\t\tif ( ! this.props.isSelected && prevProps.isSelected && this.state.captionFocused ) {\n\t\t\tthis.setState( {\n\t\t\t\tcaptionFocused: false,\n\t\t\t} );\n\t\t}\n\t}\n\n\tonSelectImage( media ) {\n\n\t\tif ( ! media || ! media.url ) {\n\t\t\tthis.props.setAttributes( {\n\t\t\t\turl: undefined,\n\t\t\t\talt: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tcaption: undefined\n\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\tconst { affiliateLink } = this.state;\n\n\t\tthis.setState( {\n\t\t\tisEditing: false,\n\t\t} );\n\n\t\tthis.props.setAttributes( {\n\t\t\t...pickRelevantMediaFiles( media ),\n\t\t\tlinkid: affiliateLink.id,\n\t\t\thref: affiliateLink.link,\n\t\t\taffiliateLink : affiliateLink,\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t} );\n\t}\n\n\tonImageError( url ) {\n\t\t// Check if there's an embed block that handles this URL.\n\t\tconst embedBlock = createUpgradedEmbedBlock(\n\t\t\t{ attributes: { url } }\n\t\t);\n\t\tif ( undefined !== embedBlock ) {\n\t\t\tthis.props.onReplace( embedBlock );\n\t\t}\n\t}\n\n\tonFocusCaption() {\n\t\tif ( ! this.state.captionFocused ) {\n\t\t\tthis.setState( {\n\t\t\t\tcaptionFocused: true,\n\t\t\t} );\n\t\t}\n\t}\n\n\tonImageClick() {\n\t\tif ( this.state.captionFocused ) {\n\t\t\tthis.setState( {\n\t\t\t\tcaptionFocused: false,\n\t\t\t} );\n\t\t}\n\t}\n\n\tupdateAlt( newAlt ) {\n\t\tthis.props.setAttributes( { alt: newAlt } );\n\t}\n\n\tupdateAlignment( nextAlign ) {\n\t\tconst extraUpdatedAttributes = [ 'wide', 'full' ].indexOf( nextAlign ) !== -1 ?\n\t\t\t{ width: undefined, height: undefined } :\n\t\t\t{};\n\t\tthis.props.setAttributes( { ...extraUpdatedAttributes, align: nextAlign } );\n\t}\n\n\tupdateImageURL( url ) {\n\t\tthis.props.setAttributes( { url, width: undefined, height: undefined } );\n\t}\n\n\tupdateWidth( width ) {\n\t\tthis.props.setAttributes( { width: parseInt( width, 10 ) } );\n\t}\n\n\tupdateHeight( height ) {\n\t\tthis.props.setAttributes( { height: parseInt( height, 10 ) } );\n\t}\n\n\tupdateDimensions( width = undefined, height = undefined ) {\n\t\treturn () => {\n\t\t\tthis.props.setAttributes( { width, height } );\n\t\t};\n\t}\n\n\tgetFilename( url ) {\n\t\tconst path = getPath( url );\n\t\tif ( path ) {\n\t\t\treturn last( path.split( '/' ) );\n\t\t}\n\t}\n\n\tgetLinkDestinationOptions() {\n\t\treturn [\n\t\t\t{ value: LINK_DESTINATION_NONE, label: __( 'None' ) },\n\t\t\t{ value: LINK_DESTINATION_MEDIA, label: __( 'Media File' ) },\n\t\t\t{ value: LINK_DESTINATION_ATTACHMENT, label: __( 'Attachment Page' ) },\n\t\t\t{ value: LINK_DESTINATION_CUSTOM, label: __( 'Custom URL' ) },\n\t\t];\n\t}\n\n\ttoggleIsEditing() {\n\t\tthis.setState( {\n\t\t\tisEditing: ! this.state.isEditing,\n\t\t} );\n\t}\n\n\tgetImageSizeOptions() {\n\t\tconst { imageSizes, image } = this.props;\n\t\treturn compact( map( imageSizes, ( { name, slug } ) => {\n\t\t\tconst sizeUrl = get( image, [ 'media_details', 'sizes', slug, 'source_url' ] );\n\t\t\tif ( ! sizeUrl ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tvalue: sizeUrl,\n\t\t\t\tlabel: name,\n\t\t\t};\n\t\t} ) );\n\t}\n\n\tonChangeInputValue( inputValue , post = null ) {\n\t\tconst linkid = post ? post.id : 0;\n\t\tthis.setState( { inputValue , linkid , post } );\n\t}\n\n\tresetInvalidLink() {\n\t\tthis.setState( { invalidLink : false } );\n\t}\n\n\tupdateImageSelection( imageSelection , affiliateLink ) {\n\t\tthis.setState({\n\t\t\timageSelection,\n\t\t\taffiliateLink\n\t\t});\n\t}\n\n\tonSelectAffiliateImage( image ) {\n\n\t\tif ( isExternalImage( image.id, image.src ) ) {\n\t\t\timage.url = image.src;\n\t\t\tthis.onSelectImage( image );\n\t\t} else {\n\t\t\tconst request = wp.apiFetch( {\n\t\t\t\tpath: wp.url.addQueryArgs( '/wp/v2/media/' + image.id , {\n\t\t\t\t\tcontext: 'edit',\n\t\t\t\t\t_locale: 'user'\n\t\t\t\t} ),\n\t\t\t} );\n\n\t\t\trequest.then( (media) => {\n\t\t\t\tmedia.url = media.source_url;\n\t\t\t\tthis.onSelectImage( media );\n\t\t\t} );\n\t\t}\n\t}\n\n\teditAFfiliateImage() {\n\n\t\tconst { attributes } = this.props;\n\t\tconst { affiliateLink } = attributes;\n\n\t\tthis.setState({\n\t\t\tisEditing : true,\n\t\t\timageSelection : affiliateLink.images,\n\t\t\taffiliateLink\n\t\t});\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tisEditing,\n\t\t\timageSelection,\n\t\t\taffiliateLink,\n\t\t} = this.state;\n\t\tconst {\n\t\t\tattributes,\n\t\t\tsetAttributes,\n\t\t\tisLargeViewport,\n\t\t\tisSelected,\n\t\t\tclassName,\n\t\t\tmaxWidth,\n\t\t\ttoggleSelection,\n\t\t\tisRTL,\n\t\t} = this.props;\n\t\tconst {\n\t\t\turl,\n\t\t\talt,\n\t\t\tcaption,\n\t\t\talign,\n\t\t\tlinkDestination,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tlinkid,\n\t\t\thref\n\t\t} = attributes;\n\t\tconst toolbarEditButton = (\n\t\t\t<Toolbar>\n\t\t\t\t<IconButton\n\t\t\t\t\tclassName=\"ta-edit-image-button components-icon-button components-toolbar__control\"\n\t\t\t\t\tlabel={ __( 'Edit ThirstyAffiliates Image' ) }\n\t\t\t\t\ticon=\"edit\"\n\t\t\t\t\tonClick={ this.editAFfiliateImage }\n\t\t\t\t/>\n\t\t\t</Toolbar>\n\t\t);\n\n\t\tconst controls = (\n\t\t\t<BlockControls>\n\t\t\t\t<BlockAlignmentToolbar\n\t\t\t\t\tvalue={ align }\n\t\t\t\t\tonChange={ this.updateAlignment }\n\t\t\t\t/>\n\t\t\t\t{ toolbarEditButton }\n\t\t\t</BlockControls>\n\t\t);\n\n\t\tif ( isEditing ) {\n\t\t\treturn (\n\t\t\t\t<Fragment>\n\t\t\t\t\t{ controls }\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ \"format-image\" }\n\t\t\t\t\t\tlabel={ __( \"ThirstyAffiliates Image\" ) }\n\t\t\t\t\t\tinstructions={ __( \"Search for an affiliate link and select image to insert.\" ) }\n\t\t\t\t\t>\n\n\t\t\t\t\t\t<ThirstyURLInput\n\t\t\t\t\t\t\tupdateImageSelection={ this.updateImageSelection }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{ !! imageSelection.length &&\n\t\t\t\t\t\t\t<div className=\"ta-image-sel-wrap\">\n\t\t\t\t\t\t\t\t<h3>{ `${affiliateLink.title} ${ __( 'attached images:' ) }` }</h3>\n\t\t\t\t\t\t\t\t<div className=\"ta-image-selection\">\n\t\t\t\t\t\t\t\t\t{ imageSelection.map( ( image , index ) => (\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => this.onSelectAffiliateImage( image ) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<img src={ image.src } />\n\t\t\t\t\t\t\t\t\t\t</button>\n\n\t\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t</Placeholder>\n\t\t\t\t</Fragment>\n\t\t\t);\n\t\t}\n\n\t\tconst classes = classnames( className, {\n\t\t\t'wp-block-image' : true,\n\t\t\t'is-transient': isBlobURL( url ),\n\t\t\t'is-resized': !! width || !! height,\n\t\t\t'is-focused': isSelected,\n\t\t} );\n\n\t\tconst isResizable = [ 'wide', 'full' ].indexOf( align ) === -1 && isLargeViewport;\n\t\tconst imageSizeOptions = this.getImageSizeOptions();\n\n\t\tconst getInspectorControls = ( imageWidth, imageHeight ) => (\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Image Settings' ) }>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\tlabel={ __( 'Alt Text (Alternative Text)' ) }\n\t\t\t\t\t\tvalue={ alt }\n\t\t\t\t\t\tonChange={ this.updateAlt }\n\t\t\t\t\t\thelp={ __( 'Alternative text describes your image to people who can’t see it. Add a short description with its key details.' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isEmpty( imageSizeOptions ) && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Image Size' ) }\n\t\t\t\t\t\t\tvalue={ url }\n\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\tonChange={ this.updateImageURL }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isResizable && (\n\t\t\t\t\t\t<div className=\"block-library-image__dimensions\">\n\t\t\t\t\t\t\t<p className=\"block-library-image__dimensions__row\">\n\t\t\t\t\t\t\t\t{ __( 'Image Dimensions' ) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<div className=\"block-library-image__dimensions__row\">\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-library-image__dimensions__width\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\t\t\tvalue={ width !== undefined ? width : '' }\n\t\t\t\t\t\t\t\t\tplaceholder={ imageWidth }\n\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\tonChange={ this.updateWidth }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-library-image__dimensions__height\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\t\t\t\tvalue={ height !== undefined ? height : '' }\n\t\t\t\t\t\t\t\t\tplaceholder={ imageHeight }\n\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\tonChange={ this.updateHeight }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"block-library-image__dimensions__row\">\n\t\t\t\t\t\t\t\t<ButtonGroup aria-label={ __( 'Image Size' ) }>\n\t\t\t\t\t\t\t\t\t{ [ 25, 50, 75, 100 ].map( ( scale ) => {\n\t\t\t\t\t\t\t\t\t\tconst scaledWidth = Math.round( imageWidth * ( scale / 100 ) );\n\t\t\t\t\t\t\t\t\t\tconst scaledHeight = Math.round( imageHeight * ( scale / 100 ) );\n\n\t\t\t\t\t\t\t\t\t\tconst isCurrent = width === scaledWidth && height === scaledHeight;\n\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ scale }\n\t\t\t\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\t\t\t\tisPrimary={ isCurrent }\n\t\t\t\t\t\t\t\t\t\t\t\taria-pressed={ isCurrent }\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ this.updateDimensions( scaledWidth, scaledHeight ) }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ scale }%\n\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t</ButtonGroup>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\tonClick={ this.updateDimensions() }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t);\n\n\t\t// Disable reason: Each block can be selected by clicking on it\n\t\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t\treturn (\n\t\t\t<Fragment>\n\t\t\t\t{ controls }\n\t\t\t\t<figure className={ classes }>\n\t\t\t\t\t<ImageSize src={ url } dirtynessTrigger={ align }>\n\t\t\t\t\t\t{ ( sizes ) => {\n\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\timageWidthWithinContainer,\n\t\t\t\t\t\t\t\timageHeightWithinContainer,\n\t\t\t\t\t\t\t\timageWidth,\n\t\t\t\t\t\t\t\timageHeight,\n\t\t\t\t\t\t\t} = sizes;\n\n\t\t\t\t\t\t\tconst filename = this.getFilename( url );\n\t\t\t\t\t\t\tlet defaultedAlt;\n\t\t\t\t\t\t\tif ( alt ) {\n\t\t\t\t\t\t\t\tdefaultedAlt = alt;\n\t\t\t\t\t\t\t} else if ( filename ) {\n\t\t\t\t\t\t\t\tdefaultedAlt = sprintf( __( 'This image has an empty alt attribute; its file name is %s' ), filename );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdefaultedAlt = __( 'This image has an empty alt attribute' );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst img = (\n\t\t\t\t\t\t\t\t// Disable reason: Image itself is not meant to be interactive, but\n\t\t\t\t\t\t\t\t// should direct focus to block.\n\t\t\t\t\t\t\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<ta linkid={ linkid } href={ href }>\n\t\t\t\t\t\t\t\t\t\t<img src={ url } alt={ defaultedAlt } onClick={ this.onImageClick } onError={ () => this.onImageError( url ) } />\n\t\t\t\t\t\t\t\t\t</ta>\n\t\t\t\t\t\t\t\t\t{ isBlobURL( url ) && <Spinner /> }\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( ! isResizable || ! imageWidthWithinContainer ) {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t{ getInspectorControls( imageWidth, imageHeight ) }\n\t\t\t\t\t\t\t\t\t\t<div style={ { width, height } }>\n\t\t\t\t\t\t\t\t\t\t\t{ img }\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst currentWidth = width || imageWidthWithinContainer;\n\t\t\t\t\t\t\tconst currentHeight = height || imageHeightWithinContainer;\n\n\t\t\t\t\t\t\tconst ratio = imageWidth / imageHeight;\n\t\t\t\t\t\t\tconst minWidth = imageWidth < imageHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\t\t\t\t\t\t\tconst minHeight = imageHeight < imageWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t\t\t\t\t\t\t// With the current implementation of ResizableBox, an image needs an explicit pixel value for the max-width.\n\t\t\t\t\t\t\t// In absence of being able to set the content-width, this max-width is currently dictated by the vanilla editor style.\n\t\t\t\t\t\t\t// The following variable adds a buffer to this vanilla style, so 3rd party themes have some wiggleroom.\n\t\t\t\t\t\t\t// This does, in most cases, allow you to scale the image beyond the width of the main column, though not infinitely.\n\t\t\t\t\t\t\t// @todo It would be good to revisit this once a content-width variable becomes available.\n\t\t\t\t\t\t\tconst maxWidthBuffer = maxWidth * 2.5;\n\n\t\t\t\t\t\t\tlet showRightHandle = false;\n\t\t\t\t\t\t\tlet showLeftHandle = false;\n\n\t\t\t\t\t\t\t/* eslint-disable no-lonely-if */\n\t\t\t\t\t\t\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\t\t\t\t\t\t\tif ( align === 'center' ) {\n\t\t\t\t\t\t\t\t// When the image is centered, show both handles.\n\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t} else if ( isRTL ) {\n\t\t\t\t\t\t\t\t// In RTL mode the image is on the right by default.\n\t\t\t\t\t\t\t\t// Show the right handle and hide the left handle only when it is aligned left.\n\t\t\t\t\t\t\t\t// Otherwise always show the left handle.\n\t\t\t\t\t\t\t\tif ( align === 'left' ) {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Show the left handle and hide the right handle only when the image is aligned right.\n\t\t\t\t\t\t\t\t// Otherwise always show the right handle.\n\t\t\t\t\t\t\t\tif ( align === 'right' ) {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/* eslint-enable no-lonely-if */\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t{ getInspectorControls( imageWidth, imageHeight ) }\n\t\t\t\t\t\t\t\t\t<ResizableBox\n\t\t\t\t\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t\t\t\t\twidth && height ? {\n\t\t\t\t\t\t\t\t\t\t\t\twidth,\n\t\t\t\t\t\t\t\t\t\t\t\theight,\n\t\t\t\t\t\t\t\t\t\t\t} : undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tminWidth={ minWidth }\n\t\t\t\t\t\t\t\t\t\tmaxWidth={ maxWidthBuffer }\n\t\t\t\t\t\t\t\t\t\tminHeight={ minHeight }\n\t\t\t\t\t\t\t\t\t\tmaxHeight={ maxWidthBuffer / ratio }\n\t\t\t\t\t\t\t\t\t\tlockAspectRatio\n\t\t\t\t\t\t\t\t\t\tenable={ {\n\t\t\t\t\t\t\t\t\t\t\ttop: false,\n\t\t\t\t\t\t\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\t\t\t\t\t\t\tbottom: true,\n\t\t\t\t\t\t\t\t\t\t\tleft: showLeftHandle,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonResizeStart={ () => {\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\twidth: parseInt( currentWidth + delta.width, 10 ),\n\t\t\t\t\t\t\t\t\t\t\t\theight: parseInt( currentHeight + delta.height, 10 ),\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ img }\n\t\t\t\t\t\t\t\t\t</ResizableBox>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t</ImageSize>\n\t\t\t\t\t{ ( ! RichText.isEmpty( caption ) || isSelected ) && (\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\t\t\tplaceholder={ __( 'Write caption…' ) }\n\t\t\t\t\t\t\tvalue={ caption }\n\t\t\t\t\t\t\tunstableOnFocus={ this.onFocusCaption }\n\t\t\t\t\t\t\tonChange={ ( value ) => setAttributes( { caption: value } ) }\n\t\t\t\t\t\t\tisSelected={ this.state.captionFocused }\n\t\t\t\t\t\t\tinlineToolbar\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</figure>\n\t\t\t</Fragment>\n\t\t);\n\t\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select, props ) => {\n\t\tconst { getMedia } = select( 'core' );\n\t\tconst { getEditorSettings } = select( 'core/editor' );\n\t\tconst { id } = props.attributes;\n\t\tconst { maxWidth, isRTL, imageSizes } = getEditorSettings();\n\n\t\treturn {\n\t\t\timage: id ? getMedia( id ) : null,\n\t\t\tmaxWidth,\n\t\t\tisRTL,\n\t\t\timageSizes,\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n\twithNotices,\n] )( ImageEdit );\n\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/edit.js","const WORDPRESS_EMBED_BLOCK = 'core-embed/wordpress';\n\nconst { includes } = lodash;\nconst { renderToString } = wp.element;\nconst { createBlock } = wp.blocks;\n\n/***\n * Creates a more suitable embed block based on the passed in props\n * and attributes generated from an embed block's preview.\n *\n * We require `attributesFromPreview` to be generated from the latest attributes\n * and preview, and because of the way the react lifecycle operates, we can't\n * guarantee that the attributes contained in the block's props are the latest\n * versions, so we require that these are generated separately.\n * See `getAttributesFromPreview` in the generated embed edit component.\n *\n * @param {Object} props The block's props.\n * @param {Object} attributesFromPreview Attributes generated from the block's most up to date preview.\n * @return {Object|undefined} A more suitable embed block if one exists.\n */\nexport const createUpgradedEmbedBlock = ( props, attributesFromPreview ) => {\n\tconst { preview, name } = props;\n\tconst { url } = props.attributes;\n\n\tif ( ! url ) {\n\t\treturn;\n\t}\n\n\tconst matchingBlock = findBlock( url );\n\n\t// WordPress blocks can work on multiple sites, and so don't have patterns,\n\t// so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.\n\tif ( WORDPRESS_EMBED_BLOCK !== name && DEFAULT_EMBED_BLOCK !== matchingBlock ) {\n\t\t// At this point, we have discovered a more suitable block for this url, so transform it.\n\t\tif ( name !== matchingBlock ) {\n\t\t\treturn createBlock( matchingBlock, { url } );\n\t\t}\n\t}\n\n\tif ( preview ) {\n\t\tconst { html } = preview;\n\n\t\t// We can't match the URL for WordPress embeds, we have to check the HTML instead.\n\t\tif ( isFromWordPress( html ) ) {\n\t\t\t// If this is not the WordPress embed block, transform it into one.\n\t\t\tif ( WORDPRESS_EMBED_BLOCK !== name ) {\n\t\t\t\treturn createBlock(\n\t\t\t\t\tWORDPRESS_EMBED_BLOCK,\n\t\t\t\t\t{\n\t\t\t\t\t\turl,\n\t\t\t\t\t\t// By now we have the preview, but when the new block first renders, it\n\t\t\t\t\t\t// won't have had all the attributes set, and so won't get the correct\n\t\t\t\t\t\t// type and it won't render correctly. So, we pass through the current attributes\n\t\t\t\t\t\t// here so that the initial render works when we switch to the WordPress\n\t\t\t\t\t\t// block. This only affects the WordPress block because it can't be\n\t\t\t\t\t\t// rendered in the usual Sandbox (it has a sandbox of its own) and it\n\t\t\t\t\t\t// relies on the preview to set the correct render type.\n\t\t\t\t\t\t...attributesFromPreview,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n};\n\nexport const isFromWordPress = ( html ) => {\n\treturn includes( html, 'class=\"wp-embedded-content\" data-secret' );\n};\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/util.js","const { noop } = lodash;\n\nconst { withGlobalEvents } = wp.compose;\nconst { Component } = wp.element;\n\nclass ImageSize extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t};\n\t\tthis.bindContainer = this.bindContainer.bind( this );\n\t\tthis.calculateSize = this.calculateSize.bind( this );\n\t}\n\n\tbindContainer( ref ) {\n\t\tthis.container = ref;\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.src !== prevProps.src ) {\n\t\t\tthis.setState( {\n\t\t\t\twidth: undefined,\n\t\t\t\theight: undefined,\n\t\t\t} );\n\t\t\tthis.fetchImageSize();\n\t\t}\n\n\t\tif ( this.props.dirtynessTrigger !== prevProps.dirtynessTrigger ) {\n\t\t\tthis.calculateSize();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.fetchImageSize();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.image ) {\n\t\t\tthis.image.onload = noop;\n\t\t}\n\t}\n\n\tfetchImageSize() {\n\t\tthis.image = new window.Image();\n\t\tthis.image.onload = this.calculateSize;\n\t\tthis.image.src = this.props.src;\n\t}\n\n\tcalculateSize() {\n\t\tconst maxWidth = this.container.clientWidth;\n\t\tconst exceedMaxWidth = this.image.width > maxWidth;\n\t\tconst ratio = this.image.height / this.image.width;\n\t\tconst width = exceedMaxWidth ? maxWidth : this.image.width;\n\t\tconst height = exceedMaxWidth ? maxWidth * ratio : this.image.height;\n\t\tthis.setState( { width, height } );\n\t}\n\n\trender() {\n\t\tconst sizes = {\n\t\t\timageWidth: this.image && this.image.width,\n\t\t\timageHeight: this.image && this.image.height,\n\t\t\tcontainerWidth: this.container && this.container.clientWidth,\n\t\t\tcontainerHeight: this.container && this.container.clientHeight,\n\t\t\timageWidthWithinContainer: this.state.width,\n\t\t\timageHeightWithinContainer: this.state.height,\n\t\t};\n\t\treturn (\n\t\t\t<div ref={ this.bindContainer }>\n\t\t\t\t{ this.props.children( sizes ) }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default withGlobalEvents( {\n\tresize: 'calculateSize',\n} )( ImageSize );\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/image-size.js","import classnames from \"classnames\";\n\nconst { __ } = wp.i18n;\nconst { Component , createRef } = wp.element;\nconst { Spinner, withSpokenMessages, Popover , TextControl } = wp.components;\nconst { withInstanceId } = wp.compose;\n\nclass ThirstyURLInput extends Component {\n\n /**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tconstructor( { autocompleteRef } ) {\n\t\tsuper( ...arguments );\n\n\t\t// this.onChange = this.onChange.bind( this );\n\t\t// this.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.autocompleteRef = autocompleteRef || createRef();\n\t\tthis.inputRef = createRef();\n\t\tthis.searchAffiliateLinks = this.searchAffiliateLinks.bind( this );\n\t\t// this.updateSuggestions = throttle( this.updateSuggestions.bind( this ), 200 );\n\n\t\tthis.suggestionNodes = [];\n\n\t\tthis.state = {\n\t\t\tposts : [],\n\t\t\tshowSuggestions : false,\n\t\t\tselectedSuggestion : null,\n\t\t\tloading : false\n\t\t};\n\t}\n\n\t/**\n * Component did update method.\n * \n * @since 3.6\n */\n\tcomponentDidUpdate() {\n\t\tconst { showSuggestions, selectedSuggestion } = this.state;\n\t\t// only have to worry about scrolling selected suggestion into view\n\t\t// when already expanded\n\t\tif ( showSuggestions && selectedSuggestion !== null && ! this.scrollingIntoView ) {\n\t\t\tthis.scrollingIntoView = true;\n\t\t\tscrollIntoView( this.suggestionNodes[ selectedSuggestion ], this.autocompleteRef.current, {\n\t\t\t\tonlyScrollIfNeeded: true,\n\t\t\t} );\n\n\t\t\tsetTimeout( () => {\n\t\t\t\tthis.scrollingIntoView = false;\n\t\t\t}, 100 );\n\t\t}\n\t}\n\n\t/**\n * Component unmount method.\n * \n * @since 3.6\n */\n\tcomponentWillUnmount() {\n\t\tdelete this.suggestionsRequest;\n\t}\n\n\t/**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\tbindSuggestionNode( index ) {\n\t\treturn ( ref ) => {\n\t\t\tthis.suggestionNodes[ index ] = ref;\n\t\t};\n\t}\n\t\n\tsearchAffiliateLinks( value ) {\n\n\t\t// Show the suggestions after typing at least 2 characters=\n\t\tif ( value.length < 2 ) {\n\t\t\tthis.setState( {\n\t\t\t\tshowSuggestions: false,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: false,\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState({\n\t\t\tshowSuggestions : true,\n\t\t\tselectedSuggestion : null,\n\t\t\tloading : true\n\t\t});\n\n\t\tconst formData = new FormData();\n formData.append( \"action\" , \"search_affiliate_links_query\" );\n formData.append( \"keyword\" , value );\n formData.append( \"paged\" , 1 );\n\t\tformData.append( \"gutenberg\" , true );\n\t\tformData.append( \"with_images\" , true );\n\t\t\n\t\t// We are getting data via the WP AJAX instead of rest API as it is not possible yet\n // to filter results with category value. This is to prepare next update to add category filter.\n const request = fetch( ajaxurl , {\n method : \"POST\",\n body : formData\n\t\t} );\n\t\t\n\t\trequest\n .then( response => response.json() )\n .then( ( response ) => {\n\n if ( ! response.affiliate_links ) return;\n\n const posts = response.affiliate_links;\n\n\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\treturn;\n }\n\n\t\t\tthis.setState( {\n\t\t\t\tposts,\n\t\t\t\tloading: false,\n } );\n\n\t\t\tif ( !! posts.length ) {\n\t\t\t\tthis.props.debouncedSpeak( sprintf( _n(\n\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\tposts.length\n\t\t\t\t), posts.length ), 'assertive' );\n\t\t\t} else {\n\t\t\t\tthis.props.debouncedSpeak( __( 'No results.' ), 'assertive' );\n }\n\n\t\t} ).catch( () => {\n\t\t\tif ( this.suggestionsRequest === request ) {\n\t\t\t\tthis.setState( {\n\t\t\t\t\tloading: false,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tthis.suggestionsRequest = request;\n\t}\n\n\t/**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\tselectLink( post ) {\n\t\t// this.props.onChange( post.link, post );\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: post,\n\t\t\tshowSuggestions: false,\n\t\t} );\n\n\t\tthis.props.updateImageSelection( post.images , post );\n\t}\n\n\t/**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\thandleOnClick( post ) {\n\t\tthis.selectLink( post );\n\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\t// this.inputRef.current.focus();\n\t}\n\n render() {\n const { value = '', autoFocus = true, instanceId } = this.props;\n const { showSuggestions , posts, selectedSuggestion , loading } = this.state;\n \n return (\n <div class=\"edit-search-affiliate-links\">\n\t\t\t\t<form\n\t\t\t\t\tclassName=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover\"\n\t\t\t\t\tonSubmit={ this.displayAffiliateImages }\n\t\t\t\t>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclassName=\"ta-search-affiliate-links\"\n\t\t\t\t\t\tplaceholder={ __( \"Type to search affiliate links\" ) }\n\t\t\t\t\t\tonChange={ this.searchAffiliateLinks }\n\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ ( loading ) && <Spinner /> }\n\n\t\t\t\t\t{ showSuggestions && !! posts.length && \n\t\t\t\t\t\t<Popover position=\"bottom\" focusOnMount={ false }>\n\t\t\t\t\t\t\t<div class=\"affilate-links-suggestions\">\n\t\t\t\t\t\t\t\t{ posts.map( ( post, index ) => (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\tkey={ post.id }\n\t\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t\t\t\t\tid={ `editor-url-input-suggestion-${ instanceId }-${ index }` }\n\t\t\t\t\t\t\t\t\t\tref={ this.bindSuggestionNode( index ) }\n\t\t\t\t\t\t\t\t\t\tclassName={ classnames( 'editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion,\n\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => this.handleOnClick( post ) }\n\t\t\t\t\t\t\t\t\t\taria-selected={ index === selectedSuggestion }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ post.title || __( '(no title)' ) }\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</Popover>\n\t\t\t\t\t}\n\t\t\t\t</form>\n </div>\n );\n }\n}\n\nexport default withSpokenMessages( withInstanceId( ThirstyURLInput ) );\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/search-input.js","import { taLink } from \"./ta-link\";\n\nconst { registerFormatType } = wp.richText;\n\n/**\n * Register custom formats.\n * \n * @since 3.6\n */\nexport default function registerFormats() {\n\n [\n taLink\n ].forEach( ( { name , ...settings } ) => registerFormatType( name , settings ) );\n}\n\n\n// WEBPACK FOOTER //\n// ./src/formats/index.js","import InlineAffiliateLinkUI from './inline';\n\nconst { __ } = wp.i18n;\nconst { Component , Fragment } = wp.element;\nconst { withSpokenMessages } = wp.components;\nconst { getTextContent , applyFormat , removeFormat , slice } = wp.richText;\nconst { isURL } = wp.url;\nconst { RichTextToolbarButton , RichTextShortcut } = wp.editor;\nconst { Path , SVG } = wp.components;\nconst { getRectangleFromRange } = wp.dom;\n\nconst name = \"ta/link\";\n\n/**\n * Custom Affiliate link format. When applied will wrap selected text with <ta href=\"\" linkid=\"\"></ta> custom element.\n * Custom element is implemented here as we are not allowed to use <a> tag due to Gutenberg limitations.\n * Element is converted to normal <a> tag on frontend via PHP script filtered on 'the_content'.\n * \n * @since 3.6\n */\nexport const taLink = {\n name,\n title : __( \"Affiliate Link\" ),\n tagName : \"ta\",\n className : null,\n attributes : {\n\t\turl : \"href\",\n\t\ttarget : \"target\"\n },\n edit : withSpokenMessages( class LinkEdit extends Component {\n\t\t\n\t\t/**\n\t\t * Component constructor.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\tconstructor() {\n\t\t\tsuper( ...arguments );\n\n\t\t\tthis.addLink = this.addLink.bind( this );\n\t\t\tthis.stopAddingLink = this.stopAddingLink.bind( this );\n\t\t\tthis.onRemoveFormat = this.onRemoveFormat.bind( this );\n\t\t\tthis.state = {\n\t\t\t\taddingLink: false,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Callback to set state to adding link status.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\taddLink() {\n\n\t\t\tconst { value, onChange } = this.props;\n\t\t\tconst text = getTextContent( slice( value ) );\n\n\t\t\tif ( text && isURL( text ) ) {\n\t\t\t\tonChange( applyFormat( value, { type: name, attributes: { url: text } } ) );\n\t\t\t} else {\n\t\t\t\tthis.setState( { addingLink: true } );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Callback to set state to stop adding link status.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\tstopAddingLink() {\n\t\t\tthis.setState( { addingLink: false } );\n\t\t}\n\n\t\t/**\n\t\t * Remove format event callback.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\tonRemoveFormat() {\n\t\t\tconst { value , onChange , speak } = this.props;\n\n\t\t\tonChange( removeFormat( value , name ) );\n\t\t\tspeak( __( \"Affiliate Link removed.\" ), \"assertive\" );\n\t\t}\n\n\t\t/**\n\t\t * Get selected anchor text.\n\t\t * \n\t\t * @since 3.9\n\t\t */\n\t\tgetAnchorRect() {\n\n\t\t\tconst selection = window.getSelection();\n\t\t\tconst range = selection.rangeCount > 0 ? selection.getRangeAt( 0 ) : null;\n\n\t\t\tif ( ! range ) return;\n\n\t\t\tlet rect = null;\n\n\t\t\tif ( this.state.addingLink ) {\n\t\t\t\trect = getRectangleFromRange( range );\n\t\t\t} else {\n\n\t\t\t\tlet element = range.startContainer;\n\n\t\t\t\t// If the caret is right before the element, select the next element.\n\t\t\t\telement = element.nextElementSibling || element;\n\n\t\t\t\twhile ( element.nodeType !== window.Node.ELEMENT_NODE ) {\n\t\t\t\t\telement = element.parentNode;\n\t\t\t\t}\n\n\t\t\t\tconst closest = element.closest( 'ta' );\n\t\t\t\tif ( closest ) {\n\t\t\t\t\trect = closest.getBoundingClientRect();\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\n\t\t\treturn rect;\n\t\t}\n\n\t\t/**\n\t\t * Component render method.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\trender() {\n\t\t\tconst { isActive , activeAttributes , value , onChange } = this.props;\n\n\t\t\tconst anchorRect = this.getAnchorRect();\n\n\t\t\treturn (\n\t\t\t\t<Fragment>\n\t\t\t\t\t<RichTextShortcut\n\t\t\t\t\t\ttype=\"access\"\n\t\t\t\t\t\tcharacter=\"s\"\n\t\t\t\t\t\tonUse={ this.onRemoveFormat }\n\t\t\t\t\t/>\n\t\t\t\t\t<RichTextShortcut\n\t\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t\tcharacter=\"l\"\n\t\t\t\t\t\tonUse={ this.addLink }\n\t\t\t\t\t/>\n\t\t\t\t\t<RichTextShortcut\n\t\t\t\t\t\ttype=\"primaryShift\"\n\t\t\t\t\t\tcharacter=\"l\"\n\t\t\t\t\t\tonUse={ this.onRemoveFormat }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isActive && <RichTextToolbarButton\n\t\t\t\t\t\ticon=\"editor-unlink\"\n\t\t\t\t\t\ttitle={ __( 'Remove Affiliate Link' ) }\n\t\t\t\t\t\tclassName=\"ta-unlink-button\"\n\t\t\t\t\t\tonClick={ this.onRemoveFormat }\n\t\t\t\t\t\tisActive={ isActive }\n\t\t\t\t\t\tshortcutType=\"primaryShift\"\n\t\t\t\t\t\tshortcutCharacter=\"l\"\n\t\t\t\t\t/> }\n\t\t\t\t\t{ ! isActive && <RichTextToolbarButton\n\t\t\t\t\t\ticon={ <SVG xmlns=\"http://www.w3.org/2000/svg\" width=\"16.688\" height=\"9.875\" viewBox=\"0 0 16.688 9.875\"><Path id=\"TA.svg\" fill=\"black\" class=\"cls-1\" d=\"M2.115,15.12H4.847L6.836,7.7H9.777l0.63-2.381H1.821L1.177,7.7H4.118Zm4.758,0H9.829l1.177-1.751h3.782l0.238,1.751h2.858L16.357,5.245H13.7Zm5.5-3.866,1.835-2.816,0.35,2.816H12.378Z\" transform=\"translate(-1.188 -5.25)\"/></SVG> }\n\t\t\t\t\t\ttitle={ __( 'Affiliate Link' ) }\n\t\t\t\t\t\tclassName=\"ta-link-button\"\n\t\t\t\t\t\tonClick={ this.addLink }\n\t\t\t\t\t\tshortcutType=\"primary\"\n\t\t\t\t\t\tshortcutCharacter=\"l\"\n\t\t\t\t\t/> }\n\t\t\t\t\t<InlineAffiliateLinkUI\n\t\t\t\t\t\taddingLink={ this.state.addingLink }\n\t\t\t\t\t\tstopAddingLink={ this.stopAddingLink }\n\t\t\t\t\t\tisActive={ isActive }\n\t\t\t\t\t\tactiveAttributes={ activeAttributes }\n\t\t\t\t\t\tanchorRect={ anchorRect }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t</Fragment>\n\t\t\t);\n\t\t}\n } )\n}\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/index.js","import classnames from \"classnames\";\nimport { isValidHref } from './utils';\nimport ThirstyURLPopover from './url-popover';\nimport ThirstyURLInput from './url-input';\n\nconst { __ } = wp.i18n;\nconst { Component , createRef } = wp.element;\nconst { ExternalLink , ToggleControl , IconButton , withSpokenMessages } = wp.components;\nconst { LEFT, RIGHT, UP, DOWN, BACKSPACE, ENTER } = wp.keycodes;\nconst { prependHTTP , safeDecodeURI , filterURLForDisplay } = wp.url;\nconst { create , insert , isCollapsed , applyFormat , getTextContent , slice } = wp.richText;\n\nconst stopKeyPropagation = ( event ) => event.stopPropagation();\n\n/**\n * Generates the format object that will be applied to the link text.\n * \n * @since 3.6\n *\n * @param {string} url The href of the link.\n * @param {boolean} linkid Affiliate link ID.\n * @param {Object} text The text that is being hyperlinked.\n *\n * @return {Object} The final format object.\n */\nfunction createLinkFormat( { url , linkid , text } ) {\n\tconst format = {\n\t\ttype: \"ta/link\",\n\t\tattributes: {\n\t\t\turl,\n\t\t\tlinkid : linkid.toString()\n\t\t},\n\t};\n\n\treturn format;\n}\n\n/**\n * Check if input is being show.\n * \n * @since 3.6\n * \n * @param {Object} props Component props.\n * @param {Object} state Component state.\n */\nfunction isShowingInput( props , state ) {\n\treturn props.addingLink || state.editLink;\n}\n\n/**\n * Affiliate Link editor JSX element.\n * \n * @since 3.6\n * \n * @param {Object} param0 Component props (destructred).\n */\nconst LinkEditor = ( { value , onChangeInputValue , onKeyDown , submitLink, invalidLink , resetInvalidLink , autocompleteRef } ) => (\n\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t<form\n\t\tclassName=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover\"\n\t\tonKeyPress={ stopKeyPropagation }\n\t\tonKeyDown={ onKeyDown }\n\t\tonSubmit={ submitLink }\n\t>\n\t\t<ThirstyURLInput\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChangeInputValue }\n\t\t\tautocompleteRef={ autocompleteRef }\n\t\t\tinvalidLink={ invalidLink }\n\t\t\tresetInvalidLink={ resetInvalidLink }\n\t\t/>\n\t\t<IconButton icon=\"editor-break\" label={ __( 'Apply' ) } type=\"submit\" />\n\t</form>\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n);\n\n/**\n * Affiliate link url viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nconst LinkViewerUrl = ( { url } ) => {\n\tconst prependedURL = prependHTTP( url );\n\tconst linkClassName = classnames( 'editor-format-toolbar__link-container-value block-editor-format-toolbar__link-container-value', {\n\t\t'has-invalid-link': ! isValidHref( prependedURL ),\n\t} );\n\n\tif ( ! url ) {\n\t\treturn <span className={ linkClassName }></span>;\n\t}\n\n\treturn (\n\t\t<ExternalLink\n\t\t\tclassName={ linkClassName }\n\t\t\thref={ url }\n\t\t>\n\t\t\t{ filterURLForDisplay( safeDecodeURI( url ) ) }\n\t\t</ExternalLink>\n\t);\n};\n\n/**\n * Affiliate link viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nconst LinkViewer = ( { url, editLink } ) => {\n\treturn (\n\t\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\t\t<div\n\t\t\tclassName=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content\"\n\t\t\tonKeyPress={ stopKeyPropagation }\n\t\t>\n\t\t\t<LinkViewerUrl url={ url } />\n\t\t\t<IconButton icon=\"edit\" label={ __( 'Edit' ) } onClick={ editLink } />\n\t\t</div>\n\t\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n\t);\n};\n\n/**\n * Inline affiliate link UI Component.\n * \n * @since 3.6\n * \n * @param {*} param0 Component props (destructred).\n */\nclass InlineAffiliateLinkUI extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.editLink = this.editLink.bind( this );\n\t\tthis.submitLink = this.submitLink.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.onChangeInputValue = this.onChangeInputValue.bind( this );\n\t\tthis.onClickOutside = this.onClickOutside.bind( this );\n\t\tthis.resetState = this.resetState.bind( this );\n\t\tthis.autocompleteRef = createRef();\n\t\tthis.resetInvalidLink = this.resetInvalidLink.bind( this );\n\n\t\tthis.state = {\n\t\t\tinputValue : '',\n\t\t\tlinkid : 0,\n\t\t\tpost : null,\n\t\t\tinvalidLink : false\n\t\t};\n\t}\n\n\t/**\n\t * Stop the key event from propagating up to ObserveTyping.startTypingInTextField.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {Object} event Event object.\n\t */\n\tonKeyDown( event ) {\n\t\tif ( [ LEFT, DOWN, RIGHT, UP, BACKSPACE, ENTER ].indexOf( event.keyCode ) > -1 ) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t}\n\n\t/**\n\t * Callback to set state when input value is changed.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} inputValue \n\t * @param {*} post \n\t */\n\tonChangeInputValue( inputValue , post = null ) {\n\t\tconst linkid = post ? post.id : 0;\n\t\tthis.setState( { inputValue , linkid , post } );\n\t}\n\n\t/**\n\t * Callback to set state when edit affiliate link (already inserted) is triggered.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} event \n\t */\n\teditLink( event ) {\n\t\tthis.setState( { editLink: true } );\n\t\tevent.preventDefault();\n\t}\n\n\t/**\n\t * Callback to apply the affiliate link format to the selected text or position in the active block.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} event \n\t */\n\tsubmitLink( event ) {\n\t\tconst { isActive, value, onChange, speak } = this.props;\n\t\tconst { inputValue, linkid , post } = this.state;\n\t\tconst url = prependHTTP( inputValue );\n\t\tconst selectedText = getTextContent( slice( value ) );\n\t\tconst format = createLinkFormat( {\n\t\t\turl,\n\t\t\tlinkid,\n\t\t\ttext: selectedText,\n\t\t} );\n\n\t\tevent.preventDefault();\n\n\t\tif ( ! linkid || ! post ) {\n\t\t\tthis.setState( { invalidLink : true } )\n\t\t\treturn;\n\t\t} \n\n\t\tif ( isCollapsed( value ) && ! isActive ) {\n\t\t\tconst toInsert = applyFormat( create( { text: post.title } ), format, 0, url.length );\n\t\t\tonChange( insert( value, toInsert ) );\n\t\t} else {\n\t\t\tonChange( applyFormat( value, format ) );\n\t\t}\n\n\t\tthis.resetState();\n\n\t\tif ( ! isValidHref( url ) ) {\n\t\t\tspeak( __( 'Warning: the link has been inserted but may have errors. Please test it.' ), 'assertive' );\n\t\t} else if ( isActive ) {\n\t\t\tspeak( __( 'Link edited.' ), 'assertive' );\n\t\t} else {\n\t\t\tspeak( __( 'Link inserted' ), 'assertive' );\n\t\t}\n\t}\n\n\t/**\n\t * Callback to run when users clicks outside the popover UI.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} event \n\t */\n\tonClickOutside( event ) {\n\t\t// The autocomplete suggestions list renders in a separate popover (in a portal),\n\t\t// so onClickOutside fails to detect that a click on a suggestion occured in the\n\t\t// LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and\n\t\t// return to avoid the popover being closed.\n\t\tconst autocompleteElement = this.autocompleteRef.current;\n\t\tif ( autocompleteElement && autocompleteElement.contains( event.target ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.resetState();\n\t}\n\n\t/**\n\t * Reset state callback.\n\t * \n\t * @since 3.6\n\t */\n\tresetState() {\n\t\tthis.props.stopAddingLink();\n\t\tthis.setState( { inputValue : '' , editLink: false } );\n\t\tthis.resetInvalidLink();\n\t}\n\n\t/**\n\t * Reset invalid link state callback. Separated as we need to run this independently from resetState() callback.\n\t * \n\t * @since 3.6\n\t */\n\tresetInvalidLink() {\n\t\tthis.setState( { invalidLink : false } );\n\t}\n\n\t/**\n\t * Component render method.\n\t *\n\t * @since 3.6\n\t */\n\trender() {\n\t\tconst { isActive, activeAttributes: { url , linkid }, addingLink, anchorRect, value, onChange } = this.props;\n\n\t\tif ( ! isActive && ! addingLink ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { inputValue , invalidLink } = this.state;\n\t\tconst showInput = isShowingInput( this.props, this.state );\n\n\t\treturn (\n\t\t\t<ThirstyURLPopover\n\t\t\t\tonClickOutside={ this.onClickOutside }\n\t\t\t\tonClose={ this.resetState }\n\t\t\t\tfocusOnMount={ showInput ? 'firstElement' : false }\n\t\t\t\tinvalidLink={ invalidLink }\n\t\t\t\tanchorRect= { anchorRect }\n\t\t\t>\n\t\t\t\t{ showInput ? (\n\t\t\t\t\t<LinkEditor\n\t\t\t\t\t\tvalue={ inputValue }\n\t\t\t\t\t\tonChangeInputValue={ this.onChangeInputValue }\n\t\t\t\t\t\tonKeyDown={ this.onKeyDown }\n\t\t\t\t\t\tsubmitLink={ this.submitLink }\n\t\t\t\t\t\tautocompleteRef={ this.autocompleteRef }\n\t\t\t\t\t\tupdateLinkId= { this.updateLinkId }\n\t\t\t\t\t\tinvalidLink={ invalidLink }\n\t\t\t\t\t\tresetInvalidLink={ this.resetInvalidLink }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<LinkViewer\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\teditLink={ this.editLink }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</ThirstyURLPopover>\n\t\t);\n\t}\n}\n\nexport default withSpokenMessages( InlineAffiliateLinkUI );\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/inline.js","const { startsWith } = lodash;\n\nconst {\n getProtocol,\n\tisValidProtocol,\n\tgetAuthority,\n\tisValidAuthority,\n\tgetPath,\n\tisValidPath,\n\tgetQueryString,\n\tisValidQueryString,\n\tgetFragment,\n\tisValidFragment,\n} = wp.url;\n\n/**\n * Check for issues with the provided href.\n * \n * @since 3.6\n *\n * @param {string} href The href.\n * @return {boolean} Is the href invalid?\n */\nexport function isValidHref( href ) {\n\tif ( ! href ) {\n\t\treturn false;\n\t}\n\n\tconst trimmedHref = href.trim();\n\n\tif ( ! trimmedHref ) {\n\t\treturn false;\n\t}\n\n\t// Does the href start with something that looks like a URL protocol?\n\tif ( /^\\S+:/.test( trimmedHref ) ) {\n\t\tconst protocol = getProtocol( trimmedHref );\n\t\tif ( ! isValidProtocol( protocol ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Add some extra checks for http(s) URIs, since these are the most common use-case.\n\t\t// This ensures URIs with an http protocol have exactly two forward slashes following the protocol.\n\t\tif ( startsWith( protocol, 'http' ) && ! /^https?:\\/\\/[^\\/\\s]/i.test( trimmedHref ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst authority = getAuthority( trimmedHref );\n\t\tif ( ! isValidAuthority( authority ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst path = getPath( trimmedHref );\n\t\tif ( path && ! isValidPath( path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst queryString = getQueryString( trimmedHref );\n\t\tif ( queryString && ! isValidQueryString( queryString ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst fragment = getFragment( trimmedHref );\n\t\tif ( fragment && ! isValidFragment( fragment ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Validate anchor links.\n\tif ( startsWith( trimmedHref, '#' ) && ! isValidFragment( trimmedHref ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/utils.js","const { __ } = wp.i18n;\nconst { Component } = wp.element;\nconst { Popover , IconButton } = wp.components;\n\n/**\n * Custom URL Popover component.\n * \n * @since 3.6\n */\nclass ThirstyURLPopover extends Component {\n\n /**\n * Component constructor method.\n * \n * @since 3.6\n */\n\tconstructor() {\n super( ...arguments );\n \n this.toggleSettingsVisibility = this.toggleSettingsVisibility.bind( this );\n\n\t\tthis.state = {\n\t\t\tisSettingsExpanded: false,\n\t\t};\n }\n \n /**\n * Component constructor.\n * \n * @since 3.6\n */\n toggleSettingsVisibility() {\n\t\tthis.setState( {\n\t\t\tisSettingsExpanded: ! this.state.isSettingsExpanded,\n\t\t} );\n\t}\n\n /**\n * Component render method.\n * \n * @since 3.6\n */\n\trender() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\trenderSettings,\n invalidLink,\n\t\t\tposition = 'bottom center',\n\t\t\tfocusOnMount = 'firstElement',\n\t\t\t...popoverProps\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tisSettingsExpanded,\n } = this.state;\n \n const showSettings = !! renderSettings && isSettingsExpanded;\n\n\t\treturn (\n\t\t\t<Popover\n\t\t\t\tclassName=\"ta-url-popover editor-url-popover block-editor-url-popover\"\n\t\t\t\tfocusOnMount={ focusOnMount }\n\t\t\t\tposition={ position }\n\t\t\t\t{ ...popoverProps }\n\t\t\t>\n\t\t\t\t<div className=\"editor-url-popover__row\">\n { children }\n { !! renderSettings && (\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\tclassName=\"editor-url-popover__settings-toggle\"\n\t\t\t\t\t\t\ticon=\"ellipsis\"\n\t\t\t\t\t\t\tlabel={ __( 'Link Settings' ) }\n\t\t\t\t\t\t\tonClick={ this.toggleSettingsVisibility }\n\t\t\t\t\t\t\taria-expanded={ isSettingsExpanded }\n\t\t\t\t\t\t/>\n ) }\n\t\t\t\t</div>\n { showSettings && (\n\t\t\t\t\t<div className=\"editor-url-popover__row editor-url-popover__settings\">\n\t\t\t\t\t\t{ renderSettings() }\n\t\t\t\t\t</div>\n ) }\n { invalidLink && <div class=\"ta-invalid-link\">{ __( 'Invalid affiliate link' ) }</div> }\n\t\t\t</Popover>\n\t\t);\n\t}\n}\n\nexport default ThirstyURLPopover;\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/url-popover.js","import classnames from 'classnames';\nimport scrollIntoView from 'dom-scroll-into-view';\n\nconst { __ } = wp.i18n;\nconst { throttle } = lodash;\nconst { Component , createRef } = wp.element;\nconst { UP, DOWN, ENTER, TAB } = wp.keycodes;\nconst { Spinner, withSpokenMessages, Popover } = wp.components;\nconst { withInstanceId } = wp.compose;\n\n// Since URLInput is rendered in the context of other inputs, but should be\n// considered a separate modal node, prevent keyboard events from propagating\n// as being considered from the input.\nconst stopEventPropagation = ( event ) => event.stopPropagation();\n\n/**\n * Custom URL Input component.\n * \n * @since 3.6\n */\nclass ThirstyURLInput extends Component {\n\n /**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tconstructor( { autocompleteRef } ) {\n\t\tsuper( ...arguments );\n\n\t\tthis.onChange = this.onChange.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.autocompleteRef = autocompleteRef || createRef();\n\t\tthis.inputRef = createRef();\n\t\tthis.updateSuggestions = throttle( this.updateSuggestions.bind( this ), 200 );\n\n\t\tthis.suggestionNodes = [];\n\n\t\tthis.state = {\n\t\t\tposts: [],\n\t\t\tshowSuggestions: false,\n\t\t\tselectedSuggestion: null,\n\t\t};\n\t}\n\n /**\n * Component did update method.\n * \n * @since 3.6\n */\n\tcomponentDidUpdate() {\n\t\tconst { showSuggestions, selectedSuggestion } = this.state;\n\t\t// only have to worry about scrolling selected suggestion into view\n\t\t// when already expanded\n\t\tif ( showSuggestions && selectedSuggestion !== null && ! this.scrollingIntoView ) {\n\t\t\tthis.scrollingIntoView = true;\n\t\t\tscrollIntoView( this.suggestionNodes[ selectedSuggestion ], this.autocompleteRef.current, {\n\t\t\t\tonlyScrollIfNeeded: true,\n\t\t\t} );\n\n\t\t\tsetTimeout( () => {\n\t\t\t\tthis.scrollingIntoView = false;\n\t\t\t}, 100 );\n\t\t}\n\t}\n\n /**\n * Component unmount method.\n * \n * @since 3.6\n */\n\tcomponentWillUnmount() {\n\t\tdelete this.suggestionsRequest;\n\t}\n\n /**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\tbindSuggestionNode( index ) {\n\t\treturn ( ref ) => {\n\t\t\tthis.suggestionNodes[ index ] = ref;\n\t\t};\n\t}\n\n /**\n * Callback to show suggestions based on value inputted on search field.\n * \n * @since 3.6\n * \n * @param {*} value \n */\n\tupdateSuggestions( value ) {\n\t\t// Show the suggestions after typing at least 2 characters\n\t\t// and also for URLs\n\t\tif ( value.length < 2 || /^https?:/.test( value ) ) {\n\t\t\tthis.setState( {\n\t\t\t\tshowSuggestions: false,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: false,\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState( {\n\t\t\tshowSuggestions: true,\n\t\t\tselectedSuggestion: null,\n\t\t\tloading: true,\n\t\t} );\n\n const formData = new FormData();\n formData.append( \"action\" , \"search_affiliate_links_query\" );\n formData.append( \"keyword\" , value );\n formData.append( \"paged\" , 1 );\n formData.append( \"gutenberg\" , true );\n \n // We are getting data via the WP AJAX instead of rest API as it is not possible yet\n // to filter results with category value. This is to prepare next update to add category filter.\n const request = fetch( ajaxurl , {\n method : \"POST\",\n body : formData\n } );\n\n request\n .then( response => response.json() )\n .then( ( response ) => {\n\n if ( ! response.affiliate_links ) return;\n\n const posts = response.affiliate_links;\n\n\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\treturn;\n }\n\n\t\t\tthis.setState( {\n\t\t\t\tposts,\n\t\t\t\tloading: false,\n } );\n\n\t\t\tif ( !! posts.length ) {\n\t\t\t\tthis.props.debouncedSpeak( sprintf( _n(\n\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\tposts.length\n\t\t\t\t), posts.length ), 'assertive' );\n\t\t\t} else {\n\t\t\t\tthis.props.debouncedSpeak( __( 'No results.' ), 'assertive' );\n }\n\n\t\t} ).catch( () => {\n\t\t\tif ( this.suggestionsRequest === request ) {\n\t\t\t\tthis.setState( {\n\t\t\t\t\tloading: false,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tthis.suggestionsRequest = request;\n\t}\n\n /**\n * Search input value change event callback method.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\tonChange( event ) {\n this.props.resetInvalidLink();\n\t\tconst inputValue = event.target.value;\n\t\tthis.props.onChange( inputValue );\n\t\tthis.updateSuggestions( inputValue );\n\t}\n\n /**\n * Keydown event callback. Handles selecting result via keyboard.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\tonKeyDown( event ) {\n\t\tconst { showSuggestions, selectedSuggestion, posts, loading } = this.state;\n\t\t// If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n\t\t// We shouldn't preventDefault to allow block arrow keys navigation\n\t\tif ( ! showSuggestions || ! posts.length || loading ) {\n\t\t\t// In the Windows version of Firefox the up and down arrows don't move the caret\n\t\t\t// within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n\t\t\t// a form of focus trapping that is disruptive to the user experience. This disruption\n\t\t\t// only happens if the caret is not in the first or last position in the text input.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n\t\t\tswitch ( event.keyCode ) {\n\t\t\t\t// When UP is pressed, if the caret is at the start of the text, move it to the 0\n\t\t\t\t// position.\n\t\t\t\tcase UP: {\n\t\t\t\t\tif ( 0 !== event.target.selectionStart ) {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to position 0\n\t\t\t\t\t\tevent.target.setSelectionRange( 0, 0 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// When DOWN is pressed, if the caret is not at the end of the text, move it to the\n\t\t\t\t// last position.\n\t\t\t\tcase DOWN: {\n\t\t\t\t\tif ( this.props.value.length !== event.target.selectionStart ) {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to the last position\n\t\t\t\t\t\tevent.target.setSelectionRange( this.props.value.length, this.props.value.length );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst post = this.state.posts[ this.state.selectedSuggestion ];\n\n\t\tswitch ( event.keyCode ) {\n\t\t\tcase UP: {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst previousIndex = ! selectedSuggestion ? posts.length - 1 : selectedSuggestion - 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: previousIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase DOWN: {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex = selectedSuggestion === null || ( selectedSuggestion === posts.length - 1 ) ? 0 : selectedSuggestion + 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: nextIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase TAB: {\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( post );\n\t\t\t\t\t// Announce a link has been selected when tabbing away from the input field.\n\t\t\t\t\tthis.props.speak( __( 'Link selected' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ENTER: {\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tthis.selectLink( post );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n /**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\tselectLink( post ) {\n\t\tthis.props.onChange( post.link, post );\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tshowSuggestions: false,\n\t\t} );\n\t}\n\n /**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\thandleOnClick( post ) {\n\t\tthis.selectLink( post );\n\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\tthis.inputRef.current.focus();\n\t}\n\n /**\n * Component render method.\n * \n * @since 3.6\n */\n\trender() {\n\t\tconst { value = '', autoFocus = true, instanceId , invalidLink } = this.props;\n\t\tconst { showSuggestions, posts, selectedSuggestion, loading } = this.state;\n\t\t/* eslint-disable jsx-a11y/no-autofocus */\n\t\treturn (\n\t\t\t<div className=\"editor-url-input block-editor-url-input\">\n\t\t\t\t<input\n\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\taria-label={ __( 'URL' ) }\n\t\t\t\t\trequired\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ this.onChange }\n\t\t\t\t\tonInput={ stopEventPropagation }\n\t\t\t\t\tplaceholder={ __( 'Paste URL or type to search' ) }\n\t\t\t\t\tonKeyDown={ this.onKeyDown }\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\taria-expanded={ showSuggestions }\n\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\taria-owns={ `editor-url-input-suggestions-${ instanceId }` }\n\t\t\t\t\taria-activedescendant={ selectedSuggestion !== null ? `editor-url-input-suggestion-${ instanceId }-${ selectedSuggestion }` : undefined }\n\t\t\t\t\tref={ this.inputRef }\n\t\t\t\t/>\n\n\t\t\t\t{ ( loading ) && <Spinner /> }\n\n\t\t\t\t{ showSuggestions && !! posts.length && ! invalidLink &&\n\t\t\t\t\t<Popover position=\"bottom\" noArrow focusOnMount={ false }>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"editor-url-input__suggestions block-editor-url-input__suggestions\"\n\t\t\t\t\t\t\tid={ `editor-url-input-suggestions-${ instanceId }` }\n\t\t\t\t\t\t\tref={ this.autocompleteRef }\n\t\t\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ posts.map( ( post, index ) => (\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\tkey={ post.id }\n\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t\t\t\tid={ `block-editor-url-input-suggestion-${ instanceId }-${ index }` }\n\t\t\t\t\t\t\t\t\tref={ this.bindSuggestionNode( index ) }\n\t\t\t\t\t\t\t\t\tclassName={ classnames( 'editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion,\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\tonClick={ () => this.handleOnClick( post ) }\n\t\t\t\t\t\t\t\t\taria-selected={ index === selectedSuggestion }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ post.title || __( '(no title)' ) }\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Popover>\n\t\t\t\t}\n\t\t\t</div>\n\t\t);\n\t\t/* eslint-enable jsx-a11y/no-autofocus */\n\t}\n}\n\nexport default withSpokenMessages( withInstanceId( ThirstyURLInput ) );\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/url-input.js","'use strict';\n\nmodule.exports = require('./dom-scroll-into-view');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dom-scroll-into-view/lib/index.js\n// module id = 14\n// module chunks = 0","'use strict';\n\nvar util = require('./util');\n\nfunction scrollIntoView(elem, container, config) {\n config = config || {};\n // document 归一化到 window\n if (container.nodeType === 9) {\n container = util.getWindow(container);\n }\n\n var allowHorizontalScroll = config.allowHorizontalScroll;\n var onlyScrollIfNeeded = config.onlyScrollIfNeeded;\n var alignWithTop = config.alignWithTop;\n var alignWithLeft = config.alignWithLeft;\n var offsetTop = config.offsetTop || 0;\n var offsetLeft = config.offsetLeft || 0;\n var offsetBottom = config.offsetBottom || 0;\n var offsetRight = config.offsetRight || 0;\n\n allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;\n\n var isWin = util.isWindow(container);\n var elemOffset = util.offset(elem);\n var eh = util.outerHeight(elem);\n var ew = util.outerWidth(elem);\n var containerOffset = undefined;\n var ch = undefined;\n var cw = undefined;\n var containerScroll = undefined;\n var diffTop = undefined;\n var diffBottom = undefined;\n var win = undefined;\n var winScroll = undefined;\n var ww = undefined;\n var wh = undefined;\n\n if (isWin) {\n win = container;\n wh = util.height(win);\n ww = util.width(win);\n winScroll = {\n left: util.scrollLeft(win),\n top: util.scrollTop(win)\n };\n // elem 相对 container 可视视窗的距离\n diffTop = {\n left: elemOffset.left - winScroll.left - offsetLeft,\n top: elemOffset.top - winScroll.top - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,\n top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom\n };\n containerScroll = winScroll;\n } else {\n containerOffset = util.offset(container);\n ch = container.clientHeight;\n cw = container.clientWidth;\n containerScroll = {\n left: container.scrollLeft,\n top: container.scrollTop\n };\n // elem 相对 container 可视视窗的距离\n // 注意边框, offset 是边框到根节点\n diffTop = {\n left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft,\n top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight,\n top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom\n };\n }\n\n if (diffTop.top < 0 || diffBottom.top > 0) {\n // 强制向上\n if (alignWithTop === true) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else if (alignWithTop === false) {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n } else {\n // 自动调整\n if (diffTop.top < 0) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;\n if (alignWithTop) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n }\n\n if (allowHorizontalScroll) {\n if (diffTop.left < 0 || diffBottom.left > 0) {\n // 强制向上\n if (alignWithLeft === true) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else if (alignWithLeft === false) {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n } else {\n // 自动调整\n if (diffTop.left < 0) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;\n if (alignWithLeft) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n }\n }\n}\n\nmodule.exports = scrollIntoView;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js\n// module id = 15\n// module chunks = 0","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar RE_NUM = /[\\-+]?(?:\\d*\\.|)\\d+(?:[eE][\\-+]?\\d+|)/.source;\n\nfunction getClientPosition(elem) {\n var box = undefined;\n var x = undefined;\n var y = undefined;\n var doc = elem.ownerDocument;\n var body = doc.body;\n var docElem = doc && doc.documentElement;\n // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式\n box = elem.getBoundingClientRect();\n\n // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop\n // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确\n // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin\n\n x = box.left;\n y = box.top;\n\n // In IE, most of the time, 2 extra pixels are added to the top and left\n // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and\n // IE6 standards mode, this border can be overridden by setting the\n // document element's border to zero -- thus, we cannot rely on the\n // offset always being 2 pixels.\n\n // In quirks mode, the offset can be determined by querying the body's\n // clientLeft/clientTop, but in standards mode, it is found by querying\n // the document element's clientLeft/clientTop. Since we already called\n // getClientBoundingRect we have already forced a reflow, so it is not\n // too expensive just to query them all.\n\n // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的\n // 窗口边框标准是设 documentElement ,quirks 时设置 body\n // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去\n // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置\n // 标准 ie 下 docElem.clientTop 就是 border-top\n // ie7 html 即窗口边框改变不了。永远为 2\n // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0\n\n x -= docElem.clientLeft || body.clientLeft || 0;\n y -= docElem.clientTop || body.clientTop || 0;\n\n return {\n left: x,\n top: y\n };\n}\n\nfunction getScroll(w, top) {\n var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];\n var method = 'scroll' + (top ? 'Top' : 'Left');\n if (typeof ret !== 'number') {\n var d = w.document;\n // ie6,7,8 standard mode\n ret = d.documentElement[method];\n if (typeof ret !== 'number') {\n // quirks mode\n ret = d.body[method];\n }\n }\n return ret;\n}\n\nfunction getScrollLeft(w) {\n return getScroll(w);\n}\n\nfunction getScrollTop(w) {\n return getScroll(w, true);\n}\n\nfunction getOffset(el) {\n var pos = getClientPosition(el);\n var doc = el.ownerDocument;\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScrollLeft(w);\n pos.top += getScrollTop(w);\n return pos;\n}\nfunction _getComputedStyle(elem, name, computedStyle_) {\n var val = '';\n var d = elem.ownerDocument;\n var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);\n\n // https://github.com/kissyteam/kissy/issues/61\n if (computedStyle) {\n val = computedStyle.getPropertyValue(name) || computedStyle[name];\n }\n\n return val;\n}\n\nvar _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');\nvar RE_POS = /^(top|right|bottom|left)$/;\nvar CURRENT_STYLE = 'currentStyle';\nvar RUNTIME_STYLE = 'runtimeStyle';\nvar LEFT = 'left';\nvar PX = 'px';\n\nfunction _getComputedStyleIE(elem, name) {\n // currentStyle maybe null\n // http://msdn.microsoft.com/en-us/library/ms535231.aspx\n var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];\n\n // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值\n // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19\n // 在 ie 下不对,需要直接用 offset 方式\n // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了\n\n // From the awesome hack by Dean Edwards\n // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n // If we're not dealing with a regular pixel number\n // but a number that has a weird ending, we need to convert it to pixels\n // exclude left right for relativity\n if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {\n // Remember the original values\n var style = elem.style;\n var left = style[LEFT];\n var rsLeft = elem[RUNTIME_STYLE][LEFT];\n\n // prevent flashing of content\n elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];\n\n // Put in the new values to get a computed value out\n style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;\n ret = style.pixelLeft + PX;\n\n // Revert the changed values\n style[LEFT] = left;\n\n elem[RUNTIME_STYLE][LEFT] = rsLeft;\n }\n return ret === '' ? 'auto' : ret;\n}\n\nvar getComputedStyleX = undefined;\nif (typeof window !== 'undefined') {\n getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;\n}\n\nfunction each(arr, fn) {\n for (var i = 0; i < arr.length; i++) {\n fn(arr[i]);\n }\n}\n\nfunction isBorderBoxFn(elem) {\n return getComputedStyleX(elem, 'boxSizing') === 'border-box';\n}\n\nvar BOX_MODELS = ['margin', 'border', 'padding'];\nvar CONTENT_INDEX = -1;\nvar PADDING_INDEX = 2;\nvar BORDER_INDEX = 1;\nvar MARGIN_INDEX = 0;\n\nfunction swap(elem, options, callback) {\n var old = {};\n var style = elem.style;\n var name = undefined;\n\n // Remember the old values, and insert the new ones\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n old[name] = style[name];\n style[name] = options[name];\n }\n }\n\n callback.call(elem);\n\n // Revert the old values\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n style[name] = old[name];\n }\n }\n}\n\nfunction getPBMWidth(elem, props, which) {\n var value = 0;\n var prop = undefined;\n var j = undefined;\n var i = undefined;\n for (j = 0; j < props.length; j++) {\n prop = props[j];\n if (prop) {\n for (i = 0; i < which.length; i++) {\n var cssProp = undefined;\n if (prop === 'border') {\n cssProp = prop + which[i] + 'Width';\n } else {\n cssProp = prop + which[i];\n }\n value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;\n }\n }\n }\n return value;\n}\n\n/**\n * A crude way of determining if an object is a window\n * @member util\n */\nfunction isWindow(obj) {\n // must use == for ie8\n /* eslint eqeqeq:0 */\n return obj != null && obj == obj.window;\n}\n\nvar domUtils = {};\n\neach(['Width', 'Height'], function (name) {\n domUtils['doc' + name] = function (refWin) {\n var d = refWin.document;\n return Math.max(\n // firefox chrome documentElement.scrollHeight< body.scrollHeight\n // ie standard mode : documentElement.scrollHeight> body.scrollHeight\n d.documentElement['scroll' + name],\n // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?\n d.body['scroll' + name], domUtils['viewport' + name](d));\n };\n\n domUtils['viewport' + name] = function (win) {\n // pc browser includes scrollbar in window.innerWidth\n var prop = 'client' + name;\n var doc = win.document;\n var body = doc.body;\n var documentElement = doc.documentElement;\n var documentElementProp = documentElement[prop];\n // 标准模式取 documentElement\n // backcompat 取 body\n return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;\n };\n});\n\n/*\n 得到元素的大小信息\n @param elem\n @param name\n @param {String} [extra] 'padding' : (css width) + padding\n 'border' : (css width) + padding + border\n 'margin' : (css width) + padding + border + margin\n */\nfunction getWH(elem, name, extra) {\n if (isWindow(elem)) {\n return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);\n } else if (elem.nodeType === 9) {\n return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);\n }\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem, computedStyle);\n var cssBoxValue = 0;\n if (borderBoxValue == null || borderBoxValue <= 0) {\n borderBoxValue = undefined;\n // Fall back to computed then un computed css if necessary\n cssBoxValue = getComputedStyleX(elem, name);\n if (cssBoxValue == null || Number(cssBoxValue) < 0) {\n cssBoxValue = elem.style[name] || 0;\n }\n // Normalize '', auto, and prepare for extra\n cssBoxValue = parseFloat(cssBoxValue) || 0;\n }\n if (extra === undefined) {\n extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;\n }\n var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;\n var val = borderBoxValue || cssBoxValue;\n if (extra === CONTENT_INDEX) {\n if (borderBoxValueOrIsBorderBox) {\n return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);\n }\n return cssBoxValue;\n }\n if (borderBoxValueOrIsBorderBox) {\n var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);\n return val + (extra === BORDER_INDEX ? 0 : padding);\n }\n return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);\n}\n\nvar cssShow = {\n position: 'absolute',\n visibility: 'hidden',\n display: 'block'\n};\n\n// fix #119 : https://github.com/kissyteam/kissy/issues/119\nfunction getWHIgnoreDisplay(elem) {\n var val = undefined;\n var args = arguments;\n // in case elem is window\n // elem.offsetWidth === undefined\n if (elem.offsetWidth !== 0) {\n val = getWH.apply(undefined, args);\n } else {\n swap(elem, cssShow, function () {\n val = getWH.apply(undefined, args);\n });\n }\n return val;\n}\n\nfunction css(el, name, v) {\n var value = v;\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n for (var i in name) {\n if (name.hasOwnProperty(i)) {\n css(el, i, name[i]);\n }\n }\n return undefined;\n }\n if (typeof value !== 'undefined') {\n if (typeof value === 'number') {\n value += 'px';\n }\n el.style[name] = value;\n return undefined;\n }\n return getComputedStyleX(el, name);\n}\n\neach(['width', 'height'], function (name) {\n var first = name.charAt(0).toUpperCase() + name.slice(1);\n domUtils['outer' + first] = function (el, includeMargin) {\n return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);\n };\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n\n domUtils[name] = function (elem, val) {\n if (val !== undefined) {\n if (elem) {\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem);\n if (isBorderBox) {\n val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);\n }\n return css(elem, name, val);\n }\n return undefined;\n }\n return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);\n };\n});\n\n// 设置 elem 相对 elem.ownerDocument 的坐标\nfunction setOffset(elem, offset) {\n // set position first, in-case top/left are set even on static elem\n if (css(elem, 'position') === 'static') {\n elem.style.position = 'relative';\n }\n\n var old = getOffset(elem);\n var ret = {};\n var current = undefined;\n var key = undefined;\n\n for (key in offset) {\n if (offset.hasOwnProperty(key)) {\n current = parseFloat(css(elem, key)) || 0;\n ret[key] = current + offset[key] - old[key];\n }\n }\n css(elem, ret);\n}\n\nmodule.exports = _extends({\n getWindow: function getWindow(node) {\n var doc = node.ownerDocument || node;\n return doc.defaultView || doc.parentWindow;\n },\n offset: function offset(el, value) {\n if (typeof value !== 'undefined') {\n setOffset(el, value);\n } else {\n return getOffset(el);\n }\n },\n\n isWindow: isWindow,\n each: each,\n css: css,\n clone: function clone(obj) {\n var ret = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret[i] = obj[i];\n }\n }\n var overflow = obj.overflow;\n if (overflow) {\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret.overflow[i] = obj.overflow[i];\n }\n }\n }\n return ret;\n },\n scrollLeft: function scrollLeft(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollLeft(w);\n }\n window.scrollTo(v, getScrollTop(w));\n } else {\n if (v === undefined) {\n return w.scrollLeft;\n }\n w.scrollLeft = v;\n }\n },\n scrollTop: function scrollTop(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollTop(w);\n }\n window.scrollTo(getScrollLeft(w), v);\n } else {\n if (v === undefined) {\n return w.scrollTop;\n }\n w.scrollTop = v;\n }\n },\n\n viewportWidth: 0,\n viewportHeight: 0\n}, domUtils);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dom-scroll-into-view/lib/util.js\n// module id = 16\n// module chunks = 0"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///gutenberg-support.js","webpack:///webpack/bootstrap 75d5f816076e5891d65a","webpack:///./node_modules/classnames/index.js","webpack:///./src/index.js","webpack:///./src/blocks/index.js","webpack:///./src/blocks/ta-image/index.js","webpack:///./src/blocks/ta-image/edit.js","webpack:///./src/blocks/ta-image/util.js","webpack:///./src/blocks/ta-image/image-size.js","webpack:///./src/blocks/ta-image/search-input.js","webpack:///./src/formats/index.js","webpack:///./src/formats/ta-link/index.js","webpack:///./src/formats/ta-link/inline.js","webpack:///./src/formats/ta-link/utils.js","webpack:///./src/formats/ta-link/url-popover.js","webpack:///./src/formats/ta-link/url-input.js","webpack:///./node_modules/dom-scroll-into-view/lib/index.js","webpack:///./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js","webpack:///./node_modules/dom-scroll-into-view/lib/util.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","classNames","classes","arguments","length","arg","argType","push","Array","isArray","inner","apply","key","hasOwn","join","default","undefined","__webpack_exports__","value","__WEBPACK_IMPORTED_MODULE_0__blocks__","__WEBPACK_IMPORTED_MODULE_1__formats__","__WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss__","registerBlocks","registerFormats","taimage","forEach","block","settings","registerBlockType","__WEBPACK_IMPORTED_MODULE_0__ta_image__","wp","blocks","_defineProperty","obj","writable","__WEBPACK_IMPORTED_MODULE_0_classnames__","__WEBPACK_IMPORTED_MODULE_0_classnames___default","__WEBPACK_IMPORTED_MODULE_1__edit__","Fragment","element","__","i18n","_wp$blocks","getPhrasingContentSchema","createBlock","getBlockAttributes","RichText","editor","_wp$components","components","Path","SVG","blockAttributes","url","type","source","selector","attribute","alt","caption","id","align","width","height","linkid","href","affiliateLink","imageSchema","img","attributes","title","description","icon","createElement","viewBox","xmlns","fill","category","keywords","getEditWrapperProps","data-align","data-resized","edit","save","_ref","_classnames","classnames","image","src","className","figure","Content","tagName","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","setPrototypeOf","__proto__","__WEBPACK_IMPORTED_MODULE_1__util__","__WEBPACK_IMPORTED_MODULE_2__image_size__","__WEBPACK_IMPORTED_MODULE_3__search_input__","_extends","assign","target","_slicedToArray","sliceIterator","arr","_arr","_n","_d","_e","_s","_i","Symbol","iterator","next","done","err","_createClass","defineProperties","props","descriptor","protoProps","staticProps","_lodash","lodash","isEmpty","map","last","pick","compact","getPath","_wp$i18n","sprintf","_wp$element","Component","createRef","_wp$blob","blob","getBlobByURL","revokeBlobURL","isBlobURL","Placeholder","Button","ButtonGroup","IconButton","PanelBody","ResizableBox","SelectControl","Spinner","TextControl","TextareaControl","Toolbar","withNotices","withSelect","ToggleControl","Popover","data","_wp$editor","BlockControls","InspectorControls","BlockAlignmentToolbar","MediaUpload","MediaUploadCheck","MediaPlaceholder","mediaUpload","withViewportMatch","viewport","compose","ALLOWED_MEDIA_TYPES","pickRelevantMediaFiles","imageProps","isTemporaryImage","isExternalImage","ImageEdit","_Component","this","_this","getPrototypeOf","updateAlt","bind","updateAlignment","onFocusCaption","onImageClick","onSelectImage","updateImageURL","updateWidth","updateHeight","updateDimensions","getFilename","toggleIsEditing","onImageError","onChangeInputValue","autocompleteRef","resetInvalidLink","updateImageSelection","onSelectAffiliateImage","editAFfiliateImage","state","captionFocused","isEditing","inputValue","post","showSuggestions","imageSelection","_this2","_props","setAttributes","noticeOperations","_attributes$url","file","filesList","onFileChange","_ref2","_ref3","allowedTypes","onError","message","createErrorNotice","setState","prevProps","_prevProps$attributes","prevID","_prevProps$attributes2","prevURL","_props$attributes","_props$attributes$url","isSelected","media","link","embedBlock","createUpgradedEmbedBlock","onReplace","newAlt","nextAlign","extraUpdatedAttributes","indexOf","parseInt","_this3","path","split","label","_props2","imageSizes","_ref4","slug","sizeUrl","invalidLink","_this4","apiFetch","addQueryArgs","context","_locale","then","source_url","images","_this5","_state","_props3","isLargeViewport","maxWidth","toggleSelection","isRTL","linkDestination","toolbarEditButton","onClick","controls","onChange","instructions","index","wp-block-image","is-transient","is-resized","is-focused","isResizable","imageSizeOptions","getImageSizeOptions","getInspectorControls","imageWidth","imageHeight","help","options","placeholder","min","aria-label","scale","scaledWidth","Math","round","scaledHeight","isCurrent","isSmall","isPrimary","aria-pressed","dirtynessTrigger","sizes","imageWidthWithinContainer","imageHeightWithinContainer","filename","defaultedAlt","style","currentWidth","currentHeight","ratio","minWidth","minHeight","maxWidthBuffer","showRightHandle","showLeftHandle","size","maxHeight","lockAspectRatio","enable","top","right","bottom","left","onResizeStart","onResizeStop","event","direction","elt","delta","unstableOnFocus","inlineToolbar","select","_select","getMedia","_select2","getEditorSettings","_getEditorSettings","includes","renderToString","attributesFromPreview","preview","matchingBlock","findBlock","DEFAULT_EMBED_BLOCK","html","isFromWordPress","noop","withGlobalEvents","ImageSize","bindContainer","calculateSize","ref","container","fetchImageSize","onload","window","Image","clientWidth","exceedMaxWidth","containerWidth","containerHeight","clientHeight","children","resize","withSpokenMessages","withInstanceId","ThirstyURLInput","inputRef","searchAffiliateLinks","suggestionNodes","posts","selectedSuggestion","loading","scrollingIntoView","scrollIntoView","current","onlyScrollIfNeeded","setTimeout","suggestionsRequest","formData","FormData","append","request","fetch","ajaxurl","method","body","response","json","affiliate_links","debouncedSpeak","catch","selectLink","instanceId","autoFocus","_state2","class","onSubmit","displayAffiliateImages","autocomplete","position","focusOnMount","role","tabIndex","bindSuggestionNode","is-selected","handleOnClick","aria-selected","_objectWithoutProperties","keys","taLink","registerFormatType","__WEBPACK_IMPORTED_MODULE_0__ta_link__","richText","__WEBPACK_IMPORTED_MODULE_0__inline__","_wp$richText","getTextContent","applyFormat","removeFormat","slice","isURL","RichTextToolbarButton","RichTextShortcut","getRectangleFromRange","dom","LinkEdit","addLink","stopAddingLink","onRemoveFormat","addingLink","text","speak","selection","getSelection","range","rangeCount","getRangeAt","rect","startContainer","nextElementSibling","nodeType","Node","ELEMENT_NODE","parentNode","closest","getBoundingClientRect","isActive","activeAttributes","anchorRect","getAnchorRect","character","onUse","shortcutType","shortcutCharacter","transform","createLinkFormat","toString","isShowingInput","editLink","__WEBPACK_IMPORTED_MODULE_1__utils__","__WEBPACK_IMPORTED_MODULE_2__url_popover__","__WEBPACK_IMPORTED_MODULE_3__url_input__","ExternalLink","_wp$keycodes","keycodes","LEFT","RIGHT","UP","DOWN","BACKSPACE","ENTER","_wp$url","prependHTTP","safeDecodeURI","filterURLForDisplay","insert","isCollapsed","stopKeyPropagation","stopPropagation","LinkEditor","onKeyDown","submitLink","onKeyPress","LinkViewerUrl","prependedURL","linkClassName","has-invalid-link","isValidHref","LinkViewer","InlineAffiliateLinkUI","onClickOutside","resetState","keyCode","preventDefault","selectedText","format","toInsert","autocompleteElement","contains","_props2$activeAttribu","showInput","onClose","updateLinkId","trimmedHref","trim","test","protocol","getProtocol","isValidProtocol","startsWith","authority","getAuthority","isValidAuthority","isValidPath","queryString","getQueryString","isValidQueryString","fragment","getFragment","isValidFragment","ThirstyURLPopover","toggleSettingsVisibility","isSettingsExpanded","renderSettings","_props$position","_props$focusOnMount","popoverProps","showSettings","aria-expanded","__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view__","__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view___default","throttle","TAB","stopEventPropagation","updateSuggestions","previousIndex","nextIndex","selectionStart","setSelectionRange","focus","_props$value","_props$autoFocus","_state3","required","onInput","aria-autocomplete","aria-owns","aria-activedescendant","noArrow","elem","config","util","getWindow","allowHorizontalScroll","alignWithTop","alignWithLeft","offsetTop","offsetLeft","offsetBottom","offsetRight","isWin","isWindow","elemOffset","offset","eh","outerHeight","ew","outerWidth","containerOffset","ch","cw","containerScroll","diffTop","diffBottom","win","winScroll","ww","wh","scrollLeft","scrollTop","parseFloat","css","getClientPosition","box","x","y","doc","ownerDocument","docElem","documentElement","clientLeft","clientTop","getScroll","w","ret","document","getScrollLeft","getScrollTop","getOffset","el","pos","defaultView","parentWindow","_getComputedStyle","computedStyle_","val","computedStyle","getComputedStyle","getPropertyValue","_getComputedStyleIE","CURRENT_STYLE","_RE_NUM_NO_PX","RE_POS","rsLeft","RUNTIME_STYLE","pixelLeft","PX","each","fn","isBorderBoxFn","getComputedStyleX","swap","callback","old","getPBMWidth","which","prop","j","cssProp","getWH","extra","domUtils","viewportWidth","viewportHeight","docWidth","docHeight","borderBoxValue","offsetWidth","offsetHeight","isBorderBox","cssBoxValue","Number","BORDER_INDEX","CONTENT_INDEX","borderBoxValueOrIsBorderBox","padding","PADDING_INDEX","BOX_MODELS","getWHIgnoreDisplay","args","cssShow","v","_typeof","setOffset","RE_NUM","RegExp","refWin","max","documentElementProp","compatMode","visibility","display","first","charAt","toUpperCase","includeMargin","node","clone","overflow","scrollTo"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,SAAAP,EAAAQ,EAAAC,GACAZ,EAAAa,EAAAV,EAAAQ,IACAG,OAAAC,eAAAZ,EAAAQ,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAf,GACA,GAAAQ,GAAAR,KAAAgB,WACA,WAA2B,MAAAhB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAJ,GAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB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AAmB,EAAA3E,GAAA,oBAAA4E,EAAAnB,IAEAzB,EAAAhC,EAAAzjB,EAAAinB,OA6BAxnB,EAAAD,QAAAuI,GACA6b,UAAA,SAAAkH,GACA,GAAAhF,GAAAgF,EAAA/E,eAAA+E,CACA,OAAAhF,GAAAe,aAAAf,EAAAgB,cAEAvC,OAAA,SAAAoC,EAAAxkB,GACA,YAAAA,EAGA,MAAAukB,GAAAC,EAFAsD,GAAAtD,EAAAxkB,IAMAkiB,WACAwD,OACApC,MACAsF,MAAA,SAAA7nB,GACA,GAAAojB,KACA,QAAA5mB,KAAAwD,GACAA,EAAArC,eAAAnB,KACA4mB,EAAA5mB,GAAAwD,EAAAxD,GAIA,IADAwD,EAAA8nB,SAEA,OAAAtrB,KAAAwD,GACAA,EAAArC,eAAAnB,KACA4mB,EAAA0E,SAAAtrB,GAAAwD,EAAA8nB,SAAAtrB,GAIA,OAAA4mB,IAEAhB,WAAA,SAAAe,EAAA0D,GACA,GAAA1F,EAAAgC,GAAA,CACA,OAAApkB,KAAA8nB,EACA,MAAAvD,GAAAH,EAEA9O,QAAA0T,SAAAlB,EAAAtD,EAAAJ,QACK,CACL,OAAApkB,KAAA8nB,EACA,MAAA1D,GAAAf,UAEAe,GAAAf,WAAAyE,IAGAxE,UAAA,SAAAc,EAAA0D,GACA,GAAA1F,EAAAgC,GAAA,CACA,OAAApkB,KAAA8nB,EACA,MAAAtD,GAAAJ,EAEA9O,QAAA0T,SAAAzE,EAAAH,GAAA0D,OACK,CACL,OAAA9nB,KAAA8nB,EACA,MAAA1D,GAAAd,SAEAc,GAAAd,UAAAwE,IAIAnB,cAAA,EACAC,eAAA,GACCF,IlBgmGK,SAAUlpB,EAAQD","file":"gutenberg-support.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 1);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (true) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n\t\t\treturn classNames;\n\t\t}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__blocks__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__formats__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss__);\n\n\n\n\n\nObject(__WEBPACK_IMPORTED_MODULE_0__blocks__[\"a\" /* default */])();\nObject(__WEBPACK_IMPORTED_MODULE_1__formats__[\"a\" /* default */])();\n\n/***/ }),\n/* 2 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = registerBlocks;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ta_image__ = __webpack_require__(3);\n\n\nvar registerBlockType = wp.blocks.registerBlockType;\n\n/**\n * Register gutenberg blocks.\n * \n * @since 3.6\n */\n\nfunction registerBlocks() {\n\n [__WEBPACK_IMPORTED_MODULE_0__ta_image__].forEach(function (block) {\n if (!block) return;\n\n var name = block.name,\n settings = block.settings;\n\n registerBlockType(name, settings);\n });\n}\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"name\", function() { return name; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"settings\", function() { return settings; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__edit__ = __webpack_require__(4);\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar Fragment = wp.element.Fragment;\nvar __ = wp.i18n.__;\nvar _wp$blocks = wp.blocks,\n createBlock = _wp$blocks.createBlock,\n getBlockAttributes = _wp$blocks.getBlockAttributes,\n getPhrasingContentSchema = _wp$blocks.getPhrasingContentSchema;\nvar RichText = wp.editor.RichText;\nvar _wp$components = wp.components,\n Path = _wp$components.Path,\n SVG = _wp$components.SVG;\n\n\n\n\nvar name = 'ta/image';\n\nvar blockAttributes = {\n\turl: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'src'\n\t},\n\talt: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'alt',\n\t\tdefault: ''\n\t},\n\tcaption: {\n\t\ttype: 'string',\n\t\tsource: 'html',\n\t\tselector: 'figcaption'\n\t},\n\tid: {\n\t\ttype: 'number'\n\t},\n\talign: {\n\t\ttype: 'string'\n\t},\n\twidth: {\n\t\ttype: 'number'\n\t},\n\theight: {\n\t\ttype: 'number'\n\t},\n\tlinkid: {\n\t\ttype: 'number'\n\t},\n\thref: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'ta',\n\t\tattribute: 'href'\n\t},\n\taffiliateLink: {\n\t\ttype: 'object'\n\t}\n};\n\nvar imageSchema = {\n\timg: {\n\t\tattributes: ['src', 'alt'],\n\t\tclasses: ['alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\\d+$/]\n\t}\n};\n\nvar schema = {\n\tfigure: {\n\t\trequire: ['ta', 'img'],\n\t\tchildren: {\n\t\t\tta: {\n\t\t\t\tattributes: ['href', 'linkid'],\n\t\t\t\tchildren: imageSchema\n\t\t\t},\n\t\t\tfigcaption: {\n\t\t\t\tchildren: getPhrasingContentSchema()\n\t\t\t}\n\t\t}\n\t}\n};\n\nfunction getFirstAnchorAttributeFormHTML(html, attributeName) {\n\tvar _document$implementat = document.implementation.createHTMLDocument(''),\n\t body = _document$implementat.body;\n\n\tbody.innerHTML = html;\n\n\tvar firstElementChild = body.firstElementChild;\n\n\n\tif (firstElementChild && firstElementChild.nodeName === 'A') {\n\t\treturn firstElementChild.getAttribute(attributeName) || undefined;\n\t}\n}\n\nvar settings = {\n\ttitle: __('ThirstyAffiliates Image'),\n\n\tdescription: __('Insert an image with an affiliate link to make a visual statement.'),\n\n\ticon: wp.element.createElement(\n\t\tSVG,\n\t\t{ viewBox: \"0 0 24 24\", xmlns: \"http://www.w3.org/2000/svg\" },\n\t\twp.element.createElement(Path, { d: \"M0,0h24v24H0V0z\", fill: \"none\" }),\n\t\twp.element.createElement(Path, { d: \"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z\" }),\n\t\twp.element.createElement(Path, { d: \"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z\" })\n\t),\n\n\tcategory: 'common',\n\n\tkeywords: ['img', // \"img\" is not translated as it is intended to reflect the HTML <img> tag.\n\t__('photo'), __('affiliate')],\n\n\tattributes: blockAttributes,\n\n\tgetEditWrapperProps: function getEditWrapperProps(attributes) {\n\t\tvar align = attributes.align,\n\t\t width = attributes.width;\n\n\t\tif ('left' === align || 'center' === align || 'right' === align || 'wide' === align || 'full' === align) {\n\t\t\treturn { 'data-align': align, 'data-resized': !!width };\n\t\t}\n\t},\n\n\n\tedit: __WEBPACK_IMPORTED_MODULE_1__edit__[\"a\" /* default */],\n\n\tsave: function save(_ref) {\n\t\tvar _classnames;\n\n\t\tvar attributes = _ref.attributes;\n\t\tvar url = attributes.url,\n\t\t alt = attributes.alt,\n\t\t caption = attributes.caption,\n\t\t align = attributes.align,\n\t\t width = attributes.width,\n\t\t height = attributes.height,\n\t\t id = attributes.id,\n\t\t linkid = attributes.linkid,\n\t\t href = attributes.href;\n\n\n\t\tvar classes = __WEBPACK_IMPORTED_MODULE_0_classnames___default()((_classnames = {}, _defineProperty(_classnames, \"align\" + align, align), _defineProperty(_classnames, 'is-resized', width || height), _classnames));\n\n\t\tvar image = wp.element.createElement(\"img\", {\n\t\t\tsrc: url,\n\t\t\talt: alt,\n\t\t\tclassName: id ? \"wp-image-\" + id : null,\n\t\t\twidth: width,\n\t\t\theight: height\n\t\t});\n\n\t\tvar figure = wp.element.createElement(\n\t\t\tFragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\t\"ta\",\n\t\t\t\t{ linkid: linkid, href: href },\n\t\t\t\timage\n\t\t\t),\n\t\t\twp.element.createElement(RichText.Content, { tagName: \"figcaption\", value: caption })\n\t\t);\n\n\t\tif ('left' === align || 'right' === align || 'center' === align) {\n\t\t\treturn wp.element.createElement(\n\t\t\t\t\"div\",\n\t\t\t\t{ className: \"wp-block-image\" },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t\"figure\",\n\t\t\t\t\t{ className: classes },\n\t\t\t\t\tfigure\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn wp.element.createElement(\n\t\t\t\"figure\",\n\t\t\t{ className: \"wp-block-image \" + classes },\n\t\t\tfigure\n\t\t);\n\t}\n};\n\n/***/ }),\n/* 4 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export pickRelevantMediaFiles */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(5);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__image_size__ = __webpack_require__(6);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__search_input__ = __webpack_require__(7);\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nvar _lodash = lodash,\n get = _lodash.get,\n isEmpty = _lodash.isEmpty,\n map = _lodash.map,\n last = _lodash.last,\n pick = _lodash.pick,\n compact = _lodash.compact;\nvar getPath = wp.url.getPath;\nvar _wp$i18n = wp.i18n,\n __ = _wp$i18n.__,\n sprintf = _wp$i18n.sprintf;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n Fragment = _wp$element.Fragment,\n createRef = _wp$element.createRef;\nvar _wp$blob = wp.blob,\n getBlobByURL = _wp$blob.getBlobByURL,\n revokeBlobURL = _wp$blob.revokeBlobURL,\n isBlobURL = _wp$blob.isBlobURL;\nvar _wp$components = wp.components,\n Placeholder = _wp$components.Placeholder,\n Button = _wp$components.Button,\n ButtonGroup = _wp$components.ButtonGroup,\n IconButton = _wp$components.IconButton,\n PanelBody = _wp$components.PanelBody,\n ResizableBox = _wp$components.ResizableBox,\n SelectControl = _wp$components.SelectControl,\n Spinner = _wp$components.Spinner,\n TextControl = _wp$components.TextControl,\n TextareaControl = _wp$components.TextareaControl,\n Toolbar = _wp$components.Toolbar,\n withNotices = _wp$components.withNotices,\n ToggleControl = _wp$components.ToggleControl,\n Popover = _wp$components.Popover;\nvar withSelect = wp.data.withSelect;\nvar _wp$editor = wp.editor,\n RichText = _wp$editor.RichText,\n BlockControls = _wp$editor.BlockControls,\n InspectorControls = _wp$editor.InspectorControls,\n MediaUpload = _wp$editor.MediaUpload,\n MediaUploadCheck = _wp$editor.MediaUploadCheck,\n MediaPlaceholder = _wp$editor.MediaPlaceholder,\n BlockAlignmentToolbar = _wp$editor.BlockAlignmentToolbar,\n mediaUpload = _wp$editor.mediaUpload;\nvar withViewportMatch = wp.viewport.withViewportMatch;\nvar compose = wp.compose.compose;\n\n\n\n\n\n\n/**\n * Module constants\n */\nvar MIN_SIZE = 20;\nvar LINK_DESTINATION_NONE = 'none';\nvar LINK_DESTINATION_MEDIA = 'media';\nvar LINK_DESTINATION_ATTACHMENT = 'attachment';\nvar LINK_DESTINATION_CUSTOM = 'custom';\nvar NEW_TAB_REL = 'noreferrer noopener';\nvar ALLOWED_MEDIA_TYPES = ['image'];\n\nvar pickRelevantMediaFiles = function pickRelevantMediaFiles(image) {\n\tvar imageProps = pick(image, ['alt', 'id', 'link', 'caption']);\n\timageProps.url = get(image, ['sizes', 'large', 'url']) || get(image, ['media_details', 'sizes', 'large', 'source_url']) || image.url;\n\treturn imageProps;\n};\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily\n * while the image is being uploaded and will not have an id yet allocated.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the URL a Blob URL\n */\nvar isTemporaryImage = function isTemporaryImage(id, url) {\n\treturn !id && isBlobURL(url);\n};\n\n/**\n * Is the url for the image hosted externally. An externally hosted image has no id\n * and is not a blob url.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the url an externally hosted url?\n */\nvar isExternalImage = function isExternalImage(id, url) {\n\treturn url && !id && !isBlobURL(url);\n};\n\nvar ImageEdit = function (_Component) {\n\t_inherits(ImageEdit, _Component);\n\n\tfunction ImageEdit(_ref) {\n\t\tvar attributes = _ref.attributes;\n\n\t\t_classCallCheck(this, ImageEdit);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ImageEdit.__proto__ || Object.getPrototypeOf(ImageEdit)).apply(this, arguments));\n\n\t\t_this.updateAlt = _this.updateAlt.bind(_this);\n\t\t_this.updateAlignment = _this.updateAlignment.bind(_this);\n\t\t_this.onFocusCaption = _this.onFocusCaption.bind(_this);\n\t\t_this.onImageClick = _this.onImageClick.bind(_this);\n\t\t_this.onSelectImage = _this.onSelectImage.bind(_this);\n\t\t_this.updateImageURL = _this.updateImageURL.bind(_this);\n\t\t_this.updateWidth = _this.updateWidth.bind(_this);\n\t\t_this.updateHeight = _this.updateHeight.bind(_this);\n\t\t_this.updateDimensions = _this.updateDimensions.bind(_this);\n\t\t_this.getFilename = _this.getFilename.bind(_this);\n\t\t_this.toggleIsEditing = _this.toggleIsEditing.bind(_this);\n\t\t_this.onImageError = _this.onImageError.bind(_this);\n\t\t_this.onChangeInputValue = _this.onChangeInputValue.bind(_this);\n\t\t_this.autocompleteRef = createRef();\n\t\t_this.resetInvalidLink = _this.resetInvalidLink.bind(_this);\n\t\t_this.updateImageSelection = _this.updateImageSelection.bind(_this);\n\t\t_this.onSelectAffiliateImage = _this.onSelectAffiliateImage.bind(_this);\n\t\t_this.editAFfiliateImage = _this.editAFfiliateImage.bind(_this);\n\n\t\t_this.state = {\n\t\t\tcaptionFocused: false,\n\t\t\tisEditing: !attributes.url,\n\t\t\tinputValue: '',\n\t\t\tlinkid: 0,\n\t\t\tpost: null,\n\t\t\tshowSuggestions: false,\n\t\t\timageSelection: [],\n\t\t\taffiliateLink: null\n\t\t};\n\t\treturn _this;\n\t}\n\n\t_createClass(ImageEdit, [{\n\t\tkey: \"componentDidMount\",\n\t\tvalue: function componentDidMount() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar _props = this.props,\n\t\t\t attributes = _props.attributes,\n\t\t\t setAttributes = _props.setAttributes,\n\t\t\t noticeOperations = _props.noticeOperations;\n\t\t\tvar id = attributes.id,\n\t\t\t _attributes$url = attributes.url,\n\t\t\t url = _attributes$url === undefined ? '' : _attributes$url;\n\n\n\t\t\tif (isTemporaryImage(id, url)) {\n\t\t\t\tvar file = getBlobByURL(url);\n\n\t\t\t\tif (file) {\n\t\t\t\t\tmediaUpload({\n\t\t\t\t\t\tfilesList: [file],\n\t\t\t\t\t\tonFileChange: function onFileChange(_ref2) {\n\t\t\t\t\t\t\tvar _ref3 = _slicedToArray(_ref2, 1),\n\t\t\t\t\t\t\t image = _ref3[0];\n\n\t\t\t\t\t\t\tsetAttributes(pickRelevantMediaFiles(image));\n\t\t\t\t\t\t},\n\t\t\t\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\t\t\t\tonError: function onError(message) {\n\t\t\t\t\t\t\tnoticeOperations.createErrorNotice(message);\n\t\t\t\t\t\t\t_this2.setState({ isEditing: true });\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"componentDidUpdate\",\n\t\tvalue: function componentDidUpdate(prevProps) {\n\t\t\tvar _prevProps$attributes = prevProps.attributes,\n\t\t\t prevID = _prevProps$attributes.id,\n\t\t\t _prevProps$attributes2 = _prevProps$attributes.url,\n\t\t\t prevURL = _prevProps$attributes2 === undefined ? '' : _prevProps$attributes2;\n\t\t\tvar _props$attributes = this.props.attributes,\n\t\t\t id = _props$attributes.id,\n\t\t\t _props$attributes$url = _props$attributes.url,\n\t\t\t url = _props$attributes$url === undefined ? '' : _props$attributes$url;\n\n\n\t\t\tif (isTemporaryImage(prevID, prevURL) && !isTemporaryImage(id, url)) {\n\t\t\t\trevokeBlobURL(url);\n\t\t\t}\n\n\t\t\tif (!this.props.isSelected && prevProps.isSelected && this.state.captionFocused) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tcaptionFocused: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"onSelectImage\",\n\t\tvalue: function onSelectImage(media) {\n\n\t\t\tif (!media || !media.url) {\n\t\t\t\tthis.props.setAttributes({\n\t\t\t\t\turl: undefined,\n\t\t\t\t\talt: undefined,\n\t\t\t\t\tid: undefined,\n\t\t\t\t\tcaption: undefined\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar affiliateLink = this.state.affiliateLink;\n\n\n\t\t\tthis.setState({\n\t\t\t\tisEditing: false\n\t\t\t});\n\n\t\t\tthis.props.setAttributes(_extends({}, pickRelevantMediaFiles(media), {\n\t\t\t\tlinkid: affiliateLink.id,\n\t\t\t\thref: affiliateLink.link,\n\t\t\t\taffiliateLink: affiliateLink,\n\t\t\t\twidth: undefined,\n\t\t\t\theight: undefined\n\t\t\t}));\n\t\t}\n\t}, {\n\t\tkey: \"onImageError\",\n\t\tvalue: function onImageError(url) {\n\t\t\t// Check if there's an embed block that handles this URL.\n\t\t\tvar embedBlock = Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"a\" /* createUpgradedEmbedBlock */])({ attributes: { url: url } });\n\t\t\tif (undefined !== embedBlock) {\n\t\t\t\tthis.props.onReplace(embedBlock);\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"onFocusCaption\",\n\t\tvalue: function onFocusCaption() {\n\t\t\tif (!this.state.captionFocused) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tcaptionFocused: true\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"onImageClick\",\n\t\tvalue: function onImageClick() {\n\t\t\tif (this.state.captionFocused) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tcaptionFocused: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"updateAlt\",\n\t\tvalue: function updateAlt(newAlt) {\n\t\t\tthis.props.setAttributes({ alt: newAlt });\n\t\t}\n\t}, {\n\t\tkey: \"updateAlignment\",\n\t\tvalue: function updateAlignment(nextAlign) {\n\t\t\tvar extraUpdatedAttributes = ['wide', 'full'].indexOf(nextAlign) !== -1 ? { width: undefined, height: undefined } : {};\n\t\t\tthis.props.setAttributes(_extends({}, extraUpdatedAttributes, { align: nextAlign }));\n\t\t}\n\t}, {\n\t\tkey: \"updateImageURL\",\n\t\tvalue: function updateImageURL(url) {\n\t\t\tthis.props.setAttributes({ url: url, width: undefined, height: undefined });\n\t\t}\n\t}, {\n\t\tkey: \"updateWidth\",\n\t\tvalue: function updateWidth(width) {\n\t\t\tthis.props.setAttributes({ width: parseInt(width, 10) });\n\t\t}\n\t}, {\n\t\tkey: \"updateHeight\",\n\t\tvalue: function updateHeight(height) {\n\t\t\tthis.props.setAttributes({ height: parseInt(height, 10) });\n\t\t}\n\t}, {\n\t\tkey: \"updateDimensions\",\n\t\tvalue: function updateDimensions() {\n\t\t\tvar _this3 = this;\n\n\t\t\tvar width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\t\t\tvar height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\t\treturn function () {\n\t\t\t\t_this3.props.setAttributes({ width: width, height: height });\n\t\t\t};\n\t\t}\n\t}, {\n\t\tkey: \"getFilename\",\n\t\tvalue: function getFilename(url) {\n\t\t\tvar path = getPath(url);\n\t\t\tif (path) {\n\t\t\t\treturn last(path.split('/'));\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"getLinkDestinationOptions\",\n\t\tvalue: function getLinkDestinationOptions() {\n\t\t\treturn [{ value: LINK_DESTINATION_NONE, label: __('None') }, { value: LINK_DESTINATION_MEDIA, label: __('Media File') }, { value: LINK_DESTINATION_ATTACHMENT, label: __('Attachment Page') }, { value: LINK_DESTINATION_CUSTOM, label: __('Custom URL') }];\n\t\t}\n\t}, {\n\t\tkey: \"toggleIsEditing\",\n\t\tvalue: function toggleIsEditing() {\n\t\t\tthis.setState({\n\t\t\t\tisEditing: !this.state.isEditing\n\t\t\t});\n\t\t}\n\t}, {\n\t\tkey: \"getImageSizeOptions\",\n\t\tvalue: function getImageSizeOptions() {\n\t\t\tvar _props2 = this.props,\n\t\t\t imageSizes = _props2.imageSizes,\n\t\t\t image = _props2.image;\n\n\t\t\treturn compact(map(imageSizes, function (_ref4) {\n\t\t\t\tvar name = _ref4.name,\n\t\t\t\t slug = _ref4.slug;\n\n\t\t\t\tvar sizeUrl = get(image, ['media_details', 'sizes', slug, 'source_url']);\n\t\t\t\tif (!sizeUrl) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tvalue: sizeUrl,\n\t\t\t\t\tlabel: name\n\t\t\t\t};\n\t\t\t}));\n\t\t}\n\t}, {\n\t\tkey: \"onChangeInputValue\",\n\t\tvalue: function onChangeInputValue(inputValue) {\n\t\t\tvar post = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n\t\t\tvar linkid = post ? post.id : 0;\n\t\t\tthis.setState({ inputValue: inputValue, linkid: linkid, post: post });\n\t\t}\n\t}, {\n\t\tkey: \"resetInvalidLink\",\n\t\tvalue: function resetInvalidLink() {\n\t\t\tthis.setState({ invalidLink: false });\n\t\t}\n\t}, {\n\t\tkey: \"updateImageSelection\",\n\t\tvalue: function updateImageSelection(imageSelection, affiliateLink) {\n\t\t\tthis.setState({\n\t\t\t\timageSelection: imageSelection,\n\t\t\t\taffiliateLink: affiliateLink\n\t\t\t});\n\t\t}\n\t}, {\n\t\tkey: \"onSelectAffiliateImage\",\n\t\tvalue: function onSelectAffiliateImage(image) {\n\t\t\tvar _this4 = this;\n\n\t\t\tif (isExternalImage(image.id, image.src)) {\n\t\t\t\timage.url = image.src;\n\t\t\t\tthis.onSelectImage(image);\n\t\t\t} else {\n\t\t\t\tvar request = wp.apiFetch({\n\t\t\t\t\tpath: wp.url.addQueryArgs('/wp/v2/media/' + image.id, {\n\t\t\t\t\t\tcontext: 'edit',\n\t\t\t\t\t\t_locale: 'user'\n\t\t\t\t\t})\n\t\t\t\t});\n\n\t\t\t\trequest.then(function (media) {\n\t\t\t\t\tmedia.url = media.source_url;\n\t\t\t\t\t_this4.onSelectImage(media);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"editAFfiliateImage\",\n\t\tvalue: function editAFfiliateImage() {\n\t\t\tvar attributes = this.props.attributes;\n\t\t\tvar affiliateLink = attributes.affiliateLink;\n\n\n\t\t\tthis.setState({\n\t\t\t\tisEditing: true,\n\t\t\t\timageSelection: affiliateLink.images,\n\t\t\t\taffiliateLink: affiliateLink\n\t\t\t});\n\t\t}\n\t}, {\n\t\tkey: \"render\",\n\t\tvalue: function render() {\n\t\t\tvar _this5 = this;\n\n\t\t\tvar _state = this.state,\n\t\t\t isEditing = _state.isEditing,\n\t\t\t imageSelection = _state.imageSelection,\n\t\t\t affiliateLink = _state.affiliateLink;\n\t\t\tvar _props3 = this.props,\n\t\t\t attributes = _props3.attributes,\n\t\t\t setAttributes = _props3.setAttributes,\n\t\t\t isLargeViewport = _props3.isLargeViewport,\n\t\t\t isSelected = _props3.isSelected,\n\t\t\t className = _props3.className,\n\t\t\t maxWidth = _props3.maxWidth,\n\t\t\t toggleSelection = _props3.toggleSelection,\n\t\t\t isRTL = _props3.isRTL;\n\t\t\tvar url = attributes.url,\n\t\t\t alt = attributes.alt,\n\t\t\t caption = attributes.caption,\n\t\t\t align = attributes.align,\n\t\t\t linkDestination = attributes.linkDestination,\n\t\t\t width = attributes.width,\n\t\t\t height = attributes.height,\n\t\t\t linkid = attributes.linkid,\n\t\t\t href = attributes.href;\n\n\t\t\tvar toolbarEditButton = wp.element.createElement(\n\t\t\t\tToolbar,\n\t\t\t\tnull,\n\t\t\t\twp.element.createElement(IconButton, {\n\t\t\t\t\tclassName: \"ta-edit-image-button components-icon-button components-toolbar__control\",\n\t\t\t\t\tlabel: __('Edit ThirstyAffiliates Image'),\n\t\t\t\t\ticon: \"edit\",\n\t\t\t\t\tonClick: this.editAFfiliateImage\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tvar controls = wp.element.createElement(\n\t\t\t\tBlockControls,\n\t\t\t\tnull,\n\t\t\t\twp.element.createElement(BlockAlignmentToolbar, {\n\t\t\t\t\tvalue: align,\n\t\t\t\t\tonChange: this.updateAlignment\n\t\t\t\t}),\n\t\t\t\ttoolbarEditButton\n\t\t\t);\n\n\t\t\tif (isEditing) {\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\tFragment,\n\t\t\t\t\tnull,\n\t\t\t\t\tcontrols,\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tPlaceholder,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticon: \"format-image\",\n\t\t\t\t\t\t\tlabel: __(\"ThirstyAffiliates Image\"),\n\t\t\t\t\t\t\tinstructions: __(\"Search for an affiliate link and select image to insert.\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\twp.element.createElement(__WEBPACK_IMPORTED_MODULE_3__search_input__[\"a\" /* default */], {\n\t\t\t\t\t\t\tupdateImageSelection: this.updateImageSelection\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t!!imageSelection.length && wp.element.createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t{ className: \"ta-image-sel-wrap\" },\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"h3\",\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\taffiliateLink.title + \" \" + __('attached images:')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t{ className: \"ta-image-selection\" },\n\t\t\t\t\t\t\t\timageSelection.map(function (image, index) {\n\t\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\t\t\"button\",\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\t\t\treturn _this5.onSelectAffiliateImage(image);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\twp.element.createElement(\"img\", { src: image.src })\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tvar classes = __WEBPACK_IMPORTED_MODULE_0_classnames___default()(className, {\n\t\t\t\t'wp-block-image': true,\n\t\t\t\t'is-transient': isBlobURL(url),\n\t\t\t\t'is-resized': !!width || !!height,\n\t\t\t\t'is-focused': isSelected\n\t\t\t});\n\n\t\t\tvar isResizable = ['wide', 'full'].indexOf(align) === -1 && isLargeViewport;\n\t\t\tvar imageSizeOptions = this.getImageSizeOptions();\n\n\t\t\tvar getInspectorControls = function getInspectorControls(imageWidth, imageHeight) {\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\tInspectorControls,\n\t\t\t\t\tnull,\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tPanelBody,\n\t\t\t\t\t\t{ title: __('Image Settings') },\n\t\t\t\t\t\twp.element.createElement(TextareaControl, {\n\t\t\t\t\t\t\tlabel: __('Alt Text (Alternative Text)'),\n\t\t\t\t\t\t\tvalue: alt,\n\t\t\t\t\t\t\tonChange: _this5.updateAlt,\n\t\t\t\t\t\t\thelp: __('Alternative text describes your image to people who can’t see it. Add a short description with its key details.')\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t!isEmpty(imageSizeOptions) && wp.element.createElement(SelectControl, {\n\t\t\t\t\t\t\tlabel: __('Image Size'),\n\t\t\t\t\t\t\tvalue: url,\n\t\t\t\t\t\t\toptions: imageSizeOptions,\n\t\t\t\t\t\t\tonChange: _this5.updateImageURL\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tisResizable && wp.element.createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions\" },\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"p\",\n\t\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions__row\" },\n\t\t\t\t\t\t\t\t__('Image Dimensions')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions__row\" },\n\t\t\t\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\t\tclassName: \"block-library-image__dimensions__width\",\n\t\t\t\t\t\t\t\t\tlabel: __('Width'),\n\t\t\t\t\t\t\t\t\tvalue: width !== undefined ? width : '',\n\t\t\t\t\t\t\t\t\tplaceholder: imageWidth,\n\t\t\t\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\t\t\t\tonChange: _this5.updateWidth\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\t\tclassName: \"block-library-image__dimensions__height\",\n\t\t\t\t\t\t\t\t\tlabel: __('Height'),\n\t\t\t\t\t\t\t\t\tvalue: height !== undefined ? height : '',\n\t\t\t\t\t\t\t\t\tplaceholder: imageHeight,\n\t\t\t\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\t\t\t\tonChange: _this5.updateHeight\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions__row\" },\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\tButtonGroup,\n\t\t\t\t\t\t\t\t\t{ \"aria-label\": __('Image Size') },\n\t\t\t\t\t\t\t\t\t[25, 50, 75, 100].map(function (scale) {\n\t\t\t\t\t\t\t\t\t\tvar scaledWidth = Math.round(imageWidth * (scale / 100));\n\t\t\t\t\t\t\t\t\t\tvar scaledHeight = Math.round(imageHeight * (scale / 100));\n\n\t\t\t\t\t\t\t\t\t\tvar isCurrent = width === scaledWidth && height === scaledHeight;\n\n\t\t\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\t\t\tButton,\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tkey: scale,\n\t\t\t\t\t\t\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\t\t\t\t\t\t\tisPrimary: isCurrent,\n\t\t\t\t\t\t\t\t\t\t\t\t\"aria-pressed\": isCurrent,\n\t\t\t\t\t\t\t\t\t\t\t\tonClick: _this5.updateDimensions(scaledWidth, scaledHeight)\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tscale,\n\t\t\t\t\t\t\t\t\t\t\t\"%\"\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\tButton,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\t\t\t\t\tonClick: _this5.updateDimensions()\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t__('Reset')\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t};\n\n\t\t\t// Disable reason: Each block can be selected by clicking on it\n\t\t\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t\t\treturn wp.element.createElement(\n\t\t\t\tFragment,\n\t\t\t\tnull,\n\t\t\t\tcontrols,\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t\"figure\",\n\t\t\t\t\t{ className: classes },\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t__WEBPACK_IMPORTED_MODULE_2__image_size__[\"a\" /* default */],\n\t\t\t\t\t\t{ src: url, dirtynessTrigger: align },\n\t\t\t\t\t\tfunction (sizes) {\n\t\t\t\t\t\t\tvar imageWidthWithinContainer = sizes.imageWidthWithinContainer,\n\t\t\t\t\t\t\t imageHeightWithinContainer = sizes.imageHeightWithinContainer,\n\t\t\t\t\t\t\t imageWidth = sizes.imageWidth,\n\t\t\t\t\t\t\t imageHeight = sizes.imageHeight;\n\n\n\t\t\t\t\t\t\tvar filename = _this5.getFilename(url);\n\t\t\t\t\t\t\tvar defaultedAlt = void 0;\n\t\t\t\t\t\t\tif (alt) {\n\t\t\t\t\t\t\t\tdefaultedAlt = alt;\n\t\t\t\t\t\t\t} else if (filename) {\n\t\t\t\t\t\t\t\tdefaultedAlt = sprintf(__('This image has an empty alt attribute; its file name is %s'), filename);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdefaultedAlt = __('This image has an empty alt attribute');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar img =\n\t\t\t\t\t\t\t// Disable reason: Image itself is not meant to be interactive, but\n\t\t\t\t\t\t\t// should direct focus to block.\n\t\t\t\t\t\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\tFragment,\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\t\"ta\",\n\t\t\t\t\t\t\t\t\t{ linkid: linkid, href: href },\n\t\t\t\t\t\t\t\t\twp.element.createElement(\"img\", { src: url, alt: defaultedAlt, onClick: _this5.onImageClick, onError: function onError() {\n\t\t\t\t\t\t\t\t\t\t\treturn _this5.onImageError(url);\n\t\t\t\t\t\t\t\t\t\t} })\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tisBlobURL(url) && wp.element.createElement(Spinner, null)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\t;\n\n\t\t\t\t\t\t\tif (!isResizable || !imageWidthWithinContainer) {\n\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\tFragment,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\tgetInspectorControls(imageWidth, imageHeight),\n\t\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t\t\t{ style: { width: width, height: height } },\n\t\t\t\t\t\t\t\t\t\timg\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar currentWidth = width || imageWidthWithinContainer;\n\t\t\t\t\t\t\tvar currentHeight = height || imageHeightWithinContainer;\n\n\t\t\t\t\t\t\tvar ratio = imageWidth / imageHeight;\n\t\t\t\t\t\t\tvar minWidth = imageWidth < imageHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\t\t\t\t\t\t\tvar minHeight = imageHeight < imageWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t\t\t\t\t\t\t// With the current implementation of ResizableBox, an image needs an explicit pixel value for the max-width.\n\t\t\t\t\t\t\t// In absence of being able to set the content-width, this max-width is currently dictated by the vanilla editor style.\n\t\t\t\t\t\t\t// The following variable adds a buffer to this vanilla style, so 3rd party themes have some wiggleroom.\n\t\t\t\t\t\t\t// This does, in most cases, allow you to scale the image beyond the width of the main column, though not infinitely.\n\t\t\t\t\t\t\t// @todo It would be good to revisit this once a content-width variable becomes available.\n\t\t\t\t\t\t\tvar maxWidthBuffer = maxWidth * 2.5;\n\n\t\t\t\t\t\t\tvar showRightHandle = false;\n\t\t\t\t\t\t\tvar showLeftHandle = false;\n\n\t\t\t\t\t\t\t/* eslint-disable no-lonely-if */\n\t\t\t\t\t\t\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\t\t\t\t\t\t\tif (align === 'center') {\n\t\t\t\t\t\t\t\t// When the image is centered, show both handles.\n\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t} else if (isRTL) {\n\t\t\t\t\t\t\t\t// In RTL mode the image is on the right by default.\n\t\t\t\t\t\t\t\t// Show the right handle and hide the left handle only when it is aligned left.\n\t\t\t\t\t\t\t\t// Otherwise always show the left handle.\n\t\t\t\t\t\t\t\tif (align === 'left') {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Show the left handle and hide the right handle only when the image is aligned right.\n\t\t\t\t\t\t\t\t// Otherwise always show the right handle.\n\t\t\t\t\t\t\t\tif (align === 'right') {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/* eslint-enable no-lonely-if */\n\n\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\tFragment,\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\tgetInspectorControls(imageWidth, imageHeight),\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\tResizableBox,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tsize: width && height ? {\n\t\t\t\t\t\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\t\t\t\t\t\theight: height\n\t\t\t\t\t\t\t\t\t\t} : undefined,\n\t\t\t\t\t\t\t\t\t\tminWidth: minWidth,\n\t\t\t\t\t\t\t\t\t\tmaxWidth: maxWidthBuffer,\n\t\t\t\t\t\t\t\t\t\tminHeight: minHeight,\n\t\t\t\t\t\t\t\t\t\tmaxHeight: maxWidthBuffer / ratio,\n\t\t\t\t\t\t\t\t\t\tlockAspectRatio: true,\n\t\t\t\t\t\t\t\t\t\tenable: {\n\t\t\t\t\t\t\t\t\t\t\ttop: false,\n\t\t\t\t\t\t\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\t\t\t\t\t\t\tbottom: true,\n\t\t\t\t\t\t\t\t\t\t\tleft: showLeftHandle\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonResizeStart: function onResizeStart() {\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection(false);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonResizeStop: function onResizeStop(event, direction, elt, delta) {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes({\n\t\t\t\t\t\t\t\t\t\t\t\twidth: parseInt(currentWidth + delta.width, 10),\n\t\t\t\t\t\t\t\t\t\t\t\theight: parseInt(currentHeight + delta.height, 10)\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection(true);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\timg\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\t(!RichText.isEmpty(caption) || isSelected) && wp.element.createElement(RichText, {\n\t\t\t\t\t\ttagName: \"figcaption\",\n\t\t\t\t\t\tplaceholder: __('Write caption…'),\n\t\t\t\t\t\tvalue: caption,\n\t\t\t\t\t\tunstableOnFocus: this.onFocusCaption,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ caption: value });\n\t\t\t\t\t\t},\n\t\t\t\t\t\tisSelected: this.state.captionFocused,\n\t\t\t\t\t\tinlineToolbar: true\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t);\n\t\t\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t\t}\n\t}]);\n\n\treturn ImageEdit;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (compose([withSelect(function (select, props) {\n\tvar _select = select('core'),\n\t getMedia = _select.getMedia;\n\n\tvar _select2 = select('core/editor'),\n\t getEditorSettings = _select2.getEditorSettings;\n\n\tvar id = props.attributes.id;\n\n\tvar _getEditorSettings = getEditorSettings(),\n\t maxWidth = _getEditorSettings.maxWidth,\n\t isRTL = _getEditorSettings.isRTL,\n\t imageSizes = _getEditorSettings.imageSizes;\n\n\treturn {\n\t\timage: id ? getMedia(id) : null,\n\t\tmaxWidth: maxWidth,\n\t\tisRTL: isRTL,\n\t\timageSizes: imageSizes\n\t};\n}), withViewportMatch({ isLargeViewport: 'medium' }), withNotices])(ImageEdit));\n\n/***/ }),\n/* 5 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return createUpgradedEmbedBlock; });\n/* unused harmony export isFromWordPress */\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar WORDPRESS_EMBED_BLOCK = 'core-embed/wordpress';\n\nvar _lodash = lodash,\n includes = _lodash.includes;\nvar renderToString = wp.element.renderToString;\nvar createBlock = wp.blocks.createBlock;\n\n/***\n * Creates a more suitable embed block based on the passed in props\n * and attributes generated from an embed block's preview.\n *\n * We require `attributesFromPreview` to be generated from the latest attributes\n * and preview, and because of the way the react lifecycle operates, we can't\n * guarantee that the attributes contained in the block's props are the latest\n * versions, so we require that these are generated separately.\n * See `getAttributesFromPreview` in the generated embed edit component.\n *\n * @param {Object} props The block's props.\n * @param {Object} attributesFromPreview Attributes generated from the block's most up to date preview.\n * @return {Object|undefined} A more suitable embed block if one exists.\n */\n\nvar createUpgradedEmbedBlock = function createUpgradedEmbedBlock(props, attributesFromPreview) {\n\tvar preview = props.preview,\n\t name = props.name;\n\tvar url = props.attributes.url;\n\n\n\tif (!url) {\n\t\treturn;\n\t}\n\n\tvar matchingBlock = findBlock(url);\n\n\t// WordPress blocks can work on multiple sites, and so don't have patterns,\n\t// so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.\n\tif (WORDPRESS_EMBED_BLOCK !== name && DEFAULT_EMBED_BLOCK !== matchingBlock) {\n\t\t// At this point, we have discovered a more suitable block for this url, so transform it.\n\t\tif (name !== matchingBlock) {\n\t\t\treturn createBlock(matchingBlock, { url: url });\n\t\t}\n\t}\n\n\tif (preview) {\n\t\tvar html = preview.html;\n\n\t\t// We can't match the URL for WordPress embeds, we have to check the HTML instead.\n\n\t\tif (isFromWordPress(html)) {\n\t\t\t// If this is not the WordPress embed block, transform it into one.\n\t\t\tif (WORDPRESS_EMBED_BLOCK !== name) {\n\t\t\t\treturn createBlock(WORDPRESS_EMBED_BLOCK, _extends({\n\t\t\t\t\turl: url\n\t\t\t\t}, attributesFromPreview));\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar isFromWordPress = function isFromWordPress(html) {\n\treturn includes(html, 'class=\"wp-embedded-content\" data-secret');\n};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _lodash = lodash,\n noop = _lodash.noop;\nvar withGlobalEvents = wp.compose.withGlobalEvents;\nvar Component = wp.element.Component;\n\nvar ImageSize = function (_Component) {\n\t_inherits(ImageSize, _Component);\n\n\tfunction ImageSize() {\n\t\t_classCallCheck(this, ImageSize);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ImageSize.__proto__ || Object.getPrototypeOf(ImageSize)).apply(this, arguments));\n\n\t\t_this.state = {\n\t\t\twidth: undefined,\n\t\t\theight: undefined\n\t\t};\n\t\t_this.bindContainer = _this.bindContainer.bind(_this);\n\t\t_this.calculateSize = _this.calculateSize.bind(_this);\n\t\treturn _this;\n\t}\n\n\t_createClass(ImageSize, [{\n\t\tkey: 'bindContainer',\n\t\tvalue: function bindContainer(ref) {\n\t\t\tthis.container = ref;\n\t\t}\n\t}, {\n\t\tkey: 'componentDidUpdate',\n\t\tvalue: function componentDidUpdate(prevProps) {\n\t\t\tif (this.props.src !== prevProps.src) {\n\t\t\t\tthis.setState({\n\t\t\t\t\twidth: undefined,\n\t\t\t\t\theight: undefined\n\t\t\t\t});\n\t\t\t\tthis.fetchImageSize();\n\t\t\t}\n\n\t\t\tif (this.props.dirtynessTrigger !== prevProps.dirtynessTrigger) {\n\t\t\t\tthis.calculateSize();\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'componentDidMount',\n\t\tvalue: function componentDidMount() {\n\t\t\tthis.fetchImageSize();\n\t\t}\n\t}, {\n\t\tkey: 'componentWillUnmount',\n\t\tvalue: function componentWillUnmount() {\n\t\t\tif (this.image) {\n\t\t\t\tthis.image.onload = noop;\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'fetchImageSize',\n\t\tvalue: function fetchImageSize() {\n\t\t\tthis.image = new window.Image();\n\t\t\tthis.image.onload = this.calculateSize;\n\t\t\tthis.image.src = this.props.src;\n\t\t}\n\t}, {\n\t\tkey: 'calculateSize',\n\t\tvalue: function calculateSize() {\n\t\t\tvar maxWidth = this.container.clientWidth;\n\t\t\tvar exceedMaxWidth = this.image.width > maxWidth;\n\t\t\tvar ratio = this.image.height / this.image.width;\n\t\t\tvar width = exceedMaxWidth ? maxWidth : this.image.width;\n\t\t\tvar height = exceedMaxWidth ? maxWidth * ratio : this.image.height;\n\t\t\tthis.setState({ width: width, height: height });\n\t\t}\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar sizes = {\n\t\t\t\timageWidth: this.image && this.image.width,\n\t\t\t\timageHeight: this.image && this.image.height,\n\t\t\t\tcontainerWidth: this.container && this.container.clientWidth,\n\t\t\t\tcontainerHeight: this.container && this.container.clientHeight,\n\t\t\t\timageWidthWithinContainer: this.state.width,\n\t\t\t\timageHeightWithinContainer: this.state.height\n\t\t\t};\n\t\t\treturn wp.element.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ ref: this.bindContainer },\n\t\t\t\tthis.props.children(sizes)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn ImageSize;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withGlobalEvents({\n\tresize: 'calculateSize'\n})(ImageSize));\n\n/***/ }),\n/* 7 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nvar __ = wp.i18n.__;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar _wp$components = wp.components,\n Spinner = _wp$components.Spinner,\n withSpokenMessages = _wp$components.withSpokenMessages,\n Popover = _wp$components.Popover,\n TextControl = _wp$components.TextControl;\nvar withInstanceId = wp.compose.withInstanceId;\n\nvar ThirstyURLInput = function (_Component) {\n\t_inherits(ThirstyURLInput, _Component);\n\n\t/**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tfunction ThirstyURLInput(_ref) {\n\t\tvar autocompleteRef = _ref.autocompleteRef;\n\n\t\t_classCallCheck(this, ThirstyURLInput);\n\n\t\t// this.onChange = this.onChange.bind( this );\n\t\t// this.onKeyDown = this.onKeyDown.bind( this );\n\t\tvar _this = _possibleConstructorReturn(this, (ThirstyURLInput.__proto__ || Object.getPrototypeOf(ThirstyURLInput)).apply(this, arguments));\n\n\t\t_this.autocompleteRef = autocompleteRef || createRef();\n\t\t_this.inputRef = createRef();\n\t\t_this.searchAffiliateLinks = _this.searchAffiliateLinks.bind(_this);\n\t\t// this.updateSuggestions = throttle( this.updateSuggestions.bind( this ), 200 );\n\n\t\t_this.suggestionNodes = [];\n\n\t\t_this.state = {\n\t\t\tposts: [],\n\t\t\tshowSuggestions: false,\n\t\t\tselectedSuggestion: null,\n\t\t\tloading: false\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Component did update method.\n * \n * @since 3.6\n */\n\n\n\t_createClass(ThirstyURLInput, [{\n\t\tkey: \"componentDidUpdate\",\n\t\tvalue: function componentDidUpdate() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar _state = this.state,\n\t\t\t showSuggestions = _state.showSuggestions,\n\t\t\t selectedSuggestion = _state.selectedSuggestion;\n\t\t\t// only have to worry about scrolling selected suggestion into view\n\t\t\t// when already expanded\n\n\t\t\tif (showSuggestions && selectedSuggestion !== null && !this.scrollingIntoView) {\n\t\t\t\tthis.scrollingIntoView = true;\n\t\t\t\tscrollIntoView(this.suggestionNodes[selectedSuggestion], this.autocompleteRef.current, {\n\t\t\t\t\tonlyScrollIfNeeded: true\n\t\t\t\t});\n\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t_this2.scrollingIntoView = false;\n\t\t\t\t}, 100);\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Component unmount method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: \"componentWillUnmount\",\n\t\tvalue: function componentWillUnmount() {\n\t\t\tdelete this.suggestionsRequest;\n\t\t}\n\n\t\t/**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\n\t}, {\n\t\tkey: \"bindSuggestionNode\",\n\t\tvalue: function bindSuggestionNode(index) {\n\t\t\tvar _this3 = this;\n\n\t\t\treturn function (ref) {\n\t\t\t\t_this3.suggestionNodes[index] = ref;\n\t\t\t};\n\t\t}\n\t}, {\n\t\tkey: \"searchAffiliateLinks\",\n\t\tvalue: function searchAffiliateLinks(value) {\n\t\t\tvar _this4 = this;\n\n\t\t\t// Show the suggestions after typing at least 2 characters=\n\t\t\tif (value.length < 2) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tshowSuggestions: false,\n\t\t\t\t\tselectedSuggestion: null,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tshowSuggestions: true,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: true\n\t\t\t});\n\n\t\t\tvar formData = new FormData();\n\t\t\tformData.append(\"action\", \"search_affiliate_links_query\");\n\t\t\tformData.append(\"keyword\", value);\n\t\t\tformData.append(\"paged\", 1);\n\t\t\tformData.append(\"gutenberg\", true);\n\t\t\tformData.append(\"with_images\", true);\n\n\t\t\t// We are getting data via the WP AJAX instead of rest API as it is not possible yet\n\t\t\t// to filter results with category value. This is to prepare next update to add category filter.\n\t\t\tvar request = fetch(ajaxurl, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: formData\n\t\t\t});\n\n\t\t\trequest.then(function (response) {\n\t\t\t\treturn response.json();\n\t\t\t}).then(function (response) {\n\n\t\t\t\tif (!response.affiliate_links) return;\n\n\t\t\t\tvar posts = response.affiliate_links;\n\n\t\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\t\tif (_this4.suggestionsRequest !== request) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t_this4.setState({\n\t\t\t\t\tposts: posts,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\tif (!!posts.length) {\n\t\t\t\t\t_this4.props.debouncedSpeak(sprintf(_n('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', posts.length), posts.length), 'assertive');\n\t\t\t\t} else {\n\t\t\t\t\t_this4.props.debouncedSpeak(__('No results.'), 'assertive');\n\t\t\t\t}\n\t\t\t}).catch(function () {\n\t\t\t\tif (_this4.suggestionsRequest === request) {\n\t\t\t\t\t_this4.setState({\n\t\t\t\t\t\tloading: false\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.suggestionsRequest = request;\n\t\t}\n\n\t\t/**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: \"selectLink\",\n\t\tvalue: function selectLink(post) {\n\t\t\t// this.props.onChange( post.link, post );\n\t\t\tthis.setState({\n\t\t\t\tselectedSuggestion: post,\n\t\t\t\tshowSuggestions: false\n\t\t\t});\n\n\t\t\tthis.props.updateImageSelection(post.images, post);\n\t\t}\n\n\t\t/**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: \"handleOnClick\",\n\t\tvalue: function handleOnClick(post) {\n\t\t\tthis.selectLink(post);\n\t\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\t\t// this.inputRef.current.focus();\n\t\t}\n\t}, {\n\t\tkey: \"render\",\n\t\tvalue: function render() {\n\t\t\tvar _this5 = this;\n\n\t\t\tvar _props = this.props,\n\t\t\t _props$value = _props.value,\n\t\t\t value = _props$value === undefined ? '' : _props$value,\n\t\t\t _props$autoFocus = _props.autoFocus,\n\t\t\t autoFocus = _props$autoFocus === undefined ? true : _props$autoFocus,\n\t\t\t instanceId = _props.instanceId;\n\t\t\tvar _state2 = this.state,\n\t\t\t showSuggestions = _state2.showSuggestions,\n\t\t\t posts = _state2.posts,\n\t\t\t selectedSuggestion = _state2.selectedSuggestion,\n\t\t\t loading = _state2.loading;\n\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\t\"div\",\n\t\t\t\t{ \"class\": \"edit-search-affiliate-links\" },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t\"form\",\n\t\t\t\t\t{\n\t\t\t\t\t\tclassName: \"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover\",\n\t\t\t\t\t\tonSubmit: this.displayAffiliateImages\n\t\t\t\t\t},\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\tclassName: \"ta-search-affiliate-links\",\n\t\t\t\t\t\tplaceholder: __(\"Type to search affiliate links\"),\n\t\t\t\t\t\tonChange: this.searchAffiliateLinks,\n\t\t\t\t\t\tautocomplete: \"off\"\n\t\t\t\t\t}),\n\t\t\t\t\tloading && wp.element.createElement(Spinner, null),\n\t\t\t\t\tshowSuggestions && !!posts.length && wp.element.createElement(\n\t\t\t\t\t\tPopover,\n\t\t\t\t\t\t{ position: \"bottom\", focusOnMount: false },\n\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t{ \"class\": \"affilate-links-suggestions\" },\n\t\t\t\t\t\t\tposts.map(function (post, index) {\n\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\t\"button\",\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tkey: post.id,\n\t\t\t\t\t\t\t\t\t\trole: \"option\",\n\t\t\t\t\t\t\t\t\t\ttabIndex: \"-1\",\n\t\t\t\t\t\t\t\t\t\tid: \"editor-url-input-suggestion-\" + instanceId + \"-\" + index,\n\t\t\t\t\t\t\t\t\t\tref: _this5.bindSuggestionNode(index),\n\t\t\t\t\t\t\t\t\t\tclassName: __WEBPACK_IMPORTED_MODULE_0_classnames___default()('editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\t\treturn _this5.handleOnClick(post);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"aria-selected\": index === selectedSuggestion\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tpost.title || __('(no title)')\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn ThirstyURLInput;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withSpokenMessages(withInstanceId(ThirstyURLInput)));\n\n/***/ }),\n/* 8 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = registerFormats;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ta_link__ = __webpack_require__(9);\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\n\n\nvar registerFormatType = wp.richText.registerFormatType;\n\n/**\n * Register custom formats.\n * \n * @since 3.6\n */\n\nfunction registerFormats() {\n\n [__WEBPACK_IMPORTED_MODULE_0__ta_link__[\"a\" /* taLink */]].forEach(function (_ref) {\n var name = _ref.name,\n settings = _objectWithoutProperties(_ref, [\"name\"]);\n\n return registerFormatType(name, settings);\n });\n}\n\n/***/ }),\n/* 9 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return taLink; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__inline__ = __webpack_require__(10);\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nvar __ = wp.i18n.__;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n Fragment = _wp$element.Fragment;\nvar withSpokenMessages = wp.components.withSpokenMessages;\nvar _wp$richText = wp.richText,\n getTextContent = _wp$richText.getTextContent,\n applyFormat = _wp$richText.applyFormat,\n removeFormat = _wp$richText.removeFormat,\n slice = _wp$richText.slice;\nvar isURL = wp.url.isURL;\nvar _wp$editor = wp.editor,\n RichTextToolbarButton = _wp$editor.RichTextToolbarButton,\n RichTextShortcut = _wp$editor.RichTextShortcut;\nvar _wp$components = wp.components,\n Path = _wp$components.Path,\n SVG = _wp$components.SVG;\nvar getRectangleFromRange = wp.dom.getRectangleFromRange;\n\n\nvar name = \"ta/link\";\n\n/**\n * Custom Affiliate link format. When applied will wrap selected text with <ta href=\"\" linkid=\"\"></ta> custom element.\n * Custom element is implemented here as we are not allowed to use <a> tag due to Gutenberg limitations.\n * Element is converted to normal <a> tag on frontend via PHP script filtered on 'the_content'.\n * \n * @since 3.6\n */\nvar taLink = {\n\tname: name,\n\ttitle: __(\"Affiliate Link\"),\n\ttagName: \"ta\",\n\tclassName: null,\n\tattributes: {\n\t\turl: \"href\",\n\t\ttarget: \"target\"\n\t},\n\tedit: withSpokenMessages(function (_Component) {\n\t\t_inherits(LinkEdit, _Component);\n\n\t\t/**\n * Component constructor.\n * \n * @since 3.6\n */\n\t\tfunction LinkEdit() {\n\t\t\t_classCallCheck(this, LinkEdit);\n\n\t\t\tvar _this = _possibleConstructorReturn(this, (LinkEdit.__proto__ || Object.getPrototypeOf(LinkEdit)).apply(this, arguments));\n\n\t\t\t_this.addLink = _this.addLink.bind(_this);\n\t\t\t_this.stopAddingLink = _this.stopAddingLink.bind(_this);\n\t\t\t_this.onRemoveFormat = _this.onRemoveFormat.bind(_this);\n\t\t\t_this.state = {\n\t\t\t\taddingLink: false\n\t\t\t};\n\t\t\treturn _this;\n\t\t}\n\n\t\t/**\n * Callback to set state to adding link status.\n * \n * @since 3.6\n */\n\n\n\t\t_createClass(LinkEdit, [{\n\t\t\tkey: \"addLink\",\n\t\t\tvalue: function addLink() {\n\t\t\t\tvar _props = this.props,\n\t\t\t\t value = _props.value,\n\t\t\t\t onChange = _props.onChange;\n\n\t\t\t\tvar text = getTextContent(slice(value));\n\n\t\t\t\tif (text && isURL(text)) {\n\t\t\t\t\tonChange(applyFormat(value, { type: name, attributes: { url: text } }));\n\t\t\t\t} else {\n\t\t\t\t\tthis.setState({ addingLink: true });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n * Callback to set state to stop adding link status.\n * \n * @since 3.6\n */\n\n\t\t}, {\n\t\t\tkey: \"stopAddingLink\",\n\t\t\tvalue: function stopAddingLink() {\n\t\t\t\tthis.setState({ addingLink: false });\n\t\t\t}\n\n\t\t\t/**\n * Remove format event callback.\n * \n * @since 3.6\n */\n\n\t\t}, {\n\t\t\tkey: \"onRemoveFormat\",\n\t\t\tvalue: function onRemoveFormat() {\n\t\t\t\tvar _props2 = this.props,\n\t\t\t\t value = _props2.value,\n\t\t\t\t onChange = _props2.onChange,\n\t\t\t\t speak = _props2.speak;\n\n\n\t\t\t\tonChange(removeFormat(value, name));\n\t\t\t\tspeak(__(\"Affiliate Link removed.\"), \"assertive\");\n\t\t\t}\n\n\t\t\t/**\n * Get selected anchor text.\n * \n * @since 3.9\n */\n\n\t\t}, {\n\t\t\tkey: \"getAnchorRect\",\n\t\t\tvalue: function getAnchorRect() {\n\n\t\t\t\tvar selection = window.getSelection();\n\t\t\t\tvar range = selection.rangeCount > 0 ? selection.getRangeAt(0) : null;\n\n\t\t\t\tif (!range) return;\n\n\t\t\t\tvar rect = null;\n\n\t\t\t\tif (this.state.addingLink) {\n\t\t\t\t\trect = getRectangleFromRange(range);\n\t\t\t\t} else {\n\n\t\t\t\t\tvar element = range.startContainer;\n\n\t\t\t\t\t// If the caret is right before the element, select the next element.\n\t\t\t\t\telement = element.nextElementSibling || element;\n\n\t\t\t\t\twhile (element.nodeType !== window.Node.ELEMENT_NODE) {\n\t\t\t\t\t\telement = element.parentNode;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar closest = element.closest('ta');\n\t\t\t\t\tif (closest) {\n\t\t\t\t\t\trect = closest.getBoundingClientRect();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn rect;\n\t\t\t}\n\n\t\t\t/**\n * Component render method.\n * \n * @since 3.6\n */\n\n\t\t}, {\n\t\t\tkey: \"render\",\n\t\t\tvalue: function render() {\n\t\t\t\tvar _props3 = this.props,\n\t\t\t\t isActive = _props3.isActive,\n\t\t\t\t activeAttributes = _props3.activeAttributes,\n\t\t\t\t value = _props3.value,\n\t\t\t\t onChange = _props3.onChange;\n\n\n\t\t\t\tvar anchorRect = this.getAnchorRect();\n\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\tFragment,\n\t\t\t\t\tnull,\n\t\t\t\t\twp.element.createElement(RichTextShortcut, {\n\t\t\t\t\t\ttype: \"access\",\n\t\t\t\t\t\tcharacter: \"s\",\n\t\t\t\t\t\tonUse: this.onRemoveFormat\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(RichTextShortcut, {\n\t\t\t\t\t\ttype: \"primary\",\n\t\t\t\t\t\tcharacter: \"l\",\n\t\t\t\t\t\tonUse: this.addLink\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(RichTextShortcut, {\n\t\t\t\t\t\ttype: \"primaryShift\",\n\t\t\t\t\t\tcharacter: \"l\",\n\t\t\t\t\t\tonUse: this.onRemoveFormat\n\t\t\t\t\t}),\n\t\t\t\t\tisActive && wp.element.createElement(RichTextToolbarButton, {\n\t\t\t\t\t\ticon: \"editor-unlink\",\n\t\t\t\t\t\ttitle: __('Remove Affiliate Link'),\n\t\t\t\t\t\tclassName: \"ta-unlink-button\",\n\t\t\t\t\t\tonClick: this.onRemoveFormat,\n\t\t\t\t\t\tisActive: isActive,\n\t\t\t\t\t\tshortcutType: \"primaryShift\",\n\t\t\t\t\t\tshortcutCharacter: \"l\"\n\t\t\t\t\t}),\n\t\t\t\t\t!isActive && wp.element.createElement(RichTextToolbarButton, {\n\t\t\t\t\t\ticon: wp.element.createElement(\n\t\t\t\t\t\t\tSVG,\n\t\t\t\t\t\t\t{ xmlns: \"http://www.w3.org/2000/svg\", width: \"16.688\", height: \"9.875\", viewBox: \"0 0 16.688 9.875\" },\n\t\t\t\t\t\t\twp.element.createElement(Path, { id: \"TA.svg\", fill: \"black\", \"class\": \"cls-1\", d: \"M2.115,15.12H4.847L6.836,7.7H9.777l0.63-2.381H1.821L1.177,7.7H4.118Zm4.758,0H9.829l1.177-1.751h3.782l0.238,1.751h2.858L16.357,5.245H13.7Zm5.5-3.866,1.835-2.816,0.35,2.816H12.378Z\", transform: \"translate(-1.188 -5.25)\" })\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttitle: __('Affiliate Link'),\n\t\t\t\t\t\tclassName: \"ta-link-button\",\n\t\t\t\t\t\tonClick: this.addLink,\n\t\t\t\t\t\tshortcutType: \"primary\",\n\t\t\t\t\t\tshortcutCharacter: \"l\"\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(__WEBPACK_IMPORTED_MODULE_0__inline__[\"a\" /* default */], {\n\t\t\t\t\t\taddingLink: this.state.addingLink,\n\t\t\t\t\t\tstopAddingLink: this.stopAddingLink,\n\t\t\t\t\t\tisActive: isActive,\n\t\t\t\t\t\tactiveAttributes: activeAttributes,\n\t\t\t\t\t\tanchorRect: anchorRect,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tonChange: onChange\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t}]);\n\n\t\treturn LinkEdit;\n\t}(Component))\n};\n\n/***/ }),\n/* 10 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(11);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__url_popover__ = __webpack_require__(12);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__url_input__ = __webpack_require__(13);\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\n\n\n\nvar __ = wp.i18n.__;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar _wp$components = wp.components,\n ExternalLink = _wp$components.ExternalLink,\n ToggleControl = _wp$components.ToggleControl,\n IconButton = _wp$components.IconButton,\n withSpokenMessages = _wp$components.withSpokenMessages;\nvar _wp$keycodes = wp.keycodes,\n LEFT = _wp$keycodes.LEFT,\n RIGHT = _wp$keycodes.RIGHT,\n UP = _wp$keycodes.UP,\n DOWN = _wp$keycodes.DOWN,\n BACKSPACE = _wp$keycodes.BACKSPACE,\n ENTER = _wp$keycodes.ENTER;\nvar _wp$url = wp.url,\n prependHTTP = _wp$url.prependHTTP,\n safeDecodeURI = _wp$url.safeDecodeURI,\n filterURLForDisplay = _wp$url.filterURLForDisplay;\nvar _wp$richText = wp.richText,\n create = _wp$richText.create,\n insert = _wp$richText.insert,\n isCollapsed = _wp$richText.isCollapsed,\n applyFormat = _wp$richText.applyFormat,\n getTextContent = _wp$richText.getTextContent,\n slice = _wp$richText.slice;\n\n\nvar stopKeyPropagation = function stopKeyPropagation(event) {\n\treturn event.stopPropagation();\n};\n\n/**\n * Generates the format object that will be applied to the link text.\n * \n * @since 3.6\n *\n * @param {string} url The href of the link.\n * @param {boolean} linkid Affiliate link ID.\n * @param {Object} text The text that is being hyperlinked.\n *\n * @return {Object} The final format object.\n */\nfunction createLinkFormat(_ref) {\n\tvar url = _ref.url,\n\t linkid = _ref.linkid,\n\t text = _ref.text;\n\n\tvar format = {\n\t\ttype: \"ta/link\",\n\t\tattributes: {\n\t\t\turl: url,\n\t\t\tlinkid: linkid.toString()\n\t\t}\n\t};\n\n\treturn format;\n}\n\n/**\n * Check if input is being show.\n * \n * @since 3.6\n * \n * @param {Object} props Component props.\n * @param {Object} state Component state.\n */\nfunction isShowingInput(props, state) {\n\treturn props.addingLink || state.editLink;\n}\n\n/**\n * Affiliate Link editor JSX element.\n * \n * @since 3.6\n * \n * @param {Object} param0 Component props (destructred).\n */\nvar LinkEditor = function LinkEditor(_ref2) {\n\tvar value = _ref2.value,\n\t onChangeInputValue = _ref2.onChangeInputValue,\n\t onKeyDown = _ref2.onKeyDown,\n\t submitLink = _ref2.submitLink,\n\t invalidLink = _ref2.invalidLink,\n\t resetInvalidLink = _ref2.resetInvalidLink,\n\t autocompleteRef = _ref2.autocompleteRef;\n\treturn (\n\t\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t\twp.element.createElement(\n\t\t\t'form',\n\t\t\t{\n\t\t\t\tclassName: 'editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover',\n\t\t\t\tonKeyPress: stopKeyPropagation,\n\t\t\t\tonKeyDown: onKeyDown,\n\t\t\t\tonSubmit: submitLink\n\t\t\t},\n\t\t\twp.element.createElement(__WEBPACK_IMPORTED_MODULE_3__url_input__[\"a\" /* default */], {\n\t\t\t\tvalue: value,\n\t\t\t\tonChange: onChangeInputValue,\n\t\t\t\tautocompleteRef: autocompleteRef,\n\t\t\t\tinvalidLink: invalidLink,\n\t\t\t\tresetInvalidLink: resetInvalidLink\n\t\t\t}),\n\t\t\twp.element.createElement(IconButton, { icon: 'editor-break', label: __('Apply'), type: 'submit' })\n\t\t)\n\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n\n\t);\n};\n\n/**\n * Affiliate link url viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nvar LinkViewerUrl = function LinkViewerUrl(_ref3) {\n\tvar url = _ref3.url;\n\n\tvar prependedURL = prependHTTP(url);\n\tvar linkClassName = __WEBPACK_IMPORTED_MODULE_0_classnames___default()('editor-format-toolbar__link-container-value block-editor-format-toolbar__link-container-value', {\n\t\t'has-invalid-link': !Object(__WEBPACK_IMPORTED_MODULE_1__utils__[\"a\" /* isValidHref */])(prependedURL)\n\t});\n\n\tif (!url) {\n\t\treturn wp.element.createElement('span', { className: linkClassName });\n\t}\n\n\treturn wp.element.createElement(\n\t\tExternalLink,\n\t\t{\n\t\t\tclassName: linkClassName,\n\t\t\thref: url\n\t\t},\n\t\tfilterURLForDisplay(safeDecodeURI(url))\n\t);\n};\n\n/**\n * Affiliate link viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nvar LinkViewer = function LinkViewer(_ref4) {\n\tvar url = _ref4.url,\n\t editLink = _ref4.editLink;\n\n\treturn (\n\t\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\t\twp.element.createElement(\n\t\t\t'div',\n\t\t\t{\n\t\t\t\tclassName: 'editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content',\n\t\t\t\tonKeyPress: stopKeyPropagation\n\t\t\t},\n\t\t\twp.element.createElement(LinkViewerUrl, { url: url }),\n\t\t\twp.element.createElement(IconButton, { icon: 'edit', label: __('Edit'), onClick: editLink })\n\t\t)\n\t\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n\n\t);\n};\n\n/**\n * Inline affiliate link UI Component.\n * \n * @since 3.6\n * \n * @param {*} param0 Component props (destructred).\n */\n\nvar InlineAffiliateLinkUI = function (_Component) {\n\t_inherits(InlineAffiliateLinkUI, _Component);\n\n\tfunction InlineAffiliateLinkUI() {\n\t\t_classCallCheck(this, InlineAffiliateLinkUI);\n\n\t\tvar _this = _possibleConstructorReturn(this, (InlineAffiliateLinkUI.__proto__ || Object.getPrototypeOf(InlineAffiliateLinkUI)).apply(this, arguments));\n\n\t\t_this.editLink = _this.editLink.bind(_this);\n\t\t_this.submitLink = _this.submitLink.bind(_this);\n\t\t_this.onKeyDown = _this.onKeyDown.bind(_this);\n\t\t_this.onChangeInputValue = _this.onChangeInputValue.bind(_this);\n\t\t_this.onClickOutside = _this.onClickOutside.bind(_this);\n\t\t_this.resetState = _this.resetState.bind(_this);\n\t\t_this.autocompleteRef = createRef();\n\t\t_this.resetInvalidLink = _this.resetInvalidLink.bind(_this);\n\n\t\t_this.state = {\n\t\t\tinputValue: '',\n\t\t\tlinkid: 0,\n\t\t\tpost: null,\n\t\t\tinvalidLink: false\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Stop the key event from propagating up to ObserveTyping.startTypingInTextField.\n * \n * @since 3.6\n * \n * @param {Object} event Event object.\n */\n\n\n\t_createClass(InlineAffiliateLinkUI, [{\n\t\tkey: 'onKeyDown',\n\t\tvalue: function onKeyDown(event) {\n\t\t\tif ([LEFT, DOWN, RIGHT, UP, BACKSPACE, ENTER].indexOf(event.keyCode) > -1) {\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Callback to set state when input value is changed.\n * \n * @since 3.6\n * \n * @param {*} inputValue \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: 'onChangeInputValue',\n\t\tvalue: function onChangeInputValue(inputValue) {\n\t\t\tvar post = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n\t\t\tvar linkid = post ? post.id : 0;\n\t\t\tthis.setState({ inputValue: inputValue, linkid: linkid, post: post });\n\t\t}\n\n\t\t/**\n * Callback to set state when edit affiliate link (already inserted) is triggered.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'editLink',\n\t\tvalue: function editLink(event) {\n\t\t\tthis.setState({ editLink: true });\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t/**\n * Callback to apply the affiliate link format to the selected text or position in the active block.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'submitLink',\n\t\tvalue: function submitLink(event) {\n\t\t\tvar _props = this.props,\n\t\t\t isActive = _props.isActive,\n\t\t\t value = _props.value,\n\t\t\t onChange = _props.onChange,\n\t\t\t speak = _props.speak;\n\t\t\tvar _state = this.state,\n\t\t\t inputValue = _state.inputValue,\n\t\t\t linkid = _state.linkid,\n\t\t\t post = _state.post;\n\n\t\t\tvar url = prependHTTP(inputValue);\n\t\t\tvar selectedText = getTextContent(slice(value));\n\t\t\tvar format = createLinkFormat({\n\t\t\t\turl: url,\n\t\t\t\tlinkid: linkid,\n\t\t\t\ttext: selectedText\n\t\t\t});\n\n\t\t\tevent.preventDefault();\n\n\t\t\tif (!linkid || !post) {\n\t\t\t\tthis.setState({ invalidLink: true });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isCollapsed(value) && !isActive) {\n\t\t\t\tvar toInsert = applyFormat(create({ text: post.title }), format, 0, url.length);\n\t\t\t\tonChange(insert(value, toInsert));\n\t\t\t} else {\n\t\t\t\tonChange(applyFormat(value, format));\n\t\t\t}\n\n\t\t\tthis.resetState();\n\n\t\t\tif (!Object(__WEBPACK_IMPORTED_MODULE_1__utils__[\"a\" /* isValidHref */])(url)) {\n\t\t\t\tspeak(__('Warning: the link has been inserted but may have errors. Please test it.'), 'assertive');\n\t\t\t} else if (isActive) {\n\t\t\t\tspeak(__('Link edited.'), 'assertive');\n\t\t\t} else {\n\t\t\t\tspeak(__('Link inserted'), 'assertive');\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Callback to run when users clicks outside the popover UI.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'onClickOutside',\n\t\tvalue: function onClickOutside(event) {\n\t\t\t// The autocomplete suggestions list renders in a separate popover (in a portal),\n\t\t\t// so onClickOutside fails to detect that a click on a suggestion occured in the\n\t\t\t// LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and\n\t\t\t// return to avoid the popover being closed.\n\t\t\tvar autocompleteElement = this.autocompleteRef.current;\n\t\t\tif (autocompleteElement && autocompleteElement.contains(event.target)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.resetState();\n\t\t}\n\n\t\t/**\n * Reset state callback.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'resetState',\n\t\tvalue: function resetState() {\n\t\t\tthis.props.stopAddingLink();\n\t\t\tthis.setState({ inputValue: '', editLink: false });\n\t\t\tthis.resetInvalidLink();\n\t\t}\n\n\t\t/**\n * Reset invalid link state callback. Separated as we need to run this independently from resetState() callback.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'resetInvalidLink',\n\t\tvalue: function resetInvalidLink() {\n\t\t\tthis.setState({ invalidLink: false });\n\t\t}\n\n\t\t/**\n * Component render method.\n *\n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _props2 = this.props,\n\t\t\t isActive = _props2.isActive,\n\t\t\t _props2$activeAttribu = _props2.activeAttributes,\n\t\t\t url = _props2$activeAttribu.url,\n\t\t\t linkid = _props2$activeAttribu.linkid,\n\t\t\t addingLink = _props2.addingLink,\n\t\t\t anchorRect = _props2.anchorRect,\n\t\t\t value = _props2.value,\n\t\t\t onChange = _props2.onChange;\n\n\n\t\t\tif (!isActive && !addingLink) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar _state2 = this.state,\n\t\t\t inputValue = _state2.inputValue,\n\t\t\t invalidLink = _state2.invalidLink;\n\n\t\t\tvar showInput = isShowingInput(this.props, this.state);\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\t__WEBPACK_IMPORTED_MODULE_2__url_popover__[\"a\" /* default */],\n\t\t\t\t{\n\t\t\t\t\tonClickOutside: this.onClickOutside,\n\t\t\t\t\tonClose: this.resetState,\n\t\t\t\t\tfocusOnMount: showInput ? 'firstElement' : false,\n\t\t\t\t\tinvalidLink: invalidLink,\n\t\t\t\t\tanchorRect: anchorRect\n\t\t\t\t},\n\t\t\t\tshowInput ? wp.element.createElement(LinkEditor, {\n\t\t\t\t\tvalue: inputValue,\n\t\t\t\t\tonChangeInputValue: this.onChangeInputValue,\n\t\t\t\t\tonKeyDown: this.onKeyDown,\n\t\t\t\t\tsubmitLink: this.submitLink,\n\t\t\t\t\tautocompleteRef: this.autocompleteRef,\n\t\t\t\t\tupdateLinkId: this.updateLinkId,\n\t\t\t\t\tinvalidLink: invalidLink,\n\t\t\t\t\tresetInvalidLink: this.resetInvalidLink\n\t\t\t\t}) : wp.element.createElement(LinkViewer, {\n\t\t\t\t\turl: url,\n\t\t\t\t\teditLink: this.editLink\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn InlineAffiliateLinkUI;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withSpokenMessages(InlineAffiliateLinkUI));\n\n/***/ }),\n/* 11 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = isValidHref;\nvar _lodash = lodash,\n startsWith = _lodash.startsWith;\nvar _wp$url = wp.url,\n getProtocol = _wp$url.getProtocol,\n isValidProtocol = _wp$url.isValidProtocol,\n getAuthority = _wp$url.getAuthority,\n isValidAuthority = _wp$url.isValidAuthority,\n getPath = _wp$url.getPath,\n isValidPath = _wp$url.isValidPath,\n getQueryString = _wp$url.getQueryString,\n isValidQueryString = _wp$url.isValidQueryString,\n getFragment = _wp$url.getFragment,\n isValidFragment = _wp$url.isValidFragment;\n\n/**\n * Check for issues with the provided href.\n * \n * @since 3.6\n *\n * @param {string} href The href.\n * @return {boolean} Is the href invalid?\n */\n\nfunction isValidHref(href) {\n\tif (!href) {\n\t\treturn false;\n\t}\n\n\tvar trimmedHref = href.trim();\n\n\tif (!trimmedHref) {\n\t\treturn false;\n\t}\n\n\t// Does the href start with something that looks like a URL protocol?\n\tif (/^\\S+:/.test(trimmedHref)) {\n\t\tvar protocol = getProtocol(trimmedHref);\n\t\tif (!isValidProtocol(protocol)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Add some extra checks for http(s) URIs, since these are the most common use-case.\n\t\t// This ensures URIs with an http protocol have exactly two forward slashes following the protocol.\n\t\tif (startsWith(protocol, 'http') && !/^https?:\\/\\/[^\\/\\s]/i.test(trimmedHref)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar authority = getAuthority(trimmedHref);\n\t\tif (!isValidAuthority(authority)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar path = getPath(trimmedHref);\n\t\tif (path && !isValidPath(path)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar queryString = getQueryString(trimmedHref);\n\t\tif (queryString && !isValidQueryString(queryString)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar fragment = getFragment(trimmedHref);\n\t\tif (fragment && !isValidFragment(fragment)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Validate anchor links.\n\tif (startsWith(trimmedHref, '#') && !isValidFragment(trimmedHref)) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/***/ }),\n/* 12 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar __ = wp.i18n.__;\nvar Component = wp.element.Component;\nvar _wp$components = wp.components,\n Popover = _wp$components.Popover,\n IconButton = _wp$components.IconButton;\n\n/**\n * Custom URL Popover component.\n * \n * @since 3.6\n */\n\nvar ThirstyURLPopover = function (_Component) {\n\t_inherits(ThirstyURLPopover, _Component);\n\n\t/**\n * Component constructor method.\n * \n * @since 3.6\n */\n\tfunction ThirstyURLPopover() {\n\t\t_classCallCheck(this, ThirstyURLPopover);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ThirstyURLPopover.__proto__ || Object.getPrototypeOf(ThirstyURLPopover)).apply(this, arguments));\n\n\t\t_this.toggleSettingsVisibility = _this.toggleSettingsVisibility.bind(_this);\n\n\t\t_this.state = {\n\t\t\tisSettingsExpanded: false\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Component constructor.\n * \n * @since 3.6\n */\n\n\n\t_createClass(ThirstyURLPopover, [{\n\t\tkey: 'toggleSettingsVisibility',\n\t\tvalue: function toggleSettingsVisibility() {\n\t\t\tthis.setState({\n\t\t\t\tisSettingsExpanded: !this.state.isSettingsExpanded\n\t\t\t});\n\t\t}\n\n\t\t/**\n * Component render method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _props = this.props,\n\t\t\t children = _props.children,\n\t\t\t renderSettings = _props.renderSettings,\n\t\t\t invalidLink = _props.invalidLink,\n\t\t\t _props$position = _props.position,\n\t\t\t position = _props$position === undefined ? 'bottom center' : _props$position,\n\t\t\t _props$focusOnMount = _props.focusOnMount,\n\t\t\t focusOnMount = _props$focusOnMount === undefined ? 'firstElement' : _props$focusOnMount,\n\t\t\t popoverProps = _objectWithoutProperties(_props, ['children', 'renderSettings', 'invalidLink', 'position', 'focusOnMount']);\n\n\t\t\tvar isSettingsExpanded = this.state.isSettingsExpanded;\n\n\n\t\t\tvar showSettings = !!renderSettings && isSettingsExpanded;\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\tPopover,\n\t\t\t\t_extends({\n\t\t\t\t\tclassName: 'ta-url-popover editor-url-popover block-editor-url-popover',\n\t\t\t\t\tfocusOnMount: focusOnMount,\n\t\t\t\t\tposition: position\n\t\t\t\t}, popoverProps),\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'editor-url-popover__row' },\n\t\t\t\t\tchildren,\n\t\t\t\t\t!!renderSettings && wp.element.createElement(IconButton, {\n\t\t\t\t\t\tclassName: 'editor-url-popover__settings-toggle',\n\t\t\t\t\t\ticon: 'ellipsis',\n\t\t\t\t\t\tlabel: __('Link Settings'),\n\t\t\t\t\t\tonClick: this.toggleSettingsVisibility,\n\t\t\t\t\t\t'aria-expanded': isSettingsExpanded\n\t\t\t\t\t})\n\t\t\t\t),\n\t\t\t\tshowSettings && wp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'editor-url-popover__row editor-url-popover__settings' },\n\t\t\t\t\trenderSettings()\n\t\t\t\t),\n\t\t\t\tinvalidLink && wp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ 'class': 'ta-invalid-link' },\n\t\t\t\t\t__('Invalid affiliate link')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn ThirstyURLPopover;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (ThirstyURLPopover);\n\n/***/ }),\n/* 13 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view__ = __webpack_require__(14);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view__);\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\n\nvar __ = wp.i18n.__;\nvar _lodash = lodash,\n throttle = _lodash.throttle;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar _wp$keycodes = wp.keycodes,\n UP = _wp$keycodes.UP,\n DOWN = _wp$keycodes.DOWN,\n ENTER = _wp$keycodes.ENTER,\n TAB = _wp$keycodes.TAB;\nvar _wp$components = wp.components,\n Spinner = _wp$components.Spinner,\n withSpokenMessages = _wp$components.withSpokenMessages,\n Popover = _wp$components.Popover;\nvar withInstanceId = wp.compose.withInstanceId;\n\n// Since URLInput is rendered in the context of other inputs, but should be\n// considered a separate modal node, prevent keyboard events from propagating\n// as being considered from the input.\n\nvar stopEventPropagation = function stopEventPropagation(event) {\n\treturn event.stopPropagation();\n};\n\n/**\n * Custom URL Input component.\n * \n * @since 3.6\n */\n\nvar ThirstyURLInput = function (_Component) {\n\t_inherits(ThirstyURLInput, _Component);\n\n\t/**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tfunction ThirstyURLInput(_ref) {\n\t\tvar autocompleteRef = _ref.autocompleteRef;\n\n\t\t_classCallCheck(this, ThirstyURLInput);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ThirstyURLInput.__proto__ || Object.getPrototypeOf(ThirstyURLInput)).apply(this, arguments));\n\n\t\t_this.onChange = _this.onChange.bind(_this);\n\t\t_this.onKeyDown = _this.onKeyDown.bind(_this);\n\t\t_this.autocompleteRef = autocompleteRef || createRef();\n\t\t_this.inputRef = createRef();\n\t\t_this.updateSuggestions = throttle(_this.updateSuggestions.bind(_this), 200);\n\n\t\t_this.suggestionNodes = [];\n\n\t\t_this.state = {\n\t\t\tposts: [],\n\t\t\tshowSuggestions: false,\n\t\t\tselectedSuggestion: null\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Component did update method.\n * \n * @since 3.6\n */\n\n\n\t_createClass(ThirstyURLInput, [{\n\t\tkey: 'componentDidUpdate',\n\t\tvalue: function componentDidUpdate() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar _state = this.state,\n\t\t\t showSuggestions = _state.showSuggestions,\n\t\t\t selectedSuggestion = _state.selectedSuggestion;\n\t\t\t// only have to worry about scrolling selected suggestion into view\n\t\t\t// when already expanded\n\n\t\t\tif (showSuggestions && selectedSuggestion !== null && !this.scrollingIntoView) {\n\t\t\t\tthis.scrollingIntoView = true;\n\t\t\t\t__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view___default()(this.suggestionNodes[selectedSuggestion], this.autocompleteRef.current, {\n\t\t\t\t\tonlyScrollIfNeeded: true\n\t\t\t\t});\n\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t_this2.scrollingIntoView = false;\n\t\t\t\t}, 100);\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Component unmount method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'componentWillUnmount',\n\t\tvalue: function componentWillUnmount() {\n\t\t\tdelete this.suggestionsRequest;\n\t\t}\n\n\t\t/**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\n\t}, {\n\t\tkey: 'bindSuggestionNode',\n\t\tvalue: function bindSuggestionNode(index) {\n\t\t\tvar _this3 = this;\n\n\t\t\treturn function (ref) {\n\t\t\t\t_this3.suggestionNodes[index] = ref;\n\t\t\t};\n\t\t}\n\n\t\t/**\n * Callback to show suggestions based on value inputted on search field.\n * \n * @since 3.6\n * \n * @param {*} value \n */\n\n\t}, {\n\t\tkey: 'updateSuggestions',\n\t\tvalue: function updateSuggestions(value) {\n\t\t\tvar _this4 = this;\n\n\t\t\t// Show the suggestions after typing at least 2 characters\n\t\t\t// and also for URLs\n\t\t\tif (value.length < 2 || /^https?:/.test(value)) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tshowSuggestions: false,\n\t\t\t\t\tselectedSuggestion: null,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tshowSuggestions: true,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: true\n\t\t\t});\n\n\t\t\tvar formData = new FormData();\n\t\t\tformData.append(\"action\", \"search_affiliate_links_query\");\n\t\t\tformData.append(\"keyword\", value);\n\t\t\tformData.append(\"paged\", 1);\n\t\t\tformData.append(\"gutenberg\", true);\n\n\t\t\t// We are getting data via the WP AJAX instead of rest API as it is not possible yet\n\t\t\t// to filter results with category value. This is to prepare next update to add category filter.\n\t\t\tvar request = fetch(ajaxurl, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: formData\n\t\t\t});\n\n\t\t\trequest.then(function (response) {\n\t\t\t\treturn response.json();\n\t\t\t}).then(function (response) {\n\n\t\t\t\tif (!response.affiliate_links) return;\n\n\t\t\t\tvar posts = response.affiliate_links;\n\n\t\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\t\tif (_this4.suggestionsRequest !== request) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t_this4.setState({\n\t\t\t\t\tposts: posts,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\tif (!!posts.length) {\n\t\t\t\t\t_this4.props.debouncedSpeak(sprintf(_n('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', posts.length), posts.length), 'assertive');\n\t\t\t\t} else {\n\t\t\t\t\t_this4.props.debouncedSpeak(__('No results.'), 'assertive');\n\t\t\t\t}\n\t\t\t}).catch(function () {\n\t\t\t\tif (_this4.suggestionsRequest === request) {\n\t\t\t\t\t_this4.setState({\n\t\t\t\t\t\tloading: false\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.suggestionsRequest = request;\n\t\t}\n\n\t\t/**\n * Search input value change event callback method.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'onChange',\n\t\tvalue: function onChange(event) {\n\t\t\tthis.props.resetInvalidLink();\n\t\t\tvar inputValue = event.target.value;\n\t\t\tthis.props.onChange(inputValue);\n\t\t\tthis.updateSuggestions(inputValue);\n\t\t}\n\n\t\t/**\n * Keydown event callback. Handles selecting result via keyboard.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'onKeyDown',\n\t\tvalue: function onKeyDown(event) {\n\t\t\tvar _state2 = this.state,\n\t\t\t showSuggestions = _state2.showSuggestions,\n\t\t\t selectedSuggestion = _state2.selectedSuggestion,\n\t\t\t posts = _state2.posts,\n\t\t\t loading = _state2.loading;\n\t\t\t// If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n\t\t\t// We shouldn't preventDefault to allow block arrow keys navigation\n\n\t\t\tif (!showSuggestions || !posts.length || loading) {\n\t\t\t\t// In the Windows version of Firefox the up and down arrows don't move the caret\n\t\t\t\t// within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n\t\t\t\t// a form of focus trapping that is disruptive to the user experience. This disruption\n\t\t\t\t// only happens if the caret is not in the first or last position in the text input.\n\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n\t\t\t\tswitch (event.keyCode) {\n\t\t\t\t\t// When UP is pressed, if the caret is at the start of the text, move it to the 0\n\t\t\t\t\t// position.\n\t\t\t\t\tcase UP:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (0 !== event.target.selectionStart) {\n\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t\t\t// Set the input caret to position 0\n\t\t\t\t\t\t\t\tevent.target.setSelectionRange(0, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t// When DOWN is pressed, if the caret is not at the end of the text, move it to the\n\t\t\t\t\t// last position.\n\t\t\t\t\tcase DOWN:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (this.props.value.length !== event.target.selectionStart) {\n\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t\t\t// Set the input caret to the last position\n\t\t\t\t\t\t\t\tevent.target.setSelectionRange(this.props.value.length, this.props.value.length);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar post = this.state.posts[this.state.selectedSuggestion];\n\n\t\t\tswitch (event.keyCode) {\n\t\t\t\tcase UP:\n\t\t\t\t\t{\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tvar previousIndex = !selectedSuggestion ? posts.length - 1 : selectedSuggestion - 1;\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\tselectedSuggestion: previousIndex\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase DOWN:\n\t\t\t\t\t{\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tvar nextIndex = selectedSuggestion === null || selectedSuggestion === posts.length - 1 ? 0 : selectedSuggestion + 1;\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\tselectedSuggestion: nextIndex\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase TAB:\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.state.selectedSuggestion !== null) {\n\t\t\t\t\t\t\tthis.selectLink(post);\n\t\t\t\t\t\t\t// Announce a link has been selected when tabbing away from the input field.\n\t\t\t\t\t\t\tthis.props.speak(__('Link selected'));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase ENTER:\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.state.selectedSuggestion !== null) {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tthis.selectLink(post);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: 'selectLink',\n\t\tvalue: function selectLink(post) {\n\t\t\tthis.props.onChange(post.link, post);\n\t\t\tthis.setState({\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tshowSuggestions: false\n\t\t\t});\n\t\t}\n\n\t\t/**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: 'handleOnClick',\n\t\tvalue: function handleOnClick(post) {\n\t\t\tthis.selectLink(post);\n\t\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\t\tthis.inputRef.current.focus();\n\t\t}\n\n\t\t/**\n * Component render method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _this5 = this;\n\n\t\t\tvar _props = this.props,\n\t\t\t _props$value = _props.value,\n\t\t\t value = _props$value === undefined ? '' : _props$value,\n\t\t\t _props$autoFocus = _props.autoFocus,\n\t\t\t autoFocus = _props$autoFocus === undefined ? true : _props$autoFocus,\n\t\t\t instanceId = _props.instanceId,\n\t\t\t invalidLink = _props.invalidLink;\n\t\t\tvar _state3 = this.state,\n\t\t\t showSuggestions = _state3.showSuggestions,\n\t\t\t posts = _state3.posts,\n\t\t\t selectedSuggestion = _state3.selectedSuggestion,\n\t\t\t loading = _state3.loading;\n\t\t\t/* eslint-disable jsx-a11y/no-autofocus */\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ className: 'editor-url-input block-editor-url-input' },\n\t\t\t\twp.element.createElement('input', {\n\t\t\t\t\tautoFocus: autoFocus,\n\t\t\t\t\ttype: 'text',\n\t\t\t\t\t'aria-label': __('URL'),\n\t\t\t\t\trequired: true,\n\t\t\t\t\tvalue: value,\n\t\t\t\t\tonChange: this.onChange,\n\t\t\t\t\tonInput: stopEventPropagation,\n\t\t\t\t\tplaceholder: __('Paste URL or type to search'),\n\t\t\t\t\tonKeyDown: this.onKeyDown,\n\t\t\t\t\trole: 'combobox',\n\t\t\t\t\t'aria-expanded': showSuggestions,\n\t\t\t\t\t'aria-autocomplete': 'list',\n\t\t\t\t\t'aria-owns': 'editor-url-input-suggestions-' + instanceId,\n\t\t\t\t\t'aria-activedescendant': selectedSuggestion !== null ? 'editor-url-input-suggestion-' + instanceId + '-' + selectedSuggestion : undefined,\n\t\t\t\t\tref: this.inputRef\n\t\t\t\t}),\n\t\t\t\tloading && wp.element.createElement(Spinner, null),\n\t\t\t\tshowSuggestions && !!posts.length && !invalidLink && wp.element.createElement(\n\t\t\t\t\tPopover,\n\t\t\t\t\t{ position: 'bottom', noArrow: true, focusOnMount: false },\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t'div',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclassName: 'editor-url-input__suggestions block-editor-url-input__suggestions',\n\t\t\t\t\t\t\tid: 'editor-url-input-suggestions-' + instanceId,\n\t\t\t\t\t\t\tref: this.autocompleteRef,\n\t\t\t\t\t\t\trole: 'listbox'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tposts.map(function (post, index) {\n\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t'button',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tkey: post.id,\n\t\t\t\t\t\t\t\t\trole: 'option',\n\t\t\t\t\t\t\t\t\ttabIndex: '-1',\n\t\t\t\t\t\t\t\t\tid: 'block-editor-url-input-suggestion-' + instanceId + '-' + index,\n\t\t\t\t\t\t\t\t\tref: _this5.bindSuggestionNode(index),\n\t\t\t\t\t\t\t\t\tclassName: __WEBPACK_IMPORTED_MODULE_0_classnames___default()('editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\treturn _this5.handleOnClick(post);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t'aria-selected': index === selectedSuggestion\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tpost.title || __('(no title)')\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t/* eslint-enable jsx-a11y/no-autofocus */\n\t\t}\n\t}]);\n\n\treturn ThirstyURLInput;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withSpokenMessages(withInstanceId(ThirstyURLInput)));\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = __webpack_require__(15);\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar util = __webpack_require__(16);\n\nfunction scrollIntoView(elem, container, config) {\n config = config || {};\n // document 归一化到 window\n if (container.nodeType === 9) {\n container = util.getWindow(container);\n }\n\n var allowHorizontalScroll = config.allowHorizontalScroll;\n var onlyScrollIfNeeded = config.onlyScrollIfNeeded;\n var alignWithTop = config.alignWithTop;\n var alignWithLeft = config.alignWithLeft;\n var offsetTop = config.offsetTop || 0;\n var offsetLeft = config.offsetLeft || 0;\n var offsetBottom = config.offsetBottom || 0;\n var offsetRight = config.offsetRight || 0;\n\n allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;\n\n var isWin = util.isWindow(container);\n var elemOffset = util.offset(elem);\n var eh = util.outerHeight(elem);\n var ew = util.outerWidth(elem);\n var containerOffset = undefined;\n var ch = undefined;\n var cw = undefined;\n var containerScroll = undefined;\n var diffTop = undefined;\n var diffBottom = undefined;\n var win = undefined;\n var winScroll = undefined;\n var ww = undefined;\n var wh = undefined;\n\n if (isWin) {\n win = container;\n wh = util.height(win);\n ww = util.width(win);\n winScroll = {\n left: util.scrollLeft(win),\n top: util.scrollTop(win)\n };\n // elem 相对 container 可视视窗的距离\n diffTop = {\n left: elemOffset.left - winScroll.left - offsetLeft,\n top: elemOffset.top - winScroll.top - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,\n top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom\n };\n containerScroll = winScroll;\n } else {\n containerOffset = util.offset(container);\n ch = container.clientHeight;\n cw = container.clientWidth;\n containerScroll = {\n left: container.scrollLeft,\n top: container.scrollTop\n };\n // elem 相对 container 可视视窗的距离\n // 注意边框, offset 是边框到根节点\n diffTop = {\n left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft,\n top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight,\n top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom\n };\n }\n\n if (diffTop.top < 0 || diffBottom.top > 0) {\n // 强制向上\n if (alignWithTop === true) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else if (alignWithTop === false) {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n } else {\n // 自动调整\n if (diffTop.top < 0) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;\n if (alignWithTop) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n }\n\n if (allowHorizontalScroll) {\n if (diffTop.left < 0 || diffBottom.left > 0) {\n // 强制向上\n if (alignWithLeft === true) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else if (alignWithLeft === false) {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n } else {\n // 自动调整\n if (diffTop.left < 0) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;\n if (alignWithLeft) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n }\n }\n}\n\nmodule.exports = scrollIntoView;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar RE_NUM = /[\\-+]?(?:\\d*\\.|)\\d+(?:[eE][\\-+]?\\d+|)/.source;\n\nfunction getClientPosition(elem) {\n var box = undefined;\n var x = undefined;\n var y = undefined;\n var doc = elem.ownerDocument;\n var body = doc.body;\n var docElem = doc && doc.documentElement;\n // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式\n box = elem.getBoundingClientRect();\n\n // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop\n // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确\n // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin\n\n x = box.left;\n y = box.top;\n\n // In IE, most of the time, 2 extra pixels are added to the top and left\n // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and\n // IE6 standards mode, this border can be overridden by setting the\n // document element's border to zero -- thus, we cannot rely on the\n // offset always being 2 pixels.\n\n // In quirks mode, the offset can be determined by querying the body's\n // clientLeft/clientTop, but in standards mode, it is found by querying\n // the document element's clientLeft/clientTop. Since we already called\n // getClientBoundingRect we have already forced a reflow, so it is not\n // too expensive just to query them all.\n\n // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的\n // 窗口边框标准是设 documentElement ,quirks 时设置 body\n // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去\n // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置\n // 标准 ie 下 docElem.clientTop 就是 border-top\n // ie7 html 即窗口边框改变不了。永远为 2\n // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0\n\n x -= docElem.clientLeft || body.clientLeft || 0;\n y -= docElem.clientTop || body.clientTop || 0;\n\n return {\n left: x,\n top: y\n };\n}\n\nfunction getScroll(w, top) {\n var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];\n var method = 'scroll' + (top ? 'Top' : 'Left');\n if (typeof ret !== 'number') {\n var d = w.document;\n // ie6,7,8 standard mode\n ret = d.documentElement[method];\n if (typeof ret !== 'number') {\n // quirks mode\n ret = d.body[method];\n }\n }\n return ret;\n}\n\nfunction getScrollLeft(w) {\n return getScroll(w);\n}\n\nfunction getScrollTop(w) {\n return getScroll(w, true);\n}\n\nfunction getOffset(el) {\n var pos = getClientPosition(el);\n var doc = el.ownerDocument;\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScrollLeft(w);\n pos.top += getScrollTop(w);\n return pos;\n}\nfunction _getComputedStyle(elem, name, computedStyle_) {\n var val = '';\n var d = elem.ownerDocument;\n var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);\n\n // https://github.com/kissyteam/kissy/issues/61\n if (computedStyle) {\n val = computedStyle.getPropertyValue(name) || computedStyle[name];\n }\n\n return val;\n}\n\nvar _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');\nvar RE_POS = /^(top|right|bottom|left)$/;\nvar CURRENT_STYLE = 'currentStyle';\nvar RUNTIME_STYLE = 'runtimeStyle';\nvar LEFT = 'left';\nvar PX = 'px';\n\nfunction _getComputedStyleIE(elem, name) {\n // currentStyle maybe null\n // http://msdn.microsoft.com/en-us/library/ms535231.aspx\n var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];\n\n // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值\n // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19\n // 在 ie 下不对,需要直接用 offset 方式\n // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了\n\n // From the awesome hack by Dean Edwards\n // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n // If we're not dealing with a regular pixel number\n // but a number that has a weird ending, we need to convert it to pixels\n // exclude left right for relativity\n if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {\n // Remember the original values\n var style = elem.style;\n var left = style[LEFT];\n var rsLeft = elem[RUNTIME_STYLE][LEFT];\n\n // prevent flashing of content\n elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];\n\n // Put in the new values to get a computed value out\n style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;\n ret = style.pixelLeft + PX;\n\n // Revert the changed values\n style[LEFT] = left;\n\n elem[RUNTIME_STYLE][LEFT] = rsLeft;\n }\n return ret === '' ? 'auto' : ret;\n}\n\nvar getComputedStyleX = undefined;\nif (typeof window !== 'undefined') {\n getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;\n}\n\nfunction each(arr, fn) {\n for (var i = 0; i < arr.length; i++) {\n fn(arr[i]);\n }\n}\n\nfunction isBorderBoxFn(elem) {\n return getComputedStyleX(elem, 'boxSizing') === 'border-box';\n}\n\nvar BOX_MODELS = ['margin', 'border', 'padding'];\nvar CONTENT_INDEX = -1;\nvar PADDING_INDEX = 2;\nvar BORDER_INDEX = 1;\nvar MARGIN_INDEX = 0;\n\nfunction swap(elem, options, callback) {\n var old = {};\n var style = elem.style;\n var name = undefined;\n\n // Remember the old values, and insert the new ones\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n old[name] = style[name];\n style[name] = options[name];\n }\n }\n\n callback.call(elem);\n\n // Revert the old values\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n style[name] = old[name];\n }\n }\n}\n\nfunction getPBMWidth(elem, props, which) {\n var value = 0;\n var prop = undefined;\n var j = undefined;\n var i = undefined;\n for (j = 0; j < props.length; j++) {\n prop = props[j];\n if (prop) {\n for (i = 0; i < which.length; i++) {\n var cssProp = undefined;\n if (prop === 'border') {\n cssProp = prop + which[i] + 'Width';\n } else {\n cssProp = prop + which[i];\n }\n value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;\n }\n }\n }\n return value;\n}\n\n/**\n * A crude way of determining if an object is a window\n * @member util\n */\nfunction isWindow(obj) {\n // must use == for ie8\n /* eslint eqeqeq:0 */\n return obj != null && obj == obj.window;\n}\n\nvar domUtils = {};\n\neach(['Width', 'Height'], function (name) {\n domUtils['doc' + name] = function (refWin) {\n var d = refWin.document;\n return Math.max(\n // firefox chrome documentElement.scrollHeight< body.scrollHeight\n // ie standard mode : documentElement.scrollHeight> body.scrollHeight\n d.documentElement['scroll' + name],\n // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?\n d.body['scroll' + name], domUtils['viewport' + name](d));\n };\n\n domUtils['viewport' + name] = function (win) {\n // pc browser includes scrollbar in window.innerWidth\n var prop = 'client' + name;\n var doc = win.document;\n var body = doc.body;\n var documentElement = doc.documentElement;\n var documentElementProp = documentElement[prop];\n // 标准模式取 documentElement\n // backcompat 取 body\n return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;\n };\n});\n\n/*\n 得到元素的大小信息\n @param elem\n @param name\n @param {String} [extra] 'padding' : (css width) + padding\n 'border' : (css width) + padding + border\n 'margin' : (css width) + padding + border + margin\n */\nfunction getWH(elem, name, extra) {\n if (isWindow(elem)) {\n return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);\n } else if (elem.nodeType === 9) {\n return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);\n }\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem, computedStyle);\n var cssBoxValue = 0;\n if (borderBoxValue == null || borderBoxValue <= 0) {\n borderBoxValue = undefined;\n // Fall back to computed then un computed css if necessary\n cssBoxValue = getComputedStyleX(elem, name);\n if (cssBoxValue == null || Number(cssBoxValue) < 0) {\n cssBoxValue = elem.style[name] || 0;\n }\n // Normalize '', auto, and prepare for extra\n cssBoxValue = parseFloat(cssBoxValue) || 0;\n }\n if (extra === undefined) {\n extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;\n }\n var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;\n var val = borderBoxValue || cssBoxValue;\n if (extra === CONTENT_INDEX) {\n if (borderBoxValueOrIsBorderBox) {\n return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);\n }\n return cssBoxValue;\n }\n if (borderBoxValueOrIsBorderBox) {\n var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);\n return val + (extra === BORDER_INDEX ? 0 : padding);\n }\n return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);\n}\n\nvar cssShow = {\n position: 'absolute',\n visibility: 'hidden',\n display: 'block'\n};\n\n// fix #119 : https://github.com/kissyteam/kissy/issues/119\nfunction getWHIgnoreDisplay(elem) {\n var val = undefined;\n var args = arguments;\n // in case elem is window\n // elem.offsetWidth === undefined\n if (elem.offsetWidth !== 0) {\n val = getWH.apply(undefined, args);\n } else {\n swap(elem, cssShow, function () {\n val = getWH.apply(undefined, args);\n });\n }\n return val;\n}\n\nfunction css(el, name, v) {\n var value = v;\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n for (var i in name) {\n if (name.hasOwnProperty(i)) {\n css(el, i, name[i]);\n }\n }\n return undefined;\n }\n if (typeof value !== 'undefined') {\n if (typeof value === 'number') {\n value += 'px';\n }\n el.style[name] = value;\n return undefined;\n }\n return getComputedStyleX(el, name);\n}\n\neach(['width', 'height'], function (name) {\n var first = name.charAt(0).toUpperCase() + name.slice(1);\n domUtils['outer' + first] = function (el, includeMargin) {\n return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);\n };\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n\n domUtils[name] = function (elem, val) {\n if (val !== undefined) {\n if (elem) {\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem);\n if (isBorderBox) {\n val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);\n }\n return css(elem, name, val);\n }\n return undefined;\n }\n return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);\n };\n});\n\n// 设置 elem 相对 elem.ownerDocument 的坐标\nfunction setOffset(elem, offset) {\n // set position first, in-case top/left are set even on static elem\n if (css(elem, 'position') === 'static') {\n elem.style.position = 'relative';\n }\n\n var old = getOffset(elem);\n var ret = {};\n var current = undefined;\n var key = undefined;\n\n for (key in offset) {\n if (offset.hasOwnProperty(key)) {\n current = parseFloat(css(elem, key)) || 0;\n ret[key] = current + offset[key] - old[key];\n }\n }\n css(elem, ret);\n}\n\nmodule.exports = _extends({\n getWindow: function getWindow(node) {\n var doc = node.ownerDocument || node;\n return doc.defaultView || doc.parentWindow;\n },\n offset: function offset(el, value) {\n if (typeof value !== 'undefined') {\n setOffset(el, value);\n } else {\n return getOffset(el);\n }\n },\n\n isWindow: isWindow,\n each: each,\n css: css,\n clone: function clone(obj) {\n var ret = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret[i] = obj[i];\n }\n }\n var overflow = obj.overflow;\n if (overflow) {\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret.overflow[i] = obj.overflow[i];\n }\n }\n }\n return ret;\n },\n scrollLeft: function scrollLeft(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollLeft(w);\n }\n window.scrollTo(v, getScrollTop(w));\n } else {\n if (v === undefined) {\n return w.scrollLeft;\n }\n w.scrollLeft = v;\n }\n },\n scrollTop: function scrollTop(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollTop(w);\n }\n window.scrollTo(getScrollLeft(w), v);\n } else {\n if (v === undefined) {\n return w.scrollTop;\n }\n w.scrollTop = v;\n }\n },\n\n viewportWidth: 0,\n viewportHeight: 0\n}, domUtils);\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// gutenberg-support.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 75d5f816076e5891d65a","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/classnames/index.js\n// module id = 0\n// module chunks = 0","import registerBlocks from \"./blocks\";\nimport registerFormats from \"./formats\";\n\nimport \"./assets/styles/index.scss\";\n\nregisterBlocks();\nregisterFormats();\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","import * as taimage from \"./ta-image\";\n\nconst { registerBlockType } = wp.blocks;\n\n/**\n * Register gutenberg blocks.\n * \n * @since 3.6\n */\nexport default function registerBlocks() {\n\n [\n taimage\n ].forEach( ( block ) => {\n if ( ! block ) return;\n\n const { name , settings } = block;\n registerBlockType( name , settings );\n } );\n}\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/index.js","import classnames from \"classnames\";\n\nconst { Fragment } = wp.element;\nconst { __ } = wp.i18n;\nconst { createBlock, getBlockAttributes, getPhrasingContentSchema } = wp.blocks;\nconst { RichText } = wp.editor;\nconst { Path , SVG } = wp.components;\n\nimport edit from \"./edit\";\n\nexport const name = 'ta/image';\n\nconst blockAttributes = {\n\turl: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'src',\n\t},\n\talt: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'alt',\n\t\tdefault: '',\n\t},\n\tcaption: {\n\t\ttype: 'string',\n\t\tsource: 'html',\n\t\tselector: 'figcaption',\n\t},\n\tid: {\n\t\ttype: 'number',\n\t},\n\talign: {\n\t\ttype: 'string',\n\t},\n\twidth: {\n\t\ttype: 'number',\n\t},\n\theight: {\n\t\ttype: 'number',\n\t},\n\tlinkid: {\n\t\ttype: 'number',\n\t},\n\thref: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'ta',\n\t\tattribute: 'href'\n\t},\n\taffiliateLink: {\n\t\ttype: 'object'\n\t}\n};\n\nconst imageSchema = {\n\timg: {\n\t\tattributes: [ 'src', 'alt' ],\n\t\tclasses: [ 'alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\\d+$/ ],\n\t},\n};\n\nconst schema = {\n\tfigure: {\n\t\trequire: [ 'ta' , 'img' ],\n\t\tchildren: {\n\t\t\tta: {\n\t\t\t\tattributes: [ 'href', 'linkid' ],\n\t\t\t\tchildren: imageSchema,\n\t\t\t},\n\t\t\tfigcaption: {\n\t\t\t\tchildren: getPhrasingContentSchema(),\n\t\t\t},\n\t\t},\n\t},\n};\n\nfunction getFirstAnchorAttributeFormHTML( html, attributeName ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = html;\n\n\tconst { firstElementChild } = body;\n\n\tif (\n\t\tfirstElementChild &&\n\t\tfirstElementChild.nodeName === 'A'\n\t) {\n\t\treturn firstElementChild.getAttribute( attributeName ) || undefined;\n\t}\n}\n\nexport const settings = {\n\ttitle: __( 'ThirstyAffiliates Image' ),\n\n\tdescription: __( 'Insert an image with an affiliate link to make a visual statement.' ),\n\n\ticon: <SVG viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><Path d=\"M0,0h24v24H0V0z\" fill=\"none\" /><Path d=\"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z\" /><Path d=\"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z\" /></SVG>,\n\n\tcategory: 'common',\n\n\tkeywords: [\n\t\t'img', // \"img\" is not translated as it is intended to reflect the HTML <img> tag.\n\t\t__( 'photo' ),\n\t\t__( 'affiliate' )\n\t],\n\n\tattributes: blockAttributes,\n\n\tgetEditWrapperProps( attributes ) {\n\t\tconst { align, width } = attributes;\n\t\tif ( 'left' === align || 'center' === align || 'right' === align || 'wide' === align || 'full' === align ) {\n\t\t\treturn { 'data-align': align, 'data-resized': !! width };\n\t\t}\n\t},\n\n\tedit,\n\n\tsave( { attributes } ) {\n\t\tconst {\n\t\t\turl,\n\t\t\talt,\n\t\t\tcaption,\n\t\t\talign,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tid,\n\t\t\tlinkid,\n\t\t\thref\n\t\t} = attributes;\n\n\t\tconst classes = classnames( {\n\t\t\t[ `align${ align }` ]: align,\n\t\t\t'is-resized': width || height,\n\t\t} );\n\n\t\tconst image = (\n\t\t\t<img\n\t\t\t\tsrc={ url }\n\t\t\t\talt={ alt }\n\t\t\t\tclassName={ id ? `wp-image-${ id }` : null }\n\t\t\t\twidth={ width }\n\t\t\t\theight={ height }\n\t\t\t/>\n\t\t);\n\n\t\tconst figure = (\n\t\t\t<Fragment>\n\t\t\t\t<ta linkid={ linkid } href={ href }>\n\t\t\t\t{ image }\n\t\t\t\t</ta>\n\t\t\t\t<RichText.Content tagName=\"figcaption\" value={ caption } />\n\t\t\t</Fragment>\n\t\t);\n\n\t\tif ( 'left' === align || 'right' === align || 'center' === align ) {\n\t\t\treturn (\n\t\t\t\t<div className='wp-block-image'>\n\t\t\t\t\t<figure className={ classes }>\n\t\t\t\t\t\t{ figure }\n\t\t\t\t\t</figure>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<figure className={ `wp-block-image ${classes}` }>\n\t\t\t\t{ figure }\n\t\t\t</figure>\n\t\t);\n\t}\n};\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/index.js","import classnames from \"classnames\";\n\nconst { get , isEmpty , map , last , pick , compact } = lodash;\nconst { getPath } = wp.url;\nconst { __, sprintf } = wp.i18n;\nconst { Component, Fragment , createRef } = wp.element;\nconst { getBlobByURL, revokeBlobURL, isBlobURL } = wp.blob;\nconst { Placeholder , Button , ButtonGroup , IconButton , PanelBody , ResizableBox , SelectControl , Spinner , TextControl , TextareaControl , Toolbar , withNotices , ToggleControl , Popover } = wp.components;\nconst { withSelect } = wp.data;\nconst { RichText , BlockControls , InspectorControls , MediaUpload , MediaUploadCheck , MediaPlaceholder , BlockAlignmentToolbar , mediaUpload } = wp.editor;\nconst { withViewportMatch } = wp.viewport;\nconst { compose } = wp.compose;\n\nimport { createUpgradedEmbedBlock } from \"./util\";\nimport ImageSize from \"./image-size\";\nimport ThirstyURLInput from './search-input';\n\n/**\n * Module constants\n */\nconst MIN_SIZE = 20;\nconst LINK_DESTINATION_NONE = 'none';\nconst LINK_DESTINATION_MEDIA = 'media';\nconst LINK_DESTINATION_ATTACHMENT = 'attachment';\nconst LINK_DESTINATION_CUSTOM = 'custom';\nconst NEW_TAB_REL = 'noreferrer noopener';\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nexport const pickRelevantMediaFiles = ( image ) => {\n\tconst imageProps = pick( image, [ 'alt', 'id', 'link', 'caption' ] );\n\timageProps.url = get( image, [ 'sizes', 'large', 'url' ] ) || get( image, [ 'media_details', 'sizes', 'large', 'source_url' ] ) || image.url;\n\treturn imageProps;\n};\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily\n * while the image is being uploaded and will not have an id yet allocated.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the URL a Blob URL\n */\nconst isTemporaryImage = ( id, url ) => ! id && isBlobURL( url );\n\n/**\n * Is the url for the image hosted externally. An externally hosted image has no id\n * and is not a blob url.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the url an externally hosted url?\n */\nconst isExternalImage = ( id, url ) => url && ! id && ! isBlobURL( url );\n\nclass ImageEdit extends Component {\n\tconstructor( { attributes } ) {\n\t\tsuper( ...arguments );\n\t\tthis.updateAlt = this.updateAlt.bind( this );\n\t\tthis.updateAlignment = this.updateAlignment.bind( this );\n\t\tthis.onFocusCaption = this.onFocusCaption.bind( this );\n\t\tthis.onImageClick = this.onImageClick.bind( this );\n\t\tthis.onSelectImage = this.onSelectImage.bind( this );\n\t\tthis.updateImageURL = this.updateImageURL.bind( this );\n\t\tthis.updateWidth = this.updateWidth.bind( this );\n\t\tthis.updateHeight = this.updateHeight.bind( this );\n\t\tthis.updateDimensions = this.updateDimensions.bind( this );\n\t\tthis.getFilename = this.getFilename.bind( this );\n\t\tthis.toggleIsEditing = this.toggleIsEditing.bind( this );\n\t\tthis.onImageError = this.onImageError.bind( this );\n\t\tthis.onChangeInputValue = this.onChangeInputValue.bind( this );\n\t\tthis.autocompleteRef = createRef();\n\t\tthis.resetInvalidLink = this.resetInvalidLink.bind( this );\n\t\tthis.updateImageSelection = this.updateImageSelection.bind( this );\n\t\tthis.onSelectAffiliateImage = this.onSelectAffiliateImage.bind( this );\n\t\tthis.editAFfiliateImage = this.editAFfiliateImage.bind( this );\n\n\t\tthis.state = {\n\t\t\tcaptionFocused: false,\n\t\t\tisEditing: ! attributes.url,\n\t\t\tinputValue : '',\n\t\t\tlinkid : 0,\n\t\t\tpost : null,\n\t\t\tshowSuggestions : false,\n\t\t\timageSelection : [],\n\t\t\taffiliateLink : null\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { attributes, setAttributes, noticeOperations } = this.props;\n\t\tconst { id, url = '' } = attributes;\n\n\t\tif ( isTemporaryImage( id, url ) ) {\n\t\t\tconst file = getBlobByURL( url );\n\n\t\t\tif ( file ) {\n\t\t\t\tmediaUpload( {\n\t\t\t\t\tfilesList: [ file ],\n\t\t\t\t\tonFileChange: ( [ image ] ) => {\n\t\t\t\t\t\tsetAttributes( pickRelevantMediaFiles( image ) );\n\t\t\t\t\t},\n\t\t\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\t\t\tonError: ( message ) => {\n\t\t\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t\t\t\tthis.setState( { isEditing: true } );\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { id: prevID, url: prevURL = '' } = prevProps.attributes;\n\t\tconst { id, url = '' } = this.props.attributes;\n\n\t\tif ( isTemporaryImage( prevID, prevURL ) && ! isTemporaryImage( id, url ) ) {\n\t\t\trevokeBlobURL( url );\n\t\t}\n\n\t\tif ( ! this.props.isSelected && prevProps.isSelected && this.state.captionFocused ) {\n\t\t\tthis.setState( {\n\t\t\t\tcaptionFocused: false,\n\t\t\t} );\n\t\t}\n\t}\n\n\tonSelectImage( media ) {\n\n\t\tif ( ! media || ! media.url ) {\n\t\t\tthis.props.setAttributes( {\n\t\t\t\turl: undefined,\n\t\t\t\talt: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tcaption: undefined\n\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\tconst { affiliateLink } = this.state;\n\n\t\tthis.setState( {\n\t\t\tisEditing: false,\n\t\t} );\n\n\t\tthis.props.setAttributes( {\n\t\t\t...pickRelevantMediaFiles( media ),\n\t\t\tlinkid: affiliateLink.id,\n\t\t\thref: affiliateLink.link,\n\t\t\taffiliateLink : affiliateLink,\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t} );\n\t}\n\n\tonImageError( url ) {\n\t\t// Check if there's an embed block that handles this URL.\n\t\tconst embedBlock = createUpgradedEmbedBlock(\n\t\t\t{ attributes: { url } }\n\t\t);\n\t\tif ( undefined !== embedBlock ) {\n\t\t\tthis.props.onReplace( embedBlock );\n\t\t}\n\t}\n\n\tonFocusCaption() {\n\t\tif ( ! this.state.captionFocused ) {\n\t\t\tthis.setState( {\n\t\t\t\tcaptionFocused: true,\n\t\t\t} );\n\t\t}\n\t}\n\n\tonImageClick() {\n\t\tif ( this.state.captionFocused ) {\n\t\t\tthis.setState( {\n\t\t\t\tcaptionFocused: false,\n\t\t\t} );\n\t\t}\n\t}\n\n\tupdateAlt( newAlt ) {\n\t\tthis.props.setAttributes( { alt: newAlt } );\n\t}\n\n\tupdateAlignment( nextAlign ) {\n\t\tconst extraUpdatedAttributes = [ 'wide', 'full' ].indexOf( nextAlign ) !== -1 ?\n\t\t\t{ width: undefined, height: undefined } :\n\t\t\t{};\n\t\tthis.props.setAttributes( { ...extraUpdatedAttributes, align: nextAlign } );\n\t}\n\n\tupdateImageURL( url ) {\n\t\tthis.props.setAttributes( { url, width: undefined, height: undefined } );\n\t}\n\n\tupdateWidth( width ) {\n\t\tthis.props.setAttributes( { width: parseInt( width, 10 ) } );\n\t}\n\n\tupdateHeight( height ) {\n\t\tthis.props.setAttributes( { height: parseInt( height, 10 ) } );\n\t}\n\n\tupdateDimensions( width = undefined, height = undefined ) {\n\t\treturn () => {\n\t\t\tthis.props.setAttributes( { width, height } );\n\t\t};\n\t}\n\n\tgetFilename( url ) {\n\t\tconst path = getPath( url );\n\t\tif ( path ) {\n\t\t\treturn last( path.split( '/' ) );\n\t\t}\n\t}\n\n\tgetLinkDestinationOptions() {\n\t\treturn [\n\t\t\t{ value: LINK_DESTINATION_NONE, label: __( 'None' ) },\n\t\t\t{ value: LINK_DESTINATION_MEDIA, label: __( 'Media File' ) },\n\t\t\t{ value: LINK_DESTINATION_ATTACHMENT, label: __( 'Attachment Page' ) },\n\t\t\t{ value: LINK_DESTINATION_CUSTOM, label: __( 'Custom URL' ) },\n\t\t];\n\t}\n\n\ttoggleIsEditing() {\n\t\tthis.setState( {\n\t\t\tisEditing: ! this.state.isEditing,\n\t\t} );\n\t}\n\n\tgetImageSizeOptions() {\n\t\tconst { imageSizes, image } = this.props;\n\t\treturn compact( map( imageSizes, ( { name, slug } ) => {\n\t\t\tconst sizeUrl = get( image, [ 'media_details', 'sizes', slug, 'source_url' ] );\n\t\t\tif ( ! sizeUrl ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tvalue: sizeUrl,\n\t\t\t\tlabel: name,\n\t\t\t};\n\t\t} ) );\n\t}\n\n\tonChangeInputValue( inputValue , post = null ) {\n\t\tconst linkid = post ? post.id : 0;\n\t\tthis.setState( { inputValue , linkid , post } );\n\t}\n\n\tresetInvalidLink() {\n\t\tthis.setState( { invalidLink : false } );\n\t}\n\n\tupdateImageSelection( imageSelection , affiliateLink ) {\n\t\tthis.setState({\n\t\t\timageSelection,\n\t\t\taffiliateLink\n\t\t});\n\t}\n\n\tonSelectAffiliateImage( image ) {\n\n\t\tif ( isExternalImage( image.id, image.src ) ) {\n\t\t\timage.url = image.src;\n\t\t\tthis.onSelectImage( image );\n\t\t} else {\n\t\t\tconst request = wp.apiFetch( {\n\t\t\t\tpath: wp.url.addQueryArgs( '/wp/v2/media/' + image.id , {\n\t\t\t\t\tcontext: 'edit',\n\t\t\t\t\t_locale: 'user'\n\t\t\t\t} ),\n\t\t\t} );\n\n\t\t\trequest.then( (media) => {\n\t\t\t\tmedia.url = media.source_url;\n\t\t\t\tthis.onSelectImage( media );\n\t\t\t} );\n\t\t}\n\t}\n\n\teditAFfiliateImage() {\n\n\t\tconst { attributes } = this.props;\n\t\tconst { affiliateLink } = attributes;\n\n\t\tthis.setState({\n\t\t\tisEditing : true,\n\t\t\timageSelection : affiliateLink.images,\n\t\t\taffiliateLink\n\t\t});\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tisEditing,\n\t\t\timageSelection,\n\t\t\taffiliateLink,\n\t\t} = this.state;\n\t\tconst {\n\t\t\tattributes,\n\t\t\tsetAttributes,\n\t\t\tisLargeViewport,\n\t\t\tisSelected,\n\t\t\tclassName,\n\t\t\tmaxWidth,\n\t\t\ttoggleSelection,\n\t\t\tisRTL,\n\t\t} = this.props;\n\t\tconst {\n\t\t\turl,\n\t\t\talt,\n\t\t\tcaption,\n\t\t\talign,\n\t\t\tlinkDestination,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tlinkid,\n\t\t\thref\n\t\t} = attributes;\n\t\tconst toolbarEditButton = (\n\t\t\t<Toolbar>\n\t\t\t\t<IconButton\n\t\t\t\t\tclassName=\"ta-edit-image-button components-icon-button components-toolbar__control\"\n\t\t\t\t\tlabel={ __( 'Edit ThirstyAffiliates Image' ) }\n\t\t\t\t\ticon=\"edit\"\n\t\t\t\t\tonClick={ this.editAFfiliateImage }\n\t\t\t\t/>\n\t\t\t</Toolbar>\n\t\t);\n\n\t\tconst controls = (\n\t\t\t<BlockControls>\n\t\t\t\t<BlockAlignmentToolbar\n\t\t\t\t\tvalue={ align }\n\t\t\t\t\tonChange={ this.updateAlignment }\n\t\t\t\t/>\n\t\t\t\t{ toolbarEditButton }\n\t\t\t</BlockControls>\n\t\t);\n\n\t\tif ( isEditing ) {\n\t\t\treturn (\n\t\t\t\t<Fragment>\n\t\t\t\t\t{ controls }\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ \"format-image\" }\n\t\t\t\t\t\tlabel={ __( \"ThirstyAffiliates Image\" ) }\n\t\t\t\t\t\tinstructions={ __( \"Search for an affiliate link and select image to insert.\" ) }\n\t\t\t\t\t>\n\n\t\t\t\t\t\t<ThirstyURLInput\n\t\t\t\t\t\t\tupdateImageSelection={ this.updateImageSelection }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{ !! imageSelection.length &&\n\t\t\t\t\t\t\t<div className=\"ta-image-sel-wrap\">\n\t\t\t\t\t\t\t\t<h3>{ `${affiliateLink.title} ${ __( 'attached images:' ) }` }</h3>\n\t\t\t\t\t\t\t\t<div className=\"ta-image-selection\">\n\t\t\t\t\t\t\t\t\t{ imageSelection.map( ( image , index ) => (\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => this.onSelectAffiliateImage( image ) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<img src={ image.src } />\n\t\t\t\t\t\t\t\t\t\t</button>\n\n\t\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t</Placeholder>\n\t\t\t\t</Fragment>\n\t\t\t);\n\t\t}\n\n\t\tconst classes = classnames( className, {\n\t\t\t'wp-block-image' : true,\n\t\t\t'is-transient': isBlobURL( url ),\n\t\t\t'is-resized': !! width || !! height,\n\t\t\t'is-focused': isSelected,\n\t\t} );\n\n\t\tconst isResizable = [ 'wide', 'full' ].indexOf( align ) === -1 && isLargeViewport;\n\t\tconst imageSizeOptions = this.getImageSizeOptions();\n\n\t\tconst getInspectorControls = ( imageWidth, imageHeight ) => (\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Image Settings' ) }>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\tlabel={ __( 'Alt Text (Alternative Text)' ) }\n\t\t\t\t\t\tvalue={ alt }\n\t\t\t\t\t\tonChange={ this.updateAlt }\n\t\t\t\t\t\thelp={ __( 'Alternative text describes your image to people who can’t see it. Add a short description with its key details.' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isEmpty( imageSizeOptions ) && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Image Size' ) }\n\t\t\t\t\t\t\tvalue={ url }\n\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\tonChange={ this.updateImageURL }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isResizable && (\n\t\t\t\t\t\t<div className=\"block-library-image__dimensions\">\n\t\t\t\t\t\t\t<p className=\"block-library-image__dimensions__row\">\n\t\t\t\t\t\t\t\t{ __( 'Image Dimensions' ) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<div className=\"block-library-image__dimensions__row\">\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-library-image__dimensions__width\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\t\t\tvalue={ width !== undefined ? width : '' }\n\t\t\t\t\t\t\t\t\tplaceholder={ imageWidth }\n\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\tonChange={ this.updateWidth }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-library-image__dimensions__height\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\t\t\t\tvalue={ height !== undefined ? height : '' }\n\t\t\t\t\t\t\t\t\tplaceholder={ imageHeight }\n\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\tonChange={ this.updateHeight }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"block-library-image__dimensions__row\">\n\t\t\t\t\t\t\t\t<ButtonGroup aria-label={ __( 'Image Size' ) }>\n\t\t\t\t\t\t\t\t\t{ [ 25, 50, 75, 100 ].map( ( scale ) => {\n\t\t\t\t\t\t\t\t\t\tconst scaledWidth = Math.round( imageWidth * ( scale / 100 ) );\n\t\t\t\t\t\t\t\t\t\tconst scaledHeight = Math.round( imageHeight * ( scale / 100 ) );\n\n\t\t\t\t\t\t\t\t\t\tconst isCurrent = width === scaledWidth && height === scaledHeight;\n\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ scale }\n\t\t\t\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\t\t\t\tisPrimary={ isCurrent }\n\t\t\t\t\t\t\t\t\t\t\t\taria-pressed={ isCurrent }\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ this.updateDimensions( scaledWidth, scaledHeight ) }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ scale }%\n\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t</ButtonGroup>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\tonClick={ this.updateDimensions() }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t);\n\n\t\t// Disable reason: Each block can be selected by clicking on it\n\t\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t\treturn (\n\t\t\t<Fragment>\n\t\t\t\t{ controls }\n\t\t\t\t<figure className={ classes }>\n\t\t\t\t\t<ImageSize src={ url } dirtynessTrigger={ align }>\n\t\t\t\t\t\t{ ( sizes ) => {\n\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\timageWidthWithinContainer,\n\t\t\t\t\t\t\t\timageHeightWithinContainer,\n\t\t\t\t\t\t\t\timageWidth,\n\t\t\t\t\t\t\t\timageHeight,\n\t\t\t\t\t\t\t} = sizes;\n\n\t\t\t\t\t\t\tconst filename = this.getFilename( url );\n\t\t\t\t\t\t\tlet defaultedAlt;\n\t\t\t\t\t\t\tif ( alt ) {\n\t\t\t\t\t\t\t\tdefaultedAlt = alt;\n\t\t\t\t\t\t\t} else if ( filename ) {\n\t\t\t\t\t\t\t\tdefaultedAlt = sprintf( __( 'This image has an empty alt attribute; its file name is %s' ), filename );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdefaultedAlt = __( 'This image has an empty alt attribute' );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst img = (\n\t\t\t\t\t\t\t\t// Disable reason: Image itself is not meant to be interactive, but\n\t\t\t\t\t\t\t\t// should direct focus to block.\n\t\t\t\t\t\t\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<ta linkid={ linkid } href={ href }>\n\t\t\t\t\t\t\t\t\t\t<img src={ url } alt={ defaultedAlt } onClick={ this.onImageClick } onError={ () => this.onImageError( url ) } />\n\t\t\t\t\t\t\t\t\t</ta>\n\t\t\t\t\t\t\t\t\t{ isBlobURL( url ) && <Spinner /> }\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( ! isResizable || ! imageWidthWithinContainer ) {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t{ getInspectorControls( imageWidth, imageHeight ) }\n\t\t\t\t\t\t\t\t\t\t<div style={ { width, height } }>\n\t\t\t\t\t\t\t\t\t\t\t{ img }\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst currentWidth = width || imageWidthWithinContainer;\n\t\t\t\t\t\t\tconst currentHeight = height || imageHeightWithinContainer;\n\n\t\t\t\t\t\t\tconst ratio = imageWidth / imageHeight;\n\t\t\t\t\t\t\tconst minWidth = imageWidth < imageHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\t\t\t\t\t\t\tconst minHeight = imageHeight < imageWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t\t\t\t\t\t\t// With the current implementation of ResizableBox, an image needs an explicit pixel value for the max-width.\n\t\t\t\t\t\t\t// In absence of being able to set the content-width, this max-width is currently dictated by the vanilla editor style.\n\t\t\t\t\t\t\t// The following variable adds a buffer to this vanilla style, so 3rd party themes have some wiggleroom.\n\t\t\t\t\t\t\t// This does, in most cases, allow you to scale the image beyond the width of the main column, though not infinitely.\n\t\t\t\t\t\t\t// @todo It would be good to revisit this once a content-width variable becomes available.\n\t\t\t\t\t\t\tconst maxWidthBuffer = maxWidth * 2.5;\n\n\t\t\t\t\t\t\tlet showRightHandle = false;\n\t\t\t\t\t\t\tlet showLeftHandle = false;\n\n\t\t\t\t\t\t\t/* eslint-disable no-lonely-if */\n\t\t\t\t\t\t\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\t\t\t\t\t\t\tif ( align === 'center' ) {\n\t\t\t\t\t\t\t\t// When the image is centered, show both handles.\n\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t} else if ( isRTL ) {\n\t\t\t\t\t\t\t\t// In RTL mode the image is on the right by default.\n\t\t\t\t\t\t\t\t// Show the right handle and hide the left handle only when it is aligned left.\n\t\t\t\t\t\t\t\t// Otherwise always show the left handle.\n\t\t\t\t\t\t\t\tif ( align === 'left' ) {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Show the left handle and hide the right handle only when the image is aligned right.\n\t\t\t\t\t\t\t\t// Otherwise always show the right handle.\n\t\t\t\t\t\t\t\tif ( align === 'right' ) {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/* eslint-enable no-lonely-if */\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t{ getInspectorControls( imageWidth, imageHeight ) }\n\t\t\t\t\t\t\t\t\t<ResizableBox\n\t\t\t\t\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t\t\t\t\twidth && height ? {\n\t\t\t\t\t\t\t\t\t\t\t\twidth,\n\t\t\t\t\t\t\t\t\t\t\t\theight,\n\t\t\t\t\t\t\t\t\t\t\t} : undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tminWidth={ minWidth }\n\t\t\t\t\t\t\t\t\t\tmaxWidth={ maxWidthBuffer }\n\t\t\t\t\t\t\t\t\t\tminHeight={ minHeight }\n\t\t\t\t\t\t\t\t\t\tmaxHeight={ maxWidthBuffer / ratio }\n\t\t\t\t\t\t\t\t\t\tlockAspectRatio\n\t\t\t\t\t\t\t\t\t\tenable={ {\n\t\t\t\t\t\t\t\t\t\t\ttop: false,\n\t\t\t\t\t\t\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\t\t\t\t\t\t\tbottom: true,\n\t\t\t\t\t\t\t\t\t\t\tleft: showLeftHandle,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonResizeStart={ () => {\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\twidth: parseInt( currentWidth + delta.width, 10 ),\n\t\t\t\t\t\t\t\t\t\t\t\theight: parseInt( currentHeight + delta.height, 10 ),\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ img }\n\t\t\t\t\t\t\t\t\t</ResizableBox>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t</ImageSize>\n\t\t\t\t\t{ ( ! RichText.isEmpty( caption ) || isSelected ) && (\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\t\t\tplaceholder={ __( 'Write caption…' ) }\n\t\t\t\t\t\t\tvalue={ caption }\n\t\t\t\t\t\t\tunstableOnFocus={ this.onFocusCaption }\n\t\t\t\t\t\t\tonChange={ ( value ) => setAttributes( { caption: value } ) }\n\t\t\t\t\t\t\tisSelected={ this.state.captionFocused }\n\t\t\t\t\t\t\tinlineToolbar\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</figure>\n\t\t\t</Fragment>\n\t\t);\n\t\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select, props ) => {\n\t\tconst { getMedia } = select( 'core' );\n\t\tconst { getEditorSettings } = select( 'core/editor' );\n\t\tconst { id } = props.attributes;\n\t\tconst { maxWidth, isRTL, imageSizes } = getEditorSettings();\n\n\t\treturn {\n\t\t\timage: id ? getMedia( id ) : null,\n\t\t\tmaxWidth,\n\t\t\tisRTL,\n\t\t\timageSizes,\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n\twithNotices,\n] )( ImageEdit );\n\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/edit.js","const WORDPRESS_EMBED_BLOCK = 'core-embed/wordpress';\n\nconst { includes } = lodash;\nconst { renderToString } = wp.element;\nconst { createBlock } = wp.blocks;\n\n/***\n * Creates a more suitable embed block based on the passed in props\n * and attributes generated from an embed block's preview.\n *\n * We require `attributesFromPreview` to be generated from the latest attributes\n * and preview, and because of the way the react lifecycle operates, we can't\n * guarantee that the attributes contained in the block's props are the latest\n * versions, so we require that these are generated separately.\n * See `getAttributesFromPreview` in the generated embed edit component.\n *\n * @param {Object} props The block's props.\n * @param {Object} attributesFromPreview Attributes generated from the block's most up to date preview.\n * @return {Object|undefined} A more suitable embed block if one exists.\n */\nexport const createUpgradedEmbedBlock = ( props, attributesFromPreview ) => {\n\tconst { preview, name } = props;\n\tconst { url } = props.attributes;\n\n\tif ( ! url ) {\n\t\treturn;\n\t}\n\n\tconst matchingBlock = findBlock( url );\n\n\t// WordPress blocks can work on multiple sites, and so don't have patterns,\n\t// so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.\n\tif ( WORDPRESS_EMBED_BLOCK !== name && DEFAULT_EMBED_BLOCK !== matchingBlock ) {\n\t\t// At this point, we have discovered a more suitable block for this url, so transform it.\n\t\tif ( name !== matchingBlock ) {\n\t\t\treturn createBlock( matchingBlock, { url } );\n\t\t}\n\t}\n\n\tif ( preview ) {\n\t\tconst { html } = preview;\n\n\t\t// We can't match the URL for WordPress embeds, we have to check the HTML instead.\n\t\tif ( isFromWordPress( html ) ) {\n\t\t\t// If this is not the WordPress embed block, transform it into one.\n\t\t\tif ( WORDPRESS_EMBED_BLOCK !== name ) {\n\t\t\t\treturn createBlock(\n\t\t\t\t\tWORDPRESS_EMBED_BLOCK,\n\t\t\t\t\t{\n\t\t\t\t\t\turl,\n\t\t\t\t\t\t// By now we have the preview, but when the new block first renders, it\n\t\t\t\t\t\t// won't have had all the attributes set, and so won't get the correct\n\t\t\t\t\t\t// type and it won't render correctly. So, we pass through the current attributes\n\t\t\t\t\t\t// here so that the initial render works when we switch to the WordPress\n\t\t\t\t\t\t// block. This only affects the WordPress block because it can't be\n\t\t\t\t\t\t// rendered in the usual Sandbox (it has a sandbox of its own) and it\n\t\t\t\t\t\t// relies on the preview to set the correct render type.\n\t\t\t\t\t\t...attributesFromPreview,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n};\n\nexport const isFromWordPress = ( html ) => {\n\treturn includes( html, 'class=\"wp-embedded-content\" data-secret' );\n};\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/util.js","const { noop } = lodash;\n\nconst { withGlobalEvents } = wp.compose;\nconst { Component } = wp.element;\n\nclass ImageSize extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t};\n\t\tthis.bindContainer = this.bindContainer.bind( this );\n\t\tthis.calculateSize = this.calculateSize.bind( this );\n\t}\n\n\tbindContainer( ref ) {\n\t\tthis.container = ref;\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.src !== prevProps.src ) {\n\t\t\tthis.setState( {\n\t\t\t\twidth: undefined,\n\t\t\t\theight: undefined,\n\t\t\t} );\n\t\t\tthis.fetchImageSize();\n\t\t}\n\n\t\tif ( this.props.dirtynessTrigger !== prevProps.dirtynessTrigger ) {\n\t\t\tthis.calculateSize();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.fetchImageSize();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.image ) {\n\t\t\tthis.image.onload = noop;\n\t\t}\n\t}\n\n\tfetchImageSize() {\n\t\tthis.image = new window.Image();\n\t\tthis.image.onload = this.calculateSize;\n\t\tthis.image.src = this.props.src;\n\t}\n\n\tcalculateSize() {\n\t\tconst maxWidth = this.container.clientWidth;\n\t\tconst exceedMaxWidth = this.image.width > maxWidth;\n\t\tconst ratio = this.image.height / this.image.width;\n\t\tconst width = exceedMaxWidth ? maxWidth : this.image.width;\n\t\tconst height = exceedMaxWidth ? maxWidth * ratio : this.image.height;\n\t\tthis.setState( { width, height } );\n\t}\n\n\trender() {\n\t\tconst sizes = {\n\t\t\timageWidth: this.image && this.image.width,\n\t\t\timageHeight: this.image && this.image.height,\n\t\t\tcontainerWidth: this.container && this.container.clientWidth,\n\t\t\tcontainerHeight: this.container && this.container.clientHeight,\n\t\t\timageWidthWithinContainer: this.state.width,\n\t\t\timageHeightWithinContainer: this.state.height,\n\t\t};\n\t\treturn (\n\t\t\t<div ref={ this.bindContainer }>\n\t\t\t\t{ this.props.children( sizes ) }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default withGlobalEvents( {\n\tresize: 'calculateSize',\n} )( ImageSize );\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/image-size.js","import classnames from \"classnames\";\n\nconst { __ } = wp.i18n;\nconst { Component , createRef } = wp.element;\nconst { Spinner, withSpokenMessages, Popover , TextControl } = wp.components;\nconst { withInstanceId } = wp.compose;\n\nclass ThirstyURLInput extends Component {\n\n /**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tconstructor( { autocompleteRef } ) {\n\t\tsuper( ...arguments );\n\n\t\t// this.onChange = this.onChange.bind( this );\n\t\t// this.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.autocompleteRef = autocompleteRef || createRef();\n\t\tthis.inputRef = createRef();\n\t\tthis.searchAffiliateLinks = this.searchAffiliateLinks.bind( this );\n\t\t// this.updateSuggestions = throttle( this.updateSuggestions.bind( this ), 200 );\n\n\t\tthis.suggestionNodes = [];\n\n\t\tthis.state = {\n\t\t\tposts : [],\n\t\t\tshowSuggestions : false,\n\t\t\tselectedSuggestion : null,\n\t\t\tloading : false\n\t\t};\n\t}\n\n\t/**\n * Component did update method.\n * \n * @since 3.6\n */\n\tcomponentDidUpdate() {\n\t\tconst { showSuggestions, selectedSuggestion } = this.state;\n\t\t// only have to worry about scrolling selected suggestion into view\n\t\t// when already expanded\n\t\tif ( showSuggestions && selectedSuggestion !== null && ! this.scrollingIntoView ) {\n\t\t\tthis.scrollingIntoView = true;\n\t\t\tscrollIntoView( this.suggestionNodes[ selectedSuggestion ], this.autocompleteRef.current, {\n\t\t\t\tonlyScrollIfNeeded: true,\n\t\t\t} );\n\n\t\t\tsetTimeout( () => {\n\t\t\t\tthis.scrollingIntoView = false;\n\t\t\t}, 100 );\n\t\t}\n\t}\n\n\t/**\n * Component unmount method.\n * \n * @since 3.6\n */\n\tcomponentWillUnmount() {\n\t\tdelete this.suggestionsRequest;\n\t}\n\n\t/**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\tbindSuggestionNode( index ) {\n\t\treturn ( ref ) => {\n\t\t\tthis.suggestionNodes[ index ] = ref;\n\t\t};\n\t}\n\t\n\tsearchAffiliateLinks( value ) {\n\n\t\t// Show the suggestions after typing at least 2 characters=\n\t\tif ( value.length < 2 ) {\n\t\t\tthis.setState( {\n\t\t\t\tshowSuggestions: false,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: false,\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState({\n\t\t\tshowSuggestions : true,\n\t\t\tselectedSuggestion : null,\n\t\t\tloading : true\n\t\t});\n\n\t\tconst formData = new FormData();\n formData.append( \"action\" , \"search_affiliate_links_query\" );\n formData.append( \"keyword\" , value );\n formData.append( \"paged\" , 1 );\n\t\tformData.append( \"gutenberg\" , true );\n\t\tformData.append( \"with_images\" , true );\n\t\t\n\t\t// We are getting data via the WP AJAX instead of rest API as it is not possible yet\n // to filter results with category value. This is to prepare next update to add category filter.\n const request = fetch( ajaxurl , {\n method : \"POST\",\n body : formData\n\t\t} );\n\t\t\n\t\trequest\n .then( response => response.json() )\n .then( ( response ) => {\n\n if ( ! response.affiliate_links ) return;\n\n const posts = response.affiliate_links;\n\n\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\treturn;\n }\n\n\t\t\tthis.setState( {\n\t\t\t\tposts,\n\t\t\t\tloading: false,\n } );\n\n\t\t\tif ( !! posts.length ) {\n\t\t\t\tthis.props.debouncedSpeak( sprintf( _n(\n\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\tposts.length\n\t\t\t\t), posts.length ), 'assertive' );\n\t\t\t} else {\n\t\t\t\tthis.props.debouncedSpeak( __( 'No results.' ), 'assertive' );\n }\n\n\t\t} ).catch( () => {\n\t\t\tif ( this.suggestionsRequest === request ) {\n\t\t\t\tthis.setState( {\n\t\t\t\t\tloading: false,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tthis.suggestionsRequest = request;\n\t}\n\n\t/**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\tselectLink( post ) {\n\t\t// this.props.onChange( post.link, post );\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: post,\n\t\t\tshowSuggestions: false,\n\t\t} );\n\n\t\tthis.props.updateImageSelection( post.images , post );\n\t}\n\n\t/**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\thandleOnClick( post ) {\n\t\tthis.selectLink( post );\n\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\t// this.inputRef.current.focus();\n\t}\n\n render() {\n const { value = '', autoFocus = true, instanceId } = this.props;\n const { showSuggestions , posts, selectedSuggestion , loading } = this.state;\n \n return (\n <div class=\"edit-search-affiliate-links\">\n\t\t\t\t<form\n\t\t\t\t\tclassName=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover\"\n\t\t\t\t\tonSubmit={ this.displayAffiliateImages }\n\t\t\t\t>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclassName=\"ta-search-affiliate-links\"\n\t\t\t\t\t\tplaceholder={ __( \"Type to search affiliate links\" ) }\n\t\t\t\t\t\tonChange={ this.searchAffiliateLinks }\n\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ ( loading ) && <Spinner /> }\n\n\t\t\t\t\t{ showSuggestions && !! posts.length && \n\t\t\t\t\t\t<Popover position=\"bottom\" focusOnMount={ false }>\n\t\t\t\t\t\t\t<div class=\"affilate-links-suggestions\">\n\t\t\t\t\t\t\t\t{ posts.map( ( post, index ) => (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\tkey={ post.id }\n\t\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t\t\t\t\tid={ `editor-url-input-suggestion-${ instanceId }-${ index }` }\n\t\t\t\t\t\t\t\t\t\tref={ this.bindSuggestionNode( index ) }\n\t\t\t\t\t\t\t\t\t\tclassName={ classnames( 'editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion,\n\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => this.handleOnClick( post ) }\n\t\t\t\t\t\t\t\t\t\taria-selected={ index === selectedSuggestion }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ post.title || __( '(no title)' ) }\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</Popover>\n\t\t\t\t\t}\n\t\t\t\t</form>\n </div>\n );\n }\n}\n\nexport default withSpokenMessages( withInstanceId( ThirstyURLInput ) );\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/search-input.js","import { taLink } from \"./ta-link\";\n\nconst { registerFormatType } = wp.richText;\n\n/**\n * Register custom formats.\n * \n * @since 3.6\n */\nexport default function registerFormats() {\n\n [\n taLink\n ].forEach( ( { name , ...settings } ) => registerFormatType( name , settings ) );\n}\n\n\n// WEBPACK FOOTER //\n// ./src/formats/index.js","import InlineAffiliateLinkUI from './inline';\n\nconst { __ } = wp.i18n;\nconst { Component , Fragment } = wp.element;\nconst { withSpokenMessages } = wp.components;\nconst { getTextContent , applyFormat , removeFormat , slice } = wp.richText;\nconst { isURL } = wp.url;\nconst { RichTextToolbarButton , RichTextShortcut } = wp.editor;\nconst { Path , SVG } = wp.components;\nconst { getRectangleFromRange } = wp.dom;\n\nconst name = \"ta/link\";\n\n/**\n * Custom Affiliate link format. When applied will wrap selected text with <ta href=\"\" linkid=\"\"></ta> custom element.\n * Custom element is implemented here as we are not allowed to use <a> tag due to Gutenberg limitations.\n * Element is converted to normal <a> tag on frontend via PHP script filtered on 'the_content'.\n * \n * @since 3.6\n */\nexport const taLink = {\n name,\n title : __( \"Affiliate Link\" ),\n tagName : \"ta\",\n className : null,\n attributes : {\n\t\turl : \"href\",\n\t\ttarget : \"target\"\n },\n edit : withSpokenMessages( class LinkEdit extends Component {\n\t\t\n\t\t/**\n\t\t * Component constructor.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\tconstructor() {\n\t\t\tsuper( ...arguments );\n\n\t\t\tthis.addLink = this.addLink.bind( this );\n\t\t\tthis.stopAddingLink = this.stopAddingLink.bind( this );\n\t\t\tthis.onRemoveFormat = this.onRemoveFormat.bind( this );\n\t\t\tthis.state = {\n\t\t\t\taddingLink: false,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Callback to set state to adding link status.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\taddLink() {\n\n\t\t\tconst { value, onChange } = this.props;\n\t\t\tconst text = getTextContent( slice( value ) );\n\n\t\t\tif ( text && isURL( text ) ) {\n\t\t\t\tonChange( applyFormat( value, { type: name, attributes: { url: text } } ) );\n\t\t\t} else {\n\t\t\t\tthis.setState( { addingLink: true } );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Callback to set state to stop adding link status.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\tstopAddingLink() {\n\t\t\tthis.setState( { addingLink: false } );\n\t\t}\n\n\t\t/**\n\t\t * Remove format event callback.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\tonRemoveFormat() {\n\t\t\tconst { value , onChange , speak } = this.props;\n\n\t\t\tonChange( removeFormat( value , name ) );\n\t\t\tspeak( __( \"Affiliate Link removed.\" ), \"assertive\" );\n\t\t}\n\n\t\t/**\n\t\t * Get selected anchor text.\n\t\t * \n\t\t * @since 3.9\n\t\t */\n\t\tgetAnchorRect() {\n\n\t\t\tconst selection = window.getSelection();\n\t\t\tconst range = selection.rangeCount > 0 ? selection.getRangeAt( 0 ) : null;\n\n\t\t\tif ( ! range ) return;\n\n\t\t\tlet rect = null;\n\n\t\t\tif ( this.state.addingLink ) {\n\t\t\t\trect = getRectangleFromRange( range );\n\t\t\t} else {\n\n\t\t\t\tlet element = range.startContainer;\n\n\t\t\t\t// If the caret is right before the element, select the next element.\n\t\t\t\telement = element.nextElementSibling || element;\n\n\t\t\t\twhile ( element.nodeType !== window.Node.ELEMENT_NODE ) {\n\t\t\t\t\telement = element.parentNode;\n\t\t\t\t}\n\n\t\t\t\tconst closest = element.closest( 'ta' );\n\t\t\t\tif ( closest ) {\n\t\t\t\t\trect = closest.getBoundingClientRect();\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\n\t\t\treturn rect;\n\t\t}\n\n\t\t/**\n\t\t * Component render method.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\trender() {\n\t\t\tconst { isActive , activeAttributes , value , onChange } = this.props;\n\n\t\t\tconst anchorRect = this.getAnchorRect();\n\n\t\t\treturn (\n\t\t\t\t<Fragment>\n\t\t\t\t\t<RichTextShortcut\n\t\t\t\t\t\ttype=\"access\"\n\t\t\t\t\t\tcharacter=\"s\"\n\t\t\t\t\t\tonUse={ this.onRemoveFormat }\n\t\t\t\t\t/>\n\t\t\t\t\t<RichTextShortcut\n\t\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t\tcharacter=\"l\"\n\t\t\t\t\t\tonUse={ this.addLink }\n\t\t\t\t\t/>\n\t\t\t\t\t<RichTextShortcut\n\t\t\t\t\t\ttype=\"primaryShift\"\n\t\t\t\t\t\tcharacter=\"l\"\n\t\t\t\t\t\tonUse={ this.onRemoveFormat }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isActive && <RichTextToolbarButton\n\t\t\t\t\t\ticon=\"editor-unlink\"\n\t\t\t\t\t\ttitle={ __( 'Remove Affiliate Link' ) }\n\t\t\t\t\t\tclassName=\"ta-unlink-button\"\n\t\t\t\t\t\tonClick={ this.onRemoveFormat }\n\t\t\t\t\t\tisActive={ isActive }\n\t\t\t\t\t\tshortcutType=\"primaryShift\"\n\t\t\t\t\t\tshortcutCharacter=\"l\"\n\t\t\t\t\t/> }\n\t\t\t\t\t{ ! isActive && <RichTextToolbarButton\n\t\t\t\t\t\ticon={ <SVG xmlns=\"http://www.w3.org/2000/svg\" width=\"16.688\" height=\"9.875\" viewBox=\"0 0 16.688 9.875\"><Path id=\"TA.svg\" fill=\"black\" class=\"cls-1\" d=\"M2.115,15.12H4.847L6.836,7.7H9.777l0.63-2.381H1.821L1.177,7.7H4.118Zm4.758,0H9.829l1.177-1.751h3.782l0.238,1.751h2.858L16.357,5.245H13.7Zm5.5-3.866,1.835-2.816,0.35,2.816H12.378Z\" transform=\"translate(-1.188 -5.25)\"/></SVG> }\n\t\t\t\t\t\ttitle={ __( 'Affiliate Link' ) }\n\t\t\t\t\t\tclassName=\"ta-link-button\"\n\t\t\t\t\t\tonClick={ this.addLink }\n\t\t\t\t\t\tshortcutType=\"primary\"\n\t\t\t\t\t\tshortcutCharacter=\"l\"\n\t\t\t\t\t/> }\n\t\t\t\t\t<InlineAffiliateLinkUI\n\t\t\t\t\t\taddingLink={ this.state.addingLink }\n\t\t\t\t\t\tstopAddingLink={ this.stopAddingLink }\n\t\t\t\t\t\tisActive={ isActive }\n\t\t\t\t\t\tactiveAttributes={ activeAttributes }\n\t\t\t\t\t\tanchorRect={ anchorRect }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t</Fragment>\n\t\t\t);\n\t\t}\n } )\n}\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/index.js","import classnames from \"classnames\";\nimport { isValidHref } from './utils';\nimport ThirstyURLPopover from './url-popover';\nimport ThirstyURLInput from './url-input';\n\nconst { __ } = wp.i18n;\nconst { Component , createRef } = wp.element;\nconst { ExternalLink , ToggleControl , IconButton , withSpokenMessages } = wp.components;\nconst { LEFT, RIGHT, UP, DOWN, BACKSPACE, ENTER } = wp.keycodes;\nconst { prependHTTP , safeDecodeURI , filterURLForDisplay } = wp.url;\nconst { create , insert , isCollapsed , applyFormat , getTextContent , slice } = wp.richText;\n\nconst stopKeyPropagation = ( event ) => event.stopPropagation();\n\n/**\n * Generates the format object that will be applied to the link text.\n * \n * @since 3.6\n *\n * @param {string} url The href of the link.\n * @param {boolean} linkid Affiliate link ID.\n * @param {Object} text The text that is being hyperlinked.\n *\n * @return {Object} The final format object.\n */\nfunction createLinkFormat( { url , linkid , text } ) {\n\tconst format = {\n\t\ttype: \"ta/link\",\n\t\tattributes: {\n\t\t\turl,\n\t\t\tlinkid : linkid.toString()\n\t\t},\n\t};\n\n\treturn format;\n}\n\n/**\n * Check if input is being show.\n * \n * @since 3.6\n * \n * @param {Object} props Component props.\n * @param {Object} state Component state.\n */\nfunction isShowingInput( props , state ) {\n\treturn props.addingLink || state.editLink;\n}\n\n/**\n * Affiliate Link editor JSX element.\n * \n * @since 3.6\n * \n * @param {Object} param0 Component props (destructred).\n */\nconst LinkEditor = ( { value , onChangeInputValue , onKeyDown , submitLink, invalidLink , resetInvalidLink , autocompleteRef } ) => (\n\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t<form\n\t\tclassName=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover\"\n\t\tonKeyPress={ stopKeyPropagation }\n\t\tonKeyDown={ onKeyDown }\n\t\tonSubmit={ submitLink }\n\t>\n\t\t<ThirstyURLInput\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChangeInputValue }\n\t\t\tautocompleteRef={ autocompleteRef }\n\t\t\tinvalidLink={ invalidLink }\n\t\t\tresetInvalidLink={ resetInvalidLink }\n\t\t/>\n\t\t<IconButton icon=\"editor-break\" label={ __( 'Apply' ) } type=\"submit\" />\n\t</form>\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n);\n\n/**\n * Affiliate link url viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nconst LinkViewerUrl = ( { url } ) => {\n\tconst prependedURL = prependHTTP( url );\n\tconst linkClassName = classnames( 'editor-format-toolbar__link-container-value block-editor-format-toolbar__link-container-value', {\n\t\t'has-invalid-link': ! isValidHref( prependedURL ),\n\t} );\n\n\tif ( ! url ) {\n\t\treturn <span className={ linkClassName }></span>;\n\t}\n\n\treturn (\n\t\t<ExternalLink\n\t\t\tclassName={ linkClassName }\n\t\t\thref={ url }\n\t\t>\n\t\t\t{ filterURLForDisplay( safeDecodeURI( url ) ) }\n\t\t</ExternalLink>\n\t);\n};\n\n/**\n * Affiliate link viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nconst LinkViewer = ( { url, editLink } ) => {\n\treturn (\n\t\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\t\t<div\n\t\t\tclassName=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content\"\n\t\t\tonKeyPress={ stopKeyPropagation }\n\t\t>\n\t\t\t<LinkViewerUrl url={ url } />\n\t\t\t<IconButton icon=\"edit\" label={ __( 'Edit' ) } onClick={ editLink } />\n\t\t</div>\n\t\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n\t);\n};\n\n/**\n * Inline affiliate link UI Component.\n * \n * @since 3.6\n * \n * @param {*} param0 Component props (destructred).\n */\nclass InlineAffiliateLinkUI extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.editLink = this.editLink.bind( this );\n\t\tthis.submitLink = this.submitLink.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.onChangeInputValue = this.onChangeInputValue.bind( this );\n\t\tthis.onClickOutside = this.onClickOutside.bind( this );\n\t\tthis.resetState = this.resetState.bind( this );\n\t\tthis.autocompleteRef = createRef();\n\t\tthis.resetInvalidLink = this.resetInvalidLink.bind( this );\n\n\t\tthis.state = {\n\t\t\tinputValue : '',\n\t\t\tlinkid : 0,\n\t\t\tpost : null,\n\t\t\tinvalidLink : false\n\t\t};\n\t}\n\n\t/**\n\t * Stop the key event from propagating up to ObserveTyping.startTypingInTextField.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {Object} event Event object.\n\t */\n\tonKeyDown( event ) {\n\t\tif ( [ LEFT, DOWN, RIGHT, UP, BACKSPACE, ENTER ].indexOf( event.keyCode ) > -1 ) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t}\n\n\t/**\n\t * Callback to set state when input value is changed.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} inputValue \n\t * @param {*} post \n\t */\n\tonChangeInputValue( inputValue , post = null ) {\n\t\tconst linkid = post ? post.id : 0;\n\t\tthis.setState( { inputValue , linkid , post } );\n\t}\n\n\t/**\n\t * Callback to set state when edit affiliate link (already inserted) is triggered.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} event \n\t */\n\teditLink( event ) {\n\t\tthis.setState( { editLink: true } );\n\t\tevent.preventDefault();\n\t}\n\n\t/**\n\t * Callback to apply the affiliate link format to the selected text or position in the active block.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} event \n\t */\n\tsubmitLink( event ) {\n\t\tconst { isActive, value, onChange, speak } = this.props;\n\t\tconst { inputValue, linkid , post } = this.state;\n\t\tconst url = prependHTTP( inputValue );\n\t\tconst selectedText = getTextContent( slice( value ) );\n\t\tconst format = createLinkFormat( {\n\t\t\turl,\n\t\t\tlinkid,\n\t\t\ttext: selectedText,\n\t\t} );\n\n\t\tevent.preventDefault();\n\n\t\tif ( ! linkid || ! post ) {\n\t\t\tthis.setState( { invalidLink : true } )\n\t\t\treturn;\n\t\t} \n\n\t\tif ( isCollapsed( value ) && ! isActive ) {\n\t\t\tconst toInsert = applyFormat( create( { text: post.title } ), format, 0, url.length );\n\t\t\tonChange( insert( value, toInsert ) );\n\t\t} else {\n\t\t\tonChange( applyFormat( value, format ) );\n\t\t}\n\n\t\tthis.resetState();\n\n\t\tif ( ! isValidHref( url ) ) {\n\t\t\tspeak( __( 'Warning: the link has been inserted but may have errors. Please test it.' ), 'assertive' );\n\t\t} else if ( isActive ) {\n\t\t\tspeak( __( 'Link edited.' ), 'assertive' );\n\t\t} else {\n\t\t\tspeak( __( 'Link inserted' ), 'assertive' );\n\t\t}\n\t}\n\n\t/**\n\t * Callback to run when users clicks outside the popover UI.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} event \n\t */\n\tonClickOutside( event ) {\n\t\t// The autocomplete suggestions list renders in a separate popover (in a portal),\n\t\t// so onClickOutside fails to detect that a click on a suggestion occured in the\n\t\t// LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and\n\t\t// return to avoid the popover being closed.\n\t\tconst autocompleteElement = this.autocompleteRef.current;\n\t\tif ( autocompleteElement && autocompleteElement.contains( event.target ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.resetState();\n\t}\n\n\t/**\n\t * Reset state callback.\n\t * \n\t * @since 3.6\n\t */\n\tresetState() {\n\t\tthis.props.stopAddingLink();\n\t\tthis.setState( { inputValue : '' , editLink: false } );\n\t\tthis.resetInvalidLink();\n\t}\n\n\t/**\n\t * Reset invalid link state callback. Separated as we need to run this independently from resetState() callback.\n\t * \n\t * @since 3.6\n\t */\n\tresetInvalidLink() {\n\t\tthis.setState( { invalidLink : false } );\n\t}\n\n\t/**\n\t * Component render method.\n\t *\n\t * @since 3.6\n\t */\n\trender() {\n\t\tconst { isActive, activeAttributes: { url , linkid }, addingLink, anchorRect, value, onChange } = this.props;\n\n\t\tif ( ! isActive && ! addingLink ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { inputValue , invalidLink } = this.state;\n\t\tconst showInput = isShowingInput( this.props, this.state );\n\n\t\treturn (\n\t\t\t<ThirstyURLPopover\n\t\t\t\tonClickOutside={ this.onClickOutside }\n\t\t\t\tonClose={ this.resetState }\n\t\t\t\tfocusOnMount={ showInput ? 'firstElement' : false }\n\t\t\t\tinvalidLink={ invalidLink }\n\t\t\t\tanchorRect= { anchorRect }\n\t\t\t>\n\t\t\t\t{ showInput ? (\n\t\t\t\t\t<LinkEditor\n\t\t\t\t\t\tvalue={ inputValue }\n\t\t\t\t\t\tonChangeInputValue={ this.onChangeInputValue }\n\t\t\t\t\t\tonKeyDown={ this.onKeyDown }\n\t\t\t\t\t\tsubmitLink={ this.submitLink }\n\t\t\t\t\t\tautocompleteRef={ this.autocompleteRef }\n\t\t\t\t\t\tupdateLinkId= { this.updateLinkId }\n\t\t\t\t\t\tinvalidLink={ invalidLink }\n\t\t\t\t\t\tresetInvalidLink={ this.resetInvalidLink }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<LinkViewer\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\teditLink={ this.editLink }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</ThirstyURLPopover>\n\t\t);\n\t}\n}\n\nexport default withSpokenMessages( InlineAffiliateLinkUI );\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/inline.js","const { startsWith } = lodash;\n\nconst {\n getProtocol,\n\tisValidProtocol,\n\tgetAuthority,\n\tisValidAuthority,\n\tgetPath,\n\tisValidPath,\n\tgetQueryString,\n\tisValidQueryString,\n\tgetFragment,\n\tisValidFragment,\n} = wp.url;\n\n/**\n * Check for issues with the provided href.\n * \n * @since 3.6\n *\n * @param {string} href The href.\n * @return {boolean} Is the href invalid?\n */\nexport function isValidHref( href ) {\n\tif ( ! href ) {\n\t\treturn false;\n\t}\n\n\tconst trimmedHref = href.trim();\n\n\tif ( ! trimmedHref ) {\n\t\treturn false;\n\t}\n\n\t// Does the href start with something that looks like a URL protocol?\n\tif ( /^\\S+:/.test( trimmedHref ) ) {\n\t\tconst protocol = getProtocol( trimmedHref );\n\t\tif ( ! isValidProtocol( protocol ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Add some extra checks for http(s) URIs, since these are the most common use-case.\n\t\t// This ensures URIs with an http protocol have exactly two forward slashes following the protocol.\n\t\tif ( startsWith( protocol, 'http' ) && ! /^https?:\\/\\/[^\\/\\s]/i.test( trimmedHref ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst authority = getAuthority( trimmedHref );\n\t\tif ( ! isValidAuthority( authority ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst path = getPath( trimmedHref );\n\t\tif ( path && ! isValidPath( path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst queryString = getQueryString( trimmedHref );\n\t\tif ( queryString && ! isValidQueryString( queryString ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst fragment = getFragment( trimmedHref );\n\t\tif ( fragment && ! isValidFragment( fragment ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Validate anchor links.\n\tif ( startsWith( trimmedHref, '#' ) && ! isValidFragment( trimmedHref ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/utils.js","const { __ } = wp.i18n;\nconst { Component } = wp.element;\nconst { Popover , IconButton } = wp.components;\n\n/**\n * Custom URL Popover component.\n * \n * @since 3.6\n */\nclass ThirstyURLPopover extends Component {\n\n /**\n * Component constructor method.\n * \n * @since 3.6\n */\n\tconstructor() {\n super( ...arguments );\n \n this.toggleSettingsVisibility = this.toggleSettingsVisibility.bind( this );\n\n\t\tthis.state = {\n\t\t\tisSettingsExpanded: false,\n\t\t};\n }\n \n /**\n * Component constructor.\n * \n * @since 3.6\n */\n toggleSettingsVisibility() {\n\t\tthis.setState( {\n\t\t\tisSettingsExpanded: ! this.state.isSettingsExpanded,\n\t\t} );\n\t}\n\n /**\n * Component render method.\n * \n * @since 3.6\n */\n\trender() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\trenderSettings,\n invalidLink,\n\t\t\tposition = 'bottom center',\n\t\t\tfocusOnMount = 'firstElement',\n\t\t\t...popoverProps\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tisSettingsExpanded,\n } = this.state;\n \n const showSettings = !! renderSettings && isSettingsExpanded;\n\n\t\treturn (\n\t\t\t<Popover\n\t\t\t\tclassName=\"ta-url-popover editor-url-popover block-editor-url-popover\"\n\t\t\t\tfocusOnMount={ focusOnMount }\n\t\t\t\tposition={ position }\n\t\t\t\t{ ...popoverProps }\n\t\t\t>\n\t\t\t\t<div className=\"editor-url-popover__row\">\n { children }\n { !! renderSettings && (\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\tclassName=\"editor-url-popover__settings-toggle\"\n\t\t\t\t\t\t\ticon=\"ellipsis\"\n\t\t\t\t\t\t\tlabel={ __( 'Link Settings' ) }\n\t\t\t\t\t\t\tonClick={ this.toggleSettingsVisibility }\n\t\t\t\t\t\t\taria-expanded={ isSettingsExpanded }\n\t\t\t\t\t\t/>\n ) }\n\t\t\t\t</div>\n { showSettings && (\n\t\t\t\t\t<div className=\"editor-url-popover__row editor-url-popover__settings\">\n\t\t\t\t\t\t{ renderSettings() }\n\t\t\t\t\t</div>\n ) }\n { invalidLink && <div class=\"ta-invalid-link\">{ __( 'Invalid affiliate link' ) }</div> }\n\t\t\t</Popover>\n\t\t);\n\t}\n}\n\nexport default ThirstyURLPopover;\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/url-popover.js","import classnames from 'classnames';\nimport scrollIntoView from 'dom-scroll-into-view';\n\nconst { __ } = wp.i18n;\nconst { throttle } = lodash;\nconst { Component , createRef } = wp.element;\nconst { UP, DOWN, ENTER, TAB } = wp.keycodes;\nconst { Spinner, withSpokenMessages, Popover } = wp.components;\nconst { withInstanceId } = wp.compose;\n\n// Since URLInput is rendered in the context of other inputs, but should be\n// considered a separate modal node, prevent keyboard events from propagating\n// as being considered from the input.\nconst stopEventPropagation = ( event ) => event.stopPropagation();\n\n/**\n * Custom URL Input component.\n * \n * @since 3.6\n */\nclass ThirstyURLInput extends Component {\n\n /**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tconstructor( { autocompleteRef } ) {\n\t\tsuper( ...arguments );\n\n\t\tthis.onChange = this.onChange.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.autocompleteRef = autocompleteRef || createRef();\n\t\tthis.inputRef = createRef();\n\t\tthis.updateSuggestions = throttle( this.updateSuggestions.bind( this ), 200 );\n\n\t\tthis.suggestionNodes = [];\n\n\t\tthis.state = {\n\t\t\tposts: [],\n\t\t\tshowSuggestions: false,\n\t\t\tselectedSuggestion: null,\n\t\t};\n\t}\n\n /**\n * Component did update method.\n * \n * @since 3.6\n */\n\tcomponentDidUpdate() {\n\t\tconst { showSuggestions, selectedSuggestion } = this.state;\n\t\t// only have to worry about scrolling selected suggestion into view\n\t\t// when already expanded\n\t\tif ( showSuggestions && selectedSuggestion !== null && ! this.scrollingIntoView ) {\n\t\t\tthis.scrollingIntoView = true;\n\t\t\tscrollIntoView( this.suggestionNodes[ selectedSuggestion ], this.autocompleteRef.current, {\n\t\t\t\tonlyScrollIfNeeded: true,\n\t\t\t} );\n\n\t\t\tsetTimeout( () => {\n\t\t\t\tthis.scrollingIntoView = false;\n\t\t\t}, 100 );\n\t\t}\n\t}\n\n /**\n * Component unmount method.\n * \n * @since 3.6\n */\n\tcomponentWillUnmount() {\n\t\tdelete this.suggestionsRequest;\n\t}\n\n /**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\tbindSuggestionNode( index ) {\n\t\treturn ( ref ) => {\n\t\t\tthis.suggestionNodes[ index ] = ref;\n\t\t};\n\t}\n\n /**\n * Callback to show suggestions based on value inputted on search field.\n * \n * @since 3.6\n * \n * @param {*} value \n */\n\tupdateSuggestions( value ) {\n\t\t// Show the suggestions after typing at least 2 characters\n\t\t// and also for URLs\n\t\tif ( value.length < 2 || /^https?:/.test( value ) ) {\n\t\t\tthis.setState( {\n\t\t\t\tshowSuggestions: false,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: false,\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState( {\n\t\t\tshowSuggestions: true,\n\t\t\tselectedSuggestion: null,\n\t\t\tloading: true,\n\t\t} );\n\n const formData = new FormData();\n formData.append( \"action\" , \"search_affiliate_links_query\" );\n formData.append( \"keyword\" , value );\n formData.append( \"paged\" , 1 );\n formData.append( \"gutenberg\" , true );\n \n // We are getting data via the WP AJAX instead of rest API as it is not possible yet\n // to filter results with category value. This is to prepare next update to add category filter.\n const request = fetch( ajaxurl , {\n method : \"POST\",\n body : formData\n } );\n\n request\n .then( response => response.json() )\n .then( ( response ) => {\n\n if ( ! response.affiliate_links ) return;\n\n const posts = response.affiliate_links;\n\n\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\treturn;\n }\n\n\t\t\tthis.setState( {\n\t\t\t\tposts,\n\t\t\t\tloading: false,\n } );\n\n\t\t\tif ( !! posts.length ) {\n\t\t\t\tthis.props.debouncedSpeak( sprintf( _n(\n\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\tposts.length\n\t\t\t\t), posts.length ), 'assertive' );\n\t\t\t} else {\n\t\t\t\tthis.props.debouncedSpeak( __( 'No results.' ), 'assertive' );\n }\n\n\t\t} ).catch( () => {\n\t\t\tif ( this.suggestionsRequest === request ) {\n\t\t\t\tthis.setState( {\n\t\t\t\t\tloading: false,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tthis.suggestionsRequest = request;\n\t}\n\n /**\n * Search input value change event callback method.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\tonChange( event ) {\n this.props.resetInvalidLink();\n\t\tconst inputValue = event.target.value;\n\t\tthis.props.onChange( inputValue );\n\t\tthis.updateSuggestions( inputValue );\n\t}\n\n /**\n * Keydown event callback. Handles selecting result via keyboard.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\tonKeyDown( event ) {\n\t\tconst { showSuggestions, selectedSuggestion, posts, loading } = this.state;\n\t\t// If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n\t\t// We shouldn't preventDefault to allow block arrow keys navigation\n\t\tif ( ! showSuggestions || ! posts.length || loading ) {\n\t\t\t// In the Windows version of Firefox the up and down arrows don't move the caret\n\t\t\t// within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n\t\t\t// a form of focus trapping that is disruptive to the user experience. This disruption\n\t\t\t// only happens if the caret is not in the first or last position in the text input.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n\t\t\tswitch ( event.keyCode ) {\n\t\t\t\t// When UP is pressed, if the caret is at the start of the text, move it to the 0\n\t\t\t\t// position.\n\t\t\t\tcase UP: {\n\t\t\t\t\tif ( 0 !== event.target.selectionStart ) {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to position 0\n\t\t\t\t\t\tevent.target.setSelectionRange( 0, 0 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// When DOWN is pressed, if the caret is not at the end of the text, move it to the\n\t\t\t\t// last position.\n\t\t\t\tcase DOWN: {\n\t\t\t\t\tif ( this.props.value.length !== event.target.selectionStart ) {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to the last position\n\t\t\t\t\t\tevent.target.setSelectionRange( this.props.value.length, this.props.value.length );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst post = this.state.posts[ this.state.selectedSuggestion ];\n\n\t\tswitch ( event.keyCode ) {\n\t\t\tcase UP: {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst previousIndex = ! selectedSuggestion ? posts.length - 1 : selectedSuggestion - 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: previousIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase DOWN: {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex = selectedSuggestion === null || ( selectedSuggestion === posts.length - 1 ) ? 0 : selectedSuggestion + 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: nextIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase TAB: {\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( post );\n\t\t\t\t\t// Announce a link has been selected when tabbing away from the input field.\n\t\t\t\t\tthis.props.speak( __( 'Link selected' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ENTER: {\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tthis.selectLink( post );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n /**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\tselectLink( post ) {\n\t\tthis.props.onChange( post.link, post );\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tshowSuggestions: false,\n\t\t} );\n\t}\n\n /**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\thandleOnClick( post ) {\n\t\tthis.selectLink( post );\n\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\tthis.inputRef.current.focus();\n\t}\n\n /**\n * Component render method.\n * \n * @since 3.6\n */\n\trender() {\n\t\tconst { value = '', autoFocus = true, instanceId , invalidLink } = this.props;\n\t\tconst { showSuggestions, posts, selectedSuggestion, loading } = this.state;\n\t\t/* eslint-disable jsx-a11y/no-autofocus */\n\t\treturn (\n\t\t\t<div className=\"editor-url-input block-editor-url-input\">\n\t\t\t\t<input\n\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\taria-label={ __( 'URL' ) }\n\t\t\t\t\trequired\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ this.onChange }\n\t\t\t\t\tonInput={ stopEventPropagation }\n\t\t\t\t\tplaceholder={ __( 'Paste URL or type to search' ) }\n\t\t\t\t\tonKeyDown={ this.onKeyDown }\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\taria-expanded={ showSuggestions }\n\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\taria-owns={ `editor-url-input-suggestions-${ instanceId }` }\n\t\t\t\t\taria-activedescendant={ selectedSuggestion !== null ? `editor-url-input-suggestion-${ instanceId }-${ selectedSuggestion }` : undefined }\n\t\t\t\t\tref={ this.inputRef }\n\t\t\t\t/>\n\n\t\t\t\t{ ( loading ) && <Spinner /> }\n\n\t\t\t\t{ showSuggestions && !! posts.length && ! invalidLink &&\n\t\t\t\t\t<Popover position=\"bottom\" noArrow focusOnMount={ false }>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"editor-url-input__suggestions block-editor-url-input__suggestions\"\n\t\t\t\t\t\t\tid={ `editor-url-input-suggestions-${ instanceId }` }\n\t\t\t\t\t\t\tref={ this.autocompleteRef }\n\t\t\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ posts.map( ( post, index ) => (\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\tkey={ post.id }\n\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t\t\t\tid={ `block-editor-url-input-suggestion-${ instanceId }-${ index }` }\n\t\t\t\t\t\t\t\t\tref={ this.bindSuggestionNode( index ) }\n\t\t\t\t\t\t\t\t\tclassName={ classnames( 'editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion,\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\tonClick={ () => this.handleOnClick( post ) }\n\t\t\t\t\t\t\t\t\taria-selected={ index === selectedSuggestion }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ post.title || __( '(no title)' ) }\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Popover>\n\t\t\t\t}\n\t\t\t</div>\n\t\t);\n\t\t/* eslint-enable jsx-a11y/no-autofocus */\n\t}\n}\n\nexport default withSpokenMessages( withInstanceId( ThirstyURLInput ) );\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/url-input.js","'use strict';\n\nmodule.exports = require('./dom-scroll-into-view');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dom-scroll-into-view/lib/index.js\n// module id = 14\n// module chunks = 0","'use strict';\n\nvar util = require('./util');\n\nfunction scrollIntoView(elem, container, config) {\n config = config || {};\n // document 归一化到 window\n if (container.nodeType === 9) {\n container = util.getWindow(container);\n }\n\n var allowHorizontalScroll = config.allowHorizontalScroll;\n var onlyScrollIfNeeded = config.onlyScrollIfNeeded;\n var alignWithTop = config.alignWithTop;\n var alignWithLeft = config.alignWithLeft;\n var offsetTop = config.offsetTop || 0;\n var offsetLeft = config.offsetLeft || 0;\n var offsetBottom = config.offsetBottom || 0;\n var offsetRight = config.offsetRight || 0;\n\n allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;\n\n var isWin = util.isWindow(container);\n var elemOffset = util.offset(elem);\n var eh = util.outerHeight(elem);\n var ew = util.outerWidth(elem);\n var containerOffset = undefined;\n var ch = undefined;\n var cw = undefined;\n var containerScroll = undefined;\n var diffTop = undefined;\n var diffBottom = undefined;\n var win = undefined;\n var winScroll = undefined;\n var ww = undefined;\n var wh = undefined;\n\n if (isWin) {\n win = container;\n wh = util.height(win);\n ww = util.width(win);\n winScroll = {\n left: util.scrollLeft(win),\n top: util.scrollTop(win)\n };\n // elem 相对 container 可视视窗的距离\n diffTop = {\n left: elemOffset.left - winScroll.left - offsetLeft,\n top: elemOffset.top - winScroll.top - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,\n top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom\n };\n containerScroll = winScroll;\n } else {\n containerOffset = util.offset(container);\n ch = container.clientHeight;\n cw = container.clientWidth;\n containerScroll = {\n left: container.scrollLeft,\n top: container.scrollTop\n };\n // elem 相对 container 可视视窗的距离\n // 注意边框, offset 是边框到根节点\n diffTop = {\n left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft,\n top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight,\n top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom\n };\n }\n\n if (diffTop.top < 0 || diffBottom.top > 0) {\n // 强制向上\n if (alignWithTop === true) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else if (alignWithTop === false) {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n } else {\n // 自动调整\n if (diffTop.top < 0) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;\n if (alignWithTop) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n }\n\n if (allowHorizontalScroll) {\n if (diffTop.left < 0 || diffBottom.left > 0) {\n // 强制向上\n if (alignWithLeft === true) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else if (alignWithLeft === false) {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n } else {\n // 自动调整\n if (diffTop.left < 0) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;\n if (alignWithLeft) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n }\n }\n}\n\nmodule.exports = scrollIntoView;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js\n// module id = 15\n// module chunks = 0","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar RE_NUM = /[\\-+]?(?:\\d*\\.|)\\d+(?:[eE][\\-+]?\\d+|)/.source;\n\nfunction getClientPosition(elem) {\n var box = undefined;\n var x = undefined;\n var y = undefined;\n var doc = elem.ownerDocument;\n var body = doc.body;\n var docElem = doc && doc.documentElement;\n // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式\n box = elem.getBoundingClientRect();\n\n // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop\n // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确\n // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin\n\n x = box.left;\n y = box.top;\n\n // In IE, most of the time, 2 extra pixels are added to the top and left\n // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and\n // IE6 standards mode, this border can be overridden by setting the\n // document element's border to zero -- thus, we cannot rely on the\n // offset always being 2 pixels.\n\n // In quirks mode, the offset can be determined by querying the body's\n // clientLeft/clientTop, but in standards mode, it is found by querying\n // the document element's clientLeft/clientTop. Since we already called\n // getClientBoundingRect we have already forced a reflow, so it is not\n // too expensive just to query them all.\n\n // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的\n // 窗口边框标准是设 documentElement ,quirks 时设置 body\n // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去\n // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置\n // 标准 ie 下 docElem.clientTop 就是 border-top\n // ie7 html 即窗口边框改变不了。永远为 2\n // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0\n\n x -= docElem.clientLeft || body.clientLeft || 0;\n y -= docElem.clientTop || body.clientTop || 0;\n\n return {\n left: x,\n top: y\n };\n}\n\nfunction getScroll(w, top) {\n var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];\n var method = 'scroll' + (top ? 'Top' : 'Left');\n if (typeof ret !== 'number') {\n var d = w.document;\n // ie6,7,8 standard mode\n ret = d.documentElement[method];\n if (typeof ret !== 'number') {\n // quirks mode\n ret = d.body[method];\n }\n }\n return ret;\n}\n\nfunction getScrollLeft(w) {\n return getScroll(w);\n}\n\nfunction getScrollTop(w) {\n return getScroll(w, true);\n}\n\nfunction getOffset(el) {\n var pos = getClientPosition(el);\n var doc = el.ownerDocument;\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScrollLeft(w);\n pos.top += getScrollTop(w);\n return pos;\n}\nfunction _getComputedStyle(elem, name, computedStyle_) {\n var val = '';\n var d = elem.ownerDocument;\n var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);\n\n // https://github.com/kissyteam/kissy/issues/61\n if (computedStyle) {\n val = computedStyle.getPropertyValue(name) || computedStyle[name];\n }\n\n return val;\n}\n\nvar _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');\nvar RE_POS = /^(top|right|bottom|left)$/;\nvar CURRENT_STYLE = 'currentStyle';\nvar RUNTIME_STYLE = 'runtimeStyle';\nvar LEFT = 'left';\nvar PX = 'px';\n\nfunction _getComputedStyleIE(elem, name) {\n // currentStyle maybe null\n // http://msdn.microsoft.com/en-us/library/ms535231.aspx\n var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];\n\n // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值\n // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19\n // 在 ie 下不对,需要直接用 offset 方式\n // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了\n\n // From the awesome hack by Dean Edwards\n // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n // If we're not dealing with a regular pixel number\n // but a number that has a weird ending, we need to convert it to pixels\n // exclude left right for relativity\n if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {\n // Remember the original values\n var style = elem.style;\n var left = style[LEFT];\n var rsLeft = elem[RUNTIME_STYLE][LEFT];\n\n // prevent flashing of content\n elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];\n\n // Put in the new values to get a computed value out\n style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;\n ret = style.pixelLeft + PX;\n\n // Revert the changed values\n style[LEFT] = left;\n\n elem[RUNTIME_STYLE][LEFT] = rsLeft;\n }\n return ret === '' ? 'auto' : ret;\n}\n\nvar getComputedStyleX = undefined;\nif (typeof window !== 'undefined') {\n getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;\n}\n\nfunction each(arr, fn) {\n for (var i = 0; i < arr.length; i++) {\n fn(arr[i]);\n }\n}\n\nfunction isBorderBoxFn(elem) {\n return getComputedStyleX(elem, 'boxSizing') === 'border-box';\n}\n\nvar BOX_MODELS = ['margin', 'border', 'padding'];\nvar CONTENT_INDEX = -1;\nvar PADDING_INDEX = 2;\nvar BORDER_INDEX = 1;\nvar MARGIN_INDEX = 0;\n\nfunction swap(elem, options, callback) {\n var old = {};\n var style = elem.style;\n var name = undefined;\n\n // Remember the old values, and insert the new ones\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n old[name] = style[name];\n style[name] = options[name];\n }\n }\n\n callback.call(elem);\n\n // Revert the old values\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n style[name] = old[name];\n }\n }\n}\n\nfunction getPBMWidth(elem, props, which) {\n var value = 0;\n var prop = undefined;\n var j = undefined;\n var i = undefined;\n for (j = 0; j < props.length; j++) {\n prop = props[j];\n if (prop) {\n for (i = 0; i < which.length; i++) {\n var cssProp = undefined;\n if (prop === 'border') {\n cssProp = prop + which[i] + 'Width';\n } else {\n cssProp = prop + which[i];\n }\n value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;\n }\n }\n }\n return value;\n}\n\n/**\n * A crude way of determining if an object is a window\n * @member util\n */\nfunction isWindow(obj) {\n // must use == for ie8\n /* eslint eqeqeq:0 */\n return obj != null && obj == obj.window;\n}\n\nvar domUtils = {};\n\neach(['Width', 'Height'], function (name) {\n domUtils['doc' + name] = function (refWin) {\n var d = refWin.document;\n return Math.max(\n // firefox chrome documentElement.scrollHeight< body.scrollHeight\n // ie standard mode : documentElement.scrollHeight> body.scrollHeight\n d.documentElement['scroll' + name],\n // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?\n d.body['scroll' + name], domUtils['viewport' + name](d));\n };\n\n domUtils['viewport' + name] = function (win) {\n // pc browser includes scrollbar in window.innerWidth\n var prop = 'client' + name;\n var doc = win.document;\n var body = doc.body;\n var documentElement = doc.documentElement;\n var documentElementProp = documentElement[prop];\n // 标准模式取 documentElement\n // backcompat 取 body\n return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;\n };\n});\n\n/*\n 得到元素的大小信息\n @param elem\n @param name\n @param {String} [extra] 'padding' : (css width) + padding\n 'border' : (css width) + padding + border\n 'margin' : (css width) + padding + border + margin\n */\nfunction getWH(elem, name, extra) {\n if (isWindow(elem)) {\n return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);\n } else if (elem.nodeType === 9) {\n return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);\n }\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem, computedStyle);\n var cssBoxValue = 0;\n if (borderBoxValue == null || borderBoxValue <= 0) {\n borderBoxValue = undefined;\n // Fall back to computed then un computed css if necessary\n cssBoxValue = getComputedStyleX(elem, name);\n if (cssBoxValue == null || Number(cssBoxValue) < 0) {\n cssBoxValue = elem.style[name] || 0;\n }\n // Normalize '', auto, and prepare for extra\n cssBoxValue = parseFloat(cssBoxValue) || 0;\n }\n if (extra === undefined) {\n extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;\n }\n var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;\n var val = borderBoxValue || cssBoxValue;\n if (extra === CONTENT_INDEX) {\n if (borderBoxValueOrIsBorderBox) {\n return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);\n }\n return cssBoxValue;\n }\n if (borderBoxValueOrIsBorderBox) {\n var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);\n return val + (extra === BORDER_INDEX ? 0 : padding);\n }\n return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);\n}\n\nvar cssShow = {\n position: 'absolute',\n visibility: 'hidden',\n display: 'block'\n};\n\n// fix #119 : https://github.com/kissyteam/kissy/issues/119\nfunction getWHIgnoreDisplay(elem) {\n var val = undefined;\n var args = arguments;\n // in case elem is window\n // elem.offsetWidth === undefined\n if (elem.offsetWidth !== 0) {\n val = getWH.apply(undefined, args);\n } else {\n swap(elem, cssShow, function () {\n val = getWH.apply(undefined, args);\n });\n }\n return val;\n}\n\nfunction css(el, name, v) {\n var value = v;\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n for (var i in name) {\n if (name.hasOwnProperty(i)) {\n css(el, i, name[i]);\n }\n }\n return undefined;\n }\n if (typeof value !== 'undefined') {\n if (typeof value === 'number') {\n value += 'px';\n }\n el.style[name] = value;\n return undefined;\n }\n return getComputedStyleX(el, name);\n}\n\neach(['width', 'height'], function (name) {\n var first = name.charAt(0).toUpperCase() + name.slice(1);\n domUtils['outer' + first] = function (el, includeMargin) {\n return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);\n };\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n\n domUtils[name] = function (elem, val) {\n if (val !== undefined) {\n if (elem) {\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem);\n if (isBorderBox) {\n val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);\n }\n return css(elem, name, val);\n }\n return undefined;\n }\n return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);\n };\n});\n\n// 设置 elem 相对 elem.ownerDocument 的坐标\nfunction setOffset(elem, offset) {\n // set position first, in-case top/left are set even on static elem\n if (css(elem, 'position') === 'static') {\n elem.style.position = 'relative';\n }\n\n var old = getOffset(elem);\n var ret = {};\n var current = undefined;\n var key = undefined;\n\n for (key in offset) {\n if (offset.hasOwnProperty(key)) {\n current = parseFloat(css(elem, key)) || 0;\n ret[key] = current + offset[key] - old[key];\n }\n }\n css(elem, ret);\n}\n\nmodule.exports = _extends({\n getWindow: function getWindow(node) {\n var doc = node.ownerDocument || node;\n return doc.defaultView || doc.parentWindow;\n },\n offset: function offset(el, value) {\n if (typeof value !== 'undefined') {\n setOffset(el, value);\n } else {\n return getOffset(el);\n }\n },\n\n isWindow: isWindow,\n each: each,\n css: css,\n clone: function clone(obj) {\n var ret = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret[i] = obj[i];\n }\n }\n var overflow = obj.overflow;\n if (overflow) {\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret.overflow[i] = obj.overflow[i];\n }\n }\n }\n return ret;\n },\n scrollLeft: function scrollLeft(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollLeft(w);\n }\n window.scrollTo(v, getScrollTop(w));\n } else {\n if (v === undefined) {\n return w.scrollLeft;\n }\n w.scrollLeft = v;\n }\n },\n scrollTop: function scrollTop(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollTop(w);\n }\n window.scrollTo(getScrollLeft(w), v);\n } else {\n if (v === undefined) {\n return w.scrollTop;\n }\n w.scrollTop = v;\n }\n },\n\n viewportWidth: 0,\n viewportHeight: 0\n}, domUtils);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dom-scroll-into-view/lib/util.js\n// module id = 16\n// module chunks = 0"],"sourceRoot":""}
js/app/gutenberg_support/src/assets/styles/index.scss CHANGED
@@ -80,58 +80,6 @@ ta,
80
  }
81
  }
82
 
83
-
84
- .wp-block-image {
85
- max-width: 100%;
86
- margin-bottom: 1em;
87
- margin-left: 0;
88
- margin-right: 0
89
-
90
- img {
91
- max-width: 100%;
92
- }
93
-
94
- &.aligncenter {
95
- text-align: center;
96
- }
97
-
98
- &.alignfull,
99
- &.alignwide {
100
-
101
- img {
102
- width: 100%;
103
- }
104
- }
105
-
106
- &.aligncenter,
107
- &.alignleft,
108
- &.alignright {
109
- display: table;
110
- margin-left: 0;
111
- margin-right: 0;
112
-
113
- > figcaption {
114
- display: table-caption;
115
- caption-side: bottom
116
- }
117
- }
118
-
119
- &.alignleft {
120
- float: left;
121
- margin-right: 1em
122
- }
123
-
124
- &.alignright {
125
- float: right;
126
- margin-left: 1em
127
- }
128
-
129
- &.aligncenter {
130
- margin-left: auto;
131
- margin-right: auto
132
- }
133
- }
134
-
135
  [data-type="ta/image"][data-align=center],
136
  [data-type="ta/image"][data-align=left],
137
  [data-type="ta/image"][data-align=right] {
@@ -181,7 +129,7 @@ ta,
181
  }
182
 
183
  .editor-block-list__block[data-type="ta/image"] {
184
-
185
  &[data-align=center] {
186
 
187
  .wp-block-image {
80
  }
81
  }
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  [data-type="ta/image"][data-align=center],
84
  [data-type="ta/image"][data-align=left],
85
  [data-type="ta/image"][data-align=right] {
129
  }
130
 
131
  .editor-block-list__block[data-type="ta/image"] {
132
+
133
  &[data-align=center] {
134
 
135
  .wp-block-image {
js/app/ta-admin.js ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+ // Flyout Menu Elements.
3
+ var $flyoutMenu = $( '#caseproof-flyout' );
4
+
5
+ if ( $flyoutMenu.length === 0 ) {
6
+ return;
7
+ }
8
+
9
+ var $head = $flyoutMenu.find( '.caseproof-flyout-head' ),
10
+ $sullie = $head.find( 'img' ),
11
+ menu = {
12
+ state: 'inactive',
13
+ srcInactive: $sullie.attr( 'src' ),
14
+ srcActive: $sullie.data( 'active' ),
15
+ };
16
+
17
+ // Click on the menu head icon.
18
+ $head.on( 'click', function( e ) {
19
+
20
+ e.preventDefault();
21
+
22
+ if ( menu.state === 'active' ) {
23
+ $flyoutMenu.removeClass( 'opened' );
24
+ $sullie.attr( 'src', menu.srcInactive );
25
+ menu.state = 'inactive';
26
+ } else {
27
+ $flyoutMenu.addClass( 'opened' );
28
+ $sullie.attr( 'src', menu.srcActive );
29
+ menu.state = 'active';
30
+ }
31
+ } );
32
+
33
+ // Page elements and other values.
34
+ var $wpfooter = $( '#wpfooter' );
35
+
36
+ if ( $wpfooter.length === 0 ) {
37
+ return;
38
+ }
39
+
40
+ var $overlap = $( '#caseproof-overview, #caseproof-entries-list, #caseproof-tools.caseproof-tools-tab-action-scheduler' ),
41
+ wpfooterTop = $wpfooter.offset().top,
42
+ wpfooterBottom = wpfooterTop + $wpfooter.height(),
43
+ overlapBottom = $overlap.length > 0 ? $overlap.offset().top + $overlap.height() + 85 : 0;
44
+
45
+ // Hide menu if scrolled down to the bottom of the page.
46
+ $( window ).on( 'resize scroll', function( e ) {
47
+
48
+ var viewTop = $( window ).scrollTop(),
49
+ viewBottom = viewTop + $( window ).height();
50
+
51
+ if ( wpfooterBottom <= viewBottom && wpfooterTop >= viewTop && overlapBottom > viewBottom ) {
52
+ $flyoutMenu.addClass( 'out' );
53
+ } else {
54
+ $flyoutMenu.removeClass( 'out' );
55
+ }
56
+ } );
57
+
58
+ // $( window ).trigger( 'scroll' );
59
+ });
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: affiliate, link, affiliate link management, link cloaker, link redirect, s
5
  Requires at least: 5.0
6
  Requires PHP: 5.6
7
  Tested up to: 5.5
8
- Stable tag: 3.9.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -159,6 +159,11 @@ See our [Knowledge Base](https://thirstyaffiliates.com/knowledge-base/?utm_sourc
159
 
160
  == Changelog ==
161
 
 
 
 
 
 
162
  = 3.9.4 =
163
  * Bug Fix: Conflict with the SmartCrawl Pro plugin
164
 
5
  Requires at least: 5.0
6
  Requires PHP: 5.6
7
  Tested up to: 5.5
8
+ Stable tag: 3.10.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
159
 
160
  == Changelog ==
161
 
162
+ = 3.10.0 =
163
+ * Changed: Admin UI tweaks
164
+ * Bug Fix: Remove styles affecting WP core image block
165
+ * Bug Fix: Notice errors when Elementor is installed
166
+
167
  = 3.9.4 =
168
  * Bug Fix: Conflict with the SmartCrawl Pro plugin
169
 
thirstyaffiliates.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: ThirstyAffiliates
4
  * Plugin URI: http://thirstyaffiliates.com/
5
  * Description: ThirstyAffiliates is a revolution in affiliate link management. Collect, collate and store your affiliate links for use in your posts and pages.
6
- * Version: 3.9.4
7
  * Author: Caseproof
8
  * Author URI: https://caseproof.com/
9
  * Requires at least: 4.5
3
  * Plugin Name: ThirstyAffiliates
4
  * Plugin URI: http://thirstyaffiliates.com/
5
  * Description: ThirstyAffiliates is a revolution in affiliate link management. Collect, collate and store your affiliate links for use in your posts and pages.
6
+ * Version: 3.10.0
7
  * Author: Caseproof
8
  * Author URI: https://caseproof.com/
9
  * Requires at least: 4.5
views/amazon-import/amazon-import.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
2
+
3
+ <div class="ta-blur-wrap">
4
+ <div class="ta-blur">
5
+ <div id="main-controls">
6
+ <div id="search-controls">
7
+ <h3 class="title">Search Amazon For Products</h3>
8
+ <p class="desc">Please <a href="#">input these required amazon credentials</a> in order to successfully query the Amazon Product Advertisement API:<br><b>Amazon Access Key ID</b> , <b>Amazon Secret Key</b> , <b>Amazon Associate Tags</b></p>
9
+ </div>
10
+ <div id="legend">
11
+ <h3 class="title">Legend</h3>
12
+ <ul>
13
+ <li class="import-link"><span class="icon"></span><span class="text">Import Link</span></li>
14
+ <li class="quick-import"><span class="icon"></span><span class="text">1-Click Import Link</span></li>
15
+ </ul>
16
+ </div>
17
+ <div style="float: none; display: block; clear: both;"></div>
18
+ </div>
19
+ <div id="search-results">
20
+ <div id="search-results-table_wrapper" class="dataTables_wrapper">
21
+ <div class="bulkactions" style="display: inline-block; margin-right: 10px;"><select id="bulk-action-selector" autocomplete="off">
22
+ <option value="">Bulk Actions</option>
23
+ <option value="import">Import</option>
24
+ <option value="delete">Delete Imported Link</option>
25
+ </select><input type="button" id="do-bulk-action" class="button action" value="Apply"></div>
26
+ <div style="display: inline-block;" id="search-results-table_filter" class="dataTables_filter"><label>Filter Results:<input type="search" class="" placeholder="" aria-controls="search-results-table"></label></div>
27
+ <table style="margin: 20px 0;" id="search-results-table" class="wp-list-table widefat fixed striped posts dataTable" cellspacing="0" width="100%" role="grid" aria-describedby="search-results-table_info" style="width: 100%;">
28
+ <thead>
29
+ <tr role="row">
30
+ <th class="manage-column check-column sorting_disabled" style="padding: 10px 3px 6px; width: 30px;" rowspan="1" colspan="1" aria-label=""><input type="checkbox" id="select-all-search-results-top" class="select-all-search-results"></th>
31
+ <th class="image sorting_disabled" rowspan="1" colspan="1" style="width: 380px;" aria-label="Image">Image</th>
32
+ <th class="title sorting" tabindex="0" aria-controls="search-results-table" rowspan="1" colspan="1" style="width: 381px;" aria-label="Title: activate to sort column ascending">Title</th>
33
+ <th class="controls-column sorting_disabled" rowspan="1" colspan="1" style="width: 381px;" aria-label="Import Link">Import Link</th>
34
+ </tr>
35
+ </thead>
36
+ <tfoot>
37
+ <tr>
38
+ <th class="manage-column check-column sorting_disabled" style="padding: 10px 3px 6px 3px;" rowspan="1" colspan="1"><input type="checkbox" id="select-all-search-results-top" class="select-all-search-results"></th>
39
+ <th class="image" rowspan="1" colspan="1">Image</th>
40
+ <th class="title" rowspan="1" colspan="1">Title</th>
41
+ <th class="controls-column" rowspan="1" colspan="1">Import Link</th>
42
+ </tr>
43
+ </tfoot>
44
+ <tbody>
45
+ <tr class="odd">
46
+ <td valign="top" colspan="7" class="dataTables_empty">No Data Available</td>
47
+ </tr>
48
+ </tbody>
49
+ </table>
50
+ <div class="dataTables_info" id="search-results-table_info" role="status" aria-live="polite"><p>Showing 0 to 0 of 0 entries</p></div>
51
+ <div class="tap-amazon-load-more"><button type="button" class="button"><span class="tap-amazon-button-text">Load More</span><span class="spinner" style="display: none;"></span></button></div>
52
+ </div><!-- #search-results-table -->
53
+ </div>
54
+ </div>
55
+ <?php
56
+ $section_title = 'Import Affiliate Links from Amazon';
57
+ $upgrade_link = 'https://thirstyaffiliates.com/pricing?utm_source=plugin_admin&utm_medium=link&utm_campaign=in_plugin&utm_content=amazon_import';
58
+ include_once $this->_constants->VIEWS_ROOT_PATH() . 'ta-upgrade.php';
59
+ ?>
60
+ </div>
views/event-notifications/event-notifications.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
2
+
3
+ <div class="ta-blur-wrap">
4
+ <div class="ta-blur">
5
+ <div id="col-container" class="wp-clearfix">
6
+ <div id="col-left">
7
+ <div class="col-wrap">
8
+ <div class="form-wrap">
9
+ <h2>Add New Event Notification</h2>
10
+ <form id="addtag" method="post" class="validate">
11
+ <div class="event-notification-description">
12
+ <p>Event notifications allow you to send a notification to someone when some significant event happens with your affiliate links.</p>
13
+ <p>You can setup different event notifications here, then assign one or more to an affiliate link and ThirstyAffiliates will monitor that link for those events.</p>
14
+ </div>
15
+ <div class="form-field form-required term-xname-wrap">
16
+ <label for="tag-name">
17
+ Name: </label>
18
+ <inputname" id="tag-name" type="text" value="" size="40" aria-required="true">
19
+ <p>Give your event notification a name for internal reference.</p>
20
+ </div>
21
+ <div class="form-field term-recipient-wrap">
22
+ <label for="tag-name">
23
+ Recipient Email: </label>
24
+ <input id="recipient_email" type="email" value="" size="40" aria-required="true" placeholder="admin@test.com">
25
+ </div>
26
+ <div class="form-field form-required event-nofication-type-wrap">
27
+ <label for="event_notification_type">
28
+ Notification Type: </label>
29
+ <div class="radio-list" id="tap_event_notification_type">
30
+ <label>
31
+ <input type="radio" value="click_count_email" checked="" required="">
32
+ Send an email when the link reaches a defined number of clicks. </label>
33
+ <label>
34
+ <input type="radio" value="click_count_email_24hours" checked="" required="">
35
+ Send an email when the link reaches a defined number of clicks within 24 hours. </label>
36
+ </div>
37
+ </div>
38
+ <div class="form-field form-required event-notification-trigger-value-wrap">
39
+ <label>
40
+ Trigger Value: </label>
41
+ <input type="number" id="tap_event_notification_trigger_value" min="1" required="">
42
+ </div>
43
+ <p class="submit">
44
+ <input type="submit" id="submit" class="button button-primary" value="Add New Event Notification"> <span class="spinner"></span>
45
+ </p>
46
+ </form>
47
+ </div>
48
+ </div>
49
+ </div><!-- /col-left -->
50
+ <div id="col-right">
51
+ <div class="col-wrap">
52
+ <form id="posts-filter" method="post">
53
+ <div class="tablenav top">
54
+ <div class="alignleft actions bulkactions">
55
+ <label for="bulk-action-selector-top" class="screen-reader-text">Select bulk action</label><select id="bulk-action-selector-top">
56
+ <option value="-1">Bulk Actions</option>
57
+ <option value="delete">Delete</option>
58
+ </select>
59
+ <input type="submit" id="doaction" class="button action" value="Apply">
60
+ </div>
61
+ <div class="tablenav-pages no-pages"><span class="displaying-num">0 items</span>
62
+ <span class="pagination-links"><span class="tablenav-pages-navspan button disabled" aria-hidden="true">«</span>
63
+ <span class="tablenav-pages-navspan button disabled" aria-hidden="true">‹</span>
64
+ <span class="paging-input"><label for="current-page-selector" class="screen-reader-text">Current Page</label><input class="current-page" id="current-page-selector" type="text" value="1" size="1" aria-describedby="table-paging"><span class="tablenav-paging-text"> of <span class="total-pages">0</span></span></span>
65
+ <a class="next-page button" href="#"><span class="screen-reader-text">Next page</span><span aria-hidden="true">›</span></a>
66
+ <a class="last-page button" href="#"><span class="screen-reader-text">Last page</span><span aria-hidden="true">»</span></a></span></div>
67
+ <br class="clear">
68
+ </div>
69
+ <h2 class="screen-reader-text">Event notification list</h2>
70
+ <table class="wp-list-table widefat fixed striped tags">
71
+ <thead>
72
+ <tr>
73
+ <td id="cb" class="manage-column column-cb check-column"><label class="screen-reader-text" for="cb-select-all-1">Select All</label><input id="cb-select-all-1" type="checkbox"></td>
74
+ <th scope="col" id="name" class="manage-column column-name column-primary sortable desc"><a href="#"><span>Name</span><span class="sorting-indicator"></span></a></th>
75
+ <th scope="col" id="event_notification_type" class="manage-column column-event_notification_type">Notification Type</th>
76
+ <th scope="col" id="event_trigger_value" class="manage-column column-event_trigger_value">Trigger Value</th>
77
+ <th scope="col" id="posts" class="manage-column column-posts num sortable desc"><a href="#"><span>Count</span><span class="sorting-indicator"></span></a></th>
78
+ </tr>
79
+ </thead>
80
+ <tbody id="the-list" data-wp-lists="list:tag">
81
+ <tr class="no-items">
82
+ <td class="colspanchange" colspan="5">Not Found</td>
83
+ </tr>
84
+ </tbody>
85
+ <tfoot>
86
+ <tr>
87
+ <td class="manage-column column-cb check-column"><label class="screen-reader-text" for="cb-select-all-2">Select All</label><input id="cb-select-all-2" type="checkbox"></td>
88
+ <th scope="col" class="manage-column column-name column-primary sortable desc"><a href="#"><span>Name</span><span class="sorting-indicator"></span></a></th>
89
+ <th scope="col" class="manage-column column-event_notification_type">Notification Type</th>
90
+ <th scope="col" class="manage-column column-event_trigger_value">Trigger Value</th>
91
+ <th scope="col" class="manage-column column-posts num sortable desc"><a href="#"><span>Count</span><span class="sorting-indicator"></span></a></th>
92
+ </tr>
93
+ </tfoot>
94
+ </table>
95
+ <div class="tablenav bottom">
96
+ <div class="alignleft actions bulkactions">
97
+ <label for="bulk-action-selector-bottom" class="screen-reader-text">Select bulk action</label><select id="bulk-action-selector-bottom">
98
+ <option value="-1">Bulk Actions</option>
99
+ <option value="delete">Delete</option>
100
+ </select>
101
+ <input type="submit" id="doaction2" class="button action" value="Apply">
102
+ </div>
103
+ <div class="tablenav-pages no-pages"><span class="displaying-num">0 items</span>
104
+ <span class="pagination-links"><span class="tablenav-pages-navspan button disabled" aria-hidden="true">«</span>
105
+ <span class="tablenav-pages-navspan button disabled" aria-hidden="true">‹</span>
106
+ <span class="screen-reader-text">Current Page</span><span id="table-paging" class="paging-input"><span class="tablenav-paging-text">1 of <span class="total-pages">0</span></span></span>
107
+ <a class="next-page button" href="#"><span class="screen-reader-text">Next page</span><span aria-hidden="true">›</span></a>
108
+ <a class="last-page button" href="#"><span class="screen-reader-text">Last page</span><span aria-hidden="true">»</span></a></span></div>
109
+ <br class="clear">
110
+ </div>
111
+ </form>
112
+ </div>
113
+ </div><!-- /col-right -->
114
+ </div>
115
+ </div>
116
+ <?php
117
+ $section_title = 'Event Notifications from Amazon';
118
+ $upgrade_link = 'https://thirstyaffiliates.com/pricing?utm_source=plugin_admin&utm_medium=link&utm_campaign=in_plugin&utm_content=event_notifications';
119
+ include_once $this->_constants->VIEWS_ROOT_PATH() . 'ta-upgrade.php';
120
+ ?>
121
+ </div>
views/exporter/exporter.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
2
+
3
+ <div class="ta-blur-wrap">
4
+
5
+ <div class="ta-blur">
6
+
7
+ <h3><?php _e( 'STEP 1 - Export your links:' , 'thirstyaffiliates' ); ?></h3>
8
+
9
+ <p>
10
+ <?php _e( 'This tool lets you export a properly formatted CSV file containing a list of all the affiliate links on this website. This CSV file will be compatible with the ThirstyAffiliates CSV Importer.' , 'thirstyaffiliates' ); ?>
11
+ </p>
12
+
13
+ <p>
14
+ <?php _e( 'You can choose to only export the links from a specific category.' , 'thirstyaffiliates' ); ?>
15
+ </p>
16
+
17
+ <form class="tap-round-box" id="tap_upload_csv_form" enctype="multipart/form-data" method="post">
18
+
19
+ <p>
20
+ <label for="export_category">
21
+ <?php _e( 'Category to export from:' , 'thirstyaffiliates' ); ?>
22
+ </label>
23
+ <select id="export_category">
24
+ <option value="all" selected="selected"><?php _e( '-- All Categories --' , 'thirstyaffiliates' ); ?></option>
25
+ </select>
26
+ </p>
27
+
28
+ <p>
29
+ <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Export affiliate links' , 'thirstyaffiliates' ); ?>" />
30
+ <span class="spinner"></span>
31
+ </p>
32
+
33
+ </form>
34
+
35
+ </div>
36
+
37
+ <?php
38
+ $section_title = 'ThirstyAffiliates CSV Exporter';
39
+ $upgrade_link = 'https://thirstyaffiliates.com/pricing?utm_source=plugin_admin&utm_medium=link&utm_campaign=in_plugin&utm_content=exporter';
40
+ include_once $this->_constants->VIEWS_ROOT_PATH() . 'ta-upgrade.php';
41
+ ?>
42
+
43
+ </div>
views/importer/importer.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
2
+
3
+ <div class="ta-blur-wrap">
4
+
5
+ <div class="ta-blur">
6
+
7
+ <h3><?php _e( 'STEP 1 - select your CSV file:' , 'thirstyaffiliates' ); ?></h3>
8
+
9
+ <p>
10
+ <?php _e( 'This tool lets you upload a properly formatted CSV file containing a list of affiliate links. These links will be bulk imported for you directly into ThirstyAffiliates.' , 'thirstyaffiliates' ); ?>
11
+ </p>
12
+
13
+ <p>
14
+ <?php _e( 'Any categories you specify in your import file that are not found in the system will be created as the links are imported' , 'thirstyaffiliates' ); ?>
15
+ </p>
16
+
17
+ <form class="tap-round-box" id="tap_upload_csv_form" enctype="multipart/form-data" method="post">
18
+ <p>
19
+ <strong>Import from CSV</strong>
20
+ </p>
21
+ <p>
22
+ Maximum file size: 128 MB </p>
23
+ <p>
24
+ <label for="import">
25
+ <input type="file" id="import" name="import">
26
+ Select a CSV file (comma delimited .csv) </label>
27
+ </p>
28
+ <p>
29
+ <label for="override_links">
30
+ <input type="checkbox" id="override_links" name="override_links">
31
+ Override already existing links with the same slug? </label>
32
+ </p>
33
+ <p>
34
+ <label for="skip_escape">
35
+ <input type="checkbox" id="skip_escape" name="skip_escape">
36
+ Skip escaping of URLs? </label>
37
+ </p>
38
+ <p>
39
+ <button class="button-primary" type="submit">
40
+ Upload file and import </button>
41
+ <span class="tap-spinner"></span>
42
+ </p>
43
+ </form>
44
+
45
+ </div>
46
+
47
+ <?php
48
+ $section_title = 'ThirstyAffiliates CSV Importer';
49
+ $upgrade_link = 'https://thirstyaffiliates.com/pricing?utm_source=plugin_admin&utm_medium=link&utm_campaign=in_plugin&utm_content=importer';
50
+ include_once $this->_constants->VIEWS_ROOT_PATH() . 'ta-upgrade.php';
51
+ ?>
52
+
53
+ </div>
views/ta-upgrade.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="ta-upgrade">
2
+ <div class="ta-upgrade-wrap">
3
+ <div class="ta-upgrade-content">
4
+ <div class="ta-upgrade-logo">
5
+ <img src="<?php echo $this->_constants->IMAGES_ROOT_URL() . 'TA-PRO.svg'; ?>" alt="">
6
+ </div>
7
+ <h2>Everything You Need To Supercharge Your Affiliate Marketing</h2>
8
+ <?php if ( ! empty( $section_title ) ) : ?>
9
+ <h4>ThirstyAffiliates Lite cannot access <?php echo $section_title; ?>.</h4>
10
+ <?php endif; ?>
11
+ <p>Once you upgrade to ThirstyAffiliates Pro, you'll have access to these pro features:</p>
12
+ <ul class="features">
13
+ <li>Automatic Keyword Linking</li>
14
+ <li>Geographic Redirects</li>
15
+ <li>Event Notifications</li>
16
+ <li>Advanced Reports</li>
17
+ <li>Amazon API Importing</li>
18
+ <li>CSV Import/Export</li>
19
+ <li>Link Scheduling</li>
20
+ <li>Link Categorization</li>
21
+ </ul>
22
+ </div>
23
+ <div class="ta-upgrade-cta">
24
+ <a href="<?php echo $upgrade_link; ?>" id="pretty_link_cta_upgrade_link" class="ta-cta-button">Upgrade to ThirstyAffiliates Pro Now</a>
25
+ </div>
26
+ </div>
27
+ </div>