Spotlight Social Media Feeds - Version 0.5

Version Description

(2020-11-17) =

Added - New option in the feeds list to update the Instagram posts for a feed - The "Show/hide PRO Features" selection is remembered in the browser

Changed - Video thumbnails are generated for non-tagged and non-hashtag posts - Added a notification when connecting an account using an access token fails - Duplicate posts, even if fetched for different sources, will no longer be shown in feeds

Fixed - Incompatibility with Kadence plugins caused modal popups to not appear - Incompatibility with LiteSpeed cache when loading JS when DOM is ready - Corrupted feed options would cause an error that prevented editing and saving feeds - Modals no longer cover up toast notifications in the admin app - Warnings would show up when activating the plugin on a new site - Cron jobs would not be recreated after their schedule is changed in the settings - Feed usage in the block editor was not detected and shown in the feeds list - Duplicate crons would be created when run manually using WP Crontrol

Download this release

Release Info

Developer Mekku
Plugin Icon 128x128 Spotlight Social Media Feeds
Version 0.5
Comparing to
See all releases

Code changes from version 0.4.2 to 0.5

Files changed (69) hide show
  1. core/Actions/ImportMediaAction.php +22 -18
  2. core/Di/Container.php +13 -4
  3. core/Engine/Aggregation/MediaCollection.php +9 -0
  4. core/Engine/Aggregation/MediaSorterProcessor.php +85 -0
  5. core/Engine/Aggregation/MediaStorySegregator.php +27 -0
  6. core/Engine/Aggregation/MediaTransformer.php +71 -0
  7. core/Engine/MediaChild.php +11 -0
  8. core/Engine/MediaComment.php +12 -0
  9. core/Engine/MediaItem.php +29 -0
  10. core/Engine/Providers/IgAccountMediaProvider.php +124 -0
  11. core/Engine/Providers/IgProvider.php +62 -0
  12. core/Engine/Sources/HashtagSource.php +36 -0
  13. core/Engine/Sources/StorySource.php +30 -0
  14. core/Engine/Sources/TaggedUserSource.php +29 -0
  15. core/Engine/Sources/UserSource.php +36 -0
  16. core/Engine/Stores/WpPostMediaStore.php +331 -0
  17. core/Feeds/FeedManager.php +152 -0
  18. core/Feeds/FeedTemplate.php +2 -12
  19. core/IgApi/IgApiClient.php +5 -6
  20. core/IgApi/IgApiUtils.php +13 -1
  21. core/IgApi/IgBasicApiClient.php +17 -7
  22. core/IgApi/IgGraphApiClient.php +27 -20
  23. core/MediaStore/Fetchers/AccountMediaFetcher.php +2 -1
  24. core/MediaStore/Processors/MediaDownloader.php +82 -27
  25. core/PostTypes/AccountPostType.php +26 -0
  26. core/PostTypes/FeedPostType.php +5 -2
  27. core/PostTypes/MediaPostType.php +1 -0
  28. core/RestApi/EndPoints/Media/FetchMediaEndPoint.php +0 -75
  29. core/RestApi/EndPoints/Media/GetFeedMediaEndPoint.php +91 -0
  30. core/RestApi/EndPoints/Media/GetMediaEndPoint.php +33 -48
  31. core/RestApi/EndPoints/Media/ImportMediaEndPoint.php +75 -0
  32. core/Utils/Arrays.php +77 -0
  33. core/Utils/Functions.php +444 -0
  34. core/Wp/CronJob.php +7 -2
  35. engine/Aggregation/ItemAggregator.php +204 -0
  36. engine/Aggregation/ItemFeed.php +62 -0
  37. engine/Aggregation/ItemProcessor.php +25 -0
  38. engine/Aggregation/ItemSegregator.php +26 -0
  39. engine/Aggregation/ItemTransformer.php +25 -0
  40. engine/Engine.php +113 -0
  41. engine/Error.php +57 -0
  42. engine/Fetching/BatchingItemProvider.php +131 -0
  43. engine/Fetching/CompositeItemProvider.php +44 -0
  44. engine/Fetching/DelegateItemProvider.php +72 -0
  45. engine/Fetching/FallbackItemProvider.php +59 -0
  46. engine/Fetching/ItemProvider.php +38 -0
  47. engine/Importing/ItemImporter.php +81 -0
  48. engine/Importing/ItemStore.php +28 -0
  49. engine/Item.php +60 -0
  50. engine/Result.php +219 -0
  51. engine/Source.php +112 -0
  52. freemius.php +2 -0
  53. includes/init.php +147 -23
  54. modules.php +2 -0
  55. modules/Dev/DevPage.php +6 -2
  56. modules/EngineModule.php +144 -0
  57. modules/FeedsModule.php +4 -0
  58. modules/ImportCronModule.php +3 -3
  59. modules/InstagramModule.php +70 -25
  60. modules/RestApiModule.php +26 -11
  61. plugin.json +1 -1
  62. plugin.php +59 -6
  63. readme.txt +75 -35
  64. ui/dist/admin-app.js +1 -1
  65. ui/dist/admin-common.js +1 -1
  66. ui/dist/common.js +1 -1
  67. ui/dist/editor-pro.js +1 -1
  68. ui/dist/editor.js +1 -1
  69. ui/dist/elementor-editor.js +1 -1
core/Actions/ImportMediaAction.php CHANGED
@@ -2,11 +2,11 @@
2
 
3
  namespace RebelCode\Spotlight\Instagram\Actions;
4
 
5
- use RebelCode\Spotlight\Instagram\MediaStore\MediaStore;
6
- use RebelCode\Spotlight\Instagram\PostTypes\FeedPostType;
 
 
7
  use RebelCode\Spotlight\Instagram\Utils\Arrays;
8
- use RebelCode\Spotlight\Instagram\Wp\PostType;
9
- use WP_Post;
10
 
11
  /**
12
  * The action that imports media for all saved accounts.
@@ -16,31 +16,31 @@ use WP_Post;
16
  class ImportMediaAction
17
  {
18
  /**
19
- * @since 0.1
20
  *
21
- * @var PostType
22
  */
23
- protected $cpt;
24
 
25
  /**
26
- * @since 0.1
27
  *
28
- * @var MediaStore
29
  */
30
- protected $store;
31
 
32
  /**
33
  * Constructor.
34
  *
35
  * @since 0.1
36
  *
37
- * @param PostType $cpt The feeds post type.
38
- * @param MediaStore $store The media store.
39
  */
40
- public function __construct(PostType $cpt, MediaStore $store)
41
  {
42
- $this->cpt = $cpt;
43
- $this->store = $store;
44
  }
45
 
46
  /**
@@ -48,10 +48,14 @@ class ImportMediaAction
48
  */
49
  public function __invoke()
50
  {
51
- $feeds = $this->cpt->query();
 
 
 
 
52
 
53
- Arrays::each($feeds, function (WP_Post $post) {
54
- $this->store->getFeedMedia(FeedPostType::fromWpPost($post));
55
  });
56
  }
57
  }
2
 
3
  namespace RebelCode\Spotlight\Instagram\Actions;
4
 
5
+ use RebelCode\Iris\Aggregation\ItemFeed;
6
+ use RebelCode\Iris\Importing\ItemImporter;
7
+ use RebelCode\Spotlight\Instagram\Engine\FeedMediaImporter;
8
+ use RebelCode\Spotlight\Instagram\Feeds\FeedManager;
9
  use RebelCode\Spotlight\Instagram\Utils\Arrays;
 
 
10
 
11
  /**
12
  * The action that imports media for all saved accounts.
16
  class ImportMediaAction
17
  {
18
  /**
19
+ * @since 0.5
20
  *
21
+ * @var FeedManager
22
  */
23
+ protected $feedManager;
24
 
25
  /**
26
+ * @since 0.5
27
  *
28
+ * @var ItemImporter
29
  */
30
+ protected $importer;
31
 
32
  /**
33
  * Constructor.
34
  *
35
  * @since 0.1
36
  *
37
+ * @param FeedManager $feedManager The feeds manager.
38
+ * @param ItemImporter $importer The item import.
39
  */
40
+ public function __construct(FeedManager $feedManager, ItemImporter $importer)
41
  {
42
+ $this->feedManager = $feedManager;
43
+ $this->importer = $importer;
44
  }
45
 
46
  /**
48
  */
49
  public function __invoke()
50
  {
51
+ $feeds = $this->feedManager->query();
52
+
53
+ Arrays::each($feeds, function (ItemFeed $feed) {
54
+ // Allocate up to 5 minutes for each feed's import
55
+ set_time_limit(300);
56
 
57
+ // Import all media for each of the feed's sources
58
+ Arrays::each($feed->sources, [$this->importer, 'import']);
59
  });
60
  }
61
  }
core/Di/Container.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  namespace RebelCode\Spotlight\Instagram\Di;
4
 
 
5
  use Dhii\Services\Extension;
6
  use Dhii\Services\Factory;
7
  use LogicException;
@@ -99,6 +100,7 @@ class Container implements ContainerInterface
99
  *
100
  * @return mixed The created service value.
101
  * @throws NotFoundException If no service with the given key was found.
 
102
  */
103
  protected function actualGet($key)
104
  {
@@ -107,10 +109,17 @@ class Container implements ContainerInterface
107
  }
108
 
109
  if (!array_key_exists($key, $this->cache)) {
110
- $service = ($this->factories[$key])($this);
111
-
112
- if (array_key_exists($key, $this->extensions)) {
113
- $service = ($this->extensions[$key])($this, $service);
 
 
 
 
 
 
 
114
  }
115
 
116
  $this->cache[$key] = apply_filters($this->filterPrefix . '/' . $key, $service);
2
 
3
  namespace RebelCode\Spotlight\Instagram\Di;
4
 
5
+ use Dhii\Container\Exception\ContainerException;
6
  use Dhii\Services\Extension;
7
  use Dhii\Services\Factory;
8
  use LogicException;
100
  *
101
  * @return mixed The created service value.
102
  * @throws NotFoundException If no service with the given key was found.
103
+ * @throws ContainerException If failed to create the service using the corresponding factory and extensions.
104
  */
105
  protected function actualGet($key)
106
  {
109
  }
110
 
111
  if (!array_key_exists($key, $this->cache)) {
112
+ try {
113
+ $service = ($this->factories[$key])($this);
114
+
115
+ if (array_key_exists($key, $this->extensions)) {
116
+ $service = ($this->extensions[$key])($this, $service);
117
+ }
118
+ } catch (ContainerException $exception) {
119
+ throw new ContainerException(
120
+ "Failed to create service \"${key}\". Reason: " . $exception->getMessage(),
121
+ null, $exception
122
+ );
123
  }
124
 
125
  $this->cache[$key] = apply_filters($this->filterPrefix . '/' . $key, $service);
core/Engine/Aggregation/MediaCollection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Engine\Aggregation;
4
+
5
+ class MediaCollection
6
+ {
7
+ const MEDIA = 'media';
8
+ const STORY = 'story';
9
+ }
core/Engine/Aggregation/MediaSorterProcessor.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Engine\Aggregation;
4
+
5
+ use RebelCode\Iris\Aggregation\ItemFeed;
6
+ use RebelCode\Iris\Aggregation\ItemProcessor;
7
+ use RebelCode\Iris\Item;
8
+ use RebelCode\Spotlight\Instagram\Engine\MediaItem;
9
+ use RebelCode\Spotlight\Instagram\Utils\Arrays;
10
+
11
+ /**
12
+ * Sorts media according to a feed's "Post order" option.
13
+ *
14
+ * @since 0.5
15
+ */
16
+ class MediaSorterProcessor implements ItemProcessor
17
+ {
18
+ /**
19
+ * @inheritDoc
20
+ *
21
+ * @since 0.5
22
+ */
23
+ public function process(array &$items, ItemFeed $feed)
24
+ {
25
+ $fOrder = $feed->getOption('postOrder');
26
+
27
+ switch ($fOrder) {
28
+ // Date sorting
29
+ case 'date_asc':
30
+ case 'date_desc':
31
+ {
32
+ $mult = ($fOrder === 'date_asc') ? 1 : -1;
33
+
34
+ usort($items, function (Item $a, Item $b) use ($mult) {
35
+ $t1 = $a->data[MediaItem::TIMESTAMP];
36
+ $t2 = $b->data[MediaItem::TIMESTAMP];
37
+
38
+ // If both have dates
39
+ if ($t1 !== null && $t2 !== null) {
40
+ return ($t1 <=> $t2) * $mult;
41
+ }
42
+
43
+ // If m2 has no date, consider it as more recent
44
+ if ($t1 !== null) {
45
+ return $mult;
46
+ }
47
+
48
+ // If m1 has no date, consider it as more recent
49
+ if ($t2 !== null) {
50
+ return -$mult;
51
+ }
52
+
53
+ // Neither have dates
54
+ return 0;
55
+ });
56
+
57
+ break;
58
+ }
59
+
60
+ // Popularity sorting
61
+ case 'popularity_asc':
62
+ case 'popularity_desc':
63
+ {
64
+ $mult = ($fOrder === 'popularity_asc') ? 1 : -1;
65
+
66
+ usort($items, function (Item $a, Item $b) use ($mult) {
67
+ $s1 = ($a->data[MediaItem::LIKES_COUNT] ?? 0) + ($a->data[MediaItem::COMMENTS_COUNT] ?? 0);
68
+ $s2 = ($b->data[MediaItem::LIKES_COUNT] ?? 0) + ($b->data[MediaItem::COMMENTS_COUNT] ?? 0);
69
+
70
+ return ($s1 <=> $s2) * $mult;
71
+ });
72
+
73
+ break;
74
+ }
75
+
76
+ // Random order
77
+ case 'random':
78
+ {
79
+ $items = Arrays::shuffle($items);
80
+
81
+ break;
82
+ }
83
+ }
84
+ }
85
+ }
core/Engine/Aggregation/MediaStorySegregator.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Engine\Aggregation;
4
+
5
+ use RebelCode\Iris\Aggregation\ItemFeed;
6
+ use RebelCode\Iris\Aggregation\ItemSegregator;
7
+ use RebelCode\Iris\Item;
8
+
9
+ /**
10
+ * Segregates Instagram media and stories into separate collections.
11
+ *
12
+ * @since 0.5
13
+ */
14
+ class MediaStorySegregator implements ItemSegregator
15
+ {
16
+ /**
17
+ * @inheritDoc
18
+ *
19
+ * @since 0.5
20
+ */
21
+ public function segregate(Item $item, ItemFeed $feed) : ?string
22
+ {
23
+ return ($item->data['is_story'] ?? false)
24
+ ? MediaCollection::STORY
25
+ : MediaCollection::MEDIA;
26
+ }
27
+ }
core/Engine/Aggregation/MediaTransformer.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Engine\Aggregation;
4
+
5
+ use RebelCode\Iris\Aggregation\ItemAggregator;
6
+ use RebelCode\Iris\Aggregation\ItemFeed;
7
+ use RebelCode\Iris\Aggregation\ItemTransformer;
8
+ use RebelCode\Iris\Item;
9
+ use RebelCode\Spotlight\Instagram\Engine\MediaChild;
10
+ use RebelCode\Spotlight\Instagram\Engine\MediaComment;
11
+ use RebelCode\Spotlight\Instagram\Engine\MediaItem;
12
+
13
+ /**
14
+ * Transforms items into media data arrays.
15
+ *
16
+ * This is used to transform the results from an {@link ItemAggregator} and prepares the items to be in the correct
17
+ * format for REST API responses.
18
+ *
19
+ * @since 0.5
20
+ */
21
+ class MediaTransformer implements ItemTransformer
22
+ {
23
+ /**
24
+ * @inheritDoc
25
+ *
26
+ * @since 0.5
27
+ */
28
+ public function transform(Item $item, ItemFeed $feed)
29
+ {
30
+ $children = $item->data['children'] ?? [];
31
+ foreach ($children as $idx => $child) {
32
+ $children[$idx] = [
33
+ 'id' => $child[MediaChild::MEDIA_ID],
34
+ 'type' => $child[MediaChild::MEDIA_TYPE],
35
+ 'url' => $child[MediaChild::MEDIA_URL],
36
+ 'permalink' => $child[MediaChild::PERMALINK],
37
+ ];
38
+ }
39
+
40
+ $comments = $item->data['comments'] ?? [];
41
+ foreach ($comments as $idx => $comment) {
42
+ $comments[$idx] = [
43
+ 'id' => $comment[MediaComment::ID],
44
+ 'username' => $comment[MediaComment::USERNAME],
45
+ 'text' => $comment[MediaComment::TEXT],
46
+ 'timestamp' => $comment[MediaComment::TIMESTAMP],
47
+ 'likeCount' => $comment[MediaComment::LIKES_COUNT],
48
+ ];
49
+ }
50
+
51
+ return [
52
+ 'id' => $item->data[MediaItem::MEDIA_ID],
53
+ 'username' => $item->data[MediaItem::USERNAME],
54
+ 'caption' => $item->data[MediaItem::CAPTION],
55
+ 'timestamp' => $item->data[MediaItem::TIMESTAMP],
56
+ 'type' => $item->data[MediaItem::MEDIA_TYPE],
57
+ 'url' => $item->data[MediaItem::MEDIA_URL],
58
+ 'permalink' => $item->data[MediaItem::PERMALINK],
59
+ 'thumbnail' => $item->data[MediaItem::THUMBNAIL_URL],
60
+ 'thumbnails' => $item->data[MediaItem::THUMBNAILS],
61
+ 'likesCount' => $item->data[MediaItem::LIKES_COUNT],
62
+ 'commentsCount' => $item->data[MediaItem::COMMENTS_COUNT],
63
+ 'comments' => $comments,
64
+ 'children' => $children,
65
+ 'source' => [
66
+ 'type' => $item->source->type,
67
+ 'name' => $item->source->data['name'],
68
+ ],
69
+ ];
70
+ }
71
+ }
core/Engine/MediaChild.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Engine;
4
+
5
+ class MediaChild
6
+ {
7
+ const MEDIA_ID = 'id';
8
+ const MEDIA_TYPE = MediaItem::MEDIA_TYPE;
9
+ const MEDIA_URL = MediaItem::MEDIA_URL;
10
+ const PERMALINK = MediaItem::PERMALINK;
11
+ }
core/Engine/MediaComment.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Engine;
4
+
5
+ class MediaComment
6
+ {
7
+ const ID = 'id';
8
+ const USERNAME = 'username';
9
+ const TEXT = 'text';
10
+ const TIMESTAMP = 'timestamp';
11
+ const LIKES_COUNT = 'like_count';
12
+ }
core/Engine/MediaItem.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Engine;
4
+
5
+ class MediaItem
6
+ {
7
+ // FROM INSTAGRAM API
8
+ // -----------------------
9
+ const MEDIA_ID = 'media_id';
10
+ const CAPTION = 'caption';
11
+ const USERNAME = 'username';
12
+ const TIMESTAMP = 'timestamp';
13
+ const MEDIA_TYPE = 'media_type';
14
+ const MEDIA_URL = 'media_url';
15
+ const PERMALINK = 'permalink';
16
+ const THUMBNAIL_URL = 'thumbnail_url';
17
+ const LIKES_COUNT = 'like_count';
18
+ const COMMENTS_COUNT = 'comments_count';
19
+ const COMMENTS = 'comments';
20
+ const CHILDREN = 'children';
21
+ // CUSTOM FIELDS
22
+ // -----------------------
23
+ const POST = 'post';
24
+ const IS_STORY = 'is_story';
25
+ const LAST_REQUESTED = 'last_requested';
26
+ const THUMBNAILS = 'thumbnails';
27
+ const SOURCE_TYPE = 'source_type';
28
+ const SOURCE_NAME = 'source_name';
29
+ }
core/Engine/Providers/IgAccountMediaProvider.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Engine\Providers;
4
+
5
+ use GuzzleHttp\ClientInterface;
6
+ use RebelCode\Iris\Fetching\ItemProvider;
7
+ use RebelCode\Iris\Result;
8
+ use RebelCode\Iris\Source;
9
+ use RebelCode\Spotlight\Instagram\Engine\Sources\UserSource;
10
+ use RebelCode\Spotlight\Instagram\IgApi\IgApiUtils;
11
+ use RebelCode\Spotlight\Instagram\PostTypes\AccountPostType;
12
+ use RebelCode\Spotlight\Instagram\Wp\PostType;
13
+
14
+ /**
15
+ * Provides Instagram media that belongs to an Instagram account.
16
+ *
17
+ * @since 0.5
18
+ */
19
+ class IgAccountMediaProvider implements ItemProvider
20
+ {
21
+ const DEFAULT_LIMIT = 50;
22
+
23
+ /**
24
+ * The API client.
25
+ *
26
+ * @since 0.5
27
+ *
28
+ * @var ClientInterface
29
+ */
30
+ protected $client;
31
+
32
+ /**
33
+ * @since 0.5
34
+ *
35
+ * @var PostType
36
+ */
37
+ protected $accounts;
38
+
39
+ /**
40
+ * @since 0.5
41
+ *
42
+ * @var bool
43
+ */
44
+ protected $isBusiness;
45
+
46
+ /**
47
+ * Constructor.
48
+ *
49
+ * @since 0.5
50
+ *
51
+ * @param ClientInterface $client The HTTP client.
52
+ * @param PostType $accounts The accounts post type.
53
+ * @param bool $isBusiness Whether or not to provide posts for business accounts using the Graph API.
54
+ */
55
+ public function __construct(ClientInterface $client, PostType $accounts, bool $isBusiness)
56
+ {
57
+ $this->client = $client;
58
+ $this->accounts = $accounts;
59
+ $this->isBusiness = $isBusiness;
60
+ }
61
+
62
+ /**
63
+ * Static constructor for personal accounts.
64
+ *
65
+ * @since 0.5
66
+ *
67
+ * @param ClientInterface $client The HTTP client.
68
+ * @param PostType $accounts The accounts post type.
69
+ *
70
+ * @return self
71
+ */
72
+ public static function forPersonalAccount(ClientInterface $client, PostType $accounts)
73
+ {
74
+ return new self($client, $accounts, false);
75
+ }
76
+
77
+ /**
78
+ * Static constructor for business accounts.
79
+ *
80
+ * @since 0.5
81
+ *
82
+ * @param ClientInterface $client The HTTP client.
83
+ * @param PostType $accounts The accounts post type.
84
+ *
85
+ * @return self
86
+ */
87
+ public static function forBusinessAccount(ClientInterface $client, PostType $accounts)
88
+ {
89
+ return new self($client, $accounts, true);
90
+ }
91
+
92
+ /**
93
+ * @inheritDoc
94
+ *
95
+ * @since 0.5
96
+ */
97
+ public function getItems(Source $source, ?int $limit = null, int $offset = 0) : Result
98
+ {
99
+ $username = $source->data['name'] ?? null;
100
+ $expectedType = $this->isBusiness ? UserSource::TYPE_BUSINESS : UserSource::TYPE_PERSONAL;
101
+
102
+ if ($source->type !== $expectedType || empty($username)) {
103
+ return Result::empty();
104
+ }
105
+
106
+ $account = AccountPostType::getByUsername($this->accounts, $username);
107
+ if ($account === null) {
108
+ return Result::error("Account \"{$username}\" does not exist on this site");
109
+ }
110
+
111
+ $userId = $account->user->id;
112
+ $accessToken = $account->accessToken;
113
+
114
+ $limit = $limit ?? static::DEFAULT_LIMIT;
115
+ $baseUrl = $this->isBusiness ? IgProvider::GRAPH_API_URL : IgProvider::BASIC_API_URL;
116
+
117
+ return IgProvider::request($this->client, $source, "{$baseUrl}/{$userId}/media", [
118
+ 'limit' => $limit,
119
+ 'offset' => $offset,
120
+ 'access_token' => $accessToken->code,
121
+ 'fields' => implode(',', IgApiUtils::getMediaFields($this->isBusiness)),
122
+ ]);
123
+ }
124
+ }
core/Engine/Providers/IgProvider.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Engine\Providers;
4
+
5
+ use Exception;
6
+ use GuzzleHttp\ClientInterface;
7
+ use GuzzleHttp\Psr7\Uri;
8
+ use RebelCode\Iris\Item;
9
+ use RebelCode\Iris\Result;
10
+ use RebelCode\Iris\Source;
11
+ use RebelCode\Spotlight\Instagram\IgApi\IgApiUtils;
12
+ use RebelCode\Spotlight\Instagram\Utils\Arrays;
13
+
14
+ class IgProvider
15
+ {
16
+ const BASIC_API_URL = 'https://graph.instagram.com';
17
+ const GRAPH_API_URL = 'https://graph.facebook.com';
18
+
19
+ public static function request(
20
+ ClientInterface $client,
21
+ Source $source,
22
+ string $url,
23
+ array $query = [],
24
+ bool $setNext = true
25
+ ) {
26
+ try {
27
+ $uri = new Uri($url);
28
+ parse_str($uri->getQuery(), $prevQuery);
29
+
30
+ $newQuery = array_merge($prevQuery, $query);
31
+ $newQuery = http_build_query($newQuery, null, '&', PHP_QUERY_RFC3986);
32
+
33
+ $response = IgApiUtils::request($client, 'GET', (string) $uri->withQuery($newQuery));
34
+ $body = IgApiUtils::parseResponse($response);
35
+ } catch (Exception $exception) {
36
+ return Result::error($exception->getCode(), $exception->getCode());
37
+ }
38
+
39
+ return static::createResult($client, $source, $body, $setNext);
40
+ }
41
+
42
+ public static function createResult(ClientInterface $client, Source $source, array $body, bool $setNext = true)
43
+ {
44
+ $data = $body['data'] ?? [];
45
+ $items = Arrays::map($data, function (array $data) use ($source) {
46
+ return Item::create($data['id'], $source, $data);
47
+ });
48
+
49
+ $result = Result::success($items);
50
+ $result->data['paging'] = $body['paging'] ?? [];
51
+
52
+ $next = $body['paging']['next'] ?? null;
53
+
54
+ if (!empty($next) && $setNext) {
55
+ $result->next = function () use ($client, $source, $next) {
56
+ return static::request($client, $source, $next);
57
+ };
58
+ }
59
+
60
+ return $result;
61
+ }
62
+ }
core/Engine/Sources/HashtagSource.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Engine\Sources;
4
+
5
+ use RebelCode\Iris\Source;
6
+ use RebelCode\Spotlight\Instagram\Pro\Engine\Providers\IgHashtagMediaProvider;
7
+
8
+ /**
9
+ * Source for posts from a hashtag.
10
+ *
11
+ * @since 0.5
12
+ */
13
+ class HashtagSource
14
+ {
15
+ const TYPE_RECENT = 'RECENT_HASHTAG';
16
+ const TYPE_POPULAR = 'POPULAR_HASHTAG';
17
+
18
+ /**
19
+ * Creates a source for a hashtag.
20
+ *
21
+ * @since 0.5
22
+ *
23
+ * @param string $tag The hashtag.
24
+ * @param string $type The hashtag media type.
25
+ *
26
+ * @return Source The created source instance.
27
+ */
28
+ public static function create(string $tag, string $type) : Source
29
+ {
30
+ $srcType = ($type === 'recent' || $type === static::TYPE_RECENT || $type === IgHashtagMediaProvider::RECENT_MEDIA)
31
+ ? static::TYPE_RECENT
32
+ : static::TYPE_POPULAR;
33
+
34
+ return Source::auto($srcType, ['name' => $tag]);
35
+ }
36
+ }
core/Engine/Sources/StorySource.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Engine\Sources;
4
+
5
+ use RebelCode\Iris\Source;
6
+ use RebelCode\Spotlight\Instagram\IgApi\IgUser;
7
+
8
+ /**
9
+ * Source for story posts from a user.
10
+ *
11
+ * @since 0.5
12
+ */
13
+ class StorySource
14
+ {
15
+ const TYPE = 'USER_STORY';
16
+
17
+ /**
18
+ * Creates a source for a user's story.
19
+ *
20
+ * @since 0.5
21
+ *
22
+ * @param IgUser $user The user instance.
23
+ *
24
+ * @return Source The created source instance.
25
+ */
26
+ public static function create(IgUser $user) : Source
27
+ {
28
+ return Source::auto(static::TYPE, ['name' => $user->username]);
29
+ }
30
+ }
core/Engine/Sources/TaggedUserSource.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Engine\Sources;
4
+
5
+ use RebelCode\Iris\Source;
6
+
7
+ /**
8
+ * Source for posts where a user is tagged.
9
+ *
10
+ * @since 0.5
11
+ */
12
+ class TaggedUserSource
13
+ {
14
+ const TYPE = 'TAGGED_ACCOUNT';
15
+
16
+ /**
17
+ * Creates a source for a tagged user.
18
+ *
19
+ * @since 0.5
20
+ *
21
+ * @param string $username The username of the tagged user.
22
+ *
23
+ * @return Source The created source instance.
24
+ */
25
+ public static function create(string $username) : Source
26
+ {
27
+ return Source::auto(static::TYPE, ['name' => $username]);
28
+ }
29
+ }
core/Engine/Sources/UserSource.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Engine\Sources;
4
+
5
+ use RebelCode\Iris\Source;
6
+ use RebelCode\Spotlight\Instagram\IgApi\IgUser;
7
+
8
+ /**
9
+ * Source for posts posted by a user.
10
+ *
11
+ * @since 0.5
12
+ */
13
+ class UserSource
14
+ {
15
+ const TYPE_PERSONAL = 'PERSONAL_ACCOUNT';
16
+ const TYPE_BUSINESS = 'BUSINESS_ACCOUNT';
17
+
18
+ /**
19
+ * Creates a media source for a user.
20
+ *
21
+ * @since 0.5
22
+ *
23
+ * @param string $username The username.
24
+ * @param string $userType The user type.
25
+ *
26
+ * @return Source The created source instance.
27
+ */
28
+ public static function create(string $username, string $userType) : Source
29
+ {
30
+ $type = ($userType === IgUser::TYPE_PERSONAL)
31
+ ? static::TYPE_PERSONAL
32
+ : static::TYPE_BUSINESS;
33
+
34
+ return Source::auto($type, ['name' => $username]);
35
+ }
36
+ }
core/Engine/Stores/WpPostMediaStore.php ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Engine\Stores;
4
+
5
+ use RebelCode\Iris\Error;
6
+ use RebelCode\Iris\Importing\ItemStore;
7
+ use RebelCode\Iris\Item;
8
+ use RebelCode\Iris\Result;
9
+ use RebelCode\Iris\Source;
10
+ use RebelCode\Spotlight\Instagram\Engine\MediaChild;
11
+ use RebelCode\Spotlight\Instagram\Engine\MediaItem;
12
+ use RebelCode\Spotlight\Instagram\Engine\Sources\UserSource;
13
+ use RebelCode\Spotlight\Instagram\IgApi\IgMedia;
14
+ use RebelCode\Spotlight\Instagram\MediaStore\Processors\MediaDownloader;
15
+ use RebelCode\Spotlight\Instagram\PostTypes\MediaPostType;
16
+ use RebelCode\Spotlight\Instagram\Utils\Arrays;
17
+ use RebelCode\Spotlight\Instagram\Wp\PostType;
18
+ use WP_Post;
19
+
20
+ /**
21
+ * The item store for storing Instagram media as WordPress posts.
22
+ *
23
+ * @since 0.5
24
+ */
25
+ class WpPostMediaStore implements ItemStore
26
+ {
27
+ /**
28
+ * The media post type.
29
+ *
30
+ * @since 0.5
31
+ *
32
+ * @var PostType
33
+ */
34
+ protected $postType;
35
+
36
+ /**
37
+ * Constructor.
38
+ *
39
+ * @since 0.5
40
+ *
41
+ * @param PostType $postType The media post type.
42
+ */
43
+ public function __construct(PostType $postType)
44
+ {
45
+ $this->postType = $postType;
46
+ }
47
+
48
+ /**
49
+ * @inheritDoc
50
+ *
51
+ * @since 0.5
52
+ */
53
+ public function store(array $items) : Result
54
+ {
55
+ $result = Result::empty();
56
+
57
+ $numItems = count($items);
58
+ if ($numItems === 0) {
59
+ return $result;
60
+ }
61
+
62
+ $existing = $this->getExistingItems($items);
63
+
64
+ foreach ($items as $item) {
65
+ // If the item does not exist, import it
66
+ if (!array_key_exists($item->id, $existing)) {
67
+ // Store the item
68
+ $item = $this->add($item);
69
+
70
+ if ($item instanceof Error) {
71
+ $result->errors[] = $item;
72
+ } else {
73
+ $result->items[] = $item;
74
+ $existing[$item->id] = true;
75
+ }
76
+ } else {
77
+ $post = $this->postType->get($existing[$item->id]);
78
+
79
+ if ($post !== null) {
80
+ $postData = ['meta_input' => []];
81
+
82
+ // If the item is a video and has no thumbnail, re-download and regenerate the thumbnails
83
+ if ($item->data[MediaItem::MEDIA_TYPE] === "VIDEO" &&
84
+ $post->{MediaPostType::TYPE} === "VIDEO" &&
85
+ empty($post->{MediaPostType::THUMBNAIL_URL})
86
+ ) {
87
+ $item = MediaDownloader::downloadItemFiles($item);
88
+ $postData = static::itemToPostData($item);
89
+ }
90
+
91
+ // If the existing item and the current item are the same account, but one is from a personal
92
+ // account and one is from a business account, update the existing post with the new item's source
93
+ $currSrcType = $post->{MediaPostType::SOURCE_TYPE};
94
+ $currSrcName = $post->{MediaPostType::SOURCE_NAME};
95
+ $newSrcType = $item->source->type;
96
+ $newSrcName = $item->source->data['name'] ?? '';
97
+
98
+ if (($currSrcType === UserSource::TYPE_PERSONAL || $currSrcType === UserSource::TYPE_BUSINESS) &&
99
+ ($newSrcType === UserSource::TYPE_PERSONAL || $newSrcType === UserSource::TYPE_BUSINESS) &&
100
+ $currSrcType !== $newSrcType && $currSrcName === $newSrcName
101
+ ) {
102
+ $postData['meta_input'][MediaPostType::SOURCE_TYPE] = $item->source->type;
103
+ $postData['meta_input'][MediaPostType::SOURCE_NAME] = $item->source->data['name'] ?? '';
104
+ }
105
+
106
+ $this->postType->update($post->ID, $postData);
107
+ }
108
+ }
109
+ }
110
+
111
+ // Report success if the number of errors is less than the number of items
112
+ $result->success = count($result->errors) < $numItems;
113
+
114
+ return $result;
115
+ }
116
+
117
+ /**
118
+ * @inheritDoc
119
+ *
120
+ * @since 0.5
121
+ */
122
+ public function getItems(Source $source, ?int $limit = null, int $offset = 0) : Result
123
+ {
124
+ $posts = $this->postType->query([
125
+ 'posts_per_page' => empty($limit) ? -1 : $limit,
126
+ 'offset' => $offset,
127
+ 'meta_query' => [
128
+ 'relation' => 'AND',
129
+ [
130
+ 'key' => MediaPostType::SOURCE_TYPE,
131
+ 'value' => $source->type,
132
+ ],
133
+ [
134
+ 'key' => MediaPostType::SOURCE_NAME,
135
+ 'value' => $source->data['name'] ?? '',
136
+ ],
137
+ ],
138
+ ]);
139
+
140
+ $items = Arrays::map($posts, function (WP_Post $post) use ($source) {
141
+ return static::wpPostToItem($post, $source);
142
+ });
143
+
144
+ return Result::success($items);
145
+ }
146
+
147
+ /**
148
+ * Adds a single item to the store.
149
+ *
150
+ * @since 0.5
151
+ *
152
+ * @param Item $item The item to add to the store.
153
+ *
154
+ * @return Item|Error The stored item on success, or an error on failure.
155
+ */
156
+ public function add(Item $item)
157
+ {
158
+ set_time_limit(30);
159
+
160
+ // Download the files and get the updated item
161
+ $item = MediaDownloader::downloadItemFiles($item);
162
+
163
+ $postData = static::itemToPostData($item);
164
+ $postId = $this->postType->insert($postData);
165
+
166
+ // If failed to insert the post into the DB
167
+ if (is_wp_error($postId)) {
168
+ // Delete all created thumbnail files
169
+ foreach (MediaDownloader::getAllThumbnails($item->id) as $file) {
170
+ if (file_exists($file)) {
171
+ @unlink($file);
172
+ }
173
+ }
174
+
175
+ return new Error('Failed to insert post for item #' . $item->id);
176
+ } else {
177
+ return static::wpPostToItem(get_post($postId), $item->source);
178
+ }
179
+ }
180
+
181
+ /**
182
+ * Checks which items in a given list already exist in the database and returns them.
183
+ *
184
+ * @since 0.5
185
+ *
186
+ * @param Item[] $items The media list to check.
187
+ *
188
+ * @return array A mapping of media IDs to post IDs
189
+ */
190
+ public function getExistingItems(array $items) : array
191
+ {
192
+ global $wpdb;
193
+
194
+ if (empty($items)) {
195
+ return [];
196
+ }
197
+
198
+ $mediaIds = Arrays::join($items, ',', function (Item $item) {
199
+ return $item->id;
200
+ });
201
+
202
+ $table = $wpdb->prefix . 'postmeta';
203
+ $query = sprintf(
204
+ "SELECT meta_value, post_id FROM %s WHERE meta_key = '%s' AND meta_value IN (%s)",
205
+ $table,
206
+ MediaPostType::MEDIA_ID,
207
+ $mediaIds
208
+ );
209
+
210
+ $results = $wpdb->get_results($query, 'ARRAY_N');
211
+
212
+ // Each value in $results is a tuple of the media ID and post ID
213
+ // The below creates an associative array using each tuple as the key->value pair
214
+ return Arrays::createMap($results, function ($pair) {
215
+ return $pair;
216
+ });
217
+ }
218
+
219
+ /**
220
+ * Transforms an item into WordPress post data.
221
+ *
222
+ * @since 0.5
223
+ *
224
+ * @param Item $item The item instance.
225
+ *
226
+ * @return array The WordPress post data for the given item.
227
+ */
228
+ public static function itemToPostData(Item $item)
229
+ {
230
+ return [
231
+ 'post_title' => $item->data[MediaItem::CAPTION] ?? '',
232
+ 'post_status' => 'publish',
233
+ 'meta_input' => [
234
+ MediaPostType::MEDIA_ID => $item->id,
235
+ MediaPostType::USERNAME => $item->data[MediaItem::USERNAME] ?? '',
236
+ MediaPostType::TIMESTAMP => $item->data[MediaItem::TIMESTAMP] ?? null,
237
+ MediaPostType::CAPTION => $item->data[MediaItem::CAPTION] ?? '',
238
+ MediaPostType::TYPE => $item->data[MediaItem::MEDIA_TYPE] ?? '',
239
+ MediaPostType::URL => $item->data[MediaItem::MEDIA_URL] ?? '',
240
+ MediaPostType::PERMALINK => $item->data[MediaItem::PERMALINK] ?? '',
241
+ MediaPostType::THUMBNAIL_URL => $item->data[MediaItem::THUMBNAIL_URL] ?? '',
242
+ MediaPostType::THUMBNAILS => $item->data[MediaItem::THUMBNAILS] ?? [],
243
+ MediaPostType::LIKES_COUNT => $item->data[MediaItem::LIKES_COUNT] ?? 0,
244
+ MediaPostType::COMMENTS_COUNT => $item->data[MediaItem::COMMENTS_COUNT] ?? 0,
245
+ MediaPostType::COMMENTS => $item->data[MediaItem::COMMENTS]['data'] ?? [],
246
+ MediaPostType::CHILDREN => $item->data[MediaItem::CHILDREN]['data'] ?? [],
247
+ MediaPostType::IS_STORY => $item->data[MediaItem::IS_STORY] ?? false,
248
+ MediaPostType::LAST_REQUESTED => time(),
249
+ MediaPostType::SOURCE_TYPE => $item->source->type,
250
+ MediaPostType::SOURCE_NAME => $item->source->data['name'] ?? '',
251
+ ],
252
+ ];
253
+ }
254
+
255
+ /**
256
+ * Transforms a WordPress post into an item.
257
+ *
258
+ * @since 0.5
259
+ *
260
+ * @param WP_Post $post The post.
261
+ * @param Source $source
262
+ *
263
+ * @return Item The WordPress post data for the given item.
264
+ */
265
+ public static function wpPostToItem(WP_Post $post, Source $source) : Item
266
+ {
267
+ $children = $post->{MediaPostType::CHILDREN};
268
+ $children = Arrays::map($children, function ($child) {
269
+ return ($child instanceof IgMedia)
270
+ ? [
271
+ MediaChild::MEDIA_ID => $child->id,
272
+ MediaChild::MEDIA_TYPE => $child->type,
273
+ MediaChild::PERMALINK => $child->permalink,
274
+ MediaChild::MEDIA_URL => $child->url,
275
+ ]
276
+ : (array) $child;
277
+ });
278
+
279
+ return Item::create($post->ID, $source, [
280
+ MediaItem::MEDIA_ID => $post->{MediaPostType::MEDIA_ID},
281
+ MediaItem::CAPTION => $post->{MediaPostType::CAPTION},
282
+ MediaItem::USERNAME => $post->{MediaPostType::USERNAME},
283
+ MediaItem::TIMESTAMP => $post->{MediaPostType::TIMESTAMP},
284
+ MediaItem::MEDIA_TYPE => $post->{MediaPostType::TYPE},
285
+ MediaItem::MEDIA_URL => $post->{MediaPostType::URL},
286
+ MediaItem::PERMALINK => $post->{MediaPostType::PERMALINK},
287
+ MediaItem::THUMBNAIL_URL => $post->{MediaPostType::THUMBNAIL_URL},
288
+ MediaItem::THUMBNAILS => $post->{MediaPostType::THUMBNAILS},
289
+ MediaItem::LIKES_COUNT => $post->{MediaPostType::LIKES_COUNT},
290
+ MediaItem::COMMENTS_COUNT => $post->{MediaPostType::COMMENTS_COUNT},
291
+ MediaItem::COMMENTS => $post->{MediaPostType::COMMENTS},
292
+ MediaItem::CHILDREN => $children,
293
+ MediaItem::IS_STORY => boolval($post->{MediaPostType::IS_STORY}),
294
+ MediaItem::LAST_REQUESTED => $post->{MediaPostType::LAST_REQUESTED},
295
+ MediaItem::SOURCE_NAME => $post->{MediaPostType::SOURCE_NAME},
296
+ MediaItem::SOURCE_TYPE => $post->{MediaPostType::SOURCE_TYPE},
297
+ MediaItem::POST => $post->ID,
298
+ ]);
299
+ }
300
+
301
+ /**
302
+ * Updates the last requested time for a list of media objects.
303
+ *
304
+ * @since 0.5
305
+ *
306
+ * @param Item[] $items The list of items.
307
+ */
308
+ public static function updateLastRequestedTime(array $items)
309
+ {
310
+ if (count($items) === 0) {
311
+ return;
312
+ }
313
+
314
+ global $wpdb;
315
+
316
+ $postIds = Arrays::join($items, ',', function (Item $item) {
317
+ return '\'' . $item->data[MediaItem::POST] . '\'';
318
+ });
319
+
320
+ $table = $wpdb->prefix . 'postmeta';
321
+ $query = sprintf(
322
+ "UPDATE %s SET meta_value = '%s' WHERE meta_key = '%s' AND post_id IN (%s)",
323
+ $table,
324
+ time(),
325
+ MediaPostType::LAST_REQUESTED,
326
+ $postIds
327
+ );
328
+
329
+ $wpdb->query($query);
330
+ }
331
+ }
core/Feeds/FeedManager.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Feeds;
4
+
5
+ use RebelCode\Iris\Aggregation\ItemFeed;
6
+ use RebelCode\Iris\Source;
7
+ use RebelCode\Spotlight\Instagram\Engine\Sources\HashtagSource;
8
+ use RebelCode\Spotlight\Instagram\Engine\Sources\TaggedUserSource;
9
+ use RebelCode\Spotlight\Instagram\Engine\Sources\UserSource;
10
+ use RebelCode\Spotlight\Instagram\PostTypes\AccountPostType;
11
+ use RebelCode\Spotlight\Instagram\PostTypes\FeedPostType;
12
+ use RebelCode\Spotlight\Instagram\Utils\Arrays;
13
+ use RebelCode\Spotlight\Instagram\Wp\PostType;
14
+ use WP_Post;
15
+
16
+ /**
17
+ * A manager for feeds (not WordPress Posts, but {@link ItemFeed} instances).
18
+ *
19
+ * @since 0.5
20
+ */
21
+ class FeedManager
22
+ {
23
+ /**
24
+ * @since 0.5
25
+ *
26
+ * @var PostType
27
+ */
28
+ public $feeds;
29
+
30
+ /**
31
+ * @since 0.5
32
+ *
33
+ * @var PostType
34
+ */
35
+ public $accounts;
36
+
37
+ /**
38
+ * Constructor.
39
+ *
40
+ * @since 0.5
41
+ *
42
+ * @param PostType $feeds
43
+ * @param PostType $accounts
44
+ */
45
+ public function __construct(PostType $feeds, PostType $accounts)
46
+ {
47
+ $this->feeds = $feeds;
48
+ $this->accounts = $accounts;
49
+ }
50
+
51
+ /**
52
+ * Gets the item feed for a post by ID.
53
+ *
54
+ * @since 0.5
55
+ *
56
+ * @param string|int $id The ID.
57
+ *
58
+ * @return ItemFeed|null The item feed, or null if the ID does not correspond to a post.
59
+ */
60
+ public function get($id)
61
+ {
62
+ return $this->wpPostToFeed($this->feeds->get($id));
63
+ }
64
+
65
+ /**
66
+ * Queries the feeds.
67
+ *
68
+ * @since 0.5
69
+ *
70
+ * @param array $query The WP_Query args.
71
+ * @param int|null $num The number of feeds to retrieve.
72
+ * @param int $page The result page number.
73
+ *
74
+ * @return ItemFeed[] A list of feeds.
75
+ */
76
+ public function query($query = [], $num = null, $page = 1)
77
+ {
78
+ return Arrays::map($this->feeds->query($query, $num, $page), [$this, 'wpPostToFeed']);
79
+ }
80
+
81
+ /**
82
+ * Retrieves the sources to use for a given set of feed options.
83
+ *
84
+ * @since 0.5
85
+ *
86
+ * @param array $options The feed options.
87
+ *
88
+ * @return Source[] A list of item sources.
89
+ */
90
+ public function getSources(array $options)
91
+ {
92
+ $sources = [];
93
+
94
+ foreach ($options['accounts'] ?? [] as $id) {
95
+ $post = $this->accounts->get($id);
96
+
97
+ if ($post !== null) {
98
+ $sources[] = UserSource::create($post->{AccountPostType::USERNAME}, $post->{AccountPostType::TYPE});
99
+ }
100
+ }
101
+
102
+ foreach ($options['tagged'] ?? [] as $id) {
103
+ $post = $this->accounts->get($id);
104
+
105
+ if ($post !== null) {
106
+ $sources[] = TaggedUserSource::create($post->{AccountPostType::USERNAME});
107
+ }
108
+ }
109
+
110
+ foreach ($options['hashtags'] ?? [] as $hashtag) {
111
+ $tag = $hashtag['tag'] ?? '';
112
+
113
+ if (!empty($tag)) {
114
+ $sources[] = HashtagSource::create($tag, $hashtag['sort'] ?? HashtagSource::TYPE_POPULAR);
115
+ }
116
+ }
117
+
118
+ return $sources;
119
+ }
120
+
121
+ /**
122
+ * Creates an {@link ItemFeed} from a set of feed options.
123
+ *
124
+ * @since 0.5
125
+ *
126
+ * @param array $options The feed options.
127
+ *
128
+ * @return ItemFeed The created feed.
129
+ */
130
+ public function createFeed(array $options)
131
+ {
132
+ return new ItemFeed($this->getSources($options), $options);
133
+ }
134
+
135
+ /**
136
+ * Converts a WordPress post into an {@link ItemFeed}.
137
+ *
138
+ * @since 0.5
139
+ *
140
+ * @param WP_Post|null $post The WordPress post.
141
+ *
142
+ * @return ItemFeed|null The created feed or null if the post is null.
143
+ */
144
+ public function wpPostToFeed(?WP_Post $post)
145
+ {
146
+ if ($post === null) {
147
+ return null;
148
+ } else {
149
+ return $this->createFeed($post->{FeedPostType::OPTIONS});
150
+ }
151
+ }
152
+ }
core/Feeds/FeedTemplate.php CHANGED
@@ -54,18 +54,8 @@ class FeedTemplate implements TemplateInterface
54
  ob_start();
55
  ?>
56
  <div class="<?= $className ?>" data-feed-var="<?= $varName ?>"></div>
57
- <script type="text/javascript">
58
- if (!window.SliFrontCtx) {
59
- window.SliFrontCtx = {};
60
- }
61
-
62
- if (!window.SliAccountInfo) {
63
- window.SliAccountInfo = {};
64
- }
65
-
66
- window.SliFrontCtx["<?= $varName ?>"] = <?= $feedJson ?>;
67
- window.SliAccountInfo["<?= $varName ?>"] = <?= $accountsJson ?>;
68
- </script>
69
  <?php
70
 
71
  // Trigger the action that will enqueue the required JS bundles
54
  ob_start();
55
  ?>
56
  <div class="<?= $className ?>" data-feed-var="<?= $varName ?>"></div>
57
+ <meta name="sli__f__<?= $varName ?>" content="<?= esc_attr($feedJson) ?>" />
58
+ <meta name="sli__a__<?= $varName ?>" content="<?= esc_attr($accountsJson) ?>" />
 
 
 
 
 
 
 
 
 
 
59
  <?php
60
 
61
  // Trigger the action that will enqueue the required JS bundles
core/IgApi/IgApiClient.php CHANGED
@@ -89,14 +89,13 @@ class IgApiClient
89
  *
90
  * @param IgAccount $account The account for which to retrieve media.
91
  *
92
- * @return IgMedia[] A list of media objects.
 
93
  */
94
  public function getAccountMedia(IgAccount $account)
95
  {
96
- if ($account->user->type === IgUser::TYPE_PERSONAL) {
97
- return $this->basicApi->getMedia($account->user->id, $account->accessToken);
98
- }
99
-
100
- return $this->graphApi->getMedia($account->user->id, $account->accessToken);
101
  }
102
  }
89
  *
90
  * @param IgAccount $account The account for which to retrieve media.
91
  *
92
+ * @return array An array containing two keys, "media" and "next", which correspond to the media list and a function
93
+ * for retrieving the next batch of media or null if there are is more media to retrieve.
94
  */
95
  public function getAccountMedia(IgAccount $account)
96
  {
97
+ return ($account->user->type === IgUser::TYPE_PERSONAL)
98
+ ? $this->basicApi->getMedia($account->user->id, $account->accessToken)
99
+ : $this->graphApi->getMedia($account->user->id, $account->accessToken->code);
 
 
100
  }
101
  }
core/IgApi/IgApiUtils.php CHANGED
@@ -197,9 +197,12 @@ class IgApiUtils
197
  *
198
  * @since 0.1
199
  *
 
 
 
200
  * @return string[]
201
  */
202
- public static function getMediaFields() : array
203
  {
204
  $fields = [
205
  'id',
@@ -213,6 +216,14 @@ class IgApiUtils
213
  'permalink',
214
  ];
215
 
 
 
 
 
 
 
 
 
216
  $list = implode(',', static::getChildrenMediaFields());
217
  $fields[] = "children{{$list}}";
218
 
@@ -259,6 +270,7 @@ class IgApiUtils
259
  'media_url',
260
  'media_type',
261
  'permalink',
 
262
  ];
263
  }
264
 
197
  *
198
  * @since 0.1
199
  *
200
+ * @param bool $isBusiness True to get the fields for media from a business account, false to get fields for media
201
+ * from a personal account.
202
+ *
203
  * @return string[]
204
  */
205
+ public static function getMediaFields(bool $isBusiness = false, bool $isOwn = true) : array
206
  {
207
  $fields = [
208
  'id',
216
  'permalink',
217
  ];
218
 
219
+ if ($isOwn) {
220
+ $fields[] = 'thumbnail_url';
221
+ }
222
+
223
+ if ($isBusiness) {
224
+ $fields[] = "comments{id,username,text,timestamp,like_count}";
225
+ }
226
+
227
  $list = implode(',', static::getChildrenMediaFields());
228
  $fields[] = "children{{$list}}";
229
 
270
  'media_url',
271
  'media_type',
272
  'permalink',
273
+ 'thumbnail_url',
274
  ];
275
  }
276
 
core/IgApi/IgBasicApiClient.php CHANGED
@@ -127,27 +127,37 @@ class IgBasicApiClient
127
  *
128
  * @param string $userId The ID of the user whose media to fetch.
129
  * @param AccessToken $accessToken The access token.
 
130
  *
131
- * @return IgMedia[] A list of media objects.
 
132
  */
133
- public function getMedia($userId, AccessToken $accessToken) : array
134
  {
135
- $getRemote = function () use ($userId, $accessToken) {
136
  return IgApiUtils::request($this->client, 'GET', static::BASE_URL . "/{$userId}/media", [
137
  'query' => [
138
  'fields' => implode(',', IgApiUtils::getMediaFields()),
139
  'access_token' => $accessToken->code,
140
- 'limit' => 200,
141
  ],
142
  ]);
143
  };
144
 
145
  $body = IgApiUtils::getCachedResponse($this->cache, "media_p_{$userId}", $getRemote);
146
  $media = $body['data'];
 
147
 
148
- return array_map(function ($data) {
149
- return IgMedia::create($this->populateMissingMediaInfo($data));
150
- }, $media);
 
 
 
 
 
 
 
151
  }
152
 
153
  /**
127
  *
128
  * @param string $userId The ID of the user whose media to fetch.
129
  * @param AccessToken $accessToken The access token.
130
+ * @param int $limit The max number of media to fetch.
131
  *
132
+ * @return array An array containing two keys, "media" and "next", which correspond to the media list and a function
133
+ * for retrieving the next batch of media or null if there are is more media to retrieve.
134
  */
135
+ public function getMedia($userId, AccessToken $accessToken, int $limit = 200) : array
136
  {
137
+ $getRemote = function () use ($userId, $accessToken, $limit) {
138
  return IgApiUtils::request($this->client, 'GET', static::BASE_URL . "/{$userId}/media", [
139
  'query' => [
140
  'fields' => implode(',', IgApiUtils::getMediaFields()),
141
  'access_token' => $accessToken->code,
142
+ 'limit' => $limit,
143
  ],
144
  ]);
145
  };
146
 
147
  $body = IgApiUtils::getCachedResponse($this->cache, "media_p_{$userId}", $getRemote);
148
  $media = $body['data'];
149
+ $media = array_map([IgMedia::class, 'create'], $media);
150
 
151
+ $nextUrl = $body['paging']['next'] ?? null;
152
+ $next = ($nextUrl !== null)
153
+ ? function () use ($nextUrl, $userId, $accessToken) {
154
+ $response = IgApiUtils::request($this->client, 'GET', $nextUrl);
155
+
156
+ return IgApiUtils::parseResponse($response);
157
+ }
158
+ : null;
159
+
160
+ return compact('media', 'next');
161
  }
162
 
163
  /**
core/IgApi/IgGraphApiClient.php CHANGED
@@ -3,7 +3,6 @@
3
  namespace RebelCode\Spotlight\Instagram\IgApi;
4
 
5
  use GuzzleHttp\ClientInterface;
6
- use Psr\Http\Message\ResponseInterface;
7
  use Psr\SimpleCache\CacheInterface;
8
 
9
  class IgGraphApiClient
@@ -121,50 +120,60 @@ class IgGraphApiClient
121
  /**
122
  * @since 0.1
123
  *
124
- * @param string $userId
125
- * @param AccessToken $accessToken
126
  *
127
- * @return IgMedia[]
 
128
  */
129
- public function getMedia($userId, AccessToken $accessToken) : array
130
  {
131
  $getRemote = function () use ($userId, $accessToken) {
132
- $response = IgApiUtils::request($this->client, 'GET', static::API_URI . "/{$userId}/media", [
133
  'query' => [
134
- 'fields' => implode(',', IgApiUtils::getMediaFields()),
135
- 'access_token' => $accessToken->code,
136
- 'limit' => 50,
137
  ],
138
  ]);
139
-
140
- return $this->expandWithComments($response, $accessToken);
141
  };
142
 
143
  $body = IgApiUtils::getCachedResponse($this->cache, "media_b_{$userId}", $getRemote);
144
  $media = $body['data'];
145
  $media = !is_array($media) ? [] : $media;
 
 
 
 
 
 
 
 
146
 
147
- return array_map([IgMedia::class, 'create'], $media);
 
 
 
 
148
  }
149
 
150
  /**
151
  * @since 0.1
152
  *
153
- * @param ResponseInterface $response
154
- * @param AccessToken $accessToken
155
  *
156
  * @return IgMedia[]
157
  */
158
- protected function expandWithComments(ResponseInterface $response, AccessToken $accessToken) : array
159
  {
160
- $mediaList = IgApiUtils::parseResponse($response)['data'];
161
  $mediaIds = array_filter(array_column($mediaList, 'id'));
162
 
163
  $response = IgApiUtils::request($this->client, 'GET', static::API_URI . "/comments", [
164
  'query' => [
165
  'ids' => implode(',', $mediaIds),
166
  'fields' => implode(',', IgApiUtils::getCommentFields()),
167
- 'access_token' => $accessToken->code,
168
  ],
169
  ]);
170
 
@@ -180,8 +189,6 @@ class IgGraphApiClient
180
  $mediaList[$idx]['comments'] = $comments[$mediaId]['data'];
181
  }
182
 
183
- return [
184
- 'data' => $mediaList,
185
- ];
186
  }
187
  }
3
  namespace RebelCode\Spotlight\Instagram\IgApi;
4
 
5
  use GuzzleHttp\ClientInterface;
 
6
  use Psr\SimpleCache\CacheInterface;
7
 
8
  class IgGraphApiClient
120
  /**
121
  * @since 0.1
122
  *
123
+ * @param string $userId
124
+ * @param string $accessToken
125
  *
126
+ * @return array An array containing two keys, "media" and "next", which correspond to the media list and a function
127
+ * for retrieving the next batch of media or null if there are is more media to retrieve.
128
  */
129
+ public function getMedia(string $userId, string $accessToken) : array
130
  {
131
  $getRemote = function () use ($userId, $accessToken) {
132
+ return IgApiUtils::request($this->client, 'GET', static::API_URI . "/{$userId}/media", [
133
  'query' => [
134
+ 'fields' => implode(',', IgApiUtils::getMediaFields(true)),
135
+ 'access_token' => $accessToken,
136
+ 'limit' => 9,
137
  ],
138
  ]);
 
 
139
  };
140
 
141
  $body = IgApiUtils::getCachedResponse($this->cache, "media_b_{$userId}", $getRemote);
142
  $media = $body['data'];
143
  $media = !is_array($media) ? [] : $media;
144
+ $media = array_map([IgMedia::class, 'create'], $media);
145
+
146
+ $nextUrl = $body['paging']['next'] ?? null;
147
+ $next = ($nextUrl !== null)
148
+ ? function () use ($nextUrl, $userId, $accessToken) {
149
+ $response = IgApiUtils::request($this->client, 'GET', $nextUrl);
150
+ $responseData = IgApiUtils::parseResponse($response);
151
+ $responseData['data'] = $this->expandWithComments($responseData['data'], $accessToken);
152
 
153
+ return $responseData;
154
+ }
155
+ : null;
156
+
157
+ return compact('media', 'next');
158
  }
159
 
160
  /**
161
  * @since 0.1
162
  *
163
+ * @param array $mediaList
164
+ * @param string $accessToken
165
  *
166
  * @return IgMedia[]
167
  */
168
+ protected function expandWithComments(array $mediaList, string $accessToken) : array
169
  {
 
170
  $mediaIds = array_filter(array_column($mediaList, 'id'));
171
 
172
  $response = IgApiUtils::request($this->client, 'GET', static::API_URI . "/comments", [
173
  'query' => [
174
  'ids' => implode(',', $mediaIds),
175
  'fields' => implode(',', IgApiUtils::getCommentFields()),
176
+ 'access_token' => $accessToken,
177
  ],
178
  ]);
179
 
189
  $mediaList[$idx]['comments'] = $comments[$mediaId]['data'];
190
  }
191
 
192
+ return $mediaList;
 
 
193
  }
194
  }
core/MediaStore/Fetchers/AccountMediaFetcher.php CHANGED
@@ -61,8 +61,9 @@ class AccountMediaFetcher implements MediaFetcherInterface
61
  foreach ($accountPosts as $accountPost) {
62
  $account = AccountPostType::fromWpPost($accountPost);
63
  $source = MediaSource::forUser($account->user);
 
64
 
65
- $store->addMedia($this->api->getAccountMedia($account), $source);
66
  }
67
  }
68
  }
61
  foreach ($accountPosts as $accountPost) {
62
  $account = AccountPostType::fromWpPost($accountPost);
63
  $source = MediaSource::forUser($account->user);
64
+ $result = $this->api->getAccountMedia($account);
65
 
66
+ $store->addMedia($result['media'], $source);
67
  }
68
  }
69
  }
core/MediaStore/Processors/MediaDownloader.php CHANGED
@@ -3,6 +3,8 @@
3
  namespace RebelCode\Spotlight\Instagram\MediaStore\Processors;
4
 
5
  use Exception;
 
 
6
  use RebelCode\Spotlight\Instagram\MediaStore\IgCachedMedia;
7
  use RebelCode\Spotlight\Instagram\Utils\Files;
8
  use RuntimeException;
@@ -45,32 +47,70 @@ class MediaDownloader
45
  */
46
  public static function downloadMediaFiles(IgCachedMedia $media)
47
  {
48
- if (empty($media->url) || $media->type === "VIDEO") {
49
- return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  }
51
 
52
- $ogImgPath = static::getThumbnailFile($media->id, null)['path'];
 
53
 
54
- try {
55
- // Download the image
56
- static::downloadFile($media->url, $ogImgPath);
 
 
57
 
58
- // Set the media's main thumbnail to point to the original image
59
- $media->thumbnail = $media->url;
60
 
61
- // Generate smaller sizes of the original image
62
- static::generateSizes($media->id, $ogImgPath);
63
 
64
- // Then remove the original file (unless its for a video post)
65
- if (file_exists($ogImgPath)) {
66
- @unlink($ogImgPath);
67
- }
68
 
69
- // Update the media's thumbnail list
70
- $media->thumbnails = static::getAllThumbnails($media->id, true);
71
- } catch (Exception $exception) {
72
- return;
 
73
  }
 
 
74
  }
75
 
76
  /**
@@ -90,9 +130,9 @@ class MediaDownloader
90
  $editor = wp_get_image_editor($filepath);
91
 
92
  if (!is_wp_error($editor)) {
93
- $editor->resize($width, null);
94
- $editor->set_quality(static::JPEG_QUALITY[$size]);
95
- $editor->save(static::getThumbnailFile($mediaId, $size)['path'], 'image/jpeg');
96
  }
97
  }
98
  }
@@ -132,12 +172,19 @@ class MediaDownloader
132
  */
133
  public static function getAllThumbnails(string $mediaId, bool $urls = false) : array
134
  {
135
- $thumbnails = [
136
- 'l' => static::getThumbnailFile($mediaId, null)[$urls ? 'url' : 'path'],
137
- ];
 
 
 
138
 
139
  foreach (static::SIZES as $size) {
140
- $thumbnails[$size] = static::getThumbnailFile($mediaId, $size)[$urls ? 'url' : 'path'];
 
 
 
 
141
  }
142
 
143
  return $thumbnails;
@@ -161,12 +208,20 @@ class MediaDownloader
161
  }
162
 
163
  if (!is_dir($uploadDir['basedir'])) {
164
- mkdir($uploadDir['basedir']);
 
 
 
 
165
  }
166
 
167
  $subDir = $uploadDir['basedir'] . '/' . static::DIR_NAME;
168
  if (!is_dir($subDir)) {
169
- mkdir($subDir);
 
 
 
 
170
  }
171
 
172
  return [
3
  namespace RebelCode\Spotlight\Instagram\MediaStore\Processors;
4
 
5
  use Exception;
6
+ use RebelCode\Iris\Item;
7
+ use RebelCode\Iris\Source;
8
  use RebelCode\Spotlight\Instagram\MediaStore\IgCachedMedia;
9
  use RebelCode\Spotlight\Instagram\Utils\Files;
10
  use RuntimeException;
47
  */
48
  public static function downloadMediaFiles(IgCachedMedia $media)
49
  {
50
+ $item = static::downloadItemFiles(Item::create($media->id, Source::auto($media->source->type), [
51
+ 'media_type' => $media->type,
52
+ 'media_url' => $media->url,
53
+ 'thumbnail_url' => $media->thumbnail,
54
+ ]));
55
+
56
+ $media->thumbnail = $item->data['thumbnail'];
57
+ $media->thumbnails = $item->data['thumbnails'];
58
+ }
59
+
60
+ /**
61
+ * Downloads all files for a given media.
62
+ *
63
+ * @since 0.5
64
+ *
65
+ * @param Item $item
66
+ *
67
+ * @return Item
68
+ */
69
+ public static function downloadItemFiles(Item $item) : Item
70
+ {
71
+ $newItem = clone $item;
72
+
73
+ $id = $item->id;
74
+ $type = $item->data['media_type'] ?? '';
75
+ $url = $item->data['media_url'] ?? '';
76
+ $thumbnail = $item->data['thumbnail_url'] ?? '';
77
+
78
+ if ($type === 'VIDEO') {
79
+ $ogImageUrl = !empty($thumbnail)
80
+ ? $thumbnail
81
+ : null;
82
+ } else {
83
+ $ogImageUrl = $url;
84
  }
85
 
86
+ if (!empty($ogImageUrl)) {
87
+ $ogImgPath = static::getThumbnailFile($id, null)['path'];
88
 
89
+ try {
90
+ // Download the image if it doesn't exist
91
+ if (!file_exists($ogImgPath)) {
92
+ static::downloadFile($ogImageUrl, $ogImgPath);
93
+ }
94
 
95
+ // Set the item's main thumbnail to point to the original image
96
+ $newItem->data['thumbnail_url'] = $ogImageUrl;
97
 
98
+ // Generate smaller sizes of the original image
99
+ static::generateSizes($id, $ogImgPath);
100
 
101
+ // Then remove the original file (unless its for a video post)
102
+ if (file_exists($ogImgPath)) {
103
+ @unlink($ogImgPath);
104
+ }
105
 
106
+ // Update the item's thumbnail list
107
+ $newItem->data['thumbnails'] = static::getAllThumbnails($id, true);
108
+ } catch (Exception $exception) {
109
+ // do nothing
110
+ }
111
  }
112
+
113
+ return $newItem;
114
  }
115
 
116
  /**
130
  $editor = wp_get_image_editor($filepath);
131
 
132
  if (!is_wp_error($editor)) {
133
+ @$editor->resize($width, null);
134
+ @$editor->set_quality(static::JPEG_QUALITY[$size]);
135
+ @$editor->save(static::getThumbnailFile($mediaId, $size)['path'], 'image/jpeg');
136
  }
137
  }
138
  }
172
  */
173
  public static function getAllThumbnails(string $mediaId, bool $urls = false) : array
174
  {
175
+ $thumbnails = [];
176
+
177
+ $largeFile = static::getThumbnailFile($mediaId, null);
178
+ if (file_exists($largeFile['path'])) {
179
+ $thumbnails['l'] = $largeFile[$urls ? 'url' : 'path'];
180
+ }
181
 
182
  foreach (static::SIZES as $size) {
183
+ $file = static::getThumbnailFile($mediaId, $size);
184
+
185
+ if (file_exists($file['path'])) {
186
+ $thumbnails[$size] = $file[$urls ? 'url' : 'path'];
187
+ }
188
  }
189
 
190
  return $thumbnails;
208
  }
209
 
210
  if (!is_dir($uploadDir['basedir'])) {
211
+ if (!mkdir($uploadDir['basedir'], 0775)) {
212
+ throw new RuntimeException(
213
+ 'Spotlight failed to create the uploads directory: ' . $uploadDir['basedir']
214
+ );
215
+ }
216
  }
217
 
218
  $subDir = $uploadDir['basedir'] . '/' . static::DIR_NAME;
219
  if (!is_dir($subDir)) {
220
+ if (!mkdir($subDir, 0775)) {
221
+ throw new RuntimeException(
222
+ 'Spotlight failed to create its photo uploads directory: ' . $subDir
223
+ );
224
+ }
225
  }
226
 
227
  return [
core/PostTypes/AccountPostType.php CHANGED
@@ -146,6 +146,32 @@ class AccountPostType extends PostType
146
  : null;
147
  }
148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  /**
150
  * Inserts an account into the database, or updates an existing account if it already exists in the database.
151
  *
146
  : null;
147
  }
148
 
149
+ /**
150
+ * Finds an account with a specific username.
151
+ *
152
+ * @since 0.5
153
+ *
154
+ * @param PostType $cpt The post type instance.
155
+ * @param string $username The username of the account to search for.
156
+ *
157
+ * @return IgAccount|null The found account with the given username or null if no matching account was found.
158
+ */
159
+ public static function getByUsername(PostType $cpt, string $username)
160
+ {
161
+ $posts = $cpt->query([
162
+ 'meta_query' => [
163
+ [
164
+ 'key' => static::USERNAME,
165
+ 'value' => $username,
166
+ ],
167
+ ],
168
+ ]);
169
+
170
+ return count($posts) > 0
171
+ ? AccountPostType::fromWpPost($posts[0])
172
+ : null;
173
+ }
174
+
175
  /**
176
  * Inserts an account into the database, or updates an existing account if it already exists in the database.
177
  *
core/PostTypes/FeedPostType.php CHANGED
@@ -36,7 +36,10 @@ class FeedPostType extends PostType
36
  */
37
  public static function fromWpPost(WP_Post $post)
38
  {
39
- return new Feed($post->ID, $post->post_title, $post->{static::OPTIONS});
 
 
 
40
  }
41
 
42
  /**
@@ -165,7 +168,7 @@ class FeedPostType extends PostType
165
  FROM %s
166
  WHERE post_type != 'revision' AND
167
  post_status != 'trash' AND
168
- post_content REGEXP '<!-- wp:spotlight/instagram \\{\"feedId\":\"?%s\"?\\} -->'",
169
  $wpdb->prefix . 'posts',
170
  $feed->getId()
171
  );
36
  */
37
  public static function fromWpPost(WP_Post $post)
38
  {
39
+ $options = $post->{static::OPTIONS};
40
+ $options = (empty($options) || !is_array($options)) ? [] : $options;
41
+
42
+ return new Feed($post->ID, $post->post_title, $options);
43
  }
44
 
45
  /**
168
  FROM %s
169
  WHERE post_type != 'revision' AND
170
  post_status != 'trash' AND
171
+ post_content REGEXP '<!-- wp:spotlight/instagram \\{\"feedId\":\"?%s\"?'",
172
  $wpdb->prefix . 'posts',
173
  $feed->getId()
174
  );
core/PostTypes/MediaPostType.php CHANGED
@@ -35,6 +35,7 @@ class MediaPostType extends PostType
35
  const COMMENTS = '_sli_comments';
36
  const CHILDREN = '_sli_children';
37
  const LAST_REQUESTED = '_sli_last_requested';
 
38
  const SOURCE_NAME = '_sli_source_name';
39
  const SOURCE_TYPE = '_sli_source_type';
40
 
35
  const COMMENTS = '_sli_comments';
36
  const CHILDREN = '_sli_children';
37
  const LAST_REQUESTED = '_sli_last_requested';
38
+ const IS_STORY = '_sli_is_story';
39
  const SOURCE_NAME = '_sli_source_name';
40
  const SOURCE_TYPE = '_sli_source_type';
41
 
core/RestApi/EndPoints/Media/FetchMediaEndPoint.php DELETED
@@ -1,75 +0,0 @@
1
- <?php
2
-
3
- namespace RebelCode\Spotlight\Instagram\RestApi\EndPoints\Media;
4
-
5
- use Dhii\Transformer\TransformerInterface;
6
- use RebelCode\Spotlight\Instagram\Feeds\Feed;
7
- use RebelCode\Spotlight\Instagram\MediaStore\MediaStore;
8
- use RebelCode\Spotlight\Instagram\RestApi\EndPoints\AbstractEndpointHandler;
9
- use WP_REST_Request;
10
- use WP_REST_Response;
11
-
12
- /**
13
- * The handler for the endpoint that fetches media from Instagram.
14
- *
15
- * @since 0.1
16
- */
17
- class FetchMediaEndPoint extends AbstractEndpointHandler
18
- {
19
- /**
20
- * @since 0.1
21
- *
22
- * @var MediaStore
23
- */
24
- protected $store;
25
-
26
- /**
27
- * @since 0.1
28
- *
29
- * @var TransformerInterface
30
- */
31
- protected $transformer;
32
-
33
- /**
34
- * Constructor.
35
- *
36
- * @since 0.1
37
- *
38
- * @param MediaStore $store
39
- * @param TransformerInterface $transformer
40
- */
41
- public function __construct(MediaStore $store, TransformerInterface $transformer)
42
- {
43
- $this->store = $store;
44
- $this->transformer = $transformer;
45
- }
46
-
47
- /**
48
- * @inheritDoc
49
- *
50
- * @since 0.1
51
- */
52
- protected function handle(WP_REST_Request $request)
53
- {
54
- $options = $request->get_param('options');
55
- $feed = Feed::fromArray(['options' => $options]);
56
-
57
- $from = $request->get_param('from');
58
- $num = $request->get_param('num');
59
- $num = ($num === null) ? $feed->getOption('numPosts')['desktop'] : $num;
60
-
61
- [$media, $stories] = $this->store->getFeedMedia($feed, $num, $from);
62
- $total = $this->store->getNumMedia();
63
-
64
- $media = array_map([$this->transformer, 'transform'], $media);
65
- $stories = array_map([$this->transformer, 'transform'], $stories);
66
-
67
- $response = [
68
- 'media' => $media,
69
- 'stories' => $stories,
70
- 'total' => $total,
71
- ];
72
-
73
- return new WP_REST_Response($response);
74
- }
75
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
core/RestApi/EndPoints/Media/GetFeedMediaEndPoint.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\RestApi\EndPoints\Media;
4
+
5
+ use RebelCode\Iris\Aggregation\ItemAggregator;
6
+ use RebelCode\Iris\Engine;
7
+ use RebelCode\Iris\Error;
8
+ use RebelCode\Spotlight\Instagram\Engine\Aggregation\MediaCollection;
9
+ use RebelCode\Spotlight\Instagram\Engine\Stores\WpPostMediaStore;
10
+ use RebelCode\Spotlight\Instagram\Feeds\FeedManager;
11
+ use RebelCode\Spotlight\Instagram\RestApi\EndPoints\AbstractEndpointHandler;
12
+ use RebelCode\Spotlight\Instagram\Utils\Arrays;
13
+ use WP_REST_Request;
14
+ use WP_REST_Response;
15
+
16
+ /**
17
+ * The handler for the endpoint that fetches media from Instagram.
18
+ *
19
+ * @since 0.1
20
+ */
21
+ class GetFeedMediaEndPoint extends AbstractEndpointHandler
22
+ {
23
+ /**
24
+ * @since 0.5
25
+ *
26
+ * @var Engine
27
+ */
28
+ protected $engine;
29
+
30
+ /**
31
+ * @since 0.5
32
+ *
33
+ * @var FeedManager
34
+ */
35
+ protected $feedManager;
36
+
37
+ /**
38
+ * Constructor.
39
+ *
40
+ * @since 0.1
41
+ *
42
+ * @param Engine $engine
43
+ * @param FeedManager $feedManager
44
+ */
45
+ public function __construct(Engine $engine, FeedManager $feedManager)
46
+ {
47
+ $this->engine = $engine;
48
+ $this->feedManager = $feedManager;
49
+ }
50
+
51
+ /**
52
+ * @inheritDoc
53
+ *
54
+ * @since 0.1
55
+ */
56
+ protected function handle(WP_REST_Request $request)
57
+ {
58
+ $options = $request->get_param('options') ?? [];
59
+ $from = $request->get_param('from') ?? 0;
60
+ $num = $request->get_param('num') ?? $options['numPosts']['desktop'] ?? 9;
61
+
62
+ $feed = $this->feedManager->createFeed($options);
63
+ $result = $this->engine->aggregate($feed, $num, $from);
64
+
65
+ $media = ItemAggregator::getCollection($result, MediaCollection::MEDIA);
66
+ $stories = ItemAggregator::getCollection($result, MediaCollection::STORY);
67
+ $total = $result->data[ItemAggregator::DATA_TOTAL];
68
+
69
+ WpPostMediaStore::updateLastRequestedTime($result->items);
70
+
71
+ $needImport = false;
72
+ foreach ($result->data[ItemAggregator::DATA_CHILDREN] as $child) {
73
+ if (count($child['result']->items) === 0) {
74
+ $needImport = true;
75
+ break;
76
+ }
77
+ }
78
+
79
+ $response = [
80
+ 'media' => $media,
81
+ 'stories' => $stories,
82
+ 'total' => $total,
83
+ 'needImport' => $needImport,
84
+ 'errors' => Arrays::map($result->errors, function (Error $error) {
85
+ return (array) $error;
86
+ }),
87
+ ];
88
+
89
+ return new WP_REST_Response($response);
90
+ }
91
+ }
core/RestApi/EndPoints/Media/GetMediaEndPoint.php CHANGED
@@ -2,11 +2,14 @@
2
 
3
  namespace RebelCode\Spotlight\Instagram\RestApi\EndPoints\Media;
4
 
5
- use Dhii\Transformer\TransformerInterface;
6
- use RebelCode\Spotlight\Instagram\IgApi\IgMedia;
7
- use RebelCode\Spotlight\Instagram\PostTypes\MediaPostType;
 
 
 
8
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\AbstractEndpointHandler;
9
- use RebelCode\Spotlight\Instagram\Wp\PostType;
10
  use WP_REST_Request;
11
  use WP_REST_Response;
12
 
@@ -18,31 +21,31 @@ use WP_REST_Response;
18
  class GetMediaEndPoint extends AbstractEndpointHandler
19
  {
20
  /**
21
- * @since 0.1
22
  *
23
- * @var PostType
24
  */
25
- protected $mediaCpt;
26
 
27
  /**
28
- * @since 0.4.2
29
  *
30
- * @var TransformerInterface
31
  */
32
- protected $transformer;
33
 
34
  /**
35
  * Constructor.
36
  *
37
  * @since 0.1
38
  *
39
- * @param PostType $mediaCpt
40
- * @param TransformerInterface $transformer
41
  */
42
- public function __construct(PostType $mediaCpt, TransformerInterface $transformer)
43
  {
44
- $this->mediaCpt = $mediaCpt;
45
- $this->transformer = $transformer;
46
  }
47
 
48
  /**
@@ -52,46 +55,28 @@ class GetMediaEndPoint extends AbstractEndpointHandler
52
  */
53
  protected function handle(WP_REST_Request $request)
54
  {
55
- $num = $request->get_param('num');
56
- $offset = $request->get_param('offset');
 
 
 
 
57
 
58
- $media = $this->mediaCpt->query([
59
- 'posts_per_page' => $num,
60
- 'offset' => $offset,
61
- ]);
62
 
63
- $media = array_map(function ($post) {
64
- return $this->transformer->transform(MediaPostType::fromWpPost($post));
65
- }, $media);
66
 
67
  $response = [
68
  'media' => $media,
69
- 'total' => $this->mediaCpt->getTotalNum(),
 
 
 
 
70
  ];
71
 
72
  return new WP_REST_Response($response);
73
  }
74
-
75
- /**
76
- * Transforms an Ig Media instance into a response array
77
- *
78
- * @since 0.1
79
- *
80
- * @param IgMedia $media
81
- *
82
- * @return array
83
- */
84
- protected function postToResponse(IgMedia $media)
85
- {
86
- return [
87
- 'id' => $media->id,
88
- 'username' => $media->username,
89
- 'caption' => $media->caption,
90
- 'timestamp' => $media->timestamp,
91
- 'type' => $media->type,
92
- 'url' => $media->url,
93
- 'permalink' => $media->permalink,
94
- 'thumbnailUrl' => $media->thumbnail,
95
- ];
96
- }
97
  }
2
 
3
  namespace RebelCode\Spotlight\Instagram\RestApi\EndPoints\Media;
4
 
5
+ use RebelCode\Iris\Aggregation\ItemAggregator;
6
+ use RebelCode\Iris\Engine;
7
+ use RebelCode\Iris\Error;
8
+ use RebelCode\Spotlight\Instagram\Engine\Aggregation\MediaCollection;
9
+ use RebelCode\Spotlight\Instagram\Engine\Stores\WpPostMediaStore;
10
+ use RebelCode\Spotlight\Instagram\Feeds\FeedManager;
11
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\AbstractEndpointHandler;
12
+ use RebelCode\Spotlight\Instagram\Utils\Arrays;
13
  use WP_REST_Request;
14
  use WP_REST_Response;
15
 
21
  class GetMediaEndPoint extends AbstractEndpointHandler
22
  {
23
  /**
24
+ * @since 0.5
25
  *
26
+ * @var Engine
27
  */
28
+ protected $engine;
29
 
30
  /**
31
+ * @since 0.5
32
  *
33
+ * @var FeedManager
34
  */
35
+ protected $feedManager;
36
 
37
  /**
38
  * Constructor.
39
  *
40
  * @since 0.1
41
  *
42
+ * @param Engine $engine
43
+ * @param FeedManager $feedManager
44
  */
45
+ public function __construct(Engine $engine, FeedManager $feedManager)
46
  {
47
+ $this->engine = $engine;
48
+ $this->feedManager = $feedManager;
49
  }
50
 
51
  /**
55
  */
56
  protected function handle(WP_REST_Request $request)
57
  {
58
+ $options = $request->get_param('options') ?? [];
59
+ $from = $request->get_param('from') ?? 0;
60
+ $num = $request->get_param('num') ?? $options['numPosts']['desktop'] ?? 9;
61
+
62
+ $feed = $this->feedManager->createFeed($options);
63
+ $result = $this->engine->aggregate($feed, $num, $from);
64
 
65
+ $media = ItemAggregator::getCollection($result, MediaCollection::MEDIA);
66
+ $stories = ItemAggregator::getCollection($result, MediaCollection::STORY);
67
+ $total = $result->data[ItemAggregator::DATA_TOTAL];
 
68
 
69
+ WpPostMediaStore::updateLastRequestedTime($result->items);
 
 
70
 
71
  $response = [
72
  'media' => $media,
73
+ 'stories' => $stories,
74
+ 'total' => $total,
75
+ 'errors' => Arrays::map($result->errors, function (Error $error) {
76
+ return (array) $error;
77
+ }),
78
  ];
79
 
80
  return new WP_REST_Response($response);
81
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  }
core/RestApi/EndPoints/Media/ImportMediaEndPoint.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\RestApi\EndPoints\Media;
4
+
5
+ use RebelCode\Iris\Engine;
6
+ use RebelCode\Iris\Error;
7
+ use RebelCode\Iris\Result;
8
+ use RebelCode\Spotlight\Instagram\Feeds\FeedManager;
9
+ use RebelCode\Spotlight\Instagram\RestApi\EndPoints\AbstractEndpointHandler;
10
+ use RebelCode\Spotlight\Instagram\Utils\Arrays;
11
+ use WP_REST_Request;
12
+ use WP_REST_Response;
13
+
14
+ /**
15
+ * The endpoint for importing media.
16
+ *
17
+ * @since 0.5
18
+ */
19
+ class ImportMediaEndPoint extends AbstractEndpointHandler
20
+ {
21
+ /**
22
+ * @since 0.5
23
+ *
24
+ * @var Engine
25
+ */
26
+ protected $engine;
27
+
28
+ /**
29
+ * @since 0.5
30
+ *
31
+ * @var FeedManager
32
+ */
33
+ protected $feedManager;
34
+
35
+ /**
36
+ * Constructor.
37
+ *
38
+ * @since 0.5
39
+ *
40
+ * @param Engine $engine
41
+ * @param FeedManager $feedManager
42
+ */
43
+ public function __construct(Engine $engine, FeedManager $feedManager)
44
+ {
45
+ $this->engine = $engine;
46
+ $this->feedManager = $feedManager;
47
+ }
48
+
49
+ /**
50
+ * @inheritDoc
51
+ *
52
+ * @since 0.5
53
+ */
54
+ protected function handle(WP_REST_Request $request)
55
+ {
56
+ $options = $request->get_param('options') ?? [];
57
+ $feed = $this->feedManager->createFeed($options);
58
+
59
+ $result = new Result();
60
+ foreach ($feed->sources as $source) {
61
+ $subResult = $this->engine->import($source);
62
+ $result->items = array_merge($result->items, $subResult->items);
63
+ $result->errors = array_merge($result->errors, $subResult->errors);
64
+ }
65
+
66
+ return new WP_REST_Response([
67
+ 'success' => $result->success,
68
+ 'items' => $result->items,
69
+ 'data' => $result->data,
70
+ 'errors' => Arrays::map($result->errors, function (Error $error) {
71
+ return (array) $error;
72
+ }),
73
+ ]);
74
+ }
75
+ }
core/Utils/Arrays.php CHANGED
@@ -56,6 +56,26 @@ class Arrays
56
  return $newArray;
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  /**
60
  * Maps each key->value pair in an array, creating a new array.
61
  *
@@ -281,6 +301,28 @@ class Arrays
281
  return $result;
282
  }
283
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  /**
285
  * Breaks path keys into sub-arrays, creating a tree from a flat list.
286
  *
@@ -415,4 +457,39 @@ class Arrays
415
  $numPages,
416
  ];
417
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418
  }
56
  return $newArray;
57
  }
58
 
59
+ /**
60
+ * Maps each value in an array to a key->value pair, creating a new associative array.
61
+ *
62
+ * This function uses {@link Arrays::mapPairs()} but omits the first argument (the key) when calling the callback.
63
+ *
64
+ * @since 0.5
65
+ *
66
+ * @param array $array The array to map.
67
+ * @param callable $fn The function to call for each pair in the array. It will receive the value as argument
68
+ * and must return an array containing two values: the key and value for the new array.
69
+ *
70
+ * @return array The mapped array.
71
+ */
72
+ public static function createMap(array $array, callable $fn)
73
+ {
74
+ return static::mapPairs($array, function ($key, $value) use ($fn) {
75
+ return $fn($value);
76
+ });
77
+ }
78
+
79
  /**
80
  * Maps each key->value pair in an array, creating a new array.
81
  *
301
  return $result;
302
  }
303
 
304
+ /**
305
+ * Creates a copy of an array containing only unique values.
306
+ *
307
+ * @since 0.5
308
+ *
309
+ * @param array $array The array.
310
+ * @param callable $uniqueFn The function that determines uniqueness for each element. Receives an array element as
311
+ * argument and is expected to return a unique string or integer key for that element.
312
+ *
313
+ * @return array The resulting array.
314
+ */
315
+ static function unique(array $array, callable $uniqueFn)
316
+ {
317
+ $unique = [];
318
+
319
+ foreach ($array as $value) {
320
+ $unique[$uniqueFn($value)] = $value;
321
+ }
322
+
323
+ return array_values($unique);
324
+ }
325
+
326
  /**
327
  * Breaks path keys into sub-arrays, creating a tree from a flat list.
328
  *
457
  $numPages,
458
  ];
459
  }
460
+
461
+ /**
462
+ * Shuffles an array into random order.
463
+ *
464
+ * @since 0.5
465
+ *
466
+ * @param array $array The array to shuffle.
467
+ *
468
+ * @return array A shuffled version of the array.
469
+ */
470
+ static function shuffle(array $array)
471
+ {
472
+ $count = count($array);
473
+ // If empty or only 1 element, do nothing
474
+ if ($count < 2) {
475
+ return $array;
476
+ }
477
+
478
+ // Iterate backwards
479
+ $currIdx = $count - 1;
480
+ while ($currIdx !== 0) {
481
+ // Pick a random element
482
+ $randIdx = rand(0, $currIdx - 1);
483
+
484
+ // Swap with current
485
+ $temp = $array[$currIdx];
486
+ $array[$currIdx] = $array[$randIdx];
487
+ $array[$randIdx] = $temp;
488
+
489
+ // Move to previous element in the list
490
+ $currIdx--;
491
+ }
492
+
493
+ return $array;
494
+ }
495
  }
core/Utils/Functions.php ADDED
@@ -0,0 +1,444 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Utils;
4
+
5
+ /**
6
+ * Utility functions for dealing with functions.
7
+ *
8
+ * @since 0.5
9
+ */
10
+ class Functions
11
+ {
12
+ /**
13
+ * Used during partial application (see {@link Func::apply()}) to denote skipped arguments.
14
+ *
15
+ * @since 0.5
16
+ */
17
+ const SKIP = '__$' . __CLASS__ . '$SKIP_ARG$__';
18
+
19
+ /**
20
+ * @since 0.5
21
+ *
22
+ * @var callable|null
23
+ */
24
+ protected $callable;
25
+
26
+ /**
27
+ * @since 0.5
28
+ *
29
+ * @var array
30
+ */
31
+ protected $args;
32
+
33
+ /**
34
+ * Constructor.
35
+ *
36
+ * @since 0.5
37
+ *
38
+ * @param callable|null $callable The callable, or null for a noop function.
39
+ * @param array $args Optional pre-applied arguments.
40
+ */
41
+ protected function __construct(?callable $callable = null, array $args = [])
42
+ {
43
+ $this->callable = $callable;
44
+ $this->args = $args;
45
+ }
46
+
47
+ /**
48
+ * Invokes the function.
49
+ *
50
+ * @since 0.5
51
+ *
52
+ * @param mixed ...$args The arguments.
53
+ *
54
+ * @return mixed The return value.
55
+ */
56
+ public function __invoke(...$args)
57
+ {
58
+ return static::call($this->callable, static::mergeArgs($this->args, $args));
59
+ }
60
+
61
+ /**
62
+ * Creates a no-operation function.
63
+ *
64
+ * @since 0.5
65
+ *
66
+ * @return callable
67
+ */
68
+ public static function noop() : callable
69
+ {
70
+ return new static();
71
+ }
72
+
73
+ /**
74
+ * Creates a function that simply returns one of its args.
75
+ *
76
+ * @since 0.5
77
+ *
78
+ * @param int $arg The argument to return, as a 0-based index.
79
+ *
80
+ * @return callable
81
+ */
82
+ public static function returnArg(int $arg = 0) : callable
83
+ {
84
+ $arg = max($arg, 0);
85
+
86
+ return function () use ($arg) {
87
+ return func_get_arg($arg);
88
+ };
89
+ }
90
+
91
+ /**
92
+ * Creates a function that returns a given value.
93
+ *
94
+ * @since 0.5
95
+ *
96
+ * @param mixed $value The value to return.
97
+ *
98
+ * @return callable The created function.
99
+ */
100
+ public static function thatReturns($value) : callable
101
+ {
102
+ return function () use ($value) {
103
+ return $value;
104
+ };
105
+ }
106
+
107
+ /**
108
+ * Partially applies a function with some arguments.
109
+ *
110
+ * @since 0.5
111
+ *
112
+ * @param callable $fn The function to partially apply arguments to.
113
+ * @param array $args The arguments to apply. Include {@link Func::SKIP} to skip arguments positionally.
114
+ *
115
+ * @return callable The partially applied function.
116
+ */
117
+ public static function apply(callable $fn, array $args) : callable
118
+ {
119
+ return ($fn instanceof static && $fn->callable !== null)
120
+ ? new static($fn->callable, static::mergeArgs($fn->args, $args))
121
+ : new static($fn, $args);
122
+ }
123
+
124
+ /**
125
+ * Merges the given functions into a single function.
126
+ *
127
+ * When the resulting merged function is invoked, the given functions are invoked in the given order and are passed
128
+ * the full set of invocation arguments.
129
+ *
130
+ * No value is returned from the merged function. For returning values, use {@link Func::pipe()}.
131
+ *
132
+ * @since 0.5
133
+ *
134
+ * @see Func::pipe()
135
+ *
136
+ * @param iterable<callable> $functions
137
+ *
138
+ * @return callable The merged function.
139
+ */
140
+ public static function merge(iterable $functions) : callable
141
+ {
142
+ return function (...$args) use ($functions) {
143
+ foreach ($functions as $function) {
144
+ if (is_callable($function)) {
145
+ static::call($function, $args);
146
+ }
147
+ }
148
+ };
149
+ }
150
+
151
+ /**
152
+ * Merges the given functions into a single function and returns the value from the last function.
153
+ *
154
+ * When the resulting merged function is invoked, the given functions are invoked in the given order and are passed
155
+ * the full set of invocation arguments, with the exception of the first argument, which will be the return value
156
+ * of the previous function. The first function's first argument will be the first invocation argument.
157
+ *
158
+ * The merged function will return the last function's return value.
159
+ *
160
+ * @since 0.5
161
+ *
162
+ * @param iterable<callable> $functions
163
+ *
164
+ * @return callable The piping function.
165
+ */
166
+ public static function pipe(iterable $functions) : callable
167
+ {
168
+ return function (...$args) use ($functions) {
169
+ foreach ($functions as $function) {
170
+ if (is_callable($function)) {
171
+ $args[0] = static::call($function, $args);
172
+ }
173
+ }
174
+
175
+ return $args[0];
176
+ };
177
+ }
178
+
179
+ /**
180
+ * Decorates a function to handle thrown exceptions using another function.
181
+ *
182
+ * @since 0.5
183
+ *
184
+ * @param callable $fn The function that is expected to throw exceptions.
185
+ * @param string[] $catch The fully qualified name of the exception class to catch.
186
+ * @param callable|null $handler The function to call when an exception is thrown by $fn. Receives the thrown
187
+ * exception as the first argument, together with all the arguments that were
188
+ * originally passed to $fn.
189
+ *
190
+ * @return callable The decorated function.
191
+ */
192
+ public static function catch(callable $fn, array $catch = [Exception::class], ?callable $handler = null) : callable
193
+ {
194
+ return function (...$args) use ($fn, $catch, $handler) {
195
+ try {
196
+ return static::call($fn, $args);
197
+ } catch (Exception $excInstance) {
198
+ if (in_array(get_class($excInstance), $catch)) {
199
+ return static::call($handler, array_merge([$excInstance], $args));
200
+ }
201
+
202
+ throw $excInstance;
203
+ }
204
+ };
205
+ }
206
+
207
+ /**
208
+ * Memoizes a function's results such that subsequent calls with the same arguments skip invocation altogether.
209
+ *
210
+ * @since 0.5
211
+ *
212
+ * @param callable $fn The function to memoize.
213
+ *
214
+ * @return callable The memoizing function.
215
+ */
216
+ public static function memoize(callable $fn) : callable
217
+ {
218
+ return function (...$args) use ($fn) {
219
+ static $cache = [];
220
+
221
+ $key = static::hashArgs($args);
222
+
223
+ if (!array_key_exists($key, $cache)) {
224
+ $cache[$key] = static::call($fn, $args);
225
+ }
226
+
227
+ return $cache[$key];
228
+ };
229
+ }
230
+
231
+ /**
232
+ * Decorates a function such that its arguments are mapped to new values prior to invocation.
233
+ *
234
+ * @since 0.5
235
+ *
236
+ * @param callable $fn The function to decorate.
237
+ * @param callable $mapFn The mapping function, which should accept a value as argument and return the new value.
238
+ *
239
+ * @return callable The decorated function.
240
+ */
241
+ public static function mapArgs(callable $fn, callable $mapFn) : callable
242
+ {
243
+ return function (...$args) use ($fn, $mapFn) {
244
+ return static::call($fn, array_map($mapFn, $args));
245
+ };
246
+ }
247
+
248
+ /**
249
+ * Reorders a function's arguments.
250
+ *
251
+ * Important: the given $order is processed sequentially in the order they are given. When one ordering is
252
+ * processed, the arguments list is re-indexed. Therefore, each reordering should take previous positional
253
+ * changes into account.
254
+ *
255
+ * **For Example**:
256
+ *
257
+ * Consider arguments [d, a, c, b].
258
+ *
259
+ * An ordering of [0 => 2, 2 => 1] will move `d` after `c` and then move `d` (now at position 2) after `a`, yielding
260
+ * [a, d, c, d].
261
+ *
262
+ * To obtain [a, b, c, d], and ordering of [0 => 2, 3 => 1] can be used.
263
+ *
264
+ * @since 0.5
265
+ *
266
+ * @param callable $fn The function whose arguments to reorder.
267
+ * @param array $reordering The reordering, as a mapping of argument indices (starting at zero) to the desired
268
+ * new position.
269
+ *
270
+ * @return callable The function with reordered arguments.
271
+ */
272
+ public static function reorderArgs(callable $fn, array $reordering) : callable
273
+ {
274
+ return function (...$args) use ($fn, $reordering) {
275
+ $numArgs = count($args);
276
+ foreach ($reordering as $oldIdx => $newIdx) {
277
+ $oldIdx = max(min($numArgs, $oldIdx), 0);
278
+ $newIdx = max(min($numArgs, $newIdx), 0);
279
+
280
+ if (!array_key_exists($oldIdx, $args)) {
281
+ continue;
282
+ }
283
+
284
+ $arg = array_splice($args, $oldIdx, 1);
285
+ array_splice($args, $newIdx, 0, $arg);
286
+ $args = array_values($args);
287
+ }
288
+
289
+ return static::call($fn, $args);
290
+ };
291
+ }
292
+
293
+ /**
294
+ * Captures the output of a function to return it instead.
295
+ *
296
+ * @since 0.5
297
+ *
298
+ * @param callable $fn The function whose output should be captured.
299
+ *
300
+ * @return callable A function that returns a string containing the original function's output.
301
+ */
302
+ public static function capture(callable $fn) : callable
303
+ {
304
+ return function (...$args) use ($fn) {
305
+ ob_start();
306
+
307
+ static::call($fn, $args);
308
+
309
+ return ob_get_clean();
310
+ };
311
+ }
312
+
313
+ /**
314
+ * Outputs a function's return value.
315
+ *
316
+ * @since 0.5
317
+ *
318
+ * @param callable $fn The function whose return value should be outputted.
319
+ *
320
+ * @return callable A function that outputs the original function's return value.
321
+ */
322
+ public static function output(callable $fn) : callable
323
+ {
324
+ return function (...$args) use ($fn) {
325
+ echo static::call($fn, $args);
326
+ };
327
+ }
328
+
329
+ /**
330
+ * Creates a function that calls a method on the first argument, while passing any remaining arguments.
331
+ *
332
+ * @since 0.5
333
+ *
334
+ * @param string $method The name of the method to call on the first argument.
335
+ *
336
+ * @return callable The created function.
337
+ */
338
+ public static function method(string $method) : callable
339
+ {
340
+ return function (...$args) use ($method) {
341
+ if (count($args) === 0) {
342
+ throw new BadFunctionCallException('At least one argument is required');
343
+ }
344
+
345
+ $object = array_shift($args);
346
+
347
+ return static::call([$object, $method], $args);
348
+ };
349
+ }
350
+
351
+ /**
352
+ * Merges two lists of arguments.
353
+ *
354
+ * This function will attempt to insert the arguments from the second list into skipped arguments in the first
355
+ * list. Any arguments from the second list that are inserted this way will be appended to the end of the argument
356
+ * list.
357
+ *
358
+ * @since 0.5
359
+ *
360
+ * @param array $args1 The first list of arguments.
361
+ * @param array $args2 The second list of arguments.
362
+ *
363
+ * @return array The merged list of arguments.
364
+ */
365
+ protected static function mergeArgs(array $args1, array $args2)
366
+ {
367
+ $replaceSkipped = function ($arg) use (&$args2, &$args1) {
368
+ if ($arg === static::SKIP && !empty($args2)) {
369
+ return array_shift($args2);
370
+ }
371
+
372
+ return $arg;
373
+ };
374
+
375
+ $replacedArgs = array_map($replaceSkipped, $args1);
376
+
377
+ return !empty($args2)
378
+ ? array_merge($replacedArgs, $args2)
379
+ : $replacedArgs;
380
+ }
381
+
382
+ /**
383
+ * Calls a function with a given list of arguments.
384
+ *
385
+ * This function will make sure to strip out any skipped arguments, as well as spread the list of arguments
386
+ * appropriately based on argument index.
387
+ *
388
+ * @since 0.5
389
+ *
390
+ * @param callable|null $callable The callable to call.
391
+ * @param array $args Optional list of arguments.
392
+ *
393
+ * @return mixed The return value.
394
+ */
395
+ protected static function call(?callable $callable, array $args = [])
396
+ {
397
+ if (!is_callable($callable)) {
398
+ return null;
399
+ }
400
+
401
+ $filteredArgs = array_filter($args, function ($arg) {
402
+ return $arg !== static::SKIP;
403
+ });
404
+
405
+ return ($callable)(...$filteredArgs);
406
+ }
407
+
408
+ /**
409
+ * Hashes a given list of arguments.
410
+ *
411
+ * @since 0.5
412
+ *
413
+ * @param array $args The arguments to hash.
414
+ *
415
+ * @return string A hash string that uniquely identifies the argument values (but not the argument references).
416
+ */
417
+ protected static function hashArgs(array $args)
418
+ {
419
+ return sha1(print_r(array_map([__CLASS__, 'prepareArgForHash'], $args), true));
420
+ }
421
+
422
+ /**
423
+ * Prepares an argument value for hashing.
424
+ *
425
+ * @since 0.5
426
+ * @see Func::hashArgs()
427
+ *
428
+ * @param mixed $arg The argument value.
429
+ *
430
+ * @return string A string that uniquely represents the **value** (not the reference) of the argument.
431
+ */
432
+ protected static function prepareArgForHash($arg) : string
433
+ {
434
+ if (is_array($arg)) {
435
+ return static::prepareArgForHash($arg);
436
+ }
437
+
438
+ if (is_object($arg)) {
439
+ return get_class($arg) . '_' . spl_object_hash($arg);
440
+ }
441
+
442
+ return (string) $arg;
443
+ }
444
+ }
core/Wp/CronJob.php CHANGED
@@ -150,8 +150,13 @@ class CronJob
150
  $event = static::getScheduledEvent($job);
151
  $isScheduled = is_object($event);
152
 
153
- // If an event is already scheduled
154
- if ($isScheduled) {
 
 
 
 
 
155
  return;
156
  }
157
 
150
  $event = static::getScheduledEvent($job);
151
  $isScheduled = is_object($event);
152
 
153
+ // Check if doing cron or if Crontrol is rescheduling a job
154
+ $doingCron = !empty(filter_input(INPUT_GET, 'doing_wp_cron'));
155
+ $fromCrontrol = filter_input(INPUT_GET, 'crontrol-single-event') === '1';
156
+
157
+ // If an event is already scheduled with the same repetition, stop here
158
+ // We also stop if currently running crons or if the Crontrol plugin is rescheduling a job
159
+ if (($isScheduled && $event->schedule === $job->repeat) || ($doingCron || $fromCrontrol)) {
160
  return;
161
  }
162
 
engine/Aggregation/ItemAggregator.php ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris\Aggregation;
4
+
5
+ use RebelCode\Iris\Fetching\ItemProvider;
6
+ use RebelCode\Iris\Item;
7
+ use RebelCode\Iris\Result;
8
+ use RebelCode\Spotlight\Instagram\Utils\Arrays;
9
+
10
+ /**
11
+ * Aggregates items for an {@link ItemFeed}.
12
+ *
13
+ * An aggregator's job is to collect items for each source in an {@link ItemFeed} and process those items into a
14
+ * desirable format.
15
+ *
16
+ * The aggregator makes use of {@link ItemProcessor} instances to determine which of the acquired items will be
17
+ * returned and how. Processors are allowed to remove items, add new items, sort the items, alter item data or perform
18
+ * any other mutation so long as the list still consists of {@link Item} instances.
19
+ *
20
+ * An {@link ItemTransformer} is then used to transform the items into a different format, such as arrays, plain
21
+ * objects or instances of some class.
22
+ *
23
+ * Finally, an {@link ItemSegregator} is used to separate the items into separate collections. This can be useful if
24
+ * the consumer needs to handle different types of items differently. These collections
25
+ *
26
+ * Aggregator results will contain various information in {@link Result::$data}. This includes the result from each
27
+ * {@link ItemProvider} in the {@link ItemAggregator::DATA_CHILDREN} key, the total number of items prior to applying
28
+ * limits and offsets in the {@link ItemAggregator::DATA_TOTAL} key and the item collections from the segregator in the
29
+ * {@link ItemAggregator::DATA_COLLECTIONS} key.
30
+ *
31
+ * @since [*next-version*]
32
+ */
33
+ class ItemAggregator
34
+ {
35
+ const DATA_COLLECTIONS = 'collections';
36
+ const DATA_TOTAL = 'total';
37
+ const DATA_CHILDREN = 'children';
38
+ const DEF_COLLECTION = 'items';
39
+
40
+ /**
41
+ * The provider to use to retrieve items.
42
+ *
43
+ * @since [*next-version*]
44
+ *
45
+ * @var ItemProvider
46
+ */
47
+ protected $provider;
48
+
49
+ /**
50
+ * The processors to use to prepare the resulting items.
51
+ *
52
+ * @since [*next-version*]
53
+ *
54
+ * @var ItemProcessor[]
55
+ */
56
+ protected $processors;
57
+
58
+ /**
59
+ * Optional item segregator to separate items into collections.
60
+ *
61
+ * @since [*next-version*]
62
+ *
63
+ * @var ItemSegregator|null
64
+ */
65
+ protected $segregator;
66
+
67
+ /**
68
+ * Optional item transformer to transform collection items.
69
+ *
70
+ * @since [*next-version*]
71
+ *
72
+ * @var ItemTransformer|null
73
+ */
74
+ protected $transformer;
75
+
76
+ /**
77
+ * Constructor.
78
+ *
79
+ * @since [*next-version*]
80
+ *
81
+ * @param ItemProvider $provider The provider to use to retrieve items.
82
+ * @param ItemProcessor[] $processors The processors to use to prepare the resulting items.
83
+ * @param ItemSegregator|null $segregator Optional item segregator to separate items into collections.
84
+ * @param ItemTransformer|null $transformer Optional item transformer to transform collection items.
85
+ */
86
+ public function __construct(
87
+ ItemProvider $provider,
88
+ array $processors = [],
89
+ ?ItemSegregator $segregator = null,
90
+ ?ItemTransformer $transformer = null
91
+ ) {
92
+ $this->provider = $provider;
93
+ $this->processors = $processors;
94
+ $this->segregator = $segregator;
95
+ $this->transformer = $transformer;
96
+ }
97
+
98
+ /**
99
+ * Aggregates items for a feed.
100
+ *
101
+ * @since [*next-version*]
102
+ *
103
+ * @param ItemFeed $feed The feed to aggregate items for.
104
+ * @param int|null $limit The maximum number of items to aggregate.
105
+ * @param int $offset The number of items to skip over.
106
+ *
107
+ * @return Result The aggregation result.
108
+ */
109
+ public function aggregate(ItemFeed $feed, ?int $limit = null, int $offset = 0) : Result
110
+ {
111
+ $result = new Result();
112
+ $result->data = [
113
+ 'children' => [],
114
+ ];
115
+
116
+ // Fetch items from provider
117
+ // ---------------------------
118
+
119
+ foreach ($feed->sources as $source) {
120
+ $srcResult = $this->provider->getItems($source);
121
+
122
+ $result->data['children'][] = [
123
+ 'source' => $source,
124
+ 'result' => $srcResult,
125
+ ];
126
+
127
+ $result->errors = array_merge($result->errors, $srcResult->errors);
128
+ $result->items = array_merge($result->items, $srcResult->items);
129
+ }
130
+
131
+ $result->success = $result->hasErrors() && count($result->items) === 0;
132
+
133
+ // Remove duplicates
134
+ // -------------------------------
135
+
136
+ $result->items = Arrays::unique($result->items, function ($item) {
137
+ return $item->id;
138
+ });
139
+
140
+ // Pass items through processors
141
+ // -------------------------------
142
+
143
+ foreach ($this->processors as $processor) {
144
+ $processor->process($result->items, $feed);
145
+ }
146
+
147
+ // Apply limit and offset
148
+ // ---------------------------
149
+
150
+ $result->data[static::DATA_TOTAL] = count($result->items);
151
+
152
+ $limit = max(0, $limit ?? 0);
153
+ $offset = max(0, $offset);
154
+
155
+ if ($limit > 0 || $offset > 0) {
156
+ $result->items = array_slice($result->items, $offset, $limit);
157
+ }
158
+
159
+ // Segregate and transform the items
160
+ // -----------------------------------
161
+
162
+ if ($this->segregator === null && $this->transformer === null) {
163
+ $result->data[static::DATA_COLLECTIONS] = [
164
+ static::DEF_COLLECTION => $result->items,
165
+ ];
166
+ } else {
167
+ $result->data[static::DATA_COLLECTIONS] = [];
168
+
169
+ foreach ($result->items as $item) {
170
+ $key = ($this->segregator !== null)
171
+ ? $this->segregator->segregate($item, $feed) ?? static::DEF_COLLECTION
172
+ : static::DEF_COLLECTION;
173
+
174
+ if (!array_key_exists($key, $result->data[static::DATA_COLLECTIONS])) {
175
+ $result->data[static::DATA_COLLECTIONS][$key] = [];
176
+ }
177
+
178
+ $result->data[static::DATA_COLLECTIONS][$key][] = ($this->transformer !== null)
179
+ ? $this->transformer->transform($item, $feed)
180
+ : $item;
181
+ }
182
+ }
183
+
184
+ return $result;
185
+ }
186
+
187
+ /**
188
+ * Retrieves a collection from a result.
189
+ *
190
+ * @since [*next-version*]
191
+ *
192
+ * @param Result $result The result.
193
+ * @param string $key The key of the collection to retrieve.
194
+ *
195
+ * @return Item[] The items in the collection. An empty list will be returned if the collection does not exist in
196
+ * the given result.
197
+ */
198
+ public static function getCollection(Result $result, string $key = self::DEF_COLLECTION)
199
+ {
200
+ $default = ($key === static::DEF_COLLECTION ? $result->items : []);
201
+
202
+ return $result->data[static::DATA_COLLECTIONS][$key] ?? $default;
203
+ }
204
+ }
engine/Aggregation/ItemFeed.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris\Aggregation;
4
+
5
+ use RebelCode\Iris\Source;
6
+
7
+ /**
8
+ * Represents a feed of items, which is configuration for an {@link ItemAggregator}.
9
+ *
10
+ * @since [*next-version*]
11
+ */
12
+ class ItemFeed
13
+ {
14
+ /**
15
+ * The sources that are being aggregated.
16
+ *
17
+ * @since [*next-version*]
18
+ *
19
+ * @var Source[]
20
+ */
21
+ public $sources;
22
+
23
+ /**
24
+ * Any config options for this aggregation.
25
+ *
26
+ * @since [*next-version*]
27
+ *
28
+ * @var array
29
+ */
30
+ public $options;
31
+
32
+ /**
33
+ * Constructor.
34
+ *
35
+ * @since [*next-version*]
36
+ *
37
+ * @param Source[] $sources The sources that are being aggregated.
38
+ * @param array $options Any config options for this aggregation.
39
+ */
40
+ public function __construct(array $sources, array $options = [])
41
+ {
42
+ $this->sources = $sources;
43
+ $this->options = $options;
44
+ }
45
+
46
+ /**
47
+ * Retrieves a single option, optionally defaulting to a specific value.
48
+ *
49
+ * @since [*next-version*]
50
+ *
51
+ * @param string $key The key of the option to retrieve.
52
+ * @param mixed $default Optional value to return if no option is found for the given $key.
53
+ *
54
+ * @return mixed|null The value for the option that corresponds to the given $key, or $default if not found.
55
+ */
56
+ public function getOption(string $key, $default = null)
57
+ {
58
+ return array_key_exists($key, $this->options)
59
+ ? $this->options[$key]
60
+ : $default;
61
+ }
62
+ }
engine/Aggregation/ItemProcessor.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris\Aggregation;
4
+
5
+ /**
6
+ * An item processor is used during item aggregation to manipulate a list of items prior to serving the result.
7
+ *
8
+ * Item processors receive the list of items **by reference**. This is done for performance reasons to avoid creating
9
+ * a new list of items in memory, reducing overall memory usage as well as resulting in less instructions required to
10
+ * generate results.
11
+ *
12
+ * @since [*next-version*]
13
+ */
14
+ interface ItemProcessor
15
+ {
16
+ /**
17
+ * Processes a list of items.
18
+ *
19
+ * @since [*next-version*]
20
+ *
21
+ * @param Item[] $items The list of items to process, passed by reference.
22
+ * @param ItemFeed $feed The item feed instance for which to process the items.
23
+ */
24
+ public function process(array &$items, ItemFeed $feed);
25
+ }
engine/Aggregation/ItemSegregator.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris\Aggregation;
4
+
5
+ use RebelCode\Iris\Item;
6
+
7
+ /**
8
+ * An item segregator is an item processor that determines what collection an item belongs to.
9
+ *
10
+ * @since [*next-version*]
11
+ */
12
+ interface ItemSegregator
13
+ {
14
+ /**
15
+ * Segregates an item for a given feed.
16
+ *
17
+ * @since [*next-version*]
18
+ *
19
+ * @param Item $item The item to maybe segregate.
20
+ * @param ItemFeed $feed The feed to segregate for.
21
+ *
22
+ * @return string|null The name of the collection in which the item belongs, or null if the item belongs in the
23
+ * default collection.
24
+ */
25
+ public function segregate(Item $item, ItemFeed $feed) : ?string;
26
+ }
engine/Aggregation/ItemTransformer.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris\Aggregation;
4
+
5
+ use RebelCode\Iris\Item;
6
+
7
+ /**
8
+ * A transformer is an item processor that transforms an {@link Item} instance into a different value.
9
+ *
10
+ * @since [*next-version*]
11
+ */
12
+ interface ItemTransformer
13
+ {
14
+ /**
15
+ * Transforms an item.
16
+ *
17
+ * @since [*next-version*]
18
+ *
19
+ * @param Item $item The item to transform.
20
+ * @param ItemFeed $feed The item feed to transform for.
21
+ *
22
+ * @return mixed The transformed result.
23
+ */
24
+ public function transform(Item $item, ItemFeed $feed);
25
+ }
engine/Engine.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris;
4
+
5
+ use RebelCode\Iris\Aggregation\ItemAggregator;
6
+ use RebelCode\Iris\Aggregation\ItemFeed;
7
+ use RebelCode\Iris\Fetching\ItemProvider;
8
+ use RebelCode\Iris\Importing\ItemImporter;
9
+ use RebelCode\Iris\Importing\ItemStore;
10
+
11
+ /**
12
+ * Acts as the single point of entry for the provider, store, importer and aggregator.
13
+ *
14
+ * @since [*next-version*]
15
+ */
16
+ class Engine
17
+ {
18
+ /**
19
+ * @since [*next-version*]
20
+ *
21
+ * @var ItemProvider
22
+ */
23
+ public $provider;
24
+
25
+ /**
26
+ * @since [*next-version*]
27
+ *
28
+ * @var ItemStore
29
+ */
30
+ public $store;
31
+
32
+ /**
33
+ * @since [*next-version*]
34
+ *
35
+ * @var ItemImporter
36
+ */
37
+ public $importer;
38
+
39
+ /**
40
+ * @since [*next-version*]
41
+ *
42
+ * @var ItemAggregator
43
+ */
44
+ public $aggregator;
45
+
46
+ /**
47
+ * Constructor.
48
+ *
49
+ * @since [*next-version*]
50
+ *
51
+ * @param ItemProvider $provider The provider.
52
+ * @param ItemImporter $importer The importer.
53
+ * @param ItemStore $store The store.
54
+ * @param ItemAggregator $aggregator The aggregator.
55
+ */
56
+ public function __construct(
57
+ ItemProvider $provider,
58
+ ItemImporter $importer,
59
+ ItemStore $store,
60
+ ItemAggregator $aggregator
61
+ ) {
62
+ $this->provider = $provider;
63
+ $this->importer = $importer;
64
+ $this->store = $store;
65
+ $this->aggregator = $aggregator;
66
+ }
67
+
68
+ /**
69
+ * Retrieves items.
70
+ *
71
+ * @since [*next-version*]
72
+ *
73
+ * @param Source $source The source to retrieve items for.
74
+ * @param int|null $limit The maximum number of items to retrieve.
75
+ * @param int $offset The number of items to skip.
76
+ *
77
+ * @return Result The result.
78
+ */
79
+ public function getItems(Source $source, ?int $limit = null, int $offset = 0) : Result
80
+ {
81
+ return $this->provider->getItems($source, $limit, $offset);
82
+ }
83
+
84
+ /**
85
+ * Imports items.
86
+ *
87
+ * @since [*next-version*]
88
+ *
89
+ * @param Source $source The source to import items from.
90
+ *
91
+ * @return Result The result.
92
+ */
93
+ public function import(Source $source)
94
+ {
95
+ return $this->importer->import($source);
96
+ }
97
+
98
+ /**
99
+ * Aggregates items for a feed.
100
+ *
101
+ * @since [*next-version*]
102
+ *
103
+ * @param ItemFeed $feed The feed for which to aggregate items.
104
+ * @param int|null $limit The maximum number of items to aggregate.
105
+ * @param int $offset The number of items to skip.
106
+ *
107
+ * @return Result The result.
108
+ */
109
+ public function aggregate(ItemFeed $feed, ?int $limit = null, int $offset = 0) : Result
110
+ {
111
+ return $this->aggregator->aggregate($feed, $limit, $offset);
112
+ }
113
+ }
engine/Error.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris;
4
+
5
+ /**
6
+ * Represents a failed retrieval of items.
7
+ *
8
+ * @since [*next-version*]
9
+ */
10
+ class Error
11
+ {
12
+ /**
13
+ * The error message.
14
+ *
15
+ * @var string
16
+ */
17
+ public $message;
18
+
19
+ /**
20
+ * A code that identifies the error type.
21
+ * This is typically provided by the source in its erroneous result.
22
+ *
23
+ * @since [*next-version*]
24
+ *
25
+ * @var string|null
26
+ */
27
+ public $code;
28
+
29
+ /**
30
+ * Constructor.
31
+ *
32
+ * @since [*next-version*]
33
+ *
34
+ * @param string $message The error message.
35
+ * @param string $code The error code.
36
+ */
37
+ public function __construct(string $message, string $code = '')
38
+ {
39
+ $this->message = $message;
40
+ $this->code = $code;
41
+ }
42
+
43
+ /**
44
+ * Static constructor.
45
+ *
46
+ * @since [*next-version*]
47
+ *
48
+ * @param string $message The error message.
49
+ * @param string $code The error code.
50
+ *
51
+ * @return self The created error.
52
+ */
53
+ public static function create(string $message, string $code = '') : self
54
+ {
55
+ return new static($message, $code);
56
+ }
57
+ }
engine/Fetching/BatchingItemProvider.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris\Fetching;
4
+
5
+ use RebelCode\Iris\Result;
6
+ use RebelCode\Iris\Source;
7
+
8
+ /**
9
+ * An item provider decorate that will retrieve as many items from another provider as it can, in batches.
10
+ *
11
+ * This provider will not yield results with a {@link Result::$next} callback. Rather, it will use the results from
12
+ * another provider to repetitively call {@link Result::$next} to get more items, until it receives a result without
13
+ * a {@link Result::$next} callback. Every time it does this, a batch of items is created. The size of the batch can
14
+ * be configured during construction.
15
+ *
16
+ * For convenience, the provider may also be configured with a callback which will be invoked with each obtained
17
+ * batch of items as argument. This can be used to perform a variety of tasks that would benefit from operating on
18
+ * batches rather than full lists, such as storing the items in an item store. The callback is expected to return a
19
+ * {@link Result} of its own. The items in the result will "replace" the items originally from the batch, allowing the
20
+ * provider to modify the provider's final result. Additionally, any errors in the callback's result will also be
21
+ * recorded in the provider's final result.
22
+ *
23
+ * @since [*next-version*]
24
+ */
25
+ class BatchingItemProvider implements ItemProvider
26
+ {
27
+ /**
28
+ * @since [*next-version*]
29
+ *
30
+ * @var ItemProvider
31
+ */
32
+ protected $provider;
33
+
34
+ /**
35
+ * @since [*next-version*]
36
+ *
37
+ * @var int
38
+ */
39
+ protected $batchSize;
40
+
41
+ /**
42
+ * @since [*next-version*]
43
+ *
44
+ * @var callable
45
+ */
46
+ protected $callback;
47
+
48
+ /**
49
+ * Constructor.
50
+ *
51
+ * @since [*next-version*]
52
+ *
53
+ * @param ItemProvider $provider
54
+ * @param int $batchSize
55
+ * @param callable $callback
56
+ */
57
+ public function __construct(ItemProvider $provider, int $batchSize, callable $callback)
58
+ {
59
+ $this->provider = $provider;
60
+ $this->batchSize = max($batchSize, 1);
61
+ $this->callback = $callback;
62
+ }
63
+
64
+ /**
65
+ * @inheritDoc
66
+ *
67
+ * @since [*next-version*]
68
+ */
69
+ public function getItems(Source $source, ?int $limit = null, int $offset = 0) : Result
70
+ {
71
+ // The final result
72
+ $result = Result::empty();
73
+ $result->data['errors'] = [];
74
+
75
+ // Normalize the limit and offset
76
+ $limit = max($limit ?? 0, 0);
77
+ $offset = max($offset, 0);
78
+ $hasLimit = $limit > 0;
79
+
80
+ // Create the first batch
81
+ $batch = Result::success([], [], function () use ($source, $offset) {
82
+ return $this->provider->getItems($source, $this->batchSize, $offset);
83
+ });
84
+
85
+ // Counter for number of items that were imported
86
+ $count = 0;
87
+
88
+ // Iterate for as long as we have available batches
89
+ while ($batch->next && (!$hasLimit || $count < $limit)) {
90
+ // Fetch the batch
91
+ $batch = $batch->getNextResult();
92
+
93
+ // Record any errors generated from fetching the batch
94
+ $result->errors = array_merge($result->errors, $batch->errors);
95
+
96
+ // If successful, import the items. Otherwise create an error to stop iterating
97
+ if ($batch->success) {
98
+ $count += count($batch->items);
99
+ $numExcess = max($count - $limit, 0);
100
+
101
+ // If importing these items will go over the limit, slice the items to get a subset
102
+ if ($hasLimit && $numExcess > 0) {
103
+ $batchSize = count($batch->items) - $numExcess;
104
+ $batch->items = array_slice($batch->items, 0, $batchSize);
105
+ }
106
+
107
+ if ($hasLimit) {
108
+ $count = min($count, $limit);
109
+ }
110
+
111
+ if (count($batch->items) > 0) {
112
+ // If a callback is set, invoke it to get a sub-result
113
+ if (is_callable($this->callback)) {
114
+ /* @var $cbResult Result */
115
+ $cbResult = ($this->callback)($batch->items);
116
+
117
+ $result->items = array_merge($result->items, $cbResult->items);
118
+ $result->errors = array_merge($result->errors, $cbResult->errors);
119
+ } else {
120
+ $result->items = array_merge($result->items, $batch->items);
121
+ }
122
+ } else {
123
+ // If we got an empty batch, either we reached the limit or the provider has no more items to give
124
+ break;
125
+ }
126
+ }
127
+ }
128
+
129
+ return $result;
130
+ }
131
+ }
engine/Fetching/CompositeItemProvider.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris\Fetching;
4
+
5
+ use RebelCode\Iris\Result;
6
+ use RebelCode\Iris\Source;
7
+
8
+ /**
9
+ * An {@link ItemProvider} implementation that provides items from multiple other providers.
10
+ *
11
+ * @since [*next-version*]
12
+ */
13
+ class CompositeItemProvider implements ItemProvider
14
+ {
15
+ /**
16
+ * @since [*next-version*]
17
+ *
18
+ * @var ItemProvider[]
19
+ */
20
+ protected $providers;
21
+
22
+ /**
23
+ * Constructor.
24
+ *
25
+ * @since [*next-version*]
26
+ *
27
+ * @param ItemProvider[] $providers
28
+ */
29
+ public function __construct(array $providers)
30
+ {
31
+ $this->providers = $providers;
32
+ }
33
+
34
+ public function getItems(Source $source, ?int $limit = null, int $offset = 0) : Result
35
+ {
36
+ $result = new Result();
37
+
38
+ foreach ($this->providers as $provider) {
39
+ $result = $result->merge($provider->getItems($source, $limit, $offset));
40
+ }
41
+
42
+ return $result;
43
+ }
44
+ }
engine/Fetching/DelegateItemProvider.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris\Fetching;
4
+
5
+ use RebelCode\Iris\Result;
6
+ use RebelCode\Iris\Source;
7
+
8
+ /**
9
+ * A provider implementation that delegates to a child provider based on the type of the given source.
10
+ *
11
+ * Example usage:
12
+ * ```
13
+ * $provider = new DelegateItemProvider([
14
+ * 'foo' => $fooProvider,
15
+ * 'bar' => $barProvider,
16
+ * ]);
17
+ *
18
+ * $provider->getItems(Source::create('test', 'foo')); // uses $fooProvider
19
+ * $provider->getItems(Source::create('test', 'bar')); // uses $barProvider
20
+ * ```
21
+ *
22
+ * @since [*next-version*]
23
+ */
24
+ class DelegateItemProvider implements ItemProvider
25
+ {
26
+ /**
27
+ * A map of source types as keys to providers.
28
+ *
29
+ * @since [*next-version*]
30
+ *
31
+ * @var ItemProvider[]
32
+ */
33
+ protected $providers;
34
+
35
+ /**
36
+ * Constructor.
37
+ *
38
+ * @since [*next-version*]
39
+ *
40
+ * @param ItemProvider[] $providers A map of source types as keys to provider instances.
41
+ */
42
+ public function __construct(array $providers)
43
+ {
44
+ $this->providers = $providers;
45
+ }
46
+
47
+ /**
48
+ * Creates a new instance.
49
+ *
50
+ * @since [*next-version*]
51
+ *
52
+ * @param array $providers A map of source types as keys to provider instances.
53
+ *
54
+ * @return self The created instance.
55
+ */
56
+ public static function create(array $providers) : self
57
+ {
58
+ return new self($providers);
59
+ }
60
+
61
+ /**
62
+ * @inheritDoc
63
+ *
64
+ * @since [*next-version*]
65
+ */
66
+ public function getItems(Source $source, ?int $number = null, int $offset = 0) : Result
67
+ {
68
+ return array_key_exists($source->type, $this->providers)
69
+ ? $this->providers[$source->type]->getItems($source, $number, $offset)
70
+ : Result::empty();
71
+ }
72
+ }
engine/Fetching/FallbackItemProvider.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris\Fetching;
4
+
5
+ use RebelCode\Iris\Result;
6
+ use RebelCode\Iris\Source;
7
+
8
+ /**
9
+ * A provider implementation that attempts to get items from multiple providers.
10
+ *
11
+ * This implementation will return items from the first provider that does so. Whenever a child provider returns an
12
+ * erroneous result or a result without any items, the next provider is used. This process repeats until the criteria
13
+ * are met. If none of the children providers' results meet the criteria, an erroneous result is returned.
14
+ *
15
+ * A very useful case for this implementation is caching, using two children providers. The first provider would attempt
16
+ * to get items from a cache. If that fails, the second provider is used which would retrieve the items from the desired
17
+ * resource such as a remote server.
18
+ *
19
+ * @since [*next-version*]
20
+ */
21
+ class FallbackItemProvider implements ItemProvider
22
+ {
23
+ /**
24
+ * @since [*next-version*]
25
+ *
26
+ * @var ItemProvider[]
27
+ */
28
+ protected $providers;
29
+
30
+ /**
31
+ * Constructor.
32
+ *
33
+ * @since [*next-version*]
34
+ *
35
+ * @param ItemProvider[] $providers
36
+ */
37
+ public function __construct(array $providers)
38
+ {
39
+ $this->providers = $providers;
40
+ }
41
+
42
+ /**
43
+ * @inheritDoc
44
+ *
45
+ * @since [*next-version*]
46
+ */
47
+ public function getItems(Source $source, ?int $number = null, int $offset = 0) : Result
48
+ {
49
+ foreach ($this->providers as $provider) {
50
+ $result = $provider->getItems($source, $number, $offset);
51
+
52
+ if ($result->success && !empty($result->items)) {
53
+ return $result;
54
+ }
55
+ }
56
+
57
+ return Result::error('No item providers are available', __CLASS__ . '_1');
58
+ }
59
+ }
engine/Fetching/ItemProvider.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris\Fetching;
4
+
5
+ use RebelCode\Iris\Result;
6
+ use RebelCode\Iris\Source;
7
+
8
+ /**
9
+ * A provider is any resource that can provide items given a source.
10
+ *
11
+ * A provider does not need to necessarily represent a discrete location or endpoint. It may represent an entire set,
12
+ * from which a discrete provider can be selected using a {@link Source}. For instance, it's possible to have a single
13
+ * provider represent the entire internet that selects servers using data within the given {@link Source}. For this
14
+ * reason, a provider is comparable to a map; given a source, the list of items that corresponds to that source will be
15
+ * retrieved.
16
+ *
17
+ * The size and region of the list to be returned can be controlled using limit and offset pagination controls. Further
18
+ * regions of the list may be retrieved using the return result's {@link Result::next} callback, if it's available. It
19
+ * is recommended to use the {@link Result::getNextResult()} method to safely fetch any additional results or the
20
+ * {@link Result::withNextResult()} method to obtain a combined version of the current result and the next.
21
+ *
22
+ * @since [*next-version*]
23
+ */
24
+ interface ItemProvider
25
+ {
26
+ /**
27
+ * Retrieves items from the provider.
28
+ *
29
+ * @since [*next-version*]
30
+ *
31
+ * @param Source $source The source for which to retrieve items.
32
+ * @param int|null $limit Optional limit for the number of items to fetch.
33
+ * @param int $offset Optional number of items to skip when fetching.
34
+ *
35
+ * @return Result The result.
36
+ */
37
+ public function getItems(Source $source, ?int $limit = null, int $offset = 0) : Result;
38
+ }
engine/Importing/ItemImporter.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris\Importing;
4
+
5
+ use RebelCode\Iris\Fetching\BatchingItemProvider;
6
+ use RebelCode\Iris\Fetching\ItemProvider;
7
+ use RebelCode\Iris\Result;
8
+ use RebelCode\Iris\Source;
9
+
10
+ /**
11
+ * Imports items from an {@link ItemProvider} into an {@link ItemStore}.
12
+ *
13
+ * This implementation uses the {@link BatchingItemProvider} to import items into batches. Do **not** instantiate the
14
+ * importer with a {@link BatchingItemProvider}, otherwise double-batching will be in-effect. The batching performed
15
+ * by the implementation is able to leverage the store's {@link ItemStore::store()} method as the batching callback,
16
+ * allowing each batch to be stored once it is fetched, as opposed to waiting for all the batches to be fetched first
17
+ * and then all stored later.
18
+ *
19
+ * @since [*next-version*]
20
+ */
21
+ class ItemImporter
22
+ {
23
+ /**
24
+ * The store in which to import items.
25
+ *
26
+ * @since [*next-version*]
27
+ *
28
+ * @var ItemStore
29
+ */
30
+ protected $store;
31
+
32
+ /**
33
+ * The provider to use to obtain items to import.
34
+ *
35
+ * @since [*next-version*]
36
+ *
37
+ * @var ItemProvider
38
+ */
39
+ protected $provider;
40
+
41
+ /**
42
+ * The size of each import batch.
43
+ *
44
+ * @since [*next-version*]
45
+ *
46
+ * @var int
47
+ */
48
+ protected $batchSize;
49
+
50
+ /**
51
+ * Constructor.
52
+ *
53
+ * @since [*next-version*]
54
+ *
55
+ * @param ItemStore $store The store in which to import items.
56
+ * @param ItemProvider $provider The provider to use to obtain items to import.
57
+ * @param int $batchSize The size of each import batch.
58
+ */
59
+ public function __construct(ItemStore $store, ItemProvider $provider, int $batchSize)
60
+ {
61
+ $this->store = $store;
62
+ $this->provider = $provider;
63
+ $this->batchSize = $batchSize;
64
+ }
65
+
66
+ /**
67
+ * Imports all items for a given source.
68
+ *
69
+ * @since [*next-version*]
70
+ *
71
+ * @param Source $source The source to import items for.
72
+ *
73
+ * @return Result The result.
74
+ */
75
+ public function import(Source $source) : Result
76
+ {
77
+ $provider = new BatchingItemProvider($this->provider, $this->batchSize, [$this->store, 'store']);
78
+
79
+ return $provider->getItems($source);
80
+ }
81
+ }
engine/Importing/ItemStore.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris\Importing;
4
+
5
+ use RebelCode\Iris\Fetching\ItemProvider;
6
+ use RebelCode\Iris\Item;
7
+ use RebelCode\Iris\Result;
8
+
9
+ /**
10
+ * Storage of items retrieved from an {@link ItemProvider}.
11
+ *
12
+ * @since [*next-version*]
13
+ */
14
+ interface ItemStore extends ItemProvider
15
+ {
16
+ /**
17
+ * Stores a given list of items.
18
+ *
19
+ * @since [*next-version*]
20
+ *
21
+ * @param Item[] $items The items to store.
22
+ *
23
+ * @return Result The result from storing the items. This result should **not** set a {@link Result::$next}
24
+ * callback. The {@link Result::$items} list should only contain items that were successfully added
25
+ * to the store, with any changes may have been made prior to storing them.
26
+ */
27
+ public function store(array $items) : Result;
28
+ }
engine/Item.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris;
4
+
5
+ /**
6
+ * Represents an item fetched from a source.
7
+ *
8
+ * @since [*next-version*]
9
+ */
10
+ class Item
11
+ {
12
+ /**
13
+ * A numeric ID that uniquely identifies this item.
14
+ *
15
+ * @since [*next-version*]
16
+ *
17
+ * @var int
18
+ */
19
+ public $id;
20
+
21
+ /**
22
+ * The source that fetched this item.
23
+ *
24
+ * @since [*next-version*]
25
+ *
26
+ * @var Source
27
+ */
28
+ public $source;
29
+
30
+ /**
31
+ * Any additional data for this item.
32
+ *
33
+ * @since [*next-version*]
34
+ *
35
+ * @var array
36
+ */
37
+ public $data;
38
+
39
+ /**
40
+ * Constructor.
41
+ *
42
+ * @since [*next-version*]
43
+ *
44
+ * @param int $id The ID of the item.
45
+ * @param Source $source The source that fetched this item.
46
+ * @param array $data Any additional data attached to the item.
47
+ *
48
+ * @return self The created item.
49
+ */
50
+ public static function create(int $id, Source $source, array $data = []) : self
51
+ {
52
+ $item = new static();
53
+
54
+ $item->id = $id;
55
+ $item->source = $source;
56
+ $item->data = $data;
57
+
58
+ return $item;
59
+ }
60
+ }
engine/Result.php ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris;
4
+
5
+ use RebelCode\Iris\Fetching\ItemProvider;
6
+
7
+ /**
8
+ * Contain results generated by an operator that works with lists of {@link Item} instances.
9
+ *
10
+ * Results can be either successful, erroneous or a mix of both. When the {@link Result::$success} flag is set to true,
11
+ * consumers can assume that the operator was successful in retrieving items, either entirely or in part. To assert
12
+ * to what extent the retrieval was successful, consumers should check the {@link Result::$errors} list. If the list is
13
+ * empty, then retrieval was entirely successful. Otherwise, some problems arose during the retrieval process that did
14
+ * not warrant a total failure. Operators are left to their own discretion on how to decide what is considered a total
15
+ * failure and what isn't.
16
+ *
17
+ * On the contrary, when the {@link Result::$success} flag is set to false, consumers can assume that the operation has
18
+ * failed entirely and no meaningful result could be obtained. In this scenario, consumers can also assume that there
19
+ * will be at least one error in the {@link Result::$errors} list.
20
+ *
21
+ * Retrieved items can be read from the {@link Result::$items} array. This array should be assumed to be numeric.
22
+ *
23
+ * It is possible for an operator to indicate success while also not providing any items in the result. Consumers are
24
+ * advised to first check whether the {@link Result::$success} flag is false to handle a complete failure. In the
25
+ * event of a true value, consumers may proceed assuming success. However, the {@link Result::$errors} should be
26
+ * handled
27
+ * in some way, whether by the direct or a delegated consumer.
28
+ *
29
+ * Additional data can be attached to the result using the {@link Result::$data} associative array. Any data stored in
30
+ * this property is non-standard and should only be depended on when explicitly dealing with specific operator
31
+ * implementations. For instance, HTTP headers may be stored when working with an HTTP {@link ItemProvider}.
32
+ *
33
+ * Finally, results may optionally provide a means by which more results can be obtained. This is done through the
34
+ * {@link Result::$next} callback. If not null, this property should be a callback which, when called returns a new
35
+ * {@link Result} instance. This callback should NOT depend on any arguments. This callback is typically set by a
36
+ * {@link ItemProvider} instance to allow consumers to easily retrieve the next batch of items, in cases where the
37
+ * provider was given a limit or the results need to be paginated.
38
+ *
39
+ * @since [*next-version*]
40
+ */
41
+ class Result
42
+ {
43
+ /**
44
+ * Whether or not item retrieval was successful.
45
+ *
46
+ * @since [*next-version*]
47
+ *
48
+ * @var bool
49
+ */
50
+ public $success = true;
51
+
52
+ /**
53
+ * The error if item retrieval failed, or null if successful.
54
+ *
55
+ * @since [*next-version*]
56
+ *
57
+ * @var Error[]
58
+ */
59
+ public $errors = [];
60
+
61
+ /**
62
+ * The retrieved items.
63
+ *
64
+ * @since [*next-version*]
65
+ *
66
+ * @var Item[]
67
+ */
68
+ public $items = [];
69
+
70
+ /**
71
+ * Any addition data attached to the result.
72
+ *
73
+ * @since [*next-version*]
74
+ *
75
+ * @var array
76
+ */
77
+ public $data = [];
78
+
79
+ /**
80
+ * A callback to get the next batch of items, or null if no more items to retrieve.
81
+ *
82
+ * @since [*next-version*]
83
+ *
84
+ * @var callable|null
85
+ */
86
+ public $next = null;
87
+
88
+ /**
89
+ * Checks whether the result has errors.
90
+ *
91
+ * @since [*next-version*]
92
+ *
93
+ * @return bool True if the result has errors, false if not.
94
+ */
95
+ public function hasErrors()
96
+ {
97
+ return count($this->errors) > 0;
98
+ }
99
+
100
+ /**
101
+ * Helper method to safely invoke the result's {@link Result::$next} callback, if one is set.
102
+ *
103
+ * @since [*next-version*]
104
+ *
105
+ * @return Result The result. An empty result will be returned if the {@link Result::$next} callback is null.
106
+ */
107
+ public function getNextResult() : ?Result
108
+ {
109
+ return $this->next !== null ? ($this->next)() : new Result();
110
+ }
111
+
112
+ /**
113
+ * Retrieves the next result, if one is available, and merges this instance with the new result.
114
+ *
115
+ * @since [*next-version*]
116
+ *
117
+ * @return static The merged result, or the same instance if no {@link Result::$next} callback is set.
118
+ */
119
+ public function withNextResult()
120
+ {
121
+ if ($this->next === null) {
122
+ return $this;
123
+ } else {
124
+ $result = $this->getNextResult();
125
+
126
+ if (!$result->hasErrors()) {
127
+ $result->items = array_merge($this->items, $result->items);
128
+ }
129
+
130
+ return $result;
131
+ }
132
+ }
133
+
134
+ /**
135
+ * Merges this result with another.
136
+ *
137
+ * @since [*next-version*]
138
+ *
139
+ * @param Result $other The result to merge with.
140
+ * @param bool $mergeNext Whether to merge the {@link Result::$next} callback or not.
141
+ *
142
+ * @return Result The merged result.
143
+ */
144
+ public function merge(Result $other, bool $mergeNext = true)
145
+ {
146
+ $new = new Result();
147
+ $new->success = $this->success || $other->success;
148
+ $new->items = array_merge($this->items, $other->items);
149
+ $new->data = array_merge($this->data, $other->data);
150
+ $new->errors = array_merge($this->errors, $other->errors);
151
+
152
+ if ($mergeNext) {
153
+ $new->next = function () use ($other) {
154
+ $r1 = $this->getNextResult();
155
+ $r2 = $other->getNextResult();
156
+
157
+ return $r1->merge($r2);
158
+ };
159
+ }
160
+
161
+ return $new;
162
+ }
163
+
164
+ /**
165
+ * Creates a successful result.
166
+ *
167
+ * @since [*next-version*]
168
+ *
169
+ * @param array $items The items.
170
+ * @param array $data Optional data to store in the result.
171
+ * @param callable|null $next Optional callback to get the next batch of items.
172
+ *
173
+ * @return self The created result.
174
+ */
175
+ public static function success(array $items, array $data = [], callable $next = null) : self
176
+ {
177
+ $result = new static();
178
+
179
+ $result->success = true;
180
+ $result->errors = [];
181
+ $result->items = $items;
182
+ $result->data = $data;
183
+ $result->next = $next;
184
+
185
+ return $result;
186
+ }
187
+
188
+ /**
189
+ * Creates an erroneous result.
190
+ *
191
+ * @since [*next-version*]
192
+ *
193
+ * @param string $message The error message.
194
+ * @param string $code The error code.
195
+ *
196
+ * @return Result The created result.
197
+ */
198
+ public static function error(string $message, string $code = '') : self
199
+ {
200
+ $result = new static();
201
+
202
+ $result->success = false;
203
+ $result->errors = [new Error($message, $code)];
204
+
205
+ return $result;
206
+ }
207
+
208
+ /**
209
+ * Creates an empty result.
210
+ *
211
+ * @since [*next-version*]
212
+ *
213
+ * @return static The created result.
214
+ */
215
+ public static function empty()
216
+ {
217
+ return new static();
218
+ }
219
+ }
engine/Source.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Iris;
4
+
5
+ use RebelCode\Iris\Fetching\ItemProvider;
6
+
7
+ /**
8
+ * A data structure for an item's source.
9
+ *
10
+ * Sources are primarily used to determine how and/or which items should be fetched from an {@link ItemProvider}.
11
+ * Typically, sources will contain information about accounts, categories, collections or other similar item-specific
12
+ * parameters. They may also contain remote-specific information such as URLs, host names, IP addresses, file paths
13
+ * and so-on. However, it is preferable to defer this resolution to an {@link ItemProvider}.
14
+ *
15
+ * Sources should be constructable using static consumer data, meaning they should not contain any functional data
16
+ * such as class instances or callbacks.
17
+ *
18
+ * Item sources as primarily used to determine or distinguish the remote source for items. These can be URLs, host
19
+ * names, IP addresses, file paths, etc.
20
+ *
21
+ * Sources must be able to be uniquely identified via their {@link Source::$key}. This key is most notably used in
22
+ * equivalence checks to determine if an item was fetched from this source or to query for items that were fetched
23
+ * for this source. For reliability, it is advised to generate the key using the uniqueness of a source's data.
24
+ *
25
+ * In contrast, the {@link Source::$type} is treated as a form of "enum" and is used to allow an {@link ItemProvider}
26
+ * to utilize different fetch methods depending on its value.
27
+ *
28
+ * @since [*next-version*]
29
+ */
30
+ class Source
31
+ {
32
+ /**
33
+ * A string key, used to uniquely identify the source.
34
+ *
35
+ * @since [*next-version*]
36
+ *
37
+ * @var string
38
+ */
39
+ public $key;
40
+
41
+ /**
42
+ * The type of the source, typically used to determine what fetching mechanism should be used.
43
+ *
44
+ * @since [*next-version*]
45
+ *
46
+ * @var string
47
+ */
48
+ public $type;
49
+
50
+ /**
51
+ * Any other data related to the source.
52
+ *
53
+ * @since [*next-version*]
54
+ *
55
+ * @var array
56
+ */
57
+ public $data;
58
+
59
+ /**
60
+ * Constructor.
61
+ *
62
+ * @since [*next-version*]
63
+ *
64
+ * @param string $key The key that identifies the source.
65
+ * @param string $type The type for this source.
66
+ * @param array $data Any additional data attached to this source.
67
+ */
68
+ public function __construct(string $key, string $type, array $data = [])
69
+ {
70
+ $this->key = $key;
71
+ $this->type = $type;
72
+ $this->data = $data;
73
+ }
74
+
75
+ /**
76
+ * Static constructor.
77
+ *
78
+ * @since [*next-version*]
79
+ *
80
+ * @param string $key The key that identifies the source.
81
+ * @param string $type The type for this source.
82
+ * @param array $data Any additional data attached to this source.
83
+ *
84
+ * @return self The created source.
85
+ */
86
+ public static function create(string $key, string $type, array $data = []) : self
87
+ {
88
+ return new static($key, $type, $data);
89
+ }
90
+
91
+ /**
92
+ * Creates a new source with an automatically generated key.
93
+ *
94
+ * Do NOT rely on uniqueness if the source has data with nested arrays, unless you are sure that the order of the
95
+ * data in sub-arrays is always the same.
96
+ *
97
+ * @since [*next-version*]
98
+ *
99
+ * @param string $type The type for this source.
100
+ * @param array $data Any additional data attached to this source.
101
+ *
102
+ * @return self The created source.
103
+ */
104
+ public static function auto(string $type, array $data = []) : self
105
+ {
106
+ ksort($data);
107
+ $hashData = compact('type', 'data');
108
+ $hash = sha1(json_encode($hashData));
109
+
110
+ return new static($hash, $type, $data);
111
+ }
112
+ }
freemius.php CHANGED
@@ -57,6 +57,8 @@ if ( !function_exists( 'sliFreemius' ) ) {
57
  sliFreemius()->add_filter( 'show_affiliate_program_notice', '__return_false' );
58
  // Disable auto deactivation
59
  sliFreemius()->add_filter( 'deactivate_on_activation', '__return_false' );
 
 
60
  // Signal that SDK was initiated.
61
  do_action( 'sli_freemius_loaded' );
62
  }
57
  sliFreemius()->add_filter( 'show_affiliate_program_notice', '__return_false' );
58
  // Disable auto deactivation
59
  sliFreemius()->add_filter( 'deactivate_on_activation', '__return_false' );
60
+ // Disable redirect on activation
61
+ sliFreemius()->add_filter( 'redirect_on_activation', '__return_false' );
62
  // Signal that SDK was initiated.
63
  do_action( 'sli_freemius_loaded' );
64
  }
includes/init.php CHANGED
@@ -116,31 +116,17 @@ if (!function_exists('slInstaRunPlugin')) {
116
  global $slInsta;
117
 
118
  if (!isset($slInsta)) {
119
- if (!function_exists('get_plugin_data')) {
120
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
121
- }
122
 
123
  $slInsta = new SlInstaRuntime();
124
- $slInstaPlugins = [];
125
 
126
- // Get the plugins that are active
127
- // We need to manually check if the plugin that triggered this script is active and add it to the list
128
- // since it won't be available in the option if it was activated in this request
129
- $activePlugins = get_option('active_plugins');
130
  $thisBaseName = plugin_basename($mainFile);
131
- if (!is_plugin_active($thisBaseName)) {
132
- $activePlugins[] = $thisBaseName;
133
- }
134
-
135
- foreach ($activePlugins as $basename) {
136
- $info = slInstaPluginInfo($basename);
137
-
138
- if ($info === null) {
139
- continue;
140
- }
141
-
142
- $slInstaPlugins[] = $info;
143
 
 
144
  $slInsta->isFreeActive = $slInsta->isFreeActive || !$info->isPro;
145
  $slInsta->isProActive = $slInsta->isProActive || $info->isPro;
146
 
@@ -185,6 +171,26 @@ if (!function_exists('slInstaRunPlugin')) {
185
  }
186
  }
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  if (!function_exists('slInstaPluginInfo')) {
189
  /**
190
  * Retrieves information about a plugin, if it's a copy of Spotlight of any tier or version.
@@ -224,9 +230,7 @@ if (!function_exists('slInstaPluginInfo')) {
224
 
225
  // Pre-v0.4 we have to parse the plugin header data to get the version and look for the PRO modules directory
226
  if ($info === null && stripos($basename, 'spotlight-social') !== false) {
227
- if (!function_exists('get_plugin_data')) {
228
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
229
- }
230
 
231
  $pluginData = get_plugin_data($file);
232
 
@@ -488,3 +492,123 @@ if (!function_exists('slInstaGetActivateUrl')) {
488
  ]);
489
  }
490
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  global $slInsta;
117
 
118
  if (!isset($slInsta)) {
119
+ slInstaLoadWpPluginFunctions();
 
 
120
 
121
  $slInsta = new SlInstaRuntime();
 
122
 
123
+ // Get the Spotlight plugin instances that are active
124
+ // We need to tell the function to include the plugin that triggered this script
125
+ // since it may not yet be marked as "active" in the DB option if it was activated in this request
 
126
  $thisBaseName = plugin_basename($mainFile);
127
+ $slInstaPlugins = slInstaGetPluginInstances([$thisBaseName]);
 
 
 
 
 
 
 
 
 
 
 
128
 
129
+ foreach ($slInstaPlugins as $info) {
130
  $slInsta->isFreeActive = $slInsta->isFreeActive || !$info->isPro;
131
  $slInsta->isProActive = $slInsta->isProActive || $info->isPro;
132
 
171
  }
172
  }
173
 
174
+ if (!function_exists('slInstaGetPluginInstances')) {
175
+ function slInstaGetPluginInstances(array $include = [])
176
+ {
177
+ slInstaLoadWpPluginFunctions();
178
+
179
+ $activePlugins = array_merge(get_option('active_plugins'), $include);
180
+ $instances = [];
181
+
182
+ foreach ($activePlugins as $basename) {
183
+ $info = slInstaPluginInfo($basename);
184
+
185
+ if ($info !== null) {
186
+ $instances[$basename] = $info;
187
+ }
188
+ }
189
+
190
+ return $instances;
191
+ }
192
+ }
193
+
194
  if (!function_exists('slInstaPluginInfo')) {
195
  /**
196
  * Retrieves information about a plugin, if it's a copy of Spotlight of any tier or version.
230
 
231
  // Pre-v0.4 we have to parse the plugin header data to get the version and look for the PRO modules directory
232
  if ($info === null && stripos($basename, 'spotlight-social') !== false) {
233
+ slInstaLoadWpPluginFunctions();
 
 
234
 
235
  $pluginData = get_plugin_data($file);
236
 
492
  ]);
493
  }
494
  }
495
+
496
+ if (!function_exists('slInstaCheckForConflicts')) {
497
+ function slInstaCheckForConflicts($ignore = null)
498
+ {
499
+ slInstaLoadWpPluginFunctions();
500
+
501
+ $conflicts = [];
502
+ foreach (slInstaGetConflictingPlugins() as $plugin => $info) {
503
+ if (is_plugin_active($plugin) && $plugin !== $ignore) {
504
+ $conflicts[] = $info;
505
+ }
506
+ }
507
+
508
+ if (empty($conflicts)) {
509
+ delete_option('sli_plugin_conflicts');
510
+ } else {
511
+ update_option('sli_plugin_conflicts', $conflicts);
512
+ }
513
+ }
514
+ }
515
+
516
+ if (!function_exists('slInstaShowConflictsNotice')) {
517
+ function slInstaShowConflictsNotice()
518
+ {
519
+ if (filter_input(INPUT_GET, 'sli_ignore_conflicts') === '1') {
520
+ delete_option('sli_plugin_conflicts');
521
+
522
+ return false;
523
+ }
524
+
525
+ $conflicts = get_option('sli_plugin_conflicts');
526
+
527
+ if (!is_array($conflicts) || empty($conflicts)) {
528
+ return false;
529
+ }
530
+
531
+ add_action('admin_notices', function () use ($conflicts) {
532
+ ?>
533
+ <div class="notice notice-error">
534
+ <p>
535
+ <?php
536
+ printf(
537
+ _x(
538
+ '%s has detected incompatibility with some of your plugins.',
539
+ '%s is the name of the plugin',
540
+ 'sl-insta'
541
+ ),
542
+ '<b>' . SL_INSTA_NAME . '</b>'
543
+ )
544
+ ?>
545
+ </p>
546
+ <ol>
547
+ <?php foreach ($conflicts as $plugin => $info) : ?>
548
+ <li><b><?= $info['name'] ?></b> &mdash; <i><?= $info['reason'] ?></i></li>
549
+ <?php endforeach; ?>
550
+ </ol>
551
+ <p><?= __('You can choose to ignore these conflicts, but do so at your own risk', 'sl-insta') ?></p>
552
+ <p>
553
+ <a class="button button-secondary" href="<?= add_query_arg(['sli_ignore_conflicts' => '1']) ?>">
554
+ <?= __('Ignore conflicts', 'sl-insta') ?>
555
+ </a>
556
+ </p>
557
+ </div>
558
+ <?php
559
+ });
560
+
561
+ return true;
562
+ }
563
+ }
564
+
565
+ if (!function_exists('slInstaGetConflictingPlugins')) {
566
+ function slInstaGetConflictingPlugins()
567
+ {
568
+ return [
569
+ 'google-calendar-events/google-calendar-events.php' => [
570
+ 'name' => 'Simple Calendar',
571
+ 'reason' => __(
572
+ 'Both plugins use the Guzzle HTTP library but at different versions, causing a fatal error.',
573
+ 'sl-insta'
574
+ ),
575
+ ],
576
+ ];
577
+ }
578
+ }
579
+
580
+ if (!function_exists('slInstaLoadWpPluginFunctions')) {
581
+ function slInstaLoadWpPluginFunctions()
582
+ {
583
+ if (!function_exists('get_plugin_data')) {
584
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
585
+ }
586
+ }
587
+ }
588
+
589
+ if (!function_exists('slInstaCheckDeactivate')) {
590
+ function slInstaCheckDeactivate()
591
+ {
592
+ // Check for error deactivation
593
+ $errorDeactivate = filter_input(INPUT_GET, 'sli_error_deactivate');
594
+
595
+ if (!empty($errorDeactivate)) {
596
+ add_action('init', function () use ($errorDeactivate) {
597
+ if (wp_verify_nonce($errorDeactivate, 'sli_error_deactivate') !== false) {
598
+ slInstaLoadWpPluginFunctions();
599
+
600
+ $instances = slInstaGetPluginInstances();
601
+ $plugins = array_map(function ($info) {
602
+ return $info->basename;
603
+ }, $instances);
604
+
605
+ deactivate_plugins($plugins);
606
+ }
607
+ });
608
+
609
+ return true;
610
+ } else {
611
+ return false;
612
+ }
613
+ }
614
+ }
modules.php CHANGED
@@ -3,6 +3,7 @@
3
  use RebelCode\Spotlight\Instagram\Modules\AccountsModule ;
4
  use RebelCode\Spotlight\Instagram\Modules\CleanUpCronModule ;
5
  use RebelCode\Spotlight\Instagram\Modules\ConfigModule ;
 
6
  use RebelCode\Spotlight\Instagram\Modules\FeedsModule ;
7
  use RebelCode\Spotlight\Instagram\Modules\ImportCronModule ;
8
  use RebelCode\Spotlight\Instagram\Modules\InstagramModule ;
@@ -24,6 +25,7 @@ $modules = [
24
  'feeds' => new FeedsModule(),
25
  'accounts' => new AccountsModule(),
26
  'media' => new MediaModule(),
 
27
  'importer' => new ImportCronModule(),
28
  'cleaner' => new CleanUpCronModule(),
29
  'token_refresher' => new TokenRefresherModule(),
3
  use RebelCode\Spotlight\Instagram\Modules\AccountsModule ;
4
  use RebelCode\Spotlight\Instagram\Modules\CleanUpCronModule ;
5
  use RebelCode\Spotlight\Instagram\Modules\ConfigModule ;
6
+ use RebelCode\Spotlight\Instagram\Modules\EngineModule ;
7
  use RebelCode\Spotlight\Instagram\Modules\FeedsModule ;
8
  use RebelCode\Spotlight\Instagram\Modules\ImportCronModule ;
9
  use RebelCode\Spotlight\Instagram\Modules\InstagramModule ;
25
  'feeds' => new FeedsModule(),
26
  'accounts' => new AccountsModule(),
27
  'media' => new MediaModule(),
28
+ 'engine' => new EngineModule(),
29
  'importer' => new ImportCronModule(),
30
  'cleaner' => new CleanUpCronModule(),
31
  'token_refresher' => new TokenRefresherModule(),
modules/Dev/DevPage.php CHANGED
@@ -112,13 +112,13 @@ class DevPage
112
  <p>Remove all plugin data from the database</p>
113
  <p>
114
  <label>
115
- <input type="checkbox" name="sli_reset_keep_accounts" value="1" />
116
  Keep accounts
117
  </label>
118
  </p>
119
  <p>
120
  <label>
121
- <input type="checkbox" name="sli_reset_keep_feeds" value="1" />
122
  Keep feeds
123
  </label>
124
  </p>
@@ -195,6 +195,7 @@ class DevPage
195
  <th class="sli-db-col-type">Type</th>
196
  <th class="sli-db-col-source">Source</th>
197
  <th class="sli-db-col-date">Date &amp; Time</th>
 
198
  </tr>
199
  <?php
200
  };
@@ -290,6 +291,9 @@ class DevPage
290
  ?>
291
  </td>
292
  <td class="sli-db-col-date"><?= $media->{MediaPostType::TIMESTAMP} ?></td>
 
 
 
293
  </tr>
294
  <?php endforeach; ?>
295
  </tbody>
112
  <p>Remove all plugin data from the database</p>
113
  <p>
114
  <label>
115
+ <input type="checkbox" name="sli_reset_keep_accounts" value="1" checked />
116
  Keep accounts
117
  </label>
118
  </p>
119
  <p>
120
  <label>
121
+ <input type="checkbox" name="sli_reset_keep_feeds" value="1" checked />
122
  Keep feeds
123
  </label>
124
  </p>
195
  <th class="sli-db-col-type">Type</th>
196
  <th class="sli-db-col-source">Source</th>
197
  <th class="sli-db-col-date">Date &amp; Time</th>
198
+ <th class="sli-db-col-last-seen">Last seen</th>
199
  </tr>
200
  <?php
201
  };
291
  ?>
292
  </td>
293
  <td class="sli-db-col-date"><?= $media->{MediaPostType::TIMESTAMP} ?></td>
294
+ <td class="sli-db-col-last-seen">
295
+ <?= date(DATE_ISO8601, $media->{MediaPostType::LAST_REQUESTED}) ?>
296
+ </td>
297
  </tr>
298
  <?php endforeach; ?>
299
  </tbody>
modules/EngineModule.php ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace RebelCode\Spotlight\Instagram\Modules;
4
+
5
+ use Dhii\Services\Factories\Constructor;
6
+ use Dhii\Services\Factories\ServiceList;
7
+ use Dhii\Services\Factories\Value;
8
+ use Dhii\Services\Factory;
9
+ use Psr\Container\ContainerInterface;
10
+ use RebelCode\Iris\Aggregation\ItemAggregator;
11
+ use RebelCode\Iris\Engine;
12
+ use RebelCode\Iris\Fetching\DelegateItemProvider;
13
+ use RebelCode\Iris\Importing\ItemImporter;
14
+ use RebelCode\Spotlight\Instagram\Engine\Aggregation\MediaSorterProcessor;
15
+ use RebelCode\Spotlight\Instagram\Engine\Aggregation\MediaStorySegregator;
16
+ use RebelCode\Spotlight\Instagram\Engine\Aggregation\MediaTransformer;
17
+ use RebelCode\Spotlight\Instagram\Engine\Providers\IgAccountMediaProvider;
18
+ use RebelCode\Spotlight\Instagram\Engine\Sources\UserSource;
19
+ use RebelCode\Spotlight\Instagram\Engine\Stores\WpPostMediaStore;
20
+ use RebelCode\Spotlight\Instagram\Module;
21
+
22
+ /**
23
+ * The module that configures the Iris engine.
24
+ *
25
+ * @since 0.5
26
+ */
27
+ class EngineModule extends Module
28
+ {
29
+ /**
30
+ * @inheritDoc
31
+ *
32
+ * @since 0.5
33
+ */
34
+ public function run(ContainerInterface $c)
35
+ {
36
+ }
37
+
38
+ /**
39
+ * @inheritDoc
40
+ *
41
+ * @since 0.5
42
+ */
43
+ public function getFactories()
44
+ {
45
+ return [
46
+ //==========================================================================================================
47
+ // THE ENGINE
48
+ //==========================================================================================================
49
+
50
+ 'instance' => new Constructor(Engine::class, [
51
+ 'provider',
52
+ 'importer',
53
+ 'store',
54
+ 'aggregator',
55
+ ]),
56
+
57
+ //==========================================================================================================
58
+ // PROVIDER
59
+ //==========================================================================================================
60
+
61
+ // The provider for fetching media from the remote Instagram API for any type of source
62
+ 'provider' => new Constructor(DelegateItemProvider::class, ['provider/delegation']),
63
+
64
+ // The delegation map for the provider
65
+ 'provider/delegation' => new Factory(
66
+ ['providers/ig/personal', 'providers/ig/business'],
67
+ function ($personal, $business) {
68
+ return [
69
+ UserSource::TYPE_PERSONAL => $personal,
70
+ UserSource::TYPE_BUSINESS => $business,
71
+ ];
72
+ }
73
+ ),
74
+
75
+ // The provider for fetching media for IG personal accounts
76
+ 'providers/ig/personal' => new Factory(
77
+ ['@ig/client', '@accounts/cpt'],
78
+ [IgAccountMediaProvider::class, 'forPersonalAccount']
79
+ ),
80
+
81
+ // The provider for fetching media and stories for IG business accounts
82
+ 'providers/ig/business' => new Factory(
83
+ ['@ig/client', '@accounts/cpt'],
84
+ [IgAccountMediaProvider::class, 'forBusinessAccount']
85
+ ),
86
+
87
+ //==========================================================================================================
88
+ // IMPORTER
89
+ //==========================================================================================================
90
+
91
+ // The store for storing media as WordPress posts
92
+ 'importer' => new Constructor(ItemImporter::class, [
93
+ 'store',
94
+ 'provider',
95
+ 'importer/batch_size',
96
+ ]),
97
+
98
+ // The size of each import batch
99
+ 'importer/batch_size' => new Value(30),
100
+
101
+ //==========================================================================================================
102
+ // STORE
103
+ //==========================================================================================================
104
+
105
+ 'store' => new Constructor(WpPostMediaStore::class, ['@media/cpt']),
106
+
107
+ //==========================================================================================================
108
+ // AGGREGATOR
109
+ //==========================================================================================================
110
+
111
+ // The item aggregator for collecting items from multiple sources
112
+ 'aggregator' => new Factory(
113
+ ['store', 'aggregator/processors', 'aggregator/segregator', 'aggregator/transformer'],
114
+ function ($store, $processors, $segregator, $transformer) {
115
+ return new ItemAggregator($store, $processors, $segregator, $transformer);
116
+ }
117
+ ),
118
+
119
+ // The item processors to use in the aggregator
120
+ 'aggregator/processors' => new ServiceList([
121
+ 'aggregator/processors/sorter',
122
+ ]),
123
+
124
+ // The aggregator processor that sorts media according to a feed's options
125
+ 'aggregator/processors/sorter' => new Constructor(MediaSorterProcessor::class),
126
+
127
+ // The item transformer to use in the aggregator
128
+ 'aggregator/transformer' => new Constructor(MediaTransformer::class),
129
+
130
+ // The item segregator to use in the aggregator
131
+ 'aggregator/segregator' => new Constructor(MediaStorySegregator::class),
132
+ ];
133
+ }
134
+
135
+ /**
136
+ * @inheritDoc
137
+ *
138
+ * @since 0.5
139
+ */
140
+ public function getExtensions()
141
+ {
142
+ return [];
143
+ }
144
+ }
modules/FeedsModule.php CHANGED
@@ -6,6 +6,7 @@ use Dhii\Services\Extensions\ArrayExtension;
6
  use Dhii\Services\Factories\Constructor;
7
  use Dhii\Services\Factories\Value;
8
  use Psr\Container\ContainerInterface;
 
9
  use RebelCode\Spotlight\Instagram\Feeds\FeedTemplate;
10
  use RebelCode\Spotlight\Instagram\Module;
11
  use RebelCode\Spotlight\Instagram\PostTypes\FeedPostType;
@@ -48,6 +49,9 @@ class FeedsModule extends Module
48
 
49
  // The template that renders feeds
50
  'template' => new Constructor(FeedTemplate::class, []),
 
 
 
51
  ];
52
  }
53
 
6
  use Dhii\Services\Factories\Constructor;
7
  use Dhii\Services\Factories\Value;
8
  use Psr\Container\ContainerInterface;
9
+ use RebelCode\Spotlight\Instagram\Feeds\FeedManager;
10
  use RebelCode\Spotlight\Instagram\Feeds\FeedTemplate;
11
  use RebelCode\Spotlight\Instagram\Module;
12
  use RebelCode\Spotlight\Instagram\PostTypes\FeedPostType;
49
 
50
  // The template that renders feeds
51
  'template' => new Constructor(FeedTemplate::class, []),
52
+
53
+ // The item feed manager
54
+ 'manager' => new Constructor(FeedManager::class, ['cpt', '@accounts/cpt']),
55
  ];
56
  }
57
 
modules/ImportCronModule.php CHANGED
@@ -72,8 +72,8 @@ class ImportCronModule extends Module
72
 
73
  // The cron handler for fetching media for saved accounts
74
  'media_handler' => new Constructor(ImportMediaAction::class, [
75
- '@feeds/cpt',
76
- '@media/store',
77
  ]),
78
 
79
  // The list of handlers for the cron
@@ -116,7 +116,7 @@ class ImportCronModule extends Module
116
  static::CFG_CRON_INTERVAL => 'config/interval',
117
  ]),
118
  // Override the API cache with the value of the import cron interval option
119
- '@ig/api/cache/ttl' => new Extension(['config/interval'], function ($ttl, ConfigEntry $interval) {
120
  return $interval->getValue();
121
  }),
122
  ];
72
 
73
  // The cron handler for fetching media for saved accounts
74
  'media_handler' => new Constructor(ImportMediaAction::class, [
75
+ '@feeds/manager',
76
+ '@engine/importer',
77
  ]),
78
 
79
  // The list of handlers for the cron
116
  static::CFG_CRON_INTERVAL => 'config/interval',
117
  ]),
118
  // Override the API cache with the value of the import cron interval option
119
+ 'ig/cache/ttl' => new Extension(['config/interval'], function ($ttl, ConfigEntry $interval) {
120
  return $interval->getValue();
121
  }),
122
  ];
modules/InstagramModule.php CHANGED
@@ -3,17 +3,24 @@
3
  namespace RebelCode\Spotlight\Instagram\Modules;
4
 
5
  use Dhii\Services\Factories\Constructor;
 
6
  use Dhii\Services\Factories\StringService;
7
  use Dhii\Services\Factories\Value;
8
  use Dhii\Services\Factory;
9
  use GuzzleHttp\Client;
 
 
 
 
10
  use Psr\Container\ContainerInterface;
11
  use RebelCode\Spotlight\Instagram\Actions\AuthCallbackListener;
12
  use RebelCode\Spotlight\Instagram\IgApi\IgApiClient;
13
  use RebelCode\Spotlight\Instagram\IgApi\IgBasicApiClient;
14
  use RebelCode\Spotlight\Instagram\IgApi\IgGraphApiClient;
15
  use RebelCode\Spotlight\Instagram\Module;
 
16
  use WpOop\TransientCache\CachePool;
 
17
 
18
  /**
19
  * The module that contains all functionality related to Instagram's APIs.
@@ -30,6 +37,66 @@ class InstagramModule extends Module
30
  public function getFactories() : array
31
  {
32
  return [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  //==========================================================================
34
  // API CLIENT
35
  //==========================================================================
@@ -62,7 +129,7 @@ class InstagramModule extends Module
62
  'api/auth/listener' => new Constructor(AuthCallbackListener::class, [
63
  'api/client',
64
  '@accounts/cpt',
65
- 'api/graph/auth_url'
66
  ]),
67
 
68
  //==========================================================================
@@ -77,7 +144,7 @@ class InstagramModule extends Module
77
  // The basic display API client
78
  'api/basic/client' => new Constructor(IgBasicApiClient::class, [
79
  'api/driver',
80
- 'api/cache',
81
  'api/basic/legacy_compensation',
82
  ]),
83
 
@@ -96,29 +163,7 @@ class InstagramModule extends Module
96
  // The Graph API client
97
  'api/graph/client' => new Constructor(IgGraphApiClient::class, [
98
  'api/driver',
99
- 'api/cache',
100
- ]),
101
-
102
- //==========================================================================
103
- // API CACHE
104
- //==========================================================================
105
-
106
- // The cache pool instance
107
- 'api/cache' => new Constructor(CachePool::class, [
108
- '@wp/db',
109
- 'api/cache/key',
110
- 'api/cache/default',
111
- ]),
112
-
113
- // The time-to-live for the cache (1 hour)
114
- 'api/cache/ttl' => new Value(3600),
115
-
116
- // The key for the cache pool
117
- 'api/cache/key' => new Value('sli_api'),
118
-
119
- // The default value for the cache pool - allows false-negative detection
120
- 'api/cache/default' => new StringService(uniqid('{key}'), [
121
- 'key' => 'api/cache/key',
122
  ]),
123
  ];
124
  }
3
  namespace RebelCode\Spotlight\Instagram\Modules;
4
 
5
  use Dhii\Services\Factories\Constructor;
6
+ use Dhii\Services\Factories\ServiceList;
7
  use Dhii\Services\Factories\StringService;
8
  use Dhii\Services\Factories\Value;
9
  use Dhii\Services\Factory;
10
  use GuzzleHttp\Client;
11
+ use GuzzleHttp\HandlerStack;
12
+ use Kevinrob\GuzzleCache\CacheMiddleware;
13
+ use Kevinrob\GuzzleCache\Storage\Psr16CacheStorage;
14
+ use Kevinrob\GuzzleCache\Strategy\GreedyCacheStrategy;
15
  use Psr\Container\ContainerInterface;
16
  use RebelCode\Spotlight\Instagram\Actions\AuthCallbackListener;
17
  use RebelCode\Spotlight\Instagram\IgApi\IgApiClient;
18
  use RebelCode\Spotlight\Instagram\IgApi\IgBasicApiClient;
19
  use RebelCode\Spotlight\Instagram\IgApi\IgGraphApiClient;
20
  use RebelCode\Spotlight\Instagram\Module;
21
+ use RebelCode\Spotlight\Instagram\Utils\Arrays;
22
  use WpOop\TransientCache\CachePool;
23
+ use WpOop\TransientCache\SilentPool;
24
 
25
  /**
26
  * The module that contains all functionality related to Instagram's APIs.
37
  public function getFactories() : array
38
  {
39
  return [
40
+ //==========================================================================
41
+ // GUZZLE CLIENT
42
+ //==========================================================================
43
+
44
+ // The Guzzle client instance
45
+ 'client' => new Factory(['client/handler', 'client/timeout'], function ($handler, $timeout) {
46
+ return new Client([
47
+ 'handler' => $handler,
48
+ 'timeout' => $timeout,
49
+ ]);
50
+ }),
51
+
52
+ // The default timeout for the Guzzle client
53
+ 'client/timeout' => new Value(20),
54
+
55
+ // The Guzzle client handler. Uses the middlewares
56
+ 'client/handler' => new Factory(['client/middlewares'], function ($middlewares) {
57
+ $stack = HandlerStack::create();
58
+ Arrays::each($middlewares, [$stack, 'push']);
59
+
60
+ return $stack;
61
+ }),
62
+
63
+ // Middleware for the Guzzle client
64
+ 'client/middlewares' => new ServiceList([
65
+ 'cache/middleware',
66
+ ]),
67
+
68
+ //==========================================================================
69
+ // API CACHE
70
+ //==========================================================================
71
+
72
+ // The cache middleware
73
+ 'cache/middleware' => new Factory(['cache/pool', 'cache/ttl'], function ($cachePool, $ttl) {
74
+ return new CacheMiddleware(
75
+ new GreedyCacheStrategy(
76
+ new Psr16CacheStorage($cachePool),
77
+ $ttl
78
+ )
79
+ );
80
+ }),
81
+
82
+ // The cache pool instance
83
+ 'cache/pool' => new Factory(['@wp/db', 'cache/pool/key', 'cache/pool/default'],
84
+ function ($wpdb, $key, $default) {
85
+ return new SilentPool(new CachePool($wpdb, $key, $default));
86
+ }
87
+ ),
88
+
89
+ // The time-to-live for the cache (1 hour)
90
+ 'cache/ttl' => new Value(3600),
91
+
92
+ // The key for the cache pool
93
+ 'cache/pool/key' => new Value('sli_api'),
94
+
95
+ // The default value for the cache pool - allows false-negative detection
96
+ 'cache/pool/default' => new StringService(uniqid('{key}'), [
97
+ 'key' => 'cache/pool/key',
98
+ ]),
99
+
100
  //==========================================================================
101
  // API CLIENT
102
  //==========================================================================
129
  'api/auth/listener' => new Constructor(AuthCallbackListener::class, [
130
  'api/client',
131
  '@accounts/cpt',
132
+ 'api/graph/auth_url',
133
  ]),
134
 
135
  //==========================================================================
144
  // The basic display API client
145
  'api/basic/client' => new Constructor(IgBasicApiClient::class, [
146
  'api/driver',
147
+ 'cache/pool',
148
  'api/basic/legacy_compensation',
149
  ]),
150
 
163
  // The Graph API client
164
  'api/graph/client' => new Constructor(IgGraphApiClient::class, [
165
  'api/driver',
166
+ 'cache/pool',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  ]),
168
  ];
169
  }
modules/RestApiModule.php CHANGED
@@ -26,8 +26,9 @@ use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Accounts\UpdateAccountEndPoi
26
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Feeds\DeleteFeedsEndpoint;
27
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Feeds\GetFeedsEndpoint;
28
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Feeds\SaveFeedsEndpoint;
29
- use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Media\FetchMediaEndPoint;
30
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Media\GetMediaEndPoint;
 
31
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Notifications\GetNotificationsEndPoint;
32
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Promotion\SearchPostsEndpoint;
33
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Settings\GetSettingsEndpoint;
@@ -73,7 +74,8 @@ class RestApiModule extends Module
73
  'endpoints/accounts/delete_media',
74
  'endpoints/accounts/get_access_token',
75
  'endpoints/media/get',
76
- 'endpoints/media/fetch',
 
77
  'endpoints/promotion/search_posts',
78
  'endpoints/settings/get',
79
  'endpoints/settings/patch',
@@ -257,24 +259,37 @@ class RestApiModule extends Module
257
 
258
  // The GET endpoint for retrieving the media posts that have been imported, without fetching new ones
259
  'endpoints/media/get' => new Factory(
260
- ['@media/cpt', 'media/transformer', 'auth/public'],
261
- function ($cpt, $t9r, $auth) {
262
  return new EndPoint(
263
  '/media',
264
  ['GET'],
265
- new GetMediaEndPoint($cpt, $t9r),
266
  $auth
267
  );
268
  }
269
  ),
270
  // The endpoint for fetching media posts from IG
271
- 'endpoints/media/fetch' => new Factory(
272
- ['@media/store', 'media/transformer', 'auth/public'],
273
- function ($store, $t9r, $auth) {
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  return new EndPoint(
275
- '/media/fetch',
276
  ['POST'],
277
- new FetchMediaEndPoint($store, $t9r),
278
  $auth
279
  );
280
  }
@@ -341,7 +356,7 @@ class RestApiModule extends Module
341
 
342
  // The endpoint for clearing the API cache
343
  'endpoints/clear_cache' => new Factory(
344
- ['@ig/api/cache', '@media/cpt', 'auth/user'],
345
  function (CacheInterface $apiCache, MediaPostType $mediaCpt, AuthGuardInterface $authGuard) {
346
  return new EndPoint(
347
  '/clear_cache',
26
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Feeds\DeleteFeedsEndpoint;
27
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Feeds\GetFeedsEndpoint;
28
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Feeds\SaveFeedsEndpoint;
29
+ use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Media\GetFeedMediaEndPoint;
30
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Media\GetMediaEndPoint;
31
+ use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Media\ImportMediaEndPoint;
32
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Notifications\GetNotificationsEndPoint;
33
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Promotion\SearchPostsEndpoint;
34
  use RebelCode\Spotlight\Instagram\RestApi\EndPoints\Settings\GetSettingsEndpoint;
74
  'endpoints/accounts/delete_media',
75
  'endpoints/accounts/get_access_token',
76
  'endpoints/media/get',
77
+ 'endpoints/media/feed',
78
+ 'endpoints/media/import',
79
  'endpoints/promotion/search_posts',
80
  'endpoints/settings/get',
81
  'endpoints/settings/patch',
259
 
260
  // The GET endpoint for retrieving the media posts that have been imported, without fetching new ones
261
  'endpoints/media/get' => new Factory(
262
+ ['@engine/instance', '@feeds/manager', 'auth/public'],
263
+ function ($engine, $feedManager, $auth) {
264
  return new EndPoint(
265
  '/media',
266
  ['GET'],
267
+ new GetMediaEndPoint($engine, $feedManager),
268
  $auth
269
  );
270
  }
271
  ),
272
  // The endpoint for fetching media posts from IG
273
+ 'endpoints/media/feed' => new Factory(
274
+ ['@engine/instance', '@feeds/manager', 'auth/public'],
275
+ function ($engine, $feedManager, $auth) {
276
+ return new EndPoint(
277
+ '/media/feed',
278
+ ['POST'],
279
+ new GetFeedMediaEndPoint($engine, $feedManager),
280
+ $auth
281
+ );
282
+ }
283
+ ),
284
+
285
+ // The endpoint for importing media posts from IG
286
+ 'endpoints/media/import' => new Factory(
287
+ ['@engine/instance', '@feeds/manager', 'auth/public'],
288
+ function ($engine, $feedManager, $auth) {
289
  return new EndPoint(
290
+ '/media/import',
291
  ['POST'],
292
+ new ImportMediaEndPoint($engine, $feedManager),
293
  $auth
294
  );
295
  }
356
 
357
  // The endpoint for clearing the API cache
358
  'endpoints/clear_cache' => new Factory(
359
+ ['@ig/cache/pool', '@media/cpt', 'auth/user'],
360
  function (CacheInterface $apiCache, MediaPostType $mediaCpt, AuthGuardInterface $authGuard) {
361
  return new EndPoint(
362
  '/clear_cache',
plugin.json CHANGED
@@ -1,7 +1,7 @@
1
  {
2
  "name": "Spotlight - Social Media Feeds",
3
  "description": "Easily embed beautiful Instagram feeds on your WordPress site.",
4
- "version": "0.4.2",
5
  "url": "https://spotlightwp.com",
6
  "author": "RebelCode",
7
  "authorUrl": "https://rebelcode.com",
1
  {
2
  "name": "Spotlight - Social Media Feeds",
3
  "description": "Easily embed beautiful Instagram feeds on your WordPress site.",
4
+ "version": "0.5",
5
  "url": "https://spotlightwp.com",
6
  "author": "RebelCode",
7
  "authorUrl": "https://rebelcode.com",
plugin.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * Plugin Name: Spotlight - Social Media Feeds
7
  * Description: Easily embed beautiful Instagram feeds on your WordPress site.
8
- * Version: 0.4.2
9
  * Author: RebelCode
10
  * Plugin URI: https://spotlightwp.com
11
  * Author URI: https://rebelcode.com
@@ -23,6 +23,32 @@ if (!defined('ABSPATH')) {
23
 
24
  require_once __DIR__ . '/includes/init.php';
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  slInstaRunPlugin(__FILE__, function (SlInstaRuntime $sli) {
27
  // Define plugin constants, if not already defined
28
  if (!defined('SL_INSTA')) {
@@ -31,7 +57,7 @@ slInstaRunPlugin(__FILE__, function (SlInstaRuntime $sli) {
31
  // The plugin name
32
  define('SL_INSTA_NAME', 'Spotlight - Social Media Feeds');
33
  // The plugin version
34
- define('SL_INSTA_VERSION', '0.4.2');
35
  // The path to the plugin's main file
36
  define('SL_INSTA_FILE', __FILE__);
37
  // The dir to the plugin's directory
@@ -54,6 +80,11 @@ slInstaRunPlugin(__FILE__, function (SlInstaRuntime $sli) {
54
  return;
55
  }
56
 
 
 
 
 
 
57
  // If a PRO version is running, block updates for the free version unless they match the running version
58
  add_filter('site_transient_update_plugins', function ($value) use ($sli) {
59
  if ($sli->isProActive && !empty($value) && !empty($value->response)) {
@@ -117,14 +148,36 @@ slInstaRunPlugin(__FILE__, function (SlInstaRuntime $sli) {
117
  : $instance;
118
  }
119
 
120
- // Run the plugin
121
  add_action('plugins_loaded', function () {
122
  try {
123
  spotlightInsta()->run();
124
- } catch (Throwable $exception) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  wp_die(
126
- $exception->getMessage() . "\n<pre>" . $exception->getTraceAsString() . '</pre>',
127
- SL_INSTA_PLUGIN_NAME . ' | Error',
128
  [
129
  'back_link' => true,
130
  ]
5
  *
6
  * Plugin Name: Spotlight - Social Media Feeds
7
  * Description: Easily embed beautiful Instagram feeds on your WordPress site.
8
+ * Version: 0.5
9
  * Author: RebelCode
10
  * Plugin URI: https://spotlightwp.com
11
  * Author URI: https://rebelcode.com
23
 
24
  require_once __DIR__ . '/includes/init.php';
25
 
26
+ // Listen for deactivation requests from a fatal error
27
+ slInstaCheckDeactivate();
28
+
29
+ // Check for conflicts on activation
30
+ register_activation_hook(__FILE__, function () {
31
+ slInstaCheckForConflicts();
32
+ });
33
+
34
+ // Check for conflicts when a plugin is activated
35
+ add_action('activated_plugin', function () {
36
+ slInstaCheckForConflicts();
37
+ });
38
+
39
+ // Check for conflicts when a plugin is deactivated
40
+ add_action('deactivated_plugin', function ($plugin = '') {
41
+ set_transient('sli_deactivated_plugin', $plugin);
42
+ });
43
+
44
+ // Check for the 3rd party plugin deactivation transient. If set, check for conflicts
45
+ $deactivated = get_transient('sli_deactivated_plugin');
46
+ if ($deactivated !== false) {
47
+ slInstaCheckForConflicts([$deactivated]);
48
+ delete_transient('sli_deactivated_plugin');
49
+ }
50
+
51
+ // Run the plugin
52
  slInstaRunPlugin(__FILE__, function (SlInstaRuntime $sli) {
53
  // Define plugin constants, if not already defined
54
  if (!defined('SL_INSTA')) {
57
  // The plugin name
58
  define('SL_INSTA_NAME', 'Spotlight - Social Media Feeds');
59
  // The plugin version
60
+ define('SL_INSTA_VERSION', '0.5');
61
  // The path to the plugin's main file
62
  define('SL_INSTA_FILE', __FILE__);
63
  // The dir to the plugin's directory
80
  return;
81
  }
82
 
83
+ // If the conflicts notice needs to be shown, stop here
84
+ if (slInstaShowConflictsNotice()) {
85
+ return;
86
+ }
87
+
88
  // If a PRO version is running, block updates for the free version unless they match the running version
89
  add_filter('site_transient_update_plugins', function ($value) use ($sli) {
90
  if ($sli->isProActive && !empty($value) && !empty($value->response)) {
148
  : $instance;
149
  }
150
 
151
+ // Run the plugin's modules
152
  add_action('plugins_loaded', function () {
153
  try {
154
  spotlightInsta()->run();
155
+ } catch (Throwable $ex) {
156
+ if (!is_admin()) {
157
+ return;
158
+ }
159
+
160
+ $message = sprintf(
161
+ _x('%s has encountered an error.', '%s is the name of the plugin', 'sl-insta'),
162
+ '<b>' . SL_INSTA_NAME . '</b>'
163
+ );
164
+
165
+ $link = sprintf(
166
+ '<a href="%s">%s</a>',
167
+ admin_url('plugins.php?sli_error_deactivate=' . wp_create_nonce('sli_error_deactivate')),
168
+ __('Click here to deactivate the plugin', 'sl-insta')
169
+ );
170
+
171
+ $details = '<b>' . __('Error details', 'sl-insta') . '</b>' .
172
+ "<pre>{$ex->getMessage()}</pre>" .
173
+ "<pre>In file: {$ex->getFile()}:{$ex->getLine()}</pre>" .
174
+ "<pre>{$ex->getTraceAsString()}</pre>";
175
+
176
+ $style = '<style type="text/css">#error-page {max-width: unset;} pre {overflow-x: auto;}</style>';
177
+
178
  wp_die(
179
+ "$style <p>$message <br /> $link</p> $details",
180
+ SL_INSTA_NAME . ' | Error',
181
  [
182
  'back_link' => true,
183
  ]
readme.txt CHANGED
@@ -6,33 +6,42 @@ Tags: Instagram, Instagram feed, Instagram feeds, Instagram widget, social media
6
  Requires at least: 5.0
7
  Requires PHP: 7.1
8
  Tested up to: 5.5.1
9
- Stable tag: 0.4.2
10
  License: GPLv3
11
 
12
  == Description ==
13
 
14
- Embed Instagram photos & videos in 3 minutes or less. Fully responsive, multiple feeds, lightbox, and much more.
15
 
16
- [Demo](https://spotlightwp.com/demo/?utm_source=readme&utm_medium=readme_desc&utm_campaign=readme_desc_topcta) | [Documentation](https://docs.spotlightwp.com/) | [Support](https://spotlightwp.com/support/?utm_source=readme&utm_medium=readme_desc&utm_campaign=readme_desc_topcta) | [**Compare free vs PRO**](https://spotlightwp.com/features/compare-free-vs-pro/?utm_source=readme&utm_medium=readme_desc&utm_campaign=readme_desc_topcomparecta)
17
 
18
  == A dead-simple Instagram feed plugin ==
19
 
20
- Rated 5 out of 5 stars by everyone from WordPress beginners to experienced developers.
21
 
22
- Quick to connect, fun to design, and simple to add to your site. No code or complex shortcodes required. Use the **live preview customizer** to get an instant look at your creation without ever leaving the page and set up your Instagram feeds in 3 minutes or less:
 
23
 
 
24
 
25
- 1. Connect your Instagram accounts
26
- 2. Design your feed
27
  3. Embed it anywhere on your site
28
 
 
 
 
 
 
 
 
29
  == Free features ==
30
 
31
  - Connect multiple Instagram accounts
32
  - Set up unlimited Instagram feeds
33
  - Interactive live preview
34
- - Point and click design editor
35
- - Fully responsive
36
  - Beautiful Instagram grid layout
37
  - Set number of posts and columns per device
38
  - Order by date, popularity, or at random
@@ -41,21 +50,22 @@ Quick to connect, fun to design, and simple to add to your site. No code or comp
41
  - Custom bio text and profile photo
42
  - “Follow” button
43
  - “Load More” button
 
44
  - Gutenberg block
45
  - Simple shortcode
46
  - Instagram widget
47
 
48
- == Easily customizable ==
49
  The live preview customizer includes a lot of design options that are point-and-click, no coding knowledge required. If you're a bit more adventurous, Spotlight's CSS is set up to be easily customizable for developers. Let your imagination run free.
50
 
51
- > Out of all of the Instagram integration plugins out there, this is one that I would by far recommend the most. [...] The team behind the Spotlight plugin are responsive and helpful.
52
  > - [@timmelville](https://wordpress.org/support/topic/easy-to-use-amazing-service/)
53
 
54
- == Engage with your audience ==
55
- Boost your brand, drive conversions, and **gain new followers** by embedding your Instagram feed directly on your website. From baby boomers to millennials and Gen Z, Instagram gets people from all walks of life to engage with each other. Something as simple as adding a “**Follow button**” to an Instagram footer feed can have an instant impact.
56
 
57
- > Straightforward and neat plugin which perfectly fits the sidebar of my website. It is very useful in leading new traffic from my website onto Instagram.
58
- > - [Andrew from Mirror Friendly](https://wordpress.org/support/topic/straightforward-neat-and-effective/)
59
 
60
  == Leverage social proof ==
61
  Instagram is a great place to **build a strong reputation** and develop social proof. Spotlight is here to help you make the most of it by sharing your Instagram photos and videos on any page. It gets even more powerful when combined with e-commerce sites. Set up an Instagram gallery for your shop or product pages to showcase your likes and comments.
@@ -73,7 +83,7 @@ When you're too busy to post new content everywhere, keep website visitors engag
73
  Switch between desktop, tablet, and phone views in the feed customizer to create custom Instagram feeds for each device. Make sure it looks just right no matter where it's being browsed.
74
 
75
  == Supports multiple accounts and feeds ==
76
- Connect as many accounts as you need, Personal and Business, and use them across multiple feeds. Embed one or more feeds on a single page or use them across different sections of your website. Use the [shortcode](https://docs.spotlightwp.com/article/579-shortcode) or [Instagram widget](https://docs.spotlightwp.com/article/580-widget) provided by Spotlight to add your Instagram feed to any page, post, block, widget area, or otherwise.
77
 
78
  == Reliable customer support ==
79
  Aside from [Spotlight's helpful documentation](https://docs.spotlightwp.com/), you have the full backing of our experienced team of developers and support specialists. Through [WP Mayor](https://wpmayor.com/), a trusted and long-standing WordPress resource site; and [WP RSS Aggregator](https://www.wprssaggregator.com/), the original and most popular RSS feed importer for WordPress, we have helped countless people over the years and continue to do so today.
@@ -82,42 +92,51 @@ Aside from [Spotlight's helpful documentation](https://docs.spotlightwp.com/), y
82
  - [Free support (forum)](https://wordpress.org/support/plugin/spotlight-social-photo-feeds/)
83
  - [Premium support (email)](https://spotlightwp.com/support/?utm_source=readme&utm_medium=readme_desc&utm_campaign=readme_desc_support)
84
 
85
- == Upgrade to Spotlight PRO ==
 
86
 
87
- Level up your Instagram feeds with **[Spotlight PRO](https://spotlightwp.com/pricing/?utm_source=readme&utm_medium=readme_desc&utm_campaign=readme_desc_upgrade)** and make the most of your Instagram marketing efforts. Design unique-looking feeds, feature hashtag campaigns, set up feeds with specific posts, and much more.
88
 
89
- > Very simple, intuitive connection with Instagram! The interface is super clean and intuitive. I had my IG feed in minutes! Very nice job, great features in the PRO version! Very recommendable.
90
- > - [@vamosambulante](https://wordpress.org/support/topic/beautiful-instagram-integration/)
 
 
91
 
92
  PRO features:
93
 
94
- - Embedded Instagram stories
95
  - Instagram hashtag feeds (from all of Instagram)
96
  - Instagram tagged post feeds
97
  - Caption filtering
98
  - Hashtag filtering
99
- - Visual moderation mode (show/hide posts)
100
- - Link media to blog posts, pages, WooCommerce products, custom links and more
101
- - Masonry layout
 
102
  - Highlight layout
 
103
  - Hover styles
104
  - Header styles
105
  - Captions, likes and comments
106
- - and more design options
 
107
 
108
- **[Start your FREE 14-day Spotlight PRO trial!](https://spotlightwp.com/pricing/?utm_source=readme&utm_medium=readme_desc&utm_campaign=readme_desc_protrial)**
109
- (no credit card required)
110
 
111
- == Recommended by trusted WordPress experts ==
112
  - Elementor: [Best Instagram Plugins for WordPress in 2020](https://elementor.com/blog/best-instagram-plugins-wordpress/)
 
113
  - WP Mayor: [How to Import Instagram Photos to WordPress](https://wpmayor.com/import-instagram-photos-wordpress/)
114
- - Kinsta: [WordPress Instagram Plugins for Displaying Interactive Feeds](https://kinsta.com/blog/wordpress-instagram-plugin/)
115
  - WPExplorer: [How to Add Instagram Photos to WordPress](https://www.wpexplorer.com/add-instagram-wordpress/)
 
 
116
  - aThemes: [Best WordPress Instagram Plugins 2020](https://athemes.com/collections/best-wordpress-instagram-plugins/)
117
- - Qode Interactive: [How to Display Your Instagram Feed on Your WordPress Website](https://qodeinteractive.com/magazine/add-instagram-feed-to-wordpress#using-the-spotlight-instagram-feeds-plugin)
118
- - Kevin Muldoon: [Spotlight - The Instagram Engagement WordPress Plugin](https://www.kevinmuldoon.com/spotlight-the-instagram-engagement-wordpress-plugin/)
119
- - Progressus: [How Instagram Feeds Can Improve Conversions and Gain New Followers](https://progressus.io/how-instagram-feeds-can-improve-conversions-and-gain-new-followers/)
120
- - wpDataTables: [Which of these WordPress Instagram plugin options is best for you?](https://wpdatatables.com/wordpress-instagram-plugin/)
 
 
 
121
 
122
  == Installation ==
123
 
@@ -125,7 +144,7 @@ PRO features:
125
 
126
  1. Go to the Plugins page in your WordPress site's dashboard.
127
  2. Click on the "Add New" button.
128
- 3. Search for “Spotlight Social Photo Feeds”.
129
  4. Click on the "Install" button next to it, then hit "Activate".
130
  5. Go to the “Instagram Feeds” menu item to get started.
131
 
@@ -140,7 +159,7 @@ PRO features:
140
 
141
  Follow the instructions to connect your first Instagram account and set up your feed. When you're happy with the design, save the feed.
142
 
143
- Use the provided [Spotlight shortcode](https://docs.spotlightwp.com/article/579-shortcode), [instagram feed="123"], or the ["Spotlight Instagram Feed"](https://docs.spotlightwp.com/article/580-widget) widget to embed it anywhere on your site.
144
 
145
  == Frequently Asked Questions ==
146
 
@@ -227,6 +246,27 @@ If none of these solutions work for you, please do contact us through the [suppo
227
 
228
  == Changelog ==
229
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  = 0.4.2 (2020-10-30) =
231
 
232
  **Changed**
6
  Requires at least: 5.0
7
  Requires PHP: 7.1
8
  Tested up to: 5.5.1
9
+ Stable tag: 0.5
10
  License: GPLv3
11
 
12
  == Description ==
13
 
14
+ Build credibility and create connections. Easily embed your custom Instagram feed anywhere on your site in seconds.
15
 
16
+ [Demo](https://spotlightwp.com/demo/?utm_source=readme&utm_medium=readme_desc&utm_campaign=readme_desc_demo) | [14-day PRO trial](https://spotlightwp.com/pricing/?utm_source=readme&utm_medium=readme_desc&utm_campaign=readme_desc_protrialtop) | [Support](https://spotlightwp.com/support/?utm_source=readme&utm_medium=readme_desc&utm_campaign=readme_desc_support) | [**Compare free vs PRO**](https://spotlightwp.com/features/compare-free-vs-pro/?utm_source=readme&utm_medium=readme_desc&utm_campaign=readme_desc_topcomparecta)
17
 
18
  == A dead-simple Instagram feed plugin ==
19
 
20
+ Quick to connect, fun to design and incredibly simple to embed on any WordPress site.
21
 
22
+ > The best Instagram feed solution on the market. Great UX and a speed & reliability focused team. Top marks!
23
+ > - [@rich9000](https://wordpress.org/support/topic/pro-features-for-ecom-are-killer/)
24
 
25
+ No code or complex shortcodes required. Use the **live preview customizer** to get an instant look at your creation without leaving the page and set up your Instagram feeds in just a few seconds:
26
 
27
+ 1. Connect your Instagram account
28
+ 2. Design your Instagram feed
29
  3. Embed it anywhere on your site
30
 
31
+ == Highly rated by beginners and experts alike ==
32
+
33
+ > "If you're ready to start nailing the big 3 C's of having a website [...], that is building credibility, staying current, and having a better connection with your website visitors, go ahead and check out Spotlight Instagram feeds today."
34
+ > - Adam Preiser, WP Crafter
35
+
36
+ https://www.youtube.com/watch?v=FaOoCzxHpgw
37
+
38
  == Free features ==
39
 
40
  - Connect multiple Instagram accounts
41
  - Set up unlimited Instagram feeds
42
  - Interactive live preview
43
+ - Point and click feed designer
44
+ - Create custom Instagram feeds
45
  - Beautiful Instagram grid layout
46
  - Set number of posts and columns per device
47
  - Order by date, popularity, or at random
50
  - Custom bio text and profile photo
51
  - “Follow” button
52
  - “Load More” button
53
+ - Fully responsive
54
  - Gutenberg block
55
  - Simple shortcode
56
  - Instagram widget
57
 
58
+ == Easy to customize ==
59
  The live preview customizer includes a lot of design options that are point-and-click, no coding knowledge required. If you're a bit more adventurous, Spotlight's CSS is set up to be easily customizable for developers. Let your imagination run free.
60
 
61
+ > Out of all of the Instagram integration plugins out there, this is one that I would by far recommend the most. The plugin itself is an easy to use and simple plugin that is easy to use for anyone – Especially a beginner. It has a user friendly interface that makes it easy for anyone of any level. (Their free option is also fairly comprehensive on it’s own!)
62
  > - [@timmelville](https://wordpress.org/support/topic/easy-to-use-amazing-service/)
63
 
64
+ == Connect with your audience ==
65
+ Boost your brand, drive conversions, and gain new followers by embedding your Instagram feed directly on your website. From baby boomers to millennials and Gen Z, Instagram gets people from all walks of life to engage with each other. Something as simple as adding a “**Follow button**” to an Instagram footer feed can have an instant impact.
66
 
67
+ > Excellent, Powerful, Smooth - This is an incredible plugin and the support given is second to none they will stop at nothing to help you solve your problems. Thank you!
68
+ > - [@forson](https://wordpress.org/support/topic/excellent-powerful-smooth/)
69
 
70
  == Leverage social proof ==
71
  Instagram is a great place to **build a strong reputation** and develop social proof. Spotlight is here to help you make the most of it by sharing your Instagram photos and videos on any page. It gets even more powerful when combined with e-commerce sites. Set up an Instagram gallery for your shop or product pages to showcase your likes and comments.
83
  Switch between desktop, tablet, and phone views in the feed customizer to create custom Instagram feeds for each device. Make sure it looks just right no matter where it's being browsed.
84
 
85
  == Supports multiple accounts and feeds ==
86
+ Connect as many accounts as you need, Personal and Business, and use them across multiple feeds. Embed one or more feeds on a single page or use them across different sections of your website. Use the [block](https://docs.spotlightwp.com/article/581-block), [shortcode](https://docs.spotlightwp.com/article/579-shortcode) or [Instagram widget](https://docs.spotlightwp.com/article/580-widget) provided by Spotlight to add your Instagram feed to any page, post, block, widget area, or otherwise.
87
 
88
  == Reliable customer support ==
89
  Aside from [Spotlight's helpful documentation](https://docs.spotlightwp.com/), you have the full backing of our experienced team of developers and support specialists. Through [WP Mayor](https://wpmayor.com/), a trusted and long-standing WordPress resource site; and [WP RSS Aggregator](https://www.wprssaggregator.com/), the original and most popular RSS feed importer for WordPress, we have helped countless people over the years and continue to do so today.
92
  - [Free support (forum)](https://wordpress.org/support/plugin/spotlight-social-photo-feeds/)
93
  - [Premium support (email)](https://spotlightwp.com/support/?utm_source=readme&utm_medium=readme_desc&utm_campaign=readme_desc_support)
94
 
95
+ > I got the free version to display a simple feed, which worked nicely and has a good set of options, not too overcrowded and well thought through. I was surprised by the good usability that I encountered in the backend. Most importantly: they provided me with amazing support and response times which helped me properly implement the plugin in a single page application.
96
+ > - [@fyn](https://wordpress.org/support/topic/great-usability-options-and-support/)
97
 
98
+ == More layouts, filtering, moderation, promotions, & more ==
99
 
100
+ Level up your Instagram feeds with **[Spotlight PRO](https://spotlightwp.com/pricing/?utm_source=readme&utm_medium=readme_desc&utm_campaign=readme_desc_upgrade)** and make the most of your Instagram feed. Design custom Instagram feeds, feature hashtag campaigns, filter out unwanted media, create shoppable Instagram feeds, and much more.
101
+
102
+ > I’ve used other Instagram feed plugins before and this one is the best! Plenty of customizable options, setup was easy, and simply works with no issues. Very happy with this Pro upgrade purchase. Keep up the great work!!
103
+ > - [@rccgd](https://wordpress.org/support/topic/solid-and-great-plugin/)
104
 
105
  PRO features:
106
 
 
107
  - Instagram hashtag feeds (from all of Instagram)
108
  - Instagram tagged post feeds
109
  - Caption filtering
110
  - Hashtag filtering
111
+ - Visual moderation (show/hide posts)
112
+ - Promote - link posts to articles, pages, WooCommerce products, and more per feed
113
+ - Promote - global links per Instagram account
114
+ - Promote - Automated hashtag linking
115
  - Highlight layout
116
+ - Masonry layout
117
  - Hover styles
118
  - Header styles
119
  - Captions, likes and comments
120
+ - Instagram stories in profile photo
121
+ - Elementor Instagram widget - [Officially recommended by Elementor](https://elementor.com/features/integrations/)
122
 
123
+ **[Start your free 14-day Spotlight PRO trial](https://spotlightwp.com/pricing/?utm_source=readme&utm_medium=readme_desc&utm_campaign=readme_desc_protrial)**
 
124
 
125
+ == Recommended by the best of the best ==
126
  - Elementor: [Best Instagram Plugins for WordPress in 2020](https://elementor.com/blog/best-instagram-plugins-wordpress/)
127
+ - Hubspot: [Top 3 Free Instagram Plugins for WordPress](https://blog.hubspot.com/website/top-free-instagram-plugins-wordpress-site)
128
  - WP Mayor: [How to Import Instagram Photos to WordPress](https://wpmayor.com/import-instagram-photos-wordpress/)
 
129
  - WPExplorer: [How to Add Instagram Photos to WordPress](https://www.wpexplorer.com/add-instagram-wordpress/)
130
+ - BobWP: [How to Improve WooCommerce Sales Using Your Instagram Feed](https://bobwp.com/how-to-improve-woocommerce-sales-using-your-instagram-feed/)
131
+ - Kinsta: [WordPress Instagram Plugins for Displaying Interactive Feeds](https://kinsta.com/blog/wordpress-instagram-plugin/)
132
  - aThemes: [Best WordPress Instagram Plugins 2020](https://athemes.com/collections/best-wordpress-instagram-plugins/)
133
+ - Elegant Themes: [7 Great Instagram Plugins for Sharing Your Feed](https://www.elegantthemes.com/blog/wordpress/instagram-plugins-for-sharing-your-feed)
134
+ - Theme Fusion: [How to Use Instagram Feeds to Boost Traffic and Conversions](https://theme-fusion.com/how-to-use-instagram-feeds-to-boost-traffic-and-conversions/)
135
+
136
+ [More of Spotlight in the spotlight](https://spotlightwp.com/in-the-spotlight/).
137
+
138
+ > Very simple, intuitive connection with Instagram! The interface is super clean and intuitive. I had my IG feed in minutes! Very nice job, great features in the PRO version! Very recommendable.
139
+ > - [@vamosambulante](https://wordpress.org/support/topic/beautiful-instagram-integration/)
140
 
141
  == Installation ==
142
 
144
 
145
  1. Go to the Plugins page in your WordPress site's dashboard.
146
  2. Click on the "Add New" button.
147
+ 3. Search for “Spotlight Social Media Feeds”.
148
  4. Click on the "Install" button next to it, then hit "Activate".
149
  5. Go to the “Instagram Feeds” menu item to get started.
150
 
159
 
160
  Follow the instructions to connect your first Instagram account and set up your feed. When you're happy with the design, save the feed.
161
 
162
+ Use the provided Spotlight [block](https://docs.spotlightwp.com/article/581-block), [shortcode](https://docs.spotlightwp.com/article/579-shortcode), [instagram feed="123"], or the ["Spotlight Instagram Feed"](https://docs.spotlightwp.com/article/580-widget) widget to embed it anywhere on your site.
163
 
164
  == Frequently Asked Questions ==
165
 
246
 
247
  == Changelog ==
248
 
249
+ = 0.5 (2020-11-17) =
250
+
251
+ **Added**
252
+ - New option in the feeds list to update the Instagram posts for a feed
253
+ - The "Show/hide PRO Features" selection is remembered in the browser
254
+
255
+ **Changed**
256
+ - Video thumbnails are generated for non-tagged and non-hashtag posts
257
+ - Added a notification when connecting an account using an access token fails
258
+ - Duplicate posts, even if fetched for different sources, will no longer be shown in feeds
259
+
260
+ **Fixed**
261
+ - Incompatibility with Kadence plugins caused modal popups to not appear
262
+ - Incompatibility with LiteSpeed cache when loading JS when DOM is ready
263
+ - Corrupted feed options would cause an error that prevented editing and saving feeds
264
+ - Modals no longer cover up toast notifications in the admin app
265
+ - Warnings would show up when activating the plugin on a new site
266
+ - Cron jobs would not be recreated after their schedule is changed in the settings
267
+ - Feed usage in the block editor was not detected and shown in the feeds list
268
+ - Duplicate crons would be created when run manually using WP Crontrol
269
+
270
  = 0.4.2 (2020-10-30) =
271
 
272
  **Changed**
ui/dist/admin-app.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],t):"object"==typeof exports?exports.spotlight=t(require("React"),require("ReactDOM")):e.spotlight=t(e.React,e.ReactDOM)}(window,(function(e,t){return(window.webpackJsonpspotlight=window.webpackJsonpspotlight||[]).push([[4],{0:function(t,n){t.exports=e},10:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(0),a=n.n(o),i=n(11);const r=e=>{var{icon:t,className:n}=e,o=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]])}return n}(e,["icon","className"]);return a.a.createElement("span",Object.assign({className:Object(i.b)("dashicons","dashicons-"+t,n)},o))}},101:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return s}));var o=n(0),a=n.n(o),i=n(6);function r(e,t){return Object(i.b)(n=>a.a.createElement(e,Object.assign(Object.assign({},t),n)))}function s(e,t){return Object(i.b)(n=>{const o={};return Object.keys(t).forEach(e=>o[e]=t[e](n)),a.a.createElement(e,Object.assign({},o,n))})}},106:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return u}));var o=n(0),a=n.n(o),i=n(3);const r=a.a.createContext(null),s={matched:!1};function l({value:e,children:t}){return s.matched=!1,a.a.createElement(r.Provider,{value:e},t.map((t,n)=>a.a.createElement(a.a.Fragment,{key:n},"function"==typeof t?t(e):t)))}function c({value:e,oneOf:t,children:n}){var o;const l=a.a.useContext(r);let c=!1;return void 0!==e&&(c="function"==typeof e?e(l):Object(i.c)(l,e)),void 0!==t&&(c=t.some(e=>Object(i.c)(e,l))),c?(s.matched=!0,"function"==typeof n?null!==(o=n(l))&&void 0!==o?o:null:null!=n?n:null):null}function u({children:e}){var t;if(s.matched)return null;const n=a.a.useContext(r);return"function"==typeof e?null!==(t=e(n))&&void 0!==t?t:null:null!=e?e:null}},11:function(e,t,n){"use strict";function o(...e){return e.filter(e=>!!e).join(" ")}function a(e){return o(...Object.getOwnPropertyNames(e).map(t=>e[t]?t:null))}function i(e,t={}){let n=Object.getOwnPropertyNames(t).map(n=>t[n]?e+n:null);return e+" "+n.filter(e=>!!e).join(" ")}n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return i})),n.d(t,"e",(function(){return r})),n.d(t,"d",(function(){return s}));const r={onMouseDown:e=>e.preventDefault()};function s(...e){return t=>{e.forEach(e=>e&&function(e,t){"function"==typeof e?e(t):e.current=t}(e,t))}}},111:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n(0),a=n.n(o),i=n(6),r=n(27),s=n(7);const l=Object(i.b)(({feed:e})=>{const t=r.a.getById(e.options.layout),n=s.a.ComputedOptions.compute(e.options,e.mode);return a.a.createElement("div",{className:"feed"},a.a.createElement(t.component,{feed:e,options:n}))})},112:function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var o=n(0),a=n.n(o),i=n(60),r=n.n(i),s=n(16),l=n(52),c=n.n(l),u=n(38),d=n.n(u),m=n(6),p=n(3),h=n(116),f=Object(m.b)((function({field:e}){const t="settings-field-"+Object(p.u)(),n=!e.label||e.fullWidth;return a.a.createElement("div",{className:d.a.root},e.label&&a.a.createElement("div",{className:d.a.label},a.a.createElement("label",{htmlFor:t},e.label)),a.a.createElement("div",{className:d.a.container},a.a.createElement("div",{className:n?d.a.controlFullWidth:d.a.controlPartialWidth},a.a.createElement(e.component,{id:t})),e.tooltip&&a.a.createElement("div",{className:d.a.tooltip},a.a.createElement(h.a,null,e.tooltip))))}));function g({group:e}){return a.a.createElement("div",{className:c.a.root},e.title&&e.title.length>0&&a.a.createElement("h1",{className:c.a.title},e.title),e.component&&a.a.createElement("div",{className:c.a.content},a.a.createElement(e.component)),e.fields&&a.a.createElement("div",{className:c.a.fieldList},e.fields.map(e=>a.a.createElement(f,{field:e,key:e.id}))))}var b=n(20);function _({page:e}){return Object(b.d)("keydown",e=>{e.key&&"s"===e.key.toLowerCase()&&e.ctrlKey&&(s.b.save(),e.preventDefault(),e.stopPropagation())}),a.a.createElement("article",{className:r.a.root},e.component&&a.a.createElement("div",{className:r.a.content},a.a.createElement(e.component)),e.groups&&a.a.createElement("div",{className:r.a.groupList},e.groups.map(e=>a.a.createElement(g,{key:e.id,group:e}))))}},12:function(e,t,n){"use strict";var o,a=n(8);let i;t.a=i={isPro:!1,config:{restApi:SliCommonL10n.restApi,imagesUrl:SliCommonL10n.imagesUrl,autoPromotions:SliCommonL10n.autoPromotions,globalPromotions:null!==(o=SliCommonL10n.globalPromotions)&&void 0!==o?o:{}},image:e=>`${i.config.imagesUrl}/${e}`},a.a.registerType({id:"link",label:"Link",isValid:()=>!1}),a.a.registerType({id:"-more-",label:"- More promotion types -",isValid:()=>!1}),a.a.Automation.registerType({id:"hashtag",label:"Hashtag",matches:()=>!1})},13:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));const o=e=>"string"==typeof e?e:"r"in e?"rgba("+e.r+","+e.g+","+e.b+","+e.a+")":"h"in e?"hsla("+e.h+","+e.s+","+e.l+","+e.a+")":"#fff"},138:function(e,t,n){"use strict";function o(e,t){return"url"===t.linkType?t.url:t.postUrl}var a;n.d(t,"a",(function(){return a})),t.b={id:"link",label:"Link",getIcon:()=>"admin-links",getPopupLink:function(e,t){return"string"==typeof t.linkText&&t.linkText.length>0?[t.linkText,t.newTab]:[a.getDefaultLinkText(t),t.newTab]},isValid:function(e){return"string"==typeof e.linkType&&e.linkType.length>0&&("url"===e.linkType&&"string"==typeof e.url&&e.url.length>0||!!e.postId&&"string"==typeof e.postUrl&&e.postUrl.length>0)},getMediaUrl:o,onMediaClick:function(e,t){var n;const a=o(0,t),i=null===(n=t.linkDirectly)||void 0===n||n;return!(!a||!i)&&(window.open(a,t.newTab?"_blank":"_self"),!0)}},function(e){e.getDefaultLinkText=function(e){switch(e.linkType){case"product":return"Buy it now";case"post":return"Read the article";case"page":return"Learn more";default:return"Visit link"}}}(a||(a={}))},139:function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var o=n(0),a=n.n(o),i=n(202),r=n.n(i),s=n(6),l=n(161),c=n(21),u=n(14),d=n(112),m=n(42),p=n(16),h=n(50),f=n(40),g=n(151),b=n(142),_=n.n(b),v=n(164),y=n(5),E=n(118),w=n(117),S=Object(s.b)((function(){const e=c.a.get("tab");return a.a.createElement(v.a,{chevron:!0,right:O},u.a.settings.pages.map((t,n)=>a.a.createElement(E.a.Link,{key:t.id,linkTo:c.a.with({tab:t.id}),isCurrent:e===t.id||!e&&0===n},t.title)))}));const O=Object(s.b)((function({}){const e=!p.b.isDirty;return a.a.createElement("div",{className:_.a.buttons},a.a.createElement(y.a,{className:_.a.cancelBtn,type:y.c.DANGER_PILL,size:y.b.LARGE,onClick:()=>p.b.restore(),disabled:e},"Cancel"),a.a.createElement(w.a,{className:_.a.saveBtn,onClick:()=>p.b.save(),isSaving:p.b.isSaving,tooltip:"Save the settings (Ctrl+S)",disabled:e}))})),k="You have unsaved changes. If you leave now, your changes will be lost.";function C(e){return Object(h.parse)(e.search).screen===f.a.SETTINGS||k}t.b=Object(s.b)((function(){const e=c.a.get("tab"),t=e?u.a.settings.pages.find(t=>e===t.id):u.a.settings.pages[0];return Object(o.useEffect)(()=>()=>{p.b.isDirty&&c.a.get("screen")!==f.a.SETTINGS&&p.b.restore()},[]),a.a.createElement(a.a.Fragment,null,a.a.createElement(l.a,{navbar:S,className:r.a.root},t&&a.a.createElement(d.a,{page:t})),a.a.createElement(m.a,{when:p.b.isDirty,message:C}),a.a.createElement(g.a,{when:p.b.isDirty,message:k}))}))},141:function(e,t,n){e.exports={"menu-link":"PageMenuNavbar__menu-link",menuLink:"PageMenuNavbar__menu-link","menu-ref":"PageMenuNavbar__menu-ref",menuRef:"PageMenuNavbar__menu-ref","arrow-down":"PageMenuNavbar__arrow-down",arrowDown:"PageMenuNavbar__arrow-down"}},142:function(e,t,n){e.exports={buttons:"SettingsNavbar__buttons layout__flex-row","cancel-btn":"SettingsNavbar__cancel-btn",cancelBtn:"SettingsNavbar__cancel-btn"}},148:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(0),a=n.n(o),i=n(29);function r({breakpoints:e,children:t}){const[n,r]=a.a.useState(null),s=a.a.useCallback(()=>{const t=Object(i.b)();r(()=>e.reduce((e,n)=>t.width<=n&&n<e?n:e,1/0))},[e]);return Object(o.useEffect)(()=>(s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)),[]),null!==n&&t(n)}},149:function(e,t,n){"use strict";var o=n(0),a=n.n(o),i=n(100),r=n(18),s=n.n(r),l=n(41),c=n(4),u=n(5),d=n(10),m=n(113),p=n(26),h=n(21),f=n(30),g=n(89),b=n(59),_=n(14),v=n(65);function y({accounts:e,showDelete:t,onDeleteError:n}){const o=(e=null!=e?e:[]).filter(e=>e.type===c.a.Type.BUSINESS).length,[i,r]=a.a.useState(!1),[y,E]=a.a.useState(null),[w,S]=a.a.useState(!1),[O,k]=a.a.useState(),[C,P]=a.a.useState(!1),T=e=>()=>{E(e),r(!0)},N=e=>()=>{f.a.openAuthWindow(e.type,0,()=>{_.a.restApi.deleteAccountMedia(e.id)})},L=e=>()=>{k(e),S(!0)},A=()=>{P(!1),k(null),S(!1)},x={cols:{username:s.a.usernameCol,type:s.a.typeCol,usages:s.a.usagesCol,actions:s.a.actionsCol},cells:{username:s.a.usernameCell,type:s.a.typeCell,usages:s.a.usagesCell,actions:s.a.actionsCell}};return a.a.createElement("div",{className:"accounts-list"},a.a.createElement(m.a,{styleMap:x,rows:e,cols:[{id:"username",label:"Username",render:e=>a.a.createElement("div",null,a.a.createElement(b.a,{account:e,className:s.a.profilePic}),a.a.createElement("a",{className:s.a.username,onClick:T(e)},e.username))},{id:"type",label:"Type",render:e=>a.a.createElement("span",{className:s.a.accountType},e.type)},{id:"usages",label:"Feeds",render:e=>a.a.createElement("span",{className:s.a.usages},e.usages.map((e,t)=>!!p.a.getById(e)&&a.a.createElement(l.a,{key:t,to:h.a.at({screen:"edit",id:e.toString()})},p.a.getById(e).name)))},{id:"actions",label:"Actions",render:e=>t&&a.a.createElement("div",{className:s.a.actionsList},a.a.createElement(u.a,{className:s.a.action,type:u.c.SECONDARY,tooltip:"Account info",onClick:T(e)},a.a.createElement(d.a,{icon:"info"})),a.a.createElement(u.a,{className:s.a.action,type:u.c.SECONDARY,tooltip:"Reconnect account",onClick:N(e)},a.a.createElement(d.a,{icon:"image-rotate"})),a.a.createElement(u.a,{className:s.a.actions,type:u.c.DANGER,tooltip:"Remove account",onClick:L(e)},a.a.createElement(d.a,{icon:"trash"})))}]}),a.a.createElement(g.a,{isOpen:i,onClose:()=>r(!1),account:y}),a.a.createElement(v.a,{isOpen:w,title:"Are you sure?",buttons:[C?"Please wait ...":"Yes I'm sure","Cancel"],okDisabled:C,cancelDisabled:C,onAccept:()=>{P(!0),f.a.deleteAccount(O.id).then(()=>A()).catch(()=>{n&&n("An error occurred while trying to remove the account."),A()})},onCancel:A},a.a.createElement("p",null,"Are you sure you want to delete"," ",a.a.createElement("span",{style:{fontWeight:"bold"}},O?O.username:""),"?"," ","This will also delete all saved media associated with this account."),O&&O.type===c.a.Type.BUSINESS&&1===o&&a.a.createElement("p",null,a.a.createElement("b",null,"Note:")," ",a.a.createElement("span",null,"Because this is your only connected Business account, deleting it will"," ","also cause any feeds that show public hashtag posts to no longer work."))))}var E=n(23),w=n(6),S=n(115),O=n(77),k=n.n(O);t.a=Object(w.b)((function(){const[,e]=a.a.useState(0),[t,n]=a.a.useState(""),o=a.a.useCallback(()=>e(e=>e++),[]);return c.b.hasAccounts()?a.a.createElement("div",{className:k.a.root},t.length>0&&a.a.createElement(E.a,{type:E.b.ERROR,showIcon:!0,isDismissible:!0,onDismiss:()=>n("")},t),a.a.createElement("div",{className:k.a.connectBtn},a.a.createElement(i.a,{onConnect:o})),a.a.createElement(y,{accounts:c.b.list,showDelete:!0,onDeleteError:n})):a.a.createElement(S.a,null)}))},15:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var o,a=n(3);!function(e){function t(e,t){return e.hasOwnProperty(t.toString())}function n(e,t){return e[t.toString()]}function o(e,t,n){return e[t.toString()]=n,e}e.has=t,e.get=n,e.set=o,e.ensure=function(n,a,i){return t(n,a)||o(n,a,i),e.get(n,a)},e.withEntry=function(t,n,o){return e.set(Object(a.h)(t),n,o)},e.remove=function(e,t){return delete e[t.toString()],e},e.without=function(t,n){return e.remove(Object(a.h)(t),n)},e.at=function(e,t){return n(e,Object.keys(e)[t])},e.keys=function(e){return Object.keys(e)},e.values=function(e){return Object.values(e)},e.entries=function(e){return Object.getOwnPropertyNames(e).map(t=>[t,e[t]])},e.map=function(t,n){const o={};return e.forEach(t,(e,t)=>o[e]=n(t,e)),o},e.size=function(t){return e.keys(t).length},e.isEmpty=function(t){return 0===e.size(t)},e.equals=function(e,t){return Object(a.p)(e,t)},e.forEach=function(t,n){e.keys(t).forEach(e=>n(e,t[e]))},e.fromArray=function(t){const n={};return t.forEach(([t,o])=>e.set(n,t,o)),n},e.fromMap=function(t){const n={};return t.forEach((t,o)=>e.set(n,o,t)),n}}(o||(o={}))},150:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var o=n(0),a=n.n(o),i=n(86),r=n.n(i),s=n(64),l=n(20);function c({children:{path:e,tabs:t,right:n},current:o,onClickTab:i}){return a.a.createElement(s.b,{pathStyle:"chevron"},{path:e,right:n,left:t.map(e=>{return a.a.createElement(u,{tab:e,key:e.key,isCurrent:e.key===o,onClick:(t=e.key,()=>i&&i(t))});var t})})}function u({tab:e,isCurrent:t,onClick:n}){return a.a.createElement("a",{key:e.key,role:"button",tabIndex:0,className:e.disabled?r.a.disabled:t?r.a.current:r.a.tab,onClick:n,onKeyDown:Object(l.f)(n)},a.a.createElement("span",{className:r.a.label},e.label))}},151:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(0),a=n.n(o),i=n(42),r=n(20);function s({when:e,message:t}){return Object(r.k)(t,e),a.a.createElement(i.a,{when:e,message:t})}},161:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var o=n(0),a=n.n(o),i=n(11),r=n(30),s=n(14),l=n(1);const c=Object(l.n)({initialized:!1,list:[]}),u=({navbar:e,className:t,fillPage:n,children:l})=>{const u=a.a.useRef(null);Object(o.useEffect)(()=>{u.current&&(function(){if(!c.initialized){const e=Array.from(document.querySelectorAll(".sli-notice")),t=Array.from(document.querySelectorAll(".fs-notice.fs-slug-spotlight-social-photo-feeds"));c.list=e.concat(t),c.initialized=!0}}(),c.list.forEach(e=>{e.remove(),u.current.appendChild(e)}))},[]);const d=r.a.getExpiringTokenAccounts(),m=Object(i.a)("admin-screen",{"--fillPage":n})+(t?" "+t:"");return a.a.createElement("div",{className:m},e&&a.a.createElement("div",{className:"admin-screen__navbar"},a.a.createElement(e)),a.a.createElement("div",{className:"admin-screen__content"},a.a.createElement("div",{className:"admin-screen__notices",ref:u},d.map(e=>a.a.createElement("div",{key:e.id,className:"notice notice-warning"},a.a.createElement("p",null,"The access token for the ",a.a.createElement("b",null,"@",e.username)," account is about to expire."," ",a.a.createElement("a",{className:"admin-screen__reconnect",onClick:t=>function(e,t){r.a.openAuthWindow(t.type,0,()=>{s.a.restApi.deleteAccountMedia(t.id)}),e.preventDefault()}(t,e)},"Re-connect the account")," ","to keep using it in Spotlight.")))),l))}},164:function(e,t,n){"use strict";var o=n(0),a=n.n(o),i=n(6),r=n(118),s=n(200),l=n.n(s),c=n(14),u=function({url:e,children:t}){return a.a.createElement("a",{className:l.a.root,href:null!=e?e:c.a.resources.upgradeLocalUrl},null!=t?t:"Upgrade to PRO")},d=n(40),m=n(12);t.a=Object(i.b)((function({right:e,chevron:t,children:n}){const o=a.a.createElement(r.a.Item,null,d.b.getCurrent().title);return a.a.createElement(r.a,null,a.a.createElement(a.a.Fragment,null,o,t&&a.a.createElement(r.a.Chevron,null),n),e?a.a.createElement(e):!m.a.isPro&&a.a.createElement(u,{url:c.a.resources.trialLocalUrl},"Start 14-day PRO trial"))}))},169:function(e,t,n){e.exports={"arrow-link":"WizardNavbar__arrow-link",arrowLink:"WizardNavbar__arrow-link","prev-link":"WizardNavbar__prev-link WizardNavbar__arrow-link",prevLink:"WizardNavbar__prev-link WizardNavbar__arrow-link","next-link":"WizardNavbar__next-link WizardNavbar__arrow-link",nextLink:"WizardNavbar__next-link WizardNavbar__arrow-link"}},17:function(e,t,n){"use strict";var o;n.d(t,"a",(function(){return o})),function(e){let t,n;!function(e){e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.ALBUM="CAROUSEL_ALBUM"}(t=e.Type||(e.Type={})),function(e){let t;!function(e){e.PERSONAL_ACCOUNT="PERSONAL_ACCOUNT",e.BUSINESS_ACCOUNT="BUSINESS_ACCOUNT",e.TAGGED_ACCOUNT="TAGGED_ACCOUNT",e.RECENT_HASHTAG="RECENT_HASHTAG",e.POPULAR_HASHTAG="POPULAR_HASHTAG",e.USER_STORY="USER_STORY"}(t=e.Type||(e.Type={}))}(n=e.Source||(e.Source={})),e.getAsRows=(e,t)=>{e=e.slice(),t=t>0?t:1;let n=[];for(;e.length;)n.push(e.splice(0,t));if(n.length>0){const e=n.length-1;for(;n[e].length<t;)n[e].push({})}return n},e.isFromHashtag=e=>e.source.type===n.Type.POPULAR_HASHTAG||e.source.type===n.Type.RECENT_HASHTAG}(o||(o={}))},170:function(e,t,n){e.exports={message:"FeedNamePrompt__message",input:"FeedNamePrompt__input"}},18:function(e,t,n){e.exports={"username-col":"AccountsList__username-col",usernameCol:"AccountsList__username-col","actions-col":"AccountsList__actions-col",actionsCol:"AccountsList__actions-col","username-cell":"AccountsList__username-cell",usernameCell:"AccountsList__username-cell",username:"AccountsList__username","profile-pic":"AccountsList__profile-pic",profilePic:"AccountsList__profile-pic","account-type":"AccountsList__account-type",accountType:"AccountsList__account-type",usages:"AccountsList__usages","actions-list":"AccountsList__actions-list layout__flex-row",actionsList:"AccountsList__actions-list layout__flex-row",action:"AccountsList__action","usages-cell":"AccountsList__usages-cell",usagesCell:"AccountsList__usages-cell","usages-col":"AccountsList__usages-col",usagesCol:"AccountsList__usages-col","type-cell":"AccountsList__type-cell",typeCell:"AccountsList__type-cell","type-col":"AccountsList__type-col",typeCol:"AccountsList__type-col"}},186:function(e,t,n){e.exports={beacon:"NewsBeacon__beacon",button:"NewsBeacon__button","button-animation":"NewsBeacon__button-animation",buttonAnimation:"NewsBeacon__button-animation",counter:"NewsBeacon__counter","hide-link":"NewsBeacon__hide-link",hideLink:"NewsBeacon__hide-link",menu:"NewsBeacon__menu"}},19:function(e,t,n){"use strict";var o=n(33),a=n.n(o),i=n(12),r=n(34);const s=i.a.config.restApi.baseUrl,l={};i.a.config.restApi.authToken&&(l["X-Sli-Auth-Token"]=i.a.config.restApi.authToken);const c=a.a.create({baseURL:s,headers:l}),u={config:i.a.config.restApi,driver:c,getAccounts:()=>c.get("/accounts"),getFeeds:()=>c.get("/feeds"),getFeedMedia:(e,t=0,n=0,o)=>{const i=o?new a.a.CancelToken(o):void 0;return c.post("/media/fetch",{options:e,num:n,from:t},{cancelToken:i})},getMedia:(e=0,t=0)=>c.get(`/media?num=${e}&offset=${t}`),getErrorReason:e=>{let t;return"object"==typeof e.response&&(e=e.response.data),t="string"==typeof e.message?e.message:e.toString(),Object(r.b)(t)}};t.a=u},199:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{constructor(e=[],t=0){this.fns=e,this.delay=null!=t?t:1}add(e){this.fns.push(e)}run(){return this.numLoaded=0,this.isLoading=!0,new Promise((e,t)=>{this.fns.forEach(n=>n().then(()=>{this.numLoaded++,this.numLoaded>=this.fns.length&&setTimeout(()=>{this.isLoading=!1,e()},this.delay)}).catch(t))})}}},2:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var o,a=n(1),i=function(e,t,n,o){var a,i=arguments.length,r=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(r=(i<3?a(r):i>3?a(t,n,r):a(t,n))||r);return i>3&&r&&Object.defineProperty(t,n,r),r};!function(e){class t{constructor(e,t,n){this.prop=e,this.name=t,this.icon=n}}t.DESKTOP=new t("desktop","Desktop","desktop"),t.TABLET=new t("tablet","Tablet","tablet"),t.PHONE=new t("phone","Phone","smartphone"),e.Mode=t,e.MODES=[t.DESKTOP,t.TABLET,t.PHONE];class n{constructor(e,t,n){this.desktop=e,this.tablet=t,this.phone=n}get(e,t){return o(this,e,t)}set(e,t){r(this,t,e)}with(e,t){const o=s(this,t,e);return new n(o.desktop,o.tablet,o.phone)}}function o(e,t,n=!1){if(!e)return;const o=e[t.prop];return n&&null==o?e.desktop:o}function r(e,t,n){return e[n.prop]=t,e}function s(e,t,o){return r(new n(e.desktop,e.tablet,e.phone),t,o)}i([a.n],n.prototype,"desktop",void 0),i([a.n],n.prototype,"tablet",void 0),i([a.n],n.prototype,"phone",void 0),e.Value=n,e.getName=function(e){return e.name},e.getIcon=function(e){return e.icon},e.cycle=function(n){const o=e.MODES.findIndex(e=>e===n);return void 0===o?t.DESKTOP:e.MODES[(o+1)%e.MODES.length]},e.get=o,e.set=r,e.withValue=s,e.normalize=function(e,t){return null==e?t.hasOwnProperty("all")?new n(t.all,t.all,t.all):new n(t.desktop,t.tablet,t.phone):"object"==typeof e&&e.hasOwnProperty("desktop")?new n(e.desktop,e.tablet,e.phone):new n(e,e,e)},e.getModeForWindowSize=function(e){return e.width<=768?t.PHONE:e.width<=935?t.TABLET:t.DESKTOP},e.isValid=function(e){return"object"==typeof e&&e.hasOwnProperty("desktop")}}(o||(o={}))},20:function(e,t,n){"use strict";n.d(t,"i",(function(){return s})),n.d(t,"e",(function(){return l})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return d})),n.d(t,"m",(function(){return m})),n.d(t,"g",(function(){return p})),n.d(t,"k",(function(){return h})),n.d(t,"j",(function(){return f})),n.d(t,"d",(function(){return b})),n.d(t,"l",(function(){return _})),n.d(t,"f",(function(){return v})),n.d(t,"h",(function(){return y}));var o=n(0),a=n.n(o),i=n(42),r=n(29);function s(e,t){!function(e,t,n){const o=a.a.useRef(!0);e(()=>{o.current=!0;const e=t(()=>new Promise(e=>{o.current&&e()}));return()=>{o.current=!1,e&&e()}},n)}(o.useEffect,e,t)}function l(e){const[t,n]=a.a.useState(e),o=a.a.useRef(t);return[t,()=>o.current,e=>n(o.current=e)]}function c(e,t,n=[]){function a(o){!e.current||e.current.contains(o.target)||n.some(e=>e&&e.current&&e.current.contains(o.target))||t(o)}Object(o.useEffect)(()=>(document.addEventListener("mousedown",a),document.addEventListener("touchend",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchend",a)}))}function u(e,t){Object(o.useEffect)(()=>{const n=()=>{0===e.filter(e=>!e.current||document.activeElement===e.current||e.current.contains(document.activeElement)).length&&t()};return document.addEventListener("keyup",n),()=>document.removeEventListener("keyup",n)},e)}function d(e,t,n=100){const[i,r]=a.a.useState(e);return Object(o.useEffect)(()=>{let o=null;return e===t?o=setTimeout(()=>r(t),n):r(!t),()=>{null!==o&&clearTimeout(o)}},[e]),[i,r]}function m(e){const[t,n]=a.a.useState(Object(r.b)()),i=()=>{const t=Object(r.b)();n(t),e&&e(t)};return Object(o.useEffect)(()=>(i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)),[]),t}function p(){return new URLSearchParams(Object(i.e)().search)}function h(e,t){const n=n=>{if(t)return(n||window.event).returnValue=e,e};Object(o.useEffect)(()=>(window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)),[t])}function f(e,t){const n=a.a.useRef(!1);return Object(o.useEffect)(()=>{n.current&&void 0!==e.current&&(e.current.scrollIntoView(Object.assign({behavior:"smooth",block:"start"},null!=t?t:{})),n.current=!1)},[n.current]),()=>n.current=!0}function g(e,t,n,a=[],i=[]){Object(o.useEffect)(()=>(a.reduce((e,t)=>e&&t,!0)&&e.addEventListener(t,n),()=>e.removeEventListener(t,n)),i)}function b(e,t,n=[],o=[]){g(document,e,t,n,o)}function _(e,t,n=[],o=[]){g(window,e,t,n,o)}function v(e){return t=>{" "!==t.key&&"Enter"!==t.key||(e(),t.preventDefault(),t.stopPropagation())}}function y(e){const[t,n]=a.a.useState(e);return[function(e){const t=a.a.useRef(e);return t.current=e,t}(t),n]}n(34)},200:function(e,t,n){e.exports={root:"ProUpgradeBtn__root"}},201:function(e,t,n){"use strict";n.d(t,"a",(function(){return S}));var o=n(0),a=n.n(o),i=n(80),r=n.n(i),s=n(6),l=n(21),c=n(150),u=n(5),d=n(64),m=n(106),p=n(242),h=n(245),f=n(16),g=n(117),b=n(139),_=n(50),v=n(40),y=n(20),E=n(42),w=n(83);const S=Object(s.b)((function({isFakePro:e}){var t;const n=null!==(t=l.a.get("tab"))&&void 0!==t?t:"automate";Object(y.k)(b.a,f.b.isDirty),Object(y.d)("keydown",e=>{"s"===e.key.toLowerCase()&&e.ctrlKey&&(f.b.isDirty&&!f.b.isSaving&&f.b.save(),e.preventDefault(),e.stopPropagation())},[],[f.b.isDirty,f.b.isSaving]);const o=e?C:f.b.values.autoPromotions,i=e?{}:f.b.values.promotions;return a.a.createElement("div",{className:r.a.screen},a.a.createElement("div",{className:r.a.navbar},a.a.createElement(O,{currTabId:n,isFakePro:e})),a.a.createElement(m.a,{value:n},a.a.createElement(m.c,{value:"automate"},a.a.createElement(p.a,{automations:o,onChange:function(t){e||f.b.update({autoPromotions:t})},isFakePro:e})),a.a.createElement(m.c,{value:"global"},a.a.createElement(h.a,{promotions:i,onChange:function(t){e||f.b.update({promotions:t})},isFakePro:e}))),a.a.createElement(E.a,{when:f.b.isDirty,message:k}))})),O=Object(s.b)((function({currTabId:e,isFakePro:t}){return a.a.createElement(a.a.Fragment,null,a.a.createElement(c.a,{current:e,onClickTab:e=>l.a.goto({tab:e},!0)},{path:[a.a.createElement(d.a,{key:"logo"}),a.a.createElement("span",{key:"screen-title"},"Promotions")],tabs:[{key:"automate",label:a.a.createElement("span",{className:t?r.a.navbarFakeProItem:r.a.navbarItem},t&&a.a.createElement(w.a,{className:r.a.navbarProPill}),a.a.createElement("span",null,"Automate"))},{key:"global",label:a.a.createElement("span",{className:t?r.a.navbarFakeProItem:r.a.navbarItem},t&&a.a.createElement(w.a,{className:r.a.navbarProPill}),a.a.createElement("span",null,"Global Promotions"))}],right:[a.a.createElement(u.a,{key:"cancel",type:u.c.SECONDARY,disabled:!f.b.isDirty,onClick:f.b.restore},"Cancel"),a.a.createElement(g.a,{key:"save",onClick:f.b.save,isSaving:f.b.isSaving,disabled:!f.b.isDirty})]}))}));function k(e){return Object(_.parse)(e.search).screen===v.a.PROMOTIONS||b.a}const C=[{type:"hashtag",config:{hashtags:["merchandise"]},promotion:{type:"link",config:{linkType:"page",postId:1,postTitle:"Merchandise",linkText:"Buy my merch!"}}},{type:"hashtag",config:{hashtags:["yt"]},promotion:{type:"link",config:{linkType:"url",url:"https://youtube.com/my-youtube-channel",linkText:"Check out my YouTube"}}}]},202:function(e,t,n){},21:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n(1),a=n(50),i=n(3),r=function(e,t,n,o){var a,i=arguments.length,r=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(r=(i<3?a(r):i>3?a(t,n,r):a(t,n))||r);return i>3&&r&&Object.defineProperty(t,n,r),r};class s{constructor(){const e=window.location;this._pathName=e.pathname,this._baseUrl=e.protocol+"//"+e.host,this.parsed=Object(a.parse)(e.search),this.unListen=null,this.listeners=[],Object(o.o)(()=>this._path,e=>this.path=e)}createPath(e){return this._pathName+"?"+Object(a.stringify)(e)}get _path(){return this.createPath(this.parsed)}get(e,t=!0){return Object(i.l)(this.parsed[e])}at(e){return this.createPath(Object.assign({page:this.parsed.page},this.processQuery(e)))}fullUrl(e){return this._baseUrl+this.createPath(Object.assign({page:this.parsed.page},this.processQuery(e)))}with(e){return this.createPath(Object.assign(Object.assign({},this.parsed),this.processQuery(e)))}without(e){const t=Object.assign({},this.parsed);return delete t[e],this.createPath(t)}goto(e,t=!1){this.history.push(t?this.with(e):this.at(e),{})}useHistory(e){return this.unListen&&this.unListen(),this.history=e,this.unListen=this.history.listen(e=>{this.parsed=Object(a.parse)(e.search),this.listeners.forEach(e=>e())}),this}listen(e){this.listeners.push(e)}unlisten(e){this.listeners=this.listeners.filter(t=>t===e)}processQuery(e){const t=Object.assign({},e);return Object.getOwnPropertyNames(e).forEach(n=>{e[n]&&0===e[n].length?delete t[n]:t[n]=e[n]}),t}}r([o.n],s.prototype,"path",void 0),r([o.n],s.prototype,"parsed",void 0),r([o.h],s.prototype,"_path",null);const l=new s},213:function(e,t,n){e.exports={root:"SpotlightGame__root layout__flex-column","game-text":"SpotlightGame__game-text",gameText:"SpotlightGame__game-text",score:"SpotlightGame__score SpotlightGame__game-text",message:"SpotlightGame__message SpotlightGame__game-text","message-bubble":"SpotlightGame__message-bubble",messageBubble:"SpotlightGame__message-bubble"}},214:function(e,t,n){e.exports={"field-container":"AdvancedSettings__field-container layout__flex-row",fieldContainer:"AdvancedSettings__field-container layout__flex-row","field-element":"AdvancedSettings__field-element",fieldElement:"AdvancedSettings__field-element","field-label":"AdvancedSettings__field-label AdvancedSettings__field-element",fieldLabel:"AdvancedSettings__field-label AdvancedSettings__field-element","field-control":"AdvancedSettings__field-control AdvancedSettings__field-element layout__flex-column",fieldControl:"AdvancedSettings__field-control AdvancedSettings__field-element layout__flex-column","field-centered":"AdvancedSettings__field-centered",fieldCentered:"AdvancedSettings__field-centered"}},253:function(e,t,n){e.exports={"contact-us":"FeedsOnboarding__contact-us",contactUs:"FeedsOnboarding__contact-us","call-to-action":"FeedsOnboarding__call-to-action",callToAction:"FeedsOnboarding__call-to-action"}},27:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{static getById(e){const t=o.list.find(t=>t.id===e);return!t&&o.list.length>0?o.list[0]:t}static getName(e){const t=o.getById(e);return t?t.name:"(Missing layout)"}static addLayout(e){o.list.push(e)}}o.list=[]},279:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n(97),a=n.n(o),i=n(0),r=n.n(i),s=n(5),l=n(10),c=n(66),u=n(11);function d({value:e,defaultValue:t,onDone:n}){const o=r.a.useRef(),[i,d]=r.a.useState(""),[m,p]=r.a.useState(!1),h=()=>{d(e),p(!0)},f=()=>{p(!1),n&&n(i),o.current&&o.current.focus()},g=e=>{switch(e.key){case"Enter":case" ":h()}};return r.a.createElement("div",{className:a.a.root},r.a.createElement(c.a,{isOpen:m,onBlur:()=>p(!1),placement:"bottom"},({ref:n})=>r.a.createElement("div",{ref:Object(u.d)(n,o),className:a.a.staticContainer,onClick:h,onKeyPress:g,tabIndex:0,role:"button"},r.a.createElement("span",{className:a.a.label},e||t),r.a.createElement(l.a,{icon:"edit",className:a.a.editIcon})),r.a.createElement(c.b,null,r.a.createElement(c.d,null,r.a.createElement("div",{className:a.a.editContainer},r.a.createElement("input",{type:"text",value:i,onChange:e=>{d(e.target.value)},onKeyDown:e=>{switch(e.key){case"Enter":f();break;case"Escape":p(!1);break;default:return}e.preventDefault(),e.stopPropagation()},autoFocus:!0,placeholder:"Feed name"}),r.a.createElement(s.a,{className:a.a.doneBtn,type:s.c.PRIMARY,size:s.b.NORMAL,onClick:f},r.a.createElement(l.a,{icon:"yes"})))))))}},280:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var o=n(0),a=n.n(o),i=n(169),r=n.n(i),s=n(64),l=n(5),c=n(10);function u({children:e,steps:t,current:n,onChangeStep:o,firstStep:i,lastStep:u}){var d;i=null!=i?i:[],u=null!=u?u:[];const m=null!==(d=t.findIndex(e=>e.key===n))&&void 0!==d?d:0,p=m<=0,h=m>=t.length-1,f=p?null:t[m-1],g=h?null:t[m+1],b=p?i:a.a.createElement(l.a,{type:l.c.LINK,onClick:()=>!p&&o&&o(t[m-1].key),className:r.a.prevLink,disabled:f.disabled},a.a.createElement(c.a,{icon:"arrow-left-alt2"}),a.a.createElement("span",null,f.label)),_=h?u:a.a.createElement(l.a,{type:l.c.LINK,onClick:()=>!h&&o&&o(t[m+1].key),className:r.a.nextLink,disabled:g.disabled},a.a.createElement("span",null,g.label),a.a.createElement(c.a,{icon:"arrow-right-alt2"}));return a.a.createElement(s.b,null,{path:[],left:b,right:_,center:e})}},281:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n(0),a=n.n(o),i=n(141),r=n.n(i),s=n(64),l=n(5),c=n(10),u=n(66);function d({pages:e,current:t,onChangePage:n,showNavArrows:o,hideMenuArrow:i,children:u}){var d,p;const{path:h,right:f}=u,g=null!==(d=e.findIndex(e=>e.key===t))&&void 0!==d?d:0,b=null!==(p=e[g].label)&&void 0!==p?p:"",_=g<=0,v=g>=e.length-1,y=_?null:e[g-1],E=v?null:e[g+1];let w=[];return o&&w.push(a.a.createElement(l.a,{key:"page-menu-left",type:l.c.PILL,onClick:()=>!_&&n&&n(e[g-1].key),disabled:_||y.disabled},a.a.createElement(c.a,{icon:"arrow-left-alt2"}))),w.push(a.a.createElement(m,{key:"page-menu",pages:e,current:t,onClickPage:e=>n&&n(e)},a.a.createElement("span",null,b),!i&&a.a.createElement(c.a,{icon:"arrow-down-alt2",className:r.a.arrowDown}))),o&&w.push(a.a.createElement(l.a,{key:"page-menu-left",type:l.c.PILL,onClick:()=>!v&&n&&n(e[g+1].key),disabled:v||E.disabled},a.a.createElement(c.a,{icon:"arrow-right-alt2"}))),a.a.createElement(s.b,{pathStyle:h.length>1?"line":"none"},{path:h,right:f,center:w})}function m({pages:e,current:t,onClickPage:n,children:o}){const[i,s]=a.a.useState(!1),l=()=>s(!0),c=()=>s(!1);return a.a.createElement(u.a,{isOpen:i,onBlur:c,placement:"bottom-start",refClassName:r.a.menuRef},({ref:e})=>a.a.createElement("a",{ref:e,className:r.a.menuLink,onClick:l},o),a.a.createElement(u.b,null,e.map(e=>{return a.a.createElement(u.c,{key:e.key,disabled:e.disabled,active:e.key===t,onClick:(o=e.key,()=>{n&&n(o),c()})},e.label);var o})))}},282:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n(0),a=n.n(o),i=n(170),r=n.n(i),s=n(65);function l({isOpen:e,onAccept:t,onCancel:n}){const[o,i]=a.a.useState("");function l(){t&&t(o)}return a.a.createElement(s.a,{title:"Feed name",isOpen:e,onCancel:function(){n&&n()},onAccept:l,buttons:["Save","Cancel"]},a.a.createElement("p",{className:r.a.message},"Give this feed a memorable name:"),a.a.createElement("input",{type:"text",className:r.a.input,value:o,onChange:e=>{i(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(l(),e.preventDefault(),e.stopPropagation())},autoFocus:!0}))}},29:function(e,t,n){"use strict";function o(e,t,n={}){return window.open(e,t,function(e={}){return Object.getOwnPropertyNames(e).map(t=>`${t}=${e[t]}`).join(",")}(n))}function a(e,t){return{top:window.top.outerHeight/2+window.top.screenY-t/2,left:window.top.outerWidth/2+window.top.screenX-e/2,width:e,height:t}}function i(){const{innerWidth:e,innerHeight:t}=window;return{width:e,height:t}}n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i}))},297:function(e,t,n){e.exports={"create-new-btn":"FeedsScreen__create-new-btn",createNewBtn:"FeedsScreen__create-new-btn"}},3:function(e,t,n){"use strict";n.d(t,"u",(function(){return u})),n.d(t,"h",(function(){return d})),n.d(t,"b",(function(){return m})),n.d(t,"v",(function(){return p})),n.d(t,"c",(function(){return h})),n.d(t,"e",(function(){return f})),n.d(t,"p",(function(){return g})),n.d(t,"o",(function(){return b})),n.d(t,"k",(function(){return _})),n.d(t,"f",(function(){return v})),n.d(t,"n",(function(){return y})),n.d(t,"q",(function(){return E})),n.d(t,"a",(function(){return w})),n.d(t,"t",(function(){return S})),n.d(t,"s",(function(){return O})),n.d(t,"r",(function(){return k})),n.d(t,"i",(function(){return C})),n.d(t,"j",(function(){return P})),n.d(t,"m",(function(){return T})),n.d(t,"g",(function(){return N})),n.d(t,"d",(function(){return L})),n.d(t,"l",(function(){return A}));var o=n(0),a=n.n(o),i=n(137),r=n(145),s=n(17),l=n(48);let c=0;function u(){return c++}function d(e){const t={};return Object.keys(e).forEach(n=>{const o=e[n];Array.isArray(o)?t[n]=o.slice():o instanceof Map?t[n]=new Map(o.entries()):t[n]="object"==typeof o?d(o):o}),t}function m(e,t){return Object.keys(t).forEach(n=>{e[n]=t[n]}),e}function p(e,t){return m(d(e),t)}function h(e,t){return Array.isArray(e)&&Array.isArray(t)?f(e,t):e instanceof Map&&t instanceof Map?f(Array.from(e.entries()),Array.from(t.entries())):"object"==typeof e&&"object"==typeof t?g(e,t):e===t}function f(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let o=0;o<e.length;++o)if(n){if(!n(e[o],t[o]))return!1}else if(!h(e[o],t[o]))return!1;return!0}function g(e,t){if(!e||!t||"object"!=typeof e||"object"!=typeof t)return h(e,t);const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;const a=new Set(n.concat(o));for(const n of a)if(!h(e[n],t[n]))return!1;return!0}function b(e){return 0===Object.keys(null!=e?e:{}).length}function _(e,t,n){return n=null!=n?n:(e,t)=>e===t,e.filter(e=>!t.some(t=>n(e,t)))}function v(e,t,n){return n=null!=n?n:(e,t)=>e===t,e.every(e=>t.some(t=>n(e,t)))&&t.every(t=>e.some(e=>n(t,e)))}function y(e,t){return 0===e.tag.localeCompare(t.tag)&&e.sort===t.sort}function E(e,t,n=0,i=!1){let r=e.trim();i&&(r=r.replace(/((?:^[.*•]+(\r\n|\r|\n))+)/gm,"\n"));const s=r.split("\n"),l=s.map((e,n)=>{if(e=e.trim(),i&&/^[.*•]$/.test(e))return null;let r,l=[];for(;null!==(r=/#([^\s]+)/g.exec(e));){const t="https://instagram.com/explore/tags/"+r[1],n=a.a.createElement("a",{href:t,target:"_blank",key:u()},r[0]),o=e.substr(0,r.index),i=e.substr(r.index+r[0].length);l.push(o),l.push(n),e=i}return e.length&&l.push(e),t&&(l=t(l,n)),s.length>1&&l.push(a.a.createElement("br",{key:u()})),a.a.createElement(o.Fragment,{key:u()},l)});return n>0?l.slice(0,n):l}var w;function S(e,t){const n=/(\s+)/g;let o,a=0,i=0,r="";for(;null!==(o=n.exec(e))&&a<t;){const t=o.index+o[1].length;r+=e.substr(i,t-i),i=t,a++}return i<e.length&&(r+=" ..."),r}function O(e){return Object(i.a)(Object(r.a)(e),{addSuffix:!0})}function k(e,t){const n=[];return e.forEach((e,o)=>{const a=o%t;Array.isArray(n[a])?n[a].push(e):n[a]=[e]}),n}function C(e,t){return function e(t){if(t.type===s.a.Type.VIDEO){const e=document.createElement("video");return e.autoplay=!1,e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.visibility="hidden",document.body.appendChild(e),new Promise(n=>{e.src=t.url,e.addEventListener("loadeddata",()=>{n({width:e.videoWidth,height:e.videoHeight}),document.body.removeChild(e)})})}if(t.type===s.a.Type.IMAGE){const e=new Image;return e.src=t.url,new Promise(t=>{e.onload=()=>{t({width:e.naturalWidth,height:e.naturalHeight})}})}return t.type===s.a.Type.ALBUM?e(t.children[0]):Promise.reject("Unknown media type")}(e).then(e=>function(e,t){const n=e.width>e.height?t.width/e.width:t.height/e.height;return{width:e.width*n,height:e.height*n}}(e,t))}function P(e,t){const n=t.map(l.b).join("|");return new RegExp(`(?:^|\\B)#(${n})(?:\\b|\\r|$)`,"imu").test(e)}function T(e,t){for(const n of t){const t=n();if(e(t))return t}}function N(e,t){return Math.max(0,Math.min(t.length-1,e))}function L(e,t,n){const o=e.slice();return o[t]=n,o}function A(e){return Array.isArray(e)?e[0]:e}!function(e){e.SMALL="s",e.MEDIUM="m",e.LARGE="l"}(w||(w={}))},32:function(e,n){e.exports=t},34:function(e,t,n){"use strict";function o(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function a(e){const t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}))},35:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return d}));var o=n(0),a=n.n(o),i=n(32),r=n.n(i),s=n(6);class l{constructor(e=new Map,t=[]){this.factories=e,this.extensions=new Map,this.cache=new Map,t.forEach(e=>this.addModule(e))}addModule(e){e.factories&&(this.factories=new Map([...this.factories,...e.factories])),e.extensions&&e.extensions.forEach((e,t)=>{this.extensions.has(t)?this.extensions.get(t).push(e):this.extensions.set(t,[e])})}get(e){let t=this.factories.get(e);if(void 0===t)throw new Error('Service "'+e+'" does not exist');let n=this.cache.get(e);if(void 0===n){n=t(this);let o=this.extensions.get(e);o&&o.forEach(e=>n=e(this,n)),this.cache.set(e,n)}return n}has(e){return this.factories.has(e)}}class c{constructor(e,t,n){this.key=e,this.mount=t,this.modules=n,this.container=null}addModules(e){this.modules=this.modules.concat(e)}run(){if(null!==this.container)return;let e=!1;const t=()=>{e||"interactive"!==document.readyState&&"complete"!==document.readyState||(this.actualRun(),e=!0)};t(),e||document.addEventListener("readystatechange",t)}actualRun(){!function(e){const t=`app/${e.key}/run`;document.dispatchEvent(new u(t,e))}(this);const e=d({root:()=>null,"root/children":()=>[]});this.container=new l(e,this.modules);const t=this.container.get("root/children").map((e,t)=>a.a.createElement(e,{key:t})),n=a.a.createElement(s.a,{c:this.container},t);this.modules.forEach(e=>e.run&&e.run(this.container)),r.a.render(n,this.mount)}}class u extends CustomEvent{constructor(e,t){super(e,{detail:{app:t}})}}function d(e){return new Map(Object.entries(e))}},37:function(e,t,n){e.exports={root:"MediaThumbnail__root","media-background-fade-in-animation":"MediaThumbnail__media-background-fade-in-animation",mediaBackgroundFadeInAnimation:"MediaThumbnail__media-background-fade-in-animation","media-object-fade-in-animation":"MediaThumbnail__media-object-fade-in-animation",mediaObjectFadeInAnimation:"MediaThumbnail__media-object-fade-in-animation",image:"MediaThumbnail__image","not-available":"MediaThumbnail__not-available",notAvailable:"MediaThumbnail__not-available"}},38:function(e,t,n){e.exports={root:"SettingsField__root layout__flex-column",label:"SettingsField__label layout__flex-column",container:"SettingsField__container layout__flex-row",control:"SettingsField__control layout__flex-column","control-partial-width":"SettingsField__control-partial-width SettingsField__control layout__flex-column",controlPartialWidth:"SettingsField__control-partial-width SettingsField__control layout__flex-column","control-full-width":"SettingsField__control-full-width SettingsField__control layout__flex-column",controlFullWidth:"SettingsField__control-full-width SettingsField__control layout__flex-column",tooltip:"SettingsField__tooltip layout__flex-column"}},39:function(e,t,n){"use strict";function o(e){return t=>(t.stopPropagation(),e(t))}function a(e,t){let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>{n=null,e(...o)},t)}}function i(){}n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i}))},4:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var o,a=n(19),i=n(1);!function(e){let t;!function(e){e.PERSONAL="PERSONAL",e.BUSINESS="BUSINESS"}(t=e.Type||(e.Type={}))}(o||(o={}));const r=Object(i.n)([]),s="https://secure.gravatar.com/avatar/4a94d759753ade2961582f7345c1d7b2?s=64&d=mm&r=g",l=e=>r.find(t=>t.id===e),c=e=>"https://instagram.com/"+e;function u(e){return e.slice().sort((e,t)=>e.type===t.type?0:e.type===o.Type.PERSONAL?-1:1),r.splice(0,r.length),e.forEach(e=>r.push(Object(i.n)(e))),r}function d(e){if("object"==typeof e&&Array.isArray(e.data))return u(e.data);throw"Spotlight encountered a problem trying to load your accounts. Kindly contact customer support for assistance."}t.b={list:r,DEFAULT_PROFILE_PIC:s,getById:l,getByUsername:e=>r.find(t=>t.username===e),hasAccounts:()=>r.length>0,filterExisting:e=>e.filter(e=>void 0!==l(e)),idsToAccounts:e=>e.map(e=>l(e)).filter(e=>void 0!==e),getBusinessAccounts:()=>r.filter(e=>e.type===o.Type.BUSINESS),getProfilePicUrl:e=>e.customProfilePicUrl?e.customProfilePicUrl:e.profilePicUrl?e.profilePicUrl:s,getBioText:e=>e.customBio.length?e.customBio:e.bio,getProfileUrl:e=>c(e.username),getUsernameUrl:c,loadAccounts:function(){return a.a.getAccounts().then(d).catch(e=>{throw a.a.getErrorReason(e)})},loadFromResponse:d,addAccounts:u}},40:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var o,a,i=n(21),r=n(1);!function(e){e.NEW_FEED="new",e.EDIT_FEED="edit",e.FEED_LIST="feeds",e.SETTINGS="settings",e.PROMOTIONS="promotions"}(o||(o={})),function(e){const t=Object(r.n)([]);e.getList=function(){return t},e.register=function(n){return t.push(n),t.sort((e,t)=>{var n,o;const a=null!==(n=e.position)&&void 0!==n?n:0,i=null!==(o=t.position)&&void 0!==o?o:0;return Math.sign(a-i)}),e},e.getScreen=function(e){return t.find(t=>t.id===e)},e.getCurrent=function(){var e;const n=null!==(e=i.a.get("screen"))&&void 0!==e?e:"";return t.find((e,t)=>n===e.id||!n&&0===t)}}(a||(a={}))},411:function(e,t,n){},43:function(e,t,n){e.exports={root:"GenericNavbar__root",list:"GenericNavbar__list","left-list":"GenericNavbar__left-list GenericNavbar__list",leftList:"GenericNavbar__left-list GenericNavbar__list",item:"GenericNavbar__item","center-list":"GenericNavbar__center-list GenericNavbar__list",centerList:"GenericNavbar__center-list GenericNavbar__list","right-list":"GenericNavbar__right-list GenericNavbar__list",rightList:"GenericNavbar__right-list GenericNavbar__list","path-list":"GenericNavbar__path-list GenericNavbar__left-list GenericNavbar__list",pathList:"GenericNavbar__path-list GenericNavbar__left-list GenericNavbar__list","path-segment":"GenericNavbar__path-segment",pathSegment:"GenericNavbar__path-segment",separator:"GenericNavbar__separator GenericNavbar__item"}},48:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));const o=(e,t)=>e.startsWith(t)?e:t+e,a=e=>{return(t=e,"#",t.startsWith("#")?t.substr("#".length):t).split(/\s/).map((e,t)=>t>0?e[0].toUpperCase()+e.substr(1):e).join("").replace(/\W/gi,"");var t}},52:function(e,t,n){e.exports={root:"SettingsGroup__root layout__flex-column",title:"SettingsGroup__title",content:"SettingsGroup__content","field-list":"SettingsGroup__field-list layout__flex-column",fieldList:"SettingsGroup__field-list layout__flex-column"}},58:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(0),a=n.n(o),i=n(74),r=n.n(i);function s(){return a.a.createElement("div",{className:r.a.root})}},59:function(e,t,n){"use strict";var o=n(0),a=n.n(o),i=n(76),r=n.n(i),s=n(4),l=n(11),c=n(6);t.a=Object(c.b)((function(e){var{account:t,square:n,className:o}=e,i=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]])}return n}(e,["account","square","className"]);const c=s.b.getProfilePicUrl(t),u=Object(l.b)(n?r.a.square:r.a.round,o);return a.a.createElement("img",Object.assign({},i,{className:u,src:s.b.DEFAULT_PROFILE_PIC,srcSet:c+" 1x",alt:t.username+" profile picture"}))}))},60:function(e,t,n){e.exports={root:"SettingsPage__root layout__flex-column",content:"SettingsPage__content","group-list":"SettingsPage__group-list layout__flex-column",groupList:"SettingsPage__group-list layout__flex-column"}},609:function(e,t,n){"use strict";n.r(t),n(259);var o=n(35),a=(n(411),n(362)),i=n(1),r=n(101),s=n(0),l=n.n(s),c=n(42),u=n(363),d=n(21),m=n(40),p=n(6),h=n(12);function f(){const e=new Date,t=3===e.getMonth()&&1===e.getDate()?"spitloght-800w.png":"spotlight-800w.png";return l.a.createElement("div",{className:"admin-loading"},l.a.createElement("div",{className:"admin-loading__perspective"},l.a.createElement("div",{className:"admin-loading__container"},l.a.createElement("img",{src:h.a.image(t),className:"admin-loading__logo",alt:"Spotlight"}))))}var g,b,_=n(7),v=n(14),y=n(379),E=n(186),w=n.n(E),S=n(10),O=n(20);n(19),(b=g||(g={})).list=Object(i.n)([]),b.fetch=function(){return v.a.restApi.getNotifications().then(e=>{"object"==typeof e&&Array.isArray(e.data)&&b.list.push(...e.data)}).catch(e=>{})};var k=n(380),C=n(66);const P=Object(p.b)((function(){const[e,t]=l.a.useState(!1),[n,o]=l.a.useState(!1),a=l.a.useCallback(()=>o(!0),[]),i=l.a.useCallback(()=>o(!1),[]),r=Object(O.f)(a);return!e&&g.list.length>0&&l.a.createElement(C.a,{className:w.a.menu,isOpen:n,onBlur:i,placement:"top-end"},({ref:e})=>l.a.createElement("div",{ref:e,className:w.a.beacon},l.a.createElement("button",{className:w.a.button,onClick:a,onKeyPress:r},l.a.createElement(S.a,{icon:"megaphone"}),g.list.length>0&&l.a.createElement("div",{className:w.a.counter},g.list.length))),l.a.createElement(C.b,null,g.list.map(e=>l.a.createElement(k.a,{key:e.id,notification:e})),n&&l.a.createElement("a",{className:w.a.hideLink,onClick:()=>t(!0)},"Hide")))}));var T=n(95),N=n(301);const L=new(n(199).a);var A=n(237);const x=document.title.replace("Spotlight","%s ‹ Spotlight");function B(){const e=d.a.get("screen"),t=m.b.getScreen(e);t&&(document.title=x.replace("%s",t.title))}d.a.listen(B);const I=Object(p.b)((function(){const[e,t]=Object(s.useState)(!1),[n,o]=Object(s.useState)(!1);Object(s.useLayoutEffect)(()=>{e||n||L.run().then(()=>{t(!0),o(!1),g.fetch()}).catch(e=>{T.a.add("load_error",Object(r.a)(A.a,{message:e.toString()}),0)})},[n,e]);const a=e=>{var t,n;const o=null!==(n=null!==(t=e.detail.message)&&void 0!==t?t:e.detail.response.data.message)&&void 0!==n?n:null;T.a.add("feed/fetch_fail",()=>l.a.createElement("div",null,l.a.createElement("p",null,"An error occurred while retrieving the media for this feed. Details:"),o&&l.a.createElement("code",null,o),l.a.createElement("p",null,"If this error persists, kindly"," ",l.a.createElement("a",{href:v.a.resources.supportUrl,target:"_blank"},"contact customer support"),".")),0)};return Object(s.useEffect)(()=>(B(),document.addEventListener(_.a.Events.FETCH_FAIL,a),()=>{document.removeEventListener(_.a.Events.FETCH_FAIL,a)}),[]),e?l.a.createElement(c.b,{history:d.a.history},m.b.getList().map((e,t)=>l.a.createElement(u.a,{key:e.id,when:"screen",is:e.id,isRoot:0===t,render:()=>l.a.createElement(e.component)})),l.a.createElement(N.a,null),l.a.createElement(P,null),l.a.createElement(y.a,null)):l.a.createElement(l.a.Fragment,null,l.a.createElement(f,null),l.a.createElement(N.a,null))}));var M=n(16),F=n(213),j=n.n(F),D=n(3),R=n(46),W=n(5);function z({}){const e=l.a.useRef(),t=l.a.useRef([]),[n,o]=l.a.useState(0),[a,i]=l.a.useState(!1),[,r]=l.a.useState(),c=()=>{const n=function(e){const t=.4*e.width,n=t/724,o=707*n,a=22*n,i=35*n;return{bounds:e,origin:{x:(e.width-t)/2+o-i/2,y:.5*e.height+a-i/2},scale:n,particleSize:i}}(e.current.getBoundingClientRect());t.current=t.current.map(e=>{const t=e.didSike?1:Math.max(1,1.3-1.3*Math.min(1,e.life/100));return Object.assign(Object.assign({},e),{pos:{x:e.pos.x+e.vel.x*t,y:e.pos.y+e.vel.y*t},life:e.life+1})}).filter(e=>e.life<500&&e.pos.x>=0&&e.pos.y>=0&&e.pos.x+e.size<=n.bounds.width&&e.pos.y+e.size<=n.bounds.height),t.current.length<30&&10*Math.random()>7&&t.current.push((e=>{const t=Math.max(1,4*Math.random()),n=2*Math.random()*Math.PI,o={x:Math.sin(n)*t,y:Math.cos(n)*t};return{pos:Object.assign({},e.origin),vel:o,size:e.particleSize,life:1}})(n)),r(D.u)};Object(s.useEffect)(()=>{const e=setInterval(c,25);return()=>clearInterval(e)},[]);const u=function(e){let t=null;return U.forEach(([n,o])=>{e>=n&&(t=o)}),t}(n);return l.a.createElement("div",{className:j.a.root},l.a.createElement("h1",{style:{textAlign:"center"}},"Let's play!"),l.a.createElement("p",null,"Click on as many Spotlight dots as you can. We challenge you to ",l.a.createElement("strong",null,"hit ",100),"!"),l.a.createElement("br",null),l.a.createElement("div",{ref:e,style:H.container},n>0&&l.a.createElement("div",{className:j.a.score},l.a.createElement("strong",null,"Score"),": ",l.a.createElement("span",null,n)),u&&l.a.createElement("div",{className:j.a.message},l.a.createElement("span",{className:j.a.messageBubble},u)),t.current.map((e,a)=>l.a.createElement("div",{key:a,onMouseDown:()=>(e=>{const a=t.current[e].didSike?5:1;t.current.splice(e,1),o(n+a)})(a),onMouseEnter:()=>(e=>{const n=t.current[e];if(n.didSike)return;const o=1e3*Math.random();o>100&&o<150&&(n.vel={x:5*Math.sign(-n.vel.x),y:5*Math.sign(-n.vel.y)},n.life=100,n.didSike=!0)})(a),style:Object.assign(Object.assign({},H.particle),{top:e.pos.y,left:e.pos.x,width:e.size,height:e.size,backgroundColor:e.didSike?"#ffaa00":"#"+(14492491+65536*e.life+256*e.life+e.life).toString(16)})},e.didSike&&l.a.createElement("span",{style:H.sike},"x",5)))),l.a.createElement(R.a,{title:"Get 20% off Spotlight PRO",isOpen:n>=100&&!a,onClose:()=>i(!0),allowShadeClose:!1},l.a.createElement(R.a.Content,null,l.a.createElement("div",{style:{textAlign:"center"}},l.a.createElement("p",{style:{display:"inline-block",width:"70%",marginTop:10}},l.a.createElement("strong",{style:{opacity:.7}},"You were just clicking the dot in the logo, weren't you?",l.a.createElement("br",null),"It doesn't matter. You made it a 100!")),l.a.createElement("h1",null,"Get 20% off Spotlight PRO"),l.a.createElement("p",{style:{display:"inline-block",width:"60%"}},"Open up to new opportunities with hashtag feeds, filtering options, visual moderation,"," ","tagged feeds, new layouts, promotions and much more."),l.a.createElement("div",{style:{margin:"10px 0"}},l.a.createElement("a",{href:v.a.resources.upgradeUrl,target:"_blank",style:{width:"100%"}},l.a.createElement(W.a,{type:W.c.PRIMARY,size:W.b.HERO,style:{width:"80%"}},"Get 20% off Spotlight PRO")))))))}const U=[[10,l.a.createElement("span",null,"You're getting the hang of this!")],[50,l.a.createElement("span",null,"Not bad. You're half way to a 100!")],[120,l.a.createElement("span",null,"Just post a 5-star review already. You're clearly in love with us!")],[150,l.a.createElement("span",null,"Hey, we'd be curious if there were more messages too. But sadly, this is the last one. Good-bye!")],[500,l.a.createElement("span",null,"Error: User has become obsessed with clicking games.")],[1e3,l.a.createElement("span",null,"While the term Easter egg has been used to mean a hidden object for some time, in reference to an Easter egg hunt, it has come to be more commonly used to mean a message, image, or feature hidden in a video game, film, or other, usually electronic, medium. The term used in this manner was coined around 1979 by Steve Wright, the then Director of Software Development in the Atari Consumer Division, to describe a hidden message in the Atari video game Adventure. [Wikipedia]")]],H={container:{flex:1,position:"relative",backgroundColor:"#fff",backgroundImage:`url('${h.a.image("spotlight-800w.png")}')`,backgroundPosition:"center 50%",backgroundSize:"40%",backgroundRepeat:"no-repeat",borderRadius:8,marginTop:15,userSelect:"none"},particle:{position:"absolute",backgroundColor:"#dd234b",borderRadius:999,cursor:"pointer",color:"#000",userSelect:"none"},sike:{position:"relative",left:"calc(100% + 5px)",fontSize:"16px",userSelect:"none"}};var G=n(149),K=n(214),q=n.n(K),V=n(11),Y=Object(p.b)((function({}){return l.a.createElement("div",{className:q.a.root})}));Object(p.b)((function({className:e,label:t,children:n}){const o="settings-field-"+Object(D.u)();return l.a.createElement("div",{className:Object(V.b)(q.a.fieldContainer,e)},l.a.createElement("div",{className:q.a.fieldLabel},l.a.createElement("label",{htmlFor:o},t)),l.a.createElement("div",{className:q.a.fieldControl},n(o)))}));var $=n(112),X=n(168);const J={factories:Object(o.b)({"admin/root/component":()=>I,"admin/settings/tabs/accounts":()=>({id:"accounts",label:"Manage Accounts",component:G.a}),"admin/settings/tabs/crons":()=>({id:"crons",label:"Crons",component:Object(r.b)($.a,{page:()=>v.a.settings.pages.find(e=>"crons"===e.id)})}),"admin/settings/tabs/advanced":e=>({id:"advanced",label:"Advanced",component:e.get("admin/settings/show_game")?e.get("admin/settings/game/component"):e.get("admin/settings/advanced/component")}),"admin/settings/show_game":()=>!0,"admin/settings/advanced/component":()=>Y,"admin/settings/game/component":()=>z}),extensions:Object(o.b)({"root/children":(e,t)=>[...t,e.get("admin/root/component")],"settings/tabs":(e,t)=>[e.get("admin/settings/tabs/accounts"),e.get("admin/settings/tabs/advanced"),...t]}),run:()=>{document.addEventListener(M.a,()=>{T.a.add("sli/settings/saved",Object(r.a)(X.a,{message:"Settings saved."}))});{const e=document.getElementById("toplevel_page_spotlight-instagram").querySelector("ul.wp-submenu").querySelectorAll("li:not(.wp-submenu-head)"),t=Array.from(e);m.b.getList().forEach((e,n)=>{const o=0===n,a=e.state||{},r=d.a.fullUrl(Object.assign({screen:e.id},a)),s=d.a.at(Object.assign({screen:e.id},a)),l=t.find(e=>e.querySelector("a").href===r);l&&(l.addEventListener("click",e=>{d.a.history.push(s,{}),e.preventDefault(),e.stopPropagation()}),Object(i.g)(()=>{var t;const n=null!==(t=d.a.get("screen"))&&void 0!==t?t:"",a=e.id===n||!n&&o;l.classList.toggle("current",a)}))})}}};var Q=n(26),Z=n(4),ee=n(297),te=n.n(ee),ne=n(161),oe=n(41),ae=n(72),ie=n.n(ae),re=n(238),se=n(113),le=n(27);const ce=()=>{const e={cols:{name:ie.a.nameCol,sources:ie.a.sourcesCol,usages:ie.a.usagesCol,actions:ie.a.actionsCol},cells:{name:ie.a.nameCell,sources:ie.a.sourcesCell,usages:ie.a.usagesCell,actions:ie.a.actionsCell}};return l.a.createElement("div",{className:"feeds-list"},l.a.createElement(se.a,{styleMap:e,cols:[{id:"name",label:"Name",render:e=>{const t=d.a.at({screen:m.a.EDIT_FEED,id:e.id.toString()});return l.a.createElement("div",null,l.a.createElement(oe.a,{to:t,className:ie.a.name},e.name?e.name:"(no name)"),l.a.createElement("div",{className:ie.a.metaList},l.a.createElement("span",{className:ie.a.id},"ID: ",e.id),l.a.createElement("span",{className:ie.a.layout},le.a.getName(e.options.layout))))}},{id:"sources",label:"Shows posts from",render:e=>l.a.createElement(ue,{feed:e})},{id:"usages",label:"Instances",render:e=>l.a.createElement(de,{feed:e})},{id:"actions",label:"Actions",render:e=>l.a.createElement("div",{className:ie.a.actionsList},l.a.createElement(re.a,{feed:e},l.a.createElement(W.a,{type:W.c.SECONDARY,tooltip:"Copy shortcode"},l.a.createElement(S.a,{icon:"editor-code"}))),l.a.createElement(W.a,{type:W.c.DANGER,tooltip:"Delete feed",onClick:()=>(e=>{confirm("Are you sure you want to delete this feed? This cannot be undone.")&&Q.a.deleteFeed(e)})(e)},l.a.createElement(S.a,{icon:"trash"})))}],rows:Q.a.list}))},ue=({feed:e})=>{let t=[];const n=_.a.Options.getSources(e.options);return n.accounts.forEach(e=>{const n=me(e);n&&t.push(n)}),n.tagged.forEach(e=>{const n=me(e,!0);n&&t.push(n)}),n.hashtags.forEach(e=>t.push(l.a.createElement("div",null,"#",e.tag))),0===t.length&&t.push(l.a.createElement("div",{className:ie.a.noSourcesMsg},l.a.createElement(S.a,{icon:"warning"}),l.a.createElement("span",null,"Feed has no sources"))),l.a.createElement("div",{className:ie.a.sourcesList},t.map((e,t)=>e&&l.a.createElement(he,{key:t},e)))},de=({feed:e})=>l.a.createElement("div",{className:ie.a.usagesList},e.usages.map((e,t)=>l.a.createElement("div",{key:t,className:ie.a.usage},l.a.createElement("a",{className:ie.a.usageLink,href:e.link,target:"_blank"},e.name),l.a.createElement("span",{className:ie.a.usageType},"(",e.type,")"))));function me(e,t){return e?l.a.createElement(pe,{account:e,isTagged:t}):null}const pe=({account:e,isTagged:t})=>{const n=t?"tag":e.type===Z.a.Type.BUSINESS?"businessman":"admin-users";return l.a.createElement("div",null,l.a.createElement(S.a,{icon:n}),e.username)},he=({children:e})=>l.a.createElement("div",{className:ie.a.source},e);var fe=n(92),ge=n(253),be=n.n(ge);const _e=d.a.at({screen:m.a.NEW_FEED}),ve=()=>{const[e,t]=l.a.useState(!1);return l.a.createElement(fe.a,{className:be.a.root,isTransitioning:e},l.a.createElement("div",null,l.a.createElement("h1",null,"Start engaging with your audience"),l.a.createElement(fe.a.Thin,null,l.a.createElement("p",null,"Connect with more people by embedding one or more Instagram feeds on this website."),l.a.createElement("p",null,"It only takes 3 steps! Let’s get going!"),l.a.createElement(fe.a.StepList,null,l.a.createElement(fe.a.Step,{num:1,isDone:Z.b.list.length>0},l.a.createElement("span",null,"Connect your Instagram Account")),l.a.createElement(fe.a.Step,{num:2},l.a.createElement("span",null,"Design your feed")),l.a.createElement(fe.a.Step,{num:3},l.a.createElement("span",null,"Embed it on your site"))))),l.a.createElement("div",{className:be.a.callToAction},l.a.createElement(fe.a.HeroButton,{onClick:()=>{t(!0),setTimeout(()=>d.a.history.push(_e,{}),fe.a.TRANSITION_DURATION)}},Z.b.list.length>0?"Design your feed":"Connect your Instagram Account"),l.a.createElement(fe.a.HelpMsg,{className:be.a.contactUs},"If you need help at any time,"," ",l.a.createElement("a",{href:v.a.resources.supportUrl,target:"_blank",style:{whiteSpace:"nowrap"}},"contact me here"),".",l.a.createElement("br",null),"- Mark Zahra, Spotlight")))};var ye=n(164),Ee=Object(p.b)((function(){return l.a.createElement(ne.a,{navbar:ye.a},l.a.createElement("div",{className:te.a.root},Q.a.hasFeeds()?l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{className:te.a.createNewBtn},l.a.createElement(oe.a,{to:d.a.at({screen:m.a.NEW_FEED}),className:"button button-primary button-large"},"Create a new feed")),l.a.createElement(ce,null)):l.a.createElement(ve,null)))})),we=n(85),Se=n(206),Oe=n(96),ke=n(384);function Ce({feed:e,onSave:t,onCancel:n}){const o=l.a.useCallback(e=>new Promise(n=>{const o=null===e.id;we.a.saveFeed(e).then(()=>{t&&t(e),o||n()})}),[]),a=l.a.useCallback(e=>we.a.editorTab=e,[]),i={tabs:Oe.a.tabs.slice(),showNameField:!0,showDoneBtn:!0,showCancelBtn:!0,doneBtnText:"Save",cancelBtnText:"Cancel"};return i.tabs.push({id:"embed",label:"Embed",sidebar:e=>l.a.createElement(ke.a,Object.assign({},e))}),l.a.createElement(Se.a,{feed:e,firstTab:we.a.editorTab,requireName:!0,confirmOnCancel:!0,useCtrlS:!0,onSave:o,onCancel:n,onChangeTab:a,config:i})}var Pe=Q.a.SavedFeed,Te=n(23);const Ne=()=>l.a.createElement("div",null,l.a.createElement(Te.a,{type:Te.b.ERROR,showIcon:!0},"Feed does not exist.",l.a.createElement(oe.a,{to:d.a.with({screen:"feeds"})},"Go back")));var Le=n(201),Ae=n(139);m.b.register({id:"feeds",title:"Feeds",position:0,component:Ee}),m.b.register({id:"new",title:"Add New",position:10,component:function(){return we.a.edit(new Pe),l.a.createElement(Ce,{feed:we.a.feed})}}),m.b.register({id:"edit",title:"Edit",isHidden:!0,component:function(){const e=(()=>{const e=d.a.get("id");return e?parseInt(e):null})(),t=Q.a.getById(e);return e&&t?(we.a.feed.id!==e&&we.a.edit(t),Object(s.useEffect)(()=>()=>we.a.cancelEditor(),[]),l.a.createElement(Ce,{feed:we.a.feed})):l.a.createElement(Ne,null)}}),m.b.register({id:"promotions",title:"Promotions",position:40,component:Object(r.a)(Le.a,{isFakePro:!0})}),m.b.register({id:"settings",title:"Settings",position:50,component:Ae.b}),L.add(()=>Q.a.loadFeeds()),L.add(()=>Z.b.loadAccounts()),L.add(()=>M.b.load());const xe=document.getElementById(v.a.config.rootId);if(xe){const e=[a.a,J].filter(e=>null!==e);xe.classList.add("wp-core-ui-override"),new o.a("admin",xe,e).run()}},64:function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return c}));var o=n(0),a=n.n(o),i=n(43),r=n.n(i),s=n(153);function l({children:e,pathStyle:t}){let{path:n,left:o,right:i,center:s}=e;return n=null!=n?n:[],o=null!=o?o:[],i=null!=i?i:[],s=null!=s?s:[],a.a.createElement("div",{className:r.a.root},a.a.createElement("div",{className:r.a.leftList},a.a.createElement("div",{className:r.a.pathList},n.map((e,n)=>a.a.createElement(m,{key:n,style:t},a.a.createElement("div",{className:r.a.item},e)))),a.a.createElement("div",{className:r.a.leftList},a.a.createElement(u,null,o))),a.a.createElement("div",{className:r.a.centerList},a.a.createElement(u,null,s)),a.a.createElement("div",{className:r.a.rightList},a.a.createElement(u,null,i)))}function c(){return a.a.createElement(s.a,null)}function u({children:e}){const t=Array.isArray(e)?e:[e];return a.a.createElement(a.a.Fragment,null,t.map((e,t)=>a.a.createElement(d,{key:t},e)))}function d({children:e}){return a.a.createElement("div",{className:r.a.item},e)}function m({children:e,style:t}){return a.a.createElement("div",{className:r.a.pathSegment},e,a.a.createElement(p,{style:t}))}function p({style:e}){if("none"===e)return null;const t="chevron"===e?"M0 0 L100 50 L0 100":"M50 0 L50 100";return a.a.createElement("div",{className:r.a.separator},a.a.createElement("svg",{viewBox:"0 0 100 100",width:"100%",height:"100%",preserveAspectRatio:"none"},a.a.createElement("path",{d:t,fill:"none",stroke:"currentcolor",strokeLinejoin:"bevel"})))}},7:function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var o=n(33),a=n.n(o),i=n(1),r=n(2),s=n(27),l=n(35),c=n(4),u=n(3),d=n(13),m=n(19),p=n(39),h=n(8),f=n(15),g=n(12),b=function(e,t,n,o){var a,i=arguments.length,r=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(r=(i<3?a(r):i>3?a(t,n,r):a(t,n))||r);return i>3&&r&&Object.defineProperty(t,n,r),r};class _{constructor(e=new _.Options,t=r.a.Mode.DESKTOP){this.media=[],this.canLoadMore=!1,this.stories=[],this.numLoadedMore=0,this.totalMedia=0,this.mode=r.a.Mode.DESKTOP,this.isLoaded=!1,this.isLoading=!1,this.isLoadingMore=!1,this.numMediaToShow=0,this.numMediaPerPage=0,this.cancelFetch=()=>{},this.options=new _.Options(e),this.localMedia=[],this.mode=t,this.mediaCounter=this._numMediaPerPage,this.reload=Object(p.a)(()=>this.load(),300),Object(i.o)(()=>this.mode,()=>{0===this.numLoadedMore&&(this.mediaCounter=this._numMediaPerPage,this.localMedia.length<this.numMediaToShow&&this.loadMedia(this.localMedia.length,this.numMediaToShow-this.localMedia.length))}),Object(i.o)(()=>this.getReloadOptions(),()=>this.reload()),Object(i.o)(()=>({num:this._numMediaPerPage,mode:this.mode}),({num:e})=>{this.localMedia.length<e&&e<=this.totalMedia?this.reload():this.mediaCounter=Math.max(1,e)}),Object(i.o)(()=>this._media,e=>this.media=e),Object(i.o)(()=>this._numMediaToShow,e=>this.numMediaToShow=e),Object(i.o)(()=>this._numMediaPerPage,e=>this.numMediaPerPage=e),Object(i.o)(()=>this._canLoadMore,e=>this.canLoadMore=e)}get _media(){return this.localMedia.slice(0,this.numMediaToShow)}get _numMediaToShow(){return Math.min(this.mediaCounter,this.totalMedia)}get _numMediaPerPage(){return Math.max(1,_.ComputedOptions.normalizeMultiInt(this.options.numPosts,this.mode,1))}get _canLoadMore(){return this.localMedia.length>this.mediaCounter||this.localMedia.length<this.totalMedia}loadMore(){const e=this.numMediaToShow+this._numMediaPerPage-this.localMedia.length;return this.isLoadingMore=!0,e>0?this.loadMedia(this.localMedia.length,this._numMediaPerPage).then(()=>{this.mediaCounter+=this._numMediaPerPage,this.numLoadedMore++,this.isLoadingMore=!1}):new Promise(e=>{this.numLoadedMore++,this.mediaCounter+=this._numMediaPerPage,this.isLoadingMore=!1,e()})}load(){return this.numLoadedMore=0,this.loadMedia(0,this._numMediaPerPage,!0).then(()=>(this.isLoaded=!0,this.mediaCounter=this._numMediaPerPage))}loadMedia(e,t,n){return this.cancelFetch(),_.Options.hasSources(this.options)?(this.isLoading=!0,new Promise((o,i)=>{m.a.getFeedMedia(this.options,e,t,e=>this.cancelFetch=e).then(e=>{var t;if("object"!=typeof e||"object"!=typeof e.data||!Array.isArray(e.data.media))throw{message:"The media response is malformed or corrupt",response:e};n&&(this.localMedia=[]),this.localMedia.push(...e.data.media),this.stories=null!==(t=e.data.stories)&&void 0!==t?t:[],this.totalMedia=e.data.total,o&&o()}).catch(e=>{var t;if(a.a.isCancel(e))return null;const n=new _.Events.FetchFailEvent(_.Events.FETCH_FAIL,{detail:{feed:this,message:null!==(t=e.response?e.response.data.message:void 0)&&void 0!==t?t:e.message,response:e.response}});return document.dispatchEvent(n),i&&i(e),e}).finally(()=>this.isLoading=!1)})):new Promise(e=>{this.localMedia=[],this.totalMedia=0,e&&e()})}getReloadOptions(){return JSON.stringify({accounts:this.options.accounts,hashtags:this.options.hashtags,tagged:this.options.tagged,postOrder:this.options.postOrder,mediaType:this.options.mediaType,moderation:this.options.moderation,moderationMode:this.options.moderationMode,hashtagBlacklist:this.options.hashtagBlacklist,hashtagWhitelist:this.options.hashtagWhitelist,captionBlacklist:this.options.captionBlacklist,captionWhitelist:this.options.captionWhitelist,hashtagBlacklistSettings:this.options.hashtagBlacklistSettings,hashtagWhitelistSettings:this.options.hashtagWhitelistSettings,captionBlacklistSettings:this.options.captionBlacklistSettings,captionWhitelistSettings:this.options.captionWhitelistSettings})}}b([i.n],_.prototype,"media",void 0),b([i.n],_.prototype,"canLoadMore",void 0),b([i.n],_.prototype,"stories",void 0),b([i.n],_.prototype,"numLoadedMore",void 0),b([i.n],_.prototype,"options",void 0),b([i.n],_.prototype,"totalMedia",void 0),b([i.n],_.prototype,"mode",void 0),b([i.n],_.prototype,"isLoaded",void 0),b([i.n],_.prototype,"isLoading",void 0),b([i.n],_.prototype,"isLoadingMore",void 0),b([i.f],_.prototype,"reload",void 0),b([i.n],_.prototype,"localMedia",void 0),b([i.n],_.prototype,"numMediaToShow",void 0),b([i.n],_.prototype,"numMediaPerPage",void 0),b([i.n],_.prototype,"mediaCounter",void 0),b([i.h],_.prototype,"_media",null),b([i.h],_.prototype,"_numMediaToShow",null),b([i.h],_.prototype,"_numMediaPerPage",null),b([i.h],_.prototype,"_canLoadMore",null),b([i.f],_.prototype,"loadMore",null),b([i.f],_.prototype,"load",null),b([i.f],_.prototype,"loadMedia",null),function(e){let t,n,o,a,m,p,_,v,y;!function(e){e.FETCH_FAIL="sli/feed/fetch_fail";class t extends CustomEvent{constructor(e,t){super(e,t)}}e.FetchFailEvent=t}(t=e.Events||(e.Events={}));class E{constructor(e={}){E.setFromObject(this,e)}static setFromObject(t,n={}){var o,a,i,l,u,d,m,p,h,g,b,_,v,y,E;const w=n.accounts?n.accounts.slice():e.DefaultOptions.accounts;t.accounts=w.filter(e=>!!e).map(e=>parseInt(e.toString()));const S=n.tagged?n.tagged.slice():e.DefaultOptions.tagged;return t.tagged=S.filter(e=>!!e).map(e=>parseInt(e.toString())),t.hashtags=n.hashtags?n.hashtags.slice():e.DefaultOptions.hashtags,t.layout=s.a.getById(n.layout).id,t.numColumns=r.a.normalize(n.numColumns,e.DefaultOptions.numColumns),t.highlightFreq=r.a.normalize(n.highlightFreq,e.DefaultOptions.highlightFreq),t.mediaType=n.mediaType||e.DefaultOptions.mediaType,t.postOrder=n.postOrder||e.DefaultOptions.postOrder,t.numPosts=r.a.normalize(n.numPosts,e.DefaultOptions.numPosts),t.linkBehavior=r.a.normalize(n.linkBehavior,e.DefaultOptions.linkBehavior),t.feedWidth=r.a.normalize(n.feedWidth,e.DefaultOptions.feedWidth),t.feedHeight=r.a.normalize(n.feedHeight,e.DefaultOptions.feedHeight),t.feedPadding=r.a.normalize(n.feedPadding,e.DefaultOptions.feedPadding),t.imgPadding=r.a.normalize(n.imgPadding,e.DefaultOptions.imgPadding),t.textSize=r.a.normalize(n.textSize,e.DefaultOptions.textSize),t.bgColor=n.bgColor||e.DefaultOptions.bgColor,t.hoverInfo=n.hoverInfo?n.hoverInfo.slice():e.DefaultOptions.hoverInfo,t.textColorHover=n.textColorHover||e.DefaultOptions.textColorHover,t.bgColorHover=n.bgColorHover||e.DefaultOptions.bgColorHover,t.showHeader=r.a.normalize(n.showHeader,e.DefaultOptions.showHeader),t.headerInfo=r.a.normalize(n.headerInfo,e.DefaultOptions.headerInfo),t.headerAccount=null!==(o=n.headerAccount)&&void 0!==o?o:e.DefaultOptions.headerAccount,t.headerAccount=null===t.headerAccount||void 0===c.b.getById(t.headerAccount)?c.b.list.length>0?c.b.list[0].id:null:t.headerAccount,t.headerStyle=r.a.normalize(n.headerStyle,e.DefaultOptions.headerStyle),t.headerTextSize=r.a.normalize(n.headerTextSize,e.DefaultOptions.headerTextSize),t.headerPhotoSize=r.a.normalize(n.headerPhotoSize,e.DefaultOptions.headerPhotoSize),t.headerTextColor=n.headerTextColor||e.DefaultOptions.headerTextColor,t.headerBgColor=n.headerBgColor||e.DefaultOptions.bgColor,t.headerPadding=r.a.normalize(n.headerPadding,e.DefaultOptions.headerPadding),t.customProfilePic=null!==(a=n.customProfilePic)&&void 0!==a?a:e.DefaultOptions.customProfilePic,t.customBioText=n.customBioText||e.DefaultOptions.customBioText,t.includeStories=null!==(i=n.includeStories)&&void 0!==i?i:e.DefaultOptions.includeStories,t.storiesInterval=n.storiesInterval||e.DefaultOptions.storiesInterval,t.showCaptions=r.a.normalize(n.showCaptions,e.DefaultOptions.showCaptions),t.captionMaxLength=r.a.normalize(n.captionMaxLength,e.DefaultOptions.captionMaxLength),t.captionRemoveDots=null!==(l=n.captionRemoveDots)&&void 0!==l?l:e.DefaultOptions.captionRemoveDots,t.captionSize=r.a.normalize(n.captionSize,e.DefaultOptions.captionSize),t.captionColor=n.captionColor||e.DefaultOptions.captionColor,t.showLikes=r.a.normalize(n.showLikes,e.DefaultOptions.showLikes),t.showComments=r.a.normalize(n.showComments,e.DefaultOptions.showCaptions),t.lcIconSize=r.a.normalize(n.lcIconSize,e.DefaultOptions.lcIconSize),t.likesIconColor=null!==(u=n.likesIconColor)&&void 0!==u?u:e.DefaultOptions.likesIconColor,t.commentsIconColor=n.commentsIconColor||e.DefaultOptions.commentsIconColor,t.lightboxShowSidebar=null!==(d=n.lightboxShowSidebar)&&void 0!==d?d:e.DefaultOptions.lightboxShowSidebar,t.numLightboxComments=n.numLightboxComments||e.DefaultOptions.numLightboxComments,t.showLoadMoreBtn=r.a.normalize(n.showLoadMoreBtn,e.DefaultOptions.showLoadMoreBtn),t.loadMoreBtnTextColor=n.loadMoreBtnTextColor||e.DefaultOptions.loadMoreBtnTextColor,t.loadMoreBtnBgColor=n.loadMoreBtnBgColor||e.DefaultOptions.loadMoreBtnBgColor,t.loadMoreBtnText=n.loadMoreBtnText||e.DefaultOptions.loadMoreBtnText,t.autoload=null!==(m=n.autoload)&&void 0!==m?m:e.DefaultOptions.autoload,t.showFollowBtn=r.a.normalize(n.showFollowBtn,e.DefaultOptions.showFollowBtn),t.followBtnText=null!==(p=n.followBtnText)&&void 0!==p?p:e.DefaultOptions.followBtnText,t.followBtnTextColor=n.followBtnTextColor||e.DefaultOptions.followBtnTextColor,t.followBtnBgColor=n.followBtnBgColor||e.DefaultOptions.followBtnBgColor,t.followBtnLocation=r.a.normalize(n.followBtnLocation,e.DefaultOptions.followBtnLocation),t.hashtagWhitelist=n.hashtagWhitelist||e.DefaultOptions.hashtagWhitelist,t.hashtagBlacklist=n.hashtagBlacklist||e.DefaultOptions.hashtagBlacklist,t.captionWhitelist=n.captionWhitelist||e.DefaultOptions.captionWhitelist,t.captionBlacklist=n.captionBlacklist||e.DefaultOptions.captionBlacklist,t.hashtagWhitelistSettings=null!==(h=n.hashtagWhitelistSettings)&&void 0!==h?h:e.DefaultOptions.hashtagWhitelistSettings,t.hashtagBlacklistSettings=null!==(g=n.hashtagBlacklistSettings)&&void 0!==g?g:e.DefaultOptions.hashtagBlacklistSettings,t.captionWhitelistSettings=null!==(b=n.captionWhitelistSettings)&&void 0!==b?b:e.DefaultOptions.captionWhitelistSettings,t.captionBlacklistSettings=null!==(_=n.captionBlacklistSettings)&&void 0!==_?_:e.DefaultOptions.captionBlacklistSettings,t.moderation=n.moderation||e.DefaultOptions.moderation,t.moderationMode=n.moderationMode||e.DefaultOptions.moderationMode,t.promotionEnabled=null!==(v=n.promotionEnabled)&&void 0!==v?v:e.DefaultOptions.promotionEnabled,t.autoPromotionsEnabled=null!==(y=n.autoPromotionsEnabled)&&void 0!==y?y:e.DefaultOptions.autoPromotionsEnabled,t.globalPromotionsEnabled=null!==(E=n.globalPromotionsEnabled)&&void 0!==E?E:e.DefaultOptions.globalPromotionsEnabled,Array.isArray(n.promotions)?t.promotions=f.a.fromArray(n.promotions):n.promotions&&n.promotions instanceof Map?t.promotions=f.a.fromMap(n.promotions):"object"==typeof n.promotions?t.promotions=n.promotions:t.promotions=e.DefaultOptions.promotions,t}static getAllAccounts(e){const t=c.b.idsToAccounts(e.accounts),n=c.b.idsToAccounts(e.tagged);return{all:t.concat(n),accounts:t,tagged:n}}static getSources(e){return{accounts:c.b.idsToAccounts(e.accounts),tagged:c.b.idsToAccounts(e.tagged),hashtags:c.b.getBusinessAccounts().length>0?e.hashtags.filter(e=>e.tag.length>0):[]}}static hasSources(t){const n=e.Options.getSources(t),o=n.accounts.length>0||n.tagged.length>0,a=n.hashtags.length>0;return o||a}static isLimitingPosts(e){return e.moderation.length>0||e.hashtagBlacklist.length>0||e.hashtagWhitelist.length>0||e.captionBlacklist.length>0||e.captionWhitelist.length>0}}b([i.n],E.prototype,"accounts",void 0),b([i.n],E.prototype,"hashtags",void 0),b([i.n],E.prototype,"tagged",void 0),b([i.n],E.prototype,"layout",void 0),b([i.n],E.prototype,"numColumns",void 0),b([i.n],E.prototype,"highlightFreq",void 0),b([i.n],E.prototype,"mediaType",void 0),b([i.n],E.prototype,"postOrder",void 0),b([i.n],E.prototype,"numPosts",void 0),b([i.n],E.prototype,"linkBehavior",void 0),b([i.n],E.prototype,"feedWidth",void 0),b([i.n],E.prototype,"feedHeight",void 0),b([i.n],E.prototype,"feedPadding",void 0),b([i.n],E.prototype,"imgPadding",void 0),b([i.n],E.prototype,"textSize",void 0),b([i.n],E.prototype,"bgColor",void 0),b([i.n],E.prototype,"textColorHover",void 0),b([i.n],E.prototype,"bgColorHover",void 0),b([i.n],E.prototype,"hoverInfo",void 0),b([i.n],E.prototype,"showHeader",void 0),b([i.n],E.prototype,"headerInfo",void 0),b([i.n],E.prototype,"headerAccount",void 0),b([i.n],E.prototype,"headerStyle",void 0),b([i.n],E.prototype,"headerTextSize",void 0),b([i.n],E.prototype,"headerPhotoSize",void 0),b([i.n],E.prototype,"headerTextColor",void 0),b([i.n],E.prototype,"headerBgColor",void 0),b([i.n],E.prototype,"headerPadding",void 0),b([i.n],E.prototype,"customBioText",void 0),b([i.n],E.prototype,"customProfilePic",void 0),b([i.n],E.prototype,"includeStories",void 0),b([i.n],E.prototype,"storiesInterval",void 0),b([i.n],E.prototype,"showCaptions",void 0),b([i.n],E.prototype,"captionMaxLength",void 0),b([i.n],E.prototype,"captionRemoveDots",void 0),b([i.n],E.prototype,"captionSize",void 0),b([i.n],E.prototype,"captionColor",void 0),b([i.n],E.prototype,"showLikes",void 0),b([i.n],E.prototype,"showComments",void 0),b([i.n],E.prototype,"lcIconSize",void 0),b([i.n],E.prototype,"likesIconColor",void 0),b([i.n],E.prototype,"commentsIconColor",void 0),b([i.n],E.prototype,"lightboxShowSidebar",void 0),b([i.n],E.prototype,"numLightboxComments",void 0),b([i.n],E.prototype,"showLoadMoreBtn",void 0),b([i.n],E.prototype,"loadMoreBtnText",void 0),b([i.n],E.prototype,"loadMoreBtnTextColor",void 0),b([i.n],E.prototype,"loadMoreBtnBgColor",void 0),b([i.n],E.prototype,"autoload",void 0),b([i.n],E.prototype,"showFollowBtn",void 0),b([i.n],E.prototype,"followBtnText",void 0),b([i.n],E.prototype,"followBtnTextColor",void 0),b([i.n],E.prototype,"followBtnBgColor",void 0),b([i.n],E.prototype,"followBtnLocation",void 0),b([i.n],E.prototype,"hashtagWhitelist",void 0),b([i.n],E.prototype,"hashtagBlacklist",void 0),b([i.n],E.prototype,"captionWhitelist",void 0),b([i.n],E.prototype,"captionBlacklist",void 0),b([i.n],E.prototype,"hashtagWhitelistSettings",void 0),b([i.n],E.prototype,"hashtagBlacklistSettings",void 0),b([i.n],E.prototype,"captionWhitelistSettings",void 0),b([i.n],E.prototype,"captionBlacklistSettings",void 0),b([i.n],E.prototype,"moderation",void 0),b([i.n],E.prototype,"moderationMode",void 0),e.Options=E;class w{constructor(e){Object.getOwnPropertyNames(e).map(t=>{this[t]=e[t]})}getCaption(e){const t=e.caption?e.caption:"";return this.captionMaxLength&&t.length?Object(u.q)(Object(u.t)(t,this.captionMaxLength)):t}static compute(t,n=r.a.Mode.DESKTOP){const o=new w({accounts:c.b.filterExisting(t.accounts),tagged:c.b.filterExisting(t.tagged),hashtags:t.hashtags.filter(e=>e.tag.length>0),layout:s.a.getById(t.layout),highlightFreq:r.a.get(t.highlightFreq,n,!0),linkBehavior:r.a.get(t.linkBehavior,n,!0),bgColor:Object(d.a)(t.bgColor),textColorHover:Object(d.a)(t.textColorHover),bgColorHover:Object(d.a)(t.bgColorHover),hoverInfo:t.hoverInfo,showHeader:r.a.get(t.showHeader,n,!0),headerInfo:r.a.get(t.headerInfo,n,!0),headerStyle:r.a.get(t.headerStyle,n,!0),headerTextColor:Object(d.a)(t.headerTextColor),headerBgColor:Object(d.a)(t.headerBgColor),headerPadding:r.a.get(t.headerPadding,n,!0),includeStories:t.includeStories,storiesInterval:t.storiesInterval,showCaptions:r.a.get(t.showCaptions,n,!0),captionMaxLength:r.a.get(t.captionMaxLength,n,!0),captionRemoveDots:t.captionRemoveDots,captionColor:Object(d.a)(t.captionColor),showLikes:r.a.get(t.showLikes,n,!0),showComments:r.a.get(t.showComments,n,!0),likesIconColor:Object(d.a)(t.likesIconColor),commentsIconColor:Object(d.a)(t.commentsIconColor),lightboxShowSidebar:t.lightboxShowSidebar,numLightboxComments:t.numLightboxComments,showLoadMoreBtn:r.a.get(t.showLoadMoreBtn,n,!0),loadMoreBtnTextColor:Object(d.a)(t.loadMoreBtnTextColor),loadMoreBtnBgColor:Object(d.a)(t.loadMoreBtnBgColor),loadMoreBtnText:t.loadMoreBtnText,showFollowBtn:r.a.get(t.showFollowBtn,n,!0),autoload:t.autoload,followBtnLocation:r.a.get(t.followBtnLocation,n,!0),followBtnTextColor:Object(d.a)(t.followBtnTextColor),followBtnBgColor:Object(d.a)(t.followBtnBgColor),followBtnText:t.followBtnText,account:null,showBio:!1,bioText:null,profilePhotoUrl:c.b.DEFAULT_PROFILE_PIC,feedWidth:"",feedHeight:"",feedPadding:"",imgPadding:"",textSize:"",headerTextSize:"",headerPhotoSize:"",captionSize:"",lcIconSize:"",showLcIcons:!1});if(o.numColumns=this.getNumCols(t,n),o.numPosts=this.getNumPosts(t,n),o.allAccounts=o.accounts.concat(o.tagged.filter(e=>!o.accounts.includes(e))),o.allAccounts.length>0&&(o.account=t.headerAccount&&o.allAccounts.includes(t.headerAccount)?c.b.getById(t.headerAccount):c.b.getById(o.allAccounts[0])),o.showHeader=o.showHeader&&null!==o.account,o.showHeader&&(o.profilePhotoUrl=t.customProfilePic.length?t.customProfilePic:c.b.getProfilePicUrl(o.account)),o.showFollowBtn=o.showFollowBtn&&null!==o.account,o.showBio=o.headerInfo.some(t=>t===e.HeaderInfo.BIO),o.showBio){const e=t.customBioText.trim().length>0?t.customBioText:null!==o.account?c.b.getBioText(o.account):"";o.bioText=Object(u.q)(e),o.showBio=o.bioText.length>0}return o.feedWidth=this.normalizeCssSize(t.feedWidth,n,"auto"),o.feedHeight=this.normalizeCssSize(t.feedHeight,n,"auto"),o.feedPadding=this.normalizeCssSize(t.feedPadding,n,"0"),o.imgPadding=this.normalizeCssSize(t.imgPadding,n,"0"),o.textSize=this.normalizeCssSize(t.textSize,n,"inherit",!0),o.headerTextSize=this.normalizeCssSize(t.headerTextSize,n,"inherit"),o.headerPhotoSize=this.normalizeCssSize(t.headerPhotoSize,n,"50px"),o.captionSize=this.normalizeCssSize(t.captionSize,n,"inherit"),o.lcIconSize=this.normalizeCssSize(t.lcIconSize,n,"inherit"),o.buttonPadding=Math.max(10,r.a.get(t.imgPadding,n))+"px",o.showLcIcons=o.showLikes||o.showComments,o}static getNumCols(e,t){return Math.max(1,this.normalizeMultiInt(e.numColumns,t,1))}static getNumPosts(e,t){return Math.max(1,this.normalizeMultiInt(e.numPosts,t,1))}static normalizeMultiInt(e,t,n=0){const o=parseInt(r.a.get(e,t)+"");return isNaN(o)?t===r.a.Mode.DESKTOP?n:this.normalizeMultiInt(e,r.a.Mode.DESKTOP,n):o}static normalizeCssSize(e,t,n=null,o=!1){const a=r.a.get(e,t,o);return a?a+"px":n}}function S(e,t){if(g.a.isPro)return Object(u.m)(h.a.isValid,[()=>O(e,t),()=>t.globalPromotionsEnabled&&h.a.getGlobalPromo(e),()=>t.autoPromotionsEnabled&&h.a.getAutoPromo(e)])}function O(e,t){return e?h.a.getPromoFromDictionary(e,t.promotions):void 0}e.ComputedOptions=w,e.HashtagSorting=Object(l.b)({recent:"Most recent",popular:"Most popular"}),function(e){e.ALL="all",e.PHOTOS="photos",e.VIDEOS="videos"}(n=e.MediaType||(e.MediaType={})),function(e){e.NOTHING="nothing",e.SELF="self",e.NEW_TAB="new_tab",e.LIGHTBOX="lightbox"}(o=e.LinkBehavior||(e.LinkBehavior={})),function(e){e.DATE_ASC="date_asc",e.DATE_DESC="date_desc",e.POPULARITY_ASC="popularity_asc",e.POPULARITY_DESC="popularity_desc",e.RANDOM="random"}(a=e.PostOrder||(e.PostOrder={})),function(e){e.USERNAME="username",e.DATE="date",e.CAPTION="caption",e.LIKES_COMMENTS="likes_comments",e.INSTA_LINK="insta_link"}(m=e.HoverInfo||(e.HoverInfo={})),function(e){e.NORMAL="normal",e.BOXED="boxed",e.CENTERED="centered"}(p=e.HeaderStyle||(e.HeaderStyle={})),function(e){e.BIO="bio",e.PROFILE_PIC="profile_pic",e.FOLLOWERS="followers",e.MEDIA_COUNT="media_count"}(_=e.HeaderInfo||(e.HeaderInfo={})),function(e){e.HEADER="header",e.BOTTOM="bottom",e.BOTH="both"}(v=e.FollowBtnLocation||(e.FollowBtnLocation={})),function(e){e.WHITELIST="whitelist",e.BLACKLIST="blacklist"}(y=e.ModerationMode||(e.ModerationMode={})),e.DefaultOptions={accounts:[],hashtags:[],tagged:[],layout:null,numColumns:{desktop:3},highlightFreq:{desktop:7},mediaType:n.ALL,postOrder:a.DATE_DESC,numPosts:{desktop:9},linkBehavior:{desktop:o.LIGHTBOX,phone:o.NEW_TAB},feedWidth:{desktop:""},feedHeight:{desktop:""},feedPadding:{desktop:20,tablet:14,phone:10},imgPadding:{desktop:14,tablet:10,phone:6},textSize:{all:""},bgColor:{r:255,g:255,b:255,a:1},hoverInfo:[m.LIKES_COMMENTS,m.INSTA_LINK],textColorHover:{r:255,g:255,b:255,a:1},bgColorHover:{r:0,g:0,b:0,a:.5},showHeader:{desktop:!0},headerInfo:{desktop:[_.PROFILE_PIC,_.BIO]},headerAccount:null,headerStyle:{desktop:p.NORMAL,phone:p.CENTERED},headerTextSize:{desktop:""},headerPhotoSize:{desktop:50},headerTextColor:{r:0,g:0,b:0,a:1},headerBgColor:{r:255,g:255,b:255,a:1},headerPadding:{desktop:0},customProfilePic:0,customBioText:"",includeStories:!1,storiesInterval:5,showCaptions:{desktop:!1},captionMaxLength:{desktop:0},captionRemoveDots:!1,captionSize:{desktop:0},captionColor:{r:0,g:0,b:0,a:1},showLikes:{desktop:!1},showComments:{desktop:!1},lcIconSize:{desktop:14},likesIconColor:{r:0,g:0,b:0,a:1},commentsIconColor:{r:0,g:0,b:0,a:1},lightboxShowSidebar:!1,numLightboxComments:50,showLoadMoreBtn:{desktop:!0},loadMoreBtnTextColor:{r:255,g:255,b:255,a:1},loadMoreBtnBgColor:{r:0,g:149,b:246,a:1},loadMoreBtnText:"Load more",autoload:!1,showFollowBtn:{desktop:!0},followBtnText:"Follow on Instagram",followBtnTextColor:{r:255,g:255,b:255,a:1},followBtnBgColor:{r:0,g:149,b:246,a:1},followBtnLocation:{desktop:v.HEADER,phone:v.BOTTOM},hashtagWhitelist:[],hashtagBlacklist:[],captionWhitelist:[],captionBlacklist:[],hashtagWhitelistSettings:!0,hashtagBlacklistSettings:!0,captionWhitelistSettings:!0,captionBlacklistSettings:!0,moderation:[],moderationMode:y.BLACKLIST,promotionEnabled:!0,autoPromotionsEnabled:!0,globalPromotionsEnabled:!0,promotions:{}},e.getPromo=S,e.getFeedPromo=O,e.executeMediaClick=function(e,t){const n=S(e,t),o=h.a.getConfig(n),a=h.a.getType(n);return!(!a||!a.isValid(o)||"function"!=typeof a.onMediaClick)&&a.onMediaClick(e,o)},e.getLink=function(e,t){var n,o;const a=S(e,t),i=h.a.getConfig(a),r=h.a.getType(a);if(void 0===r||!r.isValid(i))return{text:null,url:null,newTab:!1};let[s,l]=r.getPopupLink?null!==(n=r.getPopupLink(e,i))&&void 0!==n?n:null:[null,!1];return{text:s,url:r.getMediaUrl&&null!==(o=r.getMediaUrl(e,i))&&void 0!==o?o:null,newTab:l}}}(_||(_={}))},72:function(e,t,n){e.exports={"name-col":"FeedsList__name-col",nameCol:"FeedsList__name-col","actions-col":"FeedsList__actions-col",actionsCol:"FeedsList__actions-col","actions-cell":"FeedsList__actions-cell",actionsCell:"FeedsList__actions-cell",name:"FeedsList__name layout__text-overflow-ellipsis","meta-list":"FeedsList__meta-list",metaList:"FeedsList__meta-list","meta-info":"FeedsList__meta-info",metaInfo:"FeedsList__meta-info",id:"FeedsList__id FeedsList__meta-info",layout:"FeedsList__layout FeedsList__meta-info","sources-list":"FeedsList__sources-list layout__flex-row",sourcesList:"FeedsList__sources-list layout__flex-row",source:"FeedsList__source layout__text-overflow-ellipsis","no-sources-msg":"FeedsList__no-sources-msg",noSourcesMsg:"FeedsList__no-sources-msg","usages-list":"FeedsList__usages-list layout__flex-column",usagesList:"FeedsList__usages-list layout__flex-column",usage:"FeedsList__usage layout__flex-row layout__text-overflow-ellipsis","usage-link":"FeedsList__usage-link layout__text-overflow-ellipsis",usageLink:"FeedsList__usage-link layout__text-overflow-ellipsis","usage-type":"FeedsList__usage-type",usageType:"FeedsList__usage-type","actions-list":"FeedsList__actions-list",actionsList:"FeedsList__actions-list","sources-cell":"FeedsList__sources-cell",sourcesCell:"FeedsList__sources-cell","sources-col":"FeedsList__sources-col",sourcesCol:"FeedsList__sources-col","usages-cell":"FeedsList__usages-cell",usagesCell:"FeedsList__usages-cell","usages-col":"FeedsList__usages-col",usagesCol:"FeedsList__usages-col"}},73:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var o=n(0),a=n.n(o),i=n(37),r=n.n(i),s=n(98),l=n(3),c=n(58),u=n(11),d=n(15);function m(e){var{media:t,className:n,size:i,onLoadImage:m,width:p,height:h}=e,f=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]])}return n}(e,["media","className","size","onLoadImage","width","height"]);const g=a.a.useRef(),b=a.a.useRef(),[_,v]=a.a.useState(!0);function y(){if(g.current){const e=null!=i?i:function(){const e=g.current.getBoundingClientRect();return e.width<=320?l.a.SMALL:(e.width,l.a.MEDIUM)}(),n="object"==typeof t.thumbnails&&d.a.has(t.thumbnails,e)?d.a.get(t.thumbnails,e):t.thumbnail;g.current.src!==n&&(g.current.src=n)}}return Object(o.useLayoutEffect)(()=>{if("VIDEO"!==t.type){let e=new s.a(y);return g.current&&(g.current.onload=()=>{v(!1),m&&m()},g.current.onerror=()=>{g.current.src!==t.thumbnail&&(g.current.src=t.thumbnail),v(!1),m&&m()},y(),e.observe(g.current)),()=>{g.current.onload=()=>null,g.current.onerror=()=>null,e.disconnect()}}b.current&&(b.current.currentTime=1,v(!1),m&&m())},[t,i]),t.url&&t.url.length>0?a.a.createElement("div",Object.assign({className:Object(u.b)(r.a.root,n)},f),"VIDEO"===t.type&&a.a.createElement("video",{ref:b,className:r.a.video,src:t.url,autoPlay:!1,controls:!1,tabIndex:0},a.a.createElement("source",{src:t.url}),"Your browser does not support videos"),"VIDEO"!==t.type&&a.a.createElement("img",Object.assign({ref:g,className:r.a.image,loading:"lazy",alt:t.caption,width:p,height:h},u.e)),_&&a.a.createElement(c.a,null)):a.a.createElement("div",{className:r.a.notAvailable},a.a.createElement("span",null,"Thumbnail not available"))}},74:function(e,t,n){e.exports={root:"MediaLoading__root",animation:"MediaLoading__animation"}},76:function(e,t,n){e.exports={root:"ProfilePic__root",round:"ProfilePic__round ProfilePic__root",square:"ProfilePic__square ProfilePic__root"}},77:function(e,t,n){e.exports={"connect-btn":"AccountsPage__connect-btn",connectBtn:"AccountsPage__connect-btn"}},8:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var o,a=n(12),i=n(15),r=n(3);!function(e){function t(e){return e?c(e.type):void 0}function n(e){var n;if("object"!=typeof e)return!1;const o=t(e);return void 0!==o&&o.isValid(null!==(n=e.config)&&void 0!==n?n:{})}function o(t){return t?e.getPromoFromDictionary(t,a.a.config.globalPromotions):void 0}function s(e){const t=l(e);return void 0===t?void 0:t.promotion}function l(t){if(t)for(const n of a.a.config.autoPromotions){const o=e.Automation.getType(n),a=e.Automation.getConfig(n);if(o&&o.matches(t,a))return n}}function c(t){return e.types.find(e=>e.id===t)}let u;e.getConfig=function(e){var t,n;return e&&null!==(n=null!==(t=e.config)&&void 0!==t?t:e.data)&&void 0!==n?n:{}},e.getType=t,e.isValid=n,e.getPromoFromDictionary=function(t,n){const o=i.a.get(n,t.id);if(o)return e.getType(o)?o:void 0},e.getPromo=function(e){return Object(r.m)(n,[()=>o(e),()=>s(e)])},e.getGlobalPromo=o,e.getAutoPromo=s,e.getAutomation=l,e.types=[],e.getTypes=function(){return e.types},e.registerType=function(t){e.types.push(t)},e.getTypeById=c,e.clearTypes=function(){e.types.splice(0,e.types.length)},function(e){e.getType=function(e){return e?n(e.type):void 0},e.getConfig=function(e){var t,n;return e&&null!==(n=null!==(t=e.config)&&void 0!==t?t:e.data)&&void 0!==n?n:{}},e.getPromotion=function(e){return e?e.promotion:void 0};const t=[];function n(e){return t.find(t=>t.id===e)}e.getTypes=function(){return t},e.registerType=function(e){t.push(e)},e.getTypeById=n,e.clearTypes=function(){t.splice(0,t.length)}}(u=e.Automation||(e.Automation={}))}(o||(o={}))},80:function(e,t,n){e.exports={screen:"PromotionsScreen__screen",navbar:"PromotionsScreen__navbar","navbar-item":"PromotionsScreen__navbar-item",navbarItem:"PromotionsScreen__navbar-item","navbar-fake-pro-item":"PromotionsScreen__navbar-fake-pro-item PromotionsScreen__navbar-item",navbarFakeProItem:"PromotionsScreen__navbar-fake-pro-item PromotionsScreen__navbar-item","navbar-pro-pill":"PromotionsScreen__navbar-pro-pill",navbarProPill:"PromotionsScreen__navbar-pro-pill"}},82:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return c}));var o=n(7),a=n(19),i=n(3),r=n(15);class s{constructor(e){this.incFilters=!1,this.prevOptions=null,this.media=new Array,this.config=Object(i.h)(e),void 0===this.config.watch&&(this.config.watch={all:!0})}fetchMedia(e,t){if(this.hasCache(e))return Promise.resolve(this.media);const n=Object.assign({},e.options,{moderation:this.isWatchingField("moderation")?e.options.moderation:[],moderationMode:e.options.moderationMode,hashtagBlacklist:this.isWatchingField("hashtagBlacklist")?e.options.hashtagBlacklist:[],hashtagWhitelist:this.isWatchingField("hashtagWhitelist")?e.options.hashtagWhitelist:[],captionBlacklist:this.isWatchingField("captionBlacklist")?e.options.captionBlacklist:[],captionWhitelist:this.isWatchingField("captionWhitelist")?e.options.captionWhitelist:[],hashtagBlacklistSettings:!!this.isWatchingField("hashtagBlacklistSettings")&&e.options.hashtagBlacklistSettings,hashtagWhitelistSettings:!!this.isWatchingField("hashtagWhitelistSettings")&&e.options.hashtagWhitelistSettings,captionBlacklistSettings:!!this.isWatchingField("captionBlacklistSettings")&&e.options.captionBlacklistSettings,captionWhitelistSettings:!!this.isWatchingField("captionWhitelistSettings")&&e.options.captionWhitelistSettings});return t&&t(),a.a.getFeedMedia(n).then(t=>(this.prevOptions=new o.a.Options(e.options),this.media=t.data.media,this.media))}hasCache(e){return null!==this.prevOptions&&!this.isCacheInvalid(e)}isWatchingField(e){var t,n,o;let a=null!==(t=this.config.watch.all)&&void 0!==t&&t;return 1===r.a.size(this.config.watch)&&void 0!==this.config.watch.all?a:(s.FILTER_FIELDS.includes(e)&&(a=null!==(n=r.a.get(this.config.watch,"filters"))&&void 0!==n?n:a),null!==(o=r.a.get(this.config.watch,e))&&void 0!==o?o:a)}isCacheInvalid(e){const t=e.options,n=this.prevOptions;if(Object(i.k)(e.media,this.media,(e,t)=>e.id===t.id).length>0)return!0;if(this.isWatchingField("accounts")&&!Object(i.f)(t.accounts,n.accounts))return!0;if(this.isWatchingField("tagged")&&!Object(i.f)(t.tagged,n.tagged))return!0;if(this.isWatchingField("hashtags")&&!Object(i.f)(t.hashtags,n.hashtags,i.n))return!0;if(this.isWatchingField("moderationMode")&&t.moderationMode!==n.moderationMode)return!0;if(this.isWatchingField("moderation")&&!Object(i.f)(t.moderation,n.moderation))return!0;if(this.isWatchingField("filters")){if(this.isWatchingField("captionWhitelistSettings")&&t.captionWhitelistSettings!==n.captionWhitelistSettings)return!0;if(this.isWatchingField("captionBlacklistSettings")&&t.captionBlacklistSettings!==n.captionBlacklistSettings)return!0;if(this.isWatchingField("hashtagWhitelistSettings")&&t.hashtagWhitelistSettings!==n.hashtagWhitelistSettings)return!0;if(this.isWatchingField("hashtagBlacklistSettings")&&t.hashtagBlacklistSettings!==n.hashtagBlacklistSettings)return!0;if(this.isWatchingField("captionWhitelist")&&!Object(i.f)(t.captionWhitelist,n.captionWhitelist))return!0;if(this.isWatchingField("captionBlacklist")&&!Object(i.f)(t.captionBlacklist,n.captionBlacklist))return!0;if(this.isWatchingField("hashtagWhitelist")&&!Object(i.f)(t.hashtagWhitelist,n.hashtagWhitelist))return!0;if(this.isWatchingField("hashtagBlacklist")&&!Object(i.f)(t.hashtagBlacklist,n.hashtagBlacklist))return!0}return!1}}!function(e){e.FILTER_FIELDS=["hashtagBlacklist","hashtagWhitelist","captionBlacklist","captionWhitelist","hashtagBlacklistSettings","hashtagWhitelistSettings","captionBlacklistSettings","captionWhitelistSettings"]}(s||(s={}));const l=new s({watch:{all:!0,filters:!1}}),c=new s({watch:{all:!0,moderation:!1}})},85:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var o=n(1),a=n(26),i=n(21),r=n(40),s=n(95),l=n(168),c=n(101),u=n(14),d=n(19),m=n(237),p=function(e,t,n,o){var a,i=arguments.length,r=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(r=(i<3?a(r):i>3?a(t,n,r):a(t,n))||r);return i>3&&r&&Object.defineProperty(t,n,r),r},h=a.a.SavedFeed;class f{constructor(){this.editorTab="connect",this.isGoingFromNewToEdit=!1,this.isPromptingFeedName=!1,this.feed=new h,this.isDoingOnboarding=u.a.config.doOnboarding}edit(e){this.isGoingFromNewToEdit||(this.editorTab="connect"),this.isGoingFromNewToEdit=!1,this.feed=null,this.feed=new h(e),this.isEditorDirty=!1}saveFeed(e){const t=null===e.id;return this.isDoingOnboarding=!1,new Promise((n,o)=>{a.a.saveFeed(e).then(e=>{s.a.add("feed/save/success",Object(c.a)(l.a,{message:"Feed saved."})),t&&(this.isGoingFromNewToEdit=!0,i.a.history.push(i.a.at({screen:r.a.EDIT_FEED,id:e.id.toString()}),{})),n(e)}).catch(e=>{const t=d.a.getErrorReason(e);s.a.add("feed/save/error",Object(c.a)(m.a,{message:"Failed to save the feed: "+t})),o(t)})})}saveEditor(e){if(!this.isEditorDirty)return;const t=null===this.feed.id;if(0!==this.feed.name.length||e)return this.isSavingFeed=!0,this.isDoingOnboarding=!1,a.a.saveFeed(this.feed).then(e=>{this.feed=new h(e),this.isSavingFeed=!1,this.isEditorDirty=!1,s.a.add("feed/saved",Object(c.a)(l.a,{message:"Feed saved."})),t&&(this.isGoingFromNewToEdit=!0,i.a.history.push(i.a.at({screen:r.a.EDIT_FEED,id:this.feed.id.toString()}),{}))});this.isPromptingFeedName=!0}cancelEditor(){this.isGoingFromNewToEdit||(this.feed=new h,this.isEditorDirty=!1,this.isGoingFromNewToEdit=!1)}closeEditor(){this.cancelEditor(),setTimeout(()=>{i.a.history.push(i.a.at({screen:r.a.FEED_LIST}),{})},10)}onEditorChange(e){e&&h.setFromObject(this.feed,e),this.isEditorDirty=!0}}p([o.n],f.prototype,"feed",void 0),p([o.n],f.prototype,"isSavingFeed",void 0),p([o.n],f.prototype,"isEditorDirty",void 0),p([o.n],f.prototype,"editorTab",void 0),p([o.n],f.prototype,"isDoingOnboarding",void 0),p([o.n],f.prototype,"isGoingFromNewToEdit",void 0),p([o.n],f.prototype,"isPromptingFeedName",void 0),p([o.f],f.prototype,"edit",null),p([o.f],f.prototype,"saveEditor",null),p([o.f],f.prototype,"cancelEditor",null),p([o.f],f.prototype,"closeEditor",null),p([o.f],f.prototype,"onEditorChange",null);const g=new f},86:function(e,t,n){e.exports={label:"TabNavbar__label",tab:"TabNavbar__tab",current:"TabNavbar__current TabNavbar__tab",disabled:"TabNavbar__disabled TabNavbar__tab"}},89:function(e,t,n){"use strict";n.d(t,"a",(function(){return E}));var o=n(0),a=n.n(o),i=n(46),r=n(9),s=n.n(r),l=n(6),c=n(4),u=n(616),d=n(388),m=n(55),p=n(114),h=n(105),f=n(30),g=n(5),b=n(23),_=n(14),v=n(59),y=Object(l.b)((function({account:e,onUpdate:t}){const[n,o]=a.a.useState(!1),[i,r]=a.a.useState(""),[l,y]=a.a.useState(!1),E=e.type===c.a.Type.PERSONAL,w=c.b.getBioText(e),S=()=>{e.customBio=i,y(!0),f.a.updateAccount(e).then(()=>{o(!1),y(!1),t&&t()})},O=n=>{e.customProfilePicUrl=n,y(!0),f.a.updateAccount(e).then(()=>{y(!1),t&&t()})};return a.a.createElement("div",{className:s.a.root},a.a.createElement("div",{className:s.a.container},a.a.createElement("div",{className:s.a.infoColumn},a.a.createElement("a",{href:c.b.getProfileUrl(e),target:"_blank",className:s.a.username},"@",e.username),a.a.createElement("div",{className:s.a.row},a.a.createElement("span",{className:s.a.label},"Spotlight ID:"),e.id),a.a.createElement("div",{className:s.a.row},a.a.createElement("span",{className:s.a.label},"User ID:"),e.userId),a.a.createElement("div",{className:s.a.row},a.a.createElement("span",{className:s.a.label},"Type:"),e.type),!n&&a.a.createElement("div",{className:s.a.row},a.a.createElement("div",null,a.a.createElement("span",{className:s.a.label},"Bio:"),a.a.createElement("a",{className:s.a.editBioLink,onClick:()=>{r(c.b.getBioText(e)),o(!0)}},"Edit bio"),a.a.createElement("pre",{className:s.a.bio},w.length>0?w:"(No bio)"))),n&&a.a.createElement("div",{className:s.a.row},a.a.createElement("textarea",{className:s.a.bioEditor,value:i,onChange:e=>{r(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&e.ctrlKey&&(S(),e.preventDefault(),e.stopPropagation())},rows:4}),a.a.createElement("div",{className:s.a.bioFooter},a.a.createElement("div",{className:s.a.bioEditingControls},l&&a.a.createElement("span",null,"Please wait ...")),a.a.createElement("div",{className:s.a.bioEditingControls},a.a.createElement(g.a,{className:s.a.bioEditingButton,type:g.c.DANGER,disabled:l,onClick:()=>{e.customBio="",y(!0),f.a.updateAccount(e).then(()=>{o(!1),y(!1),t&&t()})}},"Reset"),a.a.createElement(g.a,{className:s.a.bioEditingButton,type:g.c.SECONDARY,disabled:l,onClick:()=>{o(!1)}},"Cancel"),a.a.createElement(g.a,{className:s.a.bioEditingButton,type:g.c.PRIMARY,disabled:l,onClick:S},"Save"))))),a.a.createElement("div",{className:s.a.picColumn},a.a.createElement("div",null,a.a.createElement(v.a,{account:e,className:s.a.profilePic})),a.a.createElement(p.a,{id:"account-custom-profile-pic",title:"Select profile picture",mediaType:"image",onSelect:e=>{const t=parseInt(e.attributes.id),n=h.a.media.attachment(t).attributes.url;O(n)}},({open:e})=>a.a.createElement(g.a,{type:g.c.SECONDARY,className:s.a.setCustomPic,onClick:e},"Change profile picture")),e.customProfilePicUrl.length>0&&a.a.createElement("a",{className:s.a.resetCustomPic,onClick:()=>{O("")}},"Reset profile picture"))),E&&a.a.createElement("div",{className:s.a.personalInfoMessage},a.a.createElement(b.a,{type:b.b.INFO,showIcon:!0},"Due to restrictions set by Instagram, Spotlight cannot import the profile photo and bio"," ","text for Personal accounts."," ",a.a.createElement("a",{href:_.a.resources.customPersonalInfoUrl,target:"_blank"},"Click here to learn more"),".")),a.a.createElement(m.a,{label:"View access token",stealth:!0},a.a.createElement("div",{className:s.a.row},e.accessToken&&a.a.createElement("div",null,a.a.createElement("p",null,a.a.createElement("span",{className:s.a.label},"Expires on:"),a.a.createElement("span",null,e.accessToken.expiry?Object(u.a)(Object(d.a)(e.accessToken.expiry),"PPPP"):"Unknown")),a.a.createElement("pre",{className:s.a.accessToken},e.accessToken.code)))))}));function E({isOpen:e,onClose:t,onUpdate:n,account:o}){return a.a.createElement(i.a,{isOpen:e,title:"Account details",icon:"admin-users",onClose:t},a.a.createElement(i.a.Content,null,a.a.createElement(y,{account:o,onUpdate:n})))}},9:function(e,t,n){e.exports={root:"AccountInfo__root",container:"AccountInfo__container",column:"AccountInfo__column","info-column":"AccountInfo__info-column AccountInfo__column",infoColumn:"AccountInfo__info-column AccountInfo__column","pic-column":"AccountInfo__pic-column AccountInfo__column",picColumn:"AccountInfo__pic-column AccountInfo__column",id:"AccountInfo__id",username:"AccountInfo__username","profile-pic":"AccountInfo__profile-pic",profilePic:"AccountInfo__profile-pic",label:"AccountInfo__label",row:"AccountInfo__row",pre:"AccountInfo__pre",bio:"AccountInfo__bio AccountInfo__pre","link-button":"AccountInfo__link-button",linkButton:"AccountInfo__link-button","edit-bio-link":"AccountInfo__edit-bio-link AccountInfo__link-button",editBioLink:"AccountInfo__edit-bio-link AccountInfo__link-button","bio-editor":"AccountInfo__bio-editor",bioEditor:"AccountInfo__bio-editor","bio-footer":"AccountInfo__bio-footer",bioFooter:"AccountInfo__bio-footer","bio-editing-controls":"AccountInfo__bio-editing-controls",bioEditingControls:"AccountInfo__bio-editing-controls","access-token":"AccountInfo__access-token AccountInfo__pre",accessToken:"AccountInfo__access-token AccountInfo__pre","set-custom-pic":"AccountInfo__set-custom-pic",setCustomPic:"AccountInfo__set-custom-pic","reset-custom-pic":"AccountInfo__reset-custom-pic AccountInfo__link-button",resetCustomPic:"AccountInfo__reset-custom-pic AccountInfo__link-button",subtext:"AccountInfo__subtext","personal-info-message":"AccountInfo__personal-info-message",personalInfoMessage:"AccountInfo__personal-info-message"}},97:function(e,t,n){e.exports={root:"PopupTextField__root layout__flex-row",container:"PopupTextField__container layout__flex-row","edit-container":"PopupTextField__edit-container PopupTextField__container layout__flex-row",editContainer:"PopupTextField__edit-container PopupTextField__container layout__flex-row","static-container":"PopupTextField__static-container PopupTextField__container layout__flex-row",staticContainer:"PopupTextField__static-container PopupTextField__container layout__flex-row","edit-icon":"PopupTextField__edit-icon dashicons__dashicon-normal",editIcon:"PopupTextField__edit-icon dashicons__dashicon-normal",label:"PopupTextField__label","done-btn":"PopupTextField__done-btn",doneBtn:"PopupTextField__done-btn"}},99:function(e,t,n){"use strict";var o=n(82);t.a=new class{constructor(){this.mediaStore=o.a}}}},[[609,0,1,2,3]]])}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],t):"object"==typeof exports?exports.spotlight=t(require("React"),require("ReactDOM")):e.spotlight=t(e.React,e.ReactDOM)}(window,(function(e,t){return(window.webpackJsonpspotlight=window.webpackJsonpspotlight||[]).push([[4],{0:function(t,n){t.exports=e},10:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(0),a=n.n(o),i=n(11);const r=e=>{var{icon:t,className:n}=e,o=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]])}return n}(e,["icon","className"]);return a.a.createElement("span",Object.assign({className:Object(i.b)("dashicons","dashicons-"+t,n)},o))}},101:function(e,t,n){"use strict";var o=n(83);t.a=new class{constructor(){this.mediaStore=o.a}}},107:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"b",(function(){return u}));var o=n(0),a=n.n(o),i=n(3);const r=a.a.createContext(null),s={matched:!1};function c({value:e,children:t}){return s.matched=!1,a.a.createElement(r.Provider,{value:e},t.map((t,n)=>a.a.createElement(a.a.Fragment,{key:n},"function"==typeof t?t(e):t)))}function l({value:e,oneOf:t,children:n}){var o;const c=a.a.useContext(r);let l=!1;return void 0!==e&&(l="function"==typeof e?e(c):Object(i.c)(c,e)),void 0!==t&&(l=t.some(e=>Object(i.c)(e,c))),l?(s.matched=!0,"function"==typeof n?null!==(o=n(c))&&void 0!==o?o:null:null!=n?n:null):null}function u({children:e}){var t;if(s.matched)return null;const n=a.a.useContext(r);return"function"==typeof e?null!==(t=e(n))&&void 0!==t?t:null:null!=e?e:null}},11:function(e,t,n){"use strict";function o(...e){return e.filter(e=>!!e).join(" ")}function a(e){return o(...Object.getOwnPropertyNames(e).map(t=>e[t]?t:null))}function i(e,t={}){let n=Object.getOwnPropertyNames(t).map(n=>t[n]?e+n:null);return e+" "+n.filter(e=>!!e).join(" ")}n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return i})),n.d(t,"e",(function(){return r})),n.d(t,"d",(function(){return s}));const r={onMouseDown:e=>e.preventDefault()};function s(...e){return t=>{e.forEach(e=>e&&function(e,t){"function"==typeof e?e(t):e.current=t}(e,t))}}},112:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var o=n(0),a=n.n(o),i=n(6),r=n(27),s=n(7);const c=Object(i.b)(({feed:e})=>{const t=r.a.getById(e.options.layout),n=s.a.ComputedOptions.compute(e.options,e.mode);return a.a.createElement("div",{className:"feed"},a.a.createElement(t.component,{feed:e,options:n}))})},113:function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var o=n(0),a=n.n(o),i=n(61),r=n.n(i),s=n(18),c=n(52),l=n.n(c),u=n(38),d=n.n(u),m=n(6),p=n(3),h=n(117),f=Object(m.b)((function({field:e}){const t="settings-field-"+Object(p.u)(),n=!e.label||e.fullWidth;return a.a.createElement("div",{className:d.a.root},e.label&&a.a.createElement("div",{className:d.a.label},a.a.createElement("label",{htmlFor:t},e.label)),a.a.createElement("div",{className:d.a.container},a.a.createElement("div",{className:n?d.a.controlFullWidth:d.a.controlPartialWidth},a.a.createElement(e.component,{id:t})),e.tooltip&&a.a.createElement("div",{className:d.a.tooltip},a.a.createElement(h.a,null,e.tooltip))))}));function g({group:e}){return a.a.createElement("div",{className:l.a.root},e.title&&e.title.length>0&&a.a.createElement("h1",{className:l.a.title},e.title),e.component&&a.a.createElement("div",{className:l.a.content},a.a.createElement(e.component)),e.fields&&a.a.createElement("div",{className:l.a.fieldList},e.fields.map(e=>a.a.createElement(f,{field:e,key:e.id}))))}var b=n(20);function _({page:e}){return Object(b.d)("keydown",e=>{e.key&&"s"===e.key.toLowerCase()&&e.ctrlKey&&(s.b.save(),e.preventDefault(),e.stopPropagation())}),a.a.createElement("article",{className:r.a.root},e.component&&a.a.createElement("div",{className:r.a.content},a.a.createElement(e.component)),e.groups&&a.a.createElement("div",{className:r.a.groupList},e.groups.map(e=>a.a.createElement(g,{key:e.id,group:e}))))}},12:function(e,t,n){"use strict";var o,a=n(8);let i;t.a=i={isPro:!1,config:{restApi:SliCommonL10n.restApi,imagesUrl:SliCommonL10n.imagesUrl,autoPromotions:SliCommonL10n.autoPromotions,globalPromotions:null!==(o=SliCommonL10n.globalPromotions)&&void 0!==o?o:{}},image:e=>`${i.config.imagesUrl}/${e}`},a.a.registerType({id:"link",label:"Link",isValid:()=>!1}),a.a.registerType({id:"-more-",label:"- More promotion types -",isValid:()=>!1}),a.a.Automation.registerType({id:"hashtag",label:"Hashtag",matches:()=>!1})},13:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));const o=e=>"string"==typeof e?e:"r"in e?"rgba("+e.r+","+e.g+","+e.b+","+e.a+")":"h"in e?"hsla("+e.h+","+e.s+","+e.l+","+e.a+")":"#fff"},132:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var o=n(0),a=n.n(o),i=n(99),r=n.n(i),s=n(16);function c({url:e,children:t}){return a.a.createElement("a",{className:r.a.root,href:null!=e?e:s.a.resources.pricingUrl,target:"_blank"},null!=t?t:"Free 14-day PRO trial")}},14:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var o,a=n(3);!function(e){function t(e,t){return e.hasOwnProperty(t.toString())}function n(e,t){return e[t.toString()]}function o(e,t,n){return e[t.toString()]=n,e}e.has=t,e.get=n,e.set=o,e.ensure=function(n,a,i){return t(n,a)||o(n,a,i),e.get(n,a)},e.withEntry=function(t,n,o){return e.set(Object(a.h)(t),n,o)},e.remove=function(e,t){return delete e[t.toString()],e},e.without=function(t,n){return e.remove(Object(a.h)(t),n)},e.at=function(e,t){return n(e,Object.keys(e)[t])},e.keys=function(e){return Object.keys(e)},e.values=function(e){return Object.values(e)},e.entries=function(e){return Object.getOwnPropertyNames(e).map(t=>[t,e[t]])},e.map=function(t,n){const o={};return e.forEach(t,(e,t)=>o[e]=n(t,e)),o},e.size=function(t){return e.keys(t).length},e.isEmpty=function(t){return 0===e.size(t)},e.equals=function(e,t){return Object(a.p)(e,t)},e.forEach=function(t,n){e.keys(t).forEach(e=>n(e,t[e]))},e.fromArray=function(t){const n={};return t.forEach(([t,o])=>e.set(n,t,o)),n},e.fromMap=function(t){const n={};return t.forEach((t,o)=>e.set(n,o,t)),n}}(o||(o={}))},141:function(e,t,n){"use strict";function o(e,t){return"url"===t.linkType?t.url:t.postUrl}var a;n.d(t,"a",(function(){return a})),t.b={id:"link",label:"Link",getIcon:()=>"admin-links",getPopupLink:function(e,t){return"string"==typeof t.linkText&&t.linkText.length>0?[t.linkText,t.newTab]:[a.getDefaultLinkText(t),t.newTab]},isValid:function(e){return"string"==typeof e.linkType&&e.linkType.length>0&&("url"===e.linkType&&"string"==typeof e.url&&e.url.length>0||!!e.postId&&"string"==typeof e.postUrl&&e.postUrl.length>0)},getMediaUrl:o,onMediaClick:function(e,t){var n;const a=o(0,t),i=null===(n=t.linkDirectly)||void 0===n||n;return!(!a||!i)&&(window.open(a,t.newTab?"_blank":"_self"),!0)}},function(e){e.getDefaultLinkText=function(e){switch(e.linkType){case"product":return"Buy it now";case"post":return"Read the article";case"page":return"Learn more";default:return"Visit link"}}}(a||(a={}))},143:function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var o=n(0),a=n.n(o),i=n(206),r=n.n(i),s=n(6),c=n(165),l=n(21),u=n(16),d=n(113),m=n(42),p=n(18),h=n(50),f=n(40),g=n(155),b=n(146),_=n.n(b),v=n(166),y=n(5),E=n(119),w=n(118),S=Object(s.b)((function(){const e=l.a.get("tab");return a.a.createElement(v.a,{chevron:!0,right:O},u.a.settings.pages.map((t,n)=>a.a.createElement(E.a.Link,{key:t.id,linkTo:l.a.with({tab:t.id}),isCurrent:e===t.id||!e&&0===n},t.title)))}));const O=Object(s.b)((function({}){const e=!p.b.isDirty;return a.a.createElement("div",{className:_.a.buttons},a.a.createElement(y.a,{className:_.a.cancelBtn,type:y.c.DANGER_PILL,size:y.b.LARGE,onClick:()=>p.b.restore(),disabled:e},"Cancel"),a.a.createElement(w.a,{className:_.a.saveBtn,onClick:()=>p.b.save(),isSaving:p.b.isSaving,tooltip:"Save the settings (Ctrl+S)",disabled:e}))})),k="You have unsaved changes. If you leave now, your changes will be lost.";function C(e){return Object(h.parse)(e.search).screen===f.a.SETTINGS||k}t.b=Object(s.b)((function(){const e=l.a.get("tab"),t=e?u.a.settings.pages.find(t=>e===t.id):u.a.settings.pages[0];return Object(o.useEffect)(()=>()=>{p.b.isDirty&&l.a.get("screen")!==f.a.SETTINGS&&p.b.restore()},[]),a.a.createElement(a.a.Fragment,null,a.a.createElement(c.a,{navbar:S,className:r.a.root},t&&a.a.createElement(d.a,{page:t})),a.a.createElement(m.a,{when:p.b.isDirty,message:C}),a.a.createElement(g.a,{when:p.b.isDirty,message:k}))}))},145:function(e,t,n){e.exports={"menu-link":"PageMenuNavbar__menu-link",menuLink:"PageMenuNavbar__menu-link","menu-ref":"PageMenuNavbar__menu-ref",menuRef:"PageMenuNavbar__menu-ref","arrow-down":"PageMenuNavbar__arrow-down",arrowDown:"PageMenuNavbar__arrow-down"}},146:function(e,t,n){e.exports={buttons:"SettingsNavbar__buttons layout__flex-row","cancel-btn":"SettingsNavbar__cancel-btn",cancelBtn:"SettingsNavbar__cancel-btn"}},15:function(e,t,n){"use strict";var o;n.d(t,"a",(function(){return o})),function(e){let t,n;!function(e){e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.ALBUM="CAROUSEL_ALBUM"}(t=e.Type||(e.Type={})),function(e){let t;!function(e){e.PERSONAL_ACCOUNT="PERSONAL_ACCOUNT",e.BUSINESS_ACCOUNT="BUSINESS_ACCOUNT",e.TAGGED_ACCOUNT="TAGGED_ACCOUNT",e.RECENT_HASHTAG="RECENT_HASHTAG",e.POPULAR_HASHTAG="POPULAR_HASHTAG",e.USER_STORY="USER_STORY"}(t=e.Type||(e.Type={})),e.isOwnMedia=function(e){return e.type===t.PERSONAL_ACCOUNT||e.type===t.BUSINESS_ACCOUNT||e.type===t.USER_STORY}}(n=e.Source||(e.Source={})),e.getAsRows=(e,t)=>{e=e.slice(),t=t>0?t:1;let n=[];for(;e.length;)n.push(e.splice(0,t));if(n.length>0){const e=n.length-1;for(;n[e].length<t;)n[e].push({})}return n},e.isFromHashtag=e=>e.source.type===n.Type.POPULAR_HASHTAG||e.source.type===n.Type.RECENT_HASHTAG}(o||(o={}))},152:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(0),a=n.n(o),i=n(29);function r({breakpoints:e,children:t}){const[n,r]=a.a.useState(null),s=a.a.useCallback(()=>{const t=Object(i.b)();r(()=>e.reduce((e,n)=>t.width<=n&&n<e?n:e,1/0))},[e]);return Object(o.useEffect)(()=>(s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)),[]),null!==n&&t(n)}},153:function(e,t,n){"use strict";var o=n(0),a=n.n(o),i=n(102),r=n(19),s=n.n(r),c=n(41),l=n(4),u=n(5),d=n(10),m=n(114),p=n(26),h=n(21),f=n(30),g=n(91),b=n(60),_=n(16),v=n(67);function y({accounts:e,showDelete:t,onDeleteError:n}){const o=(e=null!=e?e:[]).filter(e=>e.type===l.a.Type.BUSINESS).length,[i,r]=a.a.useState(!1),[y,E]=a.a.useState(null),[w,S]=a.a.useState(!1),[O,k]=a.a.useState(),[C,P]=a.a.useState(!1),T=e=>()=>{E(e),r(!0)},N=e=>()=>{f.a.openAuthWindow(e.type,0,()=>{_.a.restApi.deleteAccountMedia(e.id)})},L=e=>()=>{k(e),S(!0)},A=()=>{P(!1),k(null),S(!1)},x={cols:{username:s.a.usernameCol,type:s.a.typeCol,usages:s.a.usagesCol,actions:s.a.actionsCol},cells:{username:s.a.usernameCell,type:s.a.typeCell,usages:s.a.usagesCell,actions:s.a.actionsCell}};return a.a.createElement("div",{className:"accounts-list"},a.a.createElement(m.a,{styleMap:x,rows:e,cols:[{id:"username",label:"Username",render:e=>a.a.createElement("div",null,a.a.createElement(b.a,{account:e,className:s.a.profilePic}),a.a.createElement("a",{className:s.a.username,onClick:T(e)},e.username))},{id:"type",label:"Type",render:e=>a.a.createElement("span",{className:s.a.accountType},e.type)},{id:"usages",label:"Feeds",render:e=>a.a.createElement("span",{className:s.a.usages},e.usages.map((e,t)=>!!p.a.getById(e)&&a.a.createElement(c.a,{key:t,to:h.a.at({screen:"edit",id:e.toString()})},p.a.getById(e).name)))},{id:"actions",label:"Actions",render:e=>t&&a.a.createElement("div",{className:s.a.actionsList},a.a.createElement(u.a,{className:s.a.action,type:u.c.SECONDARY,tooltip:"Account info",onClick:T(e)},a.a.createElement(d.a,{icon:"info"})),a.a.createElement(u.a,{className:s.a.action,type:u.c.SECONDARY,tooltip:"Reconnect account",onClick:N(e)},a.a.createElement(d.a,{icon:"update"})),a.a.createElement(u.a,{className:s.a.actions,type:u.c.DANGER,tooltip:"Remove account",onClick:L(e)},a.a.createElement(d.a,{icon:"trash"})))}]}),a.a.createElement(g.a,{isOpen:i,onClose:()=>r(!1),account:y}),a.a.createElement(v.a,{isOpen:w,title:"Are you sure?",buttons:[C?"Please wait ...":"Yes I'm sure","Cancel"],okDisabled:C,cancelDisabled:C,onAccept:()=>{P(!0),f.a.deleteAccount(O.id).then(()=>A()).catch(()=>{n&&n("An error occurred while trying to remove the account."),A()})},onCancel:A},a.a.createElement("p",null,"Are you sure you want to delete"," ",a.a.createElement("span",{style:{fontWeight:"bold"}},O?O.username:""),"?"," ","This will also delete all saved media associated with this account."),O&&O.type===l.a.Type.BUSINESS&&1===o&&a.a.createElement("p",null,a.a.createElement("b",null,"Note:")," ",a.a.createElement("span",null,"Because this is your only connected Business account, deleting it will"," ","also cause any feeds that show public hashtag posts to no longer work."))))}var E=n(23),w=n(6),S=n(116),O=n(78),k=n.n(O);t.a=Object(w.b)((function(){const[,e]=a.a.useState(0),[t,n]=a.a.useState(""),o=a.a.useCallback(()=>e(e=>e++),[]);return l.b.hasAccounts()?a.a.createElement("div",{className:k.a.root},t.length>0&&a.a.createElement(E.a,{type:E.b.ERROR,showIcon:!0,isDismissible:!0,onDismiss:()=>n("")},t),a.a.createElement("div",{className:k.a.connectBtn},a.a.createElement(i.a,{onConnect:o})),a.a.createElement(y,{accounts:l.b.list,showDelete:!0,onDeleteError:n})):a.a.createElement(S.a,null)}))},154:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n(0),a=n.n(o),i=n(88),r=n.n(i),s=n(66),c=n(20);function l({children:{path:e,tabs:t,right:n},current:o,onClickTab:i}){return a.a.createElement(s.b,{pathStyle:"chevron"},{path:e,right:n,left:t.map(e=>{return a.a.createElement(u,{tab:e,key:e.key,isCurrent:e.key===o,onClick:(t=e.key,()=>i&&i(t))});var t})})}function u({tab:e,isCurrent:t,onClick:n}){return a.a.createElement("a",{key:e.key,role:"button",tabIndex:0,className:e.disabled?r.a.disabled:t?r.a.current:r.a.tab,onClick:n,onKeyDown:Object(c.f)(n)},a.a.createElement("span",{className:r.a.label},e.label))}},155:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(0),a=n.n(o),i=n(42),r=n(20);function s({when:e,message:t}){return Object(r.k)(t,e),a.a.createElement(i.a,{when:e,message:t})}},165:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var o=n(0),a=n.n(o),i=n(11),r=n(30),s=n(16),c=n(1);const l=Object(c.n)({initialized:!1,list:[]}),u=({navbar:e,className:t,fillPage:n,children:c})=>{const u=a.a.useRef(null);Object(o.useEffect)(()=>{u.current&&(function(){if(!l.initialized){const e=Array.from(document.querySelectorAll(".sli-notice")),t=Array.from(document.querySelectorAll(".fs-notice.fs-slug-spotlight-social-photo-feeds"));l.list=e.concat(t),l.initialized=!0}}(),l.list.forEach(e=>{e.remove(),u.current.appendChild(e)}))},[]);const d=r.a.getExpiringTokenAccounts(),m=Object(i.a)("admin-screen",{"--fillPage":n})+(t?" "+t:"");return a.a.createElement("div",{className:m},e&&a.a.createElement("div",{className:"admin-screen__navbar"},a.a.createElement(e)),a.a.createElement("div",{className:"admin-screen__content"},a.a.createElement("div",{className:"admin-screen__notices",ref:u},d.map(e=>a.a.createElement("div",{key:e.id,className:"notice notice-warning"},a.a.createElement("p",null,"The access token for the ",a.a.createElement("b",null,"@",e.username)," account is about to expire."," ",a.a.createElement("a",{className:"admin-screen__reconnect",onClick:t=>function(e,t){r.a.openAuthWindow(t.type,0,()=>{s.a.restApi.deleteAccountMedia(t.id)}),e.preventDefault()}(t,e)},"Re-connect the account")," ","to keep using it in Spotlight.")))),c))}},166:function(e,t,n){"use strict";var o=n(0),a=n.n(o),i=n(6),r=n(119),s=n(132),c=n(40),l=n(12);t.a=Object(i.b)((function({right:e,chevron:t,children:n}){const o=a.a.createElement(r.a.Item,null,c.b.getCurrent().title);return a.a.createElement(r.a,null,a.a.createElement(a.a.Fragment,null,o,t&&a.a.createElement(r.a.Chevron,null),n),e?a.a.createElement(e):!l.a.isPro&&a.a.createElement(s.a,{url:"https://spotlightwp.com/pricing/?utm_source=sl_plugin&utm_medium=sl_plugin_upgrade&utm_campaign=sl_plugin_upgrade_list"}))}))},17:function(e,t,n){"use strict";var o=n(33),a=n.n(o),i=n(12),r=n(34);const s=i.a.config.restApi.baseUrl,c={};i.a.config.restApi.authToken&&(c["X-Sli-Auth-Token"]=i.a.config.restApi.authToken);const l=a.a.create({baseURL:s,headers:c}),u={config:Object.assign(Object.assign({},i.a.config.restApi),{forceImports:!1}),driver:l,getAccounts:()=>l.get("/accounts"),getFeeds:()=>l.get("/feeds"),getFeedMedia:(e,t=0,n=0,o)=>{const i=o?new a.a.CancelToken(o):void 0;return new Promise((o,a)=>{const r=e=>{o(e),document.dispatchEvent(new Event(u.events.onGetFeedMedia))};l.post("/media/feed",{options:e,num:n,from:t},{cancelToken:i}).then(o=>{o.data.needImport?(t>0||u.config.forceImports)&&u.importMedia(e).then(()=>{l.post("/media/feed",{options:e,num:n,from:t},{cancelToken:i}).then(r).catch(a)}).catch(a):r(o)}).catch(a)})},getMedia:(e=0,t=0)=>l.get(`/media?num=${e}&offset=${t}`),importMedia:e=>new Promise((t,n)=>{document.dispatchEvent(new Event(u.events.onImportStart));const o=e=>{document.dispatchEvent(new Event(u.events.onImportFail)),n(e)};l.post("/media/import",{options:e}).then(e=>{e.data.success?(document.dispatchEvent(new Event(u.events.onImportEnd)),t(e)):o(e)}).catch(o)}),getErrorReason:e=>{let t;return"object"==typeof e.response&&(e=e.response.data),t="string"==typeof e.message?e.message:e.toString(),Object(r.b)(t)},events:{onGetFeedMedia:"sli/api/media/feed",onImportStart:"sli/api/import/start",onImportEnd:"sli/api/import/end",onImportFail:"sli/api/import/fail"}};t.a=u},173:function(e,t,n){e.exports={"arrow-link":"WizardNavbar__arrow-link",arrowLink:"WizardNavbar__arrow-link","prev-link":"WizardNavbar__prev-link WizardNavbar__arrow-link",prevLink:"WizardNavbar__prev-link WizardNavbar__arrow-link","next-link":"WizardNavbar__next-link WizardNavbar__arrow-link",nextLink:"WizardNavbar__next-link WizardNavbar__arrow-link"}},174:function(e,t,n){e.exports={message:"FeedNamePrompt__message",input:"FeedNamePrompt__input"}},19:function(e,t,n){e.exports={"username-col":"AccountsList__username-col",usernameCol:"AccountsList__username-col","actions-col":"AccountsList__actions-col",actionsCol:"AccountsList__actions-col","username-cell":"AccountsList__username-cell",usernameCell:"AccountsList__username-cell",username:"AccountsList__username","profile-pic":"AccountsList__profile-pic",profilePic:"AccountsList__profile-pic","account-type":"AccountsList__account-type",accountType:"AccountsList__account-type",usages:"AccountsList__usages","actions-list":"AccountsList__actions-list layout__flex-row",actionsList:"AccountsList__actions-list layout__flex-row",action:"AccountsList__action","usages-cell":"AccountsList__usages-cell",usagesCell:"AccountsList__usages-cell","usages-col":"AccountsList__usages-col",usagesCol:"AccountsList__usages-col","type-cell":"AccountsList__type-cell",typeCell:"AccountsList__type-cell","type-col":"AccountsList__type-col",typeCol:"AccountsList__type-col"}},191:function(e,t,n){e.exports={beacon:"NewsBeacon__beacon",button:"NewsBeacon__button","button-animation":"NewsBeacon__button-animation",buttonAnimation:"NewsBeacon__button-animation",counter:"NewsBeacon__counter","hide-link":"NewsBeacon__hide-link",hideLink:"NewsBeacon__hide-link",menu:"NewsBeacon__menu"}},2:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var o,a=n(1),i=function(e,t,n,o){var a,i=arguments.length,r=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(r=(i<3?a(r):i>3?a(t,n,r):a(t,n))||r);return i>3&&r&&Object.defineProperty(t,n,r),r};!function(e){class t{constructor(e,t,n){this.prop=e,this.name=t,this.icon=n}}t.DESKTOP=new t("desktop","Desktop","desktop"),t.TABLET=new t("tablet","Tablet","tablet"),t.PHONE=new t("phone","Phone","smartphone"),e.Mode=t,e.MODES=[t.DESKTOP,t.TABLET,t.PHONE];class n{constructor(e,t,n){this.desktop=e,this.tablet=t,this.phone=n}get(e,t){return o(this,e,t)}set(e,t){r(this,t,e)}with(e,t){const o=s(this,t,e);return new n(o.desktop,o.tablet,o.phone)}}function o(e,t,n=!1){if(!e)return;const o=e[t.prop];return n&&null==o?e.desktop:o}function r(e,t,n){return e[n.prop]=t,e}function s(e,t,o){return r(new n(e.desktop,e.tablet,e.phone),t,o)}i([a.n],n.prototype,"desktop",void 0),i([a.n],n.prototype,"tablet",void 0),i([a.n],n.prototype,"phone",void 0),e.Value=n,e.getName=function(e){return e.name},e.getIcon=function(e){return e.icon},e.cycle=function(n){const o=e.MODES.findIndex(e=>e===n);return void 0===o?t.DESKTOP:e.MODES[(o+1)%e.MODES.length]},e.get=o,e.set=r,e.withValue=s,e.normalize=function(e,t){return null==e?t.hasOwnProperty("all")?new n(t.all,t.all,t.all):new n(t.desktop,t.tablet,t.phone):"object"==typeof e&&e.hasOwnProperty("desktop")?new n(e.desktop,e.tablet,e.phone):new n(e,e,e)},e.getModeForWindowSize=function(e){return e.width<=768?t.PHONE:e.width<=935?t.TABLET:t.DESKTOP},e.isValid=function(e){return"object"==typeof e&&e.hasOwnProperty("desktop")}}(o||(o={}))},20:function(e,t,n){"use strict";n.d(t,"i",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return d})),n.d(t,"m",(function(){return m})),n.d(t,"g",(function(){return p})),n.d(t,"k",(function(){return h})),n.d(t,"j",(function(){return f})),n.d(t,"d",(function(){return b})),n.d(t,"l",(function(){return _})),n.d(t,"f",(function(){return v})),n.d(t,"h",(function(){return y}));var o=n(0),a=n.n(o),i=n(42),r=n(29);function s(e,t){!function(e,t,n){const o=a.a.useRef(!0);e(()=>{o.current=!0;const e=t(()=>new Promise(e=>{o.current&&e()}));return()=>{o.current=!1,e&&e()}},n)}(o.useEffect,e,t)}function c(e){const[t,n]=a.a.useState(e),o=a.a.useRef(t);return[t,()=>o.current,e=>n(o.current=e)]}function l(e,t,n=[]){function a(o){!e.current||e.current.contains(o.target)||n.some(e=>e&&e.current&&e.current.contains(o.target))||t(o)}Object(o.useEffect)(()=>(document.addEventListener("mousedown",a),document.addEventListener("touchend",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchend",a)}))}function u(e,t){Object(o.useEffect)(()=>{const n=()=>{0===e.filter(e=>!e.current||document.activeElement===e.current||e.current.contains(document.activeElement)).length&&t()};return document.addEventListener("keyup",n),()=>document.removeEventListener("keyup",n)},e)}function d(e,t,n=100){const[i,r]=a.a.useState(e);return Object(o.useEffect)(()=>{let o=null;return e===t?o=setTimeout(()=>r(t),n):r(!t),()=>{null!==o&&clearTimeout(o)}},[e]),[i,r]}function m(e){const[t,n]=a.a.useState(Object(r.b)()),i=()=>{const t=Object(r.b)();n(t),e&&e(t)};return Object(o.useEffect)(()=>(i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)),[]),t}function p(){return new URLSearchParams(Object(i.e)().search)}function h(e,t){const n=n=>{if(t)return(n||window.event).returnValue=e,e};Object(o.useEffect)(()=>(window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)),[t])}function f(e,t){const n=a.a.useRef(!1);return Object(o.useEffect)(()=>{n.current&&void 0!==e.current&&(e.current.scrollIntoView(Object.assign({behavior:"smooth",block:"start"},null!=t?t:{})),n.current=!1)},[n.current]),()=>n.current=!0}function g(e,t,n,a=[],i=[]){Object(o.useEffect)(()=>(a.reduce((e,t)=>e&&t,!0)&&e.addEventListener(t,n),()=>e.removeEventListener(t,n)),i)}function b(e,t,n=[],o=[]){g(document,e,t,n,o)}function _(e,t,n=[],o=[]){g(window,e,t,n,o)}function v(e){return t=>{" "!==t.key&&"Enter"!==t.key||(e(),t.preventDefault(),t.stopPropagation())}}function y(e){const[t,n]=a.a.useState(e);return[function(e){const t=a.a.useRef(e);return t.current=e,t}(t),n]}n(34)},204:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{constructor(e=[],t=0){this.fns=e,this.delay=null!=t?t:1}add(e){this.fns.push(e)}run(){return this.numLoaded=0,this.isLoading=!0,new Promise((e,t)=>{this.fns.forEach(n=>n().then(()=>{this.numLoaded++,this.numLoaded>=this.fns.length&&setTimeout(()=>{this.isLoading=!1,e()},this.delay)}).catch(t))})}}},205:function(e,t,n){"use strict";n.d(t,"a",(function(){return S}));var o=n(0),a=n.n(o),i=n(81),r=n.n(i),s=n(6),c=n(21),l=n(154),u=n(5),d=n(66),m=n(107),p=n(245),h=n(248),f=n(18),g=n(118),b=n(143),_=n(50),v=n(40),y=n(20),E=n(42),w=n(84);const S=Object(s.b)((function({isFakePro:e}){var t;const n=null!==(t=c.a.get("tab"))&&void 0!==t?t:"automate";Object(y.k)(b.a,f.b.isDirty),Object(y.d)("keydown",e=>{"s"===e.key.toLowerCase()&&e.ctrlKey&&(f.b.isDirty&&!f.b.isSaving&&f.b.save(),e.preventDefault(),e.stopPropagation())},[],[f.b.isDirty,f.b.isSaving]);const o=e?C:f.b.values.autoPromotions,i=e?{}:f.b.values.promotions;return a.a.createElement("div",{className:r.a.screen},a.a.createElement("div",{className:r.a.navbar},a.a.createElement(O,{currTabId:n,isFakePro:e})),a.a.createElement(m.a,{value:n},a.a.createElement(m.c,{value:"automate"},a.a.createElement(p.a,{automations:o,onChange:function(t){e||f.b.update({autoPromotions:t})},isFakePro:e})),a.a.createElement(m.c,{value:"global"},a.a.createElement(h.a,{promotions:i,onChange:function(t){e||f.b.update({promotions:t})},isFakePro:e}))),a.a.createElement(E.a,{when:f.b.isDirty,message:k}))})),O=Object(s.b)((function({currTabId:e,isFakePro:t}){return a.a.createElement(a.a.Fragment,null,a.a.createElement(l.a,{current:e,onClickTab:e=>c.a.goto({tab:e},!0)},{path:[a.a.createElement(d.a,{key:"logo"}),a.a.createElement("span",{key:"screen-title"},"Promotions")],tabs:[{key:"automate",label:a.a.createElement("span",{className:t?r.a.navbarFakeProItem:r.a.navbarItem},t&&a.a.createElement(w.a,{className:r.a.navbarProPill}),a.a.createElement("span",null,"Automate"))},{key:"global",label:a.a.createElement("span",{className:t?r.a.navbarFakeProItem:r.a.navbarItem},t&&a.a.createElement(w.a,{className:r.a.navbarProPill}),a.a.createElement("span",null,"Global Promotions"))}],right:[a.a.createElement(u.a,{key:"cancel",type:u.c.SECONDARY,disabled:!f.b.isDirty,onClick:f.b.restore},"Cancel"),a.a.createElement(g.a,{key:"save",onClick:f.b.save,isSaving:f.b.isSaving,disabled:!f.b.isDirty})]}))}));function k(e){return Object(_.parse)(e.search).screen===v.a.PROMOTIONS||b.a}const C=[{type:"hashtag",config:{hashtags:["product"]},promotion:{type:"link",config:{linkType:"page",postId:1,postTitle:"Product Page",linkText:"Buy this product"}}},{type:"hashtag",config:{hashtags:["myblog"]},promotion:{type:"link",config:{linkType:"post",postId:1,postTitle:"My Latest Blog Post",linkText:""}}},{type:"hashtag",config:{hashtags:["youtube"]},promotion:{type:"link",config:{linkType:"url",url:"",linkText:""}}}]},206:function(e,t,n){},21:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var o=n(1),a=n(50),i=n(3),r=function(e,t,n,o){var a,i=arguments.length,r=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(r=(i<3?a(r):i>3?a(t,n,r):a(t,n))||r);return i>3&&r&&Object.defineProperty(t,n,r),r};class s{constructor(){const e=window.location;this._pathName=e.pathname,this._baseUrl=e.protocol+"//"+e.host,this.parsed=Object(a.parse)(e.search),this.unListen=null,this.listeners=[],Object(o.o)(()=>this._path,e=>this.path=e)}createPath(e){return this._pathName+"?"+Object(a.stringify)(e)}get _path(){return this.createPath(this.parsed)}get(e,t=!0){return Object(i.l)(this.parsed[e])}at(e){return this.createPath(Object.assign({page:this.parsed.page},this.processQuery(e)))}fullUrl(e){return this._baseUrl+this.createPath(Object.assign({page:this.parsed.page},this.processQuery(e)))}with(e){return this.createPath(Object.assign(Object.assign({},this.parsed),this.processQuery(e)))}without(e){const t=Object.assign({},this.parsed);return delete t[e],this.createPath(t)}goto(e,t=!1){this.history.push(t?this.with(e):this.at(e),{})}useHistory(e){return this.unListen&&this.unListen(),this.history=e,this.unListen=this.history.listen(e=>{this.parsed=Object(a.parse)(e.search),this.listeners.forEach(e=>e())}),this}listen(e){this.listeners.push(e)}unlisten(e){this.listeners=this.listeners.filter(t=>t===e)}processQuery(e){const t=Object.assign({},e);return Object.getOwnPropertyNames(e).forEach(n=>{e[n]&&0===e[n].length?delete t[n]:t[n]=e[n]}),t}}r([o.n],s.prototype,"path",void 0),r([o.n],s.prototype,"parsed",void 0),r([o.h],s.prototype,"_path",null);const c=new s},217:function(e,t,n){e.exports={root:"SpotlightGame__root layout__flex-column","game-text":"SpotlightGame__game-text",gameText:"SpotlightGame__game-text",score:"SpotlightGame__score SpotlightGame__game-text",message:"SpotlightGame__message SpotlightGame__game-text","message-bubble":"SpotlightGame__message-bubble",messageBubble:"SpotlightGame__message-bubble"}},218:function(e,t,n){e.exports={"field-container":"AdvancedSettings__field-container layout__flex-row",fieldContainer:"AdvancedSettings__field-container layout__flex-row","field-element":"AdvancedSettings__field-element",fieldElement:"AdvancedSettings__field-element","field-label":"AdvancedSettings__field-label AdvancedSettings__field-element",fieldLabel:"AdvancedSettings__field-label AdvancedSettings__field-element","field-control":"AdvancedSettings__field-control AdvancedSettings__field-element layout__flex-column",fieldControl:"AdvancedSettings__field-control AdvancedSettings__field-element layout__flex-column","field-centered":"AdvancedSettings__field-centered",fieldCentered:"AdvancedSettings__field-centered"}},257:function(e,t,n){e.exports={"contact-us":"FeedsOnboarding__contact-us",contactUs:"FeedsOnboarding__contact-us","call-to-action":"FeedsOnboarding__call-to-action",callToAction:"FeedsOnboarding__call-to-action"}},27:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{static getById(e){const t=o.list.find(t=>t.id===e);return!t&&o.list.length>0?o.list[0]:t}static getName(e){const t=o.getById(e);return t?t.name:"(Missing layout)"}static addLayout(e){o.list.push(e)}}o.list=[]},283:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n(98),a=n.n(o),i=n(0),r=n.n(i),s=n(5),c=n(10),l=n(68),u=n(11);function d({value:e,defaultValue:t,onDone:n}){const o=r.a.useRef(),[i,d]=r.a.useState(""),[m,p]=r.a.useState(!1),h=()=>{d(e),p(!0)},f=()=>{p(!1),n&&n(i),o.current&&o.current.focus()},g=e=>{switch(e.key){case"Enter":case" ":h()}};return r.a.createElement("div",{className:a.a.root},r.a.createElement(l.a,{isOpen:m,onBlur:()=>p(!1),placement:"bottom"},({ref:n})=>r.a.createElement("div",{ref:Object(u.d)(n,o),className:a.a.staticContainer,onClick:h,onKeyPress:g,tabIndex:0,role:"button"},r.a.createElement("span",{className:a.a.label},e||t),r.a.createElement(c.a,{icon:"edit",className:a.a.editIcon})),r.a.createElement(l.b,null,r.a.createElement(l.d,null,r.a.createElement("div",{className:a.a.editContainer},r.a.createElement("input",{type:"text",value:i,onChange:e=>{d(e.target.value)},onKeyDown:e=>{switch(e.key){case"Enter":f();break;case"Escape":p(!1);break;default:return}e.preventDefault(),e.stopPropagation()},autoFocus:!0,placeholder:"Feed name"}),r.a.createElement(s.a,{className:a.a.doneBtn,type:s.c.PRIMARY,size:s.b.NORMAL,onClick:f},r.a.createElement(c.a,{icon:"yes"})))))))}},284:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var o=n(0),a=n.n(o),i=n(173),r=n.n(i),s=n(66),c=n(5),l=n(10);function u({children:e,steps:t,current:n,onChangeStep:o,firstStep:i,lastStep:u}){var d;i=null!=i?i:[],u=null!=u?u:[];const m=null!==(d=t.findIndex(e=>e.key===n))&&void 0!==d?d:0,p=m<=0,h=m>=t.length-1,f=p?null:t[m-1],g=h?null:t[m+1],b=p?i:a.a.createElement(c.a,{type:c.c.LINK,onClick:()=>!p&&o&&o(t[m-1].key),className:r.a.prevLink,disabled:f.disabled},a.a.createElement(l.a,{icon:"arrow-left-alt2"}),a.a.createElement("span",null,f.label)),_=h?u:a.a.createElement(c.a,{type:c.c.LINK,onClick:()=>!h&&o&&o(t[m+1].key),className:r.a.nextLink,disabled:g.disabled},a.a.createElement("span",null,g.label),a.a.createElement(l.a,{icon:"arrow-right-alt2"}));return a.a.createElement(s.b,null,{path:[],left:b,right:_,center:e})}},285:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n(0),a=n.n(o),i=n(145),r=n.n(i),s=n(66),c=n(5),l=n(10),u=n(68);function d({pages:e,current:t,onChangePage:n,showNavArrows:o,hideMenuArrow:i,children:u}){var d,p;const{path:h,right:f}=u,g=null!==(d=e.findIndex(e=>e.key===t))&&void 0!==d?d:0,b=null!==(p=e[g].label)&&void 0!==p?p:"",_=g<=0,v=g>=e.length-1,y=_?null:e[g-1],E=v?null:e[g+1];let w=[];return o&&w.push(a.a.createElement(c.a,{key:"page-menu-left",type:c.c.PILL,onClick:()=>!_&&n&&n(e[g-1].key),disabled:_||y.disabled},a.a.createElement(l.a,{icon:"arrow-left-alt2"}))),w.push(a.a.createElement(m,{key:"page-menu",pages:e,current:t,onClickPage:e=>n&&n(e)},a.a.createElement("span",null,b),!i&&a.a.createElement(l.a,{icon:"arrow-down-alt2",className:r.a.arrowDown}))),o&&w.push(a.a.createElement(c.a,{key:"page-menu-left",type:c.c.PILL,onClick:()=>!v&&n&&n(e[g+1].key),disabled:v||E.disabled},a.a.createElement(l.a,{icon:"arrow-right-alt2"}))),a.a.createElement(s.b,{pathStyle:h.length>1?"line":"none"},{path:h,right:f,center:w})}function m({pages:e,current:t,onClickPage:n,children:o}){const[i,s]=a.a.useState(!1),c=()=>s(!0),l=()=>s(!1);return a.a.createElement(u.a,{isOpen:i,onBlur:l,placement:"bottom-start",refClassName:r.a.menuRef},({ref:e})=>a.a.createElement("a",{ref:e,className:r.a.menuLink,onClick:c},o),a.a.createElement(u.b,null,e.map(e=>{return a.a.createElement(u.c,{key:e.key,disabled:e.disabled,active:e.key===t,onClick:(o=e.key,()=>{n&&n(o),l()})},e.label);var o})))}},286:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var o=n(0),a=n.n(o),i=n(174),r=n.n(i),s=n(67);function c({isOpen:e,onAccept:t,onCancel:n}){const[o,i]=a.a.useState("");function c(){t&&t(o)}return a.a.createElement(s.a,{title:"Feed name",isOpen:e,onCancel:function(){n&&n()},onAccept:c,buttons:["Save","Cancel"]},a.a.createElement("p",{className:r.a.message},"Give this feed a memorable name:"),a.a.createElement("input",{type:"text",className:r.a.input,value:o,onChange:e=>{i(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(c(),e.preventDefault(),e.stopPropagation())},autoFocus:!0}))}},29:function(e,t,n){"use strict";function o(e,t,n={}){return window.open(e,t,function(e={}){return Object.getOwnPropertyNames(e).map(t=>`${t}=${e[t]}`).join(",")}(n))}function a(e,t){return{top:window.top.outerHeight/2+window.top.screenY-t/2,left:window.top.outerWidth/2+window.top.screenX-e/2,width:e,height:t}}function i(){const{innerWidth:e,innerHeight:t}=window;return{width:e,height:t}}n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i}))},3:function(e,t,n){"use strict";n.d(t,"u",(function(){return u})),n.d(t,"h",(function(){return d})),n.d(t,"b",(function(){return m})),n.d(t,"v",(function(){return p})),n.d(t,"c",(function(){return h})),n.d(t,"e",(function(){return f})),n.d(t,"p",(function(){return g})),n.d(t,"o",(function(){return b})),n.d(t,"k",(function(){return _})),n.d(t,"f",(function(){return v})),n.d(t,"n",(function(){return y})),n.d(t,"q",(function(){return E})),n.d(t,"a",(function(){return w})),n.d(t,"t",(function(){return S})),n.d(t,"s",(function(){return O})),n.d(t,"r",(function(){return k})),n.d(t,"i",(function(){return C})),n.d(t,"j",(function(){return P})),n.d(t,"m",(function(){return T})),n.d(t,"g",(function(){return N})),n.d(t,"d",(function(){return L})),n.d(t,"l",(function(){return A}));var o=n(0),a=n.n(o),i=n(140),r=n(149),s=n(15),c=n(48);let l=0;function u(){return l++}function d(e){const t={};return Object.keys(e).forEach(n=>{const o=e[n];Array.isArray(o)?t[n]=o.slice():o instanceof Map?t[n]=new Map(o.entries()):t[n]="object"==typeof o?d(o):o}),t}function m(e,t){return Object.keys(t).forEach(n=>{e[n]=t[n]}),e}function p(e,t){return m(d(e),t)}function h(e,t){return Array.isArray(e)&&Array.isArray(t)?f(e,t):e instanceof Map&&t instanceof Map?f(Array.from(e.entries()),Array.from(t.entries())):"object"==typeof e&&"object"==typeof t?g(e,t):e===t}function f(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let o=0;o<e.length;++o)if(n){if(!n(e[o],t[o]))return!1}else if(!h(e[o],t[o]))return!1;return!0}function g(e,t){if(!e||!t||"object"!=typeof e||"object"!=typeof t)return h(e,t);const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;const a=new Set(n.concat(o));for(const n of a)if(!h(e[n],t[n]))return!1;return!0}function b(e){return 0===Object.keys(null!=e?e:{}).length}function _(e,t,n){return n=null!=n?n:(e,t)=>e===t,e.filter(e=>!t.some(t=>n(e,t)))}function v(e,t,n){return n=null!=n?n:(e,t)=>e===t,e.every(e=>t.some(t=>n(e,t)))&&t.every(t=>e.some(e=>n(t,e)))}function y(e,t){return 0===e.tag.localeCompare(t.tag)&&e.sort===t.sort}function E(e,t,n=0,i=!1){let r=e.trim();i&&(r=r.replace(/((?:^[.*•]+(\r\n|\r|\n))+)/gm,"\n"));const s=r.split("\n"),c=s.map((e,n)=>{if(e=e.trim(),i&&/^[.*•]$/.test(e))return null;let r,c=[];for(;null!==(r=/#([^\s]+)/g.exec(e));){const t="https://instagram.com/explore/tags/"+r[1],n=a.a.createElement("a",{href:t,target:"_blank",key:u()},r[0]),o=e.substr(0,r.index),i=e.substr(r.index+r[0].length);c.push(o),c.push(n),e=i}return e.length&&c.push(e),t&&(c=t(c,n)),s.length>1&&c.push(a.a.createElement("br",{key:u()})),a.a.createElement(o.Fragment,{key:u()},c)});return n>0?c.slice(0,n):c}var w;function S(e,t){const n=/(\s+)/g;let o,a=0,i=0,r="";for(;null!==(o=n.exec(e))&&a<t;){const t=o.index+o[1].length;r+=e.substr(i,t-i),i=t,a++}return i<e.length&&(r+=" ..."),r}function O(e){return Object(i.a)(Object(r.a)(e),{addSuffix:!0})}function k(e,t){const n=[];return e.forEach((e,o)=>{const a=o%t;Array.isArray(n[a])?n[a].push(e):n[a]=[e]}),n}function C(e,t){return function e(t){if(t.type===s.a.Type.VIDEO){const e=document.createElement("video");return e.autoplay=!1,e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.visibility="hidden",document.body.appendChild(e),new Promise(n=>{e.src=t.url,e.addEventListener("loadeddata",()=>{n({width:e.videoWidth,height:e.videoHeight}),document.body.removeChild(e)})})}if(t.type===s.a.Type.IMAGE){const e=new Image;return e.src=t.url,new Promise(t=>{e.onload=()=>{t({width:e.naturalWidth,height:e.naturalHeight})}})}return t.type===s.a.Type.ALBUM?e(t.children[0]):Promise.reject("Unknown media type")}(e).then(e=>function(e,t){const n=e.width>e.height?t.width/e.width:t.height/e.height;return{width:e.width*n,height:e.height*n}}(e,t))}function P(e,t){const n=t.map(c.b).join("|");return new RegExp(`(?:^|\\B)#(${n})(?:\\b|\\r|$)`,"imu").test(e)}function T(e,t){for(const n of t){const t=n();if(e(t))return t}}function N(e,t){return Math.max(0,Math.min(t.length-1,e))}function L(e,t,n){const o=e.slice();return o[t]=n,o}function A(e){return Array.isArray(e)?e[0]:e}!function(e){e.SMALL="s",e.MEDIUM="m",e.LARGE="l"}(w||(w={}))},300:function(e,t,n){e.exports={"create-new-btn":"FeedsScreen__create-new-btn",createNewBtn:"FeedsScreen__create-new-btn"}},32:function(e,n){e.exports=t},34:function(e,t,n){"use strict";function o(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function a(e){const t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}))},35:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return d}));var o=n(0),a=n.n(o),i=n(32),r=n.n(i),s=n(6);class c{constructor(e=new Map,t=[]){this.factories=e,this.extensions=new Map,this.cache=new Map,t.forEach(e=>this.addModule(e))}addModule(e){e.factories&&(this.factories=new Map([...this.factories,...e.factories])),e.extensions&&e.extensions.forEach((e,t)=>{this.extensions.has(t)?this.extensions.get(t).push(e):this.extensions.set(t,[e])})}get(e){let t=this.factories.get(e);if(void 0===t)throw new Error('Service "'+e+'" does not exist');let n=this.cache.get(e);if(void 0===n){n=t(this);let o=this.extensions.get(e);o&&o.forEach(e=>n=e(this,n)),this.cache.set(e,n)}return n}has(e){return this.factories.has(e)}}class l{constructor(e,t,n){this.key=e,this.mount=t,this.modules=n,this.container=null}addModules(e){this.modules=this.modules.concat(e)}run(){if(null!==this.container)return;let e=!1;const t=()=>{e||"interactive"!==document.readyState&&"complete"!==document.readyState||(this.actualRun(),e=!0)};t(),e||document.addEventListener("readystatechange",t)}actualRun(){!function(e){const t=`app/${e.key}/run`;document.dispatchEvent(new u(t,e))}(this);const e=d({root:()=>null,"root/children":()=>[]});this.container=new c(e,this.modules);const t=this.container.get("root/children").map((e,t)=>a.a.createElement(e,{key:t})),n=a.a.createElement(s.a,{c:this.container},t);this.modules.forEach(e=>e.run&&e.run(this.container)),r.a.render(n,this.mount)}}class u extends CustomEvent{constructor(e,t){super(e,{detail:{app:t}})}}function d(e){return new Map(Object.entries(e))}},37:function(e,t,n){e.exports={root:"MediaThumbnail__root","media-background-fade-in-animation":"MediaThumbnail__media-background-fade-in-animation",mediaBackgroundFadeInAnimation:"MediaThumbnail__media-background-fade-in-animation","media-object-fade-in-animation":"MediaThumbnail__media-object-fade-in-animation",mediaObjectFadeInAnimation:"MediaThumbnail__media-object-fade-in-animation",image:"MediaThumbnail__image","not-available":"MediaThumbnail__not-available",notAvailable:"MediaThumbnail__not-available"}},38:function(e,t,n){e.exports={root:"SettingsField__root layout__flex-column",label:"SettingsField__label layout__flex-column",container:"SettingsField__container layout__flex-row",control:"SettingsField__control layout__flex-column","control-partial-width":"SettingsField__control-partial-width SettingsField__control layout__flex-column",controlPartialWidth:"SettingsField__control-partial-width SettingsField__control layout__flex-column","control-full-width":"SettingsField__control-full-width SettingsField__control layout__flex-column",controlFullWidth:"SettingsField__control-full-width SettingsField__control layout__flex-column",tooltip:"SettingsField__tooltip layout__flex-column"}},39:function(e,t,n){"use strict";function o(e){return t=>(t.stopPropagation(),e(t))}function a(e,t){let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>{n=null,e(...o)},t)}}function i(){}n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i}))},4:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var o,a=n(17),i=n(1);!function(e){let t;!function(e){e.PERSONAL="PERSONAL",e.BUSINESS="BUSINESS"}(t=e.Type||(e.Type={}))}(o||(o={}));const r=Object(i.n)([]),s="https://secure.gravatar.com/avatar/4a94d759753ade2961582f7345c1d7b2?s=64&d=mm&r=g",c=e=>r.find(t=>t.id===e),l=e=>"https://instagram.com/"+e;function u(e){return e.slice().sort((e,t)=>e.type===t.type?0:e.type===o.Type.PERSONAL?-1:1),r.splice(0,r.length),e.forEach(e=>r.push(Object(i.n)(e))),r}function d(e){if("object"==typeof e&&Array.isArray(e.data))return u(e.data);throw"Spotlight encountered a problem trying to load your accounts. Kindly contact customer support for assistance."}t.b={list:r,DEFAULT_PROFILE_PIC:s,getById:c,getByUsername:e=>r.find(t=>t.username===e),hasAccounts:()=>r.length>0,filterExisting:e=>e.filter(e=>void 0!==c(e)),idsToAccounts:e=>e.map(e=>c(e)).filter(e=>void 0!==e),getBusinessAccounts:()=>r.filter(e=>e.type===o.Type.BUSINESS),getProfilePicUrl:e=>e.customProfilePicUrl?e.customProfilePicUrl:e.profilePicUrl?e.profilePicUrl:s,getBioText:e=>e.customBio.length?e.customBio:e.bio,getProfileUrl:e=>l(e.username),getUsernameUrl:l,loadAccounts:function(){return a.a.getAccounts().then(d).catch(e=>{throw a.a.getErrorReason(e)})},loadFromResponse:d,addAccounts:u}},40:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var o,a,i=n(21),r=n(1);!function(e){e.NEW_FEED="new",e.EDIT_FEED="edit",e.FEED_LIST="feeds",e.SETTINGS="settings",e.PROMOTIONS="promotions"}(o||(o={})),function(e){const t=Object(r.n)([]);e.getList=function(){return t},e.register=function(n){return t.push(n),t.sort((e,t)=>{var n,o;const a=null!==(n=e.position)&&void 0!==n?n:0,i=null!==(o=t.position)&&void 0!==o?o:0;return Math.sign(a-i)}),e},e.getScreen=function(e){return t.find(t=>t.id===e)},e.getCurrent=function(){var e;const n=null!==(e=i.a.get("screen"))&&void 0!==e?e:"";return t.find((e,t)=>n===e.id||!n&&0===t)}}(a||(a={}))},417:function(e,t,n){},43:function(e,t,n){e.exports={root:"GenericNavbar__root",list:"GenericNavbar__list","left-list":"GenericNavbar__left-list GenericNavbar__list",leftList:"GenericNavbar__left-list GenericNavbar__list",item:"GenericNavbar__item","center-list":"GenericNavbar__center-list GenericNavbar__list",centerList:"GenericNavbar__center-list GenericNavbar__list","right-list":"GenericNavbar__right-list GenericNavbar__list",rightList:"GenericNavbar__right-list GenericNavbar__list","path-list":"GenericNavbar__path-list GenericNavbar__left-list GenericNavbar__list",pathList:"GenericNavbar__path-list GenericNavbar__left-list GenericNavbar__list","path-segment":"GenericNavbar__path-segment",pathSegment:"GenericNavbar__path-segment",separator:"GenericNavbar__separator GenericNavbar__item"}},48:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));const o=(e,t)=>e.startsWith(t)?e:t+e,a=e=>{return(t=e,"#",t.startsWith("#")?t.substr("#".length):t).split(/\s/).map((e,t)=>t>0?e[0].toUpperCase()+e.substr(1):e).join("").replace(/\W/gi,"");var t}},52:function(e,t,n){e.exports={root:"SettingsGroup__root layout__flex-column",title:"SettingsGroup__title",content:"SettingsGroup__content","field-list":"SettingsGroup__field-list layout__flex-column",fieldList:"SettingsGroup__field-list layout__flex-column"}},59:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(0),a=n.n(o),i=n(74),r=n.n(i);function s(){return a.a.createElement("div",{className:r.a.root})}},60:function(e,t,n){"use strict";var o=n(0),a=n.n(o),i=n(77),r=n.n(i),s=n(4),c=n(11),l=n(6);t.a=Object(l.b)((function(e){var{account:t,square:n,className:o}=e,i=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]])}return n}(e,["account","square","className"]);const l=s.b.getProfilePicUrl(t),u=Object(c.b)(n?r.a.square:r.a.round,o);return a.a.createElement("img",Object.assign({},i,{className:u,src:s.b.DEFAULT_PROFILE_PIC,srcSet:l+" 1x",alt:t.username+" profile picture"}))}))},61:function(e,t,n){e.exports={root:"SettingsPage__root layout__flex-column",content:"SettingsPage__content","group-list":"SettingsPage__group-list layout__flex-column",groupList:"SettingsPage__group-list layout__flex-column"}},614:function(e,t,n){"use strict";n.r(t),n(263);var o=n(35),a=(n(417),n(365)),i=n(1),r=n(76),s=n(0),c=n.n(s),l=n(42),u=n(366),d=n(21),m=n(40),p=n(6),h=n(12);function f(){const e=new Date,t=3===e.getMonth()&&1===e.getDate()?"spitloght-800w.png":"spotlight-800w.png";return c.a.createElement("div",{className:"admin-loading"},c.a.createElement("div",{className:"admin-loading__perspective"},c.a.createElement("div",{className:"admin-loading__container"},c.a.createElement("img",{src:h.a.image(t),className:"admin-loading__logo",alt:"Spotlight"}))))}var g,b,_=n(7),v=n(16),y=n(384),E=n(191),w=n.n(E),S=n(10),O=n(20),k=n(17);(b=g||(g={})).list=Object(i.n)([]),b.fetch=function(){return v.a.restApi.getNotifications().then(e=>{"object"==typeof e&&Array.isArray(e.data)&&b.list.push(...e.data)}).catch(e=>{})};var C=n(385),P=n(68);const T=Object(p.b)((function(){const[e,t]=c.a.useState(!1),[n,o]=c.a.useState(!1),a=c.a.useCallback(()=>o(!0),[]),i=c.a.useCallback(()=>o(!1),[]),r=Object(O.f)(a);return!e&&g.list.length>0&&c.a.createElement(P.a,{className:w.a.menu,isOpen:n,onBlur:i,placement:"top-end"},({ref:e})=>c.a.createElement("div",{ref:e,className:w.a.beacon},c.a.createElement("button",{className:w.a.button,onClick:a,onKeyPress:r},c.a.createElement(S.a,{icon:"megaphone"}),g.list.length>0&&c.a.createElement("div",{className:w.a.counter},g.list.length))),c.a.createElement(P.b,null,g.list.map(e=>c.a.createElement(C.a,{key:e.id,notification:e})),n&&c.a.createElement("a",{className:w.a.hideLink,onClick:()=>t(!0)},"Hide")))}));var N=n(53),L=n(304);const A=new(n(204).a)([],600);var x=n(180),I=n(386);const M=document.title.replace("Spotlight","%s ‹ Spotlight");function B(){const e=d.a.get("screen"),t=m.b.getScreen(e);t&&(document.title=M.replace("%s",t.title))}d.a.listen(B);const F=Object(p.b)((function(){const[e,t]=Object(s.useState)(!1),[n,o]=Object(s.useState)(!1);Object(s.useLayoutEffect)(()=>{e||n||A.run().then(()=>{t(!0),o(!1),g.fetch()}).catch(e=>{N.a.add("load_error",Object(r.a)(x.a,{message:e.toString()}),0)})},[n,e]);const a=e=>{var t,n;const o=null!==(n=null!==(t=e.detail.message)&&void 0!==t?t:e.detail.response.data.message)&&void 0!==n?n:null;N.a.add("feed/fetch_fail",()=>c.a.createElement("div",null,c.a.createElement("p",null,"An error occurred while retrieving the media for this feed. Details:"),o&&c.a.createElement("code",null,o),c.a.createElement("p",null,"If this error persists, kindly"," ",c.a.createElement("a",{href:v.a.resources.supportUrl,target:"_blank"},"contact customer support"),".")),0)},i=()=>{N.a.add("admin/feed/import_media",N.a.message("Retrieving posts from Instagram. This may take around 30 seconds."),0)},p=()=>{N.a.remove("admin/feed/import_media")},h=()=>{N.a.add("admin/feed/import_media/fail",N.a.message("Failed to import posts from Instagram"))};return Object(s.useEffect)(()=>(B(),document.addEventListener(_.a.Events.FETCH_FAIL,a),document.addEventListener(k.a.events.onImportStart,i),document.addEventListener(k.a.events.onImportEnd,p),document.addEventListener(k.a.events.onImportFail,h),()=>{document.removeEventListener(_.a.Events.FETCH_FAIL,a),document.removeEventListener(k.a.events.onImportStart,i),document.removeEventListener(k.a.events.onImportEnd,p),document.removeEventListener(k.a.events.onImportFail,h)}),[]),e?c.a.createElement(l.b,{history:d.a.history},m.b.getList().map((e,t)=>c.a.createElement(u.a,{key:e.id,when:"screen",is:e.id,isRoot:0===t,render:()=>c.a.createElement(e.component)})),c.a.createElement(T,null),c.a.createElement(I.a,null),c.a.createElement(y.a,null),c.a.createElement(L.a,null)):c.a.createElement(c.a.Fragment,null,c.a.createElement(f,null),c.a.createElement(L.a,null))}));var j=n(18),D=n(217),R=n.n(D),W=n(3),z=n(46),U=n(5);function G({}){const e=c.a.useRef(),t=c.a.useRef([]),[n,o]=c.a.useState(0),[a,i]=c.a.useState(!1),[,r]=c.a.useState(),l=()=>{const n=function(e){const t=.4*e.width,n=t/724,o=707*n,a=22*n,i=35*n;return{bounds:e,origin:{x:(e.width-t)/2+o-i/2,y:.5*e.height+a-i/2},scale:n,particleSize:i}}(e.current.getBoundingClientRect());t.current=t.current.map(e=>{const t=e.didSike?1:Math.max(1,1.3-1.3*Math.min(1,e.life/100));return Object.assign(Object.assign({},e),{pos:{x:e.pos.x+e.vel.x*t,y:e.pos.y+e.vel.y*t},life:e.life+1})}).filter(e=>e.life<500&&e.pos.x>=0&&e.pos.y>=0&&e.pos.x+e.size<=n.bounds.width&&e.pos.y+e.size<=n.bounds.height),t.current.length<30&&10*Math.random()>7&&t.current.push((e=>{const t=Math.max(1,4*Math.random()),n=2*Math.random()*Math.PI,o={x:Math.sin(n)*t,y:Math.cos(n)*t};return{pos:Object.assign({},e.origin),vel:o,size:e.particleSize,life:1}})(n)),r(W.u)};Object(s.useEffect)(()=>{const e=setInterval(l,25);return()=>clearInterval(e)},[]);const u=function(e){let t=null;return H.forEach(([n,o])=>{e>=n&&(t=o)}),t}(n);return c.a.createElement("div",{className:R.a.root},c.a.createElement("h1",{style:{textAlign:"center"}},"Let's play!"),c.a.createElement("p",null,"Click on as many Spotlight dots as you can. We challenge you to ",c.a.createElement("strong",null,"hit ",100),"!"),c.a.createElement("br",null),c.a.createElement("div",{ref:e,style:K.container},n>0&&c.a.createElement("div",{className:R.a.score},c.a.createElement("strong",null,"Score"),": ",c.a.createElement("span",null,n)),u&&c.a.createElement("div",{className:R.a.message},c.a.createElement("span",{className:R.a.messageBubble},u)),t.current.map((e,a)=>c.a.createElement("div",{key:a,onMouseDown:()=>(e=>{const a=t.current[e].didSike?5:1;t.current.splice(e,1),o(n+a)})(a),onMouseEnter:()=>(e=>{const n=t.current[e];if(n.didSike)return;const o=1e3*Math.random();o>100&&o<150&&(n.vel={x:5*Math.sign(-n.vel.x),y:5*Math.sign(-n.vel.y)},n.life=100,n.didSike=!0)})(a),style:Object.assign(Object.assign({},K.particle),{top:e.pos.y,left:e.pos.x,width:e.size,height:e.size,backgroundColor:e.didSike?"#ffaa00":"#"+(14492491+65536*e.life+256*e.life+e.life).toString(16)})},e.didSike&&c.a.createElement("span",{style:K.sike},"x",5)))),c.a.createElement(z.a,{title:"Get 20% off Spotlight PRO",isOpen:n>=100&&!a,onClose:()=>i(!0),allowShadeClose:!1},c.a.createElement(z.a.Content,null,c.a.createElement("div",{style:{textAlign:"center"}},c.a.createElement("p",{style:{display:"inline-block",width:"70%",marginTop:10}},c.a.createElement("strong",{style:{opacity:.7}},"You were just clicking the dot in the logo, weren't you?",c.a.createElement("br",null),"It doesn't matter. You made it a 100!")),c.a.createElement("h1",null,"Get 20% off Spotlight PRO"),c.a.createElement("p",{style:{display:"inline-block",width:"60%"}},"Open up to new opportunities with hashtag feeds, filtering options, visual moderation,"," ","tagged feeds, new layouts, promotions and much more."),c.a.createElement("div",{style:{margin:"10px 0"}},c.a.createElement("a",{href:v.a.resources.upgradeUrl,target:"_blank",style:{width:"100%"}},c.a.createElement(U.a,{type:U.c.PRIMARY,size:U.b.HERO,style:{width:"80%"}},"Get 20% off Spotlight PRO")))))))}const H=[[10,c.a.createElement("span",null,"You're getting the hang of this!")],[50,c.a.createElement("span",null,"Not bad. You're half way to a 100!")],[120,c.a.createElement("span",null,"Just post a 5-star review already. You're clearly in love with us!")],[150,c.a.createElement("span",null,"Hey, we'd be curious if there were more messages too. But sadly, this is the last one. Good-bye!")],[500,c.a.createElement("span",null,"Error: User has become obsessed with clicking games.")],[1e3,c.a.createElement("span",null,"While the term Easter egg has been used to mean a hidden object for some time, in reference to an Easter egg hunt, it has come to be more commonly used to mean a message, image, or feature hidden in a video game, film, or other, usually electronic, medium. The term used in this manner was coined around 1979 by Steve Wright, the then Director of Software Development in the Atari Consumer Division, to describe a hidden message in the Atari video game Adventure. [Wikipedia]")]],K={container:{flex:1,position:"relative",backgroundColor:"#fff",backgroundImage:`url('${h.a.image("spotlight-800w.png")}')`,backgroundPosition:"center 50%",backgroundSize:"40%",backgroundRepeat:"no-repeat",borderRadius:8,marginTop:15,userSelect:"none"},particle:{position:"absolute",backgroundColor:"#dd234b",borderRadius:999,cursor:"pointer",color:"#000",userSelect:"none"},sike:{position:"relative",left:"calc(100% + 5px)",fontSize:"16px",userSelect:"none"}};var q=n(153),Y=n(218),V=n.n(Y),$=n(11),X=Object(p.b)((function({}){return c.a.createElement("div",{className:V.a.root})}));Object(p.b)((function({className:e,label:t,children:n}){const o="settings-field-"+Object(W.u)();return c.a.createElement("div",{className:Object($.b)(V.a.fieldContainer,e)},c.a.createElement("div",{className:V.a.fieldLabel},c.a.createElement("label",{htmlFor:o},t)),c.a.createElement("div",{className:V.a.fieldControl},n(o)))}));var J=n(113),Q=n(142);const Z={factories:Object(o.b)({"admin/root/component":()=>F,"admin/settings/tabs/accounts":()=>({id:"accounts",label:"Manage Accounts",component:q.a}),"admin/settings/tabs/crons":()=>({id:"crons",label:"Crons",component:Object(r.b)(J.a,{page:()=>v.a.settings.pages.find(e=>"crons"===e.id)})}),"admin/settings/tabs/advanced":e=>({id:"advanced",label:"Advanced",component:e.get("admin/settings/show_game")?e.get("admin/settings/game/component"):e.get("admin/settings/advanced/component")}),"admin/settings/show_game":()=>!0,"admin/settings/advanced/component":()=>X,"admin/settings/game/component":()=>G}),extensions:Object(o.b)({"root/children":(e,t)=>[...t,e.get("admin/root/component")],"settings/tabs":(e,t)=>[e.get("admin/settings/tabs/accounts"),e.get("admin/settings/tabs/advanced"),...t]}),run:()=>{document.addEventListener(j.a,()=>{N.a.add("sli/settings/saved",Object(r.a)(Q.a,{message:"Settings saved."}))});{const e=document.getElementById("toplevel_page_spotlight-instagram").querySelector("ul.wp-submenu").querySelectorAll("li:not(.wp-submenu-head)"),t=Array.from(e);m.b.getList().forEach((e,n)=>{const o=0===n,a=e.state||{},r=d.a.fullUrl(Object.assign({screen:e.id},a)),s=d.a.at(Object.assign({screen:e.id},a)),c=t.find(e=>e.querySelector("a").href===r);c&&(c.addEventListener("click",e=>{d.a.history.push(s,{}),e.preventDefault(),e.stopPropagation()}),Object(i.g)(()=>{var t;const n=null!==(t=d.a.get("screen"))&&void 0!==t?t:"",a=e.id===n||!n&&o;c.classList.toggle("current",a)}))})}}};var ee=n(26),te=n(4),ne=n(300),oe=n.n(ne),ae=n(165),ie=n(41),re=n(72),se=n.n(re),ce=n(241),le=n(114),ue=n(27);const de=()=>{const e={cols:{name:se.a.nameCol,sources:se.a.sourcesCol,usages:se.a.usagesCol,actions:se.a.actionsCol},cells:{name:se.a.nameCell,sources:se.a.sourcesCell,usages:se.a.usagesCell,actions:se.a.actionsCell}};return c.a.createElement("div",{className:"feeds-list"},c.a.createElement(le.a,{styleMap:e,cols:[{id:"name",label:"Name",render:e=>{const t=d.a.at({screen:m.a.EDIT_FEED,id:e.id.toString()});return c.a.createElement("div",null,c.a.createElement(ie.a,{to:t,className:se.a.name},e.name?e.name:"(no name)"),c.a.createElement("div",{className:se.a.metaList},c.a.createElement("span",{className:se.a.id},"ID: ",e.id),c.a.createElement("span",{className:se.a.layout},ue.a.getName(e.options.layout))))}},{id:"sources",label:"Shows posts from",render:e=>c.a.createElement(me,{feed:e})},{id:"usages",label:"Instances",render:e=>c.a.createElement(pe,{feed:e})},{id:"actions",label:"Actions",render:e=>c.a.createElement("div",{className:se.a.actionsList},c.a.createElement(ce.a,{feed:e},c.a.createElement(U.a,{type:U.c.SECONDARY,tooltip:"Copy shortcode"},c.a.createElement(S.a,{icon:"editor-code"}))),c.a.createElement(U.a,{type:U.c.SECONDARY,tooltip:"Import posts",onClick:()=>(e=>{k.a.importMedia(e.options).then(()=>{N.a.add("admin/feeds/import/done",N.a.message("Finished importing posts for "+e.name))}).catch(()=>{N.a.add("admin/feeds/import/error",N.a.message("Something went wrong while importing posts for "+e.name))})})(e)},c.a.createElement(S.a,{icon:"update"})),c.a.createElement(U.a,{type:U.c.DANGER,tooltip:"Delete feed",onClick:()=>(e=>{confirm("Are you sure you want to delete this feed? This cannot be undone.")&&ee.a.deleteFeed(e)})(e)},c.a.createElement(S.a,{icon:"trash"})))}],rows:ee.a.list}))},me=({feed:e})=>{let t=[];const n=_.a.Options.getSources(e.options);return n.accounts.forEach(e=>{const n=he(e);n&&t.push(n)}),n.tagged.forEach(e=>{const n=he(e,!0);n&&t.push(n)}),n.hashtags.forEach(e=>t.push(c.a.createElement("div",null,"#",e.tag))),0===t.length&&t.push(c.a.createElement("div",{className:se.a.noSourcesMsg},c.a.createElement(S.a,{icon:"warning"}),c.a.createElement("span",null,"Feed has no sources"))),c.a.createElement("div",{className:se.a.sourcesList},t.map((e,t)=>e&&c.a.createElement(ge,{key:t},e)))},pe=({feed:e})=>c.a.createElement("div",{className:se.a.usagesList},e.usages.map((e,t)=>c.a.createElement("div",{key:t,className:se.a.usage},c.a.createElement("a",{className:se.a.usageLink,href:e.link,target:"_blank"},e.name),c.a.createElement("span",{className:se.a.usageType},"(",e.type,")"))));function he(e,t){return e?c.a.createElement(fe,{account:e,isTagged:t}):null}const fe=({account:e,isTagged:t})=>{const n=t?"tag":e.type===te.a.Type.BUSINESS?"businessman":"admin-users";return c.a.createElement("div",null,c.a.createElement(S.a,{icon:n}),e.username)},ge=({children:e})=>c.a.createElement("div",{className:se.a.source},e);var be=n(94),_e=n(257),ve=n.n(_e);const ye=d.a.at({screen:m.a.NEW_FEED}),Ee=()=>{const[e,t]=c.a.useState(!1);return c.a.createElement(be.a,{className:ve.a.root,isTransitioning:e},c.a.createElement("div",null,c.a.createElement("h1",null,"Start engaging with your audience"),c.a.createElement(be.a.Thin,null,c.a.createElement("p",null,"Connect with more people by embedding one or more Instagram feeds on this website."),c.a.createElement("p",null,"It only takes 3 steps! Let’s get going!"),c.a.createElement(be.a.StepList,null,c.a.createElement(be.a.Step,{num:1,isDone:te.b.list.length>0},c.a.createElement("span",null,"Connect your Instagram Account")),c.a.createElement(be.a.Step,{num:2},c.a.createElement("span",null,"Design your feed")),c.a.createElement(be.a.Step,{num:3},c.a.createElement("span",null,"Embed it on your site"))))),c.a.createElement("div",{className:ve.a.callToAction},c.a.createElement(be.a.HeroButton,{onClick:()=>{t(!0),setTimeout(()=>d.a.history.push(ye,{}),be.a.TRANSITION_DURATION)}},te.b.list.length>0?"Design your feed":"Connect your Instagram Account"),c.a.createElement(be.a.HelpMsg,{className:ve.a.contactUs},"If you need help at any time,"," ",c.a.createElement("a",{href:v.a.resources.supportUrl,target:"_blank",style:{whiteSpace:"nowrap"}},"contact me here"),".",c.a.createElement("br",null),"- Mark Zahra, Spotlight")))};var we=n(166),Se=Object(p.b)((function(){return c.a.createElement(ae.a,{navbar:we.a},c.a.createElement("div",{className:oe.a.root},ee.a.hasFeeds()?c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:oe.a.createNewBtn},c.a.createElement(ie.a,{to:d.a.at({screen:m.a.NEW_FEED}),className:"button button-primary button-large"},"Create a new feed")),c.a.createElement(de,null)):c.a.createElement(Ee,null)))})),Oe=n(86),ke=n(210),Ce=n(97),Pe=n(390);function Te({feed:e,onSave:t,onCancel:n}){const o=c.a.useCallback(e=>new Promise(n=>{const o=null===e.id;Oe.a.saveFeed(e).then(()=>{t&&t(e),o||n()})}),[]),a=c.a.useCallback(e=>Oe.a.editorTab=e,[]),i={tabs:Ce.a.tabs.slice(),showNameField:!0,showDoneBtn:!0,showCancelBtn:!0,doneBtnText:"Save",cancelBtnText:"Cancel"};return i.tabs.push({id:"embed",label:"Embed",sidebar:e=>c.a.createElement(Pe.a,Object.assign({},e))}),c.a.createElement(ke.a,{feed:e,firstTab:Oe.a.editorTab,requireName:!0,confirmOnCancel:!0,useCtrlS:!0,onSave:o,onCancel:n,onChangeTab:a,config:i})}var Ne=ee.a.SavedFeed,Le=n(23);const Ae=()=>c.a.createElement("div",null,c.a.createElement(Le.a,{type:Le.b.ERROR,showIcon:!0},"Feed does not exist.",c.a.createElement(ie.a,{to:d.a.with({screen:"feeds"})},"Go back")));var xe=n(205),Ie=n(143);m.b.register({id:"feeds",title:"Feeds",position:0,component:Se}),m.b.register({id:"new",title:"Add New",position:10,component:function(){return Oe.a.edit(new Ne),c.a.createElement(Te,{feed:Oe.a.feed})}}),m.b.register({id:"edit",title:"Edit",isHidden:!0,component:function(){const e=(()=>{const e=d.a.get("id");return e?parseInt(e):null})(),t=ee.a.getById(e);return e&&t?(Oe.a.feed.id!==e&&Oe.a.edit(t),Object(s.useEffect)(()=>()=>Oe.a.cancelEditor(),[]),c.a.createElement(Te,{feed:Oe.a.feed})):c.a.createElement(Ae,null)}}),m.b.register({id:"promotions",title:"Promotions",position:40,component:Object(r.a)(xe.a,{isFakePro:!0})}),m.b.register({id:"settings",title:"Settings",position:50,component:Ie.b}),A.add(()=>ee.a.loadFeeds()),A.add(()=>te.b.loadAccounts()),A.add(()=>j.b.load());const Me=document.getElementById(v.a.config.rootId);if(Me){const e=[a.a,Z].filter(e=>null!==e);Me.classList.add("wp-core-ui-override"),new o.a("admin",Me,e).run()}},66:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l}));var o=n(0),a=n.n(o),i=n(43),r=n.n(i),s=n(157);function c({children:e,pathStyle:t}){let{path:n,left:o,right:i,center:s}=e;return n=null!=n?n:[],o=null!=o?o:[],i=null!=i?i:[],s=null!=s?s:[],a.a.createElement("div",{className:r.a.root},a.a.createElement("div",{className:r.a.leftList},a.a.createElement("div",{className:r.a.pathList},n.map((e,n)=>a.a.createElement(m,{key:n,style:t},a.a.createElement("div",{className:r.a.item},e)))),a.a.createElement("div",{className:r.a.leftList},a.a.createElement(u,null,o))),a.a.createElement("div",{className:r.a.centerList},a.a.createElement(u,null,s)),a.a.createElement("div",{className:r.a.rightList},a.a.createElement(u,null,i)))}function l(){return a.a.createElement(s.a,null)}function u({children:e}){const t=Array.isArray(e)?e:[e];return a.a.createElement(a.a.Fragment,null,t.map((e,t)=>a.a.createElement(d,{key:t},e)))}function d({children:e}){return a.a.createElement("div",{className:r.a.item},e)}function m({children:e,style:t}){return a.a.createElement("div",{className:r.a.pathSegment},e,a.a.createElement(p,{style:t}))}function p({style:e}){if("none"===e)return null;const t="chevron"===e?"M0 0 L100 50 L0 100":"M50 0 L50 100";return a.a.createElement("div",{className:r.a.separator},a.a.createElement("svg",{viewBox:"0 0 100 100",width:"100%",height:"100%",preserveAspectRatio:"none"},a.a.createElement("path",{d:t,fill:"none",stroke:"currentcolor",strokeLinejoin:"bevel"})))}},7:function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var o=n(33),a=n.n(o),i=n(1),r=n(2),s=n(27),c=n(35),l=n(4),u=n(3),d=n(13),m=n(17),p=n(39),h=n(8),f=n(14),g=n(12),b=function(e,t,n,o){var a,i=arguments.length,r=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(r=(i<3?a(r):i>3?a(t,n,r):a(t,n))||r);return i>3&&r&&Object.defineProperty(t,n,r),r};class _{constructor(e=new _.Options,t=r.a.Mode.DESKTOP){this.media=[],this.canLoadMore=!1,this.stories=[],this.numLoadedMore=0,this.totalMedia=0,this.mode=r.a.Mode.DESKTOP,this.isLoaded=!1,this.isLoading=!1,this.isLoadingMore=!1,this.numMediaToShow=0,this.numMediaPerPage=0,this.cancelFetch=()=>{},this.options=new _.Options(e),this.localMedia=i.n.array([]),this.mode=t,this.mediaCounter=this._numMediaPerPage,this.reload=Object(p.a)(()=>this.load(),300),Object(i.o)(()=>this.mode,()=>{0===this.numLoadedMore&&(this.mediaCounter=this._numMediaPerPage,this.localMedia.length<this.numMediaToShow&&this.loadMedia(this.localMedia.length,this.numMediaToShow-this.localMedia.length))}),Object(i.o)(()=>this.getReloadOptions(),()=>this.reload()),Object(i.o)(()=>({num:this._numMediaPerPage,mode:this.mode}),({num:e})=>{this.localMedia.length<e&&e<=this.totalMedia?this.reload():this.mediaCounter=Math.max(1,e)}),Object(i.o)(()=>this._media,e=>this.media=e),Object(i.o)(()=>this._numMediaToShow,e=>this.numMediaToShow=e),Object(i.o)(()=>this._numMediaPerPage,e=>this.numMediaPerPage=e),Object(i.o)(()=>this._canLoadMore,e=>this.canLoadMore=e)}get _media(){return this.localMedia.slice(0,this.numMediaToShow)}get _numMediaToShow(){return Math.min(this.mediaCounter,this.totalMedia)}get _numMediaPerPage(){return Math.max(1,_.ComputedOptions.normalizeMultiInt(this.options.numPosts,this.mode,1))}get _canLoadMore(){return this.localMedia.length>this.mediaCounter||this.localMedia.length<this.totalMedia}loadMore(){const e=this.numMediaToShow+this._numMediaPerPage-this.localMedia.length;return this.isLoadingMore=!0,e>0?this.loadMedia(this.localMedia.length,this._numMediaPerPage).then(()=>{this.mediaCounter+=this._numMediaPerPage,this.numLoadedMore++,this.isLoadingMore=!1}):new Promise(e=>{this.numLoadedMore++,this.mediaCounter+=this._numMediaPerPage,this.isLoadingMore=!1,e()})}load(){return this.numLoadedMore=0,this.loadMedia(0,this._numMediaPerPage,!0).then(()=>(this.isLoaded=!0,this.mediaCounter=this._numMediaPerPage))}loadMedia(e,t,n){return this.cancelFetch(),_.Options.hasSources(this.options)?(this.isLoading=!0,new Promise((o,i)=>{m.a.getFeedMedia(this.options,e,t,e=>this.cancelFetch=e).then(e=>{var t;if("object"!=typeof e||"object"!=typeof e.data||!Array.isArray(e.data.media))throw{message:"The media response is malformed or corrupt",response:e};n&&this.localMedia.replace([]),this.addLocalMedia(e.data.media),this.stories=null!==(t=e.data.stories)&&void 0!==t?t:[],this.totalMedia=e.data.total,o&&o()}).catch(e=>{var t;if(a.a.isCancel(e))return null;const n=new _.Events.FetchFailEvent(_.Events.FETCH_FAIL,{detail:{feed:this,message:null!==(t=e.response?e.response.data.message:void 0)&&void 0!==t?t:e.message,response:e.response}});return document.dispatchEvent(n),i&&i(e),e}).finally(()=>this.isLoading=!1)})):new Promise(e=>{this.localMedia.replace([]),this.totalMedia=0,e&&e()})}addLocalMedia(e){e.forEach(e=>{this.localMedia.some(t=>t.id==e.id)||this.localMedia.push(e)})}getReloadOptions(){return JSON.stringify({accounts:this.options.accounts,hashtags:this.options.hashtags,tagged:this.options.tagged,postOrder:this.options.postOrder,mediaType:this.options.mediaType,moderation:this.options.moderation,moderationMode:this.options.moderationMode,hashtagBlacklist:this.options.hashtagBlacklist,hashtagWhitelist:this.options.hashtagWhitelist,captionBlacklist:this.options.captionBlacklist,captionWhitelist:this.options.captionWhitelist,hashtagBlacklistSettings:this.options.hashtagBlacklistSettings,hashtagWhitelistSettings:this.options.hashtagWhitelistSettings,captionBlacklistSettings:this.options.captionBlacklistSettings,captionWhitelistSettings:this.options.captionWhitelistSettings})}}b([i.n],_.prototype,"media",void 0),b([i.n],_.prototype,"canLoadMore",void 0),b([i.n],_.prototype,"stories",void 0),b([i.n],_.prototype,"numLoadedMore",void 0),b([i.n],_.prototype,"options",void 0),b([i.n],_.prototype,"totalMedia",void 0),b([i.n],_.prototype,"mode",void 0),b([i.n],_.prototype,"isLoaded",void 0),b([i.n],_.prototype,"isLoading",void 0),b([i.n],_.prototype,"isLoadingMore",void 0),b([i.f],_.prototype,"reload",void 0),b([i.n],_.prototype,"localMedia",void 0),b([i.n],_.prototype,"numMediaToShow",void 0),b([i.n],_.prototype,"numMediaPerPage",void 0),b([i.n],_.prototype,"mediaCounter",void 0),b([i.h],_.prototype,"_media",null),b([i.h],_.prototype,"_numMediaToShow",null),b([i.h],_.prototype,"_numMediaPerPage",null),b([i.h],_.prototype,"_canLoadMore",null),b([i.f],_.prototype,"loadMore",null),b([i.f],_.prototype,"load",null),b([i.f],_.prototype,"loadMedia",null),b([i.f],_.prototype,"addLocalMedia",null),function(e){let t,n,o,a,m,p,_,v,y;!function(e){e.FETCH_FAIL="sli/feed/fetch_fail";class t extends CustomEvent{constructor(e,t){super(e,t)}}e.FetchFailEvent=t}(t=e.Events||(e.Events={}));class E{constructor(e={}){E.setFromObject(this,e)}static setFromObject(t,n={}){var o,a,i,c,u,d,m,p,h,g,b,_,v,y,E;const w=n.accounts?n.accounts.slice():e.DefaultOptions.accounts;t.accounts=w.filter(e=>!!e).map(e=>parseInt(e.toString()));const S=n.tagged?n.tagged.slice():e.DefaultOptions.tagged;return t.tagged=S.filter(e=>!!e).map(e=>parseInt(e.toString())),t.hashtags=n.hashtags?n.hashtags.slice():e.DefaultOptions.hashtags,t.layout=s.a.getById(n.layout).id,t.numColumns=r.a.normalize(n.numColumns,e.DefaultOptions.numColumns),t.highlightFreq=r.a.normalize(n.highlightFreq,e.DefaultOptions.highlightFreq),t.mediaType=n.mediaType||e.DefaultOptions.mediaType,t.postOrder=n.postOrder||e.DefaultOptions.postOrder,t.numPosts=r.a.normalize(n.numPosts,e.DefaultOptions.numPosts),t.linkBehavior=r.a.normalize(n.linkBehavior,e.DefaultOptions.linkBehavior),t.feedWidth=r.a.normalize(n.feedWidth,e.DefaultOptions.feedWidth),t.feedHeight=r.a.normalize(n.feedHeight,e.DefaultOptions.feedHeight),t.feedPadding=r.a.normalize(n.feedPadding,e.DefaultOptions.feedPadding),t.imgPadding=r.a.normalize(n.imgPadding,e.DefaultOptions.imgPadding),t.textSize=r.a.normalize(n.textSize,e.DefaultOptions.textSize),t.bgColor=n.bgColor||e.DefaultOptions.bgColor,t.hoverInfo=n.hoverInfo?n.hoverInfo.slice():e.DefaultOptions.hoverInfo,t.textColorHover=n.textColorHover||e.DefaultOptions.textColorHover,t.bgColorHover=n.bgColorHover||e.DefaultOptions.bgColorHover,t.showHeader=r.a.normalize(n.showHeader,e.DefaultOptions.showHeader),t.headerInfo=r.a.normalize(n.headerInfo,e.DefaultOptions.headerInfo),t.headerAccount=null!==(o=n.headerAccount)&&void 0!==o?o:e.DefaultOptions.headerAccount,t.headerAccount=null===t.headerAccount||void 0===l.b.getById(t.headerAccount)?l.b.list.length>0?l.b.list[0].id:null:t.headerAccount,t.headerStyle=r.a.normalize(n.headerStyle,e.DefaultOptions.headerStyle),t.headerTextSize=r.a.normalize(n.headerTextSize,e.DefaultOptions.headerTextSize),t.headerPhotoSize=r.a.normalize(n.headerPhotoSize,e.DefaultOptions.headerPhotoSize),t.headerTextColor=n.headerTextColor||e.DefaultOptions.headerTextColor,t.headerBgColor=n.headerBgColor||e.DefaultOptions.bgColor,t.headerPadding=r.a.normalize(n.headerPadding,e.DefaultOptions.headerPadding),t.customProfilePic=null!==(a=n.customProfilePic)&&void 0!==a?a:e.DefaultOptions.customProfilePic,t.customBioText=n.customBioText||e.DefaultOptions.customBioText,t.includeStories=null!==(i=n.includeStories)&&void 0!==i?i:e.DefaultOptions.includeStories,t.storiesInterval=n.storiesInterval||e.DefaultOptions.storiesInterval,t.showCaptions=r.a.normalize(n.showCaptions,e.DefaultOptions.showCaptions),t.captionMaxLength=r.a.normalize(n.captionMaxLength,e.DefaultOptions.captionMaxLength),t.captionRemoveDots=null!==(c=n.captionRemoveDots)&&void 0!==c?c:e.DefaultOptions.captionRemoveDots,t.captionSize=r.a.normalize(n.captionSize,e.DefaultOptions.captionSize),t.captionColor=n.captionColor||e.DefaultOptions.captionColor,t.showLikes=r.a.normalize(n.showLikes,e.DefaultOptions.showLikes),t.showComments=r.a.normalize(n.showComments,e.DefaultOptions.showCaptions),t.lcIconSize=r.a.normalize(n.lcIconSize,e.DefaultOptions.lcIconSize),t.likesIconColor=null!==(u=n.likesIconColor)&&void 0!==u?u:e.DefaultOptions.likesIconColor,t.commentsIconColor=n.commentsIconColor||e.DefaultOptions.commentsIconColor,t.lightboxShowSidebar=null!==(d=n.lightboxShowSidebar)&&void 0!==d?d:e.DefaultOptions.lightboxShowSidebar,t.numLightboxComments=n.numLightboxComments||e.DefaultOptions.numLightboxComments,t.showLoadMoreBtn=r.a.normalize(n.showLoadMoreBtn,e.DefaultOptions.showLoadMoreBtn),t.loadMoreBtnTextColor=n.loadMoreBtnTextColor||e.DefaultOptions.loadMoreBtnTextColor,t.loadMoreBtnBgColor=n.loadMoreBtnBgColor||e.DefaultOptions.loadMoreBtnBgColor,t.loadMoreBtnText=n.loadMoreBtnText||e.DefaultOptions.loadMoreBtnText,t.autoload=null!==(m=n.autoload)&&void 0!==m?m:e.DefaultOptions.autoload,t.showFollowBtn=r.a.normalize(n.showFollowBtn,e.DefaultOptions.showFollowBtn),t.followBtnText=null!==(p=n.followBtnText)&&void 0!==p?p:e.DefaultOptions.followBtnText,t.followBtnTextColor=n.followBtnTextColor||e.DefaultOptions.followBtnTextColor,t.followBtnBgColor=n.followBtnBgColor||e.DefaultOptions.followBtnBgColor,t.followBtnLocation=r.a.normalize(n.followBtnLocation,e.DefaultOptions.followBtnLocation),t.hashtagWhitelist=n.hashtagWhitelist||e.DefaultOptions.hashtagWhitelist,t.hashtagBlacklist=n.hashtagBlacklist||e.DefaultOptions.hashtagBlacklist,t.captionWhitelist=n.captionWhitelist||e.DefaultOptions.captionWhitelist,t.captionBlacklist=n.captionBlacklist||e.DefaultOptions.captionBlacklist,t.hashtagWhitelistSettings=null!==(h=n.hashtagWhitelistSettings)&&void 0!==h?h:e.DefaultOptions.hashtagWhitelistSettings,t.hashtagBlacklistSettings=null!==(g=n.hashtagBlacklistSettings)&&void 0!==g?g:e.DefaultOptions.hashtagBlacklistSettings,t.captionWhitelistSettings=null!==(b=n.captionWhitelistSettings)&&void 0!==b?b:e.DefaultOptions.captionWhitelistSettings,t.captionBlacklistSettings=null!==(_=n.captionBlacklistSettings)&&void 0!==_?_:e.DefaultOptions.captionBlacklistSettings,t.moderation=n.moderation||e.DefaultOptions.moderation,t.moderationMode=n.moderationMode||e.DefaultOptions.moderationMode,t.promotionEnabled=null!==(v=n.promotionEnabled)&&void 0!==v?v:e.DefaultOptions.promotionEnabled,t.autoPromotionsEnabled=null!==(y=n.autoPromotionsEnabled)&&void 0!==y?y:e.DefaultOptions.autoPromotionsEnabled,t.globalPromotionsEnabled=null!==(E=n.globalPromotionsEnabled)&&void 0!==E?E:e.DefaultOptions.globalPromotionsEnabled,Array.isArray(n.promotions)?t.promotions=f.a.fromArray(n.promotions):n.promotions&&n.promotions instanceof Map?t.promotions=f.a.fromMap(n.promotions):"object"==typeof n.promotions?t.promotions=n.promotions:t.promotions=e.DefaultOptions.promotions,t}static getAllAccounts(e){const t=l.b.idsToAccounts(e.accounts),n=l.b.idsToAccounts(e.tagged);return{all:t.concat(n),accounts:t,tagged:n}}static getSources(e){return{accounts:l.b.idsToAccounts(e.accounts),tagged:l.b.idsToAccounts(e.tagged),hashtags:l.b.getBusinessAccounts().length>0?e.hashtags.filter(e=>e.tag.length>0):[]}}static hasSources(t){const n=e.Options.getSources(t),o=n.accounts.length>0||n.tagged.length>0,a=n.hashtags.length>0;return o||a}static isLimitingPosts(e){return e.moderation.length>0||e.hashtagBlacklist.length>0||e.hashtagWhitelist.length>0||e.captionBlacklist.length>0||e.captionWhitelist.length>0}}b([i.n],E.prototype,"accounts",void 0),b([i.n],E.prototype,"hashtags",void 0),b([i.n],E.prototype,"tagged",void 0),b([i.n],E.prototype,"layout",void 0),b([i.n],E.prototype,"numColumns",void 0),b([i.n],E.prototype,"highlightFreq",void 0),b([i.n],E.prototype,"mediaType",void 0),b([i.n],E.prototype,"postOrder",void 0),b([i.n],E.prototype,"numPosts",void 0),b([i.n],E.prototype,"linkBehavior",void 0),b([i.n],E.prototype,"feedWidth",void 0),b([i.n],E.prototype,"feedHeight",void 0),b([i.n],E.prototype,"feedPadding",void 0),b([i.n],E.prototype,"imgPadding",void 0),b([i.n],E.prototype,"textSize",void 0),b([i.n],E.prototype,"bgColor",void 0),b([i.n],E.prototype,"textColorHover",void 0),b([i.n],E.prototype,"bgColorHover",void 0),b([i.n],E.prototype,"hoverInfo",void 0),b([i.n],E.prototype,"showHeader",void 0),b([i.n],E.prototype,"headerInfo",void 0),b([i.n],E.prototype,"headerAccount",void 0),b([i.n],E.prototype,"headerStyle",void 0),b([i.n],E.prototype,"headerTextSize",void 0),b([i.n],E.prototype,"headerPhotoSize",void 0),b([i.n],E.prototype,"headerTextColor",void 0),b([i.n],E.prototype,"headerBgColor",void 0),b([i.n],E.prototype,"headerPadding",void 0),b([i.n],E.prototype,"customBioText",void 0),b([i.n],E.prototype,"customProfilePic",void 0),b([i.n],E.prototype,"includeStories",void 0),b([i.n],E.prototype,"storiesInterval",void 0),b([i.n],E.prototype,"showCaptions",void 0),b([i.n],E.prototype,"captionMaxLength",void 0),b([i.n],E.prototype,"captionRemoveDots",void 0),b([i.n],E.prototype,"captionSize",void 0),b([i.n],E.prototype,"captionColor",void 0),b([i.n],E.prototype,"showLikes",void 0),b([i.n],E.prototype,"showComments",void 0),b([i.n],E.prototype,"lcIconSize",void 0),b([i.n],E.prototype,"likesIconColor",void 0),b([i.n],E.prototype,"commentsIconColor",void 0),b([i.n],E.prototype,"lightboxShowSidebar",void 0),b([i.n],E.prototype,"numLightboxComments",void 0),b([i.n],E.prototype,"showLoadMoreBtn",void 0),b([i.n],E.prototype,"loadMoreBtnText",void 0),b([i.n],E.prototype,"loadMoreBtnTextColor",void 0),b([i.n],E.prototype,"loadMoreBtnBgColor",void 0),b([i.n],E.prototype,"autoload",void 0),b([i.n],E.prototype,"showFollowBtn",void 0),b([i.n],E.prototype,"followBtnText",void 0),b([i.n],E.prototype,"followBtnTextColor",void 0),b([i.n],E.prototype,"followBtnBgColor",void 0),b([i.n],E.prototype,"followBtnLocation",void 0),b([i.n],E.prototype,"hashtagWhitelist",void 0),b([i.n],E.prototype,"hashtagBlacklist",void 0),b([i.n],E.prototype,"captionWhitelist",void 0),b([i.n],E.prototype,"captionBlacklist",void 0),b([i.n],E.prototype,"hashtagWhitelistSettings",void 0),b([i.n],E.prototype,"hashtagBlacklistSettings",void 0),b([i.n],E.prototype,"captionWhitelistSettings",void 0),b([i.n],E.prototype,"captionBlacklistSettings",void 0),b([i.n],E.prototype,"moderation",void 0),b([i.n],E.prototype,"moderationMode",void 0),e.Options=E;class w{constructor(e){Object.getOwnPropertyNames(e).map(t=>{this[t]=e[t]})}getCaption(e){const t=e.caption?e.caption:"";return this.captionMaxLength&&t.length?Object(u.q)(Object(u.t)(t,this.captionMaxLength)):t}static compute(t,n=r.a.Mode.DESKTOP){const o=new w({accounts:l.b.filterExisting(t.accounts),tagged:l.b.filterExisting(t.tagged),hashtags:t.hashtags.filter(e=>e.tag.length>0),layout:s.a.getById(t.layout),highlightFreq:r.a.get(t.highlightFreq,n,!0),linkBehavior:r.a.get(t.linkBehavior,n,!0),bgColor:Object(d.a)(t.bgColor),textColorHover:Object(d.a)(t.textColorHover),bgColorHover:Object(d.a)(t.bgColorHover),hoverInfo:t.hoverInfo,showHeader:r.a.get(t.showHeader,n,!0),headerInfo:r.a.get(t.headerInfo,n,!0),headerStyle:r.a.get(t.headerStyle,n,!0),headerTextColor:Object(d.a)(t.headerTextColor),headerBgColor:Object(d.a)(t.headerBgColor),headerPadding:r.a.get(t.headerPadding,n,!0),includeStories:t.includeStories,storiesInterval:t.storiesInterval,showCaptions:r.a.get(t.showCaptions,n,!0),captionMaxLength:r.a.get(t.captionMaxLength,n,!0),captionRemoveDots:t.captionRemoveDots,captionColor:Object(d.a)(t.captionColor),showLikes:r.a.get(t.showLikes,n,!0),showComments:r.a.get(t.showComments,n,!0),likesIconColor:Object(d.a)(t.likesIconColor),commentsIconColor:Object(d.a)(t.commentsIconColor),lightboxShowSidebar:t.lightboxShowSidebar,numLightboxComments:t.numLightboxComments,showLoadMoreBtn:r.a.get(t.showLoadMoreBtn,n,!0),loadMoreBtnTextColor:Object(d.a)(t.loadMoreBtnTextColor),loadMoreBtnBgColor:Object(d.a)(t.loadMoreBtnBgColor),loadMoreBtnText:t.loadMoreBtnText,showFollowBtn:r.a.get(t.showFollowBtn,n,!0),autoload:t.autoload,followBtnLocation:r.a.get(t.followBtnLocation,n,!0),followBtnTextColor:Object(d.a)(t.followBtnTextColor),followBtnBgColor:Object(d.a)(t.followBtnBgColor),followBtnText:t.followBtnText,account:null,showBio:!1,bioText:null,profilePhotoUrl:l.b.DEFAULT_PROFILE_PIC,feedWidth:"",feedHeight:"",feedPadding:"",imgPadding:"",textSize:"",headerTextSize:"",headerPhotoSize:"",captionSize:"",lcIconSize:"",showLcIcons:!1});if(o.numColumns=this.getNumCols(t,n),o.numPosts=this.getNumPosts(t,n),o.allAccounts=o.accounts.concat(o.tagged.filter(e=>!o.accounts.includes(e))),o.allAccounts.length>0&&(o.account=t.headerAccount&&o.allAccounts.includes(t.headerAccount)?l.b.getById(t.headerAccount):l.b.getById(o.allAccounts[0])),o.showHeader=o.showHeader&&null!==o.account,o.showHeader&&(o.profilePhotoUrl=t.customProfilePic.length?t.customProfilePic:l.b.getProfilePicUrl(o.account)),o.showFollowBtn=o.showFollowBtn&&null!==o.account,o.showBio=o.headerInfo.some(t=>t===e.HeaderInfo.BIO),o.showBio){const e=t.customBioText.trim().length>0?t.customBioText:null!==o.account?l.b.getBioText(o.account):"";o.bioText=Object(u.q)(e),o.showBio=o.bioText.length>0}return o.feedWidth=this.normalizeCssSize(t.feedWidth,n,"auto"),o.feedHeight=this.normalizeCssSize(t.feedHeight,n,"auto"),o.feedPadding=this.normalizeCssSize(t.feedPadding,n,"0"),o.imgPadding=this.normalizeCssSize(t.imgPadding,n,"0"),o.textSize=this.normalizeCssSize(t.textSize,n,"inherit",!0),o.headerTextSize=this.normalizeCssSize(t.headerTextSize,n,"inherit"),o.headerPhotoSize=this.normalizeCssSize(t.headerPhotoSize,n,"50px"),o.captionSize=this.normalizeCssSize(t.captionSize,n,"inherit"),o.lcIconSize=this.normalizeCssSize(t.lcIconSize,n,"inherit"),o.buttonPadding=Math.max(10,r.a.get(t.imgPadding,n))+"px",o.showLcIcons=o.showLikes||o.showComments,o}static getNumCols(e,t){return Math.max(1,this.normalizeMultiInt(e.numColumns,t,1))}static getNumPosts(e,t){return Math.max(1,this.normalizeMultiInt(e.numPosts,t,1))}static normalizeMultiInt(e,t,n=0){const o=parseInt(r.a.get(e,t)+"");return isNaN(o)?t===r.a.Mode.DESKTOP?n:this.normalizeMultiInt(e,r.a.Mode.DESKTOP,n):o}static normalizeCssSize(e,t,n=null,o=!1){const a=r.a.get(e,t,o);return a?a+"px":n}}function S(e,t){if(g.a.isPro)return Object(u.m)(h.a.isValid,[()=>O(e,t),()=>t.globalPromotionsEnabled&&h.a.getGlobalPromo(e),()=>t.autoPromotionsEnabled&&h.a.getAutoPromo(e)])}function O(e,t){return e?h.a.getPromoFromDictionary(e,t.promotions):void 0}e.ComputedOptions=w,e.HashtagSorting=Object(c.b)({recent:"Most recent",popular:"Most popular"}),function(e){e.ALL="all",e.PHOTOS="photos",e.VIDEOS="videos"}(n=e.MediaType||(e.MediaType={})),function(e){e.NOTHING="nothing",e.SELF="self",e.NEW_TAB="new_tab",e.LIGHTBOX="lightbox"}(o=e.LinkBehavior||(e.LinkBehavior={})),function(e){e.DATE_ASC="date_asc",e.DATE_DESC="date_desc",e.POPULARITY_ASC="popularity_asc",e.POPULARITY_DESC="popularity_desc",e.RANDOM="random"}(a=e.PostOrder||(e.PostOrder={})),function(e){e.USERNAME="username",e.DATE="date",e.CAPTION="caption",e.LIKES_COMMENTS="likes_comments",e.INSTA_LINK="insta_link"}(m=e.HoverInfo||(e.HoverInfo={})),function(e){e.NORMAL="normal",e.BOXED="boxed",e.CENTERED="centered"}(p=e.HeaderStyle||(e.HeaderStyle={})),function(e){e.BIO="bio",e.PROFILE_PIC="profile_pic",e.FOLLOWERS="followers",e.MEDIA_COUNT="media_count"}(_=e.HeaderInfo||(e.HeaderInfo={})),function(e){e.HEADER="header",e.BOTTOM="bottom",e.BOTH="both"}(v=e.FollowBtnLocation||(e.FollowBtnLocation={})),function(e){e.WHITELIST="whitelist",e.BLACKLIST="blacklist"}(y=e.ModerationMode||(e.ModerationMode={})),e.DefaultOptions={accounts:[],hashtags:[],tagged:[],layout:null,numColumns:{desktop:3},highlightFreq:{desktop:7},mediaType:n.ALL,postOrder:a.DATE_DESC,numPosts:{desktop:9},linkBehavior:{desktop:o.LIGHTBOX,phone:o.NEW_TAB},feedWidth:{desktop:""},feedHeight:{desktop:""},feedPadding:{desktop:20,tablet:14,phone:10},imgPadding:{desktop:14,tablet:10,phone:6},textSize:{all:""},bgColor:{r:255,g:255,b:255,a:1},hoverInfo:[m.LIKES_COMMENTS,m.INSTA_LINK],textColorHover:{r:255,g:255,b:255,a:1},bgColorHover:{r:0,g:0,b:0,a:.5},showHeader:{desktop:!0},headerInfo:{desktop:[_.PROFILE_PIC,_.BIO]},headerAccount:null,headerStyle:{desktop:p.NORMAL,phone:p.CENTERED},headerTextSize:{desktop:""},headerPhotoSize:{desktop:50},headerTextColor:{r:0,g:0,b:0,a:1},headerBgColor:{r:255,g:255,b:255,a:1},headerPadding:{desktop:0},customProfilePic:0,customBioText:"",includeStories:!1,storiesInterval:5,showCaptions:{desktop:!1},captionMaxLength:{desktop:0},captionRemoveDots:!1,captionSize:{desktop:0},captionColor:{r:0,g:0,b:0,a:1},showLikes:{desktop:!1},showComments:{desktop:!1},lcIconSize:{desktop:14},likesIconColor:{r:0,g:0,b:0,a:1},commentsIconColor:{r:0,g:0,b:0,a:1},lightboxShowSidebar:!1,numLightboxComments:50,showLoadMoreBtn:{desktop:!0},loadMoreBtnTextColor:{r:255,g:255,b:255,a:1},loadMoreBtnBgColor:{r:0,g:149,b:246,a:1},loadMoreBtnText:"Load more",autoload:!1,showFollowBtn:{desktop:!0},followBtnText:"Follow on Instagram",followBtnTextColor:{r:255,g:255,b:255,a:1},followBtnBgColor:{r:0,g:149,b:246,a:1},followBtnLocation:{desktop:v.HEADER,phone:v.BOTTOM},hashtagWhitelist:[],hashtagBlacklist:[],captionWhitelist:[],captionBlacklist:[],hashtagWhitelistSettings:!0,hashtagBlacklistSettings:!0,captionWhitelistSettings:!0,captionBlacklistSettings:!0,moderation:[],moderationMode:y.BLACKLIST,promotionEnabled:!0,autoPromotionsEnabled:!0,globalPromotionsEnabled:!0,promotions:{}},e.getPromo=S,e.getFeedPromo=O,e.executeMediaClick=function(e,t){const n=S(e,t),o=h.a.getConfig(n),a=h.a.getType(n);return!(!a||!a.isValid(o)||"function"!=typeof a.onMediaClick)&&a.onMediaClick(e,o)},e.getLink=function(e,t){var n,o;const a=S(e,t),i=h.a.getConfig(a),r=h.a.getType(a);if(void 0===r||!r.isValid(i))return{text:null,url:null,newTab:!1};let[s,c]=r.getPopupLink?null!==(n=r.getPopupLink(e,i))&&void 0!==n?n:null:[null,!1];return{text:s,url:r.getMediaUrl&&null!==(o=r.getMediaUrl(e,i))&&void 0!==o?o:null,newTab:c}}}(_||(_={}))},72:function(e,t,n){e.exports={"name-col":"FeedsList__name-col",nameCol:"FeedsList__name-col","actions-col":"FeedsList__actions-col",actionsCol:"FeedsList__actions-col","actions-cell":"FeedsList__actions-cell",actionsCell:"FeedsList__actions-cell",name:"FeedsList__name layout__text-overflow-ellipsis","meta-list":"FeedsList__meta-list",metaList:"FeedsList__meta-list","meta-info":"FeedsList__meta-info",metaInfo:"FeedsList__meta-info",id:"FeedsList__id FeedsList__meta-info",layout:"FeedsList__layout FeedsList__meta-info","sources-list":"FeedsList__sources-list layout__flex-row",sourcesList:"FeedsList__sources-list layout__flex-row",source:"FeedsList__source layout__text-overflow-ellipsis","no-sources-msg":"FeedsList__no-sources-msg",noSourcesMsg:"FeedsList__no-sources-msg","usages-list":"FeedsList__usages-list layout__flex-column",usagesList:"FeedsList__usages-list layout__flex-column",usage:"FeedsList__usage layout__flex-row layout__text-overflow-ellipsis","usage-link":"FeedsList__usage-link layout__text-overflow-ellipsis",usageLink:"FeedsList__usage-link layout__text-overflow-ellipsis","usage-type":"FeedsList__usage-type",usageType:"FeedsList__usage-type","actions-list":"FeedsList__actions-list",actionsList:"FeedsList__actions-list","sources-cell":"FeedsList__sources-cell",sourcesCell:"FeedsList__sources-cell","sources-col":"FeedsList__sources-col",sourcesCol:"FeedsList__sources-col","usages-cell":"FeedsList__usages-cell",usagesCell:"FeedsList__usages-cell","usages-col":"FeedsList__usages-col",usagesCol:"FeedsList__usages-col"}},73:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var o=n(0),a=n.n(o),i=n(37),r=n.n(i),s=n(100),c=n(15),l=n(3),u=n(59),d=n(11),m=n(14);function p(e){var{media:t,className:n,size:i,onLoadImage:p,width:h,height:f}=e,g=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]])}return n}(e,["media","className","size","onLoadImage","width","height"]);const b=a.a.useRef(),_=a.a.useRef(),[v,y]=a.a.useState(!function(e){return!!c.a.Source.isOwnMedia(e.source)&&("string"==typeof e.thumbnail&&e.thumbnail.length>0||!m.a.isEmpty(e.thumbnails))}(t)),[E,w]=a.a.useState(!0);function S(){if(b.current){const e=null!=i?i:function(){const e=b.current.getBoundingClientRect();return e.width<=320?l.a.SMALL:(e.width,l.a.MEDIUM)}(),n="object"==typeof t.thumbnails&&m.a.has(t.thumbnails,e)?m.a.get(t.thumbnails,e):t.thumbnail;b.current.src!==n&&(b.current.src=n)}}function O(){P()}function k(){t.type===c.a.Type.VIDEO?y(!0):b.current.src!==t.thumbnail&&(b.current.src=t.thumbnail),P()}function C(){isNaN(_.current.duration)||_.current.duration===1/0?_.current.currentTime=1:_.current.currentTime=_.current.duration/2,P()}function P(){w(!1),p&&p()}return Object(o.useLayoutEffect)(()=>{let e=new s.a(S);return b.current&&(b.current.onload=O,b.current.onerror=k,S(),e.observe(b.current)),_.current&&(_.current.onloadeddata=C),()=>{b.current&&(b.current.onload=()=>null,b.current.onerror=()=>null),_.current&&(_.current.onloadeddata=()=>null),e.disconnect()}},[t,i]),t.url&&t.url.length>0?a.a.createElement("div",Object.assign({className:Object(d.b)(r.a.root,n)},g),"VIDEO"===t.type&&v?a.a.createElement("video",{ref:_,className:r.a.video,src:t.url,autoPlay:!1,controls:!1,tabIndex:0},a.a.createElement("source",{src:t.url}),"Your browser does not support videos"):a.a.createElement("img",Object.assign({ref:b,className:r.a.image,loading:"lazy",width:h,height:f},d.e)),E&&a.a.createElement(u.a,null)):a.a.createElement("div",{className:r.a.notAvailable},a.a.createElement("span",null,"Thumbnail not available"))}},74:function(e,t,n){e.exports={root:"MediaLoading__root",animation:"MediaLoading__animation"}},76:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return s}));var o=n(0),a=n.n(o),i=n(6);function r(e,t){return Object(i.b)(n=>a.a.createElement(e,Object.assign(Object.assign({},t),n)))}function s(e,t){return Object(i.b)(n=>{const o={};return Object.keys(t).forEach(e=>o[e]=t[e](n)),a.a.createElement(e,Object.assign({},o,n))})}},77:function(e,t,n){e.exports={root:"ProfilePic__root",round:"ProfilePic__round ProfilePic__root",square:"ProfilePic__square ProfilePic__root"}},78:function(e,t,n){e.exports={"connect-btn":"AccountsPage__connect-btn",connectBtn:"AccountsPage__connect-btn"}},8:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var o,a=n(12),i=n(14),r=n(3);!function(e){function t(e){return e?l(e.type):void 0}function n(e){var n;if("object"!=typeof e)return!1;const o=t(e);return void 0!==o&&o.isValid(null!==(n=e.config)&&void 0!==n?n:{})}function o(t){return t?e.getPromoFromDictionary(t,a.a.config.globalPromotions):void 0}function s(e){const t=c(e);return void 0===t?void 0:t.promotion}function c(t){if(t)for(const n of a.a.config.autoPromotions){const o=e.Automation.getType(n),a=e.Automation.getConfig(n);if(o&&o.matches(t,a))return n}}function l(t){return e.types.find(e=>e.id===t)}let u;e.getConfig=function(e){var t,n;return e&&null!==(n=null!==(t=e.config)&&void 0!==t?t:e.data)&&void 0!==n?n:{}},e.getType=t,e.isValid=n,e.getPromoFromDictionary=function(t,n){const o=i.a.get(n,t.id);if(o)return e.getType(o)?o:void 0},e.getPromo=function(e){return Object(r.m)(n,[()=>o(e),()=>s(e)])},e.getGlobalPromo=o,e.getAutoPromo=s,e.getAutomation=c,e.types=[],e.getTypes=function(){return e.types},e.registerType=function(t){e.types.push(t)},e.getTypeById=l,e.clearTypes=function(){e.types.splice(0,e.types.length)},function(e){e.getType=function(e){return e?n(e.type):void 0},e.getConfig=function(e){var t,n;return e&&null!==(n=null!==(t=e.config)&&void 0!==t?t:e.data)&&void 0!==n?n:{}},e.getPromotion=function(e){return e?e.promotion:void 0};const t=[];function n(e){return t.find(t=>t.id===e)}e.getTypes=function(){return t},e.registerType=function(e){t.push(e)},e.getTypeById=n,e.clearTypes=function(){t.splice(0,t.length)}}(u=e.Automation||(e.Automation={}))}(o||(o={}))},81:function(e,t,n){e.exports={screen:"PromotionsScreen__screen",navbar:"PromotionsScreen__navbar","navbar-item":"PromotionsScreen__navbar-item",navbarItem:"PromotionsScreen__navbar-item","navbar-fake-pro-item":"PromotionsScreen__navbar-fake-pro-item PromotionsScreen__navbar-item",navbarFakeProItem:"PromotionsScreen__navbar-fake-pro-item PromotionsScreen__navbar-item","navbar-pro-pill":"PromotionsScreen__navbar-pro-pill",navbarProPill:"PromotionsScreen__navbar-pro-pill"}},83:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return l}));var o=n(7),a=n(17),i=n(3),r=n(14);class s{constructor(e){this.incFilters=!1,this.prevOptions=null,this.media=new Array,this.config=Object(i.h)(e),void 0===this.config.watch&&(this.config.watch={all:!0})}fetchMedia(e,t){if(this.hasCache(e))return Promise.resolve(this.media);const n=Object.assign({},e.options,{moderation:this.isWatchingField("moderation")?e.options.moderation:[],moderationMode:e.options.moderationMode,hashtagBlacklist:this.isWatchingField("hashtagBlacklist")?e.options.hashtagBlacklist:[],hashtagWhitelist:this.isWatchingField("hashtagWhitelist")?e.options.hashtagWhitelist:[],captionBlacklist:this.isWatchingField("captionBlacklist")?e.options.captionBlacklist:[],captionWhitelist:this.isWatchingField("captionWhitelist")?e.options.captionWhitelist:[],hashtagBlacklistSettings:!!this.isWatchingField("hashtagBlacklistSettings")&&e.options.hashtagBlacklistSettings,hashtagWhitelistSettings:!!this.isWatchingField("hashtagWhitelistSettings")&&e.options.hashtagWhitelistSettings,captionBlacklistSettings:!!this.isWatchingField("captionBlacklistSettings")&&e.options.captionBlacklistSettings,captionWhitelistSettings:!!this.isWatchingField("captionWhitelistSettings")&&e.options.captionWhitelistSettings});return t&&t(),a.a.getFeedMedia(n).then(t=>(this.prevOptions=new o.a.Options(e.options),this.media=[],this.addMedia(t.data.media),this.media))}addMedia(e){e.forEach(e=>{this.media.some(t=>t.id==e.id)||this.media.push(e)})}hasCache(e){return null!==this.prevOptions&&!this.isCacheInvalid(e)}isWatchingField(e){var t,n,o;let a=null!==(t=this.config.watch.all)&&void 0!==t&&t;return 1===r.a.size(this.config.watch)&&void 0!==this.config.watch.all?a:(s.FILTER_FIELDS.includes(e)&&(a=null!==(n=r.a.get(this.config.watch,"filters"))&&void 0!==n?n:a),null!==(o=r.a.get(this.config.watch,e))&&void 0!==o?o:a)}isCacheInvalid(e){const t=e.options,n=this.prevOptions;if(Object(i.k)(e.media,this.media,(e,t)=>e.id===t.id).length>0)return!0;if(this.isWatchingField("accounts")&&!Object(i.f)(t.accounts,n.accounts))return!0;if(this.isWatchingField("tagged")&&!Object(i.f)(t.tagged,n.tagged))return!0;if(this.isWatchingField("hashtags")&&!Object(i.f)(t.hashtags,n.hashtags,i.n))return!0;if(this.isWatchingField("moderationMode")&&t.moderationMode!==n.moderationMode)return!0;if(this.isWatchingField("moderation")&&!Object(i.f)(t.moderation,n.moderation))return!0;if(this.isWatchingField("filters")){if(this.isWatchingField("captionWhitelistSettings")&&t.captionWhitelistSettings!==n.captionWhitelistSettings)return!0;if(this.isWatchingField("captionBlacklistSettings")&&t.captionBlacklistSettings!==n.captionBlacklistSettings)return!0;if(this.isWatchingField("hashtagWhitelistSettings")&&t.hashtagWhitelistSettings!==n.hashtagWhitelistSettings)return!0;if(this.isWatchingField("hashtagBlacklistSettings")&&t.hashtagBlacklistSettings!==n.hashtagBlacklistSettings)return!0;if(this.isWatchingField("captionWhitelist")&&!Object(i.f)(t.captionWhitelist,n.captionWhitelist))return!0;if(this.isWatchingField("captionBlacklist")&&!Object(i.f)(t.captionBlacklist,n.captionBlacklist))return!0;if(this.isWatchingField("hashtagWhitelist")&&!Object(i.f)(t.hashtagWhitelist,n.hashtagWhitelist))return!0;if(this.isWatchingField("hashtagBlacklist")&&!Object(i.f)(t.hashtagBlacklist,n.hashtagBlacklist))return!0}return!1}}!function(e){e.FILTER_FIELDS=["hashtagBlacklist","hashtagWhitelist","captionBlacklist","captionWhitelist","hashtagBlacklistSettings","hashtagWhitelistSettings","captionBlacklistSettings","captionWhitelistSettings"]}(s||(s={}));const c=new s({watch:{all:!0,filters:!1}}),l=new s({watch:{all:!0,moderation:!1}})},86:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var o=n(1),a=n(26),i=n(21),r=n(40),s=n(53),c=n(142),l=n(76),u=n(16),d=n(17),m=n(180),p=function(e,t,n,o){var a,i=arguments.length,r=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(r=(i<3?a(r):i>3?a(t,n,r):a(t,n))||r);return i>3&&r&&Object.defineProperty(t,n,r),r},h=a.a.SavedFeed;class f{constructor(){this.editorTab="connect",this.isGoingFromNewToEdit=!1,this.isPromptingFeedName=!1,this.feed=new h,this.isDoingOnboarding=u.a.config.doOnboarding}edit(e){this.isGoingFromNewToEdit||(this.editorTab="connect"),this.isGoingFromNewToEdit=!1,this.feed=null,this.feed=new h(e),this.isEditorDirty=!1}saveFeed(e){const t=null===e.id;return this.isDoingOnboarding=!1,new Promise((n,o)=>{a.a.saveFeed(e).then(e=>{s.a.add("feed/save/success",Object(l.a)(c.a,{message:"Feed saved."})),t&&(this.isGoingFromNewToEdit=!0,i.a.history.push(i.a.at({screen:r.a.EDIT_FEED,id:e.id.toString()}),{})),n(e)}).catch(e=>{const t=d.a.getErrorReason(e);s.a.add("feed/save/error",Object(l.a)(m.a,{message:"Failed to save the feed: "+t})),o(t)})})}saveEditor(e){if(!this.isEditorDirty)return;const t=null===this.feed.id;if(0!==this.feed.name.length||e)return this.isSavingFeed=!0,this.isDoingOnboarding=!1,a.a.saveFeed(this.feed).then(e=>{this.feed=new h(e),this.isSavingFeed=!1,this.isEditorDirty=!1,s.a.add("feed/saved",Object(l.a)(c.a,{message:"Feed saved."})),t&&(this.isGoingFromNewToEdit=!0,i.a.history.push(i.a.at({screen:r.a.EDIT_FEED,id:this.feed.id.toString()}),{}))});this.isPromptingFeedName=!0}cancelEditor(){this.isGoingFromNewToEdit||(this.feed=new h,this.isEditorDirty=!1,this.isGoingFromNewToEdit=!1)}closeEditor(){this.cancelEditor(),setTimeout(()=>{i.a.history.push(i.a.at({screen:r.a.FEED_LIST}),{})},10)}onEditorChange(e){e&&h.setFromObject(this.feed,e),this.isEditorDirty=!0}}p([o.n],f.prototype,"feed",void 0),p([o.n],f.prototype,"isSavingFeed",void 0),p([o.n],f.prototype,"isEditorDirty",void 0),p([o.n],f.prototype,"editorTab",void 0),p([o.n],f.prototype,"isDoingOnboarding",void 0),p([o.n],f.prototype,"isGoingFromNewToEdit",void 0),p([o.n],f.prototype,"isPromptingFeedName",void 0),p([o.f],f.prototype,"edit",null),p([o.f],f.prototype,"saveEditor",null),p([o.f],f.prototype,"cancelEditor",null),p([o.f],f.prototype,"closeEditor",null),p([o.f],f.prototype,"onEditorChange",null);const g=new f},88:function(e,t,n){e.exports={label:"TabNavbar__label",tab:"TabNavbar__tab",current:"TabNavbar__current TabNavbar__tab",disabled:"TabNavbar__disabled TabNavbar__tab"}},9:function(e,t,n){e.exports={root:"AccountInfo__root",container:"AccountInfo__container",column:"AccountInfo__column","info-column":"AccountInfo__info-column AccountInfo__column",infoColumn:"AccountInfo__info-column AccountInfo__column","pic-column":"AccountInfo__pic-column AccountInfo__column",picColumn:"AccountInfo__pic-column AccountInfo__column",id:"AccountInfo__id",username:"AccountInfo__username","profile-pic":"AccountInfo__profile-pic",profilePic:"AccountInfo__profile-pic",label:"AccountInfo__label",row:"AccountInfo__row",pre:"AccountInfo__pre",bio:"AccountInfo__bio AccountInfo__pre","link-button":"AccountInfo__link-button",linkButton:"AccountInfo__link-button","edit-bio-link":"AccountInfo__edit-bio-link AccountInfo__link-button",editBioLink:"AccountInfo__edit-bio-link AccountInfo__link-button","bio-editor":"AccountInfo__bio-editor",bioEditor:"AccountInfo__bio-editor","bio-footer":"AccountInfo__bio-footer",bioFooter:"AccountInfo__bio-footer","bio-editing-controls":"AccountInfo__bio-editing-controls",bioEditingControls:"AccountInfo__bio-editing-controls","access-token":"AccountInfo__access-token AccountInfo__pre",accessToken:"AccountInfo__access-token AccountInfo__pre","set-custom-pic":"AccountInfo__set-custom-pic",setCustomPic:"AccountInfo__set-custom-pic","reset-custom-pic":"AccountInfo__reset-custom-pic AccountInfo__link-button",resetCustomPic:"AccountInfo__reset-custom-pic AccountInfo__link-button",subtext:"AccountInfo__subtext","personal-info-message":"AccountInfo__personal-info-message",personalInfoMessage:"AccountInfo__personal-info-message"}},91:function(e,t,n){"use strict";n.d(t,"a",(function(){return E}));var o=n(0),a=n.n(o),i=n(46),r=n(9),s=n.n(r),c=n(6),l=n(4),u=n(621),d=n(394),m=n(56),p=n(115),h=n(106),f=n(30),g=n(5),b=n(23),_=n(16),v=n(60),y=Object(c.b)((function({account:e,onUpdate:t}){const[n,o]=a.a.useState(!1),[i,r]=a.a.useState(""),[c,y]=a.a.useState(!1),E=e.type===l.a.Type.PERSONAL,w=l.b.getBioText(e),S=()=>{e.customBio=i,y(!0),f.a.updateAccount(e).then(()=>{o(!1),y(!1),t&&t()})},O=n=>{e.customProfilePicUrl=n,y(!0),f.a.updateAccount(e).then(()=>{y(!1),t&&t()})};return a.a.createElement("div",{className:s.a.root},a.a.createElement("div",{className:s.a.container},a.a.createElement("div",{className:s.a.infoColumn},a.a.createElement("a",{href:l.b.getProfileUrl(e),target:"_blank",className:s.a.username},"@",e.username),a.a.createElement("div",{className:s.a.row},a.a.createElement("span",{className:s.a.label},"Spotlight ID:"),e.id),a.a.createElement("div",{className:s.a.row},a.a.createElement("span",{className:s.a.label},"User ID:"),e.userId),a.a.createElement("div",{className:s.a.row},a.a.createElement("span",{className:s.a.label},"Type:"),e.type),!n&&a.a.createElement("div",{className:s.a.row},a.a.createElement("div",null,a.a.createElement("span",{className:s.a.label},"Bio:"),a.a.createElement("a",{className:s.a.editBioLink,onClick:()=>{r(l.b.getBioText(e)),o(!0)}},"Edit bio"),a.a.createElement("pre",{className:s.a.bio},w.length>0?w:"(No bio)"))),n&&a.a.createElement("div",{className:s.a.row},a.a.createElement("textarea",{className:s.a.bioEditor,value:i,onChange:e=>{r(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&e.ctrlKey&&(S(),e.preventDefault(),e.stopPropagation())},rows:4}),a.a.createElement("div",{className:s.a.bioFooter},a.a.createElement("div",{className:s.a.bioEditingControls},c&&a.a.createElement("span",null,"Please wait ...")),a.a.createElement("div",{className:s.a.bioEditingControls},a.a.createElement(g.a,{className:s.a.bioEditingButton,type:g.c.DANGER,disabled:c,onClick:()=>{e.customBio="",y(!0),f.a.updateAccount(e).then(()=>{o(!1),y(!1),t&&t()})}},"Reset"),a.a.createElement(g.a,{className:s.a.bioEditingButton,type:g.c.SECONDARY,disabled:c,onClick:()=>{o(!1)}},"Cancel"),a.a.createElement(g.a,{className:s.a.bioEditingButton,type:g.c.PRIMARY,disabled:c,onClick:S},"Save"))))),a.a.createElement("div",{className:s.a.picColumn},a.a.createElement("div",null,a.a.createElement(v.a,{account:e,className:s.a.profilePic})),a.a.createElement(p.a,{id:"account-custom-profile-pic",title:"Select profile picture",mediaType:"image",onSelect:e=>{const t=parseInt(e.attributes.id),n=h.a.media.attachment(t).attributes.url;O(n)}},({open:e})=>a.a.createElement(g.a,{type:g.c.SECONDARY,className:s.a.setCustomPic,onClick:e},"Change profile picture")),e.customProfilePicUrl.length>0&&a.a.createElement("a",{className:s.a.resetCustomPic,onClick:()=>{O("")}},"Reset profile picture"))),E&&a.a.createElement("div",{className:s.a.personalInfoMessage},a.a.createElement(b.a,{type:b.b.INFO,showIcon:!0},"Due to restrictions set by Instagram, Spotlight cannot import the profile photo and bio"," ","text for Personal accounts."," ",a.a.createElement("a",{href:_.a.resources.customPersonalInfoUrl,target:"_blank"},"Click here to learn more"),".")),a.a.createElement(m.a,{label:"View access token",stealth:!0},a.a.createElement("div",{className:s.a.row},e.accessToken&&a.a.createElement("div",null,a.a.createElement("p",null,a.a.createElement("span",{className:s.a.label},"Expires on:"),a.a.createElement("span",null,e.accessToken.expiry?Object(u.a)(Object(d.a)(e.accessToken.expiry),"PPPP"):"Unknown")),a.a.createElement("pre",{className:s.a.accessToken},e.accessToken.code)))))}));function E({isOpen:e,onClose:t,onUpdate:n,account:o}){return a.a.createElement(i.a,{isOpen:e,title:"Account details",icon:"admin-users",onClose:t},a.a.createElement(i.a.Content,null,a.a.createElement(y,{account:o,onUpdate:n})))}},98:function(e,t,n){e.exports={root:"PopupTextField__root layout__flex-row",container:"PopupTextField__container layout__flex-row","edit-container":"PopupTextField__edit-container PopupTextField__container layout__flex-row",editContainer:"PopupTextField__edit-container PopupTextField__container layout__flex-row","static-container":"PopupTextField__static-container PopupTextField__container layout__flex-row",staticContainer:"PopupTextField__static-container PopupTextField__container layout__flex-row","edit-icon":"PopupTextField__edit-icon dashicons__dashicon-normal",editIcon:"PopupTextField__edit-icon dashicons__dashicon-normal",label:"PopupTextField__label","done-btn":"PopupTextField__done-btn",doneBtn:"PopupTextField__done-btn"}},99:function(e,t,n){e.exports={root:"ProUpgradeBtn__root"}}},[[614,0,1,2,3]]])}));
ui/dist/admin-common.js CHANGED
@@ -1 +1 @@
1
- (window.webpackJsonpspotlight=window.webpackJsonpspotlight||[]).push([[2],{100:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var a=n(0),o=n.n(a),r=n(364),i=n.n(r),l=n(5),c=n(10),s=n(246),u=n(46);function m({isOpen:e,onClose:t,onConnect:n,beforeConnect:a}){return o.a.createElement(u.a,{title:"Connect an Instagram account",isOpen:e,width:650,onClose:t},o.a.createElement(u.a.Content,null,o.a.createElement(s.a,{onConnect:n,beforeConnect:e=>{a&&a(e),t()}})))}function d({children:e,onConnect:t,beforeConnect:n}){const[a,r]=o.a.useState(!1);return o.a.createElement(o.a.Fragment,null,o.a.createElement(l.a,{className:i.a.root,size:l.b.HERO,type:l.c.SECONDARY,onClick:()=>r(!0)},o.a.createElement(c.a,{icon:"instagram"}),null!=e?e:o.a.createElement("span",null,"Connect more Instagram accounts")),o.a.createElement(m,{isOpen:a,onClose:()=>{r(!1)},onConnect:t,beforeConnect:n}))}},105:function(e,t,n){"use strict";t.a=wp},113:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(0),o=n.n(a),r=n(11),i=n(132),l=n.n(i);function c({cols:e,rows:t,footerCols:n,styleMap:a}){return a=null!=a?a:{cols:{},cells:{}},o.a.createElement("table",{className:l.a.table},o.a.createElement("thead",{className:l.a.header},o.a.createElement(u,{cols:e,styleMap:a})),o.a.createElement("tbody",null,t.map((t,n)=>o.a.createElement(s,{key:n,idx:n,row:t,cols:e,styleMap:a}))),n&&o.a.createElement("tfoot",{className:l.a.footer},o.a.createElement(u,{cols:e,styleMap:a})))}function s({idx:e,row:t,cols:n,styleMap:a}){return o.a.createElement("tr",{className:l.a.row},n.map(n=>o.a.createElement("td",{key:n.id,className:Object(r.b)(l.a.cell,m(n),a.cells[n.id])},n.render(t,e))))}function u({cols:e,styleMap:t}){return o.a.createElement("tr",null,e.map(e=>{const n=Object(r.b)(l.a.colHeading,m(e),t.cols[e.id]);return o.a.createElement("th",{key:e.id,className:n},e.label)}))}function m(e){return"center"===e.align?l.a.alignCenter:"right"===e.align?l.a.alignRight:l.a.alignLeft}},114:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n(0),o=n.n(a),r=n(105),i=n(3);const l=({id:e,value:t,title:n,button:a,mediaType:l,multiple:c,children:s,onOpen:u,onClose:m,onSelect:d})=>{e=null!=e?e:"wp-media-"+Object(i.u)(),l=null!=l?l:"image",a=null!=a?a:"Select";const p=o.a.useRef();p.current||(p.current=r.a.media({id:e,title:n,library:{type:l},button:{text:a},multiple:c}));const b=()=>{const e=p.current.state().get("selection").first();d&&d(e)};return m&&p.current.on("close",m),p.current.on("open",()=>{if(t){const e="object"==typeof t?t:r.a.media.attachment(t);e.fetch(),p.current.state().get("selection").add(e?[e]:[])}u&&u()}),p.current.on("insert",b),p.current.on("select",b),s({open:()=>p.current.open()})}},116:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),o=n.n(a),r=n(209),i=n.n(r),l=n(10),c=n(226);function s({maxWidth:e,children:t}){e=null!=e?e:300;const[n,a]=o.a.useState(!1),r=()=>a(!0),s=()=>a(!1),u={content:i.a.tooltipContent,container:i.a.tooltipContainer};return o.a.createElement("div",{className:i.a.root},o.a.createElement(c.a,{visible:n,theme:u},({ref:e})=>o.a.createElement("span",{ref:e,className:i.a.icon,style:{opacity:n?1:.7},onMouseEnter:r,onMouseLeave:s},o.a.createElement(l.a,{icon:"info"})),o.a.createElement("div",{style:{maxWidth:e+"px"}},t)))}},117:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(291),o=n.n(a),r=n(0),i=n.n(r),l=n(5),c=n(11);function s({className:e,content:t,tooltip:n,onClick:a,disabled:r,isSaving:s}){return t=null!=t?t:e=>e?"Saving ...":"Save",n=null!=n?n:"Save",i.a.createElement(l.a,{className:Object(c.b)(o.a.root,e),type:l.c.PRIMARY,size:l.b.LARGE,tooltip:n,onClick:()=>a&&a(),disabled:r},s&&i.a.createElement("div",{className:o.a.savingOverlay}),t(s))}},118:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var a=n(0),o=n.n(a),r=n(134),i=n.n(r),l=n(41),c=n(11),s=n(83),u=n(153);function m({children:e}){return o.a.createElement("div",{className:i.a.root},o.a.createElement(m.Item,null,o.a.createElement(u.a,null)),o.a.createElement(m.Chevron,null),o.a.createElement("div",{className:i.a.leftContainer},e[0]),e[1]&&o.a.createElement("div",{className:i.a.rightContainer},e[1]))}!function(e){e.Item=({children:e})=>o.a.createElement("div",{className:i.a.item},e),e.Link=({linkTo:t,onClick:n,isCurrent:a,isDisabled:r,children:s})=>{const u=Object(c.c)({[i.a.link]:!0,[i.a.current]:a,[i.a.disabled]:r}),m=e=>{"Enter"!==e.key&&" "!==e.key||e.currentTarget.click()},d=r?-1:0;return o.a.createElement(e.Item,null,t?o.a.createElement(l.a,{to:t,className:u,role:"button",onKeyPress:m,tabIndex:d},s):o.a.createElement("div",{className:u,role:"button",onClick:()=>!r&&n&&n(),onKeyPress:m,tabIndex:d},s))},e.ProPill=()=>o.a.createElement("div",{className:i.a.proPill},o.a.createElement(s.a,null)),e.Chevron=()=>o.a.createElement("div",{className:i.a.chevron},o.a.createElement("svg",{viewBox:"0 0 100 100",width:"100%",height:"100%",preserveAspectRatio:"none"},o.a.createElement("path",{d:"M0 0 L100 50 L0 100",fill:"none",stroke:"currentcolor",strokeLinejoin:"bevel"})))}(m||(m={}))},119:function(e,t,n){e.exports={root:"ConnectAccount__root","prompt-msg":"ConnectAccount__prompt-msg",promptMsg:"ConnectAccount__prompt-msg",types:"ConnectAccount__types",type:"ConnectAccount__type","types-rows":"ConnectAccount__types-rows ConnectAccount__types",typesRows:"ConnectAccount__types-rows ConnectAccount__types","types-columns":"ConnectAccount__types-columns ConnectAccount__types",typesColumns:"ConnectAccount__types-columns ConnectAccount__types",capabilities:"ConnectAccount__capabilities",capability:"ConnectAccount__capability","business-learn-more":"ConnectAccount__business-learn-more",businessLearnMore:"ConnectAccount__business-learn-more","connect-access-token":"ConnectAccount__connect-access-token",connectAccessToken:"ConnectAccount__connect-access-token"}},120:function(e,t,n){e.exports={root:"ConnectAccessToken__root",row:"ConnectAccessToken__row ConnectAccessToken__root",content:"ConnectAccessToken__content",label:"ConnectAccessToken__label",bottom:"ConnectAccessToken__bottom","button-container":"ConnectAccessToken__button-container",buttonContainer:"ConnectAccessToken__button-container",button:"ConnectAccessToken__button","help-message":"ConnectAccessToken__help-message",helpMessage:"ConnectAccessToken__help-message",column:"ConnectAccessToken__column ConnectAccessToken__root"}},121:function(e,t,n){e.exports={content:"GlobalPromotionsTab__content","mobile-instructions":"GlobalPromotionsTab__mobile-instructions",mobileInstructions:"GlobalPromotionsTab__mobile-instructions",tutorial:"GlobalPromotionsTab__tutorial","tutorial-box":"GlobalPromotionsTab__tutorial-box",tutorialBox:"GlobalPromotionsTab__tutorial-box","tutorial-text":"GlobalPromotionsTab__tutorial-text",tutorialText:"GlobalPromotionsTab__tutorial-text","account-list":"GlobalPromotionsTab__account-list",accountList:"GlobalPromotionsTab__account-list","account-scroller":"GlobalPromotionsTab__account-scroller",accountScroller:"GlobalPromotionsTab__account-scroller","account-button":"GlobalPromotionsTab__account-button",accountButton:"GlobalPromotionsTab__account-button","account-selected":"GlobalPromotionsTab__account-selected GlobalPromotionsTab__account-button",accountSelected:"GlobalPromotionsTab__account-selected GlobalPromotionsTab__account-button","profile-pic":"GlobalPromotionsTab__profile-pic",profilePic:"GlobalPromotionsTab__profile-pic",username:"GlobalPromotionsTab__username","fake-pro":"GlobalPromotionsTab__fake-pro",fakePro:"GlobalPromotionsTab__fake-pro"}},125:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n(0),o=n.n(a),r=n(126),i=n(48);const l=e=>{var t;const n="string"==typeof e.value?[e.value]:null!==(t=e.value)&&void 0!==t?t:[],a=Object.assign(Object.assign({},e),{value:n.map(e=>Object(i.a)(e,"#")),sanitize:i.b});return o.a.createElement(r.a,Object.assign({},a))}},126:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var a=n(0),o=n.n(a),r=n(227),i=n(23),l=n(56);const c={DropdownIndicator:null},s=e=>({label:e,value:e}),u=({id:e,value:t,onChange:n,sanitize:u,autoFocus:m,message:d})=>{const[p,b]=o.a.useState(""),[_,g]=o.a.useState(-1),[f,h]=o.a.useState();Object(a.useEffect)(()=>{h(d)},[d]);const v=(t=Array.isArray(t)?t:[]).map(e=>s(e)),E=()=>{p.length&&(b(""),y([...v,s(p)]))},y=e=>{if(!n)return;let t=-1;e=e?e.map(e=>e&&u?u(e.value):e.value).filter((e,n,a)=>{const o=a.indexOf(e);return o!==n?(t=o,!1):!!e}):[],g(t),-1===t&&n(e)},C=Object(l.b)();return o.a.createElement(o.a.Fragment,null,o.a.createElement(r.a,{inputId:e,className:"react-select",classNamePrefix:"react-select",components:c,inputValue:p,isClearable:!1,isMulti:!0,menuIsOpen:!1,onChange:y,onInputChange:e=>{b(e)},onKeyDown:e=>{if(p)switch(e.key){case",":case"Enter":case"Tab":E(),e.preventDefault()}},onBlur:E,placeholder:"Type something and press enter...",value:v,autoFocus:m,styles:C}),_<0||0===v.length?null:o.a.createElement(i.a,{type:i.b.WARNING,shake:!0,showIcon:!0,isDismissible:!0},o.a.createElement("code",null,v[_].label)," is already in the list"),f?o.a.createElement(i.a,{type:i.b.WARNING,shake:!0,showIcon:!0,isDismissible:!0},f):null)};var m=n(6);const d=Object(m.b)(e=>{const[t,n]=o.a.useState("");e.exclude&&0===e.exclude.length&&t.length>0&&n("");let a=void 0;if(t.length>0){const n="%s",r=e.excludeMsg.indexOf("%s"),i=e.excludeMsg.substring(0,r),l=e.excludeMsg.substring(r+n.length);a=o.a.createElement(o.a.Fragment,null,i,o.a.createElement("code",null,t),l)}const r=Object.assign(Object.assign({},e),{message:a,onChange:t=>{const a=e.exclude?t.findIndex(t=>e.exclude.includes(t)):-1;a>-1?n(t[a]):e.onChange(t)}});return o.a.createElement(u,Object.assign({},r))})},132:function(e,t,n){e.exports={table:"Table__table theme__subtle-drop-shadow theme__slightly-rounded",header:"Table__header",footer:"Table__footer",cell:"Table__cell","col-heading":"Table__col-heading Table__cell",colHeading:"Table__col-heading Table__cell",row:"Table__row","align-left":"Table__align-left",alignLeft:"Table__align-left","align-right":"Table__align-right",alignRight:"Table__align-right","align-center":"Table__align-center",alignCenter:"Table__align-center"}},134:function(e,t,n){e.exports={root:"Navbar__root layout__flex-row",container:"Navbar__container layout__flex-row","left-container":"Navbar__left-container Navbar__container layout__flex-row",leftContainer:"Navbar__left-container Navbar__container layout__flex-row","right-container":"Navbar__right-container Navbar__container layout__flex-row",rightContainer:"Navbar__right-container Navbar__container layout__flex-row",child:"Navbar__child",item:"Navbar__item Navbar__child",disabled:"Navbar__disabled",chevron:"Navbar__chevron Navbar__child",link:"Navbar__link","pro-pill":"Navbar__pro-pill",proPill:"Navbar__pro-pill",current:"Navbar__current","button-container":"Navbar__button-container layout__flex-row",buttonContainer:"Navbar__button-container layout__flex-row"}},14:function(e,t,n){"use strict";n(415);var a=n(19),o=n(0),r=n.n(o),i=n(16),l=n(149),c=n(6),s=n(56),u=n(144),m=n.n(u),d=n(66),p=n(10);function b(e){var{type:t,unit:n,units:a,value:o,onChange:i}=e,l=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}(e,["type","unit","units","value","onChange"]);const[c,s]=r.a.useState(!1),u=Array.isArray(a)&&a.length,b=()=>s(e=>!e),_=e=>{switch(e.key){case" ":case"Enter":b();break;default:return}e.preventDefault(),e.stopPropagation()};return(null==o||isNaN(o))&&(o=""),r.a.createElement("div",{className:m.a.root},r.a.createElement("input",Object.assign({},l,{className:m.a.input,type:null!=t?t:"text",value:o,onChange:e=>i&&i(e.currentTarget.value,n)})),r.a.createElement("div",{className:m.a.unitContainer},u&&r.a.createElement(d.a,{isOpen:c,onBlur:()=>s(!1)},({ref:e})=>r.a.createElement("div",{ref:e,className:m.a.unitSelector,role:"button",onClick:b,onKeyDown:_,tabIndex:0},r.a.createElement("span",{className:m.a.currentUnit},n),r.a.createElement(p.a,{icon:"arrow-down-alt2",className:c?m.a.menuChevronOpen:m.a.menuChevron})),a.map(e=>r.a.createElement(d.c,{key:e,onClick:()=>(i&&i(o,e),void s(!1))},e))),!u&&r.a.createElement("div",{className:m.a.unitStatic},r.a.createElement("span",null,n))))}var _=n(55),g=n(287),f=n.n(g),h=n(5),v=[{id:"accounts",title:"Accounts",component:l.a},{id:"config",title:"Configuration",groups:[{id:"importing",title:"Import options",fields:[{id:"importerInterval",label:"Check for new posts",component:Object(c.b)(({id:e})=>r.a.createElement(s.a,{id:e,width:250,value:i.b.values.importerInterval,options:y.config.cronScheduleOptions,onChange:e=>i.b.values.importerInterval=e.value}))}]},{id:"cleaner",title:"Optimization",component:()=>r.a.createElement("div",null,r.a.createElement(_.a,{label:"What is this?",stealth:!0},r.a.createElement("div",null,r.a.createElement("p",null,"Spotlight imports all Instagram posts that can be displayed in your feed, even "," ",'those hidden behind a "Load more" button. The posts furthest down the list may'," ","therefore rarely be seen."),r.a.createElement("p",null,"To improve your site’s performance, you can choose to delete these unseen posts"," ","after a set period of time. Once a site visitor requests those posts, they will"," ","be re-imported.")))),fields:[{id:"cleanerAgeLimit",label:"Delete unseen posts after",component:Object(c.b)(({id:e})=>{const t=i.b.values.cleanerAgeLimit.split(" "),n=parseInt(t[0]),a=t[1];return r.a.createElement(b,{id:e,units:["days","hours","minutes"],value:n,unit:a,type:"number",onChange:(e,t)=>i.b.values.cleanerAgeLimit=e+" "+t})})},{id:"cleanerInterval",label:"Run optimization",component:Object(c.b)(({id:e})=>r.a.createElement(s.a,{id:e,width:250,value:i.b.values.cleanerInterval,options:y.config.cronScheduleOptions,onChange:e=>i.b.values.cleanerInterval=e.value}))}]}]},{id:"tools",title:"Tools",groups:[{id:"cache",title:"Cache",fields:[{id:"clearCache",label:"If you are experiencing issues, clearing the plugin's cache may help.",component:function({}){const[e,t]=r.a.useState(!1),[n,a]=r.a.useState(!1);return r.a.createElement("div",{className:f.a.root},r.a.createElement(h.a,{disabled:e,onClick:()=>{t(!0),y.restApi.clearCache().finally(()=>{a(!0),setTimeout(()=>{a(!1),t(!1)},3e3)})}},n?"Done!":e?"Please wait ...":"Clear the cache"),r.a.createElement("a",{href:y.resources.cacheDocsUrl,target:"_blank",className:f.a.docLink},"What's this?"))}}]}]}],E=n(96);a.a.driver.interceptors.request.use(e=>(e.headers["X-WP-Nonce"]=SliAdminCommonL10n.restApi.wpNonce,e),e=>Promise.reject(e));var y=t.a={config:{rootId:"spotlight-instagram-admin",adminUrl:SliAdminCommonL10n.adminUrl,restApi:SliAdminCommonL10n.restApi,doOnboarding:"1"==SliAdminCommonL10n.doOnboarding,cronSchedules:SliAdminCommonL10n.cronSchedules,cronScheduleOptions:SliAdminCommonL10n.cronSchedules.map(e=>({value:e.key,label:e.display})),postTypes:SliAdminCommonL10n.postTypes,hasElementor:SliAdminCommonL10n.hasElementor},resources:{upgradeUrl:"https://spotlightwp.com/pricing/",upgradeLocalUrl:SliAdminCommonL10n.adminUrl+"admin.php?page=spotlight-instagram-pricing",trialUrl:"https://spotlightwp.com/pricing/",trialLocalUrl:SliAdminCommonL10n.adminUrl+"admin.php?page=spotlight-instagram-pricing&billing_cycle=annual&trial=true",proComingSoonUrl:"https://spotlightwp.com/pro-coming-soon/",supportUrl:"https://spotlightwp.com/support/",customPersonalInfoUrl:"https://docs.spotlightwp.com/article/624-custom-profile-photo-and-bio-text",businessAccounts:"https://docs.spotlightwp.com/article/555-how-to-switch-to-a-business-account",cacheDocsUrl:"https://docs.spotlightwp.com/article/639-cache",promoTypesSurvey:"https://spotlightwp.com/survey-promote/",accessTokenDocUrl:""},editor:{config:Object.assign({},E.a)},restApi:{config:SliAdminCommonL10n.restApi,saveFeed:e=>a.a.driver.post("/feeds"+(e.id?"/"+e.id:""),{feed:e}),deleteFeed:e=>a.a.driver.delete("/feeds/"+e),connectPersonal:e=>a.a.driver.post("/connect",{accessToken:e}),connectBusiness:(e,t)=>a.a.driver.post("/connect",{accessToken:e,userId:t}),updateAccount:e=>a.a.driver.post("/accounts",e),deleteAccount:e=>a.a.driver.delete("/accounts/"+e),deleteAccountMedia:e=>a.a.driver.delete("/account_media/"+e),searchPosts:(e,t)=>a.a.driver.get(`/search_posts?search=${e}&type=${t}`),getSettings:()=>a.a.driver.get("/settings"),saveSettings:e=>a.a.driver.patch("/settings",{settings:e}),getNotifications:()=>a.a.driver.get("/notifications"),clearCache:()=>a.a.driver.post("/clear_cache")},settings:{pages:v,showGame:!0}}},144:function(e,t,n){e.exports={root:"UnitField__root layout__flex-row",input:"UnitField__input","unit-container":"UnitField__unit-container layout__flex-column",unitContainer:"UnitField__unit-container layout__flex-column","unit-bubble":"UnitField__unit-bubble",unitBubble:"UnitField__unit-bubble","unit-static":"UnitField__unit-static UnitField__unit-bubble layout__flex-column",unitStatic:"UnitField__unit-static UnitField__unit-bubble layout__flex-column","unit-selector":"UnitField__unit-selector UnitField__unit-bubble layout__flex-row",unitSelector:"UnitField__unit-selector UnitField__unit-bubble layout__flex-row","current-unit":"UnitField__current-unit",currentUnit:"UnitField__current-unit","menu-chevron":"UnitField__menu-chevron",menuChevron:"UnitField__menu-chevron","menu-chevron-open":"UnitField__menu-chevron-open UnitField__menu-chevron",menuChevronOpen:"UnitField__menu-chevron-open UnitField__menu-chevron","unit-list":"UnitField__unit-list layout__flex-column layout__z-highest",unitList:"UnitField__unit-list layout__flex-column layout__z-highest","unit-option":"UnitField__unit-option",unitOption:"UnitField__unit-option","unit-selected":"UnitField__unit-selected UnitField__unit-option",unitSelected:"UnitField__unit-selected UnitField__unit-option"}},153:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),o=n.n(a),r=n(298),i=n.n(r),l=n(12),c=n(11);function s(){return o.a.createElement("div",{className:i.a.logo},o.a.createElement("img",Object.assign({className:i.a.logoImage,src:l.a.image("spotlight-favicon.png"),alt:"Spotlight"},c.e)))}},155:function(e,t,n){e.exports={layout:"SidebarLayout__layout","layout-primary-content":"SidebarLayout__layout-primary-content SidebarLayout__layout",layoutPrimaryContent:"SidebarLayout__layout-primary-content SidebarLayout__layout","layout-primary-sidebar":"SidebarLayout__layout-primary-sidebar SidebarLayout__layout",layoutPrimarySidebar:"SidebarLayout__layout-primary-sidebar SidebarLayout__layout",container:"SidebarLayout__container",content:"SidebarLayout__content SidebarLayout__container",sidebar:"SidebarLayout__sidebar SidebarLayout__container",navigation:"SidebarLayout__navigation","navigation-left":"SidebarLayout__navigation-left SidebarLayout__navigation",navigationLeft:"SidebarLayout__navigation-left SidebarLayout__navigation","navigation-right":"SidebarLayout__navigation-right SidebarLayout__navigation",navigationRight:"SidebarLayout__navigation-right SidebarLayout__navigation","nav-link":"SidebarLayout__nav-link",navLink:"SidebarLayout__nav-link"}},16:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(1),o=n(14),r=n(3),i=n(19),l=n(12);let c;t.b=c=Object(a.n)({values:{},original:{},isDirty:!1,isSaving:!1,update(e){Object(r.b)(c.values,e)},save(){if(!c.isDirty)return;c.isSaving=!0;const e={importerInterval:c.values.importerInterval,cleanerAgeLimit:c.values.cleanerAgeLimit,cleanerInterval:c.values.cleanerInterval,hashtagWhitelist:c.values.hashtagWhitelist,hashtagBlacklist:c.values.hashtagBlacklist,captionWhitelist:c.values.captionWhitelist,captionBlacklist:c.values.captionBlacklist,autoPromotions:c.values.autoPromotions,promotions:c.values.promotions};return o.a.restApi.saveSettings(e).then(e=>{c.fromResponse(e),document.dispatchEvent(new u(s))}).finally(()=>c.isSaving=!1)},load:()=>o.a.restApi.getSettings().then(e=>c.fromResponse(e)).catch(e=>{throw i.a.getErrorReason(e)}),restore(){c.values=Object(r.h)(c.original),c.isDirty=!1},fromResponse(e){var t,n,a,o,r,i,l,s,u;if("object"!=typeof e||void 0===e.data)throw"Spotlight encountered a problem while trying to load your settings. Kindly contact customer support for assistance.";c.original={importerInterval:null!==(t=e.data.importerInterval)&&void 0!==t?t:"",cleanerAgeLimit:null!==(n=e.data.cleanerAgeLimit)&&void 0!==n?n:"",cleanerInterval:null!==(a=e.data.cleanerInterval)&&void 0!==a?a:"",hashtagWhitelist:null!==(o=e.data.hashtagWhitelist)&&void 0!==o?o:[],hashtagBlacklist:null!==(r=e.data.hashtagBlacklist)&&void 0!==r?r:[],captionWhitelist:null!==(i=e.data.captionWhitelist)&&void 0!==i?i:[],captionBlacklist:null!==(l=e.data.captionBlacklist)&&void 0!==l?l:[],autoPromotions:null!==(s=e.data.autoPromotions)&&void 0!==s?s:[],promotions:null!==(u=e.data.promotions)&&void 0!==u?u:{}},Array.isArray(c.original.promotions)&&0===c.original.promotions.length&&(c.original.promotions={}),c.restore()}},{values:a.n,update:a.f,save:a.f,load:a.f,restore:a.f}),Object(a.g)(()=>{c.isDirty=!Object(r.p)(c.original,c.values),l.a.config.globalPromotions=c.values.promotions,l.a.config.autoPromotions=c.values.autoPromotions});const s="sli/settings/saved";class u extends CustomEvent{constructor(e,t={}){super(e,t)}}},168:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(0),o=n.n(a);function r(e){return o.a.createElement("p",null,e.message)}},182:function(e,t,n){e.exports={message:"Message__message",shaking:"Message__shaking","shake-animation":"Message__shake-animation",shakeAnimation:"Message__shake-animation",icon:"Message__icon",content:"Message__content","dismiss-btn":"Message__dismiss-btn",dismissBtn:"Message__dismiss-btn",success:"Message__success Message__message",info:"Message__info Message__message",warning:"Message__warning Message__message","pro-tip":"Message__pro-tip Message__message",proTip:"Message__pro-tip Message__message",error:"Message__error Message__message"}},183:function(e,t,n){e.exports={primaryColor:"#007cba",secondaryColor:"#d04186",tertiaryColor:"#d82442",lightColor:"#f5f5f5",lightColor2:"#e6e7e8",lightColor3:"#e1e2e3",shadowColor:"rgba(20,25,60,.32)",washedColor:"#eaf0f4"}},184:function(e,t,n){e.exports={content:"Sidebar__content",sidebar:"Sidebar__sidebar",padded:"Sidebar__padded","padded-content":"Sidebar__padded-content Sidebar__content Sidebar__padded",paddedContent:"Sidebar__padded-content Sidebar__content Sidebar__padded",disabled:"Sidebar__disabled Sidebar__sidebar"}},187:function(e,t,n){e.exports={root:"Toast__root","fade-in-animation":"Toast__fade-in-animation",fadeInAnimation:"Toast__fade-in-animation","root-fading-out":"Toast__root-fading-out Toast__root",rootFadingOut:"Toast__root-fading-out Toast__root","fade-out-animation":"Toast__fade-out-animation",fadeOutAnimation:"Toast__fade-out-animation",content:"Toast__content","dismiss-icon":"Toast__dismiss-icon",dismissIcon:"Toast__dismiss-icon","dismiss-btn":"Toast__dismiss-btn Toast__dismiss-icon",dismissBtn:"Toast__dismiss-btn Toast__dismiss-icon"}},188:function(e,t,n){e.exports={content:"AutomatePromotionsTab__content","content-heading":"AutomatePromotionsTab__content-heading",contentHeading:"AutomatePromotionsTab__content-heading",tutorial:"AutomatePromotionsTab__tutorial","tutorial-box":"AutomatePromotionsTab__tutorial-box",tutorialBox:"AutomatePromotionsTab__tutorial-box","tutorial-text":"AutomatePromotionsTab__tutorial-text",tutorialText:"AutomatePromotionsTab__tutorial-text","tutorial-video":"AutomatePromotionsTab__tutorial-video",tutorialVideo:"AutomatePromotionsTab__tutorial-video","mobile-instructions":"AutomatePromotionsTab__mobile-instructions",mobileInstructions:"AutomatePromotionsTab__mobile-instructions"}},206:function(e,t,n){"use strict";n.d(t,"b",(function(){return _})),n.d(t,"a",(function(){return g}));var a=n(0),o=n.n(a),r=n(20),i=n(7),l=n(2),c=n(26),s=n(3),u=n(387),m=n(282),d=n(151),p=n(96),b=c.a.SavedFeed;const _="You have unsaved changes. If you leave now, your changes will be lost.";function g({feed:e,config:t,requireName:n,confirmOnCancel:a,firstTab:c,useCtrlS:g,onChange:f,onSave:h,onCancel:v,onRename:E,onChangeTab:y,onDirtyChange:C}){const O=Object(s.v)(p.a,null!=t?t:{});c=null!=c?c:O.tabs[0].id;const[N,w]=Object(r.h)(null),[A,k]=Object(r.h)(e.name),[S,T]=o.a.useState(!0),[P,j]=o.a.useState(c),[L,x]=o.a.useState(l.a.Mode.DESKTOP),[I,R]=Object(r.h)(!1),[F,D]=Object(r.h)(!1),[M,B]=o.a.useState(!1),U=e=>{R(e),C&&C(e)};null===N.current&&(N.current=new i.a.Options(e.options));const G=o.a.useCallback(e=>{j(e),y&&y(e)},[y]),H=o.a.useCallback(e=>{const t=new i.a.Options(N.current);Object(s.b)(t,e),w(t),U(!0),f&&f(e,t)},[f]),Y=o.a.useCallback(e=>{k(e),U(!0),E&&E(e)},[E]),W=o.a.useCallback(t=>{if(I.current)if(n&&void 0===t&&!F.current&&0===A.current.length)D(!0);else{t=null!=t?t:A.current,k(t),D(!1),B(!0);const n=new b({id:e.id,name:t,options:N.current});h&&h(n).finally(()=>{B(!1),U(!1)})}},[e,h]),z=o.a.useCallback(()=>{I.current&&!confirm(_)||(U(!1),v&&v())},[v]);return Object(r.d)("keydown",e=>{g&&e.key&&"s"===e.key.toLowerCase()&&e.ctrlKey&&(W(),e.preventDefault(),e.stopPropagation())},[],[I]),o.a.createElement(o.a.Fragment,null,o.a.createElement(u.a,Object.assign({value:N.current,name:A.current,tabId:P,previewDevice:L,showFakeOptions:S,onChange:H,onRename:Y,onChangeTab:G,onToggleFakeOptions:T,onChangeDevice:x,onSave:W,onCancel:z,isSaving:M},O,{isDoneBtnEnabled:I.current,isCancelBtnEnabled:I.current})),o.a.createElement(m.a,{isOpen:F.current,onAccept:e=>{W(e)},onCancel:()=>{D(!1)}}),a&&o.a.createElement(d.a,{message:_,when:I.current&&!M}))}},207:function(e,t,n){e.exports={root:"Tooltip__root layout__z-highest",container:"Tooltip__container","container-top":"Tooltip__container-top Tooltip__container",containerTop:"Tooltip__container-top Tooltip__container","container-bottom":"Tooltip__container-bottom Tooltip__container",containerBottom:"Tooltip__container-bottom Tooltip__container","container-left":"Tooltip__container-left Tooltip__container",containerLeft:"Tooltip__container-left Tooltip__container","container-right":"Tooltip__container-right Tooltip__container",containerRight:"Tooltip__container-right Tooltip__container",content:"Tooltip__content",arrow:"Tooltip__arrow","arrow-top":"Tooltip__arrow-top Tooltip__arrow",arrowTop:"Tooltip__arrow-top Tooltip__arrow","arrow-bottom":"Tooltip__arrow-bottom Tooltip__arrow",arrowBottom:"Tooltip__arrow-bottom Tooltip__arrow","arrow-left":"Tooltip__arrow-left Tooltip__arrow",arrowLeft:"Tooltip__arrow-left Tooltip__arrow","arrow-right":"Tooltip__arrow-right Tooltip__arrow",arrowRight:"Tooltip__arrow-right Tooltip__arrow"}},209:function(e,t,n){e.exports={root:"HelpTooltip__root",tooltip:"HelpTooltip__tooltip layout__z-high","tooltip-container":"HelpTooltip__tooltip-container",tooltipContainer:"HelpTooltip__tooltip-container","tooltip-content":"HelpTooltip__tooltip-content",tooltipContent:"HelpTooltip__tooltip-content",icon:"HelpTooltip__icon"}},212:function(e,t,n){e.exports={root:"Notification__root",text:"Notification__text",title:"Notification__title Notification__text",content:"Notification__content Notification__text",date:"Notification__date"}},226:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var a=n(0),o=n.n(a),r=n(207),i=n.n(r),l=n(172),c=n(302),s=n(303),u=n(14),m=n(11);function d({visible:e,delay:t,placement:n,theme:r,children:d}){r=null!=r?r:{},n=n||"bottom";const[b,_]=o.a.useState(!1),g={preventOverflow:{boundariesElement:document.getElementById(u.a.config.rootId),padding:5}};Object(a.useEffect)(()=>{const n=setTimeout(()=>_(e),e?t:1);return()=>clearTimeout(n)},[e]);const f=p("container",n),h=p("arrow",n),v=Object(m.b)(i.a[f],r.container,r[f]),E=Object(m.b)(i.a[h],r.arrow,r[h]);return o.a.createElement(l.c,null,o.a.createElement(c.a,null,e=>d[0](e)),o.a.createElement(s.a,{placement:n,modifiers:g,positionFixed:!0},({ref:e,style:t,placement:n,arrowProps:a})=>b?o.a.createElement("div",{ref:e,className:Object(m.b)(i.a.root,r.root),style:t,tabIndex:-1},o.a.createElement("div",{className:v,"data-placement":n},o.a.createElement("div",{className:Object(m.b)(i.a.content,r.content)},d[1]),o.a.createElement("div",{className:E,ref:a.ref,style:a.style,"data-placement":n}))):null))}function p(e,t){switch(t){case"top":case"top-start":case"top-end":return e+"Top";case"bottom":case"bottom-start":case"bottom-end":return e+"Bottom";case"left":case"left-start":case"left-end":return e+"Left";case"right":case"right-start":case"right-end":return e+"Right";default:return e}}},229:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(0),o=n.n(a),r=n(370),i=n.n(r),l=n(83);function c({children:e}){return o.a.createElement("div",null,o.a.createElement("div",{className:i.a.proPill},o.a.createElement(l.a,null)),o.a.createElement("span",null,e))}},23:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return u}));var a,o=n(0),r=n.n(o),i=n(182),l=n.n(i),c=n(11),s=n(10);!function(e){e.SUCCESS="success",e.INFO="info",e.PRO_TIP="pro-tip",e.WARNING="warning",e.ERROR="error"}(a||(a={}));const u=({children:e,type:t,showIcon:n,shake:a,isDismissible:o,onDismiss:i})=>{const[u,d]=r.a.useState(!1),p=Object(c.b)(l.a[t],a?l.a.shaking:null);return u?null:r.a.createElement("div",{className:p},n?r.a.createElement("div",null,r.a.createElement(s.a,{className:l.a.icon,icon:m(t)})):null,r.a.createElement("div",{className:l.a.content},e),o?r.a.createElement("button",{className:l.a.dismissBtn,onClick:()=>{o&&(d(!0),i&&i())}},r.a.createElement(s.a,{icon:"no"})):null)};function m(e){switch(e){case a.SUCCESS:return"yes-alt";case a.PRO_TIP:return"lightbulb";case a.ERROR:case a.WARNING:return"warning";case a.INFO:default:return"info"}}},237:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n(0),o=n.n(a),r=n(381),i=n.n(r);function l({message:e}){return o.a.createElement("pre",{className:i.a.content},e)}},238:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),o=n.n(a),r=n(382),i=n.n(r),l=n(95),c=n(168);const s=({feed:e,onCopy:t,children:n})=>o.a.createElement(i.a,{text:`[instagram feed="${e.id}"]`,onCopy:()=>{l.a.add("feeds/shortcode/copied",()=>o.a.createElement(c.a,{message:"Copied shortcode to clipboard."})),t&&t()}},n)},242:function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var a=n(0),o=n.n(a),r=n(188),i=n.n(r),l=n(90),c=n(88),s=n.n(c),u=n(3),m=n(244),d=n(5),p=n(10),b=n(8),_=n(39),g=n(106),f=n(14),h=n(65);function v({automations:e,selected:t,isFakePro:n,onChange:r,onSelect:i,onClick:l}){!n&&r||(r=_.b);const[c,p]=o.a.useState(null);function g(e){i&&i(e)}const f=Object(a.useCallback)(()=>{r(e.concat({type:"hashtag",config:{},promotion:{type:"link",config:{}}}),e.length)},[e]),v=Object(a.useCallback)(t=>()=>{const n=e[t],a=Object(u.h)(n),o=e.slice();o.splice(t+1,0,a),r(o,t+1)},[e]);function y(){p(null)}const C=Object(a.useCallback)(t=>{const n=e.slice();n.splice(t,1),r(n,0),y()},[e]),O=Object(a.useCallback)(n=>{const a=e[t],o=n.map(e=>({type:e.type,config:b.a.Automation.getConfig(e),promotion:b.a.Automation.getPromotion(e)})),i=o.findIndex(e=>e.promotion===a.promotion);r(o,i)},[e]);function N(e){return()=>{g(e),l&&l(e)}}const w=e.map(e=>Object.assign(Object.assign({},e),{id:Object(u.u)()}));return o.a.createElement("div",{className:n?s.a.fakeProList:s.a.list},o.a.createElement("div",{className:s.a.addButtonRow},o.a.createElement(d.a,{type:d.c.SECONDARY,size:d.b.LARGE,onClick:f},"Add automation")),o.a.createElement(m.a,{list:w,handle:"."+s.a.rowDragHandle,setList:O,onStart:function(e){g(e.oldIndex)},animation:200,delay:1e3,fallbackTolerance:5,delayOnTouchOnly:!0},e.map((e,n)=>o.a.createElement(E,{key:n,automation:e,selected:t===n,onClick:N(n),onDuplicate:v(n),onRemove:()=>function(e){p(e)}(n)}))),o.a.createElement(h.a,{isOpen:null!==c,title:"Are you sure?",buttons:["Yes, remove it","No, keep it"],onAccept:()=>C(c),onCancel:y},o.a.createElement("p",null,"Are you sure you want to remove this automation? This ",o.a.createElement("strong",null,"cannot")," be undone!")))}function E({automation:e,selected:t,onClick:n,onDuplicate:a,onRemove:r}){const i=b.a.Automation.getConfig(e),l=b.a.Automation.getPromotion(e),c=b.a.getConfig(l),u=f.a.config.postTypes.find(e=>e.name===c.linkType);return o.a.createElement("div",{className:t?s.a.rowSelected:s.a.row,onClick:n},o.a.createElement("div",{className:s.a.rowDragHandle},o.a.createElement(p.a,{icon:"menu"})),o.a.createElement("div",{className:s.a.rowBox},o.a.createElement("div",{className:s.a.rowHashtags},i.hashtags&&Array.isArray(i.hashtags)?i.hashtags.map(e=>"#"+e).join(", "):o.a.createElement("span",{className:s.a.noHashtagsMessage},"No hashtags")),o.a.createElement("div",{className:s.a.rowSummary},o.a.createElement(g.a,{value:c.linkType},o.a.createElement(g.c,{value:"url"},o.a.createElement("span",{className:s.a.summaryItalics},"Custom URL")),o.a.createElement(g.b,null,()=>u?o.a.createElement("span",null,o.a.createElement("span",{className:s.a.summaryBold},c.postTitle)," ",o.a.createElement("span",{className:s.a.summaryItalics},"(",u.labels.singular_name,")")):o.a.createElement("span",{className:s.a.noPromoMessage},"No promotion")))),o.a.createElement("div",{className:s.a.rowActions},o.a.createElement(d.a,{type:d.c.PILL,size:d.b.SMALL,onClick:Object(_.c)(a),tooltip:"Duplicate automation"},o.a.createElement(p.a,{icon:"admin-page"})),o.a.createElement(d.a,{type:d.c.DANGER_PILL,size:d.b.SMALL,onClick:Object(_.c)(r),tooltip:"Remove automation"},o.a.createElement(p.a,{icon:"trash"})))))}var y=n(299),C=n.n(y),O=n(94),N=n(56),w=n(84),A=n(125),k=n(178),S=n(11);let T;function P({automation:e,isFakePro:t,onChange:n}){var a;!t&&n||(n=_.b),void 0===T&&(T=b.a.getTypes().filter(e=>"-more-"!==e.id).map(e=>({value:e.id,label:e.label})));const r=b.a.Automation.getPromotion(e),i=b.a.getType(r),l=b.a.getConfig(r),c=null!==(a=b.a.Automation.getConfig(e).hashtags)&&void 0!==a?a:[];return o.a.createElement(O.a,null,e&&o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:Object(S.b)(O.a.padded,t?C.a.fakePro:null)},o.a.createElement(w.a,{id:"sli-auto-promo-hashtags",label:"Promote posts with any of these hashtags",wide:!0},o.a.createElement(A.a,{id:"sli-auto-promo-hashtags",value:c,onChange:function(t){n(Object.assign(Object.assign({},e),{config:{hashtags:t}}))},autoFocus:!t})),o.a.createElement(w.a,{id:"auto-promo-type",label:"Promotion type",wide:!0},o.a.createElement(N.a,{id:"sli-auto-promo-type",value:e.promotion.type,onChange:function(t){n(Object.assign(Object.assign({},e),{type:t.value}))},options:T,isSearchable:!1,isCreatable:!1,isClearable:!1}))),o.a.createElement("div",{className:t?C.a.fakePro:null},o.a.createElement(k.a,{type:i,config:l,onChange:function(t){n(Object.assign(Object.assign({},e),{promotion:Object.assign(Object.assign({},e.promotion),{config:t})}))},hideRemove:!0}))),!e&&o.a.createElement("div",{className:O.a.padded},o.a.createElement("p",null,"Automatically link Instagram posts from any source that contain specific hashtags to posts,"," ","pages, products, custom links, and more."," ",o.a.createElement("a",{href:"#"},"Learn more")),o.a.createElement("p",null,"To get started, create an automation or select an existing one.")))}function j({automations:e,isFakePro:t,onChange:n}){e=null!=e?e:[],n=null!=n?n:_.b;const[r,c]=o.a.useState(0),[s,m]=o.a.useState("content"),d=Object(u.g)(r,e),p=e.length>0,b=()=>m("content"),g=()=>m("sidebar"),f=Object(a.useCallback)(()=>e[d],[e,d]);function h(e){c(e)}function E(e){h(e),g()}const y=Object(a.useCallback)((e,t)=>{n(e),void 0!==t&&c(t)},[n]),C=Object(a.useCallback)(t=>{n(Object(u.d)(e,d,t))},[d,n]),O=Object(a.useCallback)(()=>{n(e.concat({type:"hashtag",config:{},promotion:{type:"link",config:{}}})),c(0),g()},[e]);return o.a.createElement(l.a,{primary:"content",current:s,sidebar:p&&(e=>o.a.createElement(o.a.Fragment,null,e&&o.a.createElement(l.a.Navigation,{icon:"arrow-left-alt",text:"Automations",onClick:b}),o.a.createElement(P,{automation:f(),onChange:C,isFakePro:t}))),content:n=>o.a.createElement("div",{className:i.a.content},!p&&o.a.createElement(L,{onCreate:O}),p&&o.a.createElement(o.a.Fragment,null,n&&o.a.createElement("div",{className:i.a.mobileInstructions},o.a.createElement("p",null,"Click or tap on an automation to change its settings")),o.a.createElement(v,{automations:e,selected:d,isFakePro:t,onChange:y,onSelect:h,onClick:E})))})}function L({onCreate:e}){return o.a.createElement("div",{className:i.a.tutorial},o.a.createElement("div",{className:i.a.tutorialBox},o.a.createElement("div",{className:i.a.tutorialText},o.a.createElement("h1",null,"Automatically drive more conversions with Instagram"),o.a.createElement("p",null,"Link Instagram posts to your products, blog posts, landing pages, and more."),o.a.createElement("p",null,o.a.createElement("b",null,"Promotions help you drive traffic and increase conversions through social proof.")),o.a.createElement("p",null,"For example, create an ",o.a.createElement("b",null,"Instagram hashtag"),", let’s call it ",o.a.createElement("b",null,"#mymaxidress"),"."," "," Display photos from Instagram that use this hashtag and feature your dress,"," "," then have them ",o.a.createElement("b",null,"link directly to your product page"),", whether it’s on the"," "," same website or not."),o.a.createElement("p",null,"Every new Instagram photo that Spotlight finds with this hashtag will then",o.a.createElement("br",null),o.a.createElement("b",null,"automatically link to the product page"),"."),o.a.createElement("p",null,o.a.createElement("b",null,"Simple. Powerful. Effective."))),o.a.createElement(d.a,{type:d.c.SECONDARY,size:d.b.HERO,onClick:e},"Create your first automation")))}},245:function(e,t,n){"use strict";n.d(t,"a",(function(){return A}));var a=n(0),o=n.n(a),r=n(121),i=n.n(r),l=n(4),c=n(7),s=n(8),u=n(82),m=n(15),d=n(90),p=n(94),b=n(84),_=n(56),g=n(178);function f({media:e,promo:t,isLastPost:n,isFakePro:r,onChange:i,onNextPost:l}){let c,u,m;e&&(c=t?t.type:s.a.getTypes()[0].id,u=s.a.getTypeById(c),m=s.a.getConfig(t));const d=Object(a.useCallback)(e=>{const t={type:u.id,config:e};i(t)},[e,u]),f=Object(a.useCallback)(e=>{const t={type:e.value,config:m};i(t)},[e,m]);if(!e)return o.a.createElement(p.a,{disabled:r},o.a.createElement("div",{className:p.a.padded},o.a.createElement("p",null,"Promote your blog posts, landing pages, products, and much more through your Instagram feed."),o.a.createElement("p",{style:{fontWeight:"bold"}},"How it works:"),o.a.createElement("ol",{style:{marginTop:0}},o.a.createElement("li",null,"Select a post from the preview on the left."),o.a.createElement("li",null,"Choose what the post should link to.")),o.a.createElement("p",null,"That’s it!")));const h=void 0!==s.a.getAutoPromo(e);return o.a.createElement(p.a,{disabled:r},o.a.createElement("div",{className:p.a.padded},o.a.createElement(b.a,{label:"Promotion type",wide:!0},o.a.createElement(_.a,{value:c,onChange:f,options:s.a.getTypes().map(e=>({value:e.id,label:e.label}))}))),o.a.createElement(g.a,{key:e?e.id:void 0,type:u,config:m,onChange:d,hasAuto:h,showNextBtn:!0,isNextBtnDisabled:n,onNext:l}))}var h=n(177),v=n(235),E=n(11),y=n(236),C=n(39),O=n(100);const N={};function w(){return new u.b({watch:{all:!0,moderation:!1,filters:!1}})}function A({promotions:e,isFakePro:t,onChange:n}){!t&&n||(n=C.b);const[a,r]=o.a.useState("content"),[u,p]=o.a.useState(l.b.list.length>0?l.b.list[0].id:null),[b,_]=o.a.useState(),g=o.a.useRef(new c.a);A();const E=()=>r("content");function A(){g.current=new c.a(new c.a.Options({accounts:[u]}))}const S=o.a.useCallback(e=>{p(e.id),A()},[p]),T=o.a.useCallback((e,t)=>{_(t)},[_]),P=e=>e&&r("sidebar"),j=o.a.useCallback(()=>{_(e=>e+1)},[_]),L=u?m.a.ensure(N,u,w()):w(),x=L.media[b],I=x?s.a.getPromoFromDictionary(x,e):void 0,R=o.a.useCallback(t=>{n(m.a.withEntry(e,x.id,t))},[x,e,n]);return o.a.createElement(o.a.Fragment,null,0===l.b.list.length&&o.a.createElement("div",{className:i.a.tutorial},o.a.createElement("div",{className:i.a.tutorialBox},o.a.createElement("div",{className:i.a.tutorialText},o.a.createElement("h1",null,"Set up global promotions across all feeds"),o.a.createElement("p",null,"Link Instagram posts to your products, blog posts, landing pages, and more."),o.a.createElement("p",null,o.a.createElement("b",null,"Promotions help you drive traffic and increase conversions through social proof.")),o.a.createElement("p",null,"Set up global promotions for each account that will apply across all feeds."," ","You may then choose to enable or disable promotions on a per-feed basis."),o.a.createElement("p",null,"Connect your first Instagram account to set up global promotions."),o.a.createElement("p",null,o.a.createElement("b",null,"Simple. Powerful. Effective."))),o.a.createElement(O.a,{onConnect:p},"Connect your Instagram account"))),l.b.list.length>0&&o.a.createElement(d.a,{primary:"content",current:a,sidebar:e=>o.a.createElement(o.a.Fragment,null,e&&o.a.createElement(o.a.Fragment,null,o.a.createElement(d.a.Navigation,{icon:"arrow-left-alt",text:"Back",onClick:E}),o.a.createElement(y.a,{media:x})),o.a.createElement(f,{media:x,promo:I,isLastPost:b>=L.media.length-1,onChange:R,onNextPost:j,isFakePro:t})),content:e=>o.a.createElement(o.a.Fragment,null,l.b.list.length>1&&o.a.createElement(k,{selected:u,onSelect:S}),o.a.createElement("div",{className:i.a.content},e&&o.a.createElement("div",{className:i.a.mobileInstructions},o.a.createElement("p",null,"Click or tap a post to set up a promotion for it")),o.a.createElement(h.a,{key:g.current.options.accounts.join("-"),feed:g.current,store:L,selected:b,onSelectMedia:T,onClickMedia:P,autoFocusFirst:!0,disabled:t},(e,n)=>{const a=t?void 0:s.a.getPromo(e);return o.a.createElement(v.a,{media:e,promo:a,selected:n===b})})))}))}function k({selected:e,onSelect:t}){return o.a.createElement("div",{className:i.a.accountList},o.a.createElement("div",{className:i.a.accountScroller},l.b.list.map(n=>{const a="global-promo-account-"+n.id;return o.a.createElement("div",{key:n.id,className:e===n.id?i.a.accountSelected:i.a.accountButton,onClick:()=>t(n),role:"button","aria-labelledby":a},o.a.createElement("div",{className:i.a.profilePic},o.a.createElement("img",Object.assign({src:l.b.getProfilePicUrl(n),alt:n.username},E.e))),o.a.createElement("div",{id:a,className:i.a.username},o.a.createElement("span",null,"@"+n.username)))})))}},246:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var a=n(0),o=n.n(a),r=n(119),i=n.n(r),l=n(30),c=n(4),s=n(46),u=n(5),m=n(10),d=n(120),p=n.n(d),b=n(55),_=n(14);function g({isColumn:e,onConnectPersonal:t,onConnectBusiness:n}){const[r,i]=o.a.useState(!1),[l,c]=o.a.useState(""),[s,m]=o.a.useState(""),[d,_]=o.a.useState(!1);Object(a.useEffect)(()=>{_(l.length>145&&!l.trimLeft().startsWith("IG"))},[l]);const g=o.a.createElement("div",{className:p.a.helpMessage},!1),f=o.a.createElement("div",{className:p.a.buttonContainer},e&&g,o.a.createElement(u.a,{className:p.a.button,onClick:()=>{d?n(l,s):t(l)},type:u.c.PRIMARY,disabled:0===l.length&&(0===s.length||!d)},"Connect"));return o.a.createElement("div",{className:e?p.a.column:p.a.row},o.a.createElement(b.a,{label:"Connect using an access token (for developers)",stealth:!0,isOpen:r,onClick:()=>i(!r)},o.a.createElement("div",{className:p.a.content},o.a.createElement("label",{className:p.a.label,htmlFor:"manual-connect-access-token"},o.a.createElement("div",null,"Enter your Instagram or Facebook access token")),o.a.createElement("div",{className:p.a.bottom},o.a.createElement("input",{id:"manual-connect-access-token",type:"text",value:l,onChange:e=>c(e.target.value),placeholder:"Your access token"}),!d&&f)),d&&o.a.createElement("div",{className:p.a.content},o.a.createElement("label",{className:p.a.label,htmlFor:"manual-connect-user-id"},o.a.createElement("div",null,"This access token is for a ",o.a.createElement("strong",null,"Business")," account."," ","Enter the user ID:")),o.a.createElement("div",{className:p.a.bottom},o.a.createElement("input",{id:"manual-connect-user-id",type:"text",value:s,onChange:e=>m(e.target.value),placeholder:"Enter the user ID"}),d&&f)),!e&&g))}function f({onConnect:e,beforeConnect:t,useColumns:n,showPrompt:a}){a=null==a||a,e||(e=()=>{});const r=e=>{l.a.State.connectSuccess&&t&&t(e)};return o.a.createElement("div",{className:i.a.root},a&&o.a.createElement("p",{className:i.a.promptMsg},"Choose the type of account to connect:"),o.a.createElement("div",{className:n?i.a.typesColumns:i.a.typesRows},o.a.createElement("div",{className:i.a.type},o.a.createElement(u.a,{type:u.c.PRIMARY,size:u.b.HERO,onClick:()=>l.a.openAuthWindow(c.a.Type.PERSONAL,s.a.ANIMATION_DELAY,r).then(e).catch(()=>{})},"Connect your Personal account"),o.a.createElement("div",{className:i.a.capabilities},o.a.createElement(h,null,"Connects directly through Instagram"),o.a.createElement(h,null,"Show posts from your account"))),o.a.createElement("div",{className:i.a.type},o.a.createElement(u.a,{type:u.c.SECONDARY,size:u.b.HERO,onClick:()=>l.a.openAuthWindow(c.a.Type.BUSINESS,s.a.ANIMATION_DELAY,r).then(e).catch(()=>{})},"Connect your Business account"),o.a.createElement("div",{className:i.a.capabilities},o.a.createElement(h,null,"Connects through your Facebook page"),o.a.createElement(h,null,"Show posts from your account"),o.a.createElement(h,null,"Show posts where you are tagged"),o.a.createElement(h,null,"Show posts with a specific hashtag from all across Instagram"),o.a.createElement("div",{className:i.a.businessLearnMore},o.a.createElement(m.a,{icon:"editor-help"}),o.a.createElement("a",{href:_.a.resources.businessAccounts,target:"_blank"},"Learn more about Business accounts"))))),o.a.createElement("div",{className:i.a.connectAccessToken},o.a.createElement(g,{isColumn:n,onConnectPersonal:t=>l.a.manualConnectPersonal(t,s.a.ANIMATION_DELAY,r).then(e),onConnectBusiness:(t,n)=>l.a.manualConnectBusiness(t,n,s.a.ANIMATION_DELAY,r).then(e)})))}const h=e=>{var{children:t}=e,n=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}(e,["children"]);return o.a.createElement("div",Object.assign({className:i.a.capability},n),o.a.createElement(m.a,{icon:"yes"}),o.a.createElement("div",null,t))}},247:function(e,t,n){e.exports={root:"ModalPrompt__root",button:"ModalPrompt__button"}},248:function(e,t,n){e.exports={button:"ColorPicker__button","color-preview":"ColorPicker__color-preview",colorPreview:"ColorPicker__color-preview",popper:"ColorPicker__popper"}},256:function(e,t,n){"use strict";t.a={Sizes:{WIDE:1200,LARGE:1180,MEDIUM:960,SMALL:782,NARROW:600,ALL:[1200,1180,960,782,600]}}},26:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var a,o=n(1),r=n(7),i=n(19),l=n(14),c=function(e,t,n,a){var o,r=arguments.length,i=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,a);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(r<3?o(i):r>3?o(t,n,i):o(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i};!function(e){class t{constructor(e={}){t.setFromObject(this,null!=e?e:{})}static setFromObject(e,t={}){var n,a,o,i,l;e.id=null!==(n=t.id)&&void 0!==n?n:null,e.name=null!==(a=t.name)&&void 0!==a?a:"",e.usages=null!==(o=t.usages)&&void 0!==o?o:[],e.options=new r.a.Options(null!==(i=e.options)&&void 0!==i?i:{}),r.a.Options.setFromObject(e.options,null!==(l=t.options)&&void 0!==l?l:{})}get label(){return t.getLabel(this.name)}static getLabel(e){return e.length>0?e:this.getDefaultName()}static getDefaultName(){return"(no name)"}}function n(n){if("object"!=typeof n||!Array.isArray(n.data))throw"Spotlight encountered a problem trying to load your feeds. Kindly contact customer support for assistance.";e.list.replace(n.data.map(e=>new t(e)))}c([o.n],t.prototype,"id",void 0),c([o.n],t.prototype,"name",void 0),c([o.n],t.prototype,"usages",void 0),c([o.n],t.prototype,"options",void 0),c([o.h],t.prototype,"label",null),e.SavedFeed=t,e.list=Object(o.n)([]),e.loadFeeds=()=>i.a.getFeeds().then(n).catch(e=>{throw i.a.getErrorReason(e)}),e.getById=t=>(t="string"==typeof t?parseInt(t):t)?e.list.find(e=>e.id==t):void 0,e.hasFeeds=()=>e.list.length>0,e.create=function(n,a){const o=new t({id:null,name:s(n),options:new r.a.Options(a)});return e.list.push(o),o},e.saveFeed=function(n){return l.a.restApi.saveFeed(n).then(a=>{const o=new t(a.data.feed);if(null===n.id)e.list.push(o);else{const t=e.list.findIndex(e=>e.id===n.id);e.list[t]=o}return o})},e.deleteFeed=function(t){const n=null!==t.id?e.list.findIndex(e=>e.id===t.id):e.list.findIndex(e=>e===t);return n>=0&&e.list.splice(n,1),null!==t.id?l.a.restApi.deleteFeed(t.id).catch(e=>{}):new Promise(e=>e())};const a=new RegExp("([\\w\\s]+)\\s?\\((\\d+)\\)?");function s(t){const n=u(t)[0],a=e.list.map(e=>u(e.name)).filter(e=>e[0]===n),o=a.reduce((e,t)=>Math.max(e,t[1]),1);return a.length>0?`${n} (${o+1})`:t.trim()}function u(e){e=e.trim();const t=a.exec(e);return t?[t[1].trim(),parseInt(t[2])]:[e,0]}}(a||(a={}))},287:function(e,t,n){e.exports={root:"ClearCacheButton__root layout__flex-row","doc-link":"ClearCacheButton__doc-link",docLink:"ClearCacheButton__doc-link"}},290:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(0),o=n.n(a);n(324);const r=({children:e})=>o.a.createElement("div",{className:"button-group"},e)},291:function(e,t,n){e.exports={root:"SaveButton__root","saving-overlay":"SaveButton__saving-overlay layout__fill-parent",savingOverlay:"SaveButton__saving-overlay layout__fill-parent","saving-animation":"SaveButton__saving-animation",savingAnimation:"SaveButton__saving-animation"}},296:function(e,t,n){e.exports={root:"Toaster__root layout__z-highest",container:"Toaster__container"}},298:function(e,t,n){e.exports={logo:"SpotlightLogo__logo","logo-image":"SpotlightLogo__logo-image",logoImage:"SpotlightLogo__logo-image"}},299:function(e,t,n){e.exports={"fake-pro":"AutoPromotionsSidebar__fake-pro",fakePro:"AutoPromotionsSidebar__fake-pro"}},30:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var a,o=n(4),r=n(29),i=n(14),l=n(1),c=n(615),s=n(614),u=n(388);!function(e){let t=null,n=null;e.State=window.SliAccountManagerState=Object(l.n)({accessToken:null,connectSuccess:!1,connectedId:null});const a=Object(c.a)(new Date,{days:7});function m(t,n,a){a&&a(e.State.connectedId),setTimeout(()=>o.b.loadAccounts().then(()=>{const t=o.b.getById(e.State.connectedId),a=new p(e.ACCOUNT_CONNECTED_EVENT,t);document.dispatchEvent(a),n(e.State.connectedId)}),t)}function d(e){return e.type===o.a.Type.BUSINESS&&e.accessToken&&e.accessToken.expiry&&Object(s.a)(a,Object(u.a)(e.accessToken.expiry))}e.manualConnectPersonal=function(t,n=0,a){return new Promise((o,r)=>{e.State.connectSuccess=!1,i.a.restApi.connectPersonal(t).then(t=>{e.State.connectSuccess=!0,e.State.connectedId=t.data.accountId,m(n,o,a)}).catch(r)})},e.manualConnectBusiness=function(t,n,a=0,o){return new Promise((r,l)=>{e.State.connectSuccess=!1,i.a.restApi.connectBusiness(t,n).then(t=>{e.State.connectSuccess=!0,e.State.connectedId=t.data.accountId,m(a,r,o)}).catch(l)})},e.openAuthWindow=function(a,l=0,c){return new Promise((s,u)=>{if(e.State.connectedId=null,null==t||t.closed){const e=Object(r.a)(700,800),n=a===o.a.Type.PERSONAL?i.a.restApi.config.personalAuthUrl:i.a.restApi.config.businessAuthUrl;t=Object(r.c)(n,"_blank",Object.assign({dependent:"yes",resizable:"yes",toolbar:"no",location:"no",scrollbars:"no"},e))}else t.focus();null==t||t.closed||(n=setInterval(()=>{t&&!t.closed||(clearInterval(n),null===e.State.connectedId?u&&u():m(l,s,c))},500))})},e.updateAccount=function(e){return i.a.restApi.updateAccount(e)},e.deleteAccount=function(e){return i.a.restApi.deleteAccount(e).then(o.b.loadFromResponse)},e.getExpiringTokenAccounts=function(){return o.b.list.filter(d)},e.isTokenExpiring=d,e.ACCOUNT_CONNECTED_EVENT="sli/account/connected";class p extends CustomEvent{constructor(e,t){super(e,{detail:{account:t}})}}e.AccountConnectedEvent=p}(a||(a={}))},301:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(296),i=n.n(r),l=n(95),c=n(187),s=n.n(c),u=n(10);function m({children:e,ttl:t,onExpired:n}){t=null!=t?t:0;const[r,i]=o.a.useState(!1);let l=o.a.useRef(),c=o.a.useRef();const m=()=>{t>0&&(l.current=setTimeout(p,t))},d=()=>{clearTimeout(l.current)},p=()=>{i(!0),c.current=setTimeout(b,200)},b=()=>{n&&n()};Object(a.useEffect)(()=>(m(),()=>{d(),clearTimeout(c.current)}),[]);const _=r?s.a.rootFadingOut:s.a.root;return o.a.createElement("div",{className:_,onMouseOver:d,onMouseOut:m},o.a.createElement("div",{className:s.a.content},e),o.a.createElement("button",{className:s.a.dismissBtn,onClick:()=>{d(),p()}},o.a.createElement(u.a,{icon:"no-alt",className:s.a.dismissIcon})))}var d=n(6);t.a=Object(d.b)((function(){return o.a.createElement("div",{className:i.a.root},o.a.createElement("div",{className:i.a.container},l.a.getAll().map(e=>{var t,n;return o.a.createElement(m,{key:e.key,ttl:null!==(t=e.ttl)&&void 0!==t?t:l.a.DEFAULT_TTL,onExpired:(n=e.key,()=>{l.a.remove(n)})},o.a.createElement(e.component,null))})))}))},324:function(e,t,n){},359:function(e,t,n){},362:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(35),o=n(93),r=n(21);const i={factories:Object(a.b)({"router/history":()=>Object(o.a)(),"router/store":e=>r.a.useHistory(e.get("router/history"))}),run:e=>{e.get("router/store")}}},363:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n(20);function o({when:e,is:t,isRoot:n,render:o}){const r=Object(a.g)().get(e);return r===t||!t&&!r||n&&!r?o():null}},364:function(e,t,n){e.exports={root:"ConnectAccountButton__root"}},370:function(e,t,n){e.exports={"pro-pill":"SpoilerProLabel__pro-pill",proPill:"SpoilerProLabel__pro-pill"}},371:function(e,t,n){e.exports={pill:"ProPill__pill"}},374:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n(0),o=n.n(a),r=n(11),i=(n(434),function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n});const l=e=>{var{className:t,unit:n}=e,a=i(e,["className","unit"]);const l=Object(r.b)("unit-input__field",t);return o.a.createElement("div",{className:"unit-input"},o.a.createElement("input",Object.assign({},a,{className:l})),o.a.createElement("div",{className:"unit-input__unit"},o.a.createElement("span",null,n)))}},376:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(46),i=n(117),l=n(16),c=n(112),s=n(14),u=n(6);t.a=Object(u.b)((function({isOpen:e,onClose:t,onSave:n}){return o.a.createElement(r.a,{title:"Global filters",isOpen:e,onClose:()=>{l.b.isDirty&&!confirm("You have unsaved changes. If you close the window now, your settings will not be saved. Click OK to close anyway.")||t()}},o.a.createElement(r.a.Content,null,o.a.createElement(c.a,{page:s.a.settings.pages.find(e=>"filters"===e.id)})),o.a.createElement(r.a.Footer,null,o.a.createElement(i.a,{disabled:!l.b.isDirty,isSaving:l.b.isSaving,onClick:()=>{l.b.save().then(()=>{n&&n()})}})))}))},377:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(0),o=n.n(a),r=n(11);n(600);const i=({name:e,className:t,disabled:n,value:a,onChange:i,options:l})=>{const c=e=>{!n&&e.target.checked&&i&&i(e.target.value)},s=Object(r.b)(Object(r.a)("radio-group",{"--disabled":n}),t);return o.a.createElement("div",{className:s},l.map((t,n)=>o.a.createElement("label",{className:"radio-group__option",key:n},o.a.createElement("input",{type:"radio",name:e,value:t.value,checked:a===t.value,onChange:c}),o.a.createElement("span",null,t.label))))}},378:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(0),o=n.n(a);n(601);const r=({size:e})=>{const t=(e=null!=e?e:24)+"px",n={width:t,height:t,boxShadow:`${.25*e+"px"} 0 0 ${.375*e+"px"} #999 inset`};return o.a.createElement("span",{className:"loading-spinner",style:n})}},379:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(4),i=n(65),l=n(89),c=n(30),s=n(6),u=n(14);t.a=Object(s.b)((function({}){Object(a.useEffect)(()=>{const e=e=>{const a=e.detail.account;n||m||a.type!==r.a.Type.PERSONAL||a.customBio.length||a.customProfilePicUrl.length||(t(a),s(!0))};return document.addEventListener(c.a.ACCOUNT_CONNECTED_EVENT,e),()=>document.removeEventListener(c.a.ACCOUNT_CONNECTED_EVENT,e)},[]);const[e,t]=o.a.useState(null),[n,s]=o.a.useState(!1),[m,d]=o.a.useState(!1),p=()=>{c.a.State.connectedId=null};return o.a.createElement(o.a.Fragment,null,o.a.createElement(i.a,{title:"You've successfully connected your account!",buttons:["Yes","No, maybe later"],isOpen:n,onAccept:()=>{s(!1),d(!0)},onCancel:()=>{s(!1),p()}},o.a.createElement("p",null,"One more thing ..."),o.a.createElement("p",null,"Instagram doesn't provide the profile photo and bio text for Personal accounts."," ","Would you like to set a custom photo and a custom bio in Spotlight to match your Instagram profile?"),o.a.createElement("p",null,o.a.createElement("a",{href:u.a.resources.customPersonalInfoUrl,target:"_blank"},"What's this about?"))),o.a.createElement(l.a,{isOpen:m,onClose:()=>{d(!1),p()},account:e}))}))},380:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var a=n(0),o=n.n(a),r=n(212),i=n.n(r),l=n(137),c=n(388),s=n(21),u=n(50);function m({notification:e}){const t=o.a.useRef();return Object(a.useEffect)(()=>{if(!t.current)return;const e=t.current.getElementsByTagName("a");for(let t=0;t<e.length;++t){const n=e.item(t);if("true"===n.getAttribute("data-sli-link"))continue;const a=n.getAttribute("href");if("string"!=typeof a||!a.startsWith("app://"))continue;const o=Object(u.parse)(a.substr("app://".length)),r=s.a.at(o),i=s.a.fullUrl(o);n.setAttribute("href",i),n.setAttribute("data-sli-link","true"),n.addEventListener("click",e=>{s.a.history.push(r,{}),e.preventDefault(),e.stopPropagation()})}},[t.current]),o.a.createElement("article",{className:i.a.root},e.title&&e.title.length&&o.a.createElement("header",{className:i.a.title},e.title),o.a.createElement("main",{ref:t,className:i.a.content,dangerouslySetInnerHTML:{__html:e.content}}),e.date&&o.a.createElement("footer",{className:i.a.date},Object(l.a)(Object(c.a)(e.date),{addSuffix:!0})))}},381:function(e,t,n){e.exports={content:"ErrorToast__content"}},415:function(e,t,n){},429:function(e,t,n){},430:function(e,t,n){},431:function(e,t,n){},432:function(e,t,n){},434:function(e,t,n){},46:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var a=n(0),o=n.n(a),r=n(32),i=n.n(r),l=n(11),c=(n(429),n(20)),s=n(5),u=n(10);function m({children:e,className:t,isOpen:n,icon:r,title:s,width:u,height:d,onClose:p,allowShadeClose:b,focusChild:_,portalTo:g}){const f=o.a.useRef(),[h]=Object(c.a)(n,!1,m.ANIMATION_DELAY);if(Object(c.d)("keydown",e=>{"Escape"===e.key&&(p&&p(),e.preventDefault(),e.stopPropagation())},[],[p]),Object(a.useEffect)(()=>{f&&f.current&&n&&(null!=_?_:f).current.focus()},[]),!h)return null;const v={width:u=null!=u?u:600,height:d},E=Object(l.b)("modal",n?"modal--open":null,n?null:"modal--close",t,"wp-core-ui-override");b=null==b||b;const y=o.a.createElement("div",{className:E},o.a.createElement("div",{className:"modal__shade",tabIndex:-1,onClick:()=>{b&&p&&p()}}),o.a.createElement("div",{ref:f,className:"modal__container",style:v,tabIndex:-1},s?o.a.createElement(m.Header,null,o.a.createElement("h1",null,o.a.createElement(m.Icon,{icon:r}),s),o.a.createElement(m.CloseBtn,{onClick:p})):null,e));let C=g;if(void 0===C){const e=document.getElementsByClassName("spotlight-modal-target");C=0===e.length?document.body:e.item(0)}return i.a.createPortal(y,C)}!function(e){e.ANIMATION_DELAY=120,e.CloseBtn=({onClick:e})=>o.a.createElement(s.a,{className:"modal__close-btn",type:s.c.NONE,onClick:e,tooltip:"Close"},o.a.createElement("span",{className:"dashicons dashicons-no-alt"})),e.Icon=({icon:e})=>e?o.a.createElement(u.a,{icon:e,className:"modal__icon"}):null,e.Header=({children:e})=>o.a.createElement("div",{className:"modal__header"},e),e.Content=({children:e})=>o.a.createElement("div",{className:"modal__scroller"},o.a.createElement("div",{className:"modal__content"},e)),e.Footer=({children:e})=>o.a.createElement("div",{className:"modal__footer"},e)}(m||(m={}))},5:function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return u}));var a,o,r=n(0),i=n.n(r),l=n(11),c=n(226),s=(n(324),n(3));!function(e){e[e.PRIMARY=0]="PRIMARY",e[e.SECONDARY=1]="SECONDARY",e[e.TOGGLE=2]="TOGGLE",e[e.LINK=3]="LINK",e[e.PILL=4]="PILL",e[e.DANGER=5]="DANGER",e[e.DANGER_LINK=6]="DANGER_LINK",e[e.DANGER_PILL=7]="DANGER_PILL",e[e.NONE=8]="NONE"}(a||(a={})),function(e){e[e.SMALL=0]="SMALL",e[e.NORMAL=1]="NORMAL",e[e.LARGE=2]="LARGE",e[e.HERO=3]="HERO"}(o||(o={}));const u=i.a.forwardRef((e,t)=>{let{children:n,className:r,type:u,size:m,active:d,tooltip:p,tooltipPlacement:b,onClick:_,linkTo:g}=e,f=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}(e,["children","className","type","size","active","tooltip","tooltipPlacement","onClick","linkTo"]);u=null!=u?u:a.SECONDARY,m=null!=m?m:o.NORMAL,b=null!=b?b:"bottom";const[h,v]=i.a.useState(!1),E=()=>v(!0),y=()=>v(!1),C=Object(l.b)(r,u!==a.NONE?"button":null,u===a.PRIMARY?"button-primary":null,u===a.SECONDARY?"button-secondary":null,u===a.LINK?"button-secondary button-tertiary":null,u===a.PILL?"button-secondary button-tertiary button-pill":null,u===a.TOGGLE?"button-toggle":null,u===a.TOGGLE&&d?"button-primary button-active":null,u!==a.TOGGLE||d?null:"button-secondary",u===a.DANGER?"button-secondary button-danger":null,u===a.DANGER_LINK?"button-tertiary button-danger":null,u===a.DANGER_PILL?"button-tertiary button-danger button-danger-pill":null,m===o.SMALL?"button-small":null,m===o.LARGE?"button-large":null,m===o.HERO?"button-hero":null),O=e=>{_&&_(e)};let N="button";if("string"==typeof g?(N="a",f.href=g):f.type="button",f.tabIndex=0,!p)return i.a.createElement(N,Object.assign({ref:t,className:C,onClick:O},f),n);const w="string"==typeof p,A="btn-tooltip-"+Object(s.u)(),k=w?p:i.a.createElement(p,{id:A});return i.a.createElement(c.a,{visible:h&&!e.disabled,placement:b,delay:300},({ref:e})=>i.a.createElement(N,Object.assign({ref:t?Object(l.d)(e,t):e,className:C,onClick:O,onMouseEnter:E,onMouseLeave:y},f),n),k)})},55:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(0),o=n.n(a),r=n(11),i=(n(430),n(10)),l=n(20);const c=o.a.forwardRef((function({label:e,className:t,isOpen:n,defaultOpen:a,showIcon:c,disabled:s,stealth:u,fitted:m,scrollIntoView:d,hideOnly:p,onClick:b,children:_},g){p=null!=p&&p,c=null==c||c,s=null!=s&&s,d=null!=d&&d;const[f,h]=o.a.useState(!!a),v=void 0!==n;v||(n=f);const E=o.a.useRef(),y=Object(l.j)(E),C=()=>{s||(!n&&d&&y(),v||h(!n),b&&b())},O=n&&void 0===b&&!c,N=O?void 0:0,w=O?void 0:"button",A=Object(r.a)("spoiler",{"--open":n,"--disabled":s,"--fitted":m,"--stealth":u,"--static":O}),k=Object(r.b)(A,t),S=n?"arrow-up-alt2":"arrow-down-alt2",T=Array.isArray(e)?e.map((e,t)=>o.a.createElement(o.a.Fragment,{key:t},e)):"string"==typeof e?o.a.createElement("span",null,e):e;return o.a.createElement("div",{ref:Object(r.d)(E,g),className:k},o.a.createElement("div",{className:"spoiler__header",onClick:C,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||C()},role:w,tabIndex:N},o.a.createElement("div",{className:"spoiler__label"},T),c&&o.a.createElement(i.a,{icon:S,className:"spoiler__icon"})),(n||p)&&o.a.createElement("div",{className:"spoiler__content"},_))}))},56:function(e,t,n){"use strict";n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return d}));var a=n(0),o=n.n(a),r=n(368),i=n(227),l=n(367),c=n(183),s=n.n(c),u=n(11);const m=(e={})=>({option:(e,t)=>Object.assign(Object.assign({},e),{cursor:"pointer",lineHeight:"24px"}),menu:(e,t)=>Object.assign(Object.assign({},e),{margin:"6px 0",boxShadow:"0 2px 8px "+s.a.shadowColor,overflow:"hidden"}),menuList:(e,t)=>({padding:"0px"}),control:(e,t)=>{let n=Object.assign(Object.assign({},e),{cursor:"pointer",lineHeight:"2",minHeight:"40px"});return t.isFocused&&(n.borderColor=s.a.primaryColor,n.boxShadow="0 0 0 1px "+s.a.primaryColor),n},valueContainer:(e,t)=>Object.assign(Object.assign({},e),{paddingTop:0,paddingBottom:0,paddingRight:0}),container:(t,n)=>Object.assign(Object.assign({},t),{width:e.width||"100%"}),multiValue:(e,t)=>Object.assign(Object.assign({},e),{padding:"0 6px"}),input:(e,t)=>Object.assign(Object.assign({},e),{outline:"0 transparent !important",border:"0 transparent !important",boxShadow:"0 0 0 transparent !important"}),indicatorSeparator:(e,t)=>Object.assign(Object.assign({},e),{margin:"0",backgroundColor:"transparent"})}),d=o.a.forwardRef((e,t)=>{var n;const a=(null!==(n=e.options)&&void 0!==n?n:[]).find(t=>t.value===e.value);e=Object.assign(Object.assign({},e),{id:void 0,className:Object(u.b)("react-select",e.className),classNamePrefix:"react-select",inputId:e.id,menuPosition:"fixed"});const c=m(e),d=e.isCreatable?i.a:e.async?l.a:r.a;return o.a.createElement(d,Object.assign({},e,{ref:t,isSearchable:e.isCreatable,value:a,styles:c,theme:e=>Object.assign(Object.assign({},e),{borderRadius:3,colors:Object.assign(Object.assign({},e.colors),{primary:s.a.primaryColor,primary25:s.a.washedColor})}),menuPlacement:"auto",menuShouldScrollIntoView:!0}))})},598:function(e,t,n){},600:function(e,t,n){},601:function(e,t,n){},65:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),o=n.n(a),r=n(247),i=n.n(r),l=n(46),c=n(5);function s({children:e,title:t,buttons:n,onAccept:a,onCancel:r,isOpen:s,okDisabled:u,cancelDisabled:m}){n=null!=n?n:["OK","Cancel"];const d=()=>r&&r();return o.a.createElement(l.a,{isOpen:s,title:t,onClose:d,className:i.a.root},o.a.createElement(l.a.Content,null,"string"==typeof e?o.a.createElement("p",null,e):e),o.a.createElement(l.a.Footer,null,o.a.createElement(c.a,{className:i.a.button,type:c.c.SECONDARY,onClick:d,disabled:m},n[1]),o.a.createElement(c.a,{className:i.a.button,type:c.c.PRIMARY,onClick:()=>a&&a(),disabled:u},n[0])))}},66:function(e,t,n){"use strict";n.d(t,"a",(function(){return m})),n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return b})),n.d(t,"d",(function(){return _}));var a=n(0),o=n.n(a),r=n(172),i=n(302),l=n(303),c=n(20),s=n(14),u=(n(432),n(11));const m=({children:e,className:t,refClassName:n,isOpen:a,onBlur:m,placement:p,modifiers:b,useVisibility:_})=>{p=null!=p?p:"bottom-end",_=null!=_&&_;const g=o.a.useRef(),f=a||_,h=!a&&_,v=Object.assign({preventOverflow:{boundariesElement:document.getElementById(s.a.config.rootId),padding:5}},b),E=()=>{m()},y=e=>{switch(e.key){case"ArrowDown":break;case"Escape":E();break;default:return}e.preventDefault(),e.stopPropagation()};return Object(c.b)(g,E,[g]),Object(c.c)([g],E),o.a.createElement("div",{ref:g,className:Object(u.b)("menu__ref",n)},o.a.createElement(r.c,null,o.a.createElement(i.a,null,t=>e[0](t)),o.a.createElement(l.a,{placement:p,positionFixed:!0,modifiers:v},({ref:n,style:a,placement:r})=>f?o.a.createElement("div",{ref:n,className:"menu",style:d(a,h),"data-placement":r,onKeyDown:y},o.a.createElement("div",{className:"menu__container"+(t?" "+t:"")},e[1])):null)))};function d(e,t){return Object.assign(Object.assign({},e),{opacity:1,pointerEvents:"all",visibility:t?"hidden":"visible"})}const p=({children:e,onClick:t,disabled:n,active:a})=>{const r=Object(u.a)("menu__item",{"--disabled":n,"--active":a});return o.a.createElement("div",{className:r},o.a.createElement("button",{onClick:()=>!a&&!n&&t&&t()},e))},b=({children:e})=>e,_=({children:e})=>o.a.createElement("div",{className:"menu__static"},e)},81:function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var a=n(0),o=n.n(a),r=n(248),i=n.n(r),l=n(375),c=n(20),s=n(13),u=n(172),m=n(302),d=n(303),p=n(11),b=n(14);function _({id:e,value:t,disableAlpha:n,onChange:r}){t=null!=t?t:"#fff";const[_,g]=o.a.useState(t),[f,h]=o.a.useState(!1),v=o.a.useRef(),E=o.a.useRef(),y=o.a.useCallback(()=>h(!1),[]),C=o.a.useCallback(()=>h(e=>!e),[]),O=o.a.useCallback(e=>{g(e.rgb),r&&r(e)},[r]),N=o.a.useCallback(e=>{"Escape"===e.key&&f&&(y(),e.preventDefault(),e.stopPropagation())},[f]);Object(a.useEffect)(()=>g(t),[t]),Object(c.b)(v,y,[E]),Object(c.c)([v,E],y),Object(c.d)("keydown",N,[f]);const w={preventOverflow:{boundariesElement:document.getElementById(b.a.config.rootId),padding:5}};return o.a.createElement(u.c,null,o.a.createElement(m.a,null,({ref:t})=>o.a.createElement("button",{ref:Object(p.d)(v,t),id:e,className:i.a.button,onClick:C},o.a.createElement("span",{className:i.a.colorPreview,style:{backgroundColor:Object(s.a)(_)}}))),o.a.createElement(d.a,{placement:"bottom-end",positionFixed:!0,modifiers:w},({ref:e,style:t})=>f&&o.a.createElement("div",{className:i.a.popper,ref:Object(p.d)(E,e),style:t},o.a.createElement(l.ChromePicker,{color:_,onChange:O,disableAlpha:n}))))}},83:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),o=n.n(a),r=n(371),i=n.n(r),l=n(14),c=n(11);const s=({className:e,children:t})=>{const n=o.a.useCallback(()=>{window.open(l.a.resources.upgradeLocalUrl,"_blank")},[]);return o.a.createElement("span",{className:Object(c.b)(i.a.pill,e),onClick:n,tabIndex:-1},"PRO",t)}},88:function(e,t,n){e.exports={list:"AutoPromotionsList__list","fake-pro-list":"AutoPromotionsList__fake-pro-list AutoPromotionsList__list",fakeProList:"AutoPromotionsList__fake-pro-list AutoPromotionsList__list",row:"AutoPromotionsList__row","row-selected":"AutoPromotionsList__row-selected AutoPromotionsList__row",rowSelected:"AutoPromotionsList__row-selected AutoPromotionsList__row","row-box":"AutoPromotionsList__row-box theme__panel",rowBox:"AutoPromotionsList__row-box theme__panel","row-hashtags":"AutoPromotionsList__row-hashtags",rowHashtags:"AutoPromotionsList__row-hashtags","row-summary":"AutoPromotionsList__row-summary",rowSummary:"AutoPromotionsList__row-summary","row-drag-handle":"AutoPromotionsList__row-drag-handle",rowDragHandle:"AutoPromotionsList__row-drag-handle","row-actions":"AutoPromotionsList__row-actions",rowActions:"AutoPromotionsList__row-actions","add-button-row":"AutoPromotionsList__add-button-row",addButtonRow:"AutoPromotionsList__add-button-row","no-hashtags-message":"AutoPromotionsList__no-hashtags-message",noHashtagsMessage:"AutoPromotionsList__no-hashtags-message","row-faded-text":"AutoPromotionsList__row-faded-text",rowFadedText:"AutoPromotionsList__row-faded-text","no-promo-message":"AutoPromotionsList__no-promo-message AutoPromotionsList__row-faded-text",noPromoMessage:"AutoPromotionsList__no-promo-message AutoPromotionsList__row-faded-text","summary-italics":"AutoPromotionsList__summary-italics",summaryItalics:"AutoPromotionsList__summary-italics","summary-bold":"AutoPromotionsList__summary-bold",summaryBold:"AutoPromotionsList__summary-bold"}},90:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),o=n.n(a),r=n(155),i=n.n(r),l=n(10),c=n(148);function s({content:e,sidebar:t,primary:n,current:r,useDefaults:l}){const[u,m]=Object(a.useState)(n),d=()=>m(b?"content":"sidebar"),p=()=>m(b?"sidebar":"content"),b="content"===(n=null!=n?n:"content"),_="sidebar"===n,g="content"===(r=l?u:r),f="sidebar"===r,h=b?i.a.layoutPrimaryContent:i.a.layoutPrimarySidebar;return o.a.createElement(c.a,{breakpoints:[s.BREAKPOINT]},n=>{const a=n<=s.BREAKPOINT;return o.a.createElement("div",{className:h},e&&(g||!a)&&o.a.createElement("div",{className:i.a.content},l&&o.a.createElement(s.Navigation,{align:b?"right":"left",text:!b&&o.a.createElement("span",null,"Go back"),icon:b?"admin-generic":"arrow-left",onClick:b?p:d}),"function"==typeof e?e(a):null!=e?e:null),t&&(f||!a)&&o.a.createElement("div",{className:i.a.sidebar},l&&o.a.createElement(s.Navigation,{align:_?"right":"left",text:!_&&o.a.createElement("span",null,"Go back"),icon:_?"admin-generic":"arrow-left",onClick:_?p:d}),"function"==typeof t?t(a):null!=t?t:null))})}!function(e){e.BREAKPOINT=968,e.Navigation=function({icon:e,text:t,align:n,onClick:a}){return t=null!=t?t:"Go back",e=null!=e?e:"arrow-left-alt",n=null!=n?n:"left",o.a.createElement("div",{className:"right"===n?i.a.navigationRight:i.a.navigationLeft},o.a.createElement("a",{className:i.a.navLink,onClick:a},e&&o.a.createElement(l.a,{icon:e}),o.a.createElement("span",null,null!=t?t:"")))}}(s||(s={}))},92:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),o=n.n(a),r=n(11),i=n(5),l=(n(431),n(10)),c=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n};function s(e){var{className:t,children:n,isTransitioning:a}=e,i=c(e,["className","children","isTransitioning"]);const l=Object(r.a)("onboarding",{"--transitioning":a});return o.a.createElement("div",Object.assign({className:Object(r.b)(l,t)},i),Array.isArray(n)?n.map((e,t)=>o.a.createElement("div",{key:t},e)):n)}!function(e){e.TRANSITION_DURATION=200,e.Thin=e=>{var{className:t,children:n}=e,a=c(e,["className","children"]);return o.a.createElement("div",Object.assign({className:Object(r.b)("onboarding__thin",t)},a),n)},e.HelpMsg=e=>{var{className:t,children:n}=e,a=c(e,["className","children"]);return o.a.createElement("div",Object.assign({className:Object(r.b)("onboarding__help-msg",t)},a),n)},e.ProTip=({children:t})=>o.a.createElement(e.HelpMsg,null,o.a.createElement("div",{className:"onboarding__pro-tip"},o.a.createElement("span",null,o.a.createElement(l.a,{icon:"lightbulb"}),o.a.createElement("strong",null,"Pro tip!")),t)),e.StepList=e=>{var{className:t,children:n}=e,a=c(e,["className","children"]);return o.a.createElement("ul",Object.assign({className:Object(r.b)("onboarding__steps",t)},a),n)},e.Step=e=>{var{isDone:t,num:n,className:a,children:i}=e,l=c(e,["isDone","num","className","children"]);return o.a.createElement("li",Object.assign({className:Object(r.b)(t?"onboarding__done":null,a)},l),o.a.createElement("strong",null,"Step ",n,":")," ",i)},e.HeroButton=e=>{var t,{className:n,children:a}=e,l=c(e,["className","children"]);return o.a.createElement(i.a,Object.assign({type:null!==(t=l.type)&&void 0!==t?t:i.c.PRIMARY,size:i.b.HERO,className:Object(r.b)("onboarding__hero-button",n)},l),a)}}(s||(s={}))},94:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n(0),o=n.n(a),r=n(184),i=n.n(r);function l({children:e,padded:t,disabled:n}){return o.a.createElement("div",{className:n?i.a.disabled:i.a.sidebar},o.a.createElement("div",{className:t?i.a.paddedContent:i.a.content},null!=e?e:null))}!function(e){e.padded=i.a.padded}(l||(l={}))},95:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var a,o=n(1),r=n(3);!function(e){const t=o.n.array([]);e.DEFAULT_TTL=5e3,e.getAll=()=>t,e.add=Object(o.f)((e,n,a)=>{t.push({key:e+Object(r.u)(),component:n,ttl:a})}),e.remove=Object(o.f)(e=>{const n=t.findIndex(t=>t.key===e);n>-1&&t.splice(n,1)})}(a||(a={}))}}]);
1
+ (window.webpackJsonpspotlight=window.webpackJsonpspotlight||[]).push([[2],{102:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var a=n(0),o=n.n(a),r=n(367),l=n.n(r),i=n(5),c=n(10),s=n(249),u=n(46);function m({isOpen:e,onClose:t,onConnect:n,beforeConnect:a}){return o.a.createElement(u.a,{title:"Connect an Instagram account",isOpen:e,width:650,onClose:t},o.a.createElement(u.a.Content,null,o.a.createElement(s.a,{onConnect:n,beforeConnect:e=>{a&&a(e),t()}})))}function d({children:e,onConnect:t,beforeConnect:n}){const[a,r]=o.a.useState(!1);return o.a.createElement(o.a.Fragment,null,o.a.createElement(i.a,{className:l.a.root,size:i.b.HERO,type:i.c.SECONDARY,onClick:()=>r(!0)},o.a.createElement(c.a,{icon:"instagram"}),null!=e?e:o.a.createElement("span",null,"Connect more Instagram accounts")),o.a.createElement(m,{isOpen:a,onClose:()=>{r(!1)},onConnect:t,beforeConnect:n}))}},106:function(e,t,n){"use strict";t.a=wp},114:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(0),o=n.n(a),r=n(11),l=n(135),i=n.n(l);function c({cols:e,rows:t,footerCols:n,styleMap:a}){return a=null!=a?a:{cols:{},cells:{}},o.a.createElement("table",{className:i.a.table},o.a.createElement("thead",{className:i.a.header},o.a.createElement(u,{cols:e,styleMap:a})),o.a.createElement("tbody",null,t.map((t,n)=>o.a.createElement(s,{key:n,idx:n,row:t,cols:e,styleMap:a}))),n&&o.a.createElement("tfoot",{className:i.a.footer},o.a.createElement(u,{cols:e,styleMap:a})))}function s({idx:e,row:t,cols:n,styleMap:a}){return o.a.createElement("tr",{className:i.a.row},n.map(n=>o.a.createElement("td",{key:n.id,className:Object(r.b)(i.a.cell,m(n),a.cells[n.id])},n.render(t,e))))}function u({cols:e,styleMap:t}){return o.a.createElement("tr",null,e.map(e=>{const n=Object(r.b)(i.a.colHeading,m(e),t.cols[e.id]);return o.a.createElement("th",{key:e.id,className:n},e.label)}))}function m(e){return"center"===e.align?i.a.alignCenter:"right"===e.align?i.a.alignRight:i.a.alignLeft}},115:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(0),o=n.n(a),r=n(106),l=n(3);const i=({id:e,value:t,title:n,button:a,mediaType:i,multiple:c,children:s,onOpen:u,onClose:m,onSelect:d})=>{e=null!=e?e:"wp-media-"+Object(l.u)(),i=null!=i?i:"image",a=null!=a?a:"Select";const p=o.a.useRef();p.current||(p.current=r.a.media({id:e,title:n,library:{type:i},button:{text:a},multiple:c}));const b=()=>{const e=p.current.state().get("selection").first();d&&d(e)};return m&&p.current.on("close",m),p.current.on("open",()=>{if(t){const e="object"==typeof t?t:r.a.media.attachment(t);e.fetch(),p.current.state().get("selection").add(e?[e]:[])}u&&u()}),p.current.on("insert",b),p.current.on("select",b),s({open:()=>p.current.open()})}},117:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),o=n.n(a),r=n(213),l=n.n(r),i=n(10),c=n(230);function s({maxWidth:e,children:t}){e=null!=e?e:300;const[n,a]=o.a.useState(!1),r=()=>a(!0),s=()=>a(!1),u={content:l.a.tooltipContent,container:l.a.tooltipContainer};return o.a.createElement("div",{className:l.a.root},o.a.createElement(c.a,{visible:n,theme:u},({ref:e})=>o.a.createElement("span",{ref:e,className:l.a.icon,style:{opacity:n?1:.7},onMouseEnter:r,onMouseLeave:s},o.a.createElement(i.a,{icon:"info"})),o.a.createElement("div",{style:{maxWidth:e+"px"}},t)))}},118:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(294),o=n.n(a),r=n(0),l=n.n(r),i=n(5),c=n(11);function s({className:e,content:t,tooltip:n,onClick:a,disabled:r,isSaving:s}){return t=null!=t?t:e=>e?"Saving ...":"Save",n=null!=n?n:"Save",l.a.createElement(i.a,{className:Object(c.b)(o.a.root,e),type:i.c.PRIMARY,size:i.b.LARGE,tooltip:n,onClick:()=>a&&a(),disabled:r},s&&l.a.createElement("div",{className:o.a.savingOverlay}),t(s))}},119:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var a=n(0),o=n.n(a),r=n(137),l=n.n(r),i=n(41),c=n(11),s=n(84),u=n(157);function m({children:e}){return o.a.createElement("div",{className:l.a.root},o.a.createElement(m.Item,null,o.a.createElement(u.a,null)),o.a.createElement(m.Chevron,null),o.a.createElement("div",{className:l.a.leftContainer},e[0]),e[1]&&o.a.createElement("div",{className:l.a.rightContainer},e[1]))}!function(e){e.Item=({children:e})=>o.a.createElement("div",{className:l.a.item},e),e.Link=({linkTo:t,onClick:n,isCurrent:a,isDisabled:r,children:s})=>{const u=Object(c.c)({[l.a.link]:!0,[l.a.current]:a,[l.a.disabled]:r}),m=e=>{"Enter"!==e.key&&" "!==e.key||e.currentTarget.click()},d=r?-1:0;return o.a.createElement(e.Item,null,t?o.a.createElement(i.a,{to:t,className:u,role:"button",onKeyPress:m,tabIndex:d},s):o.a.createElement("div",{className:u,role:"button",onClick:()=>!r&&n&&n(),onKeyPress:m,tabIndex:d},s))},e.ProPill=()=>o.a.createElement("div",{className:l.a.proPill},o.a.createElement(s.a,null)),e.Chevron=()=>o.a.createElement("div",{className:l.a.chevron},o.a.createElement("svg",{viewBox:"0 0 100 100",width:"100%",height:"100%",preserveAspectRatio:"none"},o.a.createElement("path",{d:"M0 0 L100 50 L0 100",fill:"none",stroke:"currentcolor",strokeLinejoin:"bevel"})))}(m||(m={}))},120:function(e,t,n){e.exports={root:"ConnectAccount__root","prompt-msg":"ConnectAccount__prompt-msg",promptMsg:"ConnectAccount__prompt-msg",types:"ConnectAccount__types",type:"ConnectAccount__type","types-rows":"ConnectAccount__types-rows ConnectAccount__types",typesRows:"ConnectAccount__types-rows ConnectAccount__types","types-columns":"ConnectAccount__types-columns ConnectAccount__types",typesColumns:"ConnectAccount__types-columns ConnectAccount__types",capabilities:"ConnectAccount__capabilities",capability:"ConnectAccount__capability","business-learn-more":"ConnectAccount__business-learn-more",businessLearnMore:"ConnectAccount__business-learn-more","connect-access-token":"ConnectAccount__connect-access-token",connectAccessToken:"ConnectAccount__connect-access-token"}},121:function(e,t,n){e.exports={modal:"Modal__modal layout__z-higher",shade:"Modal__shade layout__fill-parent",container:"Modal__container",opening:"Modal__opening","modal-open-animation":"Modal__modal-open-animation",modalOpenAnimation:"Modal__modal-open-animation",closing:"Modal__closing","modal-close-animation":"Modal__modal-close-animation",modalCloseAnimation:"Modal__modal-close-animation",content:"Modal__content",header:"Modal__header",icon:"Modal__icon","close-btn":"Modal__close-btn",closeBtn:"Modal__close-btn",scroller:"Modal__scroller",footer:"Modal__footer"}},122:function(e,t,n){e.exports={root:"ConnectAccessToken__root",row:"ConnectAccessToken__row ConnectAccessToken__root",content:"ConnectAccessToken__content",label:"ConnectAccessToken__label",bottom:"ConnectAccessToken__bottom","button-container":"ConnectAccessToken__button-container",buttonContainer:"ConnectAccessToken__button-container",button:"ConnectAccessToken__button","help-message":"ConnectAccessToken__help-message",helpMessage:"ConnectAccessToken__help-message",column:"ConnectAccessToken__column ConnectAccessToken__root"}},123:function(e,t,n){e.exports={content:"GlobalPromotionsTab__content","mobile-instructions":"GlobalPromotionsTab__mobile-instructions",mobileInstructions:"GlobalPromotionsTab__mobile-instructions",tutorial:"GlobalPromotionsTab__tutorial","tutorial-box":"GlobalPromotionsTab__tutorial-box",tutorialBox:"GlobalPromotionsTab__tutorial-box","tutorial-text":"GlobalPromotionsTab__tutorial-text",tutorialText:"GlobalPromotionsTab__tutorial-text","account-list":"GlobalPromotionsTab__account-list",accountList:"GlobalPromotionsTab__account-list","account-scroller":"GlobalPromotionsTab__account-scroller",accountScroller:"GlobalPromotionsTab__account-scroller","account-button":"GlobalPromotionsTab__account-button",accountButton:"GlobalPromotionsTab__account-button","account-selected":"GlobalPromotionsTab__account-selected GlobalPromotionsTab__account-button",accountSelected:"GlobalPromotionsTab__account-selected GlobalPromotionsTab__account-button","profile-pic":"GlobalPromotionsTab__profile-pic",profilePic:"GlobalPromotionsTab__profile-pic",username:"GlobalPromotionsTab__username","fake-pro":"GlobalPromotionsTab__fake-pro",fakePro:"GlobalPromotionsTab__fake-pro"}},127:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(0),o=n.n(a),r=n(128),l=n(48);const i=e=>{var t;const n="string"==typeof e.value?[e.value]:null!==(t=e.value)&&void 0!==t?t:[],a=Object.assign(Object.assign({},e),{value:n.map(e=>Object(l.a)(e,"#")),sanitize:l.b});return o.a.createElement(r.a,Object.assign({},a))}},128:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var a=n(0),o=n.n(a),r=n(231),l=n(23),i=n(57);const c={DropdownIndicator:null},s=e=>({label:e,value:e}),u=({id:e,value:t,onChange:n,sanitize:u,autoFocus:m,message:d})=>{const[p,b]=o.a.useState(""),[_,g]=o.a.useState(-1),[f,h]=o.a.useState();Object(a.useEffect)(()=>{h(d)},[d]);const v=(t=Array.isArray(t)?t:[]).map(e=>s(e)),E=()=>{p.length&&(b(""),y([...v,s(p)]))},y=e=>{if(!n)return;let t=-1;e=e?e.map(e=>e&&u?u(e.value):e.value).filter((e,n,a)=>{const o=a.indexOf(e);return o!==n?(t=o,!1):!!e}):[],g(t),-1===t&&n(e)},O=Object(i.b)();return o.a.createElement(o.a.Fragment,null,o.a.createElement(r.a,{inputId:e,className:"react-select",classNamePrefix:"react-select",components:c,inputValue:p,isClearable:!1,isMulti:!0,menuIsOpen:!1,onChange:y,onInputChange:e=>{b(e)},onKeyDown:e=>{if(p)switch(e.key){case",":case"Enter":case"Tab":E(),e.preventDefault()}},onBlur:E,placeholder:"Type something and press enter...",value:v,autoFocus:m,styles:O}),_<0||0===v.length?null:o.a.createElement(l.a,{type:l.b.WARNING,shake:!0,showIcon:!0,isDismissible:!0},o.a.createElement("code",null,v[_].label)," is already in the list"),f?o.a.createElement(l.a,{type:l.b.WARNING,shake:!0,showIcon:!0,isDismissible:!0},f):null)};var m=n(6);const d=Object(m.b)(e=>{const[t,n]=o.a.useState("");e.exclude&&0===e.exclude.length&&t.length>0&&n("");let a=void 0;if(t.length>0){const n="%s",r=e.excludeMsg.indexOf("%s"),l=e.excludeMsg.substring(0,r),i=e.excludeMsg.substring(r+n.length);a=o.a.createElement(o.a.Fragment,null,l,o.a.createElement("code",null,t),i)}const r=Object.assign(Object.assign({},e),{message:a,onChange:t=>{const a=e.exclude?t.findIndex(t=>e.exclude.includes(t)):-1;a>-1?n(t[a]):e.onChange(t)}});return o.a.createElement(u,Object.assign({},r))})},135:function(e,t,n){e.exports={table:"Table__table theme__subtle-drop-shadow theme__slightly-rounded",header:"Table__header",footer:"Table__footer",cell:"Table__cell","col-heading":"Table__col-heading Table__cell",colHeading:"Table__col-heading Table__cell",row:"Table__row","align-left":"Table__align-left",alignLeft:"Table__align-left","align-right":"Table__align-right",alignRight:"Table__align-right","align-center":"Table__align-center",alignCenter:"Table__align-center"}},137:function(e,t,n){e.exports={root:"Navbar__root layout__flex-row",container:"Navbar__container layout__flex-row","left-container":"Navbar__left-container Navbar__container layout__flex-row",leftContainer:"Navbar__left-container Navbar__container layout__flex-row","right-container":"Navbar__right-container Navbar__container layout__flex-row",rightContainer:"Navbar__right-container Navbar__container layout__flex-row",child:"Navbar__child",item:"Navbar__item Navbar__child",disabled:"Navbar__disabled",chevron:"Navbar__chevron Navbar__child",link:"Navbar__link","pro-pill":"Navbar__pro-pill",proPill:"Navbar__pro-pill",current:"Navbar__current","button-container":"Navbar__button-container layout__flex-row",buttonContainer:"Navbar__button-container layout__flex-row"}},142:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(0),o=n.n(a);function r(e){return o.a.createElement("p",null,e.message)}},148:function(e,t,n){e.exports={root:"UnitField__root layout__flex-row",input:"UnitField__input","unit-container":"UnitField__unit-container layout__flex-column",unitContainer:"UnitField__unit-container layout__flex-column","unit-bubble":"UnitField__unit-bubble",unitBubble:"UnitField__unit-bubble","unit-static":"UnitField__unit-static UnitField__unit-bubble layout__flex-column",unitStatic:"UnitField__unit-static UnitField__unit-bubble layout__flex-column","unit-selector":"UnitField__unit-selector UnitField__unit-bubble layout__flex-row",unitSelector:"UnitField__unit-selector UnitField__unit-bubble layout__flex-row","current-unit":"UnitField__current-unit",currentUnit:"UnitField__current-unit","menu-chevron":"UnitField__menu-chevron",menuChevron:"UnitField__menu-chevron","menu-chevron-open":"UnitField__menu-chevron-open UnitField__menu-chevron",menuChevronOpen:"UnitField__menu-chevron-open UnitField__menu-chevron","unit-list":"UnitField__unit-list layout__flex-column layout__z-highest",unitList:"UnitField__unit-list layout__flex-column layout__z-highest","unit-option":"UnitField__unit-option",unitOption:"UnitField__unit-option","unit-selected":"UnitField__unit-selected UnitField__unit-option",unitSelected:"UnitField__unit-selected UnitField__unit-option"}},157:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),o=n.n(a),r=n(301),l=n.n(r),i=n(12),c=n(11);function s(){return o.a.createElement("div",{className:l.a.logo},o.a.createElement("img",Object.assign({className:l.a.logoImage,src:i.a.image("spotlight-favicon.png"),alt:"Spotlight"},c.e)))}},159:function(e,t,n){e.exports={layout:"SidebarLayout__layout","layout-primary-content":"SidebarLayout__layout-primary-content SidebarLayout__layout",layoutPrimaryContent:"SidebarLayout__layout-primary-content SidebarLayout__layout","layout-primary-sidebar":"SidebarLayout__layout-primary-sidebar SidebarLayout__layout",layoutPrimarySidebar:"SidebarLayout__layout-primary-sidebar SidebarLayout__layout",container:"SidebarLayout__container",content:"SidebarLayout__content SidebarLayout__container",sidebar:"SidebarLayout__sidebar SidebarLayout__container",navigation:"SidebarLayout__navigation","navigation-left":"SidebarLayout__navigation-left SidebarLayout__navigation",navigationLeft:"SidebarLayout__navigation-left SidebarLayout__navigation","navigation-right":"SidebarLayout__navigation-right SidebarLayout__navigation",navigationRight:"SidebarLayout__navigation-right SidebarLayout__navigation","nav-link":"SidebarLayout__nav-link",navLink:"SidebarLayout__nav-link"}},16:function(e,t,n){"use strict";n(421);var a=n(17),o=n(0),r=n.n(o),l=n(18),i=n(153),c=n(6),s=n(57),u=n(148),m=n.n(u),d=n(68),p=n(10);function b(e){var{type:t,unit:n,units:a,value:o,onChange:l}=e,i=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}(e,["type","unit","units","value","onChange"]);const[c,s]=r.a.useState(!1),u=Array.isArray(a)&&a.length,b=()=>s(e=>!e),_=e=>{switch(e.key){case" ":case"Enter":b();break;default:return}e.preventDefault(),e.stopPropagation()};return(null==o||isNaN(o))&&(o=""),r.a.createElement("div",{className:m.a.root},r.a.createElement("input",Object.assign({},i,{className:m.a.input,type:null!=t?t:"text",value:o,onChange:e=>l&&l(e.currentTarget.value,n)})),r.a.createElement("div",{className:m.a.unitContainer},u&&r.a.createElement(d.a,{isOpen:c,onBlur:()=>s(!1)},({ref:e})=>r.a.createElement("div",{ref:e,className:m.a.unitSelector,role:"button",onClick:b,onKeyDown:_,tabIndex:0},r.a.createElement("span",{className:m.a.currentUnit},n),r.a.createElement(p.a,{icon:"arrow-down-alt2",className:c?m.a.menuChevronOpen:m.a.menuChevron})),a.map(e=>r.a.createElement(d.c,{key:e,onClick:()=>(l&&l(o,e),void s(!1))},e))),!u&&r.a.createElement("div",{className:m.a.unitStatic},r.a.createElement("span",null,n))))}var _=n(56),g=n(291),f=n.n(g),h=n(5),v=[{id:"accounts",title:"Accounts",component:i.a},{id:"config",title:"Configuration",groups:[{id:"importing",title:"Import options",fields:[{id:"importerInterval",label:"Check for new posts",component:Object(c.b)(({id:e})=>r.a.createElement(s.a,{id:e,width:250,value:l.b.values.importerInterval,options:O.config.cronScheduleOptions,onChange:e=>l.b.values.importerInterval=e.value}))}]},{id:"cleaner",title:"Optimization",component:()=>r.a.createElement("div",null,r.a.createElement(_.a,{label:"What is this?",stealth:!0},r.a.createElement("div",null,r.a.createElement("p",null,"Spotlight imports all Instagram posts that can be displayed in your feed, even "," ",'those hidden behind a "Load more" button. The posts furthest down the list may'," ","therefore rarely be seen."),r.a.createElement("p",null,"To improve your site’s performance, you can choose to delete these unseen posts"," ","after a set period of time. Once a site visitor requests those posts, they will"," ","be re-imported.")))),fields:[{id:"cleanerAgeLimit",label:"Delete unseen posts after",component:Object(c.b)(({id:e})=>{const t=l.b.values.cleanerAgeLimit.split(" "),n=parseInt(t[0]),a=t[1];return r.a.createElement(b,{id:e,units:["days","hours","minutes"],value:n,unit:a,type:"number",onChange:(e,t)=>l.b.values.cleanerAgeLimit=e+" "+t})})},{id:"cleanerInterval",label:"Run optimization",component:Object(c.b)(({id:e})=>r.a.createElement(s.a,{id:e,width:250,value:l.b.values.cleanerInterval,options:O.config.cronScheduleOptions,onChange:e=>l.b.values.cleanerInterval=e.value}))}]}]},{id:"tools",title:"Tools",groups:[{id:"cache",title:"Cache",fields:[{id:"clearCache",label:"If you are experiencing issues, clearing the plugin's cache may help.",component:function({}){const[e,t]=r.a.useState(!1),[n,a]=r.a.useState(!1);return r.a.createElement("div",{className:f.a.root},r.a.createElement(h.a,{disabled:e,onClick:()=>{t(!0),O.restApi.clearCache().finally(()=>{a(!0),setTimeout(()=>{a(!1),t(!1)},3e3)})}},n?"Done!":e?"Please wait ...":"Clear the cache"),r.a.createElement("a",{href:O.resources.cacheDocsUrl,target:"_blank",className:f.a.docLink},"What's this?"))}}]}]}],E=n(97);a.a.driver.interceptors.request.use(e=>(e.headers["X-WP-Nonce"]=SliAdminCommonL10n.restApi.wpNonce,e),e=>Promise.reject(e));const y={config:{rootId:"spotlight-instagram-admin",adminUrl:SliAdminCommonL10n.adminUrl,restApi:SliAdminCommonL10n.restApi,doOnboarding:"1"==SliAdminCommonL10n.doOnboarding,cronSchedules:SliAdminCommonL10n.cronSchedules,cronScheduleOptions:SliAdminCommonL10n.cronSchedules.map(e=>({value:e.key,label:e.display})),postTypes:SliAdminCommonL10n.postTypes,hasElementor:SliAdminCommonL10n.hasElementor},resources:{upgradeUrl:"https://spotlightwp.com/pricing/",upgradeLocalUrl:SliAdminCommonL10n.adminUrl+"admin.php?page=spotlight-instagram-pricing",pricingUrl:"https://spotlightwp.com/pricing/",trialLocalUrl:SliAdminCommonL10n.adminUrl+"admin.php?page=spotlight-instagram-pricing&billing_cycle=annual&trial=true",proComingSoonUrl:"https://spotlightwp.com/pro-coming-soon/",supportUrl:"https://spotlightwp.com/support/",customPersonalInfoUrl:"https://docs.spotlightwp.com/article/624-custom-profile-photo-and-bio-text",businessAccounts:"https://docs.spotlightwp.com/article/555-how-to-switch-to-a-business-account",cacheDocsUrl:"https://docs.spotlightwp.com/article/639-cache",promoTypesSurvey:"https://spotlightwp.com/survey-promote/",accessTokenDocUrl:""},editor:{config:Object.assign({},E.a)},restApi:{config:SliAdminCommonL10n.restApi,saveFeed:e=>a.a.driver.post("/feeds"+(e.id?"/"+e.id:""),{feed:e}),deleteFeed:e=>a.a.driver.delete("/feeds/"+e),connectPersonal:e=>a.a.driver.post("/connect",{accessToken:e}),connectBusiness:(e,t)=>a.a.driver.post("/connect",{accessToken:e,userId:t}),updateAccount:e=>a.a.driver.post("/accounts",e),deleteAccount:e=>a.a.driver.delete("/accounts/"+e),deleteAccountMedia:e=>a.a.driver.delete("/account_media/"+e),searchPosts:(e,t)=>a.a.driver.get(`/search_posts?search=${e}&type=${t}`),getSettings:()=>a.a.driver.get("/settings"),saveSettings:e=>a.a.driver.patch("/settings",{settings:e}),getNotifications:()=>a.a.driver.get("/notifications"),clearCache:()=>a.a.driver.post("/clear_cache")},settings:{pages:v,showGame:!0}};var O=t.a=y;a.a.config.forceImports=!0},18:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(1),o=n(16),r=n(3),l=n(17),i=n(12);let c;t.b=c=Object(a.n)({values:{},original:{},isDirty:!1,isSaving:!1,update(e){Object(r.b)(c.values,e)},save(){if(!c.isDirty)return;c.isSaving=!0;const e={importerInterval:c.values.importerInterval,cleanerAgeLimit:c.values.cleanerAgeLimit,cleanerInterval:c.values.cleanerInterval,hashtagWhitelist:c.values.hashtagWhitelist,hashtagBlacklist:c.values.hashtagBlacklist,captionWhitelist:c.values.captionWhitelist,captionBlacklist:c.values.captionBlacklist,autoPromotions:c.values.autoPromotions,promotions:c.values.promotions};return o.a.restApi.saveSettings(e).then(e=>{c.fromResponse(e),document.dispatchEvent(new u(s))}).finally(()=>c.isSaving=!1)},load:()=>o.a.restApi.getSettings().then(e=>c.fromResponse(e)).catch(e=>{throw l.a.getErrorReason(e)}),restore(){c.values=Object(r.h)(c.original),c.isDirty=!1},fromResponse(e){var t,n,a,o,r,l,i,s,u;if("object"!=typeof e||void 0===e.data)throw"Spotlight encountered a problem while trying to load your settings. Kindly contact customer support for assistance.";c.original={importerInterval:null!==(t=e.data.importerInterval)&&void 0!==t?t:"",cleanerAgeLimit:null!==(n=e.data.cleanerAgeLimit)&&void 0!==n?n:"",cleanerInterval:null!==(a=e.data.cleanerInterval)&&void 0!==a?a:"",hashtagWhitelist:null!==(o=e.data.hashtagWhitelist)&&void 0!==o?o:[],hashtagBlacklist:null!==(r=e.data.hashtagBlacklist)&&void 0!==r?r:[],captionWhitelist:null!==(l=e.data.captionWhitelist)&&void 0!==l?l:[],captionBlacklist:null!==(i=e.data.captionBlacklist)&&void 0!==i?i:[],autoPromotions:null!==(s=e.data.autoPromotions)&&void 0!==s?s:[],promotions:null!==(u=e.data.promotions)&&void 0!==u?u:{}},Array.isArray(c.original.promotions)&&0===c.original.promotions.length&&(c.original.promotions={}),c.restore()}},{values:a.n,update:a.f,save:a.f,load:a.f,restore:a.f}),Object(a.g)(()=>{c.isDirty=!Object(r.p)(c.original,c.values),i.a.config.globalPromotions=c.values.promotions,i.a.config.autoPromotions=c.values.autoPromotions});const s="sli/settings/saved";class u extends CustomEvent{constructor(e,t={}){super(e,t)}}},180:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(0),o=n.n(a),r=n(370),l=n.n(r);function i({message:e}){return o.a.createElement("pre",{className:l.a.content},e)}},187:function(e,t,n){e.exports={message:"Message__message",shaking:"Message__shaking","shake-animation":"Message__shake-animation",shakeAnimation:"Message__shake-animation",icon:"Message__icon",content:"Message__content","dismiss-btn":"Message__dismiss-btn",dismissBtn:"Message__dismiss-btn",success:"Message__success Message__message",info:"Message__info Message__message",warning:"Message__warning Message__message","pro-tip":"Message__pro-tip Message__message",proTip:"Message__pro-tip Message__message",error:"Message__error Message__message"}},188:function(e,t,n){e.exports={primaryColor:"#007cba",secondaryColor:"#d04186",tertiaryColor:"#d82442",lightColor:"#f5f5f5",lightColor2:"#e6e7e8",lightColor3:"#e1e2e3",shadowColor:"rgba(20,25,60,.32)",washedColor:"#eaf0f4"}},189:function(e,t,n){e.exports={content:"Sidebar__content",sidebar:"Sidebar__sidebar",padded:"Sidebar__padded","padded-content":"Sidebar__padded-content Sidebar__content Sidebar__padded",paddedContent:"Sidebar__padded-content Sidebar__content Sidebar__padded",disabled:"Sidebar__disabled Sidebar__sidebar"}},192:function(e,t,n){e.exports={root:"Toast__root","fade-in-animation":"Toast__fade-in-animation",fadeInAnimation:"Toast__fade-in-animation","root-fading-out":"Toast__root-fading-out Toast__root",rootFadingOut:"Toast__root-fading-out Toast__root","fade-out-animation":"Toast__fade-out-animation",fadeOutAnimation:"Toast__fade-out-animation",content:"Toast__content","dismiss-icon":"Toast__dismiss-icon",dismissIcon:"Toast__dismiss-icon","dismiss-btn":"Toast__dismiss-btn Toast__dismiss-icon",dismissBtn:"Toast__dismiss-btn Toast__dismiss-icon"}},193:function(e,t,n){e.exports={content:"AutomatePromotionsTab__content","content-heading":"AutomatePromotionsTab__content-heading",contentHeading:"AutomatePromotionsTab__content-heading",tutorial:"AutomatePromotionsTab__tutorial","tutorial-box":"AutomatePromotionsTab__tutorial-box",tutorialBox:"AutomatePromotionsTab__tutorial-box","tutorial-text":"AutomatePromotionsTab__tutorial-text",tutorialText:"AutomatePromotionsTab__tutorial-text","tutorial-video":"AutomatePromotionsTab__tutorial-video",tutorialVideo:"AutomatePromotionsTab__tutorial-video","mobile-instructions":"AutomatePromotionsTab__mobile-instructions",mobileInstructions:"AutomatePromotionsTab__mobile-instructions"}},210:function(e,t,n){"use strict";n.d(t,"b",(function(){return g})),n.d(t,"a",(function(){return f}));var a=n(0),o=n.n(a),r=n(20),l=n(7),i=n(2),c=n(26),s=n(172),u=n(3),m=n(393),d=n(286),p=n(155),b=n(97),_=c.a.SavedFeed;const g="You have unsaved changes. If you leave now, your changes will be lost.";function f({feed:e,config:t,requireName:n,confirmOnCancel:a,firstTab:c,useCtrlS:f,onChange:h,onSave:v,onCancel:E,onRename:y,onChangeTab:O,onDirtyChange:C}){const N=Object(u.v)(b.a,null!=t?t:{});c=null!=c?c:N.tabs[0].id;const w=Object(s.b)(),[A,k]=Object(r.h)(null),[S,T]=Object(r.h)(e.name),[P,j]=o.a.useState(w.showFakeOptions),[L,x]=o.a.useState(c),[I,R]=o.a.useState(i.a.Mode.DESKTOP),[M,F]=Object(r.h)(!1),[D,B]=Object(r.h)(!1),[U,G]=o.a.useState(!1),H=e=>{F(e),C&&C(e)};null===A.current&&(A.current=new l.a.Options(e.options));const Y=o.a.useCallback(e=>{x(e),O&&O(e)},[O]),W=o.a.useCallback(e=>{const t=new l.a.Options(A.current);Object(u.b)(t,e),k(t),H(!0),h&&h(e,t)},[h]),z=o.a.useCallback(e=>{T(e),H(!0),y&&y(e)},[y]),K=o.a.useCallback(t=>{if(M.current)if(n&&void 0===t&&!D.current&&0===S.current.length)B(!0);else{t=null!=t?t:S.current,T(t),B(!1),G(!0);const n=new _({id:e.id,name:t,options:A.current});v&&v(n).finally(()=>{G(!1),H(!1)})}},[e,v]),V=o.a.useCallback(()=>{M.current&&!confirm(g)||(H(!1),E&&E())},[E]);return Object(r.d)("keydown",e=>{f&&e.key&&"s"===e.key.toLowerCase()&&e.ctrlKey&&(K(),e.preventDefault(),e.stopPropagation())},[],[M]),o.a.createElement(o.a.Fragment,null,o.a.createElement(m.a,Object.assign({value:A.current,name:S.current,tabId:L,previewDevice:I,showFakeOptions:P,onChange:W,onRename:z,onChangeTab:Y,onToggleFakeOptions:e=>{j(e),Object(s.c)({showFakeOptions:e})},onChangeDevice:R,onSave:K,onCancel:V,isSaving:U},N,{isDoneBtnEnabled:M.current,isCancelBtnEnabled:M.current})),o.a.createElement(d.a,{isOpen:D.current,onAccept:e=>{K(e)},onCancel:()=>{B(!1)}}),a&&o.a.createElement(p.a,{message:g,when:M.current&&!U}))}},211:function(e,t,n){e.exports={root:"Tooltip__root layout__z-highest",container:"Tooltip__container","container-top":"Tooltip__container-top Tooltip__container",containerTop:"Tooltip__container-top Tooltip__container","container-bottom":"Tooltip__container-bottom Tooltip__container",containerBottom:"Tooltip__container-bottom Tooltip__container","container-left":"Tooltip__container-left Tooltip__container",containerLeft:"Tooltip__container-left Tooltip__container","container-right":"Tooltip__container-right Tooltip__container",containerRight:"Tooltip__container-right Tooltip__container",content:"Tooltip__content",arrow:"Tooltip__arrow","arrow-top":"Tooltip__arrow-top Tooltip__arrow",arrowTop:"Tooltip__arrow-top Tooltip__arrow","arrow-bottom":"Tooltip__arrow-bottom Tooltip__arrow",arrowBottom:"Tooltip__arrow-bottom Tooltip__arrow","arrow-left":"Tooltip__arrow-left Tooltip__arrow",arrowLeft:"Tooltip__arrow-left Tooltip__arrow","arrow-right":"Tooltip__arrow-right Tooltip__arrow",arrowRight:"Tooltip__arrow-right Tooltip__arrow"}},213:function(e,t,n){e.exports={root:"HelpTooltip__root",tooltip:"HelpTooltip__tooltip layout__z-high","tooltip-container":"HelpTooltip__tooltip-container",tooltipContainer:"HelpTooltip__tooltip-container","tooltip-content":"HelpTooltip__tooltip-content",tooltipContent:"HelpTooltip__tooltip-content",icon:"HelpTooltip__icon"}},216:function(e,t,n){e.exports={root:"Notification__root",text:"Notification__text",title:"Notification__title Notification__text",content:"Notification__content Notification__text",date:"Notification__date"}},23:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return u}));var a,o=n(0),r=n.n(o),l=n(187),i=n.n(l),c=n(11),s=n(10);!function(e){e.SUCCESS="success",e.INFO="info",e.PRO_TIP="pro-tip",e.WARNING="warning",e.ERROR="error"}(a||(a={}));const u=({children:e,type:t,showIcon:n,shake:a,isDismissible:o,onDismiss:l})=>{const[u,d]=r.a.useState(!1),p=Object(c.b)(i.a[t],a?i.a.shaking:null);return u?null:r.a.createElement("div",{className:p},n?r.a.createElement("div",null,r.a.createElement(s.a,{className:i.a.icon,icon:m(t)})):null,r.a.createElement("div",{className:i.a.content},e),o?r.a.createElement("button",{className:i.a.dismissBtn,onClick:()=>{o&&(d(!0),l&&l())}},r.a.createElement(s.a,{icon:"no"})):null)};function m(e){switch(e){case a.SUCCESS:return"yes-alt";case a.PRO_TIP:return"lightbulb";case a.ERROR:case a.WARNING:return"warning";case a.INFO:default:return"info"}}},230:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var a=n(0),o=n.n(a),r=n(211),l=n.n(r),i=n(176),c=n(305),s=n(306),u=n(16),m=n(11);function d({visible:e,delay:t,placement:n,theme:r,children:d}){r=null!=r?r:{},n=n||"bottom";const[b,_]=o.a.useState(!1),g={preventOverflow:{boundariesElement:document.getElementById(u.a.config.rootId),padding:5}};Object(a.useEffect)(()=>{const n=setTimeout(()=>_(e),e?t:1);return()=>clearTimeout(n)},[e]);const f=p("container",n),h=p("arrow",n),v=Object(m.b)(l.a[f],r.container,r[f]),E=Object(m.b)(l.a[h],r.arrow,r[h]);return o.a.createElement(i.c,null,o.a.createElement(c.a,null,e=>d[0](e)),o.a.createElement(s.a,{placement:n,modifiers:g,positionFixed:!0},({ref:e,style:t,placement:n,arrowProps:a})=>b?o.a.createElement("div",{ref:e,className:Object(m.b)(l.a.root,r.root),style:t,tabIndex:-1},o.a.createElement("div",{className:v,"data-placement":n},o.a.createElement("div",{className:Object(m.b)(l.a.content,r.content)},d[1]),o.a.createElement("div",{className:E,ref:a.ref,style:a.style,"data-placement":n}))):null))}function p(e,t){switch(t){case"top":case"top-start":case"top-end":return e+"Top";case"bottom":case"bottom-start":case"bottom-end":return e+"Bottom";case"left":case"left-start":case"left-end":return e+"Left";case"right":case"right-start":case"right-end":return e+"Right";default:return e}}},233:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(0),o=n.n(a),r=n(374),l=n.n(r),i=n(84);function c({children:e}){return o.a.createElement("div",null,o.a.createElement("div",{className:l.a.proPill},o.a.createElement(i.a,null)),o.a.createElement("span",null,e))}},241:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),o=n.n(a),r=n(388),l=n.n(r),i=n(53),c=n(142);const s=({feed:e,onCopy:t,children:n})=>o.a.createElement(l.a,{text:`[instagram feed="${e.id}"]`,onCopy:()=>{i.a.add("feeds/shortcode/copied",()=>o.a.createElement(c.a,{message:"Copied shortcode to clipboard."})),t&&t()}},n)},245:function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var a=n(0),o=n.n(a),r=n(193),l=n.n(r),i=n(92),c=n(90),s=n.n(c),u=n(3),m=n(247),d=n(5),p=n(10),b=n(8),_=n(39),g=n(107),f=n(16),h=n(67);function v({automations:e,selected:t,isFakePro:n,onChange:r,onSelect:l,onClick:i}){!n&&r||(r=_.b);const[c,p]=o.a.useState(null);function g(e){l&&l(e)}const f=Object(a.useCallback)(()=>{r(e.concat({type:"hashtag",config:{},promotion:{type:"link",config:{}}}),e.length)},[e]),v=Object(a.useCallback)(t=>()=>{const n=e[t],a=Object(u.h)(n),o=e.slice();o.splice(t+1,0,a),r(o,t+1)},[e]);function y(){p(null)}const O=Object(a.useCallback)(t=>{const n=e.slice();n.splice(t,1),r(n,0),y()},[e]),C=Object(a.useCallback)(n=>{const a=e[t],o=n.map(e=>({type:e.type,config:b.a.Automation.getConfig(e),promotion:b.a.Automation.getPromotion(e)})),l=o.findIndex(e=>e.promotion===a.promotion);r(o,l)},[e]);function N(e){return()=>{g(e),i&&i(e)}}const w=e.map(e=>Object.assign(Object.assign({},e),{id:Object(u.u)()}));return o.a.createElement("div",{className:n?s.a.fakeProList:s.a.list},o.a.createElement("div",{className:s.a.addButtonRow},o.a.createElement(d.a,{type:d.c.SECONDARY,size:d.b.LARGE,onClick:f},"Add automation")),o.a.createElement(m.a,{list:w,handle:"."+s.a.rowDragHandle,setList:C,onStart:function(e){g(e.oldIndex)},animation:200,delay:1e3,fallbackTolerance:5,delayOnTouchOnly:!0},e.map((e,n)=>o.a.createElement(E,{key:n,automation:e,selected:t===n,onClick:N(n),onDuplicate:v(n),onRemove:()=>function(e){p(e)}(n)}))),o.a.createElement(h.a,{isOpen:null!==c,title:"Are you sure?",buttons:["Yes, remove it","No, keep it"],onAccept:()=>O(c),onCancel:y},o.a.createElement("p",null,"Are you sure you want to remove this automation? This ",o.a.createElement("strong",null,"cannot")," be undone!")))}function E({automation:e,selected:t,onClick:n,onDuplicate:a,onRemove:r}){const l=b.a.Automation.getConfig(e),i=b.a.Automation.getPromotion(e),c=b.a.getConfig(i),u=f.a.config.postTypes.find(e=>e.name===c.linkType);return o.a.createElement("div",{className:t?s.a.rowSelected:s.a.row,onClick:n},o.a.createElement("div",{className:s.a.rowDragHandle},o.a.createElement(p.a,{icon:"menu"})),o.a.createElement("div",{className:s.a.rowBox},o.a.createElement("div",{className:s.a.rowHashtags},l.hashtags&&Array.isArray(l.hashtags)?l.hashtags.map(e=>"#"+e).join(", "):o.a.createElement("span",{className:s.a.noHashtagsMessage},"No hashtags")),o.a.createElement("div",{className:s.a.rowSummary},o.a.createElement(g.a,{value:c.linkType},o.a.createElement(g.c,{value:"url"},o.a.createElement("span",{className:s.a.summaryItalics},"Custom URL")),o.a.createElement(g.b,null,()=>u?o.a.createElement("span",null,o.a.createElement("span",{className:s.a.summaryBold},c.postTitle)," ",o.a.createElement("span",{className:s.a.summaryItalics},"(",u.labels.singular_name,")")):o.a.createElement("span",{className:s.a.noPromoMessage},"No promotion")))),o.a.createElement("div",{className:s.a.rowActions},o.a.createElement(d.a,{type:d.c.PILL,size:d.b.SMALL,onClick:Object(_.c)(a),tooltip:"Duplicate automation"},o.a.createElement(p.a,{icon:"admin-page"})),o.a.createElement(d.a,{type:d.c.DANGER_PILL,size:d.b.SMALL,onClick:Object(_.c)(r),tooltip:"Remove automation"},o.a.createElement(p.a,{icon:"trash"})))))}var y=n(302),O=n.n(y),C=n(96),N=n(57),w=n(85),A=n(127),k=n(183),S=n(11);let T;function P({automation:e,isFakePro:t,onChange:n}){var a;!t&&n||(n=_.b),void 0===T&&(T=b.a.getTypes().filter(e=>"-more-"!==e.id).map(e=>({value:e.id,label:e.label})));const r=b.a.Automation.getPromotion(e),l=b.a.getType(r),i=b.a.getConfig(r),c=null!==(a=b.a.Automation.getConfig(e).hashtags)&&void 0!==a?a:[];return o.a.createElement(C.a,null,e&&o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:Object(S.b)(C.a.padded,t?O.a.fakePro:null)},o.a.createElement(w.a,{id:"sli-auto-promo-hashtags",label:"Promote posts with any of these hashtags",wide:!0},o.a.createElement(A.a,{id:"sli-auto-promo-hashtags",value:c,onChange:function(t){n(Object.assign(Object.assign({},e),{config:{hashtags:t}}))},autoFocus:!t})),o.a.createElement(w.a,{id:"auto-promo-type",label:"Promotion type",wide:!0},o.a.createElement(N.a,{id:"sli-auto-promo-type",value:e.promotion.type,onChange:function(t){n(Object.assign(Object.assign({},e),{type:t.value}))},options:T,isSearchable:!1,isCreatable:!1,isClearable:!1}))),o.a.createElement("div",{className:t?O.a.fakePro:null},o.a.createElement(k.a,{type:l,config:i,onChange:function(t){n(Object.assign(Object.assign({},e),{promotion:Object.assign(Object.assign({},e.promotion),{config:t})}))},hideRemove:!0}))),!e&&o.a.createElement("div",{className:C.a.padded},o.a.createElement("p",null,"Automatically link Instagram posts from any source that contain specific hashtags to posts,"," ","pages, products, custom links, and more."," ",o.a.createElement("a",{href:"#"},"Learn more")),o.a.createElement("p",null,"To get started, create an automation or select an existing one.")))}function j({automations:e,isFakePro:t,onChange:n}){e=null!=e?e:[],n=null!=n?n:_.b;const[r,c]=o.a.useState(0),[s,m]=o.a.useState("content"),d=Object(u.g)(r,e),p=e.length>0,b=()=>m("content"),g=()=>m("sidebar"),f=Object(a.useCallback)(()=>e[d],[e,d]);function h(e){c(e)}function E(e){h(e),g()}const y=Object(a.useCallback)((e,t)=>{n(e),void 0!==t&&c(t)},[n]),O=Object(a.useCallback)(t=>{n(Object(u.d)(e,d,t))},[d,n]),C=Object(a.useCallback)(()=>{n(e.concat({type:"hashtag",config:{},promotion:{type:"link",config:{}}})),c(0),g()},[e]);return o.a.createElement(i.a,{primary:"content",current:s,sidebar:p&&(e=>o.a.createElement(o.a.Fragment,null,e&&o.a.createElement(i.a.Navigation,{icon:"arrow-left-alt",text:"Automations",onClick:b}),o.a.createElement(P,{automation:f(),onChange:O,isFakePro:t}))),content:n=>o.a.createElement("div",{className:l.a.content},!p&&o.a.createElement(L,{onCreate:C}),p&&o.a.createElement(o.a.Fragment,null,n&&o.a.createElement("div",{className:l.a.mobileInstructions},o.a.createElement("p",null,"Click or tap on an automation to change its settings")),o.a.createElement(v,{automations:e,selected:d,isFakePro:t,onChange:y,onSelect:h,onClick:E})))})}function L({onCreate:e}){return o.a.createElement("div",{className:l.a.tutorial},o.a.createElement("div",{className:l.a.tutorialBox},o.a.createElement("div",{className:l.a.tutorialText},o.a.createElement("h1",null,"Automatically drive more conversions with Instagram"),o.a.createElement("p",null,"Link Instagram posts to your products, blog posts, landing pages, and more."),o.a.createElement("p",null,o.a.createElement("b",null,"Promotions help you drive traffic and increase conversions through social proof.")),o.a.createElement("p",null,"For example, create an ",o.a.createElement("b",null,"Instagram hashtag"),", let’s call it ",o.a.createElement("b",null,"#mymaxidress"),"."," "," Display photos from Instagram that use this hashtag and feature your dress,"," "," then have them ",o.a.createElement("b",null,"link directly to your product page"),", whether it’s on the"," "," same website or not."),o.a.createElement("p",null,"Every new Instagram photo that Spotlight finds with this hashtag will then",o.a.createElement("br",null),o.a.createElement("b",null,"automatically link to the product page"),"."),o.a.createElement("p",null,o.a.createElement("b",null,"Simple. Powerful. Effective."))),o.a.createElement(d.a,{type:d.c.SECONDARY,size:d.b.HERO,onClick:e},"Create your first automation")))}},248:function(e,t,n){"use strict";n.d(t,"a",(function(){return A}));var a=n(0),o=n.n(a),r=n(123),l=n.n(r),i=n(4),c=n(7),s=n(8),u=n(83),m=n(14),d=n(92),p=n(96),b=n(85),_=n(57),g=n(183);function f({media:e,promo:t,isLastPost:n,isFakePro:r,onChange:l,onNextPost:i}){let c,u,m;e&&(c=t?t.type:s.a.getTypes()[0].id,u=s.a.getTypeById(c),m=s.a.getConfig(t));const d=Object(a.useCallback)(e=>{const t={type:u.id,config:e};l(t)},[e,u]),f=Object(a.useCallback)(e=>{const t={type:e.value,config:m};l(t)},[e,m]);if(!e)return o.a.createElement(p.a,{disabled:r},o.a.createElement("div",{className:p.a.padded},o.a.createElement("p",null,"Promote your blog posts, landing pages, products, and much more through your Instagram feed."),o.a.createElement("p",{style:{fontWeight:"bold"}},"How it works:"),o.a.createElement("ol",{style:{marginTop:0}},o.a.createElement("li",null,"Select a post from the preview on the left."),o.a.createElement("li",null,"Choose what the post should link to.")),o.a.createElement("p",null,"That’s it!")));const h=void 0!==s.a.getAutoPromo(e);return o.a.createElement(p.a,{disabled:r},o.a.createElement("div",{className:p.a.padded},o.a.createElement(b.a,{label:"Promotion type",wide:!0},o.a.createElement(_.a,{value:c,onChange:f,options:s.a.getTypes().map(e=>({value:e.id,label:e.label}))}))),o.a.createElement(g.a,{key:e?e.id:void 0,type:u,config:m,onChange:d,hasAuto:h,showNextBtn:!0,isNextBtnDisabled:n,onNext:i}))}var h=n(182),v=n(239),E=n(11),y=n(240),O=n(39),C=n(102);const N={};function w(){return new u.b({watch:{all:!0,moderation:!1,filters:!1}})}function A({promotions:e,isFakePro:t,onChange:n}){!t&&n||(n=O.b);const[a,r]=o.a.useState("content"),[u,p]=o.a.useState(i.b.list.length>0?i.b.list[0].id:null),[b,_]=o.a.useState(),g=o.a.useRef(new c.a);A();const E=()=>r("content");function A(){g.current=new c.a(new c.a.Options({accounts:[u]}))}const S=o.a.useCallback(e=>{p(e.id),A()},[p]),T=o.a.useCallback((e,t)=>{_(t)},[_]),P=e=>e&&r("sidebar"),j=o.a.useCallback(()=>{_(e=>e+1)},[_]),L=u?m.a.ensure(N,u,w()):w(),x=L.media[b],I=x?s.a.getPromoFromDictionary(x,e):void 0,R=o.a.useCallback(t=>{n(m.a.withEntry(e,x.id,t))},[x,e,n]);return o.a.createElement(o.a.Fragment,null,0===i.b.list.length&&o.a.createElement("div",{className:l.a.tutorial},o.a.createElement("div",{className:l.a.tutorialBox},o.a.createElement("div",{className:l.a.tutorialText},o.a.createElement("h1",null,"Set up global promotions across all feeds"),o.a.createElement("p",null,"Link Instagram posts to your products, blog posts, landing pages, and more."),o.a.createElement("p",null,o.a.createElement("b",null,"Promotions help you drive traffic and increase conversions through social proof.")),o.a.createElement("p",null,"Set up global promotions for each account that will apply across all feeds."," ","You may then choose to enable or disable promotions on a per-feed basis."),o.a.createElement("p",null,"Connect your first Instagram account to set up global promotions."),o.a.createElement("p",null,o.a.createElement("b",null,"Simple. Powerful. Effective."))),o.a.createElement(C.a,{onConnect:p},"Connect your Instagram account"))),i.b.list.length>0&&o.a.createElement(d.a,{primary:"content",current:a,sidebar:e=>o.a.createElement(o.a.Fragment,null,e&&o.a.createElement(o.a.Fragment,null,o.a.createElement(d.a.Navigation,{icon:"arrow-left-alt",text:"Back",onClick:E}),o.a.createElement(y.a,{media:x})),o.a.createElement(f,{media:x,promo:I,isLastPost:b>=L.media.length-1,onChange:R,onNextPost:j,isFakePro:t})),content:e=>o.a.createElement(o.a.Fragment,null,i.b.list.length>1&&o.a.createElement(k,{selected:u,onSelect:S}),o.a.createElement("div",{className:l.a.content},e&&o.a.createElement("div",{className:l.a.mobileInstructions},o.a.createElement("p",null,"Click or tap a post to set up a promotion for it")),o.a.createElement(h.a,{key:g.current.options.accounts.join("-"),feed:g.current,store:L,selected:b,onSelectMedia:T,onClickMedia:P,autoFocusFirst:!0,disabled:t},(e,n)=>{const a=t?void 0:s.a.getPromo(e);return o.a.createElement(v.a,{media:e,promo:a,selected:n===b})})))}))}function k({selected:e,onSelect:t}){return o.a.createElement("div",{className:l.a.accountList},o.a.createElement("div",{className:l.a.accountScroller},i.b.list.map(n=>{const a="global-promo-account-"+n.id;return o.a.createElement("div",{key:n.id,className:e===n.id?l.a.accountSelected:l.a.accountButton,onClick:()=>t(n),role:"button","aria-labelledby":a},o.a.createElement("div",{className:l.a.profilePic},o.a.createElement("img",Object.assign({src:i.b.getProfilePicUrl(n),alt:n.username},E.e))),o.a.createElement("div",{id:a,className:l.a.username},o.a.createElement("span",null,"@"+n.username)))})))}},249:function(e,t,n){"use strict";n.d(t,"a",(function(){return E}));var a=n(0),o=n.n(a),r=n(120),l=n.n(r),i=n(30),c=n(4),s=n(46),u=n(5),m=n(10),d=n(122),p=n.n(d),b=n(56),_=n(16);function g({isColumn:e,onConnectPersonal:t,onConnectBusiness:n}){const[r,l]=o.a.useState(!1),[i,c]=o.a.useState(""),[s,m]=o.a.useState(""),[d,_]=o.a.useState(!1);Object(a.useEffect)(()=>{_(i.length>145&&!i.trimLeft().startsWith("IG"))},[i]);const g=o.a.createElement("div",{className:p.a.helpMessage},!1),f=o.a.createElement("div",{className:p.a.buttonContainer},e&&g,o.a.createElement(u.a,{className:p.a.button,onClick:()=>{d?n(i,s):t(i)},type:u.c.PRIMARY,disabled:0===i.length&&(0===s.length||!d)},"Connect"));return o.a.createElement("div",{className:e?p.a.column:p.a.row},o.a.createElement(b.a,{label:"Connect using an access token (for developers)",stealth:!0,isOpen:r,onClick:()=>l(!r)},o.a.createElement("div",{className:p.a.content},o.a.createElement("label",{className:p.a.label,htmlFor:"manual-connect-access-token"},o.a.createElement("div",null,"Enter your Instagram or Facebook access token")),o.a.createElement("div",{className:p.a.bottom},o.a.createElement("input",{id:"manual-connect-access-token",type:"text",value:i,onChange:e=>c(e.target.value),placeholder:"Your access token"}),!d&&f)),d&&o.a.createElement("div",{className:p.a.content},o.a.createElement("label",{className:p.a.label,htmlFor:"manual-connect-user-id"},o.a.createElement("div",null,"This access token is for a ",o.a.createElement("strong",null,"Business")," account."," ","Enter the user ID:")),o.a.createElement("div",{className:p.a.bottom},o.a.createElement("input",{id:"manual-connect-user-id",type:"text",value:s,onChange:e=>m(e.target.value),placeholder:"Enter the user ID"}),d&&f)),!e&&g))}var f=n(17),h=n(53),v=n(180);function E({onConnect:e,beforeConnect:t,useColumns:n,showPrompt:a}){a=null==a||a,e||(e=()=>{});const r=e=>{const t=f.a.getErrorReason(e);h.a.add("admin/connect/fail",()=>o.a.createElement(v.a,{message:t}))},d=e=>{i.a.State.connectSuccess&&t&&t(e)};return o.a.createElement("div",{className:l.a.root},a&&o.a.createElement("p",{className:l.a.promptMsg},"Choose the type of account to connect:"),o.a.createElement("div",{className:n?l.a.typesColumns:l.a.typesRows},o.a.createElement("div",{className:l.a.type},o.a.createElement(u.a,{type:u.c.PRIMARY,size:u.b.HERO,onClick:()=>i.a.openAuthWindow(c.a.Type.PERSONAL,s.a.ANIMATION_DELAY,d).then(e).catch(()=>{})},"Connect your Personal account"),o.a.createElement("div",{className:l.a.capabilities},o.a.createElement(y,null,"Connects directly through Instagram"),o.a.createElement(y,null,"Show posts from your account"))),o.a.createElement("div",{className:l.a.type},o.a.createElement(u.a,{type:u.c.SECONDARY,size:u.b.HERO,onClick:()=>i.a.openAuthWindow(c.a.Type.BUSINESS,s.a.ANIMATION_DELAY,d).then(e).catch(()=>{})},"Connect your Business account"),o.a.createElement("div",{className:l.a.capabilities},o.a.createElement(y,null,"Connects through your Facebook page"),o.a.createElement(y,null,"Show posts from your account"),o.a.createElement(y,null,"Show posts where you are tagged"),o.a.createElement(y,null,"Show posts with a specific hashtag from all across Instagram"),o.a.createElement("div",{className:l.a.businessLearnMore},o.a.createElement(m.a,{icon:"editor-help"}),o.a.createElement("a",{href:_.a.resources.businessAccounts,target:"_blank"},"Learn more about Business accounts"))))),o.a.createElement("div",{className:l.a.connectAccessToken},o.a.createElement(g,{isColumn:n,onConnectPersonal:t=>i.a.manualConnectPersonal(t,s.a.ANIMATION_DELAY,d).then(e).catch(r),onConnectBusiness:(t,n)=>i.a.manualConnectBusiness(t,n,s.a.ANIMATION_DELAY,d).then(e).catch(r)})))}const y=e=>{var{children:t}=e,n=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}(e,["children"]);return o.a.createElement("div",Object.assign({className:l.a.capability},n),o.a.createElement(m.a,{icon:"yes"}),o.a.createElement("div",null,t))}},250:function(e,t,n){e.exports={root:"ModalPrompt__root",button:"ModalPrompt__button"}},251:function(e,t,n){e.exports={button:"ColorPicker__button","color-preview":"ColorPicker__color-preview",colorPreview:"ColorPicker__color-preview",popper:"ColorPicker__popper"}},255:function(e,t,n){e.exports={"pro-upsell":"SidebarUpsell__pro-upsell",proUpsell:"SidebarUpsell__pro-upsell",toggle:"SidebarUpsell__toggle","toggle-label":"SidebarUpsell__toggle-label",toggleLabel:"SidebarUpsell__toggle-label"}},26:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var a,o=n(1),r=n(7),l=n(17),i=n(16),c=function(e,t,n,a){var o,r=arguments.length,l=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,a);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(l=(r<3?o(l):r>3?o(t,n,l):o(t,n))||l);return r>3&&l&&Object.defineProperty(t,n,l),l};!function(e){class t{constructor(e={}){t.setFromObject(this,null!=e?e:{})}static setFromObject(e,t={}){var n,a,o,l,i;e.id=null!==(n=t.id)&&void 0!==n?n:null,e.name=null!==(a=t.name)&&void 0!==a?a:"",e.usages=null!==(o=t.usages)&&void 0!==o?o:[],e.options=new r.a.Options(null!==(l=e.options)&&void 0!==l?l:{}),r.a.Options.setFromObject(e.options,null!==(i=t.options)&&void 0!==i?i:{})}get label(){return t.getLabel(this.name)}static getLabel(e){return e.length>0?e:this.getDefaultName()}static getDefaultName(){return"(no name)"}}function n(n){if("object"!=typeof n||!Array.isArray(n.data))throw"Spotlight encountered a problem trying to load your feeds. Kindly contact customer support for assistance.";e.list.replace(n.data.map(e=>new t(e)))}c([o.n],t.prototype,"id",void 0),c([o.n],t.prototype,"name",void 0),c([o.n],t.prototype,"usages",void 0),c([o.n],t.prototype,"options",void 0),c([o.h],t.prototype,"label",null),e.SavedFeed=t,e.list=Object(o.n)([]),e.loadFeeds=()=>l.a.getFeeds().then(n).catch(e=>{throw l.a.getErrorReason(e)}),e.getById=t=>(t="string"==typeof t?parseInt(t):t)?e.list.find(e=>e.id==t):void 0,e.hasFeeds=()=>e.list.length>0,e.create=function(n,a){const o=new t({id:null,name:s(n),options:new r.a.Options(a)});return e.list.push(o),o},e.saveFeed=function(n){return i.a.restApi.saveFeed(n).then(a=>{const o=new t(a.data.feed);if(null===n.id)e.list.push(o);else{const t=e.list.findIndex(e=>e.id===n.id);e.list[t]=o}return o})},e.deleteFeed=function(t){const n=null!==t.id?e.list.findIndex(e=>e.id===t.id):e.list.findIndex(e=>e===t);return n>=0&&e.list.splice(n,1),null!==t.id?i.a.restApi.deleteFeed(t.id).catch(e=>{}):new Promise(e=>e())};const a=new RegExp("([\\w\\s]+)\\s?\\((\\d+)\\)?");function s(t){const n=u(t)[0],a=e.list.map(e=>u(e.name)).filter(e=>e[0]===n),o=a.reduce((e,t)=>Math.max(e,t[1]),1);return a.length>0?`${n} (${o+1})`:t.trim()}function u(e){e=e.trim();const t=a.exec(e);return t?[t[1].trim(),parseInt(t[2])]:[e,0]}}(a||(a={}))},260:function(e,t,n){"use strict";t.a={Sizes:{WIDE:1200,LARGE:1180,MEDIUM:960,SMALL:782,NARROW:600,ALL:[1200,1180,960,782,600]}}},291:function(e,t,n){e.exports={root:"ClearCacheButton__root layout__flex-row","doc-link":"ClearCacheButton__doc-link",docLink:"ClearCacheButton__doc-link"}},294:function(e,t,n){e.exports={root:"SaveButton__root","saving-overlay":"SaveButton__saving-overlay layout__fill-parent",savingOverlay:"SaveButton__saving-overlay layout__fill-parent","saving-animation":"SaveButton__saving-animation",savingAnimation:"SaveButton__saving-animation"}},299:function(e,t,n){e.exports={root:"Toaster__root layout__z-highest",container:"Toaster__container"}},30:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var a,o=n(4),r=n(29),l=n(16),i=n(1),c=n(620),s=n(619),u=n(394);!function(e){let t=null,n=null;e.State=window.SliAccountManagerState=Object(i.n)({accessToken:null,connectSuccess:!1,connectedId:null});const a=Object(c.a)(new Date,{days:7});function m(t,n,a){a&&a(e.State.connectedId),setTimeout(()=>o.b.loadAccounts().then(()=>{const t=o.b.getById(e.State.connectedId),a=new p(e.ACCOUNT_CONNECTED_EVENT,t);document.dispatchEvent(a),n(e.State.connectedId)}),t)}function d(e){return e.type===o.a.Type.BUSINESS&&e.accessToken&&e.accessToken.expiry&&Object(s.a)(a,Object(u.a)(e.accessToken.expiry))}e.manualConnectPersonal=function(t,n=0,a){return new Promise((o,r)=>{e.State.connectSuccess=!1,l.a.restApi.connectPersonal(t).then(t=>{e.State.connectSuccess=!0,e.State.connectedId=t.data.accountId,m(n,o,a)}).catch(r)})},e.manualConnectBusiness=function(t,n,a=0,o){return new Promise((r,i)=>{e.State.connectSuccess=!1,l.a.restApi.connectBusiness(t,n).then(t=>{e.State.connectSuccess=!0,e.State.connectedId=t.data.accountId,m(a,r,o)}).catch(i)})},e.openAuthWindow=function(a,i=0,c){return new Promise((s,u)=>{if(e.State.connectedId=null,null==t||t.closed){const e=Object(r.a)(700,800),n=a===o.a.Type.PERSONAL?l.a.restApi.config.personalAuthUrl:l.a.restApi.config.businessAuthUrl;t=Object(r.c)(n,"_blank",Object.assign({dependent:"yes",resizable:"yes",toolbar:"no",location:"no",scrollbars:"no"},e))}else t.focus();null==t||t.closed||(n=setInterval(()=>{t&&!t.closed||(clearInterval(n),null===e.State.connectedId?u&&u():m(i,s,c))},500))})},e.updateAccount=function(e){return l.a.restApi.updateAccount(e)},e.deleteAccount=function(e){return l.a.restApi.deleteAccount(e).then(o.b.loadFromResponse)},e.getExpiringTokenAccounts=function(){return o.b.list.filter(d)},e.isTokenExpiring=d,e.ACCOUNT_CONNECTED_EVENT="sli/account/connected";class p extends CustomEvent{constructor(e,t){super(e,{detail:{account:t}})}}e.AccountConnectedEvent=p}(a||(a={}))},301:function(e,t,n){e.exports={logo:"SpotlightLogo__logo","logo-image":"SpotlightLogo__logo-image",logoImage:"SpotlightLogo__logo-image"}},302:function(e,t,n){e.exports={"fake-pro":"AutoPromotionsSidebar__fake-pro",fakePro:"AutoPromotionsSidebar__fake-pro"}},304:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(299),l=n.n(r),i=n(53),c=n(192),s=n.n(c),u=n(10);function m({children:e,ttl:t,onExpired:n}){t=null!=t?t:0;const[r,l]=o.a.useState(!1);let i=o.a.useRef(),c=o.a.useRef();const m=()=>{t>0&&(i.current=setTimeout(p,t))},d=()=>{clearTimeout(i.current)},p=()=>{l(!0),c.current=setTimeout(b,200)},b=()=>{n&&n()};Object(a.useEffect)(()=>(m(),()=>{d(),clearTimeout(c.current)}),[]);const _=r?s.a.rootFadingOut:s.a.root;return o.a.createElement("div",{className:_,onMouseOver:d,onMouseOut:m},o.a.createElement("div",{className:s.a.content},e),o.a.createElement("button",{className:s.a.dismissBtn,onClick:()=>{d(),p()}},o.a.createElement(u.a,{icon:"no-alt",className:s.a.dismissIcon})))}var d=n(6);t.a=Object(d.b)((function(){return o.a.createElement("div",{className:l.a.root},o.a.createElement("div",{className:l.a.container},i.a.getAll().map(e=>{var t,n;return o.a.createElement(m,{key:e.key,ttl:null!==(t=e.ttl)&&void 0!==t?t:i.a.DEFAULT_TTL,onExpired:(n=e.key,()=>{i.a.remove(n)})},o.a.createElement(e.component,null))})))}))},327:function(e,t,n){},362:function(e,t,n){},365:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n(35),o=n(95),r=n(21);const l={factories:Object(a.b)({"router/history":()=>Object(o.a)(),"router/store":e=>r.a.useHistory(e.get("router/history"))}),run:e=>{e.get("router/store")}}},366:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n(20);function o({when:e,is:t,isRoot:n,render:o}){const r=Object(a.g)().get(e);return r===t||!t&&!r||n&&!r?o():null}},367:function(e,t,n){e.exports={root:"ConnectAccountButton__root"}},370:function(e,t,n){e.exports={content:"ErrorToast__content"}},374:function(e,t,n){e.exports={"pro-pill":"SpoilerProLabel__pro-pill",proPill:"SpoilerProLabel__pro-pill"}},375:function(e,t,n){e.exports={pill:"ProPill__pill"}},377:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(0),o=n.n(a);n(327);const r=({children:e})=>o.a.createElement("div",{className:"button-group"},e)},379:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(0),o=n.n(a),r=n(11),l=(n(439),function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n});const i=e=>{var{className:t,unit:n}=e,a=l(e,["className","unit"]);const i=Object(r.b)("unit-input__field",t);return o.a.createElement("div",{className:"unit-input"},o.a.createElement("input",Object.assign({},a,{className:i})),o.a.createElement("div",{className:"unit-input__unit"},o.a.createElement("span",null,n)))}},381:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(46),l=n(118),i=n(18),c=n(113),s=n(16),u=n(6);t.a=Object(u.b)((function({isOpen:e,onClose:t,onSave:n}){return o.a.createElement(r.a,{title:"Global filters",isOpen:e,onClose:()=>{i.b.isDirty&&!confirm("You have unsaved changes. If you close the window now, your settings will not be saved. Click OK to close anyway.")||t()}},o.a.createElement(r.a.Content,null,o.a.createElement(c.a,{page:s.a.settings.pages.find(e=>"filters"===e.id)})),o.a.createElement(r.a.Footer,null,o.a.createElement(l.a,{disabled:!i.b.isDirty,isSaving:i.b.isSaving,onClick:()=>{i.b.save().then(()=>{n&&n()})}})))}))},382:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n(0),o=n.n(a),r=n(11);n(605);const l=({name:e,className:t,disabled:n,value:a,onChange:l,options:i})=>{const c=e=>{!n&&e.target.checked&&l&&l(e.target.value)},s=Object(r.b)(Object(r.a)("radio-group",{"--disabled":n}),t);return o.a.createElement("div",{className:s},i.map((t,n)=>o.a.createElement("label",{className:"radio-group__option",key:n},o.a.createElement("input",{type:"radio",name:e,value:t.value,checked:a===t.value,onChange:c}),o.a.createElement("span",null,t.label))))}},383:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(0),o=n.n(a);n(606);const r=({size:e})=>{const t=(e=null!=e?e:24)+"px",n={width:t,height:t,boxShadow:`${.25*e+"px"} 0 0 ${.375*e+"px"} #999 inset`};return o.a.createElement("span",{className:"loading-spinner",style:n})}},384:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(4),l=n(67),i=n(91),c=n(30),s=n(6),u=n(16);t.a=Object(s.b)((function({}){Object(a.useEffect)(()=>{const e=e=>{const a=e.detail.account;n||m||a.type!==r.a.Type.PERSONAL||a.customBio.length||a.customProfilePicUrl.length||(t(a),s(!0))};return document.addEventListener(c.a.ACCOUNT_CONNECTED_EVENT,e),()=>document.removeEventListener(c.a.ACCOUNT_CONNECTED_EVENT,e)},[]);const[e,t]=o.a.useState(null),[n,s]=o.a.useState(!1),[m,d]=o.a.useState(!1),p=()=>{c.a.State.connectedId=null};return o.a.createElement(o.a.Fragment,null,o.a.createElement(l.a,{title:"You've successfully connected your account!",buttons:["Yes","No, maybe later"],isOpen:n,onAccept:()=>{s(!1),d(!0)},onCancel:()=>{s(!1),p()}},o.a.createElement("p",null,"One more thing ..."),o.a.createElement("p",null,"Instagram doesn't provide the profile photo and bio text for Personal accounts."," ","Would you like to set a custom photo and a custom bio in Spotlight to match your Instagram profile?"),o.a.createElement("p",null,o.a.createElement("a",{href:u.a.resources.customPersonalInfoUrl,target:"_blank"},"What's this about?"))),o.a.createElement(i.a,{isOpen:m,onClose:()=>{d(!1),p()},account:e}))}))},385:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var a=n(0),o=n.n(a),r=n(216),l=n.n(r),i=n(140),c=n(394),s=n(21),u=n(50);function m({notification:e}){const t=o.a.useRef();return Object(a.useEffect)(()=>{if(!t.current)return;const e=t.current.getElementsByTagName("a");for(let t=0;t<e.length;++t){const n=e.item(t);if("true"===n.getAttribute("data-sli-link"))continue;const a=n.getAttribute("href");if("string"!=typeof a||!a.startsWith("app://"))continue;const o=Object(u.parse)(a.substr("app://".length)),r=s.a.at(o),l=s.a.fullUrl(o);n.setAttribute("href",l),n.setAttribute("data-sli-link","true"),n.addEventListener("click",e=>{s.a.history.push(r,{}),e.preventDefault(),e.stopPropagation()})}},[t.current]),o.a.createElement("article",{className:l.a.root},e.title&&e.title.length&&o.a.createElement("header",{className:l.a.title},e.title),o.a.createElement("main",{ref:t,className:l.a.content,dangerouslySetInnerHTML:{__html:e.content}}),e.date&&o.a.createElement("footer",{className:l.a.date},Object(i.a)(Object(c.a)(e.date),{addSuffix:!0})))}},386:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(0),o=n.n(a),r=n(387),l=n.n(r),i=n(11);function c(){return o.a.createElement("div",{className:Object(i.b)(l.a.modalLayer,"spotlight-modal-target")})}},387:function(e,t,n){e.exports={"modal-layer":"ModalLayer__modal-layer",modalLayer:"ModalLayer__modal-layer"}},421:function(e,t,n){},435:function(e,t,n){},436:function(e,t,n){},437:function(e,t,n){},439:function(e,t,n){},46:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var a=n(0),o=n.n(a),r=n(32),l=n.n(r),i=n(121),c=n.n(i),s=n(11),u=n(20),m=n(5),d=n(10);function p({children:e,className:t,isOpen:n,icon:r,title:i,width:m,height:d,onClose:b,allowShadeClose:_,focusChild:g,portalTo:f}){const h=o.a.useRef(),[v]=Object(u.a)(n,!1,p.ANIMATION_DELAY);if(Object(u.d)("keydown",e=>{"Escape"===e.key&&(b&&b(),e.preventDefault(),e.stopPropagation())},[],[b]),Object(a.useEffect)(()=>{h&&h.current&&n&&(null!=g?g:h).current.focus()},[]),!v)return null;const E={width:m=null!=m?m:600,height:d},y=Object(s.b)(c.a.modal,n?c.a.opening:c.a.closing,t,"wp-core-ui-override");_=null==_||_;const O=o.a.createElement("div",{className:y},o.a.createElement("div",{className:c.a.shade,tabIndex:-1,onClick:()=>{_&&b&&b()}}),o.a.createElement("div",{ref:h,className:c.a.container,style:E,tabIndex:-1},i?o.a.createElement(p.Header,null,o.a.createElement("h1",null,o.a.createElement(p.Icon,{icon:r}),i),o.a.createElement(p.CloseBtn,{onClick:b})):null,e));let C=f;if(void 0===C){const e=document.getElementsByClassName("spotlight-modal-target");C=0===e.length?document.body:e.item(0)}return l.a.createPortal(O,C)}!function(e){e.ANIMATION_DELAY=120,e.CloseBtn=({onClick:e})=>o.a.createElement(m.a,{className:c.a.closeBtn,type:m.c.NONE,onClick:e,tooltip:"Close"},o.a.createElement(d.a,{icon:"no-alt"})),e.Icon=({icon:e})=>e?o.a.createElement(d.a,{icon:e,className:c.a.icon}):null,e.Header=({children:e})=>o.a.createElement("div",{className:c.a.header},e),e.Content=({children:e})=>o.a.createElement("div",{className:c.a.scroller},o.a.createElement("div",{className:c.a.content},e)),e.Footer=({children:e})=>o.a.createElement("div",{className:c.a.footer},e)}(p||(p={}))},5:function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return u}));var a,o,r=n(0),l=n.n(r),i=n(11),c=n(230),s=(n(327),n(3));!function(e){e[e.PRIMARY=0]="PRIMARY",e[e.SECONDARY=1]="SECONDARY",e[e.TOGGLE=2]="TOGGLE",e[e.LINK=3]="LINK",e[e.PILL=4]="PILL",e[e.DANGER=5]="DANGER",e[e.DANGER_LINK=6]="DANGER_LINK",e[e.DANGER_PILL=7]="DANGER_PILL",e[e.NONE=8]="NONE"}(a||(a={})),function(e){e[e.SMALL=0]="SMALL",e[e.NORMAL=1]="NORMAL",e[e.LARGE=2]="LARGE",e[e.HERO=3]="HERO"}(o||(o={}));const u=l.a.forwardRef((e,t)=>{let{children:n,className:r,type:u,size:m,active:d,tooltip:p,tooltipPlacement:b,onClick:_,linkTo:g}=e,f=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}(e,["children","className","type","size","active","tooltip","tooltipPlacement","onClick","linkTo"]);u=null!=u?u:a.SECONDARY,m=null!=m?m:o.NORMAL,b=null!=b?b:"bottom";const[h,v]=l.a.useState(!1),E=()=>v(!0),y=()=>v(!1),O=Object(i.b)(r,u!==a.NONE?"button":null,u===a.PRIMARY?"button-primary":null,u===a.SECONDARY?"button-secondary":null,u===a.LINK?"button-secondary button-tertiary":null,u===a.PILL?"button-secondary button-tertiary button-pill":null,u===a.TOGGLE?"button-toggle":null,u===a.TOGGLE&&d?"button-primary button-active":null,u!==a.TOGGLE||d?null:"button-secondary",u===a.DANGER?"button-secondary button-danger":null,u===a.DANGER_LINK?"button-tertiary button-danger":null,u===a.DANGER_PILL?"button-tertiary button-danger button-danger-pill":null,m===o.SMALL?"button-small":null,m===o.LARGE?"button-large":null,m===o.HERO?"button-hero":null),C=e=>{_&&_(e)};let N="button";if("string"==typeof g?(N="a",f.href=g):f.type="button",f.tabIndex=0,!p)return l.a.createElement(N,Object.assign({ref:t,className:O,onClick:C},f),n);const w="string"==typeof p,A="btn-tooltip-"+Object(s.u)(),k=w?p:l.a.createElement(p,{id:A});return l.a.createElement(c.a,{visible:h&&!e.disabled,placement:b,delay:300},({ref:e})=>l.a.createElement(N,Object.assign({ref:t?Object(i.d)(e,t):e,className:O,onClick:C,onMouseEnter:E,onMouseLeave:y},f),n),k)})},53:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var a,o=n(1),r=n(76),l=n(142);!function(e){const t=o.n.array([]);e.DEFAULT_TTL=5e3,e.getAll=()=>t,e.add=Object(o.f)((e,n,a)=>{t.push({key:e,component:n,ttl:a})}),e.remove=Object(o.f)(e=>{t.replace(t.filter(t=>t.key!==e))}),e.message=function(e){return Object(r.a)(l.a,{message:e})}}(a||(a={}))},56:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(0),o=n.n(a),r=n(11),l=(n(435),n(10)),i=n(20);const c=o.a.forwardRef((function({label:e,className:t,isOpen:n,defaultOpen:a,showIcon:c,disabled:s,stealth:u,fitted:m,scrollIntoView:d,hideOnly:p,onClick:b,children:_},g){p=null!=p&&p,c=null==c||c,s=null!=s&&s,d=null!=d&&d;const[f,h]=o.a.useState(!!a),v=void 0!==n;v||(n=f);const E=o.a.useRef(),y=Object(i.j)(E),O=()=>{s||(!n&&d&&y(),v||h(!n),b&&b())},C=n&&void 0===b&&!c,N=C?void 0:0,w=C?void 0:"button",A=Object(r.a)("spoiler",{"--open":n,"--disabled":s,"--fitted":m,"--stealth":u,"--static":C}),k=Object(r.b)(A,t),S=n?"arrow-up-alt2":"arrow-down-alt2",T=Array.isArray(e)?e.map((e,t)=>o.a.createElement(o.a.Fragment,{key:t},e)):"string"==typeof e?o.a.createElement("span",null,e):e;return o.a.createElement("div",{ref:Object(r.d)(E,g),className:k},o.a.createElement("div",{className:"spoiler__header",onClick:O,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||O()},role:w,tabIndex:N},o.a.createElement("div",{className:"spoiler__label"},T),c&&o.a.createElement(l.a,{icon:S,className:"spoiler__icon"})),(n||p)&&o.a.createElement("div",{className:"spoiler__content"},_))}))},57:function(e,t,n){"use strict";n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return d}));var a=n(0),o=n.n(a),r=n(372),l=n(231),i=n(371),c=n(188),s=n.n(c),u=n(11);const m=(e={})=>({option:(e,t)=>Object.assign(Object.assign({},e),{cursor:"pointer",lineHeight:"24px"}),menu:(e,t)=>Object.assign(Object.assign({},e),{margin:"6px 0",boxShadow:"0 2px 8px "+s.a.shadowColor,overflow:"hidden"}),menuList:(e,t)=>({padding:"0px"}),control:(e,t)=>{let n=Object.assign(Object.assign({},e),{cursor:"pointer",lineHeight:"2",minHeight:"40px"});return t.isFocused&&(n.borderColor=s.a.primaryColor,n.boxShadow="0 0 0 1px "+s.a.primaryColor),n},valueContainer:(e,t)=>Object.assign(Object.assign({},e),{paddingTop:0,paddingBottom:0,paddingRight:0}),container:(t,n)=>Object.assign(Object.assign({},t),{width:e.width||"100%"}),multiValue:(e,t)=>Object.assign(Object.assign({},e),{padding:"0 6px"}),input:(e,t)=>Object.assign(Object.assign({},e),{outline:"0 transparent !important",border:"0 transparent !important",boxShadow:"0 0 0 transparent !important"}),indicatorSeparator:(e,t)=>Object.assign(Object.assign({},e),{margin:"0",backgroundColor:"transparent"})}),d=o.a.forwardRef((e,t)=>{var n;const a=(null!==(n=e.options)&&void 0!==n?n:[]).find(t=>t.value===e.value);e=Object.assign(Object.assign({},e),{id:void 0,className:Object(u.b)("react-select",e.className),classNamePrefix:"react-select",inputId:e.id,menuPosition:"fixed"});const c=m(e),d=e.isCreatable?l.a:e.async?i.a:r.a;return o.a.createElement(d,Object.assign({},e,{ref:t,isSearchable:e.isCreatable,value:a,styles:c,theme:e=>Object.assign(Object.assign({},e),{borderRadius:3,colors:Object.assign(Object.assign({},e.colors),{primary:s.a.primaryColor,primary25:s.a.washedColor})}),menuPlacement:"auto",menuShouldScrollIntoView:!0}))})},603:function(e,t,n){},605:function(e,t,n){},606:function(e,t,n){},67:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),o=n.n(a),r=n(250),l=n.n(r),i=n(46),c=n(5);function s({children:e,title:t,buttons:n,onAccept:a,onCancel:r,isOpen:s,okDisabled:u,cancelDisabled:m}){n=null!=n?n:["OK","Cancel"];const d=()=>r&&r();return o.a.createElement(i.a,{isOpen:s,title:t,onClose:d,className:l.a.root},o.a.createElement(i.a.Content,null,"string"==typeof e?o.a.createElement("p",null,e):e),o.a.createElement(i.a.Footer,null,o.a.createElement(c.a,{className:l.a.button,type:c.c.SECONDARY,onClick:d,disabled:m},n[1]),o.a.createElement(c.a,{className:l.a.button,type:c.c.PRIMARY,onClick:()=>a&&a(),disabled:u},n[0])))}},68:function(e,t,n){"use strict";n.d(t,"a",(function(){return m})),n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return b})),n.d(t,"d",(function(){return _}));var a=n(0),o=n.n(a),r=n(176),l=n(305),i=n(306),c=n(20),s=n(16),u=(n(437),n(11));const m=({children:e,className:t,refClassName:n,isOpen:a,onBlur:m,placement:p,modifiers:b,useVisibility:_})=>{p=null!=p?p:"bottom-end",_=null!=_&&_;const g=o.a.useRef(),f=a||_,h=!a&&_,v=Object.assign({preventOverflow:{boundariesElement:document.getElementById(s.a.config.rootId),padding:5}},b),E=()=>{m()},y=e=>{switch(e.key){case"ArrowDown":break;case"Escape":E();break;default:return}e.preventDefault(),e.stopPropagation()};return Object(c.b)(g,E,[g]),Object(c.c)([g],E),o.a.createElement("div",{ref:g,className:Object(u.b)("menu__ref",n)},o.a.createElement(r.c,null,o.a.createElement(l.a,null,t=>e[0](t)),o.a.createElement(i.a,{placement:p,positionFixed:!0,modifiers:v},({ref:n,style:a,placement:r})=>f?o.a.createElement("div",{ref:n,className:"menu",style:d(a,h),"data-placement":r,onKeyDown:y},o.a.createElement("div",{className:"menu__container"+(t?" "+t:"")},e[1])):null)))};function d(e,t){return Object.assign(Object.assign({},e),{opacity:1,pointerEvents:"all",visibility:t?"hidden":"visible"})}const p=({children:e,onClick:t,disabled:n,active:a})=>{const r=Object(u.a)("menu__item",{"--disabled":n,"--active":a});return o.a.createElement("div",{className:r},o.a.createElement("button",{onClick:()=>!a&&!n&&t&&t()},e))},b=({children:e})=>e,_=({children:e})=>o.a.createElement("div",{className:"menu__static"},e)},82:function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var a=n(0),o=n.n(a),r=n(251),l=n.n(r),i=n(380),c=n(20),s=n(13),u=n(176),m=n(305),d=n(306),p=n(11),b=n(16);function _({id:e,value:t,disableAlpha:n,onChange:r}){t=null!=t?t:"#fff";const[_,g]=o.a.useState(t),[f,h]=o.a.useState(!1),v=o.a.useRef(),E=o.a.useRef(),y=o.a.useCallback(()=>h(!1),[]),O=o.a.useCallback(()=>h(e=>!e),[]),C=o.a.useCallback(e=>{g(e.rgb),r&&r(e)},[r]),N=o.a.useCallback(e=>{"Escape"===e.key&&f&&(y(),e.preventDefault(),e.stopPropagation())},[f]);Object(a.useEffect)(()=>g(t),[t]),Object(c.b)(v,y,[E]),Object(c.c)([v,E],y),Object(c.d)("keydown",N,[f]);const w={preventOverflow:{boundariesElement:document.getElementById(b.a.config.rootId),padding:5}};return o.a.createElement(u.c,null,o.a.createElement(m.a,null,({ref:t})=>o.a.createElement("button",{ref:Object(p.d)(v,t),id:e,className:l.a.button,onClick:O},o.a.createElement("span",{className:l.a.colorPreview,style:{backgroundColor:Object(s.a)(_)}}))),o.a.createElement(d.a,{placement:"bottom-end",positionFixed:!0,modifiers:w},({ref:e,style:t})=>f&&o.a.createElement("div",{className:l.a.popper,ref:Object(p.d)(E,e),style:t},o.a.createElement(i.ChromePicker,{color:_,onChange:C,disableAlpha:n}))))}},84:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),o=n.n(a),r=n(375),l=n.n(r),i=n(16),c=n(11);const s=({className:e,children:t})=>{const n=o.a.useCallback(()=>{window.open(i.a.resources.pricingUrl,"_blank")},[]);return o.a.createElement("span",{className:Object(c.b)(l.a.pill,e),onClick:n,tabIndex:-1},"PRO",t)}},90:function(e,t,n){e.exports={list:"AutoPromotionsList__list","fake-pro-list":"AutoPromotionsList__fake-pro-list AutoPromotionsList__list",fakeProList:"AutoPromotionsList__fake-pro-list AutoPromotionsList__list",row:"AutoPromotionsList__row","row-selected":"AutoPromotionsList__row-selected AutoPromotionsList__row",rowSelected:"AutoPromotionsList__row-selected AutoPromotionsList__row","row-box":"AutoPromotionsList__row-box theme__panel",rowBox:"AutoPromotionsList__row-box theme__panel","row-hashtags":"AutoPromotionsList__row-hashtags",rowHashtags:"AutoPromotionsList__row-hashtags","row-summary":"AutoPromotionsList__row-summary",rowSummary:"AutoPromotionsList__row-summary","row-drag-handle":"AutoPromotionsList__row-drag-handle",rowDragHandle:"AutoPromotionsList__row-drag-handle","row-actions":"AutoPromotionsList__row-actions",rowActions:"AutoPromotionsList__row-actions","add-button-row":"AutoPromotionsList__add-button-row",addButtonRow:"AutoPromotionsList__add-button-row","no-hashtags-message":"AutoPromotionsList__no-hashtags-message",noHashtagsMessage:"AutoPromotionsList__no-hashtags-message","row-faded-text":"AutoPromotionsList__row-faded-text",rowFadedText:"AutoPromotionsList__row-faded-text","no-promo-message":"AutoPromotionsList__no-promo-message AutoPromotionsList__row-faded-text",noPromoMessage:"AutoPromotionsList__no-promo-message AutoPromotionsList__row-faded-text","summary-italics":"AutoPromotionsList__summary-italics",summaryItalics:"AutoPromotionsList__summary-italics","summary-bold":"AutoPromotionsList__summary-bold",summaryBold:"AutoPromotionsList__summary-bold"}},92:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var a=n(0),o=n.n(a),r=n(159),l=n.n(r),i=n(10),c=n(152),s=n(255),u=n.n(s),m=n(132),d=n(172),p=n(62);function b(){return o.a.createElement("div",{className:u.a.proUpsell},o.a.createElement(d.a.Consumer,null,e=>e&&o.a.createElement("label",{className:u.a.toggle},o.a.createElement("span",{className:u.a.toggleLabel},"Show PRO features"),o.a.createElement(p.a,{value:e.showFakeOptions,onChange:e.onToggleFakeOptions}))),o.a.createElement(m.a,{url:"https://spotlightwp.com/pricing/?utm_source=sl_plugin&utm_medium=sl_plugin_upgrade&utm_campaign=sl_plugin_upgrade_editor"}))}var _,g=n(12);function f({content:e,sidebar:t,primary:n,current:r,useDefaults:i}){const[s,u]=Object(a.useState)(n),m=()=>u(p?"content":"sidebar"),d=()=>u(p?"sidebar":"content"),p="content"===(n=null!=n?n:"content"),_="sidebar"===n,h="content"===(r=i?s:r),v="sidebar"===r,E=p?l.a.layoutPrimaryContent:l.a.layoutPrimarySidebar;return o.a.createElement(c.a,{breakpoints:[f.BREAKPOINT]},n=>{const a=n<=f.BREAKPOINT;return o.a.createElement("div",{className:E},e&&(h||!a)&&o.a.createElement("div",{className:l.a.content},i&&o.a.createElement(f.Navigation,{align:p?"right":"left",text:!p&&o.a.createElement("span",null,"Go back"),icon:p?"admin-generic":"arrow-left",onClick:p?d:m}),"function"==typeof e?e(a):null!=e?e:null),t&&(v||!a)&&o.a.createElement("div",{className:l.a.sidebar},i&&o.a.createElement(f.Navigation,{align:_?"right":"left",text:!_&&o.a.createElement("span",null,"Go back"),icon:_?"admin-generic":"arrow-left",onClick:_?d:m}),!g.a.isPro&&o.a.createElement(b,null),"function"==typeof t?t(a):null!=t?t:null))})}(_=f||(f={})).BREAKPOINT=968,_.Navigation=function({icon:e,text:t,align:n,onClick:a}){return t=null!=t?t:"Go back",e=null!=e?e:"arrow-left-alt",n=null!=n?n:"left",o.a.createElement("div",{className:"right"===n?l.a.navigationRight:l.a.navigationLeft},o.a.createElement("a",{className:l.a.navLink,onClick:a},e&&o.a.createElement(i.a,{icon:e}),o.a.createElement("span",null,null!=t?t:"")))}},94:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),o=n.n(a),r=n(11),l=n(5),i=(n(436),n(10)),c=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n};function s(e){var{className:t,children:n,isTransitioning:a}=e,l=c(e,["className","children","isTransitioning"]);const i=Object(r.a)("onboarding",{"--transitioning":a});return o.a.createElement("div",Object.assign({className:Object(r.b)(i,t)},l),Array.isArray(n)?n.map((e,t)=>o.a.createElement("div",{key:t},e)):n)}!function(e){e.TRANSITION_DURATION=200,e.Thin=e=>{var{className:t,children:n}=e,a=c(e,["className","children"]);return o.a.createElement("div",Object.assign({className:Object(r.b)("onboarding__thin",t)},a),n)},e.HelpMsg=e=>{var{className:t,children:n}=e,a=c(e,["className","children"]);return o.a.createElement("div",Object.assign({className:Object(r.b)("onboarding__help-msg",t)},a),n)},e.ProTip=({children:t})=>o.a.createElement(e.HelpMsg,null,o.a.createElement("div",{className:"onboarding__pro-tip"},o.a.createElement("span",null,o.a.createElement(i.a,{icon:"lightbulb"}),o.a.createElement("strong",null,"Pro tip!")),t)),e.StepList=e=>{var{className:t,children:n}=e,a=c(e,["className","children"]);return o.a.createElement("ul",Object.assign({className:Object(r.b)("onboarding__steps",t)},a),n)},e.Step=e=>{var{isDone:t,num:n,className:a,children:l}=e,i=c(e,["isDone","num","className","children"]);return o.a.createElement("li",Object.assign({className:Object(r.b)(t?"onboarding__done":null,a)},i),o.a.createElement("strong",null,"Step ",n,":")," ",l)},e.HeroButton=e=>{var t,{className:n,children:a}=e,i=c(e,["className","children"]);return o.a.createElement(l.a,Object.assign({type:null!==(t=i.type)&&void 0!==t?t:l.c.PRIMARY,size:l.b.HERO,className:Object(r.b)("onboarding__hero-button",n)},i),a)}}(s||(s={}))},96:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(0),o=n.n(a),r=n(189),l=n.n(r);function i({children:e,padded:t,disabled:n}){return o.a.createElement("div",{className:n?l.a.disabled:l.a.sidebar},o.a.createElement("div",{className:t?l.a.paddedContent:l.a.content},null!=e?e:null))}!function(e){e.padded=l.a.padded}(i||(i={}))}}]);
ui/dist/common.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],t):"object"==typeof exports?exports.spotlight=t(require("React"),require("ReactDOM")):e.spotlight=t(e.React,e.ReactDOM)}(window,(function(e,t){return(window.webpackJsonpspotlight=window.webpackJsonpspotlight||[]).push([[6],{0:function(t,o){t.exports=e},10:function(e,t,o){"use strict";o.d(t,"a",(function(){return r}));var n=o(0),a=o.n(n),i=o(11);const r=e=>{var{icon:t,className:o}=e,n=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]])}return o}(e,["icon","className"]);return a.a.createElement("span",Object.assign({className:Object(i.b)("dashicons","dashicons-"+t,o)},n))}},107:function(e,t,o){e.exports={root:"MediaTile__root","type-icon":"MediaTile__type-icon",typeIcon:"MediaTile__type-icon","image-type-icon":"MediaTile__image-type-icon MediaTile__type-icon",imageTypeIcon:"MediaTile__image-type-icon MediaTile__type-icon","video-type-icon":"MediaTile__video-type-icon MediaTile__type-icon",videoTypeIcon:"MediaTile__video-type-icon MediaTile__type-icon","album-type-icon":"MediaTile__album-type-icon MediaTile__type-icon",albumTypeIcon:"MediaTile__album-type-icon MediaTile__type-icon",overlay:"MediaTile__overlay layout__fill-parent"}},108:function(e,t,o){e.exports={root:"FeedLayout__root",wrapper:"FeedLayout__wrapper",button:"FeedLayout__button","follow-btn":"FeedLayout__follow-btn FeedLayout__button",followBtn:"FeedLayout__follow-btn FeedLayout__button","load-more-btn":"FeedLayout__load-more-btn FeedLayout__button",loadMoreBtn:"FeedLayout__load-more-btn FeedLayout__button","fake-media":"FeedLayout__fake-media",fakeMedia:"FeedLayout__fake-media","fake-media-flash-animation":"FeedLayout__fake-media-flash-animation",fakeMediaFlashAnimation:"FeedLayout__fake-media-flash-animation"}},11:function(e,t,o){"use strict";function n(...e){return e.filter(e=>!!e).join(" ")}function a(e){return n(...Object.getOwnPropertyNames(e).map(t=>e[t]?t:null))}function i(e,t={}){let o=Object.getOwnPropertyNames(t).map(o=>t[o]?e+o:null);return e+" "+o.filter(e=>!!e).join(" ")}o.d(t,"b",(function(){return n})),o.d(t,"c",(function(){return a})),o.d(t,"a",(function(){return i})),o.d(t,"e",(function(){return r})),o.d(t,"d",(function(){return l}));const r={onMouseDown:e=>e.preventDefault()};function l(...e){return t=>{e.forEach(e=>e&&function(e,t){"function"==typeof e?e(t):e.current=t}(e,t))}}},12:function(e,t,o){"use strict";var n,a=o(8);let i;t.a=i={isPro:!1,config:{restApi:SliCommonL10n.restApi,imagesUrl:SliCommonL10n.imagesUrl,autoPromotions:SliCommonL10n.autoPromotions,globalPromotions:null!==(n=SliCommonL10n.globalPromotions)&&void 0!==n?n:{}},image:e=>`${i.config.imagesUrl}/${e}`},a.a.registerType({id:"link",label:"Link",isValid:()=>!1}),a.a.registerType({id:"-more-",label:"- More promotion types -",isValid:()=>!1}),a.a.Automation.registerType({id:"hashtag",label:"Hashtag",matches:()=>!1})},13:function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e?e:"r"in e?"rgba("+e.r+","+e.g+","+e.b+","+e.a+")":"h"in e?"hsla("+e.h+","+e.s+","+e.l+","+e.a+")":"#fff"},140:function(e,t,o){e.exports={root:"MediaTileIcons__root layout__flex-row",icon:"MediaTileIcons__icon"}},15:function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));var n,a=o(3);!function(e){function t(e,t){return e.hasOwnProperty(t.toString())}function o(e,t){return e[t.toString()]}function n(e,t,o){return e[t.toString()]=o,e}e.has=t,e.get=o,e.set=n,e.ensure=function(o,a,i){return t(o,a)||n(o,a,i),e.get(o,a)},e.withEntry=function(t,o,n){return e.set(Object(a.h)(t),o,n)},e.remove=function(e,t){return delete e[t.toString()],e},e.without=function(t,o){return e.remove(Object(a.h)(t),o)},e.at=function(e,t){return o(e,Object.keys(e)[t])},e.keys=function(e){return Object.keys(e)},e.values=function(e){return Object.values(e)},e.entries=function(e){return Object.getOwnPropertyNames(e).map(t=>[t,e[t]])},e.map=function(t,o){const n={};return e.forEach(t,(e,t)=>n[e]=o(t,e)),n},e.size=function(t){return e.keys(t).length},e.isEmpty=function(t){return 0===e.size(t)},e.equals=function(e,t){return Object(a.p)(e,t)},e.forEach=function(t,o){e.keys(t).forEach(e=>o(e,t[e]))},e.fromArray=function(t){const o={};return t.forEach(([t,n])=>e.set(o,t,n)),o},e.fromMap=function(t){const o={};return t.forEach((t,n)=>e.set(o,n,t)),o}}(n||(n={}))},158:function(e,t,o){"use strict";var n=o(0),a=o.n(n),i=o(165),r=o.n(i),l=o(6),s=o(3);t.a=Object(l.b)((function({media:e,options:t,full:o}){if(!t.showCaptions||!e.type)return null;const n={color:t.captionColor,fontSize:t.captionSize},i=o?0:1,l=e.caption?e.caption:"",c=t.captionMaxLength?Object(s.t)(l,t.captionMaxLength):l,d=Object(s.q)(c,void 0,i,t.captionRemoveDots),u=o?r.a.full:r.a.preview;return a.a.createElement("div",{className:u,style:n},d)}))},159:function(e,t,o){"use strict";var n=o(0),a=o.n(n),i=o(140),r=o.n(i),l=o(6),s=o(17),c=o(10);t.a=Object(l.b)((function({media:e,options:t}){if(!e.type||e.source.type===s.a.Source.Type.PERSONAL_ACCOUNT)return null;const o={fontSize:t.lcIconSize,lineHeight:t.lcIconSize},n=Object.assign(Object.assign({},o),{color:t.likesIconColor}),i=Object.assign(Object.assign({},o),{color:t.commentsIconColor}),l={fontSize:t.lcIconSize,width:t.lcIconSize,height:t.lcIconSize};return t.showLcIcons&&a.a.createElement("div",{className:r.a.root},t.showLikes&&a.a.createElement("div",{className:r.a.icon,style:n},a.a.createElement(c.a,{icon:"heart",style:l}),a.a.createElement("span",null,e.likesCount)),t.showComments&&a.a.createElement("div",{className:r.a.icon,style:i},a.a.createElement(c.a,{icon:"admin-comments",style:l}),a.a.createElement("span",null,e.commentsCount)))}))},162:function(e,t,o){"use strict";var n=o(0),a=o.n(n),i=o(108),r=o.n(i),l=o(6),s=o(24),c=o.n(s),d=o(32),u=o.n(d),m=o(17),h=o(3),p=o(10),g=o(87),f=o.n(g),_=o(11),b=o(4);const y=({comment:e,className:t})=>{const o=e.username?a.a.createElement("a",{key:-1,href:b.b.getUsernameUrl(e.username),target:"_blank",className:f.a.username},e.username):null,n=o?(e,t)=>t>0?e:[o,...e]:void 0,i=Object(h.q)(e.text,n),r=1===e.likeCount?"like":"likes";return a.a.createElement("div",{className:Object(_.b)(f.a.root,t)},a.a.createElement("div",{className:f.a.content},a.a.createElement("div",{key:e.id,className:f.a.text},i)),a.a.createElement("div",{className:f.a.metaList},a.a.createElement("div",{className:f.a.date},Object(h.s)(e.timestamp)),e.likeCount>0&&a.a.createElement("div",{className:f.a.likeCount},`${e.likeCount} ${r}`)))};var v=o(7),x=o(197),M=o.n(x),L=o(166),w=o.n(L);function E(e){var{url:t,caption:o,size:n}=e,i=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]])}return o}(e,["url","caption","size"]);const[r,l]=a.a.useState(!1),s={width:n.width+"px",height:n.height+"px"};return a.a.createElement("img",Object.assign({style:s,className:r?w.a.image:w.a.loading,src:t,alt:o,loading:"eager",onLoad:()=>l(!0)},i))}var O=o(71),S=o.n(O);function C(e){var{album:t,autoplayVideos:o,size:n}=e,i=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]])}return o}(e,["album","autoplayVideos","size"]);const r=a.a.useRef(),[l,s]=a.a.useState(0),c={transform:`translateX(${100*-l}%)`},d=t.length-1,u={width:n.width+"px",height:n.height+"px"};return a.a.createElement("div",{className:S.a.root,style:u},a.a.createElement("div",{className:S.a.strip,style:c},t.map((e,t)=>a.a.createElement("div",{key:e.id,className:S.a.frame,ref:t>0?void 0:r},a.a.createElement(I,Object.assign({media:e,size:n,autoplayVideos:o},i))))),a.a.createElement("div",{className:S.a.controls},a.a.createElement("div",null,l>0&&a.a.createElement("div",{className:S.a.prevButton,onClick:()=>s(Math.max(l-1,0)),role:"button"},a.a.createElement(p.a,{icon:"arrow-left-alt2"}))),a.a.createElement("div",null,l<d&&a.a.createElement("div",{className:S.a.nextButton,onClick:()=>s(Math.min(l+1,d)),role:"button"},a.a.createElement(p.a,{icon:"arrow-right-alt2"})))),a.a.createElement("div",{className:S.a.indicatorList},t.map((e,t)=>a.a.createElement("div",{key:t,className:t===l?S.a.indicatorCurrent:S.a.indicator}))))}var T=o(78),P=o.n(T),k=o(73);function B(e){var{media:t,thumbnailUrl:o,size:i,autoPlay:r,onGetMetaData:l}=e,s=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]])}return o}(e,["media","thumbnailUrl","size","autoPlay","onGetMetaData"]);const c=a.a.useRef(),[d,u]=a.a.useState(!r),[m,g]=a.a.useState(r);Object(n.useEffect)(()=>{r?d&&u(!1):d||u(!0),m&&g(r)},[t.url]),Object(n.useLayoutEffect)(()=>{if(c.current){const e=()=>g(!0),t=()=>g(!1);return c.current.addEventListener("play",e),c.current.addEventListener("pause",t),()=>{c.current.removeEventListener("play",e),c.current.removeEventListener("pause",t)}}},[c.current]);const f={width:i.width+"px",height:i.height+"px"};return a.a.createElement("div",{key:t.url,className:P.a.root,style:f},a.a.createElement(k.a,{className:d?P.a.thumbnail:P.a.thumbnailHidden,media:t,size:h.a.LARGE,width:i.width,height:i.height}),a.a.createElement("video",Object.assign({ref:c,className:d?P.a.videoHidden:P.a.video,src:t.url,autoPlay:r,controls:!1,playsInline:!0,loop:!0,onCanPlay:()=>{r&&c.current.play()}},s),a.a.createElement("source",{src:t.url}),"Your browser does not support videos"),a.a.createElement("div",{className:m?P.a.controlPlaying:P.a.controlPaused,onClick:()=>{c.current&&(d?(u(!1),c.current.currentTime=0,c.current.play()):c.current.paused?c.current.play():c.current.pause())}},a.a.createElement(p.a,{className:P.a.playButton,icon:"controls-play"})))}function I({media:e,size:t,autoplayVideos:o}){if(e.url&&e.url.length>0)switch(e.type){case m.a.Type.IMAGE:return a.a.createElement(E,{url:e.url,size:t,caption:e.caption});case m.a.Type.VIDEO:return a.a.createElement(B,{media:e,size:t,thumbnailUrl:e.thumbnail,autoPlay:o});case m.a.Type.ALBUM:if(e.children&&e.children.length>0)return a.a.createElement(C,{album:e.children,size:t,autoplayVideos:o})}const n={width:t.width,height:t.height};return a.a.createElement("div",{className:M.a.notAvailable,style:n},a.a.createElement("span",null,"Media is not available"))}var A=o(20),N=o(58);const j=new Map;function D({feed:e,mediaList:t,current:o,options:i,onClose:r}){var l,s;const d=t.length-1,[g,f]=a.a.useState(o),_=a.a.useRef(g),x=e=>{f(e),_.current=e;const o=t[_.current];j.has(o.id)?C(j.get(o.id)):(L(!0),Object(h.i)(o,{width:600,height:600}).then(e=>{C(e),j.set(o.id,e)}))},[M,L]=a.a.useState(!1),[w,E]=a.a.useState(function(){const e=window.innerWidth<1080?window.innerWidth/1080*600:600;return{width:e,height:e}}()),[O,S]=a.a.useState(!1),C=e=>{E(e),L(!1),S(e.width+435>=window.innerWidth)};Object(n.useEffect)(()=>{x(o)},[o]),Object(A.l)("resize",()=>{const e=t[_.current];if(j.has(e.id)){let t=j.get(e.id);C(t)}});const T=t[g],P=T.comments?T.comments.slice(0,i.numLightboxComments):[],k=v.a.getLink(T,e.options),B=null!==k.text&&null!==k.url;T.caption&&T.caption.length&&P.splice(0,0,{id:T.id,text:T.caption,timestamp:T.timestamp,username:T.username});let D=null,H=null,z=null;switch(T.source.type){case m.a.Source.Type.PERSONAL_ACCOUNT:case m.a.Source.Type.BUSINESS_ACCOUNT:case m.a.Source.Type.TAGGED_ACCOUNT:D="@"+T.username,H=b.b.getUsernameUrl(T.username);const e=b.b.getByUsername(T.username);z=e?b.b.getProfilePicUrl(e):null;break;case m.a.Source.Type.RECENT_HASHTAG:case m.a.Source.Type.POPULAR_HASHTAG:D="#"+T.source.name,H="https://instagram.com/explore/tags/"+T.source.name}const F={fontSize:i.textSize},R=e=>{x(Math.max(0,_.current-1)),e.stopPropagation(),e.preventDefault()},U=e=>{x(Math.min(d,_.current+1)),e.stopPropagation(),e.preventDefault()},W=e=>{r&&r(),e.stopPropagation(),e.preventDefault()};{Object(n.useEffect)(()=>(document.body.addEventListener("keydown",e),()=>document.body.removeEventListener("keydown",e)),[]);const e=e=>{switch(e.key){case"ArrowRight":U(e);break;case"ArrowLeft":R(e);break;case"Escape":W(e)}}}const V={width:w.width+"px",height:w.height+"px"},G=a.a.createElement("div",{style:F,className:c.a.root,tabIndex:-1},a.a.createElement("div",{className:c.a.shade,onClick:W}),M&&a.a.createElement("div",{className:c.a.loadingSkeleton,style:V}),!M&&a.a.createElement("div",{className:O?c.a.wrapVertical:c.a.wrap},a.a.createElement("div",{className:c.a.container,role:"dialog"},a.a.createElement("div",{className:c.a.frame},M?a.a.createElement(N.a,null):a.a.createElement(I,{key:T.id,media:T,size:w})),e.options.lightboxShowSidebar&&a.a.createElement("div",{className:c.a.sidebar},a.a.createElement("div",{className:c.a.sidebarHeader},z&&a.a.createElement("a",{href:H,target:"_blank",className:c.a.sidebarHeaderPicLink},a.a.createElement("img",{className:c.a.sidebarHeaderPic,src:z,alt:null!=D?D:""})),D&&a.a.createElement("div",{className:c.a.sidebarSourceName},a.a.createElement("a",{href:H,target:"_blank"},D))),a.a.createElement("div",{className:c.a.sidebarScroller},P.length>0&&a.a.createElement("div",{className:c.a.sidebarCommentList},P.map((e,t)=>a.a.createElement(y,{key:t,comment:e,className:c.a.sidebarComment})))),a.a.createElement("div",{className:c.a.sidebarFooter},a.a.createElement("div",{className:c.a.sidebarInfo},T.source.type!==m.a.Source.Type.PERSONAL_ACCOUNT&&a.a.createElement("div",{className:c.a.sidebarNumLikes},a.a.createElement("span",null,T.likesCount)," ",a.a.createElement("span",null,"likes")),T.timestamp&&a.a.createElement("div",{className:c.a.sidebarDate},Object(h.s)(T.timestamp))),a.a.createElement("div",{className:c.a.sidebarIgLink},a.a.createElement("a",{href:null!==(l=k.url)&&void 0!==l?l:T.permalink,target:k.newTab?"_blank":"_self"},a.a.createElement(p.a,{icon:B?"external":"instagram"}),a.a.createElement("span",null,null!==(s=k.text)&&void 0!==s?s:"View on Instagram")))))),g>0&&a.a.createElement("div",{className:c.a.prevButtonContainer},a.a.createElement("div",{className:c.a.prevButton,onClick:R,role:"button",tabIndex:0},a.a.createElement(p.a,{icon:"arrow-left-alt",className:c.a.buttonIcon}))),g<t.length-1&&a.a.createElement("div",{className:c.a.nextButtonContainer},a.a.createElement("div",{className:c.a.nextButton,onClick:U,role:"button",tabIndex:0},a.a.createElement(p.a,{icon:"arrow-right-alt",className:c.a.buttonIcon})))),a.a.createElement("div",{className:c.a.closeButton,onClick:W,role:"button",tabIndex:0},a.a.createElement(p.a,{icon:"no-alt",className:c.a.buttonIcon})));return u.a.createPortal(G,document.body)}var H=o(49),z=o.n(H),F=o(167),R=o.n(F);const U=Object(l.b)(({options:e})=>{const t="https://instagram.com/"+e.account.username,o={color:e.followBtnTextColor,backgroundColor:e.followBtnBgColor};return a.a.createElement("a",{href:t,target:"__blank",className:R.a.link},a.a.createElement("button",{className:R.a.button,style:o},e.followBtnText))});var W=o(44),V=o.n(W),G=o(137),q=o(145),K=Object(l.b)((function({stories:e,options:t,onClose:o}){const[i,r]=a.a.useState(0),l=e.length-1,[s,c]=a.a.useState(0),[d,h]=a.a.useState(0);Object(n.useEffect)(()=>{0!==s&&c(0)},[i]);const g=i<l,f=i>0,_=()=>o&&o(),b=()=>i<l?r(i+1):_(),y=()=>r(e=>Math.max(e-1,0)),v=e[i],x="https://instagram.com/"+t.account.username,M=v.type===m.a.Type.VIDEO?d:t.storiesInterval;Object(A.d)("keydown",e=>{switch(e.key){case"Escape":_();break;case"ArrowLeft":y();break;case"ArrowRight":b();break;default:return}e.preventDefault(),e.stopPropagation()});const L=a.a.createElement("div",{className:V.a.root},a.a.createElement("div",{className:V.a.container},a.a.createElement("div",{className:V.a.header},a.a.createElement("a",{href:x,target:"_blank"},a.a.createElement("img",{className:V.a.profilePicture,src:t.profilePhotoUrl,alt:t.account.username})),a.a.createElement("a",{href:x,className:V.a.username,target:"_blank"},t.account.username),a.a.createElement("div",{className:V.a.date},Object(G.a)(Object(q.a)(v.timestamp),{addSuffix:!0}))),a.a.createElement("div",{className:V.a.progress},e.map((e,t)=>a.a.createElement($,{key:e.id,duration:M,animate:t===i,isDone:t<i}))),a.a.createElement("div",{className:V.a.content},f&&a.a.createElement("div",{className:V.a.prevButton,onClick:y,role:"button"},a.a.createElement(p.a,{icon:"arrow-left-alt2"})),a.a.createElement("div",{className:V.a.media},a.a.createElement(X,{key:v.id,media:v,imgDuration:t.storiesInterval,onGetDuration:h,onEnd:()=>g?b():_()})),g&&a.a.createElement("div",{className:V.a.nextButton,onClick:b,role:"button"},a.a.createElement(p.a,{icon:"arrow-right-alt2"})),a.a.createElement("div",{className:V.a.closeButton,onClick:_,role:"button"},a.a.createElement(p.a,{icon:"no-alt"})))));return u.a.createPortal(L,document.body)}));function $({animate:e,isDone:t,duration:o}){const n=e?V.a.progressOverlayAnimating:t?V.a.progressOverlayDone:V.a.progressOverlay,i={animationDuration:o+"s"};return a.a.createElement("div",{className:V.a.progressSegment},a.a.createElement("div",{className:n,style:i}))}function X({media:e,imgDuration:t,onGetDuration:o,onEnd:n}){return e.type===m.a.Type.VIDEO?a.a.createElement(J,{media:e,onEnd:n,onGetDuration:o}):a.a.createElement(Y,{media:e,onEnd:n,duration:t})}function Y({media:e,duration:t,onEnd:o}){const[i,r]=a.a.useState(!1);return Object(n.useEffect)(()=>{const e=i?setTimeout(o,1e3*t):null;return()=>clearTimeout(e)},[e,i]),a.a.createElement("img",{src:e.url,onLoad:()=>r(!0),loading:"eager",alt:""})}function J({media:e,onEnd:t,onGetDuration:o}){const n=a.a.useRef();return a.a.createElement("video",{ref:n,src:e.url,poster:e.thumbnail,autoPlay:!0,controls:!1,playsInline:!0,loop:!1,onCanPlay:()=>o(n.current.duration),onEnded:t},a.a.createElement("source",{src:e.url}),"Your browser does not support embedded videos")}var Q=Object(l.b)((function({feed:e,options:t}){const[o,n]=a.a.useState(null),i=t.account,r="https://instagram.com/"+i.username,l=e.stories.filter(e=>e.username===i.username),s=l.length>0,c=t.headerInfo.includes(v.a.HeaderInfo.MEDIA_COUNT),d=t.headerInfo.includes(v.a.HeaderInfo.FOLLOWERS)&&i.type!=b.a.Type.PERSONAL,u=t.headerInfo.includes(v.a.HeaderInfo.PROFILE_PIC),m=t.includeStories&&s,h=t.headerStyle===v.a.HeaderStyle.BOXED,p={fontSize:t.headerTextSize,color:t.headerTextColor,backgroundColor:t.headerBgColor,padding:t.headerPadding},g=m?"button":void 0,f={width:t.headerPhotoSize,height:t.headerPhotoSize,cursor:m?"pointer":"normal"},_=t.showFollowBtn&&(t.followBtnLocation===v.a.FollowBtnLocation.HEADER||t.followBtnLocation===v.a.FollowBtnLocation.BOTH),y={justifyContent:t.showBio&&h?"flex-start":"center"},x=a.a.createElement("img",{src:t.profilePhotoUrl,alt:i.username}),M=m&&s?z.a.profilePicWithStories:z.a.profilePic;return a.a.createElement("div",{className:Z(t.headerStyle),style:p},a.a.createElement("div",{className:z.a.leftContainer},u&&a.a.createElement("div",{className:M,style:f,role:g,onClick:()=>{m&&n(0)}},m?x:a.a.createElement("a",{href:r,target:"_blank"},x)),a.a.createElement("div",{className:z.a.info},a.a.createElement("div",{className:z.a.username},a.a.createElement("a",{href:r,target:"_blank",style:{color:t.headerTextColor}},a.a.createElement("span",null,"@"),a.a.createElement("span",null,i.username))),t.showBio&&a.a.createElement("div",{className:z.a.bio},t.bioText),(c||d)&&a.a.createElement("div",{className:z.a.counterList},c&&a.a.createElement("div",{className:z.a.counter},a.a.createElement("span",null,i.mediaCount)," posts"),d&&a.a.createElement("div",{className:z.a.counter},a.a.createElement("span",null,i.followersCount)," followers")))),a.a.createElement("div",{className:z.a.rightContainer},_&&a.a.createElement("div",{className:z.a.followButton,style:y},a.a.createElement(U,{options:t}))),m&&null!==o&&a.a.createElement(K,{stories:l,options:t,onClose:()=>{n(null)}}))}));function Z(e){switch(e){case v.a.HeaderStyle.NORMAL:return z.a.normalStyle;case v.a.HeaderStyle.CENTERED:return z.a.centeredStyle;case v.a.HeaderStyle.BOXED:return z.a.boxedStyle;default:return}}var ee=o(198),te=o.n(ee);const oe=Object(l.b)(({feed:e,options:t})=>{const o=a.a.useRef(),n=Object(A.j)(o,{block:"end",inline:"nearest"}),i={color:t.loadMoreBtnTextColor,backgroundColor:t.loadMoreBtnBgColor};return a.a.createElement("button",{ref:o,className:te.a.root,style:i,onClick:()=>{n(),e.loadMore()}},e.isLoading?a.a.createElement("span",null,"Loading ..."):a.a.createElement("span",null,e.options.loadMoreBtnText))});t.a=Object(l.b)((function({children:e,feed:t,options:o}){const[n,i]=a.a.useState(null),l={width:o.feedWidth,height:o.feedHeight,fontSize:o.textSize},s={backgroundColor:o.bgColor,padding:o.feedPadding},c={marginBottom:o.imgPadding},d={marginTop:o.buttonPadding},u=o.showHeader&&a.a.createElement("div",{style:c},a.a.createElement(Q,{feed:t,options:o})),m=o.showLoadMoreBtn&&t.canLoadMore&&a.a.createElement("div",{className:r.a.loadMoreBtn,style:d},a.a.createElement(oe,{feed:t,options:o})),h=o.showFollowBtn&&(o.followBtnLocation===v.a.FollowBtnLocation.BOTTOM||o.followBtnLocation===v.a.FollowBtnLocation.BOTH)&&a.a.createElement("div",{className:r.a.followBtn,style:d},a.a.createElement(U,{options:o})),p=new Array(o.numPosts).fill(r.a.fakeMedia);return a.a.createElement("div",{className:r.a.root,style:l},a.a.createElement("div",{className:r.a.wrapper,style:s},e({mediaList:t.media,openMedia:function(e){const n=t.media[e];if(!t.options.promotionEnabled||!v.a.executeMediaClick(n,t.options))switch(o.linkBehavior){case v.a.LinkBehavior.LIGHTBOX:return void i(e);case v.a.LinkBehavior.NEW_TAB:return void window.open(n.permalink,"_blank");case v.a.LinkBehavior.SELF:return void window.open(n.permalink,"_self")}},header:u,loadMoreBtn:m,followBtn:h,loadingMedia:p})),null!==n&&a.a.createElement(D,{feed:t,mediaList:t.media,current:n,options:o,onClose:()=>i(null)}))}))},163:function(e,t,o){"use strict";var n=o(107),a=o.n(n),i=o(0),r=o.n(i),l=o(17),s=o(6),c=o(53),d=o.n(c),u=o(145),m=o(617),h=o(616),p=o(7),g=o(10),f=o(3),_=Object(s.b)((function({options:e,media:t}){var o;const n=r.a.useRef(),[a,s]=r.a.useState(null);Object(i.useEffect)(()=>{n.current&&s(n.current.getBoundingClientRect().width)},[]);let c=e.hoverInfo.some(e=>e===p.a.HoverInfo.LIKES_COMMENTS);c=c&&(t.source.type!==l.a.Source.Type.PERSONAL_ACCOUNT||t.source.type===l.a.Source.Type.PERSONAL_ACCOUNT&&t.likesCount+t.commentsCount>0);const _=e.hoverInfo.some(e=>e===p.a.HoverInfo.CAPTION),b=e.hoverInfo.some(e=>e===p.a.HoverInfo.USERNAME),y=e.hoverInfo.some(e=>e===p.a.HoverInfo.DATE),v=e.hoverInfo.some(e=>e===p.a.HoverInfo.INSTA_LINK),x=null!==(o=t.caption)&&void 0!==o?o:"",M=t.timestamp?Object(u.a)(t.timestamp):null,L=t.timestamp?Object(m.a)(M).toString():null,w=t.timestamp?Object(h.a)(M,"HH:mm - do MMM yyyy"):null,E=t.timestamp?Object(f.s)(t.timestamp):null,O={color:e.textColorHover,backgroundColor:e.bgColorHover};let S=null;if(null!==a){const o=Math.sqrt(1.3*(a+30)),n=Math.sqrt(1.6*a+100),i=Math.max(o,8)+"px",l=Math.max(n,8)+"px",s={fontSize:i},u={fontSize:i,width:i,height:i},m={color:e.textColorHover,fontSize:l,width:l,height:l};S=r.a.createElement("div",{className:d.a.rows},r.a.createElement("div",{className:d.a.topRow},b&&t.username&&r.a.createElement("div",{className:d.a.username},r.a.createElement("a",{href:"https://instagram.com/"+t.username,target:"_blank"},"@",t.username)),_&&t.caption&&r.a.createElement("div",{className:d.a.caption},x)),r.a.createElement("div",{className:d.a.middleRow},c&&r.a.createElement("div",{className:d.a.counterList},r.a.createElement("span",{className:d.a.likesCount,style:s},r.a.createElement(g.a,{icon:"heart",style:u})," ",t.likesCount),r.a.createElement("span",{className:d.a.commentsCount,style:s},r.a.createElement(g.a,{icon:"admin-comments",style:u})," ",t.commentsCount))),r.a.createElement("div",{className:d.a.bottomRow},y&&t.timestamp&&r.a.createElement("div",{className:d.a.date},r.a.createElement("time",{dateTime:L,title:w},E)),v&&r.a.createElement("a",{className:d.a.igLinkIcon,href:t.permalink,title:x,target:"_blank",style:m,onClick:e=>e.stopPropagation()},r.a.createElement(g.a,{icon:"instagram",style:m}))))}return r.a.createElement("div",{ref:n,className:d.a.root,style:O},S)})),b=o(12),y=o(73);t.a=Object(s.b)((function({media:e,options:t,forceOverlay:o,onClick:n}){const[i,s]=r.a.useState(!1),c=function(e){switch(e.type){case l.a.Type.IMAGE:return a.a.imageTypeIcon;case l.a.Type.VIDEO:return a.a.videoTypeIcon;case l.a.Type.ALBUM:return a.a.albumTypeIcon;default:return}}(e),d={backgroundImage:`url(${b.a.image("ig-type-sprites.png")})`};return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:a.a.root,onClick:e=>{n&&n(e)},onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1)},r.a.createElement(y.a,{media:e}),r.a.createElement("div",{className:c,style:d}),(i||o)&&r.a.createElement("div",{className:a.a.overlay},r.a.createElement(_,{media:e,options:t}))))}))},165:function(e,t,o){e.exports={root:"MediaTileCaption__root",preview:"MediaTileCaption__preview MediaTileCaption__root",full:"MediaTileCaption__full MediaTileCaption__root"}},166:function(e,t,o){e.exports={image:"MediaLightboxImage__image MediaLightboxObject__media",loading:"MediaLightboxImage__loading MediaLightboxObject__media MediaLightboxObject__loading-animation"}},167:function(e,t,o){e.exports={link:"FollowButton__link",button:"FollowButton__button feed__feed-button"}},17:function(e,t,o){"use strict";var n;o.d(t,"a",(function(){return n})),function(e){let t,o;!function(e){e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.ALBUM="CAROUSEL_ALBUM"}(t=e.Type||(e.Type={})),function(e){let t;!function(e){e.PERSONAL_ACCOUNT="PERSONAL_ACCOUNT",e.BUSINESS_ACCOUNT="BUSINESS_ACCOUNT",e.TAGGED_ACCOUNT="TAGGED_ACCOUNT",e.RECENT_HASHTAG="RECENT_HASHTAG",e.POPULAR_HASHTAG="POPULAR_HASHTAG",e.USER_STORY="USER_STORY"}(t=e.Type||(e.Type={}))}(o=e.Source||(e.Source={})),e.getAsRows=(e,t)=>{e=e.slice(),t=t>0?t:1;let o=[];for(;e.length;)o.push(e.splice(0,t));if(o.length>0){const e=o.length-1;for(;o[e].length<t;)o[e].push({})}return o},e.isFromHashtag=e=>e.source.type===o.Type.POPULAR_HASHTAG||e.source.type===o.Type.RECENT_HASHTAG}(n||(n={}))},19:function(e,t,o){"use strict";var n=o(33),a=o.n(n),i=o(12),r=o(34);const l=i.a.config.restApi.baseUrl,s={};i.a.config.restApi.authToken&&(s["X-Sli-Auth-Token"]=i.a.config.restApi.authToken);const c=a.a.create({baseURL:l,headers:s}),d={config:i.a.config.restApi,driver:c,getAccounts:()=>c.get("/accounts"),getFeeds:()=>c.get("/feeds"),getFeedMedia:(e,t=0,o=0,n)=>{const i=n?new a.a.CancelToken(n):void 0;return c.post("/media/fetch",{options:e,num:o,from:t},{cancelToken:i})},getMedia:(e=0,t=0)=>c.get(`/media?num=${e}&offset=${t}`),getErrorReason:e=>{let t;return"object"==typeof e.response&&(e=e.response.data),t="string"==typeof e.message?e.message:e.toString(),Object(r.b)(t)}};t.a=d},196:function(e,t,o){"use strict";var n=o(0),a=o.n(n),i=o(62),r=o.n(i),l=o(6),s=o(163),c=o(158),d=o(159),u=o(162),m=o(11),h=o(3);t.a=Object(l.b)((function({feed:e,options:t,cellClassName:o}){const i=a.a.useRef(),[l,p]=a.a.useState(0);Object(n.useLayoutEffect)(()=>{i.current&&p(i.current.getBoundingClientRect().height)},[t]),o=null!=o?o:()=>{};const g={gridGap:t.imgPadding,gridTemplateColumns:`repeat(${t.numColumns}, auto)`},f={paddingBottom:`calc(100% + ${l}px)`};return a.a.createElement(u.a,{feed:e,options:t},({mediaList:n,openMedia:l,header:u,loadMoreBtn:p,followBtn:_,loadingMedia:b})=>a.a.createElement("div",{className:r.a.root},u,(!e.isLoading||e.isLoadingMore)&&a.a.createElement("div",{className:r.a.grid,style:g},e.media.length?n.map((e,n)=>a.a.createElement("div",{key:`${n}-${e.id}`,className:Object(m.b)(r.a.cell,o(e,n)),style:f},a.a.createElement("div",{className:r.a.cellContent},a.a.createElement("div",{className:r.a.mediaContainer},a.a.createElement(s.a,{media:e,onClick:()=>l(n),options:t})),a.a.createElement("div",{className:r.a.mediaMeta,ref:i},a.a.createElement(c.a,{options:t,media:e}),a.a.createElement(d.a,{options:t,media:e}))))):null,e.isLoadingMore&&b.map((e,t)=>a.a.createElement("div",{key:"fake-media-"+Object(h.u)(),className:Object(m.b)(r.a.loadingCell,e,o(null,t))}))),e.isLoading&&!e.isLoadingMore&&a.a.createElement("div",{className:r.a.grid,style:g},b.map((e,t)=>a.a.createElement("div",{key:"fake-media-"+Object(h.u)(),className:Object(m.b)(r.a.loadingCell,e,o(null,t))}))),a.a.createElement("div",{className:r.a.buttonList},p,_)))}))},197:function(e,t,o){e.exports={media:"MediaLightboxObject__media","not-available":"MediaLightboxObject__not-available MediaLightboxObject__media",notAvailable:"MediaLightboxObject__not-available MediaLightboxObject__media","loading-animation":"MediaLightboxObject__loading-animation",loadingAnimation:"MediaLightboxObject__loading-animation",loading:"MediaLightboxObject__loading"}},198:function(e,t,o){e.exports={root:"LoadMoreButton__root feed__feed-button"}},2:function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));var n,a=o(1),i=function(e,t,o,n){var a,i=arguments.length,r=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(i<3?a(r):i>3?a(t,o,r):a(t,o))||r);return i>3&&r&&Object.defineProperty(t,o,r),r};!function(e){class t{constructor(e,t,o){this.prop=e,this.name=t,this.icon=o}}t.DESKTOP=new t("desktop","Desktop","desktop"),t.TABLET=new t("tablet","Tablet","tablet"),t.PHONE=new t("phone","Phone","smartphone"),e.Mode=t,e.MODES=[t.DESKTOP,t.TABLET,t.PHONE];class o{constructor(e,t,o){this.desktop=e,this.tablet=t,this.phone=o}get(e,t){return n(this,e,t)}set(e,t){r(this,t,e)}with(e,t){const n=l(this,t,e);return new o(n.desktop,n.tablet,n.phone)}}function n(e,t,o=!1){if(!e)return;const n=e[t.prop];return o&&null==n?e.desktop:n}function r(e,t,o){return e[o.prop]=t,e}function l(e,t,n){return r(new o(e.desktop,e.tablet,e.phone),t,n)}i([a.n],o.prototype,"desktop",void 0),i([a.n],o.prototype,"tablet",void 0),i([a.n],o.prototype,"phone",void 0),e.Value=o,e.getName=function(e){return e.name},e.getIcon=function(e){return e.icon},e.cycle=function(o){const n=e.MODES.findIndex(e=>e===o);return void 0===n?t.DESKTOP:e.MODES[(n+1)%e.MODES.length]},e.get=n,e.set=r,e.withValue=l,e.normalize=function(e,t){return null==e?t.hasOwnProperty("all")?new o(t.all,t.all,t.all):new o(t.desktop,t.tablet,t.phone):"object"==typeof e&&e.hasOwnProperty("desktop")?new o(e.desktop,e.tablet,e.phone):new o(e,e,e)},e.getModeForWindowSize=function(e){return e.width<=768?t.PHONE:e.width<=935?t.TABLET:t.DESKTOP},e.isValid=function(e){return"object"==typeof e&&e.hasOwnProperty("desktop")}}(n||(n={}))},20:function(e,t,o){"use strict";o.d(t,"i",(function(){return l})),o.d(t,"e",(function(){return s})),o.d(t,"b",(function(){return c})),o.d(t,"c",(function(){return d})),o.d(t,"a",(function(){return u})),o.d(t,"m",(function(){return m})),o.d(t,"g",(function(){return h})),o.d(t,"k",(function(){return p})),o.d(t,"j",(function(){return g})),o.d(t,"d",(function(){return _})),o.d(t,"l",(function(){return b})),o.d(t,"f",(function(){return y})),o.d(t,"h",(function(){return v}));var n=o(0),a=o.n(n),i=o(42),r=o(29);function l(e,t){!function(e,t,o){const n=a.a.useRef(!0);e(()=>{n.current=!0;const e=t(()=>new Promise(e=>{n.current&&e()}));return()=>{n.current=!1,e&&e()}},o)}(n.useEffect,e,t)}function s(e){const[t,o]=a.a.useState(e),n=a.a.useRef(t);return[t,()=>n.current,e=>o(n.current=e)]}function c(e,t,o=[]){function a(n){!e.current||e.current.contains(n.target)||o.some(e=>e&&e.current&&e.current.contains(n.target))||t(n)}Object(n.useEffect)(()=>(document.addEventListener("mousedown",a),document.addEventListener("touchend",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchend",a)}))}function d(e,t){Object(n.useEffect)(()=>{const o=()=>{0===e.filter(e=>!e.current||document.activeElement===e.current||e.current.contains(document.activeElement)).length&&t()};return document.addEventListener("keyup",o),()=>document.removeEventListener("keyup",o)},e)}function u(e,t,o=100){const[i,r]=a.a.useState(e);return Object(n.useEffect)(()=>{let n=null;return e===t?n=setTimeout(()=>r(t),o):r(!t),()=>{null!==n&&clearTimeout(n)}},[e]),[i,r]}function m(e){const[t,o]=a.a.useState(Object(r.b)()),i=()=>{const t=Object(r.b)();o(t),e&&e(t)};return Object(n.useEffect)(()=>(i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)),[]),t}function h(){return new URLSearchParams(Object(i.e)().search)}function p(e,t){const o=o=>{if(t)return(o||window.event).returnValue=e,e};Object(n.useEffect)(()=>(window.addEventListener("beforeunload",o),()=>window.removeEventListener("beforeunload",o)),[t])}function g(e,t){const o=a.a.useRef(!1);return Object(n.useEffect)(()=>{o.current&&void 0!==e.current&&(e.current.scrollIntoView(Object.assign({behavior:"smooth",block:"start"},null!=t?t:{})),o.current=!1)},[o.current]),()=>o.current=!0}function f(e,t,o,a=[],i=[]){Object(n.useEffect)(()=>(a.reduce((e,t)=>e&&t,!0)&&e.addEventListener(t,o),()=>e.removeEventListener(t,o)),i)}function _(e,t,o=[],n=[]){f(document,e,t,o,n)}function b(e,t,o=[],n=[]){f(window,e,t,o,n)}function y(e){return t=>{" "!==t.key&&"Enter"!==t.key||(e(),t.preventDefault(),t.stopPropagation())}}function v(e){const[t,o]=a.a.useState(e);return[function(e){const t=a.a.useRef(e);return t.current=e,t}(t),o]}o(34)},24:function(e,t,o){e.exports={root:"MediaLightbox__root layout__fill-parent layout__z-higher layout__flex-row layout__flex-center layout__no-overflow",shade:"MediaLightbox__shade layout__fill-parent layout__z-low","loading-skeleton":"MediaLightbox__loading-skeleton layout__z-high",loadingSkeleton:"MediaLightbox__loading-skeleton layout__z-high",wrap:"MediaLightbox__wrap","wrap-vertical":"MediaLightbox__wrap-vertical MediaLightbox__wrap layout__z-high",wrapVertical:"MediaLightbox__wrap-vertical MediaLightbox__wrap layout__z-high",container:"MediaLightbox__container layout__flex-row",sidebar:"MediaLightbox__sidebar layout__flex-column layout__scroll-y","sidebar-element":"MediaLightbox__sidebar-element",sidebarElement:"MediaLightbox__sidebar-element",frame:"MediaLightbox__frame layout__flex-column layout__flex-center","nav-button-container":"MediaLightbox__nav-button-container layout__flex-column layout__flex-center",navButtonContainer:"MediaLightbox__nav-button-container layout__flex-column layout__flex-center","next-button-container":"MediaLightbox__next-button-container MediaLightbox__nav-button-container layout__flex-column layout__flex-center",nextButtonContainer:"MediaLightbox__next-button-container MediaLightbox__nav-button-container layout__flex-column layout__flex-center","prev-button-container":"MediaLightbox__prev-button-container MediaLightbox__nav-button-container layout__flex-column layout__flex-center",prevButtonContainer:"MediaLightbox__prev-button-container MediaLightbox__nav-button-container layout__flex-column layout__flex-center",button:"MediaLightbox__button layout__z-low","button-icon":"MediaLightbox__button-icon",buttonIcon:"MediaLightbox__button-icon","close-button":"MediaLightbox__close-button MediaLightbox__button layout__z-low",closeButton:"MediaLightbox__close-button MediaLightbox__button layout__z-low","next-button":"MediaLightbox__next-button MediaLightbox__button layout__z-low",nextButton:"MediaLightbox__next-button MediaLightbox__button layout__z-low","prev-button":"MediaLightbox__prev-button MediaLightbox__button layout__z-low",prevButton:"MediaLightbox__prev-button MediaLightbox__button layout__z-low","sidebar-element-bordered":"MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element",sidebarElementBordered:"MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element","sidebar-header":"MediaLightbox__sidebar-header MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element layout__flex-row",sidebarHeader:"MediaLightbox__sidebar-header MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element layout__flex-row","sidebar-header-pic":"MediaLightbox__sidebar-header-pic",sidebarHeaderPic:"MediaLightbox__sidebar-header-pic","sidebar-header-pic-link":"MediaLightbox__sidebar-header-pic-link MediaLightbox__sidebar-header-pic",sidebarHeaderPicLink:"MediaLightbox__sidebar-header-pic-link MediaLightbox__sidebar-header-pic","sidebar-scroller":"MediaLightbox__sidebar-scroller layout__scroll-y",sidebarScroller:"MediaLightbox__sidebar-scroller layout__scroll-y","sidebar-comment-list":"MediaLightbox__sidebar-comment-list MediaLightbox__sidebar-element layout__flex-column",sidebarCommentList:"MediaLightbox__sidebar-comment-list MediaLightbox__sidebar-element layout__flex-column","sidebar-comment":"MediaLightbox__sidebar-comment",sidebarComment:"MediaLightbox__sidebar-comment","sidebar-source-name":"MediaLightbox__sidebar-source-name",sidebarSourceName:"MediaLightbox__sidebar-source-name","sidebar-footer":"MediaLightbox__sidebar-footer layout__flex-column",sidebarFooter:"MediaLightbox__sidebar-footer layout__flex-column","sidebar-info":"MediaLightbox__sidebar-info layout__flex-column MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element",sidebarInfo:"MediaLightbox__sidebar-info layout__flex-column MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element","sidebar-info-line":"MediaLightbox__sidebar-info-line",sidebarInfoLine:"MediaLightbox__sidebar-info-line","sidebar-num-likes":"MediaLightbox__sidebar-num-likes MediaLightbox__sidebar-info-line",sidebarNumLikes:"MediaLightbox__sidebar-num-likes MediaLightbox__sidebar-info-line","sidebar-date":"MediaLightbox__sidebar-date MediaLightbox__sidebar-info-line",sidebarDate:"MediaLightbox__sidebar-date MediaLightbox__sidebar-info-line","sidebar-ig-link":"MediaLightbox__sidebar-ig-link MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element",sidebarIgLink:"MediaLightbox__sidebar-ig-link MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element"}},27:function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));class n{static getById(e){const t=n.list.find(t=>t.id===e);return!t&&n.list.length>0?n.list[0]:t}static getName(e){const t=n.getById(e);return t?t.name:"(Missing layout)"}static addLayout(e){n.list.push(e)}}n.list=[]},29:function(e,t,o){"use strict";function n(e,t,o={}){return window.open(e,t,function(e={}){return Object.getOwnPropertyNames(e).map(t=>`${t}=${e[t]}`).join(",")}(o))}function a(e,t){return{top:window.top.outerHeight/2+window.top.screenY-t/2,left:window.top.outerWidth/2+window.top.screenX-e/2,width:e,height:t}}function i(){const{innerWidth:e,innerHeight:t}=window;return{width:e,height:t}}o.d(t,"c",(function(){return n})),o.d(t,"a",(function(){return a})),o.d(t,"b",(function(){return i}))},3:function(e,t,o){"use strict";o.d(t,"u",(function(){return d})),o.d(t,"h",(function(){return u})),o.d(t,"b",(function(){return m})),o.d(t,"v",(function(){return h})),o.d(t,"c",(function(){return p})),o.d(t,"e",(function(){return g})),o.d(t,"p",(function(){return f})),o.d(t,"o",(function(){return _})),o.d(t,"k",(function(){return b})),o.d(t,"f",(function(){return y})),o.d(t,"n",(function(){return v})),o.d(t,"q",(function(){return x})),o.d(t,"a",(function(){return M})),o.d(t,"t",(function(){return L})),o.d(t,"s",(function(){return w})),o.d(t,"r",(function(){return E})),o.d(t,"i",(function(){return O})),o.d(t,"j",(function(){return S})),o.d(t,"m",(function(){return C})),o.d(t,"g",(function(){return T})),o.d(t,"d",(function(){return P})),o.d(t,"l",(function(){return k}));var n=o(0),a=o.n(n),i=o(137),r=o(145),l=o(17),s=o(48);let c=0;function d(){return c++}function u(e){const t={};return Object.keys(e).forEach(o=>{const n=e[o];Array.isArray(n)?t[o]=n.slice():n instanceof Map?t[o]=new Map(n.entries()):t[o]="object"==typeof n?u(n):n}),t}function m(e,t){return Object.keys(t).forEach(o=>{e[o]=t[o]}),e}function h(e,t){return m(u(e),t)}function p(e,t){return Array.isArray(e)&&Array.isArray(t)?g(e,t):e instanceof Map&&t instanceof Map?g(Array.from(e.entries()),Array.from(t.entries())):"object"==typeof e&&"object"==typeof t?f(e,t):e===t}function g(e,t,o){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(o){if(!o(e[n],t[n]))return!1}else if(!p(e[n],t[n]))return!1;return!0}function f(e,t){if(!e||!t||"object"!=typeof e||"object"!=typeof t)return p(e,t);const o=Object.keys(e),n=Object.keys(t);if(o.length!==n.length)return!1;const a=new Set(o.concat(n));for(const o of a)if(!p(e[o],t[o]))return!1;return!0}function _(e){return 0===Object.keys(null!=e?e:{}).length}function b(e,t,o){return o=null!=o?o:(e,t)=>e===t,e.filter(e=>!t.some(t=>o(e,t)))}function y(e,t,o){return o=null!=o?o:(e,t)=>e===t,e.every(e=>t.some(t=>o(e,t)))&&t.every(t=>e.some(e=>o(t,e)))}function v(e,t){return 0===e.tag.localeCompare(t.tag)&&e.sort===t.sort}function x(e,t,o=0,i=!1){let r=e.trim();i&&(r=r.replace(/((?:^[.*•]+(\r\n|\r|\n))+)/gm,"\n"));const l=r.split("\n"),s=l.map((e,o)=>{if(e=e.trim(),i&&/^[.*•]$/.test(e))return null;let r,s=[];for(;null!==(r=/#([^\s]+)/g.exec(e));){const t="https://instagram.com/explore/tags/"+r[1],o=a.a.createElement("a",{href:t,target:"_blank",key:d()},r[0]),n=e.substr(0,r.index),i=e.substr(r.index+r[0].length);s.push(n),s.push(o),e=i}return e.length&&s.push(e),t&&(s=t(s,o)),l.length>1&&s.push(a.a.createElement("br",{key:d()})),a.a.createElement(n.Fragment,{key:d()},s)});return o>0?s.slice(0,o):s}var M;function L(e,t){const o=/(\s+)/g;let n,a=0,i=0,r="";for(;null!==(n=o.exec(e))&&a<t;){const t=n.index+n[1].length;r+=e.substr(i,t-i),i=t,a++}return i<e.length&&(r+=" ..."),r}function w(e){return Object(i.a)(Object(r.a)(e),{addSuffix:!0})}function E(e,t){const o=[];return e.forEach((e,n)=>{const a=n%t;Array.isArray(o[a])?o[a].push(e):o[a]=[e]}),o}function O(e,t){return function e(t){if(t.type===l.a.Type.VIDEO){const e=document.createElement("video");return e.autoplay=!1,e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.visibility="hidden",document.body.appendChild(e),new Promise(o=>{e.src=t.url,e.addEventListener("loadeddata",()=>{o({width:e.videoWidth,height:e.videoHeight}),document.body.removeChild(e)})})}if(t.type===l.a.Type.IMAGE){const e=new Image;return e.src=t.url,new Promise(t=>{e.onload=()=>{t({width:e.naturalWidth,height:e.naturalHeight})}})}return t.type===l.a.Type.ALBUM?e(t.children[0]):Promise.reject("Unknown media type")}(e).then(e=>function(e,t){const o=e.width>e.height?t.width/e.width:t.height/e.height;return{width:e.width*o,height:e.height*o}}(e,t))}function S(e,t){const o=t.map(s.b).join("|");return new RegExp(`(?:^|\\B)#(${o})(?:\\b|\\r|$)`,"imu").test(e)}function C(e,t){for(const o of t){const t=o();if(e(t))return t}}function T(e,t){return Math.max(0,Math.min(t.length-1,e))}function P(e,t,o){const n=e.slice();return n[t]=o,n}function k(e){return Array.isArray(e)?e[0]:e}!function(e){e.SMALL="s",e.MEDIUM="m",e.LARGE="l"}(M||(M={}))},32:function(e,o){e.exports=t},34:function(e,t,o){"use strict";function n(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function a(e){const t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}o.d(t,"a",(function(){return n})),o.d(t,"b",(function(){return a}))},35:function(e,t,o){"use strict";o.d(t,"a",(function(){return c})),o.d(t,"b",(function(){return u}));var n=o(0),a=o.n(n),i=o(32),r=o.n(i),l=o(6);class s{constructor(e=new Map,t=[]){this.factories=e,this.extensions=new Map,this.cache=new Map,t.forEach(e=>this.addModule(e))}addModule(e){e.factories&&(this.factories=new Map([...this.factories,...e.factories])),e.extensions&&e.extensions.forEach((e,t)=>{this.extensions.has(t)?this.extensions.get(t).push(e):this.extensions.set(t,[e])})}get(e){let t=this.factories.get(e);if(void 0===t)throw new Error('Service "'+e+'" does not exist');let o=this.cache.get(e);if(void 0===o){o=t(this);let n=this.extensions.get(e);n&&n.forEach(e=>o=e(this,o)),this.cache.set(e,o)}return o}has(e){return this.factories.has(e)}}class c{constructor(e,t,o){this.key=e,this.mount=t,this.modules=o,this.container=null}addModules(e){this.modules=this.modules.concat(e)}run(){if(null!==this.container)return;let e=!1;const t=()=>{e||"interactive"!==document.readyState&&"complete"!==document.readyState||(this.actualRun(),e=!0)};t(),e||document.addEventListener("readystatechange",t)}actualRun(){!function(e){const t=`app/${e.key}/run`;document.dispatchEvent(new d(t,e))}(this);const e=u({root:()=>null,"root/children":()=>[]});this.container=new s(e,this.modules);const t=this.container.get("root/children").map((e,t)=>a.a.createElement(e,{key:t})),o=a.a.createElement(l.a,{c:this.container},t);this.modules.forEach(e=>e.run&&e.run(this.container)),r.a.render(o,this.mount)}}class d extends CustomEvent{constructor(e,t){super(e,{detail:{app:t}})}}function u(e){return new Map(Object.entries(e))}},37:function(e,t,o){e.exports={root:"MediaThumbnail__root","media-background-fade-in-animation":"MediaThumbnail__media-background-fade-in-animation",mediaBackgroundFadeInAnimation:"MediaThumbnail__media-background-fade-in-animation","media-object-fade-in-animation":"MediaThumbnail__media-object-fade-in-animation",mediaObjectFadeInAnimation:"MediaThumbnail__media-object-fade-in-animation",image:"MediaThumbnail__image","not-available":"MediaThumbnail__not-available",notAvailable:"MediaThumbnail__not-available"}},39:function(e,t,o){"use strict";function n(e){return t=>(t.stopPropagation(),e(t))}function a(e,t){let o;return(...n)=>{clearTimeout(o),o=setTimeout(()=>{o=null,e(...n)},t)}}function i(){}o.d(t,"c",(function(){return n})),o.d(t,"a",(function(){return a})),o.d(t,"b",(function(){return i}))},390:function(e,t,o){"use strict";o.r(t);var n=o(27),a=o(12),i=o(196);n.a.addLayout({id:"grid",name:"Grid",img:a.a.image("grid-layout.png"),component:i.a})},4:function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));var n,a=o(19),i=o(1);!function(e){let t;!function(e){e.PERSONAL="PERSONAL",e.BUSINESS="BUSINESS"}(t=e.Type||(e.Type={}))}(n||(n={}));const r=Object(i.n)([]),l="https://secure.gravatar.com/avatar/4a94d759753ade2961582f7345c1d7b2?s=64&d=mm&r=g",s=e=>r.find(t=>t.id===e),c=e=>"https://instagram.com/"+e;function d(e){return e.slice().sort((e,t)=>e.type===t.type?0:e.type===n.Type.PERSONAL?-1:1),r.splice(0,r.length),e.forEach(e=>r.push(Object(i.n)(e))),r}function u(e){if("object"==typeof e&&Array.isArray(e.data))return d(e.data);throw"Spotlight encountered a problem trying to load your accounts. Kindly contact customer support for assistance."}t.b={list:r,DEFAULT_PROFILE_PIC:l,getById:s,getByUsername:e=>r.find(t=>t.username===e),hasAccounts:()=>r.length>0,filterExisting:e=>e.filter(e=>void 0!==s(e)),idsToAccounts:e=>e.map(e=>s(e)).filter(e=>void 0!==e),getBusinessAccounts:()=>r.filter(e=>e.type===n.Type.BUSINESS),getProfilePicUrl:e=>e.customProfilePicUrl?e.customProfilePicUrl:e.profilePicUrl?e.profilePicUrl:l,getBioText:e=>e.customBio.length?e.customBio:e.bio,getProfileUrl:e=>c(e.username),getUsernameUrl:c,loadAccounts:function(){return a.a.getAccounts().then(u).catch(e=>{throw a.a.getErrorReason(e)})},loadFromResponse:u,addAccounts:d}},44:function(e,t,o){e.exports={root:"StoryLightbox__root layout__fill-parent layout__z-highest layout__flex-column",container:"StoryLightbox__container layout__flex-column",header:"StoryLightbox__header layout__flex-row","profile-picture":"StoryLightbox__profile-picture",profilePicture:"StoryLightbox__profile-picture",username:"StoryLightbox__username",date:"StoryLightbox__date",progress:"StoryLightbox__progress layout__flex-row","progress-segment":"StoryLightbox__progress-segment",progressSegment:"StoryLightbox__progress-segment","progress-overlay":"StoryLightbox__progress-overlay StoryLightbox__progress-segment",progressOverlay:"StoryLightbox__progress-overlay StoryLightbox__progress-segment","progress-overlay-animating":"StoryLightbox__progress-overlay-animating StoryLightbox__progress-overlay StoryLightbox__progress-segment",progressOverlayAnimating:"StoryLightbox__progress-overlay-animating StoryLightbox__progress-overlay StoryLightbox__progress-segment","progress-segment-animation":"StoryLightbox__progress-segment-animation",progressSegmentAnimation:"StoryLightbox__progress-segment-animation","progress-overlay-done":"StoryLightbox__progress-overlay-done StoryLightbox__progress-overlay StoryLightbox__progress-segment",progressOverlayDone:"StoryLightbox__progress-overlay-done StoryLightbox__progress-overlay StoryLightbox__progress-segment",content:"StoryLightbox__content layout__flex-row layout__flex-center",media:"StoryLightbox__media",button:"StoryLightbox__button","close-button":"StoryLightbox__close-button StoryLightbox__button",closeButton:"StoryLightbox__close-button StoryLightbox__button","nav-button":"StoryLightbox__nav-button StoryLightbox__button",navButton:"StoryLightbox__nav-button StoryLightbox__button","prev-button":"StoryLightbox__prev-button StoryLightbox__nav-button StoryLightbox__button",prevButton:"StoryLightbox__prev-button StoryLightbox__nav-button StoryLightbox__button","next-button":"StoryLightbox__next-button StoryLightbox__nav-button StoryLightbox__button",nextButton:"StoryLightbox__next-button StoryLightbox__nav-button StoryLightbox__button"}},48:function(e,t,o){"use strict";o.d(t,"a",(function(){return n})),o.d(t,"b",(function(){return a}));const n=(e,t)=>e.startsWith(t)?e:t+e,a=e=>{return(t=e,"#",t.startsWith("#")?t.substr("#".length):t).split(/\s/).map((e,t)=>t>0?e[0].toUpperCase()+e.substr(1):e).join("").replace(/\W/gi,"");var t}},49:function(e,t,o){e.exports={root:"FeedHeader__root",container:"FeedHeader__container","left-container":"FeedHeader__left-container FeedHeader__container",leftContainer:"FeedHeader__left-container FeedHeader__container","right-container":"FeedHeader__right-container FeedHeader__container",rightContainer:"FeedHeader__right-container FeedHeader__container","profile-pic":"FeedHeader__profile-pic",profilePic:"FeedHeader__profile-pic","profile-pic-with-stories":"FeedHeader__profile-pic-with-stories FeedHeader__profile-pic",profilePicWithStories:"FeedHeader__profile-pic-with-stories FeedHeader__profile-pic",info:"FeedHeader__info","info-row":"FeedHeader__info-row",infoRow:"FeedHeader__info-row",username:"FeedHeader__username FeedHeader__info-row",subtext:"FeedHeader__subtext FeedHeader__info-row",bio:"FeedHeader__bio FeedHeader__subtext FeedHeader__info-row","counter-list":"FeedHeader__counter-list FeedHeader__subtext FeedHeader__info-row",counterList:"FeedHeader__counter-list FeedHeader__subtext FeedHeader__info-row",counter:"FeedHeader__counter","follow-button":"FeedHeader__follow-button",followButton:"FeedHeader__follow-button","centered-style":"FeedHeader__centered-style FeedHeader__root",centeredStyle:"FeedHeader__centered-style FeedHeader__root","normal-style":"FeedHeader__normal-style FeedHeader__root",normalStyle:"FeedHeader__normal-style FeedHeader__root","boxed-style":"FeedHeader__boxed-style FeedHeader__root",boxedStyle:"FeedHeader__boxed-style FeedHeader__root"}},53:function(e,t,o){e.exports={root:"MediaOverlay__root layout__fill-parent",rows:"MediaOverlay__rows",row:"MediaOverlay__row","top-row":"MediaOverlay__top-row MediaOverlay__row",topRow:"MediaOverlay__top-row MediaOverlay__row","middle-row":"MediaOverlay__middle-row MediaOverlay__row",middleRow:"MediaOverlay__middle-row MediaOverlay__row","bottom-row":"MediaOverlay__bottom-row MediaOverlay__row",bottomRow:"MediaOverlay__bottom-row MediaOverlay__row","counter-list":"MediaOverlay__counter-list",counterList:"MediaOverlay__counter-list",username:"MediaOverlay__username",date:"MediaOverlay__date",caption:"MediaOverlay__caption",counter:"MediaOverlay__counter","comments-count":"MediaOverlay__comments-count MediaOverlay__counter",commentsCount:"MediaOverlay__comments-count MediaOverlay__counter","likes-count":"MediaOverlay__likes-count MediaOverlay__counter",likesCount:"MediaOverlay__likes-count MediaOverlay__counter","ig-link-icon":"MediaOverlay__ig-link-icon",igLinkIcon:"MediaOverlay__ig-link-icon"}},58:function(e,t,o){"use strict";o.d(t,"a",(function(){return l}));var n=o(0),a=o.n(n),i=o(74),r=o.n(i);function l(){return a.a.createElement("div",{className:r.a.root})}},62:function(e,t,o){e.exports={root:"GridLayout__root layout__flex-column",grid:"GridLayout__grid",cell:"GridLayout__cell","cell-content":"GridLayout__cell-content layout__fill-parent layout__flex-column",cellContent:"GridLayout__cell-content layout__fill-parent layout__flex-column","media-container":"GridLayout__media-container",mediaContainer:"GridLayout__media-container","media-meta":"GridLayout__media-meta layout__flex-column",mediaMeta:"GridLayout__media-meta layout__flex-column","button-list":"GridLayout__button-list layout__flex-column",buttonList:"GridLayout__button-list layout__flex-column"}},7:function(e,t,o){"use strict";o.d(t,"a",(function(){return b}));var n=o(33),a=o.n(n),i=o(1),r=o(2),l=o(27),s=o(35),c=o(4),d=o(3),u=o(13),m=o(19),h=o(39),p=o(8),g=o(15),f=o(12),_=function(e,t,o,n){var a,i=arguments.length,r=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(i<3?a(r):i>3?a(t,o,r):a(t,o))||r);return i>3&&r&&Object.defineProperty(t,o,r),r};class b{constructor(e=new b.Options,t=r.a.Mode.DESKTOP){this.media=[],this.canLoadMore=!1,this.stories=[],this.numLoadedMore=0,this.totalMedia=0,this.mode=r.a.Mode.DESKTOP,this.isLoaded=!1,this.isLoading=!1,this.isLoadingMore=!1,this.numMediaToShow=0,this.numMediaPerPage=0,this.cancelFetch=()=>{},this.options=new b.Options(e),this.localMedia=[],this.mode=t,this.mediaCounter=this._numMediaPerPage,this.reload=Object(h.a)(()=>this.load(),300),Object(i.o)(()=>this.mode,()=>{0===this.numLoadedMore&&(this.mediaCounter=this._numMediaPerPage,this.localMedia.length<this.numMediaToShow&&this.loadMedia(this.localMedia.length,this.numMediaToShow-this.localMedia.length))}),Object(i.o)(()=>this.getReloadOptions(),()=>this.reload()),Object(i.o)(()=>({num:this._numMediaPerPage,mode:this.mode}),({num:e})=>{this.localMedia.length<e&&e<=this.totalMedia?this.reload():this.mediaCounter=Math.max(1,e)}),Object(i.o)(()=>this._media,e=>this.media=e),Object(i.o)(()=>this._numMediaToShow,e=>this.numMediaToShow=e),Object(i.o)(()=>this._numMediaPerPage,e=>this.numMediaPerPage=e),Object(i.o)(()=>this._canLoadMore,e=>this.canLoadMore=e)}get _media(){return this.localMedia.slice(0,this.numMediaToShow)}get _numMediaToShow(){return Math.min(this.mediaCounter,this.totalMedia)}get _numMediaPerPage(){return Math.max(1,b.ComputedOptions.normalizeMultiInt(this.options.numPosts,this.mode,1))}get _canLoadMore(){return this.localMedia.length>this.mediaCounter||this.localMedia.length<this.totalMedia}loadMore(){const e=this.numMediaToShow+this._numMediaPerPage-this.localMedia.length;return this.isLoadingMore=!0,e>0?this.loadMedia(this.localMedia.length,this._numMediaPerPage).then(()=>{this.mediaCounter+=this._numMediaPerPage,this.numLoadedMore++,this.isLoadingMore=!1}):new Promise(e=>{this.numLoadedMore++,this.mediaCounter+=this._numMediaPerPage,this.isLoadingMore=!1,e()})}load(){return this.numLoadedMore=0,this.loadMedia(0,this._numMediaPerPage,!0).then(()=>(this.isLoaded=!0,this.mediaCounter=this._numMediaPerPage))}loadMedia(e,t,o){return this.cancelFetch(),b.Options.hasSources(this.options)?(this.isLoading=!0,new Promise((n,i)=>{m.a.getFeedMedia(this.options,e,t,e=>this.cancelFetch=e).then(e=>{var t;if("object"!=typeof e||"object"!=typeof e.data||!Array.isArray(e.data.media))throw{message:"The media response is malformed or corrupt",response:e};o&&(this.localMedia=[]),this.localMedia.push(...e.data.media),this.stories=null!==(t=e.data.stories)&&void 0!==t?t:[],this.totalMedia=e.data.total,n&&n()}).catch(e=>{var t;if(a.a.isCancel(e))return null;const o=new b.Events.FetchFailEvent(b.Events.FETCH_FAIL,{detail:{feed:this,message:null!==(t=e.response?e.response.data.message:void 0)&&void 0!==t?t:e.message,response:e.response}});return document.dispatchEvent(o),i&&i(e),e}).finally(()=>this.isLoading=!1)})):new Promise(e=>{this.localMedia=[],this.totalMedia=0,e&&e()})}getReloadOptions(){return JSON.stringify({accounts:this.options.accounts,hashtags:this.options.hashtags,tagged:this.options.tagged,postOrder:this.options.postOrder,mediaType:this.options.mediaType,moderation:this.options.moderation,moderationMode:this.options.moderationMode,hashtagBlacklist:this.options.hashtagBlacklist,hashtagWhitelist:this.options.hashtagWhitelist,captionBlacklist:this.options.captionBlacklist,captionWhitelist:this.options.captionWhitelist,hashtagBlacklistSettings:this.options.hashtagBlacklistSettings,hashtagWhitelistSettings:this.options.hashtagWhitelistSettings,captionBlacklistSettings:this.options.captionBlacklistSettings,captionWhitelistSettings:this.options.captionWhitelistSettings})}}_([i.n],b.prototype,"media",void 0),_([i.n],b.prototype,"canLoadMore",void 0),_([i.n],b.prototype,"stories",void 0),_([i.n],b.prototype,"numLoadedMore",void 0),_([i.n],b.prototype,"options",void 0),_([i.n],b.prototype,"totalMedia",void 0),_([i.n],b.prototype,"mode",void 0),_([i.n],b.prototype,"isLoaded",void 0),_([i.n],b.prototype,"isLoading",void 0),_([i.n],b.prototype,"isLoadingMore",void 0),_([i.f],b.prototype,"reload",void 0),_([i.n],b.prototype,"localMedia",void 0),_([i.n],b.prototype,"numMediaToShow",void 0),_([i.n],b.prototype,"numMediaPerPage",void 0),_([i.n],b.prototype,"mediaCounter",void 0),_([i.h],b.prototype,"_media",null),_([i.h],b.prototype,"_numMediaToShow",null),_([i.h],b.prototype,"_numMediaPerPage",null),_([i.h],b.prototype,"_canLoadMore",null),_([i.f],b.prototype,"loadMore",null),_([i.f],b.prototype,"load",null),_([i.f],b.prototype,"loadMedia",null),function(e){let t,o,n,a,m,h,b,y,v;!function(e){e.FETCH_FAIL="sli/feed/fetch_fail";class t extends CustomEvent{constructor(e,t){super(e,t)}}e.FetchFailEvent=t}(t=e.Events||(e.Events={}));class x{constructor(e={}){x.setFromObject(this,e)}static setFromObject(t,o={}){var n,a,i,s,d,u,m,h,p,f,_,b,y,v,x;const M=o.accounts?o.accounts.slice():e.DefaultOptions.accounts;t.accounts=M.filter(e=>!!e).map(e=>parseInt(e.toString()));const L=o.tagged?o.tagged.slice():e.DefaultOptions.tagged;return t.tagged=L.filter(e=>!!e).map(e=>parseInt(e.toString())),t.hashtags=o.hashtags?o.hashtags.slice():e.DefaultOptions.hashtags,t.layout=l.a.getById(o.layout).id,t.numColumns=r.a.normalize(o.numColumns,e.DefaultOptions.numColumns),t.highlightFreq=r.a.normalize(o.highlightFreq,e.DefaultOptions.highlightFreq),t.mediaType=o.mediaType||e.DefaultOptions.mediaType,t.postOrder=o.postOrder||e.DefaultOptions.postOrder,t.numPosts=r.a.normalize(o.numPosts,e.DefaultOptions.numPosts),t.linkBehavior=r.a.normalize(o.linkBehavior,e.DefaultOptions.linkBehavior),t.feedWidth=r.a.normalize(o.feedWidth,e.DefaultOptions.feedWidth),t.feedHeight=r.a.normalize(o.feedHeight,e.DefaultOptions.feedHeight),t.feedPadding=r.a.normalize(o.feedPadding,e.DefaultOptions.feedPadding),t.imgPadding=r.a.normalize(o.imgPadding,e.DefaultOptions.imgPadding),t.textSize=r.a.normalize(o.textSize,e.DefaultOptions.textSize),t.bgColor=o.bgColor||e.DefaultOptions.bgColor,t.hoverInfo=o.hoverInfo?o.hoverInfo.slice():e.DefaultOptions.hoverInfo,t.textColorHover=o.textColorHover||e.DefaultOptions.textColorHover,t.bgColorHover=o.bgColorHover||e.DefaultOptions.bgColorHover,t.showHeader=r.a.normalize(o.showHeader,e.DefaultOptions.showHeader),t.headerInfo=r.a.normalize(o.headerInfo,e.DefaultOptions.headerInfo),t.headerAccount=null!==(n=o.headerAccount)&&void 0!==n?n:e.DefaultOptions.headerAccount,t.headerAccount=null===t.headerAccount||void 0===c.b.getById(t.headerAccount)?c.b.list.length>0?c.b.list[0].id:null:t.headerAccount,t.headerStyle=r.a.normalize(o.headerStyle,e.DefaultOptions.headerStyle),t.headerTextSize=r.a.normalize(o.headerTextSize,e.DefaultOptions.headerTextSize),t.headerPhotoSize=r.a.normalize(o.headerPhotoSize,e.DefaultOptions.headerPhotoSize),t.headerTextColor=o.headerTextColor||e.DefaultOptions.headerTextColor,t.headerBgColor=o.headerBgColor||e.DefaultOptions.bgColor,t.headerPadding=r.a.normalize(o.headerPadding,e.DefaultOptions.headerPadding),t.customProfilePic=null!==(a=o.customProfilePic)&&void 0!==a?a:e.DefaultOptions.customProfilePic,t.customBioText=o.customBioText||e.DefaultOptions.customBioText,t.includeStories=null!==(i=o.includeStories)&&void 0!==i?i:e.DefaultOptions.includeStories,t.storiesInterval=o.storiesInterval||e.DefaultOptions.storiesInterval,t.showCaptions=r.a.normalize(o.showCaptions,e.DefaultOptions.showCaptions),t.captionMaxLength=r.a.normalize(o.captionMaxLength,e.DefaultOptions.captionMaxLength),t.captionRemoveDots=null!==(s=o.captionRemoveDots)&&void 0!==s?s:e.DefaultOptions.captionRemoveDots,t.captionSize=r.a.normalize(o.captionSize,e.DefaultOptions.captionSize),t.captionColor=o.captionColor||e.DefaultOptions.captionColor,t.showLikes=r.a.normalize(o.showLikes,e.DefaultOptions.showLikes),t.showComments=r.a.normalize(o.showComments,e.DefaultOptions.showCaptions),t.lcIconSize=r.a.normalize(o.lcIconSize,e.DefaultOptions.lcIconSize),t.likesIconColor=null!==(d=o.likesIconColor)&&void 0!==d?d:e.DefaultOptions.likesIconColor,t.commentsIconColor=o.commentsIconColor||e.DefaultOptions.commentsIconColor,t.lightboxShowSidebar=null!==(u=o.lightboxShowSidebar)&&void 0!==u?u:e.DefaultOptions.lightboxShowSidebar,t.numLightboxComments=o.numLightboxComments||e.DefaultOptions.numLightboxComments,t.showLoadMoreBtn=r.a.normalize(o.showLoadMoreBtn,e.DefaultOptions.showLoadMoreBtn),t.loadMoreBtnTextColor=o.loadMoreBtnTextColor||e.DefaultOptions.loadMoreBtnTextColor,t.loadMoreBtnBgColor=o.loadMoreBtnBgColor||e.DefaultOptions.loadMoreBtnBgColor,t.loadMoreBtnText=o.loadMoreBtnText||e.DefaultOptions.loadMoreBtnText,t.autoload=null!==(m=o.autoload)&&void 0!==m?m:e.DefaultOptions.autoload,t.showFollowBtn=r.a.normalize(o.showFollowBtn,e.DefaultOptions.showFollowBtn),t.followBtnText=null!==(h=o.followBtnText)&&void 0!==h?h:e.DefaultOptions.followBtnText,t.followBtnTextColor=o.followBtnTextColor||e.DefaultOptions.followBtnTextColor,t.followBtnBgColor=o.followBtnBgColor||e.DefaultOptions.followBtnBgColor,t.followBtnLocation=r.a.normalize(o.followBtnLocation,e.DefaultOptions.followBtnLocation),t.hashtagWhitelist=o.hashtagWhitelist||e.DefaultOptions.hashtagWhitelist,t.hashtagBlacklist=o.hashtagBlacklist||e.DefaultOptions.hashtagBlacklist,t.captionWhitelist=o.captionWhitelist||e.DefaultOptions.captionWhitelist,t.captionBlacklist=o.captionBlacklist||e.DefaultOptions.captionBlacklist,t.hashtagWhitelistSettings=null!==(p=o.hashtagWhitelistSettings)&&void 0!==p?p:e.DefaultOptions.hashtagWhitelistSettings,t.hashtagBlacklistSettings=null!==(f=o.hashtagBlacklistSettings)&&void 0!==f?f:e.DefaultOptions.hashtagBlacklistSettings,t.captionWhitelistSettings=null!==(_=o.captionWhitelistSettings)&&void 0!==_?_:e.DefaultOptions.captionWhitelistSettings,t.captionBlacklistSettings=null!==(b=o.captionBlacklistSettings)&&void 0!==b?b:e.DefaultOptions.captionBlacklistSettings,t.moderation=o.moderation||e.DefaultOptions.moderation,t.moderationMode=o.moderationMode||e.DefaultOptions.moderationMode,t.promotionEnabled=null!==(y=o.promotionEnabled)&&void 0!==y?y:e.DefaultOptions.promotionEnabled,t.autoPromotionsEnabled=null!==(v=o.autoPromotionsEnabled)&&void 0!==v?v:e.DefaultOptions.autoPromotionsEnabled,t.globalPromotionsEnabled=null!==(x=o.globalPromotionsEnabled)&&void 0!==x?x:e.DefaultOptions.globalPromotionsEnabled,Array.isArray(o.promotions)?t.promotions=g.a.fromArray(o.promotions):o.promotions&&o.promotions instanceof Map?t.promotions=g.a.fromMap(o.promotions):"object"==typeof o.promotions?t.promotions=o.promotions:t.promotions=e.DefaultOptions.promotions,t}static getAllAccounts(e){const t=c.b.idsToAccounts(e.accounts),o=c.b.idsToAccounts(e.tagged);return{all:t.concat(o),accounts:t,tagged:o}}static getSources(e){return{accounts:c.b.idsToAccounts(e.accounts),tagged:c.b.idsToAccounts(e.tagged),hashtags:c.b.getBusinessAccounts().length>0?e.hashtags.filter(e=>e.tag.length>0):[]}}static hasSources(t){const o=e.Options.getSources(t),n=o.accounts.length>0||o.tagged.length>0,a=o.hashtags.length>0;return n||a}static isLimitingPosts(e){return e.moderation.length>0||e.hashtagBlacklist.length>0||e.hashtagWhitelist.length>0||e.captionBlacklist.length>0||e.captionWhitelist.length>0}}_([i.n],x.prototype,"accounts",void 0),_([i.n],x.prototype,"hashtags",void 0),_([i.n],x.prototype,"tagged",void 0),_([i.n],x.prototype,"layout",void 0),_([i.n],x.prototype,"numColumns",void 0),_([i.n],x.prototype,"highlightFreq",void 0),_([i.n],x.prototype,"mediaType",void 0),_([i.n],x.prototype,"postOrder",void 0),_([i.n],x.prototype,"numPosts",void 0),_([i.n],x.prototype,"linkBehavior",void 0),_([i.n],x.prototype,"feedWidth",void 0),_([i.n],x.prototype,"feedHeight",void 0),_([i.n],x.prototype,"feedPadding",void 0),_([i.n],x.prototype,"imgPadding",void 0),_([i.n],x.prototype,"textSize",void 0),_([i.n],x.prototype,"bgColor",void 0),_([i.n],x.prototype,"textColorHover",void 0),_([i.n],x.prototype,"bgColorHover",void 0),_([i.n],x.prototype,"hoverInfo",void 0),_([i.n],x.prototype,"showHeader",void 0),_([i.n],x.prototype,"headerInfo",void 0),_([i.n],x.prototype,"headerAccount",void 0),_([i.n],x.prototype,"headerStyle",void 0),_([i.n],x.prototype,"headerTextSize",void 0),_([i.n],x.prototype,"headerPhotoSize",void 0),_([i.n],x.prototype,"headerTextColor",void 0),_([i.n],x.prototype,"headerBgColor",void 0),_([i.n],x.prototype,"headerPadding",void 0),_([i.n],x.prototype,"customBioText",void 0),_([i.n],x.prototype,"customProfilePic",void 0),_([i.n],x.prototype,"includeStories",void 0),_([i.n],x.prototype,"storiesInterval",void 0),_([i.n],x.prototype,"showCaptions",void 0),_([i.n],x.prototype,"captionMaxLength",void 0),_([i.n],x.prototype,"captionRemoveDots",void 0),_([i.n],x.prototype,"captionSize",void 0),_([i.n],x.prototype,"captionColor",void 0),_([i.n],x.prototype,"showLikes",void 0),_([i.n],x.prototype,"showComments",void 0),_([i.n],x.prototype,"lcIconSize",void 0),_([i.n],x.prototype,"likesIconColor",void 0),_([i.n],x.prototype,"commentsIconColor",void 0),_([i.n],x.prototype,"lightboxShowSidebar",void 0),_([i.n],x.prototype,"numLightboxComments",void 0),_([i.n],x.prototype,"showLoadMoreBtn",void 0),_([i.n],x.prototype,"loadMoreBtnText",void 0),_([i.n],x.prototype,"loadMoreBtnTextColor",void 0),_([i.n],x.prototype,"loadMoreBtnBgColor",void 0),_([i.n],x.prototype,"autoload",void 0),_([i.n],x.prototype,"showFollowBtn",void 0),_([i.n],x.prototype,"followBtnText",void 0),_([i.n],x.prototype,"followBtnTextColor",void 0),_([i.n],x.prototype,"followBtnBgColor",void 0),_([i.n],x.prototype,"followBtnLocation",void 0),_([i.n],x.prototype,"hashtagWhitelist",void 0),_([i.n],x.prototype,"hashtagBlacklist",void 0),_([i.n],x.prototype,"captionWhitelist",void 0),_([i.n],x.prototype,"captionBlacklist",void 0),_([i.n],x.prototype,"hashtagWhitelistSettings",void 0),_([i.n],x.prototype,"hashtagBlacklistSettings",void 0),_([i.n],x.prototype,"captionWhitelistSettings",void 0),_([i.n],x.prototype,"captionBlacklistSettings",void 0),_([i.n],x.prototype,"moderation",void 0),_([i.n],x.prototype,"moderationMode",void 0),e.Options=x;class M{constructor(e){Object.getOwnPropertyNames(e).map(t=>{this[t]=e[t]})}getCaption(e){const t=e.caption?e.caption:"";return this.captionMaxLength&&t.length?Object(d.q)(Object(d.t)(t,this.captionMaxLength)):t}static compute(t,o=r.a.Mode.DESKTOP){const n=new M({accounts:c.b.filterExisting(t.accounts),tagged:c.b.filterExisting(t.tagged),hashtags:t.hashtags.filter(e=>e.tag.length>0),layout:l.a.getById(t.layout),highlightFreq:r.a.get(t.highlightFreq,o,!0),linkBehavior:r.a.get(t.linkBehavior,o,!0),bgColor:Object(u.a)(t.bgColor),textColorHover:Object(u.a)(t.textColorHover),bgColorHover:Object(u.a)(t.bgColorHover),hoverInfo:t.hoverInfo,showHeader:r.a.get(t.showHeader,o,!0),headerInfo:r.a.get(t.headerInfo,o,!0),headerStyle:r.a.get(t.headerStyle,o,!0),headerTextColor:Object(u.a)(t.headerTextColor),headerBgColor:Object(u.a)(t.headerBgColor),headerPadding:r.a.get(t.headerPadding,o,!0),includeStories:t.includeStories,storiesInterval:t.storiesInterval,showCaptions:r.a.get(t.showCaptions,o,!0),captionMaxLength:r.a.get(t.captionMaxLength,o,!0),captionRemoveDots:t.captionRemoveDots,captionColor:Object(u.a)(t.captionColor),showLikes:r.a.get(t.showLikes,o,!0),showComments:r.a.get(t.showComments,o,!0),likesIconColor:Object(u.a)(t.likesIconColor),commentsIconColor:Object(u.a)(t.commentsIconColor),lightboxShowSidebar:t.lightboxShowSidebar,numLightboxComments:t.numLightboxComments,showLoadMoreBtn:r.a.get(t.showLoadMoreBtn,o,!0),loadMoreBtnTextColor:Object(u.a)(t.loadMoreBtnTextColor),loadMoreBtnBgColor:Object(u.a)(t.loadMoreBtnBgColor),loadMoreBtnText:t.loadMoreBtnText,showFollowBtn:r.a.get(t.showFollowBtn,o,!0),autoload:t.autoload,followBtnLocation:r.a.get(t.followBtnLocation,o,!0),followBtnTextColor:Object(u.a)(t.followBtnTextColor),followBtnBgColor:Object(u.a)(t.followBtnBgColor),followBtnText:t.followBtnText,account:null,showBio:!1,bioText:null,profilePhotoUrl:c.b.DEFAULT_PROFILE_PIC,feedWidth:"",feedHeight:"",feedPadding:"",imgPadding:"",textSize:"",headerTextSize:"",headerPhotoSize:"",captionSize:"",lcIconSize:"",showLcIcons:!1});if(n.numColumns=this.getNumCols(t,o),n.numPosts=this.getNumPosts(t,o),n.allAccounts=n.accounts.concat(n.tagged.filter(e=>!n.accounts.includes(e))),n.allAccounts.length>0&&(n.account=t.headerAccount&&n.allAccounts.includes(t.headerAccount)?c.b.getById(t.headerAccount):c.b.getById(n.allAccounts[0])),n.showHeader=n.showHeader&&null!==n.account,n.showHeader&&(n.profilePhotoUrl=t.customProfilePic.length?t.customProfilePic:c.b.getProfilePicUrl(n.account)),n.showFollowBtn=n.showFollowBtn&&null!==n.account,n.showBio=n.headerInfo.some(t=>t===e.HeaderInfo.BIO),n.showBio){const e=t.customBioText.trim().length>0?t.customBioText:null!==n.account?c.b.getBioText(n.account):"";n.bioText=Object(d.q)(e),n.showBio=n.bioText.length>0}return n.feedWidth=this.normalizeCssSize(t.feedWidth,o,"auto"),n.feedHeight=this.normalizeCssSize(t.feedHeight,o,"auto"),n.feedPadding=this.normalizeCssSize(t.feedPadding,o,"0"),n.imgPadding=this.normalizeCssSize(t.imgPadding,o,"0"),n.textSize=this.normalizeCssSize(t.textSize,o,"inherit",!0),n.headerTextSize=this.normalizeCssSize(t.headerTextSize,o,"inherit"),n.headerPhotoSize=this.normalizeCssSize(t.headerPhotoSize,o,"50px"),n.captionSize=this.normalizeCssSize(t.captionSize,o,"inherit"),n.lcIconSize=this.normalizeCssSize(t.lcIconSize,o,"inherit"),n.buttonPadding=Math.max(10,r.a.get(t.imgPadding,o))+"px",n.showLcIcons=n.showLikes||n.showComments,n}static getNumCols(e,t){return Math.max(1,this.normalizeMultiInt(e.numColumns,t,1))}static getNumPosts(e,t){return Math.max(1,this.normalizeMultiInt(e.numPosts,t,1))}static normalizeMultiInt(e,t,o=0){const n=parseInt(r.a.get(e,t)+"");return isNaN(n)?t===r.a.Mode.DESKTOP?o:this.normalizeMultiInt(e,r.a.Mode.DESKTOP,o):n}static normalizeCssSize(e,t,o=null,n=!1){const a=r.a.get(e,t,n);return a?a+"px":o}}function L(e,t){if(f.a.isPro)return Object(d.m)(p.a.isValid,[()=>w(e,t),()=>t.globalPromotionsEnabled&&p.a.getGlobalPromo(e),()=>t.autoPromotionsEnabled&&p.a.getAutoPromo(e)])}function w(e,t){return e?p.a.getPromoFromDictionary(e,t.promotions):void 0}e.ComputedOptions=M,e.HashtagSorting=Object(s.b)({recent:"Most recent",popular:"Most popular"}),function(e){e.ALL="all",e.PHOTOS="photos",e.VIDEOS="videos"}(o=e.MediaType||(e.MediaType={})),function(e){e.NOTHING="nothing",e.SELF="self",e.NEW_TAB="new_tab",e.LIGHTBOX="lightbox"}(n=e.LinkBehavior||(e.LinkBehavior={})),function(e){e.DATE_ASC="date_asc",e.DATE_DESC="date_desc",e.POPULARITY_ASC="popularity_asc",e.POPULARITY_DESC="popularity_desc",e.RANDOM="random"}(a=e.PostOrder||(e.PostOrder={})),function(e){e.USERNAME="username",e.DATE="date",e.CAPTION="caption",e.LIKES_COMMENTS="likes_comments",e.INSTA_LINK="insta_link"}(m=e.HoverInfo||(e.HoverInfo={})),function(e){e.NORMAL="normal",e.BOXED="boxed",e.CENTERED="centered"}(h=e.HeaderStyle||(e.HeaderStyle={})),function(e){e.BIO="bio",e.PROFILE_PIC="profile_pic",e.FOLLOWERS="followers",e.MEDIA_COUNT="media_count"}(b=e.HeaderInfo||(e.HeaderInfo={})),function(e){e.HEADER="header",e.BOTTOM="bottom",e.BOTH="both"}(y=e.FollowBtnLocation||(e.FollowBtnLocation={})),function(e){e.WHITELIST="whitelist",e.BLACKLIST="blacklist"}(v=e.ModerationMode||(e.ModerationMode={})),e.DefaultOptions={accounts:[],hashtags:[],tagged:[],layout:null,numColumns:{desktop:3},highlightFreq:{desktop:7},mediaType:o.ALL,postOrder:a.DATE_DESC,numPosts:{desktop:9},linkBehavior:{desktop:n.LIGHTBOX,phone:n.NEW_TAB},feedWidth:{desktop:""},feedHeight:{desktop:""},feedPadding:{desktop:20,tablet:14,phone:10},imgPadding:{desktop:14,tablet:10,phone:6},textSize:{all:""},bgColor:{r:255,g:255,b:255,a:1},hoverInfo:[m.LIKES_COMMENTS,m.INSTA_LINK],textColorHover:{r:255,g:255,b:255,a:1},bgColorHover:{r:0,g:0,b:0,a:.5},showHeader:{desktop:!0},headerInfo:{desktop:[b.PROFILE_PIC,b.BIO]},headerAccount:null,headerStyle:{desktop:h.NORMAL,phone:h.CENTERED},headerTextSize:{desktop:""},headerPhotoSize:{desktop:50},headerTextColor:{r:0,g:0,b:0,a:1},headerBgColor:{r:255,g:255,b:255,a:1},headerPadding:{desktop:0},customProfilePic:0,customBioText:"",includeStories:!1,storiesInterval:5,showCaptions:{desktop:!1},captionMaxLength:{desktop:0},captionRemoveDots:!1,captionSize:{desktop:0},captionColor:{r:0,g:0,b:0,a:1},showLikes:{desktop:!1},showComments:{desktop:!1},lcIconSize:{desktop:14},likesIconColor:{r:0,g:0,b:0,a:1},commentsIconColor:{r:0,g:0,b:0,a:1},lightboxShowSidebar:!1,numLightboxComments:50,showLoadMoreBtn:{desktop:!0},loadMoreBtnTextColor:{r:255,g:255,b:255,a:1},loadMoreBtnBgColor:{r:0,g:149,b:246,a:1},loadMoreBtnText:"Load more",autoload:!1,showFollowBtn:{desktop:!0},followBtnText:"Follow on Instagram",followBtnTextColor:{r:255,g:255,b:255,a:1},followBtnBgColor:{r:0,g:149,b:246,a:1},followBtnLocation:{desktop:y.HEADER,phone:y.BOTTOM},hashtagWhitelist:[],hashtagBlacklist:[],captionWhitelist:[],captionBlacklist:[],hashtagWhitelistSettings:!0,hashtagBlacklistSettings:!0,captionWhitelistSettings:!0,captionBlacklistSettings:!0,moderation:[],moderationMode:v.BLACKLIST,promotionEnabled:!0,autoPromotionsEnabled:!0,globalPromotionsEnabled:!0,promotions:{}},e.getPromo=L,e.getFeedPromo=w,e.executeMediaClick=function(e,t){const o=L(e,t),n=p.a.getConfig(o),a=p.a.getType(o);return!(!a||!a.isValid(n)||"function"!=typeof a.onMediaClick)&&a.onMediaClick(e,n)},e.getLink=function(e,t){var o,n;const a=L(e,t),i=p.a.getConfig(a),r=p.a.getType(a);if(void 0===r||!r.isValid(i))return{text:null,url:null,newTab:!1};let[l,s]=r.getPopupLink?null!==(o=r.getPopupLink(e,i))&&void 0!==o?o:null:[null,!1];return{text:l,url:r.getMediaUrl&&null!==(n=r.getMediaUrl(e,i))&&void 0!==n?n:null,newTab:s}}}(b||(b={}))},71:function(e,t,o){e.exports={root:"MediaLightboxAlbum__root",strip:"MediaLightboxAlbum__strip layout__flex-row",frame:"MediaLightboxAlbum__frame",controls:"MediaLightboxAlbum__controls layout__fill-parent layout__flex-row","nav-button":"MediaLightboxAlbum__nav-button",navButton:"MediaLightboxAlbum__nav-button","next-button":"MediaLightboxAlbum__next-button MediaLightboxAlbum__nav-button",nextButton:"MediaLightboxAlbum__next-button MediaLightboxAlbum__nav-button","prev-button":"MediaLightboxAlbum__prev-button MediaLightboxAlbum__nav-button",prevButton:"MediaLightboxAlbum__prev-button MediaLightboxAlbum__nav-button","indicator-list":"MediaLightboxAlbum__indicator-list layout__flex-row",indicatorList:"MediaLightboxAlbum__indicator-list layout__flex-row",indicator:"MediaLightboxAlbum__indicator","indicator-current":"MediaLightboxAlbum__indicator-current MediaLightboxAlbum__indicator",indicatorCurrent:"MediaLightboxAlbum__indicator-current MediaLightboxAlbum__indicator"}},73:function(e,t,o){"use strict";o.d(t,"a",(function(){return m}));var n=o(0),a=o.n(n),i=o(37),r=o.n(i),l=o(98),s=o(3),c=o(58),d=o(11),u=o(15);function m(e){var{media:t,className:o,size:i,onLoadImage:m,width:h,height:p}=e,g=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]])}return o}(e,["media","className","size","onLoadImage","width","height"]);const f=a.a.useRef(),_=a.a.useRef(),[b,y]=a.a.useState(!0);function v(){if(f.current){const e=null!=i?i:function(){const e=f.current.getBoundingClientRect();return e.width<=320?s.a.SMALL:(e.width,s.a.MEDIUM)}(),o="object"==typeof t.thumbnails&&u.a.has(t.thumbnails,e)?u.a.get(t.thumbnails,e):t.thumbnail;f.current.src!==o&&(f.current.src=o)}}return Object(n.useLayoutEffect)(()=>{if("VIDEO"!==t.type){let e=new l.a(v);return f.current&&(f.current.onload=()=>{y(!1),m&&m()},f.current.onerror=()=>{f.current.src!==t.thumbnail&&(f.current.src=t.thumbnail),y(!1),m&&m()},v(),e.observe(f.current)),()=>{f.current.onload=()=>null,f.current.onerror=()=>null,e.disconnect()}}_.current&&(_.current.currentTime=1,y(!1),m&&m())},[t,i]),t.url&&t.url.length>0?a.a.createElement("div",Object.assign({className:Object(d.b)(r.a.root,o)},g),"VIDEO"===t.type&&a.a.createElement("video",{ref:_,className:r.a.video,src:t.url,autoPlay:!1,controls:!1,tabIndex:0},a.a.createElement("source",{src:t.url}),"Your browser does not support videos"),"VIDEO"!==t.type&&a.a.createElement("img",Object.assign({ref:f,className:r.a.image,loading:"lazy",alt:t.caption,width:h,height:p},d.e)),b&&a.a.createElement(c.a,null)):a.a.createElement("div",{className:r.a.notAvailable},a.a.createElement("span",null,"Thumbnail not available"))}},74:function(e,t,o){e.exports={root:"MediaLoading__root",animation:"MediaLoading__animation"}},78:function(e,t,o){e.exports={root:"IgVideoPlayer__root",thumbnail:"IgVideoPlayer__thumbnail","thumbnail-hidden":"IgVideoPlayer__thumbnail-hidden IgVideoPlayer__thumbnail",thumbnailHidden:"IgVideoPlayer__thumbnail-hidden IgVideoPlayer__thumbnail",video:"IgVideoPlayer__video","video-hidden":"IgVideoPlayer__video-hidden IgVideoPlayer__video",videoHidden:"IgVideoPlayer__video-hidden IgVideoPlayer__video",control:"IgVideoPlayer__control","control-playing":"IgVideoPlayer__control-playing IgVideoPlayer__control",controlPlaying:"IgVideoPlayer__control-playing IgVideoPlayer__control","control-paused":"IgVideoPlayer__control-paused IgVideoPlayer__control",controlPaused:"IgVideoPlayer__control-paused IgVideoPlayer__control","play-button":"IgVideoPlayer__play-button",playButton:"IgVideoPlayer__play-button"}},8:function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));var n,a=o(12),i=o(15),r=o(3);!function(e){function t(e){return e?c(e.type):void 0}function o(e){var o;if("object"!=typeof e)return!1;const n=t(e);return void 0!==n&&n.isValid(null!==(o=e.config)&&void 0!==o?o:{})}function n(t){return t?e.getPromoFromDictionary(t,a.a.config.globalPromotions):void 0}function l(e){const t=s(e);return void 0===t?void 0:t.promotion}function s(t){if(t)for(const o of a.a.config.autoPromotions){const n=e.Automation.getType(o),a=e.Automation.getConfig(o);if(n&&n.matches(t,a))return o}}function c(t){return e.types.find(e=>e.id===t)}let d;e.getConfig=function(e){var t,o;return e&&null!==(o=null!==(t=e.config)&&void 0!==t?t:e.data)&&void 0!==o?o:{}},e.getType=t,e.isValid=o,e.getPromoFromDictionary=function(t,o){const n=i.a.get(o,t.id);if(n)return e.getType(n)?n:void 0},e.getPromo=function(e){return Object(r.m)(o,[()=>n(e),()=>l(e)])},e.getGlobalPromo=n,e.getAutoPromo=l,e.getAutomation=s,e.types=[],e.getTypes=function(){return e.types},e.registerType=function(t){e.types.push(t)},e.getTypeById=c,e.clearTypes=function(){e.types.splice(0,e.types.length)},function(e){e.getType=function(e){return e?o(e.type):void 0},e.getConfig=function(e){var t,o;return e&&null!==(o=null!==(t=e.config)&&void 0!==t?t:e.data)&&void 0!==o?o:{}},e.getPromotion=function(e){return e?e.promotion:void 0};const t=[];function o(e){return t.find(t=>t.id===e)}e.getTypes=function(){return t},e.registerType=function(e){t.push(e)},e.getTypeById=o,e.clearTypes=function(){t.splice(0,t.length)}}(d=e.Automation||(e.Automation={}))}(n||(n={}))},87:function(e,t,o){e.exports={root:"MediaComment__root",row:"MediaComment__row",username:"MediaComment__username",content:"MediaComment__content MediaComment__row",text:"MediaComment__text","meta-list":"MediaComment__meta-list MediaComment__row",metaList:"MediaComment__meta-list MediaComment__row",meta:"MediaComment__meta",date:"MediaComment__date MediaComment__meta","like-count":"MediaComment__like-count MediaComment__meta",likeCount:"MediaComment__like-count MediaComment__meta"}}},[[390,0,1]]])}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],t):"object"==typeof exports?exports.spotlight=t(require("React"),require("ReactDOM")):e.spotlight=t(e.React,e.ReactDOM)}(window,(function(e,t){return(window.webpackJsonpspotlight=window.webpackJsonpspotlight||[]).push([[6],{0:function(t,o){t.exports=e},10:function(e,t,o){"use strict";o.d(t,"a",(function(){return r}));var n=o(0),a=o.n(n),i=o(11);const r=e=>{var{icon:t,className:o}=e,n=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]])}return o}(e,["icon","className"]);return a.a.createElement("span",Object.assign({className:Object(i.b)("dashicons","dashicons-"+t,o)},n))}},108:function(e,t,o){e.exports={root:"MediaTile__root","type-icon":"MediaTile__type-icon",typeIcon:"MediaTile__type-icon","image-type-icon":"MediaTile__image-type-icon MediaTile__type-icon",imageTypeIcon:"MediaTile__image-type-icon MediaTile__type-icon","video-type-icon":"MediaTile__video-type-icon MediaTile__type-icon",videoTypeIcon:"MediaTile__video-type-icon MediaTile__type-icon","album-type-icon":"MediaTile__album-type-icon MediaTile__type-icon",albumTypeIcon:"MediaTile__album-type-icon MediaTile__type-icon",overlay:"MediaTile__overlay layout__fill-parent"}},109:function(e,t,o){e.exports={root:"FeedLayout__root",wrapper:"FeedLayout__wrapper",button:"FeedLayout__button","follow-btn":"FeedLayout__follow-btn FeedLayout__button",followBtn:"FeedLayout__follow-btn FeedLayout__button","load-more-btn":"FeedLayout__load-more-btn FeedLayout__button",loadMoreBtn:"FeedLayout__load-more-btn FeedLayout__button","fake-media":"FeedLayout__fake-media",fakeMedia:"FeedLayout__fake-media","fake-media-flash-animation":"FeedLayout__fake-media-flash-animation",fakeMediaFlashAnimation:"FeedLayout__fake-media-flash-animation"}},11:function(e,t,o){"use strict";function n(...e){return e.filter(e=>!!e).join(" ")}function a(e){return n(...Object.getOwnPropertyNames(e).map(t=>e[t]?t:null))}function i(e,t={}){let o=Object.getOwnPropertyNames(t).map(o=>t[o]?e+o:null);return e+" "+o.filter(e=>!!e).join(" ")}o.d(t,"b",(function(){return n})),o.d(t,"c",(function(){return a})),o.d(t,"a",(function(){return i})),o.d(t,"e",(function(){return r})),o.d(t,"d",(function(){return l}));const r={onMouseDown:e=>e.preventDefault()};function l(...e){return t=>{e.forEach(e=>e&&function(e,t){"function"==typeof e?e(t):e.current=t}(e,t))}}},12:function(e,t,o){"use strict";var n,a=o(8);let i;t.a=i={isPro:!1,config:{restApi:SliCommonL10n.restApi,imagesUrl:SliCommonL10n.imagesUrl,autoPromotions:SliCommonL10n.autoPromotions,globalPromotions:null!==(n=SliCommonL10n.globalPromotions)&&void 0!==n?n:{}},image:e=>`${i.config.imagesUrl}/${e}`},a.a.registerType({id:"link",label:"Link",isValid:()=>!1}),a.a.registerType({id:"-more-",label:"- More promotion types -",isValid:()=>!1}),a.a.Automation.registerType({id:"hashtag",label:"Hashtag",matches:()=>!1})},13:function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e?e:"r"in e?"rgba("+e.r+","+e.g+","+e.b+","+e.a+")":"h"in e?"hsla("+e.h+","+e.s+","+e.l+","+e.a+")":"#fff"},14:function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));var n,a=o(3);!function(e){function t(e,t){return e.hasOwnProperty(t.toString())}function o(e,t){return e[t.toString()]}function n(e,t,o){return e[t.toString()]=o,e}e.has=t,e.get=o,e.set=n,e.ensure=function(o,a,i){return t(o,a)||n(o,a,i),e.get(o,a)},e.withEntry=function(t,o,n){return e.set(Object(a.h)(t),o,n)},e.remove=function(e,t){return delete e[t.toString()],e},e.without=function(t,o){return e.remove(Object(a.h)(t),o)},e.at=function(e,t){return o(e,Object.keys(e)[t])},e.keys=function(e){return Object.keys(e)},e.values=function(e){return Object.values(e)},e.entries=function(e){return Object.getOwnPropertyNames(e).map(t=>[t,e[t]])},e.map=function(t,o){const n={};return e.forEach(t,(e,t)=>n[e]=o(t,e)),n},e.size=function(t){return e.keys(t).length},e.isEmpty=function(t){return 0===e.size(t)},e.equals=function(e,t){return Object(a.p)(e,t)},e.forEach=function(t,o){e.keys(t).forEach(e=>o(e,t[e]))},e.fromArray=function(t){const o={};return t.forEach(([t,n])=>e.set(o,t,n)),o},e.fromMap=function(t){const o={};return t.forEach((t,n)=>e.set(o,n,t)),o}}(n||(n={}))},144:function(e,t,o){e.exports={root:"MediaTileIcons__root layout__flex-row",icon:"MediaTileIcons__icon"}},15:function(e,t,o){"use strict";var n;o.d(t,"a",(function(){return n})),function(e){let t,o;!function(e){e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.ALBUM="CAROUSEL_ALBUM"}(t=e.Type||(e.Type={})),function(e){let t;!function(e){e.PERSONAL_ACCOUNT="PERSONAL_ACCOUNT",e.BUSINESS_ACCOUNT="BUSINESS_ACCOUNT",e.TAGGED_ACCOUNT="TAGGED_ACCOUNT",e.RECENT_HASHTAG="RECENT_HASHTAG",e.POPULAR_HASHTAG="POPULAR_HASHTAG",e.USER_STORY="USER_STORY"}(t=e.Type||(e.Type={})),e.isOwnMedia=function(e){return e.type===t.PERSONAL_ACCOUNT||e.type===t.BUSINESS_ACCOUNT||e.type===t.USER_STORY}}(o=e.Source||(e.Source={})),e.getAsRows=(e,t)=>{e=e.slice(),t=t>0?t:1;let o=[];for(;e.length;)o.push(e.splice(0,t));if(o.length>0){const e=o.length-1;for(;o[e].length<t;)o[e].push({})}return o},e.isFromHashtag=e=>e.source.type===o.Type.POPULAR_HASHTAG||e.source.type===o.Type.RECENT_HASHTAG}(n||(n={}))},162:function(e,t,o){"use strict";var n=o(0),a=o.n(n),i=o(169),r=o.n(i),l=o(6),s=o(3);t.a=Object(l.b)((function({media:e,options:t,full:o}){if(!t.showCaptions||!e.type)return null;const n={color:t.captionColor,fontSize:t.captionSize},i=o?0:1,l=e.caption?e.caption:"",c=t.captionMaxLength?Object(s.t)(l,t.captionMaxLength):l,d=Object(s.q)(c,void 0,i,t.captionRemoveDots),u=o?r.a.full:r.a.preview;return a.a.createElement("div",{className:u,style:n},d)}))},163:function(e,t,o){"use strict";var n=o(0),a=o.n(n),i=o(144),r=o.n(i),l=o(6),s=o(15),c=o(10);t.a=Object(l.b)((function({media:e,options:t}){if(!e.type||e.source.type===s.a.Source.Type.PERSONAL_ACCOUNT)return null;const o={fontSize:t.lcIconSize,lineHeight:t.lcIconSize},n=Object.assign(Object.assign({},o),{color:t.likesIconColor}),i=Object.assign(Object.assign({},o),{color:t.commentsIconColor}),l={fontSize:t.lcIconSize,width:t.lcIconSize,height:t.lcIconSize};return t.showLcIcons&&a.a.createElement("div",{className:r.a.root},t.showLikes&&a.a.createElement("div",{className:r.a.icon,style:n},a.a.createElement(c.a,{icon:"heart",style:l}),a.a.createElement("span",null,e.likesCount)),t.showComments&&a.a.createElement("div",{className:r.a.icon,style:i},a.a.createElement(c.a,{icon:"admin-comments",style:l}),a.a.createElement("span",null,e.commentsCount)))}))},167:function(e,t,o){"use strict";var n=o(0),a=o.n(n),i=o(109),r=o.n(i),l=o(6),s=o(24),c=o.n(s),d=o(32),u=o.n(d),m=o(15),h=o(3),p=o(10),g=o(89),f=o.n(g),_=o(11),b=o(4);const y=({comment:e,className:t})=>{const o=e.username?a.a.createElement("a",{key:-1,href:b.b.getUsernameUrl(e.username),target:"_blank",className:f.a.username},e.username):null,n=o?(e,t)=>t>0?e:[o,...e]:void 0,i=Object(h.q)(e.text,n),r=1===e.likeCount?"like":"likes";return a.a.createElement("div",{className:Object(_.b)(f.a.root,t)},a.a.createElement("div",{className:f.a.content},a.a.createElement("div",{key:e.id,className:f.a.text},i)),a.a.createElement("div",{className:f.a.metaList},a.a.createElement("div",{className:f.a.date},Object(h.s)(e.timestamp)),e.likeCount>0&&a.a.createElement("div",{className:f.a.likeCount},`${e.likeCount} ${r}`)))};var v=o(7),M=o(202),x=o.n(M),L=o(170),E=o.n(L);function w(e){var{url:t,caption:o,size:n}=e,i=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]])}return o}(e,["url","caption","size"]);const[r,l]=a.a.useState(!1),s={width:n.width+"px",height:n.height+"px"};return a.a.createElement("img",Object.assign({style:s,className:r?E.a.image:E.a.loading,src:t,alt:o,loading:"eager",onLoad:()=>l(!0)},i))}var O=o(71),S=o.n(O);function C(e){var{album:t,autoplayVideos:o,size:n}=e,i=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]])}return o}(e,["album","autoplayVideos","size"]);const r=a.a.useRef(),[l,s]=a.a.useState(0),c={transform:`translateX(${100*-l}%)`},d=t.length-1,u={width:n.width+"px",height:n.height+"px"};return a.a.createElement("div",{className:S.a.root,style:u},a.a.createElement("div",{className:S.a.strip,style:c},t.map((e,t)=>a.a.createElement("div",{key:e.id,className:S.a.frame,ref:t>0?void 0:r},a.a.createElement(I,Object.assign({media:e,size:n,autoplayVideos:o},i))))),a.a.createElement("div",{className:S.a.controls},a.a.createElement("div",null,l>0&&a.a.createElement("div",{className:S.a.prevButton,onClick:()=>s(Math.max(l-1,0)),role:"button"},a.a.createElement(p.a,{icon:"arrow-left-alt2"}))),a.a.createElement("div",null,l<d&&a.a.createElement("div",{className:S.a.nextButton,onClick:()=>s(Math.min(l+1,d)),role:"button"},a.a.createElement(p.a,{icon:"arrow-right-alt2"})))),a.a.createElement("div",{className:S.a.indicatorList},t.map((e,t)=>a.a.createElement("div",{key:t,className:t===l?S.a.indicatorCurrent:S.a.indicator}))))}var T=o(79),P=o.n(T),k=o(73);function B(e){var{media:t,thumbnailUrl:o,size:i,autoPlay:r,onGetMetaData:l}=e,s=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]])}return o}(e,["media","thumbnailUrl","size","autoPlay","onGetMetaData"]);const c=a.a.useRef(),[d,u]=a.a.useState(!r),[m,g]=a.a.useState(r);Object(n.useEffect)(()=>{r?d&&u(!1):d||u(!0),m&&g(r)},[t.url]),Object(n.useLayoutEffect)(()=>{if(c.current){const e=()=>g(!0),t=()=>g(!1);return c.current.addEventListener("play",e),c.current.addEventListener("pause",t),()=>{c.current.removeEventListener("play",e),c.current.removeEventListener("pause",t)}}},[c.current]);const f={width:i.width+"px",height:i.height+"px"};return a.a.createElement("div",{key:t.url,className:P.a.root,style:f},a.a.createElement(k.a,{className:d?P.a.thumbnail:P.a.thumbnailHidden,media:t,size:h.a.LARGE,width:i.width,height:i.height}),a.a.createElement("video",Object.assign({ref:c,className:d?P.a.videoHidden:P.a.video,src:t.url,autoPlay:r,controls:!1,playsInline:!0,loop:!0,onCanPlay:()=>{r&&c.current.play()}},s),a.a.createElement("source",{src:t.url}),"Your browser does not support videos"),a.a.createElement("div",{className:m?P.a.controlPlaying:P.a.controlPaused,onClick:()=>{c.current&&(d?(u(!1),c.current.currentTime=0,c.current.play()):c.current.paused?c.current.play():c.current.pause())}},a.a.createElement(p.a,{className:P.a.playButton,icon:"controls-play"})))}function I({media:e,size:t,autoplayVideos:o}){if(e.url&&e.url.length>0)switch(e.type){case m.a.Type.IMAGE:return a.a.createElement(w,{url:e.url,size:t,caption:e.caption});case m.a.Type.VIDEO:return a.a.createElement(B,{media:e,size:t,thumbnailUrl:e.thumbnail,autoPlay:o});case m.a.Type.ALBUM:if(e.children&&e.children.length>0)return a.a.createElement(C,{album:e.children,size:t,autoplayVideos:o})}const n={width:t.width,height:t.height};return a.a.createElement("div",{className:x.a.notAvailable,style:n},a.a.createElement("span",null,"Media is not available"))}var N=o(20),A=o(59);const j=new Map;function D({feed:e,mediaList:t,current:o,options:i,onClose:r}){var l,s;const d=t.length-1,[g,f]=a.a.useState(o),_=a.a.useRef(g),M=e=>{f(e),_.current=e;const o=t[_.current];j.has(o.id)?C(j.get(o.id)):(L(!0),Object(h.i)(o,{width:600,height:600}).then(e=>{C(e),j.set(o.id,e)}))},[x,L]=a.a.useState(!1),[E,w]=a.a.useState(function(){const e=window.innerWidth<1080?window.innerWidth/1080*600:600;return{width:e,height:e}}()),[O,S]=a.a.useState(!1),C=e=>{w(e),L(!1),S(e.width+435>=window.innerWidth)};Object(n.useEffect)(()=>{M(o)},[o]),Object(N.l)("resize",()=>{const e=t[_.current];if(j.has(e.id)){let t=j.get(e.id);C(t)}});const T=t[g],P=T.comments?T.comments.slice(0,i.numLightboxComments):[],k=v.a.getLink(T,e.options),B=null!==k.text&&null!==k.url;T.caption&&T.caption.length&&P.splice(0,0,{id:T.id,text:T.caption,timestamp:T.timestamp,username:T.username});let D=null,H=null,z=null;switch(T.source.type){case m.a.Source.Type.PERSONAL_ACCOUNT:case m.a.Source.Type.BUSINESS_ACCOUNT:case m.a.Source.Type.TAGGED_ACCOUNT:D="@"+T.username,H=b.b.getUsernameUrl(T.username);const e=b.b.getByUsername(T.username);z=e?b.b.getProfilePicUrl(e):null;break;case m.a.Source.Type.RECENT_HASHTAG:case m.a.Source.Type.POPULAR_HASHTAG:D="#"+T.source.name,H="https://instagram.com/explore/tags/"+T.source.name}const F={fontSize:i.textSize},R=e=>{M(Math.max(0,_.current-1)),e.stopPropagation(),e.preventDefault()},U=e=>{M(Math.min(d,_.current+1)),e.stopPropagation(),e.preventDefault()},W=e=>{r&&r(),e.stopPropagation(),e.preventDefault()};{Object(n.useEffect)(()=>(document.body.addEventListener("keydown",e),()=>document.body.removeEventListener("keydown",e)),[]);const e=e=>{switch(e.key){case"ArrowRight":U(e);break;case"ArrowLeft":R(e);break;case"Escape":W(e)}}}const V={width:E.width+"px",height:E.height+"px"},G=a.a.createElement("div",{style:F,className:c.a.root,tabIndex:-1},a.a.createElement("div",{className:c.a.shade,onClick:W}),x&&a.a.createElement("div",{className:c.a.loadingSkeleton,style:V}),!x&&a.a.createElement("div",{className:O?c.a.wrapVertical:c.a.wrap},a.a.createElement("div",{className:c.a.container,role:"dialog"},a.a.createElement("div",{className:c.a.frame},x?a.a.createElement(A.a,null):a.a.createElement(I,{key:T.id,media:T,size:E})),e.options.lightboxShowSidebar&&a.a.createElement("div",{className:c.a.sidebar},a.a.createElement("div",{className:c.a.sidebarHeader},z&&a.a.createElement("a",{href:H,target:"_blank",className:c.a.sidebarHeaderPicLink},a.a.createElement("img",{className:c.a.sidebarHeaderPic,src:z,alt:null!=D?D:""})),D&&a.a.createElement("div",{className:c.a.sidebarSourceName},a.a.createElement("a",{href:H,target:"_blank"},D))),a.a.createElement("div",{className:c.a.sidebarScroller},P.length>0&&a.a.createElement("div",{className:c.a.sidebarCommentList},P.map((e,t)=>a.a.createElement(y,{key:t,comment:e,className:c.a.sidebarComment})))),a.a.createElement("div",{className:c.a.sidebarFooter},a.a.createElement("div",{className:c.a.sidebarInfo},T.source.type!==m.a.Source.Type.PERSONAL_ACCOUNT&&a.a.createElement("div",{className:c.a.sidebarNumLikes},a.a.createElement("span",null,T.likesCount)," ",a.a.createElement("span",null,"likes")),T.timestamp&&a.a.createElement("div",{className:c.a.sidebarDate},Object(h.s)(T.timestamp))),a.a.createElement("div",{className:c.a.sidebarIgLink},a.a.createElement("a",{href:null!==(l=k.url)&&void 0!==l?l:T.permalink,target:k.newTab?"_blank":"_self"},a.a.createElement(p.a,{icon:B?"external":"instagram"}),a.a.createElement("span",null,null!==(s=k.text)&&void 0!==s?s:"View on Instagram")))))),g>0&&a.a.createElement("div",{className:c.a.prevButtonContainer},a.a.createElement("div",{className:c.a.prevButton,onClick:R,role:"button",tabIndex:0},a.a.createElement(p.a,{icon:"arrow-left-alt",className:c.a.buttonIcon}))),g<t.length-1&&a.a.createElement("div",{className:c.a.nextButtonContainer},a.a.createElement("div",{className:c.a.nextButton,onClick:U,role:"button",tabIndex:0},a.a.createElement(p.a,{icon:"arrow-right-alt",className:c.a.buttonIcon})))),a.a.createElement("div",{className:c.a.closeButton,onClick:W,role:"button",tabIndex:0},a.a.createElement(p.a,{icon:"no-alt",className:c.a.buttonIcon})));return u.a.createPortal(G,document.body)}var H=o(49),z=o.n(H),F=o(171),R=o.n(F);const U=Object(l.b)(({options:e})=>{const t="https://instagram.com/"+e.account.username,o={color:e.followBtnTextColor,backgroundColor:e.followBtnBgColor};return a.a.createElement("a",{href:t,target:"__blank",className:R.a.link},a.a.createElement("button",{className:R.a.button,style:o},e.followBtnText))});var W=o(44),V=o.n(W),G=o(149),q=o(140),K=Object(l.b)((function({stories:e,options:t,onClose:o}){e.sort((e,t)=>{const o=Object(G.a)(e.timestamp).getTime(),n=Object(G.a)(t.timestamp).getTime();return o<n?-1:o==n?0:1});const[i,r]=a.a.useState(0),l=e.length-1,[s,c]=a.a.useState(0),[d,h]=a.a.useState(0);Object(n.useEffect)(()=>{0!==s&&c(0)},[i]);const g=i<l,f=i>0,_=()=>o&&o(),b=()=>i<l?r(i+1):_(),y=()=>r(e=>Math.max(e-1,0)),v=e[i],M="https://instagram.com/"+t.account.username,x=v.type===m.a.Type.VIDEO?d:t.storiesInterval;Object(N.d)("keydown",e=>{switch(e.key){case"Escape":_();break;case"ArrowLeft":y();break;case"ArrowRight":b();break;default:return}e.preventDefault(),e.stopPropagation()});const L=a.a.createElement("div",{className:V.a.root},a.a.createElement("div",{className:V.a.container},a.a.createElement("div",{className:V.a.header},a.a.createElement("a",{href:M,target:"_blank"},a.a.createElement("img",{className:V.a.profilePicture,src:t.profilePhotoUrl,alt:t.account.username})),a.a.createElement("a",{href:M,className:V.a.username,target:"_blank"},t.account.username),a.a.createElement("div",{className:V.a.date},Object(q.a)(Object(G.a)(v.timestamp),{addSuffix:!0}))),a.a.createElement("div",{className:V.a.progress},e.map((e,t)=>a.a.createElement($,{key:e.id,duration:x,animate:t===i,isDone:t<i}))),a.a.createElement("div",{className:V.a.content},f&&a.a.createElement("div",{className:V.a.prevButton,onClick:y,role:"button"},a.a.createElement(p.a,{icon:"arrow-left-alt2"})),a.a.createElement("div",{className:V.a.media},a.a.createElement(X,{key:v.id,media:v,imgDuration:t.storiesInterval,onGetDuration:h,onEnd:()=>g?b():_()})),g&&a.a.createElement("div",{className:V.a.nextButton,onClick:b,role:"button"},a.a.createElement(p.a,{icon:"arrow-right-alt2"})),a.a.createElement("div",{className:V.a.closeButton,onClick:_,role:"button"},a.a.createElement(p.a,{icon:"no-alt"})))));return u.a.createPortal(L,document.body)}));function $({animate:e,isDone:t,duration:o}){const n=e?V.a.progressOverlayAnimating:t?V.a.progressOverlayDone:V.a.progressOverlay,i={animationDuration:o+"s"};return a.a.createElement("div",{className:V.a.progressSegment},a.a.createElement("div",{className:n,style:i}))}function X({media:e,imgDuration:t,onGetDuration:o,onEnd:n}){return e.type===m.a.Type.VIDEO?a.a.createElement(J,{media:e,onEnd:n,onGetDuration:o}):a.a.createElement(Y,{media:e,onEnd:n,duration:t})}function Y({media:e,duration:t,onEnd:o}){const[i,r]=a.a.useState(!1);return Object(n.useEffect)(()=>{const e=i?setTimeout(o,1e3*t):null;return()=>clearTimeout(e)},[e,i]),a.a.createElement("img",{src:e.url,onLoad:()=>r(!0),loading:"eager",alt:""})}function J({media:e,onEnd:t,onGetDuration:o}){const n=a.a.useRef();return a.a.createElement("video",{ref:n,src:e.url,poster:e.thumbnail,autoPlay:!0,controls:!1,playsInline:!0,loop:!1,onCanPlay:()=>o(n.current.duration),onEnded:t},a.a.createElement("source",{src:e.url}),"Your browser does not support embedded videos")}var Q=Object(l.b)((function({feed:e,options:t}){const[o,n]=a.a.useState(null),i=t.account,r="https://instagram.com/"+i.username,l=e.stories.filter(e=>e.username===i.username),s=l.length>0,c=t.headerInfo.includes(v.a.HeaderInfo.MEDIA_COUNT),d=t.headerInfo.includes(v.a.HeaderInfo.FOLLOWERS)&&i.type!=b.a.Type.PERSONAL,u=t.headerInfo.includes(v.a.HeaderInfo.PROFILE_PIC),m=t.includeStories&&s,h=t.headerStyle===v.a.HeaderStyle.BOXED,p={fontSize:t.headerTextSize,color:t.headerTextColor,backgroundColor:t.headerBgColor,padding:t.headerPadding},g=m?"button":void 0,f={width:t.headerPhotoSize,height:t.headerPhotoSize,cursor:m?"pointer":"normal"},_=t.showFollowBtn&&(t.followBtnLocation===v.a.FollowBtnLocation.HEADER||t.followBtnLocation===v.a.FollowBtnLocation.BOTH),y={justifyContent:t.showBio&&h?"flex-start":"center"},M=a.a.createElement("img",{src:t.profilePhotoUrl,alt:i.username}),x=m&&s?z.a.profilePicWithStories:z.a.profilePic;return a.a.createElement("div",{className:Z(t.headerStyle),style:p},a.a.createElement("div",{className:z.a.leftContainer},u&&a.a.createElement("div",{className:x,style:f,role:g,onClick:()=>{m&&n(0)}},m?M:a.a.createElement("a",{href:r,target:"_blank"},M)),a.a.createElement("div",{className:z.a.info},a.a.createElement("div",{className:z.a.username},a.a.createElement("a",{href:r,target:"_blank",style:{color:t.headerTextColor}},a.a.createElement("span",null,"@"),a.a.createElement("span",null,i.username))),t.showBio&&a.a.createElement("div",{className:z.a.bio},t.bioText),(c||d)&&a.a.createElement("div",{className:z.a.counterList},c&&a.a.createElement("div",{className:z.a.counter},a.a.createElement("span",null,i.mediaCount)," posts"),d&&a.a.createElement("div",{className:z.a.counter},a.a.createElement("span",null,i.followersCount)," followers")))),a.a.createElement("div",{className:z.a.rightContainer},_&&a.a.createElement("div",{className:z.a.followButton,style:y},a.a.createElement(U,{options:t}))),m&&null!==o&&a.a.createElement(K,{stories:l,options:t,onClose:()=>{n(null)}}))}));function Z(e){switch(e){case v.a.HeaderStyle.NORMAL:return z.a.normalStyle;case v.a.HeaderStyle.CENTERED:return z.a.centeredStyle;case v.a.HeaderStyle.BOXED:return z.a.boxedStyle;default:return}}var ee=o(203),te=o.n(ee);const oe=Object(l.b)(({feed:e,options:t})=>{const o=a.a.useRef(),n=Object(N.j)(o,{block:"end",inline:"nearest"}),i={color:t.loadMoreBtnTextColor,backgroundColor:t.loadMoreBtnBgColor};return a.a.createElement("button",{ref:o,className:te.a.root,style:i,onClick:()=>{n(),e.loadMore()}},e.isLoading?a.a.createElement("span",null,"Loading ..."):a.a.createElement("span",null,e.options.loadMoreBtnText))});t.a=Object(l.b)((function({children:e,feed:t,options:o}){const[n,i]=a.a.useState(null),l={width:o.feedWidth,height:o.feedHeight,fontSize:o.textSize},s={backgroundColor:o.bgColor,padding:o.feedPadding},c={marginBottom:o.imgPadding},d={marginTop:o.buttonPadding},u=o.showHeader&&a.a.createElement("div",{style:c},a.a.createElement(Q,{feed:t,options:o})),m=o.showLoadMoreBtn&&t.canLoadMore&&a.a.createElement("div",{className:r.a.loadMoreBtn,style:d},a.a.createElement(oe,{feed:t,options:o})),h=o.showFollowBtn&&(o.followBtnLocation===v.a.FollowBtnLocation.BOTTOM||o.followBtnLocation===v.a.FollowBtnLocation.BOTH)&&a.a.createElement("div",{className:r.a.followBtn,style:d},a.a.createElement(U,{options:o})),p=new Array(o.numPosts).fill(r.a.fakeMedia);return a.a.createElement("div",{className:r.a.root,style:l},a.a.createElement("div",{className:r.a.wrapper,style:s},e({mediaList:t.media,openMedia:function(e){const n=t.media[e];if(!t.options.promotionEnabled||!v.a.executeMediaClick(n,t.options))switch(o.linkBehavior){case v.a.LinkBehavior.LIGHTBOX:return void i(e);case v.a.LinkBehavior.NEW_TAB:return void window.open(n.permalink,"_blank");case v.a.LinkBehavior.SELF:return void window.open(n.permalink,"_self")}},header:u,loadMoreBtn:m,followBtn:h,loadingMedia:p})),null!==n&&a.a.createElement(D,{feed:t,mediaList:t.media,current:n,options:o,onClose:()=>i(null)}))}))},168:function(e,t,o){"use strict";var n=o(108),a=o.n(n),i=o(0),r=o.n(i),l=o(15),s=o(6),c=o(54),d=o.n(c),u=o(149),m=o(622),h=o(621),p=o(7),g=o(10),f=o(3),_=Object(s.b)((function({options:e,media:t}){var o;const n=r.a.useRef(),[a,s]=r.a.useState(null);Object(i.useEffect)(()=>{n.current&&s(n.current.getBoundingClientRect().width)},[]);let c=e.hoverInfo.some(e=>e===p.a.HoverInfo.LIKES_COMMENTS);c=c&&(t.source.type!==l.a.Source.Type.PERSONAL_ACCOUNT||t.source.type===l.a.Source.Type.PERSONAL_ACCOUNT&&t.likesCount+t.commentsCount>0);const _=e.hoverInfo.some(e=>e===p.a.HoverInfo.CAPTION),b=e.hoverInfo.some(e=>e===p.a.HoverInfo.USERNAME),y=e.hoverInfo.some(e=>e===p.a.HoverInfo.DATE),v=e.hoverInfo.some(e=>e===p.a.HoverInfo.INSTA_LINK),M=null!==(o=t.caption)&&void 0!==o?o:"",x=t.timestamp?Object(u.a)(t.timestamp):null,L=t.timestamp?Object(m.a)(x).toString():null,E=t.timestamp?Object(h.a)(x,"HH:mm - do MMM yyyy"):null,w=t.timestamp?Object(f.s)(t.timestamp):null,O={color:e.textColorHover,backgroundColor:e.bgColorHover};let S=null;if(null!==a){const o=Math.sqrt(1.3*(a+30)),n=Math.sqrt(1.6*a+100),i=Math.max(o,8)+"px",l=Math.max(n,8)+"px",s={fontSize:i},u={fontSize:i,width:i,height:i},m={color:e.textColorHover,fontSize:l,width:l,height:l};S=r.a.createElement("div",{className:d.a.rows},r.a.createElement("div",{className:d.a.topRow},b&&t.username&&r.a.createElement("div",{className:d.a.username},r.a.createElement("a",{href:"https://instagram.com/"+t.username,target:"_blank"},"@",t.username)),_&&t.caption&&r.a.createElement("div",{className:d.a.caption},M)),r.a.createElement("div",{className:d.a.middleRow},c&&r.a.createElement("div",{className:d.a.counterList},r.a.createElement("span",{className:d.a.likesCount,style:s},r.a.createElement(g.a,{icon:"heart",style:u})," ",t.likesCount),r.a.createElement("span",{className:d.a.commentsCount,style:s},r.a.createElement(g.a,{icon:"admin-comments",style:u})," ",t.commentsCount))),r.a.createElement("div",{className:d.a.bottomRow},y&&t.timestamp&&r.a.createElement("div",{className:d.a.date},r.a.createElement("time",{dateTime:L,title:E},w)),v&&r.a.createElement("a",{className:d.a.igLinkIcon,href:t.permalink,title:M,target:"_blank",style:m,onClick:e=>e.stopPropagation()},r.a.createElement(g.a,{icon:"instagram",style:m}))))}return r.a.createElement("div",{ref:n,className:d.a.root,style:O},S)})),b=o(12),y=o(73);t.a=Object(s.b)((function({media:e,options:t,forceOverlay:o,onClick:n}){const[i,s]=r.a.useState(!1),c=function(e){switch(e.type){case l.a.Type.IMAGE:return a.a.imageTypeIcon;case l.a.Type.VIDEO:return a.a.videoTypeIcon;case l.a.Type.ALBUM:return a.a.albumTypeIcon;default:return}}(e),d={backgroundImage:`url(${b.a.image("ig-type-sprites.png")})`};return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:a.a.root,onClick:e=>{n&&n(e)},onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1)},r.a.createElement(y.a,{media:e}),r.a.createElement("div",{className:c,style:d}),(i||o)&&r.a.createElement("div",{className:a.a.overlay},r.a.createElement(_,{media:e,options:t}))))}))},169:function(e,t,o){e.exports={root:"MediaTileCaption__root",preview:"MediaTileCaption__preview MediaTileCaption__root",full:"MediaTileCaption__full MediaTileCaption__root"}},17:function(e,t,o){"use strict";var n=o(33),a=o.n(n),i=o(12),r=o(34);const l=i.a.config.restApi.baseUrl,s={};i.a.config.restApi.authToken&&(s["X-Sli-Auth-Token"]=i.a.config.restApi.authToken);const c=a.a.create({baseURL:l,headers:s}),d={config:Object.assign(Object.assign({},i.a.config.restApi),{forceImports:!1}),driver:c,getAccounts:()=>c.get("/accounts"),getFeeds:()=>c.get("/feeds"),getFeedMedia:(e,t=0,o=0,n)=>{const i=n?new a.a.CancelToken(n):void 0;return new Promise((n,a)=>{const r=e=>{n(e),document.dispatchEvent(new Event(d.events.onGetFeedMedia))};c.post("/media/feed",{options:e,num:o,from:t},{cancelToken:i}).then(n=>{n.data.needImport?(t>0||d.config.forceImports)&&d.importMedia(e).then(()=>{c.post("/media/feed",{options:e,num:o,from:t},{cancelToken:i}).then(r).catch(a)}).catch(a):r(n)}).catch(a)})},getMedia:(e=0,t=0)=>c.get(`/media?num=${e}&offset=${t}`),importMedia:e=>new Promise((t,o)=>{document.dispatchEvent(new Event(d.events.onImportStart));const n=e=>{document.dispatchEvent(new Event(d.events.onImportFail)),o(e)};c.post("/media/import",{options:e}).then(e=>{e.data.success?(document.dispatchEvent(new Event(d.events.onImportEnd)),t(e)):n(e)}).catch(n)}),getErrorReason:e=>{let t;return"object"==typeof e.response&&(e=e.response.data),t="string"==typeof e.message?e.message:e.toString(),Object(r.b)(t)},events:{onGetFeedMedia:"sli/api/media/feed",onImportStart:"sli/api/import/start",onImportEnd:"sli/api/import/end",onImportFail:"sli/api/import/fail"}};t.a=d},170:function(e,t,o){e.exports={image:"MediaLightboxImage__image MediaLightboxObject__media",loading:"MediaLightboxImage__loading MediaLightboxObject__media MediaLightboxObject__loading-animation"}},171:function(e,t,o){e.exports={link:"FollowButton__link",button:"FollowButton__button feed__feed-button"}},2:function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));var n,a=o(1),i=function(e,t,o,n){var a,i=arguments.length,r=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(i<3?a(r):i>3?a(t,o,r):a(t,o))||r);return i>3&&r&&Object.defineProperty(t,o,r),r};!function(e){class t{constructor(e,t,o){this.prop=e,this.name=t,this.icon=o}}t.DESKTOP=new t("desktop","Desktop","desktop"),t.TABLET=new t("tablet","Tablet","tablet"),t.PHONE=new t("phone","Phone","smartphone"),e.Mode=t,e.MODES=[t.DESKTOP,t.TABLET,t.PHONE];class o{constructor(e,t,o){this.desktop=e,this.tablet=t,this.phone=o}get(e,t){return n(this,e,t)}set(e,t){r(this,t,e)}with(e,t){const n=l(this,t,e);return new o(n.desktop,n.tablet,n.phone)}}function n(e,t,o=!1){if(!e)return;const n=e[t.prop];return o&&null==n?e.desktop:n}function r(e,t,o){return e[o.prop]=t,e}function l(e,t,n){return r(new o(e.desktop,e.tablet,e.phone),t,n)}i([a.n],o.prototype,"desktop",void 0),i([a.n],o.prototype,"tablet",void 0),i([a.n],o.prototype,"phone",void 0),e.Value=o,e.getName=function(e){return e.name},e.getIcon=function(e){return e.icon},e.cycle=function(o){const n=e.MODES.findIndex(e=>e===o);return void 0===n?t.DESKTOP:e.MODES[(n+1)%e.MODES.length]},e.get=n,e.set=r,e.withValue=l,e.normalize=function(e,t){return null==e?t.hasOwnProperty("all")?new o(t.all,t.all,t.all):new o(t.desktop,t.tablet,t.phone):"object"==typeof e&&e.hasOwnProperty("desktop")?new o(e.desktop,e.tablet,e.phone):new o(e,e,e)},e.getModeForWindowSize=function(e){return e.width<=768?t.PHONE:e.width<=935?t.TABLET:t.DESKTOP},e.isValid=function(e){return"object"==typeof e&&e.hasOwnProperty("desktop")}}(n||(n={}))},20:function(e,t,o){"use strict";o.d(t,"i",(function(){return l})),o.d(t,"e",(function(){return s})),o.d(t,"b",(function(){return c})),o.d(t,"c",(function(){return d})),o.d(t,"a",(function(){return u})),o.d(t,"m",(function(){return m})),o.d(t,"g",(function(){return h})),o.d(t,"k",(function(){return p})),o.d(t,"j",(function(){return g})),o.d(t,"d",(function(){return _})),o.d(t,"l",(function(){return b})),o.d(t,"f",(function(){return y})),o.d(t,"h",(function(){return v}));var n=o(0),a=o.n(n),i=o(42),r=o(29);function l(e,t){!function(e,t,o){const n=a.a.useRef(!0);e(()=>{n.current=!0;const e=t(()=>new Promise(e=>{n.current&&e()}));return()=>{n.current=!1,e&&e()}},o)}(n.useEffect,e,t)}function s(e){const[t,o]=a.a.useState(e),n=a.a.useRef(t);return[t,()=>n.current,e=>o(n.current=e)]}function c(e,t,o=[]){function a(n){!e.current||e.current.contains(n.target)||o.some(e=>e&&e.current&&e.current.contains(n.target))||t(n)}Object(n.useEffect)(()=>(document.addEventListener("mousedown",a),document.addEventListener("touchend",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchend",a)}))}function d(e,t){Object(n.useEffect)(()=>{const o=()=>{0===e.filter(e=>!e.current||document.activeElement===e.current||e.current.contains(document.activeElement)).length&&t()};return document.addEventListener("keyup",o),()=>document.removeEventListener("keyup",o)},e)}function u(e,t,o=100){const[i,r]=a.a.useState(e);return Object(n.useEffect)(()=>{let n=null;return e===t?n=setTimeout(()=>r(t),o):r(!t),()=>{null!==n&&clearTimeout(n)}},[e]),[i,r]}function m(e){const[t,o]=a.a.useState(Object(r.b)()),i=()=>{const t=Object(r.b)();o(t),e&&e(t)};return Object(n.useEffect)(()=>(i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)),[]),t}function h(){return new URLSearchParams(Object(i.e)().search)}function p(e,t){const o=o=>{if(t)return(o||window.event).returnValue=e,e};Object(n.useEffect)(()=>(window.addEventListener("beforeunload",o),()=>window.removeEventListener("beforeunload",o)),[t])}function g(e,t){const o=a.a.useRef(!1);return Object(n.useEffect)(()=>{o.current&&void 0!==e.current&&(e.current.scrollIntoView(Object.assign({behavior:"smooth",block:"start"},null!=t?t:{})),o.current=!1)},[o.current]),()=>o.current=!0}function f(e,t,o,a=[],i=[]){Object(n.useEffect)(()=>(a.reduce((e,t)=>e&&t,!0)&&e.addEventListener(t,o),()=>e.removeEventListener(t,o)),i)}function _(e,t,o=[],n=[]){f(document,e,t,o,n)}function b(e,t,o=[],n=[]){f(window,e,t,o,n)}function y(e){return t=>{" "!==t.key&&"Enter"!==t.key||(e(),t.preventDefault(),t.stopPropagation())}}function v(e){const[t,o]=a.a.useState(e);return[function(e){const t=a.a.useRef(e);return t.current=e,t}(t),o]}o(34)},201:function(e,t,o){"use strict";var n=o(0),a=o.n(n),i=o(64),r=o.n(i),l=o(6),s=o(168),c=o(162),d=o(163),u=o(167),m=o(11),h=o(3);t.a=Object(l.b)((function({feed:e,options:t,cellClassName:o}){const i=a.a.useRef(),[l,p]=a.a.useState(0);Object(n.useLayoutEffect)(()=>{i.current&&p(i.current.getBoundingClientRect().height)},[t]),o=null!=o?o:()=>{};const g={gridGap:t.imgPadding,gridTemplateColumns:`repeat(${t.numColumns}, auto)`},f={paddingBottom:`calc(100% + ${l}px)`};return a.a.createElement(u.a,{feed:e,options:t},({mediaList:n,openMedia:l,header:u,loadMoreBtn:p,followBtn:_,loadingMedia:b})=>a.a.createElement("div",{className:r.a.root},u,(!e.isLoading||e.isLoadingMore)&&a.a.createElement("div",{className:r.a.grid,style:g},e.media.length?n.map((e,n)=>a.a.createElement("div",{key:`${n}-${e.id}`,className:Object(m.b)(r.a.cell,o(e,n)),style:f},a.a.createElement("div",{className:r.a.cellContent},a.a.createElement("div",{className:r.a.mediaContainer},a.a.createElement(s.a,{media:e,onClick:()=>l(n),options:t})),a.a.createElement("div",{className:r.a.mediaMeta,ref:i},a.a.createElement(c.a,{options:t,media:e}),a.a.createElement(d.a,{options:t,media:e}))))):null,e.isLoadingMore&&b.map((e,t)=>a.a.createElement("div",{key:"fake-media-"+Object(h.u)(),className:Object(m.b)(r.a.loadingCell,e,o(null,t))}))),e.isLoading&&!e.isLoadingMore&&a.a.createElement("div",{className:r.a.grid,style:g},b.map((e,t)=>a.a.createElement("div",{key:"fake-media-"+Object(h.u)(),className:Object(m.b)(r.a.loadingCell,e,o(null,t))}))),a.a.createElement("div",{className:r.a.buttonList},p,_)))}))},202:function(e,t,o){e.exports={media:"MediaLightboxObject__media","not-available":"MediaLightboxObject__not-available MediaLightboxObject__media",notAvailable:"MediaLightboxObject__not-available MediaLightboxObject__media","loading-animation":"MediaLightboxObject__loading-animation",loadingAnimation:"MediaLightboxObject__loading-animation",loading:"MediaLightboxObject__loading"}},203:function(e,t,o){e.exports={root:"LoadMoreButton__root feed__feed-button"}},24:function(e,t,o){e.exports={root:"MediaLightbox__root layout__fill-parent layout__z-higher layout__flex-row layout__flex-center layout__no-overflow",shade:"MediaLightbox__shade layout__fill-parent layout__z-low","loading-skeleton":"MediaLightbox__loading-skeleton layout__z-high",loadingSkeleton:"MediaLightbox__loading-skeleton layout__z-high",wrap:"MediaLightbox__wrap","wrap-vertical":"MediaLightbox__wrap-vertical MediaLightbox__wrap layout__z-high",wrapVertical:"MediaLightbox__wrap-vertical MediaLightbox__wrap layout__z-high",container:"MediaLightbox__container layout__flex-row",sidebar:"MediaLightbox__sidebar layout__flex-column layout__scroll-y","sidebar-element":"MediaLightbox__sidebar-element",sidebarElement:"MediaLightbox__sidebar-element",frame:"MediaLightbox__frame layout__flex-column layout__flex-center","nav-button-container":"MediaLightbox__nav-button-container layout__flex-column layout__flex-center",navButtonContainer:"MediaLightbox__nav-button-container layout__flex-column layout__flex-center","next-button-container":"MediaLightbox__next-button-container MediaLightbox__nav-button-container layout__flex-column layout__flex-center",nextButtonContainer:"MediaLightbox__next-button-container MediaLightbox__nav-button-container layout__flex-column layout__flex-center","prev-button-container":"MediaLightbox__prev-button-container MediaLightbox__nav-button-container layout__flex-column layout__flex-center",prevButtonContainer:"MediaLightbox__prev-button-container MediaLightbox__nav-button-container layout__flex-column layout__flex-center",button:"MediaLightbox__button layout__z-low","button-icon":"MediaLightbox__button-icon",buttonIcon:"MediaLightbox__button-icon","close-button":"MediaLightbox__close-button MediaLightbox__button layout__z-low",closeButton:"MediaLightbox__close-button MediaLightbox__button layout__z-low","next-button":"MediaLightbox__next-button MediaLightbox__button layout__z-low",nextButton:"MediaLightbox__next-button MediaLightbox__button layout__z-low","prev-button":"MediaLightbox__prev-button MediaLightbox__button layout__z-low",prevButton:"MediaLightbox__prev-button MediaLightbox__button layout__z-low","sidebar-element-bordered":"MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element",sidebarElementBordered:"MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element","sidebar-header":"MediaLightbox__sidebar-header MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element layout__flex-row",sidebarHeader:"MediaLightbox__sidebar-header MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element layout__flex-row","sidebar-header-pic":"MediaLightbox__sidebar-header-pic",sidebarHeaderPic:"MediaLightbox__sidebar-header-pic","sidebar-header-pic-link":"MediaLightbox__sidebar-header-pic-link MediaLightbox__sidebar-header-pic",sidebarHeaderPicLink:"MediaLightbox__sidebar-header-pic-link MediaLightbox__sidebar-header-pic","sidebar-scroller":"MediaLightbox__sidebar-scroller layout__scroll-y",sidebarScroller:"MediaLightbox__sidebar-scroller layout__scroll-y","sidebar-comment-list":"MediaLightbox__sidebar-comment-list MediaLightbox__sidebar-element layout__flex-column",sidebarCommentList:"MediaLightbox__sidebar-comment-list MediaLightbox__sidebar-element layout__flex-column","sidebar-comment":"MediaLightbox__sidebar-comment",sidebarComment:"MediaLightbox__sidebar-comment","sidebar-source-name":"MediaLightbox__sidebar-source-name",sidebarSourceName:"MediaLightbox__sidebar-source-name","sidebar-footer":"MediaLightbox__sidebar-footer layout__flex-column",sidebarFooter:"MediaLightbox__sidebar-footer layout__flex-column","sidebar-info":"MediaLightbox__sidebar-info layout__flex-column MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element",sidebarInfo:"MediaLightbox__sidebar-info layout__flex-column MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element","sidebar-info-line":"MediaLightbox__sidebar-info-line",sidebarInfoLine:"MediaLightbox__sidebar-info-line","sidebar-num-likes":"MediaLightbox__sidebar-num-likes MediaLightbox__sidebar-info-line",sidebarNumLikes:"MediaLightbox__sidebar-num-likes MediaLightbox__sidebar-info-line","sidebar-date":"MediaLightbox__sidebar-date MediaLightbox__sidebar-info-line",sidebarDate:"MediaLightbox__sidebar-date MediaLightbox__sidebar-info-line","sidebar-ig-link":"MediaLightbox__sidebar-ig-link MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element",sidebarIgLink:"MediaLightbox__sidebar-ig-link MediaLightbox__sidebar-element-bordered MediaLightbox__sidebar-element"}},27:function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));class n{static getById(e){const t=n.list.find(t=>t.id===e);return!t&&n.list.length>0?n.list[0]:t}static getName(e){const t=n.getById(e);return t?t.name:"(Missing layout)"}static addLayout(e){n.list.push(e)}}n.list=[]},29:function(e,t,o){"use strict";function n(e,t,o={}){return window.open(e,t,function(e={}){return Object.getOwnPropertyNames(e).map(t=>`${t}=${e[t]}`).join(",")}(o))}function a(e,t){return{top:window.top.outerHeight/2+window.top.screenY-t/2,left:window.top.outerWidth/2+window.top.screenX-e/2,width:e,height:t}}function i(){const{innerWidth:e,innerHeight:t}=window;return{width:e,height:t}}o.d(t,"c",(function(){return n})),o.d(t,"a",(function(){return a})),o.d(t,"b",(function(){return i}))},3:function(e,t,o){"use strict";o.d(t,"u",(function(){return d})),o.d(t,"h",(function(){return u})),o.d(t,"b",(function(){return m})),o.d(t,"v",(function(){return h})),o.d(t,"c",(function(){return p})),o.d(t,"e",(function(){return g})),o.d(t,"p",(function(){return f})),o.d(t,"o",(function(){return _})),o.d(t,"k",(function(){return b})),o.d(t,"f",(function(){return y})),o.d(t,"n",(function(){return v})),o.d(t,"q",(function(){return M})),o.d(t,"a",(function(){return x})),o.d(t,"t",(function(){return L})),o.d(t,"s",(function(){return E})),o.d(t,"r",(function(){return w})),o.d(t,"i",(function(){return O})),o.d(t,"j",(function(){return S})),o.d(t,"m",(function(){return C})),o.d(t,"g",(function(){return T})),o.d(t,"d",(function(){return P})),o.d(t,"l",(function(){return k}));var n=o(0),a=o.n(n),i=o(140),r=o(149),l=o(15),s=o(48);let c=0;function d(){return c++}function u(e){const t={};return Object.keys(e).forEach(o=>{const n=e[o];Array.isArray(n)?t[o]=n.slice():n instanceof Map?t[o]=new Map(n.entries()):t[o]="object"==typeof n?u(n):n}),t}function m(e,t){return Object.keys(t).forEach(o=>{e[o]=t[o]}),e}function h(e,t){return m(u(e),t)}function p(e,t){return Array.isArray(e)&&Array.isArray(t)?g(e,t):e instanceof Map&&t instanceof Map?g(Array.from(e.entries()),Array.from(t.entries())):"object"==typeof e&&"object"==typeof t?f(e,t):e===t}function g(e,t,o){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(o){if(!o(e[n],t[n]))return!1}else if(!p(e[n],t[n]))return!1;return!0}function f(e,t){if(!e||!t||"object"!=typeof e||"object"!=typeof t)return p(e,t);const o=Object.keys(e),n=Object.keys(t);if(o.length!==n.length)return!1;const a=new Set(o.concat(n));for(const o of a)if(!p(e[o],t[o]))return!1;return!0}function _(e){return 0===Object.keys(null!=e?e:{}).length}function b(e,t,o){return o=null!=o?o:(e,t)=>e===t,e.filter(e=>!t.some(t=>o(e,t)))}function y(e,t,o){return o=null!=o?o:(e,t)=>e===t,e.every(e=>t.some(t=>o(e,t)))&&t.every(t=>e.some(e=>o(t,e)))}function v(e,t){return 0===e.tag.localeCompare(t.tag)&&e.sort===t.sort}function M(e,t,o=0,i=!1){let r=e.trim();i&&(r=r.replace(/((?:^[.*•]+(\r\n|\r|\n))+)/gm,"\n"));const l=r.split("\n"),s=l.map((e,o)=>{if(e=e.trim(),i&&/^[.*•]$/.test(e))return null;let r,s=[];for(;null!==(r=/#([^\s]+)/g.exec(e));){const t="https://instagram.com/explore/tags/"+r[1],o=a.a.createElement("a",{href:t,target:"_blank",key:d()},r[0]),n=e.substr(0,r.index),i=e.substr(r.index+r[0].length);s.push(n),s.push(o),e=i}return e.length&&s.push(e),t&&(s=t(s,o)),l.length>1&&s.push(a.a.createElement("br",{key:d()})),a.a.createElement(n.Fragment,{key:d()},s)});return o>0?s.slice(0,o):s}var x;function L(e,t){const o=/(\s+)/g;let n,a=0,i=0,r="";for(;null!==(n=o.exec(e))&&a<t;){const t=n.index+n[1].length;r+=e.substr(i,t-i),i=t,a++}return i<e.length&&(r+=" ..."),r}function E(e){return Object(i.a)(Object(r.a)(e),{addSuffix:!0})}function w(e,t){const o=[];return e.forEach((e,n)=>{const a=n%t;Array.isArray(o[a])?o[a].push(e):o[a]=[e]}),o}function O(e,t){return function e(t){if(t.type===l.a.Type.VIDEO){const e=document.createElement("video");return e.autoplay=!1,e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.visibility="hidden",document.body.appendChild(e),new Promise(o=>{e.src=t.url,e.addEventListener("loadeddata",()=>{o({width:e.videoWidth,height:e.videoHeight}),document.body.removeChild(e)})})}if(t.type===l.a.Type.IMAGE){const e=new Image;return e.src=t.url,new Promise(t=>{e.onload=()=>{t({width:e.naturalWidth,height:e.naturalHeight})}})}return t.type===l.a.Type.ALBUM?e(t.children[0]):Promise.reject("Unknown media type")}(e).then(e=>function(e,t){const o=e.width>e.height?t.width/e.width:t.height/e.height;return{width:e.width*o,height:e.height*o}}(e,t))}function S(e,t){const o=t.map(s.b).join("|");return new RegExp(`(?:^|\\B)#(${o})(?:\\b|\\r|$)`,"imu").test(e)}function C(e,t){for(const o of t){const t=o();if(e(t))return t}}function T(e,t){return Math.max(0,Math.min(t.length-1,e))}function P(e,t,o){const n=e.slice();return n[t]=o,n}function k(e){return Array.isArray(e)?e[0]:e}!function(e){e.SMALL="s",e.MEDIUM="m",e.LARGE="l"}(x||(x={}))},32:function(e,o){e.exports=t},34:function(e,t,o){"use strict";function n(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function a(e){const t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}o.d(t,"a",(function(){return n})),o.d(t,"b",(function(){return a}))},35:function(e,t,o){"use strict";o.d(t,"a",(function(){return c})),o.d(t,"b",(function(){return u}));var n=o(0),a=o.n(n),i=o(32),r=o.n(i),l=o(6);class s{constructor(e=new Map,t=[]){this.factories=e,this.extensions=new Map,this.cache=new Map,t.forEach(e=>this.addModule(e))}addModule(e){e.factories&&(this.factories=new Map([...this.factories,...e.factories])),e.extensions&&e.extensions.forEach((e,t)=>{this.extensions.has(t)?this.extensions.get(t).push(e):this.extensions.set(t,[e])})}get(e){let t=this.factories.get(e);if(void 0===t)throw new Error('Service "'+e+'" does not exist');let o=this.cache.get(e);if(void 0===o){o=t(this);let n=this.extensions.get(e);n&&n.forEach(e=>o=e(this,o)),this.cache.set(e,o)}return o}has(e){return this.factories.has(e)}}class c{constructor(e,t,o){this.key=e,this.mount=t,this.modules=o,this.container=null}addModules(e){this.modules=this.modules.concat(e)}run(){if(null!==this.container)return;let e=!1;const t=()=>{e||"interactive"!==document.readyState&&"complete"!==document.readyState||(this.actualRun(),e=!0)};t(),e||document.addEventListener("readystatechange",t)}actualRun(){!function(e){const t=`app/${e.key}/run`;document.dispatchEvent(new d(t,e))}(this);const e=u({root:()=>null,"root/children":()=>[]});this.container=new s(e,this.modules);const t=this.container.get("root/children").map((e,t)=>a.a.createElement(e,{key:t})),o=a.a.createElement(l.a,{c:this.container},t);this.modules.forEach(e=>e.run&&e.run(this.container)),r.a.render(o,this.mount)}}class d extends CustomEvent{constructor(e,t){super(e,{detail:{app:t}})}}function u(e){return new Map(Object.entries(e))}},37:function(e,t,o){e.exports={root:"MediaThumbnail__root","media-background-fade-in-animation":"MediaThumbnail__media-background-fade-in-animation",mediaBackgroundFadeInAnimation:"MediaThumbnail__media-background-fade-in-animation","media-object-fade-in-animation":"MediaThumbnail__media-object-fade-in-animation",mediaObjectFadeInAnimation:"MediaThumbnail__media-object-fade-in-animation",image:"MediaThumbnail__image","not-available":"MediaThumbnail__not-available",notAvailable:"MediaThumbnail__not-available"}},39:function(e,t,o){"use strict";function n(e){return t=>(t.stopPropagation(),e(t))}function a(e,t){let o;return(...n)=>{clearTimeout(o),o=setTimeout(()=>{o=null,e(...n)},t)}}function i(){}o.d(t,"c",(function(){return n})),o.d(t,"a",(function(){return a})),o.d(t,"b",(function(){return i}))},396:function(e,t,o){"use strict";o.r(t);var n=o(27),a=o(12),i=o(201);n.a.addLayout({id:"grid",name:"Grid",img:a.a.image("grid-layout.png"),component:i.a})},4:function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));var n,a=o(17),i=o(1);!function(e){let t;!function(e){e.PERSONAL="PERSONAL",e.BUSINESS="BUSINESS"}(t=e.Type||(e.Type={}))}(n||(n={}));const r=Object(i.n)([]),l="https://secure.gravatar.com/avatar/4a94d759753ade2961582f7345c1d7b2?s=64&d=mm&r=g",s=e=>r.find(t=>t.id===e),c=e=>"https://instagram.com/"+e;function d(e){return e.slice().sort((e,t)=>e.type===t.type?0:e.type===n.Type.PERSONAL?-1:1),r.splice(0,r.length),e.forEach(e=>r.push(Object(i.n)(e))),r}function u(e){if("object"==typeof e&&Array.isArray(e.data))return d(e.data);throw"Spotlight encountered a problem trying to load your accounts. Kindly contact customer support for assistance."}t.b={list:r,DEFAULT_PROFILE_PIC:l,getById:s,getByUsername:e=>r.find(t=>t.username===e),hasAccounts:()=>r.length>0,filterExisting:e=>e.filter(e=>void 0!==s(e)),idsToAccounts:e=>e.map(e=>s(e)).filter(e=>void 0!==e),getBusinessAccounts:()=>r.filter(e=>e.type===n.Type.BUSINESS),getProfilePicUrl:e=>e.customProfilePicUrl?e.customProfilePicUrl:e.profilePicUrl?e.profilePicUrl:l,getBioText:e=>e.customBio.length?e.customBio:e.bio,getProfileUrl:e=>c(e.username),getUsernameUrl:c,loadAccounts:function(){return a.a.getAccounts().then(u).catch(e=>{throw a.a.getErrorReason(e)})},loadFromResponse:u,addAccounts:d}},44:function(e,t,o){e.exports={root:"StoryLightbox__root layout__fill-parent layout__z-highest layout__flex-column",container:"StoryLightbox__container layout__flex-column",header:"StoryLightbox__header layout__flex-row","profile-picture":"StoryLightbox__profile-picture",profilePicture:"StoryLightbox__profile-picture",username:"StoryLightbox__username",date:"StoryLightbox__date",progress:"StoryLightbox__progress layout__flex-row","progress-segment":"StoryLightbox__progress-segment",progressSegment:"StoryLightbox__progress-segment","progress-overlay":"StoryLightbox__progress-overlay StoryLightbox__progress-segment",progressOverlay:"StoryLightbox__progress-overlay StoryLightbox__progress-segment","progress-overlay-animating":"StoryLightbox__progress-overlay-animating StoryLightbox__progress-overlay StoryLightbox__progress-segment",progressOverlayAnimating:"StoryLightbox__progress-overlay-animating StoryLightbox__progress-overlay StoryLightbox__progress-segment","progress-segment-animation":"StoryLightbox__progress-segment-animation",progressSegmentAnimation:"StoryLightbox__progress-segment-animation","progress-overlay-done":"StoryLightbox__progress-overlay-done StoryLightbox__progress-overlay StoryLightbox__progress-segment",progressOverlayDone:"StoryLightbox__progress-overlay-done StoryLightbox__progress-overlay StoryLightbox__progress-segment",content:"StoryLightbox__content layout__flex-row layout__flex-center",media:"StoryLightbox__media",button:"StoryLightbox__button","close-button":"StoryLightbox__close-button StoryLightbox__button",closeButton:"StoryLightbox__close-button StoryLightbox__button","nav-button":"StoryLightbox__nav-button StoryLightbox__button",navButton:"StoryLightbox__nav-button StoryLightbox__button","prev-button":"StoryLightbox__prev-button StoryLightbox__nav-button StoryLightbox__button",prevButton:"StoryLightbox__prev-button StoryLightbox__nav-button StoryLightbox__button","next-button":"StoryLightbox__next-button StoryLightbox__nav-button StoryLightbox__button",nextButton:"StoryLightbox__next-button StoryLightbox__nav-button StoryLightbox__button"}},48:function(e,t,o){"use strict";o.d(t,"a",(function(){return n})),o.d(t,"b",(function(){return a}));const n=(e,t)=>e.startsWith(t)?e:t+e,a=e=>{return(t=e,"#",t.startsWith("#")?t.substr("#".length):t).split(/\s/).map((e,t)=>t>0?e[0].toUpperCase()+e.substr(1):e).join("").replace(/\W/gi,"");var t}},49:function(e,t,o){e.exports={root:"FeedHeader__root",container:"FeedHeader__container","left-container":"FeedHeader__left-container FeedHeader__container",leftContainer:"FeedHeader__left-container FeedHeader__container","right-container":"FeedHeader__right-container FeedHeader__container",rightContainer:"FeedHeader__right-container FeedHeader__container","profile-pic":"FeedHeader__profile-pic",profilePic:"FeedHeader__profile-pic","profile-pic-with-stories":"FeedHeader__profile-pic-with-stories FeedHeader__profile-pic",profilePicWithStories:"FeedHeader__profile-pic-with-stories FeedHeader__profile-pic",info:"FeedHeader__info","info-row":"FeedHeader__info-row",infoRow:"FeedHeader__info-row",username:"FeedHeader__username FeedHeader__info-row",subtext:"FeedHeader__subtext FeedHeader__info-row",bio:"FeedHeader__bio FeedHeader__subtext FeedHeader__info-row","counter-list":"FeedHeader__counter-list FeedHeader__subtext FeedHeader__info-row",counterList:"FeedHeader__counter-list FeedHeader__subtext FeedHeader__info-row",counter:"FeedHeader__counter","follow-button":"FeedHeader__follow-button",followButton:"FeedHeader__follow-button","centered-style":"FeedHeader__centered-style FeedHeader__root",centeredStyle:"FeedHeader__centered-style FeedHeader__root","normal-style":"FeedHeader__normal-style FeedHeader__root",normalStyle:"FeedHeader__normal-style FeedHeader__root","boxed-style":"FeedHeader__boxed-style FeedHeader__root",boxedStyle:"FeedHeader__boxed-style FeedHeader__root"}},54:function(e,t,o){e.exports={root:"MediaOverlay__root layout__fill-parent",rows:"MediaOverlay__rows",row:"MediaOverlay__row","top-row":"MediaOverlay__top-row MediaOverlay__row",topRow:"MediaOverlay__top-row MediaOverlay__row","middle-row":"MediaOverlay__middle-row MediaOverlay__row",middleRow:"MediaOverlay__middle-row MediaOverlay__row","bottom-row":"MediaOverlay__bottom-row MediaOverlay__row",bottomRow:"MediaOverlay__bottom-row MediaOverlay__row","counter-list":"MediaOverlay__counter-list",counterList:"MediaOverlay__counter-list",username:"MediaOverlay__username",date:"MediaOverlay__date",caption:"MediaOverlay__caption",counter:"MediaOverlay__counter","comments-count":"MediaOverlay__comments-count MediaOverlay__counter",commentsCount:"MediaOverlay__comments-count MediaOverlay__counter","likes-count":"MediaOverlay__likes-count MediaOverlay__counter",likesCount:"MediaOverlay__likes-count MediaOverlay__counter","ig-link-icon":"MediaOverlay__ig-link-icon",igLinkIcon:"MediaOverlay__ig-link-icon"}},59:function(e,t,o){"use strict";o.d(t,"a",(function(){return l}));var n=o(0),a=o.n(n),i=o(74),r=o.n(i);function l(){return a.a.createElement("div",{className:r.a.root})}},64:function(e,t,o){e.exports={root:"GridLayout__root layout__flex-column",grid:"GridLayout__grid",cell:"GridLayout__cell","cell-content":"GridLayout__cell-content layout__fill-parent layout__flex-column",cellContent:"GridLayout__cell-content layout__fill-parent layout__flex-column","media-container":"GridLayout__media-container",mediaContainer:"GridLayout__media-container","media-meta":"GridLayout__media-meta layout__flex-column",mediaMeta:"GridLayout__media-meta layout__flex-column","button-list":"GridLayout__button-list layout__flex-column",buttonList:"GridLayout__button-list layout__flex-column"}},7:function(e,t,o){"use strict";o.d(t,"a",(function(){return b}));var n=o(33),a=o.n(n),i=o(1),r=o(2),l=o(27),s=o(35),c=o(4),d=o(3),u=o(13),m=o(17),h=o(39),p=o(8),g=o(14),f=o(12),_=function(e,t,o,n){var a,i=arguments.length,r=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(i<3?a(r):i>3?a(t,o,r):a(t,o))||r);return i>3&&r&&Object.defineProperty(t,o,r),r};class b{constructor(e=new b.Options,t=r.a.Mode.DESKTOP){this.media=[],this.canLoadMore=!1,this.stories=[],this.numLoadedMore=0,this.totalMedia=0,this.mode=r.a.Mode.DESKTOP,this.isLoaded=!1,this.isLoading=!1,this.isLoadingMore=!1,this.numMediaToShow=0,this.numMediaPerPage=0,this.cancelFetch=()=>{},this.options=new b.Options(e),this.localMedia=i.n.array([]),this.mode=t,this.mediaCounter=this._numMediaPerPage,this.reload=Object(h.a)(()=>this.load(),300),Object(i.o)(()=>this.mode,()=>{0===this.numLoadedMore&&(this.mediaCounter=this._numMediaPerPage,this.localMedia.length<this.numMediaToShow&&this.loadMedia(this.localMedia.length,this.numMediaToShow-this.localMedia.length))}),Object(i.o)(()=>this.getReloadOptions(),()=>this.reload()),Object(i.o)(()=>({num:this._numMediaPerPage,mode:this.mode}),({num:e})=>{this.localMedia.length<e&&e<=this.totalMedia?this.reload():this.mediaCounter=Math.max(1,e)}),Object(i.o)(()=>this._media,e=>this.media=e),Object(i.o)(()=>this._numMediaToShow,e=>this.numMediaToShow=e),Object(i.o)(()=>this._numMediaPerPage,e=>this.numMediaPerPage=e),Object(i.o)(()=>this._canLoadMore,e=>this.canLoadMore=e)}get _media(){return this.localMedia.slice(0,this.numMediaToShow)}get _numMediaToShow(){return Math.min(this.mediaCounter,this.totalMedia)}get _numMediaPerPage(){return Math.max(1,b.ComputedOptions.normalizeMultiInt(this.options.numPosts,this.mode,1))}get _canLoadMore(){return this.localMedia.length>this.mediaCounter||this.localMedia.length<this.totalMedia}loadMore(){const e=this.numMediaToShow+this._numMediaPerPage-this.localMedia.length;return this.isLoadingMore=!0,e>0?this.loadMedia(this.localMedia.length,this._numMediaPerPage).then(()=>{this.mediaCounter+=this._numMediaPerPage,this.numLoadedMore++,this.isLoadingMore=!1}):new Promise(e=>{this.numLoadedMore++,this.mediaCounter+=this._numMediaPerPage,this.isLoadingMore=!1,e()})}load(){return this.numLoadedMore=0,this.loadMedia(0,this._numMediaPerPage,!0).then(()=>(this.isLoaded=!0,this.mediaCounter=this._numMediaPerPage))}loadMedia(e,t,o){return this.cancelFetch(),b.Options.hasSources(this.options)?(this.isLoading=!0,new Promise((n,i)=>{m.a.getFeedMedia(this.options,e,t,e=>this.cancelFetch=e).then(e=>{var t;if("object"!=typeof e||"object"!=typeof e.data||!Array.isArray(e.data.media))throw{message:"The media response is malformed or corrupt",response:e};o&&this.localMedia.replace([]),this.addLocalMedia(e.data.media),this.stories=null!==(t=e.data.stories)&&void 0!==t?t:[],this.totalMedia=e.data.total,n&&n()}).catch(e=>{var t;if(a.a.isCancel(e))return null;const o=new b.Events.FetchFailEvent(b.Events.FETCH_FAIL,{detail:{feed:this,message:null!==(t=e.response?e.response.data.message:void 0)&&void 0!==t?t:e.message,response:e.response}});return document.dispatchEvent(o),i&&i(e),e}).finally(()=>this.isLoading=!1)})):new Promise(e=>{this.localMedia.replace([]),this.totalMedia=0,e&&e()})}addLocalMedia(e){e.forEach(e=>{this.localMedia.some(t=>t.id==e.id)||this.localMedia.push(e)})}getReloadOptions(){return JSON.stringify({accounts:this.options.accounts,hashtags:this.options.hashtags,tagged:this.options.tagged,postOrder:this.options.postOrder,mediaType:this.options.mediaType,moderation:this.options.moderation,moderationMode:this.options.moderationMode,hashtagBlacklist:this.options.hashtagBlacklist,hashtagWhitelist:this.options.hashtagWhitelist,captionBlacklist:this.options.captionBlacklist,captionWhitelist:this.options.captionWhitelist,hashtagBlacklistSettings:this.options.hashtagBlacklistSettings,hashtagWhitelistSettings:this.options.hashtagWhitelistSettings,captionBlacklistSettings:this.options.captionBlacklistSettings,captionWhitelistSettings:this.options.captionWhitelistSettings})}}_([i.n],b.prototype,"media",void 0),_([i.n],b.prototype,"canLoadMore",void 0),_([i.n],b.prototype,"stories",void 0),_([i.n],b.prototype,"numLoadedMore",void 0),_([i.n],b.prototype,"options",void 0),_([i.n],b.prototype,"totalMedia",void 0),_([i.n],b.prototype,"mode",void 0),_([i.n],b.prototype,"isLoaded",void 0),_([i.n],b.prototype,"isLoading",void 0),_([i.n],b.prototype,"isLoadingMore",void 0),_([i.f],b.prototype,"reload",void 0),_([i.n],b.prototype,"localMedia",void 0),_([i.n],b.prototype,"numMediaToShow",void 0),_([i.n],b.prototype,"numMediaPerPage",void 0),_([i.n],b.prototype,"mediaCounter",void 0),_([i.h],b.prototype,"_media",null),_([i.h],b.prototype,"_numMediaToShow",null),_([i.h],b.prototype,"_numMediaPerPage",null),_([i.h],b.prototype,"_canLoadMore",null),_([i.f],b.prototype,"loadMore",null),_([i.f],b.prototype,"load",null),_([i.f],b.prototype,"loadMedia",null),_([i.f],b.prototype,"addLocalMedia",null),function(e){let t,o,n,a,m,h,b,y,v;!function(e){e.FETCH_FAIL="sli/feed/fetch_fail";class t extends CustomEvent{constructor(e,t){super(e,t)}}e.FetchFailEvent=t}(t=e.Events||(e.Events={}));class M{constructor(e={}){M.setFromObject(this,e)}static setFromObject(t,o={}){var n,a,i,s,d,u,m,h,p,f,_,b,y,v,M;const x=o.accounts?o.accounts.slice():e.DefaultOptions.accounts;t.accounts=x.filter(e=>!!e).map(e=>parseInt(e.toString()));const L=o.tagged?o.tagged.slice():e.DefaultOptions.tagged;return t.tagged=L.filter(e=>!!e).map(e=>parseInt(e.toString())),t.hashtags=o.hashtags?o.hashtags.slice():e.DefaultOptions.hashtags,t.layout=l.a.getById(o.layout).id,t.numColumns=r.a.normalize(o.numColumns,e.DefaultOptions.numColumns),t.highlightFreq=r.a.normalize(o.highlightFreq,e.DefaultOptions.highlightFreq),t.mediaType=o.mediaType||e.DefaultOptions.mediaType,t.postOrder=o.postOrder||e.DefaultOptions.postOrder,t.numPosts=r.a.normalize(o.numPosts,e.DefaultOptions.numPosts),t.linkBehavior=r.a.normalize(o.linkBehavior,e.DefaultOptions.linkBehavior),t.feedWidth=r.a.normalize(o.feedWidth,e.DefaultOptions.feedWidth),t.feedHeight=r.a.normalize(o.feedHeight,e.DefaultOptions.feedHeight),t.feedPadding=r.a.normalize(o.feedPadding,e.DefaultOptions.feedPadding),t.imgPadding=r.a.normalize(o.imgPadding,e.DefaultOptions.imgPadding),t.textSize=r.a.normalize(o.textSize,e.DefaultOptions.textSize),t.bgColor=o.bgColor||e.DefaultOptions.bgColor,t.hoverInfo=o.hoverInfo?o.hoverInfo.slice():e.DefaultOptions.hoverInfo,t.textColorHover=o.textColorHover||e.DefaultOptions.textColorHover,t.bgColorHover=o.bgColorHover||e.DefaultOptions.bgColorHover,t.showHeader=r.a.normalize(o.showHeader,e.DefaultOptions.showHeader),t.headerInfo=r.a.normalize(o.headerInfo,e.DefaultOptions.headerInfo),t.headerAccount=null!==(n=o.headerAccount)&&void 0!==n?n:e.DefaultOptions.headerAccount,t.headerAccount=null===t.headerAccount||void 0===c.b.getById(t.headerAccount)?c.b.list.length>0?c.b.list[0].id:null:t.headerAccount,t.headerStyle=r.a.normalize(o.headerStyle,e.DefaultOptions.headerStyle),t.headerTextSize=r.a.normalize(o.headerTextSize,e.DefaultOptions.headerTextSize),t.headerPhotoSize=r.a.normalize(o.headerPhotoSize,e.DefaultOptions.headerPhotoSize),t.headerTextColor=o.headerTextColor||e.DefaultOptions.headerTextColor,t.headerBgColor=o.headerBgColor||e.DefaultOptions.bgColor,t.headerPadding=r.a.normalize(o.headerPadding,e.DefaultOptions.headerPadding),t.customProfilePic=null!==(a=o.customProfilePic)&&void 0!==a?a:e.DefaultOptions.customProfilePic,t.customBioText=o.customBioText||e.DefaultOptions.customBioText,t.includeStories=null!==(i=o.includeStories)&&void 0!==i?i:e.DefaultOptions.includeStories,t.storiesInterval=o.storiesInterval||e.DefaultOptions.storiesInterval,t.showCaptions=r.a.normalize(o.showCaptions,e.DefaultOptions.showCaptions),t.captionMaxLength=r.a.normalize(o.captionMaxLength,e.DefaultOptions.captionMaxLength),t.captionRemoveDots=null!==(s=o.captionRemoveDots)&&void 0!==s?s:e.DefaultOptions.captionRemoveDots,t.captionSize=r.a.normalize(o.captionSize,e.DefaultOptions.captionSize),t.captionColor=o.captionColor||e.DefaultOptions.captionColor,t.showLikes=r.a.normalize(o.showLikes,e.DefaultOptions.showLikes),t.showComments=r.a.normalize(o.showComments,e.DefaultOptions.showCaptions),t.lcIconSize=r.a.normalize(o.lcIconSize,e.DefaultOptions.lcIconSize),t.likesIconColor=null!==(d=o.likesIconColor)&&void 0!==d?d:e.DefaultOptions.likesIconColor,t.commentsIconColor=o.commentsIconColor||e.DefaultOptions.commentsIconColor,t.lightboxShowSidebar=null!==(u=o.lightboxShowSidebar)&&void 0!==u?u:e.DefaultOptions.lightboxShowSidebar,t.numLightboxComments=o.numLightboxComments||e.DefaultOptions.numLightboxComments,t.showLoadMoreBtn=r.a.normalize(o.showLoadMoreBtn,e.DefaultOptions.showLoadMoreBtn),t.loadMoreBtnTextColor=o.loadMoreBtnTextColor||e.DefaultOptions.loadMoreBtnTextColor,t.loadMoreBtnBgColor=o.loadMoreBtnBgColor||e.DefaultOptions.loadMoreBtnBgColor,t.loadMoreBtnText=o.loadMoreBtnText||e.DefaultOptions.loadMoreBtnText,t.autoload=null!==(m=o.autoload)&&void 0!==m?m:e.DefaultOptions.autoload,t.showFollowBtn=r.a.normalize(o.showFollowBtn,e.DefaultOptions.showFollowBtn),t.followBtnText=null!==(h=o.followBtnText)&&void 0!==h?h:e.DefaultOptions.followBtnText,t.followBtnTextColor=o.followBtnTextColor||e.DefaultOptions.followBtnTextColor,t.followBtnBgColor=o.followBtnBgColor||e.DefaultOptions.followBtnBgColor,t.followBtnLocation=r.a.normalize(o.followBtnLocation,e.DefaultOptions.followBtnLocation),t.hashtagWhitelist=o.hashtagWhitelist||e.DefaultOptions.hashtagWhitelist,t.hashtagBlacklist=o.hashtagBlacklist||e.DefaultOptions.hashtagBlacklist,t.captionWhitelist=o.captionWhitelist||e.DefaultOptions.captionWhitelist,t.captionBlacklist=o.captionBlacklist||e.DefaultOptions.captionBlacklist,t.hashtagWhitelistSettings=null!==(p=o.hashtagWhitelistSettings)&&void 0!==p?p:e.DefaultOptions.hashtagWhitelistSettings,t.hashtagBlacklistSettings=null!==(f=o.hashtagBlacklistSettings)&&void 0!==f?f:e.DefaultOptions.hashtagBlacklistSettings,t.captionWhitelistSettings=null!==(_=o.captionWhitelistSettings)&&void 0!==_?_:e.DefaultOptions.captionWhitelistSettings,t.captionBlacklistSettings=null!==(b=o.captionBlacklistSettings)&&void 0!==b?b:e.DefaultOptions.captionBlacklistSettings,t.moderation=o.moderation||e.DefaultOptions.moderation,t.moderationMode=o.moderationMode||e.DefaultOptions.moderationMode,t.promotionEnabled=null!==(y=o.promotionEnabled)&&void 0!==y?y:e.DefaultOptions.promotionEnabled,t.autoPromotionsEnabled=null!==(v=o.autoPromotionsEnabled)&&void 0!==v?v:e.DefaultOptions.autoPromotionsEnabled,t.globalPromotionsEnabled=null!==(M=o.globalPromotionsEnabled)&&void 0!==M?M:e.DefaultOptions.globalPromotionsEnabled,Array.isArray(o.promotions)?t.promotions=g.a.fromArray(o.promotions):o.promotions&&o.promotions instanceof Map?t.promotions=g.a.fromMap(o.promotions):"object"==typeof o.promotions?t.promotions=o.promotions:t.promotions=e.DefaultOptions.promotions,t}static getAllAccounts(e){const t=c.b.idsToAccounts(e.accounts),o=c.b.idsToAccounts(e.tagged);return{all:t.concat(o),accounts:t,tagged:o}}static getSources(e){return{accounts:c.b.idsToAccounts(e.accounts),tagged:c.b.idsToAccounts(e.tagged),hashtags:c.b.getBusinessAccounts().length>0?e.hashtags.filter(e=>e.tag.length>0):[]}}static hasSources(t){const o=e.Options.getSources(t),n=o.accounts.length>0||o.tagged.length>0,a=o.hashtags.length>0;return n||a}static isLimitingPosts(e){return e.moderation.length>0||e.hashtagBlacklist.length>0||e.hashtagWhitelist.length>0||e.captionBlacklist.length>0||e.captionWhitelist.length>0}}_([i.n],M.prototype,"accounts",void 0),_([i.n],M.prototype,"hashtags",void 0),_([i.n],M.prototype,"tagged",void 0),_([i.n],M.prototype,"layout",void 0),_([i.n],M.prototype,"numColumns",void 0),_([i.n],M.prototype,"highlightFreq",void 0),_([i.n],M.prototype,"mediaType",void 0),_([i.n],M.prototype,"postOrder",void 0),_([i.n],M.prototype,"numPosts",void 0),_([i.n],M.prototype,"linkBehavior",void 0),_([i.n],M.prototype,"feedWidth",void 0),_([i.n],M.prototype,"feedHeight",void 0),_([i.n],M.prototype,"feedPadding",void 0),_([i.n],M.prototype,"imgPadding",void 0),_([i.n],M.prototype,"textSize",void 0),_([i.n],M.prototype,"bgColor",void 0),_([i.n],M.prototype,"textColorHover",void 0),_([i.n],M.prototype,"bgColorHover",void 0),_([i.n],M.prototype,"hoverInfo",void 0),_([i.n],M.prototype,"showHeader",void 0),_([i.n],M.prototype,"headerInfo",void 0),_([i.n],M.prototype,"headerAccount",void 0),_([i.n],M.prototype,"headerStyle",void 0),_([i.n],M.prototype,"headerTextSize",void 0),_([i.n],M.prototype,"headerPhotoSize",void 0),_([i.n],M.prototype,"headerTextColor",void 0),_([i.n],M.prototype,"headerBgColor",void 0),_([i.n],M.prototype,"headerPadding",void 0),_([i.n],M.prototype,"customBioText",void 0),_([i.n],M.prototype,"customProfilePic",void 0),_([i.n],M.prototype,"includeStories",void 0),_([i.n],M.prototype,"storiesInterval",void 0),_([i.n],M.prototype,"showCaptions",void 0),_([i.n],M.prototype,"captionMaxLength",void 0),_([i.n],M.prototype,"captionRemoveDots",void 0),_([i.n],M.prototype,"captionSize",void 0),_([i.n],M.prototype,"captionColor",void 0),_([i.n],M.prototype,"showLikes",void 0),_([i.n],M.prototype,"showComments",void 0),_([i.n],M.prototype,"lcIconSize",void 0),_([i.n],M.prototype,"likesIconColor",void 0),_([i.n],M.prototype,"commentsIconColor",void 0),_([i.n],M.prototype,"lightboxShowSidebar",void 0),_([i.n],M.prototype,"numLightboxComments",void 0),_([i.n],M.prototype,"showLoadMoreBtn",void 0),_([i.n],M.prototype,"loadMoreBtnText",void 0),_([i.n],M.prototype,"loadMoreBtnTextColor",void 0),_([i.n],M.prototype,"loadMoreBtnBgColor",void 0),_([i.n],M.prototype,"autoload",void 0),_([i.n],M.prototype,"showFollowBtn",void 0),_([i.n],M.prototype,"followBtnText",void 0),_([i.n],M.prototype,"followBtnTextColor",void 0),_([i.n],M.prototype,"followBtnBgColor",void 0),_([i.n],M.prototype,"followBtnLocation",void 0),_([i.n],M.prototype,"hashtagWhitelist",void 0),_([i.n],M.prototype,"hashtagBlacklist",void 0),_([i.n],M.prototype,"captionWhitelist",void 0),_([i.n],M.prototype,"captionBlacklist",void 0),_([i.n],M.prototype,"hashtagWhitelistSettings",void 0),_([i.n],M.prototype,"hashtagBlacklistSettings",void 0),_([i.n],M.prototype,"captionWhitelistSettings",void 0),_([i.n],M.prototype,"captionBlacklistSettings",void 0),_([i.n],M.prototype,"moderation",void 0),_([i.n],M.prototype,"moderationMode",void 0),e.Options=M;class x{constructor(e){Object.getOwnPropertyNames(e).map(t=>{this[t]=e[t]})}getCaption(e){const t=e.caption?e.caption:"";return this.captionMaxLength&&t.length?Object(d.q)(Object(d.t)(t,this.captionMaxLength)):t}static compute(t,o=r.a.Mode.DESKTOP){const n=new x({accounts:c.b.filterExisting(t.accounts),tagged:c.b.filterExisting(t.tagged),hashtags:t.hashtags.filter(e=>e.tag.length>0),layout:l.a.getById(t.layout),highlightFreq:r.a.get(t.highlightFreq,o,!0),linkBehavior:r.a.get(t.linkBehavior,o,!0),bgColor:Object(u.a)(t.bgColor),textColorHover:Object(u.a)(t.textColorHover),bgColorHover:Object(u.a)(t.bgColorHover),hoverInfo:t.hoverInfo,showHeader:r.a.get(t.showHeader,o,!0),headerInfo:r.a.get(t.headerInfo,o,!0),headerStyle:r.a.get(t.headerStyle,o,!0),headerTextColor:Object(u.a)(t.headerTextColor),headerBgColor:Object(u.a)(t.headerBgColor),headerPadding:r.a.get(t.headerPadding,o,!0),includeStories:t.includeStories,storiesInterval:t.storiesInterval,showCaptions:r.a.get(t.showCaptions,o,!0),captionMaxLength:r.a.get(t.captionMaxLength,o,!0),captionRemoveDots:t.captionRemoveDots,captionColor:Object(u.a)(t.captionColor),showLikes:r.a.get(t.showLikes,o,!0),showComments:r.a.get(t.showComments,o,!0),likesIconColor:Object(u.a)(t.likesIconColor),commentsIconColor:Object(u.a)(t.commentsIconColor),lightboxShowSidebar:t.lightboxShowSidebar,numLightboxComments:t.numLightboxComments,showLoadMoreBtn:r.a.get(t.showLoadMoreBtn,o,!0),loadMoreBtnTextColor:Object(u.a)(t.loadMoreBtnTextColor),loadMoreBtnBgColor:Object(u.a)(t.loadMoreBtnBgColor),loadMoreBtnText:t.loadMoreBtnText,showFollowBtn:r.a.get(t.showFollowBtn,o,!0),autoload:t.autoload,followBtnLocation:r.a.get(t.followBtnLocation,o,!0),followBtnTextColor:Object(u.a)(t.followBtnTextColor),followBtnBgColor:Object(u.a)(t.followBtnBgColor),followBtnText:t.followBtnText,account:null,showBio:!1,bioText:null,profilePhotoUrl:c.b.DEFAULT_PROFILE_PIC,feedWidth:"",feedHeight:"",feedPadding:"",imgPadding:"",textSize:"",headerTextSize:"",headerPhotoSize:"",captionSize:"",lcIconSize:"",showLcIcons:!1});if(n.numColumns=this.getNumCols(t,o),n.numPosts=this.getNumPosts(t,o),n.allAccounts=n.accounts.concat(n.tagged.filter(e=>!n.accounts.includes(e))),n.allAccounts.length>0&&(n.account=t.headerAccount&&n.allAccounts.includes(t.headerAccount)?c.b.getById(t.headerAccount):c.b.getById(n.allAccounts[0])),n.showHeader=n.showHeader&&null!==n.account,n.showHeader&&(n.profilePhotoUrl=t.customProfilePic.length?t.customProfilePic:c.b.getProfilePicUrl(n.account)),n.showFollowBtn=n.showFollowBtn&&null!==n.account,n.showBio=n.headerInfo.some(t=>t===e.HeaderInfo.BIO),n.showBio){const e=t.customBioText.trim().length>0?t.customBioText:null!==n.account?c.b.getBioText(n.account):"";n.bioText=Object(d.q)(e),n.showBio=n.bioText.length>0}return n.feedWidth=this.normalizeCssSize(t.feedWidth,o,"auto"),n.feedHeight=this.normalizeCssSize(t.feedHeight,o,"auto"),n.feedPadding=this.normalizeCssSize(t.feedPadding,o,"0"),n.imgPadding=this.normalizeCssSize(t.imgPadding,o,"0"),n.textSize=this.normalizeCssSize(t.textSize,o,"inherit",!0),n.headerTextSize=this.normalizeCssSize(t.headerTextSize,o,"inherit"),n.headerPhotoSize=this.normalizeCssSize(t.headerPhotoSize,o,"50px"),n.captionSize=this.normalizeCssSize(t.captionSize,o,"inherit"),n.lcIconSize=this.normalizeCssSize(t.lcIconSize,o,"inherit"),n.buttonPadding=Math.max(10,r.a.get(t.imgPadding,o))+"px",n.showLcIcons=n.showLikes||n.showComments,n}static getNumCols(e,t){return Math.max(1,this.normalizeMultiInt(e.numColumns,t,1))}static getNumPosts(e,t){return Math.max(1,this.normalizeMultiInt(e.numPosts,t,1))}static normalizeMultiInt(e,t,o=0){const n=parseInt(r.a.get(e,t)+"");return isNaN(n)?t===r.a.Mode.DESKTOP?o:this.normalizeMultiInt(e,r.a.Mode.DESKTOP,o):n}static normalizeCssSize(e,t,o=null,n=!1){const a=r.a.get(e,t,n);return a?a+"px":o}}function L(e,t){if(f.a.isPro)return Object(d.m)(p.a.isValid,[()=>E(e,t),()=>t.globalPromotionsEnabled&&p.a.getGlobalPromo(e),()=>t.autoPromotionsEnabled&&p.a.getAutoPromo(e)])}function E(e,t){return e?p.a.getPromoFromDictionary(e,t.promotions):void 0}e.ComputedOptions=x,e.HashtagSorting=Object(s.b)({recent:"Most recent",popular:"Most popular"}),function(e){e.ALL="all",e.PHOTOS="photos",e.VIDEOS="videos"}(o=e.MediaType||(e.MediaType={})),function(e){e.NOTHING="nothing",e.SELF="self",e.NEW_TAB="new_tab",e.LIGHTBOX="lightbox"}(n=e.LinkBehavior||(e.LinkBehavior={})),function(e){e.DATE_ASC="date_asc",e.DATE_DESC="date_desc",e.POPULARITY_ASC="popularity_asc",e.POPULARITY_DESC="popularity_desc",e.RANDOM="random"}(a=e.PostOrder||(e.PostOrder={})),function(e){e.USERNAME="username",e.DATE="date",e.CAPTION="caption",e.LIKES_COMMENTS="likes_comments",e.INSTA_LINK="insta_link"}(m=e.HoverInfo||(e.HoverInfo={})),function(e){e.NORMAL="normal",e.BOXED="boxed",e.CENTERED="centered"}(h=e.HeaderStyle||(e.HeaderStyle={})),function(e){e.BIO="bio",e.PROFILE_PIC="profile_pic",e.FOLLOWERS="followers",e.MEDIA_COUNT="media_count"}(b=e.HeaderInfo||(e.HeaderInfo={})),function(e){e.HEADER="header",e.BOTTOM="bottom",e.BOTH="both"}(y=e.FollowBtnLocation||(e.FollowBtnLocation={})),function(e){e.WHITELIST="whitelist",e.BLACKLIST="blacklist"}(v=e.ModerationMode||(e.ModerationMode={})),e.DefaultOptions={accounts:[],hashtags:[],tagged:[],layout:null,numColumns:{desktop:3},highlightFreq:{desktop:7},mediaType:o.ALL,postOrder:a.DATE_DESC,numPosts:{desktop:9},linkBehavior:{desktop:n.LIGHTBOX,phone:n.NEW_TAB},feedWidth:{desktop:""},feedHeight:{desktop:""},feedPadding:{desktop:20,tablet:14,phone:10},imgPadding:{desktop:14,tablet:10,phone:6},textSize:{all:""},bgColor:{r:255,g:255,b:255,a:1},hoverInfo:[m.LIKES_COMMENTS,m.INSTA_LINK],textColorHover:{r:255,g:255,b:255,a:1},bgColorHover:{r:0,g:0,b:0,a:.5},showHeader:{desktop:!0},headerInfo:{desktop:[b.PROFILE_PIC,b.BIO]},headerAccount:null,headerStyle:{desktop:h.NORMAL,phone:h.CENTERED},headerTextSize:{desktop:""},headerPhotoSize:{desktop:50},headerTextColor:{r:0,g:0,b:0,a:1},headerBgColor:{r:255,g:255,b:255,a:1},headerPadding:{desktop:0},customProfilePic:0,customBioText:"",includeStories:!1,storiesInterval:5,showCaptions:{desktop:!1},captionMaxLength:{desktop:0},captionRemoveDots:!1,captionSize:{desktop:0},captionColor:{r:0,g:0,b:0,a:1},showLikes:{desktop:!1},showComments:{desktop:!1},lcIconSize:{desktop:14},likesIconColor:{r:0,g:0,b:0,a:1},commentsIconColor:{r:0,g:0,b:0,a:1},lightboxShowSidebar:!1,numLightboxComments:50,showLoadMoreBtn:{desktop:!0},loadMoreBtnTextColor:{r:255,g:255,b:255,a:1},loadMoreBtnBgColor:{r:0,g:149,b:246,a:1},loadMoreBtnText:"Load more",autoload:!1,showFollowBtn:{desktop:!0},followBtnText:"Follow on Instagram",followBtnTextColor:{r:255,g:255,b:255,a:1},followBtnBgColor:{r:0,g:149,b:246,a:1},followBtnLocation:{desktop:y.HEADER,phone:y.BOTTOM},hashtagWhitelist:[],hashtagBlacklist:[],captionWhitelist:[],captionBlacklist:[],hashtagWhitelistSettings:!0,hashtagBlacklistSettings:!0,captionWhitelistSettings:!0,captionBlacklistSettings:!0,moderation:[],moderationMode:v.BLACKLIST,promotionEnabled:!0,autoPromotionsEnabled:!0,globalPromotionsEnabled:!0,promotions:{}},e.getPromo=L,e.getFeedPromo=E,e.executeMediaClick=function(e,t){const o=L(e,t),n=p.a.getConfig(o),a=p.a.getType(o);return!(!a||!a.isValid(n)||"function"!=typeof a.onMediaClick)&&a.onMediaClick(e,n)},e.getLink=function(e,t){var o,n;const a=L(e,t),i=p.a.getConfig(a),r=p.a.getType(a);if(void 0===r||!r.isValid(i))return{text:null,url:null,newTab:!1};let[l,s]=r.getPopupLink?null!==(o=r.getPopupLink(e,i))&&void 0!==o?o:null:[null,!1];return{text:l,url:r.getMediaUrl&&null!==(n=r.getMediaUrl(e,i))&&void 0!==n?n:null,newTab:s}}}(b||(b={}))},71:function(e,t,o){e.exports={root:"MediaLightboxAlbum__root",strip:"MediaLightboxAlbum__strip layout__flex-row",frame:"MediaLightboxAlbum__frame",controls:"MediaLightboxAlbum__controls layout__fill-parent layout__flex-row","nav-button":"MediaLightboxAlbum__nav-button",navButton:"MediaLightboxAlbum__nav-button","next-button":"MediaLightboxAlbum__next-button MediaLightboxAlbum__nav-button",nextButton:"MediaLightboxAlbum__next-button MediaLightboxAlbum__nav-button","prev-button":"MediaLightboxAlbum__prev-button MediaLightboxAlbum__nav-button",prevButton:"MediaLightboxAlbum__prev-button MediaLightboxAlbum__nav-button","indicator-list":"MediaLightboxAlbum__indicator-list layout__flex-row",indicatorList:"MediaLightboxAlbum__indicator-list layout__flex-row",indicator:"MediaLightboxAlbum__indicator","indicator-current":"MediaLightboxAlbum__indicator-current MediaLightboxAlbum__indicator",indicatorCurrent:"MediaLightboxAlbum__indicator-current MediaLightboxAlbum__indicator"}},73:function(e,t,o){"use strict";o.d(t,"a",(function(){return h}));var n=o(0),a=o.n(n),i=o(37),r=o.n(i),l=o(100),s=o(15),c=o(3),d=o(59),u=o(11),m=o(14);function h(e){var{media:t,className:o,size:i,onLoadImage:h,width:p,height:g}=e,f=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]])}return o}(e,["media","className","size","onLoadImage","width","height"]);const _=a.a.useRef(),b=a.a.useRef(),[y,v]=a.a.useState(!function(e){return!!s.a.Source.isOwnMedia(e.source)&&("string"==typeof e.thumbnail&&e.thumbnail.length>0||!m.a.isEmpty(e.thumbnails))}(t)),[M,x]=a.a.useState(!0);function L(){if(_.current){const e=null!=i?i:function(){const e=_.current.getBoundingClientRect();return e.width<=320?c.a.SMALL:(e.width,c.a.MEDIUM)}(),o="object"==typeof t.thumbnails&&m.a.has(t.thumbnails,e)?m.a.get(t.thumbnails,e):t.thumbnail;_.current.src!==o&&(_.current.src=o)}}function E(){S()}function w(){t.type===s.a.Type.VIDEO?v(!0):_.current.src!==t.thumbnail&&(_.current.src=t.thumbnail),S()}function O(){isNaN(b.current.duration)||b.current.duration===1/0?b.current.currentTime=1:b.current.currentTime=b.current.duration/2,S()}function S(){x(!1),h&&h()}return Object(n.useLayoutEffect)(()=>{let e=new l.a(L);return _.current&&(_.current.onload=E,_.current.onerror=w,L(),e.observe(_.current)),b.current&&(b.current.onloadeddata=O),()=>{_.current&&(_.current.onload=()=>null,_.current.onerror=()=>null),b.current&&(b.current.onloadeddata=()=>null),e.disconnect()}},[t,i]),t.url&&t.url.length>0?a.a.createElement("div",Object.assign({className:Object(u.b)(r.a.root,o)},f),"VIDEO"===t.type&&y?a.a.createElement("video",{ref:b,className:r.a.video,src:t.url,autoPlay:!1,controls:!1,tabIndex:0},a.a.createElement("source",{src:t.url}),"Your browser does not support videos"):a.a.createElement("img",Object.assign({ref:_,className:r.a.image,loading:"lazy",width:p,height:g},u.e)),M&&a.a.createElement(d.a,null)):a.a.createElement("div",{className:r.a.notAvailable},a.a.createElement("span",null,"Thumbnail not available"))}},74:function(e,t,o){e.exports={root:"MediaLoading__root",animation:"MediaLoading__animation"}},79:function(e,t,o){e.exports={root:"IgVideoPlayer__root",thumbnail:"IgVideoPlayer__thumbnail","thumbnail-hidden":"IgVideoPlayer__thumbnail-hidden IgVideoPlayer__thumbnail",thumbnailHidden:"IgVideoPlayer__thumbnail-hidden IgVideoPlayer__thumbnail",video:"IgVideoPlayer__video","video-hidden":"IgVideoPlayer__video-hidden IgVideoPlayer__video",videoHidden:"IgVideoPlayer__video-hidden IgVideoPlayer__video",control:"IgVideoPlayer__control","control-playing":"IgVideoPlayer__control-playing IgVideoPlayer__control",controlPlaying:"IgVideoPlayer__control-playing IgVideoPlayer__control","control-paused":"IgVideoPlayer__control-paused IgVideoPlayer__control",controlPaused:"IgVideoPlayer__control-paused IgVideoPlayer__control","play-button":"IgVideoPlayer__play-button",playButton:"IgVideoPlayer__play-button"}},8:function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));var n,a=o(12),i=o(14),r=o(3);!function(e){function t(e){return e?c(e.type):void 0}function o(e){var o;if("object"!=typeof e)return!1;const n=t(e);return void 0!==n&&n.isValid(null!==(o=e.config)&&void 0!==o?o:{})}function n(t){return t?e.getPromoFromDictionary(t,a.a.config.globalPromotions):void 0}function l(e){const t=s(e);return void 0===t?void 0:t.promotion}function s(t){if(t)for(const o of a.a.config.autoPromotions){const n=e.Automation.getType(o),a=e.Automation.getConfig(o);if(n&&n.matches(t,a))return o}}function c(t){return e.types.find(e=>e.id===t)}let d;e.getConfig=function(e){var t,o;return e&&null!==(o=null!==(t=e.config)&&void 0!==t?t:e.data)&&void 0!==o?o:{}},e.getType=t,e.isValid=o,e.getPromoFromDictionary=function(t,o){const n=i.a.get(o,t.id);if(n)return e.getType(n)?n:void 0},e.getPromo=function(e){return Object(r.m)(o,[()=>n(e),()=>l(e)])},e.getGlobalPromo=n,e.getAutoPromo=l,e.getAutomation=s,e.types=[],e.getTypes=function(){return e.types},e.registerType=function(t){e.types.push(t)},e.getTypeById=c,e.clearTypes=function(){e.types.splice(0,e.types.length)},function(e){e.getType=function(e){return e?o(e.type):void 0},e.getConfig=function(e){var t,o;return e&&null!==(o=null!==(t=e.config)&&void 0!==t?t:e.data)&&void 0!==o?o:{}},e.getPromotion=function(e){return e?e.promotion:void 0};const t=[];function o(e){return t.find(t=>t.id===e)}e.getTypes=function(){return t},e.registerType=function(e){t.push(e)},e.getTypeById=o,e.clearTypes=function(){t.splice(0,t.length)}}(d=e.Automation||(e.Automation={}))}(n||(n={}))},89:function(e,t,o){e.exports={root:"MediaComment__root",row:"MediaComment__row",username:"MediaComment__username",content:"MediaComment__content MediaComment__row",text:"MediaComment__text","meta-list":"MediaComment__meta-list MediaComment__row",metaList:"MediaComment__meta-list MediaComment__row",meta:"MediaComment__meta",date:"MediaComment__date MediaComment__meta","like-count":"MediaComment__like-count MediaComment__meta",likeCount:"MediaComment__like-count MediaComment__meta"}}},[[396,0,1]]])}));
ui/dist/editor-pro.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],e):"object"==typeof exports?exports.spotlight=e(require("React"),require("ReactDOM")):t.spotlight=e(t.React,t.ReactDOM)}(window,(function(t,e){return(window.webpackJsonpspotlight=window.webpackJsonpspotlight||[]).push([[8],{0:function(e,o){e.exports=t},10:function(t,e,o){"use strict";o.d(e,"a",(function(){return s}));var n=o(0),i=o.n(n),a=o(11);const s=t=>{var{icon:e,className:o}=t,n=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(o[n[i]]=t[n[i]])}return o}(t,["icon","className"]);return i.a.createElement("span",Object.assign({className:Object(a.b)("dashicons","dashicons-"+e,o)},n))}},11:function(t,e,o){"use strict";function n(...t){return t.filter(t=>!!t).join(" ")}function i(t){return n(...Object.getOwnPropertyNames(t).map(e=>t[e]?e:null))}function a(t,e={}){let o=Object.getOwnPropertyNames(e).map(o=>e[o]?t+o:null);return t+" "+o.filter(t=>!!t).join(" ")}o.d(e,"b",(function(){return n})),o.d(e,"c",(function(){return i})),o.d(e,"a",(function(){return a})),o.d(e,"e",(function(){return s})),o.d(e,"d",(function(){return r}));const s={onMouseDown:t=>t.preventDefault()};function r(...t){return e=>{t.forEach(t=>t&&function(t,e){"function"==typeof t?t(e):t.current=e}(t,e))}}},112:function(t,e,o){"use strict";o.d(e,"a",(function(){return y}));var n=o(0),i=o.n(n),a=o(60),s=o.n(a),r=o(16),l=o(52),c=o.n(l),u=o(38),d=o.n(u),h=o(6),p=o(3),m=o(116),g=Object(h.b)((function({field:t}){const e="settings-field-"+Object(p.u)(),o=!t.label||t.fullWidth;return i.a.createElement("div",{className:d.a.root},t.label&&i.a.createElement("div",{className:d.a.label},i.a.createElement("label",{htmlFor:e},t.label)),i.a.createElement("div",{className:d.a.container},i.a.createElement("div",{className:o?d.a.controlFullWidth:d.a.controlPartialWidth},i.a.createElement(t.component,{id:e})),t.tooltip&&i.a.createElement("div",{className:d.a.tooltip},i.a.createElement(m.a,null,t.tooltip))))}));function f({group:t}){return i.a.createElement("div",{className:c.a.root},t.title&&t.title.length>0&&i.a.createElement("h1",{className:c.a.title},t.title),t.component&&i.a.createElement("div",{className:c.a.content},i.a.createElement(t.component)),t.fields&&i.a.createElement("div",{className:c.a.fieldList},t.fields.map(t=>i.a.createElement(g,{field:t,key:t.id}))))}var b=o(20);function y({page:t}){return Object(b.d)("keydown",t=>{t.key&&"s"===t.key.toLowerCase()&&t.ctrlKey&&(r.b.save(),t.preventDefault(),t.stopPropagation())}),i.a.createElement("article",{className:s.a.root},t.component&&i.a.createElement("div",{className:s.a.content},i.a.createElement(t.component)),t.groups&&i.a.createElement("div",{className:s.a.groupList},t.groups.map(t=>i.a.createElement(f,{key:t.id,group:t}))))}},12:function(t,e,o){"use strict";var n,i=o(8);let a;e.a=a={isPro:!1,config:{restApi:SliCommonL10n.restApi,imagesUrl:SliCommonL10n.imagesUrl,autoPromotions:SliCommonL10n.autoPromotions,globalPromotions:null!==(n=SliCommonL10n.globalPromotions)&&void 0!==n?n:{}},image:t=>`${a.config.imagesUrl}/${t}`},i.a.registerType({id:"link",label:"Link",isValid:()=>!1}),i.a.registerType({id:"-more-",label:"- More promotion types -",isValid:()=>!1}),i.a.Automation.registerType({id:"hashtag",label:"Hashtag",matches:()=>!1})},13:function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));const n=t=>"string"==typeof t?t:"r"in t?"rgba("+t.r+","+t.g+","+t.b+","+t.a+")":"h"in t?"hsla("+t.h+","+t.s+","+t.l+","+t.a+")":"#fff"},138:function(t,e,o){"use strict";function n(t,e){return"url"===e.linkType?e.url:e.postUrl}var i;o.d(e,"a",(function(){return i})),e.b={id:"link",label:"Link",getIcon:()=>"admin-links",getPopupLink:function(t,e){return"string"==typeof e.linkText&&e.linkText.length>0?[e.linkText,e.newTab]:[i.getDefaultLinkText(e),e.newTab]},isValid:function(t){return"string"==typeof t.linkType&&t.linkType.length>0&&("url"===t.linkType&&"string"==typeof t.url&&t.url.length>0||!!t.postId&&"string"==typeof t.postUrl&&t.postUrl.length>0)},getMediaUrl:n,onMediaClick:function(t,e){var o;const i=n(0,e),a=null===(o=e.linkDirectly)||void 0===o||o;return!(!i||!a)&&(window.open(i,e.newTab?"_blank":"_self"),!0)}},function(t){t.getDefaultLinkText=function(t){switch(t.linkType){case"product":return"Buy it now";case"post":return"Read the article";case"page":return"Learn more";default:return"Visit link"}}}(i||(i={}))},148:function(t,e,o){"use strict";o.d(e,"a",(function(){return s}));var n=o(0),i=o.n(n),a=o(29);function s({breakpoints:t,children:e}){const[o,s]=i.a.useState(null),r=i.a.useCallback(()=>{const e=Object(a.b)();s(()=>t.reduce((t,o)=>e.width<=o&&o<t?o:t,1/0))},[t]);return Object(n.useEffect)(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[]),null!==o&&e(o)}},149:function(t,e,o){"use strict";var n=o(0),i=o.n(n),a=o(100),s=o(18),r=o.n(s),l=o(41),c=o(4),u=o(5),d=o(10),h=o(113),p=o(26),m=o(21),g=o(30),f=o(89),b=o(59),y=o(14),v=o(65);function O({accounts:t,showDelete:e,onDeleteError:o}){const n=(t=null!=t?t:[]).filter(t=>t.type===c.a.Type.BUSINESS).length,[a,s]=i.a.useState(!1),[O,w]=i.a.useState(null),[E,S]=i.a.useState(!1),[_,C]=i.a.useState(),[P,k]=i.a.useState(!1),B=t=>()=>{w(t),s(!0)},T=t=>()=>{g.a.openAuthWindow(t.type,0,()=>{y.a.restApi.deleteAccountMedia(t.id)})},A=t=>()=>{C(t),S(!0)},M=()=>{k(!1),C(null),S(!1)},I={cols:{username:r.a.usernameCol,type:r.a.typeCol,usages:r.a.usagesCol,actions:r.a.actionsCol},cells:{username:r.a.usernameCell,type:r.a.typeCell,usages:r.a.usagesCell,actions:r.a.actionsCell}};return i.a.createElement("div",{className:"accounts-list"},i.a.createElement(h.a,{styleMap:I,rows:t,cols:[{id:"username",label:"Username",render:t=>i.a.createElement("div",null,i.a.createElement(b.a,{account:t,className:r.a.profilePic}),i.a.createElement("a",{className:r.a.username,onClick:B(t)},t.username))},{id:"type",label:"Type",render:t=>i.a.createElement("span",{className:r.a.accountType},t.type)},{id:"usages",label:"Feeds",render:t=>i.a.createElement("span",{className:r.a.usages},t.usages.map((t,e)=>!!p.a.getById(t)&&i.a.createElement(l.a,{key:e,to:m.a.at({screen:"edit",id:t.toString()})},p.a.getById(t).name)))},{id:"actions",label:"Actions",render:t=>e&&i.a.createElement("div",{className:r.a.actionsList},i.a.createElement(u.a,{className:r.a.action,type:u.c.SECONDARY,tooltip:"Account info",onClick:B(t)},i.a.createElement(d.a,{icon:"info"})),i.a.createElement(u.a,{className:r.a.action,type:u.c.SECONDARY,tooltip:"Reconnect account",onClick:T(t)},i.a.createElement(d.a,{icon:"image-rotate"})),i.a.createElement(u.a,{className:r.a.actions,type:u.c.DANGER,tooltip:"Remove account",onClick:A(t)},i.a.createElement(d.a,{icon:"trash"})))}]}),i.a.createElement(f.a,{isOpen:a,onClose:()=>s(!1),account:O}),i.a.createElement(v.a,{isOpen:E,title:"Are you sure?",buttons:[P?"Please wait ...":"Yes I'm sure","Cancel"],okDisabled:P,cancelDisabled:P,onAccept:()=>{k(!0),g.a.deleteAccount(_.id).then(()=>M()).catch(()=>{o&&o("An error occurred while trying to remove the account."),M()})},onCancel:M},i.a.createElement("p",null,"Are you sure you want to delete"," ",i.a.createElement("span",{style:{fontWeight:"bold"}},_?_.username:""),"?"," ","This will also delete all saved media associated with this account."),_&&_.type===c.a.Type.BUSINESS&&1===n&&i.a.createElement("p",null,i.a.createElement("b",null,"Note:")," ",i.a.createElement("span",null,"Because this is your only connected Business account, deleting it will"," ","also cause any feeds that show public hashtag posts to no longer work."))))}var w=o(23),E=o(6),S=o(115),_=o(77),C=o.n(_);e.a=Object(E.b)((function(){const[,t]=i.a.useState(0),[e,o]=i.a.useState(""),n=i.a.useCallback(()=>t(t=>t++),[]);return c.b.hasAccounts()?i.a.createElement("div",{className:C.a.root},e.length>0&&i.a.createElement(w.a,{type:w.b.ERROR,showIcon:!0,isDismissible:!0,onDismiss:()=>o("")},e),i.a.createElement("div",{className:C.a.connectBtn},i.a.createElement(a.a,{onConnect:n})),i.a.createElement(O,{accounts:c.b.list,showDelete:!0,onDeleteError:o})):i.a.createElement(S.a,null)}))},15:function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));var n,i=o(3);!function(t){function e(t,e){return t.hasOwnProperty(e.toString())}function o(t,e){return t[e.toString()]}function n(t,e,o){return t[e.toString()]=o,t}t.has=e,t.get=o,t.set=n,t.ensure=function(o,i,a){return e(o,i)||n(o,i,a),t.get(o,i)},t.withEntry=function(e,o,n){return t.set(Object(i.h)(e),o,n)},t.remove=function(t,e){return delete t[e.toString()],t},t.without=function(e,o){return t.remove(Object(i.h)(e),o)},t.at=function(t,e){return o(t,Object.keys(t)[e])},t.keys=function(t){return Object.keys(t)},t.values=function(t){return Object.values(t)},t.entries=function(t){return Object.getOwnPropertyNames(t).map(e=>[e,t[e]])},t.map=function(e,o){const n={};return t.forEach(e,(t,e)=>n[t]=o(e,t)),n},t.size=function(e){return t.keys(e).length},t.isEmpty=function(e){return 0===t.size(e)},t.equals=function(t,e){return Object(i.p)(t,e)},t.forEach=function(e,o){t.keys(e).forEach(t=>o(t,e[t]))},t.fromArray=function(e){const o={};return e.forEach(([e,n])=>t.set(o,e,n)),o},t.fromMap=function(e){const o={};return e.forEach((e,n)=>t.set(o,n,e)),o}}(n||(n={}))},17:function(t,e,o){"use strict";var n;o.d(e,"a",(function(){return n})),function(t){let e,o;!function(t){t.IMAGE="IMAGE",t.VIDEO="VIDEO",t.ALBUM="CAROUSEL_ALBUM"}(e=t.Type||(t.Type={})),function(t){let e;!function(t){t.PERSONAL_ACCOUNT="PERSONAL_ACCOUNT",t.BUSINESS_ACCOUNT="BUSINESS_ACCOUNT",t.TAGGED_ACCOUNT="TAGGED_ACCOUNT",t.RECENT_HASHTAG="RECENT_HASHTAG",t.POPULAR_HASHTAG="POPULAR_HASHTAG",t.USER_STORY="USER_STORY"}(e=t.Type||(t.Type={}))}(o=t.Source||(t.Source={})),t.getAsRows=(t,e)=>{t=t.slice(),e=e>0?e:1;let o=[];for(;t.length;)o.push(t.splice(0,e));if(o.length>0){const t=o.length-1;for(;o[t].length<e;)o[t].push({})}return o},t.isFromHashtag=t=>t.source.type===o.Type.POPULAR_HASHTAG||t.source.type===o.Type.RECENT_HASHTAG}(n||(n={}))},18:function(t,e,o){t.exports={"username-col":"AccountsList__username-col",usernameCol:"AccountsList__username-col","actions-col":"AccountsList__actions-col",actionsCol:"AccountsList__actions-col","username-cell":"AccountsList__username-cell",usernameCell:"AccountsList__username-cell",username:"AccountsList__username","profile-pic":"AccountsList__profile-pic",profilePic:"AccountsList__profile-pic","account-type":"AccountsList__account-type",accountType:"AccountsList__account-type",usages:"AccountsList__usages","actions-list":"AccountsList__actions-list layout__flex-row",actionsList:"AccountsList__actions-list layout__flex-row",action:"AccountsList__action","usages-cell":"AccountsList__usages-cell",usagesCell:"AccountsList__usages-cell","usages-col":"AccountsList__usages-col",usagesCol:"AccountsList__usages-col","type-cell":"AccountsList__type-cell",typeCell:"AccountsList__type-cell","type-col":"AccountsList__type-col",typeCol:"AccountsList__type-col"}},19:function(t,e,o){"use strict";var n=o(33),i=o.n(n),a=o(12),s=o(34);const r=a.a.config.restApi.baseUrl,l={};a.a.config.restApi.authToken&&(l["X-Sli-Auth-Token"]=a.a.config.restApi.authToken);const c=i.a.create({baseURL:r,headers:l}),u={config:a.a.config.restApi,driver:c,getAccounts:()=>c.get("/accounts"),getFeeds:()=>c.get("/feeds"),getFeedMedia:(t,e=0,o=0,n)=>{const a=n?new i.a.CancelToken(n):void 0;return c.post("/media/fetch",{options:t,num:o,from:e},{cancelToken:a})},getMedia:(t=0,e=0)=>c.get(`/media?num=${t}&offset=${e}`),getErrorReason:t=>{let e;return"object"==typeof t.response&&(t=t.response.data),e="string"==typeof t.message?t.message:t.toString(),Object(s.b)(e)}};e.a=u},2:function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));var n,i=o(1),a=function(t,e,o,n){var i,a=arguments.length,s=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var r=t.length-1;r>=0;r--)(i=t[r])&&(s=(a<3?i(s):a>3?i(e,o,s):i(e,o))||s);return a>3&&s&&Object.defineProperty(e,o,s),s};!function(t){class e{constructor(t,e,o){this.prop=t,this.name=e,this.icon=o}}e.DESKTOP=new e("desktop","Desktop","desktop"),e.TABLET=new e("tablet","Tablet","tablet"),e.PHONE=new e("phone","Phone","smartphone"),t.Mode=e,t.MODES=[e.DESKTOP,e.TABLET,e.PHONE];class o{constructor(t,e,o){this.desktop=t,this.tablet=e,this.phone=o}get(t,e){return n(this,t,e)}set(t,e){s(this,e,t)}with(t,e){const n=r(this,e,t);return new o(n.desktop,n.tablet,n.phone)}}function n(t,e,o=!1){if(!t)return;const n=t[e.prop];return o&&null==n?t.desktop:n}function s(t,e,o){return t[o.prop]=e,t}function r(t,e,n){return s(new o(t.desktop,t.tablet,t.phone),e,n)}a([i.n],o.prototype,"desktop",void 0),a([i.n],o.prototype,"tablet",void 0),a([i.n],o.prototype,"phone",void 0),t.Value=o,t.getName=function(t){return t.name},t.getIcon=function(t){return t.icon},t.cycle=function(o){const n=t.MODES.findIndex(t=>t===o);return void 0===n?e.DESKTOP:t.MODES[(n+1)%t.MODES.length]},t.get=n,t.set=s,t.withValue=r,t.normalize=function(t,e){return null==t?e.hasOwnProperty("all")?new o(e.all,e.all,e.all):new o(e.desktop,e.tablet,e.phone):"object"==typeof t&&t.hasOwnProperty("desktop")?new o(t.desktop,t.tablet,t.phone):new o(t,t,t)},t.getModeForWindowSize=function(t){return t.width<=768?e.PHONE:t.width<=935?e.TABLET:e.DESKTOP},t.isValid=function(t){return"object"==typeof t&&t.hasOwnProperty("desktop")}}(n||(n={}))},20:function(t,e,o){"use strict";o.d(e,"i",(function(){return r})),o.d(e,"e",(function(){return l})),o.d(e,"b",(function(){return c})),o.d(e,"c",(function(){return u})),o.d(e,"a",(function(){return d})),o.d(e,"m",(function(){return h})),o.d(e,"g",(function(){return p})),o.d(e,"k",(function(){return m})),o.d(e,"j",(function(){return g})),o.d(e,"d",(function(){return b})),o.d(e,"l",(function(){return y})),o.d(e,"f",(function(){return v})),o.d(e,"h",(function(){return O}));var n=o(0),i=o.n(n),a=o(42),s=o(29);function r(t,e){!function(t,e,o){const n=i.a.useRef(!0);t(()=>{n.current=!0;const t=e(()=>new Promise(t=>{n.current&&t()}));return()=>{n.current=!1,t&&t()}},o)}(n.useEffect,t,e)}function l(t){const[e,o]=i.a.useState(t),n=i.a.useRef(e);return[e,()=>n.current,t=>o(n.current=t)]}function c(t,e,o=[]){function i(n){!t.current||t.current.contains(n.target)||o.some(t=>t&&t.current&&t.current.contains(n.target))||e(n)}Object(n.useEffect)(()=>(document.addEventListener("mousedown",i),document.addEventListener("touchend",i),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("touchend",i)}))}function u(t,e){Object(n.useEffect)(()=>{const o=()=>{0===t.filter(t=>!t.current||document.activeElement===t.current||t.current.contains(document.activeElement)).length&&e()};return document.addEventListener("keyup",o),()=>document.removeEventListener("keyup",o)},t)}function d(t,e,o=100){const[a,s]=i.a.useState(t);return Object(n.useEffect)(()=>{let n=null;return t===e?n=setTimeout(()=>s(e),o):s(!e),()=>{null!==n&&clearTimeout(n)}},[t]),[a,s]}function h(t){const[e,o]=i.a.useState(Object(s.b)()),a=()=>{const e=Object(s.b)();o(e),t&&t(e)};return Object(n.useEffect)(()=>(a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)),[]),e}function p(){return new URLSearchParams(Object(a.e)().search)}function m(t,e){const o=o=>{if(e)return(o||window.event).returnValue=t,t};Object(n.useEffect)(()=>(window.addEventListener("beforeunload",o),()=>window.removeEventListener("beforeunload",o)),[e])}function g(t,e){const o=i.a.useRef(!1);return Object(n.useEffect)(()=>{o.current&&void 0!==t.current&&(t.current.scrollIntoView(Object.assign({behavior:"smooth",block:"start"},null!=e?e:{})),o.current=!1)},[o.current]),()=>o.current=!0}function f(t,e,o,i=[],a=[]){Object(n.useEffect)(()=>(i.reduce((t,e)=>t&&e,!0)&&t.addEventListener(e,o),()=>t.removeEventListener(e,o)),a)}function b(t,e,o=[],n=[]){f(document,t,e,o,n)}function y(t,e,o=[],n=[]){f(window,t,e,o,n)}function v(t){return e=>{" "!==e.key&&"Enter"!==e.key||(t(),e.preventDefault(),e.stopPropagation())}}function O(t){const[e,o]=i.a.useState(t);return[function(t){const e=i.a.useRef(t);return e.current=t,e}(e),o]}o(34)},21:function(t,e,o){"use strict";o.d(e,"a",(function(){return l}));var n=o(1),i=o(50),a=o(3),s=function(t,e,o,n){var i,a=arguments.length,s=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var r=t.length-1;r>=0;r--)(i=t[r])&&(s=(a<3?i(s):a>3?i(e,o,s):i(e,o))||s);return a>3&&s&&Object.defineProperty(e,o,s),s};class r{constructor(){const t=window.location;this._pathName=t.pathname,this._baseUrl=t.protocol+"//"+t.host,this.parsed=Object(i.parse)(t.search),this.unListen=null,this.listeners=[],Object(n.o)(()=>this._path,t=>this.path=t)}createPath(t){return this._pathName+"?"+Object(i.stringify)(t)}get _path(){return this.createPath(this.parsed)}get(t,e=!0){return Object(a.l)(this.parsed[t])}at(t){return this.createPath(Object.assign({page:this.parsed.page},this.processQuery(t)))}fullUrl(t){return this._baseUrl+this.createPath(Object.assign({page:this.parsed.page},this.processQuery(t)))}with(t){return this.createPath(Object.assign(Object.assign({},this.parsed),this.processQuery(t)))}without(t){const e=Object.assign({},this.parsed);return delete e[t],this.createPath(e)}goto(t,e=!1){this.history.push(e?this.with(t):this.at(t),{})}useHistory(t){return this.unListen&&this.unListen(),this.history=t,this.unListen=this.history.listen(t=>{this.parsed=Object(i.parse)(t.search),this.listeners.forEach(t=>t())}),this}listen(t){this.listeners.push(t)}unlisten(t){this.listeners=this.listeners.filter(e=>e===t)}processQuery(t){const e=Object.assign({},t);return Object.getOwnPropertyNames(t).forEach(o=>{t[o]&&0===t[o].length?delete e[o]:e[o]=t[o]}),e}}s([n.n],r.prototype,"path",void 0),s([n.n],r.prototype,"parsed",void 0),s([n.h],r.prototype,"_path",null);const l=new r},27:function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));class n{static getById(t){const e=n.list.find(e=>e.id===t);return!e&&n.list.length>0?n.list[0]:e}static getName(t){const e=n.getById(t);return e?e.name:"(Missing layout)"}static addLayout(t){n.list.push(t)}}n.list=[]},29:function(t,e,o){"use strict";function n(t,e,o={}){return window.open(t,e,function(t={}){return Object.getOwnPropertyNames(t).map(e=>`${e}=${t[e]}`).join(",")}(o))}function i(t,e){return{top:window.top.outerHeight/2+window.top.screenY-e/2,left:window.top.outerWidth/2+window.top.screenX-t/2,width:t,height:e}}function a(){const{innerWidth:t,innerHeight:e}=window;return{width:t,height:e}}o.d(e,"c",(function(){return n})),o.d(e,"a",(function(){return i})),o.d(e,"b",(function(){return a}))},3:function(t,e,o){"use strict";o.d(e,"u",(function(){return u})),o.d(e,"h",(function(){return d})),o.d(e,"b",(function(){return h})),o.d(e,"v",(function(){return p})),o.d(e,"c",(function(){return m})),o.d(e,"e",(function(){return g})),o.d(e,"p",(function(){return f})),o.d(e,"o",(function(){return b})),o.d(e,"k",(function(){return y})),o.d(e,"f",(function(){return v})),o.d(e,"n",(function(){return O})),o.d(e,"q",(function(){return w})),o.d(e,"a",(function(){return E})),o.d(e,"t",(function(){return S})),o.d(e,"s",(function(){return _})),o.d(e,"r",(function(){return C})),o.d(e,"i",(function(){return P})),o.d(e,"j",(function(){return k})),o.d(e,"m",(function(){return B})),o.d(e,"g",(function(){return T})),o.d(e,"d",(function(){return A})),o.d(e,"l",(function(){return M}));var n=o(0),i=o.n(n),a=o(137),s=o(145),r=o(17),l=o(48);let c=0;function u(){return c++}function d(t){const e={};return Object.keys(t).forEach(o=>{const n=t[o];Array.isArray(n)?e[o]=n.slice():n instanceof Map?e[o]=new Map(n.entries()):e[o]="object"==typeof n?d(n):n}),e}function h(t,e){return Object.keys(e).forEach(o=>{t[o]=e[o]}),t}function p(t,e){return h(d(t),e)}function m(t,e){return Array.isArray(t)&&Array.isArray(e)?g(t,e):t instanceof Map&&e instanceof Map?g(Array.from(t.entries()),Array.from(e.entries())):"object"==typeof t&&"object"==typeof e?f(t,e):t===e}function g(t,e,o){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;++n)if(o){if(!o(t[n],e[n]))return!1}else if(!m(t[n],e[n]))return!1;return!0}function f(t,e){if(!t||!e||"object"!=typeof t||"object"!=typeof e)return m(t,e);const o=Object.keys(t),n=Object.keys(e);if(o.length!==n.length)return!1;const i=new Set(o.concat(n));for(const o of i)if(!m(t[o],e[o]))return!1;return!0}function b(t){return 0===Object.keys(null!=t?t:{}).length}function y(t,e,o){return o=null!=o?o:(t,e)=>t===e,t.filter(t=>!e.some(e=>o(t,e)))}function v(t,e,o){return o=null!=o?o:(t,e)=>t===e,t.every(t=>e.some(e=>o(t,e)))&&e.every(e=>t.some(t=>o(e,t)))}function O(t,e){return 0===t.tag.localeCompare(e.tag)&&t.sort===e.sort}function w(t,e,o=0,a=!1){let s=t.trim();a&&(s=s.replace(/((?:^[.*•]+(\r\n|\r|\n))+)/gm,"\n"));const r=s.split("\n"),l=r.map((t,o)=>{if(t=t.trim(),a&&/^[.*•]$/.test(t))return null;let s,l=[];for(;null!==(s=/#([^\s]+)/g.exec(t));){const e="https://instagram.com/explore/tags/"+s[1],o=i.a.createElement("a",{href:e,target:"_blank",key:u()},s[0]),n=t.substr(0,s.index),a=t.substr(s.index+s[0].length);l.push(n),l.push(o),t=a}return t.length&&l.push(t),e&&(l=e(l,o)),r.length>1&&l.push(i.a.createElement("br",{key:u()})),i.a.createElement(n.Fragment,{key:u()},l)});return o>0?l.slice(0,o):l}var E;function S(t,e){const o=/(\s+)/g;let n,i=0,a=0,s="";for(;null!==(n=o.exec(t))&&i<e;){const e=n.index+n[1].length;s+=t.substr(a,e-a),a=e,i++}return a<t.length&&(s+=" ..."),s}function _(t){return Object(a.a)(Object(s.a)(t),{addSuffix:!0})}function C(t,e){const o=[];return t.forEach((t,n)=>{const i=n%e;Array.isArray(o[i])?o[i].push(t):o[i]=[t]}),o}function P(t,e){return function t(e){if(e.type===r.a.Type.VIDEO){const t=document.createElement("video");return t.autoplay=!1,t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.visibility="hidden",document.body.appendChild(t),new Promise(o=>{t.src=e.url,t.addEventListener("loadeddata",()=>{o({width:t.videoWidth,height:t.videoHeight}),document.body.removeChild(t)})})}if(e.type===r.a.Type.IMAGE){const t=new Image;return t.src=e.url,new Promise(e=>{t.onload=()=>{e({width:t.naturalWidth,height:t.naturalHeight})}})}return e.type===r.a.Type.ALBUM?t(e.children[0]):Promise.reject("Unknown media type")}(t).then(t=>function(t,e){const o=t.width>t.height?e.width/t.width:e.height/t.height;return{width:t.width*o,height:t.height*o}}(t,e))}function k(t,e){const o=e.map(l.b).join("|");return new RegExp(`(?:^|\\B)#(${o})(?:\\b|\\r|$)`,"imu").test(t)}function B(t,e){for(const o of e){const e=o();if(t(e))return e}}function T(t,e){return Math.max(0,Math.min(e.length-1,t))}function A(t,e,o){const n=t.slice();return n[e]=o,n}function M(t){return Array.isArray(t)?t[0]:t}!function(t){t.SMALL="s",t.MEDIUM="m",t.LARGE="l"}(E||(E={}))},32:function(t,o){t.exports=e},34:function(t,e,o){"use strict";function n(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function i(t){const e=document.createElement("DIV");return e.innerHTML=t,e.textContent||e.innerText||""}o.d(e,"a",(function(){return n})),o.d(e,"b",(function(){return i}))},35:function(t,e,o){"use strict";o.d(e,"a",(function(){return c})),o.d(e,"b",(function(){return d}));var n=o(0),i=o.n(n),a=o(32),s=o.n(a),r=o(6);class l{constructor(t=new Map,e=[]){this.factories=t,this.extensions=new Map,this.cache=new Map,e.forEach(t=>this.addModule(t))}addModule(t){t.factories&&(this.factories=new Map([...this.factories,...t.factories])),t.extensions&&t.extensions.forEach((t,e)=>{this.extensions.has(e)?this.extensions.get(e).push(t):this.extensions.set(e,[t])})}get(t){let e=this.factories.get(t);if(void 0===e)throw new Error('Service "'+t+'" does not exist');let o=this.cache.get(t);if(void 0===o){o=e(this);let n=this.extensions.get(t);n&&n.forEach(t=>o=t(this,o)),this.cache.set(t,o)}return o}has(t){return this.factories.has(t)}}class c{constructor(t,e,o){this.key=t,this.mount=e,this.modules=o,this.container=null}addModules(t){this.modules=this.modules.concat(t)}run(){if(null!==this.container)return;let t=!1;const e=()=>{t||"interactive"!==document.readyState&&"complete"!==document.readyState||(this.actualRun(),t=!0)};e(),t||document.addEventListener("readystatechange",e)}actualRun(){!function(t){const e=`app/${t.key}/run`;document.dispatchEvent(new u(e,t))}(this);const t=d({root:()=>null,"root/children":()=>[]});this.container=new l(t,this.modules);const e=this.container.get("root/children").map((t,e)=>i.a.createElement(t,{key:e})),o=i.a.createElement(r.a,{c:this.container},e);this.modules.forEach(t=>t.run&&t.run(this.container)),s.a.render(o,this.mount)}}class u extends CustomEvent{constructor(t,e){super(t,{detail:{app:e}})}}function d(t){return new Map(Object.entries(t))}},37:function(t,e,o){t.exports={root:"MediaThumbnail__root","media-background-fade-in-animation":"MediaThumbnail__media-background-fade-in-animation",mediaBackgroundFadeInAnimation:"MediaThumbnail__media-background-fade-in-animation","media-object-fade-in-animation":"MediaThumbnail__media-object-fade-in-animation",mediaObjectFadeInAnimation:"MediaThumbnail__media-object-fade-in-animation",image:"MediaThumbnail__image","not-available":"MediaThumbnail__not-available",notAvailable:"MediaThumbnail__not-available"}},38:function(t,e,o){t.exports={root:"SettingsField__root layout__flex-column",label:"SettingsField__label layout__flex-column",container:"SettingsField__container layout__flex-row",control:"SettingsField__control layout__flex-column","control-partial-width":"SettingsField__control-partial-width SettingsField__control layout__flex-column",controlPartialWidth:"SettingsField__control-partial-width SettingsField__control layout__flex-column","control-full-width":"SettingsField__control-full-width SettingsField__control layout__flex-column",controlFullWidth:"SettingsField__control-full-width SettingsField__control layout__flex-column",tooltip:"SettingsField__tooltip layout__flex-column"}},39:function(t,e,o){"use strict";function n(t){return e=>(e.stopPropagation(),t(e))}function i(t,e){let o;return(...n)=>{clearTimeout(o),o=setTimeout(()=>{o=null,t(...n)},e)}}function a(){}o.d(e,"c",(function(){return n})),o.d(e,"a",(function(){return i})),o.d(e,"b",(function(){return a}))},4:function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));var n,i=o(19),a=o(1);!function(t){let e;!function(t){t.PERSONAL="PERSONAL",t.BUSINESS="BUSINESS"}(e=t.Type||(t.Type={}))}(n||(n={}));const s=Object(a.n)([]),r="https://secure.gravatar.com/avatar/4a94d759753ade2961582f7345c1d7b2?s=64&d=mm&r=g",l=t=>s.find(e=>e.id===t),c=t=>"https://instagram.com/"+t;function u(t){return t.slice().sort((t,e)=>t.type===e.type?0:t.type===n.Type.PERSONAL?-1:1),s.splice(0,s.length),t.forEach(t=>s.push(Object(a.n)(t))),s}function d(t){if("object"==typeof t&&Array.isArray(t.data))return u(t.data);throw"Spotlight encountered a problem trying to load your accounts. Kindly contact customer support for assistance."}e.b={list:s,DEFAULT_PROFILE_PIC:r,getById:l,getByUsername:t=>s.find(e=>e.username===t),hasAccounts:()=>s.length>0,filterExisting:t=>t.filter(t=>void 0!==l(t)),idsToAccounts:t=>t.map(t=>l(t)).filter(t=>void 0!==t),getBusinessAccounts:()=>s.filter(t=>t.type===n.Type.BUSINESS),getProfilePicUrl:t=>t.customProfilePicUrl?t.customProfilePicUrl:t.profilePicUrl?t.profilePicUrl:r,getBioText:t=>t.customBio.length?t.customBio:t.bio,getProfileUrl:t=>c(t.username),getUsernameUrl:c,loadAccounts:function(){return i.a.getAccounts().then(d).catch(t=>{throw i.a.getErrorReason(t)})},loadFromResponse:d,addAccounts:u}},48:function(t,e,o){"use strict";o.d(e,"a",(function(){return n})),o.d(e,"b",(function(){return i}));const n=(t,e)=>t.startsWith(e)?t:e+t,i=t=>{return(e=t,"#",e.startsWith("#")?e.substr("#".length):e).split(/\s/).map((t,e)=>e>0?t[0].toUpperCase()+t.substr(1):t).join("").replace(/\W/gi,"");var e}},52:function(t,e,o){t.exports={root:"SettingsGroup__root layout__flex-column",title:"SettingsGroup__title",content:"SettingsGroup__content","field-list":"SettingsGroup__field-list layout__flex-column",fieldList:"SettingsGroup__field-list layout__flex-column"}},58:function(t,e,o){"use strict";o.d(e,"a",(function(){return r}));var n=o(0),i=o.n(n),a=o(74),s=o.n(a);function r(){return i.a.createElement("div",{className:s.a.root})}},59:function(t,e,o){"use strict";var n=o(0),i=o.n(n),a=o(76),s=o.n(a),r=o(4),l=o(11),c=o(6);e.a=Object(c.b)((function(t){var{account:e,square:o,className:n}=t,a=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(o[n[i]]=t[n[i]])}return o}(t,["account","square","className"]);const c=r.b.getProfilePicUrl(e),u=Object(l.b)(o?s.a.square:s.a.round,n);return i.a.createElement("img",Object.assign({},a,{className:u,src:r.b.DEFAULT_PROFILE_PIC,srcSet:c+" 1x",alt:e.username+" profile picture"}))}))},60:function(t,e,o){t.exports={root:"SettingsPage__root layout__flex-column",content:"SettingsPage__content","group-list":"SettingsPage__group-list layout__flex-column",groupList:"SettingsPage__group-list layout__flex-column"}},607:function(t,e,o){"use strict";o.r(e);var n=o(0),i=o.n(n),a=o(96),s=o(7),r=o(51),l=o(181),c=o(231),u=o(232),d=o(22),h=o(63),p=o(56),m=o(81),g=o(67),f=o(233),b=o(130),y=o(126),v=o(16),O=o(131),w=o(125),E=o(240),S=o(241);a.a.tabs=a.a.tabs.filter(t=>!t.isFakePro),a.a.openGroups.push("caption-filters","hashtag-filters");const _=a.a.tabs.find(t=>"connect"===t.id);_.groups=_.groups.filter(t=>!t.isFakePro),_.groups.push({id:"tagged",label:"Show posts where these accounts are tagged",fields:[{id:"tagged",component:Object(r.a)(({value:t,onChange:e})=>i.a.createElement(c.a,{value:t.tagged,onChange:t=>e({tagged:t})}),["tagged"])}]},{id:"hashtags",label:"Show posts with these hashtags",fields:[{id:"hashtags",component:Object(r.a)(({value:t,onChange:e})=>i.a.createElement(u.a,{value:t.hashtags,onChange:t=>e({hashtags:t})}),["hashtags"])}]});const C=a.a.tabs.find(t=>"design"===t.id);{C.groups=C.groups.filter(t=>!t.isFakePro),C.groups.find(t=>"layouts"===t.id).fields.push({id:"highlight-freq",component:Object(d.a)({label:"Highlight every",option:"highlightFreq",deps:["layout"],when:t=>"highlight"===t.value.layout,render:(t,e,o)=>i.a.createElement(h.a,{id:t.field.id,value:e,onChange:o,min:1,unit:"posts",placeholder:"1"})})});const t=C.groups.find(t=>"feed"===t.id);t.fields=t.fields.filter(t=>!t.isFakePro),t.fields.splice(3,0,{id:"media-type",component:Object(d.a)({label:"Types of posts",option:"mediaType",render:(t,e,o)=>i.a.createElement(p.a,{id:t.field.id,value:e,onChange:t=>o(t.value),options:[{value:s.a.MediaType.ALL,label:"All posts"},{value:s.a.MediaType.PHOTOS,label:"Photos Only"},{value:s.a.MediaType.VIDEOS,label:"Videos Only"}]})})});const e=C.groups.find(t=>"appearance"===t.id);{e.fields=e.fields.filter(t=>!t.isFakePro),e.fields.push({id:"hover-text-color",component:Object(d.a)({label:"Hover text color",option:"textColorHover",render:(t,e,o)=>i.a.createElement(m.a,{id:t.field.id,value:e,onChange:t=>o(t.rgb)})})},{id:"hover-bg-color",component:Object(d.a)({label:"Hover background color",option:"bgColorHover",render:(t,e,o)=>i.a.createElement(m.a,{id:t.field.id,value:e,onChange:t=>o(t.rgb)})})});const t=e.fields.find(t=>"hover-info"===t.id);t&&(t.data.options=t.data.options.filter(t=>!t.isFakePro),t.data.options.push({value:s.a.HoverInfo.CAPTION,label:"Caption"},{value:s.a.HoverInfo.USERNAME,label:"Username"},{value:s.a.HoverInfo.DATE,label:"Date"}))}const o=C.groups.find(t=>"header"===t.id);{o.fields=o.fields.filter(t=>!t.isFakePro),o.fields.splice(2,0,{id:"header-style",component:Object(d.a)({label:"Header style",option:"headerStyle",deps:["showHeader"],disabled:t=>Object(l.b)(t),render:(t,e,o)=>i.a.createElement(p.a,{id:t.field.id,value:e,onChange:t=>o(t.value),options:[{value:s.a.HeaderStyle.NORMAL,label:"Normal"},{value:s.a.HeaderStyle.CENTERED,label:"Centered"}]})})}),o.fields.push({id:"include-stories",component:Object(d.a)({label:"Include stories",option:"includeStories",deps:["showHeader"],disabled:t=>Object(l.b)(t),render:(t,e,o)=>i.a.createElement(g.a,{id:t.field.id,value:e,onChange:o}),tooltip:()=>i.a.createElement("span",null,"Re-shared stories are not available due to a restriction by Instagram.")})},{id:"stories-interval",component:Object(d.a)({label:"Stories interval time",option:"storiesInterval",deps:["includeStories","showHeader"],disabled:t=>function(t){return Object(l.b)(t)||!t.value.includeStories}(t),render:(t,e,o)=>i.a.createElement(h.a,{id:t.field.id,value:e,onChange:o,min:1,unit:"sec"})})});const t=o.fields.find(t=>"header-info"===t.id);t&&(t.data.options=t.data.options.filter(t=>!t.isFakePro),t.data.options.push({value:s.a.HeaderInfo.MEDIA_COUNT,label:"Post count"},{value:s.a.HeaderInfo.FOLLOWERS,label:"Follower count"}))}const n={id:"lightbox",label:"Popup box",fields:[{id:"show-lightbox-sidebar",component:Object(d.a)({label:"Show sidebar",option:"lightboxShowSidebar",render:(t,e,o)=>i.a.createElement(g.a,{id:t.field.id,value:e,onChange:o})})},{id:"num-lightbox-comments",label:"Number of comments",component:Object(d.a)({label:"Number of comments",option:"numLightboxComments",deps:["lightboxShowSidebar"],disabled:t=>!t.value.lightboxShowSidebar,render:(t,e,o)=>i.a.createElement(h.a,{id:t.field.id,value:e,onChange:o,min:0,placeholder:"No comments"}),tooltip:()=>i.a.createElement("span",null,"Comments are only available for posts from a ",i.a.createElement("strong",null,"Business")," account")})}]},a={id:"captions",label:"Captions",fields:[{id:"show-captions",component:Object(d.a)({label:"Show captions",option:"showCaptions",render:(t,e,o)=>i.a.createElement(g.a,{id:t.field.id,value:e,onChange:o})})},{id:"caption-max-length",component:Object(d.a)({label:"Caption max length",option:"captionMaxLength",deps:["showCaptions"],disabled:t=>A(t),render:(t,e,o)=>i.a.createElement(h.a,{id:t.field.id,value:e,onChange:o,min:0,unit:"words",placeholder:"No limit"})})},{id:"caption-size",component:Object(d.a)({label:"Caption text size",option:"captionSize",deps:["showCaptions"],disabled:t=>A(t),render:(t,e,o)=>i.a.createElement(h.a,{id:t.field.id,value:e,onChange:o,min:0,unit:"px",placeholder:"Theme default"})})},{id:"caption-color",component:Object(d.a)({label:"Caption text color",option:"captionColor",deps:["showCaptions"],disabled:t=>A(t),render:(t,e,o)=>i.a.createElement(m.a,{id:t.field.id,value:e,onChange:t=>o(t.rgb)})})},{id:"caption-remove-dots",component:Object(d.a)({label:"Remove dot lines",option:"captionRemoveDots",deps:["showCaptions"],disabled:t=>A(t),render:(t,e,o)=>i.a.createElement(g.a,{id:t.field.id,value:e,onChange:o}),tooltip:()=>i.a.createElement("span",null,'Enable this option to remove lines in captions that are only "dots", such as'," ",i.a.createElement("code",null,"."),", ",i.a.createElement("code",null,"•"),", ",i.a.createElement("code",null,"*"),", etc.")})}]},r={id:"likes-comments",label:"Likes & Comments",fields:[{id:"show-likes",component:Object(d.a)({label:"Show likes icon",option:"showLikes",render:(t,e,o)=>i.a.createElement(g.a,{id:t.field.id,value:e,onChange:o}),tooltip:()=>i.a.createElement("span",null,"Likes are not available for Personal accounts, due to restrictions set by Instagram.")})},{id:"likes-icon-color",component:Object(d.a)({label:"Likes icon color",option:"likesIconColor",deps:["showLikes"],disabled:t=>!t.computed.showLikes,render:(t,e,o)=>i.a.createElement(m.a,{id:t.field.id,value:e,onChange:t=>o(t.rgb)})})},{id:"show-comments",component:Object(d.a)({label:"Show comments icon",option:"showComments",render:(t,e,o)=>i.a.createElement(g.a,{id:t.field.id,value:e,onChange:o}),tooltip:()=>i.a.createElement("span",null,"Comments are not available for Personal accounts, due to restrictions set by Instagram.")})},{id:"comments-icon-color",component:Object(d.a)({label:"Comments icon color",option:"commentsIconColor",deps:["showComments"],disabled:t=>!t.computed.showComments,render:(t,e,o)=>i.a.createElement(m.a,{id:t.field.id,value:e,onChange:t=>o(t.rgb)})})},{id:"lcIconSize",component:Object(d.a)({label:"Icon size",option:"lcIconSize",deps:["showLikes","showComments"],disabled:t=>!t.computed.showLikes&&!t.computed.showComments,render:(t,e,o)=>i.a.createElement(h.a,{id:t.field.id,value:e,onChange:o,min:0,unit:"px"})})}]};C.groups.splice(4,0,n,a,r)}const P={id:"filters",label:"Filter",sidebar:f.a,groups:[{id:"caption-filters",label:"Caption filtering",fields:[{id:"caption-whitelist",component:Object(r.a)(({value:t,onChange:e,field:o})=>i.a.createElement(b.a,{label:"Only show posts with these words or phrases"},i.a.createElement(y.a,{id:o.id,value:t.captionWhitelist,onChange:t=>e({captionWhitelist:t}),exclude:v.b.values.captionBlacklist.concat(t.captionBlacklist),excludeMsg:"%s is already being used in the below option or your global filters"})),["captionWhitelist"])},{id:"caption-whitelist-settings",component:Object(r.a)(({value:t,onChange:e,feed:o})=>i.a.createElement(O.a,{value:t.captionWhitelistSettings,onChange:t=>e({captionWhitelistSettings:t}),feed:o}),["captionWhitelistSettings"])},{id:"caption-blacklist",component:Object(r.a)(({value:t,onChange:e,field:o})=>i.a.createElement(b.a,{label:"Hide posts with these words or phrases",bordered:!0},i.a.createElement(y.a,{id:o.id,value:t.captionBlacklist,onChange:t=>e({captionBlacklist:t}),exclude:v.b.values.captionWhitelist.concat(t.captionWhitelist),excludeMsg:"%s is already being used in the above option or your global filters"})),["captionBlacklist"])},{id:"caption-blacklist-settings",component:Object(r.a)(({value:t,onChange:e,feed:o})=>i.a.createElement(O.a,{value:t.captionBlacklistSettings,onChange:t=>e({captionBlacklistSettings:t}),feed:o}),["captionBlacklistSettings"])}]},{id:"hashtag-filters",label:"Hashtag filtering",fields:[{id:"hashtag-whitelist",component:Object(r.a)(({value:t,onChange:e,field:o})=>i.a.createElement(b.a,{label:"Only show posts with these hashtags"},i.a.createElement(w.a,{id:o.id,value:t.hashtagWhitelist,onChange:t=>e({hashtagWhitelist:t}),exclude:v.b.values.hashtagBlacklist.concat(t.hashtagBlacklist),excludeMsg:"The %s hashtag is already being used in the below option or your global filters"})),["hashtagWhitelist"])},{id:"hashtag-whitelist-settings",component:Object(r.a)(({value:t,onChange:e,feed:o})=>i.a.createElement(O.a,{value:t.hashtagWhitelistSettings,onChange:t=>e({hashtagWhitelistSettings:t}),feed:o}),["hashtagWhitelistSettings"])},{id:"hashtag-blacklist",component:Object(r.a)(({value:t,onChange:e,field:o})=>i.a.createElement(b.a,{label:"Hide posts with these hashtags",bordered:!0},i.a.createElement(w.a,{id:o.id,value:t.hashtagBlacklist,onChange:t=>e({hashtagBlacklist:t}),exclude:v.b.values.hashtagWhitelist.concat(t.hashtagWhitelist),excludeMsg:"The %s hashtag is already being used by the above option or your global filters"})),["hashtagBlacklist"])},{id:"hashtag-blacklist-settings",component:Object(r.a)(({value:t,onChange:e,feed:o})=>i.a.createElement(O.a,{value:t.hashtagBlacklistSettings,onChange:t=>e({hashtagBlacklistSettings:t}),feed:o}),["hashtagBlacklistSettings"])}]}]},k={id:"moderate",label:"Moderate",component:E.a},B={id:"promote",label:"Promote",component:S.a},T=a.a.tabs.findIndex(t=>"embed"===t.id);function A(t){return!t.computed.showCaptions}T<0?a.a.tabs.push(P,k,B):a.a.tabs.splice(T,0,P,k,B)},7:function(t,e,o){"use strict";o.d(e,"a",(function(){return y}));var n=o(33),i=o.n(n),a=o(1),s=o(2),r=o(27),l=o(35),c=o(4),u=o(3),d=o(13),h=o(19),p=o(39),m=o(8),g=o(15),f=o(12),b=function(t,e,o,n){var i,a=arguments.length,s=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var r=t.length-1;r>=0;r--)(i=t[r])&&(s=(a<3?i(s):a>3?i(e,o,s):i(e,o))||s);return a>3&&s&&Object.defineProperty(e,o,s),s};class y{constructor(t=new y.Options,e=s.a.Mode.DESKTOP){this.media=[],this.canLoadMore=!1,this.stories=[],this.numLoadedMore=0,this.totalMedia=0,this.mode=s.a.Mode.DESKTOP,this.isLoaded=!1,this.isLoading=!1,this.isLoadingMore=!1,this.numMediaToShow=0,this.numMediaPerPage=0,this.cancelFetch=()=>{},this.options=new y.Options(t),this.localMedia=[],this.mode=e,this.mediaCounter=this._numMediaPerPage,this.reload=Object(p.a)(()=>this.load(),300),Object(a.o)(()=>this.mode,()=>{0===this.numLoadedMore&&(this.mediaCounter=this._numMediaPerPage,this.localMedia.length<this.numMediaToShow&&this.loadMedia(this.localMedia.length,this.numMediaToShow-this.localMedia.length))}),Object(a.o)(()=>this.getReloadOptions(),()=>this.reload()),Object(a.o)(()=>({num:this._numMediaPerPage,mode:this.mode}),({num:t})=>{this.localMedia.length<t&&t<=this.totalMedia?this.reload():this.mediaCounter=Math.max(1,t)}),Object(a.o)(()=>this._media,t=>this.media=t),Object(a.o)(()=>this._numMediaToShow,t=>this.numMediaToShow=t),Object(a.o)(()=>this._numMediaPerPage,t=>this.numMediaPerPage=t),Object(a.o)(()=>this._canLoadMore,t=>this.canLoadMore=t)}get _media(){return this.localMedia.slice(0,this.numMediaToShow)}get _numMediaToShow(){return Math.min(this.mediaCounter,this.totalMedia)}get _numMediaPerPage(){return Math.max(1,y.ComputedOptions.normalizeMultiInt(this.options.numPosts,this.mode,1))}get _canLoadMore(){return this.localMedia.length>this.mediaCounter||this.localMedia.length<this.totalMedia}loadMore(){const t=this.numMediaToShow+this._numMediaPerPage-this.localMedia.length;return this.isLoadingMore=!0,t>0?this.loadMedia(this.localMedia.length,this._numMediaPerPage).then(()=>{this.mediaCounter+=this._numMediaPerPage,this.numLoadedMore++,this.isLoadingMore=!1}):new Promise(t=>{this.numLoadedMore++,this.mediaCounter+=this._numMediaPerPage,this.isLoadingMore=!1,t()})}load(){return this.numLoadedMore=0,this.loadMedia(0,this._numMediaPerPage,!0).then(()=>(this.isLoaded=!0,this.mediaCounter=this._numMediaPerPage))}loadMedia(t,e,o){return this.cancelFetch(),y.Options.hasSources(this.options)?(this.isLoading=!0,new Promise((n,a)=>{h.a.getFeedMedia(this.options,t,e,t=>this.cancelFetch=t).then(t=>{var e;if("object"!=typeof t||"object"!=typeof t.data||!Array.isArray(t.data.media))throw{message:"The media response is malformed or corrupt",response:t};o&&(this.localMedia=[]),this.localMedia.push(...t.data.media),this.stories=null!==(e=t.data.stories)&&void 0!==e?e:[],this.totalMedia=t.data.total,n&&n()}).catch(t=>{var e;if(i.a.isCancel(t))return null;const o=new y.Events.FetchFailEvent(y.Events.FETCH_FAIL,{detail:{feed:this,message:null!==(e=t.response?t.response.data.message:void 0)&&void 0!==e?e:t.message,response:t.response}});return document.dispatchEvent(o),a&&a(t),t}).finally(()=>this.isLoading=!1)})):new Promise(t=>{this.localMedia=[],this.totalMedia=0,t&&t()})}getReloadOptions(){return JSON.stringify({accounts:this.options.accounts,hashtags:this.options.hashtags,tagged:this.options.tagged,postOrder:this.options.postOrder,mediaType:this.options.mediaType,moderation:this.options.moderation,moderationMode:this.options.moderationMode,hashtagBlacklist:this.options.hashtagBlacklist,hashtagWhitelist:this.options.hashtagWhitelist,captionBlacklist:this.options.captionBlacklist,captionWhitelist:this.options.captionWhitelist,hashtagBlacklistSettings:this.options.hashtagBlacklistSettings,hashtagWhitelistSettings:this.options.hashtagWhitelistSettings,captionBlacklistSettings:this.options.captionBlacklistSettings,captionWhitelistSettings:this.options.captionWhitelistSettings})}}b([a.n],y.prototype,"media",void 0),b([a.n],y.prototype,"canLoadMore",void 0),b([a.n],y.prototype,"stories",void 0),b([a.n],y.prototype,"numLoadedMore",void 0),b([a.n],y.prototype,"options",void 0),b([a.n],y.prototype,"totalMedia",void 0),b([a.n],y.prototype,"mode",void 0),b([a.n],y.prototype,"isLoaded",void 0),b([a.n],y.prototype,"isLoading",void 0),b([a.n],y.prototype,"isLoadingMore",void 0),b([a.f],y.prototype,"reload",void 0),b([a.n],y.prototype,"localMedia",void 0),b([a.n],y.prototype,"numMediaToShow",void 0),b([a.n],y.prototype,"numMediaPerPage",void 0),b([a.n],y.prototype,"mediaCounter",void 0),b([a.h],y.prototype,"_media",null),b([a.h],y.prototype,"_numMediaToShow",null),b([a.h],y.prototype,"_numMediaPerPage",null),b([a.h],y.prototype,"_canLoadMore",null),b([a.f],y.prototype,"loadMore",null),b([a.f],y.prototype,"load",null),b([a.f],y.prototype,"loadMedia",null),function(t){let e,o,n,i,h,p,y,v,O;!function(t){t.FETCH_FAIL="sli/feed/fetch_fail";class e extends CustomEvent{constructor(t,e){super(t,e)}}t.FetchFailEvent=e}(e=t.Events||(t.Events={}));class w{constructor(t={}){w.setFromObject(this,t)}static setFromObject(e,o={}){var n,i,a,l,u,d,h,p,m,f,b,y,v,O,w;const E=o.accounts?o.accounts.slice():t.DefaultOptions.accounts;e.accounts=E.filter(t=>!!t).map(t=>parseInt(t.toString()));const S=o.tagged?o.tagged.slice():t.DefaultOptions.tagged;return e.tagged=S.filter(t=>!!t).map(t=>parseInt(t.toString())),e.hashtags=o.hashtags?o.hashtags.slice():t.DefaultOptions.hashtags,e.layout=r.a.getById(o.layout).id,e.numColumns=s.a.normalize(o.numColumns,t.DefaultOptions.numColumns),e.highlightFreq=s.a.normalize(o.highlightFreq,t.DefaultOptions.highlightFreq),e.mediaType=o.mediaType||t.DefaultOptions.mediaType,e.postOrder=o.postOrder||t.DefaultOptions.postOrder,e.numPosts=s.a.normalize(o.numPosts,t.DefaultOptions.numPosts),e.linkBehavior=s.a.normalize(o.linkBehavior,t.DefaultOptions.linkBehavior),e.feedWidth=s.a.normalize(o.feedWidth,t.DefaultOptions.feedWidth),e.feedHeight=s.a.normalize(o.feedHeight,t.DefaultOptions.feedHeight),e.feedPadding=s.a.normalize(o.feedPadding,t.DefaultOptions.feedPadding),e.imgPadding=s.a.normalize(o.imgPadding,t.DefaultOptions.imgPadding),e.textSize=s.a.normalize(o.textSize,t.DefaultOptions.textSize),e.bgColor=o.bgColor||t.DefaultOptions.bgColor,e.hoverInfo=o.hoverInfo?o.hoverInfo.slice():t.DefaultOptions.hoverInfo,e.textColorHover=o.textColorHover||t.DefaultOptions.textColorHover,e.bgColorHover=o.bgColorHover||t.DefaultOptions.bgColorHover,e.showHeader=s.a.normalize(o.showHeader,t.DefaultOptions.showHeader),e.headerInfo=s.a.normalize(o.headerInfo,t.DefaultOptions.headerInfo),e.headerAccount=null!==(n=o.headerAccount)&&void 0!==n?n:t.DefaultOptions.headerAccount,e.headerAccount=null===e.headerAccount||void 0===c.b.getById(e.headerAccount)?c.b.list.length>0?c.b.list[0].id:null:e.headerAccount,e.headerStyle=s.a.normalize(o.headerStyle,t.DefaultOptions.headerStyle),e.headerTextSize=s.a.normalize(o.headerTextSize,t.DefaultOptions.headerTextSize),e.headerPhotoSize=s.a.normalize(o.headerPhotoSize,t.DefaultOptions.headerPhotoSize),e.headerTextColor=o.headerTextColor||t.DefaultOptions.headerTextColor,e.headerBgColor=o.headerBgColor||t.DefaultOptions.bgColor,e.headerPadding=s.a.normalize(o.headerPadding,t.DefaultOptions.headerPadding),e.customProfilePic=null!==(i=o.customProfilePic)&&void 0!==i?i:t.DefaultOptions.customProfilePic,e.customBioText=o.customBioText||t.DefaultOptions.customBioText,e.includeStories=null!==(a=o.includeStories)&&void 0!==a?a:t.DefaultOptions.includeStories,e.storiesInterval=o.storiesInterval||t.DefaultOptions.storiesInterval,e.showCaptions=s.a.normalize(o.showCaptions,t.DefaultOptions.showCaptions),e.captionMaxLength=s.a.normalize(o.captionMaxLength,t.DefaultOptions.captionMaxLength),e.captionRemoveDots=null!==(l=o.captionRemoveDots)&&void 0!==l?l:t.DefaultOptions.captionRemoveDots,e.captionSize=s.a.normalize(o.captionSize,t.DefaultOptions.captionSize),e.captionColor=o.captionColor||t.DefaultOptions.captionColor,e.showLikes=s.a.normalize(o.showLikes,t.DefaultOptions.showLikes),e.showComments=s.a.normalize(o.showComments,t.DefaultOptions.showCaptions),e.lcIconSize=s.a.normalize(o.lcIconSize,t.DefaultOptions.lcIconSize),e.likesIconColor=null!==(u=o.likesIconColor)&&void 0!==u?u:t.DefaultOptions.likesIconColor,e.commentsIconColor=o.commentsIconColor||t.DefaultOptions.commentsIconColor,e.lightboxShowSidebar=null!==(d=o.lightboxShowSidebar)&&void 0!==d?d:t.DefaultOptions.lightboxShowSidebar,e.numLightboxComments=o.numLightboxComments||t.DefaultOptions.numLightboxComments,e.showLoadMoreBtn=s.a.normalize(o.showLoadMoreBtn,t.DefaultOptions.showLoadMoreBtn),e.loadMoreBtnTextColor=o.loadMoreBtnTextColor||t.DefaultOptions.loadMoreBtnTextColor,e.loadMoreBtnBgColor=o.loadMoreBtnBgColor||t.DefaultOptions.loadMoreBtnBgColor,e.loadMoreBtnText=o.loadMoreBtnText||t.DefaultOptions.loadMoreBtnText,e.autoload=null!==(h=o.autoload)&&void 0!==h?h:t.DefaultOptions.autoload,e.showFollowBtn=s.a.normalize(o.showFollowBtn,t.DefaultOptions.showFollowBtn),e.followBtnText=null!==(p=o.followBtnText)&&void 0!==p?p:t.DefaultOptions.followBtnText,e.followBtnTextColor=o.followBtnTextColor||t.DefaultOptions.followBtnTextColor,e.followBtnBgColor=o.followBtnBgColor||t.DefaultOptions.followBtnBgColor,e.followBtnLocation=s.a.normalize(o.followBtnLocation,t.DefaultOptions.followBtnLocation),e.hashtagWhitelist=o.hashtagWhitelist||t.DefaultOptions.hashtagWhitelist,e.hashtagBlacklist=o.hashtagBlacklist||t.DefaultOptions.hashtagBlacklist,e.captionWhitelist=o.captionWhitelist||t.DefaultOptions.captionWhitelist,e.captionBlacklist=o.captionBlacklist||t.DefaultOptions.captionBlacklist,e.hashtagWhitelistSettings=null!==(m=o.hashtagWhitelistSettings)&&void 0!==m?m:t.DefaultOptions.hashtagWhitelistSettings,e.hashtagBlacklistSettings=null!==(f=o.hashtagBlacklistSettings)&&void 0!==f?f:t.DefaultOptions.hashtagBlacklistSettings,e.captionWhitelistSettings=null!==(b=o.captionWhitelistSettings)&&void 0!==b?b:t.DefaultOptions.captionWhitelistSettings,e.captionBlacklistSettings=null!==(y=o.captionBlacklistSettings)&&void 0!==y?y:t.DefaultOptions.captionBlacklistSettings,e.moderation=o.moderation||t.DefaultOptions.moderation,e.moderationMode=o.moderationMode||t.DefaultOptions.moderationMode,e.promotionEnabled=null!==(v=o.promotionEnabled)&&void 0!==v?v:t.DefaultOptions.promotionEnabled,e.autoPromotionsEnabled=null!==(O=o.autoPromotionsEnabled)&&void 0!==O?O:t.DefaultOptions.autoPromotionsEnabled,e.globalPromotionsEnabled=null!==(w=o.globalPromotionsEnabled)&&void 0!==w?w:t.DefaultOptions.globalPromotionsEnabled,Array.isArray(o.promotions)?e.promotions=g.a.fromArray(o.promotions):o.promotions&&o.promotions instanceof Map?e.promotions=g.a.fromMap(o.promotions):"object"==typeof o.promotions?e.promotions=o.promotions:e.promotions=t.DefaultOptions.promotions,e}static getAllAccounts(t){const e=c.b.idsToAccounts(t.accounts),o=c.b.idsToAccounts(t.tagged);return{all:e.concat(o),accounts:e,tagged:o}}static getSources(t){return{accounts:c.b.idsToAccounts(t.accounts),tagged:c.b.idsToAccounts(t.tagged),hashtags:c.b.getBusinessAccounts().length>0?t.hashtags.filter(t=>t.tag.length>0):[]}}static hasSources(e){const o=t.Options.getSources(e),n=o.accounts.length>0||o.tagged.length>0,i=o.hashtags.length>0;return n||i}static isLimitingPosts(t){return t.moderation.length>0||t.hashtagBlacklist.length>0||t.hashtagWhitelist.length>0||t.captionBlacklist.length>0||t.captionWhitelist.length>0}}b([a.n],w.prototype,"accounts",void 0),b([a.n],w.prototype,"hashtags",void 0),b([a.n],w.prototype,"tagged",void 0),b([a.n],w.prototype,"layout",void 0),b([a.n],w.prototype,"numColumns",void 0),b([a.n],w.prototype,"highlightFreq",void 0),b([a.n],w.prototype,"mediaType",void 0),b([a.n],w.prototype,"postOrder",void 0),b([a.n],w.prototype,"numPosts",void 0),b([a.n],w.prototype,"linkBehavior",void 0),b([a.n],w.prototype,"feedWidth",void 0),b([a.n],w.prototype,"feedHeight",void 0),b([a.n],w.prototype,"feedPadding",void 0),b([a.n],w.prototype,"imgPadding",void 0),b([a.n],w.prototype,"textSize",void 0),b([a.n],w.prototype,"bgColor",void 0),b([a.n],w.prototype,"textColorHover",void 0),b([a.n],w.prototype,"bgColorHover",void 0),b([a.n],w.prototype,"hoverInfo",void 0),b([a.n],w.prototype,"showHeader",void 0),b([a.n],w.prototype,"headerInfo",void 0),b([a.n],w.prototype,"headerAccount",void 0),b([a.n],w.prototype,"headerStyle",void 0),b([a.n],w.prototype,"headerTextSize",void 0),b([a.n],w.prototype,"headerPhotoSize",void 0),b([a.n],w.prototype,"headerTextColor",void 0),b([a.n],w.prototype,"headerBgColor",void 0),b([a.n],w.prototype,"headerPadding",void 0),b([a.n],w.prototype,"customBioText",void 0),b([a.n],w.prototype,"customProfilePic",void 0),b([a.n],w.prototype,"includeStories",void 0),b([a.n],w.prototype,"storiesInterval",void 0),b([a.n],w.prototype,"showCaptions",void 0),b([a.n],w.prototype,"captionMaxLength",void 0),b([a.n],w.prototype,"captionRemoveDots",void 0),b([a.n],w.prototype,"captionSize",void 0),b([a.n],w.prototype,"captionColor",void 0),b([a.n],w.prototype,"showLikes",void 0),b([a.n],w.prototype,"showComments",void 0),b([a.n],w.prototype,"lcIconSize",void 0),b([a.n],w.prototype,"likesIconColor",void 0),b([a.n],w.prototype,"commentsIconColor",void 0),b([a.n],w.prototype,"lightboxShowSidebar",void 0),b([a.n],w.prototype,"numLightboxComments",void 0),b([a.n],w.prototype,"showLoadMoreBtn",void 0),b([a.n],w.prototype,"loadMoreBtnText",void 0),b([a.n],w.prototype,"loadMoreBtnTextColor",void 0),b([a.n],w.prototype,"loadMoreBtnBgColor",void 0),b([a.n],w.prototype,"autoload",void 0),b([a.n],w.prototype,"showFollowBtn",void 0),b([a.n],w.prototype,"followBtnText",void 0),b([a.n],w.prototype,"followBtnTextColor",void 0),b([a.n],w.prototype,"followBtnBgColor",void 0),b([a.n],w.prototype,"followBtnLocation",void 0),b([a.n],w.prototype,"hashtagWhitelist",void 0),b([a.n],w.prototype,"hashtagBlacklist",void 0),b([a.n],w.prototype,"captionWhitelist",void 0),b([a.n],w.prototype,"captionBlacklist",void 0),b([a.n],w.prototype,"hashtagWhitelistSettings",void 0),b([a.n],w.prototype,"hashtagBlacklistSettings",void 0),b([a.n],w.prototype,"captionWhitelistSettings",void 0),b([a.n],w.prototype,"captionBlacklistSettings",void 0),b([a.n],w.prototype,"moderation",void 0),b([a.n],w.prototype,"moderationMode",void 0),t.Options=w;class E{constructor(t){Object.getOwnPropertyNames(t).map(e=>{this[e]=t[e]})}getCaption(t){const e=t.caption?t.caption:"";return this.captionMaxLength&&e.length?Object(u.q)(Object(u.t)(e,this.captionMaxLength)):e}static compute(e,o=s.a.Mode.DESKTOP){const n=new E({accounts:c.b.filterExisting(e.accounts),tagged:c.b.filterExisting(e.tagged),hashtags:e.hashtags.filter(t=>t.tag.length>0),layout:r.a.getById(e.layout),highlightFreq:s.a.get(e.highlightFreq,o,!0),linkBehavior:s.a.get(e.linkBehavior,o,!0),bgColor:Object(d.a)(e.bgColor),textColorHover:Object(d.a)(e.textColorHover),bgColorHover:Object(d.a)(e.bgColorHover),hoverInfo:e.hoverInfo,showHeader:s.a.get(e.showHeader,o,!0),headerInfo:s.a.get(e.headerInfo,o,!0),headerStyle:s.a.get(e.headerStyle,o,!0),headerTextColor:Object(d.a)(e.headerTextColor),headerBgColor:Object(d.a)(e.headerBgColor),headerPadding:s.a.get(e.headerPadding,o,!0),includeStories:e.includeStories,storiesInterval:e.storiesInterval,showCaptions:s.a.get(e.showCaptions,o,!0),captionMaxLength:s.a.get(e.captionMaxLength,o,!0),captionRemoveDots:e.captionRemoveDots,captionColor:Object(d.a)(e.captionColor),showLikes:s.a.get(e.showLikes,o,!0),showComments:s.a.get(e.showComments,o,!0),likesIconColor:Object(d.a)(e.likesIconColor),commentsIconColor:Object(d.a)(e.commentsIconColor),lightboxShowSidebar:e.lightboxShowSidebar,numLightboxComments:e.numLightboxComments,showLoadMoreBtn:s.a.get(e.showLoadMoreBtn,o,!0),loadMoreBtnTextColor:Object(d.a)(e.loadMoreBtnTextColor),loadMoreBtnBgColor:Object(d.a)(e.loadMoreBtnBgColor),loadMoreBtnText:e.loadMoreBtnText,showFollowBtn:s.a.get(e.showFollowBtn,o,!0),autoload:e.autoload,followBtnLocation:s.a.get(e.followBtnLocation,o,!0),followBtnTextColor:Object(d.a)(e.followBtnTextColor),followBtnBgColor:Object(d.a)(e.followBtnBgColor),followBtnText:e.followBtnText,account:null,showBio:!1,bioText:null,profilePhotoUrl:c.b.DEFAULT_PROFILE_PIC,feedWidth:"",feedHeight:"",feedPadding:"",imgPadding:"",textSize:"",headerTextSize:"",headerPhotoSize:"",captionSize:"",lcIconSize:"",showLcIcons:!1});if(n.numColumns=this.getNumCols(e,o),n.numPosts=this.getNumPosts(e,o),n.allAccounts=n.accounts.concat(n.tagged.filter(t=>!n.accounts.includes(t))),n.allAccounts.length>0&&(n.account=e.headerAccount&&n.allAccounts.includes(e.headerAccount)?c.b.getById(e.headerAccount):c.b.getById(n.allAccounts[0])),n.showHeader=n.showHeader&&null!==n.account,n.showHeader&&(n.profilePhotoUrl=e.customProfilePic.length?e.customProfilePic:c.b.getProfilePicUrl(n.account)),n.showFollowBtn=n.showFollowBtn&&null!==n.account,n.showBio=n.headerInfo.some(e=>e===t.HeaderInfo.BIO),n.showBio){const t=e.customBioText.trim().length>0?e.customBioText:null!==n.account?c.b.getBioText(n.account):"";n.bioText=Object(u.q)(t),n.showBio=n.bioText.length>0}return n.feedWidth=this.normalizeCssSize(e.feedWidth,o,"auto"),n.feedHeight=this.normalizeCssSize(e.feedHeight,o,"auto"),n.feedPadding=this.normalizeCssSize(e.feedPadding,o,"0"),n.imgPadding=this.normalizeCssSize(e.imgPadding,o,"0"),n.textSize=this.normalizeCssSize(e.textSize,o,"inherit",!0),n.headerTextSize=this.normalizeCssSize(e.headerTextSize,o,"inherit"),n.headerPhotoSize=this.normalizeCssSize(e.headerPhotoSize,o,"50px"),n.captionSize=this.normalizeCssSize(e.captionSize,o,"inherit"),n.lcIconSize=this.normalizeCssSize(e.lcIconSize,o,"inherit"),n.buttonPadding=Math.max(10,s.a.get(e.imgPadding,o))+"px",n.showLcIcons=n.showLikes||n.showComments,n}static getNumCols(t,e){return Math.max(1,this.normalizeMultiInt(t.numColumns,e,1))}static getNumPosts(t,e){return Math.max(1,this.normalizeMultiInt(t.numPosts,e,1))}static normalizeMultiInt(t,e,o=0){const n=parseInt(s.a.get(t,e)+"");return isNaN(n)?e===s.a.Mode.DESKTOP?o:this.normalizeMultiInt(t,s.a.Mode.DESKTOP,o):n}static normalizeCssSize(t,e,o=null,n=!1){const i=s.a.get(t,e,n);return i?i+"px":o}}function S(t,e){if(f.a.isPro)return Object(u.m)(m.a.isValid,[()=>_(t,e),()=>e.globalPromotionsEnabled&&m.a.getGlobalPromo(t),()=>e.autoPromotionsEnabled&&m.a.getAutoPromo(t)])}function _(t,e){return t?m.a.getPromoFromDictionary(t,e.promotions):void 0}t.ComputedOptions=E,t.HashtagSorting=Object(l.b)({recent:"Most recent",popular:"Most popular"}),function(t){t.ALL="all",t.PHOTOS="photos",t.VIDEOS="videos"}(o=t.MediaType||(t.MediaType={})),function(t){t.NOTHING="nothing",t.SELF="self",t.NEW_TAB="new_tab",t.LIGHTBOX="lightbox"}(n=t.LinkBehavior||(t.LinkBehavior={})),function(t){t.DATE_ASC="date_asc",t.DATE_DESC="date_desc",t.POPULARITY_ASC="popularity_asc",t.POPULARITY_DESC="popularity_desc",t.RANDOM="random"}(i=t.PostOrder||(t.PostOrder={})),function(t){t.USERNAME="username",t.DATE="date",t.CAPTION="caption",t.LIKES_COMMENTS="likes_comments",t.INSTA_LINK="insta_link"}(h=t.HoverInfo||(t.HoverInfo={})),function(t){t.NORMAL="normal",t.BOXED="boxed",t.CENTERED="centered"}(p=t.HeaderStyle||(t.HeaderStyle={})),function(t){t.BIO="bio",t.PROFILE_PIC="profile_pic",t.FOLLOWERS="followers",t.MEDIA_COUNT="media_count"}(y=t.HeaderInfo||(t.HeaderInfo={})),function(t){t.HEADER="header",t.BOTTOM="bottom",t.BOTH="both"}(v=t.FollowBtnLocation||(t.FollowBtnLocation={})),function(t){t.WHITELIST="whitelist",t.BLACKLIST="blacklist"}(O=t.ModerationMode||(t.ModerationMode={})),t.DefaultOptions={accounts:[],hashtags:[],tagged:[],layout:null,numColumns:{desktop:3},highlightFreq:{desktop:7},mediaType:o.ALL,postOrder:i.DATE_DESC,numPosts:{desktop:9},linkBehavior:{desktop:n.LIGHTBOX,phone:n.NEW_TAB},feedWidth:{desktop:""},feedHeight:{desktop:""},feedPadding:{desktop:20,tablet:14,phone:10},imgPadding:{desktop:14,tablet:10,phone:6},textSize:{all:""},bgColor:{r:255,g:255,b:255,a:1},hoverInfo:[h.LIKES_COMMENTS,h.INSTA_LINK],textColorHover:{r:255,g:255,b:255,a:1},bgColorHover:{r:0,g:0,b:0,a:.5},showHeader:{desktop:!0},headerInfo:{desktop:[y.PROFILE_PIC,y.BIO]},headerAccount:null,headerStyle:{desktop:p.NORMAL,phone:p.CENTERED},headerTextSize:{desktop:""},headerPhotoSize:{desktop:50},headerTextColor:{r:0,g:0,b:0,a:1},headerBgColor:{r:255,g:255,b:255,a:1},headerPadding:{desktop:0},customProfilePic:0,customBioText:"",includeStories:!1,storiesInterval:5,showCaptions:{desktop:!1},captionMaxLength:{desktop:0},captionRemoveDots:!1,captionSize:{desktop:0},captionColor:{r:0,g:0,b:0,a:1},showLikes:{desktop:!1},showComments:{desktop:!1},lcIconSize:{desktop:14},likesIconColor:{r:0,g:0,b:0,a:1},commentsIconColor:{r:0,g:0,b:0,a:1},lightboxShowSidebar:!1,numLightboxComments:50,showLoadMoreBtn:{desktop:!0},loadMoreBtnTextColor:{r:255,g:255,b:255,a:1},loadMoreBtnBgColor:{r:0,g:149,b:246,a:1},loadMoreBtnText:"Load more",autoload:!1,showFollowBtn:{desktop:!0},followBtnText:"Follow on Instagram",followBtnTextColor:{r:255,g:255,b:255,a:1},followBtnBgColor:{r:0,g:149,b:246,a:1},followBtnLocation:{desktop:v.HEADER,phone:v.BOTTOM},hashtagWhitelist:[],hashtagBlacklist:[],captionWhitelist:[],captionBlacklist:[],hashtagWhitelistSettings:!0,hashtagBlacklistSettings:!0,captionWhitelistSettings:!0,captionBlacklistSettings:!0,moderation:[],moderationMode:O.BLACKLIST,promotionEnabled:!0,autoPromotionsEnabled:!0,globalPromotionsEnabled:!0,promotions:{}},t.getPromo=S,t.getFeedPromo=_,t.executeMediaClick=function(t,e){const o=S(t,e),n=m.a.getConfig(o),i=m.a.getType(o);return!(!i||!i.isValid(n)||"function"!=typeof i.onMediaClick)&&i.onMediaClick(t,n)},t.getLink=function(t,e){var o,n;const i=S(t,e),a=m.a.getConfig(i),s=m.a.getType(i);if(void 0===s||!s.isValid(a))return{text:null,url:null,newTab:!1};let[r,l]=s.getPopupLink?null!==(o=s.getPopupLink(t,a))&&void 0!==o?o:null:[null,!1];return{text:r,url:s.getMediaUrl&&null!==(n=s.getMediaUrl(t,a))&&void 0!==n?n:null,newTab:l}}}(y||(y={}))},73:function(t,e,o){"use strict";o.d(e,"a",(function(){return h}));var n=o(0),i=o.n(n),a=o(37),s=o.n(a),r=o(98),l=o(3),c=o(58),u=o(11),d=o(15);function h(t){var{media:e,className:o,size:a,onLoadImage:h,width:p,height:m}=t,g=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(o[n[i]]=t[n[i]])}return o}(t,["media","className","size","onLoadImage","width","height"]);const f=i.a.useRef(),b=i.a.useRef(),[y,v]=i.a.useState(!0);function O(){if(f.current){const t=null!=a?a:function(){const t=f.current.getBoundingClientRect();return t.width<=320?l.a.SMALL:(t.width,l.a.MEDIUM)}(),o="object"==typeof e.thumbnails&&d.a.has(e.thumbnails,t)?d.a.get(e.thumbnails,t):e.thumbnail;f.current.src!==o&&(f.current.src=o)}}return Object(n.useLayoutEffect)(()=>{if("VIDEO"!==e.type){let t=new r.a(O);return f.current&&(f.current.onload=()=>{v(!1),h&&h()},f.current.onerror=()=>{f.current.src!==e.thumbnail&&(f.current.src=e.thumbnail),v(!1),h&&h()},O(),t.observe(f.current)),()=>{f.current.onload=()=>null,f.current.onerror=()=>null,t.disconnect()}}b.current&&(b.current.currentTime=1,v(!1),h&&h())},[e,a]),e.url&&e.url.length>0?i.a.createElement("div",Object.assign({className:Object(u.b)(s.a.root,o)},g),"VIDEO"===e.type&&i.a.createElement("video",{ref:b,className:s.a.video,src:e.url,autoPlay:!1,controls:!1,tabIndex:0},i.a.createElement("source",{src:e.url}),"Your browser does not support videos"),"VIDEO"!==e.type&&i.a.createElement("img",Object.assign({ref:f,className:s.a.image,loading:"lazy",alt:e.caption,width:p,height:m},u.e)),y&&i.a.createElement(c.a,null)):i.a.createElement("div",{className:s.a.notAvailable},i.a.createElement("span",null,"Thumbnail not available"))}},74:function(t,e,o){t.exports={root:"MediaLoading__root",animation:"MediaLoading__animation"}},76:function(t,e,o){t.exports={root:"ProfilePic__root",round:"ProfilePic__round ProfilePic__root",square:"ProfilePic__square ProfilePic__root"}},77:function(t,e,o){t.exports={"connect-btn":"AccountsPage__connect-btn",connectBtn:"AccountsPage__connect-btn"}},8:function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));var n,i=o(12),a=o(15),s=o(3);!function(t){function e(t){return t?c(t.type):void 0}function o(t){var o;if("object"!=typeof t)return!1;const n=e(t);return void 0!==n&&n.isValid(null!==(o=t.config)&&void 0!==o?o:{})}function n(e){return e?t.getPromoFromDictionary(e,i.a.config.globalPromotions):void 0}function r(t){const e=l(t);return void 0===e?void 0:e.promotion}function l(e){if(e)for(const o of i.a.config.autoPromotions){const n=t.Automation.getType(o),i=t.Automation.getConfig(o);if(n&&n.matches(e,i))return o}}function c(e){return t.types.find(t=>t.id===e)}let u;t.getConfig=function(t){var e,o;return t&&null!==(o=null!==(e=t.config)&&void 0!==e?e:t.data)&&void 0!==o?o:{}},t.getType=e,t.isValid=o,t.getPromoFromDictionary=function(e,o){const n=a.a.get(o,e.id);if(n)return t.getType(n)?n:void 0},t.getPromo=function(t){return Object(s.m)(o,[()=>n(t),()=>r(t)])},t.getGlobalPromo=n,t.getAutoPromo=r,t.getAutomation=l,t.types=[],t.getTypes=function(){return t.types},t.registerType=function(e){t.types.push(e)},t.getTypeById=c,t.clearTypes=function(){t.types.splice(0,t.types.length)},function(t){t.getType=function(t){return t?o(t.type):void 0},t.getConfig=function(t){var e,o;return t&&null!==(o=null!==(e=t.config)&&void 0!==e?e:t.data)&&void 0!==o?o:{}},t.getPromotion=function(t){return t?t.promotion:void 0};const e=[];function o(t){return e.find(e=>e.id===t)}t.getTypes=function(){return e},t.registerType=function(t){e.push(t)},t.getTypeById=o,t.clearTypes=function(){e.splice(0,e.length)}}(u=t.Automation||(t.Automation={}))}(n||(n={}))},82:function(t,e,o){"use strict";o.d(e,"b",(function(){return r})),o.d(e,"a",(function(){return l})),o.d(e,"c",(function(){return c}));var n=o(7),i=o(19),a=o(3),s=o(15);class r{constructor(t){this.incFilters=!1,this.prevOptions=null,this.media=new Array,this.config=Object(a.h)(t),void 0===this.config.watch&&(this.config.watch={all:!0})}fetchMedia(t,e){if(this.hasCache(t))return Promise.resolve(this.media);const o=Object.assign({},t.options,{moderation:this.isWatchingField("moderation")?t.options.moderation:[],moderationMode:t.options.moderationMode,hashtagBlacklist:this.isWatchingField("hashtagBlacklist")?t.options.hashtagBlacklist:[],hashtagWhitelist:this.isWatchingField("hashtagWhitelist")?t.options.hashtagWhitelist:[],captionBlacklist:this.isWatchingField("captionBlacklist")?t.options.captionBlacklist:[],captionWhitelist:this.isWatchingField("captionWhitelist")?t.options.captionWhitelist:[],hashtagBlacklistSettings:!!this.isWatchingField("hashtagBlacklistSettings")&&t.options.hashtagBlacklistSettings,hashtagWhitelistSettings:!!this.isWatchingField("hashtagWhitelistSettings")&&t.options.hashtagWhitelistSettings,captionBlacklistSettings:!!this.isWatchingField("captionBlacklistSettings")&&t.options.captionBlacklistSettings,captionWhitelistSettings:!!this.isWatchingField("captionWhitelistSettings")&&t.options.captionWhitelistSettings});return e&&e(),i.a.getFeedMedia(o).then(e=>(this.prevOptions=new n.a.Options(t.options),this.media=e.data.media,this.media))}hasCache(t){return null!==this.prevOptions&&!this.isCacheInvalid(t)}isWatchingField(t){var e,o,n;let i=null!==(e=this.config.watch.all)&&void 0!==e&&e;return 1===s.a.size(this.config.watch)&&void 0!==this.config.watch.all?i:(r.FILTER_FIELDS.includes(t)&&(i=null!==(o=s.a.get(this.config.watch,"filters"))&&void 0!==o?o:i),null!==(n=s.a.get(this.config.watch,t))&&void 0!==n?n:i)}isCacheInvalid(t){const e=t.options,o=this.prevOptions;if(Object(a.k)(t.media,this.media,(t,e)=>t.id===e.id).length>0)return!0;if(this.isWatchingField("accounts")&&!Object(a.f)(e.accounts,o.accounts))return!0;if(this.isWatchingField("tagged")&&!Object(a.f)(e.tagged,o.tagged))return!0;if(this.isWatchingField("hashtags")&&!Object(a.f)(e.hashtags,o.hashtags,a.n))return!0;if(this.isWatchingField("moderationMode")&&e.moderationMode!==o.moderationMode)return!0;if(this.isWatchingField("moderation")&&!Object(a.f)(e.moderation,o.moderation))return!0;if(this.isWatchingField("filters")){if(this.isWatchingField("captionWhitelistSettings")&&e.captionWhitelistSettings!==o.captionWhitelistSettings)return!0;if(this.isWatchingField("captionBlacklistSettings")&&e.captionBlacklistSettings!==o.captionBlacklistSettings)return!0;if(this.isWatchingField("hashtagWhitelistSettings")&&e.hashtagWhitelistSettings!==o.hashtagWhitelistSettings)return!0;if(this.isWatchingField("hashtagBlacklistSettings")&&e.hashtagBlacklistSettings!==o.hashtagBlacklistSettings)return!0;if(this.isWatchingField("captionWhitelist")&&!Object(a.f)(e.captionWhitelist,o.captionWhitelist))return!0;if(this.isWatchingField("captionBlacklist")&&!Object(a.f)(e.captionBlacklist,o.captionBlacklist))return!0;if(this.isWatchingField("hashtagWhitelist")&&!Object(a.f)(e.hashtagWhitelist,o.hashtagWhitelist))return!0;if(this.isWatchingField("hashtagBlacklist")&&!Object(a.f)(e.hashtagBlacklist,o.hashtagBlacklist))return!0}return!1}}!function(t){t.FILTER_FIELDS=["hashtagBlacklist","hashtagWhitelist","captionBlacklist","captionWhitelist","hashtagBlacklistSettings","hashtagWhitelistSettings","captionBlacklistSettings","captionWhitelistSettings"]}(r||(r={}));const l=new r({watch:{all:!0,filters:!1}}),c=new r({watch:{all:!0,moderation:!1}})},89:function(t,e,o){"use strict";o.d(e,"a",(function(){return w}));var n=o(0),i=o.n(n),a=o(46),s=o(9),r=o.n(s),l=o(6),c=o(4),u=o(616),d=o(388),h=o(55),p=o(114),m=o(105),g=o(30),f=o(5),b=o(23),y=o(14),v=o(59),O=Object(l.b)((function({account:t,onUpdate:e}){const[o,n]=i.a.useState(!1),[a,s]=i.a.useState(""),[l,O]=i.a.useState(!1),w=t.type===c.a.Type.PERSONAL,E=c.b.getBioText(t),S=()=>{t.customBio=a,O(!0),g.a.updateAccount(t).then(()=>{n(!1),O(!1),e&&e()})},_=o=>{t.customProfilePicUrl=o,O(!0),g.a.updateAccount(t).then(()=>{O(!1),e&&e()})};return i.a.createElement("div",{className:r.a.root},i.a.createElement("div",{className:r.a.container},i.a.createElement("div",{className:r.a.infoColumn},i.a.createElement("a",{href:c.b.getProfileUrl(t),target:"_blank",className:r.a.username},"@",t.username),i.a.createElement("div",{className:r.a.row},i.a.createElement("span",{className:r.a.label},"Spotlight ID:"),t.id),i.a.createElement("div",{className:r.a.row},i.a.createElement("span",{className:r.a.label},"User ID:"),t.userId),i.a.createElement("div",{className:r.a.row},i.a.createElement("span",{className:r.a.label},"Type:"),t.type),!o&&i.a.createElement("div",{className:r.a.row},i.a.createElement("div",null,i.a.createElement("span",{className:r.a.label},"Bio:"),i.a.createElement("a",{className:r.a.editBioLink,onClick:()=>{s(c.b.getBioText(t)),n(!0)}},"Edit bio"),i.a.createElement("pre",{className:r.a.bio},E.length>0?E:"(No bio)"))),o&&i.a.createElement("div",{className:r.a.row},i.a.createElement("textarea",{className:r.a.bioEditor,value:a,onChange:t=>{s(t.target.value)},onKeyDown:t=>{"Enter"===t.key&&t.ctrlKey&&(S(),t.preventDefault(),t.stopPropagation())},rows:4}),i.a.createElement("div",{className:r.a.bioFooter},i.a.createElement("div",{className:r.a.bioEditingControls},l&&i.a.createElement("span",null,"Please wait ...")),i.a.createElement("div",{className:r.a.bioEditingControls},i.a.createElement(f.a,{className:r.a.bioEditingButton,type:f.c.DANGER,disabled:l,onClick:()=>{t.customBio="",O(!0),g.a.updateAccount(t).then(()=>{n(!1),O(!1),e&&e()})}},"Reset"),i.a.createElement(f.a,{className:r.a.bioEditingButton,type:f.c.SECONDARY,disabled:l,onClick:()=>{n(!1)}},"Cancel"),i.a.createElement(f.a,{className:r.a.bioEditingButton,type:f.c.PRIMARY,disabled:l,onClick:S},"Save"))))),i.a.createElement("div",{className:r.a.picColumn},i.a.createElement("div",null,i.a.createElement(v.a,{account:t,className:r.a.profilePic})),i.a.createElement(p.a,{id:"account-custom-profile-pic",title:"Select profile picture",mediaType:"image",onSelect:t=>{const e=parseInt(t.attributes.id),o=m.a.media.attachment(e).attributes.url;_(o)}},({open:t})=>i.a.createElement(f.a,{type:f.c.SECONDARY,className:r.a.setCustomPic,onClick:t},"Change profile picture")),t.customProfilePicUrl.length>0&&i.a.createElement("a",{className:r.a.resetCustomPic,onClick:()=>{_("")}},"Reset profile picture"))),w&&i.a.createElement("div",{className:r.a.personalInfoMessage},i.a.createElement(b.a,{type:b.b.INFO,showIcon:!0},"Due to restrictions set by Instagram, Spotlight cannot import the profile photo and bio"," ","text for Personal accounts."," ",i.a.createElement("a",{href:y.a.resources.customPersonalInfoUrl,target:"_blank"},"Click here to learn more"),".")),i.a.createElement(h.a,{label:"View access token",stealth:!0},i.a.createElement("div",{className:r.a.row},t.accessToken&&i.a.createElement("div",null,i.a.createElement("p",null,i.a.createElement("span",{className:r.a.label},"Expires on:"),i.a.createElement("span",null,t.accessToken.expiry?Object(u.a)(Object(d.a)(t.accessToken.expiry),"PPPP"):"Unknown")),i.a.createElement("pre",{className:r.a.accessToken},t.accessToken.code)))))}));function w({isOpen:t,onClose:e,onUpdate:o,account:n}){return i.a.createElement(a.a,{isOpen:t,title:"Account details",icon:"admin-users",onClose:e},i.a.createElement(a.a.Content,null,i.a.createElement(O,{account:n,onUpdate:o})))}},9:function(t,e,o){t.exports={root:"AccountInfo__root",container:"AccountInfo__container",column:"AccountInfo__column","info-column":"AccountInfo__info-column AccountInfo__column",infoColumn:"AccountInfo__info-column AccountInfo__column","pic-column":"AccountInfo__pic-column AccountInfo__column",picColumn:"AccountInfo__pic-column AccountInfo__column",id:"AccountInfo__id",username:"AccountInfo__username","profile-pic":"AccountInfo__profile-pic",profilePic:"AccountInfo__profile-pic",label:"AccountInfo__label",row:"AccountInfo__row",pre:"AccountInfo__pre",bio:"AccountInfo__bio AccountInfo__pre","link-button":"AccountInfo__link-button",linkButton:"AccountInfo__link-button","edit-bio-link":"AccountInfo__edit-bio-link AccountInfo__link-button",editBioLink:"AccountInfo__edit-bio-link AccountInfo__link-button","bio-editor":"AccountInfo__bio-editor",bioEditor:"AccountInfo__bio-editor","bio-footer":"AccountInfo__bio-footer",bioFooter:"AccountInfo__bio-footer","bio-editing-controls":"AccountInfo__bio-editing-controls",bioEditingControls:"AccountInfo__bio-editing-controls","access-token":"AccountInfo__access-token AccountInfo__pre",accessToken:"AccountInfo__access-token AccountInfo__pre","set-custom-pic":"AccountInfo__set-custom-pic",setCustomPic:"AccountInfo__set-custom-pic","reset-custom-pic":"AccountInfo__reset-custom-pic AccountInfo__link-button",resetCustomPic:"AccountInfo__reset-custom-pic AccountInfo__link-button",subtext:"AccountInfo__subtext","personal-info-message":"AccountInfo__personal-info-message",personalInfoMessage:"AccountInfo__personal-info-message"}},99:function(t,e,o){"use strict";var n=o(82);e.a=new class{constructor(){this.mediaStore=n.a}}}},[[607,0,1,2,3]]])}));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],e):"object"==typeof exports?exports.spotlight=e(require("React"),require("ReactDOM")):t.spotlight=e(t.React,t.ReactDOM)}(window,(function(t,e){return(window.webpackJsonpspotlight=window.webpackJsonpspotlight||[]).push([[8],{0:function(e,o){e.exports=t},10:function(t,e,o){"use strict";o.d(e,"a",(function(){return s}));var n=o(0),i=o.n(n),a=o(11);const s=t=>{var{icon:e,className:o}=t,n=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(o[n[i]]=t[n[i]])}return o}(t,["icon","className"]);return i.a.createElement("span",Object.assign({className:Object(a.b)("dashicons","dashicons-"+e,o)},n))}},101:function(t,e,o){"use strict";var n=o(83);e.a=new class{constructor(){this.mediaStore=n.a}}},11:function(t,e,o){"use strict";function n(...t){return t.filter(t=>!!t).join(" ")}function i(t){return n(...Object.getOwnPropertyNames(t).map(e=>t[e]?e:null))}function a(t,e={}){let o=Object.getOwnPropertyNames(e).map(o=>e[o]?t+o:null);return t+" "+o.filter(t=>!!t).join(" ")}o.d(e,"b",(function(){return n})),o.d(e,"c",(function(){return i})),o.d(e,"a",(function(){return a})),o.d(e,"e",(function(){return s})),o.d(e,"d",(function(){return r}));const s={onMouseDown:t=>t.preventDefault()};function r(...t){return e=>{t.forEach(t=>t&&function(t,e){"function"==typeof t?t(e):t.current=e}(t,e))}}},113:function(t,e,o){"use strict";o.d(e,"a",(function(){return y}));var n=o(0),i=o.n(n),a=o(61),s=o.n(a),r=o(18),l=o(52),c=o.n(l),u=o(38),d=o.n(u),h=o(6),p=o(3),m=o(117),f=Object(h.b)((function({field:t}){const e="settings-field-"+Object(p.u)(),o=!t.label||t.fullWidth;return i.a.createElement("div",{className:d.a.root},t.label&&i.a.createElement("div",{className:d.a.label},i.a.createElement("label",{htmlFor:e},t.label)),i.a.createElement("div",{className:d.a.container},i.a.createElement("div",{className:o?d.a.controlFullWidth:d.a.controlPartialWidth},i.a.createElement(t.component,{id:e})),t.tooltip&&i.a.createElement("div",{className:d.a.tooltip},i.a.createElement(m.a,null,t.tooltip))))}));function g({group:t}){return i.a.createElement("div",{className:c.a.root},t.title&&t.title.length>0&&i.a.createElement("h1",{className:c.a.title},t.title),t.component&&i.a.createElement("div",{className:c.a.content},i.a.createElement(t.component)),t.fields&&i.a.createElement("div",{className:c.a.fieldList},t.fields.map(t=>i.a.createElement(f,{field:t,key:t.id}))))}var b=o(20);function y({page:t}){return Object(b.d)("keydown",t=>{t.key&&"s"===t.key.toLowerCase()&&t.ctrlKey&&(r.b.save(),t.preventDefault(),t.stopPropagation())}),i.a.createElement("article",{className:s.a.root},t.component&&i.a.createElement("div",{className:s.a.content},i.a.createElement(t.component)),t.groups&&i.a.createElement("div",{className:s.a.groupList},t.groups.map(t=>i.a.createElement(g,{key:t.id,group:t}))))}},12:function(t,e,o){"use strict";var n,i=o(8);let a;e.a=a={isPro:!1,config:{restApi:SliCommonL10n.restApi,imagesUrl:SliCommonL10n.imagesUrl,autoPromotions:SliCommonL10n.autoPromotions,globalPromotions:null!==(n=SliCommonL10n.globalPromotions)&&void 0!==n?n:{}},image:t=>`${a.config.imagesUrl}/${t}`},i.a.registerType({id:"link",label:"Link",isValid:()=>!1}),i.a.registerType({id:"-more-",label:"- More promotion types -",isValid:()=>!1}),i.a.Automation.registerType({id:"hashtag",label:"Hashtag",matches:()=>!1})},13:function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));const n=t=>"string"==typeof t?t:"r"in t?"rgba("+t.r+","+t.g+","+t.b+","+t.a+")":"h"in t?"hsla("+t.h+","+t.s+","+t.l+","+t.a+")":"#fff"},132:function(t,e,o){"use strict";o.d(e,"a",(function(){return l}));var n=o(0),i=o.n(n),a=o(99),s=o.n(a),r=o(16);function l({url:t,children:e}){return i.a.createElement("a",{className:s.a.root,href:null!=t?t:r.a.resources.pricingUrl,target:"_blank"},null!=e?e:"Free 14-day PRO trial")}},14:function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));var n,i=o(3);!function(t){function e(t,e){return t.hasOwnProperty(e.toString())}function o(t,e){return t[e.toString()]}function n(t,e,o){return t[e.toString()]=o,t}t.has=e,t.get=o,t.set=n,t.ensure=function(o,i,a){return e(o,i)||n(o,i,a),t.get(o,i)},t.withEntry=function(e,o,n){return t.set(Object(i.h)(e),o,n)},t.remove=function(t,e){return delete t[e.toString()],t},t.without=function(e,o){return t.remove(Object(i.h)(e),o)},t.at=function(t,e){return o(t,Object.keys(t)[e])},t.keys=function(t){return Object.keys(t)},t.values=function(t){return Object.values(t)},t.entries=function(t){return Object.getOwnPropertyNames(t).map(e=>[e,t[e]])},t.map=function(e,o){const n={};return t.forEach(e,(t,e)=>n[t]=o(e,t)),n},t.size=function(e){return t.keys(e).length},t.isEmpty=function(e){return 0===t.size(e)},t.equals=function(t,e){return Object(i.p)(t,e)},t.forEach=function(e,o){t.keys(e).forEach(t=>o(t,e[t]))},t.fromArray=function(e){const o={};return e.forEach(([e,n])=>t.set(o,e,n)),o},t.fromMap=function(e){const o={};return e.forEach((e,n)=>t.set(o,n,e)),o}}(n||(n={}))},141:function(t,e,o){"use strict";function n(t,e){return"url"===e.linkType?e.url:e.postUrl}var i;o.d(e,"a",(function(){return i})),e.b={id:"link",label:"Link",getIcon:()=>"admin-links",getPopupLink:function(t,e){return"string"==typeof e.linkText&&e.linkText.length>0?[e.linkText,e.newTab]:[i.getDefaultLinkText(e),e.newTab]},isValid:function(t){return"string"==typeof t.linkType&&t.linkType.length>0&&("url"===t.linkType&&"string"==typeof t.url&&t.url.length>0||!!t.postId&&"string"==typeof t.postUrl&&t.postUrl.length>0)},getMediaUrl:n,onMediaClick:function(t,e){var o;const i=n(0,e),a=null===(o=e.linkDirectly)||void 0===o||o;return!(!i||!a)&&(window.open(i,e.newTab?"_blank":"_self"),!0)}},function(t){t.getDefaultLinkText=function(t){switch(t.linkType){case"product":return"Buy it now";case"post":return"Read the article";case"page":return"Learn more";default:return"Visit link"}}}(i||(i={}))},15:function(t,e,o){"use strict";var n;o.d(e,"a",(function(){return n})),function(t){let e,o;!function(t){t.IMAGE="IMAGE",t.VIDEO="VIDEO",t.ALBUM="CAROUSEL_ALBUM"}(e=t.Type||(t.Type={})),function(t){let e;!function(t){t.PERSONAL_ACCOUNT="PERSONAL_ACCOUNT",t.BUSINESS_ACCOUNT="BUSINESS_ACCOUNT",t.TAGGED_ACCOUNT="TAGGED_ACCOUNT",t.RECENT_HASHTAG="RECENT_HASHTAG",t.POPULAR_HASHTAG="POPULAR_HASHTAG",t.USER_STORY="USER_STORY"}(e=t.Type||(t.Type={})),t.isOwnMedia=function(t){return t.type===e.PERSONAL_ACCOUNT||t.type===e.BUSINESS_ACCOUNT||t.type===e.USER_STORY}}(o=t.Source||(t.Source={})),t.getAsRows=(t,e)=>{t=t.slice(),e=e>0?e:1;let o=[];for(;t.length;)o.push(t.splice(0,e));if(o.length>0){const t=o.length-1;for(;o[t].length<e;)o[t].push({})}return o},t.isFromHashtag=t=>t.source.type===o.Type.POPULAR_HASHTAG||t.source.type===o.Type.RECENT_HASHTAG}(n||(n={}))},152:function(t,e,o){"use strict";o.d(e,"a",(function(){return s}));var n=o(0),i=o.n(n),a=o(29);function s({breakpoints:t,children:e}){const[o,s]=i.a.useState(null),r=i.a.useCallback(()=>{const e=Object(a.b)();s(()=>t.reduce((t,o)=>e.width<=o&&o<t?o:t,1/0))},[t]);return Object(n.useEffect)(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[]),null!==o&&e(o)}},153:function(t,e,o){"use strict";var n=o(0),i=o.n(n),a=o(102),s=o(19),r=o.n(s),l=o(41),c=o(4),u=o(5),d=o(10),h=o(114),p=o(26),m=o(21),f=o(30),g=o(91),b=o(60),y=o(16),v=o(67);function O({accounts:t,showDelete:e,onDeleteError:o}){const n=(t=null!=t?t:[]).filter(t=>t.type===c.a.Type.BUSINESS).length,[a,s]=i.a.useState(!1),[O,E]=i.a.useState(null),[w,S]=i.a.useState(!1),[_,C]=i.a.useState(),[P,k]=i.a.useState(!1),B=t=>()=>{E(t),s(!0)},T=t=>()=>{f.a.openAuthWindow(t.type,0,()=>{y.a.restApi.deleteAccountMedia(t.id)})},M=t=>()=>{C(t),S(!0)},A=()=>{k(!1),C(null),S(!1)},I={cols:{username:r.a.usernameCol,type:r.a.typeCol,usages:r.a.usagesCol,actions:r.a.actionsCol},cells:{username:r.a.usernameCell,type:r.a.typeCell,usages:r.a.usagesCell,actions:r.a.actionsCell}};return i.a.createElement("div",{className:"accounts-list"},i.a.createElement(h.a,{styleMap:I,rows:t,cols:[{id:"username",label:"Username",render:t=>i.a.createElement("div",null,i.a.createElement(b.a,{account:t,className:r.a.profilePic}),i.a.createElement("a",{className:r.a.username,onClick:B(t)},t.username))},{id:"type",label:"Type",render:t=>i.a.createElement("span",{className:r.a.accountType},t.type)},{id:"usages",label:"Feeds",render:t=>i.a.createElement("span",{className:r.a.usages},t.usages.map((t,e)=>!!p.a.getById(t)&&i.a.createElement(l.a,{key:e,to:m.a.at({screen:"edit",id:t.toString()})},p.a.getById(t).name)))},{id:"actions",label:"Actions",render:t=>e&&i.a.createElement("div",{className:r.a.actionsList},i.a.createElement(u.a,{className:r.a.action,type:u.c.SECONDARY,tooltip:"Account info",onClick:B(t)},i.a.createElement(d.a,{icon:"info"})),i.a.createElement(u.a,{className:r.a.action,type:u.c.SECONDARY,tooltip:"Reconnect account",onClick:T(t)},i.a.createElement(d.a,{icon:"update"})),i.a.createElement(u.a,{className:r.a.actions,type:u.c.DANGER,tooltip:"Remove account",onClick:M(t)},i.a.createElement(d.a,{icon:"trash"})))}]}),i.a.createElement(g.a,{isOpen:a,onClose:()=>s(!1),account:O}),i.a.createElement(v.a,{isOpen:w,title:"Are you sure?",buttons:[P?"Please wait ...":"Yes I'm sure","Cancel"],okDisabled:P,cancelDisabled:P,onAccept:()=>{k(!0),f.a.deleteAccount(_.id).then(()=>A()).catch(()=>{o&&o("An error occurred while trying to remove the account."),A()})},onCancel:A},i.a.createElement("p",null,"Are you sure you want to delete"," ",i.a.createElement("span",{style:{fontWeight:"bold"}},_?_.username:""),"?"," ","This will also delete all saved media associated with this account."),_&&_.type===c.a.Type.BUSINESS&&1===n&&i.a.createElement("p",null,i.a.createElement("b",null,"Note:")," ",i.a.createElement("span",null,"Because this is your only connected Business account, deleting it will"," ","also cause any feeds that show public hashtag posts to no longer work."))))}var E=o(23),w=o(6),S=o(116),_=o(78),C=o.n(_);e.a=Object(w.b)((function(){const[,t]=i.a.useState(0),[e,o]=i.a.useState(""),n=i.a.useCallback(()=>t(t=>t++),[]);return c.b.hasAccounts()?i.a.createElement("div",{className:C.a.root},e.length>0&&i.a.createElement(E.a,{type:E.b.ERROR,showIcon:!0,isDismissible:!0,onDismiss:()=>o("")},e),i.a.createElement("div",{className:C.a.connectBtn},i.a.createElement(a.a,{onConnect:n})),i.a.createElement(O,{accounts:c.b.list,showDelete:!0,onDeleteError:o})):i.a.createElement(S.a,null)}))},17:function(t,e,o){"use strict";var n=o(33),i=o.n(n),a=o(12),s=o(34);const r=a.a.config.restApi.baseUrl,l={};a.a.config.restApi.authToken&&(l["X-Sli-Auth-Token"]=a.a.config.restApi.authToken);const c=i.a.create({baseURL:r,headers:l}),u={config:Object.assign(Object.assign({},a.a.config.restApi),{forceImports:!1}),driver:c,getAccounts:()=>c.get("/accounts"),getFeeds:()=>c.get("/feeds"),getFeedMedia:(t,e=0,o=0,n)=>{const a=n?new i.a.CancelToken(n):void 0;return new Promise((n,i)=>{const s=t=>{n(t),document.dispatchEvent(new Event(u.events.onGetFeedMedia))};c.post("/media/feed",{options:t,num:o,from:e},{cancelToken:a}).then(n=>{n.data.needImport?(e>0||u.config.forceImports)&&u.importMedia(t).then(()=>{c.post("/media/feed",{options:t,num:o,from:e},{cancelToken:a}).then(s).catch(i)}).catch(i):s(n)}).catch(i)})},getMedia:(t=0,e=0)=>c.get(`/media?num=${t}&offset=${e}`),importMedia:t=>new Promise((e,o)=>{document.dispatchEvent(new Event(u.events.onImportStart));const n=t=>{document.dispatchEvent(new Event(u.events.onImportFail)),o(t)};c.post("/media/import",{options:t}).then(t=>{t.data.success?(document.dispatchEvent(new Event(u.events.onImportEnd)),e(t)):n(t)}).catch(n)}),getErrorReason:t=>{let e;return"object"==typeof t.response&&(t=t.response.data),e="string"==typeof t.message?t.message:t.toString(),Object(s.b)(e)},events:{onGetFeedMedia:"sli/api/media/feed",onImportStart:"sli/api/import/start",onImportEnd:"sli/api/import/end",onImportFail:"sli/api/import/fail"}};e.a=u},19:function(t,e,o){t.exports={"username-col":"AccountsList__username-col",usernameCol:"AccountsList__username-col","actions-col":"AccountsList__actions-col",actionsCol:"AccountsList__actions-col","username-cell":"AccountsList__username-cell",usernameCell:"AccountsList__username-cell",username:"AccountsList__username","profile-pic":"AccountsList__profile-pic",profilePic:"AccountsList__profile-pic","account-type":"AccountsList__account-type",accountType:"AccountsList__account-type",usages:"AccountsList__usages","actions-list":"AccountsList__actions-list layout__flex-row",actionsList:"AccountsList__actions-list layout__flex-row",action:"AccountsList__action","usages-cell":"AccountsList__usages-cell",usagesCell:"AccountsList__usages-cell","usages-col":"AccountsList__usages-col",usagesCol:"AccountsList__usages-col","type-cell":"AccountsList__type-cell",typeCell:"AccountsList__type-cell","type-col":"AccountsList__type-col",typeCol:"AccountsList__type-col"}},2:function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));var n,i=o(1),a=function(t,e,o,n){var i,a=arguments.length,s=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var r=t.length-1;r>=0;r--)(i=t[r])&&(s=(a<3?i(s):a>3?i(e,o,s):i(e,o))||s);return a>3&&s&&Object.defineProperty(e,o,s),s};!function(t){class e{constructor(t,e,o){this.prop=t,this.name=e,this.icon=o}}e.DESKTOP=new e("desktop","Desktop","desktop"),e.TABLET=new e("tablet","Tablet","tablet"),e.PHONE=new e("phone","Phone","smartphone"),t.Mode=e,t.MODES=[e.DESKTOP,e.TABLET,e.PHONE];class o{constructor(t,e,o){this.desktop=t,this.tablet=e,this.phone=o}get(t,e){return n(this,t,e)}set(t,e){s(this,e,t)}with(t,e){const n=r(this,e,t);return new o(n.desktop,n.tablet,n.phone)}}function n(t,e,o=!1){if(!t)return;const n=t[e.prop];return o&&null==n?t.desktop:n}function s(t,e,o){return t[o.prop]=e,t}function r(t,e,n){return s(new o(t.desktop,t.tablet,t.phone),e,n)}a([i.n],o.prototype,"desktop",void 0),a([i.n],o.prototype,"tablet",void 0),a([i.n],o.prototype,"phone",void 0),t.Value=o,t.getName=function(t){return t.name},t.getIcon=function(t){return t.icon},t.cycle=function(o){const n=t.MODES.findIndex(t=>t===o);return void 0===n?e.DESKTOP:t.MODES[(n+1)%t.MODES.length]},t.get=n,t.set=s,t.withValue=r,t.normalize=function(t,e){return null==t?e.hasOwnProperty("all")?new o(e.all,e.all,e.all):new o(e.desktop,e.tablet,e.phone):"object"==typeof t&&t.hasOwnProperty("desktop")?new o(t.desktop,t.tablet,t.phone):new o(t,t,t)},t.getModeForWindowSize=function(t){return t.width<=768?e.PHONE:t.width<=935?e.TABLET:e.DESKTOP},t.isValid=function(t){return"object"==typeof t&&t.hasOwnProperty("desktop")}}(n||(n={}))},20:function(t,e,o){"use strict";o.d(e,"i",(function(){return r})),o.d(e,"e",(function(){return l})),o.d(e,"b",(function(){return c})),o.d(e,"c",(function(){return u})),o.d(e,"a",(function(){return d})),o.d(e,"m",(function(){return h})),o.d(e,"g",(function(){return p})),o.d(e,"k",(function(){return m})),o.d(e,"j",(function(){return f})),o.d(e,"d",(function(){return b})),o.d(e,"l",(function(){return y})),o.d(e,"f",(function(){return v})),o.d(e,"h",(function(){return O}));var n=o(0),i=o.n(n),a=o(42),s=o(29);function r(t,e){!function(t,e,o){const n=i.a.useRef(!0);t(()=>{n.current=!0;const t=e(()=>new Promise(t=>{n.current&&t()}));return()=>{n.current=!1,t&&t()}},o)}(n.useEffect,t,e)}function l(t){const[e,o]=i.a.useState(t),n=i.a.useRef(e);return[e,()=>n.current,t=>o(n.current=t)]}function c(t,e,o=[]){function i(n){!t.current||t.current.contains(n.target)||o.some(t=>t&&t.current&&t.current.contains(n.target))||e(n)}Object(n.useEffect)(()=>(document.addEventListener("mousedown",i),document.addEventListener("touchend",i),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("touchend",i)}))}function u(t,e){Object(n.useEffect)(()=>{const o=()=>{0===t.filter(t=>!t.current||document.activeElement===t.current||t.current.contains(document.activeElement)).length&&e()};return document.addEventListener("keyup",o),()=>document.removeEventListener("keyup",o)},t)}function d(t,e,o=100){const[a,s]=i.a.useState(t);return Object(n.useEffect)(()=>{let n=null;return t===e?n=setTimeout(()=>s(e),o):s(!e),()=>{null!==n&&clearTimeout(n)}},[t]),[a,s]}function h(t){const[e,o]=i.a.useState(Object(s.b)()),a=()=>{const e=Object(s.b)();o(e),t&&t(e)};return Object(n.useEffect)(()=>(a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)),[]),e}function p(){return new URLSearchParams(Object(a.e)().search)}function m(t,e){const o=o=>{if(e)return(o||window.event).returnValue=t,t};Object(n.useEffect)(()=>(window.addEventListener("beforeunload",o),()=>window.removeEventListener("beforeunload",o)),[e])}function f(t,e){const o=i.a.useRef(!1);return Object(n.useEffect)(()=>{o.current&&void 0!==t.current&&(t.current.scrollIntoView(Object.assign({behavior:"smooth",block:"start"},null!=e?e:{})),o.current=!1)},[o.current]),()=>o.current=!0}function g(t,e,o,i=[],a=[]){Object(n.useEffect)(()=>(i.reduce((t,e)=>t&&e,!0)&&t.addEventListener(e,o),()=>t.removeEventListener(e,o)),a)}function b(t,e,o=[],n=[]){g(document,t,e,o,n)}function y(t,e,o=[],n=[]){g(window,t,e,o,n)}function v(t){return e=>{" "!==e.key&&"Enter"!==e.key||(t(),e.preventDefault(),e.stopPropagation())}}function O(t){const[e,o]=i.a.useState(t);return[function(t){const e=i.a.useRef(t);return e.current=t,e}(e),o]}o(34)},21:function(t,e,o){"use strict";o.d(e,"a",(function(){return l}));var n=o(1),i=o(50),a=o(3),s=function(t,e,o,n){var i,a=arguments.length,s=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var r=t.length-1;r>=0;r--)(i=t[r])&&(s=(a<3?i(s):a>3?i(e,o,s):i(e,o))||s);return a>3&&s&&Object.defineProperty(e,o,s),s};class r{constructor(){const t=window.location;this._pathName=t.pathname,this._baseUrl=t.protocol+"//"+t.host,this.parsed=Object(i.parse)(t.search),this.unListen=null,this.listeners=[],Object(n.o)(()=>this._path,t=>this.path=t)}createPath(t){return this._pathName+"?"+Object(i.stringify)(t)}get _path(){return this.createPath(this.parsed)}get(t,e=!0){return Object(a.l)(this.parsed[t])}at(t){return this.createPath(Object.assign({page:this.parsed.page},this.processQuery(t)))}fullUrl(t){return this._baseUrl+this.createPath(Object.assign({page:this.parsed.page},this.processQuery(t)))}with(t){return this.createPath(Object.assign(Object.assign({},this.parsed),this.processQuery(t)))}without(t){const e=Object.assign({},this.parsed);return delete e[t],this.createPath(e)}goto(t,e=!1){this.history.push(e?this.with(t):this.at(t),{})}useHistory(t){return this.unListen&&this.unListen(),this.history=t,this.unListen=this.history.listen(t=>{this.parsed=Object(i.parse)(t.search),this.listeners.forEach(t=>t())}),this}listen(t){this.listeners.push(t)}unlisten(t){this.listeners=this.listeners.filter(e=>e===t)}processQuery(t){const e=Object.assign({},t);return Object.getOwnPropertyNames(t).forEach(o=>{t[o]&&0===t[o].length?delete e[o]:e[o]=t[o]}),e}}s([n.n],r.prototype,"path",void 0),s([n.n],r.prototype,"parsed",void 0),s([n.h],r.prototype,"_path",null);const l=new r},27:function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));class n{static getById(t){const e=n.list.find(e=>e.id===t);return!e&&n.list.length>0?n.list[0]:e}static getName(t){const e=n.getById(t);return e?e.name:"(Missing layout)"}static addLayout(t){n.list.push(t)}}n.list=[]},29:function(t,e,o){"use strict";function n(t,e,o={}){return window.open(t,e,function(t={}){return Object.getOwnPropertyNames(t).map(e=>`${e}=${t[e]}`).join(",")}(o))}function i(t,e){return{top:window.top.outerHeight/2+window.top.screenY-e/2,left:window.top.outerWidth/2+window.top.screenX-t/2,width:t,height:e}}function a(){const{innerWidth:t,innerHeight:e}=window;return{width:t,height:e}}o.d(e,"c",(function(){return n})),o.d(e,"a",(function(){return i})),o.d(e,"b",(function(){return a}))},3:function(t,e,o){"use strict";o.d(e,"u",(function(){return u})),o.d(e,"h",(function(){return d})),o.d(e,"b",(function(){return h})),o.d(e,"v",(function(){return p})),o.d(e,"c",(function(){return m})),o.d(e,"e",(function(){return f})),o.d(e,"p",(function(){return g})),o.d(e,"o",(function(){return b})),o.d(e,"k",(function(){return y})),o.d(e,"f",(function(){return v})),o.d(e,"n",(function(){return O})),o.d(e,"q",(function(){return E})),o.d(e,"a",(function(){return w})),o.d(e,"t",(function(){return S})),o.d(e,"s",(function(){return _})),o.d(e,"r",(function(){return C})),o.d(e,"i",(function(){return P})),o.d(e,"j",(function(){return k})),o.d(e,"m",(function(){return B})),o.d(e,"g",(function(){return T})),o.d(e,"d",(function(){return M})),o.d(e,"l",(function(){return A}));var n=o(0),i=o.n(n),a=o(140),s=o(149),r=o(15),l=o(48);let c=0;function u(){return c++}function d(t){const e={};return Object.keys(t).forEach(o=>{const n=t[o];Array.isArray(n)?e[o]=n.slice():n instanceof Map?e[o]=new Map(n.entries()):e[o]="object"==typeof n?d(n):n}),e}function h(t,e){return Object.keys(e).forEach(o=>{t[o]=e[o]}),t}function p(t,e){return h(d(t),e)}function m(t,e){return Array.isArray(t)&&Array.isArray(e)?f(t,e):t instanceof Map&&e instanceof Map?f(Array.from(t.entries()),Array.from(e.entries())):"object"==typeof t&&"object"==typeof e?g(t,e):t===e}function f(t,e,o){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;++n)if(o){if(!o(t[n],e[n]))return!1}else if(!m(t[n],e[n]))return!1;return!0}function g(t,e){if(!t||!e||"object"!=typeof t||"object"!=typeof e)return m(t,e);const o=Object.keys(t),n=Object.keys(e);if(o.length!==n.length)return!1;const i=new Set(o.concat(n));for(const o of i)if(!m(t[o],e[o]))return!1;return!0}function b(t){return 0===Object.keys(null!=t?t:{}).length}function y(t,e,o){return o=null!=o?o:(t,e)=>t===e,t.filter(t=>!e.some(e=>o(t,e)))}function v(t,e,o){return o=null!=o?o:(t,e)=>t===e,t.every(t=>e.some(e=>o(t,e)))&&e.every(e=>t.some(t=>o(e,t)))}function O(t,e){return 0===t.tag.localeCompare(e.tag)&&t.sort===e.sort}function E(t,e,o=0,a=!1){let s=t.trim();a&&(s=s.replace(/((?:^[.*•]+(\r\n|\r|\n))+)/gm,"\n"));const r=s.split("\n"),l=r.map((t,o)=>{if(t=t.trim(),a&&/^[.*•]$/.test(t))return null;let s,l=[];for(;null!==(s=/#([^\s]+)/g.exec(t));){const e="https://instagram.com/explore/tags/"+s[1],o=i.a.createElement("a",{href:e,target:"_blank",key:u()},s[0]),n=t.substr(0,s.index),a=t.substr(s.index+s[0].length);l.push(n),l.push(o),t=a}return t.length&&l.push(t),e&&(l=e(l,o)),r.length>1&&l.push(i.a.createElement("br",{key:u()})),i.a.createElement(n.Fragment,{key:u()},l)});return o>0?l.slice(0,o):l}var w;function S(t,e){const o=/(\s+)/g;let n,i=0,a=0,s="";for(;null!==(n=o.exec(t))&&i<e;){const e=n.index+n[1].length;s+=t.substr(a,e-a),a=e,i++}return a<t.length&&(s+=" ..."),s}function _(t){return Object(a.a)(Object(s.a)(t),{addSuffix:!0})}function C(t,e){const o=[];return t.forEach((t,n)=>{const i=n%e;Array.isArray(o[i])?o[i].push(t):o[i]=[t]}),o}function P(t,e){return function t(e){if(e.type===r.a.Type.VIDEO){const t=document.createElement("video");return t.autoplay=!1,t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.visibility="hidden",document.body.appendChild(t),new Promise(o=>{t.src=e.url,t.addEventListener("loadeddata",()=>{o({width:t.videoWidth,height:t.videoHeight}),document.body.removeChild(t)})})}if(e.type===r.a.Type.IMAGE){const t=new Image;return t.src=e.url,new Promise(e=>{t.onload=()=>{e({width:t.naturalWidth,height:t.naturalHeight})}})}return e.type===r.a.Type.ALBUM?t(e.children[0]):Promise.reject("Unknown media type")}(t).then(t=>function(t,e){const o=t.width>t.height?e.width/t.width:e.height/t.height;return{width:t.width*o,height:t.height*o}}(t,e))}function k(t,e){const o=e.map(l.b).join("|");return new RegExp(`(?:^|\\B)#(${o})(?:\\b|\\r|$)`,"imu").test(t)}function B(t,e){for(const o of e){const e=o();if(t(e))return e}}function T(t,e){return Math.max(0,Math.min(e.length-1,t))}function M(t,e,o){const n=t.slice();return n[e]=o,n}function A(t){return Array.isArray(t)?t[0]:t}!function(t){t.SMALL="s",t.MEDIUM="m",t.LARGE="l"}(w||(w={}))},32:function(t,o){t.exports=e},34:function(t,e,o){"use strict";function n(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function i(t){const e=document.createElement("DIV");return e.innerHTML=t,e.textContent||e.innerText||""}o.d(e,"a",(function(){return n})),o.d(e,"b",(function(){return i}))},35:function(t,e,o){"use strict";o.d(e,"a",(function(){return c})),o.d(e,"b",(function(){return d}));var n=o(0),i=o.n(n),a=o(32),s=o.n(a),r=o(6);class l{constructor(t=new Map,e=[]){this.factories=t,this.extensions=new Map,this.cache=new Map,e.forEach(t=>this.addModule(t))}addModule(t){t.factories&&(this.factories=new Map([...this.factories,...t.factories])),t.extensions&&t.extensions.forEach((t,e)=>{this.extensions.has(e)?this.extensions.get(e).push(t):this.extensions.set(e,[t])})}get(t){let e=this.factories.get(t);if(void 0===e)throw new Error('Service "'+t+'" does not exist');let o=this.cache.get(t);if(void 0===o){o=e(this);let n=this.extensions.get(t);n&&n.forEach(t=>o=t(this,o)),this.cache.set(t,o)}return o}has(t){return this.factories.has(t)}}class c{constructor(t,e,o){this.key=t,this.mount=e,this.modules=o,this.container=null}addModules(t){this.modules=this.modules.concat(t)}run(){if(null!==this.container)return;let t=!1;const e=()=>{t||"interactive"!==document.readyState&&"complete"!==document.readyState||(this.actualRun(),t=!0)};e(),t||document.addEventListener("readystatechange",e)}actualRun(){!function(t){const e=`app/${t.key}/run`;document.dispatchEvent(new u(e,t))}(this);const t=d({root:()=>null,"root/children":()=>[]});this.container=new l(t,this.modules);const e=this.container.get("root/children").map((t,e)=>i.a.createElement(t,{key:e})),o=i.a.createElement(r.a,{c:this.container},e);this.modules.forEach(t=>t.run&&t.run(this.container)),s.a.render(o,this.mount)}}class u extends CustomEvent{constructor(t,e){super(t,{detail:{app:e}})}}function d(t){return new Map(Object.entries(t))}},37:function(t,e,o){t.exports={root:"MediaThumbnail__root","media-background-fade-in-animation":"MediaThumbnail__media-background-fade-in-animation",mediaBackgroundFadeInAnimation:"MediaThumbnail__media-background-fade-in-animation","media-object-fade-in-animation":"MediaThumbnail__media-object-fade-in-animation",mediaObjectFadeInAnimation:"MediaThumbnail__media-object-fade-in-animation",image:"MediaThumbnail__image","not-available":"MediaThumbnail__not-available",notAvailable:"MediaThumbnail__not-available"}},38:function(t,e,o){t.exports={root:"SettingsField__root layout__flex-column",label:"SettingsField__label layout__flex-column",container:"SettingsField__container layout__flex-row",control:"SettingsField__control layout__flex-column","control-partial-width":"SettingsField__control-partial-width SettingsField__control layout__flex-column",controlPartialWidth:"SettingsField__control-partial-width SettingsField__control layout__flex-column","control-full-width":"SettingsField__control-full-width SettingsField__control layout__flex-column",controlFullWidth:"SettingsField__control-full-width SettingsField__control layout__flex-column",tooltip:"SettingsField__tooltip layout__flex-column"}},39:function(t,e,o){"use strict";function n(t){return e=>(e.stopPropagation(),t(e))}function i(t,e){let o;return(...n)=>{clearTimeout(o),o=setTimeout(()=>{o=null,t(...n)},e)}}function a(){}o.d(e,"c",(function(){return n})),o.d(e,"a",(function(){return i})),o.d(e,"b",(function(){return a}))},4:function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));var n,i=o(17),a=o(1);!function(t){let e;!function(t){t.PERSONAL="PERSONAL",t.BUSINESS="BUSINESS"}(e=t.Type||(t.Type={}))}(n||(n={}));const s=Object(a.n)([]),r="https://secure.gravatar.com/avatar/4a94d759753ade2961582f7345c1d7b2?s=64&d=mm&r=g",l=t=>s.find(e=>e.id===t),c=t=>"https://instagram.com/"+t;function u(t){return t.slice().sort((t,e)=>t.type===e.type?0:t.type===n.Type.PERSONAL?-1:1),s.splice(0,s.length),t.forEach(t=>s.push(Object(a.n)(t))),s}function d(t){if("object"==typeof t&&Array.isArray(t.data))return u(t.data);throw"Spotlight encountered a problem trying to load your accounts. Kindly contact customer support for assistance."}e.b={list:s,DEFAULT_PROFILE_PIC:r,getById:l,getByUsername:t=>s.find(e=>e.username===t),hasAccounts:()=>s.length>0,filterExisting:t=>t.filter(t=>void 0!==l(t)),idsToAccounts:t=>t.map(t=>l(t)).filter(t=>void 0!==t),getBusinessAccounts:()=>s.filter(t=>t.type===n.Type.BUSINESS),getProfilePicUrl:t=>t.customProfilePicUrl?t.customProfilePicUrl:t.profilePicUrl?t.profilePicUrl:r,getBioText:t=>t.customBio.length?t.customBio:t.bio,getProfileUrl:t=>c(t.username),getUsernameUrl:c,loadAccounts:function(){return i.a.getAccounts().then(d).catch(t=>{throw i.a.getErrorReason(t)})},loadFromResponse:d,addAccounts:u}},48:function(t,e,o){"use strict";o.d(e,"a",(function(){return n})),o.d(e,"b",(function(){return i}));const n=(t,e)=>t.startsWith(e)?t:e+t,i=t=>{return(e=t,"#",e.startsWith("#")?e.substr("#".length):e).split(/\s/).map((t,e)=>e>0?t[0].toUpperCase()+t.substr(1):t).join("").replace(/\W/gi,"");var e}},52:function(t,e,o){t.exports={root:"SettingsGroup__root layout__flex-column",title:"SettingsGroup__title",content:"SettingsGroup__content","field-list":"SettingsGroup__field-list layout__flex-column",fieldList:"SettingsGroup__field-list layout__flex-column"}},59:function(t,e,o){"use strict";o.d(e,"a",(function(){return r}));var n=o(0),i=o.n(n),a=o(74),s=o.n(a);function r(){return i.a.createElement("div",{className:s.a.root})}},60:function(t,e,o){"use strict";var n=o(0),i=o.n(n),a=o(77),s=o.n(a),r=o(4),l=o(11),c=o(6);e.a=Object(c.b)((function(t){var{account:e,square:o,className:n}=t,a=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(o[n[i]]=t[n[i]])}return o}(t,["account","square","className"]);const c=r.b.getProfilePicUrl(e),u=Object(l.b)(o?s.a.square:s.a.round,n);return i.a.createElement("img",Object.assign({},a,{className:u,src:r.b.DEFAULT_PROFILE_PIC,srcSet:c+" 1x",alt:e.username+" profile picture"}))}))},61:function(t,e,o){t.exports={root:"SettingsPage__root layout__flex-column",content:"SettingsPage__content","group-list":"SettingsPage__group-list layout__flex-column",groupList:"SettingsPage__group-list layout__flex-column"}},612:function(t,e,o){"use strict";o.r(e);var n=o(0),i=o.n(n),a=o(97),s=o(7),r=o(51),l=o(186),c=o(235),u=o(236),d=o(22),h=o(65),p=o(57),m=o(82),f=o(62),g=o(237),b=o(133),y=o(128),v=o(18),O=o(134),E=o(127),w=o(243),S=o(244),_=s.a.LinkBehavior;a.a.tabs=a.a.tabs.filter(t=>!t.isFakePro),a.a.openGroups.push("caption-filters","hashtag-filters");const C=a.a.tabs.find(t=>"connect"===t.id);C.groups=C.groups.filter(t=>!t.isFakePro),C.groups.push({id:"tagged",label:"Show posts where these accounts are tagged",fields:[{id:"tagged",component:Object(r.a)(({value:t,onChange:e})=>i.a.createElement(c.a,{value:t.tagged,onChange:t=>e({tagged:t})}),["accounts","tagged"])}]},{id:"hashtags",label:"Show posts with these hashtags",fields:[{id:"hashtags",component:Object(r.a)(({value:t,onChange:e})=>i.a.createElement(u.a,{value:t.hashtags,onChange:t=>e({hashtags:t})}),["accounts","hashtags"])}]});const P=a.a.tabs.find(t=>"design"===t.id);{P.groups=P.groups.filter(t=>!t.isFakePro),P.groups.find(t=>"layouts"===t.id).fields.push({id:"highlight-freq",component:Object(d.a)({label:"Highlight every",option:"highlightFreq",deps:["layout"],when:t=>"highlight"===t.value.layout,render:(t,e,o)=>i.a.createElement(h.a,{id:t.field.id,value:e,onChange:o,min:1,unit:"posts",placeholder:"1"})})});const t=P.groups.find(t=>"feed"===t.id);t.fields=t.fields.filter(t=>!t.isFakePro),t.fields.splice(3,0,{id:"media-type",component:Object(d.a)({label:"Types of posts",option:"mediaType",render:(t,e,o)=>i.a.createElement(p.a,{id:t.field.id,value:e,onChange:t=>o(t.value),options:[{value:s.a.MediaType.ALL,label:"All posts"},{value:s.a.MediaType.PHOTOS,label:"Photos Only"},{value:s.a.MediaType.VIDEOS,label:"Videos Only"}]})})});const e=P.groups.find(t=>"appearance"===t.id);{e.fields=e.fields.filter(t=>!t.isFakePro),e.fields.push({id:"hover-text-color",component:Object(d.a)({label:"Hover text color",option:"textColorHover",render:(t,e,o)=>i.a.createElement(m.a,{id:t.field.id,value:e,onChange:t=>o(t.rgb)})})},{id:"hover-bg-color",component:Object(d.a)({label:"Hover background color",option:"bgColorHover",render:(t,e,o)=>i.a.createElement(m.a,{id:t.field.id,value:e,onChange:t=>o(t.rgb)})})});const t=e.fields.find(t=>"hover-info"===t.id);t&&(t.data.options=t.data.options.filter(t=>!t.isFakePro),t.data.options.push({value:s.a.HoverInfo.CAPTION,label:"Caption"},{value:s.a.HoverInfo.USERNAME,label:"Username"},{value:s.a.HoverInfo.DATE,label:"Date"}))}const o=P.groups.find(t=>"header"===t.id);{o.fields=o.fields.filter(t=>!t.isFakePro),o.fields.splice(2,0,{id:"header-style",component:Object(d.a)({label:"Header style",option:"headerStyle",deps:["showHeader"],disabled:t=>Object(l.b)(t),render:(t,e,o)=>i.a.createElement(p.a,{id:t.field.id,value:e,onChange:t=>o(t.value),options:[{value:s.a.HeaderStyle.NORMAL,label:"Normal"},{value:s.a.HeaderStyle.CENTERED,label:"Centered"}]})})}),o.fields.push({id:"include-stories",component:Object(d.a)({label:"Include stories",option:"includeStories",deps:["showHeader"],disabled:t=>Object(l.b)(t),render:(t,e,o)=>i.a.createElement(f.a,{id:t.field.id,value:e,onChange:o}),tooltip:()=>i.a.createElement("span",null,"Re-shared stories are not available due to a restriction by Instagram.")})},{id:"stories-interval",component:Object(d.a)({label:"Stories interval time",option:"storiesInterval",deps:["includeStories","showHeader"],disabled:t=>function(t){return Object(l.b)(t)||!t.value.includeStories}(t),render:(t,e,o)=>i.a.createElement(h.a,{id:t.field.id,value:e,onChange:o,min:1,unit:"sec"})})});const t=o.fields.find(t=>"header-info"===t.id);t&&(t.data.options=t.data.options.filter(t=>!t.isFakePro),t.data.options.push({value:s.a.HeaderInfo.MEDIA_COUNT,label:"Post count"},{value:s.a.HeaderInfo.FOLLOWERS,label:"Follower count"}))}const n={id:"lightbox",label:"Popup box",fields:[{id:"show-lightbox-sidebar",component:Object(d.a)({label:"Show sidebar",option:"lightboxShowSidebar",deps:["linkBehavior"],disabled:({computed:t})=>t.linkBehavior!==_.LIGHTBOX,render:(t,e,o)=>i.a.createElement(f.a,{id:t.field.id,value:e,onChange:o})})},{id:"num-lightbox-comments",label:"Number of comments",component:Object(d.a)({label:"Number of comments",option:"numLightboxComments",deps:["lightboxShowSidebar","linkBehavior"],disabled:({computed:t,value:e})=>t.linkBehavior!==_.LIGHTBOX||!e.lightboxShowSidebar,render:(t,e,o)=>i.a.createElement(h.a,{id:t.field.id,value:e,onChange:o,min:0,placeholder:"No comments"}),tooltip:()=>i.a.createElement("span",null,"Comments are only available for posts from a ",i.a.createElement("strong",null,"Business")," account")})}]},a={id:"captions",label:"Captions",fields:[{id:"show-captions",component:Object(d.a)({label:"Show captions",option:"showCaptions",render:(t,e,o)=>i.a.createElement(f.a,{id:t.field.id,value:e,onChange:o})})},{id:"caption-max-length",component:Object(d.a)({label:"Caption max length",option:"captionMaxLength",deps:["showCaptions"],disabled:t=>A(t),render:(t,e,o)=>i.a.createElement(h.a,{id:t.field.id,value:e,onChange:o,min:0,unit:"words",placeholder:"No limit"})})},{id:"caption-size",component:Object(d.a)({label:"Caption text size",option:"captionSize",deps:["showCaptions"],disabled:t=>A(t),render:(t,e,o)=>i.a.createElement(h.a,{id:t.field.id,value:e,onChange:o,min:0,unit:"px",placeholder:"Theme default"})})},{id:"caption-color",component:Object(d.a)({label:"Caption text color",option:"captionColor",deps:["showCaptions"],disabled:t=>A(t),render:(t,e,o)=>i.a.createElement(m.a,{id:t.field.id,value:e,onChange:t=>o(t.rgb)})})},{id:"caption-remove-dots",component:Object(d.a)({label:"Remove dot lines",option:"captionRemoveDots",deps:["showCaptions"],disabled:t=>A(t),render:(t,e,o)=>i.a.createElement(f.a,{id:t.field.id,value:e,onChange:o}),tooltip:()=>i.a.createElement("span",null,'Enable this option to remove lines in captions that are only "dots", such as'," ",i.a.createElement("code",null,"."),", ",i.a.createElement("code",null,"•"),", ",i.a.createElement("code",null,"*"),", etc.")})}]},r={id:"likes-comments",label:"Likes & Comments",fields:[{id:"show-likes",component:Object(d.a)({label:"Show likes icon",option:"showLikes",render:(t,e,o)=>i.a.createElement(f.a,{id:t.field.id,value:e,onChange:o}),tooltip:()=>i.a.createElement("span",null,"Likes are not available for Personal accounts, due to restrictions set by Instagram.")})},{id:"likes-icon-color",component:Object(d.a)({label:"Likes icon color",option:"likesIconColor",deps:["showLikes"],disabled:t=>!t.computed.showLikes,render:(t,e,o)=>i.a.createElement(m.a,{id:t.field.id,value:e,onChange:t=>o(t.rgb)})})},{id:"show-comments",component:Object(d.a)({label:"Show comments icon",option:"showComments",render:(t,e,o)=>i.a.createElement(f.a,{id:t.field.id,value:e,onChange:o}),tooltip:()=>i.a.createElement("span",null,"Comments are not available for Personal accounts, due to restrictions set by Instagram.")})},{id:"comments-icon-color",component:Object(d.a)({label:"Comments icon color",option:"commentsIconColor",deps:["showComments"],disabled:t=>!t.computed.showComments,render:(t,e,o)=>i.a.createElement(m.a,{id:t.field.id,value:e,onChange:t=>o(t.rgb)})})},{id:"lcIconSize",component:Object(d.a)({label:"Icon size",option:"lcIconSize",deps:["showLikes","showComments"],disabled:t=>!t.computed.showLikes&&!t.computed.showComments,render:(t,e,o)=>i.a.createElement(h.a,{id:t.field.id,value:e,onChange:o,min:0,unit:"px"})})}]};P.groups.splice(4,0,n,a,r)}const k={id:"filters",label:"Filter",sidebar:g.a,groups:[{id:"caption-filters",label:"Caption filtering",fields:[{id:"caption-whitelist",component:Object(r.a)(({value:t,onChange:e,field:o})=>i.a.createElement(b.a,{label:"Only show posts with these words or phrases"},i.a.createElement(y.a,{id:o.id,value:t.captionWhitelist,onChange:t=>e({captionWhitelist:t}),exclude:v.b.values.captionBlacklist.concat(t.captionBlacklist),excludeMsg:"%s is already being used in the below option or your global filters"})),["captionWhitelist"])},{id:"caption-whitelist-settings",component:Object(r.a)(({value:t,onChange:e,feed:o})=>i.a.createElement(O.a,{value:t.captionWhitelistSettings,onChange:t=>e({captionWhitelistSettings:t}),feed:o}),["captionWhitelistSettings"])},{id:"caption-blacklist",component:Object(r.a)(({value:t,onChange:e,field:o})=>i.a.createElement(b.a,{label:"Hide posts with these words or phrases",bordered:!0},i.a.createElement(y.a,{id:o.id,value:t.captionBlacklist,onChange:t=>e({captionBlacklist:t}),exclude:v.b.values.captionWhitelist.concat(t.captionWhitelist),excludeMsg:"%s is already being used in the above option or your global filters"})),["captionBlacklist"])},{id:"caption-blacklist-settings",component:Object(r.a)(({value:t,onChange:e,feed:o})=>i.a.createElement(O.a,{value:t.captionBlacklistSettings,onChange:t=>e({captionBlacklistSettings:t}),feed:o}),["captionBlacklistSettings"])}]},{id:"hashtag-filters",label:"Hashtag filtering",fields:[{id:"hashtag-whitelist",component:Object(r.a)(({value:t,onChange:e,field:o})=>i.a.createElement(b.a,{label:"Only show posts with these hashtags"},i.a.createElement(E.a,{id:o.id,value:t.hashtagWhitelist,onChange:t=>e({hashtagWhitelist:t}),exclude:v.b.values.hashtagBlacklist.concat(t.hashtagBlacklist),excludeMsg:"The %s hashtag is already being used in the below option or your global filters"})),["hashtagWhitelist"])},{id:"hashtag-whitelist-settings",component:Object(r.a)(({value:t,onChange:e,feed:o})=>i.a.createElement(O.a,{value:t.hashtagWhitelistSettings,onChange:t=>e({hashtagWhitelistSettings:t}),feed:o}),["hashtagWhitelistSettings"])},{id:"hashtag-blacklist",component:Object(r.a)(({value:t,onChange:e,field:o})=>i.a.createElement(b.a,{label:"Hide posts with these hashtags",bordered:!0},i.a.createElement(E.a,{id:o.id,value:t.hashtagBlacklist,onChange:t=>e({hashtagBlacklist:t}),exclude:v.b.values.hashtagWhitelist.concat(t.hashtagWhitelist),excludeMsg:"The %s hashtag is already being used by the above option or your global filters"})),["hashtagBlacklist"])},{id:"hashtag-blacklist-settings",component:Object(r.a)(({value:t,onChange:e,feed:o})=>i.a.createElement(O.a,{value:t.hashtagBlacklistSettings,onChange:t=>e({hashtagBlacklistSettings:t}),feed:o}),["hashtagBlacklistSettings"])}]}]},B={id:"moderate",label:"Moderate",component:w.a},T={id:"promote",label:"Promote",component:S.a},M=a.a.tabs.findIndex(t=>"embed"===t.id);function A(t){return!t.computed.showCaptions}M<0?a.a.tabs.push(k,B,T):a.a.tabs.splice(M,0,k,B,T)},7:function(t,e,o){"use strict";o.d(e,"a",(function(){return y}));var n=o(33),i=o.n(n),a=o(1),s=o(2),r=o(27),l=o(35),c=o(4),u=o(3),d=o(13),h=o(17),p=o(39),m=o(8),f=o(14),g=o(12),b=function(t,e,o,n){var i,a=arguments.length,s=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var r=t.length-1;r>=0;r--)(i=t[r])&&(s=(a<3?i(s):a>3?i(e,o,s):i(e,o))||s);return a>3&&s&&Object.defineProperty(e,o,s),s};class y{constructor(t=new y.Options,e=s.a.Mode.DESKTOP){this.media=[],this.canLoadMore=!1,this.stories=[],this.numLoadedMore=0,this.totalMedia=0,this.mode=s.a.Mode.DESKTOP,this.isLoaded=!1,this.isLoading=!1,this.isLoadingMore=!1,this.numMediaToShow=0,this.numMediaPerPage=0,this.cancelFetch=()=>{},this.options=new y.Options(t),this.localMedia=a.n.array([]),this.mode=e,this.mediaCounter=this._numMediaPerPage,this.reload=Object(p.a)(()=>this.load(),300),Object(a.o)(()=>this.mode,()=>{0===this.numLoadedMore&&(this.mediaCounter=this._numMediaPerPage,this.localMedia.length<this.numMediaToShow&&this.loadMedia(this.localMedia.length,this.numMediaToShow-this.localMedia.length))}),Object(a.o)(()=>this.getReloadOptions(),()=>this.reload()),Object(a.o)(()=>({num:this._numMediaPerPage,mode:this.mode}),({num:t})=>{this.localMedia.length<t&&t<=this.totalMedia?this.reload():this.mediaCounter=Math.max(1,t)}),Object(a.o)(()=>this._media,t=>this.media=t),Object(a.o)(()=>this._numMediaToShow,t=>this.numMediaToShow=t),Object(a.o)(()=>this._numMediaPerPage,t=>this.numMediaPerPage=t),Object(a.o)(()=>this._canLoadMore,t=>this.canLoadMore=t)}get _media(){return this.localMedia.slice(0,this.numMediaToShow)}get _numMediaToShow(){return Math.min(this.mediaCounter,this.totalMedia)}get _numMediaPerPage(){return Math.max(1,y.ComputedOptions.normalizeMultiInt(this.options.numPosts,this.mode,1))}get _canLoadMore(){return this.localMedia.length>this.mediaCounter||this.localMedia.length<this.totalMedia}loadMore(){const t=this.numMediaToShow+this._numMediaPerPage-this.localMedia.length;return this.isLoadingMore=!0,t>0?this.loadMedia(this.localMedia.length,this._numMediaPerPage).then(()=>{this.mediaCounter+=this._numMediaPerPage,this.numLoadedMore++,this.isLoadingMore=!1}):new Promise(t=>{this.numLoadedMore++,this.mediaCounter+=this._numMediaPerPage,this.isLoadingMore=!1,t()})}load(){return this.numLoadedMore=0,this.loadMedia(0,this._numMediaPerPage,!0).then(()=>(this.isLoaded=!0,this.mediaCounter=this._numMediaPerPage))}loadMedia(t,e,o){return this.cancelFetch(),y.Options.hasSources(this.options)?(this.isLoading=!0,new Promise((n,a)=>{h.a.getFeedMedia(this.options,t,e,t=>this.cancelFetch=t).then(t=>{var e;if("object"!=typeof t||"object"!=typeof t.data||!Array.isArray(t.data.media))throw{message:"The media response is malformed or corrupt",response:t};o&&this.localMedia.replace([]),this.addLocalMedia(t.data.media),this.stories=null!==(e=t.data.stories)&&void 0!==e?e:[],this.totalMedia=t.data.total,n&&n()}).catch(t=>{var e;if(i.a.isCancel(t))return null;const o=new y.Events.FetchFailEvent(y.Events.FETCH_FAIL,{detail:{feed:this,message:null!==(e=t.response?t.response.data.message:void 0)&&void 0!==e?e:t.message,response:t.response}});return document.dispatchEvent(o),a&&a(t),t}).finally(()=>this.isLoading=!1)})):new Promise(t=>{this.localMedia.replace([]),this.totalMedia=0,t&&t()})}addLocalMedia(t){t.forEach(t=>{this.localMedia.some(e=>e.id==t.id)||this.localMedia.push(t)})}getReloadOptions(){return JSON.stringify({accounts:this.options.accounts,hashtags:this.options.hashtags,tagged:this.options.tagged,postOrder:this.options.postOrder,mediaType:this.options.mediaType,moderation:this.options.moderation,moderationMode:this.options.moderationMode,hashtagBlacklist:this.options.hashtagBlacklist,hashtagWhitelist:this.options.hashtagWhitelist,captionBlacklist:this.options.captionBlacklist,captionWhitelist:this.options.captionWhitelist,hashtagBlacklistSettings:this.options.hashtagBlacklistSettings,hashtagWhitelistSettings:this.options.hashtagWhitelistSettings,captionBlacklistSettings:this.options.captionBlacklistSettings,captionWhitelistSettings:this.options.captionWhitelistSettings})}}b([a.n],y.prototype,"media",void 0),b([a.n],y.prototype,"canLoadMore",void 0),b([a.n],y.prototype,"stories",void 0),b([a.n],y.prototype,"numLoadedMore",void 0),b([a.n],y.prototype,"options",void 0),b([a.n],y.prototype,"totalMedia",void 0),b([a.n],y.prototype,"mode",void 0),b([a.n],y.prototype,"isLoaded",void 0),b([a.n],y.prototype,"isLoading",void 0),b([a.n],y.prototype,"isLoadingMore",void 0),b([a.f],y.prototype,"reload",void 0),b([a.n],y.prototype,"localMedia",void 0),b([a.n],y.prototype,"numMediaToShow",void 0),b([a.n],y.prototype,"numMediaPerPage",void 0),b([a.n],y.prototype,"mediaCounter",void 0),b([a.h],y.prototype,"_media",null),b([a.h],y.prototype,"_numMediaToShow",null),b([a.h],y.prototype,"_numMediaPerPage",null),b([a.h],y.prototype,"_canLoadMore",null),b([a.f],y.prototype,"loadMore",null),b([a.f],y.prototype,"load",null),b([a.f],y.prototype,"loadMedia",null),b([a.f],y.prototype,"addLocalMedia",null),function(t){let e,o,n,i,h,p,y,v,O;!function(t){t.FETCH_FAIL="sli/feed/fetch_fail";class e extends CustomEvent{constructor(t,e){super(t,e)}}t.FetchFailEvent=e}(e=t.Events||(t.Events={}));class E{constructor(t={}){E.setFromObject(this,t)}static setFromObject(e,o={}){var n,i,a,l,u,d,h,p,m,g,b,y,v,O,E;const w=o.accounts?o.accounts.slice():t.DefaultOptions.accounts;e.accounts=w.filter(t=>!!t).map(t=>parseInt(t.toString()));const S=o.tagged?o.tagged.slice():t.DefaultOptions.tagged;return e.tagged=S.filter(t=>!!t).map(t=>parseInt(t.toString())),e.hashtags=o.hashtags?o.hashtags.slice():t.DefaultOptions.hashtags,e.layout=r.a.getById(o.layout).id,e.numColumns=s.a.normalize(o.numColumns,t.DefaultOptions.numColumns),e.highlightFreq=s.a.normalize(o.highlightFreq,t.DefaultOptions.highlightFreq),e.mediaType=o.mediaType||t.DefaultOptions.mediaType,e.postOrder=o.postOrder||t.DefaultOptions.postOrder,e.numPosts=s.a.normalize(o.numPosts,t.DefaultOptions.numPosts),e.linkBehavior=s.a.normalize(o.linkBehavior,t.DefaultOptions.linkBehavior),e.feedWidth=s.a.normalize(o.feedWidth,t.DefaultOptions.feedWidth),e.feedHeight=s.a.normalize(o.feedHeight,t.DefaultOptions.feedHeight),e.feedPadding=s.a.normalize(o.feedPadding,t.DefaultOptions.feedPadding),e.imgPadding=s.a.normalize(o.imgPadding,t.DefaultOptions.imgPadding),e.textSize=s.a.normalize(o.textSize,t.DefaultOptions.textSize),e.bgColor=o.bgColor||t.DefaultOptions.bgColor,e.hoverInfo=o.hoverInfo?o.hoverInfo.slice():t.DefaultOptions.hoverInfo,e.textColorHover=o.textColorHover||t.DefaultOptions.textColorHover,e.bgColorHover=o.bgColorHover||t.DefaultOptions.bgColorHover,e.showHeader=s.a.normalize(o.showHeader,t.DefaultOptions.showHeader),e.headerInfo=s.a.normalize(o.headerInfo,t.DefaultOptions.headerInfo),e.headerAccount=null!==(n=o.headerAccount)&&void 0!==n?n:t.DefaultOptions.headerAccount,e.headerAccount=null===e.headerAccount||void 0===c.b.getById(e.headerAccount)?c.b.list.length>0?c.b.list[0].id:null:e.headerAccount,e.headerStyle=s.a.normalize(o.headerStyle,t.DefaultOptions.headerStyle),e.headerTextSize=s.a.normalize(o.headerTextSize,t.DefaultOptions.headerTextSize),e.headerPhotoSize=s.a.normalize(o.headerPhotoSize,t.DefaultOptions.headerPhotoSize),e.headerTextColor=o.headerTextColor||t.DefaultOptions.headerTextColor,e.headerBgColor=o.headerBgColor||t.DefaultOptions.bgColor,e.headerPadding=s.a.normalize(o.headerPadding,t.DefaultOptions.headerPadding),e.customProfilePic=null!==(i=o.customProfilePic)&&void 0!==i?i:t.DefaultOptions.customProfilePic,e.customBioText=o.customBioText||t.DefaultOptions.customBioText,e.includeStories=null!==(a=o.includeStories)&&void 0!==a?a:t.DefaultOptions.includeStories,e.storiesInterval=o.storiesInterval||t.DefaultOptions.storiesInterval,e.showCaptions=s.a.normalize(o.showCaptions,t.DefaultOptions.showCaptions),e.captionMaxLength=s.a.normalize(o.captionMaxLength,t.DefaultOptions.captionMaxLength),e.captionRemoveDots=null!==(l=o.captionRemoveDots)&&void 0!==l?l:t.DefaultOptions.captionRemoveDots,e.captionSize=s.a.normalize(o.captionSize,t.DefaultOptions.captionSize),e.captionColor=o.captionColor||t.DefaultOptions.captionColor,e.showLikes=s.a.normalize(o.showLikes,t.DefaultOptions.showLikes),e.showComments=s.a.normalize(o.showComments,t.DefaultOptions.showCaptions),e.lcIconSize=s.a.normalize(o.lcIconSize,t.DefaultOptions.lcIconSize),e.likesIconColor=null!==(u=o.likesIconColor)&&void 0!==u?u:t.DefaultOptions.likesIconColor,e.commentsIconColor=o.commentsIconColor||t.DefaultOptions.commentsIconColor,e.lightboxShowSidebar=null!==(d=o.lightboxShowSidebar)&&void 0!==d?d:t.DefaultOptions.lightboxShowSidebar,e.numLightboxComments=o.numLightboxComments||t.DefaultOptions.numLightboxComments,e.showLoadMoreBtn=s.a.normalize(o.showLoadMoreBtn,t.DefaultOptions.showLoadMoreBtn),e.loadMoreBtnTextColor=o.loadMoreBtnTextColor||t.DefaultOptions.loadMoreBtnTextColor,e.loadMoreBtnBgColor=o.loadMoreBtnBgColor||t.DefaultOptions.loadMoreBtnBgColor,e.loadMoreBtnText=o.loadMoreBtnText||t.DefaultOptions.loadMoreBtnText,e.autoload=null!==(h=o.autoload)&&void 0!==h?h:t.DefaultOptions.autoload,e.showFollowBtn=s.a.normalize(o.showFollowBtn,t.DefaultOptions.showFollowBtn),e.followBtnText=null!==(p=o.followBtnText)&&void 0!==p?p:t.DefaultOptions.followBtnText,e.followBtnTextColor=o.followBtnTextColor||t.DefaultOptions.followBtnTextColor,e.followBtnBgColor=o.followBtnBgColor||t.DefaultOptions.followBtnBgColor,e.followBtnLocation=s.a.normalize(o.followBtnLocation,t.DefaultOptions.followBtnLocation),e.hashtagWhitelist=o.hashtagWhitelist||t.DefaultOptions.hashtagWhitelist,e.hashtagBlacklist=o.hashtagBlacklist||t.DefaultOptions.hashtagBlacklist,e.captionWhitelist=o.captionWhitelist||t.DefaultOptions.captionWhitelist,e.captionBlacklist=o.captionBlacklist||t.DefaultOptions.captionBlacklist,e.hashtagWhitelistSettings=null!==(m=o.hashtagWhitelistSettings)&&void 0!==m?m:t.DefaultOptions.hashtagWhitelistSettings,e.hashtagBlacklistSettings=null!==(g=o.hashtagBlacklistSettings)&&void 0!==g?g:t.DefaultOptions.hashtagBlacklistSettings,e.captionWhitelistSettings=null!==(b=o.captionWhitelistSettings)&&void 0!==b?b:t.DefaultOptions.captionWhitelistSettings,e.captionBlacklistSettings=null!==(y=o.captionBlacklistSettings)&&void 0!==y?y:t.DefaultOptions.captionBlacklistSettings,e.moderation=o.moderation||t.DefaultOptions.moderation,e.moderationMode=o.moderationMode||t.DefaultOptions.moderationMode,e.promotionEnabled=null!==(v=o.promotionEnabled)&&void 0!==v?v:t.DefaultOptions.promotionEnabled,e.autoPromotionsEnabled=null!==(O=o.autoPromotionsEnabled)&&void 0!==O?O:t.DefaultOptions.autoPromotionsEnabled,e.globalPromotionsEnabled=null!==(E=o.globalPromotionsEnabled)&&void 0!==E?E:t.DefaultOptions.globalPromotionsEnabled,Array.isArray(o.promotions)?e.promotions=f.a.fromArray(o.promotions):o.promotions&&o.promotions instanceof Map?e.promotions=f.a.fromMap(o.promotions):"object"==typeof o.promotions?e.promotions=o.promotions:e.promotions=t.DefaultOptions.promotions,e}static getAllAccounts(t){const e=c.b.idsToAccounts(t.accounts),o=c.b.idsToAccounts(t.tagged);return{all:e.concat(o),accounts:e,tagged:o}}static getSources(t){return{accounts:c.b.idsToAccounts(t.accounts),tagged:c.b.idsToAccounts(t.tagged),hashtags:c.b.getBusinessAccounts().length>0?t.hashtags.filter(t=>t.tag.length>0):[]}}static hasSources(e){const o=t.Options.getSources(e),n=o.accounts.length>0||o.tagged.length>0,i=o.hashtags.length>0;return n||i}static isLimitingPosts(t){return t.moderation.length>0||t.hashtagBlacklist.length>0||t.hashtagWhitelist.length>0||t.captionBlacklist.length>0||t.captionWhitelist.length>0}}b([a.n],E.prototype,"accounts",void 0),b([a.n],E.prototype,"hashtags",void 0),b([a.n],E.prototype,"tagged",void 0),b([a.n],E.prototype,"layout",void 0),b([a.n],E.prototype,"numColumns",void 0),b([a.n],E.prototype,"highlightFreq",void 0),b([a.n],E.prototype,"mediaType",void 0),b([a.n],E.prototype,"postOrder",void 0),b([a.n],E.prototype,"numPosts",void 0),b([a.n],E.prototype,"linkBehavior",void 0),b([a.n],E.prototype,"feedWidth",void 0),b([a.n],E.prototype,"feedHeight",void 0),b([a.n],E.prototype,"feedPadding",void 0),b([a.n],E.prototype,"imgPadding",void 0),b([a.n],E.prototype,"textSize",void 0),b([a.n],E.prototype,"bgColor",void 0),b([a.n],E.prototype,"textColorHover",void 0),b([a.n],E.prototype,"bgColorHover",void 0),b([a.n],E.prototype,"hoverInfo",void 0),b([a.n],E.prototype,"showHeader",void 0),b([a.n],E.prototype,"headerInfo",void 0),b([a.n],E.prototype,"headerAccount",void 0),b([a.n],E.prototype,"headerStyle",void 0),b([a.n],E.prototype,"headerTextSize",void 0),b([a.n],E.prototype,"headerPhotoSize",void 0),b([a.n],E.prototype,"headerTextColor",void 0),b([a.n],E.prototype,"headerBgColor",void 0),b([a.n],E.prototype,"headerPadding",void 0),b([a.n],E.prototype,"customBioText",void 0),b([a.n],E.prototype,"customProfilePic",void 0),b([a.n],E.prototype,"includeStories",void 0),b([a.n],E.prototype,"storiesInterval",void 0),b([a.n],E.prototype,"showCaptions",void 0),b([a.n],E.prototype,"captionMaxLength",void 0),b([a.n],E.prototype,"captionRemoveDots",void 0),b([a.n],E.prototype,"captionSize",void 0),b([a.n],E.prototype,"captionColor",void 0),b([a.n],E.prototype,"showLikes",void 0),b([a.n],E.prototype,"showComments",void 0),b([a.n],E.prototype,"lcIconSize",void 0),b([a.n],E.prototype,"likesIconColor",void 0),b([a.n],E.prototype,"commentsIconColor",void 0),b([a.n],E.prototype,"lightboxShowSidebar",void 0),b([a.n],E.prototype,"numLightboxComments",void 0),b([a.n],E.prototype,"showLoadMoreBtn",void 0),b([a.n],E.prototype,"loadMoreBtnText",void 0),b([a.n],E.prototype,"loadMoreBtnTextColor",void 0),b([a.n],E.prototype,"loadMoreBtnBgColor",void 0),b([a.n],E.prototype,"autoload",void 0),b([a.n],E.prototype,"showFollowBtn",void 0),b([a.n],E.prototype,"followBtnText",void 0),b([a.n],E.prototype,"followBtnTextColor",void 0),b([a.n],E.prototype,"followBtnBgColor",void 0),b([a.n],E.prototype,"followBtnLocation",void 0),b([a.n],E.prototype,"hashtagWhitelist",void 0),b([a.n],E.prototype,"hashtagBlacklist",void 0),b([a.n],E.prototype,"captionWhitelist",void 0),b([a.n],E.prototype,"captionBlacklist",void 0),b([a.n],E.prototype,"hashtagWhitelistSettings",void 0),b([a.n],E.prototype,"hashtagBlacklistSettings",void 0),b([a.n],E.prototype,"captionWhitelistSettings",void 0),b([a.n],E.prototype,"captionBlacklistSettings",void 0),b([a.n],E.prototype,"moderation",void 0),b([a.n],E.prototype,"moderationMode",void 0),t.Options=E;class w{constructor(t){Object.getOwnPropertyNames(t).map(e=>{this[e]=t[e]})}getCaption(t){const e=t.caption?t.caption:"";return this.captionMaxLength&&e.length?Object(u.q)(Object(u.t)(e,this.captionMaxLength)):e}static compute(e,o=s.a.Mode.DESKTOP){const n=new w({accounts:c.b.filterExisting(e.accounts),tagged:c.b.filterExisting(e.tagged),hashtags:e.hashtags.filter(t=>t.tag.length>0),layout:r.a.getById(e.layout),highlightFreq:s.a.get(e.highlightFreq,o,!0),linkBehavior:s.a.get(e.linkBehavior,o,!0),bgColor:Object(d.a)(e.bgColor),textColorHover:Object(d.a)(e.textColorHover),bgColorHover:Object(d.a)(e.bgColorHover),hoverInfo:e.hoverInfo,showHeader:s.a.get(e.showHeader,o,!0),headerInfo:s.a.get(e.headerInfo,o,!0),headerStyle:s.a.get(e.headerStyle,o,!0),headerTextColor:Object(d.a)(e.headerTextColor),headerBgColor:Object(d.a)(e.headerBgColor),headerPadding:s.a.get(e.headerPadding,o,!0),includeStories:e.includeStories,storiesInterval:e.storiesInterval,showCaptions:s.a.get(e.showCaptions,o,!0),captionMaxLength:s.a.get(e.captionMaxLength,o,!0),captionRemoveDots:e.captionRemoveDots,captionColor:Object(d.a)(e.captionColor),showLikes:s.a.get(e.showLikes,o,!0),showComments:s.a.get(e.showComments,o,!0),likesIconColor:Object(d.a)(e.likesIconColor),commentsIconColor:Object(d.a)(e.commentsIconColor),lightboxShowSidebar:e.lightboxShowSidebar,numLightboxComments:e.numLightboxComments,showLoadMoreBtn:s.a.get(e.showLoadMoreBtn,o,!0),loadMoreBtnTextColor:Object(d.a)(e.loadMoreBtnTextColor),loadMoreBtnBgColor:Object(d.a)(e.loadMoreBtnBgColor),loadMoreBtnText:e.loadMoreBtnText,showFollowBtn:s.a.get(e.showFollowBtn,o,!0),autoload:e.autoload,followBtnLocation:s.a.get(e.followBtnLocation,o,!0),followBtnTextColor:Object(d.a)(e.followBtnTextColor),followBtnBgColor:Object(d.a)(e.followBtnBgColor),followBtnText:e.followBtnText,account:null,showBio:!1,bioText:null,profilePhotoUrl:c.b.DEFAULT_PROFILE_PIC,feedWidth:"",feedHeight:"",feedPadding:"",imgPadding:"",textSize:"",headerTextSize:"",headerPhotoSize:"",captionSize:"",lcIconSize:"",showLcIcons:!1});if(n.numColumns=this.getNumCols(e,o),n.numPosts=this.getNumPosts(e,o),n.allAccounts=n.accounts.concat(n.tagged.filter(t=>!n.accounts.includes(t))),n.allAccounts.length>0&&(n.account=e.headerAccount&&n.allAccounts.includes(e.headerAccount)?c.b.getById(e.headerAccount):c.b.getById(n.allAccounts[0])),n.showHeader=n.showHeader&&null!==n.account,n.showHeader&&(n.profilePhotoUrl=e.customProfilePic.length?e.customProfilePic:c.b.getProfilePicUrl(n.account)),n.showFollowBtn=n.showFollowBtn&&null!==n.account,n.showBio=n.headerInfo.some(e=>e===t.HeaderInfo.BIO),n.showBio){const t=e.customBioText.trim().length>0?e.customBioText:null!==n.account?c.b.getBioText(n.account):"";n.bioText=Object(u.q)(t),n.showBio=n.bioText.length>0}return n.feedWidth=this.normalizeCssSize(e.feedWidth,o,"auto"),n.feedHeight=this.normalizeCssSize(e.feedHeight,o,"auto"),n.feedPadding=this.normalizeCssSize(e.feedPadding,o,"0"),n.imgPadding=this.normalizeCssSize(e.imgPadding,o,"0"),n.textSize=this.normalizeCssSize(e.textSize,o,"inherit",!0),n.headerTextSize=this.normalizeCssSize(e.headerTextSize,o,"inherit"),n.headerPhotoSize=this.normalizeCssSize(e.headerPhotoSize,o,"50px"),n.captionSize=this.normalizeCssSize(e.captionSize,o,"inherit"),n.lcIconSize=this.normalizeCssSize(e.lcIconSize,o,"inherit"),n.buttonPadding=Math.max(10,s.a.get(e.imgPadding,o))+"px",n.showLcIcons=n.showLikes||n.showComments,n}static getNumCols(t,e){return Math.max(1,this.normalizeMultiInt(t.numColumns,e,1))}static getNumPosts(t,e){return Math.max(1,this.normalizeMultiInt(t.numPosts,e,1))}static normalizeMultiInt(t,e,o=0){const n=parseInt(s.a.get(t,e)+"");return isNaN(n)?e===s.a.Mode.DESKTOP?o:this.normalizeMultiInt(t,s.a.Mode.DESKTOP,o):n}static normalizeCssSize(t,e,o=null,n=!1){const i=s.a.get(t,e,n);return i?i+"px":o}}function S(t,e){if(g.a.isPro)return Object(u.m)(m.a.isValid,[()=>_(t,e),()=>e.globalPromotionsEnabled&&m.a.getGlobalPromo(t),()=>e.autoPromotionsEnabled&&m.a.getAutoPromo(t)])}function _(t,e){return t?m.a.getPromoFromDictionary(t,e.promotions):void 0}t.ComputedOptions=w,t.HashtagSorting=Object(l.b)({recent:"Most recent",popular:"Most popular"}),function(t){t.ALL="all",t.PHOTOS="photos",t.VIDEOS="videos"}(o=t.MediaType||(t.MediaType={})),function(t){t.NOTHING="nothing",t.SELF="self",t.NEW_TAB="new_tab",t.LIGHTBOX="lightbox"}(n=t.LinkBehavior||(t.LinkBehavior={})),function(t){t.DATE_ASC="date_asc",t.DATE_DESC="date_desc",t.POPULARITY_ASC="popularity_asc",t.POPULARITY_DESC="popularity_desc",t.RANDOM="random"}(i=t.PostOrder||(t.PostOrder={})),function(t){t.USERNAME="username",t.DATE="date",t.CAPTION="caption",t.LIKES_COMMENTS="likes_comments",t.INSTA_LINK="insta_link"}(h=t.HoverInfo||(t.HoverInfo={})),function(t){t.NORMAL="normal",t.BOXED="boxed",t.CENTERED="centered"}(p=t.HeaderStyle||(t.HeaderStyle={})),function(t){t.BIO="bio",t.PROFILE_PIC="profile_pic",t.FOLLOWERS="followers",t.MEDIA_COUNT="media_count"}(y=t.HeaderInfo||(t.HeaderInfo={})),function(t){t.HEADER="header",t.BOTTOM="bottom",t.BOTH="both"}(v=t.FollowBtnLocation||(t.FollowBtnLocation={})),function(t){t.WHITELIST="whitelist",t.BLACKLIST="blacklist"}(O=t.ModerationMode||(t.ModerationMode={})),t.DefaultOptions={accounts:[],hashtags:[],tagged:[],layout:null,numColumns:{desktop:3},highlightFreq:{desktop:7},mediaType:o.ALL,postOrder:i.DATE_DESC,numPosts:{desktop:9},linkBehavior:{desktop:n.LIGHTBOX,phone:n.NEW_TAB},feedWidth:{desktop:""},feedHeight:{desktop:""},feedPadding:{desktop:20,tablet:14,phone:10},imgPadding:{desktop:14,tablet:10,phone:6},textSize:{all:""},bgColor:{r:255,g:255,b:255,a:1},hoverInfo:[h.LIKES_COMMENTS,h.INSTA_LINK],textColorHover:{r:255,g:255,b:255,a:1},bgColorHover:{r:0,g:0,b:0,a:.5},showHeader:{desktop:!0},headerInfo:{desktop:[y.PROFILE_PIC,y.BIO]},headerAccount:null,headerStyle:{desktop:p.NORMAL,phone:p.CENTERED},headerTextSize:{desktop:""},headerPhotoSize:{desktop:50},headerTextColor:{r:0,g:0,b:0,a:1},headerBgColor:{r:255,g:255,b:255,a:1},headerPadding:{desktop:0},customProfilePic:0,customBioText:"",includeStories:!1,storiesInterval:5,showCaptions:{desktop:!1},captionMaxLength:{desktop:0},captionRemoveDots:!1,captionSize:{desktop:0},captionColor:{r:0,g:0,b:0,a:1},showLikes:{desktop:!1},showComments:{desktop:!1},lcIconSize:{desktop:14},likesIconColor:{r:0,g:0,b:0,a:1},commentsIconColor:{r:0,g:0,b:0,a:1},lightboxShowSidebar:!1,numLightboxComments:50,showLoadMoreBtn:{desktop:!0},loadMoreBtnTextColor:{r:255,g:255,b:255,a:1},loadMoreBtnBgColor:{r:0,g:149,b:246,a:1},loadMoreBtnText:"Load more",autoload:!1,showFollowBtn:{desktop:!0},followBtnText:"Follow on Instagram",followBtnTextColor:{r:255,g:255,b:255,a:1},followBtnBgColor:{r:0,g:149,b:246,a:1},followBtnLocation:{desktop:v.HEADER,phone:v.BOTTOM},hashtagWhitelist:[],hashtagBlacklist:[],captionWhitelist:[],captionBlacklist:[],hashtagWhitelistSettings:!0,hashtagBlacklistSettings:!0,captionWhitelistSettings:!0,captionBlacklistSettings:!0,moderation:[],moderationMode:O.BLACKLIST,promotionEnabled:!0,autoPromotionsEnabled:!0,globalPromotionsEnabled:!0,promotions:{}},t.getPromo=S,t.getFeedPromo=_,t.executeMediaClick=function(t,e){const o=S(t,e),n=m.a.getConfig(o),i=m.a.getType(o);return!(!i||!i.isValid(n)||"function"!=typeof i.onMediaClick)&&i.onMediaClick(t,n)},t.getLink=function(t,e){var o,n;const i=S(t,e),a=m.a.getConfig(i),s=m.a.getType(i);if(void 0===s||!s.isValid(a))return{text:null,url:null,newTab:!1};let[r,l]=s.getPopupLink?null!==(o=s.getPopupLink(t,a))&&void 0!==o?o:null:[null,!1];return{text:r,url:s.getMediaUrl&&null!==(n=s.getMediaUrl(t,a))&&void 0!==n?n:null,newTab:l}}}(y||(y={}))},73:function(t,e,o){"use strict";o.d(e,"a",(function(){return p}));var n=o(0),i=o.n(n),a=o(37),s=o.n(a),r=o(100),l=o(15),c=o(3),u=o(59),d=o(11),h=o(14);function p(t){var{media:e,className:o,size:a,onLoadImage:p,width:m,height:f}=t,g=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(o[n[i]]=t[n[i]])}return o}(t,["media","className","size","onLoadImage","width","height"]);const b=i.a.useRef(),y=i.a.useRef(),[v,O]=i.a.useState(!function(t){return!!l.a.Source.isOwnMedia(t.source)&&("string"==typeof t.thumbnail&&t.thumbnail.length>0||!h.a.isEmpty(t.thumbnails))}(e)),[E,w]=i.a.useState(!0);function S(){if(b.current){const t=null!=a?a:function(){const t=b.current.getBoundingClientRect();return t.width<=320?c.a.SMALL:(t.width,c.a.MEDIUM)}(),o="object"==typeof e.thumbnails&&h.a.has(e.thumbnails,t)?h.a.get(e.thumbnails,t):e.thumbnail;b.current.src!==o&&(b.current.src=o)}}function _(){k()}function C(){e.type===l.a.Type.VIDEO?O(!0):b.current.src!==e.thumbnail&&(b.current.src=e.thumbnail),k()}function P(){isNaN(y.current.duration)||y.current.duration===1/0?y.current.currentTime=1:y.current.currentTime=y.current.duration/2,k()}function k(){w(!1),p&&p()}return Object(n.useLayoutEffect)(()=>{let t=new r.a(S);return b.current&&(b.current.onload=_,b.current.onerror=C,S(),t.observe(b.current)),y.current&&(y.current.onloadeddata=P),()=>{b.current&&(b.current.onload=()=>null,b.current.onerror=()=>null),y.current&&(y.current.onloadeddata=()=>null),t.disconnect()}},[e,a]),e.url&&e.url.length>0?i.a.createElement("div",Object.assign({className:Object(d.b)(s.a.root,o)},g),"VIDEO"===e.type&&v?i.a.createElement("video",{ref:y,className:s.a.video,src:e.url,autoPlay:!1,controls:!1,tabIndex:0},i.a.createElement("source",{src:e.url}),"Your browser does not support videos"):i.a.createElement("img",Object.assign({ref:b,className:s.a.image,loading:"lazy",width:m,height:f},d.e)),E&&i.a.createElement(u.a,null)):i.a.createElement("div",{className:s.a.notAvailable},i.a.createElement("span",null,"Thumbnail not available"))}},74:function(t,e,o){t.exports={root:"MediaLoading__root",animation:"MediaLoading__animation"}},76:function(t,e,o){"use strict";o.d(e,"a",(function(){return s})),o.d(e,"b",(function(){return r}));var n=o(0),i=o.n(n),a=o(6);function s(t,e){return Object(a.b)(o=>i.a.createElement(t,Object.assign(Object.assign({},e),o)))}function r(t,e){return Object(a.b)(o=>{const n={};return Object.keys(e).forEach(t=>n[t]=e[t](o)),i.a.createElement(t,Object.assign({},n,o))})}},77:function(t,e,o){t.exports={root:"ProfilePic__root",round:"ProfilePic__round ProfilePic__root",square:"ProfilePic__square ProfilePic__root"}},78:function(t,e,o){t.exports={"connect-btn":"AccountsPage__connect-btn",connectBtn:"AccountsPage__connect-btn"}},8:function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));var n,i=o(12),a=o(14),s=o(3);!function(t){function e(t){return t?c(t.type):void 0}function o(t){var o;if("object"!=typeof t)return!1;const n=e(t);return void 0!==n&&n.isValid(null!==(o=t.config)&&void 0!==o?o:{})}function n(e){return e?t.getPromoFromDictionary(e,i.a.config.globalPromotions):void 0}function r(t){const e=l(t);return void 0===e?void 0:e.promotion}function l(e){if(e)for(const o of i.a.config.autoPromotions){const n=t.Automation.getType(o),i=t.Automation.getConfig(o);if(n&&n.matches(e,i))return o}}function c(e){return t.types.find(t=>t.id===e)}let u;t.getConfig=function(t){var e,o;return t&&null!==(o=null!==(e=t.config)&&void 0!==e?e:t.data)&&void 0!==o?o:{}},t.getType=e,t.isValid=o,t.getPromoFromDictionary=function(e,o){const n=a.a.get(o,e.id);if(n)return t.getType(n)?n:void 0},t.getPromo=function(t){return Object(s.m)(o,[()=>n(t),()=>r(t)])},t.getGlobalPromo=n,t.getAutoPromo=r,t.getAutomation=l,t.types=[],t.getTypes=function(){return t.types},t.registerType=function(e){t.types.push(e)},t.getTypeById=c,t.clearTypes=function(){t.types.splice(0,t.types.length)},function(t){t.getType=function(t){return t?o(t.type):void 0},t.getConfig=function(t){var e,o;return t&&null!==(o=null!==(e=t.config)&&void 0!==e?e:t.data)&&void 0!==o?o:{}},t.getPromotion=function(t){return t?t.promotion:void 0};const e=[];function o(t){return e.find(e=>e.id===t)}t.getTypes=function(){return e},t.registerType=function(t){e.push(t)},t.getTypeById=o,t.clearTypes=function(){e.splice(0,e.length)}}(u=t.Automation||(t.Automation={}))}(n||(n={}))},83:function(t,e,o){"use strict";o.d(e,"b",(function(){return r})),o.d(e,"a",(function(){return l})),o.d(e,"c",(function(){return c}));var n=o(7),i=o(17),a=o(3),s=o(14);class r{constructor(t){this.incFilters=!1,this.prevOptions=null,this.media=new Array,this.config=Object(a.h)(t),void 0===this.config.watch&&(this.config.watch={all:!0})}fetchMedia(t,e){if(this.hasCache(t))return Promise.resolve(this.media);const o=Object.assign({},t.options,{moderation:this.isWatchingField("moderation")?t.options.moderation:[],moderationMode:t.options.moderationMode,hashtagBlacklist:this.isWatchingField("hashtagBlacklist")?t.options.hashtagBlacklist:[],hashtagWhitelist:this.isWatchingField("hashtagWhitelist")?t.options.hashtagWhitelist:[],captionBlacklist:this.isWatchingField("captionBlacklist")?t.options.captionBlacklist:[],captionWhitelist:this.isWatchingField("captionWhitelist")?t.options.captionWhitelist:[],hashtagBlacklistSettings:!!this.isWatchingField("hashtagBlacklistSettings")&&t.options.hashtagBlacklistSettings,hashtagWhitelistSettings:!!this.isWatchingField("hashtagWhitelistSettings")&&t.options.hashtagWhitelistSettings,captionBlacklistSettings:!!this.isWatchingField("captionBlacklistSettings")&&t.options.captionBlacklistSettings,captionWhitelistSettings:!!this.isWatchingField("captionWhitelistSettings")&&t.options.captionWhitelistSettings});return e&&e(),i.a.getFeedMedia(o).then(e=>(this.prevOptions=new n.a.Options(t.options),this.media=[],this.addMedia(e.data.media),this.media))}addMedia(t){t.forEach(t=>{this.media.some(e=>e.id==t.id)||this.media.push(t)})}hasCache(t){return null!==this.prevOptions&&!this.isCacheInvalid(t)}isWatchingField(t){var e,o,n;let i=null!==(e=this.config.watch.all)&&void 0!==e&&e;return 1===s.a.size(this.config.watch)&&void 0!==this.config.watch.all?i:(r.FILTER_FIELDS.includes(t)&&(i=null!==(o=s.a.get(this.config.watch,"filters"))&&void 0!==o?o:i),null!==(n=s.a.get(this.config.watch,t))&&void 0!==n?n:i)}isCacheInvalid(t){const e=t.options,o=this.prevOptions;if(Object(a.k)(t.media,this.media,(t,e)=>t.id===e.id).length>0)return!0;if(this.isWatchingField("accounts")&&!Object(a.f)(e.accounts,o.accounts))return!0;if(this.isWatchingField("tagged")&&!Object(a.f)(e.tagged,o.tagged))return!0;if(this.isWatchingField("hashtags")&&!Object(a.f)(e.hashtags,o.hashtags,a.n))return!0;if(this.isWatchingField("moderationMode")&&e.moderationMode!==o.moderationMode)return!0;if(this.isWatchingField("moderation")&&!Object(a.f)(e.moderation,o.moderation))return!0;if(this.isWatchingField("filters")){if(this.isWatchingField("captionWhitelistSettings")&&e.captionWhitelistSettings!==o.captionWhitelistSettings)return!0;if(this.isWatchingField("captionBlacklistSettings")&&e.captionBlacklistSettings!==o.captionBlacklistSettings)return!0;if(this.isWatchingField("hashtagWhitelistSettings")&&e.hashtagWhitelistSettings!==o.hashtagWhitelistSettings)return!0;if(this.isWatchingField("hashtagBlacklistSettings")&&e.hashtagBlacklistSettings!==o.hashtagBlacklistSettings)return!0;if(this.isWatchingField("captionWhitelist")&&!Object(a.f)(e.captionWhitelist,o.captionWhitelist))return!0;if(this.isWatchingField("captionBlacklist")&&!Object(a.f)(e.captionBlacklist,o.captionBlacklist))return!0;if(this.isWatchingField("hashtagWhitelist")&&!Object(a.f)(e.hashtagWhitelist,o.hashtagWhitelist))return!0;if(this.isWatchingField("hashtagBlacklist")&&!Object(a.f)(e.hashtagBlacklist,o.hashtagBlacklist))return!0}return!1}}!function(t){t.FILTER_FIELDS=["hashtagBlacklist","hashtagWhitelist","captionBlacklist","captionWhitelist","hashtagBlacklistSettings","hashtagWhitelistSettings","captionBlacklistSettings","captionWhitelistSettings"]}(r||(r={}));const l=new r({watch:{all:!0,filters:!1}}),c=new r({watch:{all:!0,moderation:!1}})},9:function(t,e,o){t.exports={root:"AccountInfo__root",container:"AccountInfo__container",column:"AccountInfo__column","info-column":"AccountInfo__info-column AccountInfo__column",infoColumn:"AccountInfo__info-column AccountInfo__column","pic-column":"AccountInfo__pic-column AccountInfo__column",picColumn:"AccountInfo__pic-column AccountInfo__column",id:"AccountInfo__id",username:"AccountInfo__username","profile-pic":"AccountInfo__profile-pic",profilePic:"AccountInfo__profile-pic",label:"AccountInfo__label",row:"AccountInfo__row",pre:"AccountInfo__pre",bio:"AccountInfo__bio AccountInfo__pre","link-button":"AccountInfo__link-button",linkButton:"AccountInfo__link-button","edit-bio-link":"AccountInfo__edit-bio-link AccountInfo__link-button",editBioLink:"AccountInfo__edit-bio-link AccountInfo__link-button","bio-editor":"AccountInfo__bio-editor",bioEditor:"AccountInfo__bio-editor","bio-footer":"AccountInfo__bio-footer",bioFooter:"AccountInfo__bio-footer","bio-editing-controls":"AccountInfo__bio-editing-controls",bioEditingControls:"AccountInfo__bio-editing-controls","access-token":"AccountInfo__access-token AccountInfo__pre",accessToken:"AccountInfo__access-token AccountInfo__pre","set-custom-pic":"AccountInfo__set-custom-pic",setCustomPic:"AccountInfo__set-custom-pic","reset-custom-pic":"AccountInfo__reset-custom-pic AccountInfo__link-button",resetCustomPic:"AccountInfo__reset-custom-pic AccountInfo__link-button",subtext:"AccountInfo__subtext","personal-info-message":"AccountInfo__personal-info-message",personalInfoMessage:"AccountInfo__personal-info-message"}},91:function(t,e,o){"use strict";o.d(e,"a",(function(){return E}));var n=o(0),i=o.n(n),a=o(46),s=o(9),r=o.n(s),l=o(6),c=o(4),u=o(621),d=o(394),h=o(56),p=o(115),m=o(106),f=o(30),g=o(5),b=o(23),y=o(16),v=o(60),O=Object(l.b)((function({account:t,onUpdate:e}){const[o,n]=i.a.useState(!1),[a,s]=i.a.useState(""),[l,O]=i.a.useState(!1),E=t.type===c.a.Type.PERSONAL,w=c.b.getBioText(t),S=()=>{t.customBio=a,O(!0),f.a.updateAccount(t).then(()=>{n(!1),O(!1),e&&e()})},_=o=>{t.customProfilePicUrl=o,O(!0),f.a.updateAccount(t).then(()=>{O(!1),e&&e()})};return i.a.createElement("div",{className:r.a.root},i.a.createElement("div",{className:r.a.container},i.a.createElement("div",{className:r.a.infoColumn},i.a.createElement("a",{href:c.b.getProfileUrl(t),target:"_blank",className:r.a.username},"@",t.username),i.a.createElement("div",{className:r.a.row},i.a.createElement("span",{className:r.a.label},"Spotlight ID:"),t.id),i.a.createElement("div",{className:r.a.row},i.a.createElement("span",{className:r.a.label},"User ID:"),t.userId),i.a.createElement("div",{className:r.a.row},i.a.createElement("span",{className:r.a.label},"Type:"),t.type),!o&&i.a.createElement("div",{className:r.a.row},i.a.createElement("div",null,i.a.createElement("span",{className:r.a.label},"Bio:"),i.a.createElement("a",{className:r.a.editBioLink,onClick:()=>{s(c.b.getBioText(t)),n(!0)}},"Edit bio"),i.a.createElement("pre",{className:r.a.bio},w.length>0?w:"(No bio)"))),o&&i.a.createElement("div",{className:r.a.row},i.a.createElement("textarea",{className:r.a.bioEditor,value:a,onChange:t=>{s(t.target.value)},onKeyDown:t=>{"Enter"===t.key&&t.ctrlKey&&(S(),t.preventDefault(),t.stopPropagation())},rows:4}),i.a.createElement("div",{className:r.a.bioFooter},i.a.createElement("div",{className:r.a.bioEditingControls},l&&i.a.createElement("span",null,"Please wait ...")),i.a.createElement("div",{className:r.a.bioEditingControls},i.a.createElement(g.a,{className:r.a.bioEditingButton,type:g.c.DANGER,disabled:l,onClick:()=>{t.customBio="",O(!0),f.a.updateAccount(t).then(()=>{n(!1),O(!1),e&&e()})}},"Reset"),i.a.createElement(g.a,{className:r.a.bioEditingButton,type:g.c.SECONDARY,disabled:l,onClick:()=>{n(!1)}},"Cancel"),i.a.createElement(g.a,{className:r.a.bioEditingButton,type:g.c.PRIMARY,disabled:l,onClick:S},"Save"))))),i.a.createElement("div",{className:r.a.picColumn},i.a.createElement("div",null,i.a.createElement(v.a,{account:t,className:r.a.profilePic})),i.a.createElement(p.a,{id:"account-custom-profile-pic",title:"Select profile picture",mediaType:"image",onSelect:t=>{const e=parseInt(t.attributes.id),o=m.a.media.attachment(e).attributes.url;_(o)}},({open:t})=>i.a.createElement(g.a,{type:g.c.SECONDARY,className:r.a.setCustomPic,onClick:t},"Change profile picture")),t.customProfilePicUrl.length>0&&i.a.createElement("a",{className:r.a.resetCustomPic,onClick:()=>{_("")}},"Reset profile picture"))),E&&i.a.createElement("div",{className:r.a.personalInfoMessage},i.a.createElement(b.a,{type:b.b.INFO,showIcon:!0},"Due to restrictions set by Instagram, Spotlight cannot import the profile photo and bio"," ","text for Personal accounts."," ",i.a.createElement("a",{href:y.a.resources.customPersonalInfoUrl,target:"_blank"},"Click here to learn more"),".")),i.a.createElement(h.a,{label:"View access token",stealth:!0},i.a.createElement("div",{className:r.a.row},t.accessToken&&i.a.createElement("div",null,i.a.createElement("p",null,i.a.createElement("span",{className:r.a.label},"Expires on:"),i.a.createElement("span",null,t.accessToken.expiry?Object(u.a)(Object(d.a)(t.accessToken.expiry),"PPPP"):"Unknown")),i.a.createElement("pre",{className:r.a.accessToken},t.accessToken.code)))))}));function E({isOpen:t,onClose:e,onUpdate:o,account:n}){return i.a.createElement(a.a,{isOpen:t,title:"Account details",icon:"admin-users",onClose:e},i.a.createElement(a.a.Content,null,i.a.createElement(O,{account:n,onUpdate:o})))}},99:function(t,e,o){t.exports={root:"ProUpgradeBtn__root"}}},[[612,0,1,2,3]]])}));
ui/dist/editor.js CHANGED
@@ -1 +1 @@
1
- (window.webpackJsonpspotlight=window.webpackJsonpspotlight||[]).push([[3],{115:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(0),o=a.n(n),l=a(246),i=a(92),r=a(55),c=a(14);const s=({onConnect:e,beforeConnect:t,isTransitioning:a})=>o.a.createElement(i.a,{className:"accounts-onboarding",isTransitioning:a},o.a.createElement("div",{className:"accounts-onboarding__left"},o.a.createElement("h1",null,"Let's connect your Instagram account"),o.a.createElement("p",{className:"accounts-onboarding__first-msg"},"If you're unsure which button applies to you, it's most likely a ",o.a.createElement("strong",null,"Personal")," account."," ","Try that first."),o.a.createElement("div",{className:"accounts-onboarding__spacer"}),o.a.createElement(r.a,{label:"Upgrade to an Instagram Business account for free",stealth:!0},o.a.createElement("p",null,"Business accounts get additional API features that give you more control over your feeds in "," ","Spotlight, especially with ",o.a.createElement("strong",null,"PRO"),"."),o.a.createElement("p",null,"Plus, they get access to ",o.a.createElement("strong",null,"more cool stuff")," within Instagram itself, such as "," ","analytics."),o.a.createElement("p",null,o.a.createElement("a",{href:c.a.resources.businessAccounts,target:"_blank",className:"accounts-onboarding__learn-more-business"},"Learn more")))),o.a.createElement("div",null,o.a.createElement(l.a,{beforeConnect:e=>t&&t(e),onConnect:t=>e&&e(t),useColumns:!0,showPrompt:!1})))},130:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(0),o=a.n(n),l=a(250),i=a.n(l);function r({children:e,label:t,bordered:a}){const n=a?i.a.bordered:i.a.filterField;return o.a.createElement("div",{className:n},o.a.createElement("span",{className:i.a.label},t),e)}},131:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(0),o=a.n(n),l=a(251),i=a.n(l),r=a(5),c=a(376);function s({id:e,value:t,onChange:a,feed:n}){const[l,s]=o.a.useState(!1);return o.a.createElement("div",{className:i.a.incGlobalFilters},o.a.createElement("label",{className:i.a.label},o.a.createElement("div",{className:i.a.field},o.a.createElement("input",{id:e,type:"checkbox",value:"1",checked:t,onChange:e=>a&&a(e.target.checked)}),o.a.createElement("span",null,"Include global filters")),o.a.createElement(r.a,{type:r.c.LINK,size:r.b.SMALL,onClick:()=>s(!0)},"Edit global filters"),o.a.createElement(c.a,{isOpen:l,onClose:()=>s(!1),onSave:()=>n&&n.reload()})))}},133:function(e,t,a){e.exports={root:"AccountSelector__root",row:"AccountSelector__row",account:"AccountSelector__account button__toggle-button button__panel-button theme__panel","account-selected":"AccountSelector__account-selected AccountSelector__account button__toggle-button button__panel-button theme__panel button__toggle-button-on button__toggle-button button__panel-button theme__panel",accountSelected:"AccountSelector__account-selected AccountSelector__account button__toggle-button button__panel-button theme__panel button__toggle-button-on button__toggle-button button__panel-button theme__panel","profile-pic":"AccountSelector__profile-pic",profilePic:"AccountSelector__profile-pic","info-column":"AccountSelector__info-column",infoColumn:"AccountSelector__info-column","info-text":"AccountSelector__info-text",infoText:"AccountSelector__info-text",username:"AccountSelector__username AccountSelector__info-text","account-type":"AccountSelector__account-type AccountSelector__info-text",accountType:"AccountSelector__account-type AccountSelector__info-text","tick-icon":"AccountSelector__tick-icon",tickIcon:"AccountSelector__tick-icon"}},135:function(e,t,a){e.exports={"embed-sidebar":"EmbedSidebar__embed-sidebar",embedSidebar:"EmbedSidebar__embed-sidebar","save-message":"EmbedSidebar__save-message",saveMessage:"EmbedSidebar__save-message",shortcode:"EmbedSidebar__shortcode",example:"EmbedSidebar__example",caption:"EmbedSidebar__caption","example-annotation":"EmbedSidebar__example-annotation",exampleAnnotation:"EmbedSidebar__example-annotation",instances:"EmbedSidebar__instances",pro:"EmbedSidebar__pro"}},154:function(e,t,a){e.exports={container:"EditorFieldRow__container",wide:"EditorFieldRow__wide EditorFieldRow__container",label:"EditorFieldRow__label",content:"EditorFieldRow__content","label-aligner":"EditorFieldRow__label-aligner",labelAligner:"EditorFieldRow__label-aligner",disabled:"EditorFieldRow__disabled EditorFieldRow__container","pro-pill":"EditorFieldRow__pro-pill",proPill:"EditorFieldRow__pro-pill"}},177:function(e,t,a){"use strict";var n=a(0),o=a.n(n),l=a(185),i=a.n(l),r=a(6),c=a(378),s=a(20);t.a=Object(r.b)((function({feed:e,media:t,store:a,selected:l,disabled:r,autoFocusFirst:u,onClickMedia:m,onSelectMedia:p,children:b}){r=null!=r&&r,u=null!=u&&u;const h=a&&e&&a.hasCache(e)||void 0!==t&&t.length>0,[g,f]=o.a.useState(null!=t?t:[]),[E,v]=o.a.useState(!h),[_,w,k]=Object(s.e)(l),y=o.a.useRef(),C=o.a.useRef(),O=o.a.useRef();function P(e){f(e),v(!1),e.length>0&&u&&p&&p(e[0],0)}Object(n.useEffect)(()=>{k(l)},[l]),Object(s.i)(n=>{a?a.fetchMedia(e).then(e=>n().then(()=>P(e))):P(t)},[a,t]);const S=e=>{null===w()||e.target!==y.current&&e.target!==C.current||F(null)};function F(e){r||(T(e),m&&m(g[e],e))}function T(e){e===w()||r||(p&&p(g[e],e),k(e))}Object(n.useLayoutEffect)(()=>{if(y.current)return y.current.addEventListener("click",S),()=>y.current.removeEventListener("click",S)},[y.current]);const N=r?i.a.gridDisabled:i.a.grid;return o.a.createElement("div",{ref:y,className:i.a.root},o.a.createElement("div",{ref:C,className:N,style:{gridGap:15},tabIndex:0,onKeyDown:function(e){if(r)return;const t=w(),a=function(){const e=C.current.getBoundingClientRect(),t=O.current.getBoundingClientRect(),a=e.width,n=t.width;return Math.floor((a+15)/(n+15))}(),n=Math.ceil(g.length/a);switch(e.key){case" ":case"Enter":F(t);break;case"ArrowLeft":T(Math.max(t-1,0));break;case"ArrowRight":T(Math.min(t+1,g.length-1));break;case"ArrowUp":{const e=Math.max(0,t-a),o=Math.floor(t/a),l=Math.floor(e/a);n>1&&l!==o&&T(e);break}case"ArrowDown":{const e=Math.min(g.length-1,t+a),o=Math.floor(t/a),l=Math.floor(e/a);n>1&&l!==o&&T(e);break}default:return}e.preventDefault(),e.stopPropagation()}},g.map((e,t)=>o.a.createElement(d,{key:e.id,ref:0===t?O:null,focused:!r&&_===t,onClick:()=>F(t),onFocus:()=>T(t)},b(e,t)))),E&&o.a.createElement("div",{className:i.a.loading},o.a.createElement(c.a,{size:60})))}));const d=o.a.forwardRef(({focused:e,onClick:t,onFocus:a,children:l},r)=>(r||(r=o.a.useRef()),Object(n.useEffect)(()=>{e&&r.current.focus()},[e]),o.a.createElement("div",{ref:r,className:i.a.item,onClick:t,onFocus:a,tabIndex:0},l)))},178:function(e,t,a){"use strict";a.d(t,"a",(function(){return f}));var n=a(0),o=a.n(n),l=a(294),i=a.n(l),r=a(234),c=a(5),s=a(14),d=new Map([["link",{heading:"Link options",fields:r.a,tutorial:function({}){return o.a.createElement(o.a.Fragment,null,o.a.createElement("p",{style:{fontWeight:"bold"}},"How it works:"),o.a.createElement("ol",{style:{marginTop:0}},o.a.createElement("li",null,"Select a post from the preview on the left."),o.a.createElement("li",null,"Choose what the post should link to.")),o.a.createElement("p",null,"That’s it!"))}}],["-more-",{heading:"Have your say...",fields:function({}){return o.a.createElement(o.a.Fragment,null,o.a.createElement("p",null,"Spotlight’s ‘Promote’ feature has lots more to come. Share your thoughts on what you’d like to"," ","promote and how."),o.a.createElement("p",null,"Take our 2-minute survey."),o.a.createElement("div",null,o.a.createElement(c.a,{type:c.c.PRIMARY,size:c.b.LARGE,onClick:function(){window.open(s.a.resources.promoTypesSurvey)}},"Start Survey")))}}]]),u=a(55),m=a(23),p=a(21);function b({hasGlobal:e,hasAuto:t,isOverriding:a,onOverride:n}){return o.a.createElement(o.a.Fragment,null,o.a.createElement(m.a,{type:m.b.WARNING,showIcon:!0},o.a.createElement("span",null,"You have")," ",t&&o.a.createElement("a",{href:p.a.at({screen:"promotions",tab:"automate"}),target:"_blank"},"automated"),t&&e&&o.a.createElement(o.a.Fragment,null," ",o.a.createElement("span",null,"and")," "),e&&o.a.createElement("a",{href:p.a.at({screen:"promotions",tab:"global"}),target:"_blank"},"global")," ",o.a.createElement("span",null,"promotions that apply to this post.")," ",a?o.a.createElement("span",null,"To stop overriding, simply remove the custom promotion."):o.a.createElement("span",null,"Click the button below to use a custom promotion instead.")),!a&&o.a.createElement(c.a,{onClick:n},"Override"))}var h=a(3),g=a(65);function f({type:e,config:t,hasGlobal:a,hasAuto:l,showTutorial:r,showNextBtn:s,isNextBtnDisabled:m,hideRemove:p,onNext:f,onChange:E}){var v,_;const[w,k]=Object(n.useState)(!1),[y,C]=Object(n.useState)(!1),O=Object(n.useCallback)(()=>C(!0),[C]),P=Object(n.useCallback)(()=>C(!1),[C]),S=Object(n.useCallback)(()=>{k(!0),E&&E({})},[e,E]),F=!Object(h.o)(t),T=a||l,N=T&&(F||w),x=null!==(v=d.get(e?e.id:""))&&void 0!==v?v:{heading:"",fields:void 0,tutorial:void 0};return o.a.createElement(o.a.Fragment,null,o.a.createElement(u.a,{label:null!==(_=x.heading)&&void 0!==_?_:"Promotion options",fitted:!0,isOpen:!0,showIcon:!1},T&&o.a.createElement(b,{hasAuto:l,hasGlobal:a,isOverriding:N,onOverride:S}),N&&o.a.createElement("hr",null),(!T||N)&&!r&&x.fields&&o.a.createElement(x.fields,{config:null!=t?t:{},onChange:E}),r&&x.tutorial&&o.a.createElement(x.tutorial,null)),o.a.createElement("div",{className:i.a.bottom},s&&o.a.createElement(c.a,{size:c.b.LARGE,onClick:f,disabled:m},"Promote next post →"),(F||N)&&!p&&o.a.createElement("a",{className:i.a.removePromo,onClick:O},"Remove promotion")),o.a.createElement(g.a,{isOpen:y,title:"Are you sure?",buttons:["Yes, I'm sure","No, keep it"],onCancel:P,onAccept:()=>{E&&E({}),k(!1),C(!1)}},o.a.createElement("p",null,"Are you sure you want to remove this promotion? This ",o.a.createElement("strong",null,"cannot")," be undone!")))}},179:function(e,t,a){"use strict";a.d(t,"a",(function(){return b}));var n=a(0),o=a.n(n),l=a(369),i=a.n(l),r=a(289),c=a.n(r),s=a(55),d=a(39),u=a(12),m=a(229);function p(e){const{group:t,showFakeOptions:a}=e,[n,l]=o.a.useState(e.openGroups.includes(t.id)),i=o.a.useCallback(()=>{l(e=>!e)},[n]),r=t.isFakePro?o.a.createElement(m.a,null,t.label):t.label;return!t.isFakePro||a||u.a.isPro?o.a.createElement(s.a,{className:t.isFakePro&&!u.a.isPro?c.a.disabled:c.a.spoiler,label:r,isOpen:n,onClick:i,scrollIntoView:!0,fitted:!0},t.fields.map(n=>{const l=Object.assign({},e);if(t.isFakePro||n.isFakePro){if(!a)return null;l.onChange=d.b}return o.a.createElement(n.component,Object.assign({key:n.id,field:n},e))})):null}function b(e){var{groups:t}=e,a=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(a[n[o]]=e[n[o]])}return a}(e,["groups"]);return o.a.createElement("div",{className:i.a.fieldGroupList},t.map(e=>o.a.createElement(p,Object.assign({key:e.id,group:e},a))))}},180:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(0),o=a.n(n);function l({id:e,value:t,onChange:a,placeholder:n}){return o.a.createElement("input",{id:e,type:"text",value:t,onChange:e=>a(e.target.value),placeholder:n})}a(359)},181:function(e,t,a){"use strict";a.d(t,"b",(function(){return N}));var n=a(0),o=a.n(n),l=a(51),i=a(208),r=a.n(i),c=a(27),s=a(14),d=a(20);const u=({value:e,onChange:t,layouts:a,showUpgrade:n})=>(a=null!=a?a:c.a.list,o.a.createElement("div",{className:r.a.root},a.map((a,n)=>{const l=a.id===e?r.a.layoutSelected:r.a.layout,i=()=>t(a.id),c=Object(d.f)(i);return o.a.createElement("div",{key:n,className:l,role:"button",tabIndex:0,onClick:i,onKeyPress:c},a.name,a.img&&o.a.createElement("img",{src:a.img,alt:a.name}))}),n&&o.a.createElement("div",{className:r.a.comingSoon},o.a.createElement("span",null,"More layouts available in PRO!"),o.a.createElement("br",null),o.a.createElement("a",{href:s.a.resources.upgradeLocalUrl,target:"_blank"},"Upgrade now!"))));var m=a(7),p=a(56),b=a(63),h=a(2),g=a(81),f=a(205),E=a(23),v=a(67),_=a(4),w=a(114),k=a(5);a(599);const y=({id:e,title:t,mediaType:a,button:n,buttonSet:l,buttonChange:i,value:r,onChange:c})=>{l=void 0===n?l:n,i=void 0===n?i:n;const s=!!r,d=s?i:l,u=()=>{c&&c("")};return o.a.createElement(w.a,{id:e,title:t,mediaType:a,button:d,value:r,onSelect:e=>{c&&c(e.attributes.url)}},({open:e})=>o.a.createElement("div",{className:"wp-media-field"},s&&o.a.createElement("div",{className:"wp-media-field__preview",tabIndex:0,onClick:e,role:"button"},o.a.createElement("img",{src:r,alt:"Custom profile picture"})),o.a.createElement(k.a,{className:"wp-media-field__select-btn",type:k.c.SECONDARY,onClick:e},d),s&&o.a.createElement(k.a,{className:"wp-media-field__remove-btn",type:k.c.DANGER_LINK,onClick:u},"Remove custom photo")))};function C({id:e,value:t,onChange:a}){return o.a.createElement("textarea",{id:e,value:t,onChange:e=>a(e.target.value)})}var O=a(180),P=a(22),S=a(12),F=m.a.FollowBtnLocation,T=m.a.HeaderInfo;function N(e){return!e.computed.showHeader}function x(e,t){return N(t)||!t.computed.headerInfo.includes(e)}function I(e){return 0===e.value.accounts.length&&0===e.value.tagged.length&&e.value.hashtags.length>0}function j(e){return!e.computed.showFollowBtn}function M(e){return!e.computed.showLoadMoreBtn}t.a=[{id:"layouts",label:"Layout",fields:[{id:"layout",component:Object(l.a)(({value:e,onChange:t})=>o.a.createElement(u,{value:e.layout,onChange:e=>t({layout:e}),showUpgrade:!S.a.isPro}),["layout"])}]},{id:"feed",label:"Feed",fields:[{id:"num-posts",component:Object(P.a)({label:"Number of posts",option:"numPosts",render:(e,t,a)=>{const n=e.previewDevice===h.a.Mode.DESKTOP;return o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:1,placeholder:n?"1":e.value.numPosts.desktop})}})},{id:"num-columns",component:Object(P.a)({label:"Number of columns",option:"numColumns",render:(e,t,a)=>{const n=e.previewDevice===h.a.Mode.DESKTOP;return o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:n?1:0,placeholder:n?"1":e.value.numColumns.desktop})}})},{id:"post-order",component:Object(P.a)({label:"Post order",option:"postOrder",render:(e,t,a)=>o.a.createElement(p.a,{id:e.field.id,value:t,onChange:e=>a(e.value),options:[{value:m.a.PostOrder.DATE_DESC,label:"Most recent first"},{value:m.a.PostOrder.DATE_ASC,label:"Oldest first"},{value:m.a.PostOrder.POPULARITY_DESC,label:"Most popular first"},{value:m.a.PostOrder.POPULARITY_ASC,label:"Least popular first"},{value:m.a.PostOrder.RANDOM,label:"Random"}]})})},{id:"media-type",isFakePro:!0,component:Object(P.a)({label:"Types of posts",option:"mediaType",render:e=>o.a.createElement(p.a,{id:e.field.id,value:m.a.MediaType.ALL,options:[{value:m.a.MediaType.ALL,label:"All posts"},{value:m.a.MediaType.PHOTOS,label:"Photos Only"},{value:m.a.MediaType.VIDEOS,label:"Videos Only"}]})})},{id:"link-behavior",component:Object(P.a)({label:"Open posts in",option:"linkBehavior",render:(e,t,a)=>o.a.createElement(p.a,{id:e.field.id,value:t,onChange:e=>a(e.value),options:[{value:m.a.LinkBehavior.NOTHING,label:"- Do not open -"},{value:m.a.LinkBehavior.SELF,label:"Same tab"},{value:m.a.LinkBehavior.NEW_TAB,label:"New tab"},{value:m.a.LinkBehavior.LIGHTBOX,label:"Popup box"}]})})}]},{id:"appearance",label:"Appearance",fields:[{id:"feed-width",component:Object(P.a)({label:"Feed width",option:"feedWidth",render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:0,unit:"px",emptyMin:!0,placeholder:"Auto"})})},{id:"feed-height",component:Object(P.a)({label:"Feed height",option:"feedHeight",render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:0,unit:"px",emptyMin:!0,placeholder:"Auto"})})},{id:"feed-padding",component:Object(P.a)({label:"Outside padding",option:"feedPadding",render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:0,unit:"px",placeholder:"No padding"})})},{id:"image-padding",component:Object(P.a)({label:"Image padding",option:"imgPadding",render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:0,unit:"px",placeholder:"No padding"})})},{id:"text-size",component:Object(P.a)({label:"Text size",option:"textSize",render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:0,unit:"px",placeholder:"Theme default"}),tooltip:()=>o.a.createElement("span",null,"If left empty, the text size will be controlled by your theme."," ",'This option will be ignored for the header if the "Text size" option in the'," ",'"Header" section is not empty.')})},{id:"bg-color",component:Object(P.a)({label:"Background color",option:"bgColor",render:(e,t,a)=>o.a.createElement(g.a,{id:e.field.id,value:t,onChange:e=>a(e.rgb)})})},{id:"hover-info",component:Object(P.a)({label:"Show on hover",option:"hoverInfo",render:(e,t,a)=>o.a.createElement(f.a,{id:e.field.id,value:t,onChange:a,showProOptions:e.showFakeOptions,options:e.field.data.options}),tooltip:()=>o.a.createElement("span",null,"Usernames are not available for hashtag posts, due to a restriction by Instagram.")}),data:{options:[{value:m.a.HoverInfo.LIKES_COMMENTS,label:"Likes & comments icons"},{value:m.a.HoverInfo.INSTA_LINK,label:"Instagram icon/link"},{value:m.a.HoverInfo.CAPTION,label:"Caption",isFakePro:!0},{value:m.a.HoverInfo.USERNAME,label:"Username",isFakePro:!0},{value:m.a.HoverInfo.DATE,label:"Date",isFakePro:!0}]}},{id:"hover-text-color",isFakePro:!0,component:Object(P.a)({label:"Hover text color",option:"textColorHover",render:e=>o.a.createElement(g.a,{id:e.field.id})})},{id:"hover-bg-color",isFakePro:!0,component:Object(P.a)({label:"Hover background color",option:"bgColorHover",render:e=>o.a.createElement(g.a,{id:e.field.id,value:{r:0,g:0,b:0,a:.5}})})}]},{id:"header",label:"Header",fields:[{id:"header-hashtag-msg",component:Object(l.a)(e=>I(e)&&o.a.createElement(E.a,{type:E.b.INFO,showIcon:!0,shake:!0},"The header is disabled because you are currently only showing posts from"," ","hashtags, so there are no accounts to show in the header."))},{id:"show-header",component:Object(P.a)({label:"Show header",option:"showHeader",disabled:e=>I(e),render:(e,t,a)=>o.a.createElement(v.a,{id:e.field.id,value:t,onChange:a})})},{id:"header-style",isFakePro:!0,component:Object(P.a)({label:"Header style",option:"headerStyle",render:e=>o.a.createElement(p.a,{id:e.field.id,value:m.a.HeaderStyle.NORMAL,options:[{value:m.a.HeaderStyle.NORMAL,label:"Normal"},{value:m.a.HeaderStyle.CENTERED,label:"Centered"}]})})},{id:"header-account",component:Object(P.a)({label:"Account to show",option:"headerAccount",deps:["showHeader"],disabled:e=>N(e),render:(e,t,a)=>o.a.createElement(p.a,{id:e.field.id,value:e.computed.account?e.computed.account.id:"",onChange:e=>a(e.value),options:e.computed.allAccounts.map(e=>({value:e,label:_.b.getById(e).username}))})})},{id:"header-info",component:Object(P.a)({label:"Show",option:"headerInfo",deps:["showHeader"],disabled:e=>N(e),render:(e,t,a)=>o.a.createElement(f.a,{id:e.field.id,value:t,onChange:a,options:e.field.data.options}),tooltip:()=>o.a.createElement("span",null,"Follower count is not available for Personal accounts due to restrictions set by Instagram.")}),data:{options:[{value:m.a.HeaderInfo.PROFILE_PIC,label:"Profile photo"},{value:m.a.HeaderInfo.BIO,label:"Profile bio text"},{value:T.MEDIA_COUNT,label:"Post count",isFakePro:!0},{value:T.FOLLOWERS,label:"Follower count",isFakePro:!0}]}},{id:"header-photo-size",component:Object(P.a)({label:"Profile photo size",option:"headerPhotoSize",deps:["showHeader","headerInfo"],disabled:e=>x(T.PROFILE_PIC,e),render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:null!=t?t:"",onChange:a,min:0,unit:"px",placeholder:"Default"})})},{id:"custom-profile-pic",component:Object(P.a)({label:"Custom profile pic",option:"customProfilePic",deps:["showHeader","headerInfo"],disabled:e=>x(T.PROFILE_PIC,e),render:(e,t,a)=>o.a.createElement(y,{id:e.field.id,value:t,onChange:a,title:"Select custom profile photo",buttonSet:"Choose custom photo",buttonChange:"Change custom photo",mediaType:"image"}),tooltip:()=>o.a.createElement("span",null,"Add a custom profile photo just for this feed. It will override the original"," ","profile photo from Instagram and any custom profile photo added in Spotlight.")})},{id:"custom-bio-text",component:Object(P.a)({label:"Custom bio text",option:"customBioText",deps:["headerInfo","showHeader"],disabled:e=>x(T.BIO,e),render:(e,t,a)=>o.a.createElement(C,{id:e.field.id,value:t,onChange:a}),tooltip:()=>o.a.createElement("span",null,"Add a custom bio text just for this feed. It will override the original custom bio"," ","text from Instagram and any custom bio text added in Spotlight.")})},{id:"header-text-size",component:Object(P.a)({label:"Header text size",option:"headerTextSize",deps:["showHeader"],disabled:e=>N(e),render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:null!=t?t:"",onChange:a,min:0,unit:"px",placeholder:"Default"}),tooltip:()=>o.a.createElement("span",null,'If left empty, the "Text size" option in the "Appearance" section will control the'," ","header's text size.")})},{id:"header-text-color",component:Object(P.a)({label:"Header text color",option:"headerTextColor",deps:["showHeader"],disabled:e=>N(e),render:(e,t,a)=>o.a.createElement(g.a,{id:e.field.id,value:t,onChange:e=>a(e.rgb)})})},{id:"header-bg-color",component:Object(P.a)({label:"Header background color",option:"headerBgColor",deps:["showHeader"],disabled:e=>N(e),render:(e,t,a)=>o.a.createElement(g.a,{id:e.field.id,value:t,onChange:e=>a(e.rgb)})})},{id:"header-padding",component:Object(P.a)({label:"Header padding",option:"headerPadding",deps:["showHeader"],disabled:e=>N(e),render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:0,unit:"px",placeholder:"No padding"})})},{id:"include-stories",isFakePro:!0,component:Object(P.a)({label:"Include stories",option:"includeStories",render:e=>o.a.createElement(v.a,{id:e.field.id,value:!0}),tooltip:()=>o.a.createElement("span",null,"Re-shared stories are not available due to a restriction by Instagram.")})},{id:"stories-interval",isFakePro:!0,component:Object(P.a)({label:"Stories interval time",option:"storiesInterval",render:e=>o.a.createElement(b.a,{id:e.field.id,value:5,min:1,unit:"sec"})})}]},{id:"lightbox",label:"Popup box",isFakePro:!0,fields:[{id:"show-lightbox-sidebar",component:Object(P.a)({label:"Show sidebar",option:"lightboxShowSidebar",render:e=>o.a.createElement(v.a,{id:e.field.id,value:!1})})},{id:"num-lightbox-comments",label:"Number of comments",component:Object(P.a)({label:"Number of comments",option:"numLightboxComments",render:e=>o.a.createElement(b.a,{id:e.field.id,value:20,min:0,placeholder:"No comments"}),tooltip:()=>o.a.createElement("span",null,"Comments are only available for posts from a ",o.a.createElement("strong",null,"Business")," account")})}]},{id:"captions",label:"Captions",isFakePro:!0,fields:[{id:"show-captions",component:Object(P.a)({label:"Show captions",option:"showCaptions",render:e=>o.a.createElement(v.a,{id:e.field.id,value:!0})})},{id:"caption-max-length",component:Object(P.a)({label:"Caption max length",option:"captionMaxLength",render:e=>o.a.createElement(b.a,{id:e.field.id,value:"",min:0,unit:"words",placeholder:"No limit"})})},{id:"caption-size",component:Object(P.a)({label:"Caption text size",option:"captionSize",render:e=>o.a.createElement(b.a,{id:e.field.id,value:"",min:0,unit:"px",placeholder:"Theme default"})})},{id:"caption-color",component:Object(P.a)({label:"Caption text color",option:"captionColor",render:e=>o.a.createElement(g.a,{id:e.field.id,value:{r:0,g:0,b:0,a:0}})})},{id:"caption-remove-dots",component:Object(P.a)({label:"Remove dot lines",option:"captionRemoveDots",render:e=>o.a.createElement(v.a,{id:e.field.id,value:!1}),tooltip:()=>o.a.createElement("span",null,'Enable this option to remove lines in captions that are only "dots", such as'," ",o.a.createElement("code",null,"."),", ",o.a.createElement("code",null,"•"),", ",o.a.createElement("code",null,"*"),", etc.")})}]},{id:"likes-comments",label:"Likes & Comments",isFakePro:!0,fields:[{id:"show-likes",component:Object(P.a)({label:"Show likes icon",option:"showLikes",render:e=>o.a.createElement(v.a,{id:e.field.id,value:!1})})},{id:"likes-icon-color",component:Object(P.a)({label:"Likes icon color",option:"likesIconColor",render:e=>o.a.createElement(g.a,{id:e.field.id,value:{r:0,g:0,b:0,a:1}})})},{id:"show-comments",component:Object(P.a)({label:"Show comments icon",option:"showComments",render:e=>o.a.createElement(v.a,{id:e.field.id,value:!1})})},{id:"comments-icon-color",component:Object(P.a)({label:"Comments icon color",option:"commentsIconColor",render:e=>o.a.createElement(g.a,{id:e.field.id,value:{r:0,g:0,b:0,a:1}})})},{id:"lcIconSize",component:Object(P.a)({label:"Icon size",option:"lcIconSize",render:e=>o.a.createElement(b.a,{id:e.field.id,value:"",min:0,unit:"px"})})}]},{id:"follow-btn",label:"Follow button",fields:[{id:"follow-btn-hashtag-msg",component:Object(l.a)(e=>I(e)&&o.a.createElement(E.a,{type:E.b.INFO,showIcon:!0,shake:!0},"The follow button is disabled because you are currently only showing posts from"," ","hashtags, so there are no accounts to follow."))},{id:"show-follow-btn",component:Object(P.a)({label:"Show 'Follow' button",option:"showFollowBtn",disabled:e=>I(e),render:(e,t,a)=>o.a.createElement(v.a,{id:e.field.id,value:t,onChange:a})})},{id:"follow-btn-location",component:Object(P.a)({label:"Location",option:"followBtnLocation",deps:["showFollowBtn"],disabled:e=>j(e),render:(e,t,a)=>o.a.createElement(p.a,{id:e.field.id,value:t,onChange:e=>a(e.value),options:[{value:F.HEADER,label:"Header"},{value:F.BOTTOM,label:"Bottom"},{value:F.BOTH,label:"Both"}]})})},{id:"follow-btn-text",component:Object(P.a)({label:"'Follow' text",option:"followBtnText",deps:["showFollowBtn"],disabled:e=>j(e),render:(e,t,a)=>o.a.createElement(O.a,{id:e.field.id,value:t,onChange:a})})},{id:"follow-btn-text-color",component:Object(P.a)({label:"Text color",option:"followBtnTextColor",deps:["showFollowBtn"],disabled:e=>j(e),render:(e,t,a)=>o.a.createElement(g.a,{id:e.field.id,value:t,onChange:e=>a(e.rgb)})})},{id:"follow-btn-bg-color",component:Object(P.a)({label:"Background color",option:"followBtnBgColor",deps:["showFollowBtn"],disabled:e=>j(e),render:(e,t,a)=>o.a.createElement(g.a,{id:e.field.id,value:t,onChange:e=>a(e.rgb)})})}]},{id:"load-more-btn",label:"Load more button",fields:[{id:"show-load-more-btn",component:Object(P.a)({label:"Show 'Load more' button",option:"showLoadMoreBtn",render:(e,t,a)=>o.a.createElement(v.a,{id:e.field.id,value:t,onChange:a})})},{id:"load-more-btn-text",component:Object(P.a)({label:"'Load more' text",option:"loadMoreBtnText",deps:["showLoadMoreBtn"],disabled:e=>M(e),render:(e,t,a)=>o.a.createElement(O.a,{id:e.field.id,value:t,onChange:a})})},{id:"load-more-btn-text-color",component:Object(P.a)({label:"Text color",option:"loadMoreBtnTextColor",deps:["showLoadMoreBtn"],disabled:e=>M(e),render:(e,t,a)=>o.a.createElement(g.a,{id:e.field.id,value:t,onChange:e=>a(e.rgb)})})},{id:"load-more-btn-bg-color",component:Object(P.a)({label:"Background color",option:"loadMoreBtnBgColor",deps:["showLoadMoreBtn"],disabled:e=>M(e),render:(e,t,a)=>o.a.createElement(g.a,{id:e.field.id,value:t,onChange:e=>a(e.rgb)})})}]}]},185:function(e,t,a){e.exports={root:"MediaGridPicker__root",loading:"MediaGridPicker__loading layout__fill-parent",grid:"MediaGridPicker__grid","grid-disabled":"MediaGridPicker__grid-disabled MediaGridPicker__grid",gridDisabled:"MediaGridPicker__grid-disabled MediaGridPicker__grid",item:"MediaGridPicker__item"}},205:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(0),o=a.n(n),l=a(83),i=a(11);function r({id:e,value:t,onChange:a,showProOptions:n,options:r}){const c=new Set(t.map(e=>e.toString())),s=e=>{const t=e.target.value,n=e.target.checked,o=r.find(e=>e.value.toString()===t);o.isFakePro||o.isDisabled||(n?c.add(t):c.delete(t),a&&a(Array.from(c)))};return o.a.createElement("div",{className:"checkbox-list"},r.filter(e=>!!e).map((t,a)=>{var r;if(t.isFakePro&&!n)return null;const d=Object(i.a)("checkbox-list__option",{"--disabled":t.isDisabled||t.isFakePro});return o.a.createElement("label",{className:d,key:a},o.a.createElement("input",{type:"checkbox",id:e,value:null!==(r=t.value.toString())&&void 0!==r?r:"",checked:c.has(t.value.toString()),onChange:s,disabled:t.isDisabled||t.isFakePro}),o.a.createElement("span",null,t.label),t.isFakePro&&o.a.createElement("div",{className:"checkbox-list__pro-pill"},o.a.createElement(l.a,null)))}))}a(598)},208:function(e,t,a){e.exports={root:"LayoutSelector__root","coming-soon":"LayoutSelector__coming-soon",comingSoon:"LayoutSelector__coming-soon",layout:"LayoutSelector__layout button__toggle-button button__panel-button theme__panel","layout-selected":"LayoutSelector__layout-selected LayoutSelector__layout button__toggle-button button__panel-button theme__panel button__toggle-button-on button__toggle-button button__panel-button theme__panel",layoutSelected:"LayoutSelector__layout-selected LayoutSelector__layout button__toggle-button button__panel-button theme__panel button__toggle-button-on button__toggle-button button__panel-button theme__panel"}},210:function(e,t,a){e.exports={"moderate-viewport":"ModerateViewport__moderate-viewport",moderateViewport:"ModerateViewport__moderate-viewport","moderate-blacklist":"ModerateViewport__moderate-blacklist ModerateViewport__moderate-viewport",moderateBlacklist:"ModerateViewport__moderate-blacklist ModerateViewport__moderate-viewport","moderate-whitelist":"ModerateViewport__moderate-whitelist ModerateViewport__moderate-viewport",moderateWhitelist:"ModerateViewport__moderate-whitelist ModerateViewport__moderate-viewport",loading:"ModerateViewport__loading layout__fill-parent",grid:"ModerateViewport__grid","grid-disabled":"ModerateViewport__grid-disabled ModerateViewport__grid",gridDisabled:"ModerateViewport__grid-disabled ModerateViewport__grid",item:"ModerateViewport__item","item-allowed":"ModerateViewport__item-allowed ModerateViewport__item",itemAllowed:"ModerateViewport__item-allowed ModerateViewport__item","item-thumbnail":"ModerateViewport__item-thumbnail",itemThumbnail:"ModerateViewport__item-thumbnail","item-removed":"ModerateViewport__item-removed ModerateViewport__item",itemRemoved:"ModerateViewport__item-removed ModerateViewport__item","item-focused":"ModerateViewport__item-focused",itemFocused:"ModerateViewport__item-focused"}},211:function(e,t,a){e.exports={item:"PromoteTile__item",selected:"PromoteTile__selected PromoteTile__item",thumbnail:"PromoteTile__thumbnail",unselected:"PromoteTile__unselected PromoteTile__item",icon:"PromoteTile__icon"}},22:function(e,t,a){"use strict";var n=a(0),o=a.n(n),l=a(51),i=a(84),r=a(249),c=a.n(r),s=a(2),d=a(5),u=a(10);function m({option:e,children:t,value:a,previewDevice:n,onChange:l,onChangeDevice:i}){const r=o.a.useCallback(t=>{l({[e]:s.a.isValid(a[e])?s.a.withValue(a[e],t,n):t})},[a[e],n,l]),m=s.a.isValid(a[e]),p=m?s.a.get(a[e],n,!0):a[e];return o.a.createElement("div",{className:c.a.propField},m&&o.a.createElement("div",{className:c.a.deviceBtn},o.a.createElement(d.a,{type:d.c.PILL,size:d.b.NORMAL,onClick:()=>i(s.a.cycle(n)),tooltip:""},o.a.createElement(u.a,{icon:s.a.getIcon(n)}))),o.a.createElement("div",{className:c.a.field},t(p,r)))}t.a=function({label:e,option:t,render:a,memo:n,deps:r,when:c,disabled:s,tooltip:d}){return n=null==n||n,c=null!=c?c:()=>!0,s=null!=s?s:()=>!1,(r=null!=r?r:[]).includes(t),Object(l.a)(n=>c(n)&&o.a.createElement(i.a,Object.assign({},n,{label:e,disabled:s(n),isFakePro:n.field.isFakePro}),o.a.createElement(m,Object.assign({},n,{option:t}),(e,t)=>a(n,e,t)),d&&d(n)),n?[t].concat(r):[])}},230:function(e,t,a){"use strict";a.d(t,"a",(function(){return u}));var n=a(0),o=a.n(n),l=a(133),i=a.n(l),r=a(4),c=a(10),s=a(20),d=a(6);const u=Object(d.b)((function({accounts:e,value:t,onChange:a}){t=null!=t?t:[],e=null!=e?e:r.b.list;const n=t.filter(t=>e.some(e=>e.id===t)),l=new Set(n);return o.a.createElement("div",{className:i.a.root},e.map((e,t)=>o.a.createElement(m,{key:t,account:e,selected:l.has(e.id),onChange:t=>{return n=e.id,t?l.add(n):l.delete(n),void a(Array.from(l));var n}})))}));function m({account:e,selected:t,onChange:a}){const n=`url("${r.b.getProfilePicUrl(e)}")`,l=()=>{a(!t)},d=Object(s.f)(l);return o.a.createElement("div",{className:i.a.row},o.a.createElement("div",{className:t?i.a.accountSelected:i.a.account,onClick:l,onKeyPress:d,role:"button",tabIndex:0},o.a.createElement("div",{className:i.a.profilePic,style:{backgroundImage:n}}),o.a.createElement("div",{className:i.a.infoColumn},o.a.createElement("div",{className:i.a.username},e.username),o.a.createElement("div",{className:i.a.accountType},e.type)),t&&o.a.createElement(c.a,{icon:"yes-alt",className:i.a.tickIcon})))}},231:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(0),o=a.n(n),l=a(230),i=a(23),r=a(4);function c(e){const t=r.b.getBusinessAccounts();return t.length>0?o.a.createElement(l.a,Object.assign({accounts:t},e)):o.a.createElement(i.a,{type:i.b.WARNING},"Connect a business account to use this feature.")}},232:function(e,t,a){"use strict";a.d(t,"a",(function(){return h}));var n,o=a(0),l=a.n(o),i=a(56),r=a(7),c=a(48),s=a(23),d=(a(433),a(5)),u=a(10),m=a(244),p=a(3),b=a(11);function h({value:e,onChange:t}){const a=(e=null!=e?e:[]).slice(),o=a.map(e=>({id:e.tag,tag:e.tag,sort:e.sort})),[i,r]=l.a.useState(""),[c,s]=l.a.useState(""),[d,u]=l.a.useState(null);return l.a.createElement("div",{className:"hashtag-selector"},l.a.createElement(m.a,{className:"hashtag-selector__list",list:o,setList:e=>{const n=e.map(e=>({tag:e.tag,sort:e.sort}));t&&!Object(p.e)(n,a,(e,t)=>e.tag===t.tag&&e.sort===t.sort)&&t(n)},handle:".hashtag-selector__drag-handle",animation:200,delay:1e3,fallbackTolerance:5,delayOnTouchOnly:!0},a.map((e,n)=>l.a.createElement(g,{key:n,disabled:null!==d&&d!==n,hashtag:e,onEdit:e=>((e,n)=>{a[e]=n,t&&t(a)})(n,e),onDelete:()=>(e=>{a.splice(e,1),t&&t(a)})(n),onStartEdit:()=>u(n),onStopEdit:()=>u(null)}))),l.a.createElement(E,{type:n.ADD,disabled:null!==d,hashtag:{tag:i,sort:c},onDone:e=>{a.push(e),t&&t(a),r(""),s("")}}))}function g({hashtag:e,disabled:t,onEdit:a,onDelete:o,onStartEdit:i,onStopEdit:r}){const[c,s]=l.a.useState(!1),d=()=>{s(!1),r&&r()};return c?l.a.createElement(E,{type:n.EDIT,disabled:t,hashtag:e,onDone:e=>{a&&a(e),d()},onCancel:d}):l.a.createElement(f,{hashtag:e,disabled:t,onEdit:()=>{s(!0),i&&i()},onDelete:o})}function f({hashtag:e,disabled:t,onEdit:a,onDelete:n}){const o=Object(b.a)("hashtag-selector__row",{"--static":!0,"--disabled":t});return l.a.createElement("div",{className:o},l.a.createElement("div",{className:"hashtag-selector__drag-handle"},l.a.createElement(u.a,{icon:"menu"})),l.a.createElement("div",{className:"hashtag-selector__tag"},r.a.HashtagSorting.get(e.sort)," posts with ",l.a.createElement("strong",null,"#",e.tag)),l.a.createElement("div",{className:"hashtag-selector__buttons"},l.a.createElement(d.a,{className:"hashtag-selector__edit-btn",type:d.c.PILL,onClick:a,tooltip:"Edit hashtag"},l.a.createElement(u.a,{icon:"edit"})),l.a.createElement(d.a,{className:"hashtag-selector__delete-btn",type:d.c.DANGER_PILL,onClick:n,tooltip:"Remove hashtag"},l.a.createElement(u.a,{icon:"trash"}))))}function E({type:e,hashtag:t,disabled:a,onChange:m,onDone:p,onCancel:h,focus:g}){const f=e===n.ADD,[E,v]=l.a.useState({tag:"",sort:"recent"});Object(o.useEffect)(()=>{var e;v({tag:null!==(e=t.tag)&&void 0!==e?e:"",sort:t.sort?t.sort:"recent"})},[t]);const[_,w]=l.a.useState(0),[k,y]=l.a.useState(!0);Object(o.useEffect)(()=>{if(y(!1),_>0){const e=setTimeout(()=>y(!0),10),t=setTimeout(()=>y(!1),310);return()=>{clearTimeout(e),clearTimeout(t)}}},[_]);const C=()=>{!_&&p&&p(E)},O=Object(b.a)("hashtag-selector__row",{"--disabled":a});return l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{className:O},l.a.createElement("input",{className:"hashtag-selector__tag",type:"text",value:"#"+E.tag,onChange:e=>{const t=e.target.value.slice(1),a={tag:Object(c.b)(t),sort:E.sort};w(t!==a.tag?Date.now():0),v(a),m&&m(a)},onKeyDown:e=>{switch(e.key){case"Enter":C();break;case"Escape":h&&h()}},autoFocus:g}),l.a.createElement(i.a,{className:"hashtag-selector__sort",placeholder:"Sort by",value:E.sort,onChange:e=>{v({tag:E.tag,sort:e.value}),m&&m({tag:E.tag,sort:e.value})},isSearchable:!1,options:Array.from(r.a.HashtagSorting.entries()).map(([e,t])=>({value:e,label:t}))}),l.a.createElement("div",{className:"hashtag-selector__buttons"},f?l.a.createElement(d.a,{type:d.c.PRIMARY,className:"hashtag-selector__add-btn",tooltip:"Add new hashtag",onClick:C,disabled:0===E.tag.length},"Add"):l.a.createElement(d.a,{type:f?d.c.PRIMARY:d.c.PILL,className:"hashtag-selector__done-btn",tooltip:"Done",disabled:0===E.tag.length,onClick:C},l.a.createElement(u.a,{icon:"yes"})),!f&&l.a.createElement(d.a,{type:d.c.DANGER_PILL,className:"hashtag-selector__cancel-btn",onClick:h,tooltip:"Cancel changes"},l.a.createElement(u.a,{icon:"no"})))),_?l.a.createElement(s.a,{type:s.b.ERROR,shake:k,showIcon:!0,isDismissible:!0,onDismiss:()=>w(0)},"Hashtags may only contain letters, numbers and underscores"):null)}!function(e){e[e.ADD=0]="ADD",e[e.EDIT=1]="EDIT"}(n||(n={}))},233:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(0),o=a.n(n),l=a(179);function i(e){return o.a.createElement(l.a,Object.assign({groups:e.tab.groups},e))}},234:function(e,t,a){"use strict";a.d(t,"a",(function(){return h}));var n=a(0),o=a.n(n),l=a(56),i=a(12),r=a(14),c=(a(19),a(138)),s=a(84),d=a(67),u=a(180),m=a(3);const p=[],b={linkType:"",postId:0,postTitle:"",postUrl:"",url:"",linkText:"",newTab:!1,linkDirectly:!0};function h({config:e,onChange:t}){e=null!=e?e:b,e=Object.assign(Object.assign({},b),e),0===p.length&&(p.push({value:"",label:"- Do not link -"},{value:"url",label:"Custom URL"}),r.a.config.postTypes.forEach(e=>{"attachment"!==e.name&&p.push({value:e.name,label:e.labels.singular_name})}));const a=o.a.useRef(),l=o.a.useRef(!1),i=o.a.useRef(),[s,d]=o.a.useState([]),[u,m]=o.a.useState(!1);Object(n.useEffect)(()=>(l.current=!1,e.linkType&&"url"!==e.linkType&&(m(!0),S("").then(e=>{l.current||d(e)}).finally(()=>{l.current||m(!1)})),()=>l.current=!0),[e.linkType]);const h=o.a.useCallback(a=>{t({linkType:a,postId:0,postTitle:"",postUrl:"",url:e.url,newTab:e.newTab,linkText:e.linkText})},[e,t]),k=o.a.useCallback(a=>{if(null===a)t(Object.assign(Object.assign({},e),{postId:0,postTitle:"",postUrl:""}));else{const n=i.current.find(e=>e.id==a.value);t(Object.assign(Object.assign({},e),{postId:a.value,postTitle:n.title,postUrl:n.permalink}))}},[e,t]),y=o.a.useCallback(a=>{t(Object.assign(Object.assign({},e),{url:a}))},[e,t]),C=o.a.useCallback(a=>{t(Object.assign(Object.assign({},e),{newTab:a}))},[e,t]),O=o.a.useCallback(a=>{t(Object.assign(Object.assign({},e),{linkDirectly:a}))},[e,t]),P=o.a.useCallback(a=>{t(Object.assign(Object.assign({},e),{linkText:a}))},[e,t]),S=o.a.useCallback(t=>(clearTimeout(a.current),new Promise(n=>{a.current=setTimeout(()=>{r.a.restApi.searchPosts(t,e.linkType).then(e=>{i.current=e.data,n(e.data.map(e=>({value:e.id,label:e.title})))}).catch(e=>{})},1e3)})),[e.linkType]),F=r.a.config.postTypes.find(t=>t.name===e.linkType);return o.a.createElement(o.a.Fragment,null,o.a.createElement(g,{value:e.linkType,onChange:h}),"url"===e.linkType&&o.a.createElement(f,{value:e.url,onChange:y}),e.linkType&&"url"!==e.linkType&&o.a.createElement(E,{postType:F,postId:e.postId,postTitle:e.postTitle,onChange:k,loadOptions:S,isLoading:u,defaultPosts:s}),e.linkType&&o.a.createElement(v,{value:e.linkDirectly,onChange:O}),e.linkType&&o.a.createElement(_,{value:e.newTab,onChange:C}),e.linkType&&o.a.createElement(w,{value:e.linkText,onChange:P,placeholder:c.a.getDefaultLinkText(e)}))}const g=o.a.memo((function({value:e,onChange:t}){return o.a.createElement(s.a,{id:"promo-link-to",label:"Link to"},o.a.createElement(l.a,{id:"promo-link-to",value:e||"",onChange:e=>t(e.value),options:p,isCreatable:!1}))})),f=o.a.memo((function({value:e,onChange:t}){return o.a.createElement(s.a,{id:"link-promo-url",label:"URL",wide:!0},o.a.createElement(u.a,{id:"link-promo-url",value:e,onChange:t}))})),E=o.a.memo((function({postType:e,postId:t,postTitle:a,onChange:n,defaultPosts:i,isLoading:r,loadOptions:c}){const d=e?"Search for a "+e.labels.singular_name:"Search";return o.a.createElement(s.a,{id:"link-promo-url",label:d,wide:!0},o.a.createElement(l.a,{async:!0,cacheOptions:!0,key:Object(m.u)(),id:"sli-promo-search-post",placeholder:"Select or start typing...",value:t||0,defaultValue:0,defaultInputValue:t?a:"",onChange:n,defaultOptions:i,loadOptions:c,noOptionsMessage:({inputValue:e})=>e.length?`No posts were found for "${e}"`:"Type to search for posts",loadingMessage:()=>"Searching...",isLoading:r,isSearchable:!0,isClearable:!0}))})),v=o.a.memo((function({value:e,onChange:t}){return o.a.createElement(s.a,{id:"promo-link-directly",label:"Link directly"},o.a.createElement(d.a,{id:"promo-link-directly",value:e,onChange:t}),o.a.createElement(o.a.Fragment,null,o.a.createElement("p",null,"Tick this box to make posts go directly to the link. If left unticked, posts will open the popup box."),o.a.createElement("p",null,"To enable your feed's popup box and sidebar:"),o.a.createElement("ol",{style:{marginLeft:15}},o.a.createElement("li",null,"Set the ",o.a.createElement("b",null,"Design » Feed » Open posts in")," option to ",o.a.createElement("b",null,"Popup box")),o.a.createElement("li",null,"Enable the ",o.a.createElement("b",null,"Design » Popup box » Show sidebar")," option."))))})),_=o.a.memo((function({value:e,onChange:t}){return o.a.createElement(s.a,{id:"promo-link-new-tab",label:"Open in a new tab"},o.a.createElement(d.a,{id:"promo-link-new-tab",value:e,onChange:t}))})),w=o.a.memo((function({value:e,onChange:t,placeholder:a}){return o.a.createElement(s.a,{id:"promo-link-text",label:"Popup box link text"},o.a.createElement(u.a,{id:"promo-link-text",value:e,onChange:t,placeholder:a}),o.a.createElement(o.a.Fragment,null,o.a.createElement("p",null,"The text to use for the link in the popup box sidebar:",o.a.createElement("br",null),o.a.createElement("img",{src:i.a.image("popup-link-text.png"),alt:""})),o.a.createElement("p",null,"Remember to enable your feed's popup box and sidebar, like so:"),o.a.createElement("ol",{style:{marginLeft:15}},o.a.createElement("li",null,"Set the ",o.a.createElement("b",null,"Design » Feed » Open posts in")," option to ",o.a.createElement("b",null,"Popup box")),o.a.createElement("li",null,"Enable the ",o.a.createElement("b",null,"Design » Popup box » Show sidebar")," option."))))}))},235:function(e,t,a){"use strict";a.d(t,"a",(function(){return u}));var n=a(0),o=a.n(n),l=a(211),i=a.n(l),r=a(8),c=a(73),s=a(10),d=a(3);const u=o.a.memo((function({media:e,selected:t,promo:a}){const n=r.a.getType(a),l=r.a.getConfig(a),d=n&&n.isValid(l)&&n.getIcon?n.getIcon(e,l):void 0;return o.a.createElement("div",{className:t?i.a.selected:i.a.unselected},o.a.createElement(c.a,{media:e,className:i.a.thumbnail}),d&&o.a.createElement(s.a,{className:i.a.icon,icon:d}))}),(function(e,t){return e.selected===t.selected&&e.media.id===t.media.id&&r.a.getType(e.promo)==r.a.getType(e.promo)&&Object(d.c)(r.a.getConfig(e.promo),r.a.getConfig(t.promo))}))},236:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(0),o=a.n(n),l=a(295),i=a.n(l),r=a(73);function c({media:e}){return o.a.createElement("div",{className:i.a.container},o.a.createElement("div",{className:i.a.sizer},o.a.createElement(r.a,{media:e})))}},240:function(e,t,a){"use strict";a.d(t,"a",(function(){return T}));var n=a(0),o=a.n(n),l=a(292),i=a.n(l),r=a(90),c=a(252),s=a.n(c),d=a(7),u=a(83),m=a(377),p=a(23),b=a(65),h=a(94);const g=o.a.memo((function({value:e,onChange:t,tab:a}){const[n,l]=o.a.useState(!1);function i(){l(!1)}const r=e.moderationMode===d.a.ModerationMode.WHITELIST;return o.a.createElement(h.a,{padded:!0},o.a.createElement("div",null,o.a.createElement("p",null,"You can choose to hide specific posts or to only show posts that you choose."),o.a.createElement("p",null,"Choose the type of moderation that you wish to apply, then simply click on the posts that you "," ","want to show or hide. Posts that appear in grey will not be shown in the feed."),o.a.createElement("hr",null),o.a.createElement("div",{className:s.a.mode},a.isFakePro&&o.a.createElement("div",{className:s.a.proPill},o.a.createElement(u.a,null)),o.a.createElement(m.a,{name:"manualFilterMode",value:e.moderationMode,onChange:function(n){a.isFakePro||t({moderationMode:n,moderation:e.moderation})},disabled:a.isFakePro,options:[{value:d.a.ModerationMode.BLACKLIST,label:"Hide the selected posts"},{value:d.a.ModerationMode.WHITELIST,label:"Only show the selected posts"}]})),(e.moderation.length>0||r)&&o.a.createElement("a",{className:s.a.reset,onClick:function(){l(!0)}},"Reset moderation")),!a.isFakePro&&o.a.createElement("div",null,o.a.createElement("hr",null),o.a.createElement(p.a,{type:p.b.PRO_TIP,showIcon:!0},o.a.createElement("span",null,o.a.createElement("strong",null,"Pro tip"),":"," ","You can navigate the posts using arrow keys and select them by pressing Enter."))),o.a.createElement(b.a,{isOpen:n,title:"Are you sure?",buttons:["Yes","No"],onAccept:function(){a.isFakePro||(i(),t({moderationMode:d.a.ModerationMode.BLACKLIST,moderation:[]}))},onCancel:i},o.a.createElement("p",null,"Are you sure you want to reset your moderation settings? This cannot be undone.")))}),(e,t)=>e.value.moderationMode===t.value.moderationMode&&e.value.moderation.length===t.value.moderation.length);var f=a(210),E=a.n(f),v=a(73),_=a(82),w=a(3),k=a(177),y=a(11),C=d.a.ModerationMode;const O=o.a.memo((function({value:e,feed:t,tab:a,onChange:n}){const[l,i]=o.a.useState(0),r=new Set(e.moderation);return o.a.createElement(k.a,{feed:t,selected:l,onSelectMedia:(e,t)=>i(t),onClickMedia:function(t){if(a.isFakePro||!t)return;const o=new Set(e.moderation);o.has(t.id)?o.delete(t.id):o.add(t.id),n({moderation:Array.from(o),moderationMode:e.moderationMode})},autoFocusFirst:!0,disabled:a.isFakePro,store:_.c},(t,a)=>o.a.createElement(P,{media:t,mode:e.moderationMode,focused:a===l,selected:r.has(t.id)}))}),(function(e,t){return e.value.moderationMode===t.value.moderationMode&&e.value.moderation.length===t.value.moderation.length&&Object(w.e)(e.value.moderation,t.value.moderation)})),P=o.a.forwardRef(({media:e,selected:t,focused:a,mode:l},i)=>{i||(i=o.a.useRef()),Object(n.useEffect)(()=>{a&&i.current.focus()},[a]);const r=l===C.BLACKLIST,c=Object(y.b)(t!==r?E.a.itemAllowed:E.a.itemRemoved,a?E.a.itemFocused:null);return o.a.createElement("div",{ref:i,className:c},o.a.createElement(v.a,{media:e,className:E.a.itemThumbnail}))});var S=a(5),F=a(10);function T(e){const[t,a]=Object(n.useState)("content"),l=()=>a("sidebar"),c=()=>a("content");return o.a.createElement(r.a,{primary:"content",current:t,sidebar:t=>o.a.createElement(o.a.Fragment,null,t&&o.a.createElement(r.a.Navigation,{onClick:c}),o.a.createElement(g,Object.assign({},e))),content:t=>o.a.createElement("div",{className:i.a.viewport},t&&o.a.createElement("div",{className:i.a.mobileViewportHeader},o.a.createElement(S.a,{onClick:l},o.a.createElement(F.a,{icon:"admin-generic"}),o.a.createElement("span",null,"Moderation options"))),o.a.createElement(O,Object.assign({},e)))})}},241:function(e,t,a){"use strict";a.d(t,"a",(function(){return N}));var n=a(0),o=a.n(n),l=a(293),i=a.n(l),r=a(56),c=a(99),s=a(8),d=a(234),u=a(23),m=a(3),p=a(84),b=a(67),h=a(7),g=a(15),f=a(205),E=a(178);const v={id:"link",label:"Link",component:d.a,isValid:()=>!1},_={type:"link",config:{linkType:"url",url:"https://your-promotion-url.com",linkText:"Check out my promotion"}};function w({value:e,tab:t,onChange:a,selected:n,onNextPost:l,promoTypeRef:d}){const f=c.a.mediaStore.media[n],w=n>=c.a.mediaStore.media.length-1,k=o.a.useRef(g.a.isEmpty(e.promotions)?"link":g.a.values(e.promotions)[0].type),C=o.a.useCallback(n=>{if(!t.isFakePro){k.current=n.value;const t=g.a.map(e.promotions,e=>({type:n.value,config:s.a.getConfig(e)}));a({promotions:t})}},[t,e.promotions]),O=o.a.useCallback(o=>{if(!t.isFakePro){const t=c.a.mediaStore.media[n],l={type:k.current,config:Object(m.h)(o)},i=g.a.withEntry(e.promotions,t.id,l);a({promotions:i})}},[n,t.isFakePro]),P=o.a.useCallback(()=>{!t.isFakePro&&l()},[t.isFakePro]),S=t.isFakePro?_:h.a.getFeedPromo(f,e),F=t.isFakePro?v:s.a.getTypeById(k.current),T=s.a.getConfig(S),N=void 0!==s.a.getGlobalPromo(f)&&e.globalPromotionsEnabled,x=void 0!==s.a.getAutoPromo(f)&&e.autoPromotionsEnabled,I=s.a.getTypes().map(e=>({value:e.id,label:e.label}));return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:i.a.top},o.a.createElement("p",null,"Promote your blog posts, landing pages, products, and much more through your Instagram feed."),o.a.createElement("hr",null),o.a.createElement(p.a,{id:"enable-promo",label:"Enable promotion"},o.a.createElement(b.a,{value:e.promotionEnabled,onChange:e=>a({promotionEnabled:e})})),!e.promotionEnabled&&o.a.createElement(u.a,{type:u.b.WARNING,showIcon:!0},"All feed, global and automated promotions are disabled."," ","Promotions may still be edited but will not apply to posts in this feed."),o.a.createElement(y,{options:e,onChange:a}),o.a.createElement(p.a,{id:"promo-type",label:"Promotion type"},o.a.createElement(r.a,{id:"sli-promo-type",ref:d,value:F.id,onChange:C,options:I,isSearchable:!1,isCreatable:!1,isClearable:!1,disabled:t.isFakePro}))),o.a.createElement(E.a,{key:f?f.id:void 0,type:F,config:T,onChange:O,hasGlobal:N,hasAuto:x,showTutorial:!f,showNextBtn:"-more-"!==F.id,isNextBtnDisabled:w,onNext:P}),t.isFakePro&&o.a.createElement("div",{className:i.a.disabledOverlay}))}const k=[{value:"global",label:"Global promotions"},{value:"auto",label:"Automated promotions"}];function y({options:e,onChange:t}){const a=Object(n.useCallback)(e=>{t({globalPromotionsEnabled:e.includes("global"),autoPromotionsEnabled:e.includes("auto")})},[t]),l=[e.globalPromotionsEnabled?"global":0,e.autoPromotionsEnabled?"auto":0];return o.a.createElement(p.a,{id:"enable-other-promos",label:"Include other promotions",disabled:!e.promotionEnabled},o.a.createElement(f.a,{value:l,onChange:a,options:k}))}var C=a(177),O=a(235);const P=o.a.memo((function({value:e,feed:t,tab:a,selected:n,onSelectMedia:l,onClickMedia:i}){return o.a.createElement(C.a,{feed:t,store:c.a.mediaStore,selected:n,onSelectMedia:l,onClickMedia:i,disabled:a.isFakePro},(t,a)=>{const l=h.a.getPromo(t,e);return o.a.createElement(O.a,{media:t,selected:a===n,promo:l})})}),(function(e,t){return e.selected===t.selected&&e.onSelectMedia===t.onSelectMedia&&e.onClickMedia===t.onClickMedia&&e.value.promotionEnabled===t.value.promotionEnabled&&e.value.autoPromotionsEnabled===t.value.autoPromotionsEnabled&&e.value.globalPromotionsEnabled===t.value.globalPromotionsEnabled&&g.a.size(e.value.promotions)===g.a.size(t.value.promotions)&&e.feed.media.length===t.feed.media.length&&e.value.promotions===t.value.promotions}));var S=a(90),F=a(94),T=a(236);function N(e){const[t,a]=o.a.useState(null),[n,l]=o.a.useState(!1),i=()=>l(!1),r=o.a.useRef(),s=o.a.useCallback(()=>{a(e=>Math.min(e+1,c.a.mediaStore.media.length-1))},[]),d=o.a.useCallback((e,t)=>{a(t)},[]),u=o.a.useCallback((e,t)=>{a(t),l(!0),requestAnimationFrame(()=>{r.current&&null!==t&&r.current.focus()})},[r]);return o.a.createElement(S.a,{primary:"content",current:n?"sidebar":"content",sidebar:a=>o.a.createElement(o.a.Fragment,null,a&&o.a.createElement(o.a.Fragment,null,o.a.createElement(S.a.Navigation,{onClick:i}),c.a.mediaStore.media[t]&&o.a.createElement(T.a,{media:c.a.mediaStore.media[t]})),o.a.createElement(F.a,null,o.a.createElement(w,Object.assign({},e,{selected:t,onNextPost:s,promoTypeRef:r})))),content:a=>o.a.createElement(o.a.Fragment,null,a&&o.a.createElement("div",{style:{textAlign:"center"}},o.a.createElement("p",null,"Click or tap a post to set up a promotion for it")),o.a.createElement(P,Object.assign({},e,{selected:t,onSelectMedia:d,onClickMedia:u})))})}},249:function(e,t,a){e.exports={"prop-field":"EditorPropField__prop-field",propField:"EditorPropField__prop-field","device-btn":"EditorPropField__device-btn",deviceBtn:"EditorPropField__device-btn",field:"EditorPropField__field"}},250:function(e,t,a){e.exports={"filter-field":"FilterFieldRow__filter-field",filterField:"FilterFieldRow__filter-field",bordered:"FilterFieldRow__bordered FilterFieldRow__filter-field",label:"FilterFieldRow__label"}},251:function(e,t,a){e.exports={"inc-global-filters":"IncGlobalFiltersField__inc-global-filters",incGlobalFilters:"IncGlobalFiltersField__inc-global-filters",label:"IncGlobalFiltersField__label",field:"IncGlobalFiltersField__field"}},252:function(e,t,a){e.exports={mode:"ModerateSidebar__mode","pro-pill":"ModerateSidebar__pro-pill",proPill:"ModerateSidebar__pro-pill",reset:"ModerateSidebar__reset"}},254:function(e,t,a){e.exports={root:"FeedEditor__root",hidden:"FeedEditor__hidden",content:"FeedEditor__content","accounts-onboarding":"FeedEditor__accounts-onboarding",accountsOnboarding:"FeedEditor__accounts-onboarding"}},255:function(e,t,a){e.exports={navbar:"EditorNavbar__navbar layout__z-high","fake-pro-item":"EditorNavbar__fake-pro-item",fakeProItem:"EditorNavbar__fake-pro-item","pro-pill":"EditorNavbar__pro-pill",proPill:"EditorNavbar__pro-pill"}},288:function(e,t,a){e.exports={"connect-button":"ConnectSidebar__connect-button",connectButton:"ConnectSidebar__connect-button","connect-sidebar":"ConnectSidebar__connect-sidebar",connectSidebar:"ConnectSidebar__connect-sidebar","connect-account":"ConnectSidebar__connect-account",connectAccount:"ConnectSidebar__connect-account"}},289:function(e,t,a){e.exports={"field-group":"FieldGroup__field-group",fieldGroup:"FieldGroup__field-group",spoiler:"FieldGroup__spoiler","pro-pill":"FieldGroup__pro-pill",proPill:"FieldGroup__pro-pill",disabled:"FieldGroup__disabled"}},292:function(e,t,a){e.exports={viewport:"ModerateTab__viewport","mobile-viewport-header":"ModerateTab__mobile-viewport-header",mobileViewportHeader:"ModerateTab__mobile-viewport-header"}},293:function(e,t,a){e.exports={top:"PromoteSidebar__top",row:"PromoteSidebar__row","disabled-overlay":"PromoteSidebar__disabled-overlay",disabledOverlay:"PromoteSidebar__disabled-overlay"}},294:function(e,t,a){e.exports={bottom:"PromotionFields__bottom","remove-promo":"PromotionFields__remove-promo",removePromo:"PromotionFields__remove-promo"}},295:function(e,t,a){e.exports={container:"PromotePreviewTile__container",sizer:"PromotePreviewTile__sizer"}},369:function(e,t,a){e.exports={"field-group-list":"FieldGroupList__field-group-list",fieldGroupList:"FieldGroupList__field-group-list"}},372:function(e,t,a){e.exports={"preview-options":"DesignSidebar__preview-options",previewOptions:"DesignSidebar__preview-options"}},383:function(e,t,a){e.exports={viewport:"EditorViewport__viewport"}},384:function(e,t,a){"use strict";a.d(t,"a",(function(){return f}));var n=a(0),o=a.n(n),l=a(135),i=a.n(l),r=a(85),c=a(14),s=a(23),d=a(55),u=a(238),m=a(5),p=a(12),b=a(26),h=a(229),g=b.a.SavedFeed;function f({name:e}){const t=g.getLabel(e),a=`[instagram feed="${r.a.feed.id}"]`,n=c.a.config.adminUrl+"/widgets.php",l=c.a.config.adminUrl+"/customize.php?autofocus%5Bpanel%5D=widgets";return r.a.feed.id?o.a.createElement("div",{className:i.a.embedSidebar},r.a.feed.usages.length>0&&o.a.createElement(d.a,{label:"Instances",defaultOpen:!0,fitted:!0,scrollIntoView:!0},o.a.createElement("div",{className:i.a.instances},o.a.createElement("p",null,"This feed is currently being shown in these pages:"),o.a.createElement("ul",null,r.a.feed.usages.map((e,t)=>o.a.createElement("li",{key:t},o.a.createElement("a",{href:`${c.a.config.adminUrl}/post.php?action=edit&post=${e.id}`,target:"_blank"},e.name),o.a.createElement("span",null,"(",e.type,")")))))),o.a.createElement(d.a,{label:"Shortcode",defaultOpen:!0,fitted:!0,scrollIntoView:!0},o.a.createElement("div",null,o.a.createElement("p",null,"Copy the shortcode below and paste it in any page or post to embed this feed:"),o.a.createElement("div",{className:i.a.shortcode},o.a.createElement("code",null,a),o.a.createElement(u.a,{feed:r.a.feed},o.a.createElement(m.a,{type:m.c.SECONDARY},"Copy"))))),c.a.config.hasElementor&&o.a.createElement(d.a,{className:p.a.isPro?void 0:i.a.pro,label:p.a.isPro?"Elementor Widget":o.a.createElement(h.a,null,"Elementor widget"),defaultOpen:!0,fitted:!0,scrollIntoView:!0},o.a.createElement("div",null,o.a.createElement("p",null,"To embed this feed in Elementor:"),o.a.createElement("ol",null,o.a.createElement("li",null,o.a.createElement("span",null,"Search for the ",o.a.createElement("b",null,"Spotlight Instagram feed")," widget",o.a.createElement(s.a,{type:s.b.INFO,showIcon:!0},"Choose the one with the Instagram logo. The other one is for the normal"," ","WordPress widget."))),o.a.createElement("li",null,"Add it to your post or page"),o.a.createElement("li",null,"Then choose ",o.a.createElement("strong",null,t)," from the list of feeds.")),o.a.createElement(v,{images:[{src:"elementor-widget-search.png",alt:"Searching for the widget"},{src:"elementor-widget-feed.png",alt:"The feed in a widget"}]}))),o.a.createElement(d.a,{label:"WordPress Block",defaultOpen:!c.a.config.hasElementor,fitted:!0,scrollIntoView:!0},o.a.createElement("div",null,o.a.createElement("p",null,"To embed this feed in the WordPress block editor:"),o.a.createElement("ol",null,o.a.createElement("li",null,"Search for the ",o.a.createElement("b",null,"Spotlight Instagram feed")," block"),o.a.createElement("li",null,"add it to your post or page."),b.a.list.length>1?o.a.createElement("li",null,"Next, choose ",o.a.createElement("strong",null,t)," from the list of feeds."):o.a.createElement("li",null,"Since this is your only feed, Spotlight will automatically show this feed.")),b.a.list.length>1?o.a.createElement(v,{images:[{src:"wp-block-search.png",alt:"Searching for the block"},{src:"wp-block-select.png",alt:"Choosing a feed for the block"},{src:"wp-block.png",alt:"The feed in a block"}]}):o.a.createElement(v,{images:[{src:"wp-block-search.png",alt:"Searching for the block"},{src:"wp-block.png",alt:"The feed in a block"}]}))),o.a.createElement(d.a,{label:"WordPress Widget",defaultOpen:!1,fitted:!0,scrollIntoView:!0},o.a.createElement("div",null,o.a.createElement("p",null,"To embed this feed as a WordPress widget:"),o.a.createElement("ol",null,o.a.createElement("li",null,"Go to the"," ",o.a.createElement("a",{href:n,target:"_blank"},"Appearance » Widgets")," ","page or the"," ",o.a.createElement("a",{href:l,target:"_blank"},"Widgets section of the Customizer")),o.a.createElement("li",null,"Then, add a ",o.a.createElement("strong",null,"Spotlight Instagram Feed")," widget"),o.a.createElement("li",null,"In the widget's settings, choose the ",o.a.createElement("strong",null,t)," as the feed"," ","to be shown.")),o.a.createElement(E,{img:"widget.png",alt:"Example of a widget"})))):o.a.createElement("div",{className:i.a.embedSidebar},o.a.createElement("div",{className:i.a.saveMessage},o.a.createElement(s.a,{type:s.b.INFO,showIcon:!0},"You're almost there... Click the ",o.a.createElement("strong",null,"Save")," button at the top-right to be"," ","able to embed this feed on your site!")))}function E({img:e,alt:t,annotation:a,onClick:n}){return o.a.createElement("figure",{className:i.a.example},o.a.createElement("figcaption",{className:i.a.caption},"Example:"),o.a.createElement("img",{src:p.a.image(e),alt:null!=t?t:"",style:{cursor:n?"pointer":"default"},onClick:n}),void 0!==a&&o.a.createElement("div",{className:i.a.exampleAnnotation},a))}function v({images:e}){const[t,a]=o.a.useState(0),l=o.a.useRef(),i=()=>{r(),l.current=setInterval(c,2e3)},r=()=>{clearInterval(l.current)},c=()=>{i(),a(t=>(t+1)%e.length)};Object(n.useEffect)(()=>(i(),r),[]);const s=e[t];return o.a.createElement(E,{img:s.src,alt:s.alt,annotation:t+1,onClick:c})}},387:function(e,t,a){"use strict";a.d(t,"a",(function(){return G}));var n=a(0),o=a.n(n),l=a(254),i=a.n(l),r=a(255),c=a.n(r),s=a(12),d=a(7),u=a(64),m=a(83),p=a(148),b=a(256),h=a(279),g=a(117),f=a(5),E=a(280),v=a(281),_=a(150),w=a(26).a.SavedFeed;const k=o.a.memo((function(e){const t=d.a.Options.hasSources(e.value),a=(e.showFakeOptions||s.a.isPro?e.tabs:e.tabs.filter(e=>!e.isFakePro)).map(e=>({key:e.id,label:o.a.createElement(y,{key:e.id,tab:e}),disabled:!e.alwaysEnabled&&!t}));return o.a.createElement("div",{className:c.a.navbar},o.a.createElement(p.a,{breakpoints:b.a.Sizes.ALL},t=>{const n=e.showNameField?o.a.createElement(h.a,{key:"name-field",value:e.name,onDone:e.onRename,defaultValue:w.getDefaultName()}):void 0,l=e.showDoneBtn?o.a.createElement(g.a,{key:"save-btn",content:t=>t?"Saving ...":e.doneBtnText,isSaving:e.isSaving,disabled:!e.isDoneBtnEnabled,onClick:e.onSave}):void 0,i=e.showCancelBtn?o.a.createElement(f.a,{key:"cancel-btn",onClick:e.onCancel,disabled:!e.isCancelBtnEnabled,children:e.cancelBtnText}):void 0;if(t<=b.a.Sizes.SMALL)return o.a.createElement(E.a,{steps:a,current:e.tabId,onChangeStep:e.onChangeTab,firstStep:i,lastStep:l},n);if(t<=b.a.Sizes.MEDIUM)return o.a.createElement(v.a,{pages:a,current:e.tabId,onChangePage:e.onChangeTab,hideMenuArrow:!0,showNavArrows:!0},{path:n?[n]:[],right:[i,l]});let r=[o.a.createElement(u.a,{key:"logo"})];return n&&r.push(n),o.a.createElement(_.a,{current:e.tabId,onClickTab:e.onChangeTab},{path:r,tabs:a,right:[i,l]})}))}),(e,t)=>e.tabId===t.tabId&&e.name===t.name&&e.showFakeOptions===t.showFakeOptions&&e.showDoneBtn===t.showDoneBtn&&e.showCancelBtn===t.showCancelBtn&&e.doneBtnText===t.doneBtnText&&e.cancelBtnText===t.cancelBtnText&&e.showNameField===t.showNameField&&e.onChangeTab===t.onChangeTab&&e.onRename===t.onRename&&e.onSave===t.onSave&&e.onCancel===t.onCancel&&e.isSaving===t.isSaving&&e.isDoneBtnEnabled===t.isDoneBtnEnabled&&e.isCancelBtnEnabled===t.isCancelBtnEnabled&&d.a.Options.hasSources(e.value)===d.a.Options.hasSources(t.value));function y({tab:e}){return e.isFakePro?o.a.createElement(C,{tab:e}):o.a.createElement("span",null,e.label)}function C({tab:e}){return o.a.createElement("span",{className:c.a.fakeProItem},o.a.createElement(m.a,{className:c.a.proPill}),o.a.createElement("span",null,e.label))}var O=a(94),P=a(90);function S(e){var{children:t,showPreviewBtn:a,onOpenPreview:n}=e,l=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(a[n[o]]=e[n[o]])}return a}(e,["children","showPreviewBtn","onOpenPreview"]);return!l.tab.sidebar||l.tab.showSidebar&&!l.tab.showSidebar()?null:o.a.createElement(o.a.Fragment,null,a&&o.a.createElement(P.a.Navigation,{align:"right",text:"Preview",icon:"visibility",onClick:n}),o.a.createElement(O.a,null,l.tab.sidebar&&o.a.createElement(l.tab.sidebar,Object.assign({tab:l.tab},l)),null!=t?t:null))}var F=a(383),T=a.n(F),N=a(70),x=a.n(N),I=a(6),j=a(2),M=a(111),A=a(92),L=a(10);const B=Object(I.b)(({feed:e,showCloseBtn:t,onClose:a})=>{if(!d.a.Options.hasSources(e.options))return o.a.createElement(A.a,{className:x.a.onboarding},t&&o.a.createElement(f.a,{onClick:a},o.a.createElement(L.a,{icon:"hidden"}),o.a.createElement("span",null,"Close Preview")),o.a.createElement("div",null,o.a.createElement("h1",null,"Select an account to get"," ",o.a.createElement("span",{className:x.a.noBreak},"started"," "," →")),o.a.createElement("p",null,"Your Instagram posts will be displayed instantly so you can easily design your feed using"," ","the live interactive preview.")));const n=e.mode,l=n===j.a.Mode.DESKTOP,i=n===j.a.Mode.TABLET,r=n===j.a.Mode.PHONE,c=l?x.a.root:x.a.shrunkRoot,s=r?x.a.phoneSizer:i?x.a.tabletSizer:x.a.sizer;return o.a.createElement("div",{className:c},o.a.createElement("div",{className:x.a.statusBar},o.a.createElement("div",{className:x.a.statusIndicator},o.a.createElement("svg",{viewBox:"0 0 24 24"},o.a.createElement("circle",{cx:"12",cy:"12",r:"12",fill:"red"})),o.a.createElement("span",{className:x.a.indicatorText},"Live interactive preview"),o.a.createElement("span",{className:x.a.indicatorDash}," — "),o.a.createElement("span",{className:x.a.indicatorCounter},"Showing ",e.media.length," out of ",e.totalMedia," posts"),e.numLoadedMore>0&&o.a.createElement("span",{className:x.a.reset},"(",o.a.createElement("a",{onClick:()=>e.load()},"Reset"),")")),t&&o.a.createElement(f.a,{onClick:a},o.a.createElement(L.a,{icon:"hidden"}),o.a.createElement("span",null,"Close Preview"))),o.a.createElement("div",{className:x.a.container},o.a.createElement("div",{className:s},0===e.media.length&&d.a.Options.hasSources(e.options)&&d.a.Options.isLimitingPosts(e.options)?o.a.createElement("div",{className:x.a.noPostsMsg},o.a.createElement("p",null,"There are no posts to show. Try relaxing your filters and moderation.")):o.a.createElement(M.a,{feed:e}))))});function D(e){var{children:t,isCollapsed:a,onClosePreview:n}=e,l=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(a[n[o]]=e[n[o]])}return a}(e,["children","isCollapsed","onClosePreview"]);return o.a.createElement("div",{className:T.a.viewport},t||(l.tab.viewport?o.a.createElement(l.tab.viewport,Object.assign({},l)):o.a.createElement(B,Object.assign({},l,{showCloseBtn:a,onClose:n}))))}var R=a(4),z=a(115);function H({value:e,feed:t,onChange:a,onChangeTab:n}){const[l,i]=o.a.useState(!1);return o.a.createElement(z.a,{beforeConnect:t=>{i(!0),a&&a({accounts:e.accounts.concat([t])})},onConnect:()=>{setTimeout(()=>{t.load(),n&&n("design")},A.a.TRANSITION_DURATION)},isTransitioning:l})}function G(e){var t,a,l,r,c,s,u,m,p=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(a[n[o]]=e[n[o]])}return a}(e,[]);const[b,h]=Object(n.useState)(!1),g=()=>h(!0),f=()=>h(!1);p.tabs=null!==(t=p.tabs)&&void 0!==t?t:[],p.showDoneBtn=null===(a=p.showDoneBtn)||void 0===a||a,p.showCancelBtn=null===(l=p.showCancelBtn)||void 0===l||l,p.showNameField=null!==(r=p.showNameField)&&void 0!==r&&r,p.doneBtnText=null!==(c=p.doneBtnText)&&void 0!==c?c:"Done",p.cancelBtnText=null!==(s=p.cancelBtnText)&&void 0!==s?s:"Cancel",p.isDoneBtnEnabled=null===(u=p.isDoneBtnEnabled)||void 0===u||u,p.isCancelBtnEnabled=null===(m=p.isCancelBtnEnabled)||void 0===m||m;const E=p.tabs.find(e=>e.id===p.tabId),v=o.a.useRef();v.current||(v.current=new d.a(p.value),v.current.load()),Object(n.useEffect)(()=>{v.current.options=p.value},[p.value]),Object(n.useEffect)(()=>{v.current.mode=p.previewDevice},[p.previewDevice]);const _=d.a.ComputedOptions.compute(p.value),w=Object.assign(Object.assign({},p),{computed:_,tab:E,feed:v.current});return o.a.createElement("div",{className:i.a.root},o.a.createElement(k,Object.assign({},p)),R.b.hasAccounts()?o.a.createElement("div",{className:i.a.content},void 0===E.component?o.a.createElement(P.a,{primary:"content",current:b?"content":"sidebar",sidebar:e=>o.a.createElement(S,Object.assign({},w,{showPreviewBtn:e,onOpenPreview:g})),content:e=>o.a.createElement(D,Object.assign({},w,{isCollapsed:e,onClosePreview:f}))}):o.a.createElement(E.component,Object.assign({},w))):o.a.createElement("div",{className:i.a.accountsOnboarding},o.a.createElement(H,Object.assign({},w))))}},433:function(e,t,a){},51:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(0),o=a.n(n),l=a(3),i=a(2);function r(e,t=[]){return o.a.memo(e,(e,a)=>{const n=t.reduce((t,n)=>t&&Object(l.c)(e.value[n],a.value[n]),t.length>0),o=!t.reduce((e,t)=>e||i.a.isValid(a.value[t]),!1)||e.previewDevice===a.previewDevice&&e.onChangeDevice===a.onChangeDevice;return n&&o&&e.showFakeOptions===a.showFakeOptions&&e.onChange===a.onChange})}},599:function(e,t,a){},63:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(0),o=a.n(n),l=a(374);function i({value:e,onChange:t,min:a,emptyMin:n,placeholder:i,id:r,unit:c}){e=null!=e?e:"",a=null!=a?a:0,i=null!=i?i:"",n=null!=n&&n;const s=o.a.useCallback(e=>{const n=e.target.value,o=parseInt(n),l=isNaN(o)?n:Math.max(a,o);t&&t(l)},[a,t]),d=o.a.useCallback(()=>{n&&e<=a&&t&&t("")},[n,e,a,t]),u=o.a.useCallback(o=>{"ArrowUp"===o.key&&""===e&&t&&t(n?a+1:a)},[e,a,n,t]),m=n&&e<=a?"":e;return c?o.a.createElement(l.a,{id:r,type:"number",unit:c,value:m,min:a,placeholder:i+"",onChange:s,onBlur:d,onKeyDown:u}):o.a.createElement("input",{id:r,type:"number",value:m,min:a,placeholder:i+"",onChange:s,onBlur:d,onKeyDown:u})}},67:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(0),o=a.n(n);function l({id:e,value:t,onChange:a,disabled:n}){return o.a.createElement("div",{className:"checkbox-field"},o.a.createElement("div",{className:"checkbox-field__aligner"},o.a.createElement("input",{id:e,type:"checkbox",value:"1",checked:!!t,onChange:e=>a(e.target.checked),disabled:n})))}a(359)},70:function(e,t,a){e.exports={root:"FeedPreview__root","shrunk-root":"FeedPreview__shrunk-root FeedPreview__root",shrunkRoot:"FeedPreview__shrunk-root FeedPreview__root","status-bar":"FeedPreview__status-bar",statusBar:"FeedPreview__status-bar","status-indicator":"FeedPreview__status-indicator",statusIndicator:"FeedPreview__status-indicator",reset:"FeedPreview__reset",container:"FeedPreview__container","no-posts-msg":"FeedPreview__no-posts-msg",noPostsMsg:"FeedPreview__no-posts-msg",indicators:"FeedPreview__indicators","waiting-indicator":"FeedPreview__waiting-indicator",waitingIndicator:"FeedPreview__waiting-indicator","loading-indicator":"FeedPreview__loading-indicator",loadingIndicator:"FeedPreview__loading-indicator",sizer:"FeedPreview__sizer","shrunk-sizer":"FeedPreview__shrunk-sizer FeedPreview__sizer",shrunkSizer:"FeedPreview__shrunk-sizer FeedPreview__sizer","tablet-sizer":"FeedPreview__tablet-sizer FeedPreview__shrunk-sizer FeedPreview__sizer",tabletSizer:"FeedPreview__tablet-sizer FeedPreview__shrunk-sizer FeedPreview__sizer","phone-sizer":"FeedPreview__phone-sizer FeedPreview__shrunk-sizer FeedPreview__sizer",phoneSizer:"FeedPreview__phone-sizer FeedPreview__shrunk-sizer FeedPreview__sizer",onboarding:"FeedPreview__onboarding","no-break":"FeedPreview__no-break",noBreak:"FeedPreview__no-break",controls:"FeedPreview__controls",control:"FeedPreview__control","control-label":"FeedPreview__control-label",controlLabel:"FeedPreview__control-label","indicator-dash":"FeedPreview__indicator-dash",indicatorDash:"FeedPreview__indicator-dash","indicator-text":"FeedPreview__indicator-text",indicatorText:"FeedPreview__indicator-text","indicator-animation":"FeedPreview__indicator-animation",indicatorAnimation:"FeedPreview__indicator-animation","loading-animation":"FeedPreview__loading-animation",loadingAnimation:"FeedPreview__loading-animation"}},84:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(0),o=a.n(n),l=a(154),i=a.n(l),r=a(116),c=a(83);function s({id:e,label:t,children:a,wide:n,disabled:l,isFakePro:s}){const d=Array.isArray(a)?a[0]:a,u=Array.isArray(a)?a[1]:void 0;return o.a.createElement("div",{className:l||s?i.a.disabled:n?i.a.wide:i.a.container},o.a.createElement("div",{className:i.a.label},o.a.createElement("div",{className:i.a.labelAligner},o.a.createElement("label",{htmlFor:e},t),u&&o.a.createElement(r.a,null,u))),o.a.createElement("div",{className:i.a.content},d),s&&o.a.createElement(c.a,{className:i.a.proPill}))}},96:function(e,t,a){"use strict";var n=a(0),o=a.n(n),l=a(288),i=a.n(l),r=a(4),c=a(100),s=a(179),d=a(372),u=a.n(d),m=a(2),p=a(7),b=a(70),h=a.n(b),g=a(290),f=a(5),E=a(10),v=a(14),_=a(12);function w(e){const t=o.a.useCallback(()=>e.onToggleFakeOptions(!0),[]),a=o.a.useCallback(()=>e.onToggleFakeOptions(!1),[]);return o.a.createElement("div",{className:h.a.controls},o.a.createElement("div",{className:h.a.control},o.a.createElement("span",{className:h.a.controlLabel},"Preview device"),o.a.createElement(g.a,null,m.a.MODES.map((t,a)=>o.a.createElement(f.a,{key:a,type:f.c.TOGGLE,onClick:()=>e.onChangeDevice(t),active:e.previewDevice===t,tooltip:t.name},o.a.createElement(E.a,{icon:t.icon}))))),!_.a.isPro&&o.a.createElement("div",{className:h.a.control},o.a.createElement("span",{className:h.a.controlLabel},"PRO features",o.a.createElement("span",null," ","—"," ",o.a.createElement("a",{href:v.a.resources.upgradeLocalUrl,target:"_blank"},"Upgrade now"))),o.a.createElement(g.a,null,o.a.createElement(f.a,{type:f.c.TOGGLE,active:e.showFakeOptions,onClick:t,tooltip:"Show PRO features"},"Show"),o.a.createElement(f.a,{type:f.c.TOGGLE,active:!e.showFakeOptions,onClick:a,tooltip:"Hide PRO features"},"Hide"))))}var k=a(51),y=a(230),C=a(231),O=a(232),P=[{id:"accounts",label:"Show posts from these accounts",fields:[{id:"accounts",component:Object(k.a)(({value:e,onChange:t})=>o.a.createElement(y.a,{value:e.accounts,onChange:e=>t({accounts:e})}),["accounts"])}]},{id:"tagged",label:"Show posts where these accounts are tagged",isFakePro:!0,fields:[{id:"tagged",component:Object(k.a)(()=>o.a.createElement(C.a,{value:[]}),["tagged"])}]},{id:"hashtags",label:"Show posts with these hashtags",isFakePro:!0,fields:[{id:"hashtags",component:Object(k.a)(()=>o.a.createElement(O.a,{value:[]}),["hashtags"])}]}],S=a(181),F=a(130),T=a(126),N=a(131),x=a(125),I=[{id:"caption-filters",label:"Caption filtering",isFakePro:!0,fields:[{id:"caption-whitelist",component:Object(k.a)(({field:e})=>o.a.createElement(F.a,{label:"Only show posts with these words or phrases"},o.a.createElement(T.a,{id:e.id,value:[]})))},{id:"caption-whitelist-settings",component:Object(k.a)(()=>o.a.createElement(N.a,{value:!0}))},{id:"caption-blacklist",component:Object(k.a)(({field:e})=>o.a.createElement(F.a,{label:"Hide posts with these words or phrases",bordered:!0},o.a.createElement(T.a,{id:e.id,value:[]})))},{id:"caption-blacklist-settings",component:Object(k.a)(()=>o.a.createElement(N.a,{value:!0}))}]},{id:"hashtag-filters",label:"Hashtag filtering",isFakePro:!0,fields:[{id:"hashtag-whitelist",component:Object(k.a)(({field:e})=>o.a.createElement(F.a,{label:"Only show posts with these hashtags"},o.a.createElement(x.a,{id:e.id,value:[]})))},{id:"hashtag-whitelist-settings",component:Object(k.a)(()=>o.a.createElement(N.a,{value:!0}))},{id:"hashtag-blacklist",component:Object(k.a)(({field:e})=>o.a.createElement(F.a,{label:"Hide posts with these hashtags",bordered:!0},o.a.createElement(x.a,{id:e.id,value:[]})))},{id:"hashtag-blacklist-settings",component:Object(k.a)(()=>o.a.createElement(N.a,{value:!0}))}]}],j=a(233),M=a(240),A=a(241),L=[{id:"connect",label:"Connect",alwaysEnabled:!0,groups:P,sidebar:function(e){const[,t]=o.a.useState(0);return r.b.hasAccounts()?o.a.createElement("div",{className:i.a.connectSidebar},o.a.createElement("div",{className:i.a.connectButton},o.a.createElement(c.a,{onConnect:a=>{e.onChange&&e.onChange({accounts:e.value.accounts.concat([a])}),t(e=>e++)}})),o.a.createElement(s.a,Object.assign({groups:e.tab.groups},e))):null}},{id:"design",label:"Design",groups:S.a,sidebar:function(e){let t=e.tab.groups;return m.a.get(e.value.linkBehavior,e.previewDevice,!0)!==p.a.LinkBehavior.LIGHTBOX&&(t=t.filter(({id:e})=>"lightbox"!==e)),o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:u.a.previewOptions},o.a.createElement(w,Object.assign({},e))),o.a.createElement(s.a,Object.assign({groups:t},e)))}},{id:"filter",label:"Filter",isFakePro:!0,groups:I,sidebar:j.a},{id:"moderate",label:"Moderate",isFakePro:!0,groups:I,component:M.a},{id:"promote",label:"Promote",isFakePro:!0,component:A.a}];t.a={tabs:L,openGroups:["accounts","tagged","hashtags","layouts","feed"],showDoneBtn:!0,showCancelBtn:!1,showNameField:!1,isDoneBtnEnabled:!0,isCancelBtnEnabled:!0,doneBtnText:"Done",cancelBtnText:"Cancel"}}}]);
1
+ (window.webpackJsonpspotlight=window.webpackJsonpspotlight||[]).push([[3],{116:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(0),o=a.n(n),l=a(249),i=a(94),r=a(56),c=a(16);const s=({onConnect:e,beforeConnect:t,isTransitioning:a})=>o.a.createElement(i.a,{className:"accounts-onboarding",isTransitioning:a},o.a.createElement("div",{className:"accounts-onboarding__left"},o.a.createElement("h1",null,"Let's connect your Instagram account"),o.a.createElement("p",{className:"accounts-onboarding__first-msg"},"If you're unsure which button applies to you, it's most likely a ",o.a.createElement("strong",null,"Personal")," account."," ","Try that first."),o.a.createElement("div",{className:"accounts-onboarding__spacer"}),o.a.createElement(r.a,{label:"Upgrade to an Instagram Business account for free",stealth:!0},o.a.createElement("p",null,"Business accounts get additional API features that give you more control over your feeds in "," ","Spotlight, especially with ",o.a.createElement("strong",null,"PRO"),"."),o.a.createElement("p",null,"Plus, they get access to ",o.a.createElement("strong",null,"more cool stuff")," within Instagram itself, such as "," ","analytics."),o.a.createElement("p",null,o.a.createElement("a",{href:c.a.resources.businessAccounts,target:"_blank",className:"accounts-onboarding__learn-more-business"},"Learn more")))),o.a.createElement("div",null,o.a.createElement(l.a,{beforeConnect:e=>t&&t(e),onConnect:t=>e&&e(t),useColumns:!0,showPrompt:!1})))},133:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(0),o=a.n(n),l=a(253),i=a.n(l);function r({children:e,label:t,bordered:a}){const n=a?i.a.bordered:i.a.filterField;return o.a.createElement("div",{className:n},o.a.createElement("span",{className:i.a.label},t),e)}},134:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(0),o=a.n(n),l=a(254),i=a.n(l),r=a(5),c=a(381);function s({id:e,value:t,onChange:a,feed:n}){const[l,s]=o.a.useState(!1);return o.a.createElement("div",{className:i.a.incGlobalFilters},o.a.createElement("label",{className:i.a.label},o.a.createElement("div",{className:i.a.field},o.a.createElement("input",{id:e,type:"checkbox",value:"1",checked:t,onChange:e=>a&&a(e.target.checked)}),o.a.createElement("span",null,"Include global filters")),o.a.createElement(r.a,{type:r.c.LINK,size:r.b.SMALL,onClick:()=>s(!0)},"Edit global filters"),o.a.createElement(c.a,{isOpen:l,onClose:()=>s(!1),onSave:()=>n&&n.reload()})))}},136:function(e,t,a){e.exports={root:"AccountSelector__root",row:"AccountSelector__row",account:"AccountSelector__account button__toggle-button button__panel-button theme__panel","account-selected":"AccountSelector__account-selected AccountSelector__account button__toggle-button button__panel-button theme__panel button__toggle-button-on button__toggle-button button__panel-button theme__panel",accountSelected:"AccountSelector__account-selected AccountSelector__account button__toggle-button button__panel-button theme__panel button__toggle-button-on button__toggle-button button__panel-button theme__panel","profile-pic":"AccountSelector__profile-pic",profilePic:"AccountSelector__profile-pic","info-column":"AccountSelector__info-column",infoColumn:"AccountSelector__info-column","info-text":"AccountSelector__info-text",infoText:"AccountSelector__info-text",username:"AccountSelector__username AccountSelector__info-text","account-type":"AccountSelector__account-type AccountSelector__info-text",accountType:"AccountSelector__account-type AccountSelector__info-text","tick-icon":"AccountSelector__tick-icon",tickIcon:"AccountSelector__tick-icon"}},138:function(e,t,a){e.exports={"embed-sidebar":"EmbedSidebar__embed-sidebar",embedSidebar:"EmbedSidebar__embed-sidebar","save-message":"EmbedSidebar__save-message",saveMessage:"EmbedSidebar__save-message",shortcode:"EmbedSidebar__shortcode",example:"EmbedSidebar__example",caption:"EmbedSidebar__caption","example-annotation":"EmbedSidebar__example-annotation",exampleAnnotation:"EmbedSidebar__example-annotation",instances:"EmbedSidebar__instances",pro:"EmbedSidebar__pro"}},158:function(e,t,a){e.exports={container:"EditorFieldRow__container",wide:"EditorFieldRow__wide EditorFieldRow__container",label:"EditorFieldRow__label",content:"EditorFieldRow__content","label-aligner":"EditorFieldRow__label-aligner",labelAligner:"EditorFieldRow__label-aligner",disabled:"EditorFieldRow__disabled EditorFieldRow__container","pro-pill":"EditorFieldRow__pro-pill",proPill:"EditorFieldRow__pro-pill"}},172:function(e,t,a){"use strict";a.d(t,"a",(function(){return i})),a.d(t,"b",(function(){return c})),a.d(t,"c",(function(){return s}));var n=a(0),o=a.n(n),l=a(3);const i=o.a.createContext(null),r={showFakeOptions:!0};function c(){var e;try{const t=null!==(e=localStorage.getItem("sli_editor"))&&void 0!==e?e:"{}",a=JSON.parse(t);return Object.assign(Object.assign({},r),a)}catch(e){return r}}function s(e){var t;t=Object(l.b)(c(),e),localStorage.setItem("sli_editor",JSON.stringify(t))}},182:function(e,t,a){"use strict";var n=a(0),o=a.n(n),l=a(190),i=a.n(l),r=a(6),c=a(383),s=a(20);t.a=Object(r.b)((function({feed:e,media:t,store:a,selected:l,disabled:r,autoFocusFirst:u,onClickMedia:m,onSelectMedia:p,children:b}){r=null!=r&&r,u=null!=u&&u;const h=a&&e&&a.hasCache(e)||void 0!==t&&t.length>0,[g,f]=o.a.useState(null!=t?t:[]),[E,v]=o.a.useState(!h),[_,w,k]=Object(s.e)(l),y=o.a.useRef(),C=o.a.useRef(),O=o.a.useRef();function P(e){f(e),v(!1),e.length>0&&u&&p&&p(e[0],0)}Object(n.useEffect)(()=>{k(l)},[l]),Object(s.i)(n=>{a?a.fetchMedia(e).then(e=>n().then(()=>P(e))):P(t)},[a,t]);const S=e=>{null===w()||e.target!==y.current&&e.target!==C.current||F(null)};function F(e){r||(N(e),m&&m(g[e],e))}function N(e){e===w()||r||(p&&p(g[e],e),k(e))}Object(n.useLayoutEffect)(()=>{if(y.current)return y.current.addEventListener("click",S),()=>y.current.removeEventListener("click",S)},[y.current]);const T=r?i.a.gridDisabled:i.a.grid;return o.a.createElement("div",{ref:y,className:i.a.root},o.a.createElement("div",{ref:C,className:T,style:{gridGap:15},tabIndex:0,onKeyDown:function(e){if(r)return;const t=w(),a=function(){const e=C.current.getBoundingClientRect(),t=O.current.getBoundingClientRect(),a=e.width,n=t.width;return Math.floor((a+15)/(n+15))}(),n=Math.ceil(g.length/a);switch(e.key){case" ":case"Enter":F(t);break;case"ArrowLeft":N(Math.max(t-1,0));break;case"ArrowRight":N(Math.min(t+1,g.length-1));break;case"ArrowUp":{const e=Math.max(0,t-a),o=Math.floor(t/a),l=Math.floor(e/a);n>1&&l!==o&&N(e);break}case"ArrowDown":{const e=Math.min(g.length-1,t+a),o=Math.floor(t/a),l=Math.floor(e/a);n>1&&l!==o&&N(e);break}default:return}e.preventDefault(),e.stopPropagation()}},g.map((e,t)=>o.a.createElement(d,{key:e.id,ref:0===t?O:null,focused:!r&&_===t,onClick:()=>F(t),onFocus:()=>N(t)},b(e,t)))),E&&o.a.createElement("div",{className:i.a.loading},o.a.createElement(c.a,{size:60})))}));const d=o.a.forwardRef(({focused:e,onClick:t,onFocus:a,children:l},r)=>(r||(r=o.a.useRef()),Object(n.useEffect)(()=>{e&&r.current.focus()},[e]),o.a.createElement("div",{ref:r,className:i.a.item,onClick:t,onFocus:a,tabIndex:0},l)))},183:function(e,t,a){"use strict";a.d(t,"a",(function(){return f}));var n=a(0),o=a.n(n),l=a(297),i=a.n(l),r=a(238),c=a(5),s=a(16),d=new Map([["link",{heading:"Link options",fields:r.a,tutorial:function({}){return o.a.createElement(o.a.Fragment,null,o.a.createElement("p",{style:{fontWeight:"bold"}},"How it works:"),o.a.createElement("ol",{style:{marginTop:0}},o.a.createElement("li",null,"Select a post from the preview on the left."),o.a.createElement("li",null,"Choose what the post should link to.")),o.a.createElement("p",null,"That’s it!"))}}],["-more-",{heading:"Have your say...",fields:function({}){return o.a.createElement(o.a.Fragment,null,o.a.createElement("p",null,"Spotlight’s ‘Promote’ feature has lots more to come. Share your thoughts on what you’d like to"," ","promote and how."),o.a.createElement("p",null,"Take our 2-minute survey."),o.a.createElement("div",null,o.a.createElement(c.a,{type:c.c.PRIMARY,size:c.b.LARGE,onClick:function(){window.open(s.a.resources.promoTypesSurvey)}},"Start Survey")))}}]]),u=a(56),m=a(23),p=a(21);function b({hasGlobal:e,hasAuto:t,isOverriding:a,onOverride:n}){return o.a.createElement(o.a.Fragment,null,o.a.createElement(m.a,{type:m.b.WARNING,showIcon:!0},o.a.createElement("span",null,"You have")," ",t&&o.a.createElement("a",{href:p.a.at({screen:"promotions",tab:"automate"}),target:"_blank"},"automated"),t&&e&&o.a.createElement(o.a.Fragment,null," ",o.a.createElement("span",null,"and")," "),e&&o.a.createElement("a",{href:p.a.at({screen:"promotions",tab:"global"}),target:"_blank"},"global")," ",o.a.createElement("span",null,"promotions that apply to this post.")," ",a?o.a.createElement("span",null,"To stop overriding, simply remove the custom promotion."):o.a.createElement("span",null,"Click the button below to use a custom promotion instead.")),!a&&o.a.createElement(c.a,{onClick:n},"Override"))}var h=a(3),g=a(67);function f({type:e,config:t,hasGlobal:a,hasAuto:l,showTutorial:r,showNextBtn:s,isNextBtnDisabled:m,hideRemove:p,onNext:f,onChange:E}){var v,_;const[w,k]=Object(n.useState)(!1),[y,C]=Object(n.useState)(!1),O=Object(n.useCallback)(()=>C(!0),[C]),P=Object(n.useCallback)(()=>C(!1),[C]),S=Object(n.useCallback)(()=>{k(!0),E&&E({})},[e,E]),F=!Object(h.o)(t),N=a||l,T=N&&(F||w),x=null!==(v=d.get(e?e.id:""))&&void 0!==v?v:{heading:"",fields:void 0,tutorial:void 0};return o.a.createElement(o.a.Fragment,null,o.a.createElement(u.a,{label:null!==(_=x.heading)&&void 0!==_?_:"Promotion options",fitted:!0,isOpen:!0,showIcon:!1},N&&o.a.createElement(b,{hasAuto:l,hasGlobal:a,isOverriding:T,onOverride:S}),T&&o.a.createElement("hr",null),(!N||T)&&!r&&x.fields&&o.a.createElement(x.fields,{config:null!=t?t:{},onChange:E}),r&&x.tutorial&&o.a.createElement(x.tutorial,null)),o.a.createElement("div",{className:i.a.bottom},s&&o.a.createElement(c.a,{size:c.b.LARGE,onClick:f,disabled:m},"Promote next post →"),(F||T)&&!p&&o.a.createElement("a",{className:i.a.removePromo,onClick:O},"Remove promotion")),o.a.createElement(g.a,{isOpen:y,title:"Are you sure?",buttons:["Yes, I'm sure","No, keep it"],onCancel:P,onAccept:()=>{E&&E({}),k(!1),C(!1)}},o.a.createElement("p",null,"Are you sure you want to remove this promotion? This ",o.a.createElement("strong",null,"cannot")," be undone!")))}},184:function(e,t,a){"use strict";a.d(t,"a",(function(){return b}));var n=a(0),o=a.n(n),l=a(373),i=a.n(l),r=a(293),c=a.n(r),s=a(56),d=a(39),u=a(12),m=a(233);function p(e){const{group:t,showFakeOptions:a}=e,[n,l]=o.a.useState(e.openGroups.includes(t.id)),i=o.a.useCallback(()=>{l(e=>!e)},[n]),r=t.isFakePro?o.a.createElement(m.a,null,t.label):t.label;return!t.isFakePro||a||u.a.isPro?o.a.createElement(s.a,{className:t.isFakePro&&!u.a.isPro?c.a.disabled:c.a.spoiler,label:r,isOpen:n,onClick:i,scrollIntoView:!0,fitted:!0},t.fields.map(n=>{const l=Object.assign({},e);if(t.isFakePro||n.isFakePro){if(!a)return null;l.onChange=d.b}return o.a.createElement(n.component,Object.assign({key:n.id,field:n},e))})):null}function b(e){var{groups:t}=e,a=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(a[n[o]]=e[n[o]])}return a}(e,["groups"]);return o.a.createElement("div",{className:i.a.fieldGroupList},t.map(e=>o.a.createElement(p,Object.assign({key:e.id,group:e},a))))}},185:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(0),o=a.n(n);function l({id:e,value:t,onChange:a,placeholder:n}){return o.a.createElement("input",{id:e,type:"text",value:t,onChange:e=>a(e.target.value),placeholder:n})}a(362)},186:function(e,t,a){"use strict";a.d(t,"b",(function(){return T}));var n=a(0),o=a.n(n),l=a(51),i=a(212),r=a.n(i),c=a(27),s=a(16),d=a(20);const u=({value:e,onChange:t,layouts:a,showUpgrade:n})=>(a=null!=a?a:c.a.list,o.a.createElement("div",{className:r.a.root},a.map((a,n)=>{const l=a.id===e?r.a.layoutSelected:r.a.layout,i=()=>t(a.id),c=Object(d.f)(i);return o.a.createElement("div",{key:n,className:l,role:"button",tabIndex:0,onClick:i,onKeyPress:c},a.name,a.img&&o.a.createElement("img",{src:a.img,alt:a.name}))}),n&&o.a.createElement("div",{className:r.a.comingSoon},o.a.createElement("span",null,"More layouts available in the PRO version!"),o.a.createElement("br",null),o.a.createElement("a",{href:s.a.resources.upgradeLocalUrl,target:"_blank"},"Upgrade now!"))));var m=a(7),p=a(57),b=a(65),h=a(2),g=a(82),f=a(209),E=a(23),v=a(62),_=a(4),w=a(115),k=a(5);a(604);const y=({id:e,title:t,mediaType:a,button:n,buttonSet:l,buttonChange:i,value:r,onChange:c})=>{l=void 0===n?l:n,i=void 0===n?i:n;const s=!!r,d=s?i:l,u=()=>{c&&c("")};return o.a.createElement(w.a,{id:e,title:t,mediaType:a,button:d,value:r,onSelect:e=>{c&&c(e.attributes.url)}},({open:e})=>o.a.createElement("div",{className:"wp-media-field"},s&&o.a.createElement("div",{className:"wp-media-field__preview",tabIndex:0,onClick:e,role:"button"},o.a.createElement("img",{src:r,alt:"Custom profile picture"})),o.a.createElement(k.a,{className:"wp-media-field__select-btn",type:k.c.SECONDARY,onClick:e},d),s&&o.a.createElement(k.a,{className:"wp-media-field__remove-btn",type:k.c.DANGER_LINK,onClick:u},"Remove custom photo")))};function C({id:e,value:t,onChange:a}){return o.a.createElement("textarea",{id:e,value:t,onChange:e=>a(e.target.value)})}var O=a(185),P=a(22),S=a(12),F=m.a.FollowBtnLocation,N=m.a.HeaderInfo;function T(e){return!e.computed.showHeader}function x(e,t){return T(t)||!t.computed.headerInfo.includes(e)}function I(e){return 0===e.value.accounts.length&&0===e.value.tagged.length&&e.value.hashtags.length>0}function j(e){return!e.computed.showFollowBtn}function M(e){return!e.computed.showLoadMoreBtn}t.a=[{id:"layouts",label:"Layout",fields:[{id:"layout",component:Object(l.a)(({value:e,onChange:t})=>o.a.createElement(u,{value:e.layout,onChange:e=>t({layout:e}),showUpgrade:!S.a.isPro}),["layout"])}]},{id:"feed",label:"Feed",fields:[{id:"num-posts",component:Object(P.a)({label:"Number of posts",option:"numPosts",render:(e,t,a)=>{const n=e.previewDevice===h.a.Mode.DESKTOP;return o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:1,placeholder:n?"1":e.value.numPosts.desktop})}})},{id:"num-columns",component:Object(P.a)({label:"Number of columns",option:"numColumns",render:(e,t,a)=>{const n=e.previewDevice===h.a.Mode.DESKTOP;return o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:n?1:0,placeholder:n?"1":e.value.numColumns.desktop})}})},{id:"post-order",component:Object(P.a)({label:"Post order",option:"postOrder",render:(e,t,a)=>o.a.createElement(p.a,{id:e.field.id,value:t,onChange:e=>a(e.value),options:[{value:m.a.PostOrder.DATE_DESC,label:"Most recent first"},{value:m.a.PostOrder.DATE_ASC,label:"Oldest first"},{value:m.a.PostOrder.POPULARITY_DESC,label:"Most popular first"},{value:m.a.PostOrder.POPULARITY_ASC,label:"Least popular first"},{value:m.a.PostOrder.RANDOM,label:"Random"}]})})},{id:"media-type",isFakePro:!0,component:Object(P.a)({label:"Types of posts",option:"mediaType",render:e=>o.a.createElement(p.a,{id:e.field.id,value:m.a.MediaType.ALL,options:[{value:m.a.MediaType.ALL,label:"All posts"},{value:m.a.MediaType.PHOTOS,label:"Photos Only"},{value:m.a.MediaType.VIDEOS,label:"Videos Only"}]})})},{id:"link-behavior",component:Object(P.a)({label:"Open posts in",option:"linkBehavior",render:(e,t,a)=>o.a.createElement(p.a,{id:e.field.id,value:t,onChange:e=>a(e.value),options:[{value:m.a.LinkBehavior.NOTHING,label:"- Do not open -"},{value:m.a.LinkBehavior.SELF,label:"Same tab"},{value:m.a.LinkBehavior.NEW_TAB,label:"New tab"},{value:m.a.LinkBehavior.LIGHTBOX,label:"Popup box"}]})})}]},{id:"appearance",label:"Appearance",fields:[{id:"feed-width",component:Object(P.a)({label:"Feed width",option:"feedWidth",render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:0,unit:"px",emptyMin:!0,placeholder:"Auto"})})},{id:"feed-height",component:Object(P.a)({label:"Feed height",option:"feedHeight",render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:0,unit:"px",emptyMin:!0,placeholder:"Auto"})})},{id:"feed-padding",component:Object(P.a)({label:"Outside padding",option:"feedPadding",render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:0,unit:"px",placeholder:"No padding"})})},{id:"image-padding",component:Object(P.a)({label:"Image padding",option:"imgPadding",render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:0,unit:"px",placeholder:"No padding"})})},{id:"text-size",component:Object(P.a)({label:"Text size",option:"textSize",render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:0,unit:"px",placeholder:"Theme default"}),tooltip:()=>o.a.createElement("span",null,"If left empty, the text size will be controlled by your theme."," ",'This option will be ignored for the header if the "Text size" option in the'," ",'"Header" section is not empty.')})},{id:"bg-color",component:Object(P.a)({label:"Background color",option:"bgColor",render:(e,t,a)=>o.a.createElement(g.a,{id:e.field.id,value:t,onChange:e=>a(e.rgb)})})},{id:"hover-info",component:Object(P.a)({label:"Show on hover",option:"hoverInfo",render:(e,t,a)=>o.a.createElement(f.a,{id:e.field.id,value:t,onChange:a,showProOptions:e.showFakeOptions,options:e.field.data.options}),tooltip:()=>o.a.createElement("span",null,"Usernames are not available for hashtag posts, due to a restriction by Instagram.")}),data:{options:[{value:m.a.HoverInfo.LIKES_COMMENTS,label:"Likes & comments icons"},{value:m.a.HoverInfo.INSTA_LINK,label:"Instagram icon/link"},{value:m.a.HoverInfo.CAPTION,label:"Caption",isFakePro:!0},{value:m.a.HoverInfo.USERNAME,label:"Username",isFakePro:!0},{value:m.a.HoverInfo.DATE,label:"Date",isFakePro:!0}]}},{id:"hover-text-color",isFakePro:!0,component:Object(P.a)({label:"Hover text color",option:"textColorHover",render:e=>o.a.createElement(g.a,{id:e.field.id})})},{id:"hover-bg-color",isFakePro:!0,component:Object(P.a)({label:"Hover background color",option:"bgColorHover",render:e=>o.a.createElement(g.a,{id:e.field.id,value:{r:0,g:0,b:0,a:.5}})})}]},{id:"header",label:"Header",fields:[{id:"header-hashtag-msg",component:Object(l.a)(e=>I(e)&&o.a.createElement(E.a,{type:E.b.INFO,showIcon:!0,shake:!0},"The header is disabled because you are currently only showing posts from"," ","hashtags, so there are no accounts to show in the header."))},{id:"show-header",component:Object(P.a)({label:"Show header",option:"showHeader",disabled:e=>I(e),render:(e,t,a)=>o.a.createElement(v.a,{id:e.field.id,value:t,onChange:a})})},{id:"header-style",isFakePro:!0,component:Object(P.a)({label:"Header style",option:"headerStyle",render:e=>o.a.createElement(p.a,{id:e.field.id,value:m.a.HeaderStyle.NORMAL,options:[{value:m.a.HeaderStyle.NORMAL,label:"Normal"},{value:m.a.HeaderStyle.CENTERED,label:"Centered"}]})})},{id:"header-account",component:Object(P.a)({label:"Account to show",option:"headerAccount",deps:["showHeader"],disabled:e=>T(e),render:(e,t,a)=>o.a.createElement(p.a,{id:e.field.id,value:e.computed.account?e.computed.account.id:"",onChange:e=>a(e.value),options:e.computed.allAccounts.map(e=>({value:e,label:_.b.getById(e).username}))})})},{id:"header-info",component:Object(P.a)({label:"Show",option:"headerInfo",deps:["showHeader"],disabled:e=>T(e),render:(e,t,a)=>o.a.createElement(f.a,{id:e.field.id,value:t,onChange:a,options:e.field.data.options}),tooltip:()=>o.a.createElement("span",null,"Follower count is not available for Personal accounts due to restrictions set by Instagram.")}),data:{options:[{value:m.a.HeaderInfo.PROFILE_PIC,label:"Profile photo"},{value:m.a.HeaderInfo.BIO,label:"Profile bio text"},{value:N.MEDIA_COUNT,label:"Post count",isFakePro:!0},{value:N.FOLLOWERS,label:"Follower count",isFakePro:!0}]}},{id:"header-photo-size",component:Object(P.a)({label:"Profile photo size",option:"headerPhotoSize",deps:["showHeader","headerInfo"],disabled:e=>x(N.PROFILE_PIC,e),render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:null!=t?t:"",onChange:a,min:0,unit:"px",placeholder:"Default"})})},{id:"custom-profile-pic",component:Object(P.a)({label:"Custom profile pic",option:"customProfilePic",deps:["showHeader","headerInfo"],disabled:e=>x(N.PROFILE_PIC,e),render:(e,t,a)=>o.a.createElement(y,{id:e.field.id,value:t,onChange:a,title:"Select custom profile photo",buttonSet:"Choose custom photo",buttonChange:"Change custom photo",mediaType:"image"}),tooltip:()=>o.a.createElement("span",null,"Add a custom profile photo just for this feed. It will override the original"," ","profile photo from Instagram and any custom profile photo added in Spotlight.")})},{id:"custom-bio-text",component:Object(P.a)({label:"Custom bio text",option:"customBioText",deps:["headerInfo","showHeader"],disabled:e=>x(N.BIO,e),render:(e,t,a)=>o.a.createElement(C,{id:e.field.id,value:t,onChange:a}),tooltip:()=>o.a.createElement("span",null,"Add a custom bio text just for this feed. It will override the original custom bio"," ","text from Instagram and any custom bio text added in Spotlight.")})},{id:"header-text-size",component:Object(P.a)({label:"Header text size",option:"headerTextSize",deps:["showHeader"],disabled:e=>T(e),render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:null!=t?t:"",onChange:a,min:0,unit:"px",placeholder:"Default"}),tooltip:()=>o.a.createElement("span",null,'If left empty, the "Text size" option in the "Appearance" section will control the'," ","header's text size.")})},{id:"header-text-color",component:Object(P.a)({label:"Header text color",option:"headerTextColor",deps:["showHeader"],disabled:e=>T(e),render:(e,t,a)=>o.a.createElement(g.a,{id:e.field.id,value:t,onChange:e=>a(e.rgb)})})},{id:"header-bg-color",component:Object(P.a)({label:"Header background color",option:"headerBgColor",deps:["showHeader"],disabled:e=>T(e),render:(e,t,a)=>o.a.createElement(g.a,{id:e.field.id,value:t,onChange:e=>a(e.rgb)})})},{id:"header-padding",component:Object(P.a)({label:"Header padding",option:"headerPadding",deps:["showHeader"],disabled:e=>T(e),render:(e,t,a)=>o.a.createElement(b.a,{id:e.field.id,value:t,onChange:a,min:0,unit:"px",placeholder:"No padding"})})},{id:"include-stories",isFakePro:!0,component:Object(P.a)({label:"Include stories",option:"includeStories",render:e=>o.a.createElement(v.a,{id:e.field.id,value:!0}),tooltip:()=>o.a.createElement("span",null,"Re-shared stories are not available due to a restriction by Instagram.")})},{id:"stories-interval",isFakePro:!0,component:Object(P.a)({label:"Stories interval time",option:"storiesInterval",render:e=>o.a.createElement(b.a,{id:e.field.id,value:5,min:1,unit:"sec"})})}]},{id:"lightbox",label:"Popup box",isFakePro:!0,fields:[{id:"show-lightbox-sidebar",component:Object(P.a)({label:"Show sidebar",option:"lightboxShowSidebar",render:e=>o.a.createElement(v.a,{id:e.field.id,value:!1})})},{id:"num-lightbox-comments",label:"Number of comments",component:Object(P.a)({label:"Number of comments",option:"numLightboxComments",render:e=>o.a.createElement(b.a,{id:e.field.id,value:20,min:0,placeholder:"No comments"}),tooltip:()=>o.a.createElement("span",null,"Comments are only available for posts from a ",o.a.createElement("strong",null,"Business")," account")})}]},{id:"captions",label:"Captions",isFakePro:!0,fields:[{id:"show-captions",component:Object(P.a)({label:"Show captions",option:"showCaptions",render:e=>o.a.createElement(v.a,{id:e.field.id,value:!0})})},{id:"caption-max-length",component:Object(P.a)({label:"Caption max length",option:"captionMaxLength",render:e=>o.a.createElement(b.a,{id:e.field.id,value:"",min:0,unit:"words",placeholder:"No limit"})})},{id:"caption-size",component:Object(P.a)({label:"Caption text size",option:"captionSize",render:e=>o.a.createElement(b.a,{id:e.field.id,value:"",min:0,unit:"px",placeholder:"Theme default"})})},{id:"caption-color",component:Object(P.a)({label:"Caption text color",option:"captionColor",render:e=>o.a.createElement(g.a,{id:e.field.id,value:{r:0,g:0,b:0,a:0}})})},{id:"caption-remove-dots",component:Object(P.a)({label:"Remove dot lines",option:"captionRemoveDots",render:e=>o.a.createElement(v.a,{id:e.field.id,value:!1}),tooltip:()=>o.a.createElement("span",null,'Enable this option to remove lines in captions that are only "dots", such as'," ",o.a.createElement("code",null,"."),", ",o.a.createElement("code",null,"•"),", ",o.a.createElement("code",null,"*"),", etc.")})}]},{id:"likes-comments",label:"Likes & Comments",isFakePro:!0,fields:[{id:"show-likes",component:Object(P.a)({label:"Show likes icon",option:"showLikes",render:e=>o.a.createElement(v.a,{id:e.field.id,value:!1})})},{id:"likes-icon-color",component:Object(P.a)({label:"Likes icon color",option:"likesIconColor",render:e=>o.a.createElement(g.a,{id:e.field.id,value:{r:0,g:0,b:0,a:1}})})},{id:"show-comments",component:Object(P.a)({label:"Show comments icon",option:"showComments",render:e=>o.a.createElement(v.a,{id:e.field.id,value:!1})})},{id:"comments-icon-color",component:Object(P.a)({label:"Comments icon color",option:"commentsIconColor",render:e=>o.a.createElement(g.a,{id:e.field.id,value:{r:0,g:0,b:0,a:1}})})},{id:"lcIconSize",component:Object(P.a)({label:"Icon size",option:"lcIconSize",render:e=>o.a.createElement(b.a,{id:e.field.id,value:"",min:0,unit:"px"})})}]},{id:"follow-btn",label:"Follow button",fields:[{id:"follow-btn-hashtag-msg",component:Object(l.a)(e=>I(e)&&o.a.createElement(E.a,{type:E.b.INFO,showIcon:!0,shake:!0},"The follow button is disabled because you are currently only showing posts from"," ","hashtags, so there are no accounts to follow."))},{id:"show-follow-btn",component:Object(P.a)({label:"Show 'Follow' button",option:"showFollowBtn",disabled:e=>I(e),render:(e,t,a)=>o.a.createElement(v.a,{id:e.field.id,value:t,onChange:a})})},{id:"follow-btn-location",component:Object(P.a)({label:"Location",option:"followBtnLocation",deps:["showFollowBtn"],disabled:e=>j(e),render:(e,t,a)=>o.a.createElement(p.a,{id:e.field.id,value:t,onChange:e=>a(e.value),options:[{value:F.HEADER,label:"Header"},{value:F.BOTTOM,label:"Bottom"},{value:F.BOTH,label:"Both"}]})})},{id:"follow-btn-text",component:Object(P.a)({label:"'Follow' text",option:"followBtnText",deps:["showFollowBtn"],disabled:e=>j(e),render:(e,t,a)=>o.a.createElement(O.a,{id:e.field.id,value:t,onChange:a})})},{id:"follow-btn-text-color",component:Object(P.a)({label:"Text color",option:"followBtnTextColor",deps:["showFollowBtn"],disabled:e=>j(e),render:(e,t,a)=>o.a.createElement(g.a,{id:e.field.id,value:t,onChange:e=>a(e.rgb)})})},{id:"follow-btn-bg-color",component:Object(P.a)({label:"Background color",option:"followBtnBgColor",deps:["showFollowBtn"],disabled:e=>j(e),render:(e,t,a)=>o.a.createElement(g.a,{id:e.field.id,value:t,onChange:e=>a(e.rgb)})})}]},{id:"load-more-btn",label:"Load more button",fields:[{id:"show-load-more-btn",component:Object(P.a)({label:"Show 'Load more' button",option:"showLoadMoreBtn",render:(e,t,a)=>o.a.createElement(v.a,{id:e.field.id,value:t,onChange:a})})},{id:"load-more-btn-text",component:Object(P.a)({label:"'Load more' text",option:"loadMoreBtnText",deps:["showLoadMoreBtn"],disabled:e=>M(e),render:(e,t,a)=>o.a.createElement(O.a,{id:e.field.id,value:t,onChange:a})})},{id:"load-more-btn-text-color",component:Object(P.a)({label:"Text color",option:"loadMoreBtnTextColor",deps:["showLoadMoreBtn"],disabled:e=>M(e),render:(e,t,a)=>o.a.createElement(g.a,{id:e.field.id,value:t,onChange:e=>a(e.rgb)})})},{id:"load-more-btn-bg-color",component:Object(P.a)({label:"Background color",option:"loadMoreBtnBgColor",deps:["showLoadMoreBtn"],disabled:e=>M(e),render:(e,t,a)=>o.a.createElement(g.a,{id:e.field.id,value:t,onChange:e=>a(e.rgb)})})}]}]},190:function(e,t,a){e.exports={root:"MediaGridPicker__root",loading:"MediaGridPicker__loading layout__fill-parent",grid:"MediaGridPicker__grid","grid-disabled":"MediaGridPicker__grid-disabled MediaGridPicker__grid",gridDisabled:"MediaGridPicker__grid-disabled MediaGridPicker__grid",item:"MediaGridPicker__item"}},209:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(0),o=a.n(n),l=a(84),i=a(11);function r({id:e,value:t,onChange:a,showProOptions:n,options:r}){const c=new Set(t.map(e=>e.toString())),s=e=>{const t=e.target.value,n=e.target.checked,o=r.find(e=>e.value.toString()===t);o.isFakePro||o.isDisabled||(n?c.add(t):c.delete(t),a&&a(Array.from(c)))};return o.a.createElement("div",{className:"checkbox-list"},r.filter(e=>!!e).map((t,a)=>{var r;if(t.isFakePro&&!n)return null;const d=Object(i.a)("checkbox-list__option",{"--disabled":t.isDisabled||t.isFakePro});return o.a.createElement("label",{className:d,key:a},o.a.createElement("input",{type:"checkbox",id:e,value:null!==(r=t.value.toString())&&void 0!==r?r:"",checked:c.has(t.value.toString()),onChange:s,disabled:t.isDisabled||t.isFakePro}),o.a.createElement("span",null,t.label),t.isFakePro&&o.a.createElement("div",{className:"checkbox-list__pro-pill"},o.a.createElement(l.a,null)))}))}a(603)},212:function(e,t,a){e.exports={root:"LayoutSelector__root","coming-soon":"LayoutSelector__coming-soon",comingSoon:"LayoutSelector__coming-soon",layout:"LayoutSelector__layout button__toggle-button button__panel-button theme__panel","layout-selected":"LayoutSelector__layout-selected LayoutSelector__layout button__toggle-button button__panel-button theme__panel button__toggle-button-on button__toggle-button button__panel-button theme__panel",layoutSelected:"LayoutSelector__layout-selected LayoutSelector__layout button__toggle-button button__panel-button theme__panel button__toggle-button-on button__toggle-button button__panel-button theme__panel"}},214:function(e,t,a){e.exports={"moderate-viewport":"ModerateViewport__moderate-viewport",moderateViewport:"ModerateViewport__moderate-viewport","moderate-blacklist":"ModerateViewport__moderate-blacklist ModerateViewport__moderate-viewport",moderateBlacklist:"ModerateViewport__moderate-blacklist ModerateViewport__moderate-viewport","moderate-whitelist":"ModerateViewport__moderate-whitelist ModerateViewport__moderate-viewport",moderateWhitelist:"ModerateViewport__moderate-whitelist ModerateViewport__moderate-viewport",loading:"ModerateViewport__loading layout__fill-parent",grid:"ModerateViewport__grid","grid-disabled":"ModerateViewport__grid-disabled ModerateViewport__grid",gridDisabled:"ModerateViewport__grid-disabled ModerateViewport__grid",item:"ModerateViewport__item","item-allowed":"ModerateViewport__item-allowed ModerateViewport__item",itemAllowed:"ModerateViewport__item-allowed ModerateViewport__item","item-thumbnail":"ModerateViewport__item-thumbnail",itemThumbnail:"ModerateViewport__item-thumbnail","item-removed":"ModerateViewport__item-removed ModerateViewport__item",itemRemoved:"ModerateViewport__item-removed ModerateViewport__item","item-focused":"ModerateViewport__item-focused",itemFocused:"ModerateViewport__item-focused"}},215:function(e,t,a){e.exports={item:"PromoteTile__item",selected:"PromoteTile__selected PromoteTile__item",thumbnail:"PromoteTile__thumbnail",unselected:"PromoteTile__unselected PromoteTile__item",icon:"PromoteTile__icon"}},22:function(e,t,a){"use strict";var n=a(0),o=a.n(n),l=a(51),i=a(85),r=a(252),c=a.n(r),s=a(2),d=a(5),u=a(10);function m({option:e,children:t,value:a,previewDevice:n,onChange:l,onChangeDevice:i}){const r=o.a.useCallback(t=>{l({[e]:s.a.isValid(a[e])?s.a.withValue(a[e],t,n):t})},[a[e],n,l]),m=s.a.isValid(a[e]),p=m?s.a.get(a[e],n,!0):a[e];return o.a.createElement("div",{className:c.a.propField},m&&o.a.createElement("div",{className:c.a.deviceBtn},o.a.createElement(d.a,{type:d.c.PILL,size:d.b.NORMAL,onClick:()=>i(s.a.cycle(n)),tooltip:""},o.a.createElement(u.a,{icon:s.a.getIcon(n)}))),o.a.createElement("div",{className:c.a.field},t(p,r)))}t.a=function({label:e,option:t,render:a,memo:n,deps:r,when:c,disabled:s,tooltip:d}){return n=null==n||n,c=null!=c?c:()=>!0,s=null!=s?s:()=>!1,(r=null!=r?r:[]).includes(t),Object(l.a)(n=>c(n)&&o.a.createElement(i.a,Object.assign({},n,{label:e,disabled:s(n),isFakePro:n.field.isFakePro}),o.a.createElement(m,Object.assign({},n,{option:t}),(e,t)=>a(n,e,t)),d&&d(n)),n?[t].concat(r):[])}},234:function(e,t,a){"use strict";a.d(t,"a",(function(){return d}));var n=a(0),o=a.n(n),l=a(136),i=a.n(l),r=a(4),c=a(10),s=a(20);function d({accounts:e,value:t,onChange:a}){t=null!=t?t:[],e=null!=e?e:r.b.list;const n=t.filter(t=>e.some(e=>e.id===t)),l=new Set(n);return o.a.createElement("div",{className:i.a.root},e.map((e,t)=>o.a.createElement(u,{key:t,account:e,selected:l.has(e.id),onChange:t=>{return n=e.id,t?l.add(n):l.delete(n),void a(Array.from(l));var n}})))}function u({account:e,selected:t,onChange:a}){const n=`url("${r.b.getProfilePicUrl(e)}")`,l=()=>{a(!t)},d=Object(s.f)(l);return o.a.createElement("div",{className:i.a.row},o.a.createElement("div",{className:t?i.a.accountSelected:i.a.account,onClick:l,onKeyPress:d,role:"button",tabIndex:0},o.a.createElement("div",{className:i.a.profilePic,style:{backgroundImage:n}}),o.a.createElement("div",{className:i.a.infoColumn},o.a.createElement("div",{className:i.a.username},e.username),o.a.createElement("div",{className:i.a.accountType},e.type)),t&&o.a.createElement(c.a,{icon:"yes-alt",className:i.a.tickIcon})))}},235:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(0),o=a.n(n),l=a(234),i=a(23),r=a(4);function c(e){const t=r.b.getBusinessAccounts();return t.length>0?o.a.createElement(l.a,Object.assign({accounts:t},e)):o.a.createElement(i.a,{type:i.b.WARNING},"Connect a business account to use this feature.")}},236:function(e,t,a){"use strict";a.d(t,"a",(function(){return g}));var n,o=a(0),l=a.n(o),i=a(57),r=a(7),c=a(48),s=a(23),d=(a(438),a(5)),u=a(10),m=a(247),p=a(3),b=a(11),h=a(4);function g({value:e,onChange:t}){const a=(e=null!=e?e:[]).slice(),o=a.map(e=>({id:e.tag,tag:e.tag,sort:e.sort})),[i,r]=l.a.useState(""),[c,d]=l.a.useState(""),[u,b]=l.a.useState(null),g=h.b.getBusinessAccounts().length>0;return l.a.createElement("div",{className:"hashtag-selector"},!g&&l.a.createElement(s.a,{type:s.b.WARNING},"Connect a business account to use this feature."),l.a.createElement(m.a,{className:"hashtag-selector__list",list:o,setList:e=>{const n=e.map(e=>({tag:e.tag,sort:e.sort}));t&&!Object(p.e)(n,a,(e,t)=>e.tag===t.tag&&e.sort===t.sort)&&t(n)},handle:".hashtag-selector__drag-handle",animation:200,delay:1e3,fallbackTolerance:5,delayOnTouchOnly:!0},a.map((e,n)=>l.a.createElement(f,{key:n,disabled:null!==u&&u!==n||!g,hashtag:e,onEdit:e=>((e,n)=>{a[e]=n,t&&t(a)})(n,e),onDelete:()=>(e=>{a.splice(e,1),t&&t(a)})(n),onStartEdit:()=>b(n),onStopEdit:()=>b(null)}))),l.a.createElement(v,{type:n.ADD,disabled:null!==u||!g,hashtag:{tag:i,sort:c},onDone:e=>{a.push(e),t&&t(a),r(""),d("")}}))}function f({hashtag:e,disabled:t,onEdit:a,onDelete:o,onStartEdit:i,onStopEdit:r}){const[c,s]=l.a.useState(!1),d=()=>{s(!1),r&&r()};return c?l.a.createElement(v,{type:n.EDIT,disabled:t,hashtag:e,onDone:e=>{a&&a(e),d()},onCancel:d}):l.a.createElement(E,{hashtag:e,disabled:t,onEdit:()=>{s(!0),i&&i()},onDelete:o})}function E({hashtag:e,disabled:t,onEdit:a,onDelete:n}){const o=Object(b.a)("hashtag-selector__row",{"--static":!0,"--disabled":t});return l.a.createElement("div",{className:o},l.a.createElement("div",{className:"hashtag-selector__drag-handle"},l.a.createElement(u.a,{icon:"menu"})),l.a.createElement("div",{className:"hashtag-selector__tag"},r.a.HashtagSorting.get(e.sort)," posts with ",l.a.createElement("strong",null,"#",e.tag)),l.a.createElement("div",{className:"hashtag-selector__buttons"},l.a.createElement(d.a,{className:"hashtag-selector__edit-btn",type:d.c.PILL,onClick:a,tooltip:"Edit hashtag"},l.a.createElement(u.a,{icon:"edit"})),l.a.createElement(d.a,{className:"hashtag-selector__delete-btn",type:d.c.DANGER_PILL,onClick:n,tooltip:"Remove hashtag"},l.a.createElement(u.a,{icon:"trash"}))))}function v({type:e,hashtag:t,disabled:a,onChange:m,onDone:p,onCancel:h,focus:g}){const f=e===n.ADD,[E,v]=l.a.useState({tag:"",sort:"recent"});Object(o.useEffect)(()=>{var e;v({tag:null!==(e=t.tag)&&void 0!==e?e:"",sort:t.sort?t.sort:"recent"})},[t]);const[_,w]=l.a.useState(0),[k,y]=l.a.useState(!0);Object(o.useEffect)(()=>{if(y(!1),_>0){const e=setTimeout(()=>y(!0),10),t=setTimeout(()=>y(!1),310);return()=>{clearTimeout(e),clearTimeout(t)}}},[_]);const C=()=>{!_&&p&&p(E)},O=Object(b.a)("hashtag-selector__row",{"--disabled":a});return l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{className:O},l.a.createElement("input",{className:"hashtag-selector__tag",type:"text",value:"#"+E.tag,onChange:e=>{const t=e.target.value.slice(1),a={tag:Object(c.b)(t),sort:E.sort};w(t!==a.tag?Date.now():0),v(a),m&&m(a)},onKeyDown:e=>{switch(e.key){case"Enter":C();break;case"Escape":h&&h()}},autoFocus:g}),l.a.createElement(i.a,{className:"hashtag-selector__sort",placeholder:"Sort by",value:E.sort,onChange:e=>{v({tag:E.tag,sort:e.value}),m&&m({tag:E.tag,sort:e.value})},isSearchable:!1,options:Array.from(r.a.HashtagSorting.entries()).map(([e,t])=>({value:e,label:t}))}),l.a.createElement("div",{className:"hashtag-selector__buttons"},f?l.a.createElement(d.a,{type:d.c.PRIMARY,className:"hashtag-selector__add-btn",tooltip:"Add new hashtag",onClick:C,disabled:0===E.tag.length},"Add"):l.a.createElement(d.a,{type:f?d.c.PRIMARY:d.c.PILL,className:"hashtag-selector__done-btn",tooltip:"Done",disabled:0===E.tag.length,onClick:C},l.a.createElement(u.a,{icon:"yes"})),!f&&l.a.createElement(d.a,{type:d.c.DANGER_PILL,className:"hashtag-selector__cancel-btn",onClick:h,tooltip:"Cancel changes"},l.a.createElement(u.a,{icon:"no"})))),_?l.a.createElement(s.a,{type:s.b.ERROR,shake:k,showIcon:!0,isDismissible:!0,onDismiss:()=>w(0)},"Hashtags may only contain letters, numbers and underscores"):null)}!function(e){e[e.ADD=0]="ADD",e[e.EDIT=1]="EDIT"}(n||(n={}))},237:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(0),o=a.n(n),l=a(184);function i(e){return o.a.createElement(l.a,Object.assign({groups:e.tab.groups},e))}},238:function(e,t,a){"use strict";a.d(t,"a",(function(){return h}));var n=a(0),o=a.n(n),l=a(57),i=a(12),r=a(16),c=(a(17),a(141)),s=a(85),d=a(62),u=a(185),m=a(3);const p=[],b={linkType:"",postId:0,postTitle:"",postUrl:"",url:"",linkText:"",newTab:!1,linkDirectly:!0};function h({config:e,onChange:t}){e=null!=e?e:b,e=Object.assign(Object.assign({},b),e),0===p.length&&(p.push({value:"",label:"- Do not link -"},{value:"url",label:"Custom URL"}),r.a.config.postTypes.forEach(e=>{"attachment"!==e.name&&p.push({value:e.name,label:e.labels.singular_name})}));const a=o.a.useRef(),l=o.a.useRef(!1),i=o.a.useRef(),[s,d]=o.a.useState([]),[u,m]=o.a.useState(!1);Object(n.useEffect)(()=>(l.current=!1,e.linkType&&"url"!==e.linkType&&(m(!0),S("").then(e=>{l.current||d(e)}).finally(()=>{l.current||m(!1)})),()=>l.current=!0),[e.linkType]);const h=o.a.useCallback(a=>{t({linkType:a,postId:0,postTitle:"",postUrl:"",url:e.url,newTab:e.newTab,linkText:e.linkText})},[e,t]),k=o.a.useCallback(a=>{if(null===a)t(Object.assign(Object.assign({},e),{postId:0,postTitle:"",postUrl:""}));else{const n=i.current.find(e=>e.id==a.value);t(Object.assign(Object.assign({},e),{postId:a.value,postTitle:n.title,postUrl:n.permalink}))}},[e,t]),y=o.a.useCallback(a=>{t(Object.assign(Object.assign({},e),{url:a}))},[e,t]),C=o.a.useCallback(a=>{t(Object.assign(Object.assign({},e),{newTab:a}))},[e,t]),O=o.a.useCallback(a=>{t(Object.assign(Object.assign({},e),{linkDirectly:a}))},[e,t]),P=o.a.useCallback(a=>{t(Object.assign(Object.assign({},e),{linkText:a}))},[e,t]),S=o.a.useCallback(t=>(clearTimeout(a.current),new Promise(n=>{a.current=setTimeout(()=>{r.a.restApi.searchPosts(t,e.linkType).then(e=>{i.current=e.data,n(e.data.map(e=>({value:e.id,label:e.title})))}).catch(e=>{})},1e3)})),[e.linkType]),F=r.a.config.postTypes.find(t=>t.name===e.linkType);return o.a.createElement(o.a.Fragment,null,o.a.createElement(g,{value:e.linkType,onChange:h}),"url"===e.linkType&&o.a.createElement(f,{value:e.url,onChange:y}),e.linkType&&"url"!==e.linkType&&o.a.createElement(E,{postType:F,postId:e.postId,postTitle:e.postTitle,onChange:k,loadOptions:S,isLoading:u,defaultPosts:s}),e.linkType&&o.a.createElement(v,{value:e.linkDirectly,onChange:O}),e.linkType&&o.a.createElement(_,{value:e.newTab,onChange:C}),e.linkType&&o.a.createElement(w,{value:e.linkText,onChange:P,placeholder:c.a.getDefaultLinkText(e)}))}const g=o.a.memo((function({value:e,onChange:t}){return o.a.createElement(s.a,{id:"promo-link-to",label:"Link to"},o.a.createElement(l.a,{id:"promo-link-to",value:e||"",onChange:e=>t(e.value),options:p,isCreatable:!1}))})),f=o.a.memo((function({value:e,onChange:t}){return o.a.createElement(s.a,{id:"link-promo-url",label:"URL",wide:!0},o.a.createElement(u.a,{id:"link-promo-url",value:e,onChange:t}))})),E=o.a.memo((function({postType:e,postId:t,postTitle:a,onChange:n,defaultPosts:i,isLoading:r,loadOptions:c}){const d=e?"Search for a "+e.labels.singular_name:"Search";return o.a.createElement(s.a,{id:"link-promo-url",label:d,wide:!0},o.a.createElement(l.a,{async:!0,cacheOptions:!0,key:Object(m.u)(),id:"sli-promo-search-post",placeholder:"Select or start typing...",value:t||0,defaultValue:0,defaultInputValue:t?a:"",onChange:n,defaultOptions:i,loadOptions:c,noOptionsMessage:({inputValue:e})=>e.length?`No posts were found for "${e}"`:"Type to search for posts",loadingMessage:()=>"Searching...",isLoading:r,isSearchable:!0,isClearable:!0}))})),v=o.a.memo((function({value:e,onChange:t}){return o.a.createElement(s.a,{id:"promo-link-directly",label:"Link directly"},o.a.createElement(d.a,{id:"promo-link-directly",value:e,onChange:t}),o.a.createElement(o.a.Fragment,null,o.a.createElement("p",null,"Tick this box to make posts go directly to the link. If left unticked, posts will open the popup box."),o.a.createElement("p",null,"To enable your feed's popup box and sidebar:"),o.a.createElement("ol",{style:{marginLeft:15}},o.a.createElement("li",null,"Set the ",o.a.createElement("b",null,"Design » Feed » Open posts in")," option to ",o.a.createElement("b",null,"Popup box")),o.a.createElement("li",null,"Enable the ",o.a.createElement("b",null,"Design » Popup box » Show sidebar")," option."))))})),_=o.a.memo((function({value:e,onChange:t}){return o.a.createElement(s.a,{id:"promo-link-new-tab",label:"Open in a new tab"},o.a.createElement(d.a,{id:"promo-link-new-tab",value:e,onChange:t}))})),w=o.a.memo((function({value:e,onChange:t,placeholder:a}){return o.a.createElement(s.a,{id:"promo-link-text",label:"Popup box link text"},o.a.createElement(u.a,{id:"promo-link-text",value:e,onChange:t,placeholder:a}),o.a.createElement(o.a.Fragment,null,o.a.createElement("p",null,"The text to use for the link in the popup box sidebar:",o.a.createElement("br",null),o.a.createElement("img",{src:i.a.image("popup-link-text.png"),alt:""})),o.a.createElement("p",null,"Remember to enable your feed's popup box and sidebar, like so:"),o.a.createElement("ol",{style:{marginLeft:15}},o.a.createElement("li",null,"Set the ",o.a.createElement("b",null,"Design » Feed » Open posts in")," option to ",o.a.createElement("b",null,"Popup box")),o.a.createElement("li",null,"Enable the ",o.a.createElement("b",null,"Design » Popup box » Show sidebar")," option."))))}))},239:function(e,t,a){"use strict";a.d(t,"a",(function(){return u}));var n=a(0),o=a.n(n),l=a(215),i=a.n(l),r=a(8),c=a(73),s=a(10),d=a(3);const u=o.a.memo((function({media:e,selected:t,promo:a}){const n=r.a.getType(a),l=r.a.getConfig(a),d=n&&n.isValid(l)&&n.getIcon?n.getIcon(e,l):void 0;return o.a.createElement("div",{className:t?i.a.selected:i.a.unselected},o.a.createElement(c.a,{media:e,className:i.a.thumbnail}),d&&o.a.createElement(s.a,{className:i.a.icon,icon:d}))}),(function(e,t){return e.selected===t.selected&&e.media.id===t.media.id&&r.a.getType(e.promo)==r.a.getType(e.promo)&&Object(d.c)(r.a.getConfig(e.promo),r.a.getConfig(t.promo))}))},240:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(0),o=a.n(n),l=a(298),i=a.n(l),r=a(73);function c({media:e}){return o.a.createElement("div",{className:i.a.container},o.a.createElement("div",{className:i.a.sizer},o.a.createElement(r.a,{media:e})))}},243:function(e,t,a){"use strict";a.d(t,"a",(function(){return N}));var n=a(0),o=a.n(n),l=a(295),i=a.n(l),r=a(92),c=a(256),s=a.n(c),d=a(7),u=a(84),m=a(382),p=a(23),b=a(67),h=a(96);const g=o.a.memo((function({value:e,onChange:t,tab:a}){const[n,l]=o.a.useState(!1);function i(){l(!1)}const r=e.moderationMode===d.a.ModerationMode.WHITELIST;return o.a.createElement(h.a,{padded:!0},o.a.createElement("div",null,o.a.createElement("p",null,"You can choose to hide specific posts or to only show posts that you choose."),o.a.createElement("p",null,"Choose the type of moderation that you wish to apply, then simply click on the posts that you "," ","want to show or hide. Posts that appear in grey will not be shown in the feed."),o.a.createElement("hr",null),o.a.createElement("div",{className:s.a.mode},a.isFakePro&&o.a.createElement("div",{className:s.a.proPill},o.a.createElement(u.a,null)),o.a.createElement(m.a,{name:"manualFilterMode",value:e.moderationMode,onChange:function(n){a.isFakePro||t({moderationMode:n,moderation:e.moderation})},disabled:a.isFakePro,options:[{value:d.a.ModerationMode.BLACKLIST,label:"Hide the selected posts"},{value:d.a.ModerationMode.WHITELIST,label:"Only show the selected posts"}]})),(e.moderation.length>0||r)&&o.a.createElement("a",{className:s.a.reset,onClick:function(){l(!0)}},"Reset moderation")),!a.isFakePro&&o.a.createElement("div",null,o.a.createElement("hr",null),o.a.createElement(p.a,{type:p.b.PRO_TIP,showIcon:!0},o.a.createElement("span",null,o.a.createElement("strong",null,"Pro tip"),":"," ","You can navigate the posts using arrow keys and select them by pressing Enter."))),o.a.createElement(b.a,{isOpen:n,title:"Are you sure?",buttons:["Yes","No"],onAccept:function(){a.isFakePro||(i(),t({moderationMode:d.a.ModerationMode.BLACKLIST,moderation:[]}))},onCancel:i},o.a.createElement("p",null,"Are you sure you want to reset your moderation settings? This cannot be undone.")))}),(e,t)=>e.value.moderationMode===t.value.moderationMode&&e.value.moderation.length===t.value.moderation.length);var f=a(214),E=a.n(f),v=a(73),_=a(83),w=a(3),k=a(182),y=a(11),C=d.a.ModerationMode;const O=o.a.memo((function({value:e,feed:t,tab:a,onChange:n}){const[l,i]=o.a.useState(0),r=new Set(e.moderation);return o.a.createElement(k.a,{feed:t,selected:l,onSelectMedia:(e,t)=>i(t),onClickMedia:function(t){if(a.isFakePro||!t)return;const o=new Set(e.moderation);o.has(t.id)?o.delete(t.id):o.add(t.id),n({moderation:Array.from(o),moderationMode:e.moderationMode})},autoFocusFirst:!0,disabled:a.isFakePro,store:_.c},(t,a)=>o.a.createElement(P,{media:t,mode:e.moderationMode,focused:a===l,selected:r.has(t.id)}))}),(function(e,t){return e.value.moderationMode===t.value.moderationMode&&e.value.moderation.length===t.value.moderation.length&&Object(w.e)(e.value.moderation,t.value.moderation)})),P=o.a.forwardRef(({media:e,selected:t,focused:a,mode:l},i)=>{i||(i=o.a.useRef()),Object(n.useEffect)(()=>{a&&i.current.focus()},[a]);const r=l===C.BLACKLIST,c=Object(y.b)(t!==r?E.a.itemAllowed:E.a.itemRemoved,a?E.a.itemFocused:null);return o.a.createElement("div",{ref:i,className:c},o.a.createElement(v.a,{media:e,className:E.a.itemThumbnail}))});var S=a(5),F=a(10);function N(e){const[t,a]=Object(n.useState)("content"),l=()=>a("sidebar"),c=()=>a("content");return o.a.createElement(r.a,{primary:"content",current:t,sidebar:t=>o.a.createElement(o.a.Fragment,null,t&&o.a.createElement(r.a.Navigation,{onClick:c}),o.a.createElement(g,Object.assign({},e))),content:t=>o.a.createElement("div",{className:i.a.viewport},t&&o.a.createElement("div",{className:i.a.mobileViewportHeader},o.a.createElement(S.a,{onClick:l},o.a.createElement(F.a,{icon:"admin-generic"}),o.a.createElement("span",null,"Moderation options"))),o.a.createElement(O,Object.assign({},e)))})}},244:function(e,t,a){"use strict";a.d(t,"a",(function(){return T}));var n=a(0),o=a.n(n),l=a(296),i=a.n(l),r=a(57),c=a(101),s=a(8),d=a(238),u=a(23),m=a(3),p=a(85),b=a(62),h=a(7),g=a(14),f=a(209),E=a(183);const v={id:"link",label:"Link",component:d.a,isValid:()=>!1},_={type:"link",config:{linkType:"url",url:"https://your-promotion-url.com",linkText:"Check out my promotion"}};function w({value:e,tab:t,onChange:a,selected:n,onNextPost:l,promoTypeRef:d}){const f=c.a.mediaStore.media[n],w=n>=c.a.mediaStore.media.length-1,k=o.a.useRef(g.a.isEmpty(e.promotions)?"link":g.a.values(e.promotions)[0].type),C=o.a.useCallback(n=>{if(!t.isFakePro){k.current=n.value;const t=g.a.map(e.promotions,e=>({type:n.value,config:s.a.getConfig(e)}));a({promotions:t})}},[t,e.promotions]),O=o.a.useCallback(o=>{if(!t.isFakePro){const t=c.a.mediaStore.media[n],l={type:k.current,config:Object(m.h)(o)},i=g.a.withEntry(e.promotions,t.id,l);a({promotions:i})}},[n,t.isFakePro]),P=o.a.useCallback(()=>{!t.isFakePro&&l()},[t.isFakePro]),S=t.isFakePro?_:h.a.getFeedPromo(f,e),F=t.isFakePro?v:s.a.getTypeById(k.current),N=s.a.getConfig(S),T=void 0!==s.a.getGlobalPromo(f)&&e.globalPromotionsEnabled,x=void 0!==s.a.getAutoPromo(f)&&e.autoPromotionsEnabled,I=s.a.getTypes().map(e=>({value:e.id,label:e.label}));return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:i.a.top},o.a.createElement("p",null,"Promote your blog posts, landing pages, products, and much more through your Instagram feed."),o.a.createElement("hr",null),o.a.createElement(p.a,{id:"enable-promo",label:"Enable promotion"},o.a.createElement(b.a,{value:e.promotionEnabled,onChange:e=>a({promotionEnabled:e})})),!e.promotionEnabled&&o.a.createElement(u.a,{type:u.b.WARNING,showIcon:!0},"All feed, global and automated promotions are disabled."," ","Promotions may still be edited but will not apply to posts in this feed."),o.a.createElement(y,{options:e,onChange:a}),o.a.createElement(p.a,{id:"promo-type",label:"Promotion type"},o.a.createElement(r.a,{id:"sli-promo-type",ref:d,value:F.id,onChange:C,options:I,isSearchable:!1,isCreatable:!1,isClearable:!1,disabled:t.isFakePro}))),o.a.createElement(E.a,{key:f?f.id:void 0,type:F,config:N,onChange:O,hasGlobal:T,hasAuto:x,showTutorial:!f,showNextBtn:"-more-"!==F.id,isNextBtnDisabled:w,onNext:P}),t.isFakePro&&o.a.createElement("div",{className:i.a.disabledOverlay}))}const k=[{value:"global",label:"Global promotions"},{value:"auto",label:"Automated promotions"}];function y({options:e,onChange:t}){const a=Object(n.useCallback)(e=>{t({globalPromotionsEnabled:e.includes("global"),autoPromotionsEnabled:e.includes("auto")})},[t]),l=[e.globalPromotionsEnabled?"global":0,e.autoPromotionsEnabled?"auto":0];return o.a.createElement(p.a,{id:"enable-other-promos",label:"Include other promotions",disabled:!e.promotionEnabled},o.a.createElement(f.a,{value:l,onChange:a,options:k}))}var C=a(182),O=a(239);const P=o.a.memo((function({value:e,feed:t,tab:a,selected:n,onSelectMedia:l,onClickMedia:i}){return o.a.createElement(C.a,{feed:t,store:c.a.mediaStore,selected:n,onSelectMedia:l,onClickMedia:i,disabled:a.isFakePro},(t,a)=>{const l=h.a.getPromo(t,e);return o.a.createElement(O.a,{media:t,selected:a===n,promo:l})})}),(function(e,t){return e.selected===t.selected&&e.onSelectMedia===t.onSelectMedia&&e.onClickMedia===t.onClickMedia&&e.value.promotionEnabled===t.value.promotionEnabled&&e.value.autoPromotionsEnabled===t.value.autoPromotionsEnabled&&e.value.globalPromotionsEnabled===t.value.globalPromotionsEnabled&&g.a.size(e.value.promotions)===g.a.size(t.value.promotions)&&e.feed.media.length===t.feed.media.length&&e.value.promotions===t.value.promotions}));var S=a(92),F=a(96),N=a(240);function T(e){const[t,a]=o.a.useState(null),[n,l]=o.a.useState(!1),i=()=>l(!1),r=o.a.useRef(),s=o.a.useCallback(()=>{a(e=>Math.min(e+1,c.a.mediaStore.media.length-1))},[]),d=o.a.useCallback((e,t)=>{a(t)},[]),u=o.a.useCallback((e,t)=>{a(t),l(!0),requestAnimationFrame(()=>{r.current&&null!==t&&r.current.focus()})},[r]);return o.a.createElement(S.a,{primary:"content",current:n?"sidebar":"content",sidebar:a=>o.a.createElement(o.a.Fragment,null,a&&o.a.createElement(o.a.Fragment,null,o.a.createElement(S.a.Navigation,{onClick:i}),c.a.mediaStore.media[t]&&o.a.createElement(N.a,{media:c.a.mediaStore.media[t]})),o.a.createElement(F.a,null,o.a.createElement(w,Object.assign({},e,{selected:t,onNextPost:s,promoTypeRef:r})))),content:a=>o.a.createElement(o.a.Fragment,null,a&&o.a.createElement("div",{style:{textAlign:"center"}},o.a.createElement("p",null,"Click or tap a post to set up a promotion for it")),o.a.createElement(P,Object.assign({},e,{selected:t,onSelectMedia:d,onClickMedia:u})))})}},252:function(e,t,a){e.exports={"prop-field":"EditorPropField__prop-field",propField:"EditorPropField__prop-field","device-btn":"EditorPropField__device-btn",deviceBtn:"EditorPropField__device-btn",field:"EditorPropField__field"}},253:function(e,t,a){e.exports={"filter-field":"FilterFieldRow__filter-field",filterField:"FilterFieldRow__filter-field",bordered:"FilterFieldRow__bordered FilterFieldRow__filter-field",label:"FilterFieldRow__label"}},254:function(e,t,a){e.exports={"inc-global-filters":"IncGlobalFiltersField__inc-global-filters",incGlobalFilters:"IncGlobalFiltersField__inc-global-filters",label:"IncGlobalFiltersField__label",field:"IncGlobalFiltersField__field"}},256:function(e,t,a){e.exports={mode:"ModerateSidebar__mode","pro-pill":"ModerateSidebar__pro-pill",proPill:"ModerateSidebar__pro-pill",reset:"ModerateSidebar__reset"}},258:function(e,t,a){e.exports={root:"FeedEditor__root",hidden:"FeedEditor__hidden",content:"FeedEditor__content","accounts-onboarding":"FeedEditor__accounts-onboarding",accountsOnboarding:"FeedEditor__accounts-onboarding"}},259:function(e,t,a){e.exports={navbar:"EditorNavbar__navbar layout__z-high","fake-pro-item":"EditorNavbar__fake-pro-item",fakeProItem:"EditorNavbar__fake-pro-item","pro-pill":"EditorNavbar__pro-pill",proPill:"EditorNavbar__pro-pill"}},292:function(e,t,a){e.exports={"connect-button":"ConnectSidebar__connect-button",connectButton:"ConnectSidebar__connect-button","connect-sidebar":"ConnectSidebar__connect-sidebar",connectSidebar:"ConnectSidebar__connect-sidebar","connect-account":"ConnectSidebar__connect-account",connectAccount:"ConnectSidebar__connect-account"}},293:function(e,t,a){e.exports={"field-group":"FieldGroup__field-group",fieldGroup:"FieldGroup__field-group",spoiler:"FieldGroup__spoiler","pro-pill":"FieldGroup__pro-pill",proPill:"FieldGroup__pro-pill",disabled:"FieldGroup__disabled"}},295:function(e,t,a){e.exports={viewport:"ModerateTab__viewport","mobile-viewport-header":"ModerateTab__mobile-viewport-header",mobileViewportHeader:"ModerateTab__mobile-viewport-header"}},296:function(e,t,a){e.exports={top:"PromoteSidebar__top",row:"PromoteSidebar__row","disabled-overlay":"PromoteSidebar__disabled-overlay",disabledOverlay:"PromoteSidebar__disabled-overlay"}},297:function(e,t,a){e.exports={bottom:"PromotionFields__bottom","remove-promo":"PromotionFields__remove-promo",removePromo:"PromotionFields__remove-promo"}},298:function(e,t,a){e.exports={container:"PromotePreviewTile__container",sizer:"PromotePreviewTile__sizer"}},373:function(e,t,a){e.exports={"field-group-list":"FieldGroupList__field-group-list",fieldGroupList:"FieldGroupList__field-group-list"}},376:function(e,t,a){e.exports={"preview-options":"DesignSidebar__preview-options",previewOptions:"DesignSidebar__preview-options"}},389:function(e,t,a){e.exports={viewport:"EditorViewport__viewport"}},390:function(e,t,a){"use strict";a.d(t,"a",(function(){return f}));var n=a(0),o=a.n(n),l=a(138),i=a.n(l),r=a(86),c=a(16),s=a(23),d=a(56),u=a(241),m=a(5),p=a(12),b=a(26),h=a(233),g=b.a.SavedFeed;function f({name:e}){const t=g.getLabel(e),a=`[instagram feed="${r.a.feed.id}"]`,n=c.a.config.adminUrl+"/widgets.php",l=c.a.config.adminUrl+"/customize.php?autofocus%5Bpanel%5D=widgets";return r.a.feed.id?o.a.createElement("div",{className:i.a.embedSidebar},r.a.feed.usages.length>0&&o.a.createElement(d.a,{label:"Instances",defaultOpen:!0,fitted:!0,scrollIntoView:!0},o.a.createElement("div",{className:i.a.instances},o.a.createElement("p",null,"This feed is currently being shown in these pages:"),o.a.createElement("ul",null,r.a.feed.usages.map((e,t)=>o.a.createElement("li",{key:t},o.a.createElement("a",{href:`${c.a.config.adminUrl}/post.php?action=edit&post=${e.id}`,target:"_blank"},e.name),o.a.createElement("span",null,"(",e.type,")")))))),o.a.createElement(d.a,{label:"Shortcode",defaultOpen:!0,fitted:!0,scrollIntoView:!0},o.a.createElement("div",null,o.a.createElement("p",null,"Copy the shortcode below and paste it in any page or post to embed this feed:"),o.a.createElement("div",{className:i.a.shortcode},o.a.createElement("code",null,a),o.a.createElement(u.a,{feed:r.a.feed},o.a.createElement(m.a,{type:m.c.SECONDARY},"Copy"))))),c.a.config.hasElementor&&o.a.createElement(d.a,{className:p.a.isPro?void 0:i.a.pro,label:p.a.isPro?"Elementor Widget":o.a.createElement(h.a,null,"Elementor widget"),defaultOpen:!0,fitted:!0,scrollIntoView:!0},o.a.createElement("div",null,o.a.createElement("p",null,"To embed this feed in Elementor:"),o.a.createElement("ol",null,o.a.createElement("li",null,o.a.createElement("span",null,"Search for the ",o.a.createElement("b",null,"Spotlight Instagram feed")," widget",o.a.createElement(s.a,{type:s.b.INFO,showIcon:!0},"Choose the one with the Instagram logo. The other one is for the normal"," ","WordPress widget."))),o.a.createElement("li",null,"Add it to your post or page"),o.a.createElement("li",null,"Then choose ",o.a.createElement("strong",null,t)," from the list of feeds.")),o.a.createElement(v,{images:[{src:"elementor-widget-search.png",alt:"Searching for the widget"},{src:"elementor-widget-feed.png",alt:"The feed in a widget"}]}))),o.a.createElement(d.a,{label:"WordPress Block",defaultOpen:!c.a.config.hasElementor,fitted:!0,scrollIntoView:!0},o.a.createElement("div",null,o.a.createElement("p",null,"To embed this feed in the WordPress block editor:"),o.a.createElement("ol",null,o.a.createElement("li",null,"Search for the ",o.a.createElement("b",null,"Spotlight Instagram feed")," block"),o.a.createElement("li",null,"add it to your post or page."),b.a.list.length>1?o.a.createElement("li",null,"Next, choose ",o.a.createElement("strong",null,t)," from the list of feeds."):o.a.createElement("li",null,"Since this is your only feed, Spotlight will automatically show this feed.")),b.a.list.length>1?o.a.createElement(v,{images:[{src:"wp-block-search.png",alt:"Searching for the block"},{src:"wp-block-select.png",alt:"Choosing a feed for the block"},{src:"wp-block.png",alt:"The feed in a block"}]}):o.a.createElement(v,{images:[{src:"wp-block-search.png",alt:"Searching for the block"},{src:"wp-block.png",alt:"The feed in a block"}]}))),o.a.createElement(d.a,{label:"WordPress Widget",defaultOpen:!1,fitted:!0,scrollIntoView:!0},o.a.createElement("div",null,o.a.createElement("p",null,"To embed this feed as a WordPress widget:"),o.a.createElement("ol",null,o.a.createElement("li",null,"Go to the"," ",o.a.createElement("a",{href:n,target:"_blank"},"Appearance » Widgets")," ","page or the"," ",o.a.createElement("a",{href:l,target:"_blank"},"Widgets section of the Customizer")),o.a.createElement("li",null,"Then, add a ",o.a.createElement("strong",null,"Spotlight Instagram Feed")," widget"),o.a.createElement("li",null,"In the widget's settings, choose the ",o.a.createElement("strong",null,t)," as the feed"," ","to be shown.")),o.a.createElement(E,{img:"widget.png",alt:"Example of a widget"})))):o.a.createElement("div",{className:i.a.embedSidebar},o.a.createElement("div",{className:i.a.saveMessage},o.a.createElement(s.a,{type:s.b.INFO,showIcon:!0},"You're almost there... Click the ",o.a.createElement("strong",null,"Save")," button at the top-right to be"," ","able to embed this feed on your site!")))}function E({img:e,alt:t,annotation:a,onClick:n}){return o.a.createElement("figure",{className:i.a.example},o.a.createElement("figcaption",{className:i.a.caption},"Example:"),o.a.createElement("img",{src:p.a.image(e),alt:null!=t?t:"",style:{cursor:n?"pointer":"default"},onClick:n}),void 0!==a&&o.a.createElement("div",{className:i.a.exampleAnnotation},a))}function v({images:e}){const[t,a]=o.a.useState(0),l=o.a.useRef(),i=()=>{r(),l.current=setInterval(c,2e3)},r=()=>{clearInterval(l.current)},c=()=>{i(),a(t=>(t+1)%e.length)};Object(n.useEffect)(()=>(i(),r),[]);const s=e[t];return o.a.createElement(E,{img:s.src,alt:s.alt,annotation:t+1,onClick:c})}},393:function(e,t,a){"use strict";a.d(t,"a",(function(){return G}));var n=a(0),o=a.n(n),l=a(258),i=a.n(l),r=a(259),c=a.n(r),s=a(12),d=a(7),u=a(66),m=a(84),p=a(152),b=a(260),h=a(283),g=a(118),f=a(5),E=a(284),v=a(285),_=a(154),w=a(26).a.SavedFeed;const k=o.a.memo((function(e){const t=d.a.Options.hasSources(e.value),a=(e.showFakeOptions||s.a.isPro?e.tabs:e.tabs.filter(e=>!e.isFakePro)).map(e=>({key:e.id,label:o.a.createElement(y,{key:e.id,tab:e}),disabled:!e.alwaysEnabled&&!t}));return o.a.createElement("div",{className:c.a.navbar},o.a.createElement(p.a,{breakpoints:b.a.Sizes.ALL},t=>{const n=e.showNameField?o.a.createElement(h.a,{key:"name-field",value:e.name,onDone:e.onRename,defaultValue:w.getDefaultName()}):void 0,l=e.showDoneBtn?o.a.createElement(g.a,{key:"save-btn",content:t=>t?"Saving ...":e.doneBtnText,isSaving:e.isSaving,disabled:!e.isDoneBtnEnabled,onClick:e.onSave}):void 0,i=e.showCancelBtn?o.a.createElement(f.a,{key:"cancel-btn",onClick:e.onCancel,disabled:!e.isCancelBtnEnabled,children:e.cancelBtnText}):void 0;if(t<=b.a.Sizes.SMALL)return o.a.createElement(E.a,{steps:a,current:e.tabId,onChangeStep:e.onChangeTab,firstStep:i,lastStep:l},n);if(t<=b.a.Sizes.MEDIUM)return o.a.createElement(v.a,{pages:a,current:e.tabId,onChangePage:e.onChangeTab,hideMenuArrow:!0,showNavArrows:!0},{path:n?[n]:[],right:[i,l]});let r=[o.a.createElement(u.a,{key:"logo"})];return n&&r.push(n),o.a.createElement(_.a,{current:e.tabId,onClickTab:e.onChangeTab},{path:r,tabs:a,right:[i,l]})}))}),(e,t)=>e.tabId===t.tabId&&e.name===t.name&&e.showFakeOptions===t.showFakeOptions&&e.showDoneBtn===t.showDoneBtn&&e.showCancelBtn===t.showCancelBtn&&e.doneBtnText===t.doneBtnText&&e.cancelBtnText===t.cancelBtnText&&e.showNameField===t.showNameField&&e.onChangeTab===t.onChangeTab&&e.onRename===t.onRename&&e.onSave===t.onSave&&e.onCancel===t.onCancel&&e.isSaving===t.isSaving&&e.isDoneBtnEnabled===t.isDoneBtnEnabled&&e.isCancelBtnEnabled===t.isCancelBtnEnabled&&d.a.Options.hasSources(e.value)===d.a.Options.hasSources(t.value));function y({tab:e}){return e.isFakePro?o.a.createElement(C,{tab:e}):o.a.createElement("span",null,e.label)}function C({tab:e}){return o.a.createElement("span",{className:c.a.fakeProItem},o.a.createElement(m.a,{className:c.a.proPill}),o.a.createElement("span",null,e.label))}var O=a(96),P=a(92);function S(e){var{children:t,showPreviewBtn:a,onOpenPreview:n}=e,l=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(a[n[o]]=e[n[o]])}return a}(e,["children","showPreviewBtn","onOpenPreview"]);return!l.tab.sidebar||l.tab.showSidebar&&!l.tab.showSidebar()?null:o.a.createElement(o.a.Fragment,null,a&&o.a.createElement(P.a.Navigation,{align:"right",text:"Preview",icon:"visibility",onClick:n}),o.a.createElement(O.a,null,l.tab.sidebar&&o.a.createElement(l.tab.sidebar,Object.assign({tab:l.tab},l)),null!=t?t:null))}var F=a(389),N=a.n(F),T=a(87),x=a.n(T),I=a(6),j=a(2),M=a(112),A=a(94),B=a(10);const L=Object(I.b)(({feed:e,showCloseBtn:t,onClose:a})=>{if(!d.a.Options.hasSources(e.options))return o.a.createElement(A.a,{className:x.a.onboarding},t&&o.a.createElement(f.a,{onClick:a},o.a.createElement(B.a,{icon:"hidden"}),o.a.createElement("span",null,"Close Preview")),o.a.createElement("div",null,o.a.createElement("h1",null,"Select an account to get"," ",o.a.createElement("span",{className:x.a.noBreak},"started"," "," →")),o.a.createElement("p",null,"Your Instagram posts will be displayed instantly so you can easily design your feed using"," ","the live interactive preview.")));const n=e.mode,l=n===j.a.Mode.DESKTOP,i=n===j.a.Mode.TABLET,r=n===j.a.Mode.PHONE,c=l?x.a.root:x.a.shrunkRoot,s=r?x.a.phoneSizer:i?x.a.tabletSizer:x.a.sizer;return o.a.createElement("div",{className:c},o.a.createElement("div",{className:x.a.statusBar},o.a.createElement("div",{className:x.a.statusIndicator},o.a.createElement("svg",{viewBox:"0 0 24 24"},o.a.createElement("circle",{cx:"12",cy:"12",r:"12",fill:"red"})),o.a.createElement("span",{className:x.a.indicatorText},"Live interactive preview"),o.a.createElement("span",{className:x.a.indicatorDash}," — "),o.a.createElement("span",{className:x.a.indicatorCounter},"Showing ",e.media.length," out of ",e.totalMedia," posts"),e.numLoadedMore>0&&o.a.createElement("span",{className:x.a.reset},"(",o.a.createElement("a",{onClick:()=>e.load()},"Reset"),")")),t&&o.a.createElement(f.a,{onClick:a},o.a.createElement(B.a,{icon:"hidden"}),o.a.createElement("span",null,"Close Preview"))),o.a.createElement("div",{className:x.a.container},o.a.createElement("div",{className:s},0===e.media.length&&d.a.Options.hasSources(e.options)&&d.a.Options.isLimitingPosts(e.options)&&!e.isLoading?o.a.createElement("div",{className:x.a.noPostsMsg},o.a.createElement("p",null,"There are no posts to show. Try relaxing your filters and moderation.")):o.a.createElement(M.a,{feed:e}))))});function D(e){var{children:t,isCollapsed:a,onClosePreview:n}=e,l=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(a[n[o]]=e[n[o]])}return a}(e,["children","isCollapsed","onClosePreview"]);return o.a.createElement("div",{className:N.a.viewport},t||(l.tab.viewport?o.a.createElement(l.tab.viewport,Object.assign({},l)):o.a.createElement(L,Object.assign({},l,{showCloseBtn:a,onClose:n}))))}var R=a(172),z=a(4),H=a(116);function V({value:e,feed:t,onChange:a,onChangeTab:n}){const[l,i]=o.a.useState(!1);return o.a.createElement(H.a,{beforeConnect:t=>{i(!0),a&&a({accounts:e.accounts.concat([t])})},onConnect:()=>{setTimeout(()=>{t.load(),n&&n("design")},A.a.TRANSITION_DURATION)},isTransitioning:l})}function G(e){var t,a,l,r,c,s,u,m,p=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(a[n[o]]=e[n[o]])}return a}(e,[]);const[b,h]=Object(n.useState)(!1),g=()=>h(!0),f=()=>h(!1);p.tabs=null!==(t=p.tabs)&&void 0!==t?t:[],p.showDoneBtn=null===(a=p.showDoneBtn)||void 0===a||a,p.showCancelBtn=null===(l=p.showCancelBtn)||void 0===l||l,p.showNameField=null!==(r=p.showNameField)&&void 0!==r&&r,p.doneBtnText=null!==(c=p.doneBtnText)&&void 0!==c?c:"Done",p.cancelBtnText=null!==(s=p.cancelBtnText)&&void 0!==s?s:"Cancel",p.isDoneBtnEnabled=null===(u=p.isDoneBtnEnabled)||void 0===u||u,p.isCancelBtnEnabled=null===(m=p.isCancelBtnEnabled)||void 0===m||m;const E=p.tabs.find(e=>e.id===p.tabId),v=o.a.useRef();v.current||(v.current=new d.a(p.value),v.current.load()),Object(n.useEffect)(()=>{v.current.options=p.value},[p.value]),Object(n.useEffect)(()=>{v.current.mode=p.previewDevice},[p.previewDevice]);const _=d.a.ComputedOptions.compute(p.value),w=Object.assign(Object.assign({},p),{computed:_,tab:E,feed:v.current});return o.a.createElement(R.a.Provider,{value:p},o.a.createElement("div",{className:i.a.root},o.a.createElement(k,Object.assign({},p)),z.b.hasAccounts()?o.a.createElement("div",{className:i.a.content},void 0===E.component?o.a.createElement(P.a,{primary:"content",current:b?"content":"sidebar",sidebar:e=>o.a.createElement(S,Object.assign({},w,{showPreviewBtn:e,onOpenPreview:g})),content:e=>o.a.createElement(D,Object.assign({},w,{isCollapsed:e,onClosePreview:f}))}):o.a.createElement(E.component,Object.assign({},w))):o.a.createElement("div",{className:i.a.accountsOnboarding},o.a.createElement(V,Object.assign({},w)))))}},438:function(e,t,a){},51:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(0),o=a.n(n),l=a(3),i=a(2);function r(e,t=[]){return o.a.memo(e,(e,a)=>{const n=t.reduce((t,n)=>t&&Object(l.c)(e.value[n],a.value[n]),t.length>0),o=!t.reduce((e,t)=>e||i.a.isValid(a.value[t]),!1)||e.previewDevice===a.previewDevice&&e.onChangeDevice===a.onChangeDevice;return n&&o&&e.showFakeOptions===a.showFakeOptions&&e.onChange===a.onChange})}},604:function(e,t,a){},62:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(0),o=a.n(n);function l({id:e,value:t,onChange:a,disabled:n}){return o.a.createElement("div",{className:"checkbox-field"},o.a.createElement("div",{className:"checkbox-field__aligner"},o.a.createElement("input",{id:e,type:"checkbox",value:"1",checked:!!t,onChange:e=>a(e.target.checked),disabled:n})))}a(362)},65:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(0),o=a.n(n),l=a(379);function i({value:e,onChange:t,min:a,emptyMin:n,placeholder:i,id:r,unit:c}){e=null!=e?e:"",a=null!=a?a:0,i=null!=i?i:"",n=null!=n&&n;const s=o.a.useCallback(e=>{const n=e.target.value,o=parseInt(n),l=isNaN(o)?n:Math.max(a,o);t&&t(l)},[a,t]),d=o.a.useCallback(()=>{n&&e<=a&&t&&t("")},[n,e,a,t]),u=o.a.useCallback(o=>{"ArrowUp"===o.key&&""===e&&t&&t(n?a+1:a)},[e,a,n,t]),m=n&&e<=a?"":e;return c?o.a.createElement(l.a,{id:r,type:"number",unit:c,value:m,min:a,placeholder:i+"",onChange:s,onBlur:d,onKeyDown:u}):o.a.createElement("input",{id:r,type:"number",value:m,min:a,placeholder:i+"",onChange:s,onBlur:d,onKeyDown:u})}},85:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(0),o=a.n(n),l=a(158),i=a.n(l),r=a(117),c=a(84);function s({id:e,label:t,children:a,wide:n,disabled:l,isFakePro:s}){const d=Array.isArray(a)?a[0]:a,u=Array.isArray(a)?a[1]:void 0;return o.a.createElement("div",{className:l||s?i.a.disabled:n?i.a.wide:i.a.container},o.a.createElement("div",{className:i.a.label},o.a.createElement("div",{className:i.a.labelAligner},o.a.createElement("label",{htmlFor:e},t),u&&o.a.createElement(r.a,null,u))),o.a.createElement("div",{className:i.a.content},d),s&&o.a.createElement(c.a,{className:i.a.proPill}))}},87:function(e,t,a){e.exports={root:"FeedPreview__root","shrunk-root":"FeedPreview__shrunk-root FeedPreview__root",shrunkRoot:"FeedPreview__shrunk-root FeedPreview__root","status-bar":"FeedPreview__status-bar",statusBar:"FeedPreview__status-bar","status-indicator":"FeedPreview__status-indicator",statusIndicator:"FeedPreview__status-indicator",reset:"FeedPreview__reset",container:"FeedPreview__container","no-posts-msg":"FeedPreview__no-posts-msg",noPostsMsg:"FeedPreview__no-posts-msg",indicators:"FeedPreview__indicators","waiting-indicator":"FeedPreview__waiting-indicator",waitingIndicator:"FeedPreview__waiting-indicator","loading-indicator":"FeedPreview__loading-indicator",loadingIndicator:"FeedPreview__loading-indicator",sizer:"FeedPreview__sizer","shrunk-sizer":"FeedPreview__shrunk-sizer FeedPreview__sizer",shrunkSizer:"FeedPreview__shrunk-sizer FeedPreview__sizer","tablet-sizer":"FeedPreview__tablet-sizer FeedPreview__shrunk-sizer FeedPreview__sizer",tabletSizer:"FeedPreview__tablet-sizer FeedPreview__shrunk-sizer FeedPreview__sizer","phone-sizer":"FeedPreview__phone-sizer FeedPreview__shrunk-sizer FeedPreview__sizer",phoneSizer:"FeedPreview__phone-sizer FeedPreview__shrunk-sizer FeedPreview__sizer",onboarding:"FeedPreview__onboarding","no-break":"FeedPreview__no-break",noBreak:"FeedPreview__no-break","preview-device":"FeedPreview__preview-device",previewDevice:"FeedPreview__preview-device","indicator-dash":"FeedPreview__indicator-dash",indicatorDash:"FeedPreview__indicator-dash","indicator-text":"FeedPreview__indicator-text",indicatorText:"FeedPreview__indicator-text","indicator-animation":"FeedPreview__indicator-animation",indicatorAnimation:"FeedPreview__indicator-animation","loading-animation":"FeedPreview__loading-animation",loadingAnimation:"FeedPreview__loading-animation"}},97:function(e,t,a){"use strict";var n=a(0),o=a.n(n),l=a(292),i=a.n(l),r=a(4),c=a(102),s=a(184),d=a(376),u=a.n(d),m=a(2),p=a(87),b=a.n(p),h=a(377),g=a(5),f=a(10);function E(e){return o.a.createElement("div",{className:b.a.previewDevice},o.a.createElement("span",null,"Preview device"),o.a.createElement(h.a,null,m.a.MODES.map((t,a)=>o.a.createElement(g.a,{key:a,type:g.c.TOGGLE,onClick:()=>e.onChangeDevice(t),active:e.previewDevice===t,tooltip:t.name},o.a.createElement(f.a,{icon:t.icon})))))}var v=a(51),_=a(234),w=a(235),k=a(236),y=[{id:"accounts",label:"Show posts from these accounts",fields:[{id:"accounts",component:Object(v.a)(({value:e,onChange:t})=>o.a.createElement(_.a,{value:e.accounts,onChange:e=>t({accounts:e})}),["accounts"])}]},{id:"tagged",label:"Show posts where these accounts are tagged",isFakePro:!0,fields:[{id:"tagged",component:Object(v.a)(()=>o.a.createElement(w.a,{value:[]}),["accounts","tagged"])}]},{id:"hashtags",label:"Show posts with these hashtags",isFakePro:!0,fields:[{id:"hashtags",component:Object(v.a)(()=>o.a.createElement(k.a,{value:[]}),["accounts","hashtags"])}]}],C=a(186),O=a(133),P=a(128),S=a(134),F=a(127),N=[{id:"caption-filters",label:"Caption filtering",isFakePro:!0,fields:[{id:"caption-whitelist",component:Object(v.a)(({field:e})=>o.a.createElement(O.a,{label:"Only show posts with these words or phrases"},o.a.createElement(P.a,{id:e.id,value:[]})))},{id:"caption-whitelist-settings",component:Object(v.a)(()=>o.a.createElement(S.a,{value:!0}))},{id:"caption-blacklist",component:Object(v.a)(({field:e})=>o.a.createElement(O.a,{label:"Hide posts with these words or phrases",bordered:!0},o.a.createElement(P.a,{id:e.id,value:[]})))},{id:"caption-blacklist-settings",component:Object(v.a)(()=>o.a.createElement(S.a,{value:!0}))}]},{id:"hashtag-filters",label:"Hashtag filtering",isFakePro:!0,fields:[{id:"hashtag-whitelist",component:Object(v.a)(({field:e})=>o.a.createElement(O.a,{label:"Only show posts with these hashtags"},o.a.createElement(F.a,{id:e.id,value:[]})))},{id:"hashtag-whitelist-settings",component:Object(v.a)(()=>o.a.createElement(S.a,{value:!0}))},{id:"hashtag-blacklist",component:Object(v.a)(({field:e})=>o.a.createElement(O.a,{label:"Hide posts with these hashtags",bordered:!0},o.a.createElement(F.a,{id:e.id,value:[]})))},{id:"hashtag-blacklist-settings",component:Object(v.a)(()=>o.a.createElement(S.a,{value:!0}))}]}],T=a(237),x=a(243),I=a(244),j=[{id:"connect",label:"Connect",alwaysEnabled:!0,groups:y,sidebar:function(e){const[,t]=o.a.useState(0);return r.b.hasAccounts()?o.a.createElement("div",{className:i.a.connectSidebar},o.a.createElement("div",{className:i.a.connectButton},o.a.createElement(c.a,{onConnect:a=>{e.onChange&&e.onChange({accounts:e.value.accounts.concat([a])}),t(e=>e++)}})),o.a.createElement(s.a,Object.assign({groups:e.tab.groups},e))):null}},{id:"design",label:"Design",groups:C.a,sidebar:function(e){return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:u.a.previewOptions},o.a.createElement(E,Object.assign({},e))),o.a.createElement(s.a,Object.assign({groups:e.tab.groups},e)))}},{id:"filter",label:"Filter",isFakePro:!0,groups:N,sidebar:T.a},{id:"moderate",label:"Moderate",isFakePro:!0,groups:N,component:x.a},{id:"promote",label:"Promote",isFakePro:!0,component:I.a}];t.a={tabs:j,openGroups:["accounts","tagged","hashtags","layouts","feed"],showDoneBtn:!0,showCancelBtn:!1,showNameField:!1,isDoneBtnEnabled:!0,isCancelBtnEnabled:!0,doneBtnText:"Done",cancelBtnText:"Cancel"}}}]);
ui/dist/elementor-editor.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],e):"object"==typeof exports?exports.spotlight=e(require("React"),require("ReactDOM")):t.spotlight=e(t.React,t.ReactDOM)}(window,(function(t,e){return(window.webpackJsonpspotlight=window.webpackJsonpspotlight||[]).push([[9],{0:function(e,n){e.exports=t},10:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(0),a=n.n(o),i=n(11);const r=t=>{var{icon:e,className:n}=t,o=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(t);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]])}return n}(t,["icon","className"]);return a.a.createElement("span",Object.assign({className:Object(i.b)("dashicons","dashicons-"+e,n)},o))}},11:function(t,e,n){"use strict";function o(...t){return t.filter(t=>!!t).join(" ")}function a(t){return o(...Object.getOwnPropertyNames(t).map(e=>t[e]?e:null))}function i(t,e={}){let n=Object.getOwnPropertyNames(e).map(n=>e[n]?t+n:null);return t+" "+n.filter(t=>!!t).join(" ")}n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return i})),n.d(e,"e",(function(){return r})),n.d(e,"d",(function(){return s}));const r={onMouseDown:t=>t.preventDefault()};function s(...t){return e=>{t.forEach(t=>t&&function(t,e){"function"==typeof t?t(e):t.current=e}(t,e))}}},111:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o=n(0),a=n.n(o),i=n(6),r=n(27),s=n(7);const l=Object(i.b)(({feed:t})=>{const e=r.a.getById(t.options.layout),n=s.a.ComputedOptions.compute(t.options,t.mode);return a.a.createElement("div",{className:"feed"},a.a.createElement(e.component,{feed:t,options:n}))})},112:function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var o=n(0),a=n.n(o),i=n(60),r=n.n(i),s=n(16),l=n(52),c=n.n(l),u=n(38),d=n.n(u),h=n(6),p=n(3),m=n(116),f=Object(h.b)((function({field:t}){const e="settings-field-"+Object(p.u)(),n=!t.label||t.fullWidth;return a.a.createElement("div",{className:d.a.root},t.label&&a.a.createElement("div",{className:d.a.label},a.a.createElement("label",{htmlFor:e},t.label)),a.a.createElement("div",{className:d.a.container},a.a.createElement("div",{className:n?d.a.controlFullWidth:d.a.controlPartialWidth},a.a.createElement(t.component,{id:e})),t.tooltip&&a.a.createElement("div",{className:d.a.tooltip},a.a.createElement(m.a,null,t.tooltip))))}));function g({group:t}){return a.a.createElement("div",{className:c.a.root},t.title&&t.title.length>0&&a.a.createElement("h1",{className:c.a.title},t.title),t.component&&a.a.createElement("div",{className:c.a.content},a.a.createElement(t.component)),t.fields&&a.a.createElement("div",{className:c.a.fieldList},t.fields.map(t=>a.a.createElement(f,{field:t,key:t.id}))))}var b=n(20);function y({page:t}){return Object(b.d)("keydown",t=>{t.key&&"s"===t.key.toLowerCase()&&t.ctrlKey&&(s.b.save(),t.preventDefault(),t.stopPropagation())}),a.a.createElement("article",{className:r.a.root},t.component&&a.a.createElement("div",{className:r.a.content},a.a.createElement(t.component)),t.groups&&a.a.createElement("div",{className:r.a.groupList},t.groups.map(t=>a.a.createElement(g,{key:t.id,group:t}))))}},12:function(t,e,n){"use strict";var o,a=n(8);let i;e.a=i={isPro:!1,config:{restApi:SliCommonL10n.restApi,imagesUrl:SliCommonL10n.imagesUrl,autoPromotions:SliCommonL10n.autoPromotions,globalPromotions:null!==(o=SliCommonL10n.globalPromotions)&&void 0!==o?o:{}},image:t=>`${i.config.imagesUrl}/${t}`},a.a.registerType({id:"link",label:"Link",isValid:()=>!1}),a.a.registerType({id:"-more-",label:"- More promotion types -",isValid:()=>!1}),a.a.Automation.registerType({id:"hashtag",label:"Hashtag",matches:()=>!1})},13:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));const o=t=>"string"==typeof t?t:"r"in t?"rgba("+t.r+","+t.g+","+t.b+","+t.a+")":"h"in t?"hsla("+t.h+","+t.s+","+t.l+","+t.a+")":"#fff"},138:function(t,e,n){"use strict";function o(t,e){return"url"===e.linkType?e.url:e.postUrl}var a;n.d(e,"a",(function(){return a})),e.b={id:"link",label:"Link",getIcon:()=>"admin-links",getPopupLink:function(t,e){return"string"==typeof e.linkText&&e.linkText.length>0?[e.linkText,e.newTab]:[a.getDefaultLinkText(e),e.newTab]},isValid:function(t){return"string"==typeof t.linkType&&t.linkType.length>0&&("url"===t.linkType&&"string"==typeof t.url&&t.url.length>0||!!t.postId&&"string"==typeof t.postUrl&&t.postUrl.length>0)},getMediaUrl:o,onMediaClick:function(t,e){var n;const a=o(0,e),i=null===(n=e.linkDirectly)||void 0===n||n;return!(!a||!i)&&(window.open(a,e.newTab?"_blank":"_self"),!0)}},function(t){t.getDefaultLinkText=function(t){switch(t.linkType){case"product":return"Buy it now";case"post":return"Read the article";case"page":return"Learn more";default:return"Visit link"}}}(a||(a={}))},141:function(t,e,n){t.exports={"menu-link":"PageMenuNavbar__menu-link",menuLink:"PageMenuNavbar__menu-link","menu-ref":"PageMenuNavbar__menu-ref",menuRef:"PageMenuNavbar__menu-ref","arrow-down":"PageMenuNavbar__arrow-down",arrowDown:"PageMenuNavbar__arrow-down"}},148:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(0),a=n.n(o),i=n(29);function r({breakpoints:t,children:e}){const[n,r]=a.a.useState(null),s=a.a.useCallback(()=>{const e=Object(i.b)();r(()=>t.reduce((t,n)=>e.width<=n&&n<t?n:t,1/0))},[t]);return Object(o.useEffect)(()=>(s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)),[]),null!==n&&e(n)}},149:function(t,e,n){"use strict";var o=n(0),a=n.n(o),i=n(100),r=n(18),s=n.n(r),l=n(41),c=n(4),u=n(5),d=n(10),h=n(113),p=n(26),m=n(21),f=n(30),g=n(89),b=n(59),y=n(14),_=n(65);function v({accounts:t,showDelete:e,onDeleteError:n}){const o=(t=null!=t?t:[]).filter(t=>t.type===c.a.Type.BUSINESS).length,[i,r]=a.a.useState(!1),[v,E]=a.a.useState(null),[w,O]=a.a.useState(!1),[S,k]=a.a.useState(),[C,P]=a.a.useState(!1),T=t=>()=>{E(t),r(!0)},A=t=>()=>{f.a.openAuthWindow(t.type,0,()=>{y.a.restApi.deleteAccountMedia(t.id)})},B=t=>()=>{k(t),O(!0)},M=()=>{P(!1),k(null),O(!1)},L={cols:{username:s.a.usernameCol,type:s.a.typeCol,usages:s.a.usagesCol,actions:s.a.actionsCol},cells:{username:s.a.usernameCell,type:s.a.typeCell,usages:s.a.usagesCell,actions:s.a.actionsCell}};return a.a.createElement("div",{className:"accounts-list"},a.a.createElement(h.a,{styleMap:L,rows:t,cols:[{id:"username",label:"Username",render:t=>a.a.createElement("div",null,a.a.createElement(b.a,{account:t,className:s.a.profilePic}),a.a.createElement("a",{className:s.a.username,onClick:T(t)},t.username))},{id:"type",label:"Type",render:t=>a.a.createElement("span",{className:s.a.accountType},t.type)},{id:"usages",label:"Feeds",render:t=>a.a.createElement("span",{className:s.a.usages},t.usages.map((t,e)=>!!p.a.getById(t)&&a.a.createElement(l.a,{key:e,to:m.a.at({screen:"edit",id:t.toString()})},p.a.getById(t).name)))},{id:"actions",label:"Actions",render:t=>e&&a.a.createElement("div",{className:s.a.actionsList},a.a.createElement(u.a,{className:s.a.action,type:u.c.SECONDARY,tooltip:"Account info",onClick:T(t)},a.a.createElement(d.a,{icon:"info"})),a.a.createElement(u.a,{className:s.a.action,type:u.c.SECONDARY,tooltip:"Reconnect account",onClick:A(t)},a.a.createElement(d.a,{icon:"image-rotate"})),a.a.createElement(u.a,{className:s.a.actions,type:u.c.DANGER,tooltip:"Remove account",onClick:B(t)},a.a.createElement(d.a,{icon:"trash"})))}]}),a.a.createElement(g.a,{isOpen:i,onClose:()=>r(!1),account:v}),a.a.createElement(_.a,{isOpen:w,title:"Are you sure?",buttons:[C?"Please wait ...":"Yes I'm sure","Cancel"],okDisabled:C,cancelDisabled:C,onAccept:()=>{P(!0),f.a.deleteAccount(S.id).then(()=>M()).catch(()=>{n&&n("An error occurred while trying to remove the account."),M()})},onCancel:M},a.a.createElement("p",null,"Are you sure you want to delete"," ",a.a.createElement("span",{style:{fontWeight:"bold"}},S?S.username:""),"?"," ","This will also delete all saved media associated with this account."),S&&S.type===c.a.Type.BUSINESS&&1===o&&a.a.createElement("p",null,a.a.createElement("b",null,"Note:")," ",a.a.createElement("span",null,"Because this is your only connected Business account, deleting it will"," ","also cause any feeds that show public hashtag posts to no longer work."))))}var E=n(23),w=n(6),O=n(115),S=n(77),k=n.n(S);e.a=Object(w.b)((function(){const[,t]=a.a.useState(0),[e,n]=a.a.useState(""),o=a.a.useCallback(()=>t(t=>t++),[]);return c.b.hasAccounts()?a.a.createElement("div",{className:k.a.root},e.length>0&&a.a.createElement(E.a,{type:E.b.ERROR,showIcon:!0,isDismissible:!0,onDismiss:()=>n("")},e),a.a.createElement("div",{className:k.a.connectBtn},a.a.createElement(i.a,{onConnect:o})),a.a.createElement(v,{accounts:c.b.list,showDelete:!0,onDeleteError:n})):a.a.createElement(O.a,null)}))},15:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o,a=n(3);!function(t){function e(t,e){return t.hasOwnProperty(e.toString())}function n(t,e){return t[e.toString()]}function o(t,e,n){return t[e.toString()]=n,t}t.has=e,t.get=n,t.set=o,t.ensure=function(n,a,i){return e(n,a)||o(n,a,i),t.get(n,a)},t.withEntry=function(e,n,o){return t.set(Object(a.h)(e),n,o)},t.remove=function(t,e){return delete t[e.toString()],t},t.without=function(e,n){return t.remove(Object(a.h)(e),n)},t.at=function(t,e){return n(t,Object.keys(t)[e])},t.keys=function(t){return Object.keys(t)},t.values=function(t){return Object.values(t)},t.entries=function(t){return Object.getOwnPropertyNames(t).map(e=>[e,t[e]])},t.map=function(e,n){const o={};return t.forEach(e,(t,e)=>o[t]=n(e,t)),o},t.size=function(e){return t.keys(e).length},t.isEmpty=function(e){return 0===t.size(e)},t.equals=function(t,e){return Object(a.p)(t,e)},t.forEach=function(e,n){t.keys(e).forEach(t=>n(t,e[t]))},t.fromArray=function(e){const n={};return e.forEach(([e,o])=>t.set(n,e,o)),n},t.fromMap=function(e){const n={};return e.forEach((e,o)=>t.set(n,o,e)),n}}(o||(o={}))},150:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var o=n(0),a=n.n(o),i=n(86),r=n.n(i),s=n(64),l=n(20);function c({children:{path:t,tabs:e,right:n},current:o,onClickTab:i}){return a.a.createElement(s.b,{pathStyle:"chevron"},{path:t,right:n,left:e.map(t=>{return a.a.createElement(u,{tab:t,key:t.key,isCurrent:t.key===o,onClick:(e=t.key,()=>i&&i(e))});var e})})}function u({tab:t,isCurrent:e,onClick:n}){return a.a.createElement("a",{key:t.key,role:"button",tabIndex:0,className:t.disabled?r.a.disabled:e?r.a.current:r.a.tab,onClick:n,onKeyDown:Object(l.f)(n)},a.a.createElement("span",{className:r.a.label},t.label))}},151:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o=n(0),a=n.n(o),i=n(42),r=n(20);function s({when:t,message:e}){return Object(r.k)(e,t),a.a.createElement(i.a,{when:t,message:e})}},169:function(t,e,n){t.exports={"arrow-link":"WizardNavbar__arrow-link",arrowLink:"WizardNavbar__arrow-link","prev-link":"WizardNavbar__prev-link WizardNavbar__arrow-link",prevLink:"WizardNavbar__prev-link WizardNavbar__arrow-link","next-link":"WizardNavbar__next-link WizardNavbar__arrow-link",nextLink:"WizardNavbar__next-link WizardNavbar__arrow-link"}},17:function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){let e,n;!function(t){t.IMAGE="IMAGE",t.VIDEO="VIDEO",t.ALBUM="CAROUSEL_ALBUM"}(e=t.Type||(t.Type={})),function(t){let e;!function(t){t.PERSONAL_ACCOUNT="PERSONAL_ACCOUNT",t.BUSINESS_ACCOUNT="BUSINESS_ACCOUNT",t.TAGGED_ACCOUNT="TAGGED_ACCOUNT",t.RECENT_HASHTAG="RECENT_HASHTAG",t.POPULAR_HASHTAG="POPULAR_HASHTAG",t.USER_STORY="USER_STORY"}(e=t.Type||(t.Type={}))}(n=t.Source||(t.Source={})),t.getAsRows=(t,e)=>{t=t.slice(),e=e>0?e:1;let n=[];for(;t.length;)n.push(t.splice(0,e));if(n.length>0){const t=n.length-1;for(;n[t].length<e;)n[t].push({})}return n},t.isFromHashtag=t=>t.source.type===n.Type.POPULAR_HASHTAG||t.source.type===n.Type.RECENT_HASHTAG}(o||(o={}))},170:function(t,e,n){t.exports={message:"FeedNamePrompt__message",input:"FeedNamePrompt__input"}},18:function(t,e,n){t.exports={"username-col":"AccountsList__username-col",usernameCol:"AccountsList__username-col","actions-col":"AccountsList__actions-col",actionsCol:"AccountsList__actions-col","username-cell":"AccountsList__username-cell",usernameCell:"AccountsList__username-cell",username:"AccountsList__username","profile-pic":"AccountsList__profile-pic",profilePic:"AccountsList__profile-pic","account-type":"AccountsList__account-type",accountType:"AccountsList__account-type",usages:"AccountsList__usages","actions-list":"AccountsList__actions-list layout__flex-row",actionsList:"AccountsList__actions-list layout__flex-row",action:"AccountsList__action","usages-cell":"AccountsList__usages-cell",usagesCell:"AccountsList__usages-cell","usages-col":"AccountsList__usages-col",usagesCol:"AccountsList__usages-col","type-cell":"AccountsList__type-cell",typeCell:"AccountsList__type-cell","type-col":"AccountsList__type-col",typeCol:"AccountsList__type-col"}},19:function(t,e,n){"use strict";var o=n(33),a=n.n(o),i=n(12),r=n(34);const s=i.a.config.restApi.baseUrl,l={};i.a.config.restApi.authToken&&(l["X-Sli-Auth-Token"]=i.a.config.restApi.authToken);const c=a.a.create({baseURL:s,headers:l}),u={config:i.a.config.restApi,driver:c,getAccounts:()=>c.get("/accounts"),getFeeds:()=>c.get("/feeds"),getFeedMedia:(t,e=0,n=0,o)=>{const i=o?new a.a.CancelToken(o):void 0;return c.post("/media/fetch",{options:t,num:n,from:e},{cancelToken:i})},getMedia:(t=0,e=0)=>c.get(`/media?num=${t}&offset=${e}`),getErrorReason:t=>{let e;return"object"==typeof t.response&&(t=t.response.data),e="string"==typeof t.message?t.message:t.toString(),Object(r.b)(e)}};e.a=u},199:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{constructor(t=[],e=0){this.fns=t,this.delay=null!=e?e:1}add(t){this.fns.push(t)}run(){return this.numLoaded=0,this.isLoading=!0,new Promise((t,e)=>{this.fns.forEach(n=>n().then(()=>{this.numLoaded++,this.numLoaded>=this.fns.length&&setTimeout(()=>{this.isLoading=!1,t()},this.delay)}).catch(e))})}}},2:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o,a=n(1),i=function(t,e,n,o){var a,i=arguments.length,r=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(r=(i<3?a(r):i>3?a(e,n,r):a(e,n))||r);return i>3&&r&&Object.defineProperty(e,n,r),r};!function(t){class e{constructor(t,e,n){this.prop=t,this.name=e,this.icon=n}}e.DESKTOP=new e("desktop","Desktop","desktop"),e.TABLET=new e("tablet","Tablet","tablet"),e.PHONE=new e("phone","Phone","smartphone"),t.Mode=e,t.MODES=[e.DESKTOP,e.TABLET,e.PHONE];class n{constructor(t,e,n){this.desktop=t,this.tablet=e,this.phone=n}get(t,e){return o(this,t,e)}set(t,e){r(this,e,t)}with(t,e){const o=s(this,e,t);return new n(o.desktop,o.tablet,o.phone)}}function o(t,e,n=!1){if(!t)return;const o=t[e.prop];return n&&null==o?t.desktop:o}function r(t,e,n){return t[n.prop]=e,t}function s(t,e,o){return r(new n(t.desktop,t.tablet,t.phone),e,o)}i([a.n],n.prototype,"desktop",void 0),i([a.n],n.prototype,"tablet",void 0),i([a.n],n.prototype,"phone",void 0),t.Value=n,t.getName=function(t){return t.name},t.getIcon=function(t){return t.icon},t.cycle=function(n){const o=t.MODES.findIndex(t=>t===n);return void 0===o?e.DESKTOP:t.MODES[(o+1)%t.MODES.length]},t.get=o,t.set=r,t.withValue=s,t.normalize=function(t,e){return null==t?e.hasOwnProperty("all")?new n(e.all,e.all,e.all):new n(e.desktop,e.tablet,e.phone):"object"==typeof t&&t.hasOwnProperty("desktop")?new n(t.desktop,t.tablet,t.phone):new n(t,t,t)},t.getModeForWindowSize=function(t){return t.width<=768?e.PHONE:t.width<=935?e.TABLET:e.DESKTOP},t.isValid=function(t){return"object"==typeof t&&t.hasOwnProperty("desktop")}}(o||(o={}))},20:function(t,e,n){"use strict";n.d(e,"i",(function(){return s})),n.d(e,"e",(function(){return l})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return u})),n.d(e,"a",(function(){return d})),n.d(e,"m",(function(){return h})),n.d(e,"g",(function(){return p})),n.d(e,"k",(function(){return m})),n.d(e,"j",(function(){return f})),n.d(e,"d",(function(){return b})),n.d(e,"l",(function(){return y})),n.d(e,"f",(function(){return _})),n.d(e,"h",(function(){return v}));var o=n(0),a=n.n(o),i=n(42),r=n(29);function s(t,e){!function(t,e,n){const o=a.a.useRef(!0);t(()=>{o.current=!0;const t=e(()=>new Promise(t=>{o.current&&t()}));return()=>{o.current=!1,t&&t()}},n)}(o.useEffect,t,e)}function l(t){const[e,n]=a.a.useState(t),o=a.a.useRef(e);return[e,()=>o.current,t=>n(o.current=t)]}function c(t,e,n=[]){function a(o){!t.current||t.current.contains(o.target)||n.some(t=>t&&t.current&&t.current.contains(o.target))||e(o)}Object(o.useEffect)(()=>(document.addEventListener("mousedown",a),document.addEventListener("touchend",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchend",a)}))}function u(t,e){Object(o.useEffect)(()=>{const n=()=>{0===t.filter(t=>!t.current||document.activeElement===t.current||t.current.contains(document.activeElement)).length&&e()};return document.addEventListener("keyup",n),()=>document.removeEventListener("keyup",n)},t)}function d(t,e,n=100){const[i,r]=a.a.useState(t);return Object(o.useEffect)(()=>{let o=null;return t===e?o=setTimeout(()=>r(e),n):r(!e),()=>{null!==o&&clearTimeout(o)}},[t]),[i,r]}function h(t){const[e,n]=a.a.useState(Object(r.b)()),i=()=>{const e=Object(r.b)();n(e),t&&t(e)};return Object(o.useEffect)(()=>(i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)),[]),e}function p(){return new URLSearchParams(Object(i.e)().search)}function m(t,e){const n=n=>{if(e)return(n||window.event).returnValue=t,t};Object(o.useEffect)(()=>(window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)),[e])}function f(t,e){const n=a.a.useRef(!1);return Object(o.useEffect)(()=>{n.current&&void 0!==t.current&&(t.current.scrollIntoView(Object.assign({behavior:"smooth",block:"start"},null!=e?e:{})),n.current=!1)},[n.current]),()=>n.current=!0}function g(t,e,n,a=[],i=[]){Object(o.useEffect)(()=>(a.reduce((t,e)=>t&&e,!0)&&t.addEventListener(e,n),()=>t.removeEventListener(e,n)),i)}function b(t,e,n=[],o=[]){g(document,t,e,n,o)}function y(t,e,n=[],o=[]){g(window,t,e,n,o)}function _(t){return e=>{" "!==e.key&&"Enter"!==e.key||(t(),e.preventDefault(),e.stopPropagation())}}function v(t){const[e,n]=a.a.useState(t);return[function(t){const e=a.a.useRef(t);return e.current=t,e}(e),n]}n(34)},21:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o=n(1),a=n(50),i=n(3),r=function(t,e,n,o){var a,i=arguments.length,r=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(r=(i<3?a(r):i>3?a(e,n,r):a(e,n))||r);return i>3&&r&&Object.defineProperty(e,n,r),r};class s{constructor(){const t=window.location;this._pathName=t.pathname,this._baseUrl=t.protocol+"//"+t.host,this.parsed=Object(a.parse)(t.search),this.unListen=null,this.listeners=[],Object(o.o)(()=>this._path,t=>this.path=t)}createPath(t){return this._pathName+"?"+Object(a.stringify)(t)}get _path(){return this.createPath(this.parsed)}get(t,e=!0){return Object(i.l)(this.parsed[t])}at(t){return this.createPath(Object.assign({page:this.parsed.page},this.processQuery(t)))}fullUrl(t){return this._baseUrl+this.createPath(Object.assign({page:this.parsed.page},this.processQuery(t)))}with(t){return this.createPath(Object.assign(Object.assign({},this.parsed),this.processQuery(t)))}without(t){const e=Object.assign({},this.parsed);return delete e[t],this.createPath(e)}goto(t,e=!1){this.history.push(e?this.with(t):this.at(t),{})}useHistory(t){return this.unListen&&this.unListen(),this.history=t,this.unListen=this.history.listen(t=>{this.parsed=Object(a.parse)(t.search),this.listeners.forEach(t=>t())}),this}listen(t){this.listeners.push(t)}unlisten(t){this.listeners=this.listeners.filter(e=>e===t)}processQuery(t){const e=Object.assign({},t);return Object.getOwnPropertyNames(t).forEach(n=>{t[n]&&0===t[n].length?delete e[n]:e[n]=t[n]}),e}}r([o.n],s.prototype,"path",void 0),r([o.n],s.prototype,"parsed",void 0),r([o.h],s.prototype,"_path",null);const l=new s},215:function(t,e,n){t.exports={root:"ElementorApp__root",shade:"ElementorApp__shade",container:"ElementorApp__container","close-button":"ElementorApp__close-button",closeButton:"ElementorApp__close-button"}},27:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{static getById(t){const e=o.list.find(e=>e.id===t);return!e&&o.list.length>0?o.list[0]:e}static getName(t){const e=o.getById(t);return e?e.name:"(Missing layout)"}static addLayout(t){o.list.push(t)}}o.list=[]},279:function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var o=n(97),a=n.n(o),i=n(0),r=n.n(i),s=n(5),l=n(10),c=n(66),u=n(11);function d({value:t,defaultValue:e,onDone:n}){const o=r.a.useRef(),[i,d]=r.a.useState(""),[h,p]=r.a.useState(!1),m=()=>{d(t),p(!0)},f=()=>{p(!1),n&&n(i),o.current&&o.current.focus()},g=t=>{switch(t.key){case"Enter":case" ":m()}};return r.a.createElement("div",{className:a.a.root},r.a.createElement(c.a,{isOpen:h,onBlur:()=>p(!1),placement:"bottom"},({ref:n})=>r.a.createElement("div",{ref:Object(u.d)(n,o),className:a.a.staticContainer,onClick:m,onKeyPress:g,tabIndex:0,role:"button"},r.a.createElement("span",{className:a.a.label},t||e),r.a.createElement(l.a,{icon:"edit",className:a.a.editIcon})),r.a.createElement(c.b,null,r.a.createElement(c.d,null,r.a.createElement("div",{className:a.a.editContainer},r.a.createElement("input",{type:"text",value:i,onChange:t=>{d(t.target.value)},onKeyDown:t=>{switch(t.key){case"Enter":f();break;case"Escape":p(!1);break;default:return}t.preventDefault(),t.stopPropagation()},autoFocus:!0,placeholder:"Feed name"}),r.a.createElement(s.a,{className:a.a.doneBtn,type:s.c.PRIMARY,size:s.b.NORMAL,onClick:f},r.a.createElement(l.a,{icon:"yes"})))))))}},280:function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var o=n(0),a=n.n(o),i=n(169),r=n.n(i),s=n(64),l=n(5),c=n(10);function u({children:t,steps:e,current:n,onChangeStep:o,firstStep:i,lastStep:u}){var d;i=null!=i?i:[],u=null!=u?u:[];const h=null!==(d=e.findIndex(t=>t.key===n))&&void 0!==d?d:0,p=h<=0,m=h>=e.length-1,f=p?null:e[h-1],g=m?null:e[h+1],b=p?i:a.a.createElement(l.a,{type:l.c.LINK,onClick:()=>!p&&o&&o(e[h-1].key),className:r.a.prevLink,disabled:f.disabled},a.a.createElement(c.a,{icon:"arrow-left-alt2"}),a.a.createElement("span",null,f.label)),y=m?u:a.a.createElement(l.a,{type:l.c.LINK,onClick:()=>!m&&o&&o(e[h+1].key),className:r.a.nextLink,disabled:g.disabled},a.a.createElement("span",null,g.label),a.a.createElement(c.a,{icon:"arrow-right-alt2"}));return a.a.createElement(s.b,null,{path:[],left:b,right:y,center:t})}},281:function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var o=n(0),a=n.n(o),i=n(141),r=n.n(i),s=n(64),l=n(5),c=n(10),u=n(66);function d({pages:t,current:e,onChangePage:n,showNavArrows:o,hideMenuArrow:i,children:u}){var d,p;const{path:m,right:f}=u,g=null!==(d=t.findIndex(t=>t.key===e))&&void 0!==d?d:0,b=null!==(p=t[g].label)&&void 0!==p?p:"",y=g<=0,_=g>=t.length-1,v=y?null:t[g-1],E=_?null:t[g+1];let w=[];return o&&w.push(a.a.createElement(l.a,{key:"page-menu-left",type:l.c.PILL,onClick:()=>!y&&n&&n(t[g-1].key),disabled:y||v.disabled},a.a.createElement(c.a,{icon:"arrow-left-alt2"}))),w.push(a.a.createElement(h,{key:"page-menu",pages:t,current:e,onClickPage:t=>n&&n(t)},a.a.createElement("span",null,b),!i&&a.a.createElement(c.a,{icon:"arrow-down-alt2",className:r.a.arrowDown}))),o&&w.push(a.a.createElement(l.a,{key:"page-menu-left",type:l.c.PILL,onClick:()=>!_&&n&&n(t[g+1].key),disabled:_||E.disabled},a.a.createElement(c.a,{icon:"arrow-right-alt2"}))),a.a.createElement(s.b,{pathStyle:m.length>1?"line":"none"},{path:m,right:f,center:w})}function h({pages:t,current:e,onClickPage:n,children:o}){const[i,s]=a.a.useState(!1),l=()=>s(!0),c=()=>s(!1);return a.a.createElement(u.a,{isOpen:i,onBlur:c,placement:"bottom-start",refClassName:r.a.menuRef},({ref:t})=>a.a.createElement("a",{ref:t,className:r.a.menuLink,onClick:l},o),a.a.createElement(u.b,null,t.map(t=>{return a.a.createElement(u.c,{key:t.key,disabled:t.disabled,active:t.key===e,onClick:(o=t.key,()=>{n&&n(o),c()})},t.label);var o})))}},282:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o=n(0),a=n.n(o),i=n(170),r=n.n(i),s=n(65);function l({isOpen:t,onAccept:e,onCancel:n}){const[o,i]=a.a.useState("");function l(){e&&e(o)}return a.a.createElement(s.a,{title:"Feed name",isOpen:t,onCancel:function(){n&&n()},onAccept:l,buttons:["Save","Cancel"]},a.a.createElement("p",{className:r.a.message},"Give this feed a memorable name:"),a.a.createElement("input",{type:"text",className:r.a.input,value:o,onChange:t=>{i(t.target.value)},onKeyDown:t=>{"Enter"===t.key&&(l(),t.preventDefault(),t.stopPropagation())},autoFocus:!0}))}},29:function(t,e,n){"use strict";function o(t,e,n={}){return window.open(t,e,function(t={}){return Object.getOwnPropertyNames(t).map(e=>`${e}=${t[e]}`).join(",")}(n))}function a(t,e){return{top:window.top.outerHeight/2+window.top.screenY-e/2,left:window.top.outerWidth/2+window.top.screenX-t/2,width:t,height:e}}function i(){const{innerWidth:t,innerHeight:e}=window;return{width:t,height:e}}n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return i}))},3:function(t,e,n){"use strict";n.d(e,"u",(function(){return u})),n.d(e,"h",(function(){return d})),n.d(e,"b",(function(){return h})),n.d(e,"v",(function(){return p})),n.d(e,"c",(function(){return m})),n.d(e,"e",(function(){return f})),n.d(e,"p",(function(){return g})),n.d(e,"o",(function(){return b})),n.d(e,"k",(function(){return y})),n.d(e,"f",(function(){return _})),n.d(e,"n",(function(){return v})),n.d(e,"q",(function(){return E})),n.d(e,"a",(function(){return w})),n.d(e,"t",(function(){return O})),n.d(e,"s",(function(){return S})),n.d(e,"r",(function(){return k})),n.d(e,"i",(function(){return C})),n.d(e,"j",(function(){return P})),n.d(e,"m",(function(){return T})),n.d(e,"g",(function(){return A})),n.d(e,"d",(function(){return B})),n.d(e,"l",(function(){return M}));var o=n(0),a=n.n(o),i=n(137),r=n(145),s=n(17),l=n(48);let c=0;function u(){return c++}function d(t){const e={};return Object.keys(t).forEach(n=>{const o=t[n];Array.isArray(o)?e[n]=o.slice():o instanceof Map?e[n]=new Map(o.entries()):e[n]="object"==typeof o?d(o):o}),e}function h(t,e){return Object.keys(e).forEach(n=>{t[n]=e[n]}),t}function p(t,e){return h(d(t),e)}function m(t,e){return Array.isArray(t)&&Array.isArray(e)?f(t,e):t instanceof Map&&e instanceof Map?f(Array.from(t.entries()),Array.from(e.entries())):"object"==typeof t&&"object"==typeof e?g(t,e):t===e}function f(t,e,n){if(t===e)return!0;if(t.length!==e.length)return!1;for(let o=0;o<t.length;++o)if(n){if(!n(t[o],e[o]))return!1}else if(!m(t[o],e[o]))return!1;return!0}function g(t,e){if(!t||!e||"object"!=typeof t||"object"!=typeof e)return m(t,e);const n=Object.keys(t),o=Object.keys(e);if(n.length!==o.length)return!1;const a=new Set(n.concat(o));for(const n of a)if(!m(t[n],e[n]))return!1;return!0}function b(t){return 0===Object.keys(null!=t?t:{}).length}function y(t,e,n){return n=null!=n?n:(t,e)=>t===e,t.filter(t=>!e.some(e=>n(t,e)))}function _(t,e,n){return n=null!=n?n:(t,e)=>t===e,t.every(t=>e.some(e=>n(t,e)))&&e.every(e=>t.some(t=>n(e,t)))}function v(t,e){return 0===t.tag.localeCompare(e.tag)&&t.sort===e.sort}function E(t,e,n=0,i=!1){let r=t.trim();i&&(r=r.replace(/((?:^[.*•]+(\r\n|\r|\n))+)/gm,"\n"));const s=r.split("\n"),l=s.map((t,n)=>{if(t=t.trim(),i&&/^[.*•]$/.test(t))return null;let r,l=[];for(;null!==(r=/#([^\s]+)/g.exec(t));){const e="https://instagram.com/explore/tags/"+r[1],n=a.a.createElement("a",{href:e,target:"_blank",key:u()},r[0]),o=t.substr(0,r.index),i=t.substr(r.index+r[0].length);l.push(o),l.push(n),t=i}return t.length&&l.push(t),e&&(l=e(l,n)),s.length>1&&l.push(a.a.createElement("br",{key:u()})),a.a.createElement(o.Fragment,{key:u()},l)});return n>0?l.slice(0,n):l}var w;function O(t,e){const n=/(\s+)/g;let o,a=0,i=0,r="";for(;null!==(o=n.exec(t))&&a<e;){const e=o.index+o[1].length;r+=t.substr(i,e-i),i=e,a++}return i<t.length&&(r+=" ..."),r}function S(t){return Object(i.a)(Object(r.a)(t),{addSuffix:!0})}function k(t,e){const n=[];return t.forEach((t,o)=>{const a=o%e;Array.isArray(n[a])?n[a].push(t):n[a]=[t]}),n}function C(t,e){return function t(e){if(e.type===s.a.Type.VIDEO){const t=document.createElement("video");return t.autoplay=!1,t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.visibility="hidden",document.body.appendChild(t),new Promise(n=>{t.src=e.url,t.addEventListener("loadeddata",()=>{n({width:t.videoWidth,height:t.videoHeight}),document.body.removeChild(t)})})}if(e.type===s.a.Type.IMAGE){const t=new Image;return t.src=e.url,new Promise(e=>{t.onload=()=>{e({width:t.naturalWidth,height:t.naturalHeight})}})}return e.type===s.a.Type.ALBUM?t(e.children[0]):Promise.reject("Unknown media type")}(t).then(t=>function(t,e){const n=t.width>t.height?e.width/t.width:e.height/t.height;return{width:t.width*n,height:t.height*n}}(t,e))}function P(t,e){const n=e.map(l.b).join("|");return new RegExp(`(?:^|\\B)#(${n})(?:\\b|\\r|$)`,"imu").test(t)}function T(t,e){for(const n of e){const e=n();if(t(e))return e}}function A(t,e){return Math.max(0,Math.min(e.length-1,t))}function B(t,e,n){const o=t.slice();return o[e]=n,o}function M(t){return Array.isArray(t)?t[0]:t}!function(t){t.SMALL="s",t.MEDIUM="m",t.LARGE="l"}(w||(w={}))},32:function(t,n){t.exports=e},34:function(t,e,n){"use strict";function o(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function a(t){const e=document.createElement("DIV");return e.innerHTML=t,e.textContent||e.innerText||""}n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a}))},35:function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return d}));var o=n(0),a=n.n(o),i=n(32),r=n.n(i),s=n(6);class l{constructor(t=new Map,e=[]){this.factories=t,this.extensions=new Map,this.cache=new Map,e.forEach(t=>this.addModule(t))}addModule(t){t.factories&&(this.factories=new Map([...this.factories,...t.factories])),t.extensions&&t.extensions.forEach((t,e)=>{this.extensions.has(e)?this.extensions.get(e).push(t):this.extensions.set(e,[t])})}get(t){let e=this.factories.get(t);if(void 0===e)throw new Error('Service "'+t+'" does not exist');let n=this.cache.get(t);if(void 0===n){n=e(this);let o=this.extensions.get(t);o&&o.forEach(t=>n=t(this,n)),this.cache.set(t,n)}return n}has(t){return this.factories.has(t)}}class c{constructor(t,e,n){this.key=t,this.mount=e,this.modules=n,this.container=null}addModules(t){this.modules=this.modules.concat(t)}run(){if(null!==this.container)return;let t=!1;const e=()=>{t||"interactive"!==document.readyState&&"complete"!==document.readyState||(this.actualRun(),t=!0)};e(),t||document.addEventListener("readystatechange",e)}actualRun(){!function(t){const e=`app/${t.key}/run`;document.dispatchEvent(new u(e,t))}(this);const t=d({root:()=>null,"root/children":()=>[]});this.container=new l(t,this.modules);const e=this.container.get("root/children").map((t,e)=>a.a.createElement(t,{key:e})),n=a.a.createElement(s.a,{c:this.container},e);this.modules.forEach(t=>t.run&&t.run(this.container)),r.a.render(n,this.mount)}}class u extends CustomEvent{constructor(t,e){super(t,{detail:{app:e}})}}function d(t){return new Map(Object.entries(t))}},37:function(t,e,n){t.exports={root:"MediaThumbnail__root","media-background-fade-in-animation":"MediaThumbnail__media-background-fade-in-animation",mediaBackgroundFadeInAnimation:"MediaThumbnail__media-background-fade-in-animation","media-object-fade-in-animation":"MediaThumbnail__media-object-fade-in-animation",mediaObjectFadeInAnimation:"MediaThumbnail__media-object-fade-in-animation",image:"MediaThumbnail__image","not-available":"MediaThumbnail__not-available",notAvailable:"MediaThumbnail__not-available"}},38:function(t,e,n){t.exports={root:"SettingsField__root layout__flex-column",label:"SettingsField__label layout__flex-column",container:"SettingsField__container layout__flex-row",control:"SettingsField__control layout__flex-column","control-partial-width":"SettingsField__control-partial-width SettingsField__control layout__flex-column",controlPartialWidth:"SettingsField__control-partial-width SettingsField__control layout__flex-column","control-full-width":"SettingsField__control-full-width SettingsField__control layout__flex-column",controlFullWidth:"SettingsField__control-full-width SettingsField__control layout__flex-column",tooltip:"SettingsField__tooltip layout__flex-column"}},39:function(t,e,n){"use strict";function o(t){return e=>(e.stopPropagation(),t(e))}function a(t,e){let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>{n=null,t(...o)},e)}}function i(){}n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return i}))},4:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o,a=n(19),i=n(1);!function(t){let e;!function(t){t.PERSONAL="PERSONAL",t.BUSINESS="BUSINESS"}(e=t.Type||(t.Type={}))}(o||(o={}));const r=Object(i.n)([]),s="https://secure.gravatar.com/avatar/4a94d759753ade2961582f7345c1d7b2?s=64&d=mm&r=g",l=t=>r.find(e=>e.id===t),c=t=>"https://instagram.com/"+t;function u(t){return t.slice().sort((t,e)=>t.type===e.type?0:t.type===o.Type.PERSONAL?-1:1),r.splice(0,r.length),t.forEach(t=>r.push(Object(i.n)(t))),r}function d(t){if("object"==typeof t&&Array.isArray(t.data))return u(t.data);throw"Spotlight encountered a problem trying to load your accounts. Kindly contact customer support for assistance."}e.b={list:r,DEFAULT_PROFILE_PIC:s,getById:l,getByUsername:t=>r.find(e=>e.username===t),hasAccounts:()=>r.length>0,filterExisting:t=>t.filter(t=>void 0!==l(t)),idsToAccounts:t=>t.map(t=>l(t)).filter(t=>void 0!==t),getBusinessAccounts:()=>r.filter(t=>t.type===o.Type.BUSINESS),getProfilePicUrl:t=>t.customProfilePicUrl?t.customProfilePicUrl:t.profilePicUrl?t.profilePicUrl:s,getBioText:t=>t.customBio.length?t.customBio:t.bio,getProfileUrl:t=>c(t.username),getUsernameUrl:c,loadAccounts:function(){return a.a.getAccounts().then(d).catch(t=>{throw a.a.getErrorReason(t)})},loadFromResponse:d,addAccounts:u}},43:function(t,e,n){t.exports={root:"GenericNavbar__root",list:"GenericNavbar__list","left-list":"GenericNavbar__left-list GenericNavbar__list",leftList:"GenericNavbar__left-list GenericNavbar__list",item:"GenericNavbar__item","center-list":"GenericNavbar__center-list GenericNavbar__list",centerList:"GenericNavbar__center-list GenericNavbar__list","right-list":"GenericNavbar__right-list GenericNavbar__list",rightList:"GenericNavbar__right-list GenericNavbar__list","path-list":"GenericNavbar__path-list GenericNavbar__left-list GenericNavbar__list",pathList:"GenericNavbar__path-list GenericNavbar__left-list GenericNavbar__list","path-segment":"GenericNavbar__path-segment",pathSegment:"GenericNavbar__path-segment",separator:"GenericNavbar__separator GenericNavbar__item"}},48:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a}));const o=(t,e)=>t.startsWith(e)?t:e+t,a=t=>{return(e=t,"#",e.startsWith("#")?e.substr("#".length):e).split(/\s/).map((t,e)=>e>0?t[0].toUpperCase()+t.substr(1):t).join("").replace(/\W/gi,"");var e}},52:function(t,e,n){t.exports={root:"SettingsGroup__root layout__flex-column",title:"SettingsGroup__title",content:"SettingsGroup__content","field-list":"SettingsGroup__field-list layout__flex-column",fieldList:"SettingsGroup__field-list layout__flex-column"}},58:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o=n(0),a=n.n(o),i=n(74),r=n.n(i);function s(){return a.a.createElement("div",{className:r.a.root})}},59:function(t,e,n){"use strict";var o=n(0),a=n.n(o),i=n(76),r=n.n(i),s=n(4),l=n(11),c=n(6);e.a=Object(c.b)((function(t){var{account:e,square:n,className:o}=t,i=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(t);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]])}return n}(t,["account","square","className"]);const c=s.b.getProfilePicUrl(e),u=Object(l.b)(n?r.a.square:r.a.round,o);return a.a.createElement("img",Object.assign({},i,{className:u,src:s.b.DEFAULT_PROFILE_PIC,srcSet:c+" 1x",alt:e.username+" profile picture"}))}))},60:function(t,e,n){t.exports={root:"SettingsPage__root layout__flex-column",content:"SettingsPage__content","group-list":"SettingsPage__group-list layout__flex-column",groupList:"SettingsPage__group-list layout__flex-column"}},613:function(t,e,n){"use strict";n.r(e);var o=n(0),a=n.n(o),i=n(32),r=n.n(i),s=n(215),l=n.n(s),c=n(206),u=n(26),d=n(199),h=n(4),p=n(16),m=n(11),f=n(42),g=n(93),b=n(10),y=u.a.SavedFeed;const _=Object(g.a)(),v={loaded:!1,loader:new d.a([()=>p.b.load(),()=>u.a.loadFeeds(),()=>h.b.loadAccounts()])};function E({rows:t,loading:e,select:n,editBtn:o,newBtn:i,value:r,update:s}){const d=a.a.useRef(!1),[h,p]=a.a.useState(v.loaded),[g,E]=a.a.useState(!1),[O,S]=a.a.useState(null),k=a.a.useCallback(()=>{E(!0),d.current=!1},[]),C=a.a.useCallback(()=>{E(!1),d.current=!1},[]),P=a.a.useCallback(()=>{d.current?confirm(c.b)&&C():C()},[d]),T=a.a.useCallback(()=>{S(u.a.getById(n.value)),k()},[]),A=a.a.useCallback(()=>{S(new y),k()},[]),B=a.a.useCallback(e=>{const o=u.a.hasFeeds(),a=null!=e?e:r;for(t.forEach((t,e)=>{t.style.display=0!==e||o?"flex":"none"});n.options.length>0;)n.remove(n.options.length-1);a&&void 0===u.a.getById(a)&&n.add(w(a,"(Missing feed)",!0)),u.a.list.forEach(t=>{n.add(w(t.id.toString(),t.label,a===t.id.toString()))}),i.textContent=o?"Create a new feed":"Design your feed",e!==r&&(n.value=e.toString(),s(n.value))},[n,r,s]),M=a.a.useCallback(()=>{v.loaded=!0,B(r),e.remove(),p(!0)},[r]),L=a.a.useCallback(t=>new Promise(e=>{u.a.saveFeed(t).then(t=>{B(t.id),e(),setTimeout(C,500)})}),[]),x=a.a.useCallback(()=>{d.current=!0},[]);return a.a.useEffect(()=>(v.loaded?M():v.loader.run().then(M),o.addEventListener("click",T),i.addEventListener("click",A),()=>{o.removeEventListener("click",T),i.removeEventListener("click",A)}),[]),g&&a.a.createElement(f.b,{history:_},a.a.createElement("div",{className:Object(m.b)(l.a.root,"wp-core-ui-override wp-core-ui spotlight-modal-target")},a.a.createElement("div",{className:l.a.shade,onClick:P}),h&&a.a.createElement("div",{className:l.a.container},a.a.createElement(c.a,{feed:O,onSave:L,onCancel:P,onDirtyChange:x,useCtrlS:!1,requireName:!0,confirmOnCancel:!0,config:{showDoneBtn:!0,showCancelBtn:!1,showNameField:!0,doneBtnText:"Save and embed"}})),a.a.createElement("div",{className:l.a.closeButton,onClick:P,role:"button","aria-label":"Cancel",tabIndex:0},a.a.createElement(b.a,{icon:"no-alt"}))))}function w(t,e,n,o){const a=document.createElement("option");return a.value=t.toString(),a.text=e,n&&(a.selected=!0),o&&(a.disabled=!0),a}elementor.addControlView("sli-select-feed",elementor.modules.controls.BaseData.extend({onReady(){const t=this.$el.find("div.sli-select-field-row"),e=this.$el.find("div.sli-select-loading"),n=this.$el.find("select.sli-select-element"),o=this.$el.find("button.sli-select-edit-btn"),i=this.$el.find("button.sli-select-new-btn");if(!n.length||!o.length||!i.length)return;const s=document.createElement("div");s.id="spotlight-elementor-app",document.body.appendChild(s);const l=a.a.createElement(E,{rows:t.get(),loading:e[0],select:n[0],editBtn:o[0],newBtn:i[0],value:this.elementSettingsModel.attributes.feed,update:t=>this.updateElementModel(t)});r.a.render(l,s)},onBeforeDestroy(){},saveValue(){}}))},64:function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c}));var o=n(0),a=n.n(o),i=n(43),r=n.n(i),s=n(153);function l({children:t,pathStyle:e}){let{path:n,left:o,right:i,center:s}=t;return n=null!=n?n:[],o=null!=o?o:[],i=null!=i?i:[],s=null!=s?s:[],a.a.createElement("div",{className:r.a.root},a.a.createElement("div",{className:r.a.leftList},a.a.createElement("div",{className:r.a.pathList},n.map((t,n)=>a.a.createElement(h,{key:n,style:e},a.a.createElement("div",{className:r.a.item},t)))),a.a.createElement("div",{className:r.a.leftList},a.a.createElement(u,null,o))),a.a.createElement("div",{className:r.a.centerList},a.a.createElement(u,null,s)),a.a.createElement("div",{className:r.a.rightList},a.a.createElement(u,null,i)))}function c(){return a.a.createElement(s.a,null)}function u({children:t}){const e=Array.isArray(t)?t:[t];return a.a.createElement(a.a.Fragment,null,e.map((t,e)=>a.a.createElement(d,{key:e},t)))}function d({children:t}){return a.a.createElement("div",{className:r.a.item},t)}function h({children:t,style:e}){return a.a.createElement("div",{className:r.a.pathSegment},t,a.a.createElement(p,{style:e}))}function p({style:t}){if("none"===t)return null;const e="chevron"===t?"M0 0 L100 50 L0 100":"M50 0 L50 100";return a.a.createElement("div",{className:r.a.separator},a.a.createElement("svg",{viewBox:"0 0 100 100",width:"100%",height:"100%",preserveAspectRatio:"none"},a.a.createElement("path",{d:e,fill:"none",stroke:"currentcolor",strokeLinejoin:"bevel"})))}},7:function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var o=n(33),a=n.n(o),i=n(1),r=n(2),s=n(27),l=n(35),c=n(4),u=n(3),d=n(13),h=n(19),p=n(39),m=n(8),f=n(15),g=n(12),b=function(t,e,n,o){var a,i=arguments.length,r=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(r=(i<3?a(r):i>3?a(e,n,r):a(e,n))||r);return i>3&&r&&Object.defineProperty(e,n,r),r};class y{constructor(t=new y.Options,e=r.a.Mode.DESKTOP){this.media=[],this.canLoadMore=!1,this.stories=[],this.numLoadedMore=0,this.totalMedia=0,this.mode=r.a.Mode.DESKTOP,this.isLoaded=!1,this.isLoading=!1,this.isLoadingMore=!1,this.numMediaToShow=0,this.numMediaPerPage=0,this.cancelFetch=()=>{},this.options=new y.Options(t),this.localMedia=[],this.mode=e,this.mediaCounter=this._numMediaPerPage,this.reload=Object(p.a)(()=>this.load(),300),Object(i.o)(()=>this.mode,()=>{0===this.numLoadedMore&&(this.mediaCounter=this._numMediaPerPage,this.localMedia.length<this.numMediaToShow&&this.loadMedia(this.localMedia.length,this.numMediaToShow-this.localMedia.length))}),Object(i.o)(()=>this.getReloadOptions(),()=>this.reload()),Object(i.o)(()=>({num:this._numMediaPerPage,mode:this.mode}),({num:t})=>{this.localMedia.length<t&&t<=this.totalMedia?this.reload():this.mediaCounter=Math.max(1,t)}),Object(i.o)(()=>this._media,t=>this.media=t),Object(i.o)(()=>this._numMediaToShow,t=>this.numMediaToShow=t),Object(i.o)(()=>this._numMediaPerPage,t=>this.numMediaPerPage=t),Object(i.o)(()=>this._canLoadMore,t=>this.canLoadMore=t)}get _media(){return this.localMedia.slice(0,this.numMediaToShow)}get _numMediaToShow(){return Math.min(this.mediaCounter,this.totalMedia)}get _numMediaPerPage(){return Math.max(1,y.ComputedOptions.normalizeMultiInt(this.options.numPosts,this.mode,1))}get _canLoadMore(){return this.localMedia.length>this.mediaCounter||this.localMedia.length<this.totalMedia}loadMore(){const t=this.numMediaToShow+this._numMediaPerPage-this.localMedia.length;return this.isLoadingMore=!0,t>0?this.loadMedia(this.localMedia.length,this._numMediaPerPage).then(()=>{this.mediaCounter+=this._numMediaPerPage,this.numLoadedMore++,this.isLoadingMore=!1}):new Promise(t=>{this.numLoadedMore++,this.mediaCounter+=this._numMediaPerPage,this.isLoadingMore=!1,t()})}load(){return this.numLoadedMore=0,this.loadMedia(0,this._numMediaPerPage,!0).then(()=>(this.isLoaded=!0,this.mediaCounter=this._numMediaPerPage))}loadMedia(t,e,n){return this.cancelFetch(),y.Options.hasSources(this.options)?(this.isLoading=!0,new Promise((o,i)=>{h.a.getFeedMedia(this.options,t,e,t=>this.cancelFetch=t).then(t=>{var e;if("object"!=typeof t||"object"!=typeof t.data||!Array.isArray(t.data.media))throw{message:"The media response is malformed or corrupt",response:t};n&&(this.localMedia=[]),this.localMedia.push(...t.data.media),this.stories=null!==(e=t.data.stories)&&void 0!==e?e:[],this.totalMedia=t.data.total,o&&o()}).catch(t=>{var e;if(a.a.isCancel(t))return null;const n=new y.Events.FetchFailEvent(y.Events.FETCH_FAIL,{detail:{feed:this,message:null!==(e=t.response?t.response.data.message:void 0)&&void 0!==e?e:t.message,response:t.response}});return document.dispatchEvent(n),i&&i(t),t}).finally(()=>this.isLoading=!1)})):new Promise(t=>{this.localMedia=[],this.totalMedia=0,t&&t()})}getReloadOptions(){return JSON.stringify({accounts:this.options.accounts,hashtags:this.options.hashtags,tagged:this.options.tagged,postOrder:this.options.postOrder,mediaType:this.options.mediaType,moderation:this.options.moderation,moderationMode:this.options.moderationMode,hashtagBlacklist:this.options.hashtagBlacklist,hashtagWhitelist:this.options.hashtagWhitelist,captionBlacklist:this.options.captionBlacklist,captionWhitelist:this.options.captionWhitelist,hashtagBlacklistSettings:this.options.hashtagBlacklistSettings,hashtagWhitelistSettings:this.options.hashtagWhitelistSettings,captionBlacklistSettings:this.options.captionBlacklistSettings,captionWhitelistSettings:this.options.captionWhitelistSettings})}}b([i.n],y.prototype,"media",void 0),b([i.n],y.prototype,"canLoadMore",void 0),b([i.n],y.prototype,"stories",void 0),b([i.n],y.prototype,"numLoadedMore",void 0),b([i.n],y.prototype,"options",void 0),b([i.n],y.prototype,"totalMedia",void 0),b([i.n],y.prototype,"mode",void 0),b([i.n],y.prototype,"isLoaded",void 0),b([i.n],y.prototype,"isLoading",void 0),b([i.n],y.prototype,"isLoadingMore",void 0),b([i.f],y.prototype,"reload",void 0),b([i.n],y.prototype,"localMedia",void 0),b([i.n],y.prototype,"numMediaToShow",void 0),b([i.n],y.prototype,"numMediaPerPage",void 0),b([i.n],y.prototype,"mediaCounter",void 0),b([i.h],y.prototype,"_media",null),b([i.h],y.prototype,"_numMediaToShow",null),b([i.h],y.prototype,"_numMediaPerPage",null),b([i.h],y.prototype,"_canLoadMore",null),b([i.f],y.prototype,"loadMore",null),b([i.f],y.prototype,"load",null),b([i.f],y.prototype,"loadMedia",null),function(t){let e,n,o,a,h,p,y,_,v;!function(t){t.FETCH_FAIL="sli/feed/fetch_fail";class e extends CustomEvent{constructor(t,e){super(t,e)}}t.FetchFailEvent=e}(e=t.Events||(t.Events={}));class E{constructor(t={}){E.setFromObject(this,t)}static setFromObject(e,n={}){var o,a,i,l,u,d,h,p,m,g,b,y,_,v,E;const w=n.accounts?n.accounts.slice():t.DefaultOptions.accounts;e.accounts=w.filter(t=>!!t).map(t=>parseInt(t.toString()));const O=n.tagged?n.tagged.slice():t.DefaultOptions.tagged;return e.tagged=O.filter(t=>!!t).map(t=>parseInt(t.toString())),e.hashtags=n.hashtags?n.hashtags.slice():t.DefaultOptions.hashtags,e.layout=s.a.getById(n.layout).id,e.numColumns=r.a.normalize(n.numColumns,t.DefaultOptions.numColumns),e.highlightFreq=r.a.normalize(n.highlightFreq,t.DefaultOptions.highlightFreq),e.mediaType=n.mediaType||t.DefaultOptions.mediaType,e.postOrder=n.postOrder||t.DefaultOptions.postOrder,e.numPosts=r.a.normalize(n.numPosts,t.DefaultOptions.numPosts),e.linkBehavior=r.a.normalize(n.linkBehavior,t.DefaultOptions.linkBehavior),e.feedWidth=r.a.normalize(n.feedWidth,t.DefaultOptions.feedWidth),e.feedHeight=r.a.normalize(n.feedHeight,t.DefaultOptions.feedHeight),e.feedPadding=r.a.normalize(n.feedPadding,t.DefaultOptions.feedPadding),e.imgPadding=r.a.normalize(n.imgPadding,t.DefaultOptions.imgPadding),e.textSize=r.a.normalize(n.textSize,t.DefaultOptions.textSize),e.bgColor=n.bgColor||t.DefaultOptions.bgColor,e.hoverInfo=n.hoverInfo?n.hoverInfo.slice():t.DefaultOptions.hoverInfo,e.textColorHover=n.textColorHover||t.DefaultOptions.textColorHover,e.bgColorHover=n.bgColorHover||t.DefaultOptions.bgColorHover,e.showHeader=r.a.normalize(n.showHeader,t.DefaultOptions.showHeader),e.headerInfo=r.a.normalize(n.headerInfo,t.DefaultOptions.headerInfo),e.headerAccount=null!==(o=n.headerAccount)&&void 0!==o?o:t.DefaultOptions.headerAccount,e.headerAccount=null===e.headerAccount||void 0===c.b.getById(e.headerAccount)?c.b.list.length>0?c.b.list[0].id:null:e.headerAccount,e.headerStyle=r.a.normalize(n.headerStyle,t.DefaultOptions.headerStyle),e.headerTextSize=r.a.normalize(n.headerTextSize,t.DefaultOptions.headerTextSize),e.headerPhotoSize=r.a.normalize(n.headerPhotoSize,t.DefaultOptions.headerPhotoSize),e.headerTextColor=n.headerTextColor||t.DefaultOptions.headerTextColor,e.headerBgColor=n.headerBgColor||t.DefaultOptions.bgColor,e.headerPadding=r.a.normalize(n.headerPadding,t.DefaultOptions.headerPadding),e.customProfilePic=null!==(a=n.customProfilePic)&&void 0!==a?a:t.DefaultOptions.customProfilePic,e.customBioText=n.customBioText||t.DefaultOptions.customBioText,e.includeStories=null!==(i=n.includeStories)&&void 0!==i?i:t.DefaultOptions.includeStories,e.storiesInterval=n.storiesInterval||t.DefaultOptions.storiesInterval,e.showCaptions=r.a.normalize(n.showCaptions,t.DefaultOptions.showCaptions),e.captionMaxLength=r.a.normalize(n.captionMaxLength,t.DefaultOptions.captionMaxLength),e.captionRemoveDots=null!==(l=n.captionRemoveDots)&&void 0!==l?l:t.DefaultOptions.captionRemoveDots,e.captionSize=r.a.normalize(n.captionSize,t.DefaultOptions.captionSize),e.captionColor=n.captionColor||t.DefaultOptions.captionColor,e.showLikes=r.a.normalize(n.showLikes,t.DefaultOptions.showLikes),e.showComments=r.a.normalize(n.showComments,t.DefaultOptions.showCaptions),e.lcIconSize=r.a.normalize(n.lcIconSize,t.DefaultOptions.lcIconSize),e.likesIconColor=null!==(u=n.likesIconColor)&&void 0!==u?u:t.DefaultOptions.likesIconColor,e.commentsIconColor=n.commentsIconColor||t.DefaultOptions.commentsIconColor,e.lightboxShowSidebar=null!==(d=n.lightboxShowSidebar)&&void 0!==d?d:t.DefaultOptions.lightboxShowSidebar,e.numLightboxComments=n.numLightboxComments||t.DefaultOptions.numLightboxComments,e.showLoadMoreBtn=r.a.normalize(n.showLoadMoreBtn,t.DefaultOptions.showLoadMoreBtn),e.loadMoreBtnTextColor=n.loadMoreBtnTextColor||t.DefaultOptions.loadMoreBtnTextColor,e.loadMoreBtnBgColor=n.loadMoreBtnBgColor||t.DefaultOptions.loadMoreBtnBgColor,e.loadMoreBtnText=n.loadMoreBtnText||t.DefaultOptions.loadMoreBtnText,e.autoload=null!==(h=n.autoload)&&void 0!==h?h:t.DefaultOptions.autoload,e.showFollowBtn=r.a.normalize(n.showFollowBtn,t.DefaultOptions.showFollowBtn),e.followBtnText=null!==(p=n.followBtnText)&&void 0!==p?p:t.DefaultOptions.followBtnText,e.followBtnTextColor=n.followBtnTextColor||t.DefaultOptions.followBtnTextColor,e.followBtnBgColor=n.followBtnBgColor||t.DefaultOptions.followBtnBgColor,e.followBtnLocation=r.a.normalize(n.followBtnLocation,t.DefaultOptions.followBtnLocation),e.hashtagWhitelist=n.hashtagWhitelist||t.DefaultOptions.hashtagWhitelist,e.hashtagBlacklist=n.hashtagBlacklist||t.DefaultOptions.hashtagBlacklist,e.captionWhitelist=n.captionWhitelist||t.DefaultOptions.captionWhitelist,e.captionBlacklist=n.captionBlacklist||t.DefaultOptions.captionBlacklist,e.hashtagWhitelistSettings=null!==(m=n.hashtagWhitelistSettings)&&void 0!==m?m:t.DefaultOptions.hashtagWhitelistSettings,e.hashtagBlacklistSettings=null!==(g=n.hashtagBlacklistSettings)&&void 0!==g?g:t.DefaultOptions.hashtagBlacklistSettings,e.captionWhitelistSettings=null!==(b=n.captionWhitelistSettings)&&void 0!==b?b:t.DefaultOptions.captionWhitelistSettings,e.captionBlacklistSettings=null!==(y=n.captionBlacklistSettings)&&void 0!==y?y:t.DefaultOptions.captionBlacklistSettings,e.moderation=n.moderation||t.DefaultOptions.moderation,e.moderationMode=n.moderationMode||t.DefaultOptions.moderationMode,e.promotionEnabled=null!==(_=n.promotionEnabled)&&void 0!==_?_:t.DefaultOptions.promotionEnabled,e.autoPromotionsEnabled=null!==(v=n.autoPromotionsEnabled)&&void 0!==v?v:t.DefaultOptions.autoPromotionsEnabled,e.globalPromotionsEnabled=null!==(E=n.globalPromotionsEnabled)&&void 0!==E?E:t.DefaultOptions.globalPromotionsEnabled,Array.isArray(n.promotions)?e.promotions=f.a.fromArray(n.promotions):n.promotions&&n.promotions instanceof Map?e.promotions=f.a.fromMap(n.promotions):"object"==typeof n.promotions?e.promotions=n.promotions:e.promotions=t.DefaultOptions.promotions,e}static getAllAccounts(t){const e=c.b.idsToAccounts(t.accounts),n=c.b.idsToAccounts(t.tagged);return{all:e.concat(n),accounts:e,tagged:n}}static getSources(t){return{accounts:c.b.idsToAccounts(t.accounts),tagged:c.b.idsToAccounts(t.tagged),hashtags:c.b.getBusinessAccounts().length>0?t.hashtags.filter(t=>t.tag.length>0):[]}}static hasSources(e){const n=t.Options.getSources(e),o=n.accounts.length>0||n.tagged.length>0,a=n.hashtags.length>0;return o||a}static isLimitingPosts(t){return t.moderation.length>0||t.hashtagBlacklist.length>0||t.hashtagWhitelist.length>0||t.captionBlacklist.length>0||t.captionWhitelist.length>0}}b([i.n],E.prototype,"accounts",void 0),b([i.n],E.prototype,"hashtags",void 0),b([i.n],E.prototype,"tagged",void 0),b([i.n],E.prototype,"layout",void 0),b([i.n],E.prototype,"numColumns",void 0),b([i.n],E.prototype,"highlightFreq",void 0),b([i.n],E.prototype,"mediaType",void 0),b([i.n],E.prototype,"postOrder",void 0),b([i.n],E.prototype,"numPosts",void 0),b([i.n],E.prototype,"linkBehavior",void 0),b([i.n],E.prototype,"feedWidth",void 0),b([i.n],E.prototype,"feedHeight",void 0),b([i.n],E.prototype,"feedPadding",void 0),b([i.n],E.prototype,"imgPadding",void 0),b([i.n],E.prototype,"textSize",void 0),b([i.n],E.prototype,"bgColor",void 0),b([i.n],E.prototype,"textColorHover",void 0),b([i.n],E.prototype,"bgColorHover",void 0),b([i.n],E.prototype,"hoverInfo",void 0),b([i.n],E.prototype,"showHeader",void 0),b([i.n],E.prototype,"headerInfo",void 0),b([i.n],E.prototype,"headerAccount",void 0),b([i.n],E.prototype,"headerStyle",void 0),b([i.n],E.prototype,"headerTextSize",void 0),b([i.n],E.prototype,"headerPhotoSize",void 0),b([i.n],E.prototype,"headerTextColor",void 0),b([i.n],E.prototype,"headerBgColor",void 0),b([i.n],E.prototype,"headerPadding",void 0),b([i.n],E.prototype,"customBioText",void 0),b([i.n],E.prototype,"customProfilePic",void 0),b([i.n],E.prototype,"includeStories",void 0),b([i.n],E.prototype,"storiesInterval",void 0),b([i.n],E.prototype,"showCaptions",void 0),b([i.n],E.prototype,"captionMaxLength",void 0),b([i.n],E.prototype,"captionRemoveDots",void 0),b([i.n],E.prototype,"captionSize",void 0),b([i.n],E.prototype,"captionColor",void 0),b([i.n],E.prototype,"showLikes",void 0),b([i.n],E.prototype,"showComments",void 0),b([i.n],E.prototype,"lcIconSize",void 0),b([i.n],E.prototype,"likesIconColor",void 0),b([i.n],E.prototype,"commentsIconColor",void 0),b([i.n],E.prototype,"lightboxShowSidebar",void 0),b([i.n],E.prototype,"numLightboxComments",void 0),b([i.n],E.prototype,"showLoadMoreBtn",void 0),b([i.n],E.prototype,"loadMoreBtnText",void 0),b([i.n],E.prototype,"loadMoreBtnTextColor",void 0),b([i.n],E.prototype,"loadMoreBtnBgColor",void 0),b([i.n],E.prototype,"autoload",void 0),b([i.n],E.prototype,"showFollowBtn",void 0),b([i.n],E.prototype,"followBtnText",void 0),b([i.n],E.prototype,"followBtnTextColor",void 0),b([i.n],E.prototype,"followBtnBgColor",void 0),b([i.n],E.prototype,"followBtnLocation",void 0),b([i.n],E.prototype,"hashtagWhitelist",void 0),b([i.n],E.prototype,"hashtagBlacklist",void 0),b([i.n],E.prototype,"captionWhitelist",void 0),b([i.n],E.prototype,"captionBlacklist",void 0),b([i.n],E.prototype,"hashtagWhitelistSettings",void 0),b([i.n],E.prototype,"hashtagBlacklistSettings",void 0),b([i.n],E.prototype,"captionWhitelistSettings",void 0),b([i.n],E.prototype,"captionBlacklistSettings",void 0),b([i.n],E.prototype,"moderation",void 0),b([i.n],E.prototype,"moderationMode",void 0),t.Options=E;class w{constructor(t){Object.getOwnPropertyNames(t).map(e=>{this[e]=t[e]})}getCaption(t){const e=t.caption?t.caption:"";return this.captionMaxLength&&e.length?Object(u.q)(Object(u.t)(e,this.captionMaxLength)):e}static compute(e,n=r.a.Mode.DESKTOP){const o=new w({accounts:c.b.filterExisting(e.accounts),tagged:c.b.filterExisting(e.tagged),hashtags:e.hashtags.filter(t=>t.tag.length>0),layout:s.a.getById(e.layout),highlightFreq:r.a.get(e.highlightFreq,n,!0),linkBehavior:r.a.get(e.linkBehavior,n,!0),bgColor:Object(d.a)(e.bgColor),textColorHover:Object(d.a)(e.textColorHover),bgColorHover:Object(d.a)(e.bgColorHover),hoverInfo:e.hoverInfo,showHeader:r.a.get(e.showHeader,n,!0),headerInfo:r.a.get(e.headerInfo,n,!0),headerStyle:r.a.get(e.headerStyle,n,!0),headerTextColor:Object(d.a)(e.headerTextColor),headerBgColor:Object(d.a)(e.headerBgColor),headerPadding:r.a.get(e.headerPadding,n,!0),includeStories:e.includeStories,storiesInterval:e.storiesInterval,showCaptions:r.a.get(e.showCaptions,n,!0),captionMaxLength:r.a.get(e.captionMaxLength,n,!0),captionRemoveDots:e.captionRemoveDots,captionColor:Object(d.a)(e.captionColor),showLikes:r.a.get(e.showLikes,n,!0),showComments:r.a.get(e.showComments,n,!0),likesIconColor:Object(d.a)(e.likesIconColor),commentsIconColor:Object(d.a)(e.commentsIconColor),lightboxShowSidebar:e.lightboxShowSidebar,numLightboxComments:e.numLightboxComments,showLoadMoreBtn:r.a.get(e.showLoadMoreBtn,n,!0),loadMoreBtnTextColor:Object(d.a)(e.loadMoreBtnTextColor),loadMoreBtnBgColor:Object(d.a)(e.loadMoreBtnBgColor),loadMoreBtnText:e.loadMoreBtnText,showFollowBtn:r.a.get(e.showFollowBtn,n,!0),autoload:e.autoload,followBtnLocation:r.a.get(e.followBtnLocation,n,!0),followBtnTextColor:Object(d.a)(e.followBtnTextColor),followBtnBgColor:Object(d.a)(e.followBtnBgColor),followBtnText:e.followBtnText,account:null,showBio:!1,bioText:null,profilePhotoUrl:c.b.DEFAULT_PROFILE_PIC,feedWidth:"",feedHeight:"",feedPadding:"",imgPadding:"",textSize:"",headerTextSize:"",headerPhotoSize:"",captionSize:"",lcIconSize:"",showLcIcons:!1});if(o.numColumns=this.getNumCols(e,n),o.numPosts=this.getNumPosts(e,n),o.allAccounts=o.accounts.concat(o.tagged.filter(t=>!o.accounts.includes(t))),o.allAccounts.length>0&&(o.account=e.headerAccount&&o.allAccounts.includes(e.headerAccount)?c.b.getById(e.headerAccount):c.b.getById(o.allAccounts[0])),o.showHeader=o.showHeader&&null!==o.account,o.showHeader&&(o.profilePhotoUrl=e.customProfilePic.length?e.customProfilePic:c.b.getProfilePicUrl(o.account)),o.showFollowBtn=o.showFollowBtn&&null!==o.account,o.showBio=o.headerInfo.some(e=>e===t.HeaderInfo.BIO),o.showBio){const t=e.customBioText.trim().length>0?e.customBioText:null!==o.account?c.b.getBioText(o.account):"";o.bioText=Object(u.q)(t),o.showBio=o.bioText.length>0}return o.feedWidth=this.normalizeCssSize(e.feedWidth,n,"auto"),o.feedHeight=this.normalizeCssSize(e.feedHeight,n,"auto"),o.feedPadding=this.normalizeCssSize(e.feedPadding,n,"0"),o.imgPadding=this.normalizeCssSize(e.imgPadding,n,"0"),o.textSize=this.normalizeCssSize(e.textSize,n,"inherit",!0),o.headerTextSize=this.normalizeCssSize(e.headerTextSize,n,"inherit"),o.headerPhotoSize=this.normalizeCssSize(e.headerPhotoSize,n,"50px"),o.captionSize=this.normalizeCssSize(e.captionSize,n,"inherit"),o.lcIconSize=this.normalizeCssSize(e.lcIconSize,n,"inherit"),o.buttonPadding=Math.max(10,r.a.get(e.imgPadding,n))+"px",o.showLcIcons=o.showLikes||o.showComments,o}static getNumCols(t,e){return Math.max(1,this.normalizeMultiInt(t.numColumns,e,1))}static getNumPosts(t,e){return Math.max(1,this.normalizeMultiInt(t.numPosts,e,1))}static normalizeMultiInt(t,e,n=0){const o=parseInt(r.a.get(t,e)+"");return isNaN(o)?e===r.a.Mode.DESKTOP?n:this.normalizeMultiInt(t,r.a.Mode.DESKTOP,n):o}static normalizeCssSize(t,e,n=null,o=!1){const a=r.a.get(t,e,o);return a?a+"px":n}}function O(t,e){if(g.a.isPro)return Object(u.m)(m.a.isValid,[()=>S(t,e),()=>e.globalPromotionsEnabled&&m.a.getGlobalPromo(t),()=>e.autoPromotionsEnabled&&m.a.getAutoPromo(t)])}function S(t,e){return t?m.a.getPromoFromDictionary(t,e.promotions):void 0}t.ComputedOptions=w,t.HashtagSorting=Object(l.b)({recent:"Most recent",popular:"Most popular"}),function(t){t.ALL="all",t.PHOTOS="photos",t.VIDEOS="videos"}(n=t.MediaType||(t.MediaType={})),function(t){t.NOTHING="nothing",t.SELF="self",t.NEW_TAB="new_tab",t.LIGHTBOX="lightbox"}(o=t.LinkBehavior||(t.LinkBehavior={})),function(t){t.DATE_ASC="date_asc",t.DATE_DESC="date_desc",t.POPULARITY_ASC="popularity_asc",t.POPULARITY_DESC="popularity_desc",t.RANDOM="random"}(a=t.PostOrder||(t.PostOrder={})),function(t){t.USERNAME="username",t.DATE="date",t.CAPTION="caption",t.LIKES_COMMENTS="likes_comments",t.INSTA_LINK="insta_link"}(h=t.HoverInfo||(t.HoverInfo={})),function(t){t.NORMAL="normal",t.BOXED="boxed",t.CENTERED="centered"}(p=t.HeaderStyle||(t.HeaderStyle={})),function(t){t.BIO="bio",t.PROFILE_PIC="profile_pic",t.FOLLOWERS="followers",t.MEDIA_COUNT="media_count"}(y=t.HeaderInfo||(t.HeaderInfo={})),function(t){t.HEADER="header",t.BOTTOM="bottom",t.BOTH="both"}(_=t.FollowBtnLocation||(t.FollowBtnLocation={})),function(t){t.WHITELIST="whitelist",t.BLACKLIST="blacklist"}(v=t.ModerationMode||(t.ModerationMode={})),t.DefaultOptions={accounts:[],hashtags:[],tagged:[],layout:null,numColumns:{desktop:3},highlightFreq:{desktop:7},mediaType:n.ALL,postOrder:a.DATE_DESC,numPosts:{desktop:9},linkBehavior:{desktop:o.LIGHTBOX,phone:o.NEW_TAB},feedWidth:{desktop:""},feedHeight:{desktop:""},feedPadding:{desktop:20,tablet:14,phone:10},imgPadding:{desktop:14,tablet:10,phone:6},textSize:{all:""},bgColor:{r:255,g:255,b:255,a:1},hoverInfo:[h.LIKES_COMMENTS,h.INSTA_LINK],textColorHover:{r:255,g:255,b:255,a:1},bgColorHover:{r:0,g:0,b:0,a:.5},showHeader:{desktop:!0},headerInfo:{desktop:[y.PROFILE_PIC,y.BIO]},headerAccount:null,headerStyle:{desktop:p.NORMAL,phone:p.CENTERED},headerTextSize:{desktop:""},headerPhotoSize:{desktop:50},headerTextColor:{r:0,g:0,b:0,a:1},headerBgColor:{r:255,g:255,b:255,a:1},headerPadding:{desktop:0},customProfilePic:0,customBioText:"",includeStories:!1,storiesInterval:5,showCaptions:{desktop:!1},captionMaxLength:{desktop:0},captionRemoveDots:!1,captionSize:{desktop:0},captionColor:{r:0,g:0,b:0,a:1},showLikes:{desktop:!1},showComments:{desktop:!1},lcIconSize:{desktop:14},likesIconColor:{r:0,g:0,b:0,a:1},commentsIconColor:{r:0,g:0,b:0,a:1},lightboxShowSidebar:!1,numLightboxComments:50,showLoadMoreBtn:{desktop:!0},loadMoreBtnTextColor:{r:255,g:255,b:255,a:1},loadMoreBtnBgColor:{r:0,g:149,b:246,a:1},loadMoreBtnText:"Load more",autoload:!1,showFollowBtn:{desktop:!0},followBtnText:"Follow on Instagram",followBtnTextColor:{r:255,g:255,b:255,a:1},followBtnBgColor:{r:0,g:149,b:246,a:1},followBtnLocation:{desktop:_.HEADER,phone:_.BOTTOM},hashtagWhitelist:[],hashtagBlacklist:[],captionWhitelist:[],captionBlacklist:[],hashtagWhitelistSettings:!0,hashtagBlacklistSettings:!0,captionWhitelistSettings:!0,captionBlacklistSettings:!0,moderation:[],moderationMode:v.BLACKLIST,promotionEnabled:!0,autoPromotionsEnabled:!0,globalPromotionsEnabled:!0,promotions:{}},t.getPromo=O,t.getFeedPromo=S,t.executeMediaClick=function(t,e){const n=O(t,e),o=m.a.getConfig(n),a=m.a.getType(n);return!(!a||!a.isValid(o)||"function"!=typeof a.onMediaClick)&&a.onMediaClick(t,o)},t.getLink=function(t,e){var n,o;const a=O(t,e),i=m.a.getConfig(a),r=m.a.getType(a);if(void 0===r||!r.isValid(i))return{text:null,url:null,newTab:!1};let[s,l]=r.getPopupLink?null!==(n=r.getPopupLink(t,i))&&void 0!==n?n:null:[null,!1];return{text:s,url:r.getMediaUrl&&null!==(o=r.getMediaUrl(t,i))&&void 0!==o?o:null,newTab:l}}}(y||(y={}))},73:function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var o=n(0),a=n.n(o),i=n(37),r=n.n(i),s=n(98),l=n(3),c=n(58),u=n(11),d=n(15);function h(t){var{media:e,className:n,size:i,onLoadImage:h,width:p,height:m}=t,f=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(t);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]])}return n}(t,["media","className","size","onLoadImage","width","height"]);const g=a.a.useRef(),b=a.a.useRef(),[y,_]=a.a.useState(!0);function v(){if(g.current){const t=null!=i?i:function(){const t=g.current.getBoundingClientRect();return t.width<=320?l.a.SMALL:(t.width,l.a.MEDIUM)}(),n="object"==typeof e.thumbnails&&d.a.has(e.thumbnails,t)?d.a.get(e.thumbnails,t):e.thumbnail;g.current.src!==n&&(g.current.src=n)}}return Object(o.useLayoutEffect)(()=>{if("VIDEO"!==e.type){let t=new s.a(v);return g.current&&(g.current.onload=()=>{_(!1),h&&h()},g.current.onerror=()=>{g.current.src!==e.thumbnail&&(g.current.src=e.thumbnail),_(!1),h&&h()},v(),t.observe(g.current)),()=>{g.current.onload=()=>null,g.current.onerror=()=>null,t.disconnect()}}b.current&&(b.current.currentTime=1,_(!1),h&&h())},[e,i]),e.url&&e.url.length>0?a.a.createElement("div",Object.assign({className:Object(u.b)(r.a.root,n)},f),"VIDEO"===e.type&&a.a.createElement("video",{ref:b,className:r.a.video,src:e.url,autoPlay:!1,controls:!1,tabIndex:0},a.a.createElement("source",{src:e.url}),"Your browser does not support videos"),"VIDEO"!==e.type&&a.a.createElement("img",Object.assign({ref:g,className:r.a.image,loading:"lazy",alt:e.caption,width:p,height:m},u.e)),y&&a.a.createElement(c.a,null)):a.a.createElement("div",{className:r.a.notAvailable},a.a.createElement("span",null,"Thumbnail not available"))}},74:function(t,e,n){t.exports={root:"MediaLoading__root",animation:"MediaLoading__animation"}},76:function(t,e,n){t.exports={root:"ProfilePic__root",round:"ProfilePic__round ProfilePic__root",square:"ProfilePic__square ProfilePic__root"}},77:function(t,e,n){t.exports={"connect-btn":"AccountsPage__connect-btn",connectBtn:"AccountsPage__connect-btn"}},8:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o,a=n(12),i=n(15),r=n(3);!function(t){function e(t){return t?c(t.type):void 0}function n(t){var n;if("object"!=typeof t)return!1;const o=e(t);return void 0!==o&&o.isValid(null!==(n=t.config)&&void 0!==n?n:{})}function o(e){return e?t.getPromoFromDictionary(e,a.a.config.globalPromotions):void 0}function s(t){const e=l(t);return void 0===e?void 0:e.promotion}function l(e){if(e)for(const n of a.a.config.autoPromotions){const o=t.Automation.getType(n),a=t.Automation.getConfig(n);if(o&&o.matches(e,a))return n}}function c(e){return t.types.find(t=>t.id===e)}let u;t.getConfig=function(t){var e,n;return t&&null!==(n=null!==(e=t.config)&&void 0!==e?e:t.data)&&void 0!==n?n:{}},t.getType=e,t.isValid=n,t.getPromoFromDictionary=function(e,n){const o=i.a.get(n,e.id);if(o)return t.getType(o)?o:void 0},t.getPromo=function(t){return Object(r.m)(n,[()=>o(t),()=>s(t)])},t.getGlobalPromo=o,t.getAutoPromo=s,t.getAutomation=l,t.types=[],t.getTypes=function(){return t.types},t.registerType=function(e){t.types.push(e)},t.getTypeById=c,t.clearTypes=function(){t.types.splice(0,t.types.length)},function(t){t.getType=function(t){return t?n(t.type):void 0},t.getConfig=function(t){var e,n;return t&&null!==(n=null!==(e=t.config)&&void 0!==e?e:t.data)&&void 0!==n?n:{}},t.getPromotion=function(t){return t?t.promotion:void 0};const e=[];function n(t){return e.find(e=>e.id===t)}t.getTypes=function(){return e},t.registerType=function(t){e.push(t)},t.getTypeById=n,t.clearTypes=function(){e.splice(0,e.length)}}(u=t.Automation||(t.Automation={}))}(o||(o={}))},82:function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return l})),n.d(e,"c",(function(){return c}));var o=n(7),a=n(19),i=n(3),r=n(15);class s{constructor(t){this.incFilters=!1,this.prevOptions=null,this.media=new Array,this.config=Object(i.h)(t),void 0===this.config.watch&&(this.config.watch={all:!0})}fetchMedia(t,e){if(this.hasCache(t))return Promise.resolve(this.media);const n=Object.assign({},t.options,{moderation:this.isWatchingField("moderation")?t.options.moderation:[],moderationMode:t.options.moderationMode,hashtagBlacklist:this.isWatchingField("hashtagBlacklist")?t.options.hashtagBlacklist:[],hashtagWhitelist:this.isWatchingField("hashtagWhitelist")?t.options.hashtagWhitelist:[],captionBlacklist:this.isWatchingField("captionBlacklist")?t.options.captionBlacklist:[],captionWhitelist:this.isWatchingField("captionWhitelist")?t.options.captionWhitelist:[],hashtagBlacklistSettings:!!this.isWatchingField("hashtagBlacklistSettings")&&t.options.hashtagBlacklistSettings,hashtagWhitelistSettings:!!this.isWatchingField("hashtagWhitelistSettings")&&t.options.hashtagWhitelistSettings,captionBlacklistSettings:!!this.isWatchingField("captionBlacklistSettings")&&t.options.captionBlacklistSettings,captionWhitelistSettings:!!this.isWatchingField("captionWhitelistSettings")&&t.options.captionWhitelistSettings});return e&&e(),a.a.getFeedMedia(n).then(e=>(this.prevOptions=new o.a.Options(t.options),this.media=e.data.media,this.media))}hasCache(t){return null!==this.prevOptions&&!this.isCacheInvalid(t)}isWatchingField(t){var e,n,o;let a=null!==(e=this.config.watch.all)&&void 0!==e&&e;return 1===r.a.size(this.config.watch)&&void 0!==this.config.watch.all?a:(s.FILTER_FIELDS.includes(t)&&(a=null!==(n=r.a.get(this.config.watch,"filters"))&&void 0!==n?n:a),null!==(o=r.a.get(this.config.watch,t))&&void 0!==o?o:a)}isCacheInvalid(t){const e=t.options,n=this.prevOptions;if(Object(i.k)(t.media,this.media,(t,e)=>t.id===e.id).length>0)return!0;if(this.isWatchingField("accounts")&&!Object(i.f)(e.accounts,n.accounts))return!0;if(this.isWatchingField("tagged")&&!Object(i.f)(e.tagged,n.tagged))return!0;if(this.isWatchingField("hashtags")&&!Object(i.f)(e.hashtags,n.hashtags,i.n))return!0;if(this.isWatchingField("moderationMode")&&e.moderationMode!==n.moderationMode)return!0;if(this.isWatchingField("moderation")&&!Object(i.f)(e.moderation,n.moderation))return!0;if(this.isWatchingField("filters")){if(this.isWatchingField("captionWhitelistSettings")&&e.captionWhitelistSettings!==n.captionWhitelistSettings)return!0;if(this.isWatchingField("captionBlacklistSettings")&&e.captionBlacklistSettings!==n.captionBlacklistSettings)return!0;if(this.isWatchingField("hashtagWhitelistSettings")&&e.hashtagWhitelistSettings!==n.hashtagWhitelistSettings)return!0;if(this.isWatchingField("hashtagBlacklistSettings")&&e.hashtagBlacklistSettings!==n.hashtagBlacklistSettings)return!0;if(this.isWatchingField("captionWhitelist")&&!Object(i.f)(e.captionWhitelist,n.captionWhitelist))return!0;if(this.isWatchingField("captionBlacklist")&&!Object(i.f)(e.captionBlacklist,n.captionBlacklist))return!0;if(this.isWatchingField("hashtagWhitelist")&&!Object(i.f)(e.hashtagWhitelist,n.hashtagWhitelist))return!0;if(this.isWatchingField("hashtagBlacklist")&&!Object(i.f)(e.hashtagBlacklist,n.hashtagBlacklist))return!0}return!1}}!function(t){t.FILTER_FIELDS=["hashtagBlacklist","hashtagWhitelist","captionBlacklist","captionWhitelist","hashtagBlacklistSettings","hashtagWhitelistSettings","captionBlacklistSettings","captionWhitelistSettings"]}(s||(s={}));const l=new s({watch:{all:!0,filters:!1}}),c=new s({watch:{all:!0,moderation:!1}})},86:function(t,e,n){t.exports={label:"TabNavbar__label",tab:"TabNavbar__tab",current:"TabNavbar__current TabNavbar__tab",disabled:"TabNavbar__disabled TabNavbar__tab"}},89:function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var o=n(0),a=n.n(o),i=n(46),r=n(9),s=n.n(r),l=n(6),c=n(4),u=n(616),d=n(388),h=n(55),p=n(114),m=n(105),f=n(30),g=n(5),b=n(23),y=n(14),_=n(59),v=Object(l.b)((function({account:t,onUpdate:e}){const[n,o]=a.a.useState(!1),[i,r]=a.a.useState(""),[l,v]=a.a.useState(!1),E=t.type===c.a.Type.PERSONAL,w=c.b.getBioText(t),O=()=>{t.customBio=i,v(!0),f.a.updateAccount(t).then(()=>{o(!1),v(!1),e&&e()})},S=n=>{t.customProfilePicUrl=n,v(!0),f.a.updateAccount(t).then(()=>{v(!1),e&&e()})};return a.a.createElement("div",{className:s.a.root},a.a.createElement("div",{className:s.a.container},a.a.createElement("div",{className:s.a.infoColumn},a.a.createElement("a",{href:c.b.getProfileUrl(t),target:"_blank",className:s.a.username},"@",t.username),a.a.createElement("div",{className:s.a.row},a.a.createElement("span",{className:s.a.label},"Spotlight ID:"),t.id),a.a.createElement("div",{className:s.a.row},a.a.createElement("span",{className:s.a.label},"User ID:"),t.userId),a.a.createElement("div",{className:s.a.row},a.a.createElement("span",{className:s.a.label},"Type:"),t.type),!n&&a.a.createElement("div",{className:s.a.row},a.a.createElement("div",null,a.a.createElement("span",{className:s.a.label},"Bio:"),a.a.createElement("a",{className:s.a.editBioLink,onClick:()=>{r(c.b.getBioText(t)),o(!0)}},"Edit bio"),a.a.createElement("pre",{className:s.a.bio},w.length>0?w:"(No bio)"))),n&&a.a.createElement("div",{className:s.a.row},a.a.createElement("textarea",{className:s.a.bioEditor,value:i,onChange:t=>{r(t.target.value)},onKeyDown:t=>{"Enter"===t.key&&t.ctrlKey&&(O(),t.preventDefault(),t.stopPropagation())},rows:4}),a.a.createElement("div",{className:s.a.bioFooter},a.a.createElement("div",{className:s.a.bioEditingControls},l&&a.a.createElement("span",null,"Please wait ...")),a.a.createElement("div",{className:s.a.bioEditingControls},a.a.createElement(g.a,{className:s.a.bioEditingButton,type:g.c.DANGER,disabled:l,onClick:()=>{t.customBio="",v(!0),f.a.updateAccount(t).then(()=>{o(!1),v(!1),e&&e()})}},"Reset"),a.a.createElement(g.a,{className:s.a.bioEditingButton,type:g.c.SECONDARY,disabled:l,onClick:()=>{o(!1)}},"Cancel"),a.a.createElement(g.a,{className:s.a.bioEditingButton,type:g.c.PRIMARY,disabled:l,onClick:O},"Save"))))),a.a.createElement("div",{className:s.a.picColumn},a.a.createElement("div",null,a.a.createElement(_.a,{account:t,className:s.a.profilePic})),a.a.createElement(p.a,{id:"account-custom-profile-pic",title:"Select profile picture",mediaType:"image",onSelect:t=>{const e=parseInt(t.attributes.id),n=m.a.media.attachment(e).attributes.url;S(n)}},({open:t})=>a.a.createElement(g.a,{type:g.c.SECONDARY,className:s.a.setCustomPic,onClick:t},"Change profile picture")),t.customProfilePicUrl.length>0&&a.a.createElement("a",{className:s.a.resetCustomPic,onClick:()=>{S("")}},"Reset profile picture"))),E&&a.a.createElement("div",{className:s.a.personalInfoMessage},a.a.createElement(b.a,{type:b.b.INFO,showIcon:!0},"Due to restrictions set by Instagram, Spotlight cannot import the profile photo and bio"," ","text for Personal accounts."," ",a.a.createElement("a",{href:y.a.resources.customPersonalInfoUrl,target:"_blank"},"Click here to learn more"),".")),a.a.createElement(h.a,{label:"View access token",stealth:!0},a.a.createElement("div",{className:s.a.row},t.accessToken&&a.a.createElement("div",null,a.a.createElement("p",null,a.a.createElement("span",{className:s.a.label},"Expires on:"),a.a.createElement("span",null,t.accessToken.expiry?Object(u.a)(Object(d.a)(t.accessToken.expiry),"PPPP"):"Unknown")),a.a.createElement("pre",{className:s.a.accessToken},t.accessToken.code)))))}));function E({isOpen:t,onClose:e,onUpdate:n,account:o}){return a.a.createElement(i.a,{isOpen:t,title:"Account details",icon:"admin-users",onClose:e},a.a.createElement(i.a.Content,null,a.a.createElement(v,{account:o,onUpdate:n})))}},9:function(t,e,n){t.exports={root:"AccountInfo__root",container:"AccountInfo__container",column:"AccountInfo__column","info-column":"AccountInfo__info-column AccountInfo__column",infoColumn:"AccountInfo__info-column AccountInfo__column","pic-column":"AccountInfo__pic-column AccountInfo__column",picColumn:"AccountInfo__pic-column AccountInfo__column",id:"AccountInfo__id",username:"AccountInfo__username","profile-pic":"AccountInfo__profile-pic",profilePic:"AccountInfo__profile-pic",label:"AccountInfo__label",row:"AccountInfo__row",pre:"AccountInfo__pre",bio:"AccountInfo__bio AccountInfo__pre","link-button":"AccountInfo__link-button",linkButton:"AccountInfo__link-button","edit-bio-link":"AccountInfo__edit-bio-link AccountInfo__link-button",editBioLink:"AccountInfo__edit-bio-link AccountInfo__link-button","bio-editor":"AccountInfo__bio-editor",bioEditor:"AccountInfo__bio-editor","bio-footer":"AccountInfo__bio-footer",bioFooter:"AccountInfo__bio-footer","bio-editing-controls":"AccountInfo__bio-editing-controls",bioEditingControls:"AccountInfo__bio-editing-controls","access-token":"AccountInfo__access-token AccountInfo__pre",accessToken:"AccountInfo__access-token AccountInfo__pre","set-custom-pic":"AccountInfo__set-custom-pic",setCustomPic:"AccountInfo__set-custom-pic","reset-custom-pic":"AccountInfo__reset-custom-pic AccountInfo__link-button",resetCustomPic:"AccountInfo__reset-custom-pic AccountInfo__link-button",subtext:"AccountInfo__subtext","personal-info-message":"AccountInfo__personal-info-message",personalInfoMessage:"AccountInfo__personal-info-message"}},97:function(t,e,n){t.exports={root:"PopupTextField__root layout__flex-row",container:"PopupTextField__container layout__flex-row","edit-container":"PopupTextField__edit-container PopupTextField__container layout__flex-row",editContainer:"PopupTextField__edit-container PopupTextField__container layout__flex-row","static-container":"PopupTextField__static-container PopupTextField__container layout__flex-row",staticContainer:"PopupTextField__static-container PopupTextField__container layout__flex-row","edit-icon":"PopupTextField__edit-icon dashicons__dashicon-normal",editIcon:"PopupTextField__edit-icon dashicons__dashicon-normal",label:"PopupTextField__label","done-btn":"PopupTextField__done-btn",doneBtn:"PopupTextField__done-btn"}},99:function(t,e,n){"use strict";var o=n(82);e.a=new class{constructor(){this.mediaStore=o.a}}}},[[613,0,1,2,3]]])}));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],e):"object"==typeof exports?exports.spotlight=e(require("React"),require("ReactDOM")):t.spotlight=e(t.React,t.ReactDOM)}(window,(function(t,e){return(window.webpackJsonpspotlight=window.webpackJsonpspotlight||[]).push([[9],{0:function(e,n){e.exports=t},10:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(0),a=n.n(o),i=n(11);const r=t=>{var{icon:e,className:n}=t,o=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(t);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]])}return n}(t,["icon","className"]);return a.a.createElement("span",Object.assign({className:Object(i.b)("dashicons","dashicons-"+e,n)},o))}},101:function(t,e,n){"use strict";var o=n(83);e.a=new class{constructor(){this.mediaStore=o.a}}},11:function(t,e,n){"use strict";function o(...t){return t.filter(t=>!!t).join(" ")}function a(t){return o(...Object.getOwnPropertyNames(t).map(e=>t[e]?e:null))}function i(t,e={}){let n=Object.getOwnPropertyNames(e).map(n=>e[n]?t+n:null);return t+" "+n.filter(t=>!!t).join(" ")}n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return i})),n.d(e,"e",(function(){return r})),n.d(e,"d",(function(){return s}));const r={onMouseDown:t=>t.preventDefault()};function s(...t){return e=>{t.forEach(t=>t&&function(t,e){"function"==typeof t?t(e):t.current=e}(t,e))}}},112:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var o=n(0),a=n.n(o),i=n(6),r=n(27),s=n(7);const c=Object(i.b)(({feed:t})=>{const e=r.a.getById(t.options.layout),n=s.a.ComputedOptions.compute(t.options,t.mode);return a.a.createElement("div",{className:"feed"},a.a.createElement(e.component,{feed:t,options:n}))})},113:function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var o=n(0),a=n.n(o),i=n(61),r=n.n(i),s=n(18),c=n(52),l=n.n(c),u=n(38),d=n.n(u),h=n(6),p=n(3),m=n(117),f=Object(h.b)((function({field:t}){const e="settings-field-"+Object(p.u)(),n=!t.label||t.fullWidth;return a.a.createElement("div",{className:d.a.root},t.label&&a.a.createElement("div",{className:d.a.label},a.a.createElement("label",{htmlFor:e},t.label)),a.a.createElement("div",{className:d.a.container},a.a.createElement("div",{className:n?d.a.controlFullWidth:d.a.controlPartialWidth},a.a.createElement(t.component,{id:e})),t.tooltip&&a.a.createElement("div",{className:d.a.tooltip},a.a.createElement(m.a,null,t.tooltip))))}));function g({group:t}){return a.a.createElement("div",{className:l.a.root},t.title&&t.title.length>0&&a.a.createElement("h1",{className:l.a.title},t.title),t.component&&a.a.createElement("div",{className:l.a.content},a.a.createElement(t.component)),t.fields&&a.a.createElement("div",{className:l.a.fieldList},t.fields.map(t=>a.a.createElement(f,{field:t,key:t.id}))))}var b=n(20);function y({page:t}){return Object(b.d)("keydown",t=>{t.key&&"s"===t.key.toLowerCase()&&t.ctrlKey&&(s.b.save(),t.preventDefault(),t.stopPropagation())}),a.a.createElement("article",{className:r.a.root},t.component&&a.a.createElement("div",{className:r.a.content},a.a.createElement(t.component)),t.groups&&a.a.createElement("div",{className:r.a.groupList},t.groups.map(t=>a.a.createElement(g,{key:t.id,group:t}))))}},12:function(t,e,n){"use strict";var o,a=n(8);let i;e.a=i={isPro:!1,config:{restApi:SliCommonL10n.restApi,imagesUrl:SliCommonL10n.imagesUrl,autoPromotions:SliCommonL10n.autoPromotions,globalPromotions:null!==(o=SliCommonL10n.globalPromotions)&&void 0!==o?o:{}},image:t=>`${i.config.imagesUrl}/${t}`},a.a.registerType({id:"link",label:"Link",isValid:()=>!1}),a.a.registerType({id:"-more-",label:"- More promotion types -",isValid:()=>!1}),a.a.Automation.registerType({id:"hashtag",label:"Hashtag",matches:()=>!1})},13:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));const o=t=>"string"==typeof t?t:"r"in t?"rgba("+t.r+","+t.g+","+t.b+","+t.a+")":"h"in t?"hsla("+t.h+","+t.s+","+t.l+","+t.a+")":"#fff"},132:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var o=n(0),a=n.n(o),i=n(99),r=n.n(i),s=n(16);function c({url:t,children:e}){return a.a.createElement("a",{className:r.a.root,href:null!=t?t:s.a.resources.pricingUrl,target:"_blank"},null!=e?e:"Free 14-day PRO trial")}},14:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o,a=n(3);!function(t){function e(t,e){return t.hasOwnProperty(e.toString())}function n(t,e){return t[e.toString()]}function o(t,e,n){return t[e.toString()]=n,t}t.has=e,t.get=n,t.set=o,t.ensure=function(n,a,i){return e(n,a)||o(n,a,i),t.get(n,a)},t.withEntry=function(e,n,o){return t.set(Object(a.h)(e),n,o)},t.remove=function(t,e){return delete t[e.toString()],t},t.without=function(e,n){return t.remove(Object(a.h)(e),n)},t.at=function(t,e){return n(t,Object.keys(t)[e])},t.keys=function(t){return Object.keys(t)},t.values=function(t){return Object.values(t)},t.entries=function(t){return Object.getOwnPropertyNames(t).map(e=>[e,t[e]])},t.map=function(e,n){const o={};return t.forEach(e,(t,e)=>o[t]=n(e,t)),o},t.size=function(e){return t.keys(e).length},t.isEmpty=function(e){return 0===t.size(e)},t.equals=function(t,e){return Object(a.p)(t,e)},t.forEach=function(e,n){t.keys(e).forEach(t=>n(t,e[t]))},t.fromArray=function(e){const n={};return e.forEach(([e,o])=>t.set(n,e,o)),n},t.fromMap=function(e){const n={};return e.forEach((e,o)=>t.set(n,o,e)),n}}(o||(o={}))},141:function(t,e,n){"use strict";function o(t,e){return"url"===e.linkType?e.url:e.postUrl}var a;n.d(e,"a",(function(){return a})),e.b={id:"link",label:"Link",getIcon:()=>"admin-links",getPopupLink:function(t,e){return"string"==typeof e.linkText&&e.linkText.length>0?[e.linkText,e.newTab]:[a.getDefaultLinkText(e),e.newTab]},isValid:function(t){return"string"==typeof t.linkType&&t.linkType.length>0&&("url"===t.linkType&&"string"==typeof t.url&&t.url.length>0||!!t.postId&&"string"==typeof t.postUrl&&t.postUrl.length>0)},getMediaUrl:o,onMediaClick:function(t,e){var n;const a=o(0,e),i=null===(n=e.linkDirectly)||void 0===n||n;return!(!a||!i)&&(window.open(a,e.newTab?"_blank":"_self"),!0)}},function(t){t.getDefaultLinkText=function(t){switch(t.linkType){case"product":return"Buy it now";case"post":return"Read the article";case"page":return"Learn more";default:return"Visit link"}}}(a||(a={}))},145:function(t,e,n){t.exports={"menu-link":"PageMenuNavbar__menu-link",menuLink:"PageMenuNavbar__menu-link","menu-ref":"PageMenuNavbar__menu-ref",menuRef:"PageMenuNavbar__menu-ref","arrow-down":"PageMenuNavbar__arrow-down",arrowDown:"PageMenuNavbar__arrow-down"}},15:function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){let e,n;!function(t){t.IMAGE="IMAGE",t.VIDEO="VIDEO",t.ALBUM="CAROUSEL_ALBUM"}(e=t.Type||(t.Type={})),function(t){let e;!function(t){t.PERSONAL_ACCOUNT="PERSONAL_ACCOUNT",t.BUSINESS_ACCOUNT="BUSINESS_ACCOUNT",t.TAGGED_ACCOUNT="TAGGED_ACCOUNT",t.RECENT_HASHTAG="RECENT_HASHTAG",t.POPULAR_HASHTAG="POPULAR_HASHTAG",t.USER_STORY="USER_STORY"}(e=t.Type||(t.Type={})),t.isOwnMedia=function(t){return t.type===e.PERSONAL_ACCOUNT||t.type===e.BUSINESS_ACCOUNT||t.type===e.USER_STORY}}(n=t.Source||(t.Source={})),t.getAsRows=(t,e)=>{t=t.slice(),e=e>0?e:1;let n=[];for(;t.length;)n.push(t.splice(0,e));if(n.length>0){const t=n.length-1;for(;n[t].length<e;)n[t].push({})}return n},t.isFromHashtag=t=>t.source.type===n.Type.POPULAR_HASHTAG||t.source.type===n.Type.RECENT_HASHTAG}(o||(o={}))},152:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(0),a=n.n(o),i=n(29);function r({breakpoints:t,children:e}){const[n,r]=a.a.useState(null),s=a.a.useCallback(()=>{const e=Object(i.b)();r(()=>t.reduce((t,n)=>e.width<=n&&n<t?n:t,1/0))},[t]);return Object(o.useEffect)(()=>(s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)),[]),null!==n&&e(n)}},153:function(t,e,n){"use strict";var o=n(0),a=n.n(o),i=n(102),r=n(19),s=n.n(r),c=n(41),l=n(4),u=n(5),d=n(10),h=n(114),p=n(26),m=n(21),f=n(30),g=n(91),b=n(60),y=n(16),v=n(67);function _({accounts:t,showDelete:e,onDeleteError:n}){const o=(t=null!=t?t:[]).filter(t=>t.type===l.a.Type.BUSINESS).length,[i,r]=a.a.useState(!1),[_,E]=a.a.useState(null),[w,O]=a.a.useState(!1),[S,k]=a.a.useState(),[C,P]=a.a.useState(!1),T=t=>()=>{E(t),r(!0)},A=t=>()=>{f.a.openAuthWindow(t.type,0,()=>{y.a.restApi.deleteAccountMedia(t.id)})},B=t=>()=>{k(t),O(!0)},M=()=>{P(!1),k(null),O(!1)},L={cols:{username:s.a.usernameCol,type:s.a.typeCol,usages:s.a.usagesCol,actions:s.a.actionsCol},cells:{username:s.a.usernameCell,type:s.a.typeCell,usages:s.a.usagesCell,actions:s.a.actionsCell}};return a.a.createElement("div",{className:"accounts-list"},a.a.createElement(h.a,{styleMap:L,rows:t,cols:[{id:"username",label:"Username",render:t=>a.a.createElement("div",null,a.a.createElement(b.a,{account:t,className:s.a.profilePic}),a.a.createElement("a",{className:s.a.username,onClick:T(t)},t.username))},{id:"type",label:"Type",render:t=>a.a.createElement("span",{className:s.a.accountType},t.type)},{id:"usages",label:"Feeds",render:t=>a.a.createElement("span",{className:s.a.usages},t.usages.map((t,e)=>!!p.a.getById(t)&&a.a.createElement(c.a,{key:e,to:m.a.at({screen:"edit",id:t.toString()})},p.a.getById(t).name)))},{id:"actions",label:"Actions",render:t=>e&&a.a.createElement("div",{className:s.a.actionsList},a.a.createElement(u.a,{className:s.a.action,type:u.c.SECONDARY,tooltip:"Account info",onClick:T(t)},a.a.createElement(d.a,{icon:"info"})),a.a.createElement(u.a,{className:s.a.action,type:u.c.SECONDARY,tooltip:"Reconnect account",onClick:A(t)},a.a.createElement(d.a,{icon:"update"})),a.a.createElement(u.a,{className:s.a.actions,type:u.c.DANGER,tooltip:"Remove account",onClick:B(t)},a.a.createElement(d.a,{icon:"trash"})))}]}),a.a.createElement(g.a,{isOpen:i,onClose:()=>r(!1),account:_}),a.a.createElement(v.a,{isOpen:w,title:"Are you sure?",buttons:[C?"Please wait ...":"Yes I'm sure","Cancel"],okDisabled:C,cancelDisabled:C,onAccept:()=>{P(!0),f.a.deleteAccount(S.id).then(()=>M()).catch(()=>{n&&n("An error occurred while trying to remove the account."),M()})},onCancel:M},a.a.createElement("p",null,"Are you sure you want to delete"," ",a.a.createElement("span",{style:{fontWeight:"bold"}},S?S.username:""),"?"," ","This will also delete all saved media associated with this account."),S&&S.type===l.a.Type.BUSINESS&&1===o&&a.a.createElement("p",null,a.a.createElement("b",null,"Note:")," ",a.a.createElement("span",null,"Because this is your only connected Business account, deleting it will"," ","also cause any feeds that show public hashtag posts to no longer work."))))}var E=n(23),w=n(6),O=n(116),S=n(78),k=n.n(S);e.a=Object(w.b)((function(){const[,t]=a.a.useState(0),[e,n]=a.a.useState(""),o=a.a.useCallback(()=>t(t=>t++),[]);return l.b.hasAccounts()?a.a.createElement("div",{className:k.a.root},e.length>0&&a.a.createElement(E.a,{type:E.b.ERROR,showIcon:!0,isDismissible:!0,onDismiss:()=>n("")},e),a.a.createElement("div",{className:k.a.connectBtn},a.a.createElement(i.a,{onConnect:o})),a.a.createElement(_,{accounts:l.b.list,showDelete:!0,onDeleteError:n})):a.a.createElement(O.a,null)}))},154:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o=n(0),a=n.n(o),i=n(88),r=n.n(i),s=n(66),c=n(20);function l({children:{path:t,tabs:e,right:n},current:o,onClickTab:i}){return a.a.createElement(s.b,{pathStyle:"chevron"},{path:t,right:n,left:e.map(t=>{return a.a.createElement(u,{tab:t,key:t.key,isCurrent:t.key===o,onClick:(e=t.key,()=>i&&i(e))});var e})})}function u({tab:t,isCurrent:e,onClick:n}){return a.a.createElement("a",{key:t.key,role:"button",tabIndex:0,className:t.disabled?r.a.disabled:e?r.a.current:r.a.tab,onClick:n,onKeyDown:Object(c.f)(n)},a.a.createElement("span",{className:r.a.label},t.label))}},155:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o=n(0),a=n.n(o),i=n(42),r=n(20);function s({when:t,message:e}){return Object(r.k)(e,t),a.a.createElement(i.a,{when:t,message:e})}},17:function(t,e,n){"use strict";var o=n(33),a=n.n(o),i=n(12),r=n(34);const s=i.a.config.restApi.baseUrl,c={};i.a.config.restApi.authToken&&(c["X-Sli-Auth-Token"]=i.a.config.restApi.authToken);const l=a.a.create({baseURL:s,headers:c}),u={config:Object.assign(Object.assign({},i.a.config.restApi),{forceImports:!1}),driver:l,getAccounts:()=>l.get("/accounts"),getFeeds:()=>l.get("/feeds"),getFeedMedia:(t,e=0,n=0,o)=>{const i=o?new a.a.CancelToken(o):void 0;return new Promise((o,a)=>{const r=t=>{o(t),document.dispatchEvent(new Event(u.events.onGetFeedMedia))};l.post("/media/feed",{options:t,num:n,from:e},{cancelToken:i}).then(o=>{o.data.needImport?(e>0||u.config.forceImports)&&u.importMedia(t).then(()=>{l.post("/media/feed",{options:t,num:n,from:e},{cancelToken:i}).then(r).catch(a)}).catch(a):r(o)}).catch(a)})},getMedia:(t=0,e=0)=>l.get(`/media?num=${t}&offset=${e}`),importMedia:t=>new Promise((e,n)=>{document.dispatchEvent(new Event(u.events.onImportStart));const o=t=>{document.dispatchEvent(new Event(u.events.onImportFail)),n(t)};l.post("/media/import",{options:t}).then(t=>{t.data.success?(document.dispatchEvent(new Event(u.events.onImportEnd)),e(t)):o(t)}).catch(o)}),getErrorReason:t=>{let e;return"object"==typeof t.response&&(t=t.response.data),e="string"==typeof t.message?t.message:t.toString(),Object(r.b)(e)},events:{onGetFeedMedia:"sli/api/media/feed",onImportStart:"sli/api/import/start",onImportEnd:"sli/api/import/end",onImportFail:"sli/api/import/fail"}};e.a=u},173:function(t,e,n){t.exports={"arrow-link":"WizardNavbar__arrow-link",arrowLink:"WizardNavbar__arrow-link","prev-link":"WizardNavbar__prev-link WizardNavbar__arrow-link",prevLink:"WizardNavbar__prev-link WizardNavbar__arrow-link","next-link":"WizardNavbar__next-link WizardNavbar__arrow-link",nextLink:"WizardNavbar__next-link WizardNavbar__arrow-link"}},174:function(t,e,n){t.exports={message:"FeedNamePrompt__message",input:"FeedNamePrompt__input"}},19:function(t,e,n){t.exports={"username-col":"AccountsList__username-col",usernameCol:"AccountsList__username-col","actions-col":"AccountsList__actions-col",actionsCol:"AccountsList__actions-col","username-cell":"AccountsList__username-cell",usernameCell:"AccountsList__username-cell",username:"AccountsList__username","profile-pic":"AccountsList__profile-pic",profilePic:"AccountsList__profile-pic","account-type":"AccountsList__account-type",accountType:"AccountsList__account-type",usages:"AccountsList__usages","actions-list":"AccountsList__actions-list layout__flex-row",actionsList:"AccountsList__actions-list layout__flex-row",action:"AccountsList__action","usages-cell":"AccountsList__usages-cell",usagesCell:"AccountsList__usages-cell","usages-col":"AccountsList__usages-col",usagesCol:"AccountsList__usages-col","type-cell":"AccountsList__type-cell",typeCell:"AccountsList__type-cell","type-col":"AccountsList__type-col",typeCol:"AccountsList__type-col"}},2:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o,a=n(1),i=function(t,e,n,o){var a,i=arguments.length,r=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(r=(i<3?a(r):i>3?a(e,n,r):a(e,n))||r);return i>3&&r&&Object.defineProperty(e,n,r),r};!function(t){class e{constructor(t,e,n){this.prop=t,this.name=e,this.icon=n}}e.DESKTOP=new e("desktop","Desktop","desktop"),e.TABLET=new e("tablet","Tablet","tablet"),e.PHONE=new e("phone","Phone","smartphone"),t.Mode=e,t.MODES=[e.DESKTOP,e.TABLET,e.PHONE];class n{constructor(t,e,n){this.desktop=t,this.tablet=e,this.phone=n}get(t,e){return o(this,t,e)}set(t,e){r(this,e,t)}with(t,e){const o=s(this,e,t);return new n(o.desktop,o.tablet,o.phone)}}function o(t,e,n=!1){if(!t)return;const o=t[e.prop];return n&&null==o?t.desktop:o}function r(t,e,n){return t[n.prop]=e,t}function s(t,e,o){return r(new n(t.desktop,t.tablet,t.phone),e,o)}i([a.n],n.prototype,"desktop",void 0),i([a.n],n.prototype,"tablet",void 0),i([a.n],n.prototype,"phone",void 0),t.Value=n,t.getName=function(t){return t.name},t.getIcon=function(t){return t.icon},t.cycle=function(n){const o=t.MODES.findIndex(t=>t===n);return void 0===o?e.DESKTOP:t.MODES[(o+1)%t.MODES.length]},t.get=o,t.set=r,t.withValue=s,t.normalize=function(t,e){return null==t?e.hasOwnProperty("all")?new n(e.all,e.all,e.all):new n(e.desktop,e.tablet,e.phone):"object"==typeof t&&t.hasOwnProperty("desktop")?new n(t.desktop,t.tablet,t.phone):new n(t,t,t)},t.getModeForWindowSize=function(t){return t.width<=768?e.PHONE:t.width<=935?e.TABLET:e.DESKTOP},t.isValid=function(t){return"object"==typeof t&&t.hasOwnProperty("desktop")}}(o||(o={}))},20:function(t,e,n){"use strict";n.d(e,"i",(function(){return s})),n.d(e,"e",(function(){return c})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return u})),n.d(e,"a",(function(){return d})),n.d(e,"m",(function(){return h})),n.d(e,"g",(function(){return p})),n.d(e,"k",(function(){return m})),n.d(e,"j",(function(){return f})),n.d(e,"d",(function(){return b})),n.d(e,"l",(function(){return y})),n.d(e,"f",(function(){return v})),n.d(e,"h",(function(){return _}));var o=n(0),a=n.n(o),i=n(42),r=n(29);function s(t,e){!function(t,e,n){const o=a.a.useRef(!0);t(()=>{o.current=!0;const t=e(()=>new Promise(t=>{o.current&&t()}));return()=>{o.current=!1,t&&t()}},n)}(o.useEffect,t,e)}function c(t){const[e,n]=a.a.useState(t),o=a.a.useRef(e);return[e,()=>o.current,t=>n(o.current=t)]}function l(t,e,n=[]){function a(o){!t.current||t.current.contains(o.target)||n.some(t=>t&&t.current&&t.current.contains(o.target))||e(o)}Object(o.useEffect)(()=>(document.addEventListener("mousedown",a),document.addEventListener("touchend",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchend",a)}))}function u(t,e){Object(o.useEffect)(()=>{const n=()=>{0===t.filter(t=>!t.current||document.activeElement===t.current||t.current.contains(document.activeElement)).length&&e()};return document.addEventListener("keyup",n),()=>document.removeEventListener("keyup",n)},t)}function d(t,e,n=100){const[i,r]=a.a.useState(t);return Object(o.useEffect)(()=>{let o=null;return t===e?o=setTimeout(()=>r(e),n):r(!e),()=>{null!==o&&clearTimeout(o)}},[t]),[i,r]}function h(t){const[e,n]=a.a.useState(Object(r.b)()),i=()=>{const e=Object(r.b)();n(e),t&&t(e)};return Object(o.useEffect)(()=>(i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)),[]),e}function p(){return new URLSearchParams(Object(i.e)().search)}function m(t,e){const n=n=>{if(e)return(n||window.event).returnValue=t,t};Object(o.useEffect)(()=>(window.addEventLis