Shortlinks by Pretty Links – Best WordPress Link Tracking Plugin - Version 3.1.0

Version Description

  • Add support for sponsored rel tag
  • Add sponsored toggle support in gutenberg and tinymce editors
  • Fix report graphs not loading for some
  • PRO: Fix bug with keywords replacements
  • PRO: Cleaned up GA support
Download this release

Release Info

Developer supercleanse
Plugin Icon 128x128 Shortlinks by Pretty Links – Best WordPress Link Tracking Plugin
Version 3.1.0
Comparing to
See all releases

Code changes from version 3.0.10 to 3.1.0

app/controllers/PrliLinksController.php CHANGED
@@ -158,6 +158,7 @@ class PrliLinksController extends PrliBaseController {
158
 
159
  $values['track_me'] = ((isset($_REQUEST['track_me']) and $_REQUEST['track_me'] == 'on') or (!isset($_REQUEST['track_me']) and $prli_options->link_track_me == '1'));
160
  $values['nofollow'] = ((isset($_REQUEST['nofollow']) and $_REQUEST['nofollow'] == 'on') or (!isset($_REQUEST['nofollow']) and $prli_options->link_nofollow == '1'));
 
161
 
162
  $values['redirect_type'] = array();
163
  $values['redirect_type']['307'] = (((isset($_REQUEST['redirect_type']) and $_REQUEST['redirect_type'] == '307') or (!isset($_REQUEST['redirect_type']) and $prli_options->link_redirect_type == '307'))?' selected="selected"':'');
@@ -202,6 +203,7 @@ class PrliLinksController extends PrliBaseController {
202
  $values['description'] = ((isset($_REQUEST['description']) and $record == null)?sanitize_textarea_field(stripslashes($_REQUEST['description'])):stripslashes($record->description));
203
  $values['track_me'] = ((isset($_REQUEST['track_me']) or $record->track_me) and ((isset($_REQUEST['track_me']) and $_REQUEST['track_me'] == 'on') or $record->track_me == 1));
204
  $values['nofollow'] = ((isset($_REQUEST['nofollow']) and $_REQUEST['nofollow'] == 'on') or (isset($record->nofollow) && $record->nofollow == 1));
 
205
 
206
  $values['groups'] = array();
207
 
@@ -585,6 +587,13 @@ class PrliLinksController extends PrliBaseController {
585
  <option value="off"><?php echo esc_html(__('Disabled', 'pretty-link')); ?></option>
586
  </select>
587
  <br/>
 
 
 
 
 
 
 
588
  <span class="title"><?php echo esc_html(__('Tracking', 'pretty-link')); ?></span>
589
  <select name="prli_quick_edit_tracking">
590
  <option value="no-change"> - <?php echo esc_html(__('No Change', 'pretty-link')); ?> - </option>
@@ -614,6 +623,7 @@ class PrliLinksController extends PrliBaseController {
614
 
615
  $tracking = ($_POST['prli_quick_edit_tracking'] == 'no-change') ? '' : ( ($_POST['prli_quick_edit_tracking'] == 'on') ? true : false );
616
  $nofollow = ($_POST['prli_quick_edit_nofollow'] == 'no-change') ? '' : ( ($_POST['prli_quick_edit_nofollow'] == 'on') ? true : false );
 
617
 
618
  prli_update_pretty_link(
619
  $link->id,
@@ -624,6 +634,7 @@ class PrliLinksController extends PrliBaseController {
624
  null,// group_id deprecated
625
  $tracking,
626
  $nofollow,
 
627
  $link->redirect_type,
628
  $link->param_forwarding,
629
  '' // param_struct deprecated
@@ -644,8 +655,9 @@ class PrliLinksController extends PrliBaseController {
644
 
645
  $tracking = ($_POST['tracking'] == 'no-change') ? '' : ( ($_POST['tracking'] == 'on') ? true : false );
646
  $nofollow = ($_POST['nofollow'] == 'no-change') ? '' : ( ($_POST['nofollow'] == 'on') ? true : false );
 
647
 
648
- if($tracking === '' && $nofollow === '') { return; } // Nothing to change
649
 
650
  $id = $prli_link->get_link_from_cpt($post_id);
651
  $link = $prli_link->getOne($id);
@@ -659,6 +671,7 @@ class PrliLinksController extends PrliBaseController {
659
  null,// group_id deprecated
660
  $tracking,
661
  $nofollow,
 
662
  $link->redirect_type,
663
  $link->param_forwarding,
664
  '' // param_struct deprecated
@@ -777,6 +790,10 @@ class PrliLinksController extends PrliBaseController {
777
  $_POST['nofollow'] = 'on';
778
  }
779
 
 
 
 
 
780
  $link_id = $prli_link->create($_POST);
781
  $link = $prli_link->getOne($link_id);
782
 
158
 
159
  $values['track_me'] = ((isset($_REQUEST['track_me']) and $_REQUEST['track_me'] == 'on') or (!isset($_REQUEST['track_me']) and $prli_options->link_track_me == '1'));
160
  $values['nofollow'] = ((isset($_REQUEST['nofollow']) and $_REQUEST['nofollow'] == 'on') or (!isset($_REQUEST['nofollow']) and $prli_options->link_nofollow == '1'));
161
+ $values['sponsored'] = ((isset($_REQUEST['sponsored']) and $_REQUEST['sponsored'] == 'on') or (!isset($_REQUEST['sponsored']) and $prli_options->link_sponsored == '1'));
162
 
163
  $values['redirect_type'] = array();
164
  $values['redirect_type']['307'] = (((isset($_REQUEST['redirect_type']) and $_REQUEST['redirect_type'] == '307') or (!isset($_REQUEST['redirect_type']) and $prli_options->link_redirect_type == '307'))?' selected="selected"':'');
203
  $values['description'] = ((isset($_REQUEST['description']) and $record == null)?sanitize_textarea_field(stripslashes($_REQUEST['description'])):stripslashes($record->description));
204
  $values['track_me'] = ((isset($_REQUEST['track_me']) or $record->track_me) and ((isset($_REQUEST['track_me']) and $_REQUEST['track_me'] == 'on') or $record->track_me == 1));
205
  $values['nofollow'] = ((isset($_REQUEST['nofollow']) and $_REQUEST['nofollow'] == 'on') or (isset($record->nofollow) && $record->nofollow == 1));
206
+ $values['sponsored'] = ((isset($_REQUEST['sponsored']) and $_REQUEST['sponsored'] == 'on') or (isset($record->sponsored) && $record->sponsored == 1));
207
 
208
  $values['groups'] = array();
209
 
587
  <option value="off"><?php echo esc_html(__('Disabled', 'pretty-link')); ?></option>
588
  </select>
589
  <br/>
590
+ <span class="title"><?php echo esc_html(__('Sponsored', 'pretty-link')); ?></span>
591
+ <select name="prli_quick_edit_sponsored">
592
+ <option value="no-change"> - <?php echo esc_html(__('No Change', 'pretty-link')); ?> - </option>
593
+ <option value="on"><?php echo esc_html(__('Enabled', 'pretty-link')); ?></option>
594
+ <option value="off"><?php echo esc_html(__('Disabled', 'pretty-link')); ?></option>
595
+ </select>
596
+ <br/>
597
  <span class="title"><?php echo esc_html(__('Tracking', 'pretty-link')); ?></span>
598
  <select name="prli_quick_edit_tracking">
599
  <option value="no-change"> - <?php echo esc_html(__('No Change', 'pretty-link')); ?> - </option>
623
 
624
  $tracking = ($_POST['prli_quick_edit_tracking'] == 'no-change') ? '' : ( ($_POST['prli_quick_edit_tracking'] == 'on') ? true : false );
625
  $nofollow = ($_POST['prli_quick_edit_nofollow'] == 'no-change') ? '' : ( ($_POST['prli_quick_edit_nofollow'] == 'on') ? true : false );
626
+ $sponsored = ($_POST['prli_quick_edit_sponsored'] == 'no-change') ? '' : ( ($_POST['prli_quick_edit_sponsored'] == 'on') ? true : false );
627
 
628
  prli_update_pretty_link(
629
  $link->id,
634
  null,// group_id deprecated
635
  $tracking,
636
  $nofollow,
637
+ $sponsored,
638
  $link->redirect_type,
639
  $link->param_forwarding,
640
  '' // param_struct deprecated
655
 
656
  $tracking = ($_POST['tracking'] == 'no-change') ? '' : ( ($_POST['tracking'] == 'on') ? true : false );
657
  $nofollow = ($_POST['nofollow'] == 'no-change') ? '' : ( ($_POST['nofollow'] == 'on') ? true : false );
658
+ $sponsored = ($_POST['sponsored'] == 'no-change') ? '' : ( ($_POST['sponsored'] == 'on') ? true : false );
659
 
660
+ if($tracking === '' && $nofollow === '' && $sponsored === '') { return; } // Nothing to change
661
 
662
  $id = $prli_link->get_link_from_cpt($post_id);
663
  $link = $prli_link->getOne($id);
671
  null,// group_id deprecated
672
  $tracking,
673
  $nofollow,
674
+ $sponsored,
675
  $link->redirect_type,
676
  $link->param_forwarding,
677
  '' // param_struct deprecated
790
  $_POST['nofollow'] = 'on';
791
  }
792
 
793
+ if ($prli_options->link_sponsored) {
794
+ $_POST['sponsored'] = 'on';
795
+ }
796
+
797
  $link_id = $prli_link->create($_POST);
798
  $link = $prli_link->getOne($link_id);
799
 
app/controllers/PrliLocalApiController.php CHANGED
@@ -62,6 +62,7 @@ class PrliLocalApiController extends PrliBaseController {
62
  $group_id = 0, // deprecated
63
  $track_me = '',
64
  $nofollow = '',
 
65
  $redirect_type = '',
66
  $param_forwarding = '',
67
  $param_struct = '' ) {
@@ -72,23 +73,25 @@ class PrliLocalApiController extends PrliBaseController {
72
 
73
  $values = array();
74
  $values['url'] = $target_url;
75
- $values['slug'] = (($slug == '')?$prli_link->generateValidSlug():$slug);
76
  $values['name'] = $name;
77
  $values['description'] = $description;
78
- $values['redirect_type'] = (($redirect_type == '')?$prli_options->link_redirect_type:$redirect_type);
79
- $values['nofollow'] = (($nofollow === '')?$prli_options->link_nofollow:$nofollow);
80
- $values['track_me'] = (($track_me === '')?$prli_options->link_track_me:$track_me);
81
- $values['param_forwarding'] = !empty($param_forwarding);
 
82
  $values['param_struct'] = $param_struct;
83
 
84
- // make array look like $_POST
85
- if(empty($values['nofollow']) or !$values['nofollow']) {
86
  unset($values['nofollow']);
87
- }
88
-
89
- if(empty($values['track_me']) or !$values['track_me']) {
90
  unset($values['track_me']);
91
- }
 
92
 
93
  $prli_error_messages = $prli_link->validate( $values );
94
 
@@ -113,6 +116,7 @@ class PrliLocalApiController extends PrliBaseController {
113
  $group_id = '', // deprecated
114
  $track_me = '',
115
  $nofollow = '',
 
116
  $redirect_type = '',
117
  $param_forwarding = '',
118
  $param_struct = -1 ) {
@@ -131,23 +135,26 @@ class PrliLocalApiController extends PrliBaseController {
131
 
132
  $values = array();
133
  $values['id'] = $id;
134
- $values['url'] = (($target_url == '')?$record->url:$target_url);
135
- $values['slug'] = (($slug == '')?$record->slug:$slug);
136
- $values['name'] = (($name == -1)?$record->name:$name);
137
- $values['description'] = (($description == -1)?$record->description:$description);
138
- $values['redirect_type'] = (($redirect_type == '')?$record->redirect_type:$redirect_type);
139
- $values['nofollow'] = (($nofollow === '')?$record->nofollow:$nofollow);
140
- $values['track_me'] = (($track_me === '')?(int)$record->track_me:$track_me);
141
- $values['param_forwarding'] = (($param_forwarding === '')?(int)$record->param_forwarding:$param_forwarding);
 
142
  $values['param_struct'] = ''; // deprecated
143
  $values['link_cpt_id'] = $record->link_cpt_id;
144
 
145
- // make array look like $_POST
146
- if(empty($values['nofollow']) or !$values['nofollow'])
147
  unset($values['nofollow']);
148
- if(empty($values['track_me']) or !$values['track_me'])
 
 
149
  unset($values['track_me']);
150
- if(empty($values['param_forwarding']) or !$values['param_forwarding'])
151
  unset($values['param_forwarding']);
152
 
153
  $prli_error_messages = $prli_link->validate( $values, $id );
@@ -250,6 +257,7 @@ function prli_create_pretty_link( $target_url,
250
  $group_id = 0, // deprecated
251
  $track_me = '',
252
  $nofollow = '',
 
253
  $redirect_type = '',
254
  $param_forwarding = '',
255
  $param_struct = '' ) {
@@ -261,6 +269,7 @@ function prli_create_pretty_link( $target_url,
261
  $group_id, // deprecated
262
  $track_me,
263
  $nofollow,
 
264
  $redirect_type,
265
  $param_forwarding,
266
  $param_struct );
@@ -274,6 +283,7 @@ function prli_update_pretty_link( $id,
274
  $group_id = '', // deprecated
275
  $track_me = '',
276
  $nofollow = '',
 
277
  $redirect_type = '',
278
  $param_forwarding = '',
279
  $param_struct = -1 ) {
@@ -286,6 +296,7 @@ function prli_update_pretty_link( $id,
286
  $group_id, // deprecated
287
  $track_me,
288
  $nofollow,
 
289
  $redirect_type,
290
  $param_forwarding,
291
  $param_struct );
62
  $group_id = 0, // deprecated
63
  $track_me = '',
64
  $nofollow = '',
65
+ $sponsored = '',
66
  $redirect_type = '',
67
  $param_forwarding = '',
68
  $param_struct = '' ) {
73
 
74
  $values = array();
75
  $values['url'] = $target_url;
76
+ $values['slug'] = (($slug == '') ? $prli_link->generateValidSlug() : $slug);
77
  $values['name'] = $name;
78
  $values['description'] = $description;
79
+ $values['redirect_type'] = (($redirect_type == '') ? $prli_options->link_redirect_type : $redirect_type);
80
+ $values['nofollow'] = (($nofollow === '') ? $prli_options->link_nofollow : $nofollow);
81
+ $values['sponsored'] = (($sponsored === '') ? $prli_options->link_sponsored : $sponsored);
82
+ $values['track_me'] = (($track_me === '') ? $prli_options->link_track_me : $track_me);
83
+ $values['param_forwarding'] = (($param_forwarding === '') ? 0 : $param_forwarding);
84
  $values['param_struct'] = $param_struct;
85
 
86
+ // prevent some values from being stored
87
+ if(empty($values['nofollow']) || !$values['nofollow'])
88
  unset($values['nofollow']);
89
+ if(empty($values['sponsored']) || !$values['sponsored'])
90
+ unset($values['sponsored']);
91
+ if(empty($values['track_me']) || !$values['track_me'])
92
  unset($values['track_me']);
93
+ if(empty($values['param_forwarding']) || !$values['param_forwarding'])
94
+ unset($values['param_forwarding']);
95
 
96
  $prli_error_messages = $prli_link->validate( $values );
97
 
116
  $group_id = '', // deprecated
117
  $track_me = '',
118
  $nofollow = '',
119
+ $sponsored = '',
120
  $redirect_type = '',
121
  $param_forwarding = '',
122
  $param_struct = -1 ) {
135
 
136
  $values = array();
137
  $values['id'] = $id;
138
+ $values['url'] = (($target_url == '') ? $record->url : $target_url);
139
+ $values['slug'] = (($slug == '') ? $record->slug : $slug);
140
+ $values['name'] = (($name == -1) ? $record->name : $name);
141
+ $values['description'] = (($description == -1) ? $record->description : $description);
142
+ $values['redirect_type'] = (($redirect_type == '') ? $record->redirect_type : $redirect_type);
143
+ $values['nofollow'] = (($nofollow === '') ? $record->nofollow : $nofollow);
144
+ $values['sponsored'] = (($sponsored === '') ? $record->sponsored : $sponsored);
145
+ $values['track_me'] = (($track_me === '') ? (int)$record->track_me : $track_me);
146
+ $values['param_forwarding'] = (($param_forwarding === '') ? (int)$record->param_forwarding : $param_forwarding);
147
  $values['param_struct'] = ''; // deprecated
148
  $values['link_cpt_id'] = $record->link_cpt_id;
149
 
150
+ // prevent some values from being stored
151
+ if(empty($values['nofollow']) || !$values['nofollow'])
152
  unset($values['nofollow']);
153
+ if(empty($values['sponsored']) || !$values['sponsored'])
154
+ unset($values['sponsored']);
155
+ if(empty($values['track_me']) || !$values['track_me'])
156
  unset($values['track_me']);
157
+ if(empty($values['param_forwarding']) || !$values['param_forwarding'])
158
  unset($values['param_forwarding']);
159
 
160
  $prli_error_messages = $prli_link->validate( $values, $id );
257
  $group_id = 0, // deprecated
258
  $track_me = '',
259
  $nofollow = '',
260
+ $sponsored = '',
261
  $redirect_type = '',
262
  $param_forwarding = '',
263
  $param_struct = '' ) {
269
  $group_id, // deprecated
270
  $track_me,
271
  $nofollow,
272
+ $sponsored,
273
  $redirect_type,
274
  $param_forwarding,
275
  $param_struct );
283
  $group_id = '', // deprecated
284
  $track_me = '',
285
  $nofollow = '',
286
+ $sponsored = '',
287
  $redirect_type = '',
288
  $param_forwarding = '',
289
  $param_struct = -1 ) {
296
  $group_id, // deprecated
297
  $track_me,
298
  $nofollow,
299
+ $sponsored,
300
  $redirect_type,
301
  $param_forwarding,
302
  $param_struct );
app/controllers/PrliOptionsController.php CHANGED
@@ -14,6 +14,7 @@ class PrliOptionsController extends PrliBaseController {
14
  'link_prefix' => 'prli_link_prefix',
15
  'auto_trim_clicks' => 'prli_auto_trim_clicks',
16
  'link_nofollow' => 'prli_link_nofollow',
 
17
  'link_redirect_type' => 'prli_link_redirect_type',
18
  'hidden_field_name' => 'prli_update_options'
19
  );
@@ -96,6 +97,7 @@ class PrliOptionsController extends PrliBaseController {
96
  $prli_options->link_prefix = (int)isset($params[ $link_prefix ]);
97
  $prli_options->auto_trim_clicks = (int)isset($params[ $auto_trim_clicks ]);
98
  $prli_options->link_nofollow = (int)isset($params[ $link_nofollow ]);
 
99
  $prli_options->link_redirect_type = isset($params[ $link_redirect_type ]) && is_string($params[ $link_redirect_type ]) ? sanitize_key(stripslashes($params[ $link_redirect_type ])) : '307';
100
 
101
  do_action('prli-update-options', $params);
14
  'link_prefix' => 'prli_link_prefix',
15
  'auto_trim_clicks' => 'prli_auto_trim_clicks',
16
  'link_nofollow' => 'prli_link_nofollow',
17
+ 'link_sponsored' => 'prli_link_sponsored',
18
  'link_redirect_type' => 'prli_link_redirect_type',
19
  'hidden_field_name' => 'prli_update_options'
20
  );
97
  $prli_options->link_prefix = (int)isset($params[ $link_prefix ]);
98
  $prli_options->auto_trim_clicks = (int)isset($params[ $auto_trim_clicks ]);
99
  $prli_options->link_nofollow = (int)isset($params[ $link_nofollow ]);
100
+ $prli_options->link_sponsored = (int)isset($params[ $link_sponsored ]);
101
  $prli_options->link_redirect_type = isset($params[ $link_redirect_type ]) && is_string($params[ $link_redirect_type ]) ? sanitize_key(stripslashes($params[ $link_redirect_type ])) : '307';
102
 
103
  do_action('prli-update-options', $params);
app/controllers/PrliPostsController.php CHANGED
@@ -47,6 +47,7 @@ class PrliPostsController extends PrliBaseController {
47
  $random_slug = $prli_link->generateValidSlug();
48
  $default_redirect = $prli_options->link_redirect_type;
49
  $default_nofollow = ($prli_options->link_nofollow)?'enabled':'disabled';
 
50
  $default_tracking = ($prli_options->link_track_me)?'enabled':'disabled';
51
 
52
  //Get alternate Base URL
@@ -94,6 +95,7 @@ class PrliPostsController extends PrliBaseController {
94
  'home_url' => $home_url,
95
  'default_redirect' => $default_redirect,
96
  'default_nofollow' => $default_nofollow,
 
97
  'default_tracking' => $default_tracking,
98
  'ajaxurl' => admin_url('admin-ajax.php')
99
  ));
@@ -123,7 +125,7 @@ class PrliPostsController extends PrliBaseController {
123
 
124
  //AJAX
125
  public function create_pretty_link() {
126
- $valid_vars = array('target', 'slug', 'redirect', 'nofollow', 'tracking');
127
 
128
  if(!PrliUtils::is_authorized()) {
129
  echo "invalid_user";
@@ -141,9 +143,10 @@ class PrliPostsController extends PrliBaseController {
141
  sanitize_text_field(stripslashes($_POST['slug'])),
142
  '', //Name
143
  '', //Desc
144
- 0, //Group ID
145
  (int)($_POST['tracking'] == 'enabled'),
146
  (int)($_POST['nofollow'] == 'enabled'),
 
147
  sanitize_key(stripslashes($_POST['redirect']))
148
  );
149
 
@@ -188,7 +191,8 @@ class PrliPostsController extends PrliBaseController {
188
  'slug' => $result['slug'],
189
  'target' => $result['url'],
190
  'title' => $result['name'], //Not used currently, but we may want this at some point
191
- 'nofollow' => (int)$result['nofollow']
 
192
  );
193
  }
194
 
47
  $random_slug = $prli_link->generateValidSlug();
48
  $default_redirect = $prli_options->link_redirect_type;
49
  $default_nofollow = ($prli_options->link_nofollow)?'enabled':'disabled';
50
+ $default_sponsored= ($prli_options->link_sponsored)?'enabled':'disabled';
51
  $default_tracking = ($prli_options->link_track_me)?'enabled':'disabled';
52
 
53
  //Get alternate Base URL
95
  'home_url' => $home_url,
96
  'default_redirect' => $default_redirect,
97
  'default_nofollow' => $default_nofollow,
98
+ 'default_sponsored' => $default_sponsored,
99
  'default_tracking' => $default_tracking,
100
  'ajaxurl' => admin_url('admin-ajax.php')
101
  ));
125
 
126
  //AJAX
127
  public function create_pretty_link() {
128
+ $valid_vars = array('target', 'slug', 'redirect', 'nofollow', 'sponsored', 'tracking');
129
 
130
  if(!PrliUtils::is_authorized()) {
131
  echo "invalid_user";
143
  sanitize_text_field(stripslashes($_POST['slug'])),
144
  '', //Name
145
  '', //Desc
146
+ 0, //Group ID (Deprecated)
147
  (int)($_POST['tracking'] == 'enabled'),
148
  (int)($_POST['nofollow'] == 'enabled'),
149
+ (int)($_POST['sponsored'] == 'sponsored'),
150
  sanitize_key(stripslashes($_POST['redirect']))
151
  );
152
 
191
  'slug' => $result['slug'],
192
  'target' => $result['url'],
193
  'title' => $result['name'], //Not used currently, but we may want this at some point
194
+ 'nofollow' => (int)$result['nofollow'],
195
+ 'sponsored' => (int)$result['sponsored']
196
  );
197
  }
198
 
app/controllers/PrliToolsController.php CHANGED
@@ -49,7 +49,7 @@ class PrliToolsController extends PrliBaseController {
49
  $track = isset($_GET['trk']) && is_numeric($_GET['trk']) && $_GET['trk'] != '-1' ? (int) $_GET['trk'] : '';
50
  $category = isset($_GET['ct']) && is_numeric($_GET['ct']) && $_GET['ct'] != '-1' ? (int) $_GET['ct'] : '';
51
 
52
- $result = prli_create_pretty_link( esc_url_raw($target_url, array('http','https')), '', '', '', 0, $track, '', $redirect_type );
53
 
54
  $plink = $prli_link->getOne($result);
55
 
49
  $track = isset($_GET['trk']) && is_numeric($_GET['trk']) && $_GET['trk'] != '-1' ? (int) $_GET['trk'] : '';
50
  $category = isset($_GET['ct']) && is_numeric($_GET['ct']) && $_GET['ct'] != '-1' ? (int) $_GET['ct'] : '';
51
 
52
+ $result = prli_create_pretty_link( esc_url_raw($target_url, array('http','https')), '', '', '', 0, $track, '', '', $redirect_type );
53
 
54
  $plink = $prli_link->getOne($result);
55
 
app/controllers/PrliXmlRpcController.php CHANGED
@@ -79,6 +79,11 @@ class PrliXmlRpcController extends PrliBaseController {
79
  * value (from the pretty link option page) will
80
  * be used
81
  *
 
 
 
 
 
82
  * @param string $link_redirect_type Optional, valid values include '307', '302', or '301',
83
  * if not set the default value (from the pretty
84
  * link option page) will be used
@@ -118,9 +123,10 @@ class PrliXmlRpcController extends PrliBaseController {
118
  $group_id = (isset($args[6])?$args[6]:'');
119
  $track_me = (isset($args[7])?$args[7]:'');
120
  $nofollow = (isset($args[8])?$args[8]:'');
121
- $redirect_type = (isset($args[9])?$args[9]:'');
122
- $param_forwarding = (isset($args[10]) && !empty($args[10]) && $args[10] != 'off');
123
- $param_struct = (isset($args[11])?$args[11]:'');
 
124
 
125
  if( $link = prli_create_pretty_link( $target_url,
126
  $slug,
@@ -129,6 +135,7 @@ class PrliXmlRpcController extends PrliBaseController {
129
  $group_id,
130
  $track_me,
131
  $nofollow,
 
132
  $redirect_type,
133
  $param_forwarding,
134
  $param_struct ) )
@@ -165,9 +172,10 @@ class PrliXmlRpcController extends PrliBaseController {
165
  $group_id = (isset($args[7])?$args[7]:'');
166
  $track_me = (isset($args[8])?$args[8]:'');
167
  $nofollow = (isset($args[9])?$args[9]:'');
168
- $redirect_type = (isset($args[10])?$args[10]:'');
169
- $param_forwarding = (isset($args[11])?$args[11]:'');
170
- $param_struct = (isset($args[12])?$args[12]:'');
 
171
 
172
  if( $link = prli_update_pretty_link( $id,
173
  $target_url,
@@ -177,6 +185,7 @@ class PrliXmlRpcController extends PrliBaseController {
177
  $group_id,
178
  $track_me,
179
  $nofollow,
 
180
  $redirect_type,
181
  $param_forwarding,
182
  $param_struct ) )
79
  * value (from the pretty link option page) will
80
  * be used
81
  *
82
+ * @param boolean $link_sponsored Optional, If true the sponsored attribute will
83
+ * be set for the link, if not set the default
84
+ * value (from the pretty link option page) will
85
+ * be used
86
+ *
87
  * @param string $link_redirect_type Optional, valid values include '307', '302', or '301',
88
  * if not set the default value (from the pretty
89
  * link option page) will be used
123
  $group_id = (isset($args[6])?$args[6]:'');
124
  $track_me = (isset($args[7])?$args[7]:'');
125
  $nofollow = (isset($args[8])?$args[8]:'');
126
+ $sponsored = (isset($args[9])?$args[9]:'');
127
+ $redirect_type = (isset($args[10])?$args[10]:'');
128
+ $param_forwarding = (isset($args[11]) && !empty($args[11]) && $args[11] != 'off');
129
+ $param_struct = (isset($args[12])?$args[12]:'');
130
 
131
  if( $link = prli_create_pretty_link( $target_url,
132
  $slug,
135
  $group_id,
136
  $track_me,
137
  $nofollow,
138
+ $sponsored,
139
  $redirect_type,
140
  $param_forwarding,
141
  $param_struct ) )
172
  $group_id = (isset($args[7])?$args[7]:'');
173
  $track_me = (isset($args[8])?$args[8]:'');
174
  $nofollow = (isset($args[9])?$args[9]:'');
175
+ $sponsored = (isset($args[10])?$args[10]:'');
176
+ $redirect_type = (isset($args[11])?$args[11]:'');
177
+ $param_forwarding = (isset($args[12])?$args[12]:'');
178
+ $param_struct = (isset($args[13])?$args[13]:'');
179
 
180
  if( $link = prli_update_pretty_link( $id,
181
  $target_url,
185
  $group_id,
186
  $track_me,
187
  $nofollow,
188
+ $sponsored,
189
  $redirect_type,
190
  $param_forwarding,
191
  $param_struct ) )
app/helpers/PrliLinksHelper.php CHANGED
@@ -52,6 +52,10 @@ class PrliLinksHelper {
52
  <i title="<?php esc_attr_e('Nofollow Enabled', 'pretty-link'); ?>" class="pl-icon-cancel-circled pl-list-icon"></i><?php
53
  endif;
54
 
 
 
 
 
55
  if(!empty($link->param_forwarding) && $link->param_forwarding != 'off'): ?>
56
  <i title="<?php esc_attr_e('Parameter Forwarding Enabled', 'pretty-link'); ?>" class="pl-icon-forward pl-list-icon"></i><?php
57
  endif;
52
  <i title="<?php esc_attr_e('Nofollow Enabled', 'pretty-link'); ?>" class="pl-icon-cancel-circled pl-list-icon"></i><?php
53
  endif;
54
 
55
+ if( $link->sponsored ): ?>
56
+ <i title="<?php esc_attr_e('Sponsored Enabled', 'pretty-link'); ?>" class="pl-icon-ok-circle pl-list-icon"></i><?php
57
+ endif;
58
+
59
  if(!empty($link->param_forwarding) && $link->param_forwarding != 'off'): ?>
60
  <i title="<?php esc_attr_e('Parameter Forwarding Enabled', 'pretty-link'); ?>" class="pl-icon-forward pl-list-icon"></i><?php
61
  endif;
app/models/PrliDb.php CHANGED
@@ -94,6 +94,7 @@ class PrliDb {
94
  url text default NULL,
95
  slug varchar(255) default NULL,
96
  nofollow tinyint(1) default 0,
 
97
  track_me tinyint(1) default 1,
98
  param_forwarding varchar(255) default NULL,
99
  param_struct varchar(255) default NULL,
@@ -108,6 +109,7 @@ class PrliDb {
108
  KEY group_id (group_id),
109
  KEY link_status (link_status),
110
  KEY nofollow (nofollow),
 
111
  KEY track_me (track_me),
112
  KEY param_forwarding (param_forwarding(191)),
113
  KEY redirect_type (redirect_type(191)),
94
  url text default NULL,
95
  slug varchar(255) default NULL,
96
  nofollow tinyint(1) default 0,
97
+ sponsored tinyint(1) default 0,
98
  track_me tinyint(1) default 1,
99
  param_forwarding varchar(255) default NULL,
100
  param_struct varchar(255) default NULL,
109
  KEY group_id (group_id),
110
  KEY link_status (link_status),
111
  KEY nofollow (nofollow),
112
+ KEY sponsored (sponsored),
113
  KEY track_me (track_me),
114
  KEY param_forwarding (param_forwarding(191)),
115
  KEY redirect_type (redirect_type(191)),
app/models/PrliLink.php CHANGED
@@ -481,6 +481,7 @@ class PrliLink {
481
  'description' => isset($values['description']) && is_string($values['description']) ? sanitize_textarea_field($values['description']) : '',
482
  'group_id' => isset($values['group_id']) && is_numeric($values['group_id']) ? (int) $values['group_id'] : null,
483
  'nofollow' => isset($values['nofollow']) ? 1 : 0,
 
484
  'param_forwarding' => isset($values['param_forwarding']) ? 1 : 0,
485
  'track_me' => isset($values['track_me']) ? 1 : 0,
486
  'link_cpt_id' => isset($values['link_cpt_id']) && is_numeric($values['link_cpt_id']) ? (int) $values['link_cpt_id'] : 0
481
  'description' => isset($values['description']) && is_string($values['description']) ? sanitize_textarea_field($values['description']) : '',
482
  'group_id' => isset($values['group_id']) && is_numeric($values['group_id']) ? (int) $values['group_id'] : null,
483
  'nofollow' => isset($values['nofollow']) ? 1 : 0,
484
+ 'sponsored' => isset($values['sponsored']) ? 1 : 0,
485
  'param_forwarding' => isset($values['param_forwarding']) ? 1 : 0,
486
  'track_me' => isset($values['track_me']) ? 1 : 0,
487
  'link_cpt_id' => isset($values['link_cpt_id']) && is_numeric($values['link_cpt_id']) ? (int) $values['link_cpt_id'] : 0
app/models/PrliOptions.php CHANGED
@@ -28,6 +28,7 @@ class PrliOptions
28
  public $auto_trim_clicks;
29
  public $link_track_me;
30
  public $link_nofollow;
 
31
 
32
  public $bookmarklet_auth;
33
 
@@ -64,6 +65,7 @@ class PrliOptions
64
  $auto_trim_clicks = 'prli_auto_trim_clicks';
65
  $link_track_as_pixel = 'prli_link_track_as_pixel';
66
  $link_nofollow = 'prli_link_nofollow';
 
67
  $link_redirect_type = 'prli_link_redirect_type';
68
 
69
  if(!isset($this->prettybar_show_title)) {
@@ -124,6 +126,10 @@ class PrliOptions
124
  $this->auto_trim_clicks = 0;
125
  }
126
 
 
 
 
 
127
  if(!isset($this->link_nofollow)) {
128
  if($var = get_option( $link_nofollow )) {
129
  $this->link_nofollow = $var;
28
  public $auto_trim_clicks;
29
  public $link_track_me;
30
  public $link_nofollow;
31
+ public $link_sponsored;
32
 
33
  public $bookmarklet_auth;
34
 
65
  $auto_trim_clicks = 'prli_auto_trim_clicks';
66
  $link_track_as_pixel = 'prli_link_track_as_pixel';
67
  $link_nofollow = 'prli_link_nofollow';
68
+ $link_sponsored = 'prli_link_sponsored';
69
  $link_redirect_type = 'prli_link_redirect_type';
70
 
71
  if(!isset($this->prettybar_show_title)) {
126
  $this->auto_trim_clicks = 0;
127
  }
128
 
129
+ if(!isset($this->link_sponsored)) {
130
+ $this->link_sponsored = 0;
131
+ }
132
+
133
  if(!isset($this->link_nofollow)) {
134
  if($var = get_option( $link_nofollow )) {
135
  $this->link_nofollow = $var;
app/models/PrliUtils.php CHANGED
@@ -311,8 +311,16 @@ class PrliUtils {
311
  $param_string = apply_filters('prli_redirect_params', $param_string);
312
  }
313
 
314
- if(isset($pretty_link->nofollow) and $pretty_link->nofollow) {
315
- header("X-Robots-Tag: noindex, nofollow", true);
 
 
 
 
 
 
 
 
316
  }
317
 
318
  //This action replaces custom variable parameters
311
  $param_string = apply_filters('prli_redirect_params', $param_string);
312
  }
313
 
314
+ $robots_tags = array();
315
+ if(isset($pretty_link->nofollow) && $pretty_link->nofollow) {
316
+ $robots_tags[] = 'noindex';
317
+ $robots_tags[] = 'nofollow';
318
+ }
319
+ if(isset($pretty_link->sponsored) && $pretty_link->sponsored) {
320
+ $robots_tags[] = 'sponsored';
321
+ }
322
+ if(!empty($robots_tags)) {
323
+ header("X-Robots-Tag: " . implode(', ', $robots_tags), true);
324
  }
325
 
326
  //This action replaces custom variable parameters
app/views/links/form_advanced.php CHANGED
@@ -7,13 +7,26 @@
7
  <?php PrliAppHelper::info_tooltip(
8
  'prli-link-options-nofollow',
9
  esc_html__('Nofollow Link', 'pretty-link'),
10
- esc_html__('Add a nofollow and noindex to this link\'s http redirect header', 'pretty-link')
11
  ); ?>
12
  </th>
13
  <td>
14
  <input type="checkbox" name="nofollow" <?php checked($values['nofollow']); ?>/>
15
  </td>
16
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  <tr id="prli_time_delay" style="display: none">
18
  <th scope="row">
19
  <?php esc_html_e('Delay Redirect', 'pretty-link'); ?>
@@ -58,17 +71,17 @@
58
  <?php esc_html_e('Google Analytics', 'pretty-link'); ?>
59
  <?php PrliAppHelper::info_tooltip(
60
  'prli-link-ga',
61
- esc_html__('Google Analytics Tracking', 'pretty-link'),
62
- esc_html__('Requires the Google Analyticator, Google Analytics by MonsterInsights (formerly Yoast) or Google Analytics Plugin installed and configured for this to work.', 'pretty-link')
63
  ); ?>
64
  </th>
65
  <td>
66
  <?php
67
  global $plp_update;
68
  if($plp_update->is_installed()):
69
- if($ga_info = PlpUtils::ga_installed()):
70
  ?>
71
- <input type="checkbox" name="google_tracking" <?php echo esc_html($values['google_tracking']); ?> />
72
  <p class="description">
73
  <?php
74
  printf(
7
  <?php PrliAppHelper::info_tooltip(
8
  'prli-link-options-nofollow',
9
  esc_html__('Nofollow Link', 'pretty-link'),
10
+ esc_html__('Add a nofollow and noindex to this link\'s http redirect header. (Recommended)', 'pretty-link')
11
  ); ?>
12
  </th>
13
  <td>
14
  <input type="checkbox" name="nofollow" <?php checked($values['nofollow']); ?>/>
15
  </td>
16
  </tr>
17
+ <tr>
18
+ <th scope="row">
19
+ <?php esc_html_e('Sponsored', 'pretty-link'); ?>
20
+ <?php PrliAppHelper::info_tooltip(
21
+ 'prli-link-options-sponsored',
22
+ esc_html__('Sponsored Link', 'pretty-link'),
23
+ esc_html__('Add a sponsored attribute to this link\'s http redirect header. Recommended if this is an affiliate link.', 'pretty-link')
24
+ ); ?>
25
+ </th>
26
+ <td>
27
+ <input type="checkbox" name="sponsored" <?php checked($values['sponsored']); ?>/>
28
+ </td>
29
+ </tr>
30
  <tr id="prli_time_delay" style="display: none">
31
  <th scope="row">
32
  <?php esc_html_e('Delay Redirect', 'pretty-link'); ?>
71
  <?php esc_html_e('Google Analytics', 'pretty-link'); ?>
72
  <?php PrliAppHelper::info_tooltip(
73
  'prli-link-ga',
74
+ esc_html__('Google Analytics', 'pretty-link'),
75
+ esc_html__('Requires the Google Analyticator plugin be installed and configured. This setting has no impact on the MonsterInsights integration with Pretty Links.', 'pretty-link')
76
  ); ?>
77
  </th>
78
  <td>
79
  <?php
80
  global $plp_update;
81
  if($plp_update->is_installed()):
82
+ if(($ga_info = PlpUtils::ga_installed())):
83
  ?>
84
+ <input type="checkbox" name="google_tracking" <?php checked($values['google_tracking']); ?> />
85
  <p class="description">
86
  <?php
87
  printf(
app/views/options/form.php CHANGED
@@ -107,13 +107,25 @@
107
  <label for="<?php echo esc_attr($link_nofollow); ?>"><?php esc_html_e('Enable No Follow', 'pretty-link'); ?></label>
108
  <?php PrliAppHelper::info_tooltip('prli-options-add-nofollow',
109
  esc_html__('Add No Follow', 'pretty-link'),
110
- esc_html__('Add the \'nofollow\' attribute by default to new links.', 'pretty-link'));
111
  ?>
112
  </th>
113
  <td>
114
  <input type="checkbox" name="<?php echo esc_attr($link_nofollow); ?>" <?php checked($prli_options->link_nofollow != 0); ?>/>
115
  </td>
116
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
117
  <tr valign="top">
118
  <th scope="row">
119
  <label for="<?php echo esc_attr($link_prefix); ?>"><?php esc_html_e('Enable Permalink Fix', 'pretty-link'); ?></label>
@@ -166,7 +178,7 @@
166
  <th scope="row">
167
  <label><?php esc_html_e('Enable Google Analytics', 'pretty-link') ?></label>
168
  <?php PrliAppHelper::info_tooltip('prli-options-use-ga', esc_html__('Enable Google Analytics', 'pretty-link'),
169
- esc_html__("Requires Google Analyticator, Google Analytics by MonsterInsights (formerly Yoast), or the Google Analytics Plugin to be installed and configured on your site.", 'pretty-link'));
170
  ?>
171
  <?php echo PrliAppHelper::pro_only_feature_indicator('option-google-analytics'); ?>
172
  </th>
@@ -389,6 +401,28 @@
389
  <input type="checkbox" disabled />
390
  </td>
391
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  <tr valign="top" class="prli-pro-only">
393
  <th scope="row">
394
  <label>
107
  <label for="<?php echo esc_attr($link_nofollow); ?>"><?php esc_html_e('Enable No Follow', 'pretty-link'); ?></label>
108
  <?php PrliAppHelper::info_tooltip('prli-options-add-nofollow',
109
  esc_html__('Add No Follow', 'pretty-link'),
110
+ esc_html__('Add the \'nofollow\' attribute by default to new links. This will add nofollow and noindex in the HTTP Response headers when enabled.', 'pretty-link'));
111
  ?>
112
  </th>
113
  <td>
114
  <input type="checkbox" name="<?php echo esc_attr($link_nofollow); ?>" <?php checked($prli_options->link_nofollow != 0); ?>/>
115
  </td>
116
  </tr>
117
+ <tr valign="top">
118
+ <th scope="row">
119
+ <label for="<?php echo esc_attr($link_sponsored); ?>"><?php esc_html_e('Enable Sponsored', 'pretty-link'); ?></label>
120
+ <?php PrliAppHelper::info_tooltip('prli-options-add-sponsored',
121
+ esc_html__('Add Sponsored', 'pretty-link'),
122
+ esc_html__('Add the \'sponsored\' attribute by default to new links. This will add sponsored in the HTTP Response headers when enabled.', 'pretty-link'));
123
+ ?>
124
+ </th>
125
+ <td>
126
+ <input type="checkbox" name="<?php echo esc_attr($link_sponsored); ?>" <?php checked($prli_options->link_sponsored != 0); ?>/>
127
+ </td>
128
+ </tr>
129
  <tr valign="top">
130
  <th scope="row">
131
  <label for="<?php echo esc_attr($link_prefix); ?>"><?php esc_html_e('Enable Permalink Fix', 'pretty-link'); ?></label>
178
  <th scope="row">
179
  <label><?php esc_html_e('Enable Google Analytics', 'pretty-link') ?></label>
180
  <?php PrliAppHelper::info_tooltip('prli-options-use-ga', esc_html__('Enable Google Analytics', 'pretty-link'),
181
+ esc_html__('Requires the Google Analyticator plugin be installed. If you rely on MonsterInsights plugin for Google Analytics, leave this setting disabled as it has no affect.', 'pretty-link'));
182
  ?>
183
  <?php echo PrliAppHelper::pro_only_feature_indicator('option-google-analytics'); ?>
184
  </th>
401
  <input type="checkbox" disabled />
402
  </td>
403
  </tr>
404
+ <tr valign="top" class="prli-pro-only">
405
+ <th scope="row">
406
+ <label>
407
+ <?php esc_html_e('Add Sponsored', 'pretty-link'); ?>
408
+ <?php PrliAppHelper::info_tooltip('prli-keyword-links-sponsored',
409
+ esc_html__('Add \'sponsored\' attribute to all Keyword Pretty Links', 'pretty-link'),
410
+ sprintf(
411
+ // translators: %1$s: open code tag, %2$s: close code tag, %3$s: open strong tag, %4$s close strong tag
412
+ esc_html__('This adds the html %1$sSPONSORED%2$s attribute to all keyword replacement links. %3$sNote:%4$s This does not apply to url replacements--only keyword replacements.', 'pretty-link'),
413
+ '<code>',
414
+ '</code>',
415
+ '<strong>',
416
+ '</strong>'
417
+ ));
418
+ ?>
419
+ <?php echo PrliAppHelper::pro_only_feature_indicator('option-replacement-no-follows'); ?>
420
+ </label>
421
+ </th>
422
+ <td>
423
+ <input type="checkbox" disabled />
424
+ </td>
425
+ </tr>
426
  <tr valign="top" class="prli-pro-only">
427
  <th scope="row">
428
  <label>
app/views/shared/tinymce_form_popup.php CHANGED
@@ -50,6 +50,14 @@
50
  <option value="disabled"><?php esc_html_e('Disabled', 'pretty-link'); ?></option>
51
  </select>
52
  </div>
 
 
 
 
 
 
 
 
53
  <div class="prlitinymce-options-row">
54
  <label><?php esc_html_e('Tracking', 'pretty-link'); ?>:</label>
55
  <select name="prli_insert_link_tracking" id="prli_insert_link_tracking">
@@ -88,6 +96,7 @@
88
  </div>
89
  <div class="prlitinymce-options-row" id="existing_link_insert">
90
  <input type="hidden" name="existing_link_nofollow" id="existing_link_nofollow" value="0" />
 
91
  <a href="javascript:PrliPopUpHandler.insert_existing()" class="prli_button"><?php esc_html_e('Insert Existing Pretty Link', 'pretty-link'); ?></a>
92
  </div>
93
  </div>
50
  <option value="disabled"><?php esc_html_e('Disabled', 'pretty-link'); ?></option>
51
  </select>
52
  </div>
53
+ <div class="prlitinymce-options-row">
54
+ <label><?php esc_html_e('Sponsored', 'pretty-link'); ?>:</label>
55
+ <select name="prli_insert_link_sponsored" id="prli_insert_link_sponsored">
56
+ <option value="default"><?php esc_html_e('Default', 'pretty-link'); ?></option>
57
+ <option value="enabled"><?php esc_html_e('Enabled', 'pretty-link'); ?></option>
58
+ <option value="disabled"><?php esc_html_e('Disabled', 'pretty-link'); ?></option>
59
+ </select>
60
+ </div>
61
  <div class="prlitinymce-options-row">
62
  <label><?php esc_html_e('Tracking', 'pretty-link'); ?>:</label>
63
  <select name="prli_insert_link_tracking" id="prli_insert_link_tracking">
96
  </div>
97
  <div class="prlitinymce-options-row" id="existing_link_insert">
98
  <input type="hidden" name="existing_link_nofollow" id="existing_link_nofollow" value="0" />
99
+ <input type="hidden" name="existing_link_sponsored" id="existing_link_sponsored" value="0" />
100
  <a href="javascript:PrliPopUpHandler.insert_existing()" class="prli_button"><?php esc_html_e('Insert Existing Pretty Link', 'pretty-link'); ?></a>
101
  </div>
102
  </div>
js/admin_link_list.js CHANGED
@@ -59,28 +59,6 @@ jQuery(document).ready(function($) {
59
  $('label.inline-edit-status').parent().hide();
60
  }
61
 
62
- /*
63
- NOT NEEDED SINCE SWITCHING TO "- No Change -" SELECT FIELD
64
- Leaving here in case we need sample code of how to do this in the future though
65
-
66
- // QUICK EDIT JS
67
- $('body').on('click', 'button.editinline', function(e) {
68
- var tr = $(this).closest("tr");
69
- var trid = tr.attr('id');
70
- var parts = trid.toString().split('-');
71
- var post_id = parts[1];
72
- var nofollow = $(this).data('nofollow');
73
- var tracking = $(this).data('tracking');
74
-
75
- if(nofollow == 'on') {
76
- $('#edit-' + post_id + ' .prli_quick_edit_nofollow:first').prop("checked", true);
77
- }
78
- if(tracking == 'on') {
79
- $('#edit-' + post_id + ' .prli_quick_edit_tracking:first').prop("checked", true);
80
- }
81
- });
82
- */
83
-
84
  // BULK EDIT JS
85
  $(document).on('click', '#bulk_edit', function() {
86
  // Display spinner as ajax can take a while if there's a lot of posts to edit
@@ -93,6 +71,7 @@ jQuery(document).ready(function($) {
93
  });
94
 
95
  var nofollow = bulk_row.find('select[name="prli_quick_edit_nofollow"]').val();
 
96
  var tracking = bulk_row.find('select[name="prli_quick_edit_tracking"]').val();
97
 
98
  $.ajax({
@@ -103,6 +82,7 @@ jQuery(document).ready(function($) {
103
  action: 'prli_links_list_save_bulk_edit',
104
  post_ids: post_ids,
105
  nofollow: nofollow,
 
106
  tracking: tracking
107
  }
108
  });
59
  $('label.inline-edit-status').parent().hide();
60
  }
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  // BULK EDIT JS
63
  $(document).on('click', '#bulk_edit', function() {
64
  // Display spinner as ajax can take a while if there's a lot of posts to edit
71
  });
72
 
73
  var nofollow = bulk_row.find('select[name="prli_quick_edit_nofollow"]').val();
74
+ var sponsored = bulk_row.find('select[name="prli_quick_edit_sponsored"]').val();
75
  var tracking = bulk_row.find('select[name="prli_quick_edit_tracking"]').val();
76
 
77
  $.ajax({
82
  action: 'prli_links_list_save_bulk_edit',
83
  post_ids: post_ids,
84
  nofollow: nofollow,
85
+ sponsored: sponsored,
86
  tracking: tracking
87
  }
88
  });
js/admin_reports.js CHANGED
@@ -14,6 +14,5 @@ var drawPrliChart = function() {
14
  hitsChart.draw(hitsChartData, {height: '300', title: PrliReport.titles});
15
  };
16
 
17
- google.load("visualization", "1", {packages:["corechart"]});
18
- google.setOnLoadCallback(drawPrliChart);
19
-
14
  hitsChart.draw(hitsChartData, {height: '300', title: PrliReport.titles});
15
  };
16
 
17
+ google.charts.load('current', { packages: ['corechart'] });
18
+ google.charts.setOnLoadCallback(drawPrliChart);
 
js/editor.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=38)}([function(t,e){!function(){t.exports=this.wp.element}()},function(t,e){!function(){t.exports=this.wp.i18n}()},function(t,e){!function(){t.exports=this.wp.url}()},function(t,e){!function(){t.exports=this.wp.richText}()},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){!function(){t.exports=this.wp.components}()},function(t,e){!function(){t.exports=this.wp.keycodes}()},function(t,e){!function(){t.exports=this.wp.blockEditor}()},function(t,e,n){var o=n(35);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e,n){var o=n(36),r=n(4);t.exports=function(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?r(t):e}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}t.exports=function(t,e,o){return e&&n(t.prototype,e),o&&n(t,o),t}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){!function(){t.exports=this.lodash}()},function(t,e,n){"use strict";n.r(e);var o=n(12),r=n.n(o),i=n(11),s=n.n(i),a=n(10),c=n.n(a),l=n(9),u=n.n(l),f=n(4),p=n.n(f),d=n(8),h=n.n(d),v=n(21),b=n.n(v),g=n(26),m=n.n(g),y=n(0),w=n(13),k=n(15),O=n.n(k),j=n(25),L=n.n(j),S=n(1),x=n(6),E=n(5),_=n(17),C=n(24),T=n(19),R=n.n(T),N=n(2),P=n(20),A=function(t){return t.stopPropagation()},F=function(){var t=m()(b.a.mark(function t(e){var n;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,R()({url:Object(N.addQueryArgs)(ajaxurl,{action:"prli_search_for_links",term:e})});case 2:return n=t.sent,t.abrupt("return",Object(w.map)(n,function(t){return{url:t.pretty_url,title:Object(P.decodeEntities)(t.value)+" ("+Object(P.decodeEntities)(t.slug)+")"||Object(S.__)("(no title)")}}));case 4:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),I=function(t){function e(t){var n,o=t.autocompleteRef;return r()(this,e),(n=c()(this,u()(e).apply(this,arguments))).onChange=n.onChange.bind(p()(n)),n.onKeyDown=n.onKeyDown.bind(p()(n)),n.autocompleteRef=o||Object(y.createRef)(),n.inputRef=Object(y.createRef)(),n.updateSuggestions=Object(w.throttle)(n.updateSuggestions.bind(p()(n)),200),n.suggestionNodes=[],n.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null},n}return h()(e,t),s()(e,[{key:"componentDidUpdate",value:function(){var t=this,e=this.state,n=e.showSuggestions,o=e.selectedSuggestion;n&&null!==o&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,L()(this.suggestionNodes[o],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout(function(){t.scrollingIntoView=!1},100))}},{key:"componentWillUnmount",value:function(){delete this.suggestionsRequest}},{key:"bindSuggestionNode",value:function(t){var e=this;return function(n){e.suggestionNodes[t]=n}}},{key:"updateSuggestions",value:function(t){var e=this;if(t.length<2||/^https?:/.test(t))this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});else{this.setState({showSuggestions:!0,selectedSuggestion:null,loading:!0});var n=F(t);n.then(function(t){e.suggestionsRequest===n&&(e.setState({suggestions:t,loading:!1}),t.length?e.props.debouncedSpeak(Object(S.sprintf)(Object(S._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",t.length),t.length),"assertive"):e.props.debouncedSpeak(Object(S.__)("No results."),"assertive"))}).catch(function(){e.suggestionsRequest===n&&e.setState({loading:!1})}),this.suggestionsRequest=n}}},{key:"onChange",value:function(t){var e=t.target.value;this.props.onChange(e),this.updateSuggestions(e)}},{key:"onKeyDown",value:function(t){var e=this.state,n=e.showSuggestions,o=e.selectedSuggestion,r=e.suggestions,i=e.loading;if(n&&r.length&&!i){var s=this.state.suggestions[this.state.selectedSuggestion];switch(t.keyCode){case x.UP:t.stopPropagation(),t.preventDefault();var a=o?o-1:r.length-1;this.setState({selectedSuggestion:a});break;case x.DOWN:t.stopPropagation(),t.preventDefault();var c=null===o||o===r.length-1?0:o+1;this.setState({selectedSuggestion:c});break;case x.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(s),this.props.speak(Object(S.__)("Link selected.")));break;case x.ENTER:null!==this.state.selectedSuggestion&&(t.stopPropagation(),this.selectLink(s))}}else switch(t.keyCode){case x.UP:0!==t.target.selectionStart&&(t.stopPropagation(),t.preventDefault(),t.target.setSelectionRange(0,0));break;case x.DOWN:this.props.value.length!==t.target.selectionStart&&(t.stopPropagation(),t.preventDefault(),t.target.setSelectionRange(this.props.value.length,this.props.value.length))}}},{key:"selectLink",value:function(t){this.props.onChange(t.url,t),this.setState({selectedSuggestion:null,showSuggestions:!1})}},{key:"handleOnClick",value:function(t){this.selectLink(t),this.inputRef.current.focus()}},{key:"render",value:function(){var t=this,e=this.props,n=e.value,o=void 0===n?"":n,r=e.autoFocus,i=void 0===r||r,s=e.instanceId,a=e.className,c=this.state,l=c.showSuggestions,u=c.suggestions,f=c.selectedSuggestion,p=c.loading,d="block-editor-url-input-suggestions-".concat(s),h="block-editor-url-input-suggestion-".concat(s);return Object(y.createElement)("div",{className:O()("editor-url-input block-editor-url-input",a)},Object(y.createElement)("input",{autoFocus:i,type:"text","aria-label":Object(S.__)("URL"),required:!0,value:o,onChange:this.onChange,onInput:A,placeholder:Object(S.__)("Paste or type to search for your Pretty Link"),onKeyDown:this.onKeyDown,role:"combobox","aria-expanded":l,"aria-autocomplete":"list","aria-owns":d,"aria-activedescendant":null!==f?"".concat(h,"-").concat(f):void 0,ref:this.inputRef}),p&&Object(y.createElement)(E.Spinner,null),l&&!!u.length&&Object(y.createElement)(E.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},Object(y.createElement)("div",{className:"editor-url-input__suggestions block-editor-url-input__suggestions",id:d,ref:this.autocompleteRef,role:"listbox"},u.map(function(e,n){return Object(y.createElement)("button",{key:e.id,role:"option",tabIndex:"-1",id:"".concat(h,"-").concat(n),ref:t.bindSuggestionNode(n),className:O()("editor-url-input__suggestion block-editor-url-input__suggestion",{"is-selected":n===f}),onClick:function(){return t.handleOnClick(e)},"aria-selected":n===f},e.title)}))))}}]),e}(y.Component);e.default=Object(_.compose)(_.withSafeTimeout,E.withSpokenMessages,_.withInstanceId,Object(C.withSelect)(function(t){return{fetchLinkSuggestions:(0,t("core/block-editor").getSettings)().__experimentalFetchLinkSuggestions}}))(I)},function(t,e,n){var o;
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
@@ -9,4 +9,4 @@
9
  Licensed under the MIT License (MIT), see
10
  http://jedwatson.github.io/classnames
11
  */
12
- !function(){"use strict";var n={}.hasOwnProperty;function r(){for(var t=[],e=0;e<arguments.length;e++){var o=arguments[e];if(o){var i=typeof o;if("string"===i||"number"===i)t.push(o);else if(Array.isArray(o)&&o.length){var s=r.apply(null,o);s&&t.push(s)}else if("object"===i)for(var a in o)n.call(o,a)&&o[a]&&t.push(a)}}return t.join(" ")}void 0!==t&&t.exports?(r.default=r,t.exports=r):void 0===(o=function(){return r}.apply(e,[]))||(t.exports=o)}()},function(t,e,n){var o=n(32);t.exports=function(t,e){if(null==t)return{};var n,r,i=o(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}},function(t,e){!function(){t.exports=this.wp.compose}()},function(t,e,n){"use strict";n.r(e);var o=n(12),r=n.n(o),i=n(11),s=n.n(i),a=n(10),c=n.n(a),l=n(9),u=n.n(l),f=n(4),p=n.n(f),d=n(8),h=n.n(d),v=n(23),b=n.n(v),g=n(16),m=n.n(g),y=n(0),w=n(15),k=n.n(w),O=n(1),j=n(5),L=n(6),S=n(22),x=n(2),E=n(3),_=n(7),C=(n(19),n(14)),T=(n(31),n(13));function R(t){if(!t)return!1;var e=t.trim();if(!e)return!1;if(/^\S+:/.test(e)){var n=Object(x.getProtocol)(e);if(!Object(x.isValidProtocol)(n))return!1;if(Object(T.startsWith)(n,"http")&&!/^https?:\/\/[^\/\s]/i.test(e))return!1;var o=Object(x.getAuthority)(e);if(!Object(x.isValidAuthority)(o))return!1;var r=Object(x.getPath)(e);if(r&&!Object(x.isValidPath)(r))return!1;var i=Object(x.getQueryString)(e);if(i&&!Object(x.isValidQueryString)(i))return!1;var s=Object(x.getFragment)(e);if(s&&!Object(x.isValidFragment)(s))return!1}return!(Object(T.startsWith)(e,"#")&&!Object(x.isValidFragment)(e))}function N(t){var e=t.url,n=t.opensInNewWindow,o=t.text,r=t.noFollow,i={type:"core/link",attributes:{url:e}};if(i.attributes.rel="",r&&(i.attributes.rel+="nofollow "),n){var s=Object(O.sprintf)(Object(O.__)("%s (opens in a new tab)"),o);i.attributes.target="_blank",i.attributes.rel+="noreferrer noopener",i.attributes["aria-label"]=s}return""===i.attributes.rel&&delete i.attributes.rel,i}var P=function(t){return t.stopPropagation()};function A(t,e){return t.addingLink||e.editLink}var F=function(t){var e=t.value,n=t.onChangeInputValue,o=t.onKeyDown,r=t.submitLink,i=t.autocompleteRef;return Object(y.createElement)("form",{className:"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content",onKeyPress:P,onKeyDown:o,onSubmit:r},Object(y.createElement)(C.default,{value:e,onChange:n,autocompleteRef:i}),Object(y.createElement)(j.IconButton,{icon:"editor-break",label:Object(O.__)("Insert Pretty Link"),type:"submit"}))},I=function(t){var e=t.url,n=Object(x.prependHTTP)(e),o=k()("editor-format-toolbar__link-container-value block-editor-format-toolbar__link-container-value",{"has-invalid-link":!R(n)});return e?Object(y.createElement)(j.ExternalLink,{className:o,href:e},Object(x.filterURLForDisplay)(Object(x.safeDecodeURI)(e))):Object(y.createElement)("span",{className:o})},U=function(t){var e=t.isActive,n=t.addingLink,o=t.value,r=m()(t,["isActive","addingLink","value"]),i=Object(y.useMemo)(function(){var t=window.getSelection(),e=t.rangeCount>0?t.getRangeAt(0):null;if(e){if(n)return Object(S.getRectangleFromRange)(e);var o=e.startContainer;for(o=o.nextElementSibling||o;o.nodeType!==window.Node.ELEMENT_NODE;)o=o.parentNode;var r=o.closest("a");return r?r.getBoundingClientRect():void 0}},[e,n,o.start,o.end]);return i?Object(y.createElement)(_.URLPopover,b()({anchorRect:i},r)):null},W=function(t){var e=t.url,n=t.editLink;return Object(y.createElement)("div",{className:"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content",onKeyPress:P},Object(y.createElement)(I,{url:e}),Object(y.createElement)(j.IconButton,{icon:"edit",label:Object(O.__)("Edit"),onClick:n}))},D=function(t){function e(){var t;return r()(this,e),(t=c()(this,u()(e).apply(this,arguments))).editLink=t.editLink.bind(p()(t)),t.submitLink=t.submitLink.bind(p()(t)),t.onKeyDown=t.onKeyDown.bind(p()(t)),t.onChangeInputValue=t.onChangeInputValue.bind(p()(t)),t.setNoFollow=t.setNoFollow.bind(p()(t)),t.setLinkTarget=t.setLinkTarget.bind(p()(t)),t.onClickOutside=t.onClickOutside.bind(p()(t)),t.resetState=t.resetState.bind(p()(t)),t.autocompleteRef=Object(y.createRef)(),t.state={noFollow:!1,opensInNewWindow:!1,inputValue:"",newLinkUrl:"",newLinkSlug:"",creatingLink:!1,createdLink:!1,createdLinkError:!1},t}return h()(e,t),s()(e,[{key:"onKeyDown",value:function(t){[L.LEFT,L.DOWN,L.RIGHT,L.UP,L.BACKSPACE,L.ENTER].indexOf(t.keyCode)>-1&&t.stopPropagation()}},{key:"onChangeInputValue",value:function(t){this.setState({inputValue:t})}},{key:"setLinkTarget",value:function(t){var e=this.props,n=e.activeAttributes.url,o=void 0===n?"":n,r=e.value,i=e.onChange;if(this.setState({opensInNewWindow:t}),!A(this.props,this.state)){var s=Object(E.getTextContent)(Object(E.slice)(r));i(Object(E.applyFormat)(r,N({url:o,opensInNewWindow:t,text:s})))}}},{key:"setNoFollow",value:function(t){var e=this.props,n=e.activeAttributes.url,o=void 0===n?"":n,r=e.value,i=e.onChange;if(this.setState({noFollow:t}),!A(this.props,this.state)){var s=Object(E.getTextContent)(Object(E.slice)(r));i(Object(E.applyFormat)(r,N({url:o,opensInNewWindow:opensInNewWindow,text:s,noFollow:t})))}}},{key:"editLink",value:function(t){this.setState({editLink:!0}),t.preventDefault()}},{key:"submitLink",value:function(t){var e=this.props,n=e.isActive,o=e.value,r=e.onChange,i=e.speak,s=this.state,a=s.inputValue,c=s.opensInNewWindow,l=s.noFollow,u=Object(x.prependHTTP)(a),f=N({url:u,opensInNewWindow:c,text:Object(E.getTextContent)(Object(E.slice)(o)),noFollow:l});if(t.preventDefault(),Object(E.isCollapsed)(o)&&!n){var p=Object(E.applyFormat)(Object(E.create)({text:u}),f,0,u.length);r(Object(E.insert)(o,p))}else r(Object(E.applyFormat)(o,f));this.resetState(),R(u)?i(n?Object(O.__)("Link edited."):Object(O.__)("Link inserted."),"assertive"):i(Object(O.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")}},{key:"onClickOutside",value:function(t){var e=this.autocompleteRef.current;e&&e.contains(t.target)||this.resetState()}},{key:"resetState",value:function(){this.props.stopAddingLink(),this.setState({editLink:!1})}},{key:"render",value:function(){var t=this,e=this.props,n=e.isActive,o=e.activeAttributes.url,r=e.addingLink,i=e.value;if(!n&&!r)return null;var s=this.state,a=s.inputValue,c=s.noFollow,l=s.opensInNewWindow,u=s.newLinkUrl,f=s.newLinkSlug,p=s.creatingLink,d=s.createdLink,h=s.createdLinkError,v=A(this.props,this.state);return Object(y.createElement)(U,{className:"pretty-link-inserter",value:i,isActive:n,addingLink:r,onClickOutside:this.onClickOutside,onClose:this.resetState,focusOnMount:!!v&&"firstElement",renderSettings:function(){return Object(y.createElement)(y.Fragment,null,Object(y.createElement)("div",null,Object(y.createElement)(j.ToggleControl,{label:Object(O.__)("Open in New Tab"),checked:l,onChange:t.setLinkTarget}),Object(y.createElement)(j.ToggleControl,{label:Object(O.__)("Nofollow"),checked:c,onChange:t.setNoFollow})),Object(y.createElement)("div",{className:"pretty-link-inserter-form-container"},d&&Object(y.createElement)(j.Notice,{status:"success",onRemove:function(){return t.setState({createdLink:!1})}},Object(y.createElement)("p",null,Object(O.__)("Pretty Link created successfully.","memberpress"))),h&&Object(y.createElement)(j.Notice,{status:"error",onRemove:function(){return t.setState({createdLink:!1,createdLinkError:!1})}},Object(y.createElement)("p",null,Object(O.__)("Pretty Link could not be created. Please try a slug that is not already used.","memberpress"))),Object(y.createElement)("strong",null,Object(O.__)("New Pretty Link","pretty-link")),Object(y.createElement)("form",{onSubmit:function(e){e.preventDefault(),t.setState({creatingLink:!0,createdLinkError:!1}),function(t,e){return new Promise(function(n,o){jQuery.post(ajaxurl,{action:"prli_create_pretty_link",target:t,slug:e,redirect:"",nofollow:1,tracking:1},function(t,e,r){"true"===t?n(t):o(t)}).fail(function(t){o(t)})})}(u,f).then(function(e){t.setState({createdLink:!0,creatingLink:!1,inputValue:plEditor.homeUrl+f,newLinkUrl:"",newLinkSlug:""})}).catch(function(e){t.setState({createdLink:!1,creatingLink:!1,createdLinkError:!0})})}},Object(y.createElement)("p",null,Object(y.createElement)(j.TextControl,{placeholder:"URL",className:"pretty-link-new-link-url",value:u,onChange:function(e){t.setState({newLinkUrl:e})}})),Object(y.createElement)("p",null,Object(y.createElement)(j.TextControl,{placeholder:"Slug",className:"pretty-link-new-link-slug",value:f,onChange:function(e){t.setState({newLinkSlug:e})}})),Object(y.createElement)("p",null,Object(y.createElement)("button",{className:"pretty-link-submit-new-link components-button is-button is-primary",onClick:function(){console.log("Creating new Pretty Link...")}},Object(O.__)("Create New Pretty Link","pretty-link")),p&&Object(y.createElement)(j.Spinner,null)))))}},v?Object(y.createElement)(F,{value:a,onChangeInputValue:this.onChangeInputValue,onKeyDown:this.onKeyDown,submitLink:this.submitLink,autocompleteRef:this.autocompleteRef}):Object(y.createElement)(W,{url:o,editLink:this.editLink}))}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n=t.activeAttributes,o=n.url,r="_blank"===n.target;if(!A(t,e)){if(o!==e.inputValue)return{inputValue:o};if(r!==e.opensInNewWindow)return{opensInNewWindow:r}}return null}}]),e}(y.Component);e.default=Object(j.withSpokenMessages)(D)},function(t,e){!function(){t.exports=this.wp.apiFetch}()},function(t,e){!function(){t.exports=this.wp.htmlEntities}()},function(t,e){!function(){t.exports=this.regeneratorRuntime}()},function(t,e){!function(){t.exports=this.wp.dom}()},function(t,e){function n(){return t.exports=n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},n.apply(this,arguments)}t.exports=n},function(t,e){!function(){t.exports=this.wp.data}()},function(t,e,n){"use strict";t.exports=n(34)},function(t,e){function n(t,e,n,o,r,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(o,r)}t.exports=function(t){return function(){var e=this,o=arguments;return new Promise(function(r,i){var s=t.apply(e,o);function a(t){n(s,r,i,a,c,"next",t)}function c(t){n(s,r,i,a,c,"throw",t)}a(void 0)})}}},function(t,e,n){"use strict";n.r(e),n.d(e,"prettyLink",function(){return x});var o=n(16),r=n.n(o),i=n(12),s=n.n(i),a=n(11),c=n.n(a),l=n(10),u=n.n(l),f=n(9),p=n.n(f),d=n(4),h=n.n(d),v=n(8),b=n.n(v),g=n(0),m=n(1),y=n(5),w=n(3),k=n(2),O=n(7),j=n(18),L="pretty-link/pretty-link",S=Object(m.__)("Pretty Link"),x={name:L,title:S,tagName:"a",className:"pretty-link",attributes:{url:"href",target:"target"},edit:Object(y.withSpokenMessages)(function(t){function e(){var t;return s()(this,e),(t=u()(this,p()(e).apply(this,arguments))).addLink=t.addLink.bind(h()(t)),t.stopAddingLink=t.stopAddingLink.bind(h()(t)),t.onRemoveFormat=t.onRemoveFormat.bind(h()(t)),t.state={addingLink:!1},t}return b()(e,t),c()(e,[{key:"addLink",value:function(){var t=this.props,e=t.value,n=t.onChange,o=Object(w.getTextContent)(Object(w.slice)(e));o&&Object(k.isURL)(o)?n(Object(w.applyFormat)(e,{type:L,attributes:{url:o}})):this.setState({addingLink:!0})}},{key:"stopAddingLink",value:function(){this.setState({addingLink:!1})}},{key:"onRemoveFormat",value:function(){var t=this.props,e=t.value,n=t.onChange,o=t.speak;n(Object(w.removeFormat)(e,L)),o(Object(m.__)("Link removed."),"assertive")}},{key:"render",value:function(){var t=this.props,e=t.isActive,n=t.activeAttributes,o=t.value,r=t.onChange;return Object(g.createElement)(g.Fragment,null,Object(g.createElement)(O.RichTextShortcut,{type:"primary",character:"p",onUse:this.addLink}),Object(g.createElement)(O.RichTextShortcut,{type:"primaryShift",character:"p",onUse:this.onRemoveFormat}),e&&Object(g.createElement)(O.RichTextToolbarButton,{icon:"star-filled",title:Object(m.__)("Unlink"),onClick:this.onRemoveFormat,isActive:e,shortcutType:"primaryShift",shortcutCharacter:"p"}),!e&&Object(g.createElement)(O.RichTextToolbarButton,{icon:"star-filled",title:S,onClick:this.addLink,isActive:e,shortcutType:"primary",shortcutCharacter:"p"}),Object(g.createElement)(j.default,{addingLink:this.state.addingLink,stopAddingLink:this.stopAddingLink,isActive:e,activeAttributes:n,value:o,onChange:r}))}}]),e}(g.Component))};[x].forEach(function(t){var e=t.name,n=r()(t,["name"]);return Object(w.registerFormatType)(e,n)})},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,o=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var r,i=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?t:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}},function(t,e,n){var o={},r=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),i=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var o=function(t,e){return e?e.querySelector(t):document.querySelector(t)}.call(this,t,n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}}(),s=null,a=0,c=[],l=n(28);function u(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=o[r.id];if(i){i.refs++;for(var s=0;s<i.parts.length;s++)i.parts[s](r.parts[s]);for(;s<r.parts.length;s++)i.parts.push(b(r.parts[s],e))}else{var a=[];for(s=0;s<r.parts.length;s++)a.push(b(r.parts[s],e));o[r.id]={id:r.id,refs:1,parts:a}}}}function f(t,e){for(var n=[],o={},r=0;r<t.length;r++){var i=t[r],s=e.base?i[0]+e.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};o[s]?o[s].parts.push(a):n.push(o[s]={id:s,parts:[a]})}return n}function p(t,e){var n=i(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=c[c.length-1];if("top"===t.insertAt)o?o.nextSibling?n.insertBefore(e,o.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),c.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=i(t.insertAt.before,n);n.insertBefore(e,r)}}function d(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=c.indexOf(t);e>=0&&c.splice(e,1)}function h(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var o=function(){0;return n.nc}();o&&(t.attrs.nonce=o)}return v(e,t.attrs),p(t,e),e}function v(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function b(t,e){var n,o,r,i;if(e.transform&&t.css){if(!(i="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=i}if(e.singleton){var c=a++;n=s||(s=h(e)),o=m.bind(null,n,c,!1),r=m.bind(null,n,c,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",v(e,t.attrs),p(t,e),e}(e),o=function(t,e,n){var o=n.css,r=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||i)&&(o=l(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var s=new Blob([o],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}.bind(null,n,e),r=function(){d(n),n.href&&URL.revokeObjectURL(n.href)}):(n=h(e),o=function(t,e){var n=e.css,o=e.media;o&&t.setAttribute("media",o);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){d(n)});return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=r()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=f(t,e);return u(n,e),function(t){for(var r=[],i=0;i<n.length;i++){var s=n[i];(a=o[s.id]).refs--,r.push(a)}t&&u(f(t,e),e);for(i=0;i<r.length;i++){var a;if(0===(a=r[i]).refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete o[a.id]}}}};var g=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}();function m(t,e,n,o){var r=n?"":o.css;if(t.styleSheet)t.styleSheet.cssText=g(e,r);else{var i=document.createTextNode(r),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(i,s[e]):t.appendChild(i)}}},function(t,e){t.exports=".pretty-link-inserter .block-editor-url-popover__settings {\n display: block; }\n\n.pretty-link-inserter .pretty-link-inserter-form-container {\n margin-top: 30px; }\n"},function(t,e,n){var o=n(30);"string"==typeof o&&(o=[[t.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(29)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=function(t,e){if(null==t)return{};var n,o,r={},i=Object.keys(t);for(o=0;o<i.length;o++)n=i[o],e.indexOf(n)>=0||(r[n]=t[n]);return r}},function(t,e,n){"use strict";var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};function i(t,e){var n=t["page"+(e?"Y":"X")+"Offset"],o="scroll"+(e?"Top":"Left");if("number"!=typeof n){var r=t.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function s(t){return i(t)}function a(t){return i(t,!0)}function c(t){var e=function(t){var e,n=void 0,o=void 0,r=t.ownerDocument,i=r.body,s=r&&r.documentElement;return n=(e=t.getBoundingClientRect()).left,o=e.top,{left:n-=s.clientLeft||i.clientLeft||0,top:o-=s.clientTop||i.clientTop||0}}(t),n=t.ownerDocument,o=n.defaultView||n.parentWindow;return e.left+=s(o),e.top+=a(o),e}var l=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),u=/^(top|right|bottom|left)$/,f="currentStyle",p="runtimeStyle",d="left",h="px";var v=void 0;function b(t,e){for(var n=0;n<t.length;n++)e(t[n])}function g(t){return"border-box"===v(t,"boxSizing")}"undefined"!=typeof window&&(v=window.getComputedStyle?function(t,e,n){var o="",r=t.ownerDocument,i=n||r.defaultView.getComputedStyle(t,null);return i&&(o=i.getPropertyValue(e)||i[e]),o}:function(t,e){var n=t[f]&&t[f][e];if(l.test(n)&&!u.test(e)){var o=t.style,r=o[d],i=t[p][d];t[p][d]=t[f][d],o[d]="fontSize"===e?"1em":n||0,n=o.pixelLeft+h,o[d]=r,t[p][d]=i}return""===n?"auto":n});var m=["margin","border","padding"],y=-1,w=2,k=1;function O(t,e,n){var o=0,r=void 0,i=void 0,s=void 0;for(i=0;i<e.length;i++)if(r=e[i])for(s=0;s<n.length;s++){var a=void 0;a="border"===r?r+n[s]+"Width":r+n[s],o+=parseFloat(v(t,a))||0}return o}function j(t){return null!=t&&t==t.window}var L={};function S(t,e,n){if(j(t))return"width"===e?L.viewportWidth(t):L.viewportHeight(t);if(9===t.nodeType)return"width"===e?L.docWidth(t):L.docHeight(t);var o="width"===e?["Left","Right"]:["Top","Bottom"],r="width"===e?t.offsetWidth:t.offsetHeight,i=(v(t),g(t)),s=0;(null==r||r<=0)&&(r=void 0,(null==(s=v(t,e))||Number(s)<0)&&(s=t.style[e]||0),s=parseFloat(s)||0),void 0===n&&(n=i?k:y);var a=void 0!==r||i,c=r||s;if(n===y)return a?c-O(t,["border","padding"],o):s;if(a){var l=n===w?-O(t,["border"],o):O(t,["margin"],o);return c+(n===k?0:l)}return s+O(t,m.slice(n),o)}b(["Width","Height"],function(t){L["doc"+t]=function(e){var n=e.document;return Math.max(n.documentElement["scroll"+t],n.body["scroll"+t],L["viewport"+t](n))},L["viewport"+t]=function(e){var n="client"+t,o=e.document,r=o.body,i=o.documentElement[n];return"CSS1Compat"===o.compatMode&&i||r&&r[n]||i}});var x={position:"absolute",visibility:"hidden",display:"block"};function E(t){var e=void 0,n=arguments;return 0!==t.offsetWidth?e=S.apply(void 0,n):function(t,e,n){var o={},r=t.style,i=void 0;for(i in e)e.hasOwnProperty(i)&&(o[i]=r[i],r[i]=e[i]);for(i in n.call(t),e)e.hasOwnProperty(i)&&(r[i]=o[i])}(t,x,function(){e=S.apply(void 0,n)}),e}function _(t,e,n){var o=n;if("object"!==(void 0===e?"undefined":r(e)))return void 0!==o?("number"==typeof o&&(o+="px"),void(t.style[e]=o)):v(t,e);for(var i in e)e.hasOwnProperty(i)&&_(t,i,e[i])}b(["width","height"],function(t){var e=t.charAt(0).toUpperCase()+t.slice(1);L["outer"+e]=function(e,n){return e&&E(e,t,n?0:k)};var n="width"===t?["Left","Right"]:["Top","Bottom"];L[t]=function(e,o){if(void 0===o)return e&&E(e,t,y);if(e){v(e);return g(e)&&(o+=O(e,["padding","border"],n)),_(e,t,o)}}}),t.exports=o({getWindow:function(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow},offset:function(t,e){if(void 0===e)return c(t);!function(t,e){"static"===_(t,"position")&&(t.style.position="relative");var n=c(t),o={},r=void 0,i=void 0;for(i in e)e.hasOwnProperty(i)&&(r=parseFloat(_(t,i))||0,o[i]=r+e[i]-n[i]);_(t,o)}(t,e)},isWindow:j,each:b,css:_,clone:function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);if(t.overflow)for(var n in t)t.hasOwnProperty(n)&&(e.overflow[n]=t.overflow[n]);return e},scrollLeft:function(t,e){if(j(t)){if(void 0===e)return s(t);window.scrollTo(e,a(t))}else{if(void 0===e)return t.scrollLeft;t.scrollLeft=e}},scrollTop:function(t,e){if(j(t)){if(void 0===e)return a(t);window.scrollTo(s(t),e)}else{if(void 0===e)return t.scrollTop;t.scrollTop=e}},viewportWidth:0,viewportHeight:0},L)},function(t,e,n){"use strict";var o=n(33);t.exports=function(t,e,n){n=n||{},9===e.nodeType&&(e=o.getWindow(e));var r=n.allowHorizontalScroll,i=n.onlyScrollIfNeeded,s=n.alignWithTop,a=n.alignWithLeft,c=n.offsetTop||0,l=n.offsetLeft||0,u=n.offsetBottom||0,f=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(e),d=o.offset(t),h=o.outerHeight(t),v=o.outerWidth(t),b=void 0,g=void 0,m=void 0,y=void 0,w=void 0,k=void 0,O=void 0,j=void 0,L=void 0,S=void 0;p?(O=e,S=o.height(O),L=o.width(O),j={left:o.scrollLeft(O),top:o.scrollTop(O)},w={left:d.left-j.left-l,top:d.top-j.top-c},k={left:d.left+v-(j.left+L)+f,top:d.top+h-(j.top+S)+u},y=j):(b=o.offset(e),g=e.clientHeight,m=e.clientWidth,y={left:e.scrollLeft,top:e.scrollTop},w={left:d.left-(b.left+(parseFloat(o.css(e,"borderLeftWidth"))||0))-l,top:d.top-(b.top+(parseFloat(o.css(e,"borderTopWidth"))||0))-c},k={left:d.left+v-(b.left+m+(parseFloat(o.css(e,"borderRightWidth"))||0))+f,top:d.top+h-(b.top+g+(parseFloat(o.css(e,"borderBottomWidth"))||0))+u}),w.top<0||k.top>0?!0===s?o.scrollTop(e,y.top+w.top):!1===s?o.scrollTop(e,y.top+k.top):w.top<0?o.scrollTop(e,y.top+w.top):o.scrollTop(e,y.top+k.top):i||((s=void 0===s||!!s)?o.scrollTop(e,y.top+w.top):o.scrollTop(e,y.top+k.top)),r&&(w.left<0||k.left>0?!0===a?o.scrollLeft(e,y.left+w.left):!1===a?o.scrollLeft(e,y.left+k.left):w.left<0?o.scrollLeft(e,y.left+w.left):o.scrollLeft(e,y.left+k.left):i||((a=void 0===a||!!a)?o.scrollLeft(e,y.left+w.left):o.scrollLeft(e,y.left+k.left)))}},function(t,e){function n(e,o){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,o)}t.exports=n},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=o=function(t){return n(t)}:t.exports=o=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},o(e)}t.exports=o},function(t,e,n){"use strict";n.r(e);var o=n(14);n.d(e,"URLInput",function(){return o.default})},function(t,e,n){n(37),n(18),n(14),t.exports=n(27)}]);
1
+ !function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=38)}([function(t,e){!function(){t.exports=this.wp.element}()},function(t,e){!function(){t.exports=this.wp.i18n}()},function(t,e){!function(){t.exports=this.wp.richText}()},function(t,e){!function(){t.exports=this.wp.url}()},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){!function(){t.exports=this.wp.components}()},function(t,e){!function(){t.exports=this.wp.keycodes}()},function(t,e){!function(){t.exports=this.wp.blockEditor}()},function(t,e,n){var o=n(35);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e,n){var o=n(36),r=n(4);t.exports=function(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?r(t):e}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}t.exports=function(t,e,o){return e&&n(t.prototype,e),o&&n(t,o),t}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){!function(){t.exports=this.lodash}()},function(t,e,n){"use strict";n.r(e);var o=n(12),r=n.n(o),i=n(11),s=n.n(i),a=n(10),l=n.n(a),c=n(9),u=n.n(c),f=n(4),p=n.n(f),d=n(8),h=n.n(d),b=n(21),v=n.n(b),g=n(26),m=n.n(g),y=n(0),w=n(13),k=n(15),O=n.n(k),j=n(25),S=n.n(j),L=n(1),x=n(6),E=n(5),_=n(17),C=n(24),T=n(19),R=n.n(T),N=n(3),P=n(20),I=function(t){return t.stopPropagation()},F=function(){var t=m()(v.a.mark(function t(e){var n;return v.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,R()({url:Object(N.addQueryArgs)(ajaxurl,{action:"prli_search_for_links",term:e})});case 2:return n=t.sent,t.abrupt("return",Object(w.map)(n,function(t){return{url:t.pretty_url,title:Object(P.decodeEntities)(t.value)+" ("+Object(P.decodeEntities)(t.slug)+")"||Object(L.__)("(no title)")}}));case 4:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),A=function(t){function e(t){var n,o=t.autocompleteRef;return r()(this,e),(n=l()(this,u()(e).apply(this,arguments))).onChange=n.onChange.bind(p()(n)),n.onKeyDown=n.onKeyDown.bind(p()(n)),n.autocompleteRef=o||Object(y.createRef)(),n.inputRef=Object(y.createRef)(),n.updateSuggestions=Object(w.throttle)(n.updateSuggestions.bind(p()(n)),200),n.suggestionNodes=[],n.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null},n}return h()(e,t),s()(e,[{key:"componentDidUpdate",value:function(){var t=this,e=this.state,n=e.showSuggestions,o=e.selectedSuggestion;n&&null!==o&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,S()(this.suggestionNodes[o],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout(function(){t.scrollingIntoView=!1},100))}},{key:"componentWillUnmount",value:function(){delete this.suggestionsRequest}},{key:"bindSuggestionNode",value:function(t){var e=this;return function(n){e.suggestionNodes[t]=n}}},{key:"updateSuggestions",value:function(t){var e=this;if(t.length<2||/^https?:/.test(t))this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});else{this.setState({showSuggestions:!0,selectedSuggestion:null,loading:!0});var n=F(t);n.then(function(t){e.suggestionsRequest===n&&(e.setState({suggestions:t,loading:!1}),t.length?e.props.debouncedSpeak(Object(L.sprintf)(Object(L._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",t.length),t.length),"assertive"):e.props.debouncedSpeak(Object(L.__)("No results."),"assertive"))}).catch(function(){e.suggestionsRequest===n&&e.setState({loading:!1})}),this.suggestionsRequest=n}}},{key:"onChange",value:function(t){var e=t.target.value;this.props.onChange(e),this.updateSuggestions(e)}},{key:"onKeyDown",value:function(t){var e=this.state,n=e.showSuggestions,o=e.selectedSuggestion,r=e.suggestions,i=e.loading;if(n&&r.length&&!i){var s=this.state.suggestions[this.state.selectedSuggestion];switch(t.keyCode){case x.UP:t.stopPropagation(),t.preventDefault();var a=o?o-1:r.length-1;this.setState({selectedSuggestion:a});break;case x.DOWN:t.stopPropagation(),t.preventDefault();var l=null===o||o===r.length-1?0:o+1;this.setState({selectedSuggestion:l});break;case x.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(s),this.props.speak(Object(L.__)("Link selected.")));break;case x.ENTER:null!==this.state.selectedSuggestion&&(t.stopPropagation(),this.selectLink(s))}}else switch(t.keyCode){case x.UP:0!==t.target.selectionStart&&(t.stopPropagation(),t.preventDefault(),t.target.setSelectionRange(0,0));break;case x.DOWN:this.props.value.length!==t.target.selectionStart&&(t.stopPropagation(),t.preventDefault(),t.target.setSelectionRange(this.props.value.length,this.props.value.length))}}},{key:"selectLink",value:function(t){this.props.onChange(t.url,t),this.setState({selectedSuggestion:null,showSuggestions:!1})}},{key:"handleOnClick",value:function(t){this.selectLink(t),this.inputRef.current.focus()}},{key:"render",value:function(){var t=this,e=this.props,n=e.value,o=void 0===n?"":n,r=e.autoFocus,i=void 0===r||r,s=e.instanceId,a=e.className,l=this.state,c=l.showSuggestions,u=l.suggestions,f=l.selectedSuggestion,p=l.loading,d="block-editor-url-input-suggestions-".concat(s),h="block-editor-url-input-suggestion-".concat(s);return Object(y.createElement)("div",{className:O()("editor-url-input block-editor-url-input",a)},Object(y.createElement)("input",{autoFocus:i,type:"text","aria-label":Object(L.__)("URL"),required:!0,value:o,onChange:this.onChange,onInput:I,placeholder:Object(L.__)("Paste or type to search for your Pretty Link"),onKeyDown:this.onKeyDown,role:"combobox","aria-expanded":c,"aria-autocomplete":"list","aria-owns":d,"aria-activedescendant":null!==f?"".concat(h,"-").concat(f):void 0,ref:this.inputRef}),p&&Object(y.createElement)(E.Spinner,null),c&&!!u.length&&Object(y.createElement)(E.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},Object(y.createElement)("div",{className:"editor-url-input__suggestions block-editor-url-input__suggestions",id:d,ref:this.autocompleteRef,role:"listbox"},u.map(function(e,n){return Object(y.createElement)("button",{key:e.id,role:"option",tabIndex:"-1",id:"".concat(h,"-").concat(n),ref:t.bindSuggestionNode(n),className:O()("editor-url-input__suggestion block-editor-url-input__suggestion",{"is-selected":n===f}),onClick:function(){return t.handleOnClick(e)},"aria-selected":n===f},e.title)}))))}}]),e}(y.Component);e.default=Object(_.compose)(_.withSafeTimeout,E.withSpokenMessages,_.withInstanceId,Object(C.withSelect)(function(t){return{fetchLinkSuggestions:(0,t("core/block-editor").getSettings)().__experimentalFetchLinkSuggestions}}))(A)},function(t,e,n){var o;
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
9
  Licensed under the MIT License (MIT), see
10
  http://jedwatson.github.io/classnames
11
  */
12
+ !function(){"use strict";var n={}.hasOwnProperty;function r(){for(var t=[],e=0;e<arguments.length;e++){var o=arguments[e];if(o){var i=typeof o;if("string"===i||"number"===i)t.push(o);else if(Array.isArray(o)&&o.length){var s=r.apply(null,o);s&&t.push(s)}else if("object"===i)for(var a in o)n.call(o,a)&&o[a]&&t.push(a)}}return t.join(" ")}void 0!==t&&t.exports?(r.default=r,t.exports=r):void 0===(o=function(){return r}.apply(e,[]))||(t.exports=o)}()},function(t,e,n){var o=n(32);t.exports=function(t,e){if(null==t)return{};var n,r,i=o(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}},function(t,e){!function(){t.exports=this.wp.compose}()},function(t,e,n){"use strict";n.r(e);var o=n(12),r=n.n(o),i=n(11),s=n.n(i),a=n(10),l=n.n(a),c=n(9),u=n.n(c),f=n(4),p=n.n(f),d=n(8),h=n.n(d),b=n(23),v=n.n(b),g=n(16),m=n.n(g),y=n(0),w=n(15),k=n.n(w),O=n(1),j=n(5),S=n(6),L=n(22),x=n(3),E=n(2),_=n(7),C=(n(19),n(14)),T=(n(31),n(13));function R(t){if(!t)return!1;var e=t.trim();if(!e)return!1;if(/^\S+:/.test(e)){var n=Object(x.getProtocol)(e);if(!Object(x.isValidProtocol)(n))return!1;if(Object(T.startsWith)(n,"http")&&!/^https?:\/\/[^\/\s]/i.test(e))return!1;var o=Object(x.getAuthority)(e);if(!Object(x.isValidAuthority)(o))return!1;var r=Object(x.getPath)(e);if(r&&!Object(x.isValidPath)(r))return!1;var i=Object(x.getQueryString)(e);if(i&&!Object(x.isValidQueryString)(i))return!1;var s=Object(x.getFragment)(e);if(s&&!Object(x.isValidFragment)(s))return!1}return!(Object(T.startsWith)(e,"#")&&!Object(x.isValidFragment)(e))}function N(t){var e=t.url,n=t.opensInNewWindow,o=t.text,r=t.noFollow,i=t.isSponsored,s={type:"core/link",attributes:{url:e}};if(s.attributes.rel="",r&&(s.attributes.rel+="nofollow noindex "),i&&(s.attributes.rel+="sponsored "),n){var a=Object(O.sprintf)(Object(O.__)("%s (opens in a new tab)"),o);s.attributes.target="_blank",s.attributes.rel+="noreferrer noopener",s.attributes["aria-label"]=a}return""===s.attributes.rel&&delete s.attributes.rel,s}var P=function(t){return t.stopPropagation()};function I(t,e){return t.addingLink||e.editLink}var F=function(t){var e=t.value,n=t.onChangeInputValue,o=t.onKeyDown,r=t.submitLink,i=t.autocompleteRef;return Object(y.createElement)("form",{className:"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content",onKeyPress:P,onKeyDown:o,onSubmit:r},Object(y.createElement)(C.default,{value:e,onChange:n,autocompleteRef:i}),Object(y.createElement)(j.IconButton,{icon:"editor-break",label:Object(O.__)("Insert Pretty Link"),type:"submit"}))},A=function(t){var e=t.url,n=Object(x.prependHTTP)(e),o=k()("editor-format-toolbar__link-container-value block-editor-format-toolbar__link-container-value",{"has-invalid-link":!R(n)});return e?Object(y.createElement)(j.ExternalLink,{className:o,href:e},Object(x.filterURLForDisplay)(Object(x.safeDecodeURI)(e))):Object(y.createElement)("span",{className:o})},W=function(t){var e=t.isActive,n=t.addingLink,o=t.value,r=m()(t,["isActive","addingLink","value"]),i=Object(y.useMemo)(function(){var t=window.getSelection(),e=t.rangeCount>0?t.getRangeAt(0):null;if(e){if(n)return Object(L.getRectangleFromRange)(e);var o=e.startContainer;for(o=o.nextElementSibling||o;o.nodeType!==window.Node.ELEMENT_NODE;)o=o.parentNode;var r=o.closest("a");return r?r.getBoundingClientRect():void 0}},[e,n,o.start,o.end]);return i?Object(y.createElement)(_.URLPopover,v()({anchorRect:i},r)):null},U=function(t){var e=t.url,n=t.editLink;return Object(y.createElement)("div",{className:"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content",onKeyPress:P},Object(y.createElement)(A,{url:e}),Object(y.createElement)(j.IconButton,{icon:"edit",label:Object(O.__)("Edit"),onClick:n}))},D=function(t){function e(){var t;return r()(this,e),(t=l()(this,u()(e).apply(this,arguments))).editLink=t.editLink.bind(p()(t)),t.submitLink=t.submitLink.bind(p()(t)),t.onKeyDown=t.onKeyDown.bind(p()(t)),t.onChangeInputValue=t.onChangeInputValue.bind(p()(t)),t.setNoFollow=t.setNoFollow.bind(p()(t)),t.setIsSponsored=t.setIsSponsored.bind(p()(t)),t.setLinkTarget=t.setLinkTarget.bind(p()(t)),t.onClickOutside=t.onClickOutside.bind(p()(t)),t.resetState=t.resetState.bind(p()(t)),t.autocompleteRef=Object(y.createRef)(),t.state={noFollow:!1,opensInNewWindow:!1,isSponsored:!1,inputValue:"",newLinkUrl:"",newLinkSlug:"",creatingLink:!1,createdLink:!1,createdLinkError:!1},t}return h()(e,t),s()(e,[{key:"onKeyDown",value:function(t){[S.LEFT,S.DOWN,S.RIGHT,S.UP,S.BACKSPACE,S.ENTER].indexOf(t.keyCode)>-1&&t.stopPropagation()}},{key:"onChangeInputValue",value:function(t){this.setState({inputValue:t})}},{key:"setLinkTarget",value:function(t){var e=this.props,n=e.activeAttributes.url,o=void 0===n?"":n,r=e.value,i=e.onChange;if(this.setState({opensInNewWindow:t}),!I(this.props,this.state)){var s=Object(E.getTextContent)(Object(E.slice)(r));i(Object(E.applyFormat)(r,N({url:o,opensInNewWindow:t,text:s})))}}},{key:"setNoFollow",value:function(t){var e=this.props,n=e.activeAttributes.url,o=void 0===n?"":n,r=e.value,i=e.onChange;if(this.setState({noFollow:t}),!I(this.props,this.state)){var s=Object(E.getTextContent)(Object(E.slice)(r));i(Object(E.applyFormat)(r,N({url:o,opensInNewWindow:opensInNewWindow,text:s,noFollow:t,isSponsored:isSponsored})))}}},{key:"setIsSponsored",value:function(t){var e=this.props,n=e.activeAttributes.url,o=void 0===n?"":n,r=e.value,i=e.onChange;if(this.setState({isSponsored:t}),!I(this.props,this.state)){var s=Object(E.getTextContent)(Object(E.slice)(r));i(Object(E.applyFormat)(r,N({url:o,opensInNewWindow:opensInNewWindow,text:s,noFollow:noFollow,isSponsored:t})))}}},{key:"editLink",value:function(t){this.setState({editLink:!0}),t.preventDefault()}},{key:"submitLink",value:function(t){var e=this.props,n=e.isActive,o=e.value,r=e.onChange,i=e.speak,s=this.state,a=s.inputValue,l=s.opensInNewWindow,c=s.noFollow,u=s.isSponsored,f=Object(x.prependHTTP)(a),p=N({url:f,opensInNewWindow:l,text:Object(E.getTextContent)(Object(E.slice)(o)),noFollow:c,isSponsored:u});if(t.preventDefault(),Object(E.isCollapsed)(o)&&!n){var d=Object(E.applyFormat)(Object(E.create)({text:f}),p,0,f.length);r(Object(E.insert)(o,d))}else r(Object(E.applyFormat)(o,p));this.resetState(),R(f)?i(n?Object(O.__)("Link edited."):Object(O.__)("Link inserted."),"assertive"):i(Object(O.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")}},{key:"onClickOutside",value:function(t){var e=this.autocompleteRef.current;e&&e.contains(t.target)||this.resetState()}},{key:"resetState",value:function(){this.props.stopAddingLink(),this.setState({editLink:!1})}},{key:"render",value:function(){var t=this,e=this.props,n=e.isActive,o=e.activeAttributes.url,r=e.addingLink,i=e.value;if(!n&&!r)return null;var s=this.state,a=s.inputValue,l=s.noFollow,c=s.opensInNewWindow,u=s.isSponsored,f=s.newLinkUrl,p=s.newLinkSlug,d=s.creatingLink,h=s.createdLink,b=s.createdLinkError,v=I(this.props,this.state);return Object(y.createElement)(W,{className:"pretty-link-inserter",value:i,isActive:n,addingLink:r,onClickOutside:this.onClickOutside,onClose:this.resetState,focusOnMount:!!v&&"firstElement",renderSettings:function(){return Object(y.createElement)(y.Fragment,null,Object(y.createElement)("div",null,Object(y.createElement)(j.ToggleControl,{label:Object(O.__)("Open in New Tab"),checked:c,onChange:t.setLinkTarget}),Object(y.createElement)(j.ToggleControl,{label:Object(O.__)("Nofollow"),checked:l,onChange:t.setNoFollow}),Object(y.createElement)(j.ToggleControl,{label:Object(O.__)("Sponsored Link"),checked:u,onChange:t.setIsSponsored})),Object(y.createElement)("div",{className:"pretty-link-inserter-form-container"},h&&Object(y.createElement)(j.Notice,{status:"success",onRemove:function(){return t.setState({createdLink:!1})}},Object(y.createElement)("p",null,Object(O.__)("Pretty Link created successfully.","memberpress"))),b&&Object(y.createElement)(j.Notice,{status:"error",onRemove:function(){return t.setState({createdLink:!1,createdLinkError:!1})}},Object(y.createElement)("p",null,Object(O.__)("Pretty Link could not be created. Please try a slug that is not already used.","memberpress"))),Object(y.createElement)("strong",null,Object(O.__)("New Pretty Link","pretty-link")),Object(y.createElement)("form",{onSubmit:function(e){e.preventDefault(),t.setState({creatingLink:!0,createdLinkError:!1}),function(t,e){return new Promise(function(n,o){jQuery.post(ajaxurl,{action:"prli_create_pretty_link",target:t,slug:e,redirect:"",nofollow:1,tracking:1,sponsored:0},function(t,e,r){"true"===t?n(t):o(t)}).fail(function(t){o(t)})})}(f,p).then(function(e){t.setState({createdLink:!0,creatingLink:!1,inputValue:plEditor.homeUrl+p,newLinkUrl:"",newLinkSlug:""})}).catch(function(e){t.setState({createdLink:!1,creatingLink:!1,createdLinkError:!0})})}},Object(y.createElement)("p",null,Object(y.createElement)(j.TextControl,{placeholder:"URL",className:"pretty-link-new-link-url",value:f,onChange:function(e){t.setState({newLinkUrl:e})}})),Object(y.createElement)("p",null,Object(y.createElement)(j.TextControl,{placeholder:"Slug",className:"pretty-link-new-link-slug",value:p,onChange:function(e){t.setState({newLinkSlug:e})}})),Object(y.createElement)("p",null,Object(y.createElement)("button",{className:"pretty-link-submit-new-link components-button is-button is-primary",onClick:function(){console.log("Creating new Pretty Link...")}},Object(O.__)("Create New Pretty Link","pretty-link")),d&&Object(y.createElement)(j.Spinner,null)))))}},v?Object(y.createElement)(F,{value:a,onChangeInputValue:this.onChangeInputValue,onKeyDown:this.onKeyDown,submitLink:this.submitLink,autocompleteRef:this.autocompleteRef}):Object(y.createElement)(U,{url:o,editLink:this.editLink}))}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n=t.activeAttributes,o=n.url,r=n.target,i=(n.isSponsored,"_blank"===r);if(!I(t,e)){if(o!==e.inputValue)return{inputValue:o};if(i!==e.opensInNewWindow)return{opensInNewWindow:i}}return null}}]),e}(y.Component);e.default=Object(j.withSpokenMessages)(D)},function(t,e){!function(){t.exports=this.wp.apiFetch}()},function(t,e){!function(){t.exports=this.wp.htmlEntities}()},function(t,e){!function(){t.exports=this.regeneratorRuntime}()},function(t,e){!function(){t.exports=this.wp.dom}()},function(t,e){function n(){return t.exports=n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},n.apply(this,arguments)}t.exports=n},function(t,e){!function(){t.exports=this.wp.data}()},function(t,e,n){"use strict";t.exports=n(34)},function(t,e){function n(t,e,n,o,r,i,s){try{var a=t[i](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(o,r)}t.exports=function(t){return function(){var e=this,o=arguments;return new Promise(function(r,i){var s=t.apply(e,o);function a(t){n(s,r,i,a,l,"next",t)}function l(t){n(s,r,i,a,l,"throw",t)}a(void 0)})}}},function(t,e,n){"use strict";n.r(e),n.d(e,"prettyLink",function(){return x});var o=n(16),r=n.n(o),i=n(12),s=n.n(i),a=n(11),l=n.n(a),c=n(10),u=n.n(c),f=n(9),p=n.n(f),d=n(4),h=n.n(d),b=n(8),v=n.n(b),g=n(0),m=n(1),y=n(5),w=n(2),k=n(3),O=n(7),j=n(18),S="pretty-link/pretty-link",L=Object(m.__)("Pretty Link"),x={name:S,title:L,tagName:"a",className:"pretty-link",attributes:{url:"href",target:"target"},edit:Object(y.withSpokenMessages)(function(t){function e(){var t;return s()(this,e),(t=u()(this,p()(e).apply(this,arguments))).addLink=t.addLink.bind(h()(t)),t.stopAddingLink=t.stopAddingLink.bind(h()(t)),t.onRemoveFormat=t.onRemoveFormat.bind(h()(t)),t.state={addingLink:!1},t}return v()(e,t),l()(e,[{key:"addLink",value:function(){var t=this.props,e=t.value,n=t.onChange,o=Object(w.getTextContent)(Object(w.slice)(e));o&&Object(k.isURL)(o)?n(Object(w.applyFormat)(e,{type:S,attributes:{url:o}})):this.setState({addingLink:!0})}},{key:"stopAddingLink",value:function(){this.setState({addingLink:!1})}},{key:"onRemoveFormat",value:function(){var t=this.props,e=t.value,n=t.onChange,o=t.speak;n(Object(w.removeFormat)(e,S)),o(Object(m.__)("Link removed."),"assertive")}},{key:"render",value:function(){var t=this.props,e=t.isActive,n=t.activeAttributes,o=t.value,r=t.onChange;return Object(g.createElement)(g.Fragment,null,Object(g.createElement)(O.RichTextShortcut,{type:"primary",character:"p",onUse:this.addLink}),Object(g.createElement)(O.RichTextShortcut,{type:"primaryShift",character:"p",onUse:this.onRemoveFormat}),e&&Object(g.createElement)(O.RichTextToolbarButton,{icon:"star-filled",title:Object(m.__)("Unlink"),onClick:this.onRemoveFormat,isActive:e,shortcutType:"primaryShift",shortcutCharacter:"p"}),!e&&Object(g.createElement)(O.RichTextToolbarButton,{icon:"star-filled",title:L,onClick:this.addLink,isActive:e,shortcutType:"primary",shortcutCharacter:"p"}),Object(g.createElement)(j.default,{addingLink:this.state.addingLink,stopAddingLink:this.stopAddingLink,isActive:e,activeAttributes:n,value:o,onChange:r}))}}]),e}(g.Component))};[x].forEach(function(t){var e=t.name,n=r()(t,["name"]);return Object(w.registerFormatType)(e,n)})},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,o=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var r,i=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?t:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}},function(t,e,n){var o={},r=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),i=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var o=function(t,e){return e?e.querySelector(t):document.querySelector(t)}.call(this,t,n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}}(),s=null,a=0,l=[],c=n(28);function u(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=o[r.id];if(i){i.refs++;for(var s=0;s<i.parts.length;s++)i.parts[s](r.parts[s]);for(;s<r.parts.length;s++)i.parts.push(v(r.parts[s],e))}else{var a=[];for(s=0;s<r.parts.length;s++)a.push(v(r.parts[s],e));o[r.id]={id:r.id,refs:1,parts:a}}}}function f(t,e){for(var n=[],o={},r=0;r<t.length;r++){var i=t[r],s=e.base?i[0]+e.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};o[s]?o[s].parts.push(a):n.push(o[s]={id:s,parts:[a]})}return n}function p(t,e){var n=i(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=l[l.length-1];if("top"===t.insertAt)o?o.nextSibling?n.insertBefore(e,o.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),l.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=i(t.insertAt.before,n);n.insertBefore(e,r)}}function d(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=l.indexOf(t);e>=0&&l.splice(e,1)}function h(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var o=function(){0;return n.nc}();o&&(t.attrs.nonce=o)}return b(e,t.attrs),p(t,e),e}function b(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function v(t,e){var n,o,r,i;if(e.transform&&t.css){if(!(i="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=i}if(e.singleton){var l=a++;n=s||(s=h(e)),o=m.bind(null,n,l,!1),r=m.bind(null,n,l,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",b(e,t.attrs),p(t,e),e}(e),o=function(t,e,n){var o=n.css,r=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||i)&&(o=c(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var s=new Blob([o],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}.bind(null,n,e),r=function(){d(n),n.href&&URL.revokeObjectURL(n.href)}):(n=h(e),o=function(t,e){var n=e.css,o=e.media;o&&t.setAttribute("media",o);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){d(n)});return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=r()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=f(t,e);return u(n,e),function(t){for(var r=[],i=0;i<n.length;i++){var s=n[i];(a=o[s.id]).refs--,r.push(a)}t&&u(f(t,e),e);for(i=0;i<r.length;i++){var a;if(0===(a=r[i]).refs){for(var l=0;l<a.parts.length;l++)a.parts[l]();delete o[a.id]}}}};var g=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}();function m(t,e,n,o){var r=n?"":o.css;if(t.styleSheet)t.styleSheet.cssText=g(e,r);else{var i=document.createTextNode(r),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(i,s[e]):t.appendChild(i)}}},function(t,e){t.exports=".pretty-link-inserter .block-editor-url-popover__settings {\n display: block; }\n\n.pretty-link-inserter .pretty-link-inserter-form-container {\n margin-top: 30px; }\n"},function(t,e,n){var o=n(30);"string"==typeof o&&(o=[[t.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(29)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=function(t,e){if(null==t)return{};var n,o,r={},i=Object.keys(t);for(o=0;o<i.length;o++)n=i[o],e.indexOf(n)>=0||(r[n]=t[n]);return r}},function(t,e,n){"use strict";var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};function i(t,e){var n=t["page"+(e?"Y":"X")+"Offset"],o="scroll"+(e?"Top":"Left");if("number"!=typeof n){var r=t.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function s(t){return i(t)}function a(t){return i(t,!0)}function l(t){var e=function(t){var e,n=void 0,o=void 0,r=t.ownerDocument,i=r.body,s=r&&r.documentElement;return n=(e=t.getBoundingClientRect()).left,o=e.top,{left:n-=s.clientLeft||i.clientLeft||0,top:o-=s.clientTop||i.clientTop||0}}(t),n=t.ownerDocument,o=n.defaultView||n.parentWindow;return e.left+=s(o),e.top+=a(o),e}var c=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),u=/^(top|right|bottom|left)$/,f="currentStyle",p="runtimeStyle",d="left",h="px";var b=void 0;function v(t,e){for(var n=0;n<t.length;n++)e(t[n])}function g(t){return"border-box"===b(t,"boxSizing")}"undefined"!=typeof window&&(b=window.getComputedStyle?function(t,e,n){var o="",r=t.ownerDocument,i=n||r.defaultView.getComputedStyle(t,null);return i&&(o=i.getPropertyValue(e)||i[e]),o}:function(t,e){var n=t[f]&&t[f][e];if(c.test(n)&&!u.test(e)){var o=t.style,r=o[d],i=t[p][d];t[p][d]=t[f][d],o[d]="fontSize"===e?"1em":n||0,n=o.pixelLeft+h,o[d]=r,t[p][d]=i}return""===n?"auto":n});var m=["margin","border","padding"],y=-1,w=2,k=1;function O(t,e,n){var o=0,r=void 0,i=void 0,s=void 0;for(i=0;i<e.length;i++)if(r=e[i])for(s=0;s<n.length;s++){var a=void 0;a="border"===r?r+n[s]+"Width":r+n[s],o+=parseFloat(b(t,a))||0}return o}function j(t){return null!=t&&t==t.window}var S={};function L(t,e,n){if(j(t))return"width"===e?S.viewportWidth(t):S.viewportHeight(t);if(9===t.nodeType)return"width"===e?S.docWidth(t):S.docHeight(t);var o="width"===e?["Left","Right"]:["Top","Bottom"],r="width"===e?t.offsetWidth:t.offsetHeight,i=(b(t),g(t)),s=0;(null==r||r<=0)&&(r=void 0,(null==(s=b(t,e))||Number(s)<0)&&(s=t.style[e]||0),s=parseFloat(s)||0),void 0===n&&(n=i?k:y);var a=void 0!==r||i,l=r||s;if(n===y)return a?l-O(t,["border","padding"],o):s;if(a){var c=n===w?-O(t,["border"],o):O(t,["margin"],o);return l+(n===k?0:c)}return s+O(t,m.slice(n),o)}v(["Width","Height"],function(t){S["doc"+t]=function(e){var n=e.document;return Math.max(n.documentElement["scroll"+t],n.body["scroll"+t],S["viewport"+t](n))},S["viewport"+t]=function(e){var n="client"+t,o=e.document,r=o.body,i=o.documentElement[n];return"CSS1Compat"===o.compatMode&&i||r&&r[n]||i}});var x={position:"absolute",visibility:"hidden",display:"block"};function E(t){var e=void 0,n=arguments;return 0!==t.offsetWidth?e=L.apply(void 0,n):function(t,e,n){var o={},r=t.style,i=void 0;for(i in e)e.hasOwnProperty(i)&&(o[i]=r[i],r[i]=e[i]);for(i in n.call(t),e)e.hasOwnProperty(i)&&(r[i]=o[i])}(t,x,function(){e=L.apply(void 0,n)}),e}function _(t,e,n){var o=n;if("object"!==(void 0===e?"undefined":r(e)))return void 0!==o?("number"==typeof o&&(o+="px"),void(t.style[e]=o)):b(t,e);for(var i in e)e.hasOwnProperty(i)&&_(t,i,e[i])}v(["width","height"],function(t){var e=t.charAt(0).toUpperCase()+t.slice(1);S["outer"+e]=function(e,n){return e&&E(e,t,n?0:k)};var n="width"===t?["Left","Right"]:["Top","Bottom"];S[t]=function(e,o){if(void 0===o)return e&&E(e,t,y);if(e){b(e);return g(e)&&(o+=O(e,["padding","border"],n)),_(e,t,o)}}}),t.exports=o({getWindow:function(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow},offset:function(t,e){if(void 0===e)return l(t);!function(t,e){"static"===_(t,"position")&&(t.style.position="relative");var n=l(t),o={},r=void 0,i=void 0;for(i in e)e.hasOwnProperty(i)&&(r=parseFloat(_(t,i))||0,o[i]=r+e[i]-n[i]);_(t,o)}(t,e)},isWindow:j,each:v,css:_,clone:function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);if(t.overflow)for(var n in t)t.hasOwnProperty(n)&&(e.overflow[n]=t.overflow[n]);return e},scrollLeft:function(t,e){if(j(t)){if(void 0===e)return s(t);window.scrollTo(e,a(t))}else{if(void 0===e)return t.scrollLeft;t.scrollLeft=e}},scrollTop:function(t,e){if(j(t)){if(void 0===e)return a(t);window.scrollTo(s(t),e)}else{if(void 0===e)return t.scrollTop;t.scrollTop=e}},viewportWidth:0,viewportHeight:0},S)},function(t,e,n){"use strict";var o=n(33);t.exports=function(t,e,n){n=n||{},9===e.nodeType&&(e=o.getWindow(e));var r=n.allowHorizontalScroll,i=n.onlyScrollIfNeeded,s=n.alignWithTop,a=n.alignWithLeft,l=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,f=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(e),d=o.offset(t),h=o.outerHeight(t),b=o.outerWidth(t),v=void 0,g=void 0,m=void 0,y=void 0,w=void 0,k=void 0,O=void 0,j=void 0,S=void 0,L=void 0;p?(O=e,L=o.height(O),S=o.width(O),j={left:o.scrollLeft(O),top:o.scrollTop(O)},w={left:d.left-j.left-c,top:d.top-j.top-l},k={left:d.left+b-(j.left+S)+f,top:d.top+h-(j.top+L)+u},y=j):(v=o.offset(e),g=e.clientHeight,m=e.clientWidth,y={left:e.scrollLeft,top:e.scrollTop},w={left:d.left-(v.left+(parseFloat(o.css(e,"borderLeftWidth"))||0))-c,top:d.top-(v.top+(parseFloat(o.css(e,"borderTopWidth"))||0))-l},k={left:d.left+b-(v.left+m+(parseFloat(o.css(e,"borderRightWidth"))||0))+f,top:d.top+h-(v.top+g+(parseFloat(o.css(e,"borderBottomWidth"))||0))+u}),w.top<0||k.top>0?!0===s?o.scrollTop(e,y.top+w.top):!1===s?o.scrollTop(e,y.top+k.top):w.top<0?o.scrollTop(e,y.top+w.top):o.scrollTop(e,y.top+k.top):i||((s=void 0===s||!!s)?o.scrollTop(e,y.top+w.top):o.scrollTop(e,y.top+k.top)),r&&(w.left<0||k.left>0?!0===a?o.scrollLeft(e,y.left+w.left):!1===a?o.scrollLeft(e,y.left+k.left):w.left<0?o.scrollLeft(e,y.left+w.left):o.scrollLeft(e,y.left+k.left):i||((a=void 0===a||!!a)?o.scrollLeft(e,y.left+w.left):o.scrollLeft(e,y.left+k.left)))}},function(t,e){function n(e,o){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,o)}t.exports=n},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=o=function(t){return n(t)}:t.exports=o=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},o(e)}t.exports=o},function(t,e,n){"use strict";n.r(e);var o=n(14);n.d(e,"URLInput",function(){return o.default})},function(t,e,n){n(37),n(18),n(14),t.exports=n(27)}]);
js/editor.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./js/editor/components/index.js","webpack:///./js/editor/components/link-editor/index.js","webpack:///./js/editor/components/link-editor/style.scss?a870","webpack:///./js/editor/components/link-editor/utils.js","webpack:///./js/editor/components/url-input/index.js","webpack:///./js/editor/formats/pretty-link/index.js","webpack:///./node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack:///./node_modules/@babel/runtime/helpers/asyncToGenerator.js","webpack:///./node_modules/@babel/runtime/helpers/classCallCheck.js","webpack:///./node_modules/@babel/runtime/helpers/createClass.js","webpack:///./node_modules/@babel/runtime/helpers/extends.js","webpack:///./node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack:///./node_modules/@babel/runtime/helpers/inherits.js","webpack:///./node_modules/@babel/runtime/helpers/objectWithoutProperties.js","webpack:///./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","webpack:///./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack:///./node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack:///./node_modules/@babel/runtime/helpers/typeof.js","webpack:///./node_modules/classnames/index.js","webpack:///./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js","webpack:///./node_modules/dom-scroll-into-view/lib/index.js","webpack:///./node_modules/dom-scroll-into-view/lib/util.js","webpack:///./js/editor/components/link-editor/style.scss","webpack:///./node_modules/style-loader/lib/addStyles.js","webpack:///./node_modules/style-loader/lib/urls.js","webpack:///external {\"this\":\"regeneratorRuntime\"}","webpack:///external {\"this\":[\"wp\",\"apiFetch\"]}","webpack:///external {\"this\":[\"wp\",\"blockEditor\"]}","webpack:///external {\"this\":[\"wp\",\"components\"]}","webpack:///external {\"this\":[\"wp\",\"compose\"]}","webpack:///external {\"this\":[\"wp\",\"data\"]}","webpack:///external {\"this\":[\"wp\",\"dom\"]}","webpack:///external {\"this\":[\"wp\",\"element\"]}","webpack:///external {\"this\":[\"wp\",\"htmlEntities\"]}","webpack:///external {\"this\":[\"wp\",\"i18n\"]}","webpack:///external {\"this\":[\"wp\",\"keycodes\"]}","webpack:///external {\"this\":[\"wp\",\"richText\"]}","webpack:///external {\"this\":[\"wp\",\"url\"]}","webpack:///external {\"this\":\"lodash\"}"],"names":["stopKeyPropagation","event","stopPropagation","isShowingInput","props","state","addingLink","editLink","LinkEditor","value","onChangeInputValue","onKeyDown","submitLink","autocompleteRef","__","LinkViewerUrl","url","prependedURL","prependHTTP","linkClassName","classnames","isValidHref","filterURLForDisplay","safeDecodeURI","URLPopoverAtLink","isActive","anchorRect","useMemo","selection","window","getSelection","range","rangeCount","getRangeAt","getRectangleFromRange","element","startContainer","nextElementSibling","nodeType","Node","ELEMENT_NODE","parentNode","closest","getBoundingClientRect","start","end","LinkViewer","createNewPrettyLink","target","slug","Promise","resolve","reject","jQuery","post","ajaxurl","action","redirect","nofollow","tracking","data","textStatus","xhr","fail","error","InlineLinkUI","arguments","bind","setNoFollow","setLinkTarget","onClickOutside","resetState","createRef","noFollow","opensInNewWindow","inputValue","newLinkUrl","newLinkSlug","creatingLink","createdLink","createdLinkError","LEFT","DOWN","RIGHT","UP","BACKSPACE","ENTER","indexOf","keyCode","setState","activeAttributes","onChange","selectedText","getTextContent","slice","applyFormat","createLinkFormat","text","preventDefault","speak","format","isCollapsed","toInsert","create","length","insert","autocompleteElement","current","contains","stopAddingLink","showInput","then","plEditor","homeUrl","catch","console","log","Component","withSpokenMessages","href","trimmedHref","trim","test","protocol","getProtocol","isValidProtocol","startsWith","authority","getAuthority","isValidAuthority","path","getPath","isValidPath","queryString","getQueryString","isValidQueryString","fragment","getFragment","isValidFragment","type","attributes","rel","label","sprintf","stopEventPropagation","fetchLinkSuggestions","search","apiFetch","addQueryArgs","term","links","map","link","pretty_url","title","decodeEntities","URLInput","inputRef","updateSuggestions","throttle","suggestionNodes","suggestions","showSuggestions","selectedSuggestion","scrollingIntoView","scrollIntoView","onlyScrollIfNeeded","setTimeout","suggestionsRequest","index","ref","loading","request","debouncedSpeak","_n","selectionStart","setSelectionRange","suggestion","previousIndex","nextIndex","TAB","selectLink","focus","autoFocus","instanceId","className","suggestionsListboxId","suggestionOptionIdPrefix","undefined","id","bindSuggestionNode","handleOnClick","compose","withSafeTimeout","withInstanceId","withSelect","select","getSettings","__experimentalFetchLinkSuggestions","name","prettyLink","tagName","edit","addLink","onRemoveFormat","isURL","removeFormat","registerFormats","forEach","settings","registerFormatType"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;ACnEA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;AAGA;AAEA;;;;AAGA;AACA;AACA;AAUA;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;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yB;;;;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gBAAgB;;AAEhB;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE,UAAU,IAA4E;AACxF;AACA,EAAE,iCAAqB,EAAE,mCAAE;AAC3B;AACA,GAAG;AAAA,oGAAC;AACJ,EAAE,MAAM,EAEN;AACF,CAAC;;;;;;;;;;;;;ACnDY;;AAEb,WAAW,mBAAO,CAAC,+DAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA,gC;;;;;;;;;;;;AChIa;;AAEb,iBAAiB,mBAAO,CAAC,+FAAwB,E;;;;;;;;;;;;ACFpC;;AAEb,mDAAmD,gBAAgB,sBAAsB,OAAO,2BAA2B,0BAA0B,yDAAyD,2BAA2B,EAAE,EAAE,EAAE,eAAe;;AAE9P,oGAAoG,mBAAmB,EAAE,mBAAmB,kGAAkG;;AAE9O;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,SAAS,OAAO;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,CAAC,Y;;;;;;;;;;;ACtbD,6EAA6E,mBAAmB,EAAE,gEAAgE,qBAAqB,EAAE,G;;;;;;;;;;;ACAzL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA,cAAc,mBAAO,CAAC,uDAAQ;;AAE9B;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,iBAAiB,mBAAmB;AACpC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA,mBAAmB,2BAA2B;;AAE9C;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,mBAAmB;AACnC;AACA;;AAEA;AACA;;AAEA,iBAAiB,2BAA2B;AAC5C;AACA;;AAEA,QAAQ,uBAAuB;AAC/B;AACA;AACA,GAAG;AACH;;AAEA,iBAAiB,uBAAuB;AACxC;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA;AACA,cAAc;;AAEd,kDAAkD,sBAAsB;AACxE;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA,KAAK,KAAwC,EAAE,EAE7C;;AAEF,QAAQ,sBAAiB;AACzB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD;AACvD;;AAEA,6BAA6B,mBAAmB;;AAEhD;;AAEA;;AAEA;AACA;;;;;;;;;;;;;AC9YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,WAAW,EAAE;AACrD,wCAAwC,WAAW,EAAE;;AAErD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,sCAAsC;AACtC,GAAG;AACH;AACA,8DAA8D;AAC9D;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxFA,aAAa,6CAA6C,EAAE,I;;;;;;;;;;;ACA5D,aAAa,yCAAyC,EAAE,I;;;;;;;;;;;ACAxD,aAAa,4CAA4C,EAAE,I;;;;;;;;;;;ACA3D,aAAa,2CAA2C,EAAE,I;;;;;;;;;;;ACA1D,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,oCAAoC,EAAE,I;;;;;;;;;;;ACAnD,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,6CAA6C,EAAE,I;;;;;;;;;;;ACA5D,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,yCAAyC,EAAE,I;;;;;;;;;;;ACAxD,aAAa,yCAAyC,EAAE,I;;;;;;;;;;;ACAxD,aAAa,oCAAoC,EAAE,I;;;;;;;;;;;ACAnD,aAAa,iCAAiC,EAAE,I","file":"editor.js","sourcesContent":[" \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// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","export { default as URLInput } from './url-input';","/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component, Fragment, createRef, useMemo } from '@wordpress/element';\nimport {\n ExternalLink,\n IconButton,\n ToggleControl,\n Button,\n TextControl,\n Notice,\n Spinner,\n withSpokenMessages,\n} from '@wordpress/components';\nimport { LEFT, RIGHT, UP, DOWN, BACKSPACE, ENTER } from '@wordpress/keycodes';\nimport { getRectangleFromRange } from '@wordpress/dom';\nimport { prependHTTP, safeDecodeURI, filterURLForDisplay } from '@wordpress/url';\nimport {\n create,\n insert,\n isCollapsed,\n applyFormat,\n getTextContent,\n slice,\n} from '@wordpress/rich-text';\nimport { URLPopover } from '@wordpress/block-editor';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport URLInput from '../url-input';\nimport './style.scss';\n\n/**\n * Internal dependencies\n */\nimport { createLinkFormat, isValidHref } from './utils';\n\nconst stopKeyPropagation = ( event ) => event.stopPropagation();\n\nfunction isShowingInput( props, state ) {\n return props.addingLink || state.editLink;\n}\n\nconst LinkEditor = ( { value, onChangeInputValue, onKeyDown, submitLink, autocompleteRef } ) => (\n // Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n <form\n className=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content\"\n onKeyPress={ stopKeyPropagation }\n onKeyDown={ onKeyDown }\n onSubmit={ submitLink }\n >\n <URLInput\n value={ value }\n onChange={ onChangeInputValue }\n autocompleteRef={ autocompleteRef }\n />\n <IconButton icon=\"editor-break\" label={ __( 'Insert Pretty Link' ) } type=\"submit\" />\n </form>\n /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n);\n\nconst LinkViewerUrl = ( { url } ) => {\n const prependedURL = prependHTTP( url );\n const linkClassName = classnames( 'editor-format-toolbar__link-container-value block-editor-format-toolbar__link-container-value', {\n 'has-invalid-link': ! isValidHref( prependedURL ),\n } );\n\n if ( ! url ) {\n return <span className={ linkClassName }></span>;\n }\n\n return (\n <ExternalLink\n className={ linkClassName }\n href={ url }\n >\n { filterURLForDisplay( safeDecodeURI( url ) ) }\n </ExternalLink>\n );\n};\n\nconst URLPopoverAtLink = ( { isActive, addingLink, value, ...props } ) => {\n const anchorRect = useMemo( () => {\n const selection = window.getSelection();\n const range = selection.rangeCount > 0 ? selection.getRangeAt( 0 ) : null;\n if ( ! range ) {\n return;\n }\n\n if ( addingLink ) {\n return getRectangleFromRange( range );\n }\n\n let element = range.startContainer;\n\n // If the caret is right before the element, select the next element.\n element = element.nextElementSibling || element;\n\n while ( element.nodeType !== window.Node.ELEMENT_NODE ) {\n element = element.parentNode;\n }\n\n const closest = element.closest( 'a' );\n if ( closest ) {\n return closest.getBoundingClientRect();\n }\n }, [ isActive, addingLink, value.start, value.end ] );\n\n if ( ! anchorRect ) {\n return null;\n }\n\n return <URLPopover anchorRect={ anchorRect } { ...props } />;\n};\n\nconst LinkViewer = ( { url, editLink } ) => {\n return (\n // Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n /* eslint-disable jsx-a11y/no-static-element-interactions */\n <div\n className=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content\"\n onKeyPress={ stopKeyPropagation }\n >\n <LinkViewerUrl url={ url } />\n <IconButton icon=\"edit\" label={ __( 'Edit' ) } onClick={ editLink } />\n </div>\n /* eslint-enable jsx-a11y/no-static-element-interactions */\n );\n};\n\nconst createNewPrettyLink = (target, slug) => {\n return new Promise((resolve, reject) => {\n jQuery.post(\n ajaxurl,\n {\n action: 'prli_create_pretty_link',\n target: target,\n slug: slug,\n redirect: '',\n nofollow: 1,\n tracking: 1\n },\n (data, textStatus, xhr) => {\n 'true' === data ? resolve(data) : reject(data);\n }\n ).fail(error => {\n reject(error);\n });\n });\n}\n\nclass InlineLinkUI extends Component {\n constructor() {\n super( ...arguments );\n\n this.editLink = this.editLink.bind( this );\n this.submitLink = this.submitLink.bind( this );\n this.onKeyDown = this.onKeyDown.bind( this );\n this.onChangeInputValue = this.onChangeInputValue.bind( this );\n this.setNoFollow = this.setNoFollow.bind( this );\n this.setLinkTarget = this.setLinkTarget.bind( this );\n this.onClickOutside = this.onClickOutside.bind( this );\n this.resetState = this.resetState.bind( this );\n this.autocompleteRef = createRef();\n\n this.state = {\n noFollow: false,\n opensInNewWindow: false,\n inputValue: '',\n newLinkUrl: '',\n newLinkSlug: '',\n creatingLink: false,\n createdLink: false,\n createdLinkError: false\n };\n }\n\n static getDerivedStateFromProps( props, state ) {\n const { activeAttributes: { url, target } } = props;\n const opensInNewWindow = target === '_blank';\n\n if ( ! isShowingInput( props, state ) ) {\n if ( url !== state.inputValue ) {\n return { inputValue: url };\n }\n\n if ( opensInNewWindow !== state.opensInNewWindow ) {\n return { opensInNewWindow };\n }\n }\n\n return null;\n }\n\n onKeyDown( event ) {\n if ( [ LEFT, DOWN, RIGHT, UP, BACKSPACE, ENTER ].indexOf( event.keyCode ) > -1 ) {\n // Stop the key event from propagating up to ObserveTyping.startTypingInTextField.\n event.stopPropagation();\n }\n }\n\n onChangeInputValue( inputValue ) {\n this.setState( { inputValue } );\n }\n\n setLinkTarget( opensInNewWindow ) {\n const { activeAttributes: { url = '' }, value, onChange } = this.props;\n\n this.setState( { opensInNewWindow } );\n\n // Apply now if URL is not being edited.\n if ( ! isShowingInput( this.props, this.state ) ) {\n const selectedText = getTextContent( slice( value ) );\n\n onChange( applyFormat( value, createLinkFormat( {\n url,\n opensInNewWindow,\n text: selectedText,\n } ) ) );\n }\n }\n\n setNoFollow( noFollow ) {\n const { activeAttributes: { url = '' }, value, onChange } = this.props;\n\n this.setState( { noFollow } );\n\n // Apply now if URL is not being edited.\n if ( ! isShowingInput( this.props, this.state ) ) {\n const selectedText = getTextContent( slice( value ) );\n\n onChange( applyFormat( value, createLinkFormat( {\n url,\n opensInNewWindow,\n text: selectedText,\n noFollow\n } ) ) );\n }\n }\n\n editLink( event ) {\n this.setState( { editLink: true } );\n event.preventDefault();\n }\n\n submitLink( event ) {\n const { isActive, value, onChange, speak } = this.props;\n const { inputValue, opensInNewWindow, noFollow } = this.state;\n const url = prependHTTP( inputValue );\n const selectedText = getTextContent( slice( value ) );\n const format = createLinkFormat( {\n url,\n opensInNewWindow,\n text: selectedText,\n noFollow\n } );\n\n event.preventDefault();\n\n if ( isCollapsed( value ) && ! isActive ) {\n const toInsert = applyFormat( create( { text: url } ), format, 0, url.length );\n onChange( insert( value, toInsert ) );\n } else {\n onChange( applyFormat( value, format ) );\n }\n\n this.resetState();\n\n if ( ! isValidHref( url ) ) {\n speak( __( 'Warning: the link has been inserted but may have errors. Please test it.' ), 'assertive' );\n } else if ( isActive ) {\n speak( __( 'Link edited.' ), 'assertive' );\n } else {\n speak( __( 'Link inserted.' ), 'assertive' );\n }\n }\n\n onClickOutside( event ) {\n // The autocomplete suggestions list renders in a separate popover (in a portal),\n // so onClickOutside fails to detect that a click on a suggestion occurred in the\n // LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and\n // return to avoid the popover being closed.\n const autocompleteElement = this.autocompleteRef.current;\n if ( autocompleteElement && autocompleteElement.contains( event.target ) ) {\n return;\n }\n\n this.resetState();\n }\n\n resetState() {\n this.props.stopAddingLink();\n this.setState( { editLink: false } );\n }\n\n render() {\n const { isActive, activeAttributes: { url }, addingLink, value } = this.props;\n\n if ( ! isActive && ! addingLink ) {\n return null;\n }\n\n const { inputValue, noFollow, opensInNewWindow, newLinkUrl, newLinkSlug, creatingLink, createdLink, createdLinkError } = this.state;\n const showInput = isShowingInput( this.props, this.state );\n\n return (\n <URLPopoverAtLink\n className=\"pretty-link-inserter\"\n value={ value }\n isActive={ isActive }\n addingLink={ addingLink }\n onClickOutside={ this.onClickOutside }\n onClose={ this.resetState }\n focusOnMount={ showInput ? 'firstElement' : false }\n renderSettings={ () => (\n <Fragment>\n <div>\n <ToggleControl\n label={ __( 'Open in New Tab' ) }\n checked={ opensInNewWindow }\n onChange={ this.setLinkTarget }\n />\n <ToggleControl\n label={ __( 'Nofollow' ) }\n checked={ noFollow }\n onChange={ this.setNoFollow }\n />\n </div>\n <div className=\"pretty-link-inserter-form-container\">\n {\n createdLink && (\n <Notice status=\"success\" onRemove={() => this.setState({createdLink: false})}>\n <p>{__( 'Pretty Link created successfully.', 'memberpress' )}</p>\n </Notice>\n )\n }\n {\n createdLinkError && (\n <Notice status=\"error\" onRemove={() => this.setState({createdLink: false, createdLinkError: false})}>\n <p>{__( 'Pretty Link could not be created. Please try a slug that is not already used.', 'memberpress' )}</p>\n </Notice>\n )\n }\n <strong>{__('New Pretty Link', 'pretty-link')}</strong>\n <form onSubmit={(event) => {\n event.preventDefault();\n // Send request to create new Pretty Link\n this.setState({\n creatingLink: true,\n createdLinkError: false,\n });\n createNewPrettyLink( newLinkUrl, newLinkSlug )\n .then(data => {\n this.setState({\n createdLink: true,\n creatingLink: false,\n inputValue: plEditor.homeUrl + newLinkSlug,\n newLinkUrl: '',\n newLinkSlug: ''\n });\n })\n .catch(error => {\n this.setState({\n createdLink: false,\n creatingLink: false,\n createdLinkError: true,\n });\n });\n }}>\n <p>\n <TextControl\n placeholder=\"URL\"\n className=\"pretty-link-new-link-url\"\n value={newLinkUrl}\n onChange={ ( newLinkUrl ) => {\n this.setState( { newLinkUrl } );\n } }\n />\n </p>\n <p>\n <TextControl\n placeholder=\"Slug\"\n className=\"pretty-link-new-link-slug\"\n value={newLinkSlug}\n onChange={ ( newLinkSlug ) => {\n this.setState( { newLinkSlug } );\n } }\n />\n </p>\n <p>\n <button\n className=\"pretty-link-submit-new-link components-button is-button is-primary\"\n onClick={ () => {\n console.log('Creating new Pretty Link...');\n } }\n >\n { __( 'Create New Pretty Link', 'pretty-link' ) }\n </button>\n {\n creatingLink && (\n <Spinner />\n )\n }\n </p>\n </form>\n </div>\n </Fragment>\n ) }\n >\n { showInput ? (\n <LinkEditor\n value={ inputValue }\n onChangeInputValue={ this.onChangeInputValue }\n onKeyDown={ this.onKeyDown }\n submitLink={ this.submitLink }\n autocompleteRef={ this.autocompleteRef }\n />\n ) : (\n <LinkViewer\n url={ url }\n editLink={ this.editLink }\n />\n ) }\n </URLPopoverAtLink>\n );\n }\n}\n\nexport default withSpokenMessages( InlineLinkUI );\n","\nvar content = require(\"!!../../../../node_modules/postcss-loader/src/index.js??ref--6-1!../../../../node_modules/sass-loader/lib/loader.js!./style.scss\");\n\nif(typeof content === 'string') content = [[module.id, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = require(\"!../../../../node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(module.hot) {\n\tmodule.hot.accept(\"!!../../../../node_modules/postcss-loader/src/index.js??ref--6-1!../../../../node_modules/sass-loader/lib/loader.js!./style.scss\", function() {\n\t\tvar newContent = require(\"!!../../../../node_modules/postcss-loader/src/index.js??ref--6-1!../../../../node_modules/sass-loader/lib/loader.js!./style.scss\");\n\n\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\n\t\tvar locals = (function(a, b) {\n\t\t\tvar key, idx = 0;\n\n\t\t\tfor(key in a) {\n\t\t\t\tif(!b || a[key] !== b[key]) return false;\n\t\t\t\tidx++;\n\t\t\t}\n\n\t\t\tfor(key in b) idx--;\n\n\t\t\treturn idx === 0;\n\t\t}(content.locals, newContent.locals));\n\n\t\tif(!locals) throw new Error('Aborting CSS HMR due to changed css-modules locals.');\n\n\t\tupdate(newContent);\n\t});\n\n\tmodule.hot.dispose(function() { update(); });\n}","/**\n * External dependencies\n */\nimport { startsWith } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n getProtocol,\n isValidProtocol,\n getAuthority,\n isValidAuthority,\n getPath,\n isValidPath,\n getQueryString,\n isValidQueryString,\n getFragment,\n isValidFragment,\n} from '@wordpress/url';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Check for issues with the provided href.\n *\n * @param {string} href The href.\n *\n * @return {boolean} Is the href invalid?\n */\nexport function isValidHref( href ) {\n if ( ! href ) {\n return false;\n }\n\n const trimmedHref = href.trim();\n\n if ( ! trimmedHref ) {\n return false;\n }\n\n // Does the href start with something that looks like a URL protocol?\n if ( /^\\S+:/.test( trimmedHref ) ) {\n const protocol = getProtocol( trimmedHref );\n if ( ! isValidProtocol( protocol ) ) {\n return false;\n }\n\n // Add some extra checks for http(s) URIs, since these are the most common use-case.\n // This ensures URIs with an http protocol have exactly two forward slashes following the protocol.\n if ( startsWith( protocol, 'http' ) && ! /^https?:\\/\\/[^\\/\\s]/i.test( trimmedHref ) ) {\n return false;\n }\n\n const authority = getAuthority( trimmedHref );\n if ( ! isValidAuthority( authority ) ) {\n return false;\n }\n\n const path = getPath( trimmedHref );\n if ( path && ! isValidPath( path ) ) {\n return false;\n }\n\n const queryString = getQueryString( trimmedHref );\n if ( queryString && ! isValidQueryString( queryString ) ) {\n return false;\n }\n\n const fragment = getFragment( trimmedHref );\n if ( fragment && ! isValidFragment( fragment ) ) {\n return false;\n }\n }\n\n // Validate anchor links.\n if ( startsWith( trimmedHref, '#' ) && ! isValidFragment( trimmedHref ) ) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Generates the format object that will be applied to the link text.\n *\n * @param {string} url The href of the link.\n * @param {boolean} opensInNewWindow Whether this link will open in a new window.\n * @param {Object} text The text that is being hyperlinked.\n *\n * @return {Object} The final format object.\n */\nexport function createLinkFormat( { url, opensInNewWindow, text, noFollow } ) {\n const format = {\n type: 'core/link',\n attributes: {\n url,\n },\n };\n\n format.attributes.rel = '';\n\n if ( noFollow ) {\n format.attributes.rel += 'nofollow ';\n }\n\n if ( opensInNewWindow ) {\n // translators: accessibility label for external links, where the argument is the link text\n const label = sprintf( __( '%s (opens in a new tab)' ), text );\n\n format.attributes.target = '_blank';\n format.attributes.rel += 'noreferrer noopener';\n\n format.attributes[ 'aria-label' ] = label;\n }\n\n if ( '' === format.attributes.rel ) {\n delete format.attributes.rel;\n }\n\n return format;\n}\n","/**\n * External dependencies\n */\nimport { throttle, map, pick, defaultTo } from 'lodash';\nimport classnames from 'classnames';\nimport scrollIntoView from 'dom-scroll-into-view';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { UP, DOWN, ENTER, TAB } from '@wordpress/keycodes';\nimport { Spinner, withSpokenMessages, Popover } from '@wordpress/components';\nimport { withInstanceId, withSafeTimeout, compose } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\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\nconst fetchLinkSuggestions = async ( search ) => {\n\n const links = await apiFetch( {\n url: addQueryArgs( ajaxurl, {\n action: 'prli_search_for_links',\n term: search,\n } ),\n } );\n\n return map( links, ( link ) => ( {\n url: link.pretty_url,\n title: decodeEntities( link.value ) + ' (' + decodeEntities( link.slug ) + ')' || __( '(no title)' ),\n } ) );\n};\n\nclass URLInput extends Component {\n constructor( { autocompleteRef } ) {\n super( ...arguments );\n\n this.onChange = this.onChange.bind( this );\n this.onKeyDown = this.onKeyDown.bind( this );\n this.autocompleteRef = autocompleteRef || createRef();\n this.inputRef = createRef();\n this.updateSuggestions = throttle( this.updateSuggestions.bind( this ), 200 );\n\n this.suggestionNodes = [];\n\n this.state = {\n suggestions: [],\n showSuggestions: false,\n selectedSuggestion: null,\n };\n }\n\n componentDidUpdate() {\n const { showSuggestions, selectedSuggestion } = this.state;\n // only have to worry about scrolling selected suggestion into view\n // when already expanded\n if ( showSuggestions && selectedSuggestion !== null && ! this.scrollingIntoView ) {\n this.scrollingIntoView = true;\n scrollIntoView( this.suggestionNodes[ selectedSuggestion ], this.autocompleteRef.current, {\n onlyScrollIfNeeded: true,\n } );\n\n this.props.setTimeout( () => {\n this.scrollingIntoView = false;\n }, 100 );\n }\n }\n\n componentWillUnmount() {\n delete this.suggestionsRequest;\n }\n\n bindSuggestionNode( index ) {\n return ( ref ) => {\n this.suggestionNodes[ index ] = ref;\n };\n }\n\n updateSuggestions( value ) {\n\n // Show the suggestions after typing at least 2 characters\n // and also for URLs\n if ( value.length < 2 || /^https?:/.test( value ) ) {\n this.setState( {\n showSuggestions: false,\n selectedSuggestion: null,\n loading: false,\n } );\n\n return;\n }\n\n this.setState( {\n showSuggestions: true,\n selectedSuggestion: null,\n loading: true,\n } );\n\n const request = fetchLinkSuggestions( value );\n\n request.then( ( suggestions ) => {\n // A fetch Promise doesn't have an abort option. It's mimicked by\n // comparing the request reference in on the instance, which is\n // reset or deleted on subsequent requests or unmounting.\n if ( this.suggestionsRequest !== request ) {\n return;\n }\n\n this.setState( {\n suggestions,\n loading: false,\n } );\n\n if ( !! suggestions.length ) {\n this.props.debouncedSpeak( sprintf( _n(\n '%d result found, use up and down arrow keys to navigate.',\n '%d results found, use up and down arrow keys to navigate.',\n suggestions.length\n ), suggestions.length ), 'assertive' );\n } else {\n this.props.debouncedSpeak( __( 'No results.' ), 'assertive' );\n }\n } ).catch( () => {\n if ( this.suggestionsRequest === request ) {\n this.setState( {\n loading: false,\n } );\n }\n } );\n\n this.suggestionsRequest = request;\n }\n\n onChange( event ) {\n const inputValue = event.target.value;\n this.props.onChange( inputValue );\n this.updateSuggestions( inputValue );\n }\n\n onKeyDown( event ) {\n const { showSuggestions, selectedSuggestion, suggestions, loading } = this.state;\n // If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n // We shouldn't preventDefault to allow block arrow keys navigation\n if ( ! showSuggestions || ! suggestions.length || loading ) {\n // In the Windows version of Firefox the up and down arrows don't move the caret\n // within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n // a form of focus trapping that is disruptive to the user experience. This disruption\n // only happens if the caret is not in the first or last position in the text input.\n // See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n switch ( event.keyCode ) {\n // When UP is pressed, if the caret is at the start of the text, move it to the 0\n // position.\n case UP: {\n if ( 0 !== event.target.selectionStart ) {\n event.stopPropagation();\n event.preventDefault();\n\n // Set the input caret to position 0\n event.target.setSelectionRange( 0, 0 );\n }\n break;\n }\n // When DOWN is pressed, if the caret is not at the end of the text, move it to the\n // last position.\n case DOWN: {\n if ( this.props.value.length !== event.target.selectionStart ) {\n event.stopPropagation();\n event.preventDefault();\n\n // Set the input caret to the last position\n event.target.setSelectionRange( this.props.value.length, this.props.value.length );\n }\n break;\n }\n }\n\n return;\n }\n\n const suggestion = this.state.suggestions[ this.state.selectedSuggestion ];\n\n switch ( event.keyCode ) {\n case UP: {\n event.stopPropagation();\n event.preventDefault();\n const previousIndex = ! selectedSuggestion ? suggestions.length - 1 : selectedSuggestion - 1;\n this.setState( {\n selectedSuggestion: previousIndex,\n } );\n break;\n }\n case DOWN: {\n event.stopPropagation();\n event.preventDefault();\n const nextIndex = selectedSuggestion === null || ( selectedSuggestion === suggestions.length - 1 ) ? 0 : selectedSuggestion + 1;\n this.setState( {\n selectedSuggestion: nextIndex,\n } );\n break;\n }\n case TAB: {\n if ( this.state.selectedSuggestion !== null ) {\n this.selectLink( suggestion );\n // Announce a link has been selected when tabbing away from the input field.\n this.props.speak( __( 'Link selected.' ) );\n }\n break;\n }\n case ENTER: {\n if ( this.state.selectedSuggestion !== null ) {\n event.stopPropagation();\n this.selectLink( suggestion );\n }\n break;\n }\n }\n }\n\n selectLink( suggestion ) {\n this.props.onChange( suggestion.url, suggestion );\n this.setState( {\n selectedSuggestion: null,\n showSuggestions: false,\n } );\n }\n\n handleOnClick( suggestion ) {\n this.selectLink( suggestion );\n // Move focus to the input field when a link suggestion is clicked.\n this.inputRef.current.focus();\n }\n\n render() {\n const { value = '', autoFocus = true, instanceId, className } = this.props;\n const { showSuggestions, suggestions, selectedSuggestion, loading } = this.state;\n\n const suggestionsListboxId = `block-editor-url-input-suggestions-${ instanceId }`;\n const suggestionOptionIdPrefix = `block-editor-url-input-suggestion-${ instanceId }`;\n\n /* eslint-disable jsx-a11y/no-autofocus */\n return (\n <div className={ classnames( 'editor-url-input block-editor-url-input', className ) }>\n <input\n autoFocus={ autoFocus }\n type=\"text\"\n aria-label={ __( 'URL' ) }\n required\n value={ value }\n onChange={ this.onChange }\n onInput={ stopEventPropagation }\n placeholder={ __( 'Paste or type to search for your Pretty Link' ) }\n onKeyDown={ this.onKeyDown }\n role=\"combobox\"\n aria-expanded={ showSuggestions }\n aria-autocomplete=\"list\"\n aria-owns={ suggestionsListboxId }\n aria-activedescendant={ selectedSuggestion !== null ? `${ suggestionOptionIdPrefix }-${ selectedSuggestion }` : undefined }\n ref={ this.inputRef }\n />\n\n { ( loading ) && <Spinner /> }\n\n { showSuggestions && !! suggestions.length &&\n <Popover position=\"bottom\" noArrow focusOnMount={ false }>\n <div\n className=\"editor-url-input__suggestions block-editor-url-input__suggestions\"\n id={ suggestionsListboxId }\n ref={ this.autocompleteRef }\n role=\"listbox\"\n >\n { suggestions.map( ( suggestion, index ) => (\n <button\n key={ suggestion.id }\n role=\"option\"\n tabIndex=\"-1\"\n id={ `${ suggestionOptionIdPrefix }-${ index }` }\n ref={ this.bindSuggestionNode( index ) }\n className={ classnames( 'editor-url-input__suggestion block-editor-url-input__suggestion', {\n 'is-selected': index === selectedSuggestion,\n } ) }\n onClick={ () => this.handleOnClick( suggestion ) }\n aria-selected={ index === selectedSuggestion }\n >\n { suggestion.title }\n </button>\n ) ) }\n </div>\n </Popover>\n }\n </div>\n );\n /* eslint-enable jsx-a11y/no-autofocus */\n }\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/url-input/README.md\n */\nexport default compose(\n withSafeTimeout,\n withSpokenMessages,\n withInstanceId,\n withSelect( ( select ) => {\n const { getSettings } = select( 'core/block-editor' );\n return {\n fetchLinkSuggestions: getSettings().__experimentalFetchLinkSuggestions,\n };\n } )\n)( URLInput );\n","/**\n * WordPress dependencies\n */\nimport { __ } from \"@wordpress/i18n\";\nimport { withSpokenMessages } from \"@wordpress/components\";\nimport { Component, Fragment } from \"@wordpress/element\";\nimport {\n getTextContent,\n applyFormat,\n removeFormat,\n slice,\n registerFormatType\n} from \"@wordpress/rich-text\";\nimport { isURL, isEmail } from \"@wordpress/url\";\nimport {\n RichTextToolbarButton,\n RichTextShortcut\n} from \"@wordpress/block-editor\";\nimport InlineLinkUI from \"../../components/link-editor\";\n\n/**\n * Block constants\n */\nconst name = \"pretty-link/pretty-link\";\nconst title = __(\"Pretty Link\");\n\nexport const prettyLink = {\n name,\n title,\n tagName: \"a\",\n className: \"pretty-link\",\n attributes: {\n url: \"href\",\n target: \"target\"\n },\n edit: withSpokenMessages(\n class LinkEdit extends Component {\n constructor() {\n super(...arguments);\n\n this.addLink = this.addLink.bind(this);\n this.stopAddingLink = this.stopAddingLink.bind(this);\n this.onRemoveFormat = this.onRemoveFormat.bind(this);\n this.state = {\n addingLink: false\n };\n }\n\n addLink() {\n const { value, onChange } = this.props;\n const text = getTextContent(slice(value));\n\n if (text && isURL(text)) {\n onChange(\n applyFormat(value, { type: name, attributes: { url: text } })\n );\n } else {\n this.setState({ addingLink: true });\n }\n }\n\n stopAddingLink() {\n this.setState({ addingLink: false });\n }\n\n onRemoveFormat() {\n const { value, onChange, speak } = this.props;\n\n onChange(removeFormat(value, name));\n speak(__(\"Link removed.\"), \"assertive\");\n }\n\n render() {\n const { isActive, activeAttributes, value, onChange } = this.props;\n\n return (\n <>\n <RichTextShortcut\n type=\"primary\"\n character=\"p\"\n onUse={this.addLink}\n />\n <RichTextShortcut\n type=\"primaryShift\"\n character=\"p\"\n onUse={this.onRemoveFormat}\n />\n {isActive && (\n <RichTextToolbarButton\n icon=\"star-filled\"\n title={__(\"Unlink\")}\n onClick={this.onRemoveFormat}\n isActive={isActive}\n shortcutType=\"primaryShift\"\n shortcutCharacter=\"p\"\n />\n )}\n {!isActive && (\n <RichTextToolbarButton\n icon=\"star-filled\"\n title={title}\n onClick={this.addLink}\n isActive={isActive}\n shortcutType=\"primary\"\n shortcutCharacter=\"p\"\n />\n )}\n <InlineLinkUI\n addingLink={this.state.addingLink}\n stopAddingLink={this.stopAddingLink}\n isActive={isActive}\n activeAttributes={activeAttributes}\n value={value}\n onChange={onChange}\n />\n </>\n );\n }\n }\n )\n};\n\nfunction registerFormats() {\n [prettyLink].forEach(({ name, ...settings }) =>\n registerFormatType(name, settings)\n );\n}\nregisterFormats();\n","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","function _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutProperties;","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","/*!\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","'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;","'use strict';\n\nmodule.exports = require('./dom-scroll-into-view');","'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);","module.exports = \".pretty-link-inserter .block-editor-url-popover__settings {\\n display: block; }\\n\\n.pretty-link-inserter .pretty-link-inserter-form-container {\\n margin-top: 30px; }\\n\"","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getTarget = function (target, parent) {\n if (parent){\n return parent.querySelector(target);\n }\n return document.querySelector(target);\n};\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(target, parent) {\n // If passing function in options, then use it for resolve \"head\" element.\n // Useful for Shadow Root style i.e\n // {\n // insertInto: function () { return document.querySelector(\"#foo\").shadowRoot }\n // }\n if (typeof target === 'function') {\n return target();\n }\n if (typeof memo[target] === \"undefined\") {\n\t\t\tvar styleTarget = getTarget.call(this, target, parent);\n\t\t\t// Special case to return head of iframe instead of iframe itself\n\t\t\tif (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n\t\t\t\ttry {\n\t\t\t\t\t// This will throw an exception if access to iframe is blocked\n\t\t\t\t\t// due to cross-origin restrictions\n\t\t\t\t\tstyleTarget = styleTarget.contentDocument.head;\n\t\t\t\t} catch(e) {\n\t\t\t\t\tstyleTarget = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmemo[target] = styleTarget;\n\t\t}\n\t\treturn memo[target]\n\t};\n})();\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n\t// tags it will allow on a page\n\tif (!options.singleton && typeof options.singleton !== \"boolean\") options.singleton = isOldIE();\n\n\t// By default, add <style> tags to the <head> element\n if (!options.insertInto) options.insertInto = \"head\";\n\n\t// By default, add <style> tags to the bottom of the target\n\tif (!options.insertAt) options.insertAt = \"bottom\";\n\n\tvar styles = listToStyles(list, options);\n\n\taddStylesToDom(styles, options);\n\n\treturn function update (newList) {\n\t\tvar mayRemove = [];\n\n\t\tfor (var i = 0; i < styles.length; i++) {\n\t\t\tvar item = styles[i];\n\t\t\tvar domStyle = stylesInDom[item.id];\n\n\t\t\tdomStyle.refs--;\n\t\t\tmayRemove.push(domStyle);\n\t\t}\n\n\t\tif(newList) {\n\t\t\tvar newStyles = listToStyles(newList, options);\n\t\t\taddStylesToDom(newStyles, options);\n\t\t}\n\n\t\tfor (var i = 0; i < mayRemove.length; i++) {\n\t\t\tvar domStyle = mayRemove[i];\n\n\t\t\tif(domStyle.refs === 0) {\n\t\t\t\tfor (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();\n\n\t\t\t\tdelete stylesInDom[domStyle.id];\n\t\t\t}\n\t\t}\n\t};\n};\n\nfunction addStylesToDom (styles, options) {\n\tfor (var i = 0; i < styles.length; i++) {\n\t\tvar item = styles[i];\n\t\tvar domStyle = stylesInDom[item.id];\n\n\t\tif(domStyle) {\n\t\t\tdomStyle.refs++;\n\n\t\t\tfor(var j = 0; j < domStyle.parts.length; j++) {\n\t\t\t\tdomStyle.parts[j](item.parts[j]);\n\t\t\t}\n\n\t\t\tfor(; j < item.parts.length; j++) {\n\t\t\t\tdomStyle.parts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\t\t} else {\n\t\t\tvar parts = [];\n\n\t\t\tfor(var j = 0; j < item.parts.length; j++) {\n\t\t\t\tparts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\n\t\t\tstylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};\n\t\t}\n\t}\n}\n\nfunction listToStyles (list, options) {\n\tvar styles = [];\n\tvar newStyles = {};\n\n\tfor (var i = 0; i < list.length; i++) {\n\t\tvar item = list[i];\n\t\tvar id = options.base ? item[0] + options.base : item[0];\n\t\tvar css = item[1];\n\t\tvar media = item[2];\n\t\tvar sourceMap = item[3];\n\t\tvar part = {css: css, media: media, sourceMap: sourceMap};\n\n\t\tif(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});\n\t\telse newStyles[id].parts.push(part);\n\t}\n\n\treturn styles;\n}\n\nfunction insertStyleElement (options, style) {\n\tvar target = getElement(options.insertInto)\n\n\tif (!target) {\n\t\tthrow new Error(\"Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.\");\n\t}\n\n\tvar lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];\n\n\tif (options.insertAt === \"top\") {\n\t\tif (!lastStyleElementInsertedAtTop) {\n\t\t\ttarget.insertBefore(style, target.firstChild);\n\t\t} else if (lastStyleElementInsertedAtTop.nextSibling) {\n\t\t\ttarget.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);\n\t\t} else {\n\t\t\ttarget.appendChild(style);\n\t\t}\n\t\tstylesInsertedAtTop.push(style);\n\t} else if (options.insertAt === \"bottom\") {\n\t\ttarget.appendChild(style);\n\t} else if (typeof options.insertAt === \"object\" && options.insertAt.before) {\n\t\tvar nextSibling = getElement(options.insertAt.before, target);\n\t\ttarget.insertBefore(style, nextSibling);\n\t} else {\n\t\tthrow new Error(\"[Style Loader]\\n\\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\\n Must be 'top', 'bottom', or Object.\\n (https://github.com/webpack-contrib/style-loader#insertat)\\n\");\n\t}\n}\n\nfunction removeStyleElement (style) {\n\tif (style.parentNode === null) return false;\n\tstyle.parentNode.removeChild(style);\n\n\tvar idx = stylesInsertedAtTop.indexOf(style);\n\tif(idx >= 0) {\n\t\tstylesInsertedAtTop.splice(idx, 1);\n\t}\n}\n\nfunction createStyleElement (options) {\n\tvar style = document.createElement(\"style\");\n\n\tif(options.attrs.type === undefined) {\n\t\toptions.attrs.type = \"text/css\";\n\t}\n\n\tif(options.attrs.nonce === undefined) {\n\t\tvar nonce = getNonce();\n\t\tif (nonce) {\n\t\t\toptions.attrs.nonce = nonce;\n\t\t}\n\t}\n\n\taddAttrs(style, options.attrs);\n\tinsertStyleElement(options, style);\n\n\treturn style;\n}\n\nfunction createLinkElement (options) {\n\tvar link = document.createElement(\"link\");\n\n\tif(options.attrs.type === undefined) {\n\t\toptions.attrs.type = \"text/css\";\n\t}\n\toptions.attrs.rel = \"stylesheet\";\n\n\taddAttrs(link, options.attrs);\n\tinsertStyleElement(options, link);\n\n\treturn link;\n}\n\nfunction addAttrs (el, attrs) {\n\tObject.keys(attrs).forEach(function (key) {\n\t\tel.setAttribute(key, attrs[key]);\n\t});\n}\n\nfunction getNonce() {\n\tif (typeof __webpack_nonce__ === 'undefined') {\n\t\treturn null;\n\t}\n\n\treturn __webpack_nonce__;\n}\n\nfunction addStyle (obj, options) {\n\tvar style, update, remove, result;\n\n\t// If a transform function was defined, run it on the css\n\tif (options.transform && obj.css) {\n\t result = typeof options.transform === 'function'\n\t\t ? options.transform(obj.css) \n\t\t : options.transform.default(obj.css);\n\n\t if (result) {\n\t \t// If transform returns a value, use that instead of the original css.\n\t \t// This allows running runtime transformations on the css.\n\t \tobj.css = result;\n\t } else {\n\t \t// If the transform function returns a falsy value, don't add this css.\n\t \t// This allows conditional loading of css\n\t \treturn function() {\n\t \t\t// noop\n\t \t};\n\t }\n\t}\n\n\tif (options.singleton) {\n\t\tvar styleIndex = singletonCounter++;\n\n\t\tstyle = singleton || (singleton = createStyleElement(options));\n\n\t\tupdate = applyToSingletonTag.bind(null, style, styleIndex, false);\n\t\tremove = applyToSingletonTag.bind(null, style, styleIndex, true);\n\n\t} else if (\n\t\tobj.sourceMap &&\n\t\ttypeof URL === \"function\" &&\n\t\ttypeof URL.createObjectURL === \"function\" &&\n\t\ttypeof URL.revokeObjectURL === \"function\" &&\n\t\ttypeof Blob === \"function\" &&\n\t\ttypeof btoa === \"function\"\n\t) {\n\t\tstyle = createLinkElement(options);\n\t\tupdate = updateLink.bind(null, style, options);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\n\t\t\tif(style.href) URL.revokeObjectURL(style.href);\n\t\t};\n\t} else {\n\t\tstyle = createStyleElement(options);\n\t\tupdate = applyToTag.bind(null, style);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\t\t};\n\t}\n\n\tupdate(obj);\n\n\treturn function updateStyle (newObj) {\n\t\tif (newObj) {\n\t\t\tif (\n\t\t\t\tnewObj.css === obj.css &&\n\t\t\t\tnewObj.media === obj.media &&\n\t\t\t\tnewObj.sourceMap === obj.sourceMap\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdate(obj = newObj);\n\t\t} else {\n\t\t\tremove();\n\t\t}\n\t};\n}\n\nvar replaceText = (function () {\n\tvar textStore = [];\n\n\treturn function (index, replacement) {\n\t\ttextStore[index] = replacement;\n\n\t\treturn textStore.filter(Boolean).join('\\n');\n\t};\n})();\n\nfunction applyToSingletonTag (style, index, remove, obj) {\n\tvar css = remove ? \"\" : obj.css;\n\n\tif (style.styleSheet) {\n\t\tstyle.styleSheet.cssText = replaceText(index, css);\n\t} else {\n\t\tvar cssNode = document.createTextNode(css);\n\t\tvar childNodes = style.childNodes;\n\n\t\tif (childNodes[index]) style.removeChild(childNodes[index]);\n\n\t\tif (childNodes.length) {\n\t\t\tstyle.insertBefore(cssNode, childNodes[index]);\n\t\t} else {\n\t\t\tstyle.appendChild(cssNode);\n\t\t}\n\t}\n}\n\nfunction applyToTag (style, obj) {\n\tvar css = obj.css;\n\tvar media = obj.media;\n\n\tif(media) {\n\t\tstyle.setAttribute(\"media\", media)\n\t}\n\n\tif(style.styleSheet) {\n\t\tstyle.styleSheet.cssText = css;\n\t} else {\n\t\twhile(style.firstChild) {\n\t\t\tstyle.removeChild(style.firstChild);\n\t\t}\n\n\t\tstyle.appendChild(document.createTextNode(css));\n\t}\n}\n\nfunction updateLink (link, options, obj) {\n\tvar css = obj.css;\n\tvar sourceMap = obj.sourceMap;\n\n\t/*\n\t\tIf convertToAbsoluteUrls isn't defined, but sourcemaps are enabled\n\t\tand there is no publicPath defined then lets turn convertToAbsoluteUrls\n\t\ton by default. Otherwise default to the convertToAbsoluteUrls option\n\t\tdirectly\n\t*/\n\tvar autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;\n\n\tif (options.convertToAbsoluteUrls || autoFixUrls) {\n\t\tcss = fixUrls(css);\n\t}\n\n\tif (sourceMap) {\n\t\t// http://stackoverflow.com/a/26603875\n\t\tcss += \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\";\n\t}\n\n\tvar blob = new Blob([css], { type: \"text/css\" });\n\n\tvar oldSrc = link.href;\n\n\tlink.href = URL.createObjectURL(blob);\n\n\tif(oldSrc) URL.revokeObjectURL(oldSrc);\n}\n","\n/**\n * When source maps are enabled, `style-loader` uses a link element with a data-uri to\n * embed the css on the page. This breaks all relative urls because now they are relative to a\n * bundle instead of the current page.\n *\n * One solution is to only use full urls, but that may be impossible.\n *\n * Instead, this function \"fixes\" the relative urls to be absolute according to the current page location.\n *\n * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.\n *\n */\n\nmodule.exports = function (css) {\n // get current location\n var location = typeof window !== \"undefined\" && window.location;\n\n if (!location) {\n throw new Error(\"fixUrls requires window.location\");\n }\n\n\t// blank or null?\n\tif (!css || typeof css !== \"string\") {\n\t return css;\n }\n\n var baseUrl = location.protocol + \"//\" + location.host;\n var currentDir = baseUrl + location.pathname.replace(/\\/[^\\/]*$/, \"/\");\n\n\t// convert each url(...)\n\t/*\n\tThis regular expression is just a way to recursively match brackets within\n\ta string.\n\n\t /url\\s*\\( = Match on the word \"url\" with any whitespace after it and then a parens\n\t ( = Start a capturing group\n\t (?: = Start a non-capturing group\n\t [^)(] = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t (?: = Start another non-capturing groups\n\t [^)(]+ = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t [^)(]* = Match anything that isn't a parentheses\n\t \\) = Match a end parentheses\n\t ) = End Group\n *\\) = Match anything and then a close parens\n ) = Close non-capturing group\n * = Match anything\n ) = Close capturing group\n\t \\) = Match a close parens\n\n\t /gi = Get all matches, not the first. Be case insensitive.\n\t */\n\tvar fixedCss = css.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi, function(fullMatch, origUrl) {\n\t\t// strip quotes (if they exist)\n\t\tvar unquotedOrigUrl = origUrl\n\t\t\t.trim()\n\t\t\t.replace(/^\"(.*)\"$/, function(o, $1){ return $1; })\n\t\t\t.replace(/^'(.*)'$/, function(o, $1){ return $1; });\n\n\t\t// already a full url? no change\n\t\tif (/^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/|\\s*$)/i.test(unquotedOrigUrl)) {\n\t\t return fullMatch;\n\t\t}\n\n\t\t// convert the url to a full url\n\t\tvar newUrl;\n\n\t\tif (unquotedOrigUrl.indexOf(\"//\") === 0) {\n\t\t \t//TODO: should we add protocol?\n\t\t\tnewUrl = unquotedOrigUrl;\n\t\t} else if (unquotedOrigUrl.indexOf(\"/\") === 0) {\n\t\t\t// path should be relative to the base url\n\t\t\tnewUrl = baseUrl + unquotedOrigUrl; // already starts with '/'\n\t\t} else {\n\t\t\t// path should be relative to current directory\n\t\t\tnewUrl = currentDir + unquotedOrigUrl.replace(/^\\.\\//, \"\"); // Strip leading './'\n\t\t}\n\n\t\t// send back the fixed url(...)\n\t\treturn \"url(\" + JSON.stringify(newUrl) + \")\";\n\t});\n\n\t// send back the fixed css\n\treturn fixedCss;\n};\n","(function() { module.exports = this[\"regeneratorRuntime\"]; }());","(function() { module.exports = this[\"wp\"][\"apiFetch\"]; }());","(function() { module.exports = this[\"wp\"][\"blockEditor\"]; }());","(function() { module.exports = this[\"wp\"][\"components\"]; }());","(function() { module.exports = this[\"wp\"][\"compose\"]; }());","(function() { module.exports = this[\"wp\"][\"data\"]; }());","(function() { module.exports = this[\"wp\"][\"dom\"]; }());","(function() { module.exports = this[\"wp\"][\"element\"]; }());","(function() { module.exports = this[\"wp\"][\"htmlEntities\"]; }());","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"keycodes\"]; }());","(function() { module.exports = this[\"wp\"][\"richText\"]; }());","(function() { module.exports = this[\"wp\"][\"url\"]; }());","(function() { module.exports = this[\"lodash\"]; }());"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./js/editor/components/index.js","webpack:///./js/editor/components/link-editor/index.js","webpack:///./js/editor/components/link-editor/style.scss?a870","webpack:///./js/editor/components/link-editor/utils.js","webpack:///./js/editor/components/url-input/index.js","webpack:///./js/editor/formats/pretty-link/index.js","webpack:///./node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack:///./node_modules/@babel/runtime/helpers/asyncToGenerator.js","webpack:///./node_modules/@babel/runtime/helpers/classCallCheck.js","webpack:///./node_modules/@babel/runtime/helpers/createClass.js","webpack:///./node_modules/@babel/runtime/helpers/extends.js","webpack:///./node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack:///./node_modules/@babel/runtime/helpers/inherits.js","webpack:///./node_modules/@babel/runtime/helpers/objectWithoutProperties.js","webpack:///./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","webpack:///./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack:///./node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack:///./node_modules/@babel/runtime/helpers/typeof.js","webpack:///./node_modules/classnames/index.js","webpack:///./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js","webpack:///./node_modules/dom-scroll-into-view/lib/index.js","webpack:///./node_modules/dom-scroll-into-view/lib/util.js","webpack:///./js/editor/components/link-editor/style.scss","webpack:///./node_modules/style-loader/lib/addStyles.js","webpack:///./node_modules/style-loader/lib/urls.js","webpack:///external {\"this\":\"regeneratorRuntime\"}","webpack:///external {\"this\":[\"wp\",\"apiFetch\"]}","webpack:///external {\"this\":[\"wp\",\"blockEditor\"]}","webpack:///external {\"this\":[\"wp\",\"components\"]}","webpack:///external {\"this\":[\"wp\",\"compose\"]}","webpack:///external {\"this\":[\"wp\",\"data\"]}","webpack:///external {\"this\":[\"wp\",\"dom\"]}","webpack:///external {\"this\":[\"wp\",\"element\"]}","webpack:///external {\"this\":[\"wp\",\"htmlEntities\"]}","webpack:///external {\"this\":[\"wp\",\"i18n\"]}","webpack:///external {\"this\":[\"wp\",\"keycodes\"]}","webpack:///external {\"this\":[\"wp\",\"richText\"]}","webpack:///external {\"this\":[\"wp\",\"url\"]}","webpack:///external {\"this\":\"lodash\"}"],"names":["stopKeyPropagation","event","stopPropagation","isShowingInput","props","state","addingLink","editLink","LinkEditor","value","onChangeInputValue","onKeyDown","submitLink","autocompleteRef","__","LinkViewerUrl","url","prependedURL","prependHTTP","linkClassName","classnames","isValidHref","filterURLForDisplay","safeDecodeURI","URLPopoverAtLink","isActive","anchorRect","useMemo","selection","window","getSelection","range","rangeCount","getRangeAt","getRectangleFromRange","element","startContainer","nextElementSibling","nodeType","Node","ELEMENT_NODE","parentNode","closest","getBoundingClientRect","start","end","LinkViewer","createNewPrettyLink","target","slug","Promise","resolve","reject","jQuery","post","ajaxurl","action","redirect","nofollow","tracking","sponsored","data","textStatus","xhr","fail","error","InlineLinkUI","arguments","bind","setNoFollow","setIsSponsored","setLinkTarget","onClickOutside","resetState","createRef","noFollow","opensInNewWindow","isSponsored","inputValue","newLinkUrl","newLinkSlug","creatingLink","createdLink","createdLinkError","LEFT","DOWN","RIGHT","UP","BACKSPACE","ENTER","indexOf","keyCode","setState","activeAttributes","onChange","selectedText","getTextContent","slice","applyFormat","createLinkFormat","text","console","log","preventDefault","speak","format","isCollapsed","toInsert","create","length","insert","autocompleteElement","current","contains","stopAddingLink","showInput","then","plEditor","homeUrl","catch","Component","withSpokenMessages","href","trimmedHref","trim","test","protocol","getProtocol","isValidProtocol","startsWith","authority","getAuthority","isValidAuthority","path","getPath","isValidPath","queryString","getQueryString","isValidQueryString","fragment","getFragment","isValidFragment","type","attributes","rel","label","sprintf","stopEventPropagation","fetchLinkSuggestions","search","apiFetch","addQueryArgs","term","links","map","link","pretty_url","title","decodeEntities","URLInput","inputRef","updateSuggestions","throttle","suggestionNodes","suggestions","showSuggestions","selectedSuggestion","scrollingIntoView","scrollIntoView","onlyScrollIfNeeded","setTimeout","suggestionsRequest","index","ref","loading","request","debouncedSpeak","_n","selectionStart","setSelectionRange","suggestion","previousIndex","nextIndex","TAB","selectLink","focus","autoFocus","instanceId","className","suggestionsListboxId","suggestionOptionIdPrefix","undefined","id","bindSuggestionNode","handleOnClick","compose","withSafeTimeout","withInstanceId","withSelect","select","getSettings","__experimentalFetchLinkSuggestions","name","prettyLink","tagName","edit","addLink","onRemoveFormat","isURL","removeFormat","registerFormats","forEach","settings","registerFormatType"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;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;AACA;AACA;;AAEA;AACA;;AAEA,4C;;;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iC;;;;;;;;;;;ACTA,wBAAwB,2EAA2E,oCAAoC,mBAAmB,GAAG,EAAE,OAAO,oCAAoC,8HAA8H,GAAG,EAAE,sBAAsB;;AAEnW;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yB;;;;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gBAAgB;;AAEhB;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE,UAAU,IAA4E;AACxF;AACA,EAAE,iCAAqB,EAAE,mCAAE;AAC3B;AACA,GAAG;AAAA,oGAAC;AACJ,EAAE,MAAM,EAEN;AACF,CAAC;;;;;;;;;;;;;ACnDY;;AAEb,WAAW,mBAAO,CAAC,+DAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA,gC;;;;;;;;;;;;AChIa;;AAEb,iBAAiB,mBAAO,CAAC,+FAAwB,E;;;;;;;;;;;;ACFpC;;AAEb,mDAAmD,gBAAgB,sBAAsB,OAAO,2BAA2B,0BAA0B,yDAAyD,2BAA2B,EAAE,EAAE,EAAE,eAAe;;AAE9P,oGAAoG,mBAAmB,EAAE,mBAAmB,kGAAkG;;AAE9O;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,SAAS,OAAO;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,CAAC,Y;;;;;;;;;;;ACtbD,6EAA6E,mBAAmB,EAAE,gEAAgE,qBAAqB,EAAE,G;;;;;;;;;;;ACAzL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA,cAAc,mBAAO,CAAC,uDAAQ;;AAE9B;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,iBAAiB,mBAAmB;AACpC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA,mBAAmB,2BAA2B;;AAE9C;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,mBAAmB;AACnC;AACA;;AAEA;AACA;;AAEA,iBAAiB,2BAA2B;AAC5C;AACA;;AAEA,QAAQ,uBAAuB;AAC/B;AACA;AACA,GAAG;AACH;;AAEA,iBAAiB,uBAAuB;AACxC;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA;AACA,cAAc;;AAEd,kDAAkD,sBAAsB;AACxE;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA,KAAK,KAAwC,EAAE,EAE7C;;AAEF,QAAQ,sBAAiB;AACzB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD;AACvD;;AAEA,6BAA6B,mBAAmB;;AAEhD;;AAEA;;AAEA;AACA;;;;;;;;;;;;;AC9YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,WAAW,EAAE;AACrD,wCAAwC,WAAW,EAAE;;AAErD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,sCAAsC;AACtC,GAAG;AACH;AACA,8DAA8D;AAC9D;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxFA,aAAa,6CAA6C,EAAE,I;;;;;;;;;;;ACA5D,aAAa,yCAAyC,EAAE,I;;;;;;;;;;;ACAxD,aAAa,4CAA4C,EAAE,I;;;;;;;;;;;ACA3D,aAAa,2CAA2C,EAAE,I;;;;;;;;;;;ACA1D,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,oCAAoC,EAAE,I;;;;;;;;;;;ACAnD,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,6CAA6C,EAAE,I;;;;;;;;;;;ACA5D,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,yCAAyC,EAAE,I;;;;;;;;;;;ACAxD,aAAa,yCAAyC,EAAE,I;;;;;;;;;;;ACAxD,aAAa,oCAAoC,EAAE,I;;;;;;;;;;;ACAnD,aAAa,iCAAiC,EAAE,I","file":"editor.js","sourcesContent":[" \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// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","export { default as URLInput } from './url-input';","/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component, Fragment, createRef, useMemo } from '@wordpress/element';\nimport {\n ExternalLink,\n IconButton,\n ToggleControl,\n Button,\n TextControl,\n Notice,\n Spinner,\n withSpokenMessages,\n} from '@wordpress/components';\nimport { LEFT, RIGHT, UP, DOWN, BACKSPACE, ENTER } from '@wordpress/keycodes';\nimport { getRectangleFromRange } from '@wordpress/dom';\nimport { prependHTTP, safeDecodeURI, filterURLForDisplay } from '@wordpress/url';\nimport {\n create,\n insert,\n isCollapsed,\n applyFormat,\n getTextContent,\n slice,\n} from '@wordpress/rich-text';\nimport { URLPopover } from '@wordpress/block-editor';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport URLInput from '../url-input';\nimport './style.scss';\n\n/**\n * Internal dependencies\n */\nimport { createLinkFormat, isValidHref } from './utils';\n\nconst stopKeyPropagation = ( event ) => event.stopPropagation();\n\nfunction isShowingInput( props, state ) {\n return props.addingLink || state.editLink;\n}\n\nconst LinkEditor = ( { value, onChangeInputValue, onKeyDown, submitLink, autocompleteRef } ) => (\n // Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n <form\n className=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content\"\n onKeyPress={ stopKeyPropagation }\n onKeyDown={ onKeyDown }\n onSubmit={ submitLink }\n >\n <URLInput\n value={ value }\n onChange={ onChangeInputValue }\n autocompleteRef={ autocompleteRef }\n />\n <IconButton icon=\"editor-break\" label={ __( 'Insert Pretty Link' ) } type=\"submit\" />\n </form>\n /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n);\n\nconst LinkViewerUrl = ( { url } ) => {\n const prependedURL = prependHTTP( url );\n const linkClassName = classnames( 'editor-format-toolbar__link-container-value block-editor-format-toolbar__link-container-value', {\n 'has-invalid-link': ! isValidHref( prependedURL ),\n } );\n\n if ( ! url ) {\n return <span className={ linkClassName }></span>;\n }\n\n return (\n <ExternalLink\n className={ linkClassName }\n href={ url }\n >\n { filterURLForDisplay( safeDecodeURI( url ) ) }\n </ExternalLink>\n );\n};\n\nconst URLPopoverAtLink = ( { isActive, addingLink, value, ...props } ) => {\n const anchorRect = useMemo( () => {\n const selection = window.getSelection();\n const range = selection.rangeCount > 0 ? selection.getRangeAt( 0 ) : null;\n if ( ! range ) {\n return;\n }\n\n if ( addingLink ) {\n return getRectangleFromRange( range );\n }\n\n let element = range.startContainer;\n\n // If the caret is right before the element, select the next element.\n element = element.nextElementSibling || element;\n\n while ( element.nodeType !== window.Node.ELEMENT_NODE ) {\n element = element.parentNode;\n }\n\n const closest = element.closest( 'a' );\n if ( closest ) {\n return closest.getBoundingClientRect();\n }\n }, [ isActive, addingLink, value.start, value.end ] );\n\n if ( ! anchorRect ) {\n return null;\n }\n\n return <URLPopover anchorRect={ anchorRect } { ...props } />;\n};\n\nconst LinkViewer = ( { url, editLink } ) => {\n return (\n // Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n /* eslint-disable jsx-a11y/no-static-element-interactions */\n <div\n className=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content\"\n onKeyPress={ stopKeyPropagation }\n >\n <LinkViewerUrl url={ url } />\n <IconButton icon=\"edit\" label={ __( 'Edit' ) } onClick={ editLink } />\n </div>\n /* eslint-enable jsx-a11y/no-static-element-interactions */\n );\n};\n\nconst createNewPrettyLink = (target, slug) => {\n return new Promise((resolve, reject) => {\n jQuery.post(\n ajaxurl,\n {\n action: 'prli_create_pretty_link',\n target: target,\n slug: slug,\n redirect: '',\n nofollow: 1,\n tracking: 1,\n sponsored: 0\n },\n (data, textStatus, xhr) => {\n 'true' === data ? resolve(data) : reject(data);\n }\n ).fail(error => {\n reject(error);\n });\n });\n}\n\nclass InlineLinkUI extends Component {\n constructor() {\n super( ...arguments );\n\n this.editLink = this.editLink.bind( this );\n this.submitLink = this.submitLink.bind( this );\n this.onKeyDown = this.onKeyDown.bind( this );\n this.onChangeInputValue = this.onChangeInputValue.bind( this );\n this.setNoFollow = this.setNoFollow.bind( this );\n this.setIsSponsored = this.setIsSponsored.bind( this );\n this.setLinkTarget = this.setLinkTarget.bind( this );\n this.onClickOutside = this.onClickOutside.bind( this );\n this.resetState = this.resetState.bind( this );\n this.autocompleteRef = createRef();\n\n this.state = {\n noFollow: false,\n opensInNewWindow: false,\n isSponsored: false,\n inputValue: '',\n newLinkUrl: '',\n newLinkSlug: '',\n creatingLink: false,\n createdLink: false,\n createdLinkError: false\n };\n }\n\n static getDerivedStateFromProps( props, state ) {\n const { activeAttributes: { url, target, isSponsored } } = props;\n const opensInNewWindow = target === '_blank';\n\n if ( ! isShowingInput( props, state ) ) {\n if ( url !== state.inputValue ) {\n return { inputValue: url };\n }\n\n if ( opensInNewWindow !== state.opensInNewWindow ) {\n return { opensInNewWindow };\n }\n }\n\n return null;\n }\n\n onKeyDown( event ) {\n if ( [ LEFT, DOWN, RIGHT, UP, BACKSPACE, ENTER ].indexOf( event.keyCode ) > -1 ) {\n // Stop the key event from propagating up to ObserveTyping.startTypingInTextField.\n event.stopPropagation();\n }\n }\n\n onChangeInputValue( inputValue ) {\n this.setState( { inputValue } );\n }\n\n setLinkTarget( opensInNewWindow ) {\n const { activeAttributes: { url = '' }, value, onChange } = this.props;\n\n this.setState( { opensInNewWindow } );\n\n // Apply now if URL is not being edited.\n if ( ! isShowingInput( this.props, this.state ) ) {\n const selectedText = getTextContent( slice( value ) );\n\n onChange( applyFormat( value, createLinkFormat( {\n url,\n opensInNewWindow,\n text: selectedText,\n } ) ) );\n }\n }\n\n setNoFollow( noFollow ) {\n const { activeAttributes: { url = '' }, value, onChange } = this.props;\n\n this.setState( { noFollow } );\n\n // Apply now if URL is not being edited.\n if ( ! isShowingInput( this.props, this.state ) ) {\n const selectedText = getTextContent( slice( value ) );\n\n onChange( applyFormat( value, createLinkFormat( {\n url,\n opensInNewWindow,\n text: selectedText,\n noFollow,\n isSponsored\n } ) ) );\n }\n }\n\n setIsSponsored( isSponsored ) {\n console.log(this);\n const { activeAttributes: { url = '' }, value, onChange } = this.props;\n\n this.setState( { isSponsored } );\n\n // Apply now if URL is not being edited.\n if ( ! isShowingInput( this.props, this.state ) ) {\n const selectedText = getTextContent( slice( value ) );\n\n onChange( applyFormat( value, createLinkFormat( {\n url,\n opensInNewWindow,\n text: selectedText,\n noFollow,\n isSponsored\n } ) ) );\n }\n }\n\n editLink( event ) {\n this.setState( { editLink: true } );\n event.preventDefault();\n }\n\n submitLink( event ) {\n const { isActive, value, onChange, speak } = this.props;\n const { inputValue, opensInNewWindow, noFollow, isSponsored } = this.state;\n const url = prependHTTP( inputValue );\n const selectedText = getTextContent( slice( value ) );\n const format = createLinkFormat( {\n url,\n opensInNewWindow,\n text: selectedText,\n noFollow,\n isSponsored\n } );\n\n event.preventDefault();\n\n if ( isCollapsed( value ) && ! isActive ) {\n const toInsert = applyFormat( create( { text: url } ), format, 0, url.length );\n onChange( insert( value, toInsert ) );\n } else {\n onChange( applyFormat( value, format ) );\n }\n\n this.resetState();\n\n if ( ! isValidHref( url ) ) {\n speak( __( 'Warning: the link has been inserted but may have errors. Please test it.' ), 'assertive' );\n } else if ( isActive ) {\n speak( __( 'Link edited.' ), 'assertive' );\n } else {\n speak( __( 'Link inserted.' ), 'assertive' );\n }\n }\n\n onClickOutside( event ) {\n // The autocomplete suggestions list renders in a separate popover (in a portal),\n // so onClickOutside fails to detect that a click on a suggestion occurred in the\n // LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and\n // return to avoid the popover being closed.\n const autocompleteElement = this.autocompleteRef.current;\n if ( autocompleteElement && autocompleteElement.contains( event.target ) ) {\n return;\n }\n\n this.resetState();\n }\n\n resetState() {\n this.props.stopAddingLink();\n this.setState( { editLink: false } );\n }\n\n render() {\n const { isActive, activeAttributes: { url }, addingLink, value } = this.props;\n\n if ( ! isActive && ! addingLink ) {\n return null;\n }\n\n const { inputValue, noFollow, opensInNewWindow, isSponsored, newLinkUrl, newLinkSlug, creatingLink, createdLink, createdLinkError } = this.state;\n const showInput = isShowingInput( this.props, this.state );\n\n return (\n <URLPopoverAtLink\n className=\"pretty-link-inserter\"\n value={ value }\n isActive={ isActive }\n addingLink={ addingLink }\n onClickOutside={ this.onClickOutside }\n onClose={ this.resetState }\n focusOnMount={ showInput ? 'firstElement' : false }\n renderSettings={ () => (\n <Fragment>\n <div>\n <ToggleControl\n label={ __( 'Open in New Tab' ) }\n checked={ opensInNewWindow }\n onChange={ this.setLinkTarget }\n />\n <ToggleControl\n label={ __( 'Nofollow' ) }\n checked={ noFollow }\n onChange={ this.setNoFollow }\n />\n <ToggleControl\n label={ __( 'Sponsored Link' ) }\n checked={ isSponsored }\n onChange={ this.setIsSponsored }\n />\n </div>\n <div className=\"pretty-link-inserter-form-container\">\n {\n createdLink && (\n <Notice status=\"success\" onRemove={() => this.setState({createdLink: false})}>\n <p>{__( 'Pretty Link created successfully.', 'memberpress' )}</p>\n </Notice>\n )\n }\n {\n createdLinkError && (\n <Notice status=\"error\" onRemove={() => this.setState({createdLink: false, createdLinkError: false})}>\n <p>{__( 'Pretty Link could not be created. Please try a slug that is not already used.', 'memberpress' )}</p>\n </Notice>\n )\n }\n <strong>{__('New Pretty Link', 'pretty-link')}</strong>\n <form onSubmit={(event) => {\n event.preventDefault();\n // Send request to create new Pretty Link\n this.setState({\n creatingLink: true,\n createdLinkError: false,\n });\n createNewPrettyLink( newLinkUrl, newLinkSlug )\n .then(data => {\n this.setState({\n createdLink: true,\n creatingLink: false,\n inputValue: plEditor.homeUrl + newLinkSlug,\n newLinkUrl: '',\n newLinkSlug: ''\n });\n })\n .catch(error => {\n this.setState({\n createdLink: false,\n creatingLink: false,\n createdLinkError: true,\n });\n });\n }}>\n <p>\n <TextControl\n placeholder=\"URL\"\n className=\"pretty-link-new-link-url\"\n value={newLinkUrl}\n onChange={ ( newLinkUrl ) => {\n this.setState( { newLinkUrl } );\n } }\n />\n </p>\n <p>\n <TextControl\n placeholder=\"Slug\"\n className=\"pretty-link-new-link-slug\"\n value={newLinkSlug}\n onChange={ ( newLinkSlug ) => {\n this.setState( { newLinkSlug } );\n } }\n />\n </p>\n <p>\n <button\n className=\"pretty-link-submit-new-link components-button is-button is-primary\"\n onClick={ () => {\n console.log('Creating new Pretty Link...');\n } }\n >\n { __( 'Create New Pretty Link', 'pretty-link' ) }\n </button>\n {\n creatingLink && (\n <Spinner />\n )\n }\n </p>\n </form>\n </div>\n </Fragment>\n ) }\n >\n { showInput ? (\n <LinkEditor\n value={ inputValue }\n onChangeInputValue={ this.onChangeInputValue }\n onKeyDown={ this.onKeyDown }\n submitLink={ this.submitLink }\n autocompleteRef={ this.autocompleteRef }\n />\n ) : (\n <LinkViewer\n url={ url }\n editLink={ this.editLink }\n />\n ) }\n </URLPopoverAtLink>\n );\n }\n}\n\nexport default withSpokenMessages( InlineLinkUI );\n","\nvar content = require(\"!!../../../../node_modules/postcss-loader/src/index.js??ref--6-1!../../../../node_modules/sass-loader/lib/loader.js!./style.scss\");\n\nif(typeof content === 'string') content = [[module.id, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = require(\"!../../../../node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(module.hot) {\n\tmodule.hot.accept(\"!!../../../../node_modules/postcss-loader/src/index.js??ref--6-1!../../../../node_modules/sass-loader/lib/loader.js!./style.scss\", function() {\n\t\tvar newContent = require(\"!!../../../../node_modules/postcss-loader/src/index.js??ref--6-1!../../../../node_modules/sass-loader/lib/loader.js!./style.scss\");\n\n\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\n\t\tvar locals = (function(a, b) {\n\t\t\tvar key, idx = 0;\n\n\t\t\tfor(key in a) {\n\t\t\t\tif(!b || a[key] !== b[key]) return false;\n\t\t\t\tidx++;\n\t\t\t}\n\n\t\t\tfor(key in b) idx--;\n\n\t\t\treturn idx === 0;\n\t\t}(content.locals, newContent.locals));\n\n\t\tif(!locals) throw new Error('Aborting CSS HMR due to changed css-modules locals.');\n\n\t\tupdate(newContent);\n\t});\n\n\tmodule.hot.dispose(function() { update(); });\n}","/**\n * External dependencies\n */\nimport { startsWith } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n getProtocol,\n isValidProtocol,\n getAuthority,\n isValidAuthority,\n getPath,\n isValidPath,\n getQueryString,\n isValidQueryString,\n getFragment,\n isValidFragment,\n} from '@wordpress/url';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Check for issues with the provided href.\n *\n * @param {string} href The href.\n *\n * @return {boolean} Is the href invalid?\n */\nexport function isValidHref( href ) {\n if ( ! href ) {\n return false;\n }\n\n const trimmedHref = href.trim();\n\n if ( ! trimmedHref ) {\n return false;\n }\n\n // Does the href start with something that looks like a URL protocol?\n if ( /^\\S+:/.test( trimmedHref ) ) {\n const protocol = getProtocol( trimmedHref );\n if ( ! isValidProtocol( protocol ) ) {\n return false;\n }\n\n // Add some extra checks for http(s) URIs, since these are the most common use-case.\n // This ensures URIs with an http protocol have exactly two forward slashes following the protocol.\n if ( startsWith( protocol, 'http' ) && ! /^https?:\\/\\/[^\\/\\s]/i.test( trimmedHref ) ) {\n return false;\n }\n\n const authority = getAuthority( trimmedHref );\n if ( ! isValidAuthority( authority ) ) {\n return false;\n }\n\n const path = getPath( trimmedHref );\n if ( path && ! isValidPath( path ) ) {\n return false;\n }\n\n const queryString = getQueryString( trimmedHref );\n if ( queryString && ! isValidQueryString( queryString ) ) {\n return false;\n }\n\n const fragment = getFragment( trimmedHref );\n if ( fragment && ! isValidFragment( fragment ) ) {\n return false;\n }\n }\n\n // Validate anchor links.\n if ( startsWith( trimmedHref, '#' ) && ! isValidFragment( trimmedHref ) ) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Generates the format object that will be applied to the link text.\n *\n * @param {string} url The href of the link.\n * @param {boolean} opensInNewWindow Whether this link will open in a new window.\n * @param {Object} text The text that is being hyperlinked.\n *\n * @return {Object} The final format object.\n */\nexport function createLinkFormat( { url, opensInNewWindow, text, noFollow, isSponsored } ) {\n const format = {\n type: 'core/link',\n attributes: {\n url,\n },\n };\n\n format.attributes.rel = '';\n\n if ( noFollow ) {\n format.attributes.rel += 'nofollow noindex ';\n }\n\n if ( isSponsored ) {\n format.attributes.rel += 'sponsored ';\n }\n\n if ( opensInNewWindow ) {\n // translators: accessibility label for external links, where the argument is the link text\n const label = sprintf( __( '%s (opens in a new tab)' ), text );\n\n format.attributes.target = '_blank';\n format.attributes.rel += 'noreferrer noopener';\n\n format.attributes[ 'aria-label' ] = label;\n }\n\n if ( '' === format.attributes.rel ) {\n delete format.attributes.rel;\n }\n\n return format;\n}\n","/**\n * External dependencies\n */\nimport { throttle, map, pick, defaultTo } from 'lodash';\nimport classnames from 'classnames';\nimport scrollIntoView from 'dom-scroll-into-view';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { UP, DOWN, ENTER, TAB } from '@wordpress/keycodes';\nimport { Spinner, withSpokenMessages, Popover } from '@wordpress/components';\nimport { withInstanceId, withSafeTimeout, compose } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\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\nconst fetchLinkSuggestions = async ( search ) => {\n\n const links = await apiFetch( {\n url: addQueryArgs( ajaxurl, {\n action: 'prli_search_for_links',\n term: search,\n } ),\n } );\n\n return map( links, ( link ) => ( {\n url: link.pretty_url,\n title: decodeEntities( link.value ) + ' (' + decodeEntities( link.slug ) + ')' || __( '(no title)' ),\n } ) );\n};\n\nclass URLInput extends Component {\n constructor( { autocompleteRef } ) {\n super( ...arguments );\n\n this.onChange = this.onChange.bind( this );\n this.onKeyDown = this.onKeyDown.bind( this );\n this.autocompleteRef = autocompleteRef || createRef();\n this.inputRef = createRef();\n this.updateSuggestions = throttle( this.updateSuggestions.bind( this ), 200 );\n\n this.suggestionNodes = [];\n\n this.state = {\n suggestions: [],\n showSuggestions: false,\n selectedSuggestion: null,\n };\n }\n\n componentDidUpdate() {\n const { showSuggestions, selectedSuggestion } = this.state;\n // only have to worry about scrolling selected suggestion into view\n // when already expanded\n if ( showSuggestions && selectedSuggestion !== null && ! this.scrollingIntoView ) {\n this.scrollingIntoView = true;\n scrollIntoView( this.suggestionNodes[ selectedSuggestion ], this.autocompleteRef.current, {\n onlyScrollIfNeeded: true,\n } );\n\n this.props.setTimeout( () => {\n this.scrollingIntoView = false;\n }, 100 );\n }\n }\n\n componentWillUnmount() {\n delete this.suggestionsRequest;\n }\n\n bindSuggestionNode( index ) {\n return ( ref ) => {\n this.suggestionNodes[ index ] = ref;\n };\n }\n\n updateSuggestions( value ) {\n\n // Show the suggestions after typing at least 2 characters\n // and also for URLs\n if ( value.length < 2 || /^https?:/.test( value ) ) {\n this.setState( {\n showSuggestions: false,\n selectedSuggestion: null,\n loading: false,\n } );\n\n return;\n }\n\n this.setState( {\n showSuggestions: true,\n selectedSuggestion: null,\n loading: true,\n } );\n\n const request = fetchLinkSuggestions( value );\n\n request.then( ( suggestions ) => {\n // A fetch Promise doesn't have an abort option. It's mimicked by\n // comparing the request reference in on the instance, which is\n // reset or deleted on subsequent requests or unmounting.\n if ( this.suggestionsRequest !== request ) {\n return;\n }\n\n this.setState( {\n suggestions,\n loading: false,\n } );\n\n if ( !! suggestions.length ) {\n this.props.debouncedSpeak( sprintf( _n(\n '%d result found, use up and down arrow keys to navigate.',\n '%d results found, use up and down arrow keys to navigate.',\n suggestions.length\n ), suggestions.length ), 'assertive' );\n } else {\n this.props.debouncedSpeak( __( 'No results.' ), 'assertive' );\n }\n } ).catch( () => {\n if ( this.suggestionsRequest === request ) {\n this.setState( {\n loading: false,\n } );\n }\n } );\n\n this.suggestionsRequest = request;\n }\n\n onChange( event ) {\n const inputValue = event.target.value;\n this.props.onChange( inputValue );\n this.updateSuggestions( inputValue );\n }\n\n onKeyDown( event ) {\n const { showSuggestions, selectedSuggestion, suggestions, loading } = this.state;\n // If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n // We shouldn't preventDefault to allow block arrow keys navigation\n if ( ! showSuggestions || ! suggestions.length || loading ) {\n // In the Windows version of Firefox the up and down arrows don't move the caret\n // within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n // a form of focus trapping that is disruptive to the user experience. This disruption\n // only happens if the caret is not in the first or last position in the text input.\n // See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n switch ( event.keyCode ) {\n // When UP is pressed, if the caret is at the start of the text, move it to the 0\n // position.\n case UP: {\n if ( 0 !== event.target.selectionStart ) {\n event.stopPropagation();\n event.preventDefault();\n\n // Set the input caret to position 0\n event.target.setSelectionRange( 0, 0 );\n }\n break;\n }\n // When DOWN is pressed, if the caret is not at the end of the text, move it to the\n // last position.\n case DOWN: {\n if ( this.props.value.length !== event.target.selectionStart ) {\n event.stopPropagation();\n event.preventDefault();\n\n // Set the input caret to the last position\n event.target.setSelectionRange( this.props.value.length, this.props.value.length );\n }\n break;\n }\n }\n\n return;\n }\n\n const suggestion = this.state.suggestions[ this.state.selectedSuggestion ];\n\n switch ( event.keyCode ) {\n case UP: {\n event.stopPropagation();\n event.preventDefault();\n const previousIndex = ! selectedSuggestion ? suggestions.length - 1 : selectedSuggestion - 1;\n this.setState( {\n selectedSuggestion: previousIndex,\n } );\n break;\n }\n case DOWN: {\n event.stopPropagation();\n event.preventDefault();\n const nextIndex = selectedSuggestion === null || ( selectedSuggestion === suggestions.length - 1 ) ? 0 : selectedSuggestion + 1;\n this.setState( {\n selectedSuggestion: nextIndex,\n } );\n break;\n }\n case TAB: {\n if ( this.state.selectedSuggestion !== null ) {\n this.selectLink( suggestion );\n // Announce a link has been selected when tabbing away from the input field.\n this.props.speak( __( 'Link selected.' ) );\n }\n break;\n }\n case ENTER: {\n if ( this.state.selectedSuggestion !== null ) {\n event.stopPropagation();\n this.selectLink( suggestion );\n }\n break;\n }\n }\n }\n\n selectLink( suggestion ) {\n this.props.onChange( suggestion.url, suggestion );\n this.setState( {\n selectedSuggestion: null,\n showSuggestions: false,\n } );\n }\n\n handleOnClick( suggestion ) {\n this.selectLink( suggestion );\n // Move focus to the input field when a link suggestion is clicked.\n this.inputRef.current.focus();\n }\n\n render() {\n const { value = '', autoFocus = true, instanceId, className } = this.props;\n const { showSuggestions, suggestions, selectedSuggestion, loading } = this.state;\n\n const suggestionsListboxId = `block-editor-url-input-suggestions-${ instanceId }`;\n const suggestionOptionIdPrefix = `block-editor-url-input-suggestion-${ instanceId }`;\n\n /* eslint-disable jsx-a11y/no-autofocus */\n return (\n <div className={ classnames( 'editor-url-input block-editor-url-input', className ) }>\n <input\n autoFocus={ autoFocus }\n type=\"text\"\n aria-label={ __( 'URL' ) }\n required\n value={ value }\n onChange={ this.onChange }\n onInput={ stopEventPropagation }\n placeholder={ __( 'Paste or type to search for your Pretty Link' ) }\n onKeyDown={ this.onKeyDown }\n role=\"combobox\"\n aria-expanded={ showSuggestions }\n aria-autocomplete=\"list\"\n aria-owns={ suggestionsListboxId }\n aria-activedescendant={ selectedSuggestion !== null ? `${ suggestionOptionIdPrefix }-${ selectedSuggestion }` : undefined }\n ref={ this.inputRef }\n />\n\n { ( loading ) && <Spinner /> }\n\n { showSuggestions && !! suggestions.length &&\n <Popover position=\"bottom\" noArrow focusOnMount={ false }>\n <div\n className=\"editor-url-input__suggestions block-editor-url-input__suggestions\"\n id={ suggestionsListboxId }\n ref={ this.autocompleteRef }\n role=\"listbox\"\n >\n { suggestions.map( ( suggestion, index ) => (\n <button\n key={ suggestion.id }\n role=\"option\"\n tabIndex=\"-1\"\n id={ `${ suggestionOptionIdPrefix }-${ index }` }\n ref={ this.bindSuggestionNode( index ) }\n className={ classnames( 'editor-url-input__suggestion block-editor-url-input__suggestion', {\n 'is-selected': index === selectedSuggestion,\n } ) }\n onClick={ () => this.handleOnClick( suggestion ) }\n aria-selected={ index === selectedSuggestion }\n >\n { suggestion.title }\n </button>\n ) ) }\n </div>\n </Popover>\n }\n </div>\n );\n /* eslint-enable jsx-a11y/no-autofocus */\n }\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/url-input/README.md\n */\nexport default compose(\n withSafeTimeout,\n withSpokenMessages,\n withInstanceId,\n withSelect( ( select ) => {\n const { getSettings } = select( 'core/block-editor' );\n return {\n fetchLinkSuggestions: getSettings().__experimentalFetchLinkSuggestions,\n };\n } )\n)( URLInput );\n","/**\n * WordPress dependencies\n */\nimport { __ } from \"@wordpress/i18n\";\nimport { withSpokenMessages } from \"@wordpress/components\";\nimport { Component, Fragment } from \"@wordpress/element\";\nimport {\n getTextContent,\n applyFormat,\n removeFormat,\n slice,\n registerFormatType\n} from \"@wordpress/rich-text\";\nimport { isURL, isEmail } from \"@wordpress/url\";\nimport {\n RichTextToolbarButton,\n RichTextShortcut\n} from \"@wordpress/block-editor\";\nimport InlineLinkUI from \"../../components/link-editor\";\n\n/**\n * Block constants\n */\nconst name = \"pretty-link/pretty-link\";\nconst title = __(\"Pretty Link\");\n\nexport const prettyLink = {\n name,\n title,\n tagName: \"a\",\n className: \"pretty-link\",\n attributes: {\n url: \"href\",\n target: \"target\"\n },\n edit: withSpokenMessages(\n class LinkEdit extends Component {\n constructor() {\n super(...arguments);\n\n this.addLink = this.addLink.bind(this);\n this.stopAddingLink = this.stopAddingLink.bind(this);\n this.onRemoveFormat = this.onRemoveFormat.bind(this);\n this.state = {\n addingLink: false\n };\n }\n\n addLink() {\n const { value, onChange } = this.props;\n const text = getTextContent(slice(value));\n\n if (text && isURL(text)) {\n onChange(\n applyFormat(value, { type: name, attributes: { url: text } })\n );\n } else {\n this.setState({ addingLink: true });\n }\n }\n\n stopAddingLink() {\n this.setState({ addingLink: false });\n }\n\n onRemoveFormat() {\n const { value, onChange, speak } = this.props;\n\n onChange(removeFormat(value, name));\n speak(__(\"Link removed.\"), \"assertive\");\n }\n\n render() {\n const { isActive, activeAttributes, value, onChange } = this.props;\n\n return (\n <>\n <RichTextShortcut\n type=\"primary\"\n character=\"p\"\n onUse={this.addLink}\n />\n <RichTextShortcut\n type=\"primaryShift\"\n character=\"p\"\n onUse={this.onRemoveFormat}\n />\n {isActive && (\n <RichTextToolbarButton\n icon=\"star-filled\"\n title={__(\"Unlink\")}\n onClick={this.onRemoveFormat}\n isActive={isActive}\n shortcutType=\"primaryShift\"\n shortcutCharacter=\"p\"\n />\n )}\n {!isActive && (\n <RichTextToolbarButton\n icon=\"star-filled\"\n title={title}\n onClick={this.addLink}\n isActive={isActive}\n shortcutType=\"primary\"\n shortcutCharacter=\"p\"\n />\n )}\n <InlineLinkUI\n addingLink={this.state.addingLink}\n stopAddingLink={this.stopAddingLink}\n isActive={isActive}\n activeAttributes={activeAttributes}\n value={value}\n onChange={onChange}\n />\n </>\n );\n }\n }\n )\n};\n\nfunction registerFormats() {\n [prettyLink].forEach(({ name, ...settings }) =>\n registerFormatType(name, settings)\n );\n}\nregisterFormats();\n","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","function _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutProperties;","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","/*!\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","'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;","'use strict';\n\nmodule.exports = require('./dom-scroll-into-view');","'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);","module.exports = \".pretty-link-inserter .block-editor-url-popover__settings {\\n display: block; }\\n\\n.pretty-link-inserter .pretty-link-inserter-form-container {\\n margin-top: 30px; }\\n\"","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getTarget = function (target, parent) {\n if (parent){\n return parent.querySelector(target);\n }\n return document.querySelector(target);\n};\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(target, parent) {\n // If passing function in options, then use it for resolve \"head\" element.\n // Useful for Shadow Root style i.e\n // {\n // insertInto: function () { return document.querySelector(\"#foo\").shadowRoot }\n // }\n if (typeof target === 'function') {\n return target();\n }\n if (typeof memo[target] === \"undefined\") {\n\t\t\tvar styleTarget = getTarget.call(this, target, parent);\n\t\t\t// Special case to return head of iframe instead of iframe itself\n\t\t\tif (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n\t\t\t\ttry {\n\t\t\t\t\t// This will throw an exception if access to iframe is blocked\n\t\t\t\t\t// due to cross-origin restrictions\n\t\t\t\t\tstyleTarget = styleTarget.contentDocument.head;\n\t\t\t\t} catch(e) {\n\t\t\t\t\tstyleTarget = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmemo[target] = styleTarget;\n\t\t}\n\t\treturn memo[target]\n\t};\n})();\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n\t// tags it will allow on a page\n\tif (!options.singleton && typeof options.singleton !== \"boolean\") options.singleton = isOldIE();\n\n\t// By default, add <style> tags to the <head> element\n if (!options.insertInto) options.insertInto = \"head\";\n\n\t// By default, add <style> tags to the bottom of the target\n\tif (!options.insertAt) options.insertAt = \"bottom\";\n\n\tvar styles = listToStyles(list, options);\n\n\taddStylesToDom(styles, options);\n\n\treturn function update (newList) {\n\t\tvar mayRemove = [];\n\n\t\tfor (var i = 0; i < styles.length; i++) {\n\t\t\tvar item = styles[i];\n\t\t\tvar domStyle = stylesInDom[item.id];\n\n\t\t\tdomStyle.refs--;\n\t\t\tmayRemove.push(domStyle);\n\t\t}\n\n\t\tif(newList) {\n\t\t\tvar newStyles = listToStyles(newList, options);\n\t\t\taddStylesToDom(newStyles, options);\n\t\t}\n\n\t\tfor (var i = 0; i < mayRemove.length; i++) {\n\t\t\tvar domStyle = mayRemove[i];\n\n\t\t\tif(domStyle.refs === 0) {\n\t\t\t\tfor (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();\n\n\t\t\t\tdelete stylesInDom[domStyle.id];\n\t\t\t}\n\t\t}\n\t};\n};\n\nfunction addStylesToDom (styles, options) {\n\tfor (var i = 0; i < styles.length; i++) {\n\t\tvar item = styles[i];\n\t\tvar domStyle = stylesInDom[item.id];\n\n\t\tif(domStyle) {\n\t\t\tdomStyle.refs++;\n\n\t\t\tfor(var j = 0; j < domStyle.parts.length; j++) {\n\t\t\t\tdomStyle.parts[j](item.parts[j]);\n\t\t\t}\n\n\t\t\tfor(; j < item.parts.length; j++) {\n\t\t\t\tdomStyle.parts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\t\t} else {\n\t\t\tvar parts = [];\n\n\t\t\tfor(var j = 0; j < item.parts.length; j++) {\n\t\t\t\tparts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\n\t\t\tstylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};\n\t\t}\n\t}\n}\n\nfunction listToStyles (list, options) {\n\tvar styles = [];\n\tvar newStyles = {};\n\n\tfor (var i = 0; i < list.length; i++) {\n\t\tvar item = list[i];\n\t\tvar id = options.base ? item[0] + options.base : item[0];\n\t\tvar css = item[1];\n\t\tvar media = item[2];\n\t\tvar sourceMap = item[3];\n\t\tvar part = {css: css, media: media, sourceMap: sourceMap};\n\n\t\tif(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});\n\t\telse newStyles[id].parts.push(part);\n\t}\n\n\treturn styles;\n}\n\nfunction insertStyleElement (options, style) {\n\tvar target = getElement(options.insertInto)\n\n\tif (!target) {\n\t\tthrow new Error(\"Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.\");\n\t}\n\n\tvar lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];\n\n\tif (options.insertAt === \"top\") {\n\t\tif (!lastStyleElementInsertedAtTop) {\n\t\t\ttarget.insertBefore(style, target.firstChild);\n\t\t} else if (lastStyleElementInsertedAtTop.nextSibling) {\n\t\t\ttarget.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);\n\t\t} else {\n\t\t\ttarget.appendChild(style);\n\t\t}\n\t\tstylesInsertedAtTop.push(style);\n\t} else if (options.insertAt === \"bottom\") {\n\t\ttarget.appendChild(style);\n\t} else if (typeof options.insertAt === \"object\" && options.insertAt.before) {\n\t\tvar nextSibling = getElement(options.insertAt.before, target);\n\t\ttarget.insertBefore(style, nextSibling);\n\t} else {\n\t\tthrow new Error(\"[Style Loader]\\n\\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\\n Must be 'top', 'bottom', or Object.\\n (https://github.com/webpack-contrib/style-loader#insertat)\\n\");\n\t}\n}\n\nfunction removeStyleElement (style) {\n\tif (style.parentNode === null) return false;\n\tstyle.parentNode.removeChild(style);\n\n\tvar idx = stylesInsertedAtTop.indexOf(style);\n\tif(idx >= 0) {\n\t\tstylesInsertedAtTop.splice(idx, 1);\n\t}\n}\n\nfunction createStyleElement (options) {\n\tvar style = document.createElement(\"style\");\n\n\tif(options.attrs.type === undefined) {\n\t\toptions.attrs.type = \"text/css\";\n\t}\n\n\tif(options.attrs.nonce === undefined) {\n\t\tvar nonce = getNonce();\n\t\tif (nonce) {\n\t\t\toptions.attrs.nonce = nonce;\n\t\t}\n\t}\n\n\taddAttrs(style, options.attrs);\n\tinsertStyleElement(options, style);\n\n\treturn style;\n}\n\nfunction createLinkElement (options) {\n\tvar link = document.createElement(\"link\");\n\n\tif(options.attrs.type === undefined) {\n\t\toptions.attrs.type = \"text/css\";\n\t}\n\toptions.attrs.rel = \"stylesheet\";\n\n\taddAttrs(link, options.attrs);\n\tinsertStyleElement(options, link);\n\n\treturn link;\n}\n\nfunction addAttrs (el, attrs) {\n\tObject.keys(attrs).forEach(function (key) {\n\t\tel.setAttribute(key, attrs[key]);\n\t});\n}\n\nfunction getNonce() {\n\tif (typeof __webpack_nonce__ === 'undefined') {\n\t\treturn null;\n\t}\n\n\treturn __webpack_nonce__;\n}\n\nfunction addStyle (obj, options) {\n\tvar style, update, remove, result;\n\n\t// If a transform function was defined, run it on the css\n\tif (options.transform && obj.css) {\n\t result = typeof options.transform === 'function'\n\t\t ? options.transform(obj.css) \n\t\t : options.transform.default(obj.css);\n\n\t if (result) {\n\t \t// If transform returns a value, use that instead of the original css.\n\t \t// This allows running runtime transformations on the css.\n\t \tobj.css = result;\n\t } else {\n\t \t// If the transform function returns a falsy value, don't add this css.\n\t \t// This allows conditional loading of css\n\t \treturn function() {\n\t \t\t// noop\n\t \t};\n\t }\n\t}\n\n\tif (options.singleton) {\n\t\tvar styleIndex = singletonCounter++;\n\n\t\tstyle = singleton || (singleton = createStyleElement(options));\n\n\t\tupdate = applyToSingletonTag.bind(null, style, styleIndex, false);\n\t\tremove = applyToSingletonTag.bind(null, style, styleIndex, true);\n\n\t} else if (\n\t\tobj.sourceMap &&\n\t\ttypeof URL === \"function\" &&\n\t\ttypeof URL.createObjectURL === \"function\" &&\n\t\ttypeof URL.revokeObjectURL === \"function\" &&\n\t\ttypeof Blob === \"function\" &&\n\t\ttypeof btoa === \"function\"\n\t) {\n\t\tstyle = createLinkElement(options);\n\t\tupdate = updateLink.bind(null, style, options);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\n\t\t\tif(style.href) URL.revokeObjectURL(style.href);\n\t\t};\n\t} else {\n\t\tstyle = createStyleElement(options);\n\t\tupdate = applyToTag.bind(null, style);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\t\t};\n\t}\n\n\tupdate(obj);\n\n\treturn function updateStyle (newObj) {\n\t\tif (newObj) {\n\t\t\tif (\n\t\t\t\tnewObj.css === obj.css &&\n\t\t\t\tnewObj.media === obj.media &&\n\t\t\t\tnewObj.sourceMap === obj.sourceMap\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdate(obj = newObj);\n\t\t} else {\n\t\t\tremove();\n\t\t}\n\t};\n}\n\nvar replaceText = (function () {\n\tvar textStore = [];\n\n\treturn function (index, replacement) {\n\t\ttextStore[index] = replacement;\n\n\t\treturn textStore.filter(Boolean).join('\\n');\n\t};\n})();\n\nfunction applyToSingletonTag (style, index, remove, obj) {\n\tvar css = remove ? \"\" : obj.css;\n\n\tif (style.styleSheet) {\n\t\tstyle.styleSheet.cssText = replaceText(index, css);\n\t} else {\n\t\tvar cssNode = document.createTextNode(css);\n\t\tvar childNodes = style.childNodes;\n\n\t\tif (childNodes[index]) style.removeChild(childNodes[index]);\n\n\t\tif (childNodes.length) {\n\t\t\tstyle.insertBefore(cssNode, childNodes[index]);\n\t\t} else {\n\t\t\tstyle.appendChild(cssNode);\n\t\t}\n\t}\n}\n\nfunction applyToTag (style, obj) {\n\tvar css = obj.css;\n\tvar media = obj.media;\n\n\tif(media) {\n\t\tstyle.setAttribute(\"media\", media)\n\t}\n\n\tif(style.styleSheet) {\n\t\tstyle.styleSheet.cssText = css;\n\t} else {\n\t\twhile(style.firstChild) {\n\t\t\tstyle.removeChild(style.firstChild);\n\t\t}\n\n\t\tstyle.appendChild(document.createTextNode(css));\n\t}\n}\n\nfunction updateLink (link, options, obj) {\n\tvar css = obj.css;\n\tvar sourceMap = obj.sourceMap;\n\n\t/*\n\t\tIf convertToAbsoluteUrls isn't defined, but sourcemaps are enabled\n\t\tand there is no publicPath defined then lets turn convertToAbsoluteUrls\n\t\ton by default. Otherwise default to the convertToAbsoluteUrls option\n\t\tdirectly\n\t*/\n\tvar autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;\n\n\tif (options.convertToAbsoluteUrls || autoFixUrls) {\n\t\tcss = fixUrls(css);\n\t}\n\n\tif (sourceMap) {\n\t\t// http://stackoverflow.com/a/26603875\n\t\tcss += \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\";\n\t}\n\n\tvar blob = new Blob([css], { type: \"text/css\" });\n\n\tvar oldSrc = link.href;\n\n\tlink.href = URL.createObjectURL(blob);\n\n\tif(oldSrc) URL.revokeObjectURL(oldSrc);\n}\n","\n/**\n * When source maps are enabled, `style-loader` uses a link element with a data-uri to\n * embed the css on the page. This breaks all relative urls because now they are relative to a\n * bundle instead of the current page.\n *\n * One solution is to only use full urls, but that may be impossible.\n *\n * Instead, this function \"fixes\" the relative urls to be absolute according to the current page location.\n *\n * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.\n *\n */\n\nmodule.exports = function (css) {\n // get current location\n var location = typeof window !== \"undefined\" && window.location;\n\n if (!location) {\n throw new Error(\"fixUrls requires window.location\");\n }\n\n\t// blank or null?\n\tif (!css || typeof css !== \"string\") {\n\t return css;\n }\n\n var baseUrl = location.protocol + \"//\" + location.host;\n var currentDir = baseUrl + location.pathname.replace(/\\/[^\\/]*$/, \"/\");\n\n\t// convert each url(...)\n\t/*\n\tThis regular expression is just a way to recursively match brackets within\n\ta string.\n\n\t /url\\s*\\( = Match on the word \"url\" with any whitespace after it and then a parens\n\t ( = Start a capturing group\n\t (?: = Start a non-capturing group\n\t [^)(] = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t (?: = Start another non-capturing groups\n\t [^)(]+ = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t [^)(]* = Match anything that isn't a parentheses\n\t \\) = Match a end parentheses\n\t ) = End Group\n *\\) = Match anything and then a close parens\n ) = Close non-capturing group\n * = Match anything\n ) = Close capturing group\n\t \\) = Match a close parens\n\n\t /gi = Get all matches, not the first. Be case insensitive.\n\t */\n\tvar fixedCss = css.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi, function(fullMatch, origUrl) {\n\t\t// strip quotes (if they exist)\n\t\tvar unquotedOrigUrl = origUrl\n\t\t\t.trim()\n\t\t\t.replace(/^\"(.*)\"$/, function(o, $1){ return $1; })\n\t\t\t.replace(/^'(.*)'$/, function(o, $1){ return $1; });\n\n\t\t// already a full url? no change\n\t\tif (/^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/|\\s*$)/i.test(unquotedOrigUrl)) {\n\t\t return fullMatch;\n\t\t}\n\n\t\t// convert the url to a full url\n\t\tvar newUrl;\n\n\t\tif (unquotedOrigUrl.indexOf(\"//\") === 0) {\n\t\t \t//TODO: should we add protocol?\n\t\t\tnewUrl = unquotedOrigUrl;\n\t\t} else if (unquotedOrigUrl.indexOf(\"/\") === 0) {\n\t\t\t// path should be relative to the base url\n\t\t\tnewUrl = baseUrl + unquotedOrigUrl; // already starts with '/'\n\t\t} else {\n\t\t\t// path should be relative to current directory\n\t\t\tnewUrl = currentDir + unquotedOrigUrl.replace(/^\\.\\//, \"\"); // Strip leading './'\n\t\t}\n\n\t\t// send back the fixed url(...)\n\t\treturn \"url(\" + JSON.stringify(newUrl) + \")\";\n\t});\n\n\t// send back the fixed css\n\treturn fixedCss;\n};\n","(function() { module.exports = this[\"regeneratorRuntime\"]; }());","(function() { module.exports = this[\"wp\"][\"apiFetch\"]; }());","(function() { module.exports = this[\"wp\"][\"blockEditor\"]; }());","(function() { module.exports = this[\"wp\"][\"components\"]; }());","(function() { module.exports = this[\"wp\"][\"compose\"]; }());","(function() { module.exports = this[\"wp\"][\"data\"]; }());","(function() { module.exports = this[\"wp\"][\"dom\"]; }());","(function() { module.exports = this[\"wp\"][\"element\"]; }());","(function() { module.exports = this[\"wp\"][\"htmlEntities\"]; }());","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"keycodes\"]; }());","(function() { module.exports = this[\"wp\"][\"richText\"]; }());","(function() { module.exports = this[\"wp\"][\"url\"]; }());","(function() { module.exports = this[\"lodash\"]; }());"],"sourceRoot":""}
js/editor/components/link-editor/index.js CHANGED
@@ -144,7 +144,8 @@ const createNewPrettyLink = (target, slug) => {
144
  slug: slug,
145
  redirect: '',
146
  nofollow: 1,
147
- tracking: 1
 
148
  },
149
  (data, textStatus, xhr) => {
150
  'true' === data ? resolve(data) : reject(data);
@@ -164,6 +165,7 @@ class InlineLinkUI extends Component {
164
  this.onKeyDown = this.onKeyDown.bind( this );
165
  this.onChangeInputValue = this.onChangeInputValue.bind( this );
166
  this.setNoFollow = this.setNoFollow.bind( this );
 
167
  this.setLinkTarget = this.setLinkTarget.bind( this );
168
  this.onClickOutside = this.onClickOutside.bind( this );
169
  this.resetState = this.resetState.bind( this );
@@ -172,6 +174,7 @@ class InlineLinkUI extends Component {
172
  this.state = {
173
  noFollow: false,
174
  opensInNewWindow: false,
 
175
  inputValue: '',
176
  newLinkUrl: '',
177
  newLinkSlug: '',
@@ -182,7 +185,7 @@ class InlineLinkUI extends Component {
182
  }
183
 
184
  static getDerivedStateFromProps( props, state ) {
185
- const { activeAttributes: { url, target } } = props;
186
  const opensInNewWindow = target === '_blank';
187
 
188
  if ( ! isShowingInput( props, state ) ) {
@@ -239,7 +242,27 @@ class InlineLinkUI extends Component {
239
  url,
240
  opensInNewWindow,
241
  text: selectedText,
242
- noFollow
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  } ) ) );
244
  }
245
  }
@@ -251,14 +274,15 @@ class InlineLinkUI extends Component {
251
 
252
  submitLink( event ) {
253
  const { isActive, value, onChange, speak } = this.props;
254
- const { inputValue, opensInNewWindow, noFollow } = this.state;
255
  const url = prependHTTP( inputValue );
256
  const selectedText = getTextContent( slice( value ) );
257
  const format = createLinkFormat( {
258
  url,
259
  opensInNewWindow,
260
  text: selectedText,
261
- noFollow
 
262
  } );
263
 
264
  event.preventDefault();
@@ -306,7 +330,7 @@ class InlineLinkUI extends Component {
306
  return null;
307
  }
308
 
309
- const { inputValue, noFollow, opensInNewWindow, newLinkUrl, newLinkSlug, creatingLink, createdLink, createdLinkError } = this.state;
310
  const showInput = isShowingInput( this.props, this.state );
311
 
312
  return (
@@ -331,6 +355,11 @@ class InlineLinkUI extends Component {
331
  checked={ noFollow }
332
  onChange={ this.setNoFollow }
333
  />
 
 
 
 
 
334
  </div>
335
  <div className="pretty-link-inserter-form-container">
336
  {
144
  slug: slug,
145
  redirect: '',
146
  nofollow: 1,
147
+ tracking: 1,
148
+ sponsored: 0
149
  },
150
  (data, textStatus, xhr) => {
151
  'true' === data ? resolve(data) : reject(data);
165
  this.onKeyDown = this.onKeyDown.bind( this );
166
  this.onChangeInputValue = this.onChangeInputValue.bind( this );
167
  this.setNoFollow = this.setNoFollow.bind( this );
168
+ this.setIsSponsored = this.setIsSponsored.bind( this );
169
  this.setLinkTarget = this.setLinkTarget.bind( this );
170
  this.onClickOutside = this.onClickOutside.bind( this );
171
  this.resetState = this.resetState.bind( this );
174
  this.state = {
175
  noFollow: false,
176
  opensInNewWindow: false,
177
+ isSponsored: false,
178
  inputValue: '',
179
  newLinkUrl: '',
180
  newLinkSlug: '',
185
  }
186
 
187
  static getDerivedStateFromProps( props, state ) {
188
+ const { activeAttributes: { url, target, isSponsored } } = props;
189
  const opensInNewWindow = target === '_blank';
190
 
191
  if ( ! isShowingInput( props, state ) ) {
242
  url,
243
  opensInNewWindow,
244
  text: selectedText,
245
+ noFollow,
246
+ isSponsored
247
+ } ) ) );
248
+ }
249
+ }
250
+
251
+ setIsSponsored( isSponsored ) {
252
+ const { activeAttributes: { url = '' }, value, onChange } = this.props;
253
+
254
+ this.setState( { isSponsored } );
255
+
256
+ // Apply now if URL is not being edited.
257
+ if ( ! isShowingInput( this.props, this.state ) ) {
258
+ const selectedText = getTextContent( slice( value ) );
259
+
260
+ onChange( applyFormat( value, createLinkFormat( {
261
+ url,
262
+ opensInNewWindow,
263
+ text: selectedText,
264
+ noFollow,
265
+ isSponsored
266
  } ) ) );
267
  }
268
  }
274
 
275
  submitLink( event ) {
276
  const { isActive, value, onChange, speak } = this.props;
277
+ const { inputValue, opensInNewWindow, noFollow, isSponsored } = this.state;
278
  const url = prependHTTP( inputValue );
279
  const selectedText = getTextContent( slice( value ) );
280
  const format = createLinkFormat( {
281
  url,
282
  opensInNewWindow,
283
  text: selectedText,
284
+ noFollow,
285
+ isSponsored
286
  } );
287
 
288
  event.preventDefault();
330
  return null;
331
  }
332
 
333
+ const { inputValue, noFollow, opensInNewWindow, isSponsored, newLinkUrl, newLinkSlug, creatingLink, createdLink, createdLinkError } = this.state;
334
  const showInput = isShowingInput( this.props, this.state );
335
 
336
  return (
355
  checked={ noFollow }
356
  onChange={ this.setNoFollow }
357
  />
358
+ <ToggleControl
359
+ label={ __( 'Sponsored Link' ) }
360
+ checked={ isSponsored }
361
+ onChange={ this.setIsSponsored }
362
+ />
363
  </div>
364
  <div className="pretty-link-inserter-form-container">
365
  {
js/editor/components/link-editor/utils.js CHANGED
@@ -89,7 +89,7 @@ export function isValidHref( href ) {
89
  *
90
  * @return {Object} The final format object.
91
  */
92
- export function createLinkFormat( { url, opensInNewWindow, text, noFollow } ) {
93
  const format = {
94
  type: 'core/link',
95
  attributes: {
@@ -100,7 +100,11 @@ export function createLinkFormat( { url, opensInNewWindow, text, noFollow } ) {
100
  format.attributes.rel = '';
101
 
102
  if ( noFollow ) {
103
- format.attributes.rel += 'nofollow ';
 
 
 
 
104
  }
105
 
106
  if ( opensInNewWindow ) {
89
  *
90
  * @return {Object} The final format object.
91
  */
92
+ export function createLinkFormat( { url, opensInNewWindow, text, noFollow, isSponsored } ) {
93
  const format = {
94
  type: 'core/link',
95
  attributes: {
100
  format.attributes.rel = '';
101
 
102
  if ( noFollow ) {
103
+ format.attributes.rel += 'nofollow noindex ';
104
+ }
105
+
106
+ if ( isSponsored ) {
107
+ format.attributes.rel += 'sponsored ';
108
  }
109
 
110
  if ( opensInNewWindow ) {
js/tinymce_form_popup.js CHANGED
@@ -17,6 +17,7 @@ var PrliPopUpHandler = {
17
  var link_text = jQuery('#prli_insert_link_link_text').val();
18
  var redirect = jQuery('#prli_insert_link_redirect').val();
19
  var nofollow = jQuery('#prli_insert_link_nofollow').val();
 
20
  var tracking = jQuery('#prli_insert_link_tracking').val();
21
  var new_tab = jQuery('#prli_insert_link_new_tab').is(':checked');
22
  var good_slug = jQuery('#prli_is_valid_slug').val();
@@ -28,6 +29,9 @@ var PrliPopUpHandler = {
28
  if(nofollow == 'default') {
29
  nofollow = prliTinymceL10n.default_nofollow;
30
  }
 
 
 
31
  if(tracking == 'default') {
32
  tracking = prliTinymceL10n.default_tracking;
33
  }
@@ -52,6 +56,7 @@ var PrliPopUpHandler = {
52
  slug: slug,
53
  redirect: redirect,
54
  nofollow: nofollow,
 
55
  tracking: tracking
56
  };
57
 
@@ -63,6 +68,7 @@ var PrliPopUpHandler = {
63
 
64
  if(trimmed_data == 'true') {
65
  var output = '';
 
66
  var pretty_link = prliTinymceL10n.home_url + slug;
67
 
68
  //Set the link text to the link itself
@@ -78,7 +84,15 @@ var PrliPopUpHandler = {
78
  }
79
 
80
  if(nofollow == 'enabled') {
81
- output += 'rel="nofollow" ';
 
 
 
 
 
 
 
 
82
  }
83
 
84
  output += '>' + link_text + '</a>';
@@ -101,10 +115,12 @@ var PrliPopUpHandler = {
101
  jQuery('#errors').html('');
102
 
103
  var output = '';
 
104
  var pretty_link = jQuery("#existing_link_slug").html();
105
  var link_text = jQuery("#existing_link_link_text").val();
106
  var new_tab = jQuery("#existing_link_new_tab").is(":checked");
107
  var nofollow = jQuery("#existing_link_nofollow").val();
 
108
 
109
  if(pretty_link.match(/https?:\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?/)) {
110
  //Set the link text to the link itself
@@ -120,7 +136,15 @@ var PrliPopUpHandler = {
120
  }
121
 
122
  if(nofollow == 1) {
123
- output += 'rel="nofollow" ';
 
 
 
 
 
 
 
 
124
  }
125
 
126
  output += '>' + link_text + '</a>';
@@ -227,6 +251,7 @@ var PrliPopUpHandler = {
227
  select: function(event, ui) {
228
  $("#existing_link_target").html(ui.item.target);
229
  $("#existing_link_nofollow").val(ui.item.nofollow);
 
230
  $("#existing_link_slug").html(prliTinymceL10n.home_url + ui.item.slug);
231
  }
232
  });
17
  var link_text = jQuery('#prli_insert_link_link_text').val();
18
  var redirect = jQuery('#prli_insert_link_redirect').val();
19
  var nofollow = jQuery('#prli_insert_link_nofollow').val();
20
+ var sponsored = jQuery('#prli_insert_link_sponsored').val();
21
  var tracking = jQuery('#prli_insert_link_tracking').val();
22
  var new_tab = jQuery('#prli_insert_link_new_tab').is(':checked');
23
  var good_slug = jQuery('#prli_is_valid_slug').val();
29
  if(nofollow == 'default') {
30
  nofollow = prliTinymceL10n.default_nofollow;
31
  }
32
+ if(sponsored == 'default') {
33
+ sponsored = prliTinymceL10n.default_sponsored;
34
+ }
35
  if(tracking == 'default') {
36
  tracking = prliTinymceL10n.default_tracking;
37
  }
56
  slug: slug,
57
  redirect: redirect,
58
  nofollow: nofollow,
59
+ sponsored: sponsored,
60
  tracking: tracking
61
  };
62
 
68
 
69
  if(trimmed_data == 'true') {
70
  var output = '';
71
+ var rel = '';
72
  var pretty_link = prliTinymceL10n.home_url + slug;
73
 
74
  //Set the link text to the link itself
84
  }
85
 
86
  if(nofollow == 'enabled') {
87
+ rel += 'nofollow ';
88
+ }
89
+
90
+ if(sponsored == 'enabled') {
91
+ rel += 'sponsored ';
92
+ }
93
+
94
+ if(rel != '') {
95
+ output += ' rel="' + rel + '" ';
96
  }
97
 
98
  output += '>' + link_text + '</a>';
115
  jQuery('#errors').html('');
116
 
117
  var output = '';
118
+ var rel = '';
119
  var pretty_link = jQuery("#existing_link_slug").html();
120
  var link_text = jQuery("#existing_link_link_text").val();
121
  var new_tab = jQuery("#existing_link_new_tab").is(":checked");
122
  var nofollow = jQuery("#existing_link_nofollow").val();
123
+ var sponsored = jQuery("#existing_link_sponsored").val();
124
 
125
  if(pretty_link.match(/https?:\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?/)) {
126
  //Set the link text to the link itself
136
  }
137
 
138
  if(nofollow == 1) {
139
+ rel += 'nofollow ';
140
+ }
141
+
142
+ if(sponsored == 1) {
143
+ rel += 'sponsored ';
144
+ }
145
+
146
+ if(rel != '') {
147
+ output += 'rel="' + rel + '" ';
148
  }
149
 
150
  output += '>' + link_text + '</a>';
251
  select: function(event, ui) {
252
  $("#existing_link_target").html(ui.item.target);
253
  $("#existing_link_nofollow").val(ui.item.nofollow);
254
+ $("#existing_link_sponsored").val(ui.item.sponsored);
255
  $("#existing_link_slug").html(prliTinymceL10n.home_url + ui.item.slug);
256
  }
257
  });
pretty-link.php CHANGED
@@ -2,12 +2,12 @@
2
  /*
3
  Plugin Name: Pretty Links
4
  Plugin URI: https://prettylinks.com/pl/plugin-uri
5
- Description: Shrink, track and share any URL on the Internet from your WordPress website!
6
- Version: 3.0.10
7
- Author: Blair Williams
8
- Author URI: http://blairwilliams.com
9
  Text Domain: pretty-link
10
- Copyright: 2004-2019, Caseproof, LLC
11
 
12
  GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
13
  This program is free software; you can redistribute it and/or modify
@@ -55,7 +55,7 @@ define('PRLI_VENDOR_LIB_URL',PRLI_URL.'/vendor/lib');
55
  define('PRLI_BROWSER_URL','https://d14715w921jdje.cloudfront.net/browser');
56
  define('PRLI_OS_URL','https://d14715w921jdje.cloudfront.net/os');
57
 
58
- define('PRLI_EDITION', 'pretty-link-lite');
59
 
60
  // Let's give pretty link plenty of room to work with
61
  $mem = abs(intval(@ini_get('memory_limit')));
@@ -167,7 +167,7 @@ $prli_utils = new PrliUtils();
167
 
168
  global $prli_db_version, $plp_db_version;
169
 
170
- $prli_db_version = 22; // this is the version of the database we're moving to
171
  $plp_db_version = 10; // this is the version of the database we're moving to
172
 
173
  global $prli_app_controller;
2
  /*
3
  Plugin Name: Pretty Links
4
  Plugin URI: https://prettylinks.com/pl/plugin-uri
5
+ Description: Shrink, track and share any URL using your website and brand!
6
+ Version: 3.1.0
7
+ Author: Pretty Links
8
+ Author URI: http://prettylinks.com
9
  Text Domain: pretty-link
10
+ Copyright: 2004-2020, Caseproof, LLC
11
 
12
  GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
13
  This program is free software; you can redistribute it and/or modify
55
  define('PRLI_BROWSER_URL','https://d14715w921jdje.cloudfront.net/browser');
56
  define('PRLI_OS_URL','https://d14715w921jdje.cloudfront.net/os');
57
 
58
+ define('PRLI_EDITION', 'pretty-link-pro');
59
 
60
  // Let's give pretty link plenty of room to work with
61
  $mem = abs(intval(@ini_get('memory_limit')));
167
 
168
  global $prli_db_version, $plp_db_version;
169
 
170
+ $prli_db_version = 23; // this is the version of the database we're moving to
171
  $plp_db_version = 10; // this is the version of the database we're moving to
172
 
173
  global $prli_app_controller;
readme.txt CHANGED
@@ -1,22 +1,16 @@
1
- === Shortlinks by Pretty Links - Best WordPress Link Tracking Plugin ===
2
  Contributors: supercleanse, cartpauj
3
  Donate link: https://prettylinks.com
4
- Tags: links, link, url, urls, affiliate, affiliates, pretty, marketing, redirect, redirection, forward, plugin, twitter, tweet, rewrite, shorturl, hoplink, hop, shortlink, short, shorten, shortening, click, clicks, track, tracking, tiny, tinyurl, budurl, shrinking, domain, shrink, mask, masking, cloak, cloaking, slug, slugs, admin, administration, stats, statistics, stat, statistic, email, ajax, javascript, ui, csv, download, page, post, pages, posts, shortcode, seo, automation, widget, widgets, dashboard
5
  Requires at least: 5.1
6
- Tested up to: 5.2.2
7
- Stable tag: 3.0.10
8
 
9
- Shrink, beautify, track, manage and share any URL on or off of your WordPress website. Create links that look how you want using your own domain name!
10
 
11
  == Description ==
12
 
13
- = Pretty Links Pro =
14
-
15
- [Upgrade to Pretty Links Pro](https://prettylinks.com/why-upgrade/ "Upgrade to Pretty Links Pro")
16
-
17
- *Pretty Links Pro* is a **significant upgrade** that adds many tools and redirection types that will allow you to create pretty links automatically, cloak links, replace keywords thoughout your blog with pretty links, categorize & tag your pretty links and much more. You can learn more about *Pretty Links Pro* here:
18
-
19
- [Learn More](https://prettylinks.com/about "Learn More") | [Pricing](https://prettylinks.com/pricing/plans/ "Pricing")
20
 
21
  = Pretty Links =
22
 
@@ -55,6 +49,14 @@ http://blairwilliams.com/w7a
55
  * Turn tracking on / off on each link
56
  * Pretty Links Bookmarklet
57
 
 
 
 
 
 
 
 
 
58
  == Installation ==
59
 
60
  1. Upload 'pretty-link.zip' to the '/wp-content/plugins/' directory
@@ -64,6 +66,13 @@ http://blairwilliams.com/w7a
64
  3. Make sure you have changed your permalink Common Settings in Settings -> Permalinks away from "Default" to something else. I prefer using custom and then "/%year%/%month%/%postname%/" for the simplest possible URL slugs with the best performance.
65
 
66
  == Changelog ==
 
 
 
 
 
 
 
67
  = 3.0.10 =
68
  * Add support for nofollow in Gutenberg popup
69
  * Fix post_author being set to 0 on CPT
@@ -132,139 +141,3 @@ http://blairwilliams.com/w7a
132
  * PRO ONLY: Fixed some issues with Pretty Link Imports and Exports
133
  * Many other small fixes and enhancements
134
 
135
- = 2.1.10 =
136
- * More security hardening
137
-
138
- = 2.1.9 =
139
- * Fixed some security issues
140
-
141
- = 2.1.8 =
142
- * Fixed broken charts in dashboard widget
143
- * Fixed duplicate social buttons
144
- * Fixed warning of "invalid argument supplied to foreach"
145
-
146
- = 2.1.7 =
147
- * Changed clipboard library
148
- * Fixed an issue with non-countable strings for PHP 7.2
149
- * Fixed issue with large indexes utf8mb4 innodb
150
- * Fixed issue with ampersands in Keywords
151
- * Fixed issue with keywords being replaced
152
- * Fixed issue with '+' sign not allowed in slugs
153
- * Fixed self-closing tags for keyword replacement
154
- * Fixed Arabic (UTF-8) characters
155
-
156
- = 2.1.6 =
157
- * Fixed a conflict with Mulit-site variable name
158
-
159
- = 2.1.5 =
160
- * Fixed Target URL Rotations
161
- * Fixed domain mapping and home_url in Multi-site
162
- * Fixed GeoRedirect for IPv6
163
-
164
- = 2.1.4 =
165
- * Fixed IP conflict with Flywheel
166
- * Fixed wp_redirect race condition
167
-
168
- = 2.1.3 =
169
- * Addressed security vulnerabilities
170
- * Fixed content-type header
171
- * Fixed -1 PHP memory_limit error
172
- * Updated redirects to use wp_redirect()
173
- * PRO Enhanced WooCommerce keyword replacements
174
- * PRO Fixed replacing keywords in header and other HTML tags
175
- * PRO Fixed link expiration dates being 1 day off
176
-
177
- = 2.1.2 =
178
- * Updated user manual link
179
- * Rebranded from Pretty Link to Pretty Links
180
-
181
- = 2.1.1 =
182
- * Redeploy to WP Repo
183
-
184
- = 2.1.0 =
185
- * Fixed bug breaking TinyMCE
186
-
187
- = 2.0.9 =
188
- * Fixed pixel redirect type tracking
189
- * Fixed ordering for geo redirects
190
- * Fixed URL validation
191
- * Fixed split test reporting
192
-
193
- = 2.0.8 =
194
- * Fixed a regular expression warning
195
- * Use PHP's url validation in utils
196
-
197
- = 2.0.7 =
198
- * Enhanced database performance
199
- * Added code to automatically remove click data from the database that is no longer being used
200
- * Fixed numerous bugs
201
- * PRO Prevent keywords autolinking from creating circular links
202
-
203
- = 2.0.6 =
204
- * Fixed numerous bugs
205
-
206
- = 2.0.4 =
207
- * Fix URI params not sticking
208
- * PRO Fix apostrophe in keywords
209
-
210
- = 2.0.3 =
211
- * *Important* performance fix
212
- * PRO Fixed an issue with Google Analytics integration
213
-
214
- = 2.0.2 =
215
- * Fixed a small javascript issue
216
- * Fixed a small issue with Keyword Replacements
217
- * Fixed an issue with the pro automatic update code that was affecting lite users
218
-
219
- = 2.0.1 =
220
- * Fixed Link titles on the Pretty Link listing admin screen
221
- * Fixed a small collation issue
222
- * Added convenience links on the plugin listing admin screen
223
-
224
- = 2.0.0 =
225
- * Added an Insert Pretty Link editor popup to create and insert pretty links while editing a page, post or custom post type
226
- * Added a base slug prefix feature so that new Pretty Links can be prefixed
227
- * Added auto-trimming for clicks to keep click databases operating at full performance
228
- * Refactored entire codebase
229
- * Completely new UI
230
- * Tools have been better separated out into it's own admin page
231
- * Now fully translatable
232
- * Fixed numerous bugs including "Slug Not Available" issue
233
- * Numerous stability, security and performance fixes
234
- * Removed banner advertisements on the Pretty Link list admin page for lite users
235
- * PRO Added support for automatically created links on Custom Post Types
236
- * PRO Added automatic link disclosures for keyword replacements
237
- * PRO Added pretty link keyword replacement indexing for better performance
238
- * PRO Added Geographic redirects
239
- * PRO Added Technology-based redirects
240
- * PRO Added Time-based redirects
241
- * PRO Added Link Expirations
242
- * PRO Enhanced Link Rotations to accept more target URLs
243
- * PRO Enhanced Social Share buttons to look better and support modern social sites
244
- * PRO Enhanced QR codes code that produces them quicker and at larger sizes
245
- * PRO Added an auto url replacement blacklist to ensure some URLs won't ever be replaced
246
- * PRO Added the ability to add custom head scripts to redirect types that support it (Javascript, Cloaked, Pretty Bar, Meta Refresh, etc)
247
- * PRO Enhanced the reliability and amount of data that can be imported and exported
248
- * PRO Changed auto update system to use a license key instead of username / password
249
- * PRO Consolidated the "Pro" Options to appear on the main Pretty Link Options admin page
250
- * PRO Removed Double Redirects
251
- * PRO Removed the Twitter Badge option ... this is now handled better with the social share bar or through another plugin like Social Warfare
252
- * PRO Removed the Auto-Tweet capability ... auto-tweeting is handled better on a service like Buffer or Hootsuite
253
-
254
- == Upgrade Notice ==
255
-
256
- = 2.0.6 =
257
- * Important bug fixes, every user should upgrade.
258
-
259
- = 2.0.3 =
260
- * Important performance fix ... every user should upgrade.
261
-
262
- = 2.0.2 =
263
- * Fixed several bugs ... one of which could affect site performance so everyone should upgrade immediately.
264
-
265
- = 2.0.1 =
266
- * Fixed a few small issues. People should generally upgrade.
267
-
268
- = 2.0.0 =
269
- * This is a major new release. To take advantage of the stability, security and performance fixes ... as well as the new features.
270
-
1
+ === Pretty Links - Link Management, Branding, Tracking & Sharing Plugin ===
2
  Contributors: supercleanse, cartpauj
3
  Donate link: https://prettylinks.com
4
+ Tags: links, urls, shortlinks, link branding, link tracking, affiliate links, link cloaking, marketing, redirect, forward, social media, rewrite, shorturl, shorten, shortening, click, clicks, track, tracking, tiny, tinyurl, budurl, shrinking, domain, shrink, mask, masking, cloak, cloaking, slug, slugs, admin, administration, stats, statistics, stat, statistic, email, ajax, javascript, ui, csv, download, page, post, pages, posts, shortcode, seo, automation, widget, widgets, dashboard
5
  Requires at least: 5.1
6
+ Tested up to: 5.4
7
+ Stable tag: 3.1.0
8
 
9
+ The best WordPress link management, branding, tracking & sharing plugin. Link shortener helps you easily make pretty & trackable shortlinks.
10
 
11
  == Description ==
12
 
13
+ Pretty Links helps you shrink, beautify, track, manage and share any URL on or off of your WordPress website. Create links that look how you want using your own domain name!
 
 
 
 
 
 
14
 
15
  = Pretty Links =
16
 
49
  * Turn tracking on / off on each link
50
  * Pretty Links Bookmarklet
51
 
52
+ = Pretty Links Pro =
53
+
54
+ [Upgrade to Pretty Links Pro](https://prettylinks.com/why-upgrade/ "Upgrade to Pretty Links Pro")
55
+
56
+ *Pretty Links Pro* is a **significant upgrade** that adds many tools and redirection types that will allow you to create pretty links automatically, cloak links, replace keywords thoughout your blog with pretty links, categorize & tag your pretty links and much more. You can learn more about *Pretty Links Pro* here:
57
+
58
+ [Learn More](https://prettylinks.com/about "Learn More") | [Pricing](https://prettylinks.com/pricing/plans/ "Pricing")
59
+
60
  == Installation ==
61
 
62
  1. Upload 'pretty-link.zip' to the '/wp-content/plugins/' directory
66
  3. Make sure you have changed your permalink Common Settings in Settings -> Permalinks away from "Default" to something else. I prefer using custom and then "/%year%/%month%/%postname%/" for the simplest possible URL slugs with the best performance.
67
 
68
  == Changelog ==
69
+ = 3.1.0 =
70
+ * Add support for sponsored rel tag
71
+ * Add sponsored toggle support in gutenberg and tinymce editors
72
+ * Fix report graphs not loading for some
73
+ * PRO: Fix bug with keywords replacements
74
+ * PRO: Cleaned up GA support
75
+
76
  = 3.0.10 =
77
  * Add support for nofollow in Gutenberg popup
78
  * Fix post_author being set to 0 on CPT
141
  * PRO ONLY: Fixed some issues with Pretty Link Imports and Exports
142
  * Many other small fixes and enhancements
143