MailPoet Newsletters (New) - Version 3.47.0

Version Description

  • 2020-05-19 =
  • Fixed: showing two columns in popup form side by side;
  • Fixed: custom form input padding.
Download this release

Release Info

Developer wysija
Plugin Icon 128x128 MailPoet Newsletters (New)
Version 3.47.0
Comparing to
See all releases

Code changes from version 3.46.14 to 3.47.0

assets/dist/css/{mailpoet-form-editor.adaee8e1.css → mailpoet-form-editor.ec3ed03e.css} RENAMED
@@ -1,4 +1,5 @@
1
  @charset "UTF-8";
 
2
  /** Colors */
3
  /** Breakpoints & Media Queries */
4
  /** Colors */
@@ -5894,6 +5895,8 @@ span.CodeMirror-selectedtext { background: none; }
5894
 
5895
  .CodeMirror { border: 1px solid #eee; }
5896
 
 
 
5897
  .form-placement-option-list { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-around; margin: 0 -8px; }
5898
 
5899
  .form-placement-option { background-color: #fff; border: solid 1px #e5e9f8; border-radius: 4px; box-shadow: 0 1px 2px 0 #e5e9f8; cursor: pointer; display: flex; flex-direction: column; height: 142px; justify-content: space-between; margin-bottom: 16px; padding: 6px; pointer-events: auto; position: relative; text-align: center; width: 116px; }
@@ -5972,6 +5975,14 @@ h2 { font-size: 1.7em; }
5972
 
5973
  .block-list-appender .block-editor-inserter { margin: 0 auto; max-width: 580px; }
5974
 
 
 
 
 
 
 
 
 
5975
  .mailpoet_custom_select .mailpoet_select { padding: 0 24px 0 8px; }
5976
 
5977
  .edit-post-visual-editor .mailpoet_custom_date select, .edit-post-visual-editor .mailpoet_custom_field_add_form select, .mailpoet_form_editor_sidebar select { padding: 0 24px 0 8px; }
1
  @charset "UTF-8";
2
+ /* default Select2 placeholder color for single dropdown */
3
  /** Colors */
4
  /** Breakpoints & Media Queries */
5
  /** Colors */
5895
 
5896
  .CodeMirror { border: 1px solid #eee; }
5897
 
5898
+ .CodeMirror textarea { font-size: 12px; }
5899
+
5900
  .form-placement-option-list { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-around; margin: 0 -8px; }
5901
 
5902
  .form-placement-option { background-color: #fff; border: solid 1px #e5e9f8; border-radius: 4px; box-shadow: 0 1px 2px 0 #e5e9f8; cursor: pointer; display: flex; flex-direction: column; height: 142px; justify-content: space-between; margin-bottom: 16px; padding: 6px; pointer-events: auto; position: relative; text-align: center; width: 116px; }
5975
 
5976
  .block-list-appender .block-editor-inserter { margin: 0 auto; max-width: 580px; }
5977
 
5978
+ .mailpoet-form-background > div > .block-editor-block-list__layout > .block-editor-block-list__block:first-child { margin-top: 0; }
5979
+
5980
+ .block-editor-block-list__layout .mailpoet_text { min-height: 0; }
5981
+
5982
+ .block-editor-block-list__layout .mailpoet_paragraph .mailpoet_text, .block-editor-block-list__layout .mailpoet_paragraph .mailpoet_submit { font-size: 1em; line-height: 1.5; }
5983
+
5984
+ .block-editor-block-list__layout .mailpoet_paragraph .mailpoet_text_label { font-size: 1em; line-height: 1.2; }
5985
+
5986
  .mailpoet_custom_select .mailpoet_select { padding: 0 24px 0 8px; }
5987
 
5988
  .edit-post-visual-editor .mailpoet_custom_date select, .edit-post-visual-editor .mailpoet_custom_field_add_form select, .mailpoet_form_editor_sidebar select { padding: 0 24px 0 8px; }
assets/dist/css/{mailpoet-plugin.f63ede85.css → mailpoet-plugin.eef47a13.css} RENAMED
@@ -1,85 +1,5 @@
1
  @charset "UTF-8";
2
  /* default Select2 placeholder color for single dropdown */
3
- .mailpoet-button { align-items: center; background: #ff5301; border: 0; border-radius: 4px; box-sizing: border-box; color: #fff; cursor: pointer; display: inline-flex; font-size: 16px; font-weight: bold; justify-content: center; line-height: 24px; max-width: 100%; min-height: 40px; padding: 8px 20px; position: relative; text-align: center; text-decoration: none; }
4
-
5
- .mailpoet-button:hover, .mailpoet-button:focus { background: #cd4200; color: #fff; text-decoration: none; }
6
-
7
- .mailpoet-button svg { fill: currentColor; height: 16px; width: 16px; }
8
-
9
- .mailpoet-button svg:first-child { margin-right: 6px; }
10
-
11
- .mailpoet-button svg:last-child { margin-left: 6px; }
12
-
13
- .mailpoet-button svg:only-child { margin-left: 0; margin-right: 0; }
14
-
15
- .mailpoet-button.mailpoet-full-width + .mailpoet-button.mailpoet-full-width { margin-top: 16px; }
16
-
17
- .mailpoet-button:not(.mailpoet-full-width) + .mailpoet-button:not(.mailpoet-full-width) { margin-left: 16px; }
18
-
19
- .mailpoet-button-small { font-size: 14px; line-height: 20px; min-height: 32px; padding: 6px 12px; }
20
-
21
- .mailpoet-button-small svg { height: 12px; width: 12px; }
22
-
23
- .mailpoet-button-large { min-height: 48px; padding: 12px 24px; }
24
-
25
- .mailpoet-button-light { background: #ffe0d0; color: #ff5301; }
26
-
27
- .mailpoet-button-light:hover, .mailpoet-button-light:focus { background: #ffbe9d; color: #ff5301; }
28
-
29
- .mailpoet-button-light.mailpoet-button-with-spinner:after { background-color: rgba(255, 224, 208, 0.8); }
30
-
31
- .mailpoet-button-dark { background: #071c6d; }
32
-
33
- .mailpoet-button-dark:hover, .mailpoet-button-dark:focus { background: #04103d; }
34
-
35
- .mailpoet-button-dark.mailpoet-button-with-spinner:after { background-color: rgba(7, 28, 109, 0.8); }
36
-
37
- .mailpoet-button-link { background: transparent; color: #ff5301; text-decoration: underline; }
38
-
39
- .mailpoet-button-link:hover, .mailpoet-button-link:focus { background: transparent; color: #cd4200; text-decoration: none; }
40
-
41
- .mailpoet-button-link.mailpoet-button-with-spinner:after { background-color: rgba(255, 255, 255, 0.8); }
42
-
43
- .mailpoet-button-link-dark { background: transparent; color: #071c6d; text-decoration: underline; }
44
-
45
- .mailpoet-button-link-dark:hover, .mailpoet-button-link-dark:focus { background: transparent; color: #04103d; text-decoration: none; }
46
-
47
- .mailpoet-button-link-dark.mailpoet-button-with-spinner:after { background-color: rgba(255, 255, 255, 0.8); }
48
-
49
- .mailpoet-button-disabled { opacity: .4; pointer-events: none; touch-action: none; }
50
-
51
- .mailpoet-button-with-spinner { pointer-events: none; touch-action: none; }
52
-
53
- .mailpoet-button-with-spinner:after { background: rgba(255, 83, 1, 0.8) no-repeat center; background-size: 24px 24px; border-radius: 4px; content: ''; height: 100%; left: 0; position: absolute; top: 0; width: 100%; }
54
-
55
- .mailpoet-button-with-spinner:after { background-image: url("data:image/gif;base64,R0lGODlhIAAgAPUxAP53Nv6LVP6lev69nv7Ksv7UwP7Ntv7EqP6yjv6ecP6SXv65mP5zMP7czP7Yxv7RvP6viv6OWP6IUP6XZv7GrP6rhP7p4P7o3v7r4v7v6P6ARP5sJv56Ov5lHP5fEv5jGP5YCP5UAv7dzv6HTv7h1P7Aov6aav7n3P7ayv62lP6pgP6UYv6idv7x7P5cDv6ESv5wLP5pIv7k2P5+QP77+v////739P9TAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBwAxACwAAAAAIAAgAEAG/8CYcEiUCA4NUqZBbDpjChGJJJORBM9stsAtPEzasFZQKg0WC8RKHAOF2CbSyUKnZ+4ZA3s4aDRQKHp7bAkGBIYHCoOLMQEVCBAVAgImKwojGhwMGx0fHh4gIGwBAycYeHctD4wxEg8yJzIXswVgrEIBKCINuxS3T10FDiy/TwcGyAYqxU8QBAcHZgnMThED15AVKgmXMwwwG5yeoW8x5WEjJgIsCSYKl5nfnB6MCgcWLS2pGcUKBXV2UN1S0ODEnAt2HAyAkGAaoxRUqsCCQC3GAhFSplCsKIAXCj+2KhJwQNIBgopDgj2YgFKIgQfJHKJEkIzAgJaNCOiEdrJlBERo0a4p2nPuyYgFZtAgqJDgRRYPLtywUZAiTaR1JiZEwARgUweo5EIUdZLuasMJCgK8mNFV3CdWGgIosKRAggZvG8QEAQAh+QQJBwA2ACwAAAAAGQAgAAAG/0CbcEiUCEoOUSaDchwqxOhQcZBZLMtspnWREgML2eWCuVowWVrCK1Q8ZKeT+Ype1iLsiUMGP43pdRknbAoOJCR8cBcFCxAJCRADBl4SBiIih4gGJmxeCA2XoCIQnV6FoCgNKCylXikosKlQrVEBDre3B7RSLAW+BQ4Tu1ELvwW6w0QHBg/NpMlDBtLSa9BCBNMGwtY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ZRAUynQugRA0yqSSApkIkryQimK0ssSINIgm0LA63DQ2srQYixCiHgSFEIQO/KA4UkSHSLNICDSgF2ROBIN3SISABBQ7ZBSWBHh7d3UIp5NkGwVkfH+npLkXZDwb8s1gbG2J0oFdvCIQC/PgR0BWFAQAGMALG+EAkAIWEBggcQGAkCQcNGjhwYABxAxIFBDJmPFBiAAITKwJIiBBBgYIAI0CKZGASyQpXCgQIUDhwYMCCFAgqqBCQwMQEBRFGvNAwg8GTCAM0shxgFAGECgKYwoQqQYNVKBIqEC3aNenSpk4VvOAQJkKFEi0XINgLVmyEGYFGTBDwdW/YCQE0QAkCACH5BAUHADYALAAAAAAfACAAAAb/QJtwSJQIVMSkcklUUDKtGnO6DAwy2FaGyhUqHNgwbdCdmkhYTLhlKC8VJAzGYgmjDu6kpGCZ9zMFJnlKCxcXFocXCINKCjInhhcnAoxKA48nkBCVSREkMo8ybZxEAp+gMoKkQyUkriQPq0QGIiINDYuyQg62t5S6Nii2KCiquigNKA4OCcA2BcvQv7oEBdYFm8AL1wV4wAIFDw8GBhPAAePkBguVIUoI6gQEzXkgIe5EEQQG8hQH5mVcgLDn7p6QCvwIHDgwgB6VDx4EEsRnQ8IAAv4YDqgQgcmGDTEgehgIIomChQsHLEiBgIWCABo0zOAwAwCDDR1EjlSyYkCJVRIqF0CooIKFiQkRRrzgYBNkTg9MAqQAOoBlBQECEkxQkFQDBwY3Q1IZIUAlAgRDsx59+cIrBxgxygQQcBbBVaMTViiQsBQGoxEKEghgkXXrCA1UggAAOw=="); }
56
-
57
- .mailpoet-button-with-spinner.mailpoet-button-light:after { background-image: url("data:image/gif;base64,R0lGODlhIAAgAPUxAP7Bo/6wi/6bbP6HTv59Pv50Mv56Ov6BRv6QW/6hdP6rg/6KU/7EqP5uKP5xLf53Nv6TXv6uh/6zjv6nfP6AQ/6WY/5jGP5kGv5hFv5eEv66mP7KsP6+oP7Quf7Vwf7RvP7ayf7ezv5tJ/60kP5qIv6FS/6kef5kG/5vKv6NVv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QqQYNVKBIqEC3aNenSpk4VvOAQJkKFEi0XINgLVmyEGYFGTBDwdW/YCQE0QAkCACH5BAUHADYALAAAAAAfACAAAAb/QJtwSJQIVMSkcklUUDKtGnO6DAwy2FaGyhUqHNgwbdCdmkhYTLhlKC8VJAzGYgmjDu6kpGCZ9zMFJnlKCxcXFocXCINKCjInhhcnAoxKA48nkBCVSREkMo8ybZxEAp+gMoKkQyUkriQPq0QGIiINDYuyQg62t5S6Nii2KCiquigNKA4OCcA2BcvQv7oEBdYFm8AL1wV4wAIFDw8GBhPAAePkBguVIUoI6gQEzXkgIe5EEQQG8hQH5mVcgLDn7p6QCvwIHDgwgB6VDx4EEsRnQ8IAAv4YDqgQgcmGDTEgehgIIomChQsHLEiBgIWCABo0zOAwAwCDDR1EjlSyYkCJVRIqF0CooIKFiQkRRrzgYBNkTg9MAqQAOoBlBQECEkxQkFQDBwY3Q1IZIUAlAgRDsx59+cIrBxgxygQQcBbBVaMTViiQsBQGoxEKEghgkXXrCA1UggAAOw=="); }
58
-
59
- .mailpoet-button-with-spinner.mailpoet-button-dark:after { background-image: url("data:image/gif;base64,R0lGODlhIAAgAPUxADtMi1hmnH2IsqCox7S60sHG2re91KqxzJGavnN/rGJvopqjwzVGiM3R4cfM3r3D2I2Wu1xqn1Rjmmp2p661z4eRuODj7N7h6+Ll7ujq8UlYkys9gj9PjiI0fBgsdx4xeg4jcQgdbs/T4lJhmdXY5qSsyW56qdzf6svP4JafwYONtmZzpHmEsOzt8xQodE5dlzFDhig6gNnc6EVUkfr6+/////T1+AccbQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBwAxACwAAAAAIAAgAEAG/8CYcEiUCA4NUqZBbDpjChGJJJORBM9stsAtPEzasFZQKg0WC8RKHAOF2CbSyUKnZ+4ZA3s4aDRQKHp7bAkGBIYHCoOLMQEVCBAVAgImKwojGhwMGx0fHh4gIGwBAycYeHctD4wxEg8yJzIXswVgrEIB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Dw8GBhPAAePkBguVIUoI6gQEzXkgIe5EEQQG8hQH5mVcgLDn7p6QCvwIHDgwgB6VDx4EEsRnQ8IAAv4YDqgQgcmGDTEgehgIIomChQsHLEiBgIWCABo0zOAwAwCDDR1EjlSyYkCJVRIqF0CooIKFiQkRRrzgYBNkTg9MAqQAOoBlBQECEkxQkFQDBwY3Q1IZIUAlAgRDsx59+cIrBxgxygQQcBbBVaMTViiQsBQGoxEKEghgkXXrCA1UggAAOw=="); }
60
-
61
- .mailpoet-button-with-spinner.mailpoet-button-link:after { background-image: url("data:image/gif;base64,R0lGODlhIAAgAPUxAP7ZyP7Fqv6rhP6TYP6GTP58Pv6DSP6MVv6ecP6yjv6+oP6XZv7dzv50Mv54OP5/Qv6hdP7Cpv7Irv65mP6KUv6lev5nHv5oIP5lHP5hFv7Quv7k2P7WxP7r4v7x7P7t5v749v78/P5zMP7JsP5vKv6QXP62lP5pIv52NP6aav6nfv68nP6uiP5fEv708P7MtP7g0v7n3P5sJv7Svv5VBP9TAf5ZCv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBwAxACwAAAAAIAAgAEAG/8CYcEiUCA4NUqZBbDpjChGJJJORBM9stsAtPEzasFZQKg0WC8RKHAOF2CbSyUKnZ+4ZA3s4aDRQKHp7bAkGBIYHCoOLMQEVCBAVAgImKwojGhwMGx0fHh4gIGwBAycYeHctD4wxEg8yJzIXswVgrEIBKCINuxS3T10FDiy/TwcGyAYqxU8QBAcHZgnMThED15AVKgmXMwwwG5yeoW8x5WEjJgIsCSYKl5nfnB6MCgcWLS2pGcUKBXV2UN1S0ODEnAt2HAyAkGAaoxRUqsCCQC3GAhFSplCsKIAXCj+2KhJwQNIBgopDgj2YgFKIgQfJHKJEkIzAgJaNCOiEdrJlBERo0a4p2nPuyYgFZtAgqJDgRRYPLtywUZAiTaR1JiZEwARgUweo5EIUdZLuasMJCgK8mNFV3CdWGgIosKRAggZvG8QEAQAh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AAAAAIAAgAAAG/0CAcEgsGo9I4iLJZAowuKa0uHicTqXpNLPBnnATLXOxKZnNUfFx8jCPzgb1kfAOhcwJuZE8GtlDA3pGGCF+hXmCRBIbIiEiIgeJRR4iGo8iGZJECBudGnGaQwYangyhQw4aqheBpwAXsBcVma6yFQ4VCq4AD7cODq2nBxXEDYh6NEQ0BL8NDx+JNNIA0gMODQbZHXoz3dI0MwIGD9kGGHowMN3dQhTk2QfBUzEx6ekyQgvZEAf9tFIsWNR4Qa/ekAgG+vUroKuJihYqVgisEYOIgA8KDxRAkGDJERcmTLhwoSIiiz0FNGpEgIFAggwkBEyQIGHBAgEWQo5UcdIIiVcPBQp8QICAAAMKCUB4GKAgQ4cFEiygMJFCRRIJBDayJGA0QQQQA5jChDrBhFUmE0AQLdo16dKmThegcKFFAggMLRkk2AtWrIQUeix0GPB1b9gOAkwwCQIAIfkECQcAAAAsAAAAACAAIAAABv9AgHBInAw8xKRymVx8Sqcbc8oUEErYU4nKHS4e2LCN0KVmLthR+HQoMxeX0SgUCjcQbuXEEJr3SwYZeUsMIiIhhyIJg0sLGhuGIhsDjEsEjxuQEZVKEhcajxptnEkDn6AagqREGBeuFxCrSQcVFQ4Oi7JDD7a3lLpCDbYNDarADQ4NDw8KwEIGy9C/wAUG1gabzgzXBnjOAwYQEAcHHc4C4+QHDJU0SwnqBQXNeTM07kkSBQfyHwjmZWTMsOfu3hAQ/AogQECAHpUYMAQSxCdkAoEC/hgSACGBCQsWNSDCGDhDyYKFCwkwoJCAwwIBJkykcJGihQoWL0SOXEKCAAZVDCoZRADhgUOGDhIsoHBhE2ROGFMEUABKgCWIAQMUdFiQ1IQLFTdDcrEwQGWCBEOzHn2JwquLFTXcCBhwNsFVox1ILJiwdEUlCwsUDOCQdasFE1yCAAA7AAAAAAAAAAAA"); }
64
-
65
- .mailpoet-full-width { width: 100%; }
66
-
67
- a { text-decoration: underline; }
68
-
69
- a:hover, a:focus { text-decoration: none; }
70
-
71
- h1, h2, h3, h4, h5 { color: #071c6d; font-weight: bold; line-height: 1.25; margin: 0 0 16px 0; }
72
-
73
- h1 { font-size: 32px; }
74
-
75
- h2 { font-size: 28px; }
76
-
77
- h3 { font-size: 24px; }
78
-
79
- h4 { font-size: 20px; }
80
-
81
- h5 { font-size: 16px; }
82
-
83
  .select2-container { box-sizing: border-box; display: inline-block; margin: 0; position: relative; vertical-align: middle; }
84
 
85
  .select2-container .select2-selection--single { box-sizing: border-box; cursor: pointer; display: block; height: 28px; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-user-select: none; }
@@ -871,6 +791,269 @@ h5 { font-size: 16px; }
871
 
872
  .wp-admin td .ui-state-active, .wp-admin td .ui-state-hover { background: #2e3641; }
873
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
874
  input.parsley-success, select.parsley-success, textarea.parsley-success { background-color: #dff0d8; border: 1px solid #d6e9c6; color: #468847; }
875
 
876
  input.parsley-error, select.parsley-error, textarea.parsley-error { background-color: #f2dede; border: 1px solid #eed3d7; color: #b94a48; }
@@ -917,8 +1100,6 @@ div.events-conditions-container input { border: 1px solid #aaa; border-radius: 4
917
 
918
  .form-field-row-filters div { margin-bottom: 10px; }
919
 
920
- .button.stats-create-segment { margin-top: 3px; }
921
-
922
  .clearfix:after { clear: both; content: ''; display: table; }
923
 
924
  .relative-holder { position: relative; }
@@ -1052,7 +1233,7 @@ body.mailpoet_modal_opened { overflow: hidden; }
1052
 
1053
  .mailpoet-modal-header h1 { line-height: 1; margin: 0; }
1054
 
1055
- .mailpoet-modal-header .mailpoet-modal-close { border: 0; cursor: pointer; height: 24px; padding: 6px; position: relative; right: -6px; top: -6px; width: 24px; }
1056
 
1057
  .mailpoet-modal-header .mailpoet-modal-close svg { opacity: .5; stroke: #979797; }
1058
 
@@ -1218,7 +1399,7 @@ ul.mailpoet_boxes { display: flex; flex-wrap: wrap; }
1218
 
1219
  .mailpoet_breadcrumb a { color: #071c6d; text-decoration: none; }
1220
 
1221
- .mailpoet_breadcrumb a:hover { color: #020a25; }
1222
 
1223
  .mailpoet_form { margin: 0 0 20px; }
1224
 
1
  @charset "UTF-8";
2
  /* default Select2 placeholder color for single dropdown */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  .select2-container { box-sizing: border-box; display: inline-block; margin: 0; position: relative; vertical-align: middle; }
4
 
5
  .select2-container .select2-selection--single { box-sizing: border-box; cursor: pointer; display: block; height: 28px; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-user-select: none; }
791
 
792
  .wp-admin td .ui-state-active, .wp-admin td .ui-state-hover { background: #2e3641; }
793
 
794
+ a { text-decoration: underline; }
795
+
796
+ a:hover, a:focus { text-decoration: none; }
797
+
798
+ h1, h2, h3, h4, h5 { color: #071c6d; font-weight: bold; line-height: 1.25; margin: 0 0 16px 0; }
799
+
800
+ h1 { font-size: 32px; }
801
+
802
+ h2 { font-size: 28px; }
803
+
804
+ h3 { font-size: 24px; }
805
+
806
+ h4 { font-size: 20px; }
807
+
808
+ h5 { font-size: 16px; }
809
+
810
+ .mailpoet-button { align-items: center; background: #ff5301; border: 0; border-radius: 4px; box-sizing: border-box; color: #fff; cursor: pointer; display: inline-flex; font-size: 16px; font-weight: bold; justify-content: center; line-height: 24px; max-width: 100%; min-height: 40px; padding: 8px 20px; position: relative; text-align: center; text-decoration: none; vertical-align: top; }
811
+
812
+ .mailpoet-button:hover, .mailpoet-button:focus { background: #cd4200; color: #fff; text-decoration: none; }
813
+
814
+ .mailpoet-button svg { fill: currentColor; height: 16px; width: 16px; }
815
+
816
+ .mailpoet-button svg:first-child { margin-right: 6px; }
817
+
818
+ .mailpoet-button svg:last-child { margin-left: 6px; }
819
+
820
+ .mailpoet-button svg:only-child { margin-left: 0; margin-right: 0; }
821
+
822
+ .mailpoet-button.mailpoet-full-width + .mailpoet-button.mailpoet-full-width { margin-top: 16px; }
823
+
824
+ .mailpoet-button:not(.mailpoet-full-width) + .mailpoet-button:not(.mailpoet-full-width) { margin-left: 16px; }
825
+
826
+ .mailpoet-button-small { font-size: 14px; line-height: 20px; min-height: 32px; padding: 6px 12px; }
827
+
828
+ .mailpoet-button-small svg { height: 12px; width: 12px; }
829
+
830
+ .mailpoet-button-large { min-height: 48px; padding: 12px 24px; }
831
+
832
+ .mailpoet-button-light { background: #ffe0d0; color: #ff5301; }
833
+
834
+ .mailpoet-button-light:hover, .mailpoet-button-light:focus { background: #ffbe9d; color: #ff5301; }
835
+
836
+ .mailpoet-button-light.mailpoet-button-with-spinner:after { background-color: rgba(255, 224, 208, 0.8); }
837
+
838
+ .mailpoet-button-dark { background: #071c6d; }
839
+
840
+ .mailpoet-button-dark:hover, .mailpoet-button-dark:focus { background: #04103d; }
841
+
842
+ .mailpoet-button-dark.mailpoet-button-with-spinner:after { background-color: rgba(7, 28, 109, 0.8); }
843
+
844
+ .mailpoet-button-link { background: transparent; color: #ff5301; text-decoration: underline; }
845
+
846
+ .mailpoet-button-link:hover, .mailpoet-button-link:focus { background: transparent; color: #cd4200; text-decoration: none; }
847
+
848
+ .mailpoet-button-link.mailpoet-button-with-spinner:after { background-color: rgba(255, 255, 255, 0.8); }
849
+
850
+ .mailpoet-button-link-dark { background: transparent; color: #071c6d; text-decoration: underline; }
851
+
852
+ .mailpoet-button-link-dark:hover, .mailpoet-button-link-dark:focus { background: transparent; color: #04103d; text-decoration: none; }
853
+
854
+ .mailpoet-button-link-dark.mailpoet-button-with-spinner:after { background-color: rgba(255, 255, 255, 0.8); }
855
+
856
+ .mailpoet-button-disabled { opacity: .4; pointer-events: none; touch-action: none; }
857
+
858
+ .mailpoet-button-with-spinner { pointer-events: none; touch-action: none; }
859
+
860
+ .mailpoet-button-with-spinner:after { background: rgba(255, 83, 1, 0.8) no-repeat center; background-size: 24px 24px; border-radius: 4px; content: ''; height: 100%; left: 0; position: absolute; top: 0; width: 100%; }
861
+
862
+ .mailpoet-button-with-spinner:after { background-image: url("data:image/gif;base64,R0lGODlhIAAgAPUxAP53Nv6LVP6lev69nv7Ksv7UwP7Ntv7EqP6yjv6ecP6SXv65mP5zMP7czP7Yxv7RvP6viv6OWP6IUP6XZv7GrP6rhP7p4P7o3v7r4v7v6P6ARP5sJv56Ov5lHP5fEv5jGP5YCP5UAv7dzv6HTv7h1P7Aov6aav7n3P7ayv62lP6pgP6UYv6idv7x7P5cDv6ESv5wLP5pIv7k2P5+QP77+v////739P9TAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBwAxACwAAAAAIAAgAEAG/8CYcEiUCA4NUqZBbDpjChGJJJORBM9stsAtPEzasFZQKg0WC8RKHAOF2CbSyUKnZ+4ZA3s4aDRQKHp7bAkGBIYHCoOLMQEVCBAVAgImKwojGhwMGx0fHh4gIGwBAycYeHctD4wxEg8yJzI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1wV4wAIFDw8GBhPAAePkBguVIUoI6gQEzXkgIe5EEQQG8hQH5mVcgLDn7p6QCvwIHDgwgB6VDx4EEsRnQ8IAAv4YDqgQgcmGDTEgehgIIomChQsHLEiBgIWCABo0zOAwAwCDDR1EjlSyYkCJVRIqF0CooIKFiQkRRrzgYBNkTg9MAqQAOoBlBQECEkxQkFQDBwY3Q1IZIUAlAgRDsx59+cIrBxgxygQQcBbBVaMTViiQsBQGoxEKEghgkXXrCA1UggAAOw=="); }
863
+
864
+ .mailpoet-button-with-spinner.mailpoet-button-light:after { background-image: url("data:image/gif;base64,R0lGODlhIAAgAPUxAP7Bo/6wi/6bbP6HTv59Pv50Mv56Ov6BRv6QW/6hdP6rg/6KU/7EqP5uKP5xLf53Nv6TXv6uh/6zjv6nfP6AQ/6WY/5jGP5kGv5hFv5eEv66mP7KsP6+oP7Quf7Vwf7RvP7ayf7ezv5tJ/60kP5qIv6FS/6kef5kG/5vKv6NVv6YZ/6pf/6db/5cDv7XxP62k/7Hq/7NtP5nH/67m/5UA/9TAf5XCP/g0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBwAxACwAAAAAIAAgAAAG/8CYcEiUCA4NUqZBbDqfMcXB0mplMlaolhgYnDDXcOux3SoKlnQ6fC1DTaSTeh02uJ2Kxkl+WTsGEAkJd0UPMicyF4oFJoRQKSQykocQjlAKIiSRMiQCllALIpmalZ9OASgiDaoUpk8CqygNDY2uTQOzKCh2tk0EDsAOCL1NBcYFDizERMcFDxPLQ80PtdEGDwbZg9ExB9nZKtwxCN8EA+IJBgTqBwrcAQTxBwfD3BAE8yUD28sR8wf6Bri7E2KLgBL6FixAsMINiIJaRixIuLBCghdQPLh4WCbCgI8IIFRQkUDBiBkMYGzY0OGDBxAcY0DEk2KhSAEsTEyIMEIDAEQGLDXCDEFUS4AKISsIEGBihUkNHIC29PAShJsRJm4KmqAgwIsZP1m69OAIK84EJhQ8jaqyA9lPG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
+ .mailpoet-button-with-spinner.mailpoet-button-dark:after { background-image: url("data:image/gif;base64,R0lGODlhIAAgAPUxADtMi1hmnH2IsqCox7S60sHG2re91KqxzJGavnN/rGJvopqjwzVGiM3R4cfM3r3D2I2Wu1xqn1Rjmmp2p661z4eRuODj7N7h6+Ll7ujq8UlYkys9gj9PjiI0fBgsdx4xeg4jcQgdbs/T4lJhmdXY5qSsyW56qdzf6svP4JafwYONtmZzpHmEsOzt8xQodE5dlzFDhig6gNnc6EVUkfr6+/////T1+AccbQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBwAxACwAAAAAIAAgAEAG/8CYcEiUCA4NUqZBbDpjChGJJJORBM9stsAtPEzasFZQKg0WC8RKHAOF2CbSyUKnZ+4ZA3s4aDRQKHp7bAkGBIYHCoOLMQEVCBAVAgImKwojGhwMGx0fHh4gIGwBAycYeHctD4wxEg8yJzIXswVgrEIBKCINuxS3T10FDiy/TwcGyAYqxU8QBAcHZgnMThED15AVKgmXMwwwG5yeoW8x5WEjJgIsCSYKl5nfnB6MCgcWLS2pGcUKBXV2UN1S0ODEnAt2HAyAkGAaoxRUqsCCQC3GAhFSplCsKIAXCj+2KhJwQNIBgopDgj2YgFKIgQfJHKJEkIzAgJaNCOiEdrJlBERo0a4p2nPuyYgFZtAgqJDgRRYPLtywUZAiTaR1JiZEwARgUweo5EIUdZLuasMJCgK8mNFV3CdWGgIosKRAggZvG8QEAQAh+QQJBwA2ACwAAAAAGQAgAAAG/0CbcEiUCEoOUSaDchwqxOhQcZBZLMtspnWREgML2eWCuVowWVrCK1Q8ZKeT+Ype1iLsiUMGP43pdRknbAoOJCR8cBcFCxAJCRADBl4SBiIih4gGJmxeCA2XoCIQnV6FoCgNKCylXikosKlQrVEBDre3B7RSLAW+BQ4Tu1ELvwW6w0QHBg/NpMlDBtLSa9BCBNMGwtY2BNgGBNvWB9gEB9XWAwQUBwcC3DYQ7AclCPAm9AcDAwrcA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SFEIQO/KA4UkSHSLNICDSgF2ROBIN3SISABBQ7ZBSWBHh7d3UIp5NkGwVkfH+npLkXZDwb8s1gbG2J0oFdvCIQC/PgR0BWFAQAGMALG+EAkAIWEBggcQGAkCQcNGjhwYABxAxIFBDJmPFBiAAITKwJIiBBBgYIAI0CKZGASyQpXCgQIUDhwYMCCFAgqqBCQwMQEBRFGvNAwg8GTCAM0shxgFAGECgKYwoQqQYNVKBIqEC3aNenSpk4VvOAQJkKFEi0XINgLVmyEGYFGTBDwdW/YCQE0QAkCACH5BAUHADYALAAAAAAfACAAAAb/QJtwSJQIVMSkcklUUDKtGnO6DAwy2FaGyhUqHNgwbdCdmkhYTLhlKC8VJAzGYgmjDu6kpGCZ9zMFJnlKCxcXFocXCINKCjInhhcnAoxKA48nkBCVSREkMo8ybZxEAp+gMoKkQyUkriQPq0QGIiINDYuyQg62t5S6Nii2KCiquigNKA4OCcA2BcvQv7oEBdYFm8AL1wV4wAIFDw8GBhPAAePkBguVIUoI6gQEzXkgIe5EEQQG8hQH5mVcgLDn7p6QCvwIHDgwgB6VDx4EEsRnQ8IAAv4YDqgQgcmGDTEgehgIIomChQsHLEiBgIWCABo0zOAwAwCDDR1EjlSyYkCJVRIqF0CooIKFiQkRRrzgYBNkTg9MAqQAOoBlBQECEkxQkFQDBwY3Q1IZIUAlAgRDsx59+cIrBxgxygQQcBbBVaMTViiQsBQGoxEKEghgkXXrCA1UggAAOw=="); }
867
+
868
+ .mailpoet-button-with-spinner.mailpoet-button-link:after { background-image: url("data:image/gif;base64,R0lGODlhIAAgAPUxAP7ZyP7Fqv6rhP6TYP6GTP58Pv6DSP6MVv6ecP6yjv6+oP6XZv7dzv50Mv54OP5/Qv6hdP7Cpv7Irv65mP6KUv6lev5nHv5oIP5lHP5hFv7Quv7k2P7WxP7r4v7x7P7t5v749v78/P5zMP7JsP5vKv6QXP62lP5pIv52NP6aav6nfv68nP6uiP5fEv708P7MtP7g0v7n3P5sJv7Svv5VBP9TAf5ZCv///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QE0QAkCACH5BAUHADYALAAAAAAfACAAAAb/QJtwSJQIVMSkcklUUDKtGnO6DAwy2FaGyhUqHNgwbdCdmkhYTLhlKC8VJAzGYgmjDu6kpGCZ9zMFJnlKCxcXFocXCINKCjInhhcnAoxKA48nkBCVSREkMo8ybZxEAp+gMoKkQyUkriQPq0QGIiINDYuyQg62t5S6Nii2KCiquigNKA4OCcA2BcvQv7oEBdYFm8AL1wV4wAIFDw8GBhPAAePkBguVIUoI6gQEzXkgIe5EEQQG8hQH5mVcgLDn7p6QCvwIHDgwgB6VDx4EEsRnQ8IAAv4YDqgQgcmGDTEgehgIIomChQsHLEiBgIWCABo0zOAwAwCDDR1EjlSyYkCJVRIqF0CooIKFiQkRRrzgYBNkTg9MAqQAOoBlBQECEkxQkFQDBwY3Q1IZIUAlAgRDsx59+cIrBxgxygQQcBbBVaMTViiQsBQGoxEKEghgkXXrCA1UggAAOw=="); }
869
+
870
+ .mailpoet-button-with-spinner.mailpoet-button-link-dark:after { background-image: url("data:image/gif;base64,R0lGODlhIAAgAPUAAP///wccbayzzoeRuGRxo1BfmENTkE1cllponnN/rJGavqKqyGp2pzlKijdIiT1NjEdWkneDr6ivy7C20G56qTVGiLK40S9BhGBtoZafwSs9gig6gIuVupqjw4GMtFZkm32IsiQ2fiY4fyI0fJ6mxhwvebvB1xgsd7a807/F2c/T4tPW5Nnc6MnN38XK3OLl7uzt8+bo8PDx9vb2+fz8/Nzf6gofbwccbRAkcgAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJBwAAACwAAAAAIAAgAAAG/0CAcEicDBCOS8lBbDqfgAUidDqVSlaoliggbEbX8Amy3S4MoXQ6fC1DM5eNeh0+uJ0Lx0YuWj8IEQoKd0UQGhsaIooGGYRQFBcakocRjlALFReRGhcDllAMFZmalZ9OAg0VDqofpk8Dqw0ODo2uTQSzDQ12tk0FD8APCb1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X0SgUCjcQbuXEEJr3SwYZeUsMIiIhhyIJg0sLGhuGIhsDjEsEjxuQEZVKEhcajxptnEkDn6AagqREGBeuFxCrSQcVFQ4Oi7JDD7a3lLpCDbYNDarADQ4NDw8KwEIGy9C/wAUG1gabzgzXBnjOAwYQEAcHHc4C4+QHDJU0SwnqBQXNeTM07kkSBQfyHwjmZWTMsOfu3hAQ/AogQECAHpUYMAQSxCdkAoEC/hgSACGBCQsWNSDCGDhDyYKFCwkwoJCAwwIBJkykcJGihQoWL0SOXEKCAAZVDCoZRADhgUOGDhIsoHBhE2ROGFMEUABKgCWIAQMUdFiQ1IQLFTdDcrEwQGWCBEOzHn2JwquLFTXcCBhwNsFVox1ILJiwdEUlCwsUDOCQdasFE1yCAAA7AAAAAAAAAAAA"); }
871
+
872
+ input { outline: none; }
873
+
874
+ .mailpoet-form-input { align-items: center; background: #fdfdff; border: 1px solid #e5e9f8; border-radius: 4px; box-sizing: border-box; display: inline-flex; height: 40px; justify-content: center; max-width: 100%; padding: 0; position: relative; text-align: left; vertical-align: top; width: 368px; }
875
+
876
+ .mailpoet-form-input input, .mailpoet-form-input select { -webkit-appearance: none; -moz-appearance: none; appearance: none; background: transparent; border: 0; color: #071c6d; flex-grow: 1; font-size: 16px; line-height: 22px; padding: 7px 16px 9px; }
877
+
878
+ .mailpoet-form-input input::-webkit-input-placeholder, .mailpoet-form-input select::-webkit-input-placeholder { color: #9ca6cc; }
879
+
880
+ .mailpoet-form-input input::-moz-placeholder, .mailpoet-form-input select::-moz-placeholder { color: #9ca6cc; }
881
+
882
+ .mailpoet-form-input input:-ms-input-placeholder, .mailpoet-form-input select:-ms-input-placeholder { color: #9ca6cc; }
883
+
884
+ .mailpoet-form-input input::-ms-input-placeholder, .mailpoet-form-input select::-ms-input-placeholder { color: #9ca6cc; }
885
+
886
+ .mailpoet-form-input input::placeholder, .mailpoet-form-input select::placeholder { color: #9ca6cc; }
887
+
888
+ .mailpoet-form-input > svg { fill: #9ca6cc; flex-shrink: 0; height: 16px; width: 16px; }
889
+
890
+ .mailpoet-form-input > svg:first-child { margin: 0 -8px 0 8px; }
891
+
892
+ .mailpoet-form-input > svg:last-child { margin: 0 8px 0 -8px; }
893
+
894
+ .mailpoet-form-input.mailpoet-full-width + .mailpoet-form-input.mailpoet-full-width { margin-top: 16px; }
895
+
896
+ .mailpoet-form-input:not(.mailpoet-full-width) + .mailpoet-form-input:not(.mailpoet-full-width) { margin-left: 16px; }
897
+
898
+ .mailpoet-form-input-small { font-size: 14px; height: 32px; width: 272px; }
899
+
900
+ .mailpoet-form-input-small input, .mailpoet-form-input-small select { font-size: 14px; line-height: 14px; }
901
+
902
+ .mailpoet-form-input-small svg { height: 12px; width: 12px; }
903
+
904
+ select { outline: none; }
905
+
906
+ .mailpoet-form-select { height: auto; min-height: 40px; }
907
+
908
+ .mailpoet-form-select select { padding-right: 28px; }
909
+
910
+ .mailpoet-form-select > svg:first-child { margin-right: -24px; }
911
+
912
+ .mailpoet-form-select > svg + select { padding-left: 32px; }
913
+
914
+ .mailpoet-form-select > svg ~ .mailpoet-form-react-select .mailpoet-form-react-select__value-container { padding-left: 32px !important; }
915
+
916
+ .mailpoet-form-select.mailpoet-form-input-small > svg:first-child { margin-right: -20px; }
917
+
918
+ .mailpoet-form-select.mailpoet-form-input-small > svg + select { padding-left: 28px; }
919
+
920
+ .mailpoet-form-select.mailpoet-form-input-small > svg ~ .mailpoet-form-react-select .mailpoet-form-react-select__value-container { padding-left: 28px !important; }
921
+
922
+ .mailpoet-form-select:after { background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAQCAYAAAAMJL+VAAAAqklEQVR4AWOAAS75Ak922byr7DK5/ynBHDJ5j0FmMaADkARCIeWWYLEg9xG1LACFBKYFcvlxVPOBXF4sAzbAIZs7n1LDQWYw4AJSxg1clEQ0SC/IDAZ8gEcuVwuo+CsZFnwF6WUgBgDDMJ6McI8naDBmfFAe7oTjg/JwJxwflIY74figPNwJxwfF4U44PnKvwAwHsWHhTjlAlLaSQIN7gJHax62YL84wWAAANkMq0+UYHGkAAAAASUVORK5CYII=") no-repeat center; background-size: contain; content: ''; height: 8px; margin-top: -4px; pointer-events: none; position: absolute; right: 8px; top: 50%; width: 12px; }
923
+
924
+ .mailpoet-form-react-select { flex-grow: 1; max-width: 100%; }
925
+
926
+ .mailpoet-form-react-select__control { background: transparent !important; border: 0 !important; box-shadow: none !important; }
927
+
928
+ .mailpoet-form-react-select__value-container { padding: 4px 28px 4px 16px !important; }
929
+
930
+ .mailpoet-form-react-select__single-value { color: #071c6d !important; max-width: 100%; }
931
+
932
+ .mailpoet-form-react-select__multi-value { background: #e5e9f8 !important; margin: 2px 8px 2px 0 !important; }
933
+
934
+ .mailpoet-form-react-select__multi-value__label { color: #071c6d; font-size: 14px; line-height: 20px; max-width: calc(100% - 32px); padding: 3px 0 3px 6px; }
935
+
936
+ .mailpoet-form-react-select__multi-value__remove { cursor: pointer; }
937
+
938
+ .mailpoet-form-react-select__multi-value__remove svg { fill: rgba(7, 28, 109, 0.4) !important; height: 18px; width: 18px; }
939
+
940
+ .mailpoet-form-react-select__multi-value__remove:hover, .mailpoet-form-react-select__multi-value__remove:focus { background: rgba(7, 28, 109, 0.1) !important; outline: none; }
941
+
942
+ .mailpoet-form-react-select__placeholder { color: #9ca6cc !important; }
943
+
944
+ .mailpoet-form-react-select__input { color: #071c6d !important; }
945
+
946
+ .mailpoet-form-react-select__indicators { display: none !important; }
947
+
948
+ .mailpoet-form-react-select__menu { border: 1px solid #e5e9f8 !important; border-radius: 0 0 4px 4px !important; box-shadow: none !important; left: -1px !important; margin-bottom: -4px !important; margin-top: -4px !important; width: calc(100% + 2px) !important; }
949
+
950
+ .mailpoet-form-react-select__menu-notice { color: #9ca6cc !important; }
951
+
952
+ .mailpoet-form-react-select__option { color: #071c6d !important; cursor: pointer; font-size: 14px !important; line-height: 18px !important; padding: 8px 16px !important; }
953
+
954
+ .mailpoet-form-react-select__option--is-focused { background: #e5e9f8 !important; }
955
+
956
+ .mailpoet-form-react-select-option { align-items: center; box-sizing: border-box; display: flex; max-width: 100%; position: relative; }
957
+
958
+ .mailpoet-form-react-select-text { min-width: 0; }
959
+
960
+ .mailpoet-form-react-select-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
961
+
962
+ .mailpoet-form-react-select-tag { background: #071c6d; border-radius: 2px; box-sizing: border-box; color: #fff; font-size: 12px; font-weight: 600; line-height: 14px; margin-right: 6px; padding: 2px 5px; }
963
+
964
+ .mailpoet-form-react-select-count { background: rgba(156, 166, 204, 0.5); border-radius: 10px; box-sizing: border-box; color: #071c6d; font-size: 12px; font-weight: 600; line-height: 14px; margin-left: 6px; padding: 1px 5px; }
965
+
966
+ /* These are temporary styles until we get rid of select2 Usage: const data = [{ id: '1', count: 1, tag: 'Tag', text: 'Option', }]; const templateRendered = (option) => { let tpl = ''; if (option.tag !== undefined) { tpl += `<span class="mailpoet-form-select2-tag">${option.tag}</span>`; } tpl += `<span class="mailpoet-form-select2-text"><span>${option.text}</span></span>`; if (option.count !== undefined) { tpl += `<span class="mailpoet-form-select2-count">${option.count}</span>`; } return tpl; }; element.select2({ data, dropdownCssClass: 'mailpoet-form-select2-dropdown', escapeMarkup: (markup) => markup, templateResult: templateRendered, templateSelection: templateRendered, }); */
967
+ .mailpoet-form-select svg ~ .select2 .select2-selection__rendered { padding-left: 32px !important; }
968
+
969
+ .mailpoet-form-select.mailpoet-form-input-small svg ~ .select2 .select2-selection__rendered { padding-left: 28px !important; }
970
+
971
+ .mailpoet-form-select .select2-container { width: 100% !important; }
972
+
973
+ .mailpoet-form-select .select2-selection { background: transparent !important; border: 0 !important; height: auto !important; outline: none; }
974
+
975
+ .mailpoet-form-select .select2-selection__arrow { display: none !important; }
976
+
977
+ .mailpoet-form-select .select2-selection__rendered { color: #071c6d !important; line-height: 22px !important; padding: 7px 24px 9px 16px !important; vertical-align: top; }
978
+
979
+ .mailpoet-form-select .select2-selection--multiple .select2-selection__rendered { padding-bottom: 0 !important; }
980
+
981
+ .mailpoet-form-select .select2-selection__choice { background: #e5e9f8 !important; border: 0 !important; font-size: 14px; height: 24px !important; margin: 0 7px 7px 0 !important; padding: 1px 24px 1px 6px !important; }
982
+
983
+ .mailpoet-form-select .select2-selection__choice__remove { color: rgba(7, 28, 109, 0.4) !important; font-size: 22px; line-height: 24px; margin-right: 0 !important; padding-top: 2px; position: absolute; right: 0; text-align: center; top: 0; width: 24px; }
984
+
985
+ .mailpoet-form-select .select2-search--inline { margin-bottom: 7px; }
986
+
987
+ .mailpoet-form-select .select2-search__field { line-height: 24px; margin-top: 0 !important; }
988
+
989
+ .mailpoet-form-select .select2-search__field::-webkit-input-placeholder { color: #9ca6cc; }
990
+
991
+ .mailpoet-form-select .select2-search__field::-moz-placeholder { color: #9ca6cc; }
992
+
993
+ .mailpoet-form-select .select2-search__field:-ms-input-placeholder { color: #9ca6cc; }
994
+
995
+ .mailpoet-form-select .select2-search__field::-ms-input-placeholder { color: #9ca6cc; }
996
+
997
+ .mailpoet-form-select .select2-search__field::placeholder { color: #9ca6cc; }
998
+
999
+ .mailpoet-form-select2-dropdown { border-color: #e5e9f8; border-radius: 4px; box-sizing: content-box; color: #071c6d; font-family: "proxima-soft", sans-serif; font-size: 16px; margin-left: -1px; }
1000
+
1001
+ .mailpoet-form-select2-dropdown.select2-dropdown--below { margin-top: -4px; }
1002
+
1003
+ .mailpoet-form-select2-dropdown.select2-dropdown--above { margin-bottom: -4px; }
1004
+
1005
+ .mailpoet-form-select2-dropdown .select2-search--dropdown { padding: 6px 8px; }
1006
+
1007
+ .mailpoet-form-select2-dropdown .select2-search--dropdown .select2-search__field { background: #fff; border: 1px solid #e5e9f8; border-radius: 4px; font-size: 14px; padding: 8px; }
1008
+
1009
+ .mailpoet-form-select2-dropdown .select2-search--dropdown .select2-search__field::-webkit-input-placeholder { color: #9ca6cc; }
1010
+
1011
+ .mailpoet-form-select2-dropdown .select2-search--dropdown .select2-search__field::-moz-placeholder { color: #9ca6cc; }
1012
+
1013
+ .mailpoet-form-select2-dropdown .select2-search--dropdown .select2-search__field:-ms-input-placeholder { color: #9ca6cc; }
1014
+
1015
+ .mailpoet-form-select2-dropdown .select2-search--dropdown .select2-search__field::-ms-input-placeholder { color: #9ca6cc; }
1016
+
1017
+ .mailpoet-form-select2-dropdown .select2-search--dropdown .select2-search__field::placeholder { color: #9ca6cc; }
1018
+
1019
+ .mailpoet-form-select2-dropdown .select2-results__options { padding: 4px 0; }
1020
+
1021
+ .mailpoet-form-select2-dropdown .select2-results__option { align-items: center; display: flex; padding: 12px 16px; }
1022
+
1023
+ .mailpoet-form-select2-dropdown .select2-results__option[aria-selected=true] { background-color: #ffe0d0; color: #071c6d; }
1024
+
1025
+ .mailpoet-form-select2-dropdown .select2-results__option--highlighted { background-color: #e5e9f8; }
1026
+
1027
+ .mailpoet-form-select2-dropdown .select2-results__option--highlighted[aria-selected=true] { background-color: #ffbe9d; }
1028
+
1029
+ .mailpoet-form-select .select2-selection__choice, .mailpoet-form-select2-dropdown .select2-results__option { align-items: center; box-sizing: border-box; display: flex; max-width: 100%; position: relative; }
1030
+
1031
+ .mailpoet-form-select2-text { min-width: 0; }
1032
+
1033
+ .mailpoet-form-select2-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1034
+
1035
+ .mailpoet-form-select2-tag { background: #071c6d; border-radius: 2px; box-sizing: border-box; color: #fff; font-size: 12px; font-weight: 600; line-height: 14px; margin-right: 6px; padding: 2px 5px; }
1036
+
1037
+ .mailpoet-form-select2-count { background: rgba(156, 166, 204, 0.5); border-radius: 10px; box-sizing: border-box; color: #071c6d; font-size: 12px; font-weight: 600; line-height: 14px; margin-left: 6px; padding: 1px 5px; }
1038
+
1039
+ .mailpoet-grid-column { width: 368px; }
1040
+
1041
+ .mailpoet-grid-column-small { width: 272px; }
1042
+
1043
+ .mailpoet-grid-two-columns { display: grid; grid-column-gap: 16px; grid-template-columns: 1fr 1fr; }
1044
+
1045
+ .mailpoet-grid-three-columns { display: grid; grid-column-gap: 16px; grid-template-columns: 1fr 1fr 1fr; }
1046
+
1047
+ .mailpoet-grid-space-between { align-items: flex-start; display: flex; justify-content: space-between; }
1048
+
1049
+ .mailpoet-grid-space-between-vertical-center { align-items: center; }
1050
+
1051
+ .mailpoet-grid-two-columns-list { -moz-column-gap: 16px; column-gap: 16px; -moz-columns: 2 auto; columns: 2 auto; }
1052
+
1053
+ .mailpoet-full-width { width: 100%; }
1054
+
1055
+ .mailpoet-gap { display: block; height: 16px; }
1056
+
1057
  input.parsley-success, select.parsley-success, textarea.parsley-success { background-color: #dff0d8; border: 1px solid #d6e9c6; color: #468847; }
1058
 
1059
  input.parsley-error, select.parsley-error, textarea.parsley-error { background-color: #f2dede; border: 1px solid #eed3d7; color: #b94a48; }
1100
 
1101
  .form-field-row-filters div { margin-bottom: 10px; }
1102
 
 
 
1103
  .clearfix:after { clear: both; content: ''; display: table; }
1104
 
1105
  .relative-holder { position: relative; }
1233
 
1234
  .mailpoet-modal-header h1 { line-height: 1; margin: 0; }
1235
 
1236
+ .mailpoet-modal-header .mailpoet-modal-close { background: none; border: 0; cursor: pointer; height: 24px; outline: none; padding: 6px; position: relative; right: -6px; top: -6px; width: 24px; }
1237
 
1238
  .mailpoet-modal-header .mailpoet-modal-close svg { opacity: .5; stroke: #979797; }
1239
 
1399
 
1400
  .mailpoet_breadcrumb a { color: #071c6d; text-decoration: none; }
1401
 
1402
+ .mailpoet_breadcrumb a:hover { color: #04103d; }
1403
 
1404
  .mailpoet_form { margin: 0 0 20px; }
1405
 
assets/dist/css/{mailpoet-public.c513a013.css → mailpoet-public.c2ddf210.css} RENAMED
@@ -80,13 +80,13 @@ input.parsley-error, select.parsley-error, textarea.parsley-error { background-c
80
 
81
  .mailpoet_form_tight_container .mailpoet_form_column:not(:first-child) { margin-left: 0 !important; }
82
 
83
- .mailpoet_widget_preview { align-items: center; display: flex; background-color: #ffffff; flex-direction: row; height: 100%; justify-content: center; left: 0; max-width: 100% !important; overflow-y: auto !important; position: fixed; top: 0; width: 100% !important; z-index: 100000; }
84
 
85
  .mailpoet_widget_preview .widget-area { display: block !important; float: none !important; margin: auto; position: static !important; width: 340px; }
86
 
87
  .mailpoet_form_popup_overlay { background-color: black; display: none; height: 100%; left: 0; max-width: 100% !important; opacity: .7; position: fixed; top: 0; width: 100% !important; z-index: 100000; }
88
 
89
- div.mailpoet_form_popup { background-color: white; border-radius: 10px; box-shadow: 0 4px 35px 0 rgba(195, 65, 2, 0.2); display: none; left: 50%; max-height: calc(100vh - 60px); max-width: 500px !important; overflow-y: auto; padding: 20px; position: fixed; top: 50%; transform: translate(-50%, -50%); width: 500px !important; z-index: 100001; }
90
 
91
  .mailpoet_form_close_icon { cursor: pointer; display: block; margin: 0 0 0 auto; }
92
 
@@ -128,4 +128,4 @@ div.mailpoet_form_slide_in { -webkit-animation: slide-top 1.5s cubic-bezier(0.25
128
 
129
  .mailpoet_form_image figcaption { text-align: center; }
130
 
131
- .mailpoet_spacer { display: flex; flex-direction: column; align-items: center; width: 100%; justify-content: center; margin-bottom: 20px; }
80
 
81
  .mailpoet_form_tight_container .mailpoet_form_column:not(:first-child) { margin-left: 0 !important; }
82
 
83
+ .mailpoet_widget_preview { align-items: center; background-color: #fff; display: flex; flex-direction: row; height: 100%; justify-content: center; left: 0; max-width: 100% !important; overflow-y: auto !important; position: fixed; top: 0; width: 100% !important; z-index: 100000; }
84
 
85
  .mailpoet_widget_preview .widget-area { display: block !important; float: none !important; margin: auto; position: static !important; width: 340px; }
86
 
87
  .mailpoet_form_popup_overlay { background-color: black; display: none; height: 100%; left: 0; max-width: 100% !important; opacity: .7; position: fixed; top: 0; width: 100% !important; z-index: 100000; }
88
 
89
+ div.mailpoet_form_popup { background-color: white; border-radius: 10px; box-shadow: 0 4px 35px 0 rgba(195, 65, 2, 0.2); display: none; left: 50%; max-height: calc(100vh - 60px); max-width: 560px !important; overflow-y: auto; padding: 20px; position: fixed; top: 50%; transform: translate(-50%, -50%); width: 560px !important; z-index: 100001; }
90
 
91
  .mailpoet_form_close_icon { cursor: pointer; display: block; margin: 0 0 0 auto; }
92
 
128
 
129
  .mailpoet_form_image figcaption { text-align: center; }
130
 
131
+ .mailpoet_spacer { align-items: center; display: flex; flex-direction: column; justify-content: center; margin-bottom: 20px; width: 100%; }
assets/dist/css/manifest.json CHANGED
@@ -1,8 +1,8 @@
1
  {
2
  "mailpoet-admin.css": "mailpoet-admin.08333cf9.css",
3
  "mailpoet-editor.css": "mailpoet-editor.83734695.css",
4
- "mailpoet-form-editor.css": "mailpoet-form-editor.adaee8e1.css",
5
- "mailpoet-plugin.css": "mailpoet-plugin.f63ede85.css",
6
  "mailpoet-post-editor-block.css": "mailpoet-post-editor-block.b87557ef.css",
7
- "mailpoet-public.css": "mailpoet-public.c513a013.css"
8
  }
1
  {
2
  "mailpoet-admin.css": "mailpoet-admin.08333cf9.css",
3
  "mailpoet-editor.css": "mailpoet-editor.83734695.css",
4
+ "mailpoet-form-editor.css": "mailpoet-form-editor.ec3ed03e.css",
5
+ "mailpoet-plugin.css": "mailpoet-plugin.eef47a13.css",
6
  "mailpoet-post-editor-block.css": "mailpoet-post-editor-block.b87557ef.css",
7
+ "mailpoet-public.css": "mailpoet-public.c2ddf210.css"
8
  }
assets/dist/js/{admin.aa1497af.chunk.js → admin.efadeb05.chunk.js} RENAMED
@@ -39,4 +39,4 @@ var n;n=function(){return function(e){var t={};function a(n){if(t[n])return t[n]
39
  *
40
  * This source code is licensed under the MIT license found in the
41
  * LICENSE file in the root directory of this source tree.
42
- */var n=a(138),r=a(0);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s="function"==typeof Symbol&&Symbol.for,o=s?Symbol.for("react.portal"):60106,l=s?Symbol.for("react.fragment"):60107,c=s?Symbol.for("react.strict_mode"):60108,u=s?Symbol.for("react.profiler"):60114,p=s?Symbol.for("react.provider"):60109,d=s?Symbol.for("react.context"):60110,m=s?Symbol.for("react.concurrent_mode"):60111,h=s?Symbol.for("react.forward_ref"):60112,f=s?Symbol.for("react.suspense"):60113,g=s?Symbol.for("react.suspense_list"):60120,v=s?Symbol.for("react.memo"):60115,b=s?Symbol.for("react.lazy"):60116,_=s?Symbol.for("react.fundamental"):60117,y=s?Symbol.for("react.scope"):60119,w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case l:return"Fragment";case o:return"Portal";case u:return"Profiler";case c:return"StrictMode";case f:return"Suspense";case g:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case d:return"Context.Consumer";case p:return"Context.Provider";case h:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case v:return E(e.type);case b:if(e=1===e._status?e._result:null)return E(e)}return null}w.hasOwnProperty("ReactCurrentDispatcher")||(w.ReactCurrentDispatcher={current:null}),w.hasOwnProperty("ReactCurrentBatchConfig")||(w.ReactCurrentBatchConfig={suspense:null});var k={};function I(e,t){for(var a=0|e._threadCount;a<=t;a++)e[a]=e._currentValue2,e._threadCount=a+1}for(var S=new Uint16Array(16),C=0;15>C;C++)S[C]=C+1;S[15]=0;var N=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,x=Object.prototype.hasOwnProperty,T={},R={};function P(e){return!!x.call(R,e)||!x.call(T,e)&&(N.test(e)?R[e]=!0:(T[e]=!0,!1))}function O(e,t,a,n,r,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=r,this.mustUseProperty=a,this.propertyName=e,this.type=t,this.sanitizeURL=i}var D={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){D[e]=new O(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];D[t]=new O(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){D[e]=new O(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){D[e]=new O(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){D[e]=new O(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){D[e]=new O(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){D[e]=new O(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){D[e]=new O(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){D[e]=new O(e,5,!1,e.toLowerCase(),null,!1)}));var A=/[\-:]([a-z])/g;function q(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(A,q);D[t]=new O(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(A,q);D[t]=new O(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(A,q);D[t]=new O(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){D[e]=new O(e,1,!1,e.toLowerCase(),null,!1)})),D.xlinkHref=new O("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){D[e]=new O(e,1,!1,e.toLowerCase(),null,!0)}));var L=/["'&<>]/;function F(e){if("boolean"==typeof e||"number"==typeof e)return""+e;e=""+e;var t=L.exec(e);if(t){var a,n="",r=0;for(a=t.index;a<e.length;a++){switch(e.charCodeAt(a)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}r!==a&&(n+=e.substring(r,a)),r=a+1,n+=t}e=r!==a?n+e.substring(r,a):n}return e}function j(e,t){var a,n=D.hasOwnProperty(e)?D[e]:null;return(a="style"!==e)&&(a=null!==n?0===n.type:2<e.length&&("o"===e[0]||"O"===e[0])&&("n"===e[1]||"N"===e[1])),a||function(e,t,a,n){if(null==t||function(e,t,a,n){if(null!==a&&0===a.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==a?!a.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,a,n))return!0;if(n)return!1;if(null!==a)switch(a.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(e,t,n,!1)?"":null!==n?(e=n.attributeName,3===(a=n.type)||4===a&&!0===t?e+'=""':(n.sanitizeURL&&(t=""+t),e+'="'+F(t)+'"')):P(e)?e+'="'+F(t)+'"':""}var M="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},V=null,B=null,z=null,U=!1,$=!1,W=null,H=0;function K(){if(null===V)throw Error(i(321));return V}function G(){if(0<H)throw Error(i(312));return{memoizedState:null,queue:null,next:null}}function Y(){return null===z?null===B?(U=!1,B=z=G()):(U=!0,z=B):null===z.next?(U=!1,z=z.next=G()):(U=!0,z=z.next),z}function J(e,t,a,n){for(;$;)$=!1,H+=1,z=null,a=e(t,n);return B=V=null,H=0,z=W=null,a}function Q(e,t){return"function"==typeof t?t(e):t}function Z(e,t,a){if(V=K(),z=Y(),U){var n=z.queue;if(t=n.dispatch,null!==W&&void 0!==(a=W.get(n))){W.delete(n),n=z.memoizedState;do{n=e(n,a.action),a=a.next}while(null!==a);return z.memoizedState=n,[n,t]}return[z.memoizedState,t]}return e=e===Q?"function"==typeof t?t():t:void 0!==a?a(t):t,z.memoizedState=e,e=(e=z.queue={last:null,dispatch:null}).dispatch=X.bind(null,V,e),[z.memoizedState,e]}function X(e,t,a){if(!(25>H))throw Error(i(301));if(e===V)if($=!0,e={action:a,next:null},null===W&&(W=new Map),void 0===(a=W.get(t)))W.set(t,e);else{for(t=a;null!==t.next;)t=t.next;t.next=e}}function ee(){}var te=0,ae={readContext:function(e){var t=te;return I(e,t),e[t]},useContext:function(e){K();var t=te;return I(e,t),e[t]},useMemo:function(e,t){if(V=K(),t=void 0===t?null:t,null!==(z=Y())){var a=z.memoizedState;if(null!==a&&null!==t){e:{var n=a[1];if(null===n)n=!1;else{for(var r=0;r<n.length&&r<t.length;r++)if(!M(t[r],n[r])){n=!1;break e}n=!0}}if(n)return a[0]}}return e=e(),z.memoizedState=[e,t],e},useReducer:Z,useRef:function(e){V=K();var t=(z=Y()).memoizedState;return null===t?(e={current:e},z.memoizedState=e):t},useState:function(e){return Z(Q,e)},useLayoutEffect:function(){},useCallback:function(e){return e},useImperativeHandle:ee,useEffect:ee,useDebugValue:ee,useResponder:function(e,t){return{props:t,responder:e}},useDeferredValue:function(e){return K(),e},useTransition:function(){return K(),[function(e){e()},!1]}},ne={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function re(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var ie={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},se=n({menuitem:!0},ie),oe={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},le=["Webkit","ms","Moz","O"];Object.keys(oe).forEach((function(e){le.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),oe[t]=oe[e]}))}));var ce=/([A-Z])/g,ue=/^ms-/,pe=r.Children.toArray,de=w.ReactCurrentDispatcher,me={listing:!0,pre:!0,textarea:!0},he=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,fe={},ge={};var ve=Object.prototype.hasOwnProperty,be={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function _e(e,t){if(void 0===e)throw Error(i(152,E(t)||"Component"))}function ye(e,t,a){function s(r,s){var o=s.prototype&&s.prototype.isReactComponent,l=function(e,t,a,n){if(n&&("object"==typeof(n=e.contextType)&&null!==n))return I(n,a),n[a];if(e=e.contextTypes){for(var r in a={},e)a[r]=t[r];t=a}else t=k;return t}(s,t,a,o),c=[],u=!1,p={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===c)return null},enqueueReplaceState:function(e,t){u=!0,c=[t]},enqueueSetState:function(e,t){if(null===c)return null;c.push(t)}};if(o){if(o=new s(r.props,l,p),"function"==typeof s.getDerivedStateFromProps){var d=s.getDerivedStateFromProps.call(null,r.props,o.state);null!=d&&(o.state=n({},o.state,d))}}else if(V={},o=s(r.props,l,p),null==(o=J(s,r.props,o,l))||null==o.render)return void _e(e=o,s);if(o.props=r.props,o.context=l,o.updater=p,void 0===(p=o.state)&&(o.state=p=null),"function"==typeof o.UNSAFE_componentWillMount||"function"==typeof o.componentWillMount)if("function"==typeof o.componentWillMount&&"function"!=typeof s.getDerivedStateFromProps&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&"function"!=typeof s.getDerivedStateFromProps&&o.UNSAFE_componentWillMount(),c.length){p=c;var m=u;if(c=null,u=!1,m&&1===p.length)o.state=p[0];else{d=m?p[0]:o.state;var h=!0;for(m=m?1:0;m<p.length;m++){var f=p[m];null!=(f="function"==typeof f?f.call(o,d,r.props,l):f)&&(h?(h=!1,d=n({},d,f)):n(d,f))}o.state=d}}else c=null;if(_e(e=o.render(),s),"function"==typeof o.getChildContext&&"object"==typeof(r=s.childContextTypes)){var g=o.getChildContext();for(var v in g)if(!(v in r))throw Error(i(108,E(s)||"Unknown",v))}g&&(t=n({},t,g))}for(;r.isValidElement(e);){var o=e,l=o.type;if("function"!=typeof l)break;s(o,l)}return{child:e,context:t}}var we=function(){function e(e,t){r.isValidElement(e)?e.type!==l?e=[e]:(e=e.props.children,e=r.isValidElement(e)?[e]:pe(e)):e=pe(e),e={type:null,domNamespace:ne.html,children:e,childIndex:0,context:k,footer:""};var a=S[0];if(0===a){var n=S,s=2*(a=n.length);if(!(65536>=s))throw Error(i(304));var o=new Uint16Array(s);for(o.set(n),(S=o)[0]=a+1,n=a;n<s-1;n++)S[n]=n+1;S[s-1]=0}else S[0]=S[a];this.threadID=a,this.stack=[e],this.exhausted=!1,this.currentSelectValue=null,this.previousWasTextNode=!1,this.makeStaticMarkup=t,this.suspenseDepth=0,this.contextIndex=-1,this.contextStack=[],this.contextValueStack=[]}var t=e.prototype;return t.destroy=function(){if(!this.exhausted){this.exhausted=!0,this.clearProviders();var e=this.threadID;S[e]=S[0],S[0]=e}},t.pushProvider=function(e){var t=++this.contextIndex,a=e.type._context,n=this.threadID;I(a,n);var r=a[n];this.contextStack[t]=a,this.contextValueStack[t]=r,a[n]=e.props.value},t.popProvider=function(){var e=this.contextIndex,t=this.contextStack[e],a=this.contextValueStack[e];this.contextStack[e]=null,this.contextValueStack[e]=null,this.contextIndex--,t[this.threadID]=a},t.clearProviders=function(){for(var e=this.contextIndex;0<=e;e--)this.contextStack[e][this.threadID]=this.contextValueStack[e]},t.read=function(e){if(this.exhausted)return null;var t=te;te=this.threadID;var a=de.current;de.current=ae;try{for(var n=[""],r=!1;n[0].length<e;){if(0===this.stack.length){this.exhausted=!0;var s=this.threadID;S[s]=S[0],S[0]=s;break}var o=this.stack[this.stack.length-1];if(r||o.childIndex>=o.children.length){var l=o.footer;if(""!==l&&(this.previousWasTextNode=!1),this.stack.pop(),"select"===o.type)this.currentSelectValue=null;else if(null!=o.type&&null!=o.type.type&&o.type.type.$$typeof===p)this.popProvider(o.type);else if(o.type===f){this.suspenseDepth--;var c=n.pop();if(r){r=!1;var u=o.fallbackFrame;if(!u)throw Error(i(303));this.stack.push(u),n[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}n[this.suspenseDepth]+=c}n[this.suspenseDepth]+=l}else{var d=o.children[o.childIndex++],m="";try{m+=this.render(d,o.context,o.domNamespace)}catch(e){if(null!=e&&"function"==typeof e.then)throw Error(i(294));throw e}n.length<=this.suspenseDepth&&n.push(""),n[this.suspenseDepth]+=m}}return n[0]}finally{de.current=a,te=t}},t.render=function(e,t,a){if("string"==typeof e||"number"==typeof e)return""===(a=""+e)?"":this.makeStaticMarkup?F(a):this.previousWasTextNode?"\x3c!-- --\x3e"+F(a):(this.previousWasTextNode=!0,F(a));if(e=(t=ye(e,t,this.threadID)).child,t=t.context,null===e||!1===e)return"";if(!r.isValidElement(e)){if(null!=e&&null!=e.$$typeof){if((a=e.$$typeof)===o)throw Error(i(257));throw Error(i(258,a.toString()))}return e=pe(e),this.stack.push({type:null,domNamespace:a,children:e,childIndex:0,context:t,footer:""}),""}var s=e.type;if("string"==typeof s)return this.renderDOM(e,t,a);switch(s){case c:case m:case u:case g:case l:return e=pe(e.props.children),this.stack.push({type:null,domNamespace:a,children:e,childIndex:0,context:t,footer:""}),"";case f:throw Error(i(294))}if("object"==typeof s&&null!==s)switch(s.$$typeof){case h:V={};var w=s.render(e.props,e.ref);return w=J(s.render,e.props,w,e.ref),w=pe(w),this.stack.push({type:null,domNamespace:a,children:w,childIndex:0,context:t,footer:""}),"";case v:return e=[r.createElement(s.type,n({ref:e.ref},e.props))],this.stack.push({type:null,domNamespace:a,children:e,childIndex:0,context:t,footer:""}),"";case p:return a={type:e,domNamespace:a,children:s=pe(e.props.children),childIndex:0,context:t,footer:""},this.pushProvider(e),this.stack.push(a),"";case d:s=e.type,w=e.props;var E=this.threadID;return I(s,E),s=pe(w.children(s[E])),this.stack.push({type:e,domNamespace:a,children:s,childIndex:0,context:t,footer:""}),"";case _:throw Error(i(338));case b:switch(function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(s=e.type),s._status){case 1:return e=[r.createElement(s._result,n({ref:e.ref},e.props))],this.stack.push({type:null,domNamespace:a,children:e,childIndex:0,context:t,footer:""}),"";case 2:throw s._result;default:throw Error(i(295))}case y:throw Error(i(343))}throw Error(i(130,null==s?s:typeof s,""))},t.renderDOM=function(e,t,a){var s=e.type.toLowerCase();if(a===ne.html&&re(s),!fe.hasOwnProperty(s)){if(!he.test(s))throw Error(i(65,s));fe[s]=!0}var o=e.props;if("input"===s)o=n({type:void 0},o,{defaultChecked:void 0,defaultValue:void 0,value:null!=o.value?o.value:o.defaultValue,checked:null!=o.checked?o.checked:o.defaultChecked});else if("textarea"===s){var l=o.value;if(null==l){l=o.defaultValue;var c=o.children;if(null!=c){if(null!=l)throw Error(i(92));if(Array.isArray(c)){if(!(1>=c.length))throw Error(i(93));c=c[0]}l=""+c}null==l&&(l="")}o=n({},o,{value:void 0,children:""+l})}else if("select"===s)this.currentSelectValue=null!=o.value?o.value:o.defaultValue,o=n({},o,{value:void 0});else if("option"===s){c=this.currentSelectValue;var u=function(e){if(null==e)return e;var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(o.children);if(null!=c){var p=null!=o.value?o.value+"":u;if(l=!1,Array.isArray(c)){for(var d=0;d<c.length;d++)if(""+c[d]===p){l=!0;break}}else l=""+c===p;o=n({selected:void 0,children:void 0},o,{selected:l,children:u})}}if(l=o){if(se[s]&&(null!=l.children||null!=l.dangerouslySetInnerHTML))throw Error(i(137,s,""));if(null!=l.dangerouslySetInnerHTML){if(null!=l.children)throw Error(i(60));if(!("object"==typeof l.dangerouslySetInnerHTML&&"__html"in l.dangerouslySetInnerHTML))throw Error(i(61))}if(null!=l.style&&"object"!=typeof l.style)throw Error(i(62,""))}for(y in l=o,c=this.makeStaticMarkup,u=1===this.stack.length,p="<"+e.type,l)if(ve.call(l,y)){var m=l[y];if(null!=m){if("style"===y){d=void 0;var h="",f="";for(d in m)if(m.hasOwnProperty(d)){var g=0===d.indexOf("--"),v=m[d];if(null!=v){if(g)var b=d;else if(b=d,ge.hasOwnProperty(b))b=ge[b];else{var _=b.replace(ce,"-$1").toLowerCase().replace(ue,"-ms-");b=ge[b]=_}h+=f+b+":",f=d,h+=g=null==v||"boolean"==typeof v||""===v?"":g||"number"!=typeof v||0===v||oe.hasOwnProperty(f)&&oe[f]?(""+v).trim():v+"px",f=";"}}m=h||null}d=null;e:if(g=s,v=l,-1===g.indexOf("-"))g="string"==typeof v.is;else switch(g){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":g=!1;break e;default:g=!0}g?be.hasOwnProperty(y)||(d=P(d=y)&&null!=m?d+'="'+F(m)+'"':""):d=j(y,m),d&&(p+=" "+d)}}c||u&&(p+=' data-reactroot=""');var y=p;l="",ie.hasOwnProperty(s)?y+="/>":(y+=">",l="</"+e.type+">");e:{if(null!=(c=o.dangerouslySetInnerHTML)){if(null!=c.__html){c=c.__html;break e}}else if("string"==typeof(c=o.children)||"number"==typeof c){c=F(c);break e}c=null}return null!=c?(o=[],me[s]&&"\n"===c.charAt(0)&&(y+="\n"),y+=c):o=pe(o.children),e=e.type,a=null==a||"http://www.w3.org/1999/xhtml"===a?re(e):"http://www.w3.org/2000/svg"===a&&"foreignObject"===e?"http://www.w3.org/1999/xhtml":a,this.stack.push({domNamespace:a,type:s,children:o,childIndex:0,context:t,footer:l}),this.previousWasTextNode=!1,y},e}(),Ee={renderToString:function(e){e=new we(e,!1);try{return e.read(1/0)}finally{e.destroy()}},renderToStaticMarkup:function(e){e=new we(e,!0);try{return e.read(1/0)}finally{e.destroy()}},renderToNodeStream:function(){throw Error(i(207))},renderToStaticNodeStream:function(){throw Error(i(208))},version:"16.12.0"},ke={default:Ee},Ie=ke&&Ee||ke;e.exports=Ie.default||Ie},574:function(e,t,a){e.exports=a(575)},575:function(e,t,a){a(576);var n=a(26);e.exports=n.Date.now},576:function(e,t,a){a(17)({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}})},589:function(e,t,a){e.exports=a(298)},590:function(e,t,a){e.exports=a(591)},591:function(e,t,a){e.exports=a(470)},592:function(e,t,a){var n=a(477),r=a(593);e.exports=function(e,t){if(null==e)return{};var a,i,s={},o=r(e);for(i=0;i<o.length;i++)a=o[i],n(t).call(t,a)>=0||(s[a]=e[a]);return s}},593:function(e,t,a){e.exports=a(594)},594:function(e,t,a){e.exports=a(303)},595:function(e,t,a){e.exports=a(596)},596:function(e,t,a){var n=a(597),r=Array.prototype;e.exports=function(e){var t=e.sort;return e===r||e instanceof Array&&t===r.sort?n:t}},597:function(e,t,a){a(598);var n=a(43);e.exports=n("Array").sort},598:function(e,t,a){"use strict";var n=a(17),r=a(72),i=a(53),s=a(33),o=a(110),l=[].sort,c=[1,2,3],u=s((function(){c.sort(void 0)})),p=s((function(){c.sort(null)})),d=o("sort");n({target:"Array",proto:!0,forced:u||!p||d},{sort:function(e){return void 0===e?l.call(i(this)):l.call(i(this),r(e))}})},60:function(e,t,a){e.exports=a(568)},607:function(e,t,a){e.exports=a(608)},608:function(e,t,a){a(609);var n=a(26);e.exports=n.Number.isFinite},609:function(e,t,a){a(17)({target:"Number",stat:!0},{isFinite:a(610)})},610:function(e,t,a){var n=a(32).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&n(e)}},615:function(e,t,a){e.exports=a(616)},616:function(e,t,a){var n=a(617),r=Array.prototype;e.exports=function(e){var t=e.slice;return e===r||e instanceof Array&&t===r.slice?n:t}},617:function(e,t,a){a(618);var n=a(43);e.exports=n("Array").slice},618:function(e,t,a){"use strict";var n=a(17),r=a(42),i=a(94),s=a(109),o=a(58),l=a(52),c=a(112),u=a(103),p=a(34)("species"),d=[].slice,m=Math.max;n({target:"Array",proto:!0,forced:!u("slice")},{slice:function(e,t){var a,n,u,h=l(this),f=o(h.length),g=s(e,f),v=s(void 0===t?f:t,f);if(i(h)&&("function"!=typeof(a=h.constructor)||a!==Array&&!i(a.prototype)?r(a)&&null===(a=a[p])&&(a=void 0):a=void 0,a===Array||void 0===a))return d.call(h,g,v);for(n=new(void 0===a?Array:a)(m(v-g,0)),u=0;g<v;g++,u++)g in h&&c(n,u,h[g]);return n.length=u,n}})},619:function(e,t,a){e.exports=a(620)},620:function(e,t,a){var n=a(621),r=Array.prototype;e.exports=function(e){var t=e.fill;return e===r||e instanceof Array&&t===r.fill?n:t}},621:function(e,t,a){a(622);var n=a(43);e.exports=n("Array").fill},622:function(e,t,a){var n=a(17),r=a(623),i=a(111);n({target:"Array",proto:!0},{fill:r}),i("fill")},623:function(e,t,a){"use strict";var n=a(53),r=a(109),i=a(58);e.exports=function(e){for(var t=n(this),a=i(t.length),s=arguments.length,o=r(s>1?arguments[1]:void 0,a),l=s>2?arguments[2]:void 0,c=void 0===l?a:r(l,a);c>o;)t[o++]=e;return t}},624:function(e,t){jQuery.AsyncQueue=function(){var e,t,a,n,r=this,s=[],o=!1;return n=function(){var e=s.shift();e?(e.apply(r,[r]),!1===o&&n()):t&&t.apply(r)},this.onFailure=function(t){e=t},this.onComplete=function(e){t=e},this.add=function(e){return s.push(e),this},this.storeData=function(e){return a=e,this},this.lastCallbackData=function(){return a},this.run=function(){o=!1,n()},this.pause=function(){return o=!0,this},this.failure=function(){if(o=!0,e){var t=[r];for(i=0;i<arguments.length;i++)t.push(arguments[i]);e.apply(r,t)}},this}},625:function(e,t,a){e.exports=a(626)},626:function(e,t,a){a(627);var n=a(26);e.exports=n.Object.values},627:function(e,t,a){var n=a(17),r=a(473).values;n({target:"Object",stat:!0},{values:function(e){return r(e)}})},648:function(e,t,a){"use strict";a.r(t);var n=a(95),r=a.n(n),i=a(96),s=a.n(i),o=a(69),l=a.n(o),c=a(24),u=a.n(c),p=a(70),d=a.n(p),m=a(18),h=a.n(m),f=a(71),g=a.n(f),v=a(28),b=a.n(v),_=a(8),y=a.n(_),w=a(15),E=a.n(w),k=a(61),I=a.n(k),S=a(29),C=a.n(S),N=a(7),x=a.n(N),T=a(0),R=a.n(T),P=a(3),O=a.n(P),D=a(25),A=a.n(D),q=a(1),L=a(9),F=a.n(L),j=a(11),M=a.n(j),V=a(10),B=a.n(V),z=a(12),U=a.n(z),$=a(13),W=a.n($),H=a(6),K=a.n(H),G=a(14),Y=a.n(G),J=a(64),Q=a(2),Z=a.n(Q);function X(e){var t=[{name:"type",label:q.a.I18n.t("selectType")},{name:"events",label:q.a.I18n.t("events")},{name:"conditions",label:q.a.I18n.t("conditions")},{name:"template",label:q.a.I18n.t("template")},{name:"editor",label:q.a.I18n.t("designer")},{name:"send",label:q.a.I18n.t("send")}];return R.a.createElement(J.a,{step:e.step,steps:t})}X.propTypes={step:Z.a.string.isRequired};var ee=X,te=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this.props.event,a=t.soon;if(this.props.premium)e=R.a.createElement("a",{href:"?page=mailpoet-premium",target:"_blank"},q.a.I18n.t("premiumFeatureLink"));else if(t.actionButtonLink&&t.actionButtonTitle)e=R.a.createElement("a",{href:t.actionButtonLink,target:"_blank",rel:"noopener noreferrer"},t.actionButtonTitle);else{var n=a?null:O.a.partial(this.props.eventsConfigurator,t.slug);e=R.a.createElement("a",{className:"button button-primary",disabled:a,onClick:n,role:"presentation","data-automation-id":"create_".concat(t.slug),onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),n())}},t.actionButtonTitle||q.a.I18n.t("setUp"))}return R.a.createElement("li",{"data-type":t.slug},R.a.createElement("div",{className:"mailpoet_thumbnail"},t.thumbnailImage?R.a.createElement("img",{src:t.thumbnailImage,alt:""}):null),R.a.createElement("div",{className:"mailpoet_boxes_content"},R.a.createElement("div",{className:"mailpoet_description"},R.a.createElement("div",{className:"title_and_badge"},R.a.createElement("h3",null,t.title," ",t.soon?"(".concat(q.a.I18n.t("soon"),")"):""),t.badge?R.a.createElement("span",{className:"mailpoet_badge mailpoet_badge_".concat(t.badge.style)},t.badge.text):""),R.a.createElement("p",null,t.description)),R.a.createElement("div",{className:"mailpoet_actions"},e)))}}]),t}(R.a.PureComponent);te.defaultProps={premium:!1},te.propTypes={premium:Z.a.bool,eventsConfigurator:Z.a.func.isRequired,event:Z.a.shape({slug:Z.a.string.isRequired,thumbnailImage:Z.a.string,actionButtonLink:Z.a.string,title:Z.a.string.isRequired,soon:Z.a.bool,badge:Z.a.shape({style:Z.a.string,text:Z.a.string}),description:Z.a.string.isRequired,actionButtonTitle:Z.a.string}).isRequired};var ae=te,ne=a(105),re=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).email=n.props.email,n.emailEvents=n.email.events,n.eventsConfigurator=F()(a=n.eventsConfigurator).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"eventsConfigurator",value:function(e){var t;q.a.trackEvent("Emails > Automatic Type selected",{"MailPoet Free version":window.mailpoet_version,"MailPoet Premium version":window.mailpoet_premium_version,"Email type":e}),this.props.history.push(E()(t="/new/".concat(this.email.slug,"/")).call(t,e,"/conditions"))}},{key:"displayEvents",value:function(){var e=this,t=x()(O.a).call(O.a,this.emailEvents,(function(t,a){return R.a.createElement(ae,{premium:e.email.premium,event:t,key:a,eventsConfigurator:e.eventsConfigurator})}));return R.a.createElement("ul",{className:"mailpoet_boxes woocommerce clearfix"},t)}},{key:"render",value:function(){var e=q.a.I18n.t("selectAutomaticEmailsEventsHeading").replace("%$1s",this.email.title);return R.a.createElement("div",null,R.a.createElement("h1",null,e),R.a.createElement(ee,{step:"events"}),this.displayEvents())}}]),t}(R.a.Component);re.propTypes={email:Z.a.shape({title:Z.a.string.isRequired,slug:Z.a.string.isRequired,premium:Z.a.bool}).isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var ie=Object(ne.withRouter)(re),se=a(30),oe=a.n(se),le=a(40),ce=a.n(le),ue=a(50),pe=a.n(ue),de=a(35),me=a.n(de),he=a(319),fe=a.n(he),ge=a(4),ve=a.n(ge),be=a(39),_e=a.n(be),ye=(a(456),function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"getFieldId",(function(e){var t=e||a.props;return t.field.id||t.field.name})),y()(K()(a),"getSelectedValues",(function(){if(void 0!==a.props.field.selected)return a.props.field.selected(a.props.item);if(void 0!==a.props.item&&void 0!==a.props.field.name){if(!a.allowMultipleValues())return a.props.item[a.props.field.name];var e;if(O.a.isArray(a.props.item[a.props.field.name]))return x()(e=a.props.item[a.props.field.name]).call(e,(function(e){return e.id}))}return null})),y()(K()(a),"getItems",(function(){var e;return void 0!==window["mailpoet_".concat(a.props.field.endpoint)]?e=window["mailpoet_".concat(a.props.field.endpoint)]:void 0!==ce()(a.props.field)&&(e=ce()(a.props.field)),O.a.isArray(e)&&void 0!==h()(a.props.field)&&(e=h()(e).call(e,h()(a.props.field))),e})),y()(K()(a),"getLabel",(function(e){return void 0!==a.props.field.getLabel?a.props.field.getLabel(e,a.props.item):e.name})),y()(K()(a),"getSearchLabel",(function(e){return void 0!==a.props.field.getSearchLabel?a.props.field.getSearchLabel(e,a.props.item):null})),y()(K()(a),"getValue",(function(e){return void 0!==a.props.field.getValue?a.props.field.getValue(e,a.props.item):e.id})),y()(K()(a),"setupSelect2",(function(){if(!a.isSelect2Initialized()){var e={disabled:a.props.disabled||!1,width:a.props.width||"",placeholder:{id:"",text:a.props.field.placeholder},templateResult:function(e){return e.element&&e.element.selected?null:e.title?e.title:e.text}},t=a.props.field.remoteQuery||null;t&&(e=fe()(e,{ajax:{url:window.ajaxurl,type:"POST",dataType:"json",data:function(e){return{action:"mailpoet",api_version:window.mailpoet_api_version,token:window.mailpoet_token,endpoint:t.endpoint,method:t.method,data:fe()(t.data,{query:e.term})}},processResults:function(e){var t,a;O.a.has(e,"data")?t=x()(a=e.data).call(a,(function(e){return{id:e.id||e.value,text:e.name||e.text}})):t=[];return{results:t}}},minimumInputLength:t.minimumInputLength||2})),void 0!==a.props.field.extendSelect2Options&&(e=fe()(e,a.props.field.extendSelect2Options));var n=ve()("#".concat(a.selectRef.current.id)).select2(e),r=!1;n.on("select2:unselecting",(function(){r=!0})),n.on("select2:opening",(function(e){!0===r&&(r=!1,e.preventDefault())})),n.on("change",a.handleChange)}})),y()(K()(a),"resetSelect2",(function(){a.destroySelect2(),a.setupSelect2()})),y()(K()(a),"destroySelect2",(function(){a.isSelect2Initialized()&&(ve()("#".concat(a.selectRef.current.id)).select2("destroy"),a.cleanupAfterSelect2())})),y()(K()(a),"cleanupAfterSelect2",(function(){var e;me()(e=ve()("#".concat(a.selectRef.current.id))).call(e,"option:not(.default)").remove(),ve()("#".concat(a.selectRef.current.id)).off("select2:unselecting").off("select2:opening")})),y()(K()(a),"allowMultipleValues",(function(){return!0===a.props.field.multiple})),y()(K()(a),"isSelect2Initialized",(function(){return!0===ve()("#".concat(a.selectRef.current.id)).hasClass("select2-hidden-accessible")})),y()(K()(a),"isSelect2Component",(function(){return a.allowMultipleValues()||a.props.field.forceSelect2})),y()(K()(a),"handleChange",(function(e){var t;if(void 0!==a.props.onValueChange){var n=x()(t=ve()("#".concat(a.selectRef.current.id)).children(":selected")).call(t,(function(){return{id:ve()(this).val(),text:ve()(this).text()}})),r=a.props.field.multiple?O.a.pluck(n,"id"):O.a.pluck(n,"id").toString(),i=a.transformChangedValue(r,n);a.props.onValueChange({target:{value:i,name:a.props.field.name,id:e.target.id}})}})),y()(K()(a),"transformChangedValue",(function(e,t){return"function"==typeof a.props.field.transformChangedValue?a.props.field.transformChangedValue.call(K()(a),e,t):e})),y()(K()(a),"insertEmptyOption",(function(){if(!a.allowMultipleValues())return a.props.field.placeholder?R.a.createElement("option",{className:"default"}):void 0})),a.selectRef=R.a.createRef(),a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){this.isSelect2Component()&&this.setupSelect2()}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.item&&void 0!==e.item&&this.props.item.id!==e.item.id&&ve()("#".concat(this.selectRef.current.id)).val(this.getSelectedValues()).trigger("change"),this.isSelect2Initialized()&&this.getFieldId(this.props)!==this.getFieldId(e)&&void 0!==this.props.field.resetSelect2OnUpdate&&this.resetSelect2()}},{key:"componentWillUnmount",value:function(){this.isSelect2Component()&&this.destroySelect2()}},{key:"render",value:function(){var e=this,t=this.getItems(this.props.field),a=this.getSelectedValues(),n=x()(t).call(t,(function(t){var a=e.getLabel(t),n=e.getSearchLabel(t),r=e.getValue(t);return R.a.createElement("option",{key:"option-".concat(t.id),className:"default",value:r,title:n},a)}));return R.a.createElement("select",pe()({id:this.getFieldId(),ref:this.selectRef,disabled:this.props.field.disabled,"data-placeholder":this.props.field.placeholder,multiple:this.props.field.multiple,defaultValue:a},this.props.field.validation),this.insertEmptyOption(),n)}}]),t}(R.a.Component));ye.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.oneOfType([Z.a.object,Z.a.array]),getLabel:Z.a.func,resetSelect2OnUpdate:Z.a.bool,selected:Z.a.func,endpoint:Z.a.string,filter:Z.a.func,getSearchLabel:Z.a.func,getValue:Z.a.func,placeholder:Z.a.string,remoteQuery:Z.a.object,extendSelect2Options:Z.a.object,multiple:Z.a.bool,forceSelect2:Z.a.bool,transformChangedValue:Z.a.func,disabled:Z.a.bool,validation:Z.a.object}).isRequired,item:Z.a.object,disabled:Z.a.bool,width:Z.a.string},ye.defaultProps={onValueChange:function(){},disabled:!1,width:"",item:void 0};var we=ye,Ee=a(114),ke=a.n(Ee),Ie=a(23),Se=a.n(Ie),Ce=a(21),Ne=a.n(Ce),xe=a(480),Te=a.n(xe),Re=a(60),Pe=a.n(Re),Oe=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t,a=this.props.field.name||null,n=this.props.item||{};this.props.onValueChange instanceof Function&&(e=void 0===(e=n[this.props.field.name])?this.props.field.defaultValue||"":e),!e&&this.props.field.defaultValue&&(t=this.props.field.defaultValue);var r=this.props.field.id||null;!r&&this.props.field.name&&(r="field_".concat(this.props.field.name));var i=this.props.field.class||null;return i||this.props.field.size||(i="regular-text"),R.a.createElement("input",pe()({type:"text",disabled:void 0!==this.props.field.disabled&&this.props.field.disabled(this.props.item),className:i,size:"auto"!==this.props.field.size&&this.props.field.size>0?this.props.field.size:null,name:a,id:r,value:e,defaultValue:t,placeholder:this.props.field.placeholder,onChange:this.props.onValueChange},this.props.field.validation))}}]),t}(R.a.Component);Oe.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,defaultValue:Z.a.string,id:Z.a.string,class:Z.a.string,size:Z.a.oneOfType([Z.a.string,Z.a.number]),disabled:Z.a.func,placeholder:Z.a.string,validation:Z.a.object}).isRequired,item:Z.a.object.isRequired},Oe.defaultProps={onValueChange:function(){}};var De=Oe,Ae=window.mailpoet_time_format||"H:i",qe={immediate:q.a.I18n.t("delayImmediately"),hours:q.a.I18n.t("delayHoursAfter"),days:q.a.I18n.t("delayDaysAfter"),weeks:q.a.I18n.t("delayWeeksAfter")},Le={daily:q.a.I18n.t("daily"),weekly:q.a.I18n.t("weekly"),monthly:q.a.I18n.t("monthly"),nthWeekDay:q.a.I18n.t("monthlyEvery"),immediately:q.a.I18n.t("immediately")},Fe=O.a.object(x()(O.a).call(O.a,O.a.times(24,(function(e){return 3600*e})),(function(e){var t=new Date(null);return t.setSeconds(e),[e,q.a.Date.format(t,{format:Ae,offset:0})]}))),je={0:q.a.I18n.t("sunday"),1:q.a.I18n.t("monday"),2:q.a.I18n.t("tuesday"),3:q.a.I18n.t("wednesday"),4:q.a.I18n.t("thursday"),5:q.a.I18n.t("friday"),6:q.a.I18n.t("saturday")},Me=O.a.object(x()(O.a).call(O.a,O.a.times(28,(function(e){return e})),(function(e){var t={0:q.a.I18n.t("first"),1:q.a.I18n.t("second"),2:q.a.I18n.t("third")};return[e+1,void 0!==t[e]?t[e]:q.a.I18n.t("nth").replace("%$1d",e+1)]}))),Ve={1:q.a.I18n.t("first"),2:q.a.I18n.t("second"),3:q.a.I18n.t("third"),L:q.a.I18n.t("last")},Be="immediate",ze=1,Ue=30,$e=function(e){function t(e){var a,n;M()(this,t);var r=(n=U()(this,W()(t).call(this,e))).props,i=r.item,s=r.event;n.handleChange=F()(a=n.handleChange).call(a,K()(n));var o=i.afterTimeType||s.defaultAfterTimeType||Be,l="minutes"===o?Ue:ze,c=i.afterTimeNumber||l;return n.state={afterTimeType:o,afterTimeNumber:c},i.afterTimeNumber===c&&i.afterTimeType===o||n.propagateChange(n.state),n}return Y()(t,e),B()(t,[{key:"displayAfterTimeNumberField",value:function(){var e=this.props,t=e.afterTimeNumberSize,a=e.event,n=this.state,r=n.afterTimeType,i=n.afterTimeNumber;if("immediate"===r)return null;if(a.timeDelayValues&&a.timeDelayValues[r]&&!a.timeDelayValues[r].displayAfterTimeNumberField)return null;var s={field:{id:"scheduling_time_duration",name:"scheduling_time_duration",defaultValue:i?i.toString():"",size:t},item:{},onValueChange:O.a.partial(this.handleChange,O.a,"afterTimeNumber")};return R.a.createElement(De,{field:s.field,item:s.item,onValueChange:s.onValueChange})}},{key:"displayAfterTimeTypeOptions",value:function(){var e,t=this.props.event,a=qe;t.timeDelayValues&&(a=Pe()(e=Te()(t.timeDelayValues)).call(e,(function(e,t){var a=Ne()(t,2),n=a[0],r=a[1];return e[n]=r.text,e}),{}));var n=this.state.afterTimeType,r={field:{id:"scheduling_time_interval",name:"scheduling_time_interval",forceSelect2:!0,values:x()(O.a).call(O.a,a,(function(e,t){return{name:e,id:t}})),extendSelect2Options:{minimumResultsForSearch:1/0},selected:function(){return n}},onValueChange:O.a.partial(this.handleChange,O.a,"afterTimeType")};return R.a.createElement(we,{field:r.field,onValueChange:r.onValueChange})}},{key:"handleChange",value:function(e,t){var a=e.target.value;"afterTimeNumber"===t&&(a=Se()(e.target.value,10),a=ke()(a)?null:a);var n=y()({},t,a),r=this.state.afterTimeType;"afterTimeType"===t&&r!==a&&("minutes"===r&&(n.afterTimeNumber=ze),"minutes"===a&&(n.afterTimeNumber=Ue)),this.setState(n,this.propagateChange(n))}},{key:"propagateChange",value:function(e){var t=this.props.onValueChange;t&&t(e)}},{key:"render",value:function(){var e=this.props.event;return R.a.createElement(R.a.Fragment,null,R.a.createElement("div",{className:"event-scheduling-time-duration-selection"},this.displayAfterTimeNumberField()),R.a.createElement("div",{className:"event-scheduling-time-interval-selection"},this.displayAfterTimeTypeOptions()),e.schedulingReadMoreLink&&R.a.createElement("a",{href:e.schedulingReadMoreLink.link,target:"_blank",rel:"noopener noreferrer",className:"event-scheduling-read-more-link"},e.schedulingReadMoreLink.text))}}]),t}(R.a.Component);$e.propTypes={item:Z.a.shape({afterTimeType:Z.a.string.isRequired,afterTimeNumber:Z.a.number}).isRequired,afterTimeNumberSize:Z.a.number,onValueChange:Z.a.func,event:Z.a.shape({defaultAfterTimeType:Z.a.string,timeDelayValues:Z.a.objectOf(Z.a.shape({text:Z.a.string,displayAfterTimeNumberField:Z.a.bool})),schedulingReadMoreLink:Z.a.shape({link:Z.a.string.isRequired,text:Z.a.string.isRequired})}).isRequired},$e.defaultProps={afterTimeNumberSize:3,onValueChange:null};var We=$e,He=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).handleEventOptionChange=F()(a=n.handleEventOptionChange).call(a,K()(n)),n}return Y()(t,e),B()(t,null,[{key:"getEventOptionsValues",value:function(e){var t=e&&ce()(e)?ce()(e):[];return t?x()(t).call(t,(function(e){return{id:e.id,name:e.name}})):t}}]),B()(t,[{key:"displayEventOptions",value:function(){var e=this.props,t=e.eventOptions,a=e.eventSlug,n=e.selected,r=e.emailSlug;if(!t)return t;var i={field:{id:"event_options_".concat(a),name:"event_options_".concat(a),forceSelect2:!0,resetSelect2OnUpdate:!0,values:this.constructor.getEventOptionsValues(t),multiple:t.multiple||!1,placeholder:t.placeholder||!1,extendSelect2Options:{minimumResultsForSearch:1/0},transformChangedValue:function(e,t){return x()(O.a).call(O.a,t,(function(e){return{id:e.id,name:e.text}}))},selected:function(){return n}},onValueChange:this.handleEventOptionChange};return"remote"===t.type&&(i.field=O.a.extend(i.field,{remoteQuery:{minimumInputLength:t.remoteQueryMinimumInputLength||null,endpoint:"automatic_emails",method:"get_event_options",data:{filter:t.remoteQueryFilter||null,email_slug:r,event_slug:a}}})),R.a.createElement(we,{field:i.field,onValueChange:i.onValueChange})}},{key:"handleEventOptionChange",value:function(e){var t=this.props.onValueChange;t&&t({eventOptionValue:e.target.value})}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("div",{className:"event-option-selection"},this.displayEventOptions()))}}]),t}(R.a.Component);He.propTypes={selected:Z.a.array,eventOptions:Z.a.object,eventSlug:Z.a.string.isRequired,emailSlug:Z.a.string.isRequired,onValueChange:Z.a.func},He.defaultProps={eventOptions:null,selected:[],onValueChange:null};var Ke=He,Ge=a(22),Ye="immediate",Je=function(e){function t(e){var a,n,r;M()(this,t),r=U()(this,W()(t).call(this,e));var i=e.email,s=e.name;r.handleChange=F()(a=r.handleChange).call(a,K()(r)),r.handleNextStep=F()(n=r.handleNextStep).call(n,K()(r)),r.email=i,r.emailEvents=r.email.events,r.segments=h()(O.a).call(O.a,window.mailpoet_segments,(function(e){return null===e.deleted_at}));var o=r.getEvent(s),l=r.constructor.getEventOptions(o),c=r.constructor.getEventOptionsFirstValue(l);return r.state={event:o,eventSlug:o.slug,eventOptionValue:c,segment:o.sendToLists?r.constructor.getFirstSegment():null,afterTimeType:o.defaultAfterTimeType||Ye,afterTimeNumber:null},r}return Y()(t,e),B()(t,null,[{key:"getEventOptions",value:function(e){return e.options||null}},{key:"getEventOptionsFirstValue",value:function(e){return e&&O.a.isArray(ce()(e))&&ce()(e)[0].id?ce()(e)[0].id:null}},{key:"displayBreadcrumbs",value:function(){return R.a.createElement(ee,{step:"conditions"})}}]),B()(t,[{key:"getEvent",value:function(e){return this.emailEvents[e]}},{key:"getFirstSegment",value:function(){return O.a.isArray(this.segments)&&this.segments[0].id?this.segments[0].id:null}},{key:"displayHeader",value:function(){return this.state.event.title}},{key:"displayEventOptions",value:function(){var e=this.state,t=e.eventSlug,a=e.event,n={emailSlug:this.email.slug,eventSlug:t,eventOptions:this.constructor.getEventOptions(a),onValueChange:this.handleChange};return R.a.createElement(Ke,{emailSlug:n.emailSlug,eventSlug:n.eventSlug,eventOptions:n.eventOptions,onValueChange:n.onValueChange})}},{key:"displaySegments",value:function(){var e=this;if(!this.state.event.sendToLists)return null;var t={field:{id:"segments",forceSelect2:!0,values:this.segments,extendSelect2Options:{minimumResultsForSearch:1/0}},onValueChange:function(t){return e.handleChange({segment:t.target.value})}};return R.a.createElement("div",{className:"event-segment-selection"},R.a.createElement(we,{field:t.field,onValueChange:t.onValueChange}))}},{key:"displayScheduling",value:function(){var e=this.state,t={item:{afterTimeNumber:e.afterTimeNumber,afterTimeType:e.afterTimeType},event:e.event,onValueChange:this.handleChange};return R.a.createElement(We,{item:t.item,event:t.event,onValueChange:t.onValueChange})}},{key:"displayEventTip",value:function(){var e=this.state.event;return e.tip?R.a.createElement("p",{className:"description"},R.a.createElement("strong",null,q.a.I18n.t("tip"))," ",e.tip):null}},{key:"handleChange",value:function(e){var t=this.state,a=t.segment,n=t.afterTimeNumber,r=e;if(r.eventSlug){r.event=this.getEvent(r.eventSlug),r.segment=r.event.sendToLists?a||this.constructor.getFirstSegment():null;var i=this.constructor.getEventOptions(r.event);r.eventOptionValue=i?this.constructor.getEventOptionsFirstValue(i):null}r.afterTimeType&&"immediate"===r.afterTimeType?r.afterTimeNumber=null:!r.afterTimeType||r.afterTimeNumber||n||(r.afterTimeNumber=1),this.setState(r)}},{key:"handleNextStep",value:function(){var e=this,t=this.props.history,a=this.state,n=a.eventSlug,r=a.afterTimeType,i=a.afterTimeNumber,s=a.event,o=a.segment,l=a.eventOptionValue,c={group:this.email.slug,event:n,afterTimeType:r};i&&(c.afterTimeNumber=i),c.sendTo=s.sendToLists?"segment":"user",o&&(c.segment=o),l&&(c.meta=oe()({option:l})),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:"automatic",subject:q.a.I18n.t("draftNewsletterTitle"),options:c}}).done((function(e){q.a.trackEvent("Emails > New Automatic Email Created",{"MailPoet Premium version":window.mailpoet_premium_version,"MailPoet Free version":window.mailpoet_version,"Event type":c.event,"Schedule type":c.afterTimeType,"Schedule value":c.afterTimeNumber}),t.push("/template/".concat(e.data.id))})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))}},{key:"render",value:function(){var e=q.a.I18n.t("selectAutomaticEmailsEventsConditionsHeading").replace("%1s",this.email.title);return R.a.createElement("div",null,R.a.createElement("h1",null,e),this.constructor.displayBreadcrumbs(),R.a.createElement("div",{className:"events-conditions-container"},R.a.createElement("h1",null,this.displayHeader()),R.a.createElement("div",null,this.displayEventOptions()),R.a.createElement("div",null,this.displaySegments()),R.a.createElement("div",null,this.displayScheduling())),R.a.createElement("p",{className:"submit"},R.a.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleNextStep,value:q.a.I18n.t("next")})),this.displayEventTip())}}]),t}(R.a.Component);Je.contextType=Ge.a,Je.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,name:Z.a.string.isRequired,email:Z.a.shape({title:Z.a.string.isRequired,slug:Z.a.string.isRequired}).isRequired};var Qe=Je,Ze="immediate",Xe=1,et=function(e){function t(e){var a,n;M()(this,t),n=U()(this,W()(t).call(this,e));var r=e.field;n.handleChange=F()(a=n.handleChange).call(a,K()(n)),n.email=r.email,n.emailOptions=r.emailOptions,n.events=O.a.indexBy(n.email.events,"slug"),n.segments=h()(O.a).call(O.a,window.mailpoet_segments,(function(e){return null===e.deleted_at}));var i=n.events[n.emailOptions.event],s=n.emailOptions.afterTimeType||i.defaultAfterTimeType||Ze;return n.state={event:i,afterTimeType:s,eventSlug:n.emailOptions.event,eventOptionValue:null,afterTimeNumber:n.emailOptions.afterTimeNumber||Xe,segment:n.emailOptions.segment?n.emailOptions.segment:null},n}return Y()(t,e),B()(t,[{key:"displayHeader",value:function(){return this.state.event.title}},{key:"displayEventOptions",value:function(){var e,t=this.state,a=t.event,n=t.eventSlug;try{e=JSON.parse(this.emailOptions.meta||null)}catch(t){e=this.emailOptions.meta||null}var r={emailSlug:this.email.slug,eventSlug:n,onValueChange:this.handleChange,eventOptions:a.options||null};return e&&e.option&&("remote"===r.eventOptions.type&&(r.eventOptions.values=e.option),r.selected=x()(O.a).call(O.a,e.option,(function(e){return e.id}))),R.a.createElement(Ke,{emailSlug:r.emailSlug,eventSlug:r.eventSlug,eventOptions:r.eventOptions,onValueChange:r.onValueChange,selected:r.selected})}},{key:"displaySegments",value:function(){var e=this,t=this.state.segment;if("user"===this.emailOptions.sendTo)return null;var a={field:{id:"segments",forceSelect2:!0,values:this.segments,extendSelect2Options:{minimumResultsForSearch:1/0},selected:function(){return t}},onValueChange:function(t){return e.handleChange({segment:t.target.value})}};return R.a.createElement("div",{className:"event-segment-selection"},R.a.createElement(we,{field:a.field,onValueChange:a.onValueChange}))}},{key:"displayScheduling",value:function(){var e=this.state,t={item:{afterTimeNumber:e.afterTimeNumber,afterTimeType:e.afterTimeType},event:e.event,onValueChange:this.handleChange};return R.a.createElement(We,{item:t.item,event:t.event,onValueChange:t.onValueChange})}},{key:"handleChange",value:function(e){var t=this.state.afterTimeNumber,a=e;a.afterTimeType&&"immediate"===a.afterTimeType?a.afterTimeNumber=null:!a.afterTimeType||a.afterTimeNumber||t||(a.afterTimeNumber=Xe),this.setState(e,this.propagateChange)}},{key:"propagateChange",value:function(){var e=this.state,t=e.eventSlug,a=e.afterTimeType,n=e.afterTimeNumber,r=e.segment,i=e.eventOptionValue,s=this.props.onValueChange;if(s){var o={group:this.email.slug,event:t,afterTimeType:a};n&&(o.afterTimeNumber=n),r&&(o.segment=r),i&&(o.meta=oe()({option:this.state.eventOptionValue})),s({target:{name:"options",value:o}})}}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("div",{className:"events-conditions-header"},this.displayHeader()),R.a.createElement("div",{className:"events-conditions-container"},R.a.createElement("div",null,this.displayEventOptions()),R.a.createElement("div",null,this.displaySegments()),R.a.createElement("div",null,this.displayScheduling())))}}]),t}(R.a.Component);et.propTypes={field:Z.a.shape({email:Z.a.shape({events:Z.a.object.isRequired}).isRequired,emailOptions:Z.a.object.isRequired}).isRequired,onValueChange:Z.a.func},et.defaultProps={onValueChange:null};var tt=et,at=a(59),nt=a.n(at),rt=a(48),it=a.n(rt),st=a(16),ot=a(20),lt=a.n(ot),ct=a(294),ut=a.n(ct),pt=a(481),dt=a.n(pt),mt=function(e){var t=e.installedDaysAgo,a=t>30?q.a.I18n.t("reviewRequestUsingForMonths").replace("[months]",Math.round(t/30)):q.a.I18n.t("reviewRequestUsingForDays").replace("[days]",t);return R.a.createElement("div",{className:"mailpoet_review_request"},R.a.createElement("img",{src:e.reviewRequestIllustrationUrl,height:"280",width:"280",alt:""}),R.a.createElement("h2",null,q.a.I18n.t("reviewRequestHeading")),R.a.createElement("p",null,q.a.I18n.t("reviewRequestDidYouKnow").replace("[username]",e.username)),R.a.createElement("p",null,a),R.a.createElement("p",null,R.a.createElement("a",{href:"http://bit.ly/2Bi124o",target:"_blank",rel:"noopener noreferrer",className:"button button-primary"},q.a.I18n.t("reviewRequestRateUsNow"))),R.a.createElement("p",null,R.a.createElement("a",{id:"mailpoet_review_request_not_now"},q.a.I18n.t("reviewRequestNotNow"))))};mt.propTypes={installedDaysAgo:Z.a.number.isRequired,reviewRequestIllustrationUrl:Z.a.string.isRequired,username:Z.a.string.isRequired};var ht=mt,ft=null;var gt=function(){return ft||(ft=q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"analytics",action:"getTrackingData"})),ft},vt=function(){return Object(T.useLayoutEffect)((function(){var e=function(e){var t;t=window.mailpoet_display_nps_form?"EqOgKsgZd832Sz9w":window.mailpoet_is_new_user?"6L479eVPXk7pBn6S":"k0aJAsQAWI2ERyGv",dt()({writeKey:t,userId:window.mailpoet_current_wp_user.ID+window.mailpoet_site_url,traits:{name:window.mailpoet_current_wp_user.user_nicename,email:window.mailpoet_current_wp_user.user_email,mailpoetVersion:window.mailpoet_version,mailpoetPremiumIsActive:window.mailpoet_premium_active,createdAt:e.installedAtIso,newslettersSent:e.newslettersSent,welcomeEmails:e.welcomeEmails,postnotificationEmails:e.postnotificationEmails,woocommerceEmails:e.woocommerceEmails,subscribers:e.subscribers,lists:e.lists,sendingMethod:e.sendingMethod,woocommerceIsInstalled:e.woocommerceIsInstalled},events:{submit:function(e){e.rating>=9&&e.completed&&q.a.Modal.popup({width:800,template:ut.a.renderToString(ht({username:window.mailpoet_current_wp_user_firstname||window.mailpoet_current_wp_user.user_login,reviewRequestIllustrationUrl:window.mailpoet_review_request_illustration_url,installedDaysAgo:window.mailpoet_installed_days_ago})),onInit:function(){document.getElementById("mailpoet_review_request_not_now").addEventListener("click",(function(){return q.a.Modal.close()}))}})}}})};window.mailpoet_display_nps_poll&&gt().then((function(t){var a=t.data;return e(a)}))}),[]),null},bt=function(e){return function(t){return vt(),R.a.createElement(e,t)}},_t=function(e){function t(e){var a;return M()(this,t),(a=U()(this,W()(t).call(this,e))).state={tabs:A.a.applyFilters("mailpoet_newsletters_listings_tabs",[{name:"standard",label:q.a.I18n.t("tabStandardTitle"),link:"/standard"},{name:"welcome",label:q.a.I18n.t("tabWelcomeTitle"),link:"/welcome"},{name:"notification",label:q.a.I18n.t("tabNotificationTitle"),link:"/notification"}])},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this,a=x()(e=this.state.tabs).call(e,(function(e){if(!1===e.display)return null;var a=lt()("nav-tab",{"nav-tab-active":t.props.tab===e.name});return R.a.createElement(st.b,{key:"tab-".concat(e.label),className:a,"data-automation-id":"tab-".concat(e.label),to:e.link,onClick:function(){return q.a.trackEvent("Tab Emails > ".concat(e.name," clicked"),{"MailPoet Free version":window.mailpoet_version})}},e.label)}));return R.a.createElement("h2",{className:"nav-tab-wrapper","data-automation-id":"newsletters_listing_tabs"},a)}}]),t}(R.a.Component);_t.propTypes={tab:Z.a.string.isRequired};var yt=bt(_t),wt=function(){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("pageTitle"),R.a.createElement(st.b,{id:"mailpoet-new-email",className:"page-title-action",to:"/new",onClick:function(){return q.a.trackEvent("Emails > Add New",{"MailPoet Free version":window.mailpoet_version})},"data-automation-id":"new_email"},q.a.I18n.t("new"))))},Et=a(317),kt=a.n(Et),It=a(36),St=a.n(It),Ct=function(e){function t(e){var a,n,r,i;return M()(this,t),(i=U()(this,W()(t).call(this,e))).loadBeamer=F()(a=i.loadBeamer).call(a,K()(i)),i.beamerCallback=F()(n=i.beamerCallback).call(n,K()(i)),i.showBeamer=F()(r=i.showBeamer).call(r,K()(i)),i.state={showDot:e.hasNews,beamerLoaded:void 0!==window.Beamer,beamerInitialized:!1},i}return Y()(t,e),B()(t,null,[{key:"updateLastAnnouncementSeenValue",value:function(){var e={last_announcement_seen:Math.floor(kt()()/1e3)};q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"user_flags",action:"set",data:e})}},{key:"showPluginUpdateNotice",value:function(){if(window.mailpoet_update_available&&!document.getElementById("mailpoet_update_notice")){var e=St()(q.a.I18n.t("updateMailPoetNotice"),/\[link\](.*?)\[\/link\]/,(function(e){return'<a href="update-core.php">'.concat(e,"</a>")})).join("");ve()("#beamerOverlay").append('<p id="mailpoet_update_notice" class="mailpoet_in_beamer_update_notice">'.concat(e,"</p>"))}}}]),B()(t,[{key:"loadBeamer",value:function(){window.beamer_config={product_id:"VvHbhYWy7118",selector:"#beamer-empty-element",language:window.mailpoet_user_locale,callback:this.beamerCallback},window.mailpoet_woocommerce_active&&(window.beamer_config.filter="woocommerce"),q.a.Modal.loading(!0),window.mailpoet_feature_announcement_has_news=!1,this.setState({beamerLoaded:!0});var e=document.createElement("script");e.type="text/javascript",e.src="https://app.getbeamer.com/js/beamer-embed.js",document.getElementsByTagName("body")[0].appendChild(e)}},{key:"beamerCallback",value:function(){this.state.beamerInitialized||(this.showBeamer(),this.setState({beamerInitialized:!0}))}},{key:"showBeamer",value:function(e){e&&e.preventDefault(),this.state.beamerLoaded?(this.setState({showDot:!1}),q.a.Modal.loading(!1),window.Beamer.show(),t.updateLastAnnouncementSeenValue(),t.showPluginUpdateNotice()):this.loadBeamer()}},{key:"render",value:function(){var e=lt()("button mailpoet_feature_announcement_button",this.state.showDot?"mailpoet_feature_announcement_dot":"");return R.a.createElement("div",{className:"mailpoet_feature_announcement"},R.a.createElement("button",{type:"button",onClick:this.showBeamer,className:e,title:q.a.I18n.t("whatsNew")},R.a.createElement("span",{className:"mailpoet_feature_announcement_icon dashicons dashicons-carrot"})),R.a.createElement("span",{id:"beamer-empty-element"}))}}]),t}(R.a.Component);Ct.propTypes={hasNews:Z.a.bool},Ct.defaultProps={hasNews:!1};var Nt=Ct,xt=function(){q.a.trackEvent("User has clicked a CTA to view detailed stats",{"MailPoet Free version":window.mailpoet_version})},Tt=function(e){return e.unshift({name:"stats",link:function(e){return R.a.createElement(st.b,{to:"/stats/".concat(e.id),onClick:A.a.applyFilters("mailpoet_newsletters_listing_stats_tracking",xt)},q.a.I18n.t("statsListingActionTitle"))},display:function(e){var t=e.queue&&e.queue.count_processed;return Number(e.total_sent||t)>0}}),e},Rt=function(e){e.meta.mta_log.error&&"authorization"===e.meta.mta_log.error.operation&&(q.a.Notice.hide("mailpoet_notice_being_sent"),q.a.Notice.error(e.meta.mta_log.error.error_message,{static:!0,id:"mailpoet_authorization_error"}),ve()(".js-button-resume-sending").on("click",(function(){ve()('[data-id="mailpoet_authorization_error"]').slideUp()})))},Pt=function(e){if(!1===e.meta.cron_accessible){var t=St()(q.a.I18n.t("cronNotAccessibleNotice"),/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{href:"https://kb.mailpoet.com/article/231-sending-does-not-work","data-beacon-article":"5a0257ac2c7d3a272c0d7ad6",target:"_blank",rel:"noopener noreferrer",key:"check-cron"},e)}));q.a.Notice.error("",{static:!0,id:"mailpoet_cron_error"}),_e.a.render(R.a.createElement("div",null,R.a.createElement("p",null,t)),ve()('[data-id="mailpoet_cron_error"]')[0])}else q.a.Notice.hide("mailpoet_cron_error")},Ot=a(5),Dt=a.n(Ot),At=a(63),qt=a.n(At),Lt=a(116),Ft=a.n(Lt),jt=function(e){var t=e.newsletter,a=e.isSent,n=e.currentTime,r=a;if(void 0===r&&(r=t.statistics&&t.queue&&"scheduled"!==t.queue.status),!r)return R.a.createElement("span",null,q.a.I18n.t("notSentYet"));var i={link:"/stats/".concat(t.id),onClick:A.a.applyFilters("mailpoet_newsletters_listing_stats_tracking",xt)},s=Number(t.total_sent||t.queue.count_processed),o=0,l=0,c=0,u=null;s>0&&(o=100*t.statistics.clicked/s,l=100*t.statistics.opened/s,c=100*t.statistics.unsubscribed/s,u=t.statistics.revenue);var p,d,m,h,f,g=q.a.Num.toLocaleFixed(o,1),v=q.a.Num.toLocaleFixed(l,1),b=q.a.Num.toLocaleFixed(c,1);void 0!==n?(p=6,d=t.queue.scheduled_at||t.queue.created_at,h=(m=Dt()(n).diff(Dt()(d),"hours"))<p,f=!0):(h=!1,f=!1);var _;_=s>=20&&t.statistics.opened>=5&&!h?R.a.createElement("div",{className:"mailpoet_stats_text"},R.a.createElement("div",null,R.a.createElement("span",null,v,"%"," "),R.a.createElement(Ft.a,{stat:"opened",rate:l,tooltipId:"opened-".concat(t.id)})),R.a.createElement("div",null,R.a.createElement("span",null,g,"%"," "),R.a.createElement(Ft.a,{stat:"clicked",rate:o,tooltipId:"clicked-".concat(t.id)})),R.a.createElement("div",null,R.a.createElement("span",{className:"mailpoet_stat_hidden"},b,"%"))):R.a.createElement("div",null,R.a.createElement("span",{className:"mailpoet_stats_text"},v,"%,"," ",g,"%",R.a.createElement("span",{className:"mailpoet_stat_hidden"},","," ",b,"%")));var y,w=function(e,a){var n;return function(e,t,a,n){return n<=0||!t.link?e:t.externalLink?R.a.createElement("a",{key:"stats-".concat(a),href:t.link,onClick:t.onClick||null},e):R.a.createElement(st.b,{key:"stats-".concat(a),to:t.link,onClick:t.onClick||null},e)}(e,i,E()(n="".concat(a,"-")).call(n,t.id),s)},k=R.a.createElement(R.a.Fragment,null,w(_,"opened-and-clicked"),null!==u&&u.value>0&&R.a.createElement("div",{className:"mailpoet_stats_text"},w(u.formatted,"revenue")," ",R.a.createElement(qt.a,{tooltip:q.a.I18n.t("revenueStatsTooltip"),place:"left",tooltipId:"helpTooltipStatsRevenue"})),h&&w(R.a.createElement("div",{className:"mailpoet_badge mailpoet_badge_green"},q.a.I18n.t("checkBackInHours").replace("%$1d",p-m)),"check-back"));return f&&l<5&&m>=24&&s>=10&&(y=R.a.createElement("div",null,R.a.createElement("a",{href:"https://kb.mailpoet.com/article/191-how-to-improve-my-open-and-click-rates","data-beacon-article":"58f671152c7d3a057f8858e8",target:"_blank",rel:"noopener noreferrer",className:"mailpoet_stat_link_small"},q.a.I18n.t("improveThisLinkText")))),R.a.createElement("div",null,k,y)},Mt=Z.a.shape({clicked:Z.a.number,opened:Z.a.number,unsubscribed:Z.a.number,revenue:Z.a.shape({count:Z.a.number,currency:Z.a.string,formatted:Z.a.string,value:Z.a.number})}),Vt=Z.a.shape({status:Z.a.string,count_processed:Z.a.string.isRequired,count_total:Z.a.string.isRequired,created_at:Z.a.string,scheduled_at:Z.a.string});jt.propTypes={newsletter:Z.a.shape({id:Z.a.number.isRequired,queue:Z.a.oneOfType([Vt,Z.a.bool]),total_sent:Z.a.number,statistics:Z.a.oneOfType([Mt,Z.a.bool])}).isRequired,isSent:Z.a.bool,currentTime:Z.a.string},jt.defaultProps={isSent:void 0,currentTime:void 0};var Bt=jt,zt=a(51),Ut=a.n(zt),$t=a(78),Wt=a.n($t),Ht=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"setupNewsletter",(function(e){void 0!==e&&(a.props.history.push("/new/".concat(e)),q.a.trackEvent("Emails > Type selected",{"MailPoet Free version":window.mailpoet_version,"Email type":e}))})),y()(K()(a),"getAutomaticEmails",(function(){return window.mailpoet_automatic_emails?x()(O.a).call(O.a,window.mailpoet_automatic_emails,(function(e){var t=e,n=O.a.partial(a.setupNewsletter,e.slug);return t.action=R.a.createElement("div",null,R.a.createElement("a",{className:"button button-primary",onClick:n,role:"button",tabIndex:0,disabled:a.state.isCreating,onKeyDown:function(e){var t,n;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(n=["Enter"," "]).call(n,e.key)&&(e.preventDefault(),a.onClick())}},q.a.I18n.t("setUp"))),t})):[]})),y()(K()(a),"getAdditionalTypes",(function(){return window.mailpoet_woocommerce_active?[{slug:"wc_transactional",title:q.a.I18n.t("wooCommerceCustomizerTypeTitle"),description:q.a.I18n.t("wooCommerceCustomizerTypeDescription"),action:R.a.createElement("a",{className:"button button-primary","data-automation-id":"customize_woocommerce",onClick:a.openWooCommerceCustomizer,role:"button",tabIndex:0,onKeyDown:function(e){var t,n;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(n=["Enter"," "]).call(n,e.key)&&(e.preventDefault(),a.openWooCommerceCustomizer())}},q.a.I18n.t("customize"))}]:[]})),y()(K()(a),"openWooCommerceCustomizer",Wt()(Ut.a.mark((function e(){var t,n,r;return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(q.a.trackEvent("Emails > Type selected",{"MailPoet Free version":window.mailpoet_version,"Email type":"wc_transactional"}),t=window.mailpoet_woocommerce_transactional_email_id){e.next=15;break}return e.prev=3,e.next=6,q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:{"woocommerce.use_mailpoet_editor":1}});case 6:n=e.sent,t=n.data.woocommerce.transactional_email_id,q.a.trackEvent("Emails > WooCommerce email customizer enabled",{"MailPoet Free version":window.mailpoet_version}),e.next=15;break;case 11:return e.prev=11,e.t0=e.catch(3),e.t0.errors.length>0&&a.context.notices.error(x()(r=e.t0.errors).call(r,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0}),e.abrupt("return");case 15:window.location.href="?page=mailpoet-newsletter-editor&id=".concat(t);case 16:case"end":return e.stop()}}),e,null,[[3,11]])})))),y()(K()(a),"createNewsletter",(function(e){a.setState({isCreating:!0}),q.a.trackEvent("Emails > Type selected",{"MailPoet Free version":window.mailpoet_version,"Email type":e}),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:e,subject:q.a.I18n.t("draftNewsletterTitle")}}).done((function(e){a.props.history.push("/template/".concat(e.data.id))})).fail((function(e){var t;(a.setState({isCreating:!1}),e.errors.length>0)&&a.context.notices.error(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))})),a.state={isCreating:!1},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=O.a.partial(this.createNewsletter,"standard"),a=O.a.partial(this.setupNewsletter,"notification"),n=O.a.partial(this.setupNewsletter,"welcome"),r=[{slug:"standard",title:q.a.I18n.t("regularNewsletterTypeTitle"),description:q.a.I18n.t("regularNewsletterTypeDescription"),action:R.a.createElement("a",{className:"button button-primary","data-automation-id":"create_standard",onClick:t,role:"button",tabIndex:0,disabled:this.state.isCreating,onKeyDown:function(e){var a,n;C()(a=["keydown","keypress"]).call(a,e.type)&&C()(n=["Enter"," "]).call(n,e.key)&&(e.preventDefault(),t())}},q.a.I18n.t("create"))},{slug:"welcome",title:q.a.I18n.t("welcomeNewsletterTypeTitle"),description:q.a.I18n.t("welcomeNewsletterTypeDescription"),videoGuide:"https://kb.mailpoet.com/article/254-video-guide-to-welcome-emails",videoGuideBeacon:"5b05ebf20428635ba8b2aa53",action:R.a.createElement("a",{className:"button button-primary",onClick:n,"data-automation-id":"create_welcome",disabled:this.state.isCreating,onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),n())},role:"button",tabIndex:0},q.a.I18n.t("setUp"))},{slug:"notification",title:q.a.I18n.t("postNotificationNewsletterTypeTitle"),description:q.a.I18n.t("postNotificationNewsletterTypeDescription"),videoGuide:"https://kb.mailpoet.com/article/210-video-guide-to-post-notifications",videoGuideBeacon:"59ba6fb3042863033a1cd5a5",action:R.a.createElement("a",{className:"button button-primary","data-automation-id":"create_notification",onClick:a,role:"button",disabled:this.state.isCreating,tabIndex:0,onKeyDown:function(e){var t,n;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(n=["Enter"," "]).call(n,e.key)&&(e.preventDefault(),a())}},q.a.I18n.t("setUp"))}],i=A.a.applyFilters("mailpoet_newsletters_types",E()(e=[]).call(e,r,I()(this.getAutomaticEmails())),this);i=E()(i).call(i,this.getAdditionalTypes()),h()(this.props)&&(i=h()(i).call(i,h()(this.props)));var s=!0===window.mailpoet_is_new_user?"mailpoet_badge mailpoet_badge_video":"mailpoet_badge mailpoet_badge_video mailpoet_badge_video_grey",o=q.a.Ajax.constructGetUrl({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"getAll"});return R.a.createElement("div",null,R.a.createElement("link",{rel:"prefetch",href:window.mailpoet_editor_javascript_url,as:"script"}),this.props.showHeader&&R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",null,q.a.I18n.t(0===window.mailpoet_newsletters_count?"createFirstEmailTitle":"pickCampaignType")),R.a.createElement(J.a,{step:"type"})),R.a.createElement("ul",{className:"mailpoet_boxes mailpoet_boxes_types"},x()(i).call(i,(function(e){return R.a.createElement("li",{key:e.slug,"data-type":e.slug,className:"mailpoet_newsletter_types"},R.a.createElement("div",{className:"mailpoet_thumbnail"},e.thumbnailImage?R.a.createElement("img",{src:e.thumbnailImage,alt:""}):null),R.a.createElement("div",{className:"mailpoet_boxes_content"},R.a.createElement("div",{className:"mailpoet_description"},R.a.createElement("h3",null,e.title," ",e.beta?"(".concat(q.a.I18n.t("beta"),")"):""),R.a.createElement("p",null,e.description),e.videoGuide&&R.a.createElement("a",{className:s,href:e.videoGuide,"data-beacon-article":e.videoGuideBeacon,target:"_blank",rel:"noopener noreferrer"},R.a.createElement("span",{className:"dashicons dashicons-format-video"}),q.a.I18n.t("seeVideoGuide"))),R.a.createElement("div",{className:"mailpoet_actions"},e.action)))}),this)),R.a.createElement("link",{rel:"prefetch",href:o,as:"fetch"}))}}]),t}(R.a.Component);Ht.contextType=Ge.a,Ht.propTypes={filter:Z.a.func,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,showHeader:Z.a.bool},Ht.defaultProps={filter:null,showHeader:!0};var Kt=Object(ne.withRouter)(Ht),Gt=a(47),Yt=a.n(Gt),Jt=function(e){var t=e.onClose,a=e.onDisplay,n=e.renderInPlace,r=e.timeout,i=e.scroll,s=e.children,o=e.closable,l=e.type,c=R.a.useState(!1),u=Ne()(c,2),p=u[0],d=u[1],m=R.a.useRef(null),h=R.a.useRef(null),f=R.a.useCallback((function(){t&&t(),d(!0)}),[t]);if(R.a.useEffect((function(){return r&&(h.current=Yt()(f,r)),function(){return h.current?clearTimeout(h.current):null}}),[f,r]),R.a.useLayoutEffect((function(){i&&m.current&&m.current.scrollIntoView(!1)}),[i]),R.a.useLayoutEffect((function(){a&&a()}),[a]),p)return null;var g=R.a.createElement("div",{ref:m,className:"mailpoet_base_notice mailpoet_".concat(l,"_notice")},s,o&&R.a.createElement("button",{type:"button",className:"notice-dismiss",onClick:f},R.a.createElement("span",{className:"screen-reader-text"},q.a.I18n.t("dismissNotice"))));return n?g:_e.a.createPortal(g,document.getElementById("mailpoet_notices"))};Jt.propTypes={type:Z.a.oneOf(["success","info","warning","error"]).isRequired,children:Z.a.node.isRequired,scroll:Z.a.bool,closable:Z.a.bool,renderInPlace:Z.a.bool,onDisplay:Z.a.func,onClose:Z.a.func,timeout:Z.a.oneOfType([Z.a.number,Z.a.oneOf([!1])])},Jt.defaultProps={timeout:1e4,scroll:!1,closable:!0,renderInPlace:!1,onDisplay:void 0,onClose:void 0};var Qt=Jt,Zt=function(){if(!window.mailpoet_subscribers_limit_reached)return null;var e=window.mailpoet_has_valid_api_key,t=q.a.I18n.t("subscribersLimitNoticeTitle").replace("[subscribersLimit]",window.mailpoet_subscribers_limit),a=q.a.I18n.t(e?"yourPlanLimit":"freeVersionLimit").replace("[subscribersLimit]",window.mailpoet_subscribers_limit),n=e?"https://account.mailpoet.com/upgrade":"https://account.mailpoet.com/?s=".concat(window.mailpoet_subscribers_count+1),r=function(){var e=Wt()(Ut.a.mark((function e(){return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"services",action:"recheckKeys"});case 2:window.location.reload();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return R.a.createElement(Qt,{type:"error",timeout:!1,closable:!1,renderInPlace:!0},R.a.createElement("h3",null,t),R.a.createElement("p",null,a," ",q.a.I18n.t("youNeedToUpgrade")),R.a.createElement("p",null,R.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",className:"button button-primary",href:n},q.a.I18n.t("upgradeNow")),e&&R.a.createElement(R.a.Fragment,null," ",R.a.createElement("button",{type:"button",className:"button",onClick:r},q.a.I18n.t("refreshMySubscribers")))))},Xt=function(e){var t=e.mssKeyInvalid,a=e.subscribersCount;return t?R.a.createElement(Qt,{type:"error",timeout:!1,closable:!1,renderInPlace:!0},R.a.createElement("h3",null,q.a.I18n.t("allSendingPausedHeader")),R.a.createElement("p",null,q.a.I18n.t("allSendingPausedBody")),R.a.createElement("p",null,R.a.createElement("a",{href:"https://account.mailpoet.com?s=".concat(a),className:"button button-primary",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("allSendingPausedLink")))):null};Xt.propTypes={mssKeyInvalid:Z.a.bool.isRequired,subscribersCount:Z.a.number.isRequired};var ea=Xt,ta=!!window.mailpoet_tracking_enabled,aa=window.mailpoet_woocommerce_automatic_emails||{},na={onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},ra=[{name:"subject",label:q.a.I18n.t("subject"),sortable:!0},{name:"status",label:q.a.I18n.t("status"),width:145},{name:"settings",label:q.a.I18n.t("settings")},{name:"statistics",label:q.a.I18n.t("statistics"),display:ta},{name:"updated_at",label:q.a.I18n.t("lastModifiedOn"),sortable:!0}],ia=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:na.onTrash}],sa=[{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"edit",link:function(e){return R.a.createElement("a",{href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},q.a.I18n.t("edit"))}},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("newsletterDuplicated").replace("%$1s",e.data.subject)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"trash"}];A.a.addFilter("mailpoet_newsletters_listings_automatic_email_actions","mailpoet",Tt);var oa=function(e){function t(e){var a,n;return M()(this,t),n=U()(this,W()(t).call(this,e)),y()(K()(n),"updateStatus",(function(e){e.persist(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:Number(e.target.getAttribute("data-id")),status:e.target.value}}).done((function(e){"active"===e.data.status&&q.a.Notice.success(q.a.I18n.t("automaticEmailActivated")),n.forceUpdate()})).fail((function(t){q.a.Notice.showApiErrorNotice(t),e.target.value=t.status}))})),y()(K()(n),"renderStatus",(function(e){var t=Se()(e.total_sent,10)?q.a.I18n.t("sentToXCustomers").replace("%$1d",e.total_sent.toLocaleString()):q.a.I18n.t("notSentYet");return R.a.createElement("div",null,R.a.createElement("p",null,R.a.createElement("select",{"data-id":e.id,defaultValue:e.status,onChange:n.updateStatus},R.a.createElement("option",{value:"active"},q.a.I18n.t("active")),R.a.createElement("option",{value:"draft"},q.a.I18n.t("inactive")))),R.a.createElement("p",null,R.a.createElement(st.b,{to:"/sending-status/".concat(e.id)},t)))})),y()(K()(n),"renderSettings",(function(e){var t,a=aa[e.options.group].events[e.options.event];try{t=JSON.parse(e.options.meta||null)}catch(a){t=e.options.meta||null}var n,r,i=t&&t.option?O.a.pluck(t.option,"name"):[];if(t&&O.a.isEmpty(i))return R.a.createElement("span",{className:"mailpoet_error"},q.a.I18n.t("automaticEmailEventOptionsNotConfigured"));if((n=i.length>1&&"listingScheduleDisplayTextPlural"in a?a.listingScheduleDisplayTextPlural.replace("%s",i.join(", ")):a.listingScheduleDisplayText.replace("%s",i.join(", ")))&&"immediate"!==e.options.afterTimeType)switch(e.options.afterTimeType){case"minutes":r=q.a.I18n.t("sendingDelayMinutes").replace("%$1d",e.options.afterTimeNumber);break;case"hours":r=q.a.I18n.t("sendingDelayHours").replace("%$1d",e.options.afterTimeNumber);break;case"days":r=q.a.I18n.t("sendingDelayDays").replace("%$1d",e.options.afterTimeNumber);break;case"weeks":r=q.a.I18n.t("sendingDelayWeeks").replace("%$1d",e.options.afterTimeNumber);break;default:r=q.a.I18n.t("sendingDelayInvalid")}return R.a.createElement("span",null,n,r&&R.a.createElement(R.a.Fragment,null,R.a.createElement("br",null),r))})),y()(K()(n),"renderItem",(function(e,t){var a=lt()("manage-column","column-primary","has-row-actions");return R.a.createElement("div",null,R.a.createElement("td",{className:a},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},n.renderStatus(e)),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("settings")},n.renderSettings(e)),!0===ta?R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("statistics")},R.a.createElement(Bt,{newsletter:e,isSent:e.total_sent>0&&!!e.statistics})):null,R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("lastModifiedOn")},R.a.createElement("abbr",null,q.a.Date.format(e.updated_at))))})),n.state={eventCounts:{},newslettersCount:void 0},n.afterGetItems=F()(a=n.afterGetItems).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"afterGetItems",value:function(e){Rt(e),this.countEmailTypes(e)}},{key:"countEmailTypes",value:function(e){if(nt()(e.items)){var t,a,n=Pe()(t=x()(a=e.items).call(a,(function(e){return e.options.event}))).call(t,(function(e,t){return e[t]?e[t]+=1:e[t]=1,e}),{woocommerce_product_purchased:0,woocommerce_product_purchased_in_category:0,woocommerce_first_purchase:0});this.setState({eventCounts:n})}}},{key:"renderWarning",value:function(){var e=this.state.eventCounts;return e.woocommerce_product_purchased+e.woocommerce_product_purchased_in_category+e.woocommerce_first_purchase?"1"===window.mailpoet_woocommerce_optin_on_checkout?null:R.a.createElement("div",{className:"mailpoet_base_notice mailpoet_error_notice"},R.a.createElement("p",null,q.a.I18n.t("wooCommerceEmailsWarning")),R.a.createElement("p",null,R.a.createElement("a",{href:"?page=mailpoet-settings#woocommerce"},q.a.I18n.t("wooCommerceEmailsWarningLink")))):null}},{key:"render",value:function(){var e=this,t=this.props,a=t.match,n=t.location;return R.a.createElement("div",null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(yt,{tab:"woocommerce"}),this.renderWarning(),0===this.state.newslettersCount&&R.a.createElement(Kt,{filter:function(e){return"woocommerce"===e.slug},showHeader:!1}),0!==this.state.newslettersCount&&R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:n,params:a.params,endpoint:"newsletters",type:"automatic",base_url:"woocommerce",onRenderItem:this.renderItem,columns:ra,bulk_actions:ia,item_actions:sa,messages:na,auto_refresh:!0,sort_by:"updated_at",sort_order:"desc",afterGetItems:function(t){if(!t.loading){var a,n=Pe()(a=t.groups).call(a,(function(e,t){return e+t.count}),0);e.setState({newslettersCount:n})}e.afterGetItems(t)}}))}}]),t}(R.a.Component);oa.propTypes={match:Z.a.shape({params:Z.a.shape({tab:Z.a.string}).isRequired}).isRequired,location:Z.a.object.isRequired};var la=oa,ca=O.a.once((function(){return q.a.trackEvent("User has typed a GA campaign name",{"MailPoet Premium version":window.mailpoet_premium_version})})),ua=St()(q.a.I18n.t("gaCampaignTip"),/\[link\](.*?)\[\/link\]/g,(function(e,t){return R.a.createElement("a",{key:t,href:"https://kb.mailpoet.com/article/187-track-your-newsletters-subscribers-in-google-analytics","data-beacon-article":"58b597d12c7d3a576d359144",target:"_blank",rel:"noopener noreferrer"},e)})),pa={name:"ga_campaign",label:q.a.I18n.t("gaCampaignLine"),tip:ua,type:"text",onBeforeChange:ca};function da(e,t){var a=b()(e);if(g.a){var n=g()(e);t&&(n=h()(n).call(n,(function(t){return d()(e,t).enumerable}))),a.push.apply(a,n)}return a}function ma(e){for(var t=1;t<arguments.length;t++){var a,n=null!=arguments[t]?arguments[t]:{};if(t%2)u()(a=da(Object(n),!0)).call(a,(function(t){y()(e,t,n[t])}));else if(l.a)s()(e,l()(n));else{var i;u()(i=da(Object(n))).call(i,(function(t){r()(e,t,d()(n,t))}))}}return e}var ha=window.mailpoet_woocommerce_automatic_emails||[];if(document.getElementById("newsletters_container")&&!O.a.isEmpty(ha)){A.a.addFilter("mailpoet_newsletters_types","mailpoet",(function(e,t){var a,n=O.a.reject(e,(function(e){return O.a.has(ha,e.slug)})),r=x()(O.a).call(O.a,ha,(function(e){var a=e,n=O.a.partial(t.setupNewsletter,e.slug);return a.action=R.a.createElement("div",null,R.a.createElement("span",{className:"button button-primary",onClick:n,onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),n())},role:"button","data-automation-id":"create_woocommerce",tabIndex:0},e.actionButtonTitle||q.a.I18n.t("setUp"))),a}));return E()(a=[]).call(a,I()(n),I()(r))})),A.a.addFilter("mailpoet_newsletters_before_router","mailpoet",(function(e){var t,a=O.a.reject(e,(function(e){return O.a.has(ha,e.name)})),n=[],r=[],i=[];return O.a.each(ha,(function(e){var t=e.events;O.a.isObject(t)&&O.a.each(t,(function(t){var a;r.push({path:E()(a="/new/".concat(e.slug,"/")).call(a,t.slug,"/conditions"),name:t.slug,render:function(a){var n=ma({},a,{email:e,name:t.slug});return R.a.createElement(Qe,n)}})})),n.push({path:"/new/".concat(e.slug),name:e.slug,render:function(t){var a=ma({},t,{email:e});return R.a.createElement(ie,a)}}),i.push({path:"/".concat(e.slug,"/(.*)?"),params:{tab:e.slug},component:la})})),E()(t=[]).call(t,r,n,i,I()(a))}))}A.a.addFilter("mailpoet_newsletters_listings_tabs","mailpoet",(function(e){var t,a=[];return O.a.each(ha,(function(e){a.push({name:e.slug,label:e.title,link:"/".concat(e.slug),display:window.mailpoet_woocommerce_active})})),E()(t=[]).call(t,I()(e),a)}));var fa=function(e,t,a){return"automatic"===t?R.a.createElement(ee,{step:a}):e};A.a.addFilter("mailpoet_newsletters_template_breadcrumb","mailpoet",fa),A.a.addFilter("mailpoet_newsletters_editor_breadcrumb","mailpoet",fa),A.a.addFilter("mailpoet_newsletters_send_breadcrumb","mailpoet",fa);A.a.addFilter("mailpoet_newsletters_editor_extend_config","mailpoet",(function(e,t){if("automatic"!==t.type)return e;var a=e;return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"automatic_emails",action:"get_event_shortcodes",data:{email_slug:t.options.group,event_slug:t.options.event}}).then((function(e){return O.a.isObject(e)&&e.data?(a.shortcodes=ma({},a.shortcodes,{},e.data),a):a})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0,static:!0})}))}));A.a.addFilter("mailpoet_newsletters_send_newsletter_fields","mailpoet",(function(e,t){if("automatic"!==t.type)return e;var a=ha[t.options.group];if(!a)return e;var n=t.options,r=[{name:"subject",label:q.a.I18n.t("subjectLine"),tip:q.a.I18n.t("subjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("emptySubjectLineError")}},{name:"options",label:q.a.I18n.t("sendAutomaticEmailWhenHeading").replace("%1s",a.title),type:"reactComponent",component:tt,email:a,emailOptions:n},{name:"sender",label:q.a.I18n.t("sender"),tip:q.a.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:q.a.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"text",placeholder:q.a.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:q.a.I18n.t("replyTo"),tip:q.a.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:q.a.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:q.a.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]},pa];return{getFields:function(){return r},getSendButtonOptions:function(){return{value:q.a.I18n.t("activate")}}}}));A.a.addFilter("mailpoet_newsletters_send_server_request_parameters","mailpoet",(function(e,t){return"automatic"===t.type?{api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:t.id,status:"active"}}:e}));A.a.addFilter("mailpoet_newsletters_send_server_request_response_redirect","mailpoet",(function(e,t){return"automatic"===t.type?"/".concat(t.options.group):e}));A.a.addFilter("mailpoet_newsletters_send_server_request_response","mailpoet",(function(e){if("automatic"!==e.type)return null;var t=ha[e.options.group];return t?function(){q.a.Notice.success(q.a.I18n.t("automaticEmailActivated").replace("%1s",t.title))}:null}));var ga=function(e){var t=e.subscribersInPlan,a=e.hasValidApiKey;return t&&a?R.a.createElement("h3",null,q.a.I18n.t("subscribersInPlan").replace("%$1d",t.toLocaleString())," ",R.a.createElement(qt.a,{tooltip:q.a.I18n.t("subscribersInPlanTooltip"),place:"right"})):null};ga.propTypes={subscribersInPlan:Z.a.oneOfType([Z.a.number,Z.a.oneOf([!1])]).isRequired,hasValidApiKey:Z.a.bool.isRequired};var va=ga,ba=[{name:"email",label:q.a.I18n.t("subscriber"),sortable:!0},{name:"status",label:q.a.I18n.t("status"),sortable:!0},{name:"segments",label:q.a.I18n.t("lists")},{name:"created_at",label:q.a.I18n.t("subscribedOn"),sortable:!0}],_a={onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSubscriberTrashed"):q.a.I18n.t("multipleSubscribersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSubscriberDeleted"):q.a.I18n.t("multipleSubscribersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSubscriberRestored"):q.a.I18n.t("multipleSubscribersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onNoItemsFound:function(e){return"bounced"===e&&!window.mailpoet_premium_active&&!window.mss_active&&R.a.createElement("div",null,R.a.createElement("p",null,q.a.I18n.t("bouncedSubscribersHelp")),R.a.createElement("p",null,R.a.createElement("a",{href:"admin.php?page=mailpoet-premium",className:"button-primary"},q.a.I18n.t("bouncedSubscribersPremiumButtonText"))))}},ya=[{name:"moveToList",label:q.a.I18n.t("moveToList"),onSelect:function(){return R.a.createElement(we,{field:{id:"move_to_segment",name:"move_to_segment",endpoint:"segments",filter:function(e){return!(e.deleted_at||"default"!==e.type)}}})},getData:function(){return{segment_id:Number(ve()("#move_to_segment").val())}},onSuccess:function(e){q.a.Notice.success(q.a.I18n.t("multipleSubscribersMovedToList").replace("%$1d",Number(e.meta.count).toLocaleString()).replace("%$2s",e.meta.segment))}},{name:"addToList",label:q.a.I18n.t("addToList"),onSelect:function(){return R.a.createElement(we,{field:{id:"add_to_segment",name:"add_to_segment",endpoint:"segments",filter:function(e){return!(e.deleted_at||"default"!==e.type)}}})},getData:function(){return{segment_id:Number(ve()("#add_to_segment").val())}},onSuccess:function(e){q.a.Notice.success(q.a.I18n.t("multipleSubscribersAddedToList").replace("%$1d",Number(e.meta.count).toLocaleString()).replace("%$2s",e.meta.segment))}},{name:"removeFromList",label:q.a.I18n.t("removeFromList"),onSelect:function(){return R.a.createElement(we,{field:{id:"remove_from_segment",name:"remove_from_segment",endpoint:"segments",filter:function(e){return!("default"!==e.type)}}})},getData:function(){return{segment_id:Number(ve()("#remove_from_segment").val())}},onSuccess:function(e){q.a.Notice.success(q.a.I18n.t("multipleSubscribersRemovedFromList").replace("%$1d",Number(e.meta.count).toLocaleString()).replace("%$2s",e.meta.segment))}},{name:"removeFromAllLists",label:q.a.I18n.t("removeFromAllLists"),onSuccess:function(e){q.a.Notice.success(q.a.I18n.t("multipleSubscribersRemovedFromAllLists").replace("%$1d",Number(e.meta.count).toLocaleString()))}},{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:_a.onTrash}],wa=[{name:"edit",label:q.a.I18n.t("edit"),link:function(e){return R.a.createElement(st.b,{to:"/edit/".concat(e.id)},q.a.I18n.t("edit"))}},{name:"sendConfirmationEmail",label:q.a.I18n.t("resendConfirmationEmail"),display:function(e){return"unconfirmed"===e.status&&e.count_confirmations<window.mailpoet_max_confirmation_emails},onClick:function(e){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"subscribers",action:"sendConfirmationEmail",data:{id:e.id}}).done((function(){return q.a.Notice.success(q.a.I18n.t("oneConfirmationEmailSent"))})).fail((function(e){return q.a.Notice.showApiErrorNotice(e)}))}},{name:"trash",display:function(e){return 0===Number(e.wp_user_id)&&0===Number(e.is_woocommerce_user)}}],Ea=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"getSegmentFromId",(function(e){var t,a=!1;return u()(t=window.mailpoet_segments).call(t,(function(t){t.id===e&&(a=t)})),a})),y()(K()(n),"renderItem",(function(e,t){var a=lt()("manage-column","column-primary","has-row-actions","column-username"),r="";switch(e.status){case"subscribed":r=q.a.I18n.t("subscribed");break;case"unconfirmed":r=q.a.I18n.t("unconfirmed");break;case"unsubscribed":r=q.a.I18n.t("unsubscribed");break;case"inactive":r=q.a.I18n.t("inactive");break;case"bounced":r=q.a.I18n.t("bounced");break;default:r="Invalid"}var i=!1;if(e.subscriptions.length>0){var s,o=[];u()(s=e.subscriptions).call(s,(function(e){var t=n.getSegmentFromId(e.segment_id);!1!==t&&"subscribed"===e.status&&o.push(t.name)})),i=R.a.createElement("span",null,o.join(", "))}return R.a.createElement("div",null,R.a.createElement("td",{className:a},R.a.createElement("strong",null,R.a.createElement(st.b,{className:"row-title",to:"/edit/".concat(e.id)},e.email)),R.a.createElement("p",{style:{margin:0}},e.first_name," ",e.last_name),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},r),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("lists")},i),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("subscribedOn")},R.a.createElement("abbr",null,q.a.Date.format(e.created_at))))})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("pageTitle")," ",R.a.createElement(st.b,{className:"page-title-action",to:"/new"},q.a.I18n.t("new")),R.a.createElement("a",{className:"page-title-action",href:"?page=mailpoet-import","data-automation-id":"import-subscribers-button"},q.a.I18n.t("import")),R.a.createElement("a",{id:"mailpoet_export_button",className:"page-title-action",href:"?page=mailpoet-export"},q.a.I18n.t("export"))),R.a.createElement(va,{subscribersInPlan:window.mailpoet_subscribers_in_plan_count,hasValidApiKey:window.mailpoet_has_valid_api_key}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"subscribers",onRenderItem:this.renderItem,columns:ba,bulk_actions:ya,item_actions:wa,messages:_a,sort_by:"created_at",sort_order:"desc"}))}}]),t}(R.a.Component);Ea.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var ka=Ea,Ia=a(129),Sa=a.n(Ia),Ca=function(e){return R.a.createElement("textarea",pe()({type:"text",className:"regular-text",name:e.field.name,id:"field_".concat(e.field.name),value:e.item[e.field.name],placeholder:e.field.placeholder,defaultValue:e.field.defaultValue,onChange:e.onValueChange},e.field.validation))};Ca.propTypes={item:Z.a.object.isRequired,field:Z.a.shape({name:Z.a.string,placeholder:Z.a.string,defaultValue:Z.a.string,validation:Z.a.object}).isRequired,onValueChange:Z.a.func.isRequired};var Na=Ca,xa=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this;if(void 0===ce()(this.props.field))return!1;var a,n=!1,r=!1,i=!1;void 0!==this.props.field.placeholder&&(r=R.a.createElement("option",{value:""},this.props.field.placeholder)),void 0!==h()(this.props.field)&&(n=h()(this.props.field)),O.a.isFunction(this.props.field.sortBy)&&(i=this.props.field.sortBy),a=i?x()(O.a).call(O.a,O.a.sortBy(O.a.pairs(ce()(this.props.field)),(function(e){return i(e[0],e[1])})),(function(e){return e[0]})):b()(ce()(this.props.field));var s=x()(e=h()(a).call(a,(function(e){return!1===n||n(t.props.item,e)}))).call(e,(function(e){return R.a.createElement("option",{key:"option-".concat(e),value:e},ce()(t.props.field)[e])}));return R.a.createElement("select",pe()({name:this.props.field.name,id:"field_".concat(this.props.field.name),value:this.props.item[this.props.field.name]||"",onChange:this.props.onValueChange,"data-automation-id":this.props.automationId},this.props.field.validation),r,s)}}]),t}(R.a.Component);xa.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.object,placeholder:Z.a.string,filter:Z.a.func,sortBy:Z.a.func,validation:Z.a.object}).isRequired,item:Z.a.object.isRequired,automationId:Z.a.string},xa.defaultProps={automationId:"",onValueChange:function(){}};var Ta=xa,Ra=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this;if(void 0===ce()(this.props.field))return!1;var a=this.props.item[this.props.field.name],n=x()(e=b()(ce()(this.props.field))).call(e,(function(e){return R.a.createElement("p",{key:"radio-".concat(e)},R.a.createElement("label",{htmlFor:t.props.field.name},R.a.createElement("input",{type:"radio",checked:a===e,value:e,onChange:t.props.onValueChange,name:t.props.field.name,id:t.props.field.name}),ce()(t.props.field)[e]))}));return R.a.createElement("div",null,n)}}]),t}(R.a.Component);Ra.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.object}).isRequired,item:Z.a.object.isRequired},Ra.defaultProps={onValueChange:function(){}};var Pa=Ra,Oa=function(e){function t(e){var a,n;return M()(this,t),n=U()(this,W()(t).call(this,e)),y()(K()(n),"onValueChange",(function(e){return e.target.value=n.checkboxRef.current.checked?"1":"0",n.props.onValueChange(e)})),n.checkboxRef=R.a.createRef(),n.onValueChange=F()(a=n.onValueChange).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this;if(void 0===ce()(this.props.field))return!1;var a=!!Number(this.props.item[this.props.field.name]),n=x()(e=b()(ce()(this.props.field))).call(e,(function(e){return R.a.createElement("p",{key:"checkbox-".concat(e)},R.a.createElement("label",{htmlFor:t.props.field.name},R.a.createElement("input",{ref:t.checkboxRef,type:"checkbox",value:"1",checked:a,onChange:t.onValueChange,name:t.props.field.name,id:t.props.field.name}),ce()(t.props.field)[e]))}));return R.a.createElement("div",null,n)}}]),t}(R.a.Component);Oa.propTypes={onValueChange:Z.a.func.isRequired,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.object.isRequired}).isRequired,item:Z.a.object.isRequired};var Da=Oa,Aa=a(49),qa=a.n(Aa);function La(e){var t=[];void 0!==e.placeholder&&t.push(R.a.createElement("option",{value:"",key:0},e.placeholder));for(var a=Dt()().year(),n=a;n>=a-100;n-=1)t.push(R.a.createElement("option",{key:n,value:n},n));return R.a.createElement("select",{name:"".concat(e.name,"[year]"),value:e.year,onChange:e.onValueChange,className:lt()({mailpoet_date_year:e.addDefaultClasses})},t)}function Fa(e){var t=[];void 0!==e.placeholder&&t.push(R.a.createElement("option",{value:"",key:0},e.placeholder));for(var a=1;a<=12;a+=1)t.push(R.a.createElement("option",{key:a,value:a},e.monthNames[a-1]));return R.a.createElement("select",{name:"".concat(e.name,"[month]"),value:e.month,onChange:e.onValueChange,className:lt()({mailpoet_date_month:e.addDefaultClasses})},t)}function ja(e){var t=[];void 0!==e.placeholder&&t.push(R.a.createElement("option",{value:"",key:0},e.placeholder));for(var a=1;a<=31;a+=1)t.push(R.a.createElement("option",{key:a,value:a},a));return R.a.createElement("select",{name:"".concat(e.name,"[day]"),value:e.day,onChange:e.onValueChange,className:lt()({mailpoet_date_day:e.addDefaultClasses})},t)}La.propTypes={name:Z.a.string.isRequired,placeholder:Z.a.string.isRequired,onValueChange:Z.a.func.isRequired,year:Z.a.oneOfType([Z.a.string,Z.a.number]).isRequired,addDefaultClasses:Z.a.bool.isRequired},Fa.propTypes={name:Z.a.string.isRequired,placeholder:Z.a.string.isRequired,onValueChange:Z.a.func.isRequired,month:Z.a.oneOfType([Z.a.string,Z.a.number]).isRequired,monthNames:Z.a.arrayOf(Z.a.string).isRequired,addDefaultClasses:Z.a.bool.isRequired},ja.propTypes={name:Z.a.string.isRequired,placeholder:Z.a.string.isRequired,onValueChange:Z.a.func.isRequired,day:Z.a.oneOfType([Z.a.string,Z.a.number]).isRequired,addDefaultClasses:Z.a.bool.isRequired};var Ma=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).state={year:"",month:"",day:""},n.onValueChange=F()(a=n.onValueChange).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){this.extractDateParts()}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.item&&void 0!==e.item&&this.props.item.id!==e.item.id&&this.extractDateParts()}},{key:"onValueChange",value:function(e){var t=this,a=e.target.name.match(/(.*?)\[(.*?)\]/),n=null,r=null;if(null!==a&&3===a.length){var i=Ne()(a,3);n=i[1],r=i[2];var s=Number(e.target.value);this.setState(y()({},"".concat(r),s),(function(){t.props.onValueChange({target:{name:n,value:t.formatValue()}})}))}}},{key:"formatValue",value:function(){var e;switch(this.props.field.params.date_type){case"year_month_day":e={year:this.state.year,month:this.state.month,day:this.state.day};break;case"year_month":e={year:this.state.year,month:this.state.month};break;case"month":e={month:this.state.month};break;case"year":e={year:this.state.year};break;default:e={value:"invalid type"}}return e}},{key:"extractDateParts",value:function(){var e,t=void 0!==this.props.item[this.props.field.name]?qa()(e=this.props.item[this.props.field.name]).call(e):"";if(""!==t){var a=Dt()(t);this.setState({year:a.format("YYYY"),month:a.format("M"),day:a.format("D")})}}},{key:"render",value:function(){var e=this,t=window.mailpoet_month_names||[],a=(window.mailpoet_date_formats||{})[this.props.field.params.date_type][0];this.props.field.params.date_format&&(a=this.props.field.params.date_format);var n=a.split("/"),r=x()(n).call(n,(function(a){switch(a){case"YYYY":return R.a.createElement(La,{onValueChange:e.onValueChange,key:"year",name:e.props.field.name,addDefaultClasses:e.props.addDefaultClasses,year:e.state.year,placeholder:e.props.field.year_placeholder});case"MM":return R.a.createElement(Fa,{onValueChange:e.onValueChange,key:"month",name:e.props.field.name,addDefaultClasses:e.props.addDefaultClasses,month:e.state.month,monthNames:t,placeholder:e.props.field.month_placeholder});case"DD":return R.a.createElement(ja,{onValueChange:e.onValueChange,key:"day",name:e.props.field.name,addDefaultClasses:e.props.addDefaultClasses,day:e.state.day,placeholder:e.props.field.day_placeholder});default:return R.a.createElement("div",null,"Invalid date type")}}));return R.a.createElement("div",null,r)}}]),t}(R.a.Component);Ma.propTypes={item:Z.a.object.isRequired,field:Z.a.shape({name:Z.a.string,day_placeholder:Z.a.string,month_placeholder:Z.a.string,year_placeholder:Z.a.string,params:Z.a.object}).isRequired,onValueChange:Z.a.func.isRequired,addDefaultClasses:Z.a.bool},Ma.defaultProps={addDefaultClasses:!1};var Va=Ma,Ba=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"renderField",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=!1;e.field.description&&(a=R.a.createElement("p",{className:"description"},e.field.description));var n=!1,r=e.field;switch(void 0!==e.field.field&&(r=ve.a.merge(r,e.field.field)),r.type){case"text":n=R.a.createElement(De,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"textarea":n=R.a.createElement(Na,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"select":n=R.a.createElement(Ta,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"radio":n=R.a.createElement(Pa,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"checkbox":n=R.a.createElement(Da,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"selection":n=R.a.createElement(we,{key:"selection-field-".concat(r.name),onValueChange:e.onValueChange,field:e.field,automationId:e.automationId,inline:e.inline,description:e.description,item:e.item});break;case"date":n=R.a.createElement(Va,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"reactComponent":n=R.a.createElement(e.field.component,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;default:n="invalid"}return!0===t?R.a.createElement("span",{key:"field-".concat(e.index||0)},n,a):R.a.createElement("div",{key:"field-".concat(e.index||0)},n,a)})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this,a=!1;void 0!==this.props.field.fields?a=x()(e=this.props.field.fields).call(e,(function(e,a){return t.renderField({index:a,field:e,item:t.props.item,onValueChange:t.props.onValueChange||!1})})):a=this.renderField(this.props);var n=!1;return this.props.field.tip&&(n=R.a.createElement("p",{className:"description"},this.props.field.tip)),R.a.createElement("tr",{className:"form-field-row-".concat(this.props.field.name)},R.a.createElement("th",{scope:"row"},R.a.createElement("label",{htmlFor:"field_".concat(this.props.field.name)},this.props.field.label,n)),R.a.createElement("td",null,a))}}]),t}(R.a.Component);Ba.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.object,tip:Z.a.oneOfType([Z.a.array,Z.a.string]),label:Z.a.string,fields:Z.a.array,description:Z.a.string}).isRequired,item:Z.a.object.isRequired},Ba.defaultProps={onValueChange:function(){}};var za=Ba,Ua=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"getValues",(function(){return a.props.item||a.state.item})),y()(K()(a),"getErrors",(function(){return a.props.errors||a.state.errors})),y()(K()(a),"loadItem",(function(e){a.setState({loading:!0}),a.props.endpoint&&q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:a.props.endpoint,action:"get",data:{id:e}}).done((function(e){a.setState({loading:!1,item:e.data}),"function"==typeof a.props.onItemLoad&&a.props.onItemLoad(e.data)})).fail((function(){a.setState({loading:!1,item:{}},(function(){this.props.history.push("/new")}))}))})),y()(K()(a),"handleSubmit",(function(e){var t;if(e.preventDefault(),void 0===a.props.isValid||!1!==a.props.isValid()){a.setState({loading:!0});var n={};u()(t=a.props.fields).call(t,(function(e){var t;void 0!==e.fields?u()(t=e.fields).call(t,(function(e){n[e.name]=a.state.item[e.name]})):n[e.name]=a.state.item[e.name]})),void 0!==a.props.params.id&&(n.id=a.props.params.id),a.props.endpoint&&q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:a.props.endpoint,action:"save",data:n}).always((function(){a.setState({loading:!1})})).done((function(){void 0!==a.props.onSuccess?a.props.onSuccess():a.props.history.push("/"),void 0!==a.props.params.id?a.props.messages.onUpdate():a.props.messages.onCreate()})).fail((function(e){e.errors.length>0&&a.setState({errors:e.errors})}))}})),y()(K()(a),"handleValueChange",(function(e){var t=e.target,n=t.name,r=t.value;return a.props.onChange?a.props.onChange(e):(a.setState((function(e){var t=e.item;return t[n]=r,{item:t}})),!0)})),a.formRef=R.a.createRef(),a.state={loading:!1,errors:[],item:{}},a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this;void 0!==this.props.params.id?this.loadItem(this.props.params.id):Sa()((function(){e.setState({item:ve()(".mailpoet_form").mailpoetSerializeObject()})}))}},{key:"componentDidUpdate",value:function(){var e=this;void 0===this.props.params.id&&this.state.loading&&(Sa()((function(){e.setState({loading:!1,item:{}})})),void 0===this.props.item&&this.formRef.current.reset())}},{key:"render",value:function(){var e,t,a,n=this;void 0!==this.getErrors()&&(t=x()(a=this.getErrors()).call(a,(function(e){return R.a.createElement("div",{className:"mailpoet_notice notice inline error is-dismissible",key:"error-".concat(e.message)},R.a.createElement("p",null,e.message))})));var r=lt()("mailpoet_form",{mailpoet_form_loading:this.state.loading||this.props.loading}),i=!1,s=!1;void 0!==this.props.beforeFormContent&&(i=this.props.beforeFormContent(this.getValues())),void 0!==this.props.afterFormContent&&(s=this.props.afterFormContent(this.getValues()));var o=x()(e=this.props.fields).call(e,(function(e){var t=n.handleValueChange;return e.onBeforeChange&&(t=function(t){return e.onBeforeChange(t),n.handleValueChange(t)}),R.a.createElement(za,{field:e,item:n.getValues(),onValueChange:t,key:"field-".concat(e.name),automationId:e.automationId})})),l=!1;return l=this.props.children?this.props.children:R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("save"),disabled:this.state.loading}),R.a.createElement("div",null,i,R.a.createElement("form",{id:this.props.id,ref:this.formRef,className:r,onSubmit:void 0!==this.props.onSubmit?this.props.onSubmit:this.handleSubmit,"data-automation-id":this.props.automationId},t,R.a.createElement("table",{className:"form-table"},R.a.createElement("tbody",null,o)),l),s)}}]),t}(R.a.Component);Ua.propTypes={params:Z.a.shape({id:Z.a.string}),item:Z.a.object,errors:Z.a.arrayOf(Z.a.object),endpoint:Z.a.string,fields:Z.a.arrayOf(Z.a.object),messages:Z.a.shape({onUpdate:Z.a.func,onCreate:Z.a.func}),loading:Z.a.bool,children:Z.a.array,id:Z.a.string,automationId:Z.a.string,beforeFormContent:Z.a.func,afterFormContent:Z.a.func,onItemLoad:Z.a.func,isValid:Z.a.func,onChange:Z.a.func,onSubmit:Z.a.func,onSuccess:Z.a.func,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired},Ua.defaultProps={params:{},errors:void 0,fields:void 0,item:void 0,onItemLoad:void 0,isValid:void 0,onSuccess:void 0,onChange:void 0,loading:!1,beforeFormContent:void 0,afterFormContent:void 0,children:void 0,id:"",onSubmit:void 0,automationId:"",messages:{onUpdate:function(){},onCreate:function(){}},endpoint:void 0};var $a=Object(ne.withRouter)(Ua),Wa=[{name:"email",label:q.a.I18n.t("email"),type:"text",disabled:function(e){return Number(e.wp_user_id>0)||1===Number(e.is_woocommerce_user)}},{name:"first_name",label:q.a.I18n.t("firstname"),type:"text",disabled:function(e){return Number(e.wp_user_id>0)||1===Number(e.is_woocommerce_user)}},{name:"last_name",label:q.a.I18n.t("lastname"),type:"text",disabled:function(e){return Number(e.wp_user_id>0)||1===Number(e.is_woocommerce_user)}},{name:"status",label:q.a.I18n.t("status"),type:"select",automationId:"subscriber-status",values:{subscribed:q.a.I18n.t("subscribed"),unconfirmed:q.a.I18n.t("unconfirmed"),unsubscribed:q.a.I18n.t("unsubscribed"),inactive:q.a.I18n.t("inactive"),bounced:q.a.I18n.t("bounced")}},{name:"segments",label:q.a.I18n.t("lists"),type:"selection",placeholder:q.a.I18n.t("selectList"),tip:q.a.I18n.t("welcomeEmailTip"),api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,selected:function(e){var t,a;return!1===nt()(e.subscriptions)?null:x()(t=h()(a=e.subscriptions).call(a,(function(e){return"subscribed"===e.status}))).call(t,(function(e){return e.segment_id}))},filter:function(e){return!e.deleted_at&&"default"===e.type},getLabel:function(e){var t;return E()(t="".concat(e.name," (")).call(t,e.subscribers,")")},getSearchLabel:function(e,t){var a,n="";void 0!==t.subscriptions&&u()(a=t.subscriptions).call(a,(function(t){if(e.id===t.segment_id&&(n=e.name,"unsubscribed"===t.status)){var a=q.a.Date.format(t.updated_at);n+=" (%$1s)".replace("%$1s",q.a.I18n.t("unsubscribedOn").replace("%$1s",a))}}));return n}}],Ha=window.mailpoet_custom_fields||[];u()(Ha).call(Ha,(function(e){var t={name:"cf_".concat(e.id),label:e.name,type:e.type};switch(e.params&&(t.params=e.params),ce()(e.params)&&(t.values=ce()(e.params)),e.type){case"date":t.year_placeholder=q.a.I18n.t("year"),t.month_placeholder=q.a.I18n.t("month"),t.day_placeholder=q.a.I18n.t("day");break;case"select":t.placeholder="-";break;default:t.placeholder=""}Wa.push(t)}));var Ka={onUpdate:function(){q.a.Notice.success(q.a.I18n.t("subscriberUpdated"))},onCreate:function(){q.a.Notice.success(q.a.I18n.t("subscriberAdded")),q.a.trackEvent("Subscribers > Add new",{"MailPoet Free version":window.mailpoet_version})}};function Ga(e){if(Number(e.wp_user_id)>0)return R.a.createElement("p",{className:"description"},St()(q.a.I18n.t("WPUserEditNotice"),/\[link\](.*?)\[\/link\]/g,(function(t,a){return R.a.createElement("a",{key:a,href:"user-edit.php?user_id=".concat(e.wp_user_id)},t)})))}function Ya(){return R.a.createElement("p",{className:"description"},R.a.createElement("strong",null,q.a.I18n.t("tip"))," ",q.a.I18n.t("customFieldsTip"))}var Ja=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("subscriber"),R.a.createElement(st.b,{className:"page-title-action",to:"/"},q.a.I18n.t("backToList"))),R.a.createElement(Zt,null),R.a.createElement($a,{automationId:"subscriber_edit_form",endpoint:"subscribers",fields:Wa,params:this.props.match.params,messages:Ka,beforeFormContent:Ga,afterFormContent:Ya}))}}]),t}(R.a.Component);Ja.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired};var Qa=Ja,Za=a(482),Xa=a.n(Za),en=function(){var e,t=R.a.useContext(Ge.a).notices;return x()(e=t.items).call(e,(function(e){var t=e.id,a=Xa()(e,["id"]);return R.a.createElement(Qt,pe()({key:t},a))}))},tn=document.getElementById("subscribers_container");tn&&_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{path:"/new",component:Qa}),R.a.createElement(ne.Route,{path:"/edit/:id",component:Qa}),R.a.createElement(ne.Route,{path:"*",component:ka}))))}),null),tn);var an=a(483),nn=a.n(an),rn=a(31),sn=a.n(rn),on=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){q.a.Modal.loading(!0)}},{key:"componentWillUnmount",value:function(){q.a.Modal.loading(!1)}},{key:"render",value:function(){return null}}]),t}(R.a.Component),ln=function(e){var t=e.tabs,a=e.selected,n=e.select;return R.a.createElement("div",{className:"wp-filter hide-if-no-js"},R.a.createElement("ul",{className:"filter-links"},x()(t).call(t,(function(e){var t=e.name,r=e.label;return R.a.createElement("li",{key:t},R.a.createElement("a",{href:"#",className:a===t?"current":"",onClick:function(e){e.preventDefault(),n(t)}}," ",r))}))))};ln.propTypes={selected:Z.a.string.isRequired,select:Z.a.func.isRequired,tabs:Z.a.arrayOf(Z.a.shape({label:Z.a.string.isRequired,name:Z.a.string.isRequired}).isRequired).isRequired};var cn=ln,un=function(e){return q.a.Modal.popup({title:e.title,template:ut.a.renderToString(R.a.createElement(R.a.Fragment,null,R.a.createElement("p",null,e.message),R.a.createElement("button",{id:"mailpoet_alert_cancel",className:"button button-secondary",type:"button"},e.cancelLabel),R.a.createElement("button",{id:"mailpoet_alert_confirm",className:"button button-primary",type:"submit"},e.confirmLabel))),onInit:function(){document.getElementById("mailpoet_alert_confirm").addEventListener("click",(function(){q.a.Modal.close(),e.onConfirm()})),document.getElementById("mailpoet_alert_cancel").addEventListener("click",(function(){return q.a.Modal.close()}))}}),null};function pn(e){ut.a.renderToString(R.a.createElement(un,{title:e.title,message:e.message,cancelLabel:e.cancelLabel,confirmLabel:e.confirmLabel,onConfirm:e.onConfirm}))}un.propTypes={title:Z.a.string,message:Z.a.string.isRequired,cancelLabel:Z.a.string,confirmLabel:Z.a.string,onConfirm:Z.a.func.isRequired},un.defaultProps={title:q.a.I18n.t("confirmTitle"),cancelLabel:q.a.I18n.t("cancelLabel"),confirmLabel:q.a.I18n.t("confirmLabel")};var dn=function(e){function t(e){var a,n,r,i;return M()(this,t),(i=U()(this,W()(t).call(this,e))).onPreview=F()(a=i.onPreview).call(a,K()(i)),i.onDelete=F()(n=i.onDelete).call(n,K()(i)),i.onSelect=F()(r=i.onSelect).call(r,K()(i)),i}return Y()(t,e),B()(t,[{key:"onDelete",value:function(){var e=this,t=this.props,a=t.id,n=t.name,r=t.beforeDelete,i=t.afterDelete;pn({message:q.a.I18n.t("confirmTemplateDeletion").replace("%$1s",n),onConfirm:function(){r(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"delete",data:{id:a}}).done((function(){i(!0,a)})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0});i(!1)}))}})}},{key:"onPreview",value:function(){q.a.Modal.popup({title:this.props.name,template:'<img src="{{ thumbnail }}" />',data:this.props})}},{key:"onSelect",value:function(){var e=this,t=this.props,a=t.newsletterId,n=t.name,r=t.beforeSelect,i=t.afterSelect;r(),q.a.trackEvent("Emails > Template selected",{"MailPoet Free version":window.mailpoet_version,"Email name":n}),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"save",data:{id:a,template_id:this.props.id}}).done((function(e){i(!0,e.data.id)})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0});i(!1)}))}},{key:"render",value:function(){var e=this,t=this.props,a=t.index,n=t.name,r=t.thumbnail,i=t.readonly,s=R.a.createElement("button",{className:"mailpoet_delete button button-secondary",onClick:this.onDelete,type:"button"},q.a.I18n.t("delete")),o="";return"string"==typeof r&&r.length>0&&(o=R.a.createElement("a",{href:"#",onClick:function(t){t.preventDefault(),e.onPreview(t)}},R.a.createElement("img",{src:r,alt:q.a.I18n.t("templatePreview"),loading:"lazy"}),R.a.createElement("div",{className:"mailpoet_overlay"},R.a.createElement("p",{className:"mailpoet_more_details"},q.a.I18n.t("zoom"))))),R.a.createElement("li",{className:"mailpoet_template_boxes","data-automation-id":"select_template_box"},R.a.createElement("div",{className:"mailpoet_thumbnail"},o),R.a.createElement("div",{className:"mailpoet_template_content"},R.a.createElement("div",{className:"mailpoet_description"},R.a.createElement("h3",null,n)),R.a.createElement("div",{className:"mailpoet_actions"},!0!==i&&s,R.a.createElement("a",{className:"button button-primary","data-automation-id":"select_template_".concat(a),onClick:this.onSelect,role:"button",tabIndex:0,onKeyDown:function(t){var a,n;C()(a=["keydown","keypress"]).call(a,t.type)&&C()(n=["Enter"," "]).call(n,t.key)&&(t.preventDefault(),e.onSelect())}}," ",q.a.I18n.t("select")," "))))}}]),t}(R.a.Component);dn.contextType=Ge.a,dn.propTypes={index:Z.a.number.isRequired,id:Z.a.number.isRequired,newsletterId:Z.a.string.isRequired,name:Z.a.string.isRequired,thumbnail:Z.a.string.isRequired,readonly:Z.a.bool.isRequired,beforeDelete:Z.a.func.isRequired,afterDelete:Z.a.func.isRequired,beforeSelect:Z.a.func.isRequired,afterSelect:Z.a.func.isRequired};var mn=dn,hn=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).fileRef=R.a.createRef(),n.handleSubmit=F()(a=n.handleSubmit).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"saveTemplate",value:function(e){var t,a,n,r,i=this,s=e,o=this.props,l=o.beforeImport,c=o.afterImport;O.a.isUndefined(s.body)||(s.body=oe()(s.body));try{s.categories=JSON.parse(s.categories)}catch(e){s.categories=[]}-1===sn()(t=s.categories).call(t,"saved")&&s.categories.push("saved"),-1===sn()(a=s.categories).call(a,"standard")&&-1===sn()(n=s.categories).call(n,"welcome")&&-1===sn()(r=s.categories).call(r,"notification")&&s.categories.push("standard"),s.categories=oe()(s.categories),l(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"save",data:s}).done((function(e){c(!0,e.data)})).fail((function(e){var t;e.errors.length>0&&i.context.notices.error(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0});c(!1)}))}},{key:"handleSubmit",value:function(e){var t=this;if(e.preventDefault(),O.a.size(this.fileRef.current.files)<=0)return!1;var a=O.a.first(this.fileRef.current.files),n=new FileReader;return n.onload=function(e){try{t.saveTemplate(JSON.parse(e.target.result)),q.a.trackEvent("Emails > Template imported",{"MailPoet Free version":window.mailpoet_version})}catch(e){t.context.notices.error(R.a.createElement("p",null,q.a.I18n.t("templateFileMalformedError")))}},n.readAsText(a),!0}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("importTemplateTitle"),R.a.createElement(qt.a,{tooltip:q.a.I18n.t("helpTooltipTemplateUpload"),place:"right",className:"tooltip-help-import-template"})),R.a.createElement("form",{onSubmit:this.handleSubmit},R.a.createElement("input",{type:"file",placeholder:q.a.I18n.t("selectJsonFileToUpload"),ref:this.fileRef}),R.a.createElement("p",{className:"submit"},R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("upload")}))))}}]),t}(R.a.Component);hn.contextType=Ge.a,hn.propTypes={beforeImport:Z.a.func.isRequired,afterImport:Z.a.func.isRequired};var fn=hn,gn=[{name:"standard",label:q.a.I18n.t("tabStandardTitle")},{name:"welcome",label:q.a.I18n.t("tabWelcomeTitle")},{name:"notification",label:q.a.I18n.t("tabNotificationTitle")},{name:"blank",label:q.a.I18n.t("tabBlankTitle")}];window.mailpoet_woocommerce_active&&gn.push({name:"woocommerce",label:q.a.I18n.t("tabWoocommerceTitle")}),gn.push.apply(gn,[{name:"recent",label:q.a.I18n.t("recentlySent")},{name:"saved",label:q.a.I18n.t("savedTemplates")}]);var vn=function(e){function t(e){var a,n,r,i,s;return M()(this,t),(s=U()(this,W()(t).call(this,e))).state={loading:!0,templates:{},emailType:null,selectedTab:""},s.templates={},s.addTemplate=F()(a=s.addTemplate).call(a,K()(s)),s.afterTemplateDelete=F()(n=s.afterTemplateDelete).call(n,K()(s)),s.afterTemplateSelect=F()(r=s.afterTemplateSelect).call(r,K()(s)),s.afterTemplateImport=F()(i=s.afterTemplateImport).call(i,K()(s)),s}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this;q.a.Ajax.get({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"getAll"}).done((function(t){var a;0===t.data.length&&(t.data=[{name:q.a.I18n.t("mailpoetGuideTemplateTitle"),categories:'["welcome", "notification", "standard", "woocommerce"]',readonly:!0}]),u()(a=t.data).call(a,e.addTemplate),e.sortTemplates()})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})})).always((function(){e.selectInitialTab()}))}},{key:"addTemplate",value:function(e){var t,a=this,n=x()(gn).call(gn,(function(e){return e.name}));-1===sn()(n).call(n,"woocommerce")&&n.push("woocommerce");try{var r;t=h()(r=JSON.parse(e.categories)).call(r,(function(e){return-1!==sn()(n).call(n,e)}))}catch(e){t=[]}0===t.length&&t.push("saved"),u()(t).call(t,(function(t){void 0===a.templates[t]&&(a.templates[t]=[]),a.templates[t].unshift(e)}))}},{key:"sortTemplates",value:function(){var e,t=this;u()(e=b()(this.templates)).call(e,(function(e){var a;nn()(a=t.templates[e]).call(a,(function(e,t){return e.id<t.id?1:-1}))}))}},{key:"selectInitialTab",value:function(){var e,t=this,a="standard";q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:this.props.match.params.id}}).done((function(t){e=t.data.type,O.a.findWhere(gn,{name:t.data.type})?a=t.data.type:"automatic"===t.data.type&&O.a.findWhere(gn,{name:t.data.options.group})&&(a=t.data.options.group)})).fail((function(e){var a;e.errors.length>0&&t.context.notices.error(x()(a=e.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})})).always((function(){t.setState({templates:t.templates,emailType:e,selectedTab:a,loading:!1})}))}},{key:"afterTemplateDelete",value:function(e,t){var a,n=this;e&&u()(a=b()(this.templates)).call(a,(function(e){var a;n.templates[e]=h()(a=n.templates[e]).call(a,(function(e){return e.id!==t}))}));this.setState({templates:this.templates,loading:!1})}},{key:"afterTemplateSelect",value:function(e,t){e?window.location=function(e){return"admin.php?page=mailpoet-newsletter-editor&id=".concat(e)}(t):this.setState({loading:!1})}},{key:"afterTemplateImport",value:function(e,t){e&&this.addTemplate(t),this.setState({templates:this.templates,selectedTab:e?"saved":"import",loading:!1})}},{key:"render",value:function(){var e=this;if(this.state.loading)return R.a.createElement(on,null);var t=E()(gn).call(gn,{name:"import",label:q.a.I18n.t("tabImportTitle")}),a=null;if("import"===this.state.selectedTab)a=R.a.createElement(fn,{beforeImport:function(){return e.setState({loading:!0})},afterImport:this.afterTemplateImport});else{var n=this.state.templates[this.state.selectedTab]||[];n=0===n.length?this.state.loading?null:R.a.createElement("p",null,q.a.I18n.t("noTemplates")):x()(n).call(n,(function(t,a){return R.a.createElement(mn,{key:t.id,index:a,newsletterId:e.props.match.params.id,beforeDelete:function(){return e.setState({loading:!0})},afterDelete:e.afterTemplateDelete,beforeSelect:function(){return e.setState({loading:!0})},afterSelect:e.afterTemplateSelect,id:t.id,name:t.name,thumbnail:t.thumbnail,readonly:t.readonly})})),a=R.a.createElement("ul",{className:"mailpoet_boxes clearfix"},n)}var r=A.a.applyFilters("mailpoet_newsletters_template_breadcrumb",R.a.createElement(J.a,{step:"template"}),this.state.emailType,"template");return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("selectTemplateTitle")),r,R.a.createElement(cn,{tabs:t,selected:this.state.selectedTab,select:function(t){return e.setState({selectedTab:t})}}),a)}}]),t}(R.a.Component);vn.contextType=Ge.a,vn.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired};var bn=vn,_n=a(54),yn=a.n(_n),wn={closeText:q.a.I18n.t("close"),currentText:q.a.I18n.t("today"),nextText:q.a.I18n.t("next"),prevText:q.a.I18n.t("previous"),monthNames:[q.a.I18n.t("january"),q.a.I18n.t("february"),q.a.I18n.t("march"),q.a.I18n.t("april"),q.a.I18n.t("may"),q.a.I18n.t("june"),q.a.I18n.t("july"),q.a.I18n.t("august"),q.a.I18n.t("september"),q.a.I18n.t("october"),q.a.I18n.t("november"),q.a.I18n.t("december")],monthNamesShort:[q.a.I18n.t("januaryShort"),q.a.I18n.t("februaryShort"),q.a.I18n.t("marchShort"),q.a.I18n.t("aprilShort"),q.a.I18n.t("mayShort"),q.a.I18n.t("juneShort"),q.a.I18n.t("julyShort"),q.a.I18n.t("augustShort"),q.a.I18n.t("septemberShort"),q.a.I18n.t("octoberShort"),q.a.I18n.t("novemberShort"),q.a.I18n.t("decemberShort")],dayNames:[q.a.I18n.t("sunday"),q.a.I18n.t("monday"),q.a.I18n.t("tuesday"),q.a.I18n.t("wednesday"),q.a.I18n.t("thursday"),q.a.I18n.t("friday"),q.a.I18n.t("saturday")],dayNamesShort:[q.a.I18n.t("sundayShort"),q.a.I18n.t("mondayShort"),q.a.I18n.t("tuesdayShort"),q.a.I18n.t("wednesdayShort"),q.a.I18n.t("thursdayShort"),q.a.I18n.t("fridayShort"),q.a.I18n.t("saturdayShort")],dayNamesMin:[q.a.I18n.t("sundayMin"),q.a.I18n.t("mondayMin"),q.a.I18n.t("tuesdayMin"),q.a.I18n.t("wednesdayMin"),q.a.I18n.t("thursdayMin"),q.a.I18n.t("fridayMin"),q.a.I18n.t("saturdayMin")]},En=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"onChange",(function(e){var t=e,n=t.target.value,r=a.getStorageDate(n);t.target.value=r,a.props.onChange(t)})),y()(K()(a),"getFieldName",(function(){return a.props.name||"date"})),y()(K()(a),"getDisplayDate",(function(e){var t={parseFormat:a.props.storageFormat,format:a.props.displayFormat};return q.a.Date.format(e,t)})),y()(K()(a),"getStorageDate",(function(e){var t={parseFormat:a.props.displayFormat,format:a.props.storageFormat};return q.a.Date.format(e,t)})),a.dateInput=R.a.createRef(),a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=ve()(this.dateInput.current),t=this;e.datepicker&&(ve.a.datepicker.parseDate=function(e,t){return q.a.Date.toDate(t,{parseFormat:this.props.displayFormat,format:e})},ve.a.datepicker.formatDate=function(e,t){return q.a.Date.format(t,{format:e})},e.datepicker(O.a.extend({dateFormat:this.props.displayFormat,firstDay:window.mailpoet_start_of_week,isRTL:!1,onSelect:function(e){t.onChange({target:{name:t.getFieldName(),value:e}})}},wn)),this.datepickerInitialized=!0)}},{key:"componentWillUnmount",value:function(){this.datepickerInitialized&&ve()(this.dateInput.current).datepicker("destroy")}},{key:"render",value:function(){return R.a.createElement("input",pe()({type:"text",size:"30",name:this.getFieldName(),value:this.getDisplayDate(this.props.value),readOnly:!0,disabled:this.props.disabled,onChange:this.onChange,ref:this.dateInput},this.props.validation))}}]),t}(R.a.Component);En.propTypes={displayFormat:Z.a.string.isRequired,onChange:Z.a.func.isRequired,name:Z.a.string,storageFormat:Z.a.string.isRequired,value:Z.a.string.isRequired,disabled:Z.a.bool.isRequired,validation:Z.a.object.isRequired},En.defaultProps={name:"date"};var kn=En,In=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this,a=x()(e=b()(this.props.timeOfDayItems)).call(e,(function(e){return R.a.createElement("option",{key:"option-".concat(t.props.timeOfDayItems[e]),value:e},t.props.timeOfDayItems[e])}));return R.a.createElement("select",pe()({name:this.props.name||"time",value:this.props.value,disabled:this.props.disabled,onChange:this.props.onChange},this.props.validation),a)}}]),t}(R.a.Component);In.propTypes={timeOfDayItems:Z.a.objectOf(Z.a.string).isRequired,name:Z.a.string,value:Z.a.string.isRequired,disabled:Z.a.bool,onChange:Z.a.func.isRequired,validation:Z.a.object},In.defaultProps={name:"time",disabled:!1,validation:{}};var Sn=In,Cn=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"DATE_TIME_SEPARATOR"," "),y()(K()(a),"getDateTime",(function(){return[a.state.date,a.state.time].join(a.DATE_TIME_SEPARATOR)})),y()(K()(a),"buildStateFromProps",(function(e){var t=(e.value||a.props.defaultDateTime).split(a.DATE_TIME_SEPARATOR),n=Ne()(t,2);return{date:n[0],time:n[1]}})),y()(K()(a),"handleChange",(function(e){var t={};t[e.target.name]=e.target.value,a.setState(t,a.propagateChange)})),y()(K()(a),"propagateChange",(function(){a.props.onChange&&a.props.onChange({target:{name:a.props.name||"",value:a.getDateTime()}})})),a.state=a.buildStateFromProps(e),a}return Y()(t,e),B()(t,[{key:"componentDidUpdate",value:function(e){var t=this;this.props.value===e.value&&this.props.defaultDateTime===e.defaultDateTime||Sa()((function(){t.setState(t.buildStateFromProps(t.props))}))}},{key:"render",value:function(){return R.a.createElement("span",null,R.a.createElement(kn,{name:"date",value:this.state.date,onChange:this.handleChange,displayFormat:this.props.dateDisplayFormat,storageFormat:this.props.dateStorageFormat,disabled:this.props.disabled,validation:this.props.dateValidation}),R.a.createElement(Sn,{name:"time",value:this.state.time,onChange:this.handleChange,disabled:this.props.disabled,validation:this.props.timeValidation,timeOfDayItems:this.props.timeOfDayItems}))}}]),t}(R.a.Component);Cn.propTypes={value:Z.a.string,defaultDateTime:Z.a.string.isRequired,dateDisplayFormat:Z.a.string.isRequired,dateStorageFormat:Z.a.string.isRequired,onChange:Z.a.func,name:Z.a.string,disabled:Z.a.bool,dateValidation:Z.a.object.isRequired,timeValidation:Z.a.any,timeOfDayItems:Z.a.objectOf(Z.a.string).isRequired},Cn.defaultProps={onChange:void 0,name:"",disabled:!1,timeValidation:void 0,value:void 0};var Nn=Cn,xn=window.location.hostname.replace("www.",""),Tn="contact@".concat(xn),Rn=function(e){var t,a=e.emailAddress;if(e.mssActive)return null;var n=a.split("@").pop().toLowerCase();return sn()(t=window.mailpoet_free_domains).call(t,n)>-1?R.a.createElement(R.a.Fragment,null,R.a.createElement("p",{className:"sender_email_address_warning","data-acceptance-id":"freemail-sender-warning-old-installation"},q.a.I18n.t("senderEmailAddressWarning1")),R.a.createElement("p",{className:"sender_email_address_warning"},St()(q.a.I18n.t("senderEmailAddressWarning2"),/(%1\$s|%2\$s|<em>.*<\/em>)/,(function(e){return"%1$s"===e?Tn:"%2$s"===e?R.a.createElement("em",{key:"sender-email"},a):R.a.createElement("em",{key:"reply-to"},e.replace(/<\/?em>/g,""))}))),R.a.createElement("p",{className:"sender_email_address_warning"},R.a.createElement("a",{href:"https://kb.mailpoet.com/article/259-your-from-address-cannot-be-yahoo-com-gmail-com-outlook-com","data-beacon-article":"5be5911104286304a71c176e",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("senderEmailAddressWarning3")))):null};Rn.propTypes={emailAddress:Z.a.string.isRequired,mssActive:Z.a.bool.isRequired};var Pn=Rn,On=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).state={emailAddress:e.item.sender_address},n.onChange=F()(a=n.onChange).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"onChange",value:function(e){this.setState({emailAddress:e.target.value}),this.props.onValueChange(e)}},{key:"render",value:function(){return R.a.createElement(R.a.Fragment,null,R.a.createElement(De,{item:this.props.item,field:this.props.field,onValueChange:this.onChange}),R.a.createElement("div",{className:"regular-text"},R.a.createElement(Pn,{emailAddress:this.state.emailAddress,mssActive:window.mailpoet_mss_active})))}}]),t}(R.a.Component);On.propTypes={field:Z.a.object.isRequired,item:Z.a.shape({sender_address:Z.a.string.isRequired}).isRequired,onValueChange:Z.a.func},On.defaultProps={onValueChange:function(){}};var Dn=On,An=window.mailpoet_current_time||"00:00",qn="".concat(window.mailpoet_current_date," 00:00:00"),Ln=window.mailpoet_schedule_time_of_day,Fn=window.mailpoet_date_display_format,jn=window.mailpoet_date_storage_format,Mn=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"getCurrentValue",(function(){var e={isScheduled:"0",scheduledAt:qn};return O.a.defaults(n.props.item[n.props.field.name]||{},e)})),y()(K()(n),"getDateValidation",(function(){return{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("noScheduledDateError"),"data-parsley-errors-container":"#mailpoet_scheduling"}})),y()(K()(n),"isScheduled",(function(){return"1"===n.getCurrentValue().isScheduled})),y()(K()(n),"handleCheckboxChange",(function(e){var t=e;return t.target.value=e.target.checked?"1":"0",n.handleValueChange(t)})),y()(K()(n),"handleValueChange",(function(e){var t=n.getCurrentValue(),a={};return a[e.target.name]=e.target.value,n.props.onValueChange({target:{name:n.props.field.name,value:O.a.extend({},t,a)}})})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e;return this.isScheduled()&&(e=R.a.createElement("span",{id:"mailpoet_scheduling"},R.a.createElement(Nn,{name:"scheduledAt",value:this.getCurrentValue().scheduledAt,onChange:this.handleValueChange,disabled:this.props.field.disabled,dateValidation:this.getDateValidation(),defaultDateTime:qn,timeOfDayItems:Ln,dateDisplayFormat:Fn,dateStorageFormat:jn})," ",R.a.createElement("span",null,q.a.I18n.t("websiteTimeIs")," ",R.a.createElement("code",null,An)))),R.a.createElement("div",null,R.a.createElement("input",{type:"checkbox",value:"1",checked:this.isScheduled(),disabled:this.props.field.disabled,name:"isScheduled",onChange:this.handleCheckboxChange}),e)}}]),t}(R.a.Component);Mn.propTypes={item:Z.a.object,field:Z.a.shape({name:Z.a.string.isRequired,disabled:Z.a.bool}).isRequired,onValueChange:Z.a.func.isRequired},Mn.defaultProps={item:{}};var Vn=[{name:"subject",label:q.a.I18n.t("subjectLine"),tip:q.a.I18n.t("subjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("emptySubjectLineError")}},{name:"segments",label:q.a.I18n.t("segments"),tip:q.a.I18n.t("segmentsTip"),type:"selection",placeholder:q.a.I18n.t("selectSegmentPlaceholder"),id:"mailpoet_segments",api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,filter:function(e){return!e.deleted_at},getLabel:function(e){var t;return E()(t="".concat(e.name," (")).call(t,Se()(e.subscribers,10).toLocaleString(),")")},transformChangedValue:function(e){var t=this.getItems();return x()(O.a).call(O.a,e,(function(e){return me()(O.a).call(O.a,t,(function(t){return t.id===e}))}))},validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("noSegmentsSelectedError")}},{name:"sender",label:q.a.I18n.t("sender"),tip:q.a.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:q.a.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"reactComponent",component:Dn,placeholder:q.a.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:q.a.I18n.t("replyTo"),tip:q.a.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:q.a.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:q.a.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]},pa,{name:"options",label:q.a.I18n.t("scheduleIt"),type:"reactComponent",component:Mn}];Vn=A.a.applyFilters("mailpoet_newsletters_3rd_step_fields",Vn);var Bn={getFields:function(){return Vn},getSendButtonOptions:function(e){var t=e||{},a={value:"object"===yn()(t.options)&&"1"===t.options.isScheduled?q.a.I18n.t("schedule"):q.a.I18n.t("send")};return"sent"!==t.status&&"sending"!==t.status||(a.disabled="disabled"),a}},zn={name:"intervalType",values:Le},Un={name:"timeOfDay",values:Fe},$n={name:"weekDay",values:je},Wn={name:"monthDay",values:Me},Hn={name:"nthWeekDay",values:Ve},Kn=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"getCurrentValue",(function(){return n.props.item[n.props.field.name]||{}})),y()(K()(n),"handleValueChanges",(function(e){var t=n.getCurrentValue();return n.props.onValueChange({target:{name:n.props.field.name,value:O.a.extend({},t,e)}})})),y()(K()(n),"handleIntervalChange",(function(e){var t=e.target.value,a={};a.intervalType=t,"monthly"===t&&(a.monthDay="1"),n.handleValueChanges(a)})),y()(K()(n),"handleTimeOfDayChange",(function(e){return n.handleValueChanges({timeOfDay:e.target.value})})),y()(K()(n),"handleWeekDayChange",(function(e){return n.handleValueChanges({weekDay:e.target.value})})),y()(K()(n),"handleMonthDayChange",(function(e){return n.handleValueChanges({monthDay:e.target.value})})),y()(K()(n),"handleNthWeekDayChange",(function(e){return n.handleValueChanges({nthWeekDay:e.target.value})})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t,a,n,r=this.getCurrentValue();return"immediately"!==r.intervalType&&(e=R.a.createElement(Ta,{field:Un,item:this.getCurrentValue(),onValueChange:this.handleTimeOfDayChange})),"weekly"!==r.intervalType&&"nthWeekDay"!==r.intervalType||(t=R.a.createElement(Ta,{field:$n,item:this.getCurrentValue(),onValueChange:this.handleWeekDayChange})),"monthly"===r.intervalType&&(a=R.a.createElement(Ta,{field:Wn,item:this.getCurrentValue(),onValueChange:this.handleMonthDayChange})),"nthWeekDay"===r.intervalType&&(n=R.a.createElement(Ta,{field:Hn,item:this.getCurrentValue(),onValueChange:this.handleNthWeekDayChange})),R.a.createElement("div",null,R.a.createElement(Ta,{field:zn,item:this.getCurrentValue(),onValueChange:this.handleIntervalChange,automationId:"newsletter_interval_type"}),n,a,t,e)}}]),t}(R.a.Component);Kn.propTypes={item:Z.a.object.isRequired,field:Z.a.shape({name:Z.a.string}).isRequired,onValueChange:Z.a.func.isRequired};var Gn=Kn,Yn=[{name:"subject",label:q.a.I18n.t("subjectLine"),tip:q.a.I18n.t("postNotificationSubjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("emptySubjectLineError")}},{name:"options",label:q.a.I18n.t("selectFrequency"),type:"reactComponent",component:Gn},{name:"segments",label:q.a.I18n.t("segments"),tip:q.a.I18n.t("segmentsTip"),type:"selection",placeholder:q.a.I18n.t("selectSegmentPlaceholder"),id:"mailpoet_segments",api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,filter:function(e){return!e.deleted_at},getLabel:function(e){var t;return E()(t="".concat(e.name," (")).call(t,Se()(e.subscribers,10).toLocaleString(),")")},transformChangedValue:function(e){var t=this.getItems();return x()(O.a).call(O.a,e,(function(e){return me()(O.a).call(O.a,t,(function(t){return t.id===e}))}))},validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("noSegmentsSelectedError")}},{name:"sender",label:q.a.I18n.t("sender"),tip:q.a.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:q.a.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"reactComponent",component:Dn,placeholder:q.a.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:q.a.I18n.t("replyTo"),tip:q.a.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:q.a.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:q.a.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]},pa];Yn=A.a.applyFilters("mailpoet_newsletters_3rd_step_fields",Yn);var Jn={getFields:function(){return Yn},getSendButtonOptions:function(){return{value:q.a.I18n.t("activate")}}},Qn=window.mailpoet_roles||{},Zn=h()(O.a).call(O.a,window.mailpoet_segments||[],(function(e){return"default"===e.type})),Xn={name:"event",values:{segment:q.a.I18n.t("onSubscriptionToList"),user:q.a.I18n.t("onWPUserRegistration")}},er={name:"segment",values:O.a.object(x()(O.a).call(O.a,Zn,(function(e){var t,a=E()(t="".concat(e.name," (")).call(t,Se()(e.subscribers,10).toLocaleString(),")");return[e.id,a]}))),sortBy:function(e,t){return t.toLowerCase()}},tr={name:"role",values:Qn},ar={name:"afterTimeNumber",size:3},nr={name:"afterTimeType",values:qe},rr=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"getCurrentValue",(function(){return n.props.item[n.props.field.name]||{}})),y()(K()(n),"handleValueChange",(function(e,t){var a=n.getCurrentValue(),r={};return r[e]=t,n.props.onValueChange({target:{name:n.props.field.name,value:O.a.extend({},a,r)}})})),y()(K()(n),"handleEventChange",(function(e){return n.handleValueChange("event",e.target.value)})),y()(K()(n),"handleSegmentChange",(function(e){return n.handleValueChange("segment",e.target.value)})),y()(K()(n),"handleRoleChange",(function(e){return n.handleValueChange("role",e.target.value)})),y()(K()(n),"handleAfterTimeNumberChange",(function(e){return n.handleValueChange("afterTimeNumber",e.target.value)})),y()(K()(n),"handleAfterTimeTypeChange",(function(e){return n.handleValueChange("afterTimeType",e.target.value)})),y()(K()(n),"handleNext",(function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:"welcome",options:n.state}}).done((function(e){n.showTemplateSelection(e.data.id)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))})),y()(K()(n),"showTemplateSelection",(function(e){n.props.history.push("/template/".concat(e))})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t,a=this.getCurrentValue();return e="user"===a.event?R.a.createElement(Ta,{field:tr,item:this.getCurrentValue(),onValueChange:this.handleRoleChange}):R.a.createElement(Ta,{field:er,item:this.getCurrentValue(),onValueChange:this.handleSegmentChange}),"immediate"!==a.afterTimeType&&(t=R.a.createElement(De,{field:ar,item:this.getCurrentValue(),onValueChange:this.handleAfterTimeNumberChange})),R.a.createElement("div",null,R.a.createElement(Ta,{field:Xn,item:this.getCurrentValue(),onValueChange:this.handleEventChange}),e,t,R.a.createElement(Ta,{field:nr,item:this.getCurrentValue(),onValueChange:this.handleAfterTimeTypeChange}))}}]),t}(R.a.Component);rr.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,item:Z.a.object.isRequired,field:Z.a.shape({name:Z.a.string}).isRequired,onValueChange:Z.a.func.isRequired};var ir=Object(ne.withRouter)(rr),sr=[{name:"subject",label:q.a.I18n.t("subjectLine"),tip:q.a.I18n.t("subjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("emptySubjectLineError")}},{name:"options",label:q.a.I18n.t("sendWelcomeEmailWhen"),type:"reactComponent",component:ir},{name:"sender",label:q.a.I18n.t("sender"),tip:q.a.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:q.a.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"reactComponent",component:Dn,placeholder:q.a.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:q.a.I18n.t("replyTo"),tip:q.a.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:q.a.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:q.a.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]},pa];sr=A.a.applyFilters("mailpoet_newsletters_3rd_step_fields",sr);var or={getFields:function(){return sr},getSendButtonOptions:function(){return{value:q.a.I18n.t("activate")}}},lr=a(295),cr=a(485),ur=a.n(cr),pr=function(e,t){var a,n=ur()(t,{lower:!0}).replace(/[^a-z0-9]+/g,"-").replace(/-$/,"");return E()(a="".concat(n||"newsletter","_")).call(a,e)},dr=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"getFieldsByNewsletter",(function(e){return a.getSubtype(e).getFields(e)})),y()(K()(a),"getSendButtonOptions",(function(){return a.getSubtype(a.state.item).getSendButtonOptions(a.state.item)})),y()(K()(a),"getSubtype",(function(e){switch(e.type){case"notification":return Jn;case"welcome":return or;default:return A.a.applyFilters("mailpoet_newsletters_send_newsletter_fields",Bn,e)}})),y()(K()(a),"getThumbnailPromise",(function(e){return a.state.thumbnailPromise?a.state.thumbnailPromise:Object(lr.b)(e)})),y()(K()(a),"isValid",(function(){return ve()("#mailpoet_newsletter").parsley().isValid()})),y()(K()(a),"isValidFromAddress",Wt()(Ut.a.mark((function e(){var t,n;return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("MailPoet"===window.mailpoet_mta_method){e.next=2;break}return e.abrupt("return",!0);case 2:return e.next=4,a.loadAuthorizedEmailAddresses();case 4:return t=e.sent,n=a.state.item.sender_address,e.abrupt("return",-1!==sn()(t).call(t,n));case 7:case"end":return e.stop()}}),e)})))),y()(K()(a),"showInvalidFromAddressError",(function(){var e=St()(q.a.I18n.t("newsletterInvalidFromAddress"),"%$1s",(function(){return a.state.item.sender_address}));e=St()(e,/\[link\](.*?)\[\/link\]/g,(function(e){return'<a href="https://account.mailpoet.com/authorization" target="_blank" rel="noopener noreferrer">'.concat(e,"</a>")})),ve()("#field_sender_address").parsley().addError("invalidFromAddress",{message:e.join(""),updateClass:!0})})),y()(K()(a),"removeInvalidFromAddressError",(function(){ve()("#field_sender_address").parsley().removeError("invalidFromAddress",{updateClass:!0})})),y()(K()(a),"loadItem",(function(e){return a.setState({loading:!0}),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:e}}).done((function(e){var t="draft"===e.data.status?a.getThumbnailPromise(e.meta.preview_url):null,n=e.data;n.ga_campaign||(n.ga_campaign=pr(n.id,n.subject)),a.setState({item:e.data,fields:a.getFieldsByNewsletter(e.data),thumbnailPromise:t})})).fail((function(){a.setState({item:{}},(function(){a.props.history.push("/new")}))}))})),y()(K()(a),"saveTemplate",(function(e,t){a.getThumbnailPromise(e.meta.preview_url).then((function(n){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"save",data:{newsletter_id:e.data.id,name:e.data.subject,thumbnail:n,body:oe()(e.data.body),categories:'["recent"]'}}).fail((function(e){a.showError(e),a.setState({loading:!1}),q.a.Modal.loading(!1)})),t()})).catch((function(e){a.showError({errors:[e]})}))})),y()(K()(a),"loadAuthorizedEmailAddresses",Wt()(Ut.a.mark((function e(){var t;return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("MailPoet"===window.mailpoet_mta_method){e.next=2;break}return e.abrupt("return",[]);case 2:return e.next=4,q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"mailer",action:"getAuthorizedEmailAddresses"});case 4:return t=e.sent,e.abrupt("return",t.data||[]);case 6:case"end":return e.stop()}}),e)})))),y()(K()(a),"handleSend",(function(e){return e.preventDefault(),a.removeInvalidFromAddressError(),a.isValid()?(q.a.Modal.loading(!0),a.isValidFromAddress().then((function(t){return t?a.saveNewsletter(e).done((function(){a.setState({loading:!0})})).done((function(e){switch(e.data.type){case"notification":case"welcome":return a.activateNewsletter(e);default:return a.sendNewsletter(e)}})).fail((function(e){a.showError(e),a.setState({loading:!1}),q.a.Modal.loading(!1)})):(a.showInvalidFromAddressError(),q.a.Modal.loading(!1))}))):ve()("#mailpoet_newsletter").parsley().validate()})),y()(K()(a),"sendNewsletter",(function(e){return q.a.Ajax.post(A.a.applyFilters("mailpoet_newsletters_send_server_request_parameters",{api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"add",data:{newsletter_id:a.state.item.id}},a.state.item)).done((function(t){a.saveTemplate(e,(function(){if(window.mailpoet_show_congratulate_after_first_newsletter)return q.a.Modal.loading(!1),void a.props.history.push("/send/congratulate/".concat(a.state.item.id));a.props.history.push(A.a.applyFilters("mailpoet_newsletters_send_server_request_response_redirect","/".concat(a.state.item.type||""),a.state.item));var e=A.a.applyFilters("mailpoet_newsletters_send_server_request_response",a.state.item,t);O.a.isFunction(e)?e():"scheduled"===t.data.status?(a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterHasBeenScheduled"))),q.a.trackEvent("Emails > Newsletter sent",{scheduled:!0,"MailPoet Free version":window.mailpoet_version})):(a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterBeingSent")),{id:"mailpoet_notice_being_sent"}),q.a.trackEvent("Emails > Newsletter sent",{scheduled:!1,"MailPoet Free version":window.mailpoet_version})),q.a.Modal.loading(!1)}))})).fail((function(e){a.showError(e),a.setState({loading:!1}),q.a.Modal.loading(!1)}))})),y()(K()(a),"activateNewsletter",(function(e){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:a.props.match.params.id,status:"active"}}).done((function(t){a.saveTemplate(e,(function(){if(window.mailpoet_show_congratulate_after_first_newsletter)return q.a.Modal.loading(!1),void a.props.history.push("/send/congratulate/".concat(a.state.item.id));a.props.history.push("/".concat(a.state.item.type||""));var e,n=a.state.item.options;"welcome"===t.data.type?(a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("welcomeEmailActivated"))),q.a.trackEvent("Emails > Welcome email activated",{"MailPoet Free version":window.mailpoet_version,"List type":n.event,Delay:E()(e="".concat(n.afterTimeNumber," ")).call(e,n.afterTimeType)})):"notification"===t.data.type&&(a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("postNotificationActivated"))),q.a.trackEvent("Emails > Post notifications activated",{"MailPoet Free version":window.mailpoet_version,Frequency:n.intervalType}));q.a.Modal.loading(!1)}))})).fail((function(e){a.showError(e),a.setState({loading:!1}),q.a.Modal.loading(!1)}))})),y()(K()(a),"handleResume",(function(e){return e.preventDefault(),a.isValid()?a.saveNewsletter(e).done((function(){a.setState({loading:!0})})).done((function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"resume",data:{newsletter_id:a.state.item.id}}).done((function(){a.props.history.push("/".concat(a.state.item.type||"")),a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterSendingHasBeenResumed")))})).fail((function(e){a.showError(e)}))})).fail((function(e){a.showError(e)})).always((function(){a.setState({loading:!1})})):ve()("#mailpoet_newsletter").parsley().validate(),!1})),y()(K()(a),"handleSave",(function(e){e.preventDefault(),a.saveNewsletter(e).done((function(){a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterUpdated")))})).done((function(){var e="automatic"===a.state.item.type?a.state.item.options.group:a.state.item.type;a.props.history.push("/".concat(e||""))})).fail((function(e){a.showError(e)}))})),y()(K()(a),"handleRedirectToDesign",(function(e){e.preventDefault();var t=e.target.href;a.saveNewsletter(e).done((function(){a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterUpdated")))})).done((function(){window.location=t})).fail((function(e){a.showError(e)}))})),y()(K()(a),"saveNewsletter",(function(){var e=a.state.item;e.queue=void 0,a.setState({loading:!0});var t=O.a.omit(e,["preheader","body","created_at","deleted_at","hash","status","updated_at","type"]);return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"save",data:t})})),y()(K()(a),"showError",(function(e){var t;e.errors.length>0&&a.context.notices.error(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})})),y()(K()(a),"handleFormChange",(function(e){var t=e.target.name,n=e.target.value;return a.setState((function(e){var a=e.item,r=a.subject,i=a.ga_campaign;(a[t]=n,"subject"===t)&&(i===pr(a.id,r)&&(a.ga_campaign=pr(a.id,n)));return{item:a}})),!0})),a.state={fields:[],item:{},loading:!0,thumbnailPromise:null},a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this;this.loadItem(this.props.match.params.id).always((function(){e.setState({loading:!1})})),ve()("#mailpoet_newsletter").parsley()}},{key:"componentDidUpdate",value:function(e){var t=this;this.props.match.params.id!==e.match.params.id&&this.loadItem(this.props.match.params.id).always((function(){t.setState({loading:!1})}))}},{key:"render",value:function(){var e,t="sending"===this.state.item.status&&this.state.item.queue&&"paused"===this.state.item.queue.status,a=x()(e=this.state.fields).call(e,(function(e){var a=e;return"segments"!==e.name&&"options"!==e.name||(a.disabled=t),a})),n=this.getSendButtonOptions(),r=A.a.applyFilters("mailpoet_newsletters_send_breadcrumb",R.a.createElement(J.a,{step:"send"}),this.state.item.type,"send"),i=window.mailpoet_subscribers_limit_reached||window.mailpoet_mss_key_pending_approval;return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("finalNewsletterStep")),r,R.a.createElement($a,{id:"mailpoet_newsletter",fields:a,automationId:"newsletter_send_form",item:this.state.item,loading:this.state.loading,onChange:this.handleFormChange,onSubmit:this.handleSave},R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement("p",{className:"submit"},t?R.a.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleResume,value:q.a.I18n.t("resume"),disabled:i}):R.a.createElement("input",pe()({className:"button button-primary",type:"button",onClick:this.handleSend,value:q.a.I18n.t("send")},n,{disabled:i}))," ",R.a.createElement("input",{className:"button button-secondary",type:"submit",value:q.a.I18n.t("saveDraftAndClose")})," ",q.a.I18n.t("orSimply")," ",R.a.createElement("a",{href:"?page=mailpoet-newsletter-editor&id=".concat(this.props.match.params.id),onClick:this.handleRedirectToDesign},q.a.I18n.t("goBackToDesign")),"."),!t&&n.disabled&&"disabled"===n.disabled&&R.a.createElement(qt.a,{tooltip:q.a.I18n.t("helpTooltipSendEmail"),tooltipId:"helpTooltipSendEmail"}),window.mailpoet_mss_key_pending_approval&&R.a.createElement("div",{className:"mailpoet_error"},St()(q.a.I18n.t("pendingKeyApprovalNotice"),/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{key:"pendingKeyApprovalNoticeLink",href:"https://account.mailpoet.com/authorization",target:"_blank",rel:"noopener noreferrer"},e)})))))}}]),t}(R.a.Component);dr.contextType=Ge.a,dr.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var mr=Object(ne.withRouter)(dr);function hr(e){return R.a.createElement("div",{className:"mailpoet_congratulate_success"},R.a.createElement("h1",null,"welcome"===(t=e.newsletter).type?q.a.I18n.t("congratulationsWelcomeEmailSuccessHeader"):"notification"===t.type?q.a.I18n.t("congratulationsPostNotificationSuccessHeader"):"automatic"===t.type?q.a.I18n.t("congratulationsWooSuccessHeader"):"scheduled"===t.status?q.a.I18n.t("congratulationsScheduleSuccessHeader"):q.a.I18n.t("congratulationsSendSuccessHeader")),R.a.createElement("img",{src:e.illustrationImageUrl,alt:"",width:"750",height:"250"}),R.a.createElement("button",{type:"button",className:"button",onClick:e.successClicked},q.a.I18n.t("close")));var t}hr.propTypes={successClicked:Z.a.func.isRequired,illustrationImageUrl:Z.a.string.isRequired,newsletter:Z.a.shape({status:Z.a.string.isRequired,type:Z.a.string.isRequired}).isRequired};var fr=hr,gr=a(67),vr=a.n(gr),br=function(e){var t,a;return e.step>e.steps_count?null:R.a.createElement("div",{className:"mailpoet_stepped_progress_bar"},x()(t=I()(vr()(a=Array(e.steps_count)).call(a))).call(t,(function(t){var a;return R.a.createElement("div",{className:E()(a="\n mailpoet_stepped_progress_bar_step ".concat(t<e.step?"active":""," ")).call(a,t===e.step-1?"current":"","\n "),key:"step_".concat(t)})})))};br.propTypes={steps_count:Z.a.number.isRequired,step:Z.a.number.isRequired};var _r=br,yr=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_flex"},R.a.createElement("div",{className:"mailpoet_welcome_wizard_illustration"},R.a.createElement("img",{src:e.illustrationUrl,alt:""})),R.a.createElement("div",{className:"mailpoet_welcome_wizard_step"},e.displayProgressBar&&e.step<=e.stepsCount?R.a.createElement(_r,{steps_count:e.stepsCount,step:e.step}):null,e.children))};yr.propTypes={illustrationUrl:Z.a.string.isRequired,displayProgressBar:Z.a.bool,step:Z.a.number,stepsCount:Z.a.number,children:Z.a.oneOfType([Z.a.arrayOf(Z.a.node),Z.a.node]).isRequired},yr.defaultProps={displayProgressBar:!0,step:0,stepsCount:-1};var wr=yr,Er=function(){return R.a.createElement("ul",{className:"welcome_wizard_tracking_list"},R.a.createElement("li",null,q.a.I18n.t("welcomeWizardMSSList1")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardMSSList2")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardMSSList4")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardMSSList5")))},kr=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_controls"},R.a.createElement("p",null,R.a.createElement("a",{href:e.mailpoetAccountUrl,target:"_blank",rel:"noopener noreferrer",className:"button button-primary",onClick:function(t){t.preventDefault(),window.open(e.mailpoetAccountUrl),e.next()}},e.nextButtonText)),R.a.createElement("p",null,R.a.createElement("a",{onClick:e.next,role:"button",tabIndex:0,onKeyDown:function(t){var a,n;C()(a=["keydown","keypress"]).call(a,t.type)&&C()(n=["Enter"," "]).call(n,t.key)&&(t.preventDefault(),e.next())}},q.a.I18n.t("welcomeWizardMSSNoThanks"))))};kr.propTypes={mailpoetAccountUrl:Z.a.string.isRequired,next:Z.a.func.isRequired,nextButtonText:Z.a.string.isRequired};var Ir=function(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardMSSFreeTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSFreeSubtitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSFreeListTitle"),":"),R.a.createElement(Er,null),R.a.createElement(kr,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.next,nextButtonText:q.a.I18n.t("welcomeWizardMSSFreeButton")}))};Ir.propTypes={mailpoetAccountUrl:Z.a.string.isRequired,next:Z.a.func.isRequired};var Sr=function(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardMSSNotFreeTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSNotFreeSubtitle"),":"),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSFreeListTitle"),":"),R.a.createElement(Er,null),R.a.createElement(kr,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.next,nextButtonText:q.a.I18n.t("welcomeWizardMSSNotFreeButton")}))};Sr.propTypes={mailpoetAccountUrl:Z.a.string.isRequired,next:Z.a.func.isRequired};var Cr=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},e.subscribersCount<1e3?R.a.createElement(Ir,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.next}):R.a.createElement(Sr,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.next}))};Cr.propTypes={next:Z.a.func.isRequired,subscribersCount:Z.a.number.isRequired,mailpoetAccountUrl:Z.a.string.isRequired};var Nr=Cr;function xr(e){return R.a.createElement("div",{className:"mailpoet_congratulate_success mailpoet_congratulate_mss_pitch"},R.a.createElement(wr,{illustrationUrl:e.MSSPitchIllustrationUrl,displayProgressBar:!1},R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("congratulationsMSSPitchHeader")),R.a.createElement("h2",null,q.a.I18n.t("congratulationsMSSPitchSubHeader")),R.a.createElement("p",null,q.a.I18n.t(e.subscribersCount<1e3?"welcomeWizardMSSFreeSubtitle":"welcomeWizardMSSNotFreeSubtitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSFreeListTitle"),":"),R.a.createElement(Er,null),R.a.createElement(kr,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.onFinish,nextButtonText:q.a.I18n.t("welcomeWizardMSSFreeButton")}))))}xr.propTypes={MSSPitchIllustrationUrl:Z.a.string.isRequired,onFinish:Z.a.func.isRequired,subscribersCount:Z.a.number.isRequired,mailpoetAccountUrl:Z.a.string.isRequired};var Tr=xr;function Rr(e){return window.has_mss_key_specified?R.a.createElement(fr,{successClicked:e.successClicked,illustrationImageUrl:e.illustrationImageUrl,newsletter:e.newsletter}):R.a.createElement(Tr,{MSSPitchIllustrationUrl:e.MSSPitchIllustrationUrl,onFinish:e.successClicked,subscribersCount:e.subscribersCount,mailpoetAccountUrl:e.mailpoetAccountUrl})}function Pr(e){return R.a.createElement(Rr,{successClicked:e.successClicked,illustrationImageUrl:e.illustrationImageUrl,MSSPitchIllustrationUrl:e.MSSPitchIllustrationUrl,newsletter:e.newsletter,subscribersCount:e.subscribersCount,mailpoetAccountUrl:e.mailpoetAccountUrl})}Pr.propTypes={successClicked:Z.a.func.isRequired,illustrationImageUrl:Z.a.string.isRequired,MSSPitchIllustrationUrl:Z.a.string.isRequired,newsletter:Z.a.shape({status:Z.a.string.isRequired,type:Z.a.string.isRequired}).isRequired,subscribersCount:Z.a.number.isRequired,mailpoetAccountUrl:Z.a.string.isRequired},Rr.propTypes={successClicked:Z.a.func.isRequired,illustrationImageUrl:Z.a.string.isRequired,MSSPitchIllustrationUrl:Z.a.string.isRequired,newsletter:Z.a.shape({status:Z.a.string.isRequired,type:Z.a.string.isRequired}).isRequired,subscribersCount:Z.a.number.isRequired,mailpoetAccountUrl:Z.a.string.isRequired};var Or=Pr;function Dr(e){return R.a.createElement("div",{className:"mailpoet_centered"},R.a.createElement("h1",null,q.a.I18n.t("congratulationsSendFailHeader")),R.a.createElement("p",null,St()(q.a.I18n.t("congratulationsSendFailExplain"),/\[link\](.*?)\[\/link\]/g,(function(e,t){return R.a.createElement("a",{key:t,target:"_blank",rel:"noopener noreferrer",href:"https://kb.mailpoet.com/article/231-sending-does-not-work","data-beacon-article":"5a0257ac2c7d3a272c0d7ad6"},e)}))),R.a.createElement("button",{type:"button",className:"button",onClick:e.failClicked},q.a.I18n.t("close")))}Dr.propTypes={failClicked:Z.a.func.isRequired};var Ar=Dr;var qr=function(){return R.a.createElement("div",{className:"mailpoet_loading"},R.a.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_1"}),R.a.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_2"}),R.a.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_3"}))};function Lr(e){return R.a.createElement("div",{className:"mailpoet_newsletter_loading"},R.a.createElement(qr,null),(t=e.showRichLoadingScreen,a=e.illustrationImageUrl,t?R.a.createElement("div",null,R.a.createElement("h1",{className:"mailpoet_newsletter_loading_header"},q.a.I18n.t("congratulationsLoadingHeader")),R.a.createElement("img",{src:a,alt:"",width:"800px",height:"266px"})):R.a.createElement("div",null)));var t,a}Lr.propTypes={illustrationImageUrl:Z.a.string.isRequired,showRichLoadingScreen:Z.a.bool.isRequired};var Fr=Lr;function jr(){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:{show_congratulate_after_first_newsletter:!1}}).always((function(){window.location=window.mailpoet_main_page}))}var Mr=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).state={loading:!0,newsletter:null,testingPassed:!1,timeStart:Dt()(),minimumLoadingTimePassed:!1},n.tick=F()(a=n.tick).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){this.loadNewsletter(this.props.match.params.id),this.tick()}},{key:"componentDidUpdate",value:function(e){e.match.params.id!==this.props.match.params.id&&this.loadNewsletter(this.props.match.params.id)}},{key:"tick",value:function(){Dt()().subtract(20,"second").isAfter(this.state.timeStart)&&this.setState({error:!0,loading:!1}),this.state.loading&&this.loadNewsletter(this.props.match.params.id),Dt()().subtract(6,"seconds").isAfter(this.state.timeStart)&&this.setState({minimumLoadingTimePassed:!0}),!this.state.loading&&this.state.minimumLoadingTimePassed||Yt()(this.tick,2e3)}},{key:"loadNewsletter",value:function(e){var t=this;q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:e}}).done((function(e){return t.newsletterLoaded(e.data)}))}},{key:"newsletterLoaded",value:function(e){"standard"!==e.type||"scheduled"===e.status?this.setState({newsletter:e,loading:!1,minimumLoadingTimePassed:!0}):"sent"===e.status||"sending"===e.status?this.setState({newsletter:e,loading:!1,testingPassed:!0}):this.setState({newsletter:e})}},{key:"renderContent",value:function(){return this.state.loading||!this.state.minimumLoadingTimePassed?(e=!!this.state.newsletter,R.a.createElement(Fr,{illustrationImageUrl:window.mailpoet_congratulations_loading_image,successClicked:jr,showRichLoadingScreen:e})):this.state.error?(q.a.trackEvent("Cron testing done",{"Cron is working":"false"}),R.a.createElement(Ar,{failClicked:function(){window.location=window.mailpoet_main_page}})):(t=this.state.newsletter,this.state.testingPassed&&q.a.trackEvent("Cron testing done",{"Cron is working":"true"}),R.a.createElement(Or,{illustrationImageUrl:window.mailpoet_congratulations_success_image,MSSPitchIllustrationUrl:window.MSS_pitch_illustration_url,successClicked:jr,newsletter:t,isWoocommerceActive:window.mailpoet_woocommerce_active,subscribersCount:window.mailpoet_subscribers_count,mailpoetAccountUrl:window.mailpoet_account_url}));var e,t}},{key:"render",value:function(){return R.a.createElement("div",{className:"newsletter_congratulate_page"},this.renderContent())}}]),t}(R.a.Component);Mr.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired};var Vr=Mr,Br=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"showTemplateSelection",(function(e){n.props.history.push("/template/".concat(e))})),n}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this;q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:"standard"}}).done((function(t){e.showTemplateSelection(t.data.id)})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("regularNewsletterTypeTitle")),R.a.createElement(J.a,{step:"type"}))}}]),t}(R.a.Component);Br.contextType=Ge.a,Br.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var zr=Object(ne.withRouter)(Br),Ur={name:"options",type:"reactComponent",component:Gn},$r=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"handleValueChange",(function(e){var t=a.state;t[e.target.name]=e.target.value,a.setState(t)})),y()(K()(a),"handleNext",(function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:O.a.extend({},a.state,{type:"notification",subject:q.a.I18n.t("draftPostNotificationTitle")})}).done((function(e){a.showTemplateSelection(e.data.id)})).fail((function(e){var t;e.errors.length>0&&a.context.notices.error(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))})),y()(K()(a),"showTemplateSelection",(function(e){a.props.history.push("/template/".concat(e))})),a.state={options:{intervalType:"daily",timeOfDay:0,weekDay:1,monthDay:0,nthWeekDay:1}},a}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("postNotificationNewsletterTypeTitle")),R.a.createElement(J.a,{step:"type"}),R.a.createElement("h3",null,q.a.I18n.t("selectFrequency")),R.a.createElement(Gn,{item:this.state,field:Ur,onValueChange:this.handleValueChange}),R.a.createElement("p",{className:"submit"},R.a.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleNext,value:q.a.I18n.t("next")})))}}]),t}(R.a.Component);$r.contextType=Ge.a,$r.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var Wr=Object(ne.withRouter)($r),Hr={name:"options",label:"Event",type:"reactComponent",component:ir},Kr=function(e){function t(e){var a,n,r;M()(this,t),r=U()(this,W()(t).call(this,e));var i=window.mailpoet_segments||[],s=1;return i=h()(i).call(i,(function(e){return"default"===e.type})),O.a.size(i)>0&&(s=O.a.first(i).id),r.state={options:{event:"segment",segment:s,role:"subscriber",afterTimeNumber:1,afterTimeType:"immediate"}},r.handleValueChange=F()(a=r.handleValueChange).call(a,K()(r)),r.handleNext=F()(n=r.handleNext).call(n,K()(r)),r}return Y()(t,e),B()(t,[{key:"handleValueChange",value:function(e){var t=this.state;t[e.target.name]=e.target.value,this.setState(t)}},{key:"handleNext",value:function(){var e=this;q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:O.a.extend({},this.state,{type:"welcome",subject:q.a.I18n.t("draftNewsletterTitle")})}).done((function(t){e.showTemplateSelection(t.data.id)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{key:"showTemplateSelection",value:function(e){this.props.history.push("/template/".concat(e))}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("welcomeNewsletterTypeTitle")),R.a.createElement(J.a,{step:"type"}),R.a.createElement("h3",null,q.a.I18n.t("selectEventToSendWelcomeEmail")),R.a.createElement(ir,{item:this.state,field:Hr,onValueChange:this.handleValueChange}),R.a.createElement("p",{className:"submit"},R.a.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleNext,value:q.a.I18n.t("next")})))}}]),t}(R.a.Component);Kr.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var Gr=Kr,Yr=a(486),Jr=a.n(Yr),Qr=function(e){var t=e.errors;return t.length<1?null:R.a.createElement(Qt,{type:"error",closable:!1},x()(t).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})))};Qr.propTypes={errors:Z.a.arrayOf(Z.a.shape({message:Z.a.string.isRequired})).isRequired};var Zr=Qr,Xr=Z.a.shape({status:Z.a.string,count_processed:Z.a.string.isRequired,count_total:Z.a.string.isRequired,scheduled_at:Z.a.string}),ei=Z.a.shape({id:Z.a.number.isRequired,queue:Z.a.oneOfType([Xr,Z.a.bool])}),ti=function(e){var t=e.queue,a=lt()("mailpoet_progress",{mailpoet_progress_complete:"completed"===t.status}),n=Math.round(100*t.count_processed/t.count_total),r=0;return Jr()(n)?(r=n,n+="%"):n=q.a.I18n.t("noSubscribers"),R.a.createElement("div",{className:a},R.a.createElement("span",{className:"mailpoet_progress_bar",style:{width:"".concat(r,"%")}}),R.a.createElement("span",{className:"mailpoet_progress_label"},n))};ti.propTypes={queue:Xr.isRequired};var ai=function(e){var t=e.newsletter;return R.a.createElement(st.b,{to:"/sending-status/".concat(t.id),"data-automation-id":"sending_status_".concat(t.id)},R.a.createElement("span",null,q.a.I18n.t("newsletterQueueCompleted").replace("%$1d",Se()(t.queue.count_processed,10).toLocaleString()).replace("%$2d",Se()(t.queue.count_total,10).toLocaleString())))};ai.propTypes={newsletter:ei.isRequired};var ni=function(e){var t=e.className,a=e.onClick,n=e.children;return R.a.createElement("a",{className:lt()("button",t),style:{display:"inline-block"},href:"#",onClick:function(e){e.preventDefault(),a(e)}},n)};ni.propTypes={className:Z.a.string,onClick:Z.a.func.isRequired,children:Z.a.string.isRequired},ni.defaultProps={className:""};var ri=function(e){var t=e.newsletter,a=R.a.useState("paused"===t.queue.status),n=Ne()(a,2),r=n[0],i=n[1],s=R.a.useState([]),o=Ne()(s,2),l=o[0],c=o[1];return R.a.createElement(R.a.Fragment,null,R.a.createElement(Zr,{errors:l}),R.a.createElement("span",null,Se()(t.queue.count_processed,10).toLocaleString(),"/",Se()(t.queue.count_total,10).toLocaleString(),"  ",r&&R.a.createElement(ni,{onClick:function(){c([]),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"resume",data:{newsletter_id:t.id}}).done((function(){return i(!1)})).fail((function(e){return c(e.errors)}))}},q.a.I18n.t("resume")),!r&&R.a.createElement(ni,{className:"mailpoet_pause",onClick:function(){c([]),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"pause",data:{newsletter_id:t.id}}).done((function(){return i(!0)})).fail((function(e){return c(e.errors)}))}},q.a.I18n.t("pause"))))};ri.propTypes={newsletter:ei.isRequired};var ii=function(e){var t=e.newsletter,a=e.mailerLog;return t.queue?"paused"===a.status&&"completed"!==t.queue.status?R.a.createElement("span",null,q.a.I18n.t("paused")):"scheduled"===t.queue.status?R.a.createElement("span",null,q.a.I18n.t("scheduledFor")," ",q.a.Date.format(t.queue.scheduled_at)):R.a.createElement("div",null,R.a.createElement(ti,{queue:t.queue}),R.a.createElement("p",{style:{textAlign:"center"}},"completed"===t.queue.status&&R.a.createElement(ai,{newsletter:t}),"completed"!==t.queue.status&&R.a.createElement(ri,{newsletter:t}))):R.a.createElement("span",null,q.a.I18n.t("notSentYet"))};ii.propTypes={newsletter:ei.isRequired,mailerLog:Z.a.shape({status:Z.a.string}).isRequired};var si=ii,oi=function(e){var t=e.mailpoetInstalledDaysAgo,a=e.sendTransactionalEmails,n=e.mtaMethod,r=e.noticeDismissed,i=e.apiVersion,s=Object(T.useState)(!1),o=Ne()(s,2),l=o[0],c=o[1],u=function(){q.a.Ajax.post({api_version:i,endpoint:"UserFlags",action:"set",data:{transactional_emails_opt_in_notice_dismissed:"1"}})};return t<30?null:a?null:"PHPMail"===n?null:"1"===r?null:l?null:R.a.createElement(Qt,{type:"success",timeout:!1,onClose:u},R.a.createElement("h3",null,q.a.I18n.t("transactionalEmailNoticeTitle")),R.a.createElement("p",null,q.a.I18n.t("transactionalEmailNoticeBody")," ",R.a.createElement("a",{href:"https://kb.mailpoet.com/article/292-choose-how-to-send-your-wordpress-websites-emails",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("transactionalEmailNoticeBodyReadMore"))),R.a.createElement("p",null,R.a.createElement("button",{type:"button",className:"button",onClick:function(){c(!0),q.a.Ajax.post({api_version:i,endpoint:"settings",action:"set",data:{send_transactional_emails:"1"}}),u()}},q.a.I18n.t("transactionalEmailNoticeCTA"))))};oi.propTypes={mailpoetInstalledDaysAgo:Z.a.number.isRequired,sendTransactionalEmails:Z.a.bool.isRequired,noticeDismissed:Z.a.string.isRequired,mtaMethod:Z.a.string.isRequired,apiVersion:Z.a.string.isRequired};var li=oi,ci=!!window.mailpoet_tracking_enabled,ui={onNoItemsFound:function(e,t){return q.a.I18n.t(t?"noItemsFound":"emptyListing")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},pi=[{name:"subject",label:q.a.I18n.t("subject"),sortable:!0},{name:"status",label:q.a.I18n.t("status")},{name:"segments",label:q.a.I18n.t("lists")},{name:"statistics",label:q.a.I18n.t("statistics"),display:ci},{name:"sent_at",label:q.a.I18n.t("sentOn"),sortable:!0}],di=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:ui.onTrash}],mi=function(e){var t=function(){window.location.href="?page=mailpoet-newsletter-editor&id=".concat(e.id)};e.queue&&"sending"===e.status&&null===e.queue.status?pn({message:q.a.I18n.t("confirmEdit"),onConfirm:t}):t()},hi=[{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"edit",label:q.a.I18n.t("edit"),onClick:mi},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("newsletterDuplicated").replace("%$1s",e.data.subject)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"trash"}];hi=Tt(hi);var fi=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"renderItem",(function(e,t,a){var n,r=lt()("manage-column","column-primary","has-row-actions"),i=x()(n=e.segments).call(n,(function(e){return e.name})).join(", ");return R.a.createElement("div",null,R.a.createElement("td",{className:r},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"#",onClick:function(t){t.preventDefault(),mi(e)}},e.queue.newsletter_rendered_subject||e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},R.a.createElement(si,{newsletter:e,mailerLog:a.mta_log})),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("lists")},i),!0===ci?R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("statistics")},R.a.createElement(Bt,{newsletter:e,currentTime:a.current_time})):null,R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("sentOn")},R.a.createElement("abbr",null,e.sent_at?q.a.Date.format(e.sent_at):q.a.I18n.t("notSentYet"))))})),a.state={newslettersCount:void 0},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e=this;return R.a.createElement("div",null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(Zt,null),R.a.createElement(li,{mailpoetInstalledDaysAgo:window.mailpoet_installed_days_ago,sendTransactionalEmails:window.mailpoet_send_transactional_emails,mtaMethod:window.mailpoet_mta_method,apiVersion:window.mailpoet_api_version,noticeDismissed:window.mailpoet_transactional_emails_opt_in_notice_dismissed}),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(yt,{tab:"standard"}),0===this.state.newslettersCount&&R.a.createElement(Kt,{filter:function(e){return"standard"===e.slug},showHeader:!1}),0!==this.state.newslettersCount&&R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"standard",base_url:"standard",onRenderItem:this.renderItem,columns:pi,bulk_actions:di,item_actions:hi,messages:ui,auto_refresh:!0,sort_by:"sent_at",sort_order:"desc",afterGetItems:function(t){if(!t.loading){var a,n=Pe()(a=t.groups).call(a,(function(e,t){return e+t.count}),0);e.setState({newslettersCount:n})}Rt(t),Pt(t)}}))}}]),t}(R.a.Component);fi.contextType=Ge.a,fi.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var gi=fi,vi=window.mailpoet_roles||{},bi=window.mailpoet_segments||{},_i=!!window.mailpoet_tracking_enabled,yi={onNoItemsFound:function(e,t){return q.a.I18n.t(t?"noItemsFound":"emptyListing")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},wi=[{name:"subject",label:q.a.I18n.t("subject"),sortable:!0},{name:"status",label:q.a.I18n.t("status"),width:145},{name:"settings",label:q.a.I18n.t("settings")},{name:"statistics",label:q.a.I18n.t("statistics"),display:_i},{name:"updated_at",label:q.a.I18n.t("lastModifiedOn"),sortable:!0}],Ei=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:yi.onTrash}],ki=[{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("newsletterDuplicated").replace("%$1s",e.data.subject)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"edit",link:function(e){return R.a.createElement("a",{href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},q.a.I18n.t("edit"))}},{name:"trash"}];ki=Tt(ki);var Ii=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"updateStatus",(function(e){e.persist(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:Number(e.target.getAttribute("data-id")),status:e.target.value}}).done((function(e){"active"===e.data.status&&q.a.Notice.success(q.a.I18n.t("welcomeEmailActivated")),a.forceUpdate()})).fail((function(t){q.a.Notice.showApiErrorNotice(t),e.target.value=t.status}))})),y()(K()(a),"renderStatus",(function(e){var t=q.a.I18n.t("sentToXSubscribers").replace("%$1d",e.total_sent.toLocaleString()),n=q.a.I18n.t("scheduledToXSubscribers").replace("%$1d",e.total_scheduled.toLocaleString());return R.a.createElement("div",null,R.a.createElement("p",null,R.a.createElement("select",{"data-id":e.id,defaultValue:e.status,onChange:a.updateStatus},R.a.createElement("option",{value:"active"},q.a.I18n.t("active")),R.a.createElement("option",{value:"draft"},q.a.I18n.t("inactive")))),R.a.createElement("p",null,R.a.createElement(st.b,{to:"/sending-status/".concat(e.id),"data-automation-id":"sending_status_".concat(e.id)},t)," ",R.a.createElement("br",null),n))})),y()(K()(a),"renderSettings",(function(e){var t,a,n;switch(e.options.event){case"user":t="mailpoet_all"===e.options.role?q.a.I18n.t("welcomeEventWPUserAnyRole"):q.a.I18n.t("welcomeEventWPUserWithRole").replace("%$1s",vi[e.options.role]);break;default:if(void 0===(n=me()(O.a).call(O.a,bi,(function(t){return Number(t.id)===Number(e.options.segment)}))))return R.a.createElement("span",{className:"mailpoet_error"},q.a.I18n.t("sendingToSegmentsNotSpecified"));t=q.a.I18n.t("welcomeEventSegment").replace("%$1s",n.name)}if(t&&"immediate"!==e.options.afterTimeType){switch(e.options.afterTimeType){case"minutes":a=q.a.I18n.t("sendingDelayMinutes").replace("%$1d",e.options.afterTimeNumber);break;case"hours":a=q.a.I18n.t("sendingDelayHours").replace("%$1d",e.options.afterTimeNumber);break;case"days":a=q.a.I18n.t("sendingDelayDays").replace("%$1d",e.options.afterTimeNumber);break;case"weeks":a=q.a.I18n.t("sendingDelayWeeks").replace("%$1d",e.options.afterTimeNumber);break;default:a=q.a.I18n.t("sendingDelayInvalid")}t+=" [".concat(a,"].")}return R.a.createElement("span",null,t)})),y()(K()(a),"renderItem",(function(e,t){var n=lt()("manage-column","column-primary","has-row-actions");return R.a.createElement("div",null,R.a.createElement("td",{className:n},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},a.renderStatus(e)),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("settings")},a.renderSettings(e)),!0===_i?R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("statistics")},R.a.createElement(Bt,{newsletter:e,isSent:e.total_sent>0&&!!e.statistics})):null,R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("lastModifiedOn")},R.a.createElement("abbr",null,q.a.Date.format(e.updated_at))))})),a.state={newslettersCount:void 0},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e=this;return R.a.createElement("div",null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(yt,{tab:"welcome"}),0===this.state.newslettersCount&&R.a.createElement(Kt,{filter:function(e){return"welcome"===e.slug},showHeader:!1}),0!==this.state.newslettersCount&&R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"welcome",base_url:"welcome",onRenderItem:this.renderItem,columns:wi,bulk_actions:Ei,item_actions:ki,messages:yi,auto_refresh:!0,sort_by:"updated_at",sort_order:"desc",afterGetItems:function(t){if(!t.loading){var a,n=Pe()(a=t.groups).call(a,(function(e,t){return e+t.count}),0);e.setState({newslettersCount:n})}Rt(t),Pt(t)}}))}}]),t}(R.a.Component);Ii.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var Si=Ii,Ci={onNoItemsFound:function(e,t){return q.a.I18n.t(t?"noItemsFound":"emptyListing")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},Ni=[{name:"subject",label:q.a.I18n.t("subject"),sortable:!0},{name:"status",label:q.a.I18n.t("status"),width:100},{name:"settings",label:q.a.I18n.t("settings")},{name:"history",label:q.a.I18n.t("history"),width:100},{name:"updated_at",label:q.a.I18n.t("lastModifiedOn"),sortable:!0}],xi=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:Ci.onTrash}],Ti=[{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"edit",link:function(e){return R.a.createElement("a",{href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},q.a.I18n.t("edit"))}},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("newsletterDuplicated").replace("%$1s",e.data.subject)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"trash"}],Ri=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"updateStatus",(function(e){e.persist(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:Number(e.target.getAttribute("data-id")),status:e.target.value}}).done((function(e){"active"===e.data.status&&q.a.Notice.success(q.a.I18n.t("postNotificationActivated")),a.forceUpdate()})).fail((function(t){q.a.Notice.showApiErrorNotice(t),e.target.value=t.status}))})),y()(K()(a),"renderStatus",(function(e){return R.a.createElement("select",{"data-id":e.id,defaultValue:e.status,onChange:a.updateStatus},R.a.createElement("option",{value:"active"},q.a.I18n.t("active")),R.a.createElement("option",{value:"draft"},q.a.I18n.t("inactive")))})),y()(K()(a),"renderSettings",(function(e){var t,a,n=x()(t=e.segments).call(t,(function(e){return e.name})),r=q.a.I18n.t("ifNewContentToSegments").replace("%$1s",n.join(", "));if(0===n.length)return R.a.createElement("span",{className:"mailpoet_error"},q.a.I18n.t("sendingToSegmentsNotSpecified"));switch(e.options.intervalType){case"daily":a=q.a.I18n.t("sendDaily").replace("%$1s",Fe[e.options.timeOfDay]);break;case"weekly":a=q.a.I18n.t("sendWeekly").replace("%$1s",je[e.options.weekDay]).replace("%$2s",Fe[e.options.timeOfDay]);break;case"monthly":a=q.a.I18n.t("sendMonthly").replace("%$1s",Me[e.options.monthDay]).replace("%$2s",Fe[e.options.timeOfDay]);break;case"nthWeekDay":a=q.a.I18n.t("sendNthWeekDay").replace("%$1s",Ve[e.options.nthWeekDay]).replace("%$2s",je[e.options.weekDay]).replace("%$3s",Fe[e.options.timeOfDay]);break;case"immediately":a=q.a.I18n.t("sendImmediately");break;default:a="Invalid sending frequency"}return R.a.createElement("span",null,a," ",r)})),y()(K()(a),"renderHistoryLink",(function(e){return 0===Number(e.children_count)?q.a.I18n.t("notSentYet"):R.a.createElement(st.b,{"data-automation-id":"history-".concat(e.id),to:"/notification/history/".concat(e.id)},q.a.I18n.t("viewHistory"))})),y()(K()(a),"renderItem",(function(e,t){var n=lt()("manage-column","column-primary","has-row-actions");return R.a.createElement("div",null,R.a.createElement("td",{className:n},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},a.renderStatus(e)),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("settings")},a.renderSettings(e)),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("history")},a.renderHistoryLink(e)),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("lastModifiedOn")},R.a.createElement("abbr",null,q.a.Date.format(e.updated_at))))})),a.state={newslettersCount:void 0},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e=this;return R.a.createElement("div",null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(yt,{tab:"notification"}),0===this.state.newslettersCount&&R.a.createElement(Kt,{filter:function(e){return"notification"===e.slug},showHeader:!1}),0!==this.state.newslettersCount&&R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"notification",base_url:"notification",onRenderItem:this.renderItem,columns:Ni,bulk_actions:xi,item_actions:Ti,messages:Ci,auto_refresh:!0,sort_by:"updated_at",sort_order:"desc",afterGetItems:function(t){if(!t.loading){var a,n=Pe()(a=t.groups).call(a,(function(e,t){return e+t.count}),0);e.setState({newslettersCount:n})}Rt(t),Pt(t)}}))}}]),t}(R.a.Component);Ri.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var Pi=Ri,Oi=!!window.mailpoet_tracking_enabled,Di=[{name:"subject",label:q.a.I18n.t("subject")},{name:"status",label:q.a.I18n.t("status")},{name:"segments",label:q.a.I18n.t("lists")},{name:"statistics",label:q.a.I18n.t("statistics"),display:Oi},{name:"sent_at",label:q.a.I18n.t("sentOn")}],Ai={onNoItemsFound:function(e,t){return q.a.I18n.t(t?"noItemsFound":"emptyListing")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},qi=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:Ai.onTrash}],Li=Tt([{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"trash"}]),Fi=function(e,t,a){var n,r=lt()("manage-column","column-primary","has-row-actions"),i=x()(n=e.segments).call(n,(function(e){return e.name})).join(", ");return R.a.createElement(R.a.Fragment,null,R.a.createElement("td",{className:r},R.a.createElement("strong",null,R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},e.queue.newsletter_rendered_subject||e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},R.a.createElement(si,{newsletter:e,mailerLog:a.mta_log})),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("lists")},i),!0===Oi?R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("statistics")},R.a.createElement(Bt,{newsletter:e,currentTime:a.current_time})):null,R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("sentOn")},e.sent_at?q.a.Date.format(e.sent_at):q.a.I18n.t("notSentYet")))},ji=function(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(yt,{tab:"notification"}),R.a.createElement(st.b,{className:"page-title-action",to:"/notification"},q.a.I18n.t("backToPostNotifications")),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:e.location,params:e.match.params,endpoint:"newsletters",type:"notification_history",base_url:"notification/history/:parent_id",onRenderItem:Fi,columns:Di,messages:Ai,item_actions:Li,bulk_actions:qi,auto_refresh:!0,sort_by:"sent_at",sort_order:"desc",afterGetItems:function(e){Rt(e),Pt(e)}}))};ji.propTypes={location:Z.a.shape({pathname:Z.a.string}).isRequired,match:Z.a.shape({params:Z.a.shape({id:Z.a.string})}).isRequired};var Mi=ji,Vi=[{name:"subscriber_id",label:q.a.I18n.t("subscriber"),sortable:!0},{name:"status",label:q.a.I18n.t("sendingStatus")},{name:"failureReason",label:q.a.I18n.t("failureReason")}],Bi={onNoItemsFound:function(){return q.a.I18n.t("noSendingTaskFound")}},zi=function(e){var t=R.a.useState({id:e.match.params.id,subject:"",sent:!1}),a=Ne()(t,2),n=a[0],r=a[1];return R.a.useEffect((function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:n.id}}).done((function(e){return r({id:n.id,subject:e.data.subject,sent:null!==e.data.sent_at})})).fail((function(e){return q.a.Notice.showApiErrorNotice(e)}))}),[n.id]),R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",null,q.a.I18n.t("sendingStatusTitle")),R.a.createElement($i,{newsletter:n}),R.a.createElement(Ui,{location:e.location,params:e.match.params}))};zi.propTypes={location:Z.a.shape({pathname:Z.a.string}).isRequired,match:Z.a.shape({params:Z.a.shape({id:Z.a.string.isRequired}).isRequired}).isRequired};var Ui=R.a.memo((function(e){var t=e.location,a=e.params;return R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:t,params:a,endpoint:"sending_task_subscribers",base_url:"sending-status/:id",onRenderItem:function(e){return R.a.createElement("div",null,R.a.createElement(Wi,e))},getListingItemKey:function(e){var t;return E()(t="".concat(e.taskId,"-")).call(t,e.subscriberId)},columns:Vi,messages:Bi,auto_refresh:!0,sort_by:"failed",sort_order:"desc",afterGetItems:function(e){Rt(e),Pt(e)}})}),(function(e,t){return e.location.pathname===t.location.pathname&&e.params.id===t.params.id}));Ui.propTypes={location:Z.a.shape({pathname:Z.a.string}).isRequired,params:Z.a.shape({id:Z.a.string.isRequired}).isRequired};var $i=function(e){var t=e.newsletter;return t.id&&t.subject&&t.sent?R.a.createElement("p",null,R.a.createElement(st.b,{to:"/stats/".concat(t.id)},t.subject)):null};$i.propTypes={newsletter:Z.a.shape({id:Z.a.string,subject:Z.a.string,sent:Z.a.bool})},$i.defaultProps={newsletter:{id:null,subject:null,sent:!1}};var Wi=function(e){var t,a,n,r,i=e.error,s=e.failed,o=e.taskId,l=e.processed,c=e.email,u=e.subscriberId,p=e.lastName,d=e.firstName,m=lt()("manage-column","column-primary","has-row-actions"),h=q.a.I18n.t("unprocessed");return"1"===l&&(h="1"===s?R.a.createElement("span",null,q.a.I18n.t("failed"),R.a.createElement("br",null),R.a.createElement("a",{className:"button",href:"#",onClick:function(e){e.preventDefault(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sending_task_subscribers",action:"resend",data:{taskId:o,subscriberId:u}}).done((function(){return window.mailpoet_listing.forceUpdate()})).fail((function(e){return q.a.Notice.showApiErrorNotice(e)}))}},q.a.I18n.t("resend"))):q.a.I18n.t("sent")),R.a.createElement(R.a.Fragment,null,R.a.createElement("td",{"data-automation-id":E()(t="name_".concat(o,"_")).call(t,u),className:m},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"admin.php?page=mailpoet-subscribers#/edit/".concat(u)},c)),R.a.createElement("p",{style:{margin:0}},E()(a="".concat(d," ")).call(a,p))),R.a.createElement("td",{className:"column","data-automation-id":E()(n="status_".concat(o,"_")).call(n,u),"data-colname":q.a.I18n.t("sendingStatus")},h),R.a.createElement("td",{className:"column","data-automation-id":E()(r="error_".concat(o,"_")).call(r,u),"data-colname":q.a.I18n.t("failureReason")},i))};Wi.propTypes={error:Z.a.string,email:Z.a.string.isRequired,failed:Z.a.string.isRequired,taskId:Z.a.string.isRequired,lastName:Z.a.string.isRequired,firstName:Z.a.string.isRequired,processed:Z.a.string.isRequired,subscriberId:Z.a.string.isRequired},Wi.defaultProps={error:""};var Hi=zi,Ki=function(e){var t,a,n,r=e.newsletter,i=r.total_sent||0,s=0,o=0,l=0;i>0&&(s=100*r.statistics.clicked/i,o=100*r.statistics.opened/i,l=100*r.statistics.unsubscribed/i);var c,u=q.a.Num.toLocaleFixed(s,1),p=q.a.Num.toLocaleFixed(o,1),d=q.a.Num.toLocaleFixed(l,1),m=E()(t="".concat(p,"% ")).call(t,q.a.I18n.t("percentageOpened")),h=E()(a="".concat(u,"% ")).call(a,q.a.I18n.t("percentageClicked")),f=E()(n="".concat(d,"% ")).call(n,q.a.I18n.t("percentageUnsubscribed"));return c=i>=20&&r.statistics.opened>=5?R.a.createElement("div",{className:"mailpoet_stat_grey"},R.a.createElement("div",{className:"mailpoet_stat_big mailpoet_stat_spaced"},R.a.createElement(Ft.a,{stat:"opened",rate:o,headline:m})),R.a.createElement("div",{className:"mailpoet_stat_big mailpoet_stat_spaced"},R.a.createElement(Ft.a,{stat:"clicked",rate:s,headline:h})),A.a.applyFilters("mailpoet_newsletters_revenues_stats",null,r.statistics.revenue),R.a.createElement("div",null,R.a.createElement(Ft.a,{stat:"unsubscribed",rate:l,headline:f}))):R.a.createElement("div",{className:"mailpoet_stat_grey"},R.a.createElement("div",{className:"mailpoet_stat_big mailpoet_stat_spaced"},m),R.a.createElement("div",{className:"mailpoet_stat_big mailpoet_stat_spaced"},h),A.a.applyFilters("mailpoet_newsletters_revenues_stats",null,r.statistics.revenue),R.a.createElement("div",null,f)),R.a.createElement("div",null,R.a.createElement("p",{className:"mailpoet_stat_grey mailpoet_stat_big"},q.a.I18n.t("statsTotalSent")," ",Se()(i,10).toLocaleString()),c,r.ga_campaign&&R.a.createElement("p",null,q.a.I18n.t("googleAnalytics"),": ",r.ga_campaign),R.a.createElement("p",null,R.a.createElement("a",{href:"https://kb.mailpoet.com/article/190-whats-a-good-email-open-rate",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("readMoreOnStats"))))};Ki.propTypes={newsletter:Z.a.shape({ga_campaign:Z.a.string,total_sent:Z.a.number,statistics:Z.a.shape({clicked:Z.a.number,opened:Z.a.number,unsubscribed:Z.a.number,revenue:Z.a.shape({currency:Z.a.string.isRequired,value:Z.a.number.isRequired,formatted:Z.a.string.isRequired,count:Z.a.number.isRequired})}).isRequired}).isRequired};var Gi=Ki;function Yi(e,t){var a,n="";e&&(n=t?E()(a="".concat(t," <")).call(a,e,">"):e);return n}function Ji(e){var t,a=e.newsletter,n=a.queue.scheduled_at||a.queue.created_at,r=Yi(a.sender_address||"",a.sender_name||""),i=Yi(a.reply_to_address||"",a.reply_to_name||""),s=x()(t=a.segments||[]).call(t,(function(e){return e.name})).join(", ");return R.a.createElement("div",null,R.a.createElement("div",{className:"mailpoet_stat_spaced"},R.a.createElement("a",{href:a.preview_url,className:"button-secondary",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("statsPreviewNewsletter"))),R.a.createElement("p",null,q.a.I18n.t("statsDateSent"),":"," ",q.a.Date.format(n)),s&&R.a.createElement("p",null,q.a.I18n.t("statsToSegments"),":"," ",s),R.a.createElement("p",null,q.a.I18n.t("statsFromAddress"),":"," ",r),i&&R.a.createElement("p",null,q.a.I18n.t("statsReplyToAddress"),":"," ",i))}Ji.propTypes={newsletter:Z.a.shape({queue:Z.a.shape({scheduled_at:Z.a.string,created_at:Z.a.string}).isRequired,sender_address:Z.a.string,sender_name:Z.a.string,reply_to_address:Z.a.string,preview_url:Z.a.string,reply_to_name:Z.a.string,segments:Z.a.array}).isRequired};var Qi=Ji,Zi=function(){if(!window.mailpoet_display_detailed_stats){var e=R.a.createElement("a",{className:"button",href:q.a.MailPoetComUrlFactory.getFreePlanUrl({utm_medium:"stats",utm_campaign:"signup"}),target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("premiumBannerCtaFree"));return R.a.createElement("div",{className:"mailpoet_stats_premium_banner"},R.a.createElement("h1",null,q.a.I18n.t("premiumBannerTitle")),R.a.createElement("p",null,e),R.a.createElement("a",{href:"admin.php?page=mailpoet-premium"},q.a.I18n.t("premiumBannerLink")))}if(window.mailpoet_subscribers_limit_reached){var t=window.mailpoet_has_valid_api_key,a=q.a.I18n.t("subscribersLimitNoticeTitle").replace("[subscribersLimit]",window.mailpoet_subscribers_limit),n=q.a.I18n.t(t?"yourPlanLimit":"freeVersionLimit").replace("[subscribersLimit]",window.mailpoet_subscribers_limit),r=t?"https://account.mailpoet.com/upgrade":"https://account.mailpoet.com/?s=".concat(window.mailpoet_subscribers_count+1);return R.a.createElement("div",{className:"mailpoet_stats_premium_banner"},R.a.createElement("h1",null,a),R.a.createElement("p",null,n),R.a.createElement("p",null,R.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",className:"button",href:r},q.a.I18n.t("upgradeNow"))))}return null},Xi=function(e){function t(e){var a;return M()(this,t),(a=U()(this,W()(t).call(this,e))).state={item:{},loading:!0},a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this.props.match;window.scrollTo(0,0),this.loadItem(e.params.id)}},{key:"componentDidUpdate",value:function(e){e.match.params.id!==this.props.match.params.id&&this.loadItem(this.props.match.params.id)}},{key:"loadItem",value:function(e){var t=this,a=this.props.history;this.setState({loading:!0}),q.a.Modal.loading(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:window.mailpoet_display_detailed_stats?"stats":"newsletters",action:window.mailpoet_display_detailed_stats?"get":"getWithStats",data:{id:e}}).always((function(){q.a.Modal.loading(!1)})).done((function(e){t.setState({loading:!1,item:e.data})})).fail((function(e){var n;q.a.Notice.error(x()(n=e.errors).call(n,(function(e){return e.message})),{scroll:!0}),t.setState({loading:!1,item:{}},(function(){a.push("/")}))}))}},{key:"render",value:function(){var e,t=this.state,a=t.item,n=t.loading,r=a,i=this.props,s=i.match,o=i.location;return n||!r.queue?R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("statsTitle"),R.a.createElement(st.b,{className:"page-title-action",to:"/"},q.a.I18n.t("backToList")))):R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},E()(e="".concat(q.a.I18n.t("statsTitle"),": ")).call(e,r.subject),R.a.createElement(st.b,{className:"page-title-action",to:"/"},q.a.I18n.t("backToList"))),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement("div",{className:"mailpoet_stat_triple-spaced"},R.a.createElement("div",{className:"mailpoet_stat_info"},R.a.createElement(Qi,{newsletter:r})),R.a.createElement("div",{className:"mailpoet_stat_general"},R.a.createElement(Gi,{newsletter:r})),R.a.createElement("div",{style:{clear:"both"}})),R.a.createElement("h2",null,q.a.I18n.t("clickedLinks")),R.a.createElement("div",{className:"mailpoet_stat_triple-spaced"},A.a.applyFilters("mailpoet_newsletters_clicked_links_table",R.a.createElement(Zi,null),r.clicked_links)),R.a.createElement("div",{className:"mailpoet_stat_triple-spaced"},A.a.applyFilters("mailpoet_newsletters_purchased_products",null,r)),R.a.createElement("h2",null,q.a.I18n.t("subscriberEngagement")),A.a.applyFilters("mailpoet_newsletters_subscriber_engagement",R.a.createElement(Zi,null),o,s.params,r))}}]),t}(R.a.Component);Xi.propTypes={match:Z.a.shape({params:Z.a.object.isRequired}).isRequired,location:Z.a.object.isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var es,ts=Object(ne.withRouter)(Xi),as=A.a.applyFilters("mailpoet_newsletters_before_router",E()(es=[{path:"/standard/(.*)?",component:gi},{path:"/welcome/(.*)?",component:Si},{path:"/notification/history/:parent_id/(.*)?",component:Mi},{path:"/notification/(.*)?",component:Pi},{path:"/new/standard",component:zr},{path:"/new/notification",component:Wr},{path:"/new/welcome",component:Gr},{path:"/new",component:Kt},{name:"template",path:"/template/:id",component:bn},{path:"/send/congratulate/:id",component:Vr},{path:"/send/:id",component:mr},{path:"/sending-status/:id/(.*)?",component:Hi},{path:"/stats/:id/(.*)?",component:ts}]).call(es,I()(window.mailpoet_automatic_emails?x()(O.a).call(O.a,window.mailpoet_automatic_emails,(function(e){return{path:"new/".concat(e.slug),name:e.slug,component:ie,data:{email:e}}})):[]))),ns=document.getElementById("newsletters_container");ns&&(window.mailpoet_listing=_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{exact:!0,path:"/",render:function(){return R.a.createElement(ne.Redirect,{to:0===window.mailpoet_newsletters_count?"/new":"/standard"})}}),x()(as).call(as,(function(e){return R.a.createElement(ne.Route,{key:e.path,path:e.path,component:e.component,name:e.name||null,data:e.data||null,render:e.render})})))))}),null),ns));var rs=function(){var e=Object(ne.useLocation)().pathname.split("/"),t=Ne()(e,2)[1];return R.a.createElement("h2",{className:"nav-tab-wrapper"},R.a.createElement(st.b,{to:"/",className:lt()("nav-tab",{"nav-tab-active":"segments"!==t})},q.a.I18n.t("pageTitle")),R.a.createElement(st.b,{to:"/segments","data-automation-id":"dynamic-segments-tab",className:lt()("nav-tab",{"nav-tab-active":"segments"===t})},q.a.I18n.t("pageTitleSegments")))},is=function(e){return"wp_users"===e.type},ss=function(e){return"woocommerce_users"===e.type},os=function(e){return is(e)||ss(e)},ls=[{name:"name",label:q.a.I18n.t("name"),sortable:!0},{name:"description",label:q.a.I18n.t("description")},{name:"subscribed",label:q.a.I18n.t("subscribed")},{name:"unconfirmed",label:q.a.I18n.t("unconfirmed")},{name:"unsubscribed",label:q.a.I18n.t("unsubscribed")},{name:"inactive",label:q.a.I18n.t("inactive")},{name:"bounced",label:q.a.I18n.t("bounced")},{name:"created_at",label:q.a.I18n.t("createdOn"),sortable:!0}],cs={onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSegmentTrashed"):q.a.I18n.t("multipleSegmentsTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSegmentDeleted"):q.a.I18n.t("multipleSegmentsDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSegmentRestored"):q.a.I18n.t("multipleSegmentsRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},us=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:cs.onTrash}],ps=[{name:"edit",link:function(e){return R.a.createElement(st.b,{to:"/edit/".concat(e.id)},q.a.I18n.t("edit"))},display:function(e){return!os(e)}},{name:"duplicate_segment",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"segments",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("listDuplicated").replace("%$1s",e.data.name)),t()})).fail((function(e){var t;q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))},display:function(e){return!os(e)}},{name:"read_more",link:function(){return R.a.createElement("a",{href:"https://kb.mailpoet.com/article/133-the-wordpress-users-list",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("readMore"))},display:function(e){return is(e)}},{name:"synchronize_segment",label:q.a.I18n.t("forceSync"),onClick:function(e,t){q.a.Modal.loading(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"segments",action:"synchronize",data:{type:e.type}}).done((function(){q.a.Modal.loading(!1),q.a.Notice.success(q.a.I18n.t("listSynchronized").replace("%$1s",e.name)),t()})).fail((function(e){var t;(q.a.Modal.loading(!1),e.errors.length>0)&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))},display:function(e){return is(e)||ss(e)}},{name:"view_subscribers",link:function(e){return R.a.createElement("a",{href:e.subscribers_url,"data-automation-id":"view_subscribers_".concat(e.name)},q.a.I18n.t("viewSubscribers"))}},{name:"trash",display:function(e){return!os(e)&&0===e.automated_emails_subjects.length}},{name:"delete",label:q.a.I18n.t("moveToTrash"),onClick:function(e){var t;q.a.Notice.error(q.a.I18n.t("trashDisallowed").replace("%$1s",x()(t=e.automated_emails_subjects).call(t,(function(e){return"'".concat(e,"'")})).join(", ")),{scroll:!0})},display:function(e){return!os(e)&&e.automated_emails_subjects.length>0}}],ds=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"renderItem",(function(e,t){var a,n=lt()("manage-column","column-primary","has-row-actions"),r=Number(e.subscribers_count.subscribed||0),i=Number(e.subscribers_count.unconfirmed||0),s=Number(e.subscribers_count.unsubscribed||0),o=Number(e.subscribers_count.inactive||0),l=Number(e.subscribers_count.bounced||0);return a=os(e)?R.a.createElement("span",{className:"row-title"},e.name):R.a.createElement(st.b,{className:"row-title",to:"/edit/".concat(e.id)},e.name),R.a.createElement("div",null,R.a.createElement("td",{className:n,"data-automation-id":"segment_name_".concat(e.name)},R.a.createElement("strong",null,a),t),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("description")},R.a.createElement("abbr",null,e.description)),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("subscribed")},R.a.createElement("abbr",null,r.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("unconfirmed")},R.a.createElement("abbr",null,i.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("unsubscribed")},R.a.createElement("abbr",null,s.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("inactive")},R.a.createElement("abbr",null,o.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("bounced")},R.a.createElement("abbr",null,l.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("createdOn")},R.a.createElement("abbr",null,q.a.Date.format(e.created_at))))})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",{className:"mailpoet-segments-listing"},R.a.createElement("h1",{className:"title"},q.a.I18n.t("pageTitle")," ",R.a.createElement(st.b,{className:"page-title-action",to:"/new"},q.a.I18n.t("new")),R.a.createElement(st.b,{className:"page-title-action",to:"/new-segment","data-automation-id":"new-segment"},q.a.I18n.t("newSegment"))),R.a.createElement(va,{subscribersInPlan:window.mailpoet_subscribers_in_plan_count,hasValidApiKey:window.mailpoet_has_valid_api_key}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(rs,null),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,messages:cs,search:!1,endpoint:"segments",onRenderItem:this.renderItem,columns:ls,bulk_actions:us,item_actions:ps,sort_by:"name",sort_order:"asc"}))}}]),t}(R.a.Component);ds.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var ms=ds,hs=[{name:"name",label:q.a.I18n.t("nameColumn"),sortable:!0},{name:"count",label:q.a.I18n.t("subscribersCountColumn"),sortable:!1},{name:"updated_at",label:q.a.I18n.t("updatedAtColumn"),sortable:!0}],fs={onLoadingItems:function(){return q.a.I18n.t("loadingDynamicSegmentItems")},onNoItemsFound:function(){return q.a.I18n.t("noDynamicSegmentItemsFound")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneDynamicSegmentTrashed"):q.a.I18n.t("multipleDynamicSegmentsTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneDynamicSegmentDeleted"):q.a.I18n.t("multipleDynamicSegmentsDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneDynamicSegmentRestored"):q.a.I18n.t("multipleDynamicSegmentsRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},gs=[{name:"edit",link:function(e){return R.a.createElement(st.b,{to:"/edit-segment/".concat(e.id)},q.a.I18n.t("edit"))}},{name:"view_subscribers",link:function(e){return R.a.createElement("a",{href:e.subscribers_url},q.a.I18n.t("viewSubscribers"))}},{name:"trash"}];function vs(e,t){return R.a.createElement(R.a.Fragment,null,R.a.createElement("td",{"data-colname":q.a.I18n.t("nameColumn")},R.a.createElement("strong",null,e.name),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("subscribersCountColumn")},Se()(e.count,10).toLocaleString()),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("updatedAtColumn")},q.a.Date.format(e.updated_at)))}function bs(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",{className:"pageTitle"},q.a.I18n.t("pageTitleSegments")," ",R.a.createElement(st.b,{className:"page-title-action",to:"/new"},q.a.I18n.t("new")),R.a.createElement(st.b,{className:"page-title-action",to:"/new-segment","data-automation-id":"new-segment"},q.a.I18n.t("newSegment"))),R.a.createElement(va,{subscribersInPlan:window.mailpoet_subscribers_in_plan_count,hasValidApiKey:window.mailpoet_has_valid_api_key}),R.a.createElement(rs,null),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:e.location,params:e.match.params,search:!0,onRenderItem:vs,endpoint:"dynamic_segments",base_url:"segments",columns:hs,messages:fs,sort_by:"created_at",sort_order:"desc",item_actions:gs}),R.a.createElement("p",{className:"mailpoet_sending_methods_help help"},R.a.createElement("b",null,q.a.I18n.t("segmentsTip"),":")," ",q.a.I18n.t("segmentsTipText")," ",R.a.createElement("a",{href:"https://kb.mailpoet.com/article/237-guide-to-subscriber-segmentation?utm_source=plugin&utm_medium=segments&utm_campaign=helpdocs","data-beacon-article":"5a574bd92c7d3a194368233e",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("segmentsTipLink"))))}bs.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var _s=bs,ys=[{name:"name",label:q.a.I18n.t("name"),type:"text"},{name:"description",label:q.a.I18n.t("description"),type:"textarea",tip:q.a.I18n.t("segmentDescriptionTip")}],ws={onUpdate:function(){q.a.Notice.success(q.a.I18n.t("segmentUpdated"))},onCreate:function(){q.a.Notice.success(q.a.I18n.t("segmentAdded")),q.a.trackEvent("Lists > Add new",{"MailPoet Free version":window.mailpoet_version})}},Es=function(e){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("segment"),R.a.createElement(st.b,{className:"page-title-action",to:"/"},q.a.I18n.t("backToList"))),R.a.createElement(Zt,null),R.a.createElement($a,{endpoint:"segments",fields:ys,params:e.match.params,messages:ws}))};Es.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired};var ks=Es,Is=a(79),Ss=a.n(Is),Cs={};var Ns=function(e){return function(e){return"clicked"!==e.action&&"notClicked"!==e.action?Ss.a.resolve():e.newsletter_id?void 0!==Cs[e.newsletter_id]?Ss.a.resolve(Cs[e.newsletter_id]):q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletter_links",action:"get",data:{newsletterId:e.newsletter_id}}).then((function(t){var a=t.data;return Cs[e.newsletter_id]=a,a})).fail((function(e){var t;q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})})):Ss.a.resolve()}(e).then((function(e){var t,a=[{name:"action",type:"select",values:{"":q.a.I18n.t("selectActionPlaceholder"),opened:q.a.I18n.t("emailActionOpened"),notOpened:q.a.I18n.t("emailActionNotOpened"),clicked:q.a.I18n.t("emailActionClicked"),notClicked:q.a.I18n.t("emailActionNotClicked")}},{name:"newsletter_id",type:"selection",resetSelect2OnUpdate:!0,endpoint:"newsletters_list",placeholder:q.a.I18n.t("selectNewsletterPlaceholder"),forceSelect2:!0,getLabel:function(e){var t,a=e.sent_at?q.a.Date.format(e.sent_at):q.a.I18n.t("notSentYet");return E()(t="".concat(e.subject," (")).call(t,a,")")}}];return e?E()(t=[]).call(t,a,[{name:"link_id",type:"selection",placeholder:q.a.I18n.t("selectLinkPlaceholder"),forceSelect2:!0,getLabel:function(e){return e.url},values:e}]):a}))},xs={name:"action",type:"select",values:{"":q.a.I18n.t("selectActionPlaceholder"),purchasedCategory:q.a.I18n.t("wooPurchasedCategory"),purchasedProduct:q.a.I18n.t("wooPurchasedProduct")}},Ts={name:"category_id",type:"selection",endpoint:"product_categories",resetSelect2OnUpdate:!0,placeholder:q.a.I18n.t("selectWooPurchasedCategory"),forceSelect2:!0,getLabel:O.a.property("cat_name"),getValue:O.a.property("term_id")},Rs={name:"product_id",type:"selection",endpoint:"products",resetSelect2OnUpdate:!0,placeholder:q.a.I18n.t("selectWooPurchasedProduct"),forceSelect2:!0,getLabel:O.a.property("title"),getValue:O.a.property("ID")},Ps={onUpdate:function(){return q.a.Notice.success(q.a.I18n.t("segmentUpdated"))},onCreate:function(e){q.a.Notice.success(q.a.I18n.t("segmentAdded")),q.a.trackEvent("Segments > Add new",{"MailPoet Free version":window.mailpoet_version,type:e.segmentType||"unknown type",subtype:e.action||e.wordpressRole||"unknown subtype"})}};var Os=function(e){function t(e){var a,n,r,i;return M()(this,t),(i=U()(this,W()(t).call(this,e))).state={item:{segmentType:"email"},childFields:[],errors:void 0},i.loadFields(),i.handleValueChange=F()(a=i.handleValueChange).call(a,K()(i)),i.handleSave=F()(n=i.handleSave).call(n,K()(i)),i.onItemLoad=F()(r=i.onItemLoad).call(r,K()(i)),i}return Y()(t,e),B()(t,[{key:"onItemLoad",value:function(e){var t=O.a.mapObject(e,(function(e){return O.a.isNull(e)?"":e}));this.setState({item:t},this.loadFields)}},{key:"getFields",value:function(){var e,t,a=this.state.childFields;return[{name:"name",label:q.a.I18n.t("name"),type:"text"},{name:"description",label:q.a.I18n.t("description"),type:"textarea",tip:q.a.I18n.t("descriptionTip")},{name:"filters",description:"main",label:q.a.I18n.t("formSegmentTitle"),fields:E()(e=[{name:"segmentType",type:"select",values:(t={email:q.a.I18n.t("email"),userRole:q.a.I18n.t("wpUserRole")},window.is_woocommerce_active&&(t.woocommerce=q.a.I18n.t("woocommerce")),t)}]).call(e,I()(a))}]}},{key:"getChildFields",value:function(){var e,t,a,n=this.state.item;switch(n.segmentType){case"userRole":return Ss.a.resolve([{name:"wordpressRole",type:"select",placeholder:q.a.I18n.t("selectUserRolePlaceholder"),values:Pe()(a=window.wordpress_editable_roles_list).call(a,(function(e,t){return O.a.extend({},e,y()({},t.role_id,t.role_name))}),{})}]);case"email":return Ns(n);case"woocommerce":return t=[xs],"purchasedCategory"===(e=n).action&&t.push(Ts),"purchasedProduct"===e.action&&t.push(Rs),Ss.a.resolve(t);default:return[]}}},{key:"loadFields",value:function(){var e=this;this.getChildFields().then((function(t){return e.setState({childFields:t})}))}},{key:"handleValueChange",value:function(e){var t=this.state.item;return t[e.target.name]=e.target.value,this.setState({item:t}),this.loadFields(),!0}},{key:"handleSave",value:function(e){var t=this,a=this.state.item,n=this.props,r=n.history,i=n.match;e.preventDefault(),this.setState({errors:void 0}),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"dynamic_segments",action:"save",data:a}).done((function(){r.push("/segments"),void 0!==i.params.id?Ps.onUpdate():Ps.onCreate(a)})).fail((function(e){e.errors.length>0&&t.setState({errors:e.errors})}))}},{key:"render",value:function(){var e=this.getFields(),t=this.props.match,a=this.state,n=a.item,r=a.errors;return R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("formPageTitle")," ",R.a.createElement(st.b,{className:"page-title-action",to:"/segments"},q.a.I18n.t("backToList"))),R.a.createElement($a,{endpoint:"dynamic_segments",fields:e,params:t.params,messages:Ps,onChange:this.handleValueChange,onSubmit:this.handleSave,onItemLoad:this.onItemLoad,item:n,errors:r}))}}]),t}(R.a.Component);Os.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var Ds=Object(ne.withRouter)(Os),As=document.getElementById("segments_container");As&&_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{path:"/new",component:ks}),R.a.createElement(ne.Route,{path:"/edit/:id",component:ks}),R.a.createElement(ne.Route,{path:"/new-segment",component:Ds}),R.a.createElement(ne.Route,{path:"/edit-segment/:id",component:Ds}),R.a.createElement(ne.Route,{path:"/segments/(.*)?",component:_s}),R.a.createElement(ne.Route,{path:"*",component:ms}))))}),null),As);var qs=[{name:"name",label:q.a.I18n.t("formName"),sortable:!0},{name:"segments",label:q.a.I18n.t("segments")},{name:"signups",label:q.a.I18n.t("signups")},{name:"created_at",label:q.a.I18n.t("createdOn"),sortable:!0}],Ls={onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneFormTrashed"):q.a.I18n.t("multipleFormsTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneFormDeleted"):q.a.I18n.t("multipleFormsDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneFormRestored"):q.a.I18n.t("multipleFormsRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},Fs=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:Ls.onTrash}],js=[{name:"edit",label:q.a.I18n.t("edit"),link:function(e){return R.a.createElement("a",{href:"admin.php?page=mailpoet-form-editor&id=".concat(e.id)},q.a.I18n.t("edit"))}},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"duplicate",data:{id:e.id}}).done((function(e){var a=e.data.name?e.data.name:q.a.I18n.t("noName");q.a.Notice.success(q.a.I18n.t("formDuplicated").replace("%$1s",a)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"trash"}],Ms=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"createForm",(function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"create"}).done((function(e){q.a.trackEvent("Forms > Add New",{"MailPoet Free version":window.mailpoet_version}),Yt()((function(){window.location=window.mailpoet_form_edit_url+e.data.id}),200)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))})),y()(K()(n),"renderItem",(function(e,t){var a,n,r,i=lt()("manage-column","column-primary","has-row-actions"),s=x()(a=h()(n=window.mailpoet_segments).call(n,(function(t){return-1!==ve.a.inArray(t.id,e.segments)}))).call(a,(function(e){return e.name})).join(", ");"user"===e.settings.segments_selected_by&&(s=E()(r="".concat(q.a.I18n.t("userChoice")," ")).call(r,s));return R.a.createElement("div",null,R.a.createElement("td",{className:i},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"admin.php?page=mailpoet-form-editor&id=".concat(e.id)},e.name?e.name:"(".concat(q.a.I18n.t("noName"),")"))),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("segments")},s),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("signups")},e.signups),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("createdOn")},R.a.createElement("abbr",null,q.a.Date.format(e.created_at))))})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("pageTitle")," ",R.a.createElement("button",{className:"page-title-action",onClick:this.createForm,"data-automation-id":"create_new_form",type:"button"},q.a.I18n.t("new"))),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,messages:Ls,search:!1,endpoint:"forms",onRenderItem:this.renderItem,columns:qs,bulk_actions:Fs,item_actions:js}))}}]),t}(R.a.Component);Ms.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var Vs=bt(Ms),Bs=document.getElementById("forms_container");Bs&&_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Route,{path:"*",component:Vs})))}),null),Bs);var zs=[{name:"knowledgeBase",label:q.a.I18n.t("tabKnowledgeBaseTitle"),link:"/knowledgeBase"},{name:"systemStatus",label:q.a.I18n.t("tabSystemStatusTitle"),link:"/systemStatus"},{name:"systemInfo",label:q.a.I18n.t("tabSystemInfoTitle"),link:"/systemInfo"},{name:"yourPrivacy",label:q.a.I18n.t("tabYourPrivacyTitle"),link:"/yourPrivacy"}];function Us(e){var t=x()(zs).call(zs,(function(t){var a=lt()("nav-tab",{"nav-tab-active":e.tab===t.name});return R.a.createElement(st.b,{key:"tab-".concat(t.name),className:a,to:t.link},t.label)}));return R.a.createElement("h2",{className:"nav-tab-wrapper"},t)}Us.propTypes={tab:Z.a.string},Us.defaultProps={tab:"knowledgeBase"};var $s=Us;var Ws=function(){return R.a.createElement("div",null,R.a.createElement($s,{tab:"knowledgeBase"}),R.a.createElement("p",null,q.a.I18n.t("knowledgeBaseIntro")),R.a.createElement("ul",null,R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/116-common-problems"},"Common Problems")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/165-newsletters"},"Newsletters")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/156-migration-questions"},"Migration Questions")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/149-sending-methods"},"Sending Methods")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/139-subscription-forms"},"Subscription Forms")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/114-getting-started"},"Getting Started")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/123-newsletter-designer"},"Newsletter Designer")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/121-subscribers-and-lists"},"Subscribers and Lists"))),R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/",className:"button button-primary"},q.a.I18n.t("knowledgeBaseButton")))};function Hs(e){e.target.select()}var Ks=function(){var e=window.systemInfoData;return R.a.createElement("div",null,R.a.createElement($s,{tab:"systemInfo"}),R.a.createElement("div",{className:"mailpoet_notice notice inline",style:{marginTop:"1em"}},R.a.createElement("p",null,q.a.I18n.t("systemInfoIntro"))),function(e){if(O.a.isObject(e)){var t,a=x()(t=b()(e)).call(t,(function(t){var a;return E()(a="".concat(t,": ")).call(a,e[t])}));return R.a.createElement("textarea",{readOnly:!0,onFocus:Hs,value:a.join("\n"),style:{width:"100%",height:"400px"}})}return R.a.createElement("p",null,q.a.I18n.t("systemInfoDataError"))}(e))},Gs=function(e){var t;return R.a.createElement("table",{className:"widefat fixed",style:{maxWidth:e.max_width}},R.a.createElement("tbody",null,x()(t=e.rows).call(t,(function(e){return R.a.createElement("tr",{key:"row_".concat(e.key)},R.a.createElement("td",{className:"row-title"},e.key),R.a.createElement("td",null,e.value))}))))};Gs.propTypes={max_width:Z.a.string,rows:Z.a.arrayOf(Z.a.shape({key:Z.a.string.isRequired,value:Z.a.oneOfType([Z.a.string,Z.a.number,Z.a.element]).isRequired})).isRequired},Gs.defaultProps={max_width:"auto"};var Ys=Gs,Js=function(e){return R.a.createElement("span",null,!0===e.children&&e.truthy||!1===e.children&&e.falsy||e.unknown)};Js.propTypes={truthy:Z.a.string,falsy:Z.a.string,unknown:Z.a.string,children:Z.a.bool},Js.defaultProps={truthy:q.a.I18n.t("yes"),falsy:q.a.I18n.t("no"),unknown:q.a.I18n.t("unknown"),children:null};var Qs=Js,Zs=function(e){var t,a=e.status_data,n={active:q.a.I18n.t("running"),inactive:q.a.I18n.t("cronWaiting")},r=nt()(a.last_error)?R.a.createElement(R.a.Fragment,null,x()(t=a.last_error).call(t,(function(e){return R.a.createElement("div",{key:e.worker},e.worker,":"," ",R.a.createElement("i",null,e.message))}))):a.last_error;return R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("systemStatusCronStatusTitle")),R.a.createElement(Ys,{max_width:"400px",rows:[{key:q.a.I18n.t("accessible"),value:R.a.createElement(Qs,null,a.accessible)},{key:q.a.I18n.t("status"),value:n[a.status]?n[a.status]:q.a.I18n.t("unknown")},{key:q.a.I18n.t("lastUpdated"),value:a.updated_at?q.a.Date.full(1e3*a.updated_at):q.a.I18n.t("unknown")},{key:q.a.I18n.t("lastRunStarted"),value:a.run_accessed_at?q.a.Date.full(1e3*a.run_started_at):q.a.I18n.t("unknown")},{key:q.a.I18n.t("lastRunCompleted"),value:a.run_completed_at?q.a.Date.full(1e3*a.run_completed_at):q.a.I18n.t("unknown")},{key:q.a.I18n.t("lastSeenError"),value:r||q.a.I18n.t("none")},{key:q.a.I18n.t("lastSeenErrorDate"),value:a.last_error_date?q.a.Date.full(1e3*a.last_error_date):q.a.I18n.t("unknown")}]}))};Zs.propTypes={status_data:Z.a.shape({accessible:Z.a.bool,last_error_date:Z.a.string,status:Z.a.string,updated_at:Z.a.number,run_accessed_at:Z.a.number,run_completed_at:Z.a.number,run_started_at:Z.a.number,last_error:Z.a.oneOfType([Z.a.string,Z.a.array])}).isRequired};var Xs=Zs,eo=function(e){return R.a.createElement("tr",null,R.a.createElement("td",{className:"column column-primary"},e.task.id),R.a.createElement("td",{className:"column"},e.task.type),R.a.createElement("td",{className:"column"},e.task.newsletter?R.a.createElement("a",{href:e.task.newsletter.preview_url,"data-newsletter-id":e.task.newsletter.newsletter_id,"data-queue-id":e.task.newsletter.queue_id,target:"_blank",rel:"noopener noreferrer"},e.task.newsletter.subject||q.a.I18n.t("preview")):q.a.I18n.t("none")),R.a.createElement("td",{className:"column"},e.task.priority),e.show_scheduled_at?R.a.createElement("td",{className:"column-date"},R.a.createElement("abbr",null,q.a.Date.format(1e3*e.task.scheduled_at))):null,R.a.createElement("td",{className:"column-date"},R.a.createElement("abbr",null,q.a.Date.format(1e3*e.task.updated_at))))};eo.propTypes={show_scheduled_at:Z.a.bool,task:Z.a.shape({id:Z.a.number.isRequired,type:Z.a.string.isRequired,priority:Z.a.number.isRequired,updated_at:Z.a.number.isRequired,scheduled_at:Z.a.number,status:Z.a.string,newsletter:Z.a.shape({newsletter_id:Z.a.number.isRequired,queue_id:Z.a.number.isRequired,preview_url:Z.a.string.isRequired,subject:Z.a.string})}).isRequired},eo.defaultProps={show_scheduled_at:!1};var to=eo,ao=function(e){return R.a.createElement("tr",null,R.a.createElement("th",{className:"row-title"},"Id"),R.a.createElement("th",{className:"row-title"},q.a.I18n.t("type")),R.a.createElement("th",{className:"row-title"},q.a.I18n.t("email")),R.a.createElement("th",{className:"row-title"},q.a.I18n.t("priority")),e.show_scheduled_at?R.a.createElement("th",{className:"row-title"},q.a.I18n.t("scheduledAt")):null,R.a.createElement("th",{className:"row-title"},q.a.I18n.t("updatedAt")))};ao.propTypes={show_scheduled_at:Z.a.bool},ao.defaultProps={show_scheduled_at:!1};var no=ao,ro=function(e){var t,a=e.show_scheduled_at?6:5;return R.a.createElement("table",{className:"widefat fixed striped"},R.a.createElement("thead",null,R.a.createElement(no,{show_scheduled_at:e.show_scheduled_at})),R.a.createElement("tbody",null,e.tasks.length?x()(t=e.tasks).call(t,(function(t){return R.a.createElement(to,{key:t.id,task:t,show_scheduled_at:e.show_scheduled_at})})):R.a.createElement("tr",{className:"no-items"},R.a.createElement("td",{colSpan:a},q.a.I18n.t("nothingToShow")))),R.a.createElement("tfoot",null,R.a.createElement(no,{show_scheduled_at:e.show_scheduled_at})))};ro.propTypes={show_scheduled_at:Z.a.bool,tasks:Z.a.arrayOf(to.propTypes.task).isRequired},ro.defaultProps={show_scheduled_at:!1};var io=ro,so=function(e){var t,a,n,r=e.status_data;return R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("systemStatusQueueTitle")),R.a.createElement(Ys,{max_width:"400px",rows:[{key:q.a.I18n.t("status"),value:"paused"===r.status?q.a.I18n.t("paused"):q.a.I18n.t("running")},{key:q.a.I18n.t("startedAt"),value:r.started?q.a.Date.full(1e3*r.started):q.a.I18n.t("unknown")},{key:q.a.I18n.t("sentEmails"),value:r.sent||0},{key:q.a.I18n.t("retryAttempt"),value:r.retry_attempt||q.a.I18n.t("none")},{key:q.a.I18n.t("retryAt"),value:r.retry_at?q.a.Date.full(1e3*r.retry_at):q.a.I18n.t("none")},{key:q.a.I18n.t("error"),value:r.error?r.error.error_message:q.a.I18n.t("none")},{key:q.a.I18n.t("totalCompletedTasks"),value:r.tasksStatusCounts.completed},{key:q.a.I18n.t("totalRunningTasks"),value:r.tasksStatusCounts.running},{key:q.a.I18n.t("totalPausedTasks"),value:r.tasksStatusCounts.paused},{key:q.a.I18n.t("totalScheduledTasks"),value:r.tasksStatusCounts.scheduled}]}),R.a.createElement("h4",null,q.a.I18n.t("scheduledTasks")),R.a.createElement(io,{show_scheduled_at:!0,tasks:h()(t=r.latestTasks).call(t,(function(e){return"scheduled"===e.status}))}),R.a.createElement("h4",null,q.a.I18n.t("runningTasks")),R.a.createElement(io,{tasks:h()(a=r.latestTasks).call(a,(function(e){return null===e.status}))}),R.a.createElement("h4",null,q.a.I18n.t("completedTasks")),R.a.createElement(io,{tasks:h()(n=r.latestTasks).call(n,(function(e){return"completed"===e.status}))}))};so.propTypes={status_data:Z.a.shape({status:Z.a.string,started:Z.a.number,sent:Z.a.number,retry_attempt:Z.a.number,retry_at:Z.a.number,error:Z.a.shape({operation:Z.a.string,error_message:Z.a.string}),tasksStatusCounts:Z.a.shape({completed:Z.a.number.isRequired,running:Z.a.number.isRequired,paused:Z.a.number.isRequired,scheduled:Z.a.number.isRequired}).isRequired,latestTasks:Z.a.arrayOf(to.propTypes.task).isRequired}).isRequired};var oo=so;function lo(e,t,a,n,r){var i,s=e?"success":"error",o=e?q.a.I18n.t("systemStatusConnectionSuccessful"):E()(i="".concat(q.a.I18n.t("systemStatusConnectionUnsuccessful")," ")).call(i,t);return a&&(o=St()(o,/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{href:a,"data-beacon-article":n,key:"kb-link"},e)}))),R.a.createElement("div",{className:"mailpoet_notice notice inline notice-".concat(s),style:{marginTop:"1em"}},R.a.createElement("p",null,o),r?R.a.createElement("p",null,R.a.createElement("i",null,r)):null)}var co=function(){var e,t,a,n,r,i=window.systemStatusData;return R.a.createElement("div",null,R.a.createElement($s,{tab:"systemStatus"}),R.a.createElement("div",{className:"mailpoet_notice notice inline",style:{marginTop:"1em"}},R.a.createElement("p",null,i.mss.enabled?q.a.I18n.t("systemStatusIntroCronMSS"):q.a.I18n.t("systemStatusIntroCron"))),(t=(e=i).cron.isReachable,a=e.cron.url,n=q.a.I18n.t("systemStatusCronConnectionUnsuccessfulInfo"),r=t?null:e.cron.pingResponse,R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("systemStatusCronTitle")),R.a.createElement("p",null,R.a.createElement("a",{href:a,target:"_blank",rel:"noopener noreferrer"},a)),lo(t,n,"https://kb.mailpoet.com/article/231-sending-does-not-work","5a0257ac2c7d3a272c0d7ad6",r))),function(e){if(e.mss.enabled){var t=e.mss.enabled.isReachable;return R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("systemStatusMSSTitle")),lo(t,q.a.I18n.t("systemStatusMSSConnectionUnsuccessfulInfo"),!1))}}(i),R.a.createElement(Xs,{status_data:i.cronStatus}),R.a.createElement(oo,{status_data:i.queueStatus}))};var uo=function(){return R.a.createElement("div",null,R.a.createElement($s,{tab:"yourPrivacy"}),R.a.createElement("p",null,q.a.I18n.t("yourPrivacyContent1")),R.a.createElement("p",null,q.a.I18n.t("yourPrivacyContent2")),R.a.createElement("p",null,q.a.I18n.t("yourPrivacyContent3")),R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://www.mailpoet.com/privacy-notice/",className:"button button-primary"},q.a.I18n.t("yourPrivacyButton")))},po=document.getElementById("help_container");po&&_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{exact:!0,path:"/",render:function(){return R.a.createElement(ne.Redirect,{to:"/knowledgeBase"})}}),R.a.createElement(ne.Route,{path:"/knowledgeBase",component:Ws}),R.a.createElement(ne.Route,{path:"/systemStatus",component:co}),R.a.createElement(ne.Route,{path:"/systemInfo",component:Ks}),R.a.createElement(ne.Route,{path:"/yourPrivacy",component:uo}))))}),null),po);var mo=Object(ne.withRouter)((function(e){var t=e.children,a=e.location.pathname;return Object(T.useEffect)((function(){window.scrollTo(0,0)}),[a]),t||null}));function ho(e){var t=e.activeMethod,a=e.onMethodChange,n=R.a.useContext(Ge.a).users.isNewUser,r=lt()("mailpoet_badge","mailpoet_badge_video",{mailpoet_badge_video_grey:!n});return R.a.createElement(R.a.Fragment,null,R.a.createElement("form",{className:"mailpoet_import_selection_form"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("methodSelectionHead")),R.a.createElement("label",{htmlFor:"import-paste-method"},R.a.createElement("input",{type:"radio",name:"select_method","data-automation-id":"import-paste-method",id:"import-paste-method",checked:"paste-method"===t,onChange:function(){return a("paste-method")}}),q.a.I18n.t("methodPaste")),R.a.createElement("label",{htmlFor:"import-csv-method"},R.a.createElement("input",{type:"radio",name:"select_method","data-automation-id":"import-csv-method",id:"import-csv-method",checked:"file-method"===t,onChange:function(){return a("file-method")}}),q.a.I18n.t("methodUpload")),R.a.createElement("label",{htmlFor:"import-mailchimp-method"},R.a.createElement("input",{type:"radio",name:"select_method","data-automation-id":"import-mailchimp-method",id:"import-mailchimp-method",checked:"mailchimp-method"===t,onChange:function(){return a("mailchimp-method")}}),q.a.I18n.t("methodMailChimp"))),R.a.createElement("a",{className:r,href:"https://kb.mailpoet.com/article/242-video-guide-importing-subscribers-using-a-csv-file","data-beacon-article":"5a8e8f0204286305fbc9be9a",target:"_blank",rel:"noopener noreferrer"},R.a.createElement("span",{className:"dashicons dashicons-format-video"}),q.a.I18n.t("seeVideo")))}ho.propTypes={activeMethod:Z.a.string,onMethodChange:Z.a.func.isRequired},ho.defaultProps={activeMethod:void 0};var fo=ho,go=function(e){var t=e.hidePrevious,a=e.canGoNext,n=e.onPreviousAction,r=e.onNextAction,i=lt()("button-primary","wysija",{"button-disabled":!a});return R.a.createElement("div",{className:"mailpoet_import_step_buttons"},!t&&R.a.createElement(R.a.Fragment,null,R.a.createElement("button",{className:"button-primary wysija button",type:"button",onClick:n},q.a.I18n.t("previousStep")),"  "),R.a.createElement("button",{type:"button","data-automation-id":"import-next-step",className:i,onClick:function(){a&&r()}},q.a.I18n.t("nextStep")))};go.propTypes={canGoNext:Z.a.bool,hidePrevious:Z.a.bool,onPreviousAction:Z.a.func,onNextAction:Z.a.func},go.defaultProps={hidePrevious:!1,canGoNext:!0,onPreviousAction:function(){},onNextAction:function(){}};var vo=go,bo=function(e){var t=e.onValueChange,a=e.canFinish,n=e.onFinish,r=e.data;return R.a.createElement(R.a.Fragment,null,R.a.createElement("label",{htmlFor:"paste_input",className:"mailpoet_import_method_paste"},R.a.createElement("div",{className:"mailpoet_import_paste_texts"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("pasteLabel")),R.a.createElement("p",{className:"description"},St()(q.a.I18n.t("pasteDescription"),/\[link\](.*?)\[\/link\]/,(function(e){return R.a.createElement("a",{href:"".concat("https://kb.mailpoet.com/article/126-importing-subscribers-with-csv-files"),"data-beacon-article":"57ce079f903360649f6e56fc",key:"kb-link",target:"_blank",rel:"noopener noreferrer"},e)})))),R.a.createElement("textarea",{id:"paste_input",rows:"15",placeholder:"Email, First Name, Last Name\njohn@doe.com, John, Doe\nmary@smith.com, Mary, Smith\njohnny@walker.com, Johnny, Walker",className:"regular-text code",onChange:function(e){t(e.target.value)},defaultValue:r})),R.a.createElement(vo,{canGoNext:a,hidePrevious:!0,onNextAction:n}))};bo.propTypes={onFinish:Z.a.func,canFinish:Z.a.bool.isRequired,onValueChange:Z.a.func.isRequired,data:Z.a.string},bo.defaultProps={onFinish:function(){},data:""};var _o=bo,yo=function(e){var t=e.onValueChange,a=e.canFinish,n=e.onFinish;return R.a.createElement(R.a.Fragment,null,R.a.createElement("div",null,R.a.createElement("label",{htmlFor:"paste_input",className:"mailpoet_import_method_paste"},R.a.createElement("div",{className:"mailpoet_import_paste_texts"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("methodUpload")),R.a.createElement("p",{className:"description"},St()(q.a.I18n.t("pasteDescription"),/\[link\](.*?)\[\/link\]/,(function(e){return R.a.createElement("a",{href:"".concat("https://kb.mailpoet.com/article/126-importing-subscribers-with-csv-files"),"data-beacon-article":"57ce079f903360649f6e56fc",key:"kb-link",target:"_blank",rel:"noopener noreferrer"},e)})))),R.a.createElement("input",{type:"file",id:"file_local",accept:".csv","data-automation-id":"import-file-upload-input",onChange:function(e){var a=e.target.value.match(/[^.]+$/);q.a.Notice.hide(),null===a||"csv"!==a[0].toLowerCase()?(q.a.Notice.error(q.a.I18n.t("wrongFileFormat")),t("")):t(e.target.files[0])}}))),R.a.createElement(vo,{canGoNext:a,hidePrevious:!0,onNextAction:n}))};yo.propTypes={canFinish:Z.a.bool.isRequired,onFinish:Z.a.func,onValueChange:Z.a.func.isRequired},yo.defaultProps={onFinish:function(){}};var wo=yo,Eo=function(e){var t=e.onFinish,a=Object(T.useState)(""),n=Ne()(a,2),r=n[0],i=n[1],s=Object(T.useState)(void 0),o=Ne()(s,2),l=o[0],c=o[1],u=Object(T.useState)([]),p=Ne()(u,2),d=p[0],m=p[1],h=lt()("mailpoet_mailchimp-key-status",{"mailpoet_mailchimp-ok":nt()(l)});return R.a.createElement("div",{className:"mailpoet_import_mailchimp"},R.a.createElement("div",{className:"mailpoet_mailchimp_key"},R.a.createElement("label",{htmlFor:"mailpoet_mailchimp_key_input",className:"mailpoet_mailchimp_key_input"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("methodMailChimpLabel")),R.a.createElement("input",{id:"mailpoet_mailchimp_key_input",type:"text",onChange:function(e){var t;i(e.target.value),""===qa()(t=e.target.value).call(t)&&c(void 0)}})),R.a.createElement("button",{className:"button",type:"button",onClick:function(){q.a.Modal.loading(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"importExport",action:"getMailChimpLists",data:{api_key:r}}).always((function(){q.a.Modal.loading(!1)})).done((function(e){return c(e.data)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},q.a.I18n.t("methodMailChimpVerify")),R.a.createElement("span",{className:h},nt()(l)&&0===l.length?q.a.I18n.t("noMailChimpLists"):null)),l?R.a.createElement("div",{className:"mailpoet_mailchimp_lists"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("methodMailChimpSelectList")),R.a.createElement(we,{field:{id:"segments",name:"list-selection",multiple:!0,placeholder:q.a.I18n.t("methodMailChimpSelectPlaceholder"),forceSelect2:!0,values:l},onValueChange:function(e){return m(e.target.value)}})):null,R.a.createElement(vo,{canGoNext:nt()(d)&&d.length>0,hidePrevious:!0,onNextAction:function(){q.a.Modal.loading(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"importExport",action:"getMailChimpSubscribers",data:{api_key:r,lists:d}}).always((function(){q.a.Modal.loading(!1)})).done((function(e){return t(e.data)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}}))};Eo.propTypes={onFinish:Z.a.func},Eo.defaultProps={onFinish:function(){}};var ko=Eo,Io=a(487),So=a.n(Io),Co=a(318),No=a.n(Co),xo=a(139),To=a.n(xo),Ro=function(e){var t;return To()(t=window.roleBasedEmails).call(t,(function(t){return No()(e).call(e,"".concat(t,"@"))}))>=0},Po=function(e){var t,a,n,r=ve()("<div />").html(e).text();(r=r.toLowerCase().replace(/^["';.,\s]+|[^\x20-\x7E]+$|["';.,_\s]+$/g,"").replace(/\s+|%\d+|,+/g,""),t=/<(.*?)>/.exec(r))&&(r=qa()(a=t[1]).call(a));(t=/mailto:(?:\s+)?(.*)/.exec(r))&&(r=qa()(n=t[1]).call(n));return!!window.mailpoet_email_regex.test(r)&&(!Ro(r)&&r)};var Oo=function(e){var t,a,n,r,i,s=[],o=[],l=[],c=[],p=[],d=null,m=null,h=!1;return u()(t=b()(e)).call(t,(function(t){var f,g;(r=x()(f=e[t]).call(f,(function(e){return qa()(e).call(e)})),i=r.length,null===m&&(m=i),i===m)&&(null===d?(u()(g=b()(r)).call(g,(function(e){n=Po(r[e]),null===d&&window.mailpoet_email_regex.test(n)&&(d=e,o[n]=!0,r[e]=n,s[n]=r)})),null===d&&0===Se()(t,10)&&(h=!0,s[0]=r)):""!==r[d]&&(a=Po(r[d]),O.a.has(o,a)?l.push(a):Ro(r[d])?p.push(r[d]):window.mailpoet_email_regex.test(a)?(o[a]=!0,r[d]=a,s[a]=r):c.push(r[d])))})),(s=ce()(O.a).call(O.a,s))&&(h&&s.length>=2||!h&&s.length>=1)?{header:window.mailpoet_email_regex.test(s[0][d])?null:s.shift(),subscribers:s,subscribersCount:s.length,duplicate:O.a.uniq(l),invalid:O.a.uniq(c),role:O.a.uniq(p)}:null};var Do=function(e,t){var a=encodeURI(e).split(/%..|./).length-1;q.a.Notice.hide(),a>window.maxPostSizeBytes?q.a.Notice.error(q.a.I18n.t("maxPostSizeNotice")):(q.a.Modal.loading(!0),So.a.parse(e,function(e){return{skipEmptyLines:!0,error:function(){q.a.Notice.hide(),q.a.Notice.error(q.a.I18n.t("dataProcessingError"))},complete:function(t){var a=Oo(t.data);if(a)e(a);else{var n=q.a.I18n.t("noValidRecords");n=(n=n.replace("[link]",'<a href="https://kb.mailpoet.com/article/126-importing-subscribers-with-csv-files" data-beacon-article="57ce079f903360649f6e56fc">')).replace("[/link]","</a>"),q.a.Notice.error(n)}q.a.Modal.loading(!1)}}}(t)))},Ao=function(e,t,a){return void 0===e?"step_data_manipulation":void 0===e.subscribersCount?"step_data_manipulation":e.subscribersCount<t?"step_data_manipulation":"mailchimp-method"===a?"step_data_manipulation":"step_input_validation"};function qo(e){var t=e.history,a=e.setStepMethodSelectionData,n=e.subscribersLimitForValidation,r=Object(T.useState)(void 0),i=Ne()(r,2),s=i[0],o=i[1],l=Object(T.useState)(""),c=Ne()(l,2),u=c[0],p=c[1],d=Object(T.useState)(void 0),m=Ne()(d,2),h=m[0],f=m[1],g=function(e){a(e),t.push(Ao(e,n,s))},v=function(){Do("paste-method"===s?u:h,(function(e){q.a.trackEvent("Subscribers import started",{source:"file-method"===s?"file upload":"pasted data","MailPoet Free version":window.mailpoet_version}),g(e)}))};return R.a.createElement("div",{className:"mailpoet_method_selection_step"},R.a.createElement(fo,{activeMethod:s,onMethodChange:o}),"paste-method"===s&&R.a.createElement(_o,{onValueChange:p,onFinish:v,canFinish:!!qa()(u).call(u),data:u}),"file-method"===s&&R.a.createElement(wo,{onValueChange:f,onFinish:v,canFinish:!!h,data:h}),"mailchimp-method"===s&&R.a.createElement(ko,{onFinish:function(e){q.a.trackEvent("Subscribers import started",{source:"MailChimp","MailPoet Free version":window.mailpoet_version}),g(e)}}))}qo.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,setStepMethodSelectionData:Z.a.func.isRequired,subscribersLimitForValidation:Z.a.number.isRequired};var Lo=Object(ne.withRouter)(qo);function Fo(e){var t=e.onSubmit,a=e.history,n=Object(T.useState)(void 0),r=Ne()(n,2),i=r[0],s=r[1];return R.a.createElement(R.a.Fragment,null,R.a.createElement("h2",null,q.a.I18n.t("validationStepHeading")),R.a.createElement("label",{htmlFor:"existing-list"},R.a.createElement("input",{"data-automation-id":"mailpoet_import_validation_step_option1",type:"radio",id:"existing-list",checked:"existing-list"===i,onChange:function(){return s("existing-list")}}),q.a.I18n.t("validationStepRadio1")),R.a.createElement("label",{htmlFor:"address-book"},R.a.createElement("input",{"data-automation-id":"mailpoet_import_validation_step_option2",type:"radio",id:"address-book",checked:"address-book"===i,onChange:function(){return s("address-book")}}),q.a.I18n.t("validationStepRadio2")),R.a.createElement(vo,{canGoNext:void 0!==i,onPreviousAction:function(){return a.push("step_method_selection")},onNextAction:function(){return t(i)}}))}Fo.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,onSubmit:Z.a.func.isRequired};var jo=Fo;var Mo=function(){return R.a.createElement("div",{className:"mailpoet_import_block","data-automation-id":"import_wrong_source_block"},R.a.createElement("p",null,q.a.I18n.t("validationStepBlock1")),R.a.createElement("p",null,q.a.I18n.t("validationStepBlock2")),R.a.createElement("a",{href:"https://kb.mailpoet.com/article/269-reconfirm-subscribers-to-your-list",target:"_blank",rel:"noopener noreferrer",className:"button button-primary"},q.a.I18n.t("validationStepBlockButton")))};var Vo=function(){return R.a.createElement("div",{className:"mailpoet_import_block","data-automation-id":"import_old_list_block"},R.a.createElement("p",null,q.a.I18n.t("validationStepBlock1")),R.a.createElement("p",null,q.a.I18n.t("validationStepBlock3")),R.a.createElement("p",null,q.a.I18n.t("validationStepBlock4")),R.a.createElement("a",{href:"https://kb.mailpoet.com/article/269-reconfirm-subscribers-to-your-list",target:"_blank",rel:"noopener noreferrer",className:"button button-primary"},q.a.I18n.t("validationStepBlockButton")))};function Bo(e){var t=e.onSubmit,a=Object(T.useState)("over2years"),n=Ne()(a,2),r=n[0],i=n[1];return R.a.createElement(R.a.Fragment,null,R.a.createElement("h2",null,q.a.I18n.t("validationStepLastSentHeading")),R.a.createElement("select",{value:r,onChange:function(e){i(e.target.value)},className:"mailpoet_last_sent","data-automation-id":"last_sent_to_list"},R.a.createElement("option",{value:"over2years"},q.a.I18n.t("validationStepLastSentOption1")),R.a.createElement("option",{value:"1to2years"},q.a.I18n.t("validationStepLastSentOption2")),R.a.createElement("option",{value:"less1year"},q.a.I18n.t("validationStepLastSentOption3")),R.a.createElement("option",{value:"less3months"},q.a.I18n.t("validationStepLastSentOption4"))),R.a.createElement("button",{type:"button",className:"button button-primary","data-automation-id":"last_sent_to_list_next",onClick:function(){t("over2years"===r||"1to2years"===r?"notRecently":"recently")}},q.a.I18n.t("validationStepLastSentNext")))}Bo.propTypes={onSubmit:Z.a.func.isRequired};var zo=Bo;function Uo(e){var t=e.stepMethodSelectionData,a=e.history,n=Object(T.useState)(void 0),r=Ne()(n,2),i=r[0],s=r[1],o=Object(T.useState)(void 0),l=Ne()(o,2),c=l[0],u=l[1];return Object(T.useEffect)((function(){void 0===t&&a.replace("step_method_selection")}),[t,a]),R.a.createElement("div",{className:"mailpoet_import_validation_step","data-automation-id":"mailpoet_import_validation_step"},void 0===i&&R.a.createElement(jo,{onSubmit:s,history:a}),"address-book"===i&&R.a.createElement(Mo,null),"existing-list"===i&&void 0===c&&R.a.createElement(zo,{onSubmit:function(e){u(e),"recently"===e&&a.push("step_data_manipulation")}}),"existing-list"===i&&"notRecently"===c&&R.a.createElement(Vo,null))}Uo.propTypes={history:Z.a.shape({push:Z.a.func.isRequired,replace:Z.a.func.isRequired}).isRequired,stepMethodSelectionData:Z.a.shape({duplicate:Z.a.arrayOf(Z.a.string),header:Z.a.arrayOf(Z.a.string),invalid:Z.a.arrayOf(Z.a.string),role:Z.a.arrayOf(Z.a.string),subscribersCount:Z.a.number,subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.string))})},Uo.defaultProps={stepMethodSelectionData:void 0};var $o=Object(ne.withRouter)(Uo),Wo=function(e){var t=e.translation,a=e.subscribers,n="";return a.length&&(n=St()(t.replace("%2$s",a.join(", ")),"%1$s",(function(){return R.a.createElement("strong",{key:t},a.length.toLocaleString())})),n=R.a.createElement("p",null,n)),n};Wo.propTypes={translation:Z.a.string.isRequired,subscribers:Z.a.arrayOf(Z.a.string).isRequired};var Ho=function(e){var t=e.stepMethodSelectionData,a=t.invalid,n=t.duplicate,r=t.role,i=Object(T.useState)(!1),s=Ne()(i,2),o=s[0],l=s[1],c=lt()("mailpoet_subscribers_data_parse_results_details",{mailpoet_hidden:!o}),u=R.a.createElement(Wo,{translation:q.a.I18n.t("importNoticeInvalid"),subscribers:a}),p=R.a.createElement(Wo,{translation:q.a.I18n.t("importNoticeDuplicate"),subscribers:n}),d="";if(r.length&&(d=St()(q.a.I18n.t("importNoticeRoleBased"),/(%1\$s|\[link\].*\[\/link\]|%2\$s)/,(function(e){return"%1$s"===e?R.a.createElement("strong",{key:"role-length"},r.length.toLocaleString()):"%2$s"===e?r.join(", "):R.a.createElement("a",{href:"https://kb.mailpoet.com/article/270-role-based-email-addresses-are-not-allowed","data-beacon-article":"5d0a1da404286318cac46fe5",target:"_blank",rel:"noopener noreferrer",key:e},e.replace("[link]","").replace("[/link]",""))})),d=R.a.createElement("p",null,d)),a.length||n.length||r.length){var m=a.length+n.length+r.length;return R.a.createElement("div",{className:"error"},R.a.createElement("p",null,St()(q.a.I18n.t("importNoticeSkipped"),"%1$s",(function(){return R.a.createElement("strong",{key:"lengths"},m.toLocaleString())}))," ",R.a.createElement("a",{className:"mailpoet_subscribers_data_parse_results_details_show","data-automation-id":"show-more-details",onClick:function(){return l(!o)},role:"button",tabIndex:0,onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),l(!o))}},q.a.I18n.t("showMoreDetails"))),R.a.createElement("div",{className:c},R.a.createElement("hr",null),u,p,d))}return null};Ho.propTypes={stepMethodSelectionData:Z.a.shape({duplicate:Z.a.arrayOf(Z.a.string),invalid:Z.a.arrayOf(Z.a.string),role:Z.a.arrayOf(Z.a.string)})},Ho.defaultProps={stepMethodSelectionData:{invalid:[],duplicate:[],role:[]}};var Ko=Ho,Go=a(488),Yo=a.n(Go),Jo=a(489),Qo=a.n(Jo),Zo=function(){ve()("select.mailpoet_subscribers_column_data_match").select2({data:window.mailpoetColumnsSelect2,width:"15em",templateResult:function(e){return e.name},templateSelection:function(e){return e.name}}).on("select2:selecting",(function(e){var t=e.currentTarget,a=e.params.args.data.id;"create"===a?(e.preventDefault(),ve()(t).select2("close"),q.a.Modal.popup({title:q.a.I18n.t("addNewField"),template:ve()("#form_template_field_form").html()}),ve()("#form_field_new").parsley().on("form:submit",(function(){var e=ve()("#form_field_new").mailpoetSerializeObject();return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:e}).done((function(e){var a={id:e.data.id,name:e.data.name,type:e.data.type,params:e.data.params,custom:!0};2===window.mailpoetColumnsSelect2.length&&window.mailpoetColumnsSelect2.push({name:q.a.I18n.t("userColumns"),children:[]}),window.mailpoetColumnsSelect2[2].children.push(a),window.mailpoetColumns.push(a),ve()("select.mailpoet_subscribers_column_data_match").each((function(){ve()(t).html("").select2("destroy").select2({data:window.mailpoetColumnsSelect2,width:"15em",templateResult:function(e){return e.name},templateSelection:function(e){return e.name}})})),ve()(t).data("column-id",a.id),q.a.Modal.close()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{positionAfter:"#field_name"})})),!1}))):ve()("select.mailpoet_subscribers_column_data_match").each((function(){var n,r=t,i=ve()(r).val();i===a&&"ignore"!==i&&(confirm(E()(n="".concat(q.a.I18n.t("selectedValueAlreadyMatched")," ")).call(n,q.a.I18n.t("confirmCorrespondingColumn")))?ve()(r).data("column-id","ignore"):(e.preventDefault(),ve()(t).select2("close")))}))})).on("select2:select",(function(e){var t=e.currentTarget,a=e.params.data.id;ve()(t).data("column-id",a)})),x()(ve.a).call(ve.a,ve()(".mailpoet_subscribers_column_data_match"),(function(e){var t=ve()(e).data("column-id");ve()(e).val(t).trigger("change")}))},Xo=function(e,t){var a,n,r,i,s,o=[],l=[];return u()(a=b()(e[0])).call(a,(function(a){if(n=e[0][a],r="ignore",n%1!=0&&window.mailpoet_email_regex.test(n))r="email";else if(t){var c,u;i=t[a],-1!==(s=sn()(c=x()(u=window.mailpoetColumns).call(u,(function(e){return e.name}))).call(c,i))?r=window.mailpoetColumns[s].id:i&&(/first|first name|given name/i.test(i)?r="first_name":/last|last name/i.test(i)&&(r="last_name"))}r="ignore"!==r&&-1===sn()(l).call(l,r)?r:"ignore",o[a]={column_id:r},l.push(r)})),o},el=10;function tl(e){var t=e.header,a=e.subscribers,n=Xo(a,t);return R.a.createElement("tr",null,R.a.createElement("th",null,q.a.I18n.t("matchData")),x()(n).call(n,(function(e,t){return R.a.createElement("th",{key:e.column_id+t},R.a.createElement("select",{className:"mailpoet_subscribers_column_data_match","data-column-id":e.column_id,"data-column-index":t,id:"column_".concat(t)}))})))}function al(e){var t=e.header;return R.a.createElement("tr",{className:"mailpoet_header"},R.a.createElement("td",null),x()(t).call(t,(function(e){return R.a.createElement("td",{key:e},e)})))}function nl(e){var t=e.subscriber,a=e.index;return R.a.createElement(R.a.Fragment,null,R.a.createElement("td",null,a),x()(t).call(t,(function(e,t){var n,r;return R.a.createElement("td",{key:E()(n=E()(r="".concat(e,"-")).call(r,a,"-")).call(n,t)},e)})))}function rl(e){var t,a,n=e.subscribers,r=e.subscribersCount,i=Qo()(t=Array(n[0].length)).call(t,". . .");return R.a.createElement(R.a.Fragment,null,x()(a=Yo()(n).call(n,0,el)).call(a,(function(e,t){var a;return(R.a.createElement("tr",{key:E()(a="".concat(e[0],"-")).call(a,t)},R.a.createElement(nl,{subscriber:e,index:t+1})))})),r>el+1?R.a.createElement("tr",{key:"filler"},R.a.createElement(nl,{subscriber:i,index:". . ."})):null,r>el?R.a.createElement("tr",{key:n[r-1][0]},R.a.createElement(nl,{subscriber:n[r-1],index:r})):null)}function il(e){var t=e.subscribersCount,a=e.subscribers,n=e.header;return Object(T.useLayoutEffect)((function(){Zo()})),R.a.createElement("div",{className:"subscribers_data"},R.a.createElement("table",{className:"mailpoet_subscribers widefat fixed"},R.a.createElement("thead",null,R.a.createElement(tl,{header:n,subscribers:a})),R.a.createElement("tbody",null,n?R.a.createElement(al,{header:n}):null,R.a.createElement(rl,{subscribers:a,subscribersCount:t}))))}tl.propTypes={subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number]))).isRequired,header:Z.a.arrayOf(Z.a.string)},tl.defaultProps={header:[]},al.propTypes={header:Z.a.arrayOf(Z.a.string).isRequired},nl.propTypes={subscriber:Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number])).isRequired,index:Z.a.node.isRequired},rl.propTypes={subscribersCount:Z.a.number.isRequired,subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number]))).isRequired},il.propTypes={subscribersCount:Z.a.number,subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number]))),header:Z.a.arrayOf(Z.a.string)},il.defaultProps={subscribersCount:0,subscribers:[],header:[]};var sl=il;var ol=function(e){q.a.Modal.popup({title:q.a.I18n.t("addNewList"),template:ve()("#new_segment_template").html()}),ve()("#new_segment_name").keypress((function(e){13===e.which&&ve()("#new_segment_process").click()})),ve()("#new_segment_process").click((function(){var t,a,n=qa()(t=ve()("#new_segment_name").val()).call(t),r=qa()(a=ve()("#new_segment_description").val()).call(a);q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"addSegment",data:{name:n,description:r}}).done((function(t){e({id:t.data.id,name:t.data.name,text:t.data.name,subscriberCount:0}),q.a.Modal.close()})).fail((function(e){var t;e.errors.length>0&&(q.a.Notice.hide(),q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{positionAfter:"#new_segment_name"}))}))})),ve()("#new_segment_cancel").click((function(){q.a.Modal.close()}))};function ll(e){var t=e.setSelectedSegments,a=Object(T.useContext)(Ge.a).segments.all,n=Object(T.useState)(a),r=Ne()(n,2),i=r[0],s=r[1];Object(T.useLayoutEffect)((function(){!function(e,t){var a=ve()("select#mailpoet_segments_select");a.data("select2")||(a.html(""),a.select2({data:e,width:"20em",templateResult:function(e){var t,a=e;return a.subscriberCount=Se()(a.subscriberCount,10),E()(t="".concat(a.name," (")).call(t,a.subscriberCount.toLocaleString(),")")},templateSelection:function(e){var t,a=e;return a.subscriberCount=Se()(a.subscriberCount,10),E()(t="".concat(a.name," (")).call(t,a.subscriberCount.toLocaleString(),")")}}).change((function(e){var n=ve()('[data-id="notice_segmentSelection"]');e.currentTarget.value?ve()('[data-id="notice_segmentSelection"]').remove():n.length||q.a.Notice.error(q.a.I18n.t("segmentSelectionRequired"),{static:!0,scroll:!0,id:"notice_segmentSelection",hideClose:!0});var r=O.a.pluck(a.select2("data"),"id");t(r)})))}(i,(function(e){t(e)}))}),[i,t]);var o=function(e){var a,n;(n=ve()("select#mailpoet_segments_select")).data("select2")&&(n.select2("destroy"),me()(n).call(n,"option").remove(),n.off("select2:unselecting").off("change").off("select2:opening")),t([]),s(E()(a=[]).call(a,I()(i),[e]))};return R.a.createElement("div",{className:"mailpoet_import_select_segment"},R.a.createElement("label",{htmlFor:"mailpoet_segments_select"},R.a.createElement("div",{className:"mailpoet_label_description"},R.a.createElement("b",null,q.a.I18n.t("pickLists")),R.a.createElement("p",{className:"description"},q.a.I18n.t("pickListsDescription"))),R.a.createElement("select",{id:"mailpoet_segments_select","data-placeholder":q.a.I18n.t("select"),multiple:"multiple"},R.a.createElement("option",null))),R.a.createElement("a",{className:"mailpoet_create_segment",onClick:function(){return ol(o)},role:"button",tabIndex:0,onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),ol(o))}},q.a.I18n.t("createANewList")))}ll.propTypes={setSelectedSegments:Z.a.func.isRequired};var cl=ll;function ul(e){var t=e.updateExistingSubscribers,a=e.setUpdateExistingSubscribers;return R.a.createElement("div",{className:"mailpoet_update_existing_subscribers"},R.a.createElement("div",{className:"mailpoet_label_description"},q.a.I18n.t("updateExistingSubscribers")),R.a.createElement("label",{htmlFor:"update_existing_subscribers"},R.a.createElement("input",{id:"update_existing_subscribers",type:"radio",name:"update_existing_subscribers",checked:t,onChange:function(){return a(!0)}}),q.a.I18n.t("updateExistingSubscribersYes")),R.a.createElement("label",{htmlFor:"dont_update_existing_subscribers"},R.a.createElement("input",{id:"dont_update_existing_subscribers",type:"radio",name:"update_existing_subscribers",checked:!t,onChange:function(){return a(!1)}}),q.a.I18n.t("updateExistingSubscribersNo")))}ul.propTypes={setUpdateExistingSubscribers:Z.a.func.isRequired,updateExistingSubscribers:Z.a.bool.isRequired};var pl=ul,dl=(a(624),function(e,t,a,n){var r={},i=new ve.a.AsyncQueue,s=0,o=kt()()/1e3,l={created:0,updated:0,errors:[],segments:[]};q.a.Modal.loading(!0);var c,u,p=(c=e,u=2e3,Pe()(c).call(c,(function(e,t,a){return a%u==0&&e.push([]),e[e.length-1].push(t),e}),[]));O.a.each(ve()("select.mailpoet_subscribers_column_data_match"),(function(e,t){var a=ve()(e).data("column-id");"ignore"!==a&&(r[a]={index:t})})),O.a.each(p,(function(){i.add((function(e){e.pause(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"processImport",data:oe()({columns:r,subscribers:p[s],timestamp:o,segments:t,updateSubscribers:a})}).done((function(t){var a=t.data.added_to_segment_with_welcome_notification;l.created+=t.data.created,l.updated+=t.data.updated,l.segments=t.data.segments,l.added_to_segment_with_welcome_notification=a,e.run()})).fail((function(e){var t;(q.a.Modal.loading(!1),e.errors.length>0)&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})})),s+=1}))})),i.run(),i.onComplete((function(){q.a.Modal.loading(!1),l.errors.length>0&&!l.updated&&!l.created?q.a.Notice.error(O.a.flatten(l.errors)):(l.segments=x()(O.a).call(O.a,h()(O.a).call(O.a,l.segments,(function(e){return C()(t).call(t,e.id)})),(function(e){return e.name})),n(l))}))});function ml(e){var t=e.history,a=e.stepMethodSelectionData,n=e.subscribersLimitForValidation,r=e.setStepDataManipulationData,i=Object(T.useState)([]),s=Ne()(i,2),o=s[0],l=s[1],c=Object(T.useState)(!0),u=Ne()(c,2),p=u[0],d=u[1];Object(T.useEffect)((function(){void 0===a&&t.replace("step_method_selection")}),[a,t]);return void 0===a?null:R.a.createElement("div",{className:"mailpoet_data_manipulation_step","data-automation-id":"import_data_manipulation_step"},R.a.createElement(Ko,{stepMethodSelectionData:a}),R.a.createElement(sl,{subscribersCount:a.subscribersCount,subscribers:a.subscribers,header:a.header}),R.a.createElement(cl,{setSelectedSegments:l}),R.a.createElement(pl,{setUpdateExistingSubscribers:d,updateExistingSubscribers:p}),R.a.createElement(vo,{canGoNext:o.length>0,onPreviousAction:function(){return t.push(function(e,t){return void 0===e?"step_method_selection":void 0===e.subscribersCount?"step_method_selection":e.subscribersCount<t?"step_method_selection":"step_input_validation"}(a,n))},onNextAction:function(){dl(a.subscribers,o,p,(function(e){r(e),t.push("step_results")}))}}))}ml.propTypes={history:Z.a.shape({push:Z.a.func.isRequired,replace:Z.a.func.isRequired}).isRequired,stepMethodSelectionData:Z.a.shape({duplicate:Z.a.arrayOf(Z.a.string),header:Z.a.arrayOf(Z.a.string),invalid:Z.a.arrayOf(Z.a.string),role:Z.a.arrayOf(Z.a.string),subscribersCount:Z.a.number,subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number])))}),subscribersLimitForValidation:Z.a.number.isRequired,setStepDataManipulationData:Z.a.func.isRequired},ml.defaultProps={stepMethodSelectionData:void 0};var hl=Object(ne.withRouter)(ml),fl=function(e){return e.subscribersCount<2e3?null:R.a.createElement("div",{className:"mailpoet_offer_migration"},R.a.createElement("h2",null,q.a.I18n.t("offerMigrationHead")),R.a.createElement("p",null,q.a.I18n.t("offerMigrationSubhead"),":"),R.a.createElement("ul",{className:"default-list"},R.a.createElement("li",null,q.a.I18n.t("offerMigrationList1")),R.a.createElement("li",null,q.a.I18n.t("offerMigrationList2")),R.a.createElement("li",null,q.a.I18n.t("offerMigrationList3")),R.a.createElement("li",null,q.a.I18n.t("offerMigrationList4"))),R.a.createElement("a",{type:"button",className:"button-primary wysija",href:"https://www.mailpoet.com/concierge-migration/",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("offerMigrationCTA")))};fl.propTypes={subscribersCount:Z.a.number.isRequired};var gl=fl;function vl(e){var t=e.subscribersCount,a=e.segments,n=e.initialMessage;if(t){var r=St()(n,"%1$s",(function(){return R.a.createElement("strong",{key:"%1$s"},t.toLocaleString())}));return r=St()(r,"%2$s",(function(){return'"'.concat(a.join('", "'),'"')})),R.a.createElement("p",null,r)}return null}function bl(e){var t=e.createdSubscribers,a=e.updatedSubscribers;return t||a?null:R.a.createElement("p",null,q.a.I18n.t("importNoAction"))}function _l(e){return e.addedToSegmentWithWelcomeNotification?R.a.createElement("p",null,q.a.I18n.t("importNoWelcomeEmail")):null}function yl(e){var t=e.errors,a=e.createdSubscribers,n=e.updatedSubscribers,r=e.segments,i=e.addedToSegmentWithWelcomeNotification,s=e.history;Object(T.useEffect)((function(){void 0===r&&0===t.length&&void 0===a&&void 0===n&&s.replace("step_method_selection")}),[r,a,t.length,s,n]),t.length&&q.a.Notice.error(O.a.flatten(t));var o=0;return null!=a&&(o+=a),null!=n&&(o+=n),R.a.createElement(R.a.Fragment,null,R.a.createElement("div",{className:"updated"},R.a.createElement(vl,{subscribersCount:a,segments:r,initialMessage:q.a.I18n.t("subscribersCreated")}),R.a.createElement(vl,{subscribersCount:n,segments:r,initialMessage:q.a.I18n.t("subscribersUpdated")}),R.a.createElement(bl,{createdSubscribers:a,updatedSubscribers:n}),R.a.createElement(_l,{addedToSegmentWithWelcomeNotification:i})),R.a.createElement("button",{type:"button",className:"button-primary wysija",onClick:function(){return s.push("step_method_selection")}},q.a.I18n.t("importAgain")),"  ",R.a.createElement("button",{type:"button",className:"button-primary wysija",onClick:function(){window.location.href="admin.php?page=mailpoet-subscribers"}},q.a.I18n.t("viewSubscribers")),R.a.createElement(gl,{subscribersCount:o}))}vl.propTypes={segments:Z.a.arrayOf(Z.a.string.isRequired),subscribersCount:Z.a.number,initialMessage:Z.a.string},vl.defaultProps={segments:[],subscribersCount:0,initialMessage:""},bl.propTypes={createdSubscribers:Z.a.number,updatedSubscribers:Z.a.number},bl.defaultProps={createdSubscribers:0,updatedSubscribers:0},_l.propTypes={addedToSegmentWithWelcomeNotification:Z.a.bool},_l.defaultProps={addedToSegmentWithWelcomeNotification:!1},yl.propTypes={history:Z.a.shape({push:Z.a.func.isRequired,replace:Z.a.func.isRequired}).isRequired,errors:Z.a.arrayOf(Z.a.string.isRequired),segments:Z.a.arrayOf(Z.a.string.isRequired),createdSubscribers:Z.a.number,updatedSubscribers:Z.a.number,addedToSegmentWithWelcomeNotification:Z.a.bool},yl.defaultProps={errors:[],segments:void 0,createdSubscribers:void 0,updatedSubscribers:void 0,addedToSegmentWithWelcomeNotification:void 0};var wl=Object(ne.withRouter)(yl),El=document.getElementById("import_container");El&&_e.a.render(R.a.createElement((function(){var e=Object(T.useState)(void 0),t=Ne()(e,2),a=t[0],n=t[1],r=Object(T.useState)({}),i=Ne()(r,2),s=i[0],o=i[1],l=Object(Ge.b)(window);return R.a.createElement(Ge.a.Provider,{value:l},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(mo,null,R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{path:"/step_method_selection",render:function(e){return R.a.createElement(Lo,pe()({},e,{setStepMethodSelectionData:n,subscribersLimitForValidation:200}))}}),R.a.createElement(ne.Route,{path:"/step_input_validation",render:function(e){return R.a.createElement($o,pe()({},e,{stepMethodSelectionData:a}))}}),R.a.createElement(ne.Route,{path:"/step_data_manipulation",render:function(e){return R.a.createElement(hl,pe()({},e,{stepMethodSelectionData:a,subscribersLimitForValidation:200,setStepDataManipulationData:o}))}}),R.a.createElement(ne.Route,{path:"/step_results",render:function(e){return R.a.createElement(wl,pe()({},e,{errors:s.errors,createdSubscribers:s.created,updatedSubscribers:s.updated,segments:s.segments,addedToSegmentWithWelcomeNotification:s.added_to_segment_with_welcome_notification}))}}),R.a.createElement(ne.Route,{path:"*",render:function(){return R.a.createElement(ne.Redirect,{to:"/step_method_selection"})}})))))}),null),El);var kl=a(27),Il=a.n(kl);ve()(document).ready((function(){var e,t,a,n,r,i;function s(e){"on"===e?n.removeClass("button-disabled"):n.addClass("button-disabled")}ve()("#mailpoet_subscribers_export").length&&window.exportData.segments&&(i=Il.a.compile(ve()("#mailpoet_subscribers_export_template").html()),ve()("#mailpoet_subscribers_export > div.inside").html(i(window.exportData)),t=ve()("#export_lists"),a=ve()("#export_columns"),n=ve()("a.mailpoet_export_process"),r=function(e,n){e.data("select2")&&e.html("").select2("destroy"),e.select2({data:n,width:"20em",templateResult:function(e){return e.subscriberCount>0?e.name+" ("+Se()(e.subscriberCount,10).toLocaleString()+")":e.name},templateSelection:function(e){return e.subscriberCount>0?e.name+" ("+Se()(e.subscriberCount,10).toLocaleString()+")":e.name}}).on("select2:selecting",(function(t){var a,n=t.params.args.data.id,r=["select","deselect"];O.a.contains(r,n)&&(t.preventDefault(),"deselect"===n?ve()(this).val("").trigger("change"):(a=[],O.a.each(me()(e).call(e,"option"),(function(e){O.a.contains(r,e.value)||a.push(e.value)})),ve()(this).val(a).trigger("change")),ve()(this).select2("close"))})).on("change",(function(){window.exportData.segments&&t.select2("data").length&&a.select2("data").length||!window.exportData.segments&&a.select2("data").length?s("on"):s("off")}))},u()(e=window.segments).call(e,(function(e){t.append(ve()("<option></option>").attr("value",e.id).text(e.name))})),r(t,window.segments),r(a,window.subscriberFieldsSelect2),a.val(["email","first_name","last_name","list_status","global_status"]).trigger("change"),n.click((function(){var e;ve()(this).hasClass("button-disabled")||(q.a.Modal.loading(!0),e=ve()(':radio[name="option_format"]:checked').val(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"processExport",data:oe()({export_format_option:e,segments:!!window.exportData.segments&&t.val(),subscriber_fields:a.val()})}).always((function(){q.a.Modal.loading(!1)})).done((function(t){var a=q.a.I18n.t("exportMessage").replace("%1$s","<strong>"+Se()(t.data.totalExported,10).toLocaleString()+"</strong>").replace("[link]",'<a href="'+t.data.exportFileURL+'" target="_blank" >').replace("[/link]","</a>");ve()("#export_result_notice").html("<p>"+a+"</p>").show(),window.location.href=t.data.exportFileURL,q.a.trackEvent("Subscribers export completed",{"Total exported":t.data.totalExported,"File Format":e,"MailPoet Free version":window.mailpoet_version})})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})})))})))}));var Sl=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardLetsStartTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardSenderText")),R.a.createElement("form",{id:"mailpoet_sender_form",className:e.loading?"mailpoet_sender_form_loading":"",onSubmit:function(t){t.preventDefault(),ve()("#mailpoet_sender_form").parsley().validate()&&e.submit_sender()}},R.a.createElement("label",{htmlFor:"senderName"},q.a.I18n.t("senderName"),":",R.a.createElement("input",{name:"senderName",type:"text",placeholder:"John Doe",value:e.sender?e.sender.name:"","data-parsley-required":!0,onChange:function(t){return e.update_sender({name:t.target.value})}})),R.a.createElement("label",{htmlFor:"senderAddress"},q.a.I18n.t("senderAddress"),":",R.a.createElement("input",{name:"senderAddress",type:"text",placeholder:"john@doe.com",value:e.sender?e.sender.address:"","data-parsley-required":!0,"data-parsley-type":"email",onChange:function(t){return e.update_sender({address:t.target.value})}})),R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_controls"},R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("next")})),R.a.createElement("a",{onClick:e.finish,href:"#finish",className:"sender_form_small"},q.a.I18n.t("noThanksSkip"))))};Sl.propTypes={finish:Z.a.func.isRequired,loading:Z.a.bool.isRequired,update_sender:Z.a.func.isRequired,submit_sender:Z.a.func.isRequired,sender:Z.a.shape({name:Z.a.string,address:Z.a.string})},Sl.defaultProps={sender:null};var Cl=Sl,Nl=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardLetsStartTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardSenderMigratedUserText")),R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_controls"},R.a.createElement("button",{type:"button",className:"button button-primary",onClick:e.next},q.a.I18n.t("next"))))};Nl.propTypes={next:Z.a.func.isRequired};var xl=Nl,Tl=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardEmailCourseTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardEmailCourseText")),R.a.createElement("iframe",{id:"mailpoet_form_iframe",width:"100%",scrolling:"no",frameBorder:"0",title:"Apply to course",src:"https://www.mailpoet.com?mailpoet_form_iframe=13",className:"mailpoet_form_iframe",marginWidth:"0",marginHeight:"0"}),R.a.createElement("button",{type:"button",className:"button button-primary",onClick:e.next},q.a.I18n.t("next")))};Tl.propTypes={next:Z.a.func.isRequired};var Rl=Tl,Pl=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardUsageTrackingStepTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardTrackingText")),R.a.createElement("h2",{className:"welcome_wizard_tracking_sub_title"},q.a.I18n.t("welcomeWizardUsageTrackingStepSubTitle")),R.a.createElement("ul",{className:"welcome_wizard_tracking_list"},R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList1")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList2")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList3")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList4")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList5"))),R.a.createElement("a",{href:" https://kb.mailpoet.com/article/130-sharing-your-data-with-us","data-beacon-article":"57ce0aaac6979108399a0454",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("welcomeWizardTrackingLink")),R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_controls\n ".concat(e.loading?"mailpoet_welcome_wizard_step_controls_loading":"")},R.a.createElement("button",{type:"button",className:"button",onClick:e.skip_action,disabled:e.loading},q.a.I18n.t("skip")),R.a.createElement("button",{type:"button",className:"button button-primary",onClick:e.allow_action,disabled:e.loading},e.allow_text)))};Pl.propTypes={allow_action:Z.a.func.isRequired,allow_text:Z.a.string.isRequired,skip_action:Z.a.func.isRequired,loading:Z.a.bool.isRequired};var Ol=Pl,Dl=function(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement("div",{className:"mailpoet_welcome_wizard_header"},R.a.createElement("img",{src:window.mailpoet_logo_url,width:"200",height:"87",alt:"MailPoet logo"})),R.a.createElement(wr,{illustrationUrl:e.illustrationUrl,step:e.step,stepsCount:e.stepsCount,displayProgressBar:e.displayProgressBar},e.children))};Dl.propTypes={illustrationUrl:Z.a.string.isRequired,step:Z.a.number.isRequired,displayProgressBar:Z.a.bool,stepsCount:Z.a.number.isRequired,children:Z.a.oneOfType([Z.a.arrayOf(Z.a.node),Z.a.node]).isRequired},Dl.defaultProps={displayProgressBar:!0};var Al=Dl,ql=function(e){var t,a=e.name,n=e.address,r=n.split("@").pop().toLowerCase();return sn()(t=window.mailpoet_free_domains).call(t,r)>-1?function(e){var t=e.name,a=e.address,n=window.location.hostname.replace("www.",""),r="wordpress@".concat(n);return{sender:{name:t,address:r},reply_to:{name:t,address:a},"signup_confirmation.from.address":r,"signup_confirmation.from.name":t,"signup_confirmation.reply_to.address":a,"signup_confirmation.reply_to.name":t}}({name:a,address:n}):function(e){var t=e.name,a=e.address;return{sender:{name:t,address:a},reply_to:{name:t,address:a},"signup_confirmation.from.address":a,"signup_confirmation.from.name":t,"signup_confirmation.reply_to.address":a,"signup_confirmation.reply_to.name":t}}({name:a,address:n})},Ll=function(){var e=3;return window.has_mss_key_specified||(e+=1),e},Fl=function(e,t,a){a<Ll()?e.push("/steps/".concat(a+1)):t()};function jl(e,t){var a=b()(e);if(g.a){var n=g()(e);t&&(n=h()(n).call(n,(function(t){return d()(e,t).enumerable}))),a.push.apply(a,n)}return a}var Ml=function(e){var t=Ll(),a=Se()(e.match.params.step,10),n=Object(T.useState)(!1),i=Ne()(n,2),o=i[0],c=i[1],p=Object(T.useState)(window.sender_data),m=Ne()(p,2),h=m[0],f=m[1];function g(){c(!0),window.location=window.finish_wizard_url}Object(T.useEffect)((function(){(a>t||a<1)&&e.history.push("/steps/1")}),[a,t,e.history]);var v=Object(P.partial)(Fl,e.history,g);function b(e){return c(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:e}).then((function(){return c(!1)})).fail((function(e){var t;(c(!1),e.errors.length>0)&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}var _,w,E=(_=a,w=!window.is_mp2_migration_complete,1===_&&w?"WelcomeWizardSenderStep":1!==_||w?2===_?"WelcomeWizardEmailCourseStep":3===_?"WelcomeWizardUsageTrackingStep":"WelcomeWizardPitchMSSStep":"WelcomeWizardMigratedUserStep");return R.a.createElement("div",{className:"mailpoet_welcome_wizard_steps"},"WelcomeWizardSenderStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_sender_illustration_url},R.a.createElement(Cl,{update_sender:function(e){f(function(e){for(var t=1;t<arguments.length;t++){var a,n=null!=arguments[t]?arguments[t]:{};if(t%2)u()(a=jl(Object(n),!0)).call(a,(function(t){y()(e,t,n[t])}));else if(l.a)s()(e,l()(n));else{var i;u()(i=jl(Object(n))).call(i,(function(t){r()(e,t,d()(n,t))}))}}return e}({},h,{},e))},submit_sender:function(){b(ql(h)).then((function(){return v(a)}))},finish:function(){c(!0),b(ql({address:window.admin_email,name:""})).then(g)},loading:o,sender:h})):null,"WelcomeWizardMigratedUserStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_sender_illustration_url},R.a.createElement(xl,{next:function(){return v(a)}})):null,"WelcomeWizardEmailCourseStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_email_course_illustration_url},R.a.createElement(Rl,{next:function(){return v(a)}})):null,"WelcomeWizardUsageTrackingStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_tracking_illustration_url},R.a.createElement(Ol,{skip_action:function(){return v(a)},allow_action:function(){b({analytics:{enabled:!0}}).then((function(){return v(a)}))},allow_text:t>3?q.a.I18n.t("allowAndContinue"):q.a.I18n.t("allowAndFinish"),loading:o})):null,"WelcomeWizardPitchMSSStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_MSS_pitch_illustration_url},R.a.createElement(Nr,{next:function(){return v(a)},subscribersCount:window.subscribers_count,mailpoetAccountUrl:window.mailpoet_account_url})):null)};Ml.propTypes={match:Z.a.shape({params:Z.a.shape({step:Z.a.string}).isRequired}).isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var Vl=Ml,Bl=a(115),zl=a.n(Bl),Ul=function(e){function t(e){var a,n,r;return M()(this,t),(r=U()(this,W()(t).call(this,e))).state={importType:null},r.handleOptionChange=F()(a=r.handleOptionChange).call(a,K()(r)),r.submit=F()(n=r.submit).call(n,K()(r)),r}return Y()(t,e),B()(t,[{key:"handleOptionChange",value:function(e){this.setState({importType:e.target.value})}},{key:"submit",value:function(e){return e.preventDefault(),!!this.state.importType&&(this.props.submitForm(this.state.importType),!1)}},{key:"render",value:function(){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_centered_column"},R.a.createElement("h1",null,q.a.I18n.t("wooCommerceListImportTitle")),R.a.createElement("p",null,q.a.I18n.t("wooCommerceListImportInfo1")),R.a.createElement("p",null,q.a.I18n.t("wooCommerceListImportInfo2")),R.a.createElement("p",null,R.a.createElement("b",null,q.a.I18n.t("wooCommerceListImportInfo3"))),R.a.createElement("form",{onSubmit:this.submit,className:"mailpoet_wizard_woocommerce_list"},R.a.createElement("label",{htmlFor:"import_type_subscribed"},R.a.createElement("input",{id:"import_type_subscribed",type:"radio",name:"import_type",checked:"subscribed"===this.state.importType,onChange:this.handleOptionChange,value:"subscribed","data-automation-id":"import_as_subscribed"}),zl()(q.a.I18n.t("wooCommerceListImportCheckboxSubscribed"))),R.a.createElement("label",{htmlFor:"import_type_unsubscribed"},R.a.createElement("input",{id:"import_type_unsubscribed",type:"radio",name:"import_type",checked:"unsubscribed"===this.state.importType,onChange:this.handleOptionChange,value:"unsubscribed","data-automation-id":"import_as_unsubscribed"}),zl()(q.a.I18n.t("wooCommerceListImportCheckboxUnsubscribed"))),R.a.createElement("p",null,q.a.I18n.t("wooCommerceListImportInfo4")),R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("wooCommerceListImportSubmit"),disabled:!this.state.importType||this.props.loading,"data-automation-id":"submit_woo_commerce_list_import"})))}}]),t}(R.a.Component);Ul.propTypes={submitForm:Z.a.func.isRequired,loading:Z.a.bool.isRequired};var $l=Ul,Wl=function(e){function t(e){var a,n,r,i,s;return M()(this,t),(s=U()(this,W()(t).call(this,e))).state={loading:!1},s.updateSettings=F()(a=s.updateSettings).call(a,K()(s)),s.scheduleImport=F()(n=s.scheduleImport).call(n,K()(s)),s.finishWizard=F()(r=s.finishWizard).call(r,K()(s)),s.submit=F()(i=s.submit).call(i,K()(s)),s}return Y()(t,e),B()(t,[{key:"finishWizard",value:function(){this.setState({loading:!0}),window.location=window.finish_wizard_url}},{key:"updateSettings",value:function(e){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:e}).fail(this.handleApiError)}},{key:"scheduleImport",value:function(){var e=this;return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"importExport",action:"setupWooCommerceInitialImport"}).then((function(){return e.setState({loading:!1})})).fail(this.handleApiError)}},{key:"handleApiError",value:function(e){this.setState({loading:!1}),q.a.Notice.showApiErrorNotice(e,{scroll:!0})}},{key:"submit",value:function(e){this.setState({loading:!0});var t={woocommerce_import_screen_displayed:1,"mailpoet_subscribe_old_woocommerce_customers.enabled":"subscribed"===e?1:0};this.updateSettings(t).then(this.scheduleImport).then(this.finishWizard)}},{key:"render",value:function(){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_steps mailpoet_welcome_wizard_centered_column"},R.a.createElement("div",{className:"mailpoet_welcome_wizard_header"},R.a.createElement("img",{src:window.mailpoet_logo_url,width:"200",height:"87",alt:"MailPoet logo"})),R.a.createElement($l,{loading:this.state.loading,submitForm:this.submit}))}}]),t}(R.a.Component);Wl.propTypes={};var Hl=Wl;function Kl(e){var t=e.submitForm,a=e.loading,n=Object(T.useState)("true"),r=Ne()(n,2),i=r[0],s=r[1];return R.a.createElement("div",{className:" mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_step_revenue_tracking mailpoet_welcome_wizard_centered_column "},R.a.createElement("p",null,q.a.I18n.t("revenueTrackingInfo1")),R.a.createElement("p",null,q.a.I18n.t("revenueTrackingInfo2")),R.a.createElement("form",{onSubmit:function(e){return e.preventDefault(),void 0!==i&&(t("true"===i),!1)},className:"mailpoet_wizard_woocommerce_list"},R.a.createElement("label",{htmlFor:"tracking_allowed"},R.a.createElement("input",{id:"tracking_allowed",type:"radio",name:"import_type",checked:"true"===i,onChange:function(e){return s(e.target.value)},value:"true"}),q.a.I18n.t("revenueTrackingAllow")),R.a.createElement("label",{htmlFor:"tracking_not_allowed"},R.a.createElement("input",{id:"tracking_not_allowed",type:"radio",name:"import_type",checked:"false"===i,onChange:function(e){return s(e.target.value)},value:"false"}),q.a.I18n.t("revenueTrackingDontAllow")),R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("revenueTrackingSubmit"),disabled:a})))}Kl.propTypes={submitForm:Z.a.func.isRequired,loading:Z.a.bool.isRequired};var Gl=Kl;var Yl=function(){var e=Object(T.useState)(!1),t=Ne()(e,2),a=t[0],n=t[1],r=function(e){n(!1),q.a.Notice.showApiErrorNotice(e,{scroll:!0})},i=function(){window.location=window.finish_wizard_url};return R.a.createElement("div",{className:"mailpoet_welcome_wizard_steps mailpoet_welcome_wizard_centered_column"},R.a.createElement("div",{className:"mailpoet_welcome_wizard_header"},R.a.createElement("img",{src:window.mailpoet_logo_url,width:"200",height:"87",alt:"MailPoet logo"})),R.a.createElement(Gl,{loading:a,submitForm:function(e){var t;n(!0),(t={"woocommerce.accept_cookie_revenue_tracking.enabled":e?1:0,"woocommerce.accept_cookie_revenue_tracking.set":1},q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:t}).fail(r)).then(i)}}))},Jl=document.getElementById("mailpoet_wizard_container");Jl&&_e.a.render(R.a.createElement((function(){var e,t,a="/steps/1";C()(e=window.location.search).call(e,"revenue-tracking-permission")?a="/revenue-tracking-permission":C()(t=window.location.search).call(t,"woocommerce-list-import")&&(a="/import");var n=Object(Ge.b)(window);return R.a.createElement(Ge.a.Provider,{value:n},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{path:"/steps/:step",component:Vl}),R.a.createElement(ne.Route,{path:"/import",component:Hl}),R.a.createElement(ne.Route,{path:"/revenue-tracking-permission",component:Yl}),R.a.createElement(ne.Route,{render:function(){return R.a.createElement(ne.Redirect,{to:a})}}))))}),null),Jl);var Ql=a(460),Zl=a.n(Ql);function Xl(e,t){var a=b()(e);if(g.a){var n=g()(e);t&&(n=h()(n).call(n,(function(t){return d()(e,t).enumerable}))),a.push.apply(a,n)}return a}function ec(e){for(var t=1;t<arguments.length;t++){var a,n=null!=arguments[t]?arguments[t]:{};if(t%2)u()(a=Xl(Object(n),!0)).call(a,(function(t){y()(e,t,n[t])}));else if(l.a)s()(e,l()(n));else{var i;u()(i=Xl(Object(n))).call(i,(function(t){r()(e,t,d()(n,t))}))}}return e}var tc=document.getElementById("experimental_features_container");tc&&_e.a.render(R.a.createElement((function(){var e,t=Object(T.useState)(null),a=Ne()(t,2),n=a[0],r=a[1],i=Object(Ge.b)(window),s=i.notices.error;function o(e){var t=e.target.name,a=e.target.checked;q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"featureFlags",action:"set",data:y()({},t,a?1:0)}).done((function(){var e,s=n[t];s.value=a,r(ec({},n,y()({},t,s)));var o=E()(e="Feature '".concat(t,"' was ")).call(e,a?"enabled":"disabled",".");i.notices.success(R.a.createElement("p",null,o))})).fail((function(e){var t;e.errors.length>0&&s(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))}return Object(T.useEffect)((function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"featureFlags",action:"getAll"}).done((function(e){var t,a=Pe()(t=e.data).call(t,(function(e,t){return ec({},e,y()({},t.name,t))}),{});r(a)})).fail((function(e){var t;e.errors.length>0&&s(R.a.createElement(R.a.Fragment,null,x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",null,e.message)}))),{scroll:!0})}))}),[s]),null===n?R.a.createElement("p",null,"Loading experimental features..."):0===Zl()(n).length?R.a.createElement("p",null,"There are no experimental features at the moment."):R.a.createElement(Ge.a.Provider,{value:i},R.a.createElement(R.a.Fragment,null,R.a.createElement(en,null),x()(e=Zl()(n)).call(e,(function(e){var t="experimental-feature-".concat(e.name);return R.a.createElement("div",{key:e.name},R.a.createElement("label",{htmlFor:t},R.a.createElement("input",{id:t,type:"checkbox",name:e.name,defaultChecked:e.value,onChange:o})," ",e.name))}))))}),null),tc);var ac=27;function nc(e){var t=e.shouldCloseOnClickOutside,a=e.onRequestClose,n=e.shouldCloseOnEsc,r=e.overlayClassName,i=e.contentLabel,s=e.aria,o=s.describedby,l=s.labelledby,c=e.children,u=e.className,p=e.role,d=e.fullScreen,m=Object(T.useRef)(null);function h(e){a&&a(e)}return R.a.createElement("div",{className:lt()("mailpoet-modal-screen-overlay",r),onKeyDown:function(e){e.keyCode===ac&&function(e){n&&(e.stopPropagation(),h(e))}(e)},onClick:function(e){t&&m.current&&!m.current.contains(e.target)&&h(e)},role:"button",tabIndex:"0"},R.a.createElement("div",{ref:m,className:lt()("mailpoet-modal-frame",{"mailpoet-modal-full-screen":d},u),role:p,"aria-label":i,"aria-labelledby":i?null:l,"aria-describedby":o,tabIndex:"-1"},c))}nc.propTypes={onRequestClose:Z.a.func,shouldCloseOnEsc:Z.a.bool,fullScreen:Z.a.bool,shouldCloseOnClickOutside:Z.a.bool,role:Z.a.string,className:Z.a.string,contentLabel:Z.a.string,overlayClassName:Z.a.string,children:Z.a.node.isRequired,aria:Z.a.shape({describedby:Z.a.string,labelledby:Z.a.string})},nc.defaultProps={onRequestClose:function(){},role:"dialog",shouldCloseOnEsc:!0,fullScreen:!1,shouldCloseOnClickOutside:!0,className:"",aria:{describedby:"",labelledby:""},contentLabel:null,overlayClassName:""};var rc=nc,ic=R.a.createElement("svg",{viewBox:"0 0 48 48"},R.a.createElement("path",{d:"M42 6L6 42M6 6L42 42",strokeWidth:"12",strokeLinecap:"round"})),sc=function(e){var t=e.title,a=e.onClose,n=e.headingId,r=e.isDismissible;return R.a.createElement("div",{className:"mailpoet-modal-header"},R.a.createElement("div",{className:"mailpoet-modal-header-heading-container"},t&&R.a.createElement("h1",{id:n,className:"mailpoet-modal-header-heading"},t)),r&&R.a.createElement("button",{type:"button",onClick:a,className:"mailpoet-modal-close"},ic))};sc.propTypes={title:Z.a.string,headingId:Z.a.string,onClose:Z.a.func,isDismissible:Z.a.bool},sc.defaultProps={title:null,headingId:"heading-id",onClose:function(){},isDismissible:!0};var oc=sc;function lc(e){var t=e.onRequestClose,a=e.title,n=e.displayTitle,r=e.children,i=e.aria,s=e.isDismissible,o=e.shouldCloseOnEsc,l=e.shouldCloseOnClickOutside,c=e.role,u=e.contentClassName,p=e.contentLabel,d=e.overlayClassName,m=e.fullScreen,h=i.labelledby||"mailpoet-modal-header";return Object(be.createPortal)(R.a.createElement(rc,{onRequestClose:t,aria:{labelledby:a?h:null,describedby:i.describedby},shouldCloseOnEsc:o,shouldCloseOnClickOutside:l,role:c,className:u,contentLabel:p,overlayClassName:d,fullScreen:m},R.a.createElement("div",{className:"mailpoet-modal-content",role:"document"},n&&R.a.createElement(oc,{headingId:h,isDismissible:s,onClose:t,title:a}),r)),document.getElementById("mailpoet_modal"))}lc.propTypes={children:Z.a.node,aria:Z.a.shape({labelledby:Z.a.string,describedby:Z.a.string}),isDismissible:Z.a.bool,contentClassName:Z.a.string,contentLabel:Z.a.string,overlayClassName:Z.a.string,title:Z.a.string,onRequestClose:Z.a.func,displayTitle:Z.a.bool,fullScreen:Z.a.bool,focusOnMount:Z.a.bool,shouldCloseOnEsc:Z.a.bool,shouldCloseOnClickOutside:Z.a.bool,role:Z.a.string},lc.defaultProps={bodyOpenClassName:"modal-open",onRequestClose:function(){},role:"dialog",title:null,aria:{},focusOnMount:!0,shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,isDismissible:!0,displayTitle:!0,fullScreen:!1};var cc=lc,uc=window.mailpoet_api_version,pc=function(){var e=Wt()(Ut.a.mark((function e(t){return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",q.a.Ajax.post({api_version:uc,endpoint:"settings",action:"setAuthorizedFromAddress",data:{address:t}}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),dc=function(e){return e?"unauthorized"===e.error?q.a.I18n.t("setFromAddressEmailNotAuthorized").replace(/\[link\](.*?)\[\/link\]/g,'<a href="https://account.mailpoet.com/authorization" target="_blank" rel="noopener noreferrer">$1</a>'):e.message||q.a.I18n.t("setFromAddressEmailUnknownError"):q.a.I18n.t("setFromAddressEmailUnknownError")},mc=function(){var e=document.querySelector('[data-notice="unauthorized-email-addresses-notice"]');e&&e.remove();var t=document.querySelector('[data-notice="unauthorized-email-in-newsletters-addresses-notice"]');t&&t.remove();var a=document.querySelector('[data-id="mailpoet_authorization_error"]');a&&a.remove()},hc=function(e){var t=e.onRequestClose,a=e.setAuthorizedAddress,n=Object(T.useState)(null),r=Ne()(n,2),i=r[0],s=r[1],o=R.a.useContext(Ge.a).notices;return R.a.createElement(cc,{title:q.a.I18n.t("setFromAddressModalTitle"),onRequestClose:t,contentClassName:"set-from-address-modal"},R.a.createElement("p",null,St()(q.a.I18n.t("setFromAddressModalDescription"),/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{key:"setFromAddressModalDescriptionLink",href:"https://account.mailpoet.com/authorization",target:"_blank",rel:"noopener noreferrer"},e)}))),R.a.createElement("input",{id:"mailpoet-set-from-address-modal-input",type:"text",placeholder:"from@mydomain.com","data-parsley-required":!0,"data-parsley-type":"email",onChange:function(e){var t;s(qa()(t=e.target.value).call(t)||null),ve()("#mailpoet-set-from-address-modal-input").parsley().removeError("saveError")}}),R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("setFromAddressModalSave"),onClick:Wt()(Ut.a.mark((function e(){var n,r,s;return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=ve()("#mailpoet-set-from-address-modal-input").parsley()).validate(),n.isValid()){e.next=4;break}return e.abrupt("return");case 4:if(i){e.next=6;break}return e.abrupt("return");case 6:return e.prev=6,e.next=9,pc(i);case 9:a(i),t(),mc(),o.success(R.a.createElement("p",null,St()(q.a.I18n.t("setFromAddressEmailSuccess"),/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{key:"setFromAddressModalBasicsTabLink",href:"?page=mailpoet-settings#basics",rel:"noopener noreferrer"},e)}))),{timeout:!1}),e.next=20;break;case 15:e.prev=15,e.t0=e.catch(6),r=e.t0.errors&&e.t0.errors[0]?e.t0.errors[0]:null,s=dc(r),n.addError("saveError",{message:s});case 20:case"end":return e.stop()}}),e,null,[[6,15]])})))}))};hc.propTypes={onRequestClose:Z.a.func.isRequired,setAuthorizedAddress:Z.a.func},hc.defaultProps={setAuthorizedAddress:function(){}};var fc=hc,gc=function(e){var t=e.onRequestClose,a=Object(T.useState)(!1),n=Ne()(a,2),r=n[0],i=n[1];return ve()((function(e){e(document).on("click",".notice .mailpoet-js-button-fix-this",(function(){i(!0)}))})),R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(en,null),r&&R.a.createElement(fc,{onRequestClose:function(){i(!1),t()}}))};gc.propTypes={onRequestClose:Z.a.func},gc.defaultProps={onRequestClose:function(){}};var vc=document.getElementById("mailpoet_set_from_address_modal");vc&&_e.a.render(R.a.createElement(gc,{onRequestClose:function(){var e;C()(e=window.location.href).call(e,"?page=mailpoet-settings")&&window.location.reload()}}),vc)}},[[648,0,1]]]);
39
  *
40
  * This source code is licensed under the MIT license found in the
41
  * LICENSE file in the root directory of this source tree.
42
+ */var n=a(138),r=a(0);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s="function"==typeof Symbol&&Symbol.for,o=s?Symbol.for("react.portal"):60106,l=s?Symbol.for("react.fragment"):60107,c=s?Symbol.for("react.strict_mode"):60108,u=s?Symbol.for("react.profiler"):60114,p=s?Symbol.for("react.provider"):60109,d=s?Symbol.for("react.context"):60110,m=s?Symbol.for("react.concurrent_mode"):60111,h=s?Symbol.for("react.forward_ref"):60112,f=s?Symbol.for("react.suspense"):60113,g=s?Symbol.for("react.suspense_list"):60120,v=s?Symbol.for("react.memo"):60115,b=s?Symbol.for("react.lazy"):60116,_=s?Symbol.for("react.fundamental"):60117,y=s?Symbol.for("react.scope"):60119,w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case l:return"Fragment";case o:return"Portal";case u:return"Profiler";case c:return"StrictMode";case f:return"Suspense";case g:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case d:return"Context.Consumer";case p:return"Context.Provider";case h:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case v:return E(e.type);case b:if(e=1===e._status?e._result:null)return E(e)}return null}w.hasOwnProperty("ReactCurrentDispatcher")||(w.ReactCurrentDispatcher={current:null}),w.hasOwnProperty("ReactCurrentBatchConfig")||(w.ReactCurrentBatchConfig={suspense:null});var k={};function I(e,t){for(var a=0|e._threadCount;a<=t;a++)e[a]=e._currentValue2,e._threadCount=a+1}for(var S=new Uint16Array(16),C=0;15>C;C++)S[C]=C+1;S[15]=0;var N=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,x=Object.prototype.hasOwnProperty,T={},R={};function P(e){return!!x.call(R,e)||!x.call(T,e)&&(N.test(e)?R[e]=!0:(T[e]=!0,!1))}function O(e,t,a,n,r,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=r,this.mustUseProperty=a,this.propertyName=e,this.type=t,this.sanitizeURL=i}var D={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){D[e]=new O(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];D[t]=new O(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){D[e]=new O(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){D[e]=new O(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){D[e]=new O(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){D[e]=new O(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){D[e]=new O(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){D[e]=new O(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){D[e]=new O(e,5,!1,e.toLowerCase(),null,!1)}));var A=/[\-:]([a-z])/g;function q(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(A,q);D[t]=new O(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(A,q);D[t]=new O(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(A,q);D[t]=new O(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){D[e]=new O(e,1,!1,e.toLowerCase(),null,!1)})),D.xlinkHref=new O("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){D[e]=new O(e,1,!1,e.toLowerCase(),null,!0)}));var L=/["'&<>]/;function F(e){if("boolean"==typeof e||"number"==typeof e)return""+e;e=""+e;var t=L.exec(e);if(t){var a,n="",r=0;for(a=t.index;a<e.length;a++){switch(e.charCodeAt(a)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}r!==a&&(n+=e.substring(r,a)),r=a+1,n+=t}e=r!==a?n+e.substring(r,a):n}return e}function j(e,t){var a,n=D.hasOwnProperty(e)?D[e]:null;return(a="style"!==e)&&(a=null!==n?0===n.type:2<e.length&&("o"===e[0]||"O"===e[0])&&("n"===e[1]||"N"===e[1])),a||function(e,t,a,n){if(null==t||function(e,t,a,n){if(null!==a&&0===a.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==a?!a.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,a,n))return!0;if(n)return!1;if(null!==a)switch(a.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(e,t,n,!1)?"":null!==n?(e=n.attributeName,3===(a=n.type)||4===a&&!0===t?e+'=""':(n.sanitizeURL&&(t=""+t),e+'="'+F(t)+'"')):P(e)?e+'="'+F(t)+'"':""}var M="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},V=null,B=null,z=null,U=!1,$=!1,W=null,H=0;function K(){if(null===V)throw Error(i(321));return V}function G(){if(0<H)throw Error(i(312));return{memoizedState:null,queue:null,next:null}}function Y(){return null===z?null===B?(U=!1,B=z=G()):(U=!0,z=B):null===z.next?(U=!1,z=z.next=G()):(U=!0,z=z.next),z}function J(e,t,a,n){for(;$;)$=!1,H+=1,z=null,a=e(t,n);return B=V=null,H=0,z=W=null,a}function Q(e,t){return"function"==typeof t?t(e):t}function Z(e,t,a){if(V=K(),z=Y(),U){var n=z.queue;if(t=n.dispatch,null!==W&&void 0!==(a=W.get(n))){W.delete(n),n=z.memoizedState;do{n=e(n,a.action),a=a.next}while(null!==a);return z.memoizedState=n,[n,t]}return[z.memoizedState,t]}return e=e===Q?"function"==typeof t?t():t:void 0!==a?a(t):t,z.memoizedState=e,e=(e=z.queue={last:null,dispatch:null}).dispatch=X.bind(null,V,e),[z.memoizedState,e]}function X(e,t,a){if(!(25>H))throw Error(i(301));if(e===V)if($=!0,e={action:a,next:null},null===W&&(W=new Map),void 0===(a=W.get(t)))W.set(t,e);else{for(t=a;null!==t.next;)t=t.next;t.next=e}}function ee(){}var te=0,ae={readContext:function(e){var t=te;return I(e,t),e[t]},useContext:function(e){K();var t=te;return I(e,t),e[t]},useMemo:function(e,t){if(V=K(),t=void 0===t?null:t,null!==(z=Y())){var a=z.memoizedState;if(null!==a&&null!==t){e:{var n=a[1];if(null===n)n=!1;else{for(var r=0;r<n.length&&r<t.length;r++)if(!M(t[r],n[r])){n=!1;break e}n=!0}}if(n)return a[0]}}return e=e(),z.memoizedState=[e,t],e},useReducer:Z,useRef:function(e){V=K();var t=(z=Y()).memoizedState;return null===t?(e={current:e},z.memoizedState=e):t},useState:function(e){return Z(Q,e)},useLayoutEffect:function(){},useCallback:function(e){return e},useImperativeHandle:ee,useEffect:ee,useDebugValue:ee,useResponder:function(e,t){return{props:t,responder:e}},useDeferredValue:function(e){return K(),e},useTransition:function(){return K(),[function(e){e()},!1]}},ne={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function re(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var ie={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},se=n({menuitem:!0},ie),oe={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},le=["Webkit","ms","Moz","O"];Object.keys(oe).forEach((function(e){le.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),oe[t]=oe[e]}))}));var ce=/([A-Z])/g,ue=/^ms-/,pe=r.Children.toArray,de=w.ReactCurrentDispatcher,me={listing:!0,pre:!0,textarea:!0},he=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,fe={},ge={};var ve=Object.prototype.hasOwnProperty,be={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function _e(e,t){if(void 0===e)throw Error(i(152,E(t)||"Component"))}function ye(e,t,a){function s(r,s){var o=s.prototype&&s.prototype.isReactComponent,l=function(e,t,a,n){if(n&&("object"==typeof(n=e.contextType)&&null!==n))return I(n,a),n[a];if(e=e.contextTypes){for(var r in a={},e)a[r]=t[r];t=a}else t=k;return t}(s,t,a,o),c=[],u=!1,p={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===c)return null},enqueueReplaceState:function(e,t){u=!0,c=[t]},enqueueSetState:function(e,t){if(null===c)return null;c.push(t)}};if(o){if(o=new s(r.props,l,p),"function"==typeof s.getDerivedStateFromProps){var d=s.getDerivedStateFromProps.call(null,r.props,o.state);null!=d&&(o.state=n({},o.state,d))}}else if(V={},o=s(r.props,l,p),null==(o=J(s,r.props,o,l))||null==o.render)return void _e(e=o,s);if(o.props=r.props,o.context=l,o.updater=p,void 0===(p=o.state)&&(o.state=p=null),"function"==typeof o.UNSAFE_componentWillMount||"function"==typeof o.componentWillMount)if("function"==typeof o.componentWillMount&&"function"!=typeof s.getDerivedStateFromProps&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&"function"!=typeof s.getDerivedStateFromProps&&o.UNSAFE_componentWillMount(),c.length){p=c;var m=u;if(c=null,u=!1,m&&1===p.length)o.state=p[0];else{d=m?p[0]:o.state;var h=!0;for(m=m?1:0;m<p.length;m++){var f=p[m];null!=(f="function"==typeof f?f.call(o,d,r.props,l):f)&&(h?(h=!1,d=n({},d,f)):n(d,f))}o.state=d}}else c=null;if(_e(e=o.render(),s),"function"==typeof o.getChildContext&&"object"==typeof(r=s.childContextTypes)){var g=o.getChildContext();for(var v in g)if(!(v in r))throw Error(i(108,E(s)||"Unknown",v))}g&&(t=n({},t,g))}for(;r.isValidElement(e);){var o=e,l=o.type;if("function"!=typeof l)break;s(o,l)}return{child:e,context:t}}var we=function(){function e(e,t){r.isValidElement(e)?e.type!==l?e=[e]:(e=e.props.children,e=r.isValidElement(e)?[e]:pe(e)):e=pe(e),e={type:null,domNamespace:ne.html,children:e,childIndex:0,context:k,footer:""};var a=S[0];if(0===a){var n=S,s=2*(a=n.length);if(!(65536>=s))throw Error(i(304));var o=new Uint16Array(s);for(o.set(n),(S=o)[0]=a+1,n=a;n<s-1;n++)S[n]=n+1;S[s-1]=0}else S[0]=S[a];this.threadID=a,this.stack=[e],this.exhausted=!1,this.currentSelectValue=null,this.previousWasTextNode=!1,this.makeStaticMarkup=t,this.suspenseDepth=0,this.contextIndex=-1,this.contextStack=[],this.contextValueStack=[]}var t=e.prototype;return t.destroy=function(){if(!this.exhausted){this.exhausted=!0,this.clearProviders();var e=this.threadID;S[e]=S[0],S[0]=e}},t.pushProvider=function(e){var t=++this.contextIndex,a=e.type._context,n=this.threadID;I(a,n);var r=a[n];this.contextStack[t]=a,this.contextValueStack[t]=r,a[n]=e.props.value},t.popProvider=function(){var e=this.contextIndex,t=this.contextStack[e],a=this.contextValueStack[e];this.contextStack[e]=null,this.contextValueStack[e]=null,this.contextIndex--,t[this.threadID]=a},t.clearProviders=function(){for(var e=this.contextIndex;0<=e;e--)this.contextStack[e][this.threadID]=this.contextValueStack[e]},t.read=function(e){if(this.exhausted)return null;var t=te;te=this.threadID;var a=de.current;de.current=ae;try{for(var n=[""],r=!1;n[0].length<e;){if(0===this.stack.length){this.exhausted=!0;var s=this.threadID;S[s]=S[0],S[0]=s;break}var o=this.stack[this.stack.length-1];if(r||o.childIndex>=o.children.length){var l=o.footer;if(""!==l&&(this.previousWasTextNode=!1),this.stack.pop(),"select"===o.type)this.currentSelectValue=null;else if(null!=o.type&&null!=o.type.type&&o.type.type.$$typeof===p)this.popProvider(o.type);else if(o.type===f){this.suspenseDepth--;var c=n.pop();if(r){r=!1;var u=o.fallbackFrame;if(!u)throw Error(i(303));this.stack.push(u),n[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}n[this.suspenseDepth]+=c}n[this.suspenseDepth]+=l}else{var d=o.children[o.childIndex++],m="";try{m+=this.render(d,o.context,o.domNamespace)}catch(e){if(null!=e&&"function"==typeof e.then)throw Error(i(294));throw e}n.length<=this.suspenseDepth&&n.push(""),n[this.suspenseDepth]+=m}}return n[0]}finally{de.current=a,te=t}},t.render=function(e,t,a){if("string"==typeof e||"number"==typeof e)return""===(a=""+e)?"":this.makeStaticMarkup?F(a):this.previousWasTextNode?"\x3c!-- --\x3e"+F(a):(this.previousWasTextNode=!0,F(a));if(e=(t=ye(e,t,this.threadID)).child,t=t.context,null===e||!1===e)return"";if(!r.isValidElement(e)){if(null!=e&&null!=e.$$typeof){if((a=e.$$typeof)===o)throw Error(i(257));throw Error(i(258,a.toString()))}return e=pe(e),this.stack.push({type:null,domNamespace:a,children:e,childIndex:0,context:t,footer:""}),""}var s=e.type;if("string"==typeof s)return this.renderDOM(e,t,a);switch(s){case c:case m:case u:case g:case l:return e=pe(e.props.children),this.stack.push({type:null,domNamespace:a,children:e,childIndex:0,context:t,footer:""}),"";case f:throw Error(i(294))}if("object"==typeof s&&null!==s)switch(s.$$typeof){case h:V={};var w=s.render(e.props,e.ref);return w=J(s.render,e.props,w,e.ref),w=pe(w),this.stack.push({type:null,domNamespace:a,children:w,childIndex:0,context:t,footer:""}),"";case v:return e=[r.createElement(s.type,n({ref:e.ref},e.props))],this.stack.push({type:null,domNamespace:a,children:e,childIndex:0,context:t,footer:""}),"";case p:return a={type:e,domNamespace:a,children:s=pe(e.props.children),childIndex:0,context:t,footer:""},this.pushProvider(e),this.stack.push(a),"";case d:s=e.type,w=e.props;var E=this.threadID;return I(s,E),s=pe(w.children(s[E])),this.stack.push({type:e,domNamespace:a,children:s,childIndex:0,context:t,footer:""}),"";case _:throw Error(i(338));case b:switch(function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(s=e.type),s._status){case 1:return e=[r.createElement(s._result,n({ref:e.ref},e.props))],this.stack.push({type:null,domNamespace:a,children:e,childIndex:0,context:t,footer:""}),"";case 2:throw s._result;default:throw Error(i(295))}case y:throw Error(i(343))}throw Error(i(130,null==s?s:typeof s,""))},t.renderDOM=function(e,t,a){var s=e.type.toLowerCase();if(a===ne.html&&re(s),!fe.hasOwnProperty(s)){if(!he.test(s))throw Error(i(65,s));fe[s]=!0}var o=e.props;if("input"===s)o=n({type:void 0},o,{defaultChecked:void 0,defaultValue:void 0,value:null!=o.value?o.value:o.defaultValue,checked:null!=o.checked?o.checked:o.defaultChecked});else if("textarea"===s){var l=o.value;if(null==l){l=o.defaultValue;var c=o.children;if(null!=c){if(null!=l)throw Error(i(92));if(Array.isArray(c)){if(!(1>=c.length))throw Error(i(93));c=c[0]}l=""+c}null==l&&(l="")}o=n({},o,{value:void 0,children:""+l})}else if("select"===s)this.currentSelectValue=null!=o.value?o.value:o.defaultValue,o=n({},o,{value:void 0});else if("option"===s){c=this.currentSelectValue;var u=function(e){if(null==e)return e;var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(o.children);if(null!=c){var p=null!=o.value?o.value+"":u;if(l=!1,Array.isArray(c)){for(var d=0;d<c.length;d++)if(""+c[d]===p){l=!0;break}}else l=""+c===p;o=n({selected:void 0,children:void 0},o,{selected:l,children:u})}}if(l=o){if(se[s]&&(null!=l.children||null!=l.dangerouslySetInnerHTML))throw Error(i(137,s,""));if(null!=l.dangerouslySetInnerHTML){if(null!=l.children)throw Error(i(60));if(!("object"==typeof l.dangerouslySetInnerHTML&&"__html"in l.dangerouslySetInnerHTML))throw Error(i(61))}if(null!=l.style&&"object"!=typeof l.style)throw Error(i(62,""))}for(y in l=o,c=this.makeStaticMarkup,u=1===this.stack.length,p="<"+e.type,l)if(ve.call(l,y)){var m=l[y];if(null!=m){if("style"===y){d=void 0;var h="",f="";for(d in m)if(m.hasOwnProperty(d)){var g=0===d.indexOf("--"),v=m[d];if(null!=v){if(g)var b=d;else if(b=d,ge.hasOwnProperty(b))b=ge[b];else{var _=b.replace(ce,"-$1").toLowerCase().replace(ue,"-ms-");b=ge[b]=_}h+=f+b+":",f=d,h+=g=null==v||"boolean"==typeof v||""===v?"":g||"number"!=typeof v||0===v||oe.hasOwnProperty(f)&&oe[f]?(""+v).trim():v+"px",f=";"}}m=h||null}d=null;e:if(g=s,v=l,-1===g.indexOf("-"))g="string"==typeof v.is;else switch(g){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":g=!1;break e;default:g=!0}g?be.hasOwnProperty(y)||(d=P(d=y)&&null!=m?d+'="'+F(m)+'"':""):d=j(y,m),d&&(p+=" "+d)}}c||u&&(p+=' data-reactroot=""');var y=p;l="",ie.hasOwnProperty(s)?y+="/>":(y+=">",l="</"+e.type+">");e:{if(null!=(c=o.dangerouslySetInnerHTML)){if(null!=c.__html){c=c.__html;break e}}else if("string"==typeof(c=o.children)||"number"==typeof c){c=F(c);break e}c=null}return null!=c?(o=[],me[s]&&"\n"===c.charAt(0)&&(y+="\n"),y+=c):o=pe(o.children),e=e.type,a=null==a||"http://www.w3.org/1999/xhtml"===a?re(e):"http://www.w3.org/2000/svg"===a&&"foreignObject"===e?"http://www.w3.org/1999/xhtml":a,this.stack.push({domNamespace:a,type:s,children:o,childIndex:0,context:t,footer:l}),this.previousWasTextNode=!1,y},e}(),Ee={renderToString:function(e){e=new we(e,!1);try{return e.read(1/0)}finally{e.destroy()}},renderToStaticMarkup:function(e){e=new we(e,!0);try{return e.read(1/0)}finally{e.destroy()}},renderToNodeStream:function(){throw Error(i(207))},renderToStaticNodeStream:function(){throw Error(i(208))},version:"16.12.0"},ke={default:Ee},Ie=ke&&Ee||ke;e.exports=Ie.default||Ie},574:function(e,t,a){e.exports=a(575)},575:function(e,t,a){a(576);var n=a(26);e.exports=n.Date.now},576:function(e,t,a){a(17)({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}})},589:function(e,t,a){e.exports=a(298)},590:function(e,t,a){e.exports=a(591)},591:function(e,t,a){e.exports=a(470)},592:function(e,t,a){var n=a(477),r=a(593);e.exports=function(e,t){if(null==e)return{};var a,i,s={},o=r(e);for(i=0;i<o.length;i++)a=o[i],n(t).call(t,a)>=0||(s[a]=e[a]);return s}},593:function(e,t,a){e.exports=a(594)},594:function(e,t,a){e.exports=a(303)},595:function(e,t,a){e.exports=a(596)},596:function(e,t,a){var n=a(597),r=Array.prototype;e.exports=function(e){var t=e.sort;return e===r||e instanceof Array&&t===r.sort?n:t}},597:function(e,t,a){a(598);var n=a(43);e.exports=n("Array").sort},598:function(e,t,a){"use strict";var n=a(17),r=a(72),i=a(53),s=a(33),o=a(110),l=[].sort,c=[1,2,3],u=s((function(){c.sort(void 0)})),p=s((function(){c.sort(null)})),d=o("sort");n({target:"Array",proto:!0,forced:u||!p||d},{sort:function(e){return void 0===e?l.call(i(this)):l.call(i(this),r(e))}})},60:function(e,t,a){e.exports=a(568)},607:function(e,t,a){e.exports=a(608)},608:function(e,t,a){a(609);var n=a(26);e.exports=n.Number.isFinite},609:function(e,t,a){a(17)({target:"Number",stat:!0},{isFinite:a(610)})},610:function(e,t,a){var n=a(32).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&n(e)}},615:function(e,t,a){e.exports=a(616)},616:function(e,t,a){var n=a(617),r=Array.prototype;e.exports=function(e){var t=e.slice;return e===r||e instanceof Array&&t===r.slice?n:t}},617:function(e,t,a){a(618);var n=a(43);e.exports=n("Array").slice},618:function(e,t,a){"use strict";var n=a(17),r=a(42),i=a(94),s=a(109),o=a(58),l=a(52),c=a(112),u=a(103),p=a(34)("species"),d=[].slice,m=Math.max;n({target:"Array",proto:!0,forced:!u("slice")},{slice:function(e,t){var a,n,u,h=l(this),f=o(h.length),g=s(e,f),v=s(void 0===t?f:t,f);if(i(h)&&("function"!=typeof(a=h.constructor)||a!==Array&&!i(a.prototype)?r(a)&&null===(a=a[p])&&(a=void 0):a=void 0,a===Array||void 0===a))return d.call(h,g,v);for(n=new(void 0===a?Array:a)(m(v-g,0)),u=0;g<v;g++,u++)g in h&&c(n,u,h[g]);return n.length=u,n}})},619:function(e,t,a){e.exports=a(620)},620:function(e,t,a){var n=a(621),r=Array.prototype;e.exports=function(e){var t=e.fill;return e===r||e instanceof Array&&t===r.fill?n:t}},621:function(e,t,a){a(622);var n=a(43);e.exports=n("Array").fill},622:function(e,t,a){var n=a(17),r=a(623),i=a(111);n({target:"Array",proto:!0},{fill:r}),i("fill")},623:function(e,t,a){"use strict";var n=a(53),r=a(109),i=a(58);e.exports=function(e){for(var t=n(this),a=i(t.length),s=arguments.length,o=r(s>1?arguments[1]:void 0,a),l=s>2?arguments[2]:void 0,c=void 0===l?a:r(l,a);c>o;)t[o++]=e;return t}},624:function(e,t){jQuery.AsyncQueue=function(){var e,t,a,n,r=this,s=[],o=!1;return n=function(){var e=s.shift();e?(e.apply(r,[r]),!1===o&&n()):t&&t.apply(r)},this.onFailure=function(t){e=t},this.onComplete=function(e){t=e},this.add=function(e){return s.push(e),this},this.storeData=function(e){return a=e,this},this.lastCallbackData=function(){return a},this.run=function(){o=!1,n()},this.pause=function(){return o=!0,this},this.failure=function(){if(o=!0,e){var t=[r];for(i=0;i<arguments.length;i++)t.push(arguments[i]);e.apply(r,t)}},this}},625:function(e,t,a){e.exports=a(626)},626:function(e,t,a){a(627);var n=a(26);e.exports=n.Object.values},627:function(e,t,a){var n=a(17),r=a(473).values;n({target:"Object",stat:!0},{values:function(e){return r(e)}})},648:function(e,t,a){"use strict";a.r(t);var n=a(95),r=a.n(n),i=a(96),s=a.n(i),o=a(69),l=a.n(o),c=a(24),u=a.n(c),p=a(70),d=a.n(p),m=a(18),h=a.n(m),f=a(71),g=a.n(f),v=a(28),b=a.n(v),_=a(8),y=a.n(_),w=a(15),E=a.n(w),k=a(61),I=a.n(k),S=a(29),C=a.n(S),N=a(7),x=a.n(N),T=a(0),R=a.n(T),P=a(3),O=a.n(P),D=a(25),A=a.n(D),q=a(1),L=a(9),F=a.n(L),j=a(11),M=a.n(j),V=a(10),B=a.n(V),z=a(12),U=a.n(z),$=a(13),W=a.n($),H=a(6),K=a.n(H),G=a(14),Y=a.n(G),J=a(64),Q=a(2),Z=a.n(Q);function X(e){var t=[{name:"type",label:q.a.I18n.t("selectType")},{name:"events",label:q.a.I18n.t("events")},{name:"conditions",label:q.a.I18n.t("conditions")},{name:"template",label:q.a.I18n.t("template")},{name:"editor",label:q.a.I18n.t("designer")},{name:"send",label:q.a.I18n.t("send")}];return R.a.createElement(J.a,{step:e.step,steps:t})}X.propTypes={step:Z.a.string.isRequired};var ee=X,te=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this.props.event,a=t.soon;if(this.props.premium)e=R.a.createElement("a",{href:"?page=mailpoet-premium",target:"_blank"},q.a.I18n.t("premiumFeatureLink"));else if(t.actionButtonLink&&t.actionButtonTitle)e=R.a.createElement("a",{href:t.actionButtonLink,target:"_blank",rel:"noopener noreferrer"},t.actionButtonTitle);else{var n=a?null:O.a.partial(this.props.eventsConfigurator,t.slug);e=R.a.createElement("a",{className:"button button-primary",disabled:a,onClick:n,role:"presentation","data-automation-id":"create_".concat(t.slug),onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),n())}},t.actionButtonTitle||q.a.I18n.t("setUp"))}return R.a.createElement("li",{"data-type":t.slug},R.a.createElement("div",{className:"mailpoet_thumbnail"},t.thumbnailImage?R.a.createElement("img",{src:t.thumbnailImage,alt:""}):null),R.a.createElement("div",{className:"mailpoet_boxes_content"},R.a.createElement("div",{className:"mailpoet_description"},R.a.createElement("div",{className:"title_and_badge"},R.a.createElement("h3",null,t.title," ",t.soon?"(".concat(q.a.I18n.t("soon"),")"):""),t.badge?R.a.createElement("span",{className:"mailpoet_badge mailpoet_badge_".concat(t.badge.style)},t.badge.text):""),R.a.createElement("p",null,t.description)),R.a.createElement("div",{className:"mailpoet_actions"},e)))}}]),t}(R.a.PureComponent);te.defaultProps={premium:!1},te.propTypes={premium:Z.a.bool,eventsConfigurator:Z.a.func.isRequired,event:Z.a.shape({slug:Z.a.string.isRequired,thumbnailImage:Z.a.string,actionButtonLink:Z.a.string,title:Z.a.string.isRequired,soon:Z.a.bool,badge:Z.a.shape({style:Z.a.string,text:Z.a.string}),description:Z.a.string.isRequired,actionButtonTitle:Z.a.string}).isRequired};var ae=te,ne=a(105),re=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).email=n.props.email,n.emailEvents=n.email.events,n.eventsConfigurator=F()(a=n.eventsConfigurator).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"eventsConfigurator",value:function(e){var t;q.a.trackEvent("Emails > Automatic Type selected",{"MailPoet Free version":window.mailpoet_version,"MailPoet Premium version":window.mailpoet_premium_version,"Email type":e}),this.props.history.push(E()(t="/new/".concat(this.email.slug,"/")).call(t,e,"/conditions"))}},{key:"displayEvents",value:function(){var e=this,t=x()(O.a).call(O.a,this.emailEvents,(function(t,a){return R.a.createElement(ae,{premium:e.email.premium,event:t,key:a,eventsConfigurator:e.eventsConfigurator})}));return R.a.createElement("ul",{className:"mailpoet_boxes woocommerce clearfix"},t)}},{key:"render",value:function(){var e=q.a.I18n.t("selectAutomaticEmailsEventsHeading").replace("%$1s",this.email.title);return R.a.createElement("div",null,R.a.createElement("h1",null,e),R.a.createElement(ee,{step:"events"}),this.displayEvents())}}]),t}(R.a.Component);re.propTypes={email:Z.a.shape({title:Z.a.string.isRequired,slug:Z.a.string.isRequired,premium:Z.a.bool}).isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var ie=Object(ne.withRouter)(re),se=a(30),oe=a.n(se),le=a(40),ce=a.n(le),ue=a(50),pe=a.n(ue),de=a(35),me=a.n(de),he=a(319),fe=a.n(he),ge=a(4),ve=a.n(ge),be=a(39),_e=a.n(be),ye=(a(456),function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"getFieldId",(function(e){var t=e||a.props;return t.field.id||t.field.name})),y()(K()(a),"getSelectedValues",(function(){if(void 0!==a.props.field.selected)return a.props.field.selected(a.props.item);if(void 0!==a.props.item&&void 0!==a.props.field.name){if(!a.allowMultipleValues())return a.props.item[a.props.field.name];var e;if(O.a.isArray(a.props.item[a.props.field.name]))return x()(e=a.props.item[a.props.field.name]).call(e,(function(e){return e.id}))}return null})),y()(K()(a),"getItems",(function(){var e;return void 0!==window["mailpoet_".concat(a.props.field.endpoint)]?e=window["mailpoet_".concat(a.props.field.endpoint)]:void 0!==ce()(a.props.field)&&(e=ce()(a.props.field)),O.a.isArray(e)&&void 0!==h()(a.props.field)&&(e=h()(e).call(e,h()(a.props.field))),e})),y()(K()(a),"getLabel",(function(e){return void 0!==a.props.field.getLabel?a.props.field.getLabel(e,a.props.item):e.name})),y()(K()(a),"getSearchLabel",(function(e){return void 0!==a.props.field.getSearchLabel?a.props.field.getSearchLabel(e,a.props.item):null})),y()(K()(a),"getValue",(function(e){return void 0!==a.props.field.getValue?a.props.field.getValue(e,a.props.item):e.id})),y()(K()(a),"setupSelect2",(function(){if(!a.isSelect2Initialized()){var e={disabled:a.props.disabled||!1,width:a.props.width||"",placeholder:{id:"",text:a.props.field.placeholder},templateResult:function(e){return e.element&&e.element.selected?null:e.title?e.title:e.text}},t=a.props.field.remoteQuery||null;t&&(e=fe()(e,{ajax:{url:window.ajaxurl,type:"POST",dataType:"json",data:function(e){return{action:"mailpoet",api_version:window.mailpoet_api_version,token:window.mailpoet_token,endpoint:t.endpoint,method:t.method,data:fe()(t.data,{query:e.term})}},processResults:function(e){var t,a;O.a.has(e,"data")?t=x()(a=e.data).call(a,(function(e){return{id:e.id||e.value,text:e.name||e.text}})):t=[];return{results:t}}},minimumInputLength:t.minimumInputLength||2})),void 0!==a.props.field.extendSelect2Options&&(e=fe()(e,a.props.field.extendSelect2Options));var n=ve()("#".concat(a.selectRef.current.id)).select2(e),r=!1;n.on("select2:unselecting",(function(){r=!0})),n.on("select2:opening",(function(e){!0===r&&(r=!1,e.preventDefault())})),n.on("change",a.handleChange)}})),y()(K()(a),"resetSelect2",(function(){a.destroySelect2(),a.setupSelect2()})),y()(K()(a),"destroySelect2",(function(){a.isSelect2Initialized()&&(ve()("#".concat(a.selectRef.current.id)).select2("destroy"),a.cleanupAfterSelect2())})),y()(K()(a),"cleanupAfterSelect2",(function(){var e;me()(e=ve()("#".concat(a.selectRef.current.id))).call(e,"option:not(.default)").remove(),ve()("#".concat(a.selectRef.current.id)).off("select2:unselecting").off("select2:opening")})),y()(K()(a),"allowMultipleValues",(function(){return!0===a.props.field.multiple})),y()(K()(a),"isSelect2Initialized",(function(){return!0===ve()("#".concat(a.selectRef.current.id)).hasClass("select2-hidden-accessible")})),y()(K()(a),"isSelect2Component",(function(){return a.allowMultipleValues()||a.props.field.forceSelect2})),y()(K()(a),"handleChange",(function(e){var t;if(void 0!==a.props.onValueChange){var n=x()(t=ve()("#".concat(a.selectRef.current.id)).children(":selected")).call(t,(function(){return{id:ve()(this).val(),text:ve()(this).text()}})),r=a.props.field.multiple?O.a.pluck(n,"id"):O.a.pluck(n,"id").toString(),i=a.transformChangedValue(r,n);a.props.onValueChange({target:{value:i,name:a.props.field.name,id:e.target.id}})}})),y()(K()(a),"transformChangedValue",(function(e,t){return"function"==typeof a.props.field.transformChangedValue?a.props.field.transformChangedValue.call(K()(a),e,t):e})),y()(K()(a),"insertEmptyOption",(function(){if(!a.allowMultipleValues())return a.props.field.placeholder?R.a.createElement("option",{className:"default"}):void 0})),a.selectRef=R.a.createRef(),a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){this.isSelect2Component()&&this.setupSelect2()}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.item&&void 0!==e.item&&this.props.item.id!==e.item.id&&ve()("#".concat(this.selectRef.current.id)).val(this.getSelectedValues()).trigger("change"),this.isSelect2Initialized()&&this.getFieldId(this.props)!==this.getFieldId(e)&&void 0!==this.props.field.resetSelect2OnUpdate&&this.resetSelect2()}},{key:"componentWillUnmount",value:function(){this.isSelect2Component()&&this.destroySelect2()}},{key:"render",value:function(){var e=this,t=this.getItems(this.props.field),a=this.getSelectedValues(),n=x()(t).call(t,(function(t){var a=e.getLabel(t),n=e.getSearchLabel(t),r=e.getValue(t);return R.a.createElement("option",{key:"option-".concat(t.id),className:"default",value:r,title:n},a)}));return R.a.createElement("select",pe()({id:this.getFieldId(),ref:this.selectRef,disabled:this.props.field.disabled,"data-placeholder":this.props.field.placeholder,multiple:this.props.field.multiple,defaultValue:a},this.props.field.validation),this.insertEmptyOption(),n)}}]),t}(R.a.Component));ye.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.oneOfType([Z.a.object,Z.a.array]),getLabel:Z.a.func,resetSelect2OnUpdate:Z.a.bool,selected:Z.a.func,endpoint:Z.a.string,filter:Z.a.func,getSearchLabel:Z.a.func,getValue:Z.a.func,placeholder:Z.a.string,remoteQuery:Z.a.object,extendSelect2Options:Z.a.object,multiple:Z.a.bool,forceSelect2:Z.a.bool,transformChangedValue:Z.a.func,disabled:Z.a.bool,validation:Z.a.object}).isRequired,item:Z.a.object,disabled:Z.a.bool,width:Z.a.string},ye.defaultProps={onValueChange:function(){},disabled:!1,width:"",item:void 0};var we=ye,Ee=a(114),ke=a.n(Ee),Ie=a(23),Se=a.n(Ie),Ce=a(21),Ne=a.n(Ce),xe=a(480),Te=a.n(xe),Re=a(60),Pe=a.n(Re),Oe=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t,a=this.props.field.name||null,n=this.props.item||{};this.props.onValueChange instanceof Function&&(e=void 0===(e=n[this.props.field.name])?this.props.field.defaultValue||"":e),!e&&this.props.field.defaultValue&&(t=this.props.field.defaultValue);var r=this.props.field.id||null;!r&&this.props.field.name&&(r="field_".concat(this.props.field.name));var i=this.props.field.class||null;return i||this.props.field.size||(i="regular-text"),R.a.createElement("input",pe()({type:"text",disabled:void 0!==this.props.field.disabled&&this.props.field.disabled(this.props.item),className:i,size:"auto"!==this.props.field.size&&this.props.field.size>0?this.props.field.size:null,name:a,id:r,value:e,defaultValue:t,placeholder:this.props.field.placeholder,onChange:this.props.onValueChange},this.props.field.validation))}}]),t}(R.a.Component);Oe.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,defaultValue:Z.a.string,id:Z.a.string,class:Z.a.string,size:Z.a.oneOfType([Z.a.string,Z.a.number]),disabled:Z.a.func,placeholder:Z.a.string,validation:Z.a.object}).isRequired,item:Z.a.object.isRequired},Oe.defaultProps={onValueChange:function(){}};var De=Oe,Ae=window.mailpoet_time_format||"H:i",qe={immediate:q.a.I18n.t("delayImmediately"),hours:q.a.I18n.t("delayHoursAfter"),days:q.a.I18n.t("delayDaysAfter"),weeks:q.a.I18n.t("delayWeeksAfter")},Le={daily:q.a.I18n.t("daily"),weekly:q.a.I18n.t("weekly"),monthly:q.a.I18n.t("monthly"),nthWeekDay:q.a.I18n.t("monthlyEvery"),immediately:q.a.I18n.t("immediately")},Fe=O.a.object(x()(O.a).call(O.a,O.a.times(24,(function(e){return 3600*e})),(function(e){var t=new Date(null);return t.setSeconds(e),[e,q.a.Date.format(t,{format:Ae,offset:0})]}))),je={0:q.a.I18n.t("sunday"),1:q.a.I18n.t("monday"),2:q.a.I18n.t("tuesday"),3:q.a.I18n.t("wednesday"),4:q.a.I18n.t("thursday"),5:q.a.I18n.t("friday"),6:q.a.I18n.t("saturday")},Me=O.a.object(x()(O.a).call(O.a,O.a.times(28,(function(e){return e})),(function(e){var t={0:q.a.I18n.t("first"),1:q.a.I18n.t("second"),2:q.a.I18n.t("third")};return[e+1,void 0!==t[e]?t[e]:q.a.I18n.t("nth").replace("%$1d",e+1)]}))),Ve={1:q.a.I18n.t("first"),2:q.a.I18n.t("second"),3:q.a.I18n.t("third"),L:q.a.I18n.t("last")},Be="immediate",ze=1,Ue=30,$e=function(e){function t(e){var a,n;M()(this,t);var r=(n=U()(this,W()(t).call(this,e))).props,i=r.item,s=r.event;n.handleChange=F()(a=n.handleChange).call(a,K()(n));var o=i.afterTimeType||s.defaultAfterTimeType||Be,l="minutes"===o?Ue:ze,c=i.afterTimeNumber||l;return n.state={afterTimeType:o,afterTimeNumber:c},i.afterTimeNumber===c&&i.afterTimeType===o||n.propagateChange(n.state),n}return Y()(t,e),B()(t,[{key:"displayAfterTimeNumberField",value:function(){var e=this.props,t=e.afterTimeNumberSize,a=e.event,n=this.state,r=n.afterTimeType,i=n.afterTimeNumber;if("immediate"===r)return null;if(a.timeDelayValues&&a.timeDelayValues[r]&&!a.timeDelayValues[r].displayAfterTimeNumberField)return null;var s={field:{id:"scheduling_time_duration",name:"scheduling_time_duration",defaultValue:i?i.toString():"",size:t},item:{},onValueChange:O.a.partial(this.handleChange,O.a,"afterTimeNumber")};return R.a.createElement(De,{field:s.field,item:s.item,onValueChange:s.onValueChange})}},{key:"displayAfterTimeTypeOptions",value:function(){var e,t=this.props.event,a=qe;t.timeDelayValues&&(a=Pe()(e=Te()(t.timeDelayValues)).call(e,(function(e,t){var a=Ne()(t,2),n=a[0],r=a[1];return e[n]=r.text,e}),{}));var n=this.state.afterTimeType,r={field:{id:"scheduling_time_interval",name:"scheduling_time_interval",forceSelect2:!0,values:x()(O.a).call(O.a,a,(function(e,t){return{name:e,id:t}})),extendSelect2Options:{minimumResultsForSearch:1/0},selected:function(){return n}},onValueChange:O.a.partial(this.handleChange,O.a,"afterTimeType")};return R.a.createElement(we,{field:r.field,onValueChange:r.onValueChange})}},{key:"handleChange",value:function(e,t){var a=e.target.value;"afterTimeNumber"===t&&(a=Se()(e.target.value,10),a=ke()(a)?null:a);var n=y()({},t,a),r=this.state.afterTimeType;"afterTimeType"===t&&r!==a&&("minutes"===r&&(n.afterTimeNumber=ze),"minutes"===a&&(n.afterTimeNumber=Ue)),this.setState(n,this.propagateChange(n))}},{key:"propagateChange",value:function(e){var t=this.props.onValueChange;t&&t(e)}},{key:"render",value:function(){var e=this.props.event;return R.a.createElement(R.a.Fragment,null,R.a.createElement("div",{className:"event-scheduling-time-duration-selection"},this.displayAfterTimeNumberField()),R.a.createElement("div",{className:"event-scheduling-time-interval-selection"},this.displayAfterTimeTypeOptions()),e.schedulingReadMoreLink&&R.a.createElement("a",{href:e.schedulingReadMoreLink.link,target:"_blank",rel:"noopener noreferrer",className:"event-scheduling-read-more-link"},e.schedulingReadMoreLink.text))}}]),t}(R.a.Component);$e.propTypes={item:Z.a.shape({afterTimeType:Z.a.string.isRequired,afterTimeNumber:Z.a.number}).isRequired,afterTimeNumberSize:Z.a.number,onValueChange:Z.a.func,event:Z.a.shape({defaultAfterTimeType:Z.a.string,timeDelayValues:Z.a.objectOf(Z.a.shape({text:Z.a.string,displayAfterTimeNumberField:Z.a.bool})),schedulingReadMoreLink:Z.a.shape({link:Z.a.string.isRequired,text:Z.a.string.isRequired})}).isRequired},$e.defaultProps={afterTimeNumberSize:3,onValueChange:null};var We=$e,He=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).handleEventOptionChange=F()(a=n.handleEventOptionChange).call(a,K()(n)),n}return Y()(t,e),B()(t,null,[{key:"getEventOptionsValues",value:function(e){var t=e&&ce()(e)?ce()(e):[];return t?x()(t).call(t,(function(e){return{id:e.id,name:e.name}})):t}}]),B()(t,[{key:"displayEventOptions",value:function(){var e=this.props,t=e.eventOptions,a=e.eventSlug,n=e.selected,r=e.emailSlug;if(!t)return t;var i={field:{id:"event_options_".concat(a),name:"event_options_".concat(a),forceSelect2:!0,resetSelect2OnUpdate:!0,values:this.constructor.getEventOptionsValues(t),multiple:t.multiple||!1,placeholder:t.placeholder||!1,extendSelect2Options:{minimumResultsForSearch:1/0},transformChangedValue:function(e,t){return x()(O.a).call(O.a,t,(function(e){return{id:e.id,name:e.text}}))},selected:function(){return n}},onValueChange:this.handleEventOptionChange};return"remote"===t.type&&(i.field=O.a.extend(i.field,{remoteQuery:{minimumInputLength:t.remoteQueryMinimumInputLength||null,endpoint:"automatic_emails",method:"get_event_options",data:{filter:t.remoteQueryFilter||null,email_slug:r,event_slug:a}}})),R.a.createElement(we,{field:i.field,onValueChange:i.onValueChange})}},{key:"handleEventOptionChange",value:function(e){var t=this.props.onValueChange;t&&t({eventOptionValue:e.target.value})}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("div",{className:"event-option-selection"},this.displayEventOptions()))}}]),t}(R.a.Component);He.propTypes={selected:Z.a.array,eventOptions:Z.a.object,eventSlug:Z.a.string.isRequired,emailSlug:Z.a.string.isRequired,onValueChange:Z.a.func},He.defaultProps={eventOptions:null,selected:[],onValueChange:null};var Ke=He,Ge=a(22),Ye="immediate",Je=function(e){function t(e){var a,n,r;M()(this,t),r=U()(this,W()(t).call(this,e));var i=e.email,s=e.name;r.handleChange=F()(a=r.handleChange).call(a,K()(r)),r.handleNextStep=F()(n=r.handleNextStep).call(n,K()(r)),r.email=i,r.emailEvents=r.email.events,r.segments=h()(O.a).call(O.a,window.mailpoet_segments,(function(e){return null===e.deleted_at}));var o=r.getEvent(s),l=r.constructor.getEventOptions(o),c=r.constructor.getEventOptionsFirstValue(l);return r.state={event:o,eventSlug:o.slug,eventOptionValue:c,segment:o.sendToLists?r.constructor.getFirstSegment():null,afterTimeType:o.defaultAfterTimeType||Ye,afterTimeNumber:null},r}return Y()(t,e),B()(t,null,[{key:"getEventOptions",value:function(e){return e.options||null}},{key:"getEventOptionsFirstValue",value:function(e){return e&&O.a.isArray(ce()(e))&&ce()(e)[0].id?ce()(e)[0].id:null}},{key:"displayBreadcrumbs",value:function(){return R.a.createElement(ee,{step:"conditions"})}}]),B()(t,[{key:"getEvent",value:function(e){return this.emailEvents[e]}},{key:"getFirstSegment",value:function(){return O.a.isArray(this.segments)&&this.segments[0].id?this.segments[0].id:null}},{key:"displayHeader",value:function(){return this.state.event.title}},{key:"displayEventOptions",value:function(){var e=this.state,t=e.eventSlug,a=e.event,n={emailSlug:this.email.slug,eventSlug:t,eventOptions:this.constructor.getEventOptions(a),onValueChange:this.handleChange};return R.a.createElement(Ke,{emailSlug:n.emailSlug,eventSlug:n.eventSlug,eventOptions:n.eventOptions,onValueChange:n.onValueChange})}},{key:"displaySegments",value:function(){var e=this;if(!this.state.event.sendToLists)return null;var t={field:{id:"segments",forceSelect2:!0,values:this.segments,extendSelect2Options:{minimumResultsForSearch:1/0}},onValueChange:function(t){return e.handleChange({segment:t.target.value})}};return R.a.createElement("div",{className:"event-segment-selection"},R.a.createElement(we,{field:t.field,onValueChange:t.onValueChange}))}},{key:"displayScheduling",value:function(){var e=this.state,t={item:{afterTimeNumber:e.afterTimeNumber,afterTimeType:e.afterTimeType},event:e.event,onValueChange:this.handleChange};return R.a.createElement(We,{item:t.item,event:t.event,onValueChange:t.onValueChange})}},{key:"displayEventTip",value:function(){var e=this.state.event;return e.tip?R.a.createElement("p",{className:"description"},R.a.createElement("strong",null,q.a.I18n.t("tip"))," ",e.tip):null}},{key:"handleChange",value:function(e){var t=this.state,a=t.segment,n=t.afterTimeNumber,r=e;if(r.eventSlug){r.event=this.getEvent(r.eventSlug),r.segment=r.event.sendToLists?a||this.constructor.getFirstSegment():null;var i=this.constructor.getEventOptions(r.event);r.eventOptionValue=i?this.constructor.getEventOptionsFirstValue(i):null}r.afterTimeType&&"immediate"===r.afterTimeType?r.afterTimeNumber=null:!r.afterTimeType||r.afterTimeNumber||n||(r.afterTimeNumber=1),this.setState(r)}},{key:"handleNextStep",value:function(){var e=this,t=this.props.history,a=this.state,n=a.eventSlug,r=a.afterTimeType,i=a.afterTimeNumber,s=a.event,o=a.segment,l=a.eventOptionValue,c={group:this.email.slug,event:n,afterTimeType:r};i&&(c.afterTimeNumber=i),c.sendTo=s.sendToLists?"segment":"user",o&&(c.segment=o),l&&(c.meta=oe()({option:l})),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:"automatic",subject:q.a.I18n.t("draftNewsletterTitle"),options:c}}).done((function(e){q.a.trackEvent("Emails > New Automatic Email Created",{"MailPoet Premium version":window.mailpoet_premium_version,"MailPoet Free version":window.mailpoet_version,"Event type":c.event,"Schedule type":c.afterTimeType,"Schedule value":c.afterTimeNumber}),t.push("/template/".concat(e.data.id))})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))}},{key:"render",value:function(){var e=q.a.I18n.t("selectAutomaticEmailsEventsConditionsHeading").replace("%1s",this.email.title);return R.a.createElement("div",null,R.a.createElement("h1",null,e),this.constructor.displayBreadcrumbs(),R.a.createElement("div",{className:"events-conditions-container"},R.a.createElement("h1",null,this.displayHeader()),R.a.createElement("div",null,this.displayEventOptions()),R.a.createElement("div",null,this.displaySegments()),R.a.createElement("div",null,this.displayScheduling())),R.a.createElement("p",{className:"submit"},R.a.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleNextStep,value:q.a.I18n.t("next")})),this.displayEventTip())}}]),t}(R.a.Component);Je.contextType=Ge.a,Je.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,name:Z.a.string.isRequired,email:Z.a.shape({title:Z.a.string.isRequired,slug:Z.a.string.isRequired}).isRequired};var Qe=Je,Ze="immediate",Xe=1,et=function(e){function t(e){var a,n;M()(this,t),n=U()(this,W()(t).call(this,e));var r=e.field;n.handleChange=F()(a=n.handleChange).call(a,K()(n)),n.email=r.email,n.emailOptions=r.emailOptions,n.events=O.a.indexBy(n.email.events,"slug"),n.segments=h()(O.a).call(O.a,window.mailpoet_segments,(function(e){return null===e.deleted_at}));var i=n.events[n.emailOptions.event],s=n.emailOptions.afterTimeType||i.defaultAfterTimeType||Ze;return n.state={event:i,afterTimeType:s,eventSlug:n.emailOptions.event,eventOptionValue:null,afterTimeNumber:n.emailOptions.afterTimeNumber||Xe,segment:n.emailOptions.segment?n.emailOptions.segment:null},n}return Y()(t,e),B()(t,[{key:"displayHeader",value:function(){return this.state.event.title}},{key:"displayEventOptions",value:function(){var e,t=this.state,a=t.event,n=t.eventSlug;try{e=JSON.parse(this.emailOptions.meta||null)}catch(t){e=this.emailOptions.meta||null}var r={emailSlug:this.email.slug,eventSlug:n,onValueChange:this.handleChange,eventOptions:a.options||null};return e&&e.option&&("remote"===r.eventOptions.type&&(r.eventOptions.values=e.option),r.selected=x()(O.a).call(O.a,e.option,(function(e){return e.id}))),R.a.createElement(Ke,{emailSlug:r.emailSlug,eventSlug:r.eventSlug,eventOptions:r.eventOptions,onValueChange:r.onValueChange,selected:r.selected})}},{key:"displaySegments",value:function(){var e=this,t=this.state.segment;if("user"===this.emailOptions.sendTo)return null;var a={field:{id:"segments",forceSelect2:!0,values:this.segments,extendSelect2Options:{minimumResultsForSearch:1/0},selected:function(){return t}},onValueChange:function(t){return e.handleChange({segment:t.target.value})}};return R.a.createElement("div",{className:"event-segment-selection"},R.a.createElement(we,{field:a.field,onValueChange:a.onValueChange}))}},{key:"displayScheduling",value:function(){var e=this.state,t={item:{afterTimeNumber:e.afterTimeNumber,afterTimeType:e.afterTimeType},event:e.event,onValueChange:this.handleChange};return R.a.createElement(We,{item:t.item,event:t.event,onValueChange:t.onValueChange})}},{key:"handleChange",value:function(e){var t=this.state.afterTimeNumber,a=e;a.afterTimeType&&"immediate"===a.afterTimeType?a.afterTimeNumber=null:!a.afterTimeType||a.afterTimeNumber||t||(a.afterTimeNumber=Xe),this.setState(e,this.propagateChange)}},{key:"propagateChange",value:function(){var e=this.state,t=e.eventSlug,a=e.afterTimeType,n=e.afterTimeNumber,r=e.segment,i=e.eventOptionValue,s=this.props.onValueChange;if(s){var o={group:this.email.slug,event:t,afterTimeType:a};n&&(o.afterTimeNumber=n),r&&(o.segment=r),i&&(o.meta=oe()({option:this.state.eventOptionValue})),s({target:{name:"options",value:o}})}}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("div",{className:"events-conditions-header"},this.displayHeader()),R.a.createElement("div",{className:"events-conditions-container"},R.a.createElement("div",null,this.displayEventOptions()),R.a.createElement("div",null,this.displaySegments()),R.a.createElement("div",null,this.displayScheduling())))}}]),t}(R.a.Component);et.propTypes={field:Z.a.shape({email:Z.a.shape({events:Z.a.object.isRequired}).isRequired,emailOptions:Z.a.object.isRequired}).isRequired,onValueChange:Z.a.func},et.defaultProps={onValueChange:null};var tt=et,at=a(59),nt=a.n(at),rt=a(48),it=a.n(rt),st=a(16),ot=a(20),lt=a.n(ot),ct=a(294),ut=a.n(ct),pt=a(481),dt=a.n(pt),mt=function(e){var t=e.installedDaysAgo,a=t>30?q.a.I18n.t("reviewRequestUsingForMonths").replace("[months]",Math.round(t/30)):q.a.I18n.t("reviewRequestUsingForDays").replace("[days]",t);return R.a.createElement("div",{className:"mailpoet_review_request"},R.a.createElement("img",{src:e.reviewRequestIllustrationUrl,height:"280",width:"280",alt:""}),R.a.createElement("h2",null,q.a.I18n.t("reviewRequestHeading")),R.a.createElement("p",null,q.a.I18n.t("reviewRequestDidYouKnow").replace("[username]",e.username)),R.a.createElement("p",null,a),R.a.createElement("p",null,R.a.createElement("a",{href:"http://bit.ly/2Bi124o",target:"_blank",rel:"noopener noreferrer",className:"button button-primary"},q.a.I18n.t("reviewRequestRateUsNow"))),R.a.createElement("p",null,R.a.createElement("a",{id:"mailpoet_review_request_not_now"},q.a.I18n.t("reviewRequestNotNow"))))};mt.propTypes={installedDaysAgo:Z.a.number.isRequired,reviewRequestIllustrationUrl:Z.a.string.isRequired,username:Z.a.string.isRequired};var ht=mt,ft=null;var gt=function(){return ft||(ft=q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"analytics",action:"getTrackingData"})),ft},vt=function(){return Object(T.useLayoutEffect)((function(){var e=function(e){var t;t=window.mailpoet_display_nps_form?"EqOgKsgZd832Sz9w":window.mailpoet_is_new_user?"6L479eVPXk7pBn6S":"k0aJAsQAWI2ERyGv",dt()({writeKey:t,userId:window.mailpoet_current_wp_user.ID+window.mailpoet_site_url,traits:{name:window.mailpoet_current_wp_user.user_nicename,email:window.mailpoet_current_wp_user.user_email,mailpoetVersion:window.mailpoet_version,mailpoetPremiumIsActive:window.mailpoet_premium_active,createdAt:e.installedAtIso,newslettersSent:e.newslettersSent,welcomeEmails:e.welcomeEmails,postnotificationEmails:e.postnotificationEmails,woocommerceEmails:e.woocommerceEmails,subscribers:e.subscribers,lists:e.lists,sendingMethod:e.sendingMethod,woocommerceIsInstalled:e.woocommerceIsInstalled},events:{submit:function(e){e.rating>=9&&e.completed&&q.a.Modal.popup({width:800,template:ut.a.renderToString(ht({username:window.mailpoet_current_wp_user_firstname||window.mailpoet_current_wp_user.user_login,reviewRequestIllustrationUrl:window.mailpoet_review_request_illustration_url,installedDaysAgo:window.mailpoet_installed_days_ago})),onInit:function(){document.getElementById("mailpoet_review_request_not_now").addEventListener("click",(function(){return q.a.Modal.close()}))}})}}})};window.mailpoet_display_nps_poll&&gt().then((function(t){var a=t.data;return e(a)}))}),[]),null},bt=function(e){return function(t){return vt(),R.a.createElement(e,t)}},_t=function(e){function t(e){var a;return M()(this,t),(a=U()(this,W()(t).call(this,e))).state={tabs:A.a.applyFilters("mailpoet_newsletters_listings_tabs",[{name:"standard",label:q.a.I18n.t("tabStandardTitle"),link:"/standard"},{name:"welcome",label:q.a.I18n.t("tabWelcomeTitle"),link:"/welcome"},{name:"notification",label:q.a.I18n.t("tabNotificationTitle"),link:"/notification"}])},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this,a=x()(e=this.state.tabs).call(e,(function(e){if(!1===e.display)return null;var a=lt()("nav-tab",{"nav-tab-active":t.props.tab===e.name});return R.a.createElement(st.b,{key:"tab-".concat(e.label),className:a,"data-automation-id":"tab-".concat(e.label),to:e.link,onClick:function(){return q.a.trackEvent("Tab Emails > ".concat(e.name," clicked"),{"MailPoet Free version":window.mailpoet_version})}},e.label)}));return R.a.createElement("h2",{className:"nav-tab-wrapper","data-automation-id":"newsletters_listing_tabs"},a)}}]),t}(R.a.Component);_t.propTypes={tab:Z.a.string.isRequired};var yt=bt(_t),wt=function(){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("pageTitle"),R.a.createElement(st.b,{id:"mailpoet-new-email",className:"page-title-action",to:"/new",onClick:function(){return q.a.trackEvent("Emails > Add New",{"MailPoet Free version":window.mailpoet_version})},"data-automation-id":"new_email"},q.a.I18n.t("new"))))},Et=a(317),kt=a.n(Et),It=a(36),St=a.n(It),Ct=function(e){function t(e){var a,n,r,i;return M()(this,t),(i=U()(this,W()(t).call(this,e))).loadBeamer=F()(a=i.loadBeamer).call(a,K()(i)),i.beamerCallback=F()(n=i.beamerCallback).call(n,K()(i)),i.showBeamer=F()(r=i.showBeamer).call(r,K()(i)),i.state={showDot:e.hasNews,beamerLoaded:void 0!==window.Beamer,beamerInitialized:!1},i}return Y()(t,e),B()(t,null,[{key:"updateLastAnnouncementSeenValue",value:function(){var e={last_announcement_seen:Math.floor(kt()()/1e3)};q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"user_flags",action:"set",data:e})}},{key:"showPluginUpdateNotice",value:function(){if(window.mailpoet_update_available&&!document.getElementById("mailpoet_update_notice")){var e=St()(q.a.I18n.t("updateMailPoetNotice"),/\[link\](.*?)\[\/link\]/,(function(e){return'<a href="update-core.php">'.concat(e,"</a>")})).join("");ve()("#beamerOverlay").append('<p id="mailpoet_update_notice" class="mailpoet_in_beamer_update_notice">'.concat(e,"</p>"))}}}]),B()(t,[{key:"loadBeamer",value:function(){window.beamer_config={product_id:"VvHbhYWy7118",selector:"#beamer-empty-element",language:window.mailpoet_user_locale,callback:this.beamerCallback},window.mailpoet_woocommerce_active&&(window.beamer_config.filter="woocommerce"),q.a.Modal.loading(!0),window.mailpoet_feature_announcement_has_news=!1,this.setState({beamerLoaded:!0});var e=document.createElement("script");e.type="text/javascript",e.src="https://app.getbeamer.com/js/beamer-embed.js",document.getElementsByTagName("body")[0].appendChild(e)}},{key:"beamerCallback",value:function(){this.state.beamerInitialized||(this.showBeamer(),this.setState({beamerInitialized:!0}))}},{key:"showBeamer",value:function(e){e&&e.preventDefault(),this.state.beamerLoaded?(this.setState({showDot:!1}),q.a.Modal.loading(!1),window.Beamer.show(),t.updateLastAnnouncementSeenValue(),t.showPluginUpdateNotice()):this.loadBeamer()}},{key:"render",value:function(){var e=lt()("button mailpoet_feature_announcement_button",this.state.showDot?"mailpoet_feature_announcement_dot":"");return R.a.createElement("div",{className:"mailpoet_feature_announcement"},R.a.createElement("button",{type:"button",onClick:this.showBeamer,className:e,title:q.a.I18n.t("whatsNew")},R.a.createElement("span",{className:"mailpoet_feature_announcement_icon dashicons dashicons-carrot"})),R.a.createElement("span",{id:"beamer-empty-element"}))}}]),t}(R.a.Component);Ct.propTypes={hasNews:Z.a.bool},Ct.defaultProps={hasNews:!1};var Nt=Ct,xt=function(){q.a.trackEvent("User has clicked a CTA to view detailed stats",{"MailPoet Free version":window.mailpoet_version})},Tt=function(e){return e.unshift({name:"stats",link:function(e){return R.a.createElement(st.b,{to:"/stats/".concat(e.id),onClick:A.a.applyFilters("mailpoet_newsletters_listing_stats_tracking",xt)},q.a.I18n.t("statsListingActionTitle"))},display:function(e){var t=e.queue&&e.queue.count_processed;return Number(e.total_sent||t)>0}}),e},Rt=function(e){e.meta.mta_log.error&&"authorization"===e.meta.mta_log.error.operation&&(q.a.Notice.hide("mailpoet_notice_being_sent"),q.a.Notice.error(e.meta.mta_log.error.error_message,{static:!0,id:"mailpoet_authorization_error"}),ve()(".js-button-resume-sending").on("click",(function(){ve()('[data-id="mailpoet_authorization_error"]').slideUp()})))},Pt=function(e){if(!1===e.meta.cron_accessible){var t=St()(q.a.I18n.t("cronNotAccessibleNotice"),/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{href:"https://kb.mailpoet.com/article/231-sending-does-not-work","data-beacon-article":"5a0257ac2c7d3a272c0d7ad6",target:"_blank",rel:"noopener noreferrer",key:"check-cron"},e)}));q.a.Notice.error("",{static:!0,id:"mailpoet_cron_error"}),_e.a.render(R.a.createElement("div",null,R.a.createElement("p",null,t)),ve()('[data-id="mailpoet_cron_error"]')[0])}else q.a.Notice.hide("mailpoet_cron_error")},Ot=a(5),Dt=a.n(Ot),At=a(63),qt=a.n(At),Lt=a(116),Ft=a.n(Lt),jt=function(e){var t=e.newsletter,a=e.isSent,n=e.currentTime,r=a;if(void 0===r&&(r=t.statistics&&t.queue&&"scheduled"!==t.queue.status),!r)return R.a.createElement("span",null,q.a.I18n.t("notSentYet"));var i={link:"/stats/".concat(t.id),onClick:A.a.applyFilters("mailpoet_newsletters_listing_stats_tracking",xt)},s=Number(t.total_sent||t.queue.count_processed),o=0,l=0,c=0,u=null;s>0&&(o=100*t.statistics.clicked/s,l=100*t.statistics.opened/s,c=100*t.statistics.unsubscribed/s,u=t.statistics.revenue);var p,d,m,h,f,g=q.a.Num.toLocaleFixed(o,1),v=q.a.Num.toLocaleFixed(l,1),b=q.a.Num.toLocaleFixed(c,1);void 0!==n?(p=6,d=t.queue.scheduled_at||t.queue.created_at,h=(m=Dt()(n).diff(Dt()(d),"hours"))<p,f=!0):(h=!1,f=!1);var _;_=s>=20&&t.statistics.opened>=5&&!h?R.a.createElement("div",{className:"mailpoet_stats_text"},R.a.createElement("div",null,R.a.createElement("span",null,v,"%"," "),R.a.createElement(Ft.a,{stat:"opened",rate:l,tooltipId:"opened-".concat(t.id)})),R.a.createElement("div",null,R.a.createElement("span",null,g,"%"," "),R.a.createElement(Ft.a,{stat:"clicked",rate:o,tooltipId:"clicked-".concat(t.id)})),R.a.createElement("div",null,R.a.createElement("span",{className:"mailpoet_stat_hidden"},b,"%"))):R.a.createElement("div",null,R.a.createElement("span",{className:"mailpoet_stats_text"},v,"%,"," ",g,"%",R.a.createElement("span",{className:"mailpoet_stat_hidden"},","," ",b,"%")));var y,w=function(e,a){var n;return function(e,t,a,n){return n<=0||!t.link?e:t.externalLink?R.a.createElement("a",{key:"stats-".concat(a),href:t.link,onClick:t.onClick||null},e):R.a.createElement(st.b,{key:"stats-".concat(a),to:t.link,onClick:t.onClick||null},e)}(e,i,E()(n="".concat(a,"-")).call(n,t.id),s)},k=R.a.createElement(R.a.Fragment,null,w(_,"opened-and-clicked"),null!==u&&u.value>0&&R.a.createElement("div",{className:"mailpoet_stats_text"},w(u.formatted,"revenue")," ",R.a.createElement(qt.a,{tooltip:q.a.I18n.t("revenueStatsTooltip"),place:"left",tooltipId:"helpTooltipStatsRevenue"})),h&&w(R.a.createElement("div",{className:"mailpoet_badge mailpoet_badge_green"},q.a.I18n.t("checkBackInHours").replace("%$1d",p-m)),"check-back"));return f&&l<5&&m>=24&&s>=10&&(y=R.a.createElement("div",null,R.a.createElement("a",{href:"https://kb.mailpoet.com/article/191-how-to-improve-my-open-and-click-rates","data-beacon-article":"58f671152c7d3a057f8858e8",target:"_blank",rel:"noopener noreferrer",className:"mailpoet_stat_link_small"},q.a.I18n.t("improveThisLinkText")))),R.a.createElement("div",null,k,y)},Mt=Z.a.shape({clicked:Z.a.number,opened:Z.a.number,unsubscribed:Z.a.number,revenue:Z.a.shape({count:Z.a.number,currency:Z.a.string,formatted:Z.a.string,value:Z.a.number})}),Vt=Z.a.shape({status:Z.a.string,count_processed:Z.a.string.isRequired,count_total:Z.a.string.isRequired,created_at:Z.a.string,scheduled_at:Z.a.string});jt.propTypes={newsletter:Z.a.shape({id:Z.a.number.isRequired,queue:Z.a.oneOfType([Vt,Z.a.bool]),total_sent:Z.a.number,statistics:Z.a.oneOfType([Mt,Z.a.bool])}).isRequired,isSent:Z.a.bool,currentTime:Z.a.string},jt.defaultProps={isSent:void 0,currentTime:void 0};var Bt=jt,zt=a(51),Ut=a.n(zt),$t=a(78),Wt=a.n($t),Ht=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"setupNewsletter",(function(e){void 0!==e&&(a.props.history.push("/new/".concat(e)),q.a.trackEvent("Emails > Type selected",{"MailPoet Free version":window.mailpoet_version,"Email type":e}))})),y()(K()(a),"getAutomaticEmails",(function(){return window.mailpoet_automatic_emails?x()(O.a).call(O.a,window.mailpoet_automatic_emails,(function(e){var t=e,n=O.a.partial(a.setupNewsletter,e.slug);return t.action=R.a.createElement("div",null,R.a.createElement("a",{className:"button button-primary",onClick:n,role:"button",tabIndex:0,disabled:a.state.isCreating,onKeyDown:function(e){var t,n;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(n=["Enter"," "]).call(n,e.key)&&(e.preventDefault(),a.onClick())}},q.a.I18n.t("setUp"))),t})):[]})),y()(K()(a),"getAdditionalTypes",(function(){return window.mailpoet_woocommerce_active?[{slug:"wc_transactional",title:q.a.I18n.t("wooCommerceCustomizerTypeTitle"),description:q.a.I18n.t("wooCommerceCustomizerTypeDescription"),action:R.a.createElement("a",{className:"button button-primary","data-automation-id":"customize_woocommerce",onClick:a.openWooCommerceCustomizer,role:"button",tabIndex:0,onKeyDown:function(e){var t,n;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(n=["Enter"," "]).call(n,e.key)&&(e.preventDefault(),a.openWooCommerceCustomizer())}},q.a.I18n.t("customize"))}]:[]})),y()(K()(a),"openWooCommerceCustomizer",Wt()(Ut.a.mark((function e(){var t,n,r;return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(q.a.trackEvent("Emails > Type selected",{"MailPoet Free version":window.mailpoet_version,"Email type":"wc_transactional"}),t=window.mailpoet_woocommerce_transactional_email_id){e.next=15;break}return e.prev=3,e.next=6,q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:{"woocommerce.use_mailpoet_editor":1}});case 6:n=e.sent,t=n.data.woocommerce.transactional_email_id,q.a.trackEvent("Emails > WooCommerce email customizer enabled",{"MailPoet Free version":window.mailpoet_version}),e.next=15;break;case 11:return e.prev=11,e.t0=e.catch(3),e.t0.errors.length>0&&a.context.notices.error(x()(r=e.t0.errors).call(r,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0}),e.abrupt("return");case 15:window.location.href="?page=mailpoet-newsletter-editor&id=".concat(t);case 16:case"end":return e.stop()}}),e,null,[[3,11]])})))),y()(K()(a),"createNewsletter",(function(e){a.setState({isCreating:!0}),q.a.trackEvent("Emails > Type selected",{"MailPoet Free version":window.mailpoet_version,"Email type":e}),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:e,subject:q.a.I18n.t("draftNewsletterTitle")}}).done((function(e){a.props.history.push("/template/".concat(e.data.id))})).fail((function(e){var t;(a.setState({isCreating:!1}),e.errors.length>0)&&a.context.notices.error(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))})),a.state={isCreating:!1},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=O.a.partial(this.createNewsletter,"standard"),a=O.a.partial(this.setupNewsletter,"notification"),n=O.a.partial(this.setupNewsletter,"welcome"),r=[{slug:"standard",title:q.a.I18n.t("regularNewsletterTypeTitle"),description:q.a.I18n.t("regularNewsletterTypeDescription"),action:R.a.createElement("a",{className:"button button-primary","data-automation-id":"create_standard",onClick:t,role:"button",tabIndex:0,disabled:this.state.isCreating,onKeyDown:function(e){var a,n;C()(a=["keydown","keypress"]).call(a,e.type)&&C()(n=["Enter"," "]).call(n,e.key)&&(e.preventDefault(),t())}},q.a.I18n.t("create"))},{slug:"welcome",title:q.a.I18n.t("welcomeNewsletterTypeTitle"),description:q.a.I18n.t("welcomeNewsletterTypeDescription"),videoGuide:"https://kb.mailpoet.com/article/254-video-guide-to-welcome-emails",videoGuideBeacon:"5b05ebf20428635ba8b2aa53",action:R.a.createElement("a",{className:"button button-primary",onClick:n,"data-automation-id":"create_welcome",disabled:this.state.isCreating,onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),n())},role:"button",tabIndex:0},q.a.I18n.t("setUp"))},{slug:"notification",title:q.a.I18n.t("postNotificationNewsletterTypeTitle"),description:q.a.I18n.t("postNotificationNewsletterTypeDescription"),videoGuide:"https://kb.mailpoet.com/article/210-video-guide-to-post-notifications",videoGuideBeacon:"59ba6fb3042863033a1cd5a5",action:R.a.createElement("a",{className:"button button-primary","data-automation-id":"create_notification",onClick:a,role:"button",disabled:this.state.isCreating,tabIndex:0,onKeyDown:function(e){var t,n;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(n=["Enter"," "]).call(n,e.key)&&(e.preventDefault(),a())}},q.a.I18n.t("setUp"))}],i=A.a.applyFilters("mailpoet_newsletters_types",E()(e=[]).call(e,r,I()(this.getAutomaticEmails())),this);i=E()(i).call(i,this.getAdditionalTypes()),h()(this.props)&&(i=h()(i).call(i,h()(this.props)));var s=!0===window.mailpoet_is_new_user?"mailpoet_badge mailpoet_badge_video":"mailpoet_badge mailpoet_badge_video mailpoet_badge_video_grey",o=q.a.Ajax.constructGetUrl({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"getAll"});return R.a.createElement("div",null,R.a.createElement("link",{rel:"prefetch",href:window.mailpoet_editor_javascript_url,as:"script"}),this.props.showHeader&&R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",null,q.a.I18n.t(0===window.mailpoet_newsletters_count?"createFirstEmailTitle":"pickCampaignType")),R.a.createElement(J.a,{step:"type"})),R.a.createElement("ul",{className:"mailpoet_boxes mailpoet_boxes_types"},x()(i).call(i,(function(e){return R.a.createElement("li",{key:e.slug,"data-type":e.slug,className:"mailpoet_newsletter_types"},R.a.createElement("div",{className:"mailpoet_thumbnail"},e.thumbnailImage?R.a.createElement("img",{src:e.thumbnailImage,alt:""}):null),R.a.createElement("div",{className:"mailpoet_boxes_content"},R.a.createElement("div",{className:"mailpoet_description"},R.a.createElement("h3",null,e.title," ",e.beta?"(".concat(q.a.I18n.t("beta"),")"):""),R.a.createElement("p",null,e.description),e.videoGuide&&R.a.createElement("a",{className:s,href:e.videoGuide,"data-beacon-article":e.videoGuideBeacon,target:"_blank",rel:"noopener noreferrer"},R.a.createElement("span",{className:"dashicons dashicons-format-video"}),q.a.I18n.t("seeVideoGuide"))),R.a.createElement("div",{className:"mailpoet_actions"},e.action)))}),this)),R.a.createElement("link",{rel:"prefetch",href:o,as:"fetch"}))}}]),t}(R.a.Component);Ht.contextType=Ge.a,Ht.propTypes={filter:Z.a.func,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,showHeader:Z.a.bool},Ht.defaultProps={filter:null,showHeader:!0};var Kt=Object(ne.withRouter)(Ht),Gt=a(47),Yt=a.n(Gt),Jt=function(e){var t=e.onClose,a=e.onDisplay,n=e.renderInPlace,r=e.timeout,i=e.scroll,s=e.children,o=e.closable,l=e.type,c=R.a.useState(!1),u=Ne()(c,2),p=u[0],d=u[1],m=R.a.useRef(null),h=R.a.useRef(null),f=R.a.useCallback((function(){t&&t(),d(!0)}),[t]);if(R.a.useEffect((function(){return r&&(h.current=Yt()(f,r)),function(){return h.current?clearTimeout(h.current):null}}),[f,r]),R.a.useLayoutEffect((function(){i&&m.current&&m.current.scrollIntoView(!1)}),[i]),R.a.useLayoutEffect((function(){a&&a()}),[a]),p)return null;var g=R.a.createElement("div",{ref:m,className:"mailpoet_base_notice mailpoet_".concat(l,"_notice")},s,o&&R.a.createElement("button",{type:"button",className:"notice-dismiss",onClick:f},R.a.createElement("span",{className:"screen-reader-text"},q.a.I18n.t("dismissNotice"))));return n?g:_e.a.createPortal(g,document.getElementById("mailpoet_notices"))};Jt.propTypes={type:Z.a.oneOf(["success","info","warning","error"]).isRequired,children:Z.a.node.isRequired,scroll:Z.a.bool,closable:Z.a.bool,renderInPlace:Z.a.bool,onDisplay:Z.a.func,onClose:Z.a.func,timeout:Z.a.oneOfType([Z.a.number,Z.a.oneOf([!1])])},Jt.defaultProps={timeout:1e4,scroll:!1,closable:!0,renderInPlace:!1,onDisplay:void 0,onClose:void 0};var Qt=Jt,Zt=function(){if(!window.mailpoet_subscribers_limit_reached)return null;var e=window.mailpoet_has_valid_api_key,t=q.a.I18n.t("subscribersLimitNoticeTitle").replace("[subscribersLimit]",window.mailpoet_subscribers_limit),a=q.a.I18n.t(e?"yourPlanLimit":"freeVersionLimit").replace("[subscribersLimit]",window.mailpoet_subscribers_limit),n=e?"https://account.mailpoet.com/upgrade":"https://account.mailpoet.com/?s=".concat(window.mailpoet_subscribers_count+1),r=function(){var e=Wt()(Ut.a.mark((function e(){return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"services",action:"recheckKeys"});case 2:window.location.reload();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return R.a.createElement(Qt,{type:"error",timeout:!1,closable:!1,renderInPlace:!0},R.a.createElement("h3",null,t),R.a.createElement("p",null,a," ",q.a.I18n.t("youNeedToUpgrade")),R.a.createElement("p",null,R.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",className:"button button-primary",href:n},q.a.I18n.t("upgradeNow")),e&&R.a.createElement(R.a.Fragment,null," ",R.a.createElement("button",{type:"button",className:"button",onClick:r},q.a.I18n.t("refreshMySubscribers")))))},Xt=function(e){var t=e.mssKeyInvalid,a=e.subscribersCount;return t?R.a.createElement(Qt,{type:"error",timeout:!1,closable:!1,renderInPlace:!0},R.a.createElement("h3",null,q.a.I18n.t("allSendingPausedHeader")),R.a.createElement("p",null,q.a.I18n.t("allSendingPausedBody")),R.a.createElement("p",null,R.a.createElement("a",{href:"https://account.mailpoet.com?s=".concat(a),className:"button button-primary",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("allSendingPausedLink")))):null};Xt.propTypes={mssKeyInvalid:Z.a.bool.isRequired,subscribersCount:Z.a.number.isRequired};var ea=Xt,ta=!!window.mailpoet_tracking_enabled,aa=window.mailpoet_woocommerce_automatic_emails||{},na={onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},ra=[{name:"subject",label:q.a.I18n.t("subject"),sortable:!0},{name:"status",label:q.a.I18n.t("status"),width:145},{name:"settings",label:q.a.I18n.t("settings")},{name:"statistics",label:q.a.I18n.t("statistics"),display:ta},{name:"updated_at",label:q.a.I18n.t("lastModifiedOn"),sortable:!0}],ia=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:na.onTrash}],sa=[{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"edit",link:function(e){return R.a.createElement("a",{href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},q.a.I18n.t("edit"))}},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("newsletterDuplicated").replace("%$1s",e.data.subject)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"trash"}];A.a.addFilter("mailpoet_newsletters_listings_automatic_email_actions","mailpoet",Tt);var oa=function(e){function t(e){var a,n;return M()(this,t),n=U()(this,W()(t).call(this,e)),y()(K()(n),"updateStatus",(function(e){e.persist(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:Number(e.target.getAttribute("data-id")),status:e.target.value}}).done((function(e){"active"===e.data.status&&q.a.Notice.success(q.a.I18n.t("automaticEmailActivated")),n.forceUpdate()})).fail((function(t){q.a.Notice.showApiErrorNotice(t),e.target.value=t.status}))})),y()(K()(n),"renderStatus",(function(e){var t=Se()(e.total_sent,10)?q.a.I18n.t("sentToXCustomers").replace("%$1d",e.total_sent.toLocaleString()):q.a.I18n.t("notSentYet");return R.a.createElement("div",null,R.a.createElement("p",null,R.a.createElement("select",{"data-id":e.id,defaultValue:e.status,onChange:n.updateStatus},R.a.createElement("option",{value:"active"},q.a.I18n.t("active")),R.a.createElement("option",{value:"draft"},q.a.I18n.t("inactive")))),R.a.createElement("p",null,R.a.createElement(st.b,{to:"/sending-status/".concat(e.id)},t)))})),y()(K()(n),"renderSettings",(function(e){var t,a=aa[e.options.group].events[e.options.event];try{t=JSON.parse(e.options.meta||null)}catch(a){t=e.options.meta||null}var n,r,i=t&&t.option?O.a.pluck(t.option,"name"):[];if(t&&O.a.isEmpty(i))return R.a.createElement("span",{className:"mailpoet_error"},q.a.I18n.t("automaticEmailEventOptionsNotConfigured"));if((n=i.length>1&&"listingScheduleDisplayTextPlural"in a?a.listingScheduleDisplayTextPlural.replace("%s",i.join(", ")):a.listingScheduleDisplayText.replace("%s",i.join(", ")))&&"immediate"!==e.options.afterTimeType)switch(e.options.afterTimeType){case"minutes":r=q.a.I18n.t("sendingDelayMinutes").replace("%$1d",e.options.afterTimeNumber);break;case"hours":r=q.a.I18n.t("sendingDelayHours").replace("%$1d",e.options.afterTimeNumber);break;case"days":r=q.a.I18n.t("sendingDelayDays").replace("%$1d",e.options.afterTimeNumber);break;case"weeks":r=q.a.I18n.t("sendingDelayWeeks").replace("%$1d",e.options.afterTimeNumber);break;default:r=q.a.I18n.t("sendingDelayInvalid")}return R.a.createElement("span",null,n,r&&R.a.createElement(R.a.Fragment,null,R.a.createElement("br",null),r))})),y()(K()(n),"renderItem",(function(e,t){var a=lt()("manage-column","column-primary","has-row-actions");return R.a.createElement("div",null,R.a.createElement("td",{className:a},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},n.renderStatus(e)),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("settings")},n.renderSettings(e)),!0===ta?R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("statistics")},R.a.createElement(Bt,{newsletter:e,isSent:e.total_sent>0&&!!e.statistics})):null,R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("lastModifiedOn")},R.a.createElement("abbr",null,q.a.Date.format(e.updated_at))))})),n.state={eventCounts:{},newslettersCount:void 0},n.afterGetItems=F()(a=n.afterGetItems).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"afterGetItems",value:function(e){Rt(e),this.countEmailTypes(e)}},{key:"countEmailTypes",value:function(e){if(nt()(e.items)){var t,a,n=Pe()(t=x()(a=e.items).call(a,(function(e){return e.options.event}))).call(t,(function(e,t){return e[t]?e[t]+=1:e[t]=1,e}),{woocommerce_product_purchased:0,woocommerce_product_purchased_in_category:0,woocommerce_first_purchase:0});this.setState({eventCounts:n})}}},{key:"renderWarning",value:function(){var e=this.state.eventCounts;return e.woocommerce_product_purchased+e.woocommerce_product_purchased_in_category+e.woocommerce_first_purchase?"1"===window.mailpoet_woocommerce_optin_on_checkout?null:R.a.createElement("div",{className:"mailpoet_base_notice mailpoet_error_notice"},R.a.createElement("p",null,q.a.I18n.t("wooCommerceEmailsWarning")),R.a.createElement("p",null,R.a.createElement("a",{href:"?page=mailpoet-settings#woocommerce"},q.a.I18n.t("wooCommerceEmailsWarningLink")))):null}},{key:"render",value:function(){var e=this,t=this.props,a=t.match,n=t.location;return R.a.createElement("div",null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(yt,{tab:"woocommerce"}),this.renderWarning(),0===this.state.newslettersCount&&R.a.createElement(Kt,{filter:function(e){return"woocommerce"===e.slug},showHeader:!1}),0!==this.state.newslettersCount&&R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:n,params:a.params,endpoint:"newsletters",type:"automatic",base_url:"woocommerce",onRenderItem:this.renderItem,columns:ra,bulk_actions:ia,item_actions:sa,messages:na,auto_refresh:!0,sort_by:"updated_at",sort_order:"desc",afterGetItems:function(t){if(!t.loading){var a,n=Pe()(a=t.groups).call(a,(function(e,t){return e+t.count}),0);e.setState({newslettersCount:n})}e.afterGetItems(t)}}))}}]),t}(R.a.Component);oa.propTypes={match:Z.a.shape({params:Z.a.shape({tab:Z.a.string}).isRequired}).isRequired,location:Z.a.object.isRequired};var la=oa,ca=O.a.once((function(){return q.a.trackEvent("User has typed a GA campaign name",{"MailPoet Premium version":window.mailpoet_premium_version})})),ua=St()(q.a.I18n.t("gaCampaignTip"),/\[link\](.*?)\[\/link\]/g,(function(e,t){return R.a.createElement("a",{key:t,href:"https://kb.mailpoet.com/article/187-track-your-newsletters-subscribers-in-google-analytics","data-beacon-article":"58b597d12c7d3a576d359144",target:"_blank",rel:"noopener noreferrer"},e)})),pa={name:"ga_campaign",label:q.a.I18n.t("gaCampaignLine"),tip:ua,type:"text",onBeforeChange:ca};function da(e,t){var a=b()(e);if(g.a){var n=g()(e);t&&(n=h()(n).call(n,(function(t){return d()(e,t).enumerable}))),a.push.apply(a,n)}return a}function ma(e){for(var t=1;t<arguments.length;t++){var a,n=null!=arguments[t]?arguments[t]:{};if(t%2)u()(a=da(Object(n),!0)).call(a,(function(t){y()(e,t,n[t])}));else if(l.a)s()(e,l()(n));else{var i;u()(i=da(Object(n))).call(i,(function(t){r()(e,t,d()(n,t))}))}}return e}var ha=window.mailpoet_woocommerce_automatic_emails||[];if(document.getElementById("newsletters_container")&&!O.a.isEmpty(ha)){A.a.addFilter("mailpoet_newsletters_types","mailpoet",(function(e,t){var a,n=O.a.reject(e,(function(e){return O.a.has(ha,e.slug)})),r=x()(O.a).call(O.a,ha,(function(e){var a=e,n=O.a.partial(t.setupNewsletter,e.slug);return a.action=R.a.createElement("div",null,R.a.createElement("span",{className:"button button-primary",onClick:n,onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),n())},role:"button","data-automation-id":"create_woocommerce",tabIndex:0},e.actionButtonTitle||q.a.I18n.t("setUp"))),a}));return E()(a=[]).call(a,I()(n),I()(r))})),A.a.addFilter("mailpoet_newsletters_before_router","mailpoet",(function(e){var t,a=O.a.reject(e,(function(e){return O.a.has(ha,e.name)})),n=[],r=[],i=[];return O.a.each(ha,(function(e){var t=e.events;O.a.isObject(t)&&O.a.each(t,(function(t){var a;r.push({path:E()(a="/new/".concat(e.slug,"/")).call(a,t.slug,"/conditions"),name:t.slug,render:function(a){var n=ma({},a,{email:e,name:t.slug});return R.a.createElement(Qe,n)}})})),n.push({path:"/new/".concat(e.slug),name:e.slug,render:function(t){var a=ma({},t,{email:e});return R.a.createElement(ie,a)}}),i.push({path:"/".concat(e.slug,"/(.*)?"),params:{tab:e.slug},component:la})})),E()(t=[]).call(t,r,n,i,I()(a))}))}A.a.addFilter("mailpoet_newsletters_listings_tabs","mailpoet",(function(e){var t,a=[];return O.a.each(ha,(function(e){a.push({name:e.slug,label:e.title,link:"/".concat(e.slug),display:window.mailpoet_woocommerce_active})})),E()(t=[]).call(t,I()(e),a)}));var fa=function(e,t,a){return"automatic"===t?R.a.createElement(ee,{step:a}):e};A.a.addFilter("mailpoet_newsletters_template_breadcrumb","mailpoet",fa),A.a.addFilter("mailpoet_newsletters_editor_breadcrumb","mailpoet",fa),A.a.addFilter("mailpoet_newsletters_send_breadcrumb","mailpoet",fa);A.a.addFilter("mailpoet_newsletters_editor_extend_config","mailpoet",(function(e,t){if("automatic"!==t.type)return e;var a=e;return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"automatic_emails",action:"get_event_shortcodes",data:{email_slug:t.options.group,event_slug:t.options.event}}).then((function(e){return O.a.isObject(e)&&e.data?(a.shortcodes=ma({},a.shortcodes,{},e.data),a):a})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0,static:!0})}))}));A.a.addFilter("mailpoet_newsletters_send_newsletter_fields","mailpoet",(function(e,t){if("automatic"!==t.type)return e;var a=ha[t.options.group];if(!a)return e;var n=t.options,r=[{name:"subject",label:q.a.I18n.t("subjectLine"),tip:q.a.I18n.t("subjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("emptySubjectLineError")}},{name:"options",label:q.a.I18n.t("sendAutomaticEmailWhenHeading").replace("%1s",a.title),type:"reactComponent",component:tt,email:a,emailOptions:n},{name:"sender",label:q.a.I18n.t("sender"),tip:q.a.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:q.a.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"text",placeholder:q.a.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:q.a.I18n.t("replyTo"),tip:q.a.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:q.a.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:q.a.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]},pa];return{getFields:function(){return r},getSendButtonOptions:function(){return{value:q.a.I18n.t("activate")}}}}));A.a.addFilter("mailpoet_newsletters_send_server_request_parameters","mailpoet",(function(e,t){return"automatic"===t.type?{api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:t.id,status:"active"}}:e}));A.a.addFilter("mailpoet_newsletters_send_server_request_response_redirect","mailpoet",(function(e,t){return"automatic"===t.type?"/".concat(t.options.group):e}));A.a.addFilter("mailpoet_newsletters_send_server_request_response","mailpoet",(function(e){if("automatic"!==e.type)return null;var t=ha[e.options.group];return t?function(){q.a.Notice.success(q.a.I18n.t("automaticEmailActivated").replace("%1s",t.title))}:null}));var ga=function(e){var t=e.subscribersInPlan,a=e.hasValidApiKey;return t&&a?R.a.createElement("h3",null,q.a.I18n.t("subscribersInPlan").replace("%$1d",t.toLocaleString())," ",R.a.createElement(qt.a,{tooltip:q.a.I18n.t("subscribersInPlanTooltip"),place:"right"})):null};ga.propTypes={subscribersInPlan:Z.a.oneOfType([Z.a.number,Z.a.oneOf([!1])]).isRequired,hasValidApiKey:Z.a.bool.isRequired};var va=ga,ba=[{name:"email",label:q.a.I18n.t("subscriber"),sortable:!0},{name:"status",label:q.a.I18n.t("status"),sortable:!0},{name:"segments",label:q.a.I18n.t("lists")},{name:"created_at",label:q.a.I18n.t("subscribedOn"),sortable:!0}],_a={onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSubscriberTrashed"):q.a.I18n.t("multipleSubscribersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSubscriberDeleted"):q.a.I18n.t("multipleSubscribersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSubscriberRestored"):q.a.I18n.t("multipleSubscribersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onNoItemsFound:function(e){return"bounced"===e&&!window.mailpoet_premium_active&&!window.mss_active&&R.a.createElement("div",null,R.a.createElement("p",null,q.a.I18n.t("bouncedSubscribersHelp")),R.a.createElement("p",null,R.a.createElement("a",{href:"admin.php?page=mailpoet-premium",className:"button-primary"},q.a.I18n.t("bouncedSubscribersPremiumButtonText"))))}},ya=[{name:"moveToList",label:q.a.I18n.t("moveToList"),onSelect:function(){return R.a.createElement(we,{field:{id:"move_to_segment",name:"move_to_segment",endpoint:"segments",filter:function(e){return!(e.deleted_at||"default"!==e.type)}}})},getData:function(){return{segment_id:Number(ve()("#move_to_segment").val())}},onSuccess:function(e){q.a.Notice.success(q.a.I18n.t("multipleSubscribersMovedToList").replace("%$1d",Number(e.meta.count).toLocaleString()).replace("%$2s",e.meta.segment))}},{name:"addToList",label:q.a.I18n.t("addToList"),onSelect:function(){return R.a.createElement(we,{field:{id:"add_to_segment",name:"add_to_segment",endpoint:"segments",filter:function(e){return!(e.deleted_at||"default"!==e.type)}}})},getData:function(){return{segment_id:Number(ve()("#add_to_segment").val())}},onSuccess:function(e){q.a.Notice.success(q.a.I18n.t("multipleSubscribersAddedToList").replace("%$1d",Number(e.meta.count).toLocaleString()).replace("%$2s",e.meta.segment))}},{name:"removeFromList",label:q.a.I18n.t("removeFromList"),onSelect:function(){return R.a.createElement(we,{field:{id:"remove_from_segment",name:"remove_from_segment",endpoint:"segments",filter:function(e){return!("default"!==e.type)}}})},getData:function(){return{segment_id:Number(ve()("#remove_from_segment").val())}},onSuccess:function(e){q.a.Notice.success(q.a.I18n.t("multipleSubscribersRemovedFromList").replace("%$1d",Number(e.meta.count).toLocaleString()).replace("%$2s",e.meta.segment))}},{name:"removeFromAllLists",label:q.a.I18n.t("removeFromAllLists"),onSuccess:function(e){q.a.Notice.success(q.a.I18n.t("multipleSubscribersRemovedFromAllLists").replace("%$1d",Number(e.meta.count).toLocaleString()))}},{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:_a.onTrash}],wa=[{name:"edit",label:q.a.I18n.t("edit"),link:function(e){return R.a.createElement(st.b,{to:"/edit/".concat(e.id)},q.a.I18n.t("edit"))}},{name:"sendConfirmationEmail",label:q.a.I18n.t("resendConfirmationEmail"),display:function(e){return"unconfirmed"===e.status&&e.count_confirmations<window.mailpoet_max_confirmation_emails},onClick:function(e){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"subscribers",action:"sendConfirmationEmail",data:{id:e.id}}).done((function(){return q.a.Notice.success(q.a.I18n.t("oneConfirmationEmailSent"))})).fail((function(e){return q.a.Notice.showApiErrorNotice(e)}))}},{name:"trash",display:function(e){return 0===Number(e.wp_user_id)&&0===Number(e.is_woocommerce_user)}}],Ea=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"getSegmentFromId",(function(e){var t,a=!1;return u()(t=window.mailpoet_segments).call(t,(function(t){t.id===e&&(a=t)})),a})),y()(K()(n),"renderItem",(function(e,t){var a=lt()("manage-column","column-primary","has-row-actions","column-username"),r="";switch(e.status){case"subscribed":r=q.a.I18n.t("subscribed");break;case"unconfirmed":r=q.a.I18n.t("unconfirmed");break;case"unsubscribed":r=q.a.I18n.t("unsubscribed");break;case"inactive":r=q.a.I18n.t("inactive");break;case"bounced":r=q.a.I18n.t("bounced");break;default:r="Invalid"}var i=!1;if(e.subscriptions.length>0){var s,o=[];u()(s=e.subscriptions).call(s,(function(e){var t=n.getSegmentFromId(e.segment_id);!1!==t&&"subscribed"===e.status&&o.push(t.name)})),i=R.a.createElement("span",null,o.join(", "))}return R.a.createElement("div",null,R.a.createElement("td",{className:a},R.a.createElement("strong",null,R.a.createElement(st.b,{className:"row-title",to:"/edit/".concat(e.id)},e.email)),R.a.createElement("p",{style:{margin:0}},e.first_name," ",e.last_name),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},r),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("lists")},i),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("subscribedOn")},R.a.createElement("abbr",null,q.a.Date.format(e.created_at))))})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("pageTitle")," ",R.a.createElement(st.b,{className:"page-title-action",to:"/new"},q.a.I18n.t("new")),R.a.createElement("a",{className:"page-title-action",href:"?page=mailpoet-import","data-automation-id":"import-subscribers-button"},q.a.I18n.t("import")),R.a.createElement("a",{id:"mailpoet_export_button",className:"page-title-action",href:"?page=mailpoet-export"},q.a.I18n.t("export"))),R.a.createElement(va,{subscribersInPlan:window.mailpoet_subscribers_in_plan_count,hasValidApiKey:window.mailpoet_has_valid_api_key}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"subscribers",onRenderItem:this.renderItem,columns:ba,bulk_actions:ya,item_actions:wa,messages:_a,sort_by:"created_at",sort_order:"desc"}))}}]),t}(R.a.Component);Ea.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var ka=Ea,Ia=a(129),Sa=a.n(Ia),Ca=function(e){return R.a.createElement("textarea",pe()({type:"text",className:"regular-text",name:e.field.name,id:"field_".concat(e.field.name),value:e.item[e.field.name],placeholder:e.field.placeholder,defaultValue:e.field.defaultValue,onChange:e.onValueChange},e.field.validation))};Ca.propTypes={item:Z.a.object.isRequired,field:Z.a.shape({name:Z.a.string,placeholder:Z.a.string,defaultValue:Z.a.string,validation:Z.a.object}).isRequired,onValueChange:Z.a.func.isRequired};var Na=Ca,xa=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this;if(void 0===ce()(this.props.field))return!1;var a,n=!1,r=!1,i=!1;void 0!==this.props.field.placeholder&&(r=R.a.createElement("option",{value:""},this.props.field.placeholder)),void 0!==h()(this.props.field)&&(n=h()(this.props.field)),O.a.isFunction(this.props.field.sortBy)&&(i=this.props.field.sortBy),a=i?x()(O.a).call(O.a,O.a.sortBy(O.a.pairs(ce()(this.props.field)),(function(e){return i(e[0],e[1])})),(function(e){return e[0]})):b()(ce()(this.props.field));var s=x()(e=h()(a).call(a,(function(e){return!1===n||n(t.props.item,e)}))).call(e,(function(e){return R.a.createElement("option",{key:"option-".concat(e),value:e},ce()(t.props.field)[e])}));return R.a.createElement("select",pe()({name:this.props.field.name,id:"field_".concat(this.props.field.name),value:this.props.item[this.props.field.name]||"",onChange:this.props.onValueChange,"data-automation-id":this.props.automationId},this.props.field.validation),r,s)}}]),t}(R.a.Component);xa.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.object,placeholder:Z.a.string,filter:Z.a.func,sortBy:Z.a.func,validation:Z.a.object}).isRequired,item:Z.a.object.isRequired,automationId:Z.a.string},xa.defaultProps={automationId:"",onValueChange:function(){}};var Ta=xa,Ra=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this;if(void 0===ce()(this.props.field))return!1;var a=this.props.item[this.props.field.name],n=x()(e=b()(ce()(this.props.field))).call(e,(function(e){return R.a.createElement("p",{key:"radio-".concat(e)},R.a.createElement("label",{htmlFor:t.props.field.name},R.a.createElement("input",{type:"radio",checked:a===e,value:e,onChange:t.props.onValueChange,name:t.props.field.name,id:t.props.field.name}),ce()(t.props.field)[e]))}));return R.a.createElement("div",null,n)}}]),t}(R.a.Component);Ra.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.object}).isRequired,item:Z.a.object.isRequired},Ra.defaultProps={onValueChange:function(){}};var Pa=Ra,Oa=function(e){function t(e){var a,n;return M()(this,t),n=U()(this,W()(t).call(this,e)),y()(K()(n),"onValueChange",(function(e){return e.target.value=n.checkboxRef.current.checked?"1":"0",n.props.onValueChange(e)})),n.checkboxRef=R.a.createRef(),n.onValueChange=F()(a=n.onValueChange).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this;if(void 0===ce()(this.props.field))return!1;var a=!!Number(this.props.item[this.props.field.name]),n=x()(e=b()(ce()(this.props.field))).call(e,(function(e){return R.a.createElement("p",{key:"checkbox-".concat(e)},R.a.createElement("label",{htmlFor:t.props.field.name},R.a.createElement("input",{ref:t.checkboxRef,type:"checkbox",value:"1",checked:a,onChange:t.onValueChange,name:t.props.field.name,id:t.props.field.name}),ce()(t.props.field)[e]))}));return R.a.createElement("div",null,n)}}]),t}(R.a.Component);Oa.propTypes={onValueChange:Z.a.func.isRequired,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.object.isRequired}).isRequired,item:Z.a.object.isRequired};var Da=Oa,Aa=a(49),qa=a.n(Aa);function La(e){var t=[];void 0!==e.placeholder&&t.push(R.a.createElement("option",{value:"",key:0},e.placeholder));for(var a=Dt()().year(),n=a;n>=a-100;n-=1)t.push(R.a.createElement("option",{key:n,value:n},n));return R.a.createElement("select",{name:"".concat(e.name,"[year]"),value:e.year,onChange:e.onValueChange,className:lt()({mailpoet_date_year:e.addDefaultClasses})},t)}function Fa(e){var t=[];void 0!==e.placeholder&&t.push(R.a.createElement("option",{value:"",key:0},e.placeholder));for(var a=1;a<=12;a+=1)t.push(R.a.createElement("option",{key:a,value:a},e.monthNames[a-1]));return R.a.createElement("select",{name:"".concat(e.name,"[month]"),value:e.month,onChange:e.onValueChange,className:lt()({mailpoet_date_month:e.addDefaultClasses})},t)}function ja(e){var t=[];void 0!==e.placeholder&&t.push(R.a.createElement("option",{value:"",key:0},e.placeholder));for(var a=1;a<=31;a+=1)t.push(R.a.createElement("option",{key:a,value:a},a));return R.a.createElement("select",{name:"".concat(e.name,"[day]"),value:e.day,onChange:e.onValueChange,className:lt()({mailpoet_date_day:e.addDefaultClasses})},t)}La.propTypes={name:Z.a.string.isRequired,placeholder:Z.a.string.isRequired,onValueChange:Z.a.func.isRequired,year:Z.a.oneOfType([Z.a.string,Z.a.number]).isRequired,addDefaultClasses:Z.a.bool.isRequired},Fa.propTypes={name:Z.a.string.isRequired,placeholder:Z.a.string.isRequired,onValueChange:Z.a.func.isRequired,month:Z.a.oneOfType([Z.a.string,Z.a.number]).isRequired,monthNames:Z.a.arrayOf(Z.a.string).isRequired,addDefaultClasses:Z.a.bool.isRequired},ja.propTypes={name:Z.a.string.isRequired,placeholder:Z.a.string.isRequired,onValueChange:Z.a.func.isRequired,day:Z.a.oneOfType([Z.a.string,Z.a.number]).isRequired,addDefaultClasses:Z.a.bool.isRequired};var Ma=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).state={year:"",month:"",day:""},n.onValueChange=F()(a=n.onValueChange).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){this.extractDateParts()}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.item&&void 0!==e.item&&this.props.item.id!==e.item.id&&this.extractDateParts()}},{key:"onValueChange",value:function(e){var t=this,a=e.target.name.match(/(.*?)\[(.*?)\]/),n=null,r=null;if(null!==a&&3===a.length){var i=Ne()(a,3);n=i[1],r=i[2];var s=Number(e.target.value);this.setState(y()({},"".concat(r),s),(function(){t.props.onValueChange({target:{name:n,value:t.formatValue()}})}))}}},{key:"formatValue",value:function(){var e;switch(this.props.field.params.date_type){case"year_month_day":e={year:this.state.year,month:this.state.month,day:this.state.day};break;case"year_month":e={year:this.state.year,month:this.state.month};break;case"month":e={month:this.state.month};break;case"year":e={year:this.state.year};break;default:e={value:"invalid type"}}return e}},{key:"extractDateParts",value:function(){var e,t=void 0!==this.props.item[this.props.field.name]?qa()(e=this.props.item[this.props.field.name]).call(e):"";if(""!==t){var a=Dt()(t);this.setState({year:a.format("YYYY"),month:a.format("M"),day:a.format("D")})}}},{key:"render",value:function(){var e=this,t=window.mailpoet_month_names||[],a=(window.mailpoet_date_formats||{})[this.props.field.params.date_type][0];this.props.field.params.date_format&&(a=this.props.field.params.date_format);var n=a.split("/"),r=x()(n).call(n,(function(a){switch(a){case"YYYY":return R.a.createElement(La,{onValueChange:e.onValueChange,key:"year",name:e.props.field.name,addDefaultClasses:e.props.addDefaultClasses,year:e.state.year,placeholder:e.props.field.year_placeholder});case"MM":return R.a.createElement(Fa,{onValueChange:e.onValueChange,key:"month",name:e.props.field.name,addDefaultClasses:e.props.addDefaultClasses,month:e.state.month,monthNames:t,placeholder:e.props.field.month_placeholder});case"DD":return R.a.createElement(ja,{onValueChange:e.onValueChange,key:"day",name:e.props.field.name,addDefaultClasses:e.props.addDefaultClasses,day:e.state.day,placeholder:e.props.field.day_placeholder});default:return R.a.createElement("div",null,"Invalid date type")}}));return R.a.createElement("div",null,r)}}]),t}(R.a.Component);Ma.propTypes={item:Z.a.object.isRequired,field:Z.a.shape({name:Z.a.string,day_placeholder:Z.a.string,month_placeholder:Z.a.string,year_placeholder:Z.a.string,params:Z.a.object}).isRequired,onValueChange:Z.a.func.isRequired,addDefaultClasses:Z.a.bool},Ma.defaultProps={addDefaultClasses:!1};var Va=Ma,Ba=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"renderField",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=!1;e.field.description&&(a=R.a.createElement("p",{className:"description"},e.field.description));var n=!1,r=e.field;switch(void 0!==e.field.field&&(r=ve.a.merge(r,e.field.field)),r.type){case"text":n=R.a.createElement(De,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"textarea":n=R.a.createElement(Na,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"select":n=R.a.createElement(Ta,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"radio":n=R.a.createElement(Pa,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"checkbox":n=R.a.createElement(Da,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"selection":n=R.a.createElement(we,{key:"selection-field-".concat(r.name),onValueChange:e.onValueChange,field:e.field,automationId:e.automationId,inline:e.inline,description:e.description,item:e.item});break;case"date":n=R.a.createElement(Va,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"reactComponent":n=R.a.createElement(e.field.component,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;default:n="invalid"}return!0===t?R.a.createElement("span",{key:"field-".concat(e.index||0)},n,a):R.a.createElement("div",{key:"field-".concat(e.index||0)},n,a)})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this,a=!1;void 0!==this.props.field.fields?a=x()(e=this.props.field.fields).call(e,(function(e,a){return t.renderField({index:a,field:e,item:t.props.item,onValueChange:t.props.onValueChange||!1})})):a=this.renderField(this.props);var n=!1;return this.props.field.tip&&(n=R.a.createElement("p",{className:"description"},this.props.field.tip)),R.a.createElement("tr",{className:"form-field-row-".concat(this.props.field.name)},R.a.createElement("th",{scope:"row"},R.a.createElement("label",{htmlFor:"field_".concat(this.props.field.name)},this.props.field.label,n)),R.a.createElement("td",null,a))}}]),t}(R.a.Component);Ba.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.object,tip:Z.a.oneOfType([Z.a.array,Z.a.string]),label:Z.a.string,fields:Z.a.array,description:Z.a.string}).isRequired,item:Z.a.object.isRequired},Ba.defaultProps={onValueChange:function(){}};var za=Ba,Ua=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"getValues",(function(){return a.props.item||a.state.item})),y()(K()(a),"getErrors",(function(){return a.props.errors||a.state.errors})),y()(K()(a),"loadItem",(function(e){a.setState({loading:!0}),a.props.endpoint&&q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:a.props.endpoint,action:"get",data:{id:e}}).done((function(e){a.setState({loading:!1,item:e.data}),"function"==typeof a.props.onItemLoad&&a.props.onItemLoad(e.data)})).fail((function(){a.setState({loading:!1,item:{}},(function(){this.props.history.push("/new")}))}))})),y()(K()(a),"handleSubmit",(function(e){var t;if(e.preventDefault(),void 0===a.props.isValid||!1!==a.props.isValid()){a.setState({loading:!0});var n={};u()(t=a.props.fields).call(t,(function(e){var t;void 0!==e.fields?u()(t=e.fields).call(t,(function(e){n[e.name]=a.state.item[e.name]})):n[e.name]=a.state.item[e.name]})),void 0!==a.props.params.id&&(n.id=a.props.params.id),a.props.endpoint&&q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:a.props.endpoint,action:"save",data:n}).always((function(){a.setState({loading:!1})})).done((function(){void 0!==a.props.onSuccess?a.props.onSuccess():a.props.history.push("/"),void 0!==a.props.params.id?a.props.messages.onUpdate():a.props.messages.onCreate()})).fail((function(e){e.errors.length>0&&a.setState({errors:e.errors})}))}})),y()(K()(a),"handleValueChange",(function(e){var t=e.target,n=t.name,r=t.value;return a.props.onChange?a.props.onChange(e):(a.setState((function(e){var t=e.item;return t[n]=r,{item:t}})),!0)})),a.formRef=R.a.createRef(),a.state={loading:!1,errors:[],item:{}},a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this;void 0!==this.props.params.id?this.loadItem(this.props.params.id):Sa()((function(){e.setState({item:ve()(".mailpoet_form").mailpoetSerializeObject()})}))}},{key:"componentDidUpdate",value:function(){var e=this;void 0===this.props.params.id&&this.state.loading&&(Sa()((function(){e.setState({loading:!1,item:{}})})),void 0===this.props.item&&this.formRef.current.reset())}},{key:"render",value:function(){var e,t,a,n=this;void 0!==this.getErrors()&&(t=x()(a=this.getErrors()).call(a,(function(e){return R.a.createElement("div",{className:"mailpoet_notice notice inline error is-dismissible",key:"error-".concat(e.message)},R.a.createElement("p",null,e.message))})));var r=lt()("mailpoet_form",{mailpoet_form_loading:this.state.loading||this.props.loading}),i=!1,s=!1;void 0!==this.props.beforeFormContent&&(i=this.props.beforeFormContent(this.getValues())),void 0!==this.props.afterFormContent&&(s=this.props.afterFormContent(this.getValues()));var o=x()(e=this.props.fields).call(e,(function(e){var t=n.handleValueChange;return e.onBeforeChange&&(t=function(t){return e.onBeforeChange(t),n.handleValueChange(t)}),R.a.createElement(za,{field:e,item:n.getValues(),onValueChange:t,key:"field-".concat(e.name),automationId:e.automationId})})),l=!1;return l=this.props.children?this.props.children:R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("save"),disabled:this.state.loading}),R.a.createElement("div",null,i,R.a.createElement("form",{id:this.props.id,ref:this.formRef,className:r,onSubmit:void 0!==this.props.onSubmit?this.props.onSubmit:this.handleSubmit,"data-automation-id":this.props.automationId},t,R.a.createElement("table",{className:"form-table"},R.a.createElement("tbody",null,o)),l),s)}}]),t}(R.a.Component);Ua.propTypes={params:Z.a.shape({id:Z.a.string}),item:Z.a.object,errors:Z.a.arrayOf(Z.a.object),endpoint:Z.a.string,fields:Z.a.arrayOf(Z.a.object),messages:Z.a.shape({onUpdate:Z.a.func,onCreate:Z.a.func}),loading:Z.a.bool,children:Z.a.array,id:Z.a.string,automationId:Z.a.string,beforeFormContent:Z.a.func,afterFormContent:Z.a.func,onItemLoad:Z.a.func,isValid:Z.a.func,onChange:Z.a.func,onSubmit:Z.a.func,onSuccess:Z.a.func,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired},Ua.defaultProps={params:{},errors:void 0,fields:void 0,item:void 0,onItemLoad:void 0,isValid:void 0,onSuccess:void 0,onChange:void 0,loading:!1,beforeFormContent:void 0,afterFormContent:void 0,children:void 0,id:"",onSubmit:void 0,automationId:"",messages:{onUpdate:function(){},onCreate:function(){}},endpoint:void 0};var $a=Object(ne.withRouter)(Ua),Wa=[{name:"email",label:q.a.I18n.t("email"),type:"text",disabled:function(e){return Number(e.wp_user_id>0)||1===Number(e.is_woocommerce_user)}},{name:"first_name",label:q.a.I18n.t("firstname"),type:"text",disabled:function(e){return Number(e.wp_user_id>0)||1===Number(e.is_woocommerce_user)}},{name:"last_name",label:q.a.I18n.t("lastname"),type:"text",disabled:function(e){return Number(e.wp_user_id>0)||1===Number(e.is_woocommerce_user)}},{name:"status",label:q.a.I18n.t("status"),type:"select",automationId:"subscriber-status",values:{subscribed:q.a.I18n.t("subscribed"),unconfirmed:q.a.I18n.t("unconfirmed"),unsubscribed:q.a.I18n.t("unsubscribed"),inactive:q.a.I18n.t("inactive"),bounced:q.a.I18n.t("bounced")}},{name:"segments",label:q.a.I18n.t("lists"),type:"selection",placeholder:q.a.I18n.t("selectList"),tip:q.a.I18n.t("welcomeEmailTip"),api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,selected:function(e){var t,a;return!1===nt()(e.subscriptions)?null:x()(t=h()(a=e.subscriptions).call(a,(function(e){return"subscribed"===e.status}))).call(t,(function(e){return e.segment_id}))},filter:function(e){return!e.deleted_at&&"default"===e.type},getLabel:function(e){var t;return E()(t="".concat(e.name," (")).call(t,e.subscribers,")")},getSearchLabel:function(e,t){var a,n="";void 0!==t.subscriptions&&u()(a=t.subscriptions).call(a,(function(t){if(e.id===t.segment_id&&(n=e.name,"unsubscribed"===t.status)){var a=q.a.Date.format(t.updated_at);n+=" (%$1s)".replace("%$1s",q.a.I18n.t("unsubscribedOn").replace("%$1s",a))}}));return n}}],Ha=window.mailpoet_custom_fields||[];u()(Ha).call(Ha,(function(e){var t={name:"cf_".concat(e.id),label:e.name,type:e.type};switch(e.params&&(t.params=e.params),ce()(e.params)&&(t.values=ce()(e.params)),e.type){case"date":t.year_placeholder=q.a.I18n.t("year"),t.month_placeholder=q.a.I18n.t("month"),t.day_placeholder=q.a.I18n.t("day");break;case"select":t.placeholder="-";break;default:t.placeholder=""}Wa.push(t)}));var Ka={onUpdate:function(){q.a.Notice.success(q.a.I18n.t("subscriberUpdated"))},onCreate:function(){q.a.Notice.success(q.a.I18n.t("subscriberAdded")),q.a.trackEvent("Subscribers > Add new",{"MailPoet Free version":window.mailpoet_version})}};function Ga(e){if(Number(e.wp_user_id)>0)return R.a.createElement("p",{className:"description"},St()(q.a.I18n.t("WPUserEditNotice"),/\[link\](.*?)\[\/link\]/g,(function(t,a){return R.a.createElement("a",{key:a,href:"user-edit.php?user_id=".concat(e.wp_user_id)},t)})))}function Ya(){return R.a.createElement("p",{className:"description"},R.a.createElement("strong",null,q.a.I18n.t("tip"))," ",q.a.I18n.t("customFieldsTip"))}var Ja=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("subscriber"),R.a.createElement(st.b,{className:"page-title-action",to:"/"},q.a.I18n.t("backToList"))),R.a.createElement(Zt,null),R.a.createElement($a,{automationId:"subscriber_edit_form",endpoint:"subscribers",fields:Wa,params:this.props.match.params,messages:Ka,beforeFormContent:Ga,afterFormContent:Ya}))}}]),t}(R.a.Component);Ja.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired};var Qa=Ja,Za=a(482),Xa=a.n(Za),en=function(){var e,t=R.a.useContext(Ge.a).notices;return x()(e=t.items).call(e,(function(e){var t=e.id,a=Xa()(e,["id"]);return R.a.createElement(Qt,pe()({key:t},a))}))},tn=document.getElementById("subscribers_container");tn&&_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{path:"/new",component:Qa}),R.a.createElement(ne.Route,{path:"/edit/:id",component:Qa}),R.a.createElement(ne.Route,{path:"*",component:ka}))))}),null),tn);var an=a(483),nn=a.n(an),rn=a(31),sn=a.n(rn),on=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){q.a.Modal.loading(!0)}},{key:"componentWillUnmount",value:function(){q.a.Modal.loading(!1)}},{key:"render",value:function(){return null}}]),t}(R.a.Component),ln=function(e){var t=e.tabs,a=e.selected,n=e.select;return R.a.createElement("div",{className:"wp-filter hide-if-no-js"},R.a.createElement("ul",{className:"filter-links"},x()(t).call(t,(function(e){var t=e.name,r=e.label;return R.a.createElement("li",{key:t},R.a.createElement("a",{href:"#",className:a===t?"current":"",onClick:function(e){e.preventDefault(),n(t)}}," ",r))}))))};ln.propTypes={selected:Z.a.string.isRequired,select:Z.a.func.isRequired,tabs:Z.a.arrayOf(Z.a.shape({label:Z.a.string.isRequired,name:Z.a.string.isRequired}).isRequired).isRequired};var cn=ln,un=function(e){return q.a.Modal.popup({title:e.title,template:ut.a.renderToString(R.a.createElement(R.a.Fragment,null,R.a.createElement("p",null,e.message),R.a.createElement("button",{id:"mailpoet_alert_cancel",className:"button button-secondary",type:"button"},e.cancelLabel),R.a.createElement("button",{id:"mailpoet_alert_confirm",className:"button button-primary",type:"submit"},e.confirmLabel))),onInit:function(){document.getElementById("mailpoet_alert_confirm").addEventListener("click",(function(){q.a.Modal.close(),e.onConfirm()})),document.getElementById("mailpoet_alert_cancel").addEventListener("click",(function(){return q.a.Modal.close()}))}}),null};function pn(e){ut.a.renderToString(R.a.createElement(un,{title:e.title,message:e.message,cancelLabel:e.cancelLabel,confirmLabel:e.confirmLabel,onConfirm:e.onConfirm}))}un.propTypes={title:Z.a.string,message:Z.a.string.isRequired,cancelLabel:Z.a.string,confirmLabel:Z.a.string,onConfirm:Z.a.func.isRequired},un.defaultProps={title:q.a.I18n.t("confirmTitle"),cancelLabel:q.a.I18n.t("cancelLabel"),confirmLabel:q.a.I18n.t("confirmLabel")};var dn=function(e){function t(e){var a,n,r,i;return M()(this,t),(i=U()(this,W()(t).call(this,e))).onPreview=F()(a=i.onPreview).call(a,K()(i)),i.onDelete=F()(n=i.onDelete).call(n,K()(i)),i.onSelect=F()(r=i.onSelect).call(r,K()(i)),i}return Y()(t,e),B()(t,[{key:"onDelete",value:function(){var e=this,t=this.props,a=t.id,n=t.name,r=t.beforeDelete,i=t.afterDelete;pn({message:q.a.I18n.t("confirmTemplateDeletion").replace("%$1s",n),onConfirm:function(){r(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"delete",data:{id:a}}).done((function(){i(!0,a)})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0});i(!1)}))}})}},{key:"onPreview",value:function(){q.a.Modal.popup({title:this.props.name,template:'<img src="{{ thumbnail }}" />',data:this.props})}},{key:"onSelect",value:function(){var e=this,t=this.props,a=t.newsletterId,n=t.name,r=t.beforeSelect,i=t.afterSelect;r(),q.a.trackEvent("Emails > Template selected",{"MailPoet Free version":window.mailpoet_version,"Email name":n}),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"save",data:{id:a,template_id:this.props.id}}).done((function(e){i(!0,e.data.id)})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0});i(!1)}))}},{key:"render",value:function(){var e=this,t=this.props,a=t.index,n=t.name,r=t.thumbnail,i=t.readonly,s=R.a.createElement("button",{className:"mailpoet_delete button button-secondary",onClick:this.onDelete,type:"button"},q.a.I18n.t("delete")),o="";return"string"==typeof r&&r.length>0&&(o=R.a.createElement("a",{href:"#",onClick:function(t){t.preventDefault(),e.onPreview(t)}},R.a.createElement("img",{src:r,alt:q.a.I18n.t("templatePreview"),loading:"lazy"}),R.a.createElement("div",{className:"mailpoet_overlay"},R.a.createElement("p",{className:"mailpoet_more_details"},q.a.I18n.t("zoom"))))),R.a.createElement("li",{className:"mailpoet_template_boxes","data-automation-id":"select_template_box"},R.a.createElement("div",{className:"mailpoet_thumbnail"},o),R.a.createElement("div",{className:"mailpoet_template_content"},R.a.createElement("div",{className:"mailpoet_description"},R.a.createElement("h3",null,n)),R.a.createElement("div",{className:"mailpoet_actions"},!0!==i&&s,R.a.createElement("a",{className:"button button-primary","data-automation-id":"select_template_".concat(a),onClick:this.onSelect,role:"button",tabIndex:0,onKeyDown:function(t){var a,n;C()(a=["keydown","keypress"]).call(a,t.type)&&C()(n=["Enter"," "]).call(n,t.key)&&(t.preventDefault(),e.onSelect())}}," ",q.a.I18n.t("select")," "))))}}]),t}(R.a.Component);dn.contextType=Ge.a,dn.propTypes={index:Z.a.number.isRequired,id:Z.a.number.isRequired,newsletterId:Z.a.string.isRequired,name:Z.a.string.isRequired,thumbnail:Z.a.string.isRequired,readonly:Z.a.bool.isRequired,beforeDelete:Z.a.func.isRequired,afterDelete:Z.a.func.isRequired,beforeSelect:Z.a.func.isRequired,afterSelect:Z.a.func.isRequired};var mn=dn,hn=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).fileRef=R.a.createRef(),n.handleSubmit=F()(a=n.handleSubmit).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"saveTemplate",value:function(e){var t,a,n,r,i=this,s=e,o=this.props,l=o.beforeImport,c=o.afterImport;O.a.isUndefined(s.body)||(s.body=oe()(s.body));try{s.categories=JSON.parse(s.categories)}catch(e){s.categories=[]}-1===sn()(t=s.categories).call(t,"saved")&&s.categories.push("saved"),-1===sn()(a=s.categories).call(a,"standard")&&-1===sn()(n=s.categories).call(n,"welcome")&&-1===sn()(r=s.categories).call(r,"notification")&&s.categories.push("standard"),s.categories=oe()(s.categories),l(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"save",data:s}).done((function(e){c(!0,e.data)})).fail((function(e){var t;e.errors.length>0&&i.context.notices.error(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0});c(!1)}))}},{key:"handleSubmit",value:function(e){var t=this;if(e.preventDefault(),O.a.size(this.fileRef.current.files)<=0)return!1;var a=O.a.first(this.fileRef.current.files),n=new FileReader;return n.onload=function(e){try{t.saveTemplate(JSON.parse(e.target.result)),q.a.trackEvent("Emails > Template imported",{"MailPoet Free version":window.mailpoet_version})}catch(e){t.context.notices.error(R.a.createElement("p",null,q.a.I18n.t("templateFileMalformedError")))}},n.readAsText(a),!0}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("importTemplateTitle"),R.a.createElement(qt.a,{tooltip:q.a.I18n.t("helpTooltipTemplateUpload"),place:"right",className:"tooltip-help-import-template"})),R.a.createElement("form",{onSubmit:this.handleSubmit},R.a.createElement("input",{type:"file",placeholder:q.a.I18n.t("selectJsonFileToUpload"),ref:this.fileRef}),R.a.createElement("p",{className:"submit"},R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("upload")}))))}}]),t}(R.a.Component);hn.contextType=Ge.a,hn.propTypes={beforeImport:Z.a.func.isRequired,afterImport:Z.a.func.isRequired};var fn=hn,gn=[{name:"standard",label:q.a.I18n.t("tabStandardTitle")},{name:"welcome",label:q.a.I18n.t("tabWelcomeTitle")},{name:"notification",label:q.a.I18n.t("tabNotificationTitle")},{name:"blank",label:q.a.I18n.t("tabBlankTitle")}];window.mailpoet_woocommerce_active&&gn.push({name:"woocommerce",label:q.a.I18n.t("tabWoocommerceTitle")}),gn.push.apply(gn,[{name:"recent",label:q.a.I18n.t("recentlySent")},{name:"saved",label:q.a.I18n.t("savedTemplates")}]);var vn=function(e){function t(e){var a,n,r,i,s;return M()(this,t),(s=U()(this,W()(t).call(this,e))).state={loading:!0,templates:{},emailType:null,selectedTab:""},s.templates={},s.addTemplate=F()(a=s.addTemplate).call(a,K()(s)),s.afterTemplateDelete=F()(n=s.afterTemplateDelete).call(n,K()(s)),s.afterTemplateSelect=F()(r=s.afterTemplateSelect).call(r,K()(s)),s.afterTemplateImport=F()(i=s.afterTemplateImport).call(i,K()(s)),s}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this;q.a.Ajax.get({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"getAll"}).done((function(t){var a;0===t.data.length&&(t.data=[{name:q.a.I18n.t("mailpoetGuideTemplateTitle"),categories:'["welcome", "notification", "standard", "woocommerce"]',readonly:!0}]),u()(a=t.data).call(a,e.addTemplate),e.sortTemplates()})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})})).always((function(){e.selectInitialTab()}))}},{key:"addTemplate",value:function(e){var t,a=this,n=x()(gn).call(gn,(function(e){return e.name}));-1===sn()(n).call(n,"woocommerce")&&n.push("woocommerce");try{var r;t=h()(r=JSON.parse(e.categories)).call(r,(function(e){return-1!==sn()(n).call(n,e)}))}catch(e){t=[]}0===t.length&&t.push("saved"),u()(t).call(t,(function(t){void 0===a.templates[t]&&(a.templates[t]=[]),a.templates[t].unshift(e)}))}},{key:"sortTemplates",value:function(){var e,t=this;u()(e=b()(this.templates)).call(e,(function(e){var a;nn()(a=t.templates[e]).call(a,(function(e,t){return e.id<t.id?1:-1}))}))}},{key:"selectInitialTab",value:function(){var e,t=this,a="standard";q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:this.props.match.params.id}}).done((function(t){e=t.data.type,O.a.findWhere(gn,{name:t.data.type})?a=t.data.type:"automatic"===t.data.type&&O.a.findWhere(gn,{name:t.data.options.group})&&(a=t.data.options.group)})).fail((function(e){var a;e.errors.length>0&&t.context.notices.error(x()(a=e.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})})).always((function(){t.setState({templates:t.templates,emailType:e,selectedTab:a,loading:!1})}))}},{key:"afterTemplateDelete",value:function(e,t){var a,n=this;e&&u()(a=b()(this.templates)).call(a,(function(e){var a;n.templates[e]=h()(a=n.templates[e]).call(a,(function(e){return e.id!==t}))}));this.setState({templates:this.templates,loading:!1})}},{key:"afterTemplateSelect",value:function(e,t){e?window.location=function(e){return"admin.php?page=mailpoet-newsletter-editor&id=".concat(e)}(t):this.setState({loading:!1})}},{key:"afterTemplateImport",value:function(e,t){e&&this.addTemplate(t),this.setState({templates:this.templates,selectedTab:e?"saved":"import",loading:!1})}},{key:"render",value:function(){var e=this;if(this.state.loading)return R.a.createElement(on,null);var t=E()(gn).call(gn,{name:"import",label:q.a.I18n.t("tabImportTitle")}),a=null;if("import"===this.state.selectedTab)a=R.a.createElement(fn,{beforeImport:function(){return e.setState({loading:!0})},afterImport:this.afterTemplateImport});else{var n=this.state.templates[this.state.selectedTab]||[];n=0===n.length?this.state.loading?null:R.a.createElement("p",null,q.a.I18n.t("noTemplates")):x()(n).call(n,(function(t,a){return R.a.createElement(mn,{key:t.id,index:a,newsletterId:e.props.match.params.id,beforeDelete:function(){return e.setState({loading:!0})},afterDelete:e.afterTemplateDelete,beforeSelect:function(){return e.setState({loading:!0})},afterSelect:e.afterTemplateSelect,id:t.id,name:t.name,thumbnail:t.thumbnail,readonly:t.readonly})})),a=R.a.createElement("ul",{className:"mailpoet_boxes clearfix"},n)}var r=A.a.applyFilters("mailpoet_newsletters_template_breadcrumb",R.a.createElement(J.a,{step:"template"}),this.state.emailType,"template");return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("selectTemplateTitle")),r,R.a.createElement(cn,{tabs:t,selected:this.state.selectedTab,select:function(t){return e.setState({selectedTab:t})}}),a)}}]),t}(R.a.Component);vn.contextType=Ge.a,vn.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired};var bn=vn,_n=a(54),yn=a.n(_n),wn={closeText:q.a.I18n.t("close"),currentText:q.a.I18n.t("today"),nextText:q.a.I18n.t("next"),prevText:q.a.I18n.t("previous"),monthNames:[q.a.I18n.t("january"),q.a.I18n.t("february"),q.a.I18n.t("march"),q.a.I18n.t("april"),q.a.I18n.t("may"),q.a.I18n.t("june"),q.a.I18n.t("july"),q.a.I18n.t("august"),q.a.I18n.t("september"),q.a.I18n.t("october"),q.a.I18n.t("november"),q.a.I18n.t("december")],monthNamesShort:[q.a.I18n.t("januaryShort"),q.a.I18n.t("februaryShort"),q.a.I18n.t("marchShort"),q.a.I18n.t("aprilShort"),q.a.I18n.t("mayShort"),q.a.I18n.t("juneShort"),q.a.I18n.t("julyShort"),q.a.I18n.t("augustShort"),q.a.I18n.t("septemberShort"),q.a.I18n.t("octoberShort"),q.a.I18n.t("novemberShort"),q.a.I18n.t("decemberShort")],dayNames:[q.a.I18n.t("sunday"),q.a.I18n.t("monday"),q.a.I18n.t("tuesday"),q.a.I18n.t("wednesday"),q.a.I18n.t("thursday"),q.a.I18n.t("friday"),q.a.I18n.t("saturday")],dayNamesShort:[q.a.I18n.t("sundayShort"),q.a.I18n.t("mondayShort"),q.a.I18n.t("tuesdayShort"),q.a.I18n.t("wednesdayShort"),q.a.I18n.t("thursdayShort"),q.a.I18n.t("fridayShort"),q.a.I18n.t("saturdayShort")],dayNamesMin:[q.a.I18n.t("sundayMin"),q.a.I18n.t("mondayMin"),q.a.I18n.t("tuesdayMin"),q.a.I18n.t("wednesdayMin"),q.a.I18n.t("thursdayMin"),q.a.I18n.t("fridayMin"),q.a.I18n.t("saturdayMin")]},En=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"onChange",(function(e){var t=e,n=t.target.value,r=a.getStorageDate(n);t.target.value=r,a.props.onChange(t)})),y()(K()(a),"getFieldName",(function(){return a.props.name||"date"})),y()(K()(a),"getDisplayDate",(function(e){var t={parseFormat:a.props.storageFormat,format:a.props.displayFormat};return q.a.Date.format(e,t)})),y()(K()(a),"getStorageDate",(function(e){var t={parseFormat:a.props.displayFormat,format:a.props.storageFormat};return q.a.Date.format(e,t)})),a.dateInput=R.a.createRef(),a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=ve()(this.dateInput.current),t=this;e.datepicker&&(ve.a.datepicker.parseDate=function(e,t){return q.a.Date.toDate(t,{parseFormat:this.props.displayFormat,format:e})},ve.a.datepicker.formatDate=function(e,t){return q.a.Date.format(t,{format:e})},e.datepicker(O.a.extend({dateFormat:this.props.displayFormat,firstDay:window.mailpoet_start_of_week,isRTL:!1,onSelect:function(e){t.onChange({target:{name:t.getFieldName(),value:e}})}},wn)),this.datepickerInitialized=!0)}},{key:"componentWillUnmount",value:function(){this.datepickerInitialized&&ve()(this.dateInput.current).datepicker("destroy")}},{key:"render",value:function(){return R.a.createElement("input",pe()({type:"text",size:"30",name:this.getFieldName(),value:this.getDisplayDate(this.props.value),readOnly:!0,disabled:this.props.disabled,onChange:this.onChange,ref:this.dateInput},this.props.validation))}}]),t}(R.a.Component);En.propTypes={displayFormat:Z.a.string.isRequired,onChange:Z.a.func.isRequired,name:Z.a.string,storageFormat:Z.a.string.isRequired,value:Z.a.string.isRequired,disabled:Z.a.bool.isRequired,validation:Z.a.object.isRequired},En.defaultProps={name:"date"};var kn=En,In=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this,a=x()(e=b()(this.props.timeOfDayItems)).call(e,(function(e){return R.a.createElement("option",{key:"option-".concat(t.props.timeOfDayItems[e]),value:e},t.props.timeOfDayItems[e])}));return R.a.createElement("select",pe()({name:this.props.name||"time",value:this.props.value,disabled:this.props.disabled,onChange:this.props.onChange},this.props.validation),a)}}]),t}(R.a.Component);In.propTypes={timeOfDayItems:Z.a.objectOf(Z.a.string).isRequired,name:Z.a.string,value:Z.a.string.isRequired,disabled:Z.a.bool,onChange:Z.a.func.isRequired,validation:Z.a.object},In.defaultProps={name:"time",disabled:!1,validation:{}};var Sn=In,Cn=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"DATE_TIME_SEPARATOR"," "),y()(K()(a),"getDateTime",(function(){return[a.state.date,a.state.time].join(a.DATE_TIME_SEPARATOR)})),y()(K()(a),"buildStateFromProps",(function(e){var t=(e.value||a.props.defaultDateTime).split(a.DATE_TIME_SEPARATOR),n=Ne()(t,2);return{date:n[0],time:n[1]}})),y()(K()(a),"handleChange",(function(e){var t={};t[e.target.name]=e.target.value,a.setState(t,a.propagateChange)})),y()(K()(a),"propagateChange",(function(){a.props.onChange&&a.props.onChange({target:{name:a.props.name||"",value:a.getDateTime()}})})),a.state=a.buildStateFromProps(e),a}return Y()(t,e),B()(t,[{key:"componentDidUpdate",value:function(e){var t=this;this.props.value===e.value&&this.props.defaultDateTime===e.defaultDateTime||Sa()((function(){t.setState(t.buildStateFromProps(t.props))}))}},{key:"render",value:function(){return R.a.createElement("span",null,R.a.createElement(kn,{name:"date",value:this.state.date,onChange:this.handleChange,displayFormat:this.props.dateDisplayFormat,storageFormat:this.props.dateStorageFormat,disabled:this.props.disabled,validation:this.props.dateValidation}),R.a.createElement(Sn,{name:"time",value:this.state.time,onChange:this.handleChange,disabled:this.props.disabled,validation:this.props.timeValidation,timeOfDayItems:this.props.timeOfDayItems}))}}]),t}(R.a.Component);Cn.propTypes={value:Z.a.string,defaultDateTime:Z.a.string.isRequired,dateDisplayFormat:Z.a.string.isRequired,dateStorageFormat:Z.a.string.isRequired,onChange:Z.a.func,name:Z.a.string,disabled:Z.a.bool,dateValidation:Z.a.object.isRequired,timeValidation:Z.a.any,timeOfDayItems:Z.a.objectOf(Z.a.string).isRequired},Cn.defaultProps={onChange:void 0,name:"",disabled:!1,timeValidation:void 0,value:void 0};var Nn=Cn,xn=window.location.hostname.replace("www.",""),Tn="contact@".concat(xn),Rn=function(e){var t,a=e.emailAddress;if(e.mssActive)return null;var n=a.split("@").pop().toLowerCase();return sn()(t=window.mailpoet_free_domains).call(t,n)>-1?R.a.createElement(R.a.Fragment,null,R.a.createElement("p",{className:"sender_email_address_warning","data-acceptance-id":"freemail-sender-warning-old-installation"},q.a.I18n.t("senderEmailAddressWarning1")),R.a.createElement("p",{className:"sender_email_address_warning"},St()(q.a.I18n.t("senderEmailAddressWarning2"),/(%1\$s|%2\$s|<em>.*<\/em>)/,(function(e){return"%1$s"===e?Tn:"%2$s"===e?R.a.createElement("em",{key:"sender-email"},a):R.a.createElement("em",{key:"reply-to"},e.replace(/<\/?em>/g,""))}))),R.a.createElement("p",{className:"sender_email_address_warning"},R.a.createElement("a",{href:"https://kb.mailpoet.com/article/259-your-from-address-cannot-be-yahoo-com-gmail-com-outlook-com","data-beacon-article":"5be5911104286304a71c176e",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("senderEmailAddressWarning3")))):null};Rn.propTypes={emailAddress:Z.a.string.isRequired,mssActive:Z.a.bool.isRequired};var Pn=Rn,On=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).state={emailAddress:e.item.sender_address},n.onChange=F()(a=n.onChange).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"onChange",value:function(e){this.setState({emailAddress:e.target.value}),this.props.onValueChange(e)}},{key:"render",value:function(){return R.a.createElement(R.a.Fragment,null,R.a.createElement(De,{item:this.props.item,field:this.props.field,onValueChange:this.onChange}),R.a.createElement("div",{className:"regular-text"},R.a.createElement(Pn,{emailAddress:this.state.emailAddress,mssActive:window.mailpoet_mss_active})))}}]),t}(R.a.Component);On.propTypes={field:Z.a.object.isRequired,item:Z.a.shape({sender_address:Z.a.string.isRequired}).isRequired,onValueChange:Z.a.func},On.defaultProps={onValueChange:function(){}};var Dn=On,An=window.mailpoet_current_time||"00:00",qn="".concat(window.mailpoet_current_date," 00:00:00"),Ln=window.mailpoet_schedule_time_of_day,Fn=window.mailpoet_date_display_format,jn=window.mailpoet_date_storage_format,Mn=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"getCurrentValue",(function(){var e={isScheduled:"0",scheduledAt:qn};return O.a.defaults(n.props.item[n.props.field.name]||{},e)})),y()(K()(n),"getDateValidation",(function(){return{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("noScheduledDateError"),"data-parsley-errors-container":"#mailpoet_scheduling"}})),y()(K()(n),"isScheduled",(function(){return"1"===n.getCurrentValue().isScheduled})),y()(K()(n),"handleCheckboxChange",(function(e){var t=e;return t.target.value=e.target.checked?"1":"0",n.handleValueChange(t)})),y()(K()(n),"handleValueChange",(function(e){var t=n.getCurrentValue(),a={};return a[e.target.name]=e.target.value,n.props.onValueChange({target:{name:n.props.field.name,value:O.a.extend({},t,a)}})})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e;return this.isScheduled()&&(e=R.a.createElement("span",{id:"mailpoet_scheduling"},R.a.createElement(Nn,{name:"scheduledAt",value:this.getCurrentValue().scheduledAt,onChange:this.handleValueChange,disabled:this.props.field.disabled,dateValidation:this.getDateValidation(),defaultDateTime:qn,timeOfDayItems:Ln,dateDisplayFormat:Fn,dateStorageFormat:jn})," ",R.a.createElement("span",null,q.a.I18n.t("websiteTimeIs")," ",R.a.createElement("code",null,An)))),R.a.createElement("div",null,R.a.createElement("input",{type:"checkbox",value:"1",checked:this.isScheduled(),disabled:this.props.field.disabled,name:"isScheduled",onChange:this.handleCheckboxChange}),e)}}]),t}(R.a.Component);Mn.propTypes={item:Z.a.object,field:Z.a.shape({name:Z.a.string.isRequired,disabled:Z.a.bool}).isRequired,onValueChange:Z.a.func.isRequired},Mn.defaultProps={item:{}};var Vn=[{name:"subject",label:q.a.I18n.t("subjectLine"),tip:q.a.I18n.t("subjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("emptySubjectLineError")}},{name:"segments",label:q.a.I18n.t("segments"),tip:q.a.I18n.t("segmentsTip"),type:"selection",placeholder:q.a.I18n.t("selectSegmentPlaceholder"),id:"mailpoet_segments",api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,filter:function(e){return!e.deleted_at},getLabel:function(e){var t;return E()(t="".concat(e.name," (")).call(t,Se()(e.subscribers,10).toLocaleString(),")")},transformChangedValue:function(e){var t=this.getItems();return x()(O.a).call(O.a,e,(function(e){return me()(O.a).call(O.a,t,(function(t){return t.id===e}))}))},validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("noSegmentsSelectedError")}},{name:"sender",label:q.a.I18n.t("sender"),tip:q.a.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:q.a.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"reactComponent",component:Dn,placeholder:q.a.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:q.a.I18n.t("replyTo"),tip:q.a.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:q.a.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:q.a.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]},pa,{name:"options",label:q.a.I18n.t("scheduleIt"),type:"reactComponent",component:Mn}];Vn=A.a.applyFilters("mailpoet_newsletters_3rd_step_fields",Vn);var Bn={getFields:function(){return Vn},getSendButtonOptions:function(e){var t=e||{},a={value:"object"===yn()(t.options)&&"1"===t.options.isScheduled?q.a.I18n.t("schedule"):q.a.I18n.t("send")};return"sent"!==t.status&&"sending"!==t.status||(a.disabled="disabled"),a}},zn={name:"intervalType",values:Le},Un={name:"timeOfDay",values:Fe},$n={name:"weekDay",values:je},Wn={name:"monthDay",values:Me},Hn={name:"nthWeekDay",values:Ve},Kn=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"getCurrentValue",(function(){return n.props.item[n.props.field.name]||{}})),y()(K()(n),"handleValueChanges",(function(e){var t=n.getCurrentValue();return n.props.onValueChange({target:{name:n.props.field.name,value:O.a.extend({},t,e)}})})),y()(K()(n),"handleIntervalChange",(function(e){var t=e.target.value,a={};a.intervalType=t,"monthly"===t&&(a.monthDay="1"),n.handleValueChanges(a)})),y()(K()(n),"handleTimeOfDayChange",(function(e){return n.handleValueChanges({timeOfDay:e.target.value})})),y()(K()(n),"handleWeekDayChange",(function(e){return n.handleValueChanges({weekDay:e.target.value})})),y()(K()(n),"handleMonthDayChange",(function(e){return n.handleValueChanges({monthDay:e.target.value})})),y()(K()(n),"handleNthWeekDayChange",(function(e){return n.handleValueChanges({nthWeekDay:e.target.value})})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t,a,n,r=this.getCurrentValue();return"immediately"!==r.intervalType&&(e=R.a.createElement(Ta,{field:Un,item:this.getCurrentValue(),onValueChange:this.handleTimeOfDayChange})),"weekly"!==r.intervalType&&"nthWeekDay"!==r.intervalType||(t=R.a.createElement(Ta,{field:$n,item:this.getCurrentValue(),onValueChange:this.handleWeekDayChange})),"monthly"===r.intervalType&&(a=R.a.createElement(Ta,{field:Wn,item:this.getCurrentValue(),onValueChange:this.handleMonthDayChange})),"nthWeekDay"===r.intervalType&&(n=R.a.createElement(Ta,{field:Hn,item:this.getCurrentValue(),onValueChange:this.handleNthWeekDayChange})),R.a.createElement("div",null,R.a.createElement(Ta,{field:zn,item:this.getCurrentValue(),onValueChange:this.handleIntervalChange,automationId:"newsletter_interval_type"}),n,a,t,e)}}]),t}(R.a.Component);Kn.propTypes={item:Z.a.object.isRequired,field:Z.a.shape({name:Z.a.string}).isRequired,onValueChange:Z.a.func.isRequired};var Gn=Kn,Yn=[{name:"subject",label:q.a.I18n.t("subjectLine"),tip:q.a.I18n.t("postNotificationSubjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("emptySubjectLineError")}},{name:"options",label:q.a.I18n.t("selectFrequency"),type:"reactComponent",component:Gn},{name:"segments",label:q.a.I18n.t("segments"),tip:q.a.I18n.t("segmentsTip"),type:"selection",placeholder:q.a.I18n.t("selectSegmentPlaceholder"),id:"mailpoet_segments",api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,filter:function(e){return!e.deleted_at},getLabel:function(e){var t;return E()(t="".concat(e.name," (")).call(t,Se()(e.subscribers,10).toLocaleString(),")")},transformChangedValue:function(e){var t=this.getItems();return x()(O.a).call(O.a,e,(function(e){return me()(O.a).call(O.a,t,(function(t){return t.id===e}))}))},validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("noSegmentsSelectedError")}},{name:"sender",label:q.a.I18n.t("sender"),tip:q.a.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:q.a.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"reactComponent",component:Dn,placeholder:q.a.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:q.a.I18n.t("replyTo"),tip:q.a.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:q.a.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:q.a.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]},pa];Yn=A.a.applyFilters("mailpoet_newsletters_3rd_step_fields",Yn);var Jn={getFields:function(){return Yn},getSendButtonOptions:function(){return{value:q.a.I18n.t("activate")}}},Qn=window.mailpoet_roles||{},Zn=h()(O.a).call(O.a,window.mailpoet_segments||[],(function(e){return"default"===e.type})),Xn={name:"event",values:{segment:q.a.I18n.t("onSubscriptionToList"),user:q.a.I18n.t("onWPUserRegistration")}},er={name:"segment",values:O.a.object(x()(O.a).call(O.a,Zn,(function(e){var t,a=E()(t="".concat(e.name," (")).call(t,Se()(e.subscribers,10).toLocaleString(),")");return[e.id,a]}))),sortBy:function(e,t){return t.toLowerCase()}},tr={name:"role",values:Qn},ar={name:"afterTimeNumber",size:3},nr={name:"afterTimeType",values:qe},rr=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"getCurrentValue",(function(){return n.props.item[n.props.field.name]||{}})),y()(K()(n),"handleValueChange",(function(e,t){var a=n.getCurrentValue(),r={};return r[e]=t,n.props.onValueChange({target:{name:n.props.field.name,value:O.a.extend({},a,r)}})})),y()(K()(n),"handleEventChange",(function(e){return n.handleValueChange("event",e.target.value)})),y()(K()(n),"handleSegmentChange",(function(e){return n.handleValueChange("segment",e.target.value)})),y()(K()(n),"handleRoleChange",(function(e){return n.handleValueChange("role",e.target.value)})),y()(K()(n),"handleAfterTimeNumberChange",(function(e){return n.handleValueChange("afterTimeNumber",e.target.value)})),y()(K()(n),"handleAfterTimeTypeChange",(function(e){return n.handleValueChange("afterTimeType",e.target.value)})),y()(K()(n),"handleNext",(function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:"welcome",options:n.state}}).done((function(e){n.showTemplateSelection(e.data.id)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))})),y()(K()(n),"showTemplateSelection",(function(e){n.props.history.push("/template/".concat(e))})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t,a=this.getCurrentValue();return e="user"===a.event?R.a.createElement(Ta,{field:tr,item:this.getCurrentValue(),onValueChange:this.handleRoleChange}):R.a.createElement(Ta,{field:er,item:this.getCurrentValue(),onValueChange:this.handleSegmentChange}),"immediate"!==a.afterTimeType&&(t=R.a.createElement(De,{field:ar,item:this.getCurrentValue(),onValueChange:this.handleAfterTimeNumberChange})),R.a.createElement("div",null,R.a.createElement(Ta,{field:Xn,item:this.getCurrentValue(),onValueChange:this.handleEventChange}),e,t,R.a.createElement(Ta,{field:nr,item:this.getCurrentValue(),onValueChange:this.handleAfterTimeTypeChange}))}}]),t}(R.a.Component);rr.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,item:Z.a.object.isRequired,field:Z.a.shape({name:Z.a.string}).isRequired,onValueChange:Z.a.func.isRequired};var ir=Object(ne.withRouter)(rr),sr=[{name:"subject",label:q.a.I18n.t("subjectLine"),tip:q.a.I18n.t("subjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("emptySubjectLineError")}},{name:"options",label:q.a.I18n.t("sendWelcomeEmailWhen"),type:"reactComponent",component:ir},{name:"sender",label:q.a.I18n.t("sender"),tip:q.a.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:q.a.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"reactComponent",component:Dn,placeholder:q.a.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:q.a.I18n.t("replyTo"),tip:q.a.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:q.a.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:q.a.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]},pa];sr=A.a.applyFilters("mailpoet_newsletters_3rd_step_fields",sr);var or={getFields:function(){return sr},getSendButtonOptions:function(){return{value:q.a.I18n.t("activate")}}},lr=a(295),cr=a(485),ur=a.n(cr),pr=function(e,t){var a,n=ur()(t,{lower:!0}).replace(/[^a-z0-9]+/g,"-").replace(/-$/,"");return E()(a="".concat(n||"newsletter","_")).call(a,e)},dr=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"getFieldsByNewsletter",(function(e){return a.getSubtype(e).getFields(e)})),y()(K()(a),"getSendButtonOptions",(function(){return a.getSubtype(a.state.item).getSendButtonOptions(a.state.item)})),y()(K()(a),"getSubtype",(function(e){switch(e.type){case"notification":return Jn;case"welcome":return or;default:return A.a.applyFilters("mailpoet_newsletters_send_newsletter_fields",Bn,e)}})),y()(K()(a),"getThumbnailPromise",(function(e){return a.state.thumbnailPromise?a.state.thumbnailPromise:Object(lr.b)(e)})),y()(K()(a),"isValid",(function(){return ve()("#mailpoet_newsletter").parsley().isValid()})),y()(K()(a),"isValidFromAddress",Wt()(Ut.a.mark((function e(){var t,n;return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("MailPoet"===window.mailpoet_mta_method){e.next=2;break}return e.abrupt("return",!0);case 2:return e.next=4,a.loadAuthorizedEmailAddresses();case 4:return t=e.sent,n=a.state.item.sender_address,e.abrupt("return",-1!==sn()(t).call(t,n));case 7:case"end":return e.stop()}}),e)})))),y()(K()(a),"showInvalidFromAddressError",(function(){var e=St()(q.a.I18n.t("newsletterInvalidFromAddress"),"%$1s",(function(){return a.state.item.sender_address}));e=St()(e,/\[link\](.*?)\[\/link\]/g,(function(e){return'<a href="https://account.mailpoet.com/authorization" target="_blank" rel="noopener noreferrer">'.concat(e,"</a>")})),ve()("#field_sender_address").parsley().addError("invalidFromAddress",{message:e.join(""),updateClass:!0})})),y()(K()(a),"removeInvalidFromAddressError",(function(){ve()("#field_sender_address").parsley().removeError("invalidFromAddress",{updateClass:!0})})),y()(K()(a),"loadItem",(function(e){return a.setState({loading:!0}),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:e}}).done((function(e){var t="draft"===e.data.status?a.getThumbnailPromise(e.meta.preview_url):null,n=e.data;n.ga_campaign||(n.ga_campaign=pr(n.id,n.subject)),a.setState({item:e.data,fields:a.getFieldsByNewsletter(e.data),thumbnailPromise:t})})).fail((function(){a.setState({item:{}},(function(){a.props.history.push("/new")}))}))})),y()(K()(a),"saveTemplate",(function(e,t){a.getThumbnailPromise(e.meta.preview_url).then((function(n){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"save",data:{newsletter_id:e.data.id,name:e.data.subject,thumbnail:n,body:oe()(e.data.body),categories:'["recent"]'}}).fail((function(e){a.showError(e),a.setState({loading:!1}),q.a.Modal.loading(!1)})),t()})).catch((function(e){a.showError({errors:[e]})}))})),y()(K()(a),"loadAuthorizedEmailAddresses",Wt()(Ut.a.mark((function e(){var t;return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("MailPoet"===window.mailpoet_mta_method){e.next=2;break}return e.abrupt("return",[]);case 2:return e.next=4,q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"mailer",action:"getAuthorizedEmailAddresses"});case 4:return t=e.sent,e.abrupt("return",t.data||[]);case 6:case"end":return e.stop()}}),e)})))),y()(K()(a),"handleSend",(function(e){return e.preventDefault(),a.removeInvalidFromAddressError(),a.isValid()?(q.a.Modal.loading(!0),a.isValidFromAddress().then((function(t){return t?a.saveNewsletter(e).done((function(){a.setState({loading:!0})})).done((function(e){switch(e.data.type){case"notification":case"welcome":return a.activateNewsletter(e);default:return a.sendNewsletter(e)}})).fail((function(e){a.showError(e),a.setState({loading:!1}),q.a.Modal.loading(!1)})):(a.showInvalidFromAddressError(),q.a.Modal.loading(!1))}))):ve()("#mailpoet_newsletter").parsley().validate()})),y()(K()(a),"sendNewsletter",(function(e){return q.a.Ajax.post(A.a.applyFilters("mailpoet_newsletters_send_server_request_parameters",{api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"add",data:{newsletter_id:a.state.item.id}},a.state.item)).done((function(t){a.saveTemplate(e,(function(){if(window.mailpoet_show_congratulate_after_first_newsletter)return q.a.Modal.loading(!1),void a.props.history.push("/send/congratulate/".concat(a.state.item.id));a.props.history.push(A.a.applyFilters("mailpoet_newsletters_send_server_request_response_redirect","/".concat(a.state.item.type||""),a.state.item));var e=A.a.applyFilters("mailpoet_newsletters_send_server_request_response",a.state.item,t);O.a.isFunction(e)?e():"scheduled"===t.data.status?(a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterHasBeenScheduled"))),q.a.trackEvent("Emails > Newsletter sent",{scheduled:!0,"MailPoet Free version":window.mailpoet_version})):(a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterBeingSent")),{id:"mailpoet_notice_being_sent"}),q.a.trackEvent("Emails > Newsletter sent",{scheduled:!1,"MailPoet Free version":window.mailpoet_version})),q.a.Modal.loading(!1)}))})).fail((function(e){a.showError(e),a.setState({loading:!1}),q.a.Modal.loading(!1)}))})),y()(K()(a),"activateNewsletter",(function(e){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:a.props.match.params.id,status:"active"}}).done((function(t){a.saveTemplate(e,(function(){if(window.mailpoet_show_congratulate_after_first_newsletter)return q.a.Modal.loading(!1),void a.props.history.push("/send/congratulate/".concat(a.state.item.id));a.props.history.push("/".concat(a.state.item.type||""));var e,n=a.state.item.options;"welcome"===t.data.type?(a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("welcomeEmailActivated"))),q.a.trackEvent("Emails > Welcome email activated",{"MailPoet Free version":window.mailpoet_version,"List type":n.event,Delay:E()(e="".concat(n.afterTimeNumber," ")).call(e,n.afterTimeType)})):"notification"===t.data.type&&(a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("postNotificationActivated"))),q.a.trackEvent("Emails > Post notifications activated",{"MailPoet Free version":window.mailpoet_version,Frequency:n.intervalType}));q.a.Modal.loading(!1)}))})).fail((function(e){a.showError(e),a.setState({loading:!1}),q.a.Modal.loading(!1)}))})),y()(K()(a),"handleResume",(function(e){return e.preventDefault(),a.isValid()?a.saveNewsletter(e).done((function(){a.setState({loading:!0})})).done((function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"resume",data:{newsletter_id:a.state.item.id}}).done((function(){a.props.history.push("/".concat(a.state.item.type||"")),a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterSendingHasBeenResumed")))})).fail((function(e){a.showError(e)}))})).fail((function(e){a.showError(e)})).always((function(){a.setState({loading:!1})})):ve()("#mailpoet_newsletter").parsley().validate(),!1})),y()(K()(a),"handleSave",(function(e){e.preventDefault(),a.saveNewsletter(e).done((function(){a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterUpdated")))})).done((function(){var e="automatic"===a.state.item.type?a.state.item.options.group:a.state.item.type;a.props.history.push("/".concat(e||""))})).fail((function(e){a.showError(e)}))})),y()(K()(a),"handleRedirectToDesign",(function(e){e.preventDefault();var t=e.target.href;a.saveNewsletter(e).done((function(){a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterUpdated")))})).done((function(){window.location=t})).fail((function(e){a.showError(e)}))})),y()(K()(a),"saveNewsletter",(function(){var e=a.state.item;e.queue=void 0,a.setState({loading:!0});var t=O.a.omit(e,["preheader","body","created_at","deleted_at","hash","status","updated_at","type"]);return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"save",data:t})})),y()(K()(a),"showError",(function(e){var t;e.errors.length>0&&a.context.notices.error(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})})),y()(K()(a),"handleFormChange",(function(e){var t=e.target.name,n=e.target.value;return a.setState((function(e){var a=e.item,r=a.subject,i=a.ga_campaign;(a[t]=n,"subject"===t)&&(i===pr(a.id,r)&&(a.ga_campaign=pr(a.id,n)));return{item:a}})),!0})),a.state={fields:[],item:{},loading:!0,thumbnailPromise:null},a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this;this.loadItem(this.props.match.params.id).always((function(){e.setState({loading:!1})})),ve()("#mailpoet_newsletter").parsley()}},{key:"componentDidUpdate",value:function(e){var t=this;this.props.match.params.id!==e.match.params.id&&this.loadItem(this.props.match.params.id).always((function(){t.setState({loading:!1})}))}},{key:"render",value:function(){var e,t="sending"===this.state.item.status&&this.state.item.queue&&"paused"===this.state.item.queue.status,a=x()(e=this.state.fields).call(e,(function(e){var a=e;return"segments"!==e.name&&"options"!==e.name||(a.disabled=t),a})),n=this.getSendButtonOptions(),r=A.a.applyFilters("mailpoet_newsletters_send_breadcrumb",R.a.createElement(J.a,{step:"send"}),this.state.item.type,"send"),i=window.mailpoet_subscribers_limit_reached||window.mailpoet_mss_key_pending_approval;return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("finalNewsletterStep")),r,R.a.createElement($a,{id:"mailpoet_newsletter",fields:a,automationId:"newsletter_send_form",item:this.state.item,loading:this.state.loading,onChange:this.handleFormChange,onSubmit:this.handleSave},R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement("p",{className:"submit"},t?R.a.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleResume,value:q.a.I18n.t("resume"),disabled:i}):R.a.createElement("input",pe()({className:"button button-primary",type:"button",onClick:this.handleSend,value:q.a.I18n.t("send")},n,{disabled:i}))," ",R.a.createElement("input",{className:"button button-secondary",type:"submit",value:q.a.I18n.t("saveDraftAndClose")})," ",q.a.I18n.t("orSimply")," ",R.a.createElement("a",{href:"?page=mailpoet-newsletter-editor&id=".concat(this.props.match.params.id),onClick:this.handleRedirectToDesign},q.a.I18n.t("goBackToDesign")),"."),!t&&n.disabled&&"disabled"===n.disabled&&R.a.createElement(qt.a,{tooltip:q.a.I18n.t("helpTooltipSendEmail"),tooltipId:"helpTooltipSendEmail"}),window.mailpoet_mss_key_pending_approval&&R.a.createElement("div",{className:"mailpoet_error"},St()(q.a.I18n.t("pendingKeyApprovalNotice"),/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{key:"pendingKeyApprovalNoticeLink",href:"https://account.mailpoet.com/authorization",target:"_blank",rel:"noopener noreferrer"},e)})))))}}]),t}(R.a.Component);dr.contextType=Ge.a,dr.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var mr=Object(ne.withRouter)(dr);function hr(e){return R.a.createElement("div",{className:"mailpoet_congratulate_success"},R.a.createElement("h1",null,"welcome"===(t=e.newsletter).type?q.a.I18n.t("congratulationsWelcomeEmailSuccessHeader"):"notification"===t.type?q.a.I18n.t("congratulationsPostNotificationSuccessHeader"):"automatic"===t.type?q.a.I18n.t("congratulationsWooSuccessHeader"):"scheduled"===t.status?q.a.I18n.t("congratulationsScheduleSuccessHeader"):q.a.I18n.t("congratulationsSendSuccessHeader")),R.a.createElement("img",{src:e.illustrationImageUrl,alt:"",width:"750",height:"250"}),R.a.createElement("button",{type:"button",className:"button",onClick:e.successClicked},q.a.I18n.t("close")));var t}hr.propTypes={successClicked:Z.a.func.isRequired,illustrationImageUrl:Z.a.string.isRequired,newsletter:Z.a.shape({status:Z.a.string.isRequired,type:Z.a.string.isRequired}).isRequired};var fr=hr,gr=a(67),vr=a.n(gr),br=function(e){var t,a;return e.step>e.steps_count?null:R.a.createElement("div",{className:"mailpoet_stepped_progress_bar"},x()(t=I()(vr()(a=Array(e.steps_count)).call(a))).call(t,(function(t){var a;return R.a.createElement("div",{className:E()(a="\n mailpoet_stepped_progress_bar_step ".concat(t<e.step?"active":""," ")).call(a,t===e.step-1?"current":"","\n "),key:"step_".concat(t)})})))};br.propTypes={steps_count:Z.a.number.isRequired,step:Z.a.number.isRequired};var _r=br,yr=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_flex"},R.a.createElement("div",{className:"mailpoet_welcome_wizard_illustration"},R.a.createElement("img",{src:e.illustrationUrl,alt:""})),R.a.createElement("div",{className:"mailpoet_welcome_wizard_step"},e.displayProgressBar&&e.step<=e.stepsCount?R.a.createElement(_r,{steps_count:e.stepsCount,step:e.step}):null,e.children))};yr.propTypes={illustrationUrl:Z.a.string.isRequired,displayProgressBar:Z.a.bool,step:Z.a.number,stepsCount:Z.a.number,children:Z.a.oneOfType([Z.a.arrayOf(Z.a.node),Z.a.node]).isRequired},yr.defaultProps={displayProgressBar:!0,step:0,stepsCount:-1};var wr=yr,Er=function(){return R.a.createElement("ul",{className:"welcome_wizard_tracking_list"},R.a.createElement("li",null,q.a.I18n.t("welcomeWizardMSSList1")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardMSSList2")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardMSSList4")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardMSSList5")))},kr=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_controls"},R.a.createElement("p",null,R.a.createElement("a",{href:e.mailpoetAccountUrl,target:"_blank",rel:"noopener noreferrer",className:"button button-primary",onClick:function(t){t.preventDefault(),window.open(e.mailpoetAccountUrl),e.next()}},e.nextButtonText)),R.a.createElement("p",null,R.a.createElement("a",{onClick:e.next,role:"button",tabIndex:0,onKeyDown:function(t){var a,n;C()(a=["keydown","keypress"]).call(a,t.type)&&C()(n=["Enter"," "]).call(n,t.key)&&(t.preventDefault(),e.next())}},q.a.I18n.t("welcomeWizardMSSNoThanks"))))};kr.propTypes={mailpoetAccountUrl:Z.a.string.isRequired,next:Z.a.func.isRequired,nextButtonText:Z.a.string.isRequired};var Ir=function(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardMSSFreeTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSFreeSubtitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSFreeListTitle"),":"),R.a.createElement(Er,null),R.a.createElement(kr,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.next,nextButtonText:q.a.I18n.t("welcomeWizardMSSFreeButton")}))};Ir.propTypes={mailpoetAccountUrl:Z.a.string.isRequired,next:Z.a.func.isRequired};var Sr=function(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardMSSNotFreeTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSNotFreeSubtitle"),":"),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSFreeListTitle"),":"),R.a.createElement(Er,null),R.a.createElement(kr,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.next,nextButtonText:q.a.I18n.t("welcomeWizardMSSNotFreeButton")}))};Sr.propTypes={mailpoetAccountUrl:Z.a.string.isRequired,next:Z.a.func.isRequired};var Cr=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},e.subscribersCount<1e3?R.a.createElement(Ir,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.next}):R.a.createElement(Sr,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.next}))};Cr.propTypes={next:Z.a.func.isRequired,subscribersCount:Z.a.number.isRequired,mailpoetAccountUrl:Z.a.string.isRequired};var Nr=Cr;function xr(e){return R.a.createElement("div",{className:"mailpoet_congratulate_success mailpoet_congratulate_mss_pitch"},R.a.createElement(wr,{illustrationUrl:e.MSSPitchIllustrationUrl,displayProgressBar:!1},R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("congratulationsMSSPitchHeader")),R.a.createElement("h2",null,q.a.I18n.t("congratulationsMSSPitchSubHeader")),R.a.createElement("p",null,q.a.I18n.t(e.subscribersCount<1e3?"welcomeWizardMSSFreeSubtitle":"welcomeWizardMSSNotFreeSubtitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSFreeListTitle"),":"),R.a.createElement(Er,null),R.a.createElement(kr,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.onFinish,nextButtonText:q.a.I18n.t("welcomeWizardMSSFreeButton")}))))}xr.propTypes={MSSPitchIllustrationUrl:Z.a.string.isRequired,onFinish:Z.a.func.isRequired,subscribersCount:Z.a.number.isRequired,mailpoetAccountUrl:Z.a.string.isRequired};var Tr=xr;function Rr(e){return window.has_mss_key_specified?R.a.createElement(fr,{successClicked:e.successClicked,illustrationImageUrl:e.illustrationImageUrl,newsletter:e.newsletter}):R.a.createElement(Tr,{MSSPitchIllustrationUrl:e.MSSPitchIllustrationUrl,onFinish:e.successClicked,subscribersCount:e.subscribersCount,mailpoetAccountUrl:e.mailpoetAccountUrl})}function Pr(e){return R.a.createElement(Rr,{successClicked:e.successClicked,illustrationImageUrl:e.illustrationImageUrl,MSSPitchIllustrationUrl:e.MSSPitchIllustrationUrl,newsletter:e.newsletter,subscribersCount:e.subscribersCount,mailpoetAccountUrl:e.mailpoetAccountUrl})}Pr.propTypes={successClicked:Z.a.func.isRequired,illustrationImageUrl:Z.a.string.isRequired,MSSPitchIllustrationUrl:Z.a.string.isRequired,newsletter:Z.a.shape({status:Z.a.string.isRequired,type:Z.a.string.isRequired}).isRequired,subscribersCount:Z.a.number.isRequired,mailpoetAccountUrl:Z.a.string.isRequired},Rr.propTypes={successClicked:Z.a.func.isRequired,illustrationImageUrl:Z.a.string.isRequired,MSSPitchIllustrationUrl:Z.a.string.isRequired,newsletter:Z.a.shape({status:Z.a.string.isRequired,type:Z.a.string.isRequired}).isRequired,subscribersCount:Z.a.number.isRequired,mailpoetAccountUrl:Z.a.string.isRequired};var Or=Pr;function Dr(e){return R.a.createElement("div",{className:"mailpoet_centered"},R.a.createElement("h1",null,q.a.I18n.t("congratulationsSendFailHeader")),R.a.createElement("p",null,St()(q.a.I18n.t("congratulationsSendFailExplain"),/\[link\](.*?)\[\/link\]/g,(function(e,t){return R.a.createElement("a",{key:t,target:"_blank",rel:"noopener noreferrer",href:"https://kb.mailpoet.com/article/231-sending-does-not-work","data-beacon-article":"5a0257ac2c7d3a272c0d7ad6"},e)}))),R.a.createElement("button",{type:"button",className:"button",onClick:e.failClicked},q.a.I18n.t("close")))}Dr.propTypes={failClicked:Z.a.func.isRequired};var Ar=Dr;var qr=function(){return R.a.createElement("div",{className:"mailpoet_loading"},R.a.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_1"}),R.a.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_2"}),R.a.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_3"}))};function Lr(e){return R.a.createElement("div",{className:"mailpoet_newsletter_loading"},R.a.createElement(qr,null),(t=e.showRichLoadingScreen,a=e.illustrationImageUrl,t?R.a.createElement("div",null,R.a.createElement("h1",{className:"mailpoet_newsletter_loading_header"},q.a.I18n.t("congratulationsLoadingHeader")),R.a.createElement("img",{src:a,alt:"",width:"800px",height:"266px"})):R.a.createElement("div",null)));var t,a}Lr.propTypes={illustrationImageUrl:Z.a.string.isRequired,showRichLoadingScreen:Z.a.bool.isRequired};var Fr=Lr;function jr(){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:{show_congratulate_after_first_newsletter:!1}}).always((function(){window.location=window.mailpoet_main_page}))}var Mr=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).state={loading:!0,newsletter:null,testingPassed:!1,timeStart:Dt()(),minimumLoadingTimePassed:!1},n.tick=F()(a=n.tick).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){this.loadNewsletter(this.props.match.params.id),this.tick()}},{key:"componentDidUpdate",value:function(e){e.match.params.id!==this.props.match.params.id&&this.loadNewsletter(this.props.match.params.id)}},{key:"tick",value:function(){Dt()().subtract(20,"second").isAfter(this.state.timeStart)&&this.setState({error:!0,loading:!1}),this.state.loading&&this.loadNewsletter(this.props.match.params.id),Dt()().subtract(6,"seconds").isAfter(this.state.timeStart)&&this.setState({minimumLoadingTimePassed:!0}),!this.state.loading&&this.state.minimumLoadingTimePassed||Yt()(this.tick,2e3)}},{key:"loadNewsletter",value:function(e){var t=this;q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:e}}).done((function(e){return t.newsletterLoaded(e.data)}))}},{key:"newsletterLoaded",value:function(e){"standard"!==e.type||"scheduled"===e.status?this.setState({newsletter:e,loading:!1,minimumLoadingTimePassed:!0}):"sent"===e.status||"sending"===e.status?this.setState({newsletter:e,loading:!1,testingPassed:!0}):this.setState({newsletter:e})}},{key:"renderContent",value:function(){return this.state.loading||!this.state.minimumLoadingTimePassed?(e=!!this.state.newsletter,R.a.createElement(Fr,{illustrationImageUrl:window.mailpoet_congratulations_loading_image,successClicked:jr,showRichLoadingScreen:e})):this.state.error?(q.a.trackEvent("Cron testing done",{"Cron is working":"false"}),R.a.createElement(Ar,{failClicked:function(){window.location=window.mailpoet_main_page}})):(t=this.state.newsletter,this.state.testingPassed&&q.a.trackEvent("Cron testing done",{"Cron is working":"true"}),R.a.createElement(Or,{illustrationImageUrl:window.mailpoet_congratulations_success_image,MSSPitchIllustrationUrl:window.MSS_pitch_illustration_url,successClicked:jr,newsletter:t,isWoocommerceActive:window.mailpoet_woocommerce_active,subscribersCount:window.mailpoet_subscribers_count,mailpoetAccountUrl:window.mailpoet_account_url}));var e,t}},{key:"render",value:function(){return R.a.createElement("div",{className:"newsletter_congratulate_page"},this.renderContent())}}]),t}(R.a.Component);Mr.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired};var Vr=Mr,Br=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"showTemplateSelection",(function(e){n.props.history.push("/template/".concat(e))})),n}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this;q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:"standard"}}).done((function(t){e.showTemplateSelection(t.data.id)})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("regularNewsletterTypeTitle")),R.a.createElement(J.a,{step:"type"}))}}]),t}(R.a.Component);Br.contextType=Ge.a,Br.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var zr=Object(ne.withRouter)(Br),Ur={name:"options",type:"reactComponent",component:Gn},$r=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"handleValueChange",(function(e){var t=a.state;t[e.target.name]=e.target.value,a.setState(t)})),y()(K()(a),"handleNext",(function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:O.a.extend({},a.state,{type:"notification",subject:q.a.I18n.t("draftPostNotificationTitle")})}).done((function(e){a.showTemplateSelection(e.data.id)})).fail((function(e){var t;e.errors.length>0&&a.context.notices.error(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))})),y()(K()(a),"showTemplateSelection",(function(e){a.props.history.push("/template/".concat(e))})),a.state={options:{intervalType:"daily",timeOfDay:0,weekDay:1,monthDay:0,nthWeekDay:1}},a}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("postNotificationNewsletterTypeTitle")),R.a.createElement(J.a,{step:"type"}),R.a.createElement("h3",null,q.a.I18n.t("selectFrequency")),R.a.createElement(Gn,{item:this.state,field:Ur,onValueChange:this.handleValueChange}),R.a.createElement("p",{className:"submit"},R.a.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleNext,value:q.a.I18n.t("next")})))}}]),t}(R.a.Component);$r.contextType=Ge.a,$r.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var Wr=Object(ne.withRouter)($r),Hr={name:"options",label:"Event",type:"reactComponent",component:ir},Kr=function(e){function t(e){var a,n,r;M()(this,t),r=U()(this,W()(t).call(this,e));var i=window.mailpoet_segments||[],s=1;return i=h()(i).call(i,(function(e){return"default"===e.type})),O.a.size(i)>0&&(s=O.a.first(i).id),r.state={options:{event:"segment",segment:s,role:"subscriber",afterTimeNumber:1,afterTimeType:"immediate"}},r.handleValueChange=F()(a=r.handleValueChange).call(a,K()(r)),r.handleNext=F()(n=r.handleNext).call(n,K()(r)),r}return Y()(t,e),B()(t,[{key:"handleValueChange",value:function(e){var t=this.state;t[e.target.name]=e.target.value,this.setState(t)}},{key:"handleNext",value:function(){var e=this;q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:O.a.extend({},this.state,{type:"welcome",subject:q.a.I18n.t("draftNewsletterTitle")})}).done((function(t){e.showTemplateSelection(t.data.id)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{key:"showTemplateSelection",value:function(e){this.props.history.push("/template/".concat(e))}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("welcomeNewsletterTypeTitle")),R.a.createElement(J.a,{step:"type"}),R.a.createElement("h3",null,q.a.I18n.t("selectEventToSendWelcomeEmail")),R.a.createElement(ir,{item:this.state,field:Hr,onValueChange:this.handleValueChange}),R.a.createElement("p",{className:"submit"},R.a.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleNext,value:q.a.I18n.t("next")})))}}]),t}(R.a.Component);Kr.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var Gr=Kr,Yr=a(486),Jr=a.n(Yr),Qr=function(e){var t=e.errors;return t.length<1?null:R.a.createElement(Qt,{type:"error",closable:!1},x()(t).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})))};Qr.propTypes={errors:Z.a.arrayOf(Z.a.shape({message:Z.a.string.isRequired})).isRequired};var Zr=Qr,Xr=Z.a.shape({status:Z.a.string,count_processed:Z.a.string.isRequired,count_total:Z.a.string.isRequired,scheduled_at:Z.a.string}),ei=Z.a.shape({id:Z.a.number.isRequired,queue:Z.a.oneOfType([Xr,Z.a.bool])}),ti=function(e){var t=e.queue,a=lt()("mailpoet_progress",{mailpoet_progress_complete:"completed"===t.status}),n=Math.round(100*t.count_processed/t.count_total),r=0;return Jr()(n)?(r=n,n+="%"):n=q.a.I18n.t("noSubscribers"),R.a.createElement("div",{className:a},R.a.createElement("span",{className:"mailpoet_progress_bar",style:{width:"".concat(r,"%")}}),R.a.createElement("span",{className:"mailpoet_progress_label"},n))};ti.propTypes={queue:Xr.isRequired};var ai=function(e){var t=e.newsletter;return R.a.createElement(st.b,{to:"/sending-status/".concat(t.id),"data-automation-id":"sending_status_".concat(t.id)},R.a.createElement("span",null,q.a.I18n.t("newsletterQueueCompleted").replace("%$1d",Se()(t.queue.count_processed,10).toLocaleString()).replace("%$2d",Se()(t.queue.count_total,10).toLocaleString())))};ai.propTypes={newsletter:ei.isRequired};var ni=function(e){var t=e.className,a=e.onClick,n=e.children;return R.a.createElement("a",{className:lt()("button",t),style:{display:"inline-block"},href:"#",onClick:function(e){e.preventDefault(),a(e)}},n)};ni.propTypes={className:Z.a.string,onClick:Z.a.func.isRequired,children:Z.a.string.isRequired},ni.defaultProps={className:""};var ri=function(e){var t=e.newsletter,a=R.a.useState("paused"===t.queue.status),n=Ne()(a,2),r=n[0],i=n[1],s=R.a.useState([]),o=Ne()(s,2),l=o[0],c=o[1];return R.a.createElement(R.a.Fragment,null,R.a.createElement(Zr,{errors:l}),R.a.createElement("span",null,Se()(t.queue.count_processed,10).toLocaleString(),"/",Se()(t.queue.count_total,10).toLocaleString(),"  ",r&&R.a.createElement(ni,{onClick:function(){c([]),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"resume",data:{newsletter_id:t.id}}).done((function(){return i(!1)})).fail((function(e){return c(e.errors)}))}},q.a.I18n.t("resume")),!r&&R.a.createElement(ni,{className:"mailpoet_pause",onClick:function(){c([]),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"pause",data:{newsletter_id:t.id}}).done((function(){return i(!0)})).fail((function(e){return c(e.errors)}))}},q.a.I18n.t("pause"))))};ri.propTypes={newsletter:ei.isRequired};var ii=function(e){var t=e.newsletter,a=e.mailerLog;return t.queue?"paused"===a.status&&"completed"!==t.queue.status?R.a.createElement("span",null,q.a.I18n.t("paused")):"scheduled"===t.queue.status?R.a.createElement("span",null,q.a.I18n.t("scheduledFor")," ",q.a.Date.format(t.queue.scheduled_at)):R.a.createElement("div",null,R.a.createElement(ti,{queue:t.queue}),R.a.createElement("p",{style:{textAlign:"center"}},"completed"===t.queue.status&&R.a.createElement(ai,{newsletter:t}),"completed"!==t.queue.status&&R.a.createElement(ri,{newsletter:t}))):R.a.createElement("span",null,q.a.I18n.t("notSentYet"))};ii.propTypes={newsletter:ei.isRequired,mailerLog:Z.a.shape({status:Z.a.string}).isRequired};var si=ii,oi=function(e){var t=e.mailpoetInstalledDaysAgo,a=e.sendTransactionalEmails,n=e.mtaMethod,r=e.noticeDismissed,i=e.apiVersion,s=Object(T.useState)(!1),o=Ne()(s,2),l=o[0],c=o[1],u=function(){q.a.Ajax.post({api_version:i,endpoint:"UserFlags",action:"set",data:{transactional_emails_opt_in_notice_dismissed:"1"}})};return t<30?null:a?null:"PHPMail"===n?null:"1"===r?null:l?null:R.a.createElement(Qt,{type:"success",timeout:!1,onClose:u},R.a.createElement("h3",null,q.a.I18n.t("transactionalEmailNoticeTitle")),R.a.createElement("p",null,q.a.I18n.t("transactionalEmailNoticeBody")," ",R.a.createElement("a",{href:"https://kb.mailpoet.com/article/292-choose-how-to-send-your-wordpress-websites-emails",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("transactionalEmailNoticeBodyReadMore"))),R.a.createElement("p",null,R.a.createElement("button",{type:"button",className:"button",onClick:function(){c(!0),q.a.Ajax.post({api_version:i,endpoint:"settings",action:"set",data:{send_transactional_emails:"1"}}),u()}},q.a.I18n.t("transactionalEmailNoticeCTA"))))};oi.propTypes={mailpoetInstalledDaysAgo:Z.a.number.isRequired,sendTransactionalEmails:Z.a.bool.isRequired,noticeDismissed:Z.a.string.isRequired,mtaMethod:Z.a.string.isRequired,apiVersion:Z.a.string.isRequired};var li=oi,ci=!!window.mailpoet_tracking_enabled,ui={onNoItemsFound:function(e,t){return q.a.I18n.t(t?"noItemsFound":"emptyListing")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},pi=[{name:"subject",label:q.a.I18n.t("subject"),sortable:!0},{name:"status",label:q.a.I18n.t("status")},{name:"segments",label:q.a.I18n.t("lists")},{name:"statistics",label:q.a.I18n.t("statistics"),display:ci},{name:"sent_at",label:q.a.I18n.t("sentOn"),sortable:!0}],di=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:ui.onTrash}],mi=function(e){var t=function(){window.location.href="?page=mailpoet-newsletter-editor&id=".concat(e.id)};e.queue&&"sending"===e.status&&null===e.queue.status?pn({message:q.a.I18n.t("confirmEdit"),onConfirm:t}):t()},hi=[{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"edit",label:q.a.I18n.t("edit"),onClick:mi},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("newsletterDuplicated").replace("%$1s",e.data.subject)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"trash"}];hi=Tt(hi);var fi=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"renderItem",(function(e,t,a){var n,r=lt()("manage-column","column-primary","has-row-actions"),i=x()(n=e.segments).call(n,(function(e){return e.name})).join(", ");return R.a.createElement("div",null,R.a.createElement("td",{className:r},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"#",onClick:function(t){t.preventDefault(),mi(e)}},e.queue.newsletter_rendered_subject||e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},R.a.createElement(si,{newsletter:e,mailerLog:a.mta_log})),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("lists")},i),!0===ci?R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("statistics")},R.a.createElement(Bt,{newsletter:e,currentTime:a.current_time})):null,R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("sentOn")},R.a.createElement("abbr",null,e.sent_at?q.a.Date.format(e.sent_at):q.a.I18n.t("notSentYet"))))})),a.state={newslettersCount:void 0},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e=this;return R.a.createElement("div",null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(Zt,null),R.a.createElement(li,{mailpoetInstalledDaysAgo:window.mailpoet_installed_days_ago,sendTransactionalEmails:window.mailpoet_send_transactional_emails,mtaMethod:window.mailpoet_mta_method,apiVersion:window.mailpoet_api_version,noticeDismissed:window.mailpoet_transactional_emails_opt_in_notice_dismissed}),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(yt,{tab:"standard"}),0===this.state.newslettersCount&&R.a.createElement(Kt,{filter:function(e){return"standard"===e.slug},showHeader:!1}),0!==this.state.newslettersCount&&R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"standard",base_url:"standard",onRenderItem:this.renderItem,columns:pi,bulk_actions:di,item_actions:hi,messages:ui,auto_refresh:!0,sort_by:"sent_at",sort_order:"desc",afterGetItems:function(t){if(!t.loading){var a,n=Pe()(a=t.groups).call(a,(function(e,t){return e+t.count}),0);e.setState({newslettersCount:n})}Rt(t),Pt(t)}}))}}]),t}(R.a.Component);fi.contextType=Ge.a,fi.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var gi=fi,vi=window.mailpoet_roles||{},bi=window.mailpoet_segments||{},_i=!!window.mailpoet_tracking_enabled,yi={onNoItemsFound:function(e,t){return q.a.I18n.t(t?"noItemsFound":"emptyListing")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},wi=[{name:"subject",label:q.a.I18n.t("subject"),sortable:!0},{name:"status",label:q.a.I18n.t("status"),width:145},{name:"settings",label:q.a.I18n.t("settings")},{name:"statistics",label:q.a.I18n.t("statistics"),display:_i},{name:"updated_at",label:q.a.I18n.t("lastModifiedOn"),sortable:!0}],Ei=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:yi.onTrash}],ki=[{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("newsletterDuplicated").replace("%$1s",e.data.subject)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"edit",link:function(e){return R.a.createElement("a",{href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},q.a.I18n.t("edit"))}},{name:"trash"}];ki=Tt(ki);var Ii=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"updateStatus",(function(e){e.persist(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:Number(e.target.getAttribute("data-id")),status:e.target.value}}).done((function(e){"active"===e.data.status&&q.a.Notice.success(q.a.I18n.t("welcomeEmailActivated")),a.forceUpdate()})).fail((function(t){q.a.Notice.showApiErrorNotice(t),e.target.value=t.status}))})),y()(K()(a),"renderStatus",(function(e){var t=q.a.I18n.t("sentToXSubscribers").replace("%$1d",e.total_sent.toLocaleString()),n=q.a.I18n.t("scheduledToXSubscribers").replace("%$1d",e.total_scheduled.toLocaleString());return R.a.createElement("div",null,R.a.createElement("p",null,R.a.createElement("select",{"data-id":e.id,defaultValue:e.status,onChange:a.updateStatus},R.a.createElement("option",{value:"active"},q.a.I18n.t("active")),R.a.createElement("option",{value:"draft"},q.a.I18n.t("inactive")))),R.a.createElement("p",null,R.a.createElement(st.b,{to:"/sending-status/".concat(e.id),"data-automation-id":"sending_status_".concat(e.id)},t)," ",R.a.createElement("br",null),n))})),y()(K()(a),"renderSettings",(function(e){var t,a,n;switch(e.options.event){case"user":t="mailpoet_all"===e.options.role?q.a.I18n.t("welcomeEventWPUserAnyRole"):q.a.I18n.t("welcomeEventWPUserWithRole").replace("%$1s",vi[e.options.role]);break;default:if(void 0===(n=me()(O.a).call(O.a,bi,(function(t){return Number(t.id)===Number(e.options.segment)}))))return R.a.createElement("span",{className:"mailpoet_error"},q.a.I18n.t("sendingToSegmentsNotSpecified"));t=q.a.I18n.t("welcomeEventSegment").replace("%$1s",n.name)}if(t&&"immediate"!==e.options.afterTimeType){switch(e.options.afterTimeType){case"minutes":a=q.a.I18n.t("sendingDelayMinutes").replace("%$1d",e.options.afterTimeNumber);break;case"hours":a=q.a.I18n.t("sendingDelayHours").replace("%$1d",e.options.afterTimeNumber);break;case"days":a=q.a.I18n.t("sendingDelayDays").replace("%$1d",e.options.afterTimeNumber);break;case"weeks":a=q.a.I18n.t("sendingDelayWeeks").replace("%$1d",e.options.afterTimeNumber);break;default:a=q.a.I18n.t("sendingDelayInvalid")}t+=" [".concat(a,"].")}return R.a.createElement("span",null,t)})),y()(K()(a),"renderItem",(function(e,t){var n=lt()("manage-column","column-primary","has-row-actions");return R.a.createElement("div",null,R.a.createElement("td",{className:n},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},a.renderStatus(e)),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("settings")},a.renderSettings(e)),!0===_i?R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("statistics")},R.a.createElement(Bt,{newsletter:e,isSent:e.total_sent>0&&!!e.statistics})):null,R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("lastModifiedOn")},R.a.createElement("abbr",null,q.a.Date.format(e.updated_at))))})),a.state={newslettersCount:void 0},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e=this;return R.a.createElement("div",null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(yt,{tab:"welcome"}),0===this.state.newslettersCount&&R.a.createElement(Kt,{filter:function(e){return"welcome"===e.slug},showHeader:!1}),0!==this.state.newslettersCount&&R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"welcome",base_url:"welcome",onRenderItem:this.renderItem,columns:wi,bulk_actions:Ei,item_actions:ki,messages:yi,auto_refresh:!0,sort_by:"updated_at",sort_order:"desc",afterGetItems:function(t){if(!t.loading){var a,n=Pe()(a=t.groups).call(a,(function(e,t){return e+t.count}),0);e.setState({newslettersCount:n})}Rt(t),Pt(t)}}))}}]),t}(R.a.Component);Ii.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var Si=Ii,Ci={onNoItemsFound:function(e,t){return q.a.I18n.t(t?"noItemsFound":"emptyListing")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},Ni=[{name:"subject",label:q.a.I18n.t("subject"),sortable:!0},{name:"status",label:q.a.I18n.t("status"),width:100},{name:"settings",label:q.a.I18n.t("settings")},{name:"history",label:q.a.I18n.t("history"),width:100},{name:"updated_at",label:q.a.I18n.t("lastModifiedOn"),sortable:!0}],xi=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:Ci.onTrash}],Ti=[{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"edit",link:function(e){return R.a.createElement("a",{href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},q.a.I18n.t("edit"))}},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("newsletterDuplicated").replace("%$1s",e.data.subject)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"trash"}],Ri=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"updateStatus",(function(e){e.persist(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:Number(e.target.getAttribute("data-id")),status:e.target.value}}).done((function(e){"active"===e.data.status&&q.a.Notice.success(q.a.I18n.t("postNotificationActivated")),a.forceUpdate()})).fail((function(t){q.a.Notice.showApiErrorNotice(t),e.target.value=t.status}))})),y()(K()(a),"renderStatus",(function(e){return R.a.createElement("select",{"data-id":e.id,defaultValue:e.status,onChange:a.updateStatus},R.a.createElement("option",{value:"active"},q.a.I18n.t("active")),R.a.createElement("option",{value:"draft"},q.a.I18n.t("inactive")))})),y()(K()(a),"renderSettings",(function(e){var t,a,n=x()(t=e.segments).call(t,(function(e){return e.name})),r=q.a.I18n.t("ifNewContentToSegments").replace("%$1s",n.join(", "));if(0===n.length)return R.a.createElement("span",{className:"mailpoet_error"},q.a.I18n.t("sendingToSegmentsNotSpecified"));switch(e.options.intervalType){case"daily":a=q.a.I18n.t("sendDaily").replace("%$1s",Fe[e.options.timeOfDay]);break;case"weekly":a=q.a.I18n.t("sendWeekly").replace("%$1s",je[e.options.weekDay]).replace("%$2s",Fe[e.options.timeOfDay]);break;case"monthly":a=q.a.I18n.t("sendMonthly").replace("%$1s",Me[e.options.monthDay]).replace("%$2s",Fe[e.options.timeOfDay]);break;case"nthWeekDay":a=q.a.I18n.t("sendNthWeekDay").replace("%$1s",Ve[e.options.nthWeekDay]).replace("%$2s",je[e.options.weekDay]).replace("%$3s",Fe[e.options.timeOfDay]);break;case"immediately":a=q.a.I18n.t("sendImmediately");break;default:a="Invalid sending frequency"}return R.a.createElement("span",null,a," ",r)})),y()(K()(a),"renderHistoryLink",(function(e){return 0===Number(e.children_count)?q.a.I18n.t("notSentYet"):R.a.createElement(st.b,{"data-automation-id":"history-".concat(e.id),to:"/notification/history/".concat(e.id)},q.a.I18n.t("viewHistory"))})),y()(K()(a),"renderItem",(function(e,t){var n=lt()("manage-column","column-primary","has-row-actions");return R.a.createElement("div",null,R.a.createElement("td",{className:n},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},a.renderStatus(e)),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("settings")},a.renderSettings(e)),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("history")},a.renderHistoryLink(e)),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("lastModifiedOn")},R.a.createElement("abbr",null,q.a.Date.format(e.updated_at))))})),a.state={newslettersCount:void 0},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e=this;return R.a.createElement("div",null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(yt,{tab:"notification"}),0===this.state.newslettersCount&&R.a.createElement(Kt,{filter:function(e){return"notification"===e.slug},showHeader:!1}),0!==this.state.newslettersCount&&R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"notification",base_url:"notification",onRenderItem:this.renderItem,columns:Ni,bulk_actions:xi,item_actions:Ti,messages:Ci,auto_refresh:!0,sort_by:"updated_at",sort_order:"desc",afterGetItems:function(t){if(!t.loading){var a,n=Pe()(a=t.groups).call(a,(function(e,t){return e+t.count}),0);e.setState({newslettersCount:n})}Rt(t),Pt(t)}}))}}]),t}(R.a.Component);Ri.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var Pi=Ri,Oi=!!window.mailpoet_tracking_enabled,Di=[{name:"subject",label:q.a.I18n.t("subject")},{name:"status",label:q.a.I18n.t("status")},{name:"segments",label:q.a.I18n.t("lists")},{name:"statistics",label:q.a.I18n.t("statistics"),display:Oi},{name:"sent_at",label:q.a.I18n.t("sentOn")}],Ai={onNoItemsFound:function(e,t){return q.a.I18n.t(t?"noItemsFound":"emptyListing")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},qi=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:Ai.onTrash}],Li=Tt([{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"trash"}]),Fi=function(e,t,a){var n,r=lt()("manage-column","column-primary","has-row-actions"),i=x()(n=e.segments).call(n,(function(e){return e.name})).join(", ");return R.a.createElement(R.a.Fragment,null,R.a.createElement("td",{className:r},R.a.createElement("strong",null,R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},e.queue.newsletter_rendered_subject||e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},R.a.createElement(si,{newsletter:e,mailerLog:a.mta_log})),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("lists")},i),!0===Oi?R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("statistics")},R.a.createElement(Bt,{newsletter:e,currentTime:a.current_time})):null,R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("sentOn")},e.sent_at?q.a.Date.format(e.sent_at):q.a.I18n.t("notSentYet")))},ji=function(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(yt,{tab:"notification"}),R.a.createElement(st.b,{className:"page-title-action",to:"/notification"},q.a.I18n.t("backToPostNotifications")),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:e.location,params:e.match.params,endpoint:"newsletters",type:"notification_history",base_url:"notification/history/:parent_id",onRenderItem:Fi,columns:Di,messages:Ai,item_actions:Li,bulk_actions:qi,auto_refresh:!0,sort_by:"sent_at",sort_order:"desc",afterGetItems:function(e){Rt(e),Pt(e)}}))};ji.propTypes={location:Z.a.shape({pathname:Z.a.string}).isRequired,match:Z.a.shape({params:Z.a.shape({id:Z.a.string})}).isRequired};var Mi=ji,Vi=[{name:"subscriber_id",label:q.a.I18n.t("subscriber"),sortable:!0},{name:"status",label:q.a.I18n.t("sendingStatus")},{name:"failureReason",label:q.a.I18n.t("failureReason")}],Bi={onNoItemsFound:function(){return q.a.I18n.t("noSendingTaskFound")}},zi=function(e){var t=R.a.useState({id:e.match.params.id,subject:"",sent:!1}),a=Ne()(t,2),n=a[0],r=a[1];return R.a.useEffect((function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:n.id}}).done((function(e){return r({id:n.id,subject:e.data.subject,sent:null!==e.data.sent_at})})).fail((function(e){return q.a.Notice.showApiErrorNotice(e)}))}),[n.id]),R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",null,q.a.I18n.t("sendingStatusTitle")),R.a.createElement($i,{newsletter:n}),R.a.createElement(Ui,{location:e.location,params:e.match.params}))};zi.propTypes={location:Z.a.shape({pathname:Z.a.string}).isRequired,match:Z.a.shape({params:Z.a.shape({id:Z.a.string.isRequired}).isRequired}).isRequired};var Ui=R.a.memo((function(e){var t=e.location,a=e.params;return R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:t,params:a,endpoint:"sending_task_subscribers",base_url:"sending-status/:id",onRenderItem:function(e){return R.a.createElement("div",null,R.a.createElement(Wi,e))},getListingItemKey:function(e){var t;return E()(t="".concat(e.taskId,"-")).call(t,e.subscriberId)},columns:Vi,messages:Bi,auto_refresh:!0,sort_by:"failed",sort_order:"desc",afterGetItems:function(e){Rt(e),Pt(e)}})}),(function(e,t){return e.location.pathname===t.location.pathname&&e.params.id===t.params.id}));Ui.propTypes={location:Z.a.shape({pathname:Z.a.string}).isRequired,params:Z.a.shape({id:Z.a.string.isRequired}).isRequired};var $i=function(e){var t=e.newsletter;return t.id&&t.subject&&t.sent?R.a.createElement("p",null,R.a.createElement(st.b,{to:"/stats/".concat(t.id)},t.subject)):null};$i.propTypes={newsletter:Z.a.shape({id:Z.a.string,subject:Z.a.string,sent:Z.a.bool})},$i.defaultProps={newsletter:{id:null,subject:null,sent:!1}};var Wi=function(e){var t,a,n,r,i=e.error,s=e.failed,o=e.taskId,l=e.processed,c=e.email,u=e.subscriberId,p=e.lastName,d=e.firstName,m=lt()("manage-column","column-primary","has-row-actions"),h=q.a.I18n.t("unprocessed");return"1"===l&&(h="1"===s?R.a.createElement("span",null,q.a.I18n.t("failed"),R.a.createElement("br",null),R.a.createElement("a",{className:"button",href:"#",onClick:function(e){e.preventDefault(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sending_task_subscribers",action:"resend",data:{taskId:o,subscriberId:u}}).done((function(){return window.mailpoet_listing.forceUpdate()})).fail((function(e){return q.a.Notice.showApiErrorNotice(e)}))}},q.a.I18n.t("resend"))):q.a.I18n.t("sent")),R.a.createElement(R.a.Fragment,null,R.a.createElement("td",{"data-automation-id":E()(t="name_".concat(o,"_")).call(t,u),className:m},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"admin.php?page=mailpoet-subscribers#/edit/".concat(u)},c)),R.a.createElement("p",{style:{margin:0}},E()(a="".concat(d," ")).call(a,p))),R.a.createElement("td",{className:"column","data-automation-id":E()(n="status_".concat(o,"_")).call(n,u),"data-colname":q.a.I18n.t("sendingStatus")},h),R.a.createElement("td",{className:"column","data-automation-id":E()(r="error_".concat(o,"_")).call(r,u),"data-colname":q.a.I18n.t("failureReason")},i))};Wi.propTypes={error:Z.a.string,email:Z.a.string.isRequired,failed:Z.a.string.isRequired,taskId:Z.a.string.isRequired,lastName:Z.a.string.isRequired,firstName:Z.a.string.isRequired,processed:Z.a.string.isRequired,subscriberId:Z.a.string.isRequired},Wi.defaultProps={error:""};var Hi=zi,Ki=function(e){var t,a,n,r=e.newsletter,i=r.total_sent||0,s=0,o=0,l=0;i>0&&(s=100*r.statistics.clicked/i,o=100*r.statistics.opened/i,l=100*r.statistics.unsubscribed/i);var c,u=q.a.Num.toLocaleFixed(s,1),p=q.a.Num.toLocaleFixed(o,1),d=q.a.Num.toLocaleFixed(l,1),m=E()(t="".concat(p,"% ")).call(t,q.a.I18n.t("percentageOpened")),h=E()(a="".concat(u,"% ")).call(a,q.a.I18n.t("percentageClicked")),f=E()(n="".concat(d,"% ")).call(n,q.a.I18n.t("percentageUnsubscribed"));return c=i>=20&&r.statistics.opened>=5?R.a.createElement("div",{className:"mailpoet_stat_grey"},R.a.createElement("div",{className:"mailpoet_stat_big mailpoet_stat_spaced"},R.a.createElement(Ft.a,{stat:"opened",rate:o,headline:m})),R.a.createElement("div",{className:"mailpoet_stat_big mailpoet_stat_spaced"},R.a.createElement(Ft.a,{stat:"clicked",rate:s,headline:h})),A.a.applyFilters("mailpoet_newsletters_revenues_stats",null,r.statistics.revenue),R.a.createElement("div",null,R.a.createElement(Ft.a,{stat:"unsubscribed",rate:l,headline:f}))):R.a.createElement("div",{className:"mailpoet_stat_grey"},R.a.createElement("div",{className:"mailpoet_stat_big mailpoet_stat_spaced"},m),R.a.createElement("div",{className:"mailpoet_stat_big mailpoet_stat_spaced"},h),A.a.applyFilters("mailpoet_newsletters_revenues_stats",null,r.statistics.revenue),R.a.createElement("div",null,f)),R.a.createElement("div",null,R.a.createElement("p",{className:"mailpoet_stat_grey mailpoet_stat_big"},q.a.I18n.t("statsTotalSent")," ",Se()(i,10).toLocaleString()),c,r.ga_campaign&&R.a.createElement("p",null,q.a.I18n.t("googleAnalytics"),": ",r.ga_campaign),R.a.createElement("p",null,R.a.createElement("a",{href:"https://kb.mailpoet.com/article/190-whats-a-good-email-open-rate",target:"_blank",rel:"noopener noreferrer","data-beacon-article":"58f671152c7d3a057f8858e8"},q.a.I18n.t("readMoreOnStats"))))};Ki.propTypes={newsletter:Z.a.shape({ga_campaign:Z.a.string,total_sent:Z.a.number,statistics:Z.a.shape({clicked:Z.a.number,opened:Z.a.number,unsubscribed:Z.a.number,revenue:Z.a.shape({currency:Z.a.string.isRequired,value:Z.a.number.isRequired,formatted:Z.a.string.isRequired,count:Z.a.number.isRequired})}).isRequired}).isRequired};var Gi=Ki;function Yi(e,t){var a,n="";e&&(n=t?E()(a="".concat(t," <")).call(a,e,">"):e);return n}function Ji(e){var t,a=e.newsletter,n=a.queue.scheduled_at||a.queue.created_at,r=Yi(a.sender_address||"",a.sender_name||""),i=Yi(a.reply_to_address||"",a.reply_to_name||""),s=x()(t=a.segments||[]).call(t,(function(e){return e.name})).join(", ");return R.a.createElement("div",null,R.a.createElement("div",{className:"mailpoet_stat_spaced"},R.a.createElement("a",{href:a.preview_url,className:"button-secondary",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("statsPreviewNewsletter"))),R.a.createElement("p",null,q.a.I18n.t("statsDateSent"),":"," ",q.a.Date.format(n)),s&&R.a.createElement("p",null,q.a.I18n.t("statsToSegments"),":"," ",s),R.a.createElement("p",null,q.a.I18n.t("statsFromAddress"),":"," ",r),i&&R.a.createElement("p",null,q.a.I18n.t("statsReplyToAddress"),":"," ",i))}Ji.propTypes={newsletter:Z.a.shape({queue:Z.a.shape({scheduled_at:Z.a.string,created_at:Z.a.string}).isRequired,sender_address:Z.a.string,sender_name:Z.a.string,reply_to_address:Z.a.string,preview_url:Z.a.string,reply_to_name:Z.a.string,segments:Z.a.array}).isRequired};var Qi=Ji,Zi=function(){if(!window.mailpoet_display_detailed_stats){var e=R.a.createElement("a",{className:"button",href:q.a.MailPoetComUrlFactory.getFreePlanUrl({utm_medium:"stats",utm_campaign:"signup"}),target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("premiumBannerCtaFree"));return R.a.createElement("div",{className:"mailpoet_stats_premium_banner"},R.a.createElement("h1",null,q.a.I18n.t("premiumBannerTitle")),R.a.createElement("p",null,e),R.a.createElement("a",{href:"admin.php?page=mailpoet-premium"},q.a.I18n.t("premiumBannerLink")))}if(window.mailpoet_subscribers_limit_reached){var t=window.mailpoet_has_valid_api_key,a=q.a.I18n.t("subscribersLimitNoticeTitle").replace("[subscribersLimit]",window.mailpoet_subscribers_limit),n=q.a.I18n.t(t?"yourPlanLimit":"freeVersionLimit").replace("[subscribersLimit]",window.mailpoet_subscribers_limit),r=t?"https://account.mailpoet.com/upgrade":"https://account.mailpoet.com/?s=".concat(window.mailpoet_subscribers_count+1);return R.a.createElement("div",{className:"mailpoet_stats_premium_banner"},R.a.createElement("h1",null,a),R.a.createElement("p",null,n),R.a.createElement("p",null,R.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",className:"button",href:r},q.a.I18n.t("upgradeNow"))))}return null},Xi=function(e){function t(e){var a;return M()(this,t),(a=U()(this,W()(t).call(this,e))).state={item:{},loading:!0},a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this.props.match;window.scrollTo(0,0),this.loadItem(e.params.id)}},{key:"componentDidUpdate",value:function(e){e.match.params.id!==this.props.match.params.id&&this.loadItem(this.props.match.params.id)}},{key:"loadItem",value:function(e){var t=this,a=this.props.history;this.setState({loading:!0}),q.a.Modal.loading(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:window.mailpoet_display_detailed_stats?"stats":"newsletters",action:window.mailpoet_display_detailed_stats?"get":"getWithStats",data:{id:e}}).always((function(){q.a.Modal.loading(!1)})).done((function(e){t.setState({loading:!1,item:e.data})})).fail((function(e){var n;q.a.Notice.error(x()(n=e.errors).call(n,(function(e){return e.message})),{scroll:!0}),t.setState({loading:!1,item:{}},(function(){a.push("/")}))}))}},{key:"render",value:function(){var e,t=this.state,a=t.item,n=t.loading,r=a,i=this.props,s=i.match,o=i.location;return n||!r.queue?R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("statsTitle"),R.a.createElement(st.b,{className:"page-title-action",to:"/"},q.a.I18n.t("backToList")))):R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},E()(e="".concat(q.a.I18n.t("statsTitle"),": ")).call(e,r.subject),R.a.createElement(st.b,{className:"page-title-action",to:"/"},q.a.I18n.t("backToList"))),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement("div",{className:"mailpoet_stat_triple-spaced"},R.a.createElement("div",{className:"mailpoet_stat_info"},R.a.createElement(Qi,{newsletter:r})),R.a.createElement("div",{className:"mailpoet_stat_general"},R.a.createElement(Gi,{newsletter:r})),R.a.createElement("div",{style:{clear:"both"}})),R.a.createElement("h2",null,q.a.I18n.t("clickedLinks")),R.a.createElement("div",{className:"mailpoet_stat_triple-spaced"},A.a.applyFilters("mailpoet_newsletters_clicked_links_table",R.a.createElement(Zi,null),r.clicked_links)),R.a.createElement("div",{className:"mailpoet_stat_triple-spaced"},A.a.applyFilters("mailpoet_newsletters_purchased_products",null,r)),R.a.createElement("h2",null,q.a.I18n.t("subscriberEngagement")),A.a.applyFilters("mailpoet_newsletters_subscriber_engagement",R.a.createElement(Zi,null),o,s.params,r))}}]),t}(R.a.Component);Xi.propTypes={match:Z.a.shape({params:Z.a.object.isRequired}).isRequired,location:Z.a.object.isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var es,ts=Object(ne.withRouter)(Xi),as=A.a.applyFilters("mailpoet_newsletters_before_router",E()(es=[{path:"/standard/(.*)?",component:gi},{path:"/welcome/(.*)?",component:Si},{path:"/notification/history/:parent_id/(.*)?",component:Mi},{path:"/notification/(.*)?",component:Pi},{path:"/new/standard",component:zr},{path:"/new/notification",component:Wr},{path:"/new/welcome",component:Gr},{path:"/new",component:Kt},{name:"template",path:"/template/:id",component:bn},{path:"/send/congratulate/:id",component:Vr},{path:"/send/:id",component:mr},{path:"/sending-status/:id/(.*)?",component:Hi},{path:"/stats/:id/(.*)?",component:ts}]).call(es,I()(window.mailpoet_automatic_emails?x()(O.a).call(O.a,window.mailpoet_automatic_emails,(function(e){return{path:"new/".concat(e.slug),name:e.slug,component:ie,data:{email:e}}})):[]))),ns=document.getElementById("newsletters_container");ns&&(window.mailpoet_listing=_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{exact:!0,path:"/",render:function(){return R.a.createElement(ne.Redirect,{to:0===window.mailpoet_newsletters_count?"/new":"/standard"})}}),x()(as).call(as,(function(e){return R.a.createElement(ne.Route,{key:e.path,path:e.path,component:e.component,name:e.name||null,data:e.data||null,render:e.render})})))))}),null),ns));var rs=function(){var e=Object(ne.useLocation)().pathname.split("/"),t=Ne()(e,2)[1];return R.a.createElement("h2",{className:"nav-tab-wrapper"},R.a.createElement(st.b,{to:"/",className:lt()("nav-tab",{"nav-tab-active":"segments"!==t})},q.a.I18n.t("pageTitle")),R.a.createElement(st.b,{to:"/segments","data-automation-id":"dynamic-segments-tab",className:lt()("nav-tab",{"nav-tab-active":"segments"===t})},q.a.I18n.t("pageTitleSegments")))},is=function(e){return"wp_users"===e.type},ss=function(e){return"woocommerce_users"===e.type},os=function(e){return is(e)||ss(e)},ls=[{name:"name",label:q.a.I18n.t("name"),sortable:!0},{name:"description",label:q.a.I18n.t("description")},{name:"subscribed",label:q.a.I18n.t("subscribed")},{name:"unconfirmed",label:q.a.I18n.t("unconfirmed")},{name:"unsubscribed",label:q.a.I18n.t("unsubscribed")},{name:"inactive",label:q.a.I18n.t("inactive")},{name:"bounced",label:q.a.I18n.t("bounced")},{name:"created_at",label:q.a.I18n.t("createdOn"),sortable:!0}],cs={onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSegmentTrashed"):q.a.I18n.t("multipleSegmentsTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSegmentDeleted"):q.a.I18n.t("multipleSegmentsDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSegmentRestored"):q.a.I18n.t("multipleSegmentsRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},us=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:cs.onTrash}],ps=[{name:"edit",link:function(e){return R.a.createElement(st.b,{to:"/edit/".concat(e.id)},q.a.I18n.t("edit"))},display:function(e){return!os(e)}},{name:"duplicate_segment",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"segments",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("listDuplicated").replace("%$1s",e.data.name)),t()})).fail((function(e){var t;q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))},display:function(e){return!os(e)}},{name:"read_more",link:function(){return R.a.createElement("a",{href:"https://kb.mailpoet.com/article/133-the-wordpress-users-list",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("readMore"))},display:function(e){return is(e)}},{name:"synchronize_segment",label:q.a.I18n.t("forceSync"),onClick:function(e,t){q.a.Modal.loading(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"segments",action:"synchronize",data:{type:e.type}}).done((function(){q.a.Modal.loading(!1),q.a.Notice.success(q.a.I18n.t("listSynchronized").replace("%$1s",e.name)),t()})).fail((function(e){var t;(q.a.Modal.loading(!1),e.errors.length>0)&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))},display:function(e){return is(e)||ss(e)}},{name:"view_subscribers",link:function(e){return R.a.createElement("a",{href:e.subscribers_url,"data-automation-id":"view_subscribers_".concat(e.name)},q.a.I18n.t("viewSubscribers"))}},{name:"trash",display:function(e){return!os(e)&&0===e.automated_emails_subjects.length}},{name:"delete",label:q.a.I18n.t("moveToTrash"),onClick:function(e){var t;q.a.Notice.error(q.a.I18n.t("trashDisallowed").replace("%$1s",x()(t=e.automated_emails_subjects).call(t,(function(e){return"'".concat(e,"'")})).join(", ")),{scroll:!0})},display:function(e){return!os(e)&&e.automated_emails_subjects.length>0}}],ds=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"renderItem",(function(e,t){var a,n=lt()("manage-column","column-primary","has-row-actions"),r=Number(e.subscribers_count.subscribed||0),i=Number(e.subscribers_count.unconfirmed||0),s=Number(e.subscribers_count.unsubscribed||0),o=Number(e.subscribers_count.inactive||0),l=Number(e.subscribers_count.bounced||0);return a=os(e)?R.a.createElement("span",{className:"row-title"},e.name):R.a.createElement(st.b,{className:"row-title",to:"/edit/".concat(e.id)},e.name),R.a.createElement("div",null,R.a.createElement("td",{className:n,"data-automation-id":"segment_name_".concat(e.name)},R.a.createElement("strong",null,a),t),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("description")},R.a.createElement("abbr",null,e.description)),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("subscribed")},R.a.createElement("abbr",null,r.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("unconfirmed")},R.a.createElement("abbr",null,i.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("unsubscribed")},R.a.createElement("abbr",null,s.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("inactive")},R.a.createElement("abbr",null,o.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("bounced")},R.a.createElement("abbr",null,l.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("createdOn")},R.a.createElement("abbr",null,q.a.Date.format(e.created_at))))})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",{className:"mailpoet-segments-listing"},R.a.createElement("h1",{className:"title"},q.a.I18n.t("pageTitle")," ",R.a.createElement(st.b,{className:"page-title-action",to:"/new"},q.a.I18n.t("new")),R.a.createElement(st.b,{className:"page-title-action",to:"/new-segment","data-automation-id":"new-segment"},q.a.I18n.t("newSegment"))),R.a.createElement(va,{subscribersInPlan:window.mailpoet_subscribers_in_plan_count,hasValidApiKey:window.mailpoet_has_valid_api_key}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(rs,null),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,messages:cs,search:!1,endpoint:"segments",onRenderItem:this.renderItem,columns:ls,bulk_actions:us,item_actions:ps,sort_by:"name",sort_order:"asc"}))}}]),t}(R.a.Component);ds.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var ms=ds,hs=[{name:"name",label:q.a.I18n.t("nameColumn"),sortable:!0},{name:"count",label:q.a.I18n.t("subscribersCountColumn"),sortable:!1},{name:"updated_at",label:q.a.I18n.t("updatedAtColumn"),sortable:!0}],fs={onLoadingItems:function(){return q.a.I18n.t("loadingDynamicSegmentItems")},onNoItemsFound:function(){return q.a.I18n.t("noDynamicSegmentItemsFound")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneDynamicSegmentTrashed"):q.a.I18n.t("multipleDynamicSegmentsTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneDynamicSegmentDeleted"):q.a.I18n.t("multipleDynamicSegmentsDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneDynamicSegmentRestored"):q.a.I18n.t("multipleDynamicSegmentsRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},gs=[{name:"edit",link:function(e){return R.a.createElement(st.b,{to:"/edit-segment/".concat(e.id)},q.a.I18n.t("edit"))}},{name:"view_subscribers",link:function(e){return R.a.createElement("a",{href:e.subscribers_url},q.a.I18n.t("viewSubscribers"))}},{name:"trash"}];function vs(e,t){return R.a.createElement(R.a.Fragment,null,R.a.createElement("td",{"data-colname":q.a.I18n.t("nameColumn")},R.a.createElement("strong",null,e.name),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("subscribersCountColumn")},Se()(e.count,10).toLocaleString()),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("updatedAtColumn")},q.a.Date.format(e.updated_at)))}function bs(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",{className:"pageTitle"},q.a.I18n.t("pageTitleSegments")," ",R.a.createElement(st.b,{className:"page-title-action",to:"/new"},q.a.I18n.t("new")),R.a.createElement(st.b,{className:"page-title-action",to:"/new-segment","data-automation-id":"new-segment"},q.a.I18n.t("newSegment"))),R.a.createElement(va,{subscribersInPlan:window.mailpoet_subscribers_in_plan_count,hasValidApiKey:window.mailpoet_has_valid_api_key}),R.a.createElement(rs,null),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:e.location,params:e.match.params,search:!0,onRenderItem:vs,endpoint:"dynamic_segments",base_url:"segments",columns:hs,messages:fs,sort_by:"created_at",sort_order:"desc",item_actions:gs}),R.a.createElement("p",{className:"mailpoet_sending_methods_help help"},R.a.createElement("b",null,q.a.I18n.t("segmentsTip"),":")," ",q.a.I18n.t("segmentsTipText")," ",R.a.createElement("a",{href:"https://kb.mailpoet.com/article/237-guide-to-subscriber-segmentation?utm_source=plugin&utm_medium=segments&utm_campaign=helpdocs","data-beacon-article":"5a574bd92c7d3a194368233e",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("segmentsTipLink"))))}bs.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var _s=bs,ys=[{name:"name",label:q.a.I18n.t("name"),type:"text"},{name:"description",label:q.a.I18n.t("description"),type:"textarea",tip:q.a.I18n.t("segmentDescriptionTip")}],ws={onUpdate:function(){q.a.Notice.success(q.a.I18n.t("segmentUpdated"))},onCreate:function(){q.a.Notice.success(q.a.I18n.t("segmentAdded")),q.a.trackEvent("Lists > Add new",{"MailPoet Free version":window.mailpoet_version})}},Es=function(e){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("segment"),R.a.createElement(st.b,{className:"page-title-action",to:"/"},q.a.I18n.t("backToList"))),R.a.createElement(Zt,null),R.a.createElement($a,{endpoint:"segments",fields:ys,params:e.match.params,messages:ws}))};Es.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired};var ks=Es,Is=a(79),Ss=a.n(Is),Cs={};var Ns=function(e){return function(e){return"clicked"!==e.action&&"notClicked"!==e.action?Ss.a.resolve():e.newsletter_id?void 0!==Cs[e.newsletter_id]?Ss.a.resolve(Cs[e.newsletter_id]):q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletter_links",action:"get",data:{newsletterId:e.newsletter_id}}).then((function(t){var a=t.data;return Cs[e.newsletter_id]=a,a})).fail((function(e){var t;q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})})):Ss.a.resolve()}(e).then((function(e){var t,a=[{name:"action",type:"select",values:{"":q.a.I18n.t("selectActionPlaceholder"),opened:q.a.I18n.t("emailActionOpened"),notOpened:q.a.I18n.t("emailActionNotOpened"),clicked:q.a.I18n.t("emailActionClicked"),notClicked:q.a.I18n.t("emailActionNotClicked")}},{name:"newsletter_id",type:"selection",resetSelect2OnUpdate:!0,endpoint:"newsletters_list",placeholder:q.a.I18n.t("selectNewsletterPlaceholder"),forceSelect2:!0,getLabel:function(e){var t,a=e.sent_at?q.a.Date.format(e.sent_at):q.a.I18n.t("notSentYet");return E()(t="".concat(e.subject," (")).call(t,a,")")}}];return e?E()(t=[]).call(t,a,[{name:"link_id",type:"selection",placeholder:q.a.I18n.t("selectLinkPlaceholder"),forceSelect2:!0,getLabel:function(e){return e.url},values:e}]):a}))},xs={name:"action",type:"select",values:{"":q.a.I18n.t("selectActionPlaceholder"),purchasedCategory:q.a.I18n.t("wooPurchasedCategory"),purchasedProduct:q.a.I18n.t("wooPurchasedProduct")}},Ts={name:"category_id",type:"selection",endpoint:"product_categories",resetSelect2OnUpdate:!0,placeholder:q.a.I18n.t("selectWooPurchasedCategory"),forceSelect2:!0,getLabel:O.a.property("cat_name"),getValue:O.a.property("term_id")},Rs={name:"product_id",type:"selection",endpoint:"products",resetSelect2OnUpdate:!0,placeholder:q.a.I18n.t("selectWooPurchasedProduct"),forceSelect2:!0,getLabel:O.a.property("title"),getValue:O.a.property("ID")},Ps={onUpdate:function(){return q.a.Notice.success(q.a.I18n.t("segmentUpdated"))},onCreate:function(e){q.a.Notice.success(q.a.I18n.t("segmentAdded")),q.a.trackEvent("Segments > Add new",{"MailPoet Free version":window.mailpoet_version,type:e.segmentType||"unknown type",subtype:e.action||e.wordpressRole||"unknown subtype"})}};var Os=function(e){function t(e){var a,n,r,i;return M()(this,t),(i=U()(this,W()(t).call(this,e))).state={item:{segmentType:"email"},childFields:[],errors:void 0},i.loadFields(),i.handleValueChange=F()(a=i.handleValueChange).call(a,K()(i)),i.handleSave=F()(n=i.handleSave).call(n,K()(i)),i.onItemLoad=F()(r=i.onItemLoad).call(r,K()(i)),i}return Y()(t,e),B()(t,[{key:"onItemLoad",value:function(e){var t=O.a.mapObject(e,(function(e){return O.a.isNull(e)?"":e}));this.setState({item:t},this.loadFields)}},{key:"getFields",value:function(){var e,t,a=this.state.childFields;return[{name:"name",label:q.a.I18n.t("name"),type:"text"},{name:"description",label:q.a.I18n.t("description"),type:"textarea",tip:q.a.I18n.t("descriptionTip")},{name:"filters",description:"main",label:q.a.I18n.t("formSegmentTitle"),fields:E()(e=[{name:"segmentType",type:"select",values:(t={email:q.a.I18n.t("email"),userRole:q.a.I18n.t("wpUserRole")},window.is_woocommerce_active&&(t.woocommerce=q.a.I18n.t("woocommerce")),t)}]).call(e,I()(a))}]}},{key:"getChildFields",value:function(){var e,t,a,n=this.state.item;switch(n.segmentType){case"userRole":return Ss.a.resolve([{name:"wordpressRole",type:"select",placeholder:q.a.I18n.t("selectUserRolePlaceholder"),values:Pe()(a=window.wordpress_editable_roles_list).call(a,(function(e,t){return O.a.extend({},e,y()({},t.role_id,t.role_name))}),{})}]);case"email":return Ns(n);case"woocommerce":return t=[xs],"purchasedCategory"===(e=n).action&&t.push(Ts),"purchasedProduct"===e.action&&t.push(Rs),Ss.a.resolve(t);default:return[]}}},{key:"loadFields",value:function(){var e=this;this.getChildFields().then((function(t){return e.setState({childFields:t})}))}},{key:"handleValueChange",value:function(e){var t=this.state.item;return t[e.target.name]=e.target.value,this.setState({item:t}),this.loadFields(),!0}},{key:"handleSave",value:function(e){var t=this,a=this.state.item,n=this.props,r=n.history,i=n.match;e.preventDefault(),this.setState({errors:void 0}),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"dynamic_segments",action:"save",data:a}).done((function(){r.push("/segments"),void 0!==i.params.id?Ps.onUpdate():Ps.onCreate(a)})).fail((function(e){e.errors.length>0&&t.setState({errors:e.errors})}))}},{key:"render",value:function(){var e=this.getFields(),t=this.props.match,a=this.state,n=a.item,r=a.errors;return R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("formPageTitle")," ",R.a.createElement(st.b,{className:"page-title-action",to:"/segments"},q.a.I18n.t("backToList"))),R.a.createElement($a,{endpoint:"dynamic_segments",fields:e,params:t.params,messages:Ps,onChange:this.handleValueChange,onSubmit:this.handleSave,onItemLoad:this.onItemLoad,item:n,errors:r}))}}]),t}(R.a.Component);Os.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var Ds=Object(ne.withRouter)(Os),As=document.getElementById("segments_container");As&&_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{path:"/new",component:ks}),R.a.createElement(ne.Route,{path:"/edit/:id",component:ks}),R.a.createElement(ne.Route,{path:"/new-segment",component:Ds}),R.a.createElement(ne.Route,{path:"/edit-segment/:id",component:Ds}),R.a.createElement(ne.Route,{path:"/segments/(.*)?",component:_s}),R.a.createElement(ne.Route,{path:"*",component:ms}))))}),null),As);var qs=[{name:"name",label:q.a.I18n.t("formName"),sortable:!0},{name:"segments",label:q.a.I18n.t("segments")},{name:"signups",label:q.a.I18n.t("signups")},{name:"created_at",label:q.a.I18n.t("createdOn"),sortable:!0}],Ls={onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneFormTrashed"):q.a.I18n.t("multipleFormsTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneFormDeleted"):q.a.I18n.t("multipleFormsDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneFormRestored"):q.a.I18n.t("multipleFormsRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},Fs=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:Ls.onTrash}],js=[{name:"edit",label:q.a.I18n.t("edit"),link:function(e){return R.a.createElement("a",{href:"admin.php?page=mailpoet-form-editor&id=".concat(e.id)},q.a.I18n.t("edit"))}},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"duplicate",data:{id:e.id}}).done((function(e){var a=e.data.name?e.data.name:q.a.I18n.t("noName");q.a.Notice.success(q.a.I18n.t("formDuplicated").replace("%$1s",a)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"trash"}],Ms=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"createForm",(function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"create"}).done((function(e){q.a.trackEvent("Forms > Add New",{"MailPoet Free version":window.mailpoet_version}),Yt()((function(){window.location=window.mailpoet_form_edit_url+e.data.id}),200)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))})),y()(K()(n),"renderItem",(function(e,t){var a,n,r,i=lt()("manage-column","column-primary","has-row-actions"),s=x()(a=h()(n=window.mailpoet_segments).call(n,(function(t){return-1!==ve.a.inArray(t.id,e.segments)}))).call(a,(function(e){return e.name})).join(", ");"user"===e.settings.segments_selected_by&&(s=E()(r="".concat(q.a.I18n.t("userChoice")," ")).call(r,s));return R.a.createElement("div",null,R.a.createElement("td",{className:i},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"admin.php?page=mailpoet-form-editor&id=".concat(e.id)},e.name?e.name:"(".concat(q.a.I18n.t("noName"),")"))),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("segments")},s),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("signups")},e.signups),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("createdOn")},R.a.createElement("abbr",null,q.a.Date.format(e.created_at))))})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("pageTitle")," ",R.a.createElement("button",{className:"page-title-action",onClick:this.createForm,"data-automation-id":"create_new_form",type:"button"},q.a.I18n.t("new"))),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,messages:Ls,search:!1,endpoint:"forms",onRenderItem:this.renderItem,columns:qs,bulk_actions:Fs,item_actions:js}))}}]),t}(R.a.Component);Ms.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var Vs=bt(Ms),Bs=document.getElementById("forms_container");Bs&&_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Route,{path:"*",component:Vs})))}),null),Bs);var zs=[{name:"knowledgeBase",label:q.a.I18n.t("tabKnowledgeBaseTitle"),link:"/knowledgeBase"},{name:"systemStatus",label:q.a.I18n.t("tabSystemStatusTitle"),link:"/systemStatus"},{name:"systemInfo",label:q.a.I18n.t("tabSystemInfoTitle"),link:"/systemInfo"},{name:"yourPrivacy",label:q.a.I18n.t("tabYourPrivacyTitle"),link:"/yourPrivacy"}];function Us(e){var t=x()(zs).call(zs,(function(t){var a=lt()("nav-tab",{"nav-tab-active":e.tab===t.name});return R.a.createElement(st.b,{key:"tab-".concat(t.name),className:a,to:t.link},t.label)}));return R.a.createElement("h2",{className:"nav-tab-wrapper"},t)}Us.propTypes={tab:Z.a.string},Us.defaultProps={tab:"knowledgeBase"};var $s=Us;var Ws=function(){return R.a.createElement("div",null,R.a.createElement($s,{tab:"knowledgeBase"}),R.a.createElement("p",null,q.a.I18n.t("knowledgeBaseIntro")),R.a.createElement("ul",null,R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/116-common-problems"},"Common Problems")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/165-newsletters"},"Newsletters")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/156-migration-questions"},"Migration Questions")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/149-sending-methods"},"Sending Methods")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/139-subscription-forms"},"Subscription Forms")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/114-getting-started"},"Getting Started")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/123-newsletter-designer"},"Newsletter Designer")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/121-subscribers-and-lists"},"Subscribers and Lists"))),R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/",className:"button button-primary"},q.a.I18n.t("knowledgeBaseButton")))};function Hs(e){e.target.select()}var Ks=function(){var e=window.systemInfoData;return R.a.createElement("div",null,R.a.createElement($s,{tab:"systemInfo"}),R.a.createElement("div",{className:"mailpoet_notice notice inline",style:{marginTop:"1em"}},R.a.createElement("p",null,q.a.I18n.t("systemInfoIntro"))),function(e){if(O.a.isObject(e)){var t,a=x()(t=b()(e)).call(t,(function(t){var a;return E()(a="".concat(t,": ")).call(a,e[t])}));return R.a.createElement("textarea",{readOnly:!0,onFocus:Hs,value:a.join("\n"),style:{width:"100%",height:"400px"}})}return R.a.createElement("p",null,q.a.I18n.t("systemInfoDataError"))}(e))},Gs=function(e){var t;return R.a.createElement("table",{className:"widefat fixed",style:{maxWidth:e.max_width}},R.a.createElement("tbody",null,x()(t=e.rows).call(t,(function(e){return R.a.createElement("tr",{key:"row_".concat(e.key)},R.a.createElement("td",{className:"row-title"},e.key),R.a.createElement("td",null,e.value))}))))};Gs.propTypes={max_width:Z.a.string,rows:Z.a.arrayOf(Z.a.shape({key:Z.a.string.isRequired,value:Z.a.oneOfType([Z.a.string,Z.a.number,Z.a.element]).isRequired})).isRequired},Gs.defaultProps={max_width:"auto"};var Ys=Gs,Js=function(e){return R.a.createElement("span",null,!0===e.children&&e.truthy||!1===e.children&&e.falsy||e.unknown)};Js.propTypes={truthy:Z.a.string,falsy:Z.a.string,unknown:Z.a.string,children:Z.a.bool},Js.defaultProps={truthy:q.a.I18n.t("yes"),falsy:q.a.I18n.t("no"),unknown:q.a.I18n.t("unknown"),children:null};var Qs=Js,Zs=function(e){var t,a=e.status_data,n={active:q.a.I18n.t("running"),inactive:q.a.I18n.t("cronWaiting")},r=nt()(a.last_error)?R.a.createElement(R.a.Fragment,null,x()(t=a.last_error).call(t,(function(e){return R.a.createElement("div",{key:e.worker},e.worker,":"," ",R.a.createElement("i",null,e.message))}))):a.last_error;return R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("systemStatusCronStatusTitle")),R.a.createElement(Ys,{max_width:"400px",rows:[{key:q.a.I18n.t("accessible"),value:R.a.createElement(Qs,null,a.accessible)},{key:q.a.I18n.t("status"),value:n[a.status]?n[a.status]:q.a.I18n.t("unknown")},{key:q.a.I18n.t("lastUpdated"),value:a.updated_at?q.a.Date.full(1e3*a.updated_at):q.a.I18n.t("unknown")},{key:q.a.I18n.t("lastRunStarted"),value:a.run_accessed_at?q.a.Date.full(1e3*a.run_started_at):q.a.I18n.t("unknown")},{key:q.a.I18n.t("lastRunCompleted"),value:a.run_completed_at?q.a.Date.full(1e3*a.run_completed_at):q.a.I18n.t("unknown")},{key:q.a.I18n.t("lastSeenError"),value:r||q.a.I18n.t("none")},{key:q.a.I18n.t("lastSeenErrorDate"),value:a.last_error_date?q.a.Date.full(1e3*a.last_error_date):q.a.I18n.t("unknown")}]}))};Zs.propTypes={status_data:Z.a.shape({accessible:Z.a.bool,last_error_date:Z.a.string,status:Z.a.string,updated_at:Z.a.number,run_accessed_at:Z.a.number,run_completed_at:Z.a.number,run_started_at:Z.a.number,last_error:Z.a.oneOfType([Z.a.string,Z.a.array])}).isRequired};var Xs=Zs,eo=function(e){return R.a.createElement("tr",null,R.a.createElement("td",{className:"column column-primary"},e.task.id),R.a.createElement("td",{className:"column"},e.task.type),R.a.createElement("td",{className:"column"},e.task.newsletter?R.a.createElement("a",{href:e.task.newsletter.preview_url,"data-newsletter-id":e.task.newsletter.newsletter_id,"data-queue-id":e.task.newsletter.queue_id,target:"_blank",rel:"noopener noreferrer"},e.task.newsletter.subject||q.a.I18n.t("preview")):q.a.I18n.t("none")),R.a.createElement("td",{className:"column"},e.task.priority),e.show_scheduled_at?R.a.createElement("td",{className:"column-date"},R.a.createElement("abbr",null,q.a.Date.format(1e3*e.task.scheduled_at))):null,R.a.createElement("td",{className:"column-date"},R.a.createElement("abbr",null,q.a.Date.format(1e3*e.task.updated_at))))};eo.propTypes={show_scheduled_at:Z.a.bool,task:Z.a.shape({id:Z.a.number.isRequired,type:Z.a.string.isRequired,priority:Z.a.number.isRequired,updated_at:Z.a.number.isRequired,scheduled_at:Z.a.number,status:Z.a.string,newsletter:Z.a.shape({newsletter_id:Z.a.number.isRequired,queue_id:Z.a.number.isRequired,preview_url:Z.a.string.isRequired,subject:Z.a.string})}).isRequired},eo.defaultProps={show_scheduled_at:!1};var to=eo,ao=function(e){return R.a.createElement("tr",null,R.a.createElement("th",{className:"row-title"},"Id"),R.a.createElement("th",{className:"row-title"},q.a.I18n.t("type")),R.a.createElement("th",{className:"row-title"},q.a.I18n.t("email")),R.a.createElement("th",{className:"row-title"},q.a.I18n.t("priority")),e.show_scheduled_at?R.a.createElement("th",{className:"row-title"},q.a.I18n.t("scheduledAt")):null,R.a.createElement("th",{className:"row-title"},q.a.I18n.t("updatedAt")))};ao.propTypes={show_scheduled_at:Z.a.bool},ao.defaultProps={show_scheduled_at:!1};var no=ao,ro=function(e){var t,a=e.show_scheduled_at?6:5;return R.a.createElement("table",{className:"widefat fixed striped"},R.a.createElement("thead",null,R.a.createElement(no,{show_scheduled_at:e.show_scheduled_at})),R.a.createElement("tbody",null,e.tasks.length?x()(t=e.tasks).call(t,(function(t){return R.a.createElement(to,{key:t.id,task:t,show_scheduled_at:e.show_scheduled_at})})):R.a.createElement("tr",{className:"no-items"},R.a.createElement("td",{colSpan:a},q.a.I18n.t("nothingToShow")))),R.a.createElement("tfoot",null,R.a.createElement(no,{show_scheduled_at:e.show_scheduled_at})))};ro.propTypes={show_scheduled_at:Z.a.bool,tasks:Z.a.arrayOf(to.propTypes.task).isRequired},ro.defaultProps={show_scheduled_at:!1};var io=ro,so=function(e){var t,a,n,r=e.status_data;return R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("systemStatusQueueTitle")),R.a.createElement(Ys,{max_width:"400px",rows:[{key:q.a.I18n.t("status"),value:"paused"===r.status?q.a.I18n.t("paused"):q.a.I18n.t("running")},{key:q.a.I18n.t("startedAt"),value:r.started?q.a.Date.full(1e3*r.started):q.a.I18n.t("unknown")},{key:q.a.I18n.t("sentEmails"),value:r.sent||0},{key:q.a.I18n.t("retryAttempt"),value:r.retry_attempt||q.a.I18n.t("none")},{key:q.a.I18n.t("retryAt"),value:r.retry_at?q.a.Date.full(1e3*r.retry_at):q.a.I18n.t("none")},{key:q.a.I18n.t("error"),value:r.error?r.error.error_message:q.a.I18n.t("none")},{key:q.a.I18n.t("totalCompletedTasks"),value:r.tasksStatusCounts.completed},{key:q.a.I18n.t("totalRunningTasks"),value:r.tasksStatusCounts.running},{key:q.a.I18n.t("totalPausedTasks"),value:r.tasksStatusCounts.paused},{key:q.a.I18n.t("totalScheduledTasks"),value:r.tasksStatusCounts.scheduled}]}),R.a.createElement("h4",null,q.a.I18n.t("scheduledTasks")),R.a.createElement(io,{show_scheduled_at:!0,tasks:h()(t=r.latestTasks).call(t,(function(e){return"scheduled"===e.status}))}),R.a.createElement("h4",null,q.a.I18n.t("runningTasks")),R.a.createElement(io,{tasks:h()(a=r.latestTasks).call(a,(function(e){return null===e.status}))}),R.a.createElement("h4",null,q.a.I18n.t("completedTasks")),R.a.createElement(io,{tasks:h()(n=r.latestTasks).call(n,(function(e){return"completed"===e.status}))}))};so.propTypes={status_data:Z.a.shape({status:Z.a.string,started:Z.a.number,sent:Z.a.number,retry_attempt:Z.a.number,retry_at:Z.a.number,error:Z.a.shape({operation:Z.a.string,error_message:Z.a.string}),tasksStatusCounts:Z.a.shape({completed:Z.a.number.isRequired,running:Z.a.number.isRequired,paused:Z.a.number.isRequired,scheduled:Z.a.number.isRequired}).isRequired,latestTasks:Z.a.arrayOf(to.propTypes.task).isRequired}).isRequired};var oo=so;function lo(e,t,a,n,r){var i,s=e?"success":"error",o=e?q.a.I18n.t("systemStatusConnectionSuccessful"):E()(i="".concat(q.a.I18n.t("systemStatusConnectionUnsuccessful")," ")).call(i,t);return a&&(o=St()(o,/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{href:a,"data-beacon-article":n,key:"kb-link"},e)}))),R.a.createElement("div",{className:"mailpoet_notice notice inline notice-".concat(s),style:{marginTop:"1em"}},R.a.createElement("p",null,o),r?R.a.createElement("p",null,R.a.createElement("i",null,r)):null)}var co=function(){var e,t,a,n,r,i=window.systemStatusData;return R.a.createElement("div",null,R.a.createElement($s,{tab:"systemStatus"}),R.a.createElement("div",{className:"mailpoet_notice notice inline",style:{marginTop:"1em"}},R.a.createElement("p",null,i.mss.enabled?q.a.I18n.t("systemStatusIntroCronMSS"):q.a.I18n.t("systemStatusIntroCron"))),(t=(e=i).cron.isReachable,a=e.cron.url,n=q.a.I18n.t("systemStatusCronConnectionUnsuccessfulInfo"),r=t?null:e.cron.pingResponse,R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("systemStatusCronTitle")),R.a.createElement("p",null,R.a.createElement("a",{href:a,target:"_blank",rel:"noopener noreferrer"},a)),lo(t,n,"https://kb.mailpoet.com/article/231-sending-does-not-work","5a0257ac2c7d3a272c0d7ad6",r))),function(e){if(e.mss.enabled){var t=e.mss.enabled.isReachable;return R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("systemStatusMSSTitle")),lo(t,q.a.I18n.t("systemStatusMSSConnectionUnsuccessfulInfo"),!1))}}(i),R.a.createElement(Xs,{status_data:i.cronStatus}),R.a.createElement(oo,{status_data:i.queueStatus}))};var uo=function(){return R.a.createElement("div",null,R.a.createElement($s,{tab:"yourPrivacy"}),R.a.createElement("p",null,q.a.I18n.t("yourPrivacyContent1")),R.a.createElement("p",null,q.a.I18n.t("yourPrivacyContent2")),R.a.createElement("p",null,q.a.I18n.t("yourPrivacyContent3")),R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://www.mailpoet.com/privacy-notice/",className:"button button-primary"},q.a.I18n.t("yourPrivacyButton")))},po=document.getElementById("help_container");po&&_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{exact:!0,path:"/",render:function(){return R.a.createElement(ne.Redirect,{to:"/knowledgeBase"})}}),R.a.createElement(ne.Route,{path:"/knowledgeBase",component:Ws}),R.a.createElement(ne.Route,{path:"/systemStatus",component:co}),R.a.createElement(ne.Route,{path:"/systemInfo",component:Ks}),R.a.createElement(ne.Route,{path:"/yourPrivacy",component:uo}))))}),null),po);var mo=Object(ne.withRouter)((function(e){var t=e.children,a=e.location.pathname;return Object(T.useEffect)((function(){window.scrollTo(0,0)}),[a]),t||null}));function ho(e){var t=e.activeMethod,a=e.onMethodChange,n=R.a.useContext(Ge.a).users.isNewUser,r=lt()("mailpoet_badge","mailpoet_badge_video",{mailpoet_badge_video_grey:!n});return R.a.createElement(R.a.Fragment,null,R.a.createElement("form",{className:"mailpoet_import_selection_form"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("methodSelectionHead")),R.a.createElement("label",{htmlFor:"import-paste-method"},R.a.createElement("input",{type:"radio",name:"select_method","data-automation-id":"import-paste-method",id:"import-paste-method",checked:"paste-method"===t,onChange:function(){return a("paste-method")}}),q.a.I18n.t("methodPaste")),R.a.createElement("label",{htmlFor:"import-csv-method"},R.a.createElement("input",{type:"radio",name:"select_method","data-automation-id":"import-csv-method",id:"import-csv-method",checked:"file-method"===t,onChange:function(){return a("file-method")}}),q.a.I18n.t("methodUpload")),R.a.createElement("label",{htmlFor:"import-mailchimp-method"},R.a.createElement("input",{type:"radio",name:"select_method","data-automation-id":"import-mailchimp-method",id:"import-mailchimp-method",checked:"mailchimp-method"===t,onChange:function(){return a("mailchimp-method")}}),q.a.I18n.t("methodMailChimp"))),R.a.createElement("a",{className:r,href:"https://kb.mailpoet.com/article/242-video-guide-importing-subscribers-using-a-csv-file","data-beacon-article":"5a8e8f0204286305fbc9be9a",target:"_blank",rel:"noopener noreferrer"},R.a.createElement("span",{className:"dashicons dashicons-format-video"}),q.a.I18n.t("seeVideo")))}ho.propTypes={activeMethod:Z.a.string,onMethodChange:Z.a.func.isRequired},ho.defaultProps={activeMethod:void 0};var fo=ho,go=function(e){var t=e.hidePrevious,a=e.canGoNext,n=e.onPreviousAction,r=e.onNextAction,i=lt()("button-primary","wysija",{"button-disabled":!a});return R.a.createElement("div",{className:"mailpoet_import_step_buttons"},!t&&R.a.createElement(R.a.Fragment,null,R.a.createElement("button",{className:"button-primary wysija button",type:"button",onClick:n},q.a.I18n.t("previousStep")),"  "),R.a.createElement("button",{type:"button","data-automation-id":"import-next-step",className:i,onClick:function(){a&&r()}},q.a.I18n.t("nextStep")))};go.propTypes={canGoNext:Z.a.bool,hidePrevious:Z.a.bool,onPreviousAction:Z.a.func,onNextAction:Z.a.func},go.defaultProps={hidePrevious:!1,canGoNext:!0,onPreviousAction:function(){},onNextAction:function(){}};var vo=go,bo=function(e){var t=e.onValueChange,a=e.canFinish,n=e.onFinish,r=e.data;return R.a.createElement(R.a.Fragment,null,R.a.createElement("label",{htmlFor:"paste_input",className:"mailpoet_import_method_paste"},R.a.createElement("div",{className:"mailpoet_import_paste_texts"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("pasteLabel")),R.a.createElement("p",{className:"description"},St()(q.a.I18n.t("pasteDescription"),/\[link\](.*?)\[\/link\]/,(function(e){return R.a.createElement("a",{href:"".concat("https://kb.mailpoet.com/article/126-importing-subscribers-with-csv-files"),"data-beacon-article":"57ce079f903360649f6e56fc",key:"kb-link",target:"_blank",rel:"noopener noreferrer"},e)})))),R.a.createElement("textarea",{id:"paste_input",rows:"15",placeholder:"Email, First Name, Last Name\njohn@doe.com, John, Doe\nmary@smith.com, Mary, Smith\njohnny@walker.com, Johnny, Walker",className:"regular-text code",onChange:function(e){t(e.target.value)},defaultValue:r})),R.a.createElement(vo,{canGoNext:a,hidePrevious:!0,onNextAction:n}))};bo.propTypes={onFinish:Z.a.func,canFinish:Z.a.bool.isRequired,onValueChange:Z.a.func.isRequired,data:Z.a.string},bo.defaultProps={onFinish:function(){},data:""};var _o=bo,yo=function(e){var t=e.onValueChange,a=e.canFinish,n=e.onFinish;return R.a.createElement(R.a.Fragment,null,R.a.createElement("div",null,R.a.createElement("label",{htmlFor:"paste_input",className:"mailpoet_import_method_paste"},R.a.createElement("div",{className:"mailpoet_import_paste_texts"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("methodUpload")),R.a.createElement("p",{className:"description"},St()(q.a.I18n.t("pasteDescription"),/\[link\](.*?)\[\/link\]/,(function(e){return R.a.createElement("a",{href:"".concat("https://kb.mailpoet.com/article/126-importing-subscribers-with-csv-files"),"data-beacon-article":"57ce079f903360649f6e56fc",key:"kb-link",target:"_blank",rel:"noopener noreferrer"},e)})))),R.a.createElement("input",{type:"file",id:"file_local",accept:".csv","data-automation-id":"import-file-upload-input",onChange:function(e){var a=e.target.value.match(/[^.]+$/);q.a.Notice.hide(),null===a||"csv"!==a[0].toLowerCase()?(q.a.Notice.error(q.a.I18n.t("wrongFileFormat")),t("")):t(e.target.files[0])}}))),R.a.createElement(vo,{canGoNext:a,hidePrevious:!0,onNextAction:n}))};yo.propTypes={canFinish:Z.a.bool.isRequired,onFinish:Z.a.func,onValueChange:Z.a.func.isRequired},yo.defaultProps={onFinish:function(){}};var wo=yo,Eo=function(e){var t=e.onFinish,a=Object(T.useState)(""),n=Ne()(a,2),r=n[0],i=n[1],s=Object(T.useState)(void 0),o=Ne()(s,2),l=o[0],c=o[1],u=Object(T.useState)([]),p=Ne()(u,2),d=p[0],m=p[1],h=lt()("mailpoet_mailchimp-key-status",{"mailpoet_mailchimp-ok":nt()(l)});return R.a.createElement("div",{className:"mailpoet_import_mailchimp"},R.a.createElement("div",{className:"mailpoet_mailchimp_key"},R.a.createElement("label",{htmlFor:"mailpoet_mailchimp_key_input",className:"mailpoet_mailchimp_key_input"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("methodMailChimpLabel")),R.a.createElement("input",{id:"mailpoet_mailchimp_key_input",type:"text",onChange:function(e){var t;i(e.target.value),""===qa()(t=e.target.value).call(t)&&c(void 0)}})),R.a.createElement("button",{className:"button",type:"button",onClick:function(){q.a.Modal.loading(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"importExport",action:"getMailChimpLists",data:{api_key:r}}).always((function(){q.a.Modal.loading(!1)})).done((function(e){return c(e.data)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},q.a.I18n.t("methodMailChimpVerify")),R.a.createElement("span",{className:h},nt()(l)&&0===l.length?q.a.I18n.t("noMailChimpLists"):null)),l?R.a.createElement("div",{className:"mailpoet_mailchimp_lists"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("methodMailChimpSelectList")),R.a.createElement(we,{field:{id:"segments",name:"list-selection",multiple:!0,placeholder:q.a.I18n.t("methodMailChimpSelectPlaceholder"),forceSelect2:!0,values:l},onValueChange:function(e){return m(e.target.value)}})):null,R.a.createElement(vo,{canGoNext:nt()(d)&&d.length>0,hidePrevious:!0,onNextAction:function(){q.a.Modal.loading(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"importExport",action:"getMailChimpSubscribers",data:{api_key:r,lists:d}}).always((function(){q.a.Modal.loading(!1)})).done((function(e){return t(e.data)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}}))};Eo.propTypes={onFinish:Z.a.func},Eo.defaultProps={onFinish:function(){}};var ko=Eo,Io=a(487),So=a.n(Io),Co=a(318),No=a.n(Co),xo=a(139),To=a.n(xo),Ro=function(e){var t;return To()(t=window.roleBasedEmails).call(t,(function(t){return No()(e).call(e,"".concat(t,"@"))}))>=0},Po=function(e){var t,a,n,r=ve()("<div />").html(e).text();(r=r.toLowerCase().replace(/^["';.,\s]+|[^\x20-\x7E]+$|["';.,_\s]+$/g,"").replace(/\s+|%\d+|,+/g,""),t=/<(.*?)>/.exec(r))&&(r=qa()(a=t[1]).call(a));(t=/mailto:(?:\s+)?(.*)/.exec(r))&&(r=qa()(n=t[1]).call(n));return!!window.mailpoet_email_regex.test(r)&&(!Ro(r)&&r)};var Oo=function(e){var t,a,n,r,i,s=[],o=[],l=[],c=[],p=[],d=null,m=null,h=!1;return u()(t=b()(e)).call(t,(function(t){var f,g;(r=x()(f=e[t]).call(f,(function(e){return qa()(e).call(e)})),i=r.length,null===m&&(m=i),i===m)&&(null===d?(u()(g=b()(r)).call(g,(function(e){n=Po(r[e]),null===d&&window.mailpoet_email_regex.test(n)&&(d=e,o[n]=!0,r[e]=n,s[n]=r)})),null===d&&0===Se()(t,10)&&(h=!0,s[0]=r)):""!==r[d]&&(a=Po(r[d]),O.a.has(o,a)?l.push(a):Ro(r[d])?p.push(r[d]):window.mailpoet_email_regex.test(a)?(o[a]=!0,r[d]=a,s[a]=r):c.push(r[d])))})),(s=ce()(O.a).call(O.a,s))&&(h&&s.length>=2||!h&&s.length>=1)?{header:window.mailpoet_email_regex.test(s[0][d])?null:s.shift(),subscribers:s,subscribersCount:s.length,duplicate:O.a.uniq(l),invalid:O.a.uniq(c),role:O.a.uniq(p)}:null};var Do=function(e,t){var a=encodeURI(e).split(/%..|./).length-1;q.a.Notice.hide(),a>window.maxPostSizeBytes?q.a.Notice.error(q.a.I18n.t("maxPostSizeNotice")):(q.a.Modal.loading(!0),So.a.parse(e,function(e){return{skipEmptyLines:!0,error:function(){q.a.Notice.hide(),q.a.Notice.error(q.a.I18n.t("dataProcessingError"))},complete:function(t){var a=Oo(t.data);if(a)e(a);else{var n=q.a.I18n.t("noValidRecords");n=(n=n.replace("[link]",'<a href="https://kb.mailpoet.com/article/126-importing-subscribers-with-csv-files" data-beacon-article="57ce079f903360649f6e56fc">')).replace("[/link]","</a>"),q.a.Notice.error(n)}q.a.Modal.loading(!1)}}}(t)))},Ao=function(e,t,a){return void 0===e?"step_data_manipulation":void 0===e.subscribersCount?"step_data_manipulation":e.subscribersCount<t?"step_data_manipulation":"mailchimp-method"===a?"step_data_manipulation":"step_input_validation"};function qo(e){var t=e.history,a=e.setStepMethodSelectionData,n=e.subscribersLimitForValidation,r=Object(T.useState)(void 0),i=Ne()(r,2),s=i[0],o=i[1],l=Object(T.useState)(""),c=Ne()(l,2),u=c[0],p=c[1],d=Object(T.useState)(void 0),m=Ne()(d,2),h=m[0],f=m[1],g=function(e){a(e),t.push(Ao(e,n,s))},v=function(){Do("paste-method"===s?u:h,(function(e){q.a.trackEvent("Subscribers import started",{source:"file-method"===s?"file upload":"pasted data","MailPoet Free version":window.mailpoet_version}),g(e)}))};return R.a.createElement("div",{className:"mailpoet_method_selection_step"},R.a.createElement(fo,{activeMethod:s,onMethodChange:o}),"paste-method"===s&&R.a.createElement(_o,{onValueChange:p,onFinish:v,canFinish:!!qa()(u).call(u),data:u}),"file-method"===s&&R.a.createElement(wo,{onValueChange:f,onFinish:v,canFinish:!!h,data:h}),"mailchimp-method"===s&&R.a.createElement(ko,{onFinish:function(e){q.a.trackEvent("Subscribers import started",{source:"MailChimp","MailPoet Free version":window.mailpoet_version}),g(e)}}))}qo.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,setStepMethodSelectionData:Z.a.func.isRequired,subscribersLimitForValidation:Z.a.number.isRequired};var Lo=Object(ne.withRouter)(qo);function Fo(e){var t=e.onSubmit,a=e.history,n=Object(T.useState)(void 0),r=Ne()(n,2),i=r[0],s=r[1];return R.a.createElement(R.a.Fragment,null,R.a.createElement("h2",null,q.a.I18n.t("validationStepHeading")),R.a.createElement("label",{htmlFor:"existing-list"},R.a.createElement("input",{"data-automation-id":"mailpoet_import_validation_step_option1",type:"radio",id:"existing-list",checked:"existing-list"===i,onChange:function(){return s("existing-list")}}),q.a.I18n.t("validationStepRadio1")),R.a.createElement("label",{htmlFor:"address-book"},R.a.createElement("input",{"data-automation-id":"mailpoet_import_validation_step_option2",type:"radio",id:"address-book",checked:"address-book"===i,onChange:function(){return s("address-book")}}),q.a.I18n.t("validationStepRadio2")),R.a.createElement(vo,{canGoNext:void 0!==i,onPreviousAction:function(){return a.push("step_method_selection")},onNextAction:function(){return t(i)}}))}Fo.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,onSubmit:Z.a.func.isRequired};var jo=Fo;var Mo=function(){return R.a.createElement("div",{className:"mailpoet_import_block","data-automation-id":"import_wrong_source_block"},R.a.createElement("p",null,q.a.I18n.t("validationStepBlock1")),R.a.createElement("p",null,q.a.I18n.t("validationStepBlock2")),R.a.createElement("a",{href:"https://kb.mailpoet.com/article/269-reconfirm-subscribers-to-your-list",target:"_blank",rel:"noopener noreferrer",className:"button button-primary"},q.a.I18n.t("validationStepBlockButton")))};var Vo=function(){return R.a.createElement("div",{className:"mailpoet_import_block","data-automation-id":"import_old_list_block"},R.a.createElement("p",null,q.a.I18n.t("validationStepBlock1")),R.a.createElement("p",null,q.a.I18n.t("validationStepBlock3")),R.a.createElement("p",null,q.a.I18n.t("validationStepBlock4")),R.a.createElement("a",{href:"https://kb.mailpoet.com/article/269-reconfirm-subscribers-to-your-list",target:"_blank",rel:"noopener noreferrer",className:"button button-primary"},q.a.I18n.t("validationStepBlockButton")))};function Bo(e){var t=e.onSubmit,a=Object(T.useState)("over2years"),n=Ne()(a,2),r=n[0],i=n[1];return R.a.createElement(R.a.Fragment,null,R.a.createElement("h2",null,q.a.I18n.t("validationStepLastSentHeading")),R.a.createElement("select",{value:r,onChange:function(e){i(e.target.value)},className:"mailpoet_last_sent","data-automation-id":"last_sent_to_list"},R.a.createElement("option",{value:"over2years"},q.a.I18n.t("validationStepLastSentOption1")),R.a.createElement("option",{value:"1to2years"},q.a.I18n.t("validationStepLastSentOption2")),R.a.createElement("option",{value:"less1year"},q.a.I18n.t("validationStepLastSentOption3")),R.a.createElement("option",{value:"less3months"},q.a.I18n.t("validationStepLastSentOption4"))),R.a.createElement("button",{type:"button",className:"button button-primary","data-automation-id":"last_sent_to_list_next",onClick:function(){t("over2years"===r||"1to2years"===r?"notRecently":"recently")}},q.a.I18n.t("validationStepLastSentNext")))}Bo.propTypes={onSubmit:Z.a.func.isRequired};var zo=Bo;function Uo(e){var t=e.stepMethodSelectionData,a=e.history,n=Object(T.useState)(void 0),r=Ne()(n,2),i=r[0],s=r[1],o=Object(T.useState)(void 0),l=Ne()(o,2),c=l[0],u=l[1];return Object(T.useEffect)((function(){void 0===t&&a.replace("step_method_selection")}),[t,a]),R.a.createElement("div",{className:"mailpoet_import_validation_step","data-automation-id":"mailpoet_import_validation_step"},void 0===i&&R.a.createElement(jo,{onSubmit:s,history:a}),"address-book"===i&&R.a.createElement(Mo,null),"existing-list"===i&&void 0===c&&R.a.createElement(zo,{onSubmit:function(e){u(e),"recently"===e&&a.push("step_data_manipulation")}}),"existing-list"===i&&"notRecently"===c&&R.a.createElement(Vo,null))}Uo.propTypes={history:Z.a.shape({push:Z.a.func.isRequired,replace:Z.a.func.isRequired}).isRequired,stepMethodSelectionData:Z.a.shape({duplicate:Z.a.arrayOf(Z.a.string),header:Z.a.arrayOf(Z.a.string),invalid:Z.a.arrayOf(Z.a.string),role:Z.a.arrayOf(Z.a.string),subscribersCount:Z.a.number,subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.string))})},Uo.defaultProps={stepMethodSelectionData:void 0};var $o=Object(ne.withRouter)(Uo),Wo=function(e){var t=e.translation,a=e.subscribers,n="";return a.length&&(n=St()(t.replace("%2$s",a.join(", ")),"%1$s",(function(){return R.a.createElement("strong",{key:t},a.length.toLocaleString())})),n=R.a.createElement("p",null,n)),n};Wo.propTypes={translation:Z.a.string.isRequired,subscribers:Z.a.arrayOf(Z.a.string).isRequired};var Ho=function(e){var t=e.stepMethodSelectionData,a=t.invalid,n=t.duplicate,r=t.role,i=Object(T.useState)(!1),s=Ne()(i,2),o=s[0],l=s[1],c=lt()("mailpoet_subscribers_data_parse_results_details",{mailpoet_hidden:!o}),u=R.a.createElement(Wo,{translation:q.a.I18n.t("importNoticeInvalid"),subscribers:a}),p=R.a.createElement(Wo,{translation:q.a.I18n.t("importNoticeDuplicate"),subscribers:n}),d="";if(r.length&&(d=St()(q.a.I18n.t("importNoticeRoleBased"),/(%1\$s|\[link\].*\[\/link\]|%2\$s)/,(function(e){return"%1$s"===e?R.a.createElement("strong",{key:"role-length"},r.length.toLocaleString()):"%2$s"===e?r.join(", "):R.a.createElement("a",{href:"https://kb.mailpoet.com/article/270-role-based-email-addresses-are-not-allowed","data-beacon-article":"5d0a1da404286318cac46fe5",target:"_blank",rel:"noopener noreferrer",key:e},e.replace("[link]","").replace("[/link]",""))})),d=R.a.createElement("p",null,d)),a.length||n.length||r.length){var m=a.length+n.length+r.length;return R.a.createElement("div",{className:"error"},R.a.createElement("p",null,St()(q.a.I18n.t("importNoticeSkipped"),"%1$s",(function(){return R.a.createElement("strong",{key:"lengths"},m.toLocaleString())}))," ",R.a.createElement("a",{className:"mailpoet_subscribers_data_parse_results_details_show","data-automation-id":"show-more-details",onClick:function(){return l(!o)},role:"button",tabIndex:0,onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),l(!o))}},q.a.I18n.t("showMoreDetails"))),R.a.createElement("div",{className:c},R.a.createElement("hr",null),u,p,d))}return null};Ho.propTypes={stepMethodSelectionData:Z.a.shape({duplicate:Z.a.arrayOf(Z.a.string),invalid:Z.a.arrayOf(Z.a.string),role:Z.a.arrayOf(Z.a.string)})},Ho.defaultProps={stepMethodSelectionData:{invalid:[],duplicate:[],role:[]}};var Ko=Ho,Go=a(488),Yo=a.n(Go),Jo=a(489),Qo=a.n(Jo),Zo=function(){ve()("select.mailpoet_subscribers_column_data_match").select2({data:window.mailpoetColumnsSelect2,width:"15em",templateResult:function(e){return e.name},templateSelection:function(e){return e.name}}).on("select2:selecting",(function(e){var t=e.currentTarget,a=e.params.args.data.id;"create"===a?(e.preventDefault(),ve()(t).select2("close"),q.a.Modal.popup({title:q.a.I18n.t("addNewField"),template:ve()("#form_template_field_form").html()}),ve()("#form_field_new").parsley().on("form:submit",(function(){var e=ve()("#form_field_new").mailpoetSerializeObject();return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:e}).done((function(e){var a={id:e.data.id,name:e.data.name,type:e.data.type,params:e.data.params,custom:!0};2===window.mailpoetColumnsSelect2.length&&window.mailpoetColumnsSelect2.push({name:q.a.I18n.t("userColumns"),children:[]}),window.mailpoetColumnsSelect2[2].children.push(a),window.mailpoetColumns.push(a),ve()("select.mailpoet_subscribers_column_data_match").each((function(){ve()(t).html("").select2("destroy").select2({data:window.mailpoetColumnsSelect2,width:"15em",templateResult:function(e){return e.name},templateSelection:function(e){return e.name}})})),ve()(t).data("column-id",a.id),q.a.Modal.close()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{positionAfter:"#field_name"})})),!1}))):ve()("select.mailpoet_subscribers_column_data_match").each((function(){var n,r=t,i=ve()(r).val();i===a&&"ignore"!==i&&(confirm(E()(n="".concat(q.a.I18n.t("selectedValueAlreadyMatched")," ")).call(n,q.a.I18n.t("confirmCorrespondingColumn")))?ve()(r).data("column-id","ignore"):(e.preventDefault(),ve()(t).select2("close")))}))})).on("select2:select",(function(e){var t=e.currentTarget,a=e.params.data.id;ve()(t).data("column-id",a)})),x()(ve.a).call(ve.a,ve()(".mailpoet_subscribers_column_data_match"),(function(e){var t=ve()(e).data("column-id");ve()(e).val(t).trigger("change")}))},Xo=function(e,t){var a,n,r,i,s,o=[],l=[];return u()(a=b()(e[0])).call(a,(function(a){if(n=e[0][a],r="ignore",n%1!=0&&window.mailpoet_email_regex.test(n))r="email";else if(t){var c,u;i=t[a],-1!==(s=sn()(c=x()(u=window.mailpoetColumns).call(u,(function(e){return e.name}))).call(c,i))?r=window.mailpoetColumns[s].id:i&&(/first|first name|given name/i.test(i)?r="first_name":/last|last name/i.test(i)&&(r="last_name"))}r="ignore"!==r&&-1===sn()(l).call(l,r)?r:"ignore",o[a]={column_id:r},l.push(r)})),o},el=10;function tl(e){var t=e.header,a=e.subscribers,n=Xo(a,t);return R.a.createElement("tr",null,R.a.createElement("th",null,q.a.I18n.t("matchData")),x()(n).call(n,(function(e,t){return R.a.createElement("th",{key:e.column_id+t},R.a.createElement("select",{className:"mailpoet_subscribers_column_data_match","data-column-id":e.column_id,"data-column-index":t,id:"column_".concat(t)}))})))}function al(e){var t=e.header;return R.a.createElement("tr",{className:"mailpoet_header"},R.a.createElement("td",null),x()(t).call(t,(function(e){return R.a.createElement("td",{key:e},e)})))}function nl(e){var t=e.subscriber,a=e.index;return R.a.createElement(R.a.Fragment,null,R.a.createElement("td",null,a),x()(t).call(t,(function(e,t){var n,r;return R.a.createElement("td",{key:E()(n=E()(r="".concat(e,"-")).call(r,a,"-")).call(n,t)},e)})))}function rl(e){var t,a,n=e.subscribers,r=e.subscribersCount,i=Qo()(t=Array(n[0].length)).call(t,". . .");return R.a.createElement(R.a.Fragment,null,x()(a=Yo()(n).call(n,0,el)).call(a,(function(e,t){var a;return(R.a.createElement("tr",{key:E()(a="".concat(e[0],"-")).call(a,t)},R.a.createElement(nl,{subscriber:e,index:t+1})))})),r>el+1?R.a.createElement("tr",{key:"filler"},R.a.createElement(nl,{subscriber:i,index:". . ."})):null,r>el?R.a.createElement("tr",{key:n[r-1][0]},R.a.createElement(nl,{subscriber:n[r-1],index:r})):null)}function il(e){var t=e.subscribersCount,a=e.subscribers,n=e.header;return Object(T.useLayoutEffect)((function(){Zo()})),R.a.createElement("div",{className:"subscribers_data"},R.a.createElement("table",{className:"mailpoet_subscribers widefat fixed"},R.a.createElement("thead",null,R.a.createElement(tl,{header:n,subscribers:a})),R.a.createElement("tbody",null,n?R.a.createElement(al,{header:n}):null,R.a.createElement(rl,{subscribers:a,subscribersCount:t}))))}tl.propTypes={subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number]))).isRequired,header:Z.a.arrayOf(Z.a.string)},tl.defaultProps={header:[]},al.propTypes={header:Z.a.arrayOf(Z.a.string).isRequired},nl.propTypes={subscriber:Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number])).isRequired,index:Z.a.node.isRequired},rl.propTypes={subscribersCount:Z.a.number.isRequired,subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number]))).isRequired},il.propTypes={subscribersCount:Z.a.number,subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number]))),header:Z.a.arrayOf(Z.a.string)},il.defaultProps={subscribersCount:0,subscribers:[],header:[]};var sl=il;var ol=function(e){q.a.Modal.popup({title:q.a.I18n.t("addNewList"),template:ve()("#new_segment_template").html()}),ve()("#new_segment_name").keypress((function(e){13===e.which&&ve()("#new_segment_process").click()})),ve()("#new_segment_process").click((function(){var t,a,n=qa()(t=ve()("#new_segment_name").val()).call(t),r=qa()(a=ve()("#new_segment_description").val()).call(a);q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"addSegment",data:{name:n,description:r}}).done((function(t){e({id:t.data.id,name:t.data.name,text:t.data.name,subscriberCount:0}),q.a.Modal.close()})).fail((function(e){var t;e.errors.length>0&&(q.a.Notice.hide(),q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{positionAfter:"#new_segment_name"}))}))})),ve()("#new_segment_cancel").click((function(){q.a.Modal.close()}))};function ll(e){var t=e.setSelectedSegments,a=Object(T.useContext)(Ge.a).segments.all,n=Object(T.useState)(a),r=Ne()(n,2),i=r[0],s=r[1];Object(T.useLayoutEffect)((function(){!function(e,t){var a=ve()("select#mailpoet_segments_select");a.data("select2")||(a.html(""),a.select2({data:e,width:"20em",templateResult:function(e){var t,a=e;return a.subscriberCount=Se()(a.subscriberCount,10),E()(t="".concat(a.name," (")).call(t,a.subscriberCount.toLocaleString(),")")},templateSelection:function(e){var t,a=e;return a.subscriberCount=Se()(a.subscriberCount,10),E()(t="".concat(a.name," (")).call(t,a.subscriberCount.toLocaleString(),")")}}).change((function(e){var n=ve()('[data-id="notice_segmentSelection"]');e.currentTarget.value?ve()('[data-id="notice_segmentSelection"]').remove():n.length||q.a.Notice.error(q.a.I18n.t("segmentSelectionRequired"),{static:!0,scroll:!0,id:"notice_segmentSelection",hideClose:!0});var r=O.a.pluck(a.select2("data"),"id");t(r)})))}(i,(function(e){t(e)}))}),[i,t]);var o=function(e){var a,n;(n=ve()("select#mailpoet_segments_select")).data("select2")&&(n.select2("destroy"),me()(n).call(n,"option").remove(),n.off("select2:unselecting").off("change").off("select2:opening")),t([]),s(E()(a=[]).call(a,I()(i),[e]))};return R.a.createElement("div",{className:"mailpoet_import_select_segment"},R.a.createElement("label",{htmlFor:"mailpoet_segments_select"},R.a.createElement("div",{className:"mailpoet_label_description"},R.a.createElement("b",null,q.a.I18n.t("pickLists")),R.a.createElement("p",{className:"description"},q.a.I18n.t("pickListsDescription"))),R.a.createElement("select",{id:"mailpoet_segments_select","data-placeholder":q.a.I18n.t("select"),multiple:"multiple"},R.a.createElement("option",null))),R.a.createElement("a",{className:"mailpoet_create_segment",onClick:function(){return ol(o)},role:"button",tabIndex:0,onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),ol(o))}},q.a.I18n.t("createANewList")))}ll.propTypes={setSelectedSegments:Z.a.func.isRequired};var cl=ll;function ul(e){var t=e.updateExistingSubscribers,a=e.setUpdateExistingSubscribers;return R.a.createElement("div",{className:"mailpoet_update_existing_subscribers"},R.a.createElement("div",{className:"mailpoet_label_description"},q.a.I18n.t("updateExistingSubscribers")),R.a.createElement("label",{htmlFor:"update_existing_subscribers"},R.a.createElement("input",{id:"update_existing_subscribers",type:"radio",name:"update_existing_subscribers",checked:t,onChange:function(){return a(!0)}}),q.a.I18n.t("updateExistingSubscribersYes")),R.a.createElement("label",{htmlFor:"dont_update_existing_subscribers"},R.a.createElement("input",{id:"dont_update_existing_subscribers",type:"radio",name:"update_existing_subscribers",checked:!t,onChange:function(){return a(!1)}}),q.a.I18n.t("updateExistingSubscribersNo")))}ul.propTypes={setUpdateExistingSubscribers:Z.a.func.isRequired,updateExistingSubscribers:Z.a.bool.isRequired};var pl=ul,dl=(a(624),function(e,t,a,n){var r={},i=new ve.a.AsyncQueue,s=0,o=kt()()/1e3,l={created:0,updated:0,errors:[],segments:[]};q.a.Modal.loading(!0);var c,u,p=(c=e,u=2e3,Pe()(c).call(c,(function(e,t,a){return a%u==0&&e.push([]),e[e.length-1].push(t),e}),[]));O.a.each(ve()("select.mailpoet_subscribers_column_data_match"),(function(e,t){var a=ve()(e).data("column-id");"ignore"!==a&&(r[a]={index:t})})),O.a.each(p,(function(){i.add((function(e){e.pause(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"processImport",data:oe()({columns:r,subscribers:p[s],timestamp:o,segments:t,updateSubscribers:a})}).done((function(t){var a=t.data.added_to_segment_with_welcome_notification;l.created+=t.data.created,l.updated+=t.data.updated,l.segments=t.data.segments,l.added_to_segment_with_welcome_notification=a,e.run()})).fail((function(e){var t;(q.a.Modal.loading(!1),e.errors.length>0)&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})})),s+=1}))})),i.run(),i.onComplete((function(){q.a.Modal.loading(!1),l.errors.length>0&&!l.updated&&!l.created?q.a.Notice.error(O.a.flatten(l.errors)):(l.segments=x()(O.a).call(O.a,h()(O.a).call(O.a,l.segments,(function(e){return C()(t).call(t,e.id)})),(function(e){return e.name})),n(l))}))});function ml(e){var t=e.history,a=e.stepMethodSelectionData,n=e.subscribersLimitForValidation,r=e.setStepDataManipulationData,i=Object(T.useState)([]),s=Ne()(i,2),o=s[0],l=s[1],c=Object(T.useState)(!0),u=Ne()(c,2),p=u[0],d=u[1];Object(T.useEffect)((function(){void 0===a&&t.replace("step_method_selection")}),[a,t]);return void 0===a?null:R.a.createElement("div",{className:"mailpoet_data_manipulation_step","data-automation-id":"import_data_manipulation_step"},R.a.createElement(Ko,{stepMethodSelectionData:a}),R.a.createElement(sl,{subscribersCount:a.subscribersCount,subscribers:a.subscribers,header:a.header}),R.a.createElement(cl,{setSelectedSegments:l}),R.a.createElement(pl,{setUpdateExistingSubscribers:d,updateExistingSubscribers:p}),R.a.createElement(vo,{canGoNext:o.length>0,onPreviousAction:function(){return t.push(function(e,t){return void 0===e?"step_method_selection":void 0===e.subscribersCount?"step_method_selection":e.subscribersCount<t?"step_method_selection":"step_input_validation"}(a,n))},onNextAction:function(){dl(a.subscribers,o,p,(function(e){r(e),t.push("step_results")}))}}))}ml.propTypes={history:Z.a.shape({push:Z.a.func.isRequired,replace:Z.a.func.isRequired}).isRequired,stepMethodSelectionData:Z.a.shape({duplicate:Z.a.arrayOf(Z.a.string),header:Z.a.arrayOf(Z.a.string),invalid:Z.a.arrayOf(Z.a.string),role:Z.a.arrayOf(Z.a.string),subscribersCount:Z.a.number,subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number])))}),subscribersLimitForValidation:Z.a.number.isRequired,setStepDataManipulationData:Z.a.func.isRequired},ml.defaultProps={stepMethodSelectionData:void 0};var hl=Object(ne.withRouter)(ml),fl=function(e){return e.subscribersCount<2e3?null:R.a.createElement("div",{className:"mailpoet_offer_migration"},R.a.createElement("h2",null,q.a.I18n.t("offerMigrationHead")),R.a.createElement("p",null,q.a.I18n.t("offerMigrationSubhead"),":"),R.a.createElement("ul",{className:"default-list"},R.a.createElement("li",null,q.a.I18n.t("offerMigrationList1")),R.a.createElement("li",null,q.a.I18n.t("offerMigrationList2")),R.a.createElement("li",null,q.a.I18n.t("offerMigrationList3")),R.a.createElement("li",null,q.a.I18n.t("offerMigrationList4"))),R.a.createElement("a",{type:"button",className:"button-primary wysija",href:"https://www.mailpoet.com/concierge-migration/",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("offerMigrationCTA")))};fl.propTypes={subscribersCount:Z.a.number.isRequired};var gl=fl;function vl(e){var t=e.subscribersCount,a=e.segments,n=e.initialMessage;if(t){var r=St()(n,"%1$s",(function(){return R.a.createElement("strong",{key:"%1$s"},t.toLocaleString())}));return r=St()(r,"%2$s",(function(){return'"'.concat(a.join('", "'),'"')})),R.a.createElement("p",null,r)}return null}function bl(e){var t=e.createdSubscribers,a=e.updatedSubscribers;return t||a?null:R.a.createElement("p",null,q.a.I18n.t("importNoAction"))}function _l(e){return e.addedToSegmentWithWelcomeNotification?R.a.createElement("p",null,q.a.I18n.t("importNoWelcomeEmail")):null}function yl(e){var t=e.errors,a=e.createdSubscribers,n=e.updatedSubscribers,r=e.segments,i=e.addedToSegmentWithWelcomeNotification,s=e.history;Object(T.useEffect)((function(){void 0===r&&0===t.length&&void 0===a&&void 0===n&&s.replace("step_method_selection")}),[r,a,t.length,s,n]),t.length&&q.a.Notice.error(O.a.flatten(t));var o=0;return null!=a&&(o+=a),null!=n&&(o+=n),R.a.createElement(R.a.Fragment,null,R.a.createElement("div",{className:"updated"},R.a.createElement(vl,{subscribersCount:a,segments:r,initialMessage:q.a.I18n.t("subscribersCreated")}),R.a.createElement(vl,{subscribersCount:n,segments:r,initialMessage:q.a.I18n.t("subscribersUpdated")}),R.a.createElement(bl,{createdSubscribers:a,updatedSubscribers:n}),R.a.createElement(_l,{addedToSegmentWithWelcomeNotification:i})),R.a.createElement("button",{type:"button",className:"button-primary wysija",onClick:function(){return s.push("step_method_selection")}},q.a.I18n.t("importAgain")),"  ",R.a.createElement("button",{type:"button",className:"button-primary wysija",onClick:function(){window.location.href="admin.php?page=mailpoet-subscribers"}},q.a.I18n.t("viewSubscribers")),R.a.createElement(gl,{subscribersCount:o}))}vl.propTypes={segments:Z.a.arrayOf(Z.a.string.isRequired),subscribersCount:Z.a.number,initialMessage:Z.a.string},vl.defaultProps={segments:[],subscribersCount:0,initialMessage:""},bl.propTypes={createdSubscribers:Z.a.number,updatedSubscribers:Z.a.number},bl.defaultProps={createdSubscribers:0,updatedSubscribers:0},_l.propTypes={addedToSegmentWithWelcomeNotification:Z.a.bool},_l.defaultProps={addedToSegmentWithWelcomeNotification:!1},yl.propTypes={history:Z.a.shape({push:Z.a.func.isRequired,replace:Z.a.func.isRequired}).isRequired,errors:Z.a.arrayOf(Z.a.string.isRequired),segments:Z.a.arrayOf(Z.a.string.isRequired),createdSubscribers:Z.a.number,updatedSubscribers:Z.a.number,addedToSegmentWithWelcomeNotification:Z.a.bool},yl.defaultProps={errors:[],segments:void 0,createdSubscribers:void 0,updatedSubscribers:void 0,addedToSegmentWithWelcomeNotification:void 0};var wl=Object(ne.withRouter)(yl),El=document.getElementById("import_container");El&&_e.a.render(R.a.createElement((function(){var e=Object(T.useState)(void 0),t=Ne()(e,2),a=t[0],n=t[1],r=Object(T.useState)({}),i=Ne()(r,2),s=i[0],o=i[1],l=Object(Ge.b)(window);return R.a.createElement(Ge.a.Provider,{value:l},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(mo,null,R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{path:"/step_method_selection",render:function(e){return R.a.createElement(Lo,pe()({},e,{setStepMethodSelectionData:n,subscribersLimitForValidation:200}))}}),R.a.createElement(ne.Route,{path:"/step_input_validation",render:function(e){return R.a.createElement($o,pe()({},e,{stepMethodSelectionData:a}))}}),R.a.createElement(ne.Route,{path:"/step_data_manipulation",render:function(e){return R.a.createElement(hl,pe()({},e,{stepMethodSelectionData:a,subscribersLimitForValidation:200,setStepDataManipulationData:o}))}}),R.a.createElement(ne.Route,{path:"/step_results",render:function(e){return R.a.createElement(wl,pe()({},e,{errors:s.errors,createdSubscribers:s.created,updatedSubscribers:s.updated,segments:s.segments,addedToSegmentWithWelcomeNotification:s.added_to_segment_with_welcome_notification}))}}),R.a.createElement(ne.Route,{path:"*",render:function(){return R.a.createElement(ne.Redirect,{to:"/step_method_selection"})}})))))}),null),El);var kl=a(27),Il=a.n(kl);ve()(document).ready((function(){var e,t,a,n,r,i;function s(e){"on"===e?n.removeClass("button-disabled"):n.addClass("button-disabled")}ve()("#mailpoet_subscribers_export").length&&window.exportData.segments&&(i=Il.a.compile(ve()("#mailpoet_subscribers_export_template").html()),ve()("#mailpoet_subscribers_export > div.inside").html(i(window.exportData)),t=ve()("#export_lists"),a=ve()("#export_columns"),n=ve()("a.mailpoet_export_process"),r=function(e,n){e.data("select2")&&e.html("").select2("destroy"),e.select2({data:n,width:"20em",templateResult:function(e){return e.subscriberCount>0?e.name+" ("+Se()(e.subscriberCount,10).toLocaleString()+")":e.name},templateSelection:function(e){return e.subscriberCount>0?e.name+" ("+Se()(e.subscriberCount,10).toLocaleString()+")":e.name}}).on("select2:selecting",(function(t){var a,n=t.params.args.data.id,r=["select","deselect"];O.a.contains(r,n)&&(t.preventDefault(),"deselect"===n?ve()(this).val("").trigger("change"):(a=[],O.a.each(me()(e).call(e,"option"),(function(e){O.a.contains(r,e.value)||a.push(e.value)})),ve()(this).val(a).trigger("change")),ve()(this).select2("close"))})).on("change",(function(){window.exportData.segments&&t.select2("data").length&&a.select2("data").length||!window.exportData.segments&&a.select2("data").length?s("on"):s("off")}))},u()(e=window.segments).call(e,(function(e){t.append(ve()("<option></option>").attr("value",e.id).text(e.name))})),r(t,window.segments),r(a,window.subscriberFieldsSelect2),a.val(["email","first_name","last_name","list_status","global_status"]).trigger("change"),n.click((function(){var e;ve()(this).hasClass("button-disabled")||(q.a.Modal.loading(!0),e=ve()(':radio[name="option_format"]:checked').val(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"processExport",data:oe()({export_format_option:e,segments:!!window.exportData.segments&&t.val(),subscriber_fields:a.val()})}).always((function(){q.a.Modal.loading(!1)})).done((function(t){var a=q.a.I18n.t("exportMessage").replace("%1$s","<strong>"+Se()(t.data.totalExported,10).toLocaleString()+"</strong>").replace("[link]",'<a href="'+t.data.exportFileURL+'" target="_blank" >').replace("[/link]","</a>");ve()("#export_result_notice").html("<p>"+a+"</p>").show(),window.location.href=t.data.exportFileURL,q.a.trackEvent("Subscribers export completed",{"Total exported":t.data.totalExported,"File Format":e,"MailPoet Free version":window.mailpoet_version})})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})})))})))}));var Sl=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardLetsStartTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardSenderText")),R.a.createElement("form",{id:"mailpoet_sender_form",className:e.loading?"mailpoet_sender_form_loading":"",onSubmit:function(t){t.preventDefault(),ve()("#mailpoet_sender_form").parsley().validate()&&e.submit_sender()}},R.a.createElement("label",{htmlFor:"senderName"},q.a.I18n.t("senderName"),":",R.a.createElement("input",{name:"senderName",type:"text",placeholder:"John Doe",value:e.sender?e.sender.name:"","data-parsley-required":!0,onChange:function(t){return e.update_sender({name:t.target.value})}})),R.a.createElement("label",{htmlFor:"senderAddress"},q.a.I18n.t("senderAddress"),":",R.a.createElement("input",{name:"senderAddress",type:"text",placeholder:"john@doe.com",value:e.sender?e.sender.address:"","data-parsley-required":!0,"data-parsley-type":"email",onChange:function(t){return e.update_sender({address:t.target.value})}})),R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_controls"},R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("next")})),R.a.createElement("a",{onClick:e.finish,href:"#finish",className:"sender_form_small"},q.a.I18n.t("noThanksSkip"))))};Sl.propTypes={finish:Z.a.func.isRequired,loading:Z.a.bool.isRequired,update_sender:Z.a.func.isRequired,submit_sender:Z.a.func.isRequired,sender:Z.a.shape({name:Z.a.string,address:Z.a.string})},Sl.defaultProps={sender:null};var Cl=Sl,Nl=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardLetsStartTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardSenderMigratedUserText")),R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_controls"},R.a.createElement("button",{type:"button",className:"button button-primary",onClick:e.next},q.a.I18n.t("next"))))};Nl.propTypes={next:Z.a.func.isRequired};var xl=Nl,Tl=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardEmailCourseTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardEmailCourseText")),R.a.createElement("iframe",{id:"mailpoet_form_iframe",width:"100%",scrolling:"no",frameBorder:"0",title:"Apply to course",src:"https://www.mailpoet.com?mailpoet_form_iframe=13",className:"mailpoet_form_iframe",marginWidth:"0",marginHeight:"0"}),R.a.createElement("button",{type:"button",className:"button button-primary",onClick:e.next},q.a.I18n.t("next")))};Tl.propTypes={next:Z.a.func.isRequired};var Rl=Tl,Pl=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardUsageTrackingStepTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardTrackingText")),R.a.createElement("h2",{className:"welcome_wizard_tracking_sub_title"},q.a.I18n.t("welcomeWizardUsageTrackingStepSubTitle")),R.a.createElement("ul",{className:"welcome_wizard_tracking_list"},R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList1")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList2")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList3")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList4")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList5"))),R.a.createElement("a",{href:" https://kb.mailpoet.com/article/130-sharing-your-data-with-us","data-beacon-article":"57ce0aaac6979108399a0454",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("welcomeWizardTrackingLink")),R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_controls\n ".concat(e.loading?"mailpoet_welcome_wizard_step_controls_loading":"")},R.a.createElement("button",{type:"button",className:"button",onClick:e.skip_action,disabled:e.loading},q.a.I18n.t("skip")),R.a.createElement("button",{type:"button",className:"button button-primary",onClick:e.allow_action,disabled:e.loading},e.allow_text)))};Pl.propTypes={allow_action:Z.a.func.isRequired,allow_text:Z.a.string.isRequired,skip_action:Z.a.func.isRequired,loading:Z.a.bool.isRequired};var Ol=Pl,Dl=function(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement("div",{className:"mailpoet_welcome_wizard_header"},R.a.createElement("img",{src:window.mailpoet_logo_url,width:"200",height:"87",alt:"MailPoet logo"})),R.a.createElement(wr,{illustrationUrl:e.illustrationUrl,step:e.step,stepsCount:e.stepsCount,displayProgressBar:e.displayProgressBar},e.children))};Dl.propTypes={illustrationUrl:Z.a.string.isRequired,step:Z.a.number.isRequired,displayProgressBar:Z.a.bool,stepsCount:Z.a.number.isRequired,children:Z.a.oneOfType([Z.a.arrayOf(Z.a.node),Z.a.node]).isRequired},Dl.defaultProps={displayProgressBar:!0};var Al=Dl,ql=function(e){var t,a=e.name,n=e.address,r=n.split("@").pop().toLowerCase();return sn()(t=window.mailpoet_free_domains).call(t,r)>-1?function(e){var t=e.name,a=e.address,n=window.location.hostname.replace("www.",""),r="wordpress@".concat(n);return{sender:{name:t,address:r},reply_to:{name:t,address:a},"signup_confirmation.from.address":r,"signup_confirmation.from.name":t,"signup_confirmation.reply_to.address":a,"signup_confirmation.reply_to.name":t}}({name:a,address:n}):function(e){var t=e.name,a=e.address;return{sender:{name:t,address:a},reply_to:{name:t,address:a},"signup_confirmation.from.address":a,"signup_confirmation.from.name":t,"signup_confirmation.reply_to.address":a,"signup_confirmation.reply_to.name":t}}({name:a,address:n})},Ll=function(){var e=3;return window.has_mss_key_specified||(e+=1),e},Fl=function(e,t,a){a<Ll()?e.push("/steps/".concat(a+1)):t()};function jl(e,t){var a=b()(e);if(g.a){var n=g()(e);t&&(n=h()(n).call(n,(function(t){return d()(e,t).enumerable}))),a.push.apply(a,n)}return a}var Ml=function(e){var t=Ll(),a=Se()(e.match.params.step,10),n=Object(T.useState)(!1),i=Ne()(n,2),o=i[0],c=i[1],p=Object(T.useState)(window.sender_data),m=Ne()(p,2),h=m[0],f=m[1];function g(){c(!0),window.location=window.finish_wizard_url}Object(T.useEffect)((function(){(a>t||a<1)&&e.history.push("/steps/1")}),[a,t,e.history]);var v=Object(P.partial)(Fl,e.history,g);function b(e){return c(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:e}).then((function(){return c(!1)})).fail((function(e){var t;(c(!1),e.errors.length>0)&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}var _,w,E=(_=a,w=!window.is_mp2_migration_complete,1===_&&w?"WelcomeWizardSenderStep":1!==_||w?2===_?"WelcomeWizardEmailCourseStep":3===_?"WelcomeWizardUsageTrackingStep":"WelcomeWizardPitchMSSStep":"WelcomeWizardMigratedUserStep");return R.a.createElement("div",{className:"mailpoet_welcome_wizard_steps"},"WelcomeWizardSenderStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_sender_illustration_url},R.a.createElement(Cl,{update_sender:function(e){f(function(e){for(var t=1;t<arguments.length;t++){var a,n=null!=arguments[t]?arguments[t]:{};if(t%2)u()(a=jl(Object(n),!0)).call(a,(function(t){y()(e,t,n[t])}));else if(l.a)s()(e,l()(n));else{var i;u()(i=jl(Object(n))).call(i,(function(t){r()(e,t,d()(n,t))}))}}return e}({},h,{},e))},submit_sender:function(){b(ql(h)).then((function(){return v(a)}))},finish:function(){c(!0),b(ql({address:window.admin_email,name:""})).then(g)},loading:o,sender:h})):null,"WelcomeWizardMigratedUserStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_sender_illustration_url},R.a.createElement(xl,{next:function(){return v(a)}})):null,"WelcomeWizardEmailCourseStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_email_course_illustration_url},R.a.createElement(Rl,{next:function(){return v(a)}})):null,"WelcomeWizardUsageTrackingStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_tracking_illustration_url},R.a.createElement(Ol,{skip_action:function(){return v(a)},allow_action:function(){b({analytics:{enabled:!0}}).then((function(){return v(a)}))},allow_text:t>3?q.a.I18n.t("allowAndContinue"):q.a.I18n.t("allowAndFinish"),loading:o})):null,"WelcomeWizardPitchMSSStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_MSS_pitch_illustration_url},R.a.createElement(Nr,{next:function(){return v(a)},subscribersCount:window.subscribers_count,mailpoetAccountUrl:window.mailpoet_account_url})):null)};Ml.propTypes={match:Z.a.shape({params:Z.a.shape({step:Z.a.string}).isRequired}).isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var Vl=Ml,Bl=a(115),zl=a.n(Bl),Ul=function(e){function t(e){var a,n,r;return M()(this,t),(r=U()(this,W()(t).call(this,e))).state={importType:null},r.handleOptionChange=F()(a=r.handleOptionChange).call(a,K()(r)),r.submit=F()(n=r.submit).call(n,K()(r)),r}return Y()(t,e),B()(t,[{key:"handleOptionChange",value:function(e){this.setState({importType:e.target.value})}},{key:"submit",value:function(e){return e.preventDefault(),!!this.state.importType&&(this.props.submitForm(this.state.importType),!1)}},{key:"render",value:function(){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_centered_column"},R.a.createElement("h1",null,q.a.I18n.t("wooCommerceListImportTitle")),R.a.createElement("p",null,q.a.I18n.t("wooCommerceListImportInfo1")),R.a.createElement("p",null,q.a.I18n.t("wooCommerceListImportInfo2")),R.a.createElement("p",null,R.a.createElement("b",null,q.a.I18n.t("wooCommerceListImportInfo3"))),R.a.createElement("form",{onSubmit:this.submit,className:"mailpoet_wizard_woocommerce_list"},R.a.createElement("label",{htmlFor:"import_type_subscribed"},R.a.createElement("input",{id:"import_type_subscribed",type:"radio",name:"import_type",checked:"subscribed"===this.state.importType,onChange:this.handleOptionChange,value:"subscribed","data-automation-id":"import_as_subscribed"}),zl()(q.a.I18n.t("wooCommerceListImportCheckboxSubscribed"))),R.a.createElement("label",{htmlFor:"import_type_unsubscribed"},R.a.createElement("input",{id:"import_type_unsubscribed",type:"radio",name:"import_type",checked:"unsubscribed"===this.state.importType,onChange:this.handleOptionChange,value:"unsubscribed","data-automation-id":"import_as_unsubscribed"}),zl()(q.a.I18n.t("wooCommerceListImportCheckboxUnsubscribed"))),R.a.createElement("p",null,q.a.I18n.t("wooCommerceListImportInfo4")),R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("wooCommerceListImportSubmit"),disabled:!this.state.importType||this.props.loading,"data-automation-id":"submit_woo_commerce_list_import"})))}}]),t}(R.a.Component);Ul.propTypes={submitForm:Z.a.func.isRequired,loading:Z.a.bool.isRequired};var $l=Ul,Wl=function(e){function t(e){var a,n,r,i,s;return M()(this,t),(s=U()(this,W()(t).call(this,e))).state={loading:!1},s.updateSettings=F()(a=s.updateSettings).call(a,K()(s)),s.scheduleImport=F()(n=s.scheduleImport).call(n,K()(s)),s.finishWizard=F()(r=s.finishWizard).call(r,K()(s)),s.submit=F()(i=s.submit).call(i,K()(s)),s}return Y()(t,e),B()(t,[{key:"finishWizard",value:function(){this.setState({loading:!0}),window.location=window.finish_wizard_url}},{key:"updateSettings",value:function(e){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:e}).fail(this.handleApiError)}},{key:"scheduleImport",value:function(){var e=this;return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"importExport",action:"setupWooCommerceInitialImport"}).then((function(){return e.setState({loading:!1})})).fail(this.handleApiError)}},{key:"handleApiError",value:function(e){this.setState({loading:!1}),q.a.Notice.showApiErrorNotice(e,{scroll:!0})}},{key:"submit",value:function(e){this.setState({loading:!0});var t={woocommerce_import_screen_displayed:1,"mailpoet_subscribe_old_woocommerce_customers.enabled":"subscribed"===e?1:0};this.updateSettings(t).then(this.scheduleImport).then(this.finishWizard)}},{key:"render",value:function(){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_steps mailpoet_welcome_wizard_centered_column"},R.a.createElement("div",{className:"mailpoet_welcome_wizard_header"},R.a.createElement("img",{src:window.mailpoet_logo_url,width:"200",height:"87",alt:"MailPoet logo"})),R.a.createElement($l,{loading:this.state.loading,submitForm:this.submit}))}}]),t}(R.a.Component);Wl.propTypes={};var Hl=Wl;function Kl(e){var t=e.submitForm,a=e.loading,n=Object(T.useState)("true"),r=Ne()(n,2),i=r[0],s=r[1];return R.a.createElement("div",{className:" mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_step_revenue_tracking mailpoet_welcome_wizard_centered_column "},R.a.createElement("p",null,q.a.I18n.t("revenueTrackingInfo1")),R.a.createElement("p",null,q.a.I18n.t("revenueTrackingInfo2")),R.a.createElement("form",{onSubmit:function(e){return e.preventDefault(),void 0!==i&&(t("true"===i),!1)},className:"mailpoet_wizard_woocommerce_list"},R.a.createElement("label",{htmlFor:"tracking_allowed"},R.a.createElement("input",{id:"tracking_allowed",type:"radio",name:"import_type",checked:"true"===i,onChange:function(e){return s(e.target.value)},value:"true"}),q.a.I18n.t("revenueTrackingAllow")),R.a.createElement("label",{htmlFor:"tracking_not_allowed"},R.a.createElement("input",{id:"tracking_not_allowed",type:"radio",name:"import_type",checked:"false"===i,onChange:function(e){return s(e.target.value)},value:"false"}),q.a.I18n.t("revenueTrackingDontAllow")),R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("revenueTrackingSubmit"),disabled:a})))}Kl.propTypes={submitForm:Z.a.func.isRequired,loading:Z.a.bool.isRequired};var Gl=Kl;var Yl=function(){var e=Object(T.useState)(!1),t=Ne()(e,2),a=t[0],n=t[1],r=function(e){n(!1),q.a.Notice.showApiErrorNotice(e,{scroll:!0})},i=function(){window.location=window.finish_wizard_url};return R.a.createElement("div",{className:"mailpoet_welcome_wizard_steps mailpoet_welcome_wizard_centered_column"},R.a.createElement("div",{className:"mailpoet_welcome_wizard_header"},R.a.createElement("img",{src:window.mailpoet_logo_url,width:"200",height:"87",alt:"MailPoet logo"})),R.a.createElement(Gl,{loading:a,submitForm:function(e){var t;n(!0),(t={"woocommerce.accept_cookie_revenue_tracking.enabled":e?1:0,"woocommerce.accept_cookie_revenue_tracking.set":1},q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:t}).fail(r)).then(i)}}))},Jl=document.getElementById("mailpoet_wizard_container");Jl&&_e.a.render(R.a.createElement((function(){var e,t,a="/steps/1";C()(e=window.location.search).call(e,"revenue-tracking-permission")?a="/revenue-tracking-permission":C()(t=window.location.search).call(t,"woocommerce-list-import")&&(a="/import");var n=Object(Ge.b)(window);return R.a.createElement(Ge.a.Provider,{value:n},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{path:"/steps/:step",component:Vl}),R.a.createElement(ne.Route,{path:"/import",component:Hl}),R.a.createElement(ne.Route,{path:"/revenue-tracking-permission",component:Yl}),R.a.createElement(ne.Route,{render:function(){return R.a.createElement(ne.Redirect,{to:a})}}))))}),null),Jl);var Ql=a(460),Zl=a.n(Ql);function Xl(e,t){var a=b()(e);if(g.a){var n=g()(e);t&&(n=h()(n).call(n,(function(t){return d()(e,t).enumerable}))),a.push.apply(a,n)}return a}function ec(e){for(var t=1;t<arguments.length;t++){var a,n=null!=arguments[t]?arguments[t]:{};if(t%2)u()(a=Xl(Object(n),!0)).call(a,(function(t){y()(e,t,n[t])}));else if(l.a)s()(e,l()(n));else{var i;u()(i=Xl(Object(n))).call(i,(function(t){r()(e,t,d()(n,t))}))}}return e}var tc=document.getElementById("experimental_features_container");tc&&_e.a.render(R.a.createElement((function(){var e,t=Object(T.useState)(null),a=Ne()(t,2),n=a[0],r=a[1],i=Object(Ge.b)(window),s=i.notices.error;function o(e){var t=e.target.name,a=e.target.checked;q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"featureFlags",action:"set",data:y()({},t,a?1:0)}).done((function(){var e,s=n[t];s.value=a,r(ec({},n,y()({},t,s)));var o=E()(e="Feature '".concat(t,"' was ")).call(e,a?"enabled":"disabled",".");i.notices.success(R.a.createElement("p",null,o))})).fail((function(e){var t;e.errors.length>0&&s(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))}return Object(T.useEffect)((function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"featureFlags",action:"getAll"}).done((function(e){var t,a=Pe()(t=e.data).call(t,(function(e,t){return ec({},e,y()({},t.name,t))}),{});r(a)})).fail((function(e){var t;e.errors.length>0&&s(R.a.createElement(R.a.Fragment,null,x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",null,e.message)}))),{scroll:!0})}))}),[s]),null===n?R.a.createElement("p",null,"Loading experimental features..."):0===Zl()(n).length?R.a.createElement("p",null,"There are no experimental features at the moment."):R.a.createElement(Ge.a.Provider,{value:i},R.a.createElement(R.a.Fragment,null,R.a.createElement(en,null),x()(e=Zl()(n)).call(e,(function(e){var t="experimental-feature-".concat(e.name);return R.a.createElement("div",{key:e.name},R.a.createElement("label",{htmlFor:t},R.a.createElement("input",{id:t,type:"checkbox",name:e.name,defaultChecked:e.value,onChange:o})," ",e.name))}))))}),null),tc);var ac=27;function nc(e){var t=e.shouldCloseOnClickOutside,a=e.onRequestClose,n=e.shouldCloseOnEsc,r=e.overlayClassName,i=e.contentLabel,s=e.aria,o=s.describedby,l=s.labelledby,c=e.children,u=e.className,p=e.role,d=e.fullScreen,m=Object(T.useRef)(null);function h(e){a&&a(e)}return R.a.createElement("div",{className:lt()("mailpoet-modal-screen-overlay",r),onKeyDown:function(e){e.keyCode===ac&&function(e){n&&(e.stopPropagation(),h(e))}(e)},onClick:function(e){t&&m.current&&!m.current.contains(e.target)&&h(e)},role:"button",tabIndex:"0"},R.a.createElement("div",{ref:m,className:lt()("mailpoet-modal-frame",{"mailpoet-modal-full-screen":d},u),role:p,"aria-label":i,"aria-labelledby":i?null:l,"aria-describedby":o,tabIndex:"-1"},c))}nc.propTypes={onRequestClose:Z.a.func,shouldCloseOnEsc:Z.a.bool,fullScreen:Z.a.bool,shouldCloseOnClickOutside:Z.a.bool,role:Z.a.string,className:Z.a.string,contentLabel:Z.a.string,overlayClassName:Z.a.string,children:Z.a.node.isRequired,aria:Z.a.shape({describedby:Z.a.string,labelledby:Z.a.string})},nc.defaultProps={onRequestClose:function(){},role:"dialog",shouldCloseOnEsc:!0,fullScreen:!1,shouldCloseOnClickOutside:!0,className:"",aria:{describedby:"",labelledby:""},contentLabel:null,overlayClassName:""};var rc=nc,ic=R.a.createElement("svg",{viewBox:"0 0 48 48"},R.a.createElement("path",{d:"M42 6L6 42M6 6L42 42",strokeWidth:"12",strokeLinecap:"round"})),sc=function(e){var t=e.title,a=e.onClose,n=e.headingId,r=e.isDismissible;return R.a.createElement("div",{className:"mailpoet-modal-header"},R.a.createElement("div",{className:"mailpoet-modal-header-heading-container"},t&&R.a.createElement("h1",{id:n,className:"mailpoet-modal-header-heading"},t)),r&&R.a.createElement("button",{type:"button",onClick:a,className:"mailpoet-modal-close"},ic))};sc.propTypes={title:Z.a.string,headingId:Z.a.string,onClose:Z.a.func,isDismissible:Z.a.bool},sc.defaultProps={title:null,headingId:"heading-id",onClose:function(){},isDismissible:!0};var oc=sc;function lc(e){var t=e.onRequestClose,a=e.title,n=e.displayTitle,r=e.children,i=e.aria,s=e.isDismissible,o=e.shouldCloseOnEsc,l=e.shouldCloseOnClickOutside,c=e.role,u=e.contentClassName,p=e.contentLabel,d=e.overlayClassName,m=e.fullScreen,h=i.labelledby||"mailpoet-modal-header";return Object(be.createPortal)(R.a.createElement(rc,{onRequestClose:t,aria:{labelledby:a?h:null,describedby:i.describedby},shouldCloseOnEsc:o,shouldCloseOnClickOutside:l,role:c,className:u,contentLabel:p,overlayClassName:d,fullScreen:m},R.a.createElement("div",{className:"mailpoet-modal-content",role:"document"},n&&R.a.createElement(oc,{headingId:h,isDismissible:s,onClose:t,title:a}),r)),document.getElementById("mailpoet_modal"))}lc.propTypes={children:Z.a.node,aria:Z.a.shape({labelledby:Z.a.string,describedby:Z.a.string}),isDismissible:Z.a.bool,contentClassName:Z.a.string,contentLabel:Z.a.string,overlayClassName:Z.a.string,title:Z.a.string,onRequestClose:Z.a.func,displayTitle:Z.a.bool,fullScreen:Z.a.bool,focusOnMount:Z.a.bool,shouldCloseOnEsc:Z.a.bool,shouldCloseOnClickOutside:Z.a.bool,role:Z.a.string},lc.defaultProps={bodyOpenClassName:"modal-open",onRequestClose:function(){},role:"dialog",title:null,aria:{},focusOnMount:!0,shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,isDismissible:!0,displayTitle:!0,fullScreen:!1};var cc=lc,uc=window.mailpoet_api_version,pc=function(){var e=Wt()(Ut.a.mark((function e(t){return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",q.a.Ajax.post({api_version:uc,endpoint:"settings",action:"setAuthorizedFromAddress",data:{address:t}}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),dc=function(e){return e?"unauthorized"===e.error?q.a.I18n.t("setFromAddressEmailNotAuthorized").replace(/\[link\](.*?)\[\/link\]/g,'<a href="https://account.mailpoet.com/authorization" target="_blank" rel="noopener noreferrer">$1</a>'):e.message||q.a.I18n.t("setFromAddressEmailUnknownError"):q.a.I18n.t("setFromAddressEmailUnknownError")},mc=function(){var e=document.querySelector('[data-notice="unauthorized-email-addresses-notice"]');e&&e.remove();var t=document.querySelector('[data-notice="unauthorized-email-in-newsletters-addresses-notice"]');t&&t.remove();var a=document.querySelector('[data-id="mailpoet_authorization_error"]');a&&a.remove()},hc=function(e){var t=e.onRequestClose,a=e.setAuthorizedAddress,n=Object(T.useState)(null),r=Ne()(n,2),i=r[0],s=r[1],o=R.a.useContext(Ge.a).notices;return R.a.createElement(cc,{title:q.a.I18n.t("setFromAddressModalTitle"),onRequestClose:t,contentClassName:"set-from-address-modal"},R.a.createElement("p",null,St()(q.a.I18n.t("setFromAddressModalDescription"),/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{key:"setFromAddressModalDescriptionLink",href:"https://account.mailpoet.com/authorization",target:"_blank",rel:"noopener noreferrer"},e)}))),R.a.createElement("input",{id:"mailpoet-set-from-address-modal-input",type:"text",placeholder:"from@mydomain.com","data-parsley-required":!0,"data-parsley-type":"email",onChange:function(e){var t;s(qa()(t=e.target.value).call(t)||null),ve()("#mailpoet-set-from-address-modal-input").parsley().removeError("saveError")}}),R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("setFromAddressModalSave"),onClick:Wt()(Ut.a.mark((function e(){var n,r,s;return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=ve()("#mailpoet-set-from-address-modal-input").parsley()).validate(),n.isValid()){e.next=4;break}return e.abrupt("return");case 4:if(i){e.next=6;break}return e.abrupt("return");case 6:return e.prev=6,e.next=9,pc(i);case 9:a(i),t(),mc(),o.success(R.a.createElement("p",null,St()(q.a.I18n.t("setFromAddressEmailSuccess"),/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{key:"setFromAddressModalBasicsTabLink",href:"?page=mailpoet-settings#basics",rel:"noopener noreferrer"},e)}))),{timeout:!1}),e.next=20;break;case 15:e.prev=15,e.t0=e.catch(6),r=e.t0.errors&&e.t0.errors[0]?e.t0.errors[0]:null,s=dc(r),n.addError("saveError",{message:s});case 20:case"end":return e.stop()}}),e,null,[[6,15]])})))}))};hc.propTypes={onRequestClose:Z.a.func.isRequired,setAuthorizedAddress:Z.a.func},hc.defaultProps={setAuthorizedAddress:function(){}};var fc=hc,gc=function(e){var t=e.onRequestClose,a=Object(T.useState)(!1),n=Ne()(a,2),r=n[0],i=n[1];return ve()((function(e){e(document).on("click",".notice .mailpoet-js-button-fix-this",(function(){i(!0)}))})),R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(en,null),r&&R.a.createElement(fc,{onRequestClose:function(){i(!1),t()}}))};gc.propTypes={onRequestClose:Z.a.func},gc.defaultProps={onRequestClose:function(){}};var vc=document.getElementById("mailpoet_set_from_address_modal");vc&&_e.a.render(R.a.createElement(gc,{onRequestClose:function(){var e;C()(e=window.location.href).call(e,"?page=mailpoet-settings")&&window.location.reload()}}),vc)}},[[648,0,1]]]);
assets/dist/js/{admin_vendor.aa1497af.chunk.js → admin_vendor.efadeb05.chunk.js} RENAMED
File without changes
assets/dist/js/{admin_vendor_chunk.aa1497af.chunk.js → admin_vendor_chunk.efadeb05.chunk.js} RENAMED
File without changes
assets/dist/js/{form_editor.099af42d.js → form_editor.41e28ea1.js} RENAMED
@@ -109,4 +109,4 @@ var factory;factory=function(){return function(modules){var installedModules={};
109
  * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
110
  * Released under MIT license, http://github.com/requirejs/almond/LICENSE
111
  */
112
- var requirejs,require,define;S2&&S2.requirejs||(S2?require=S2:S2={},function(undef){var main,req,makeMap,handlers,defined={},waiting={},config={},defining={},hasOwn=Object.prototype.hasOwnProperty,aps=[].slice,jsSuffixRegExp=/\.js$/;function hasProp(obj,prop){return hasOwn.call(obj,prop)}function normalize(name,baseName){var nameParts,nameSegment,mapValue,foundMap,lastIndex,foundI,foundStarMap,starI,i,j,part,baseParts=baseName&&baseName.split("/"),map=config.map,starMap=map&&map["*"]||{};if(name){for(lastIndex=(name=name.split("/")).length-1,config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex])&&(name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"")),"."===name[0].charAt(0)&&baseParts&&(name=baseParts.slice(0,baseParts.length-1).concat(name)),i=0;i<name.length;i++)if("."===(part=name[i]))name.splice(i,1),i-=1;else if(".."===part){if(0===i||1===i&&".."===name[2]||".."===name[i-1])continue;i>0&&(name.splice(i-1,2),i-=2)}name=name.join("/")}if((baseParts||starMap)&&map){for(i=(nameParts=name.split("/")).length;i>0;i-=1){if(nameSegment=nameParts.slice(0,i).join("/"),baseParts)for(j=baseParts.length;j>0;j-=1)if((mapValue=map[baseParts.slice(0,j).join("/")])&&(mapValue=mapValue[nameSegment])){foundMap=mapValue,foundI=i;break}if(foundMap)break;!foundStarMap&&starMap&&starMap[nameSegment]&&(foundStarMap=starMap[nameSegment],starI=i)}!foundMap&&foundStarMap&&(foundMap=foundStarMap,foundI=starI),foundMap&&(nameParts.splice(0,foundI,foundMap),name=nameParts.join("/"))}return name}function makeRequire(relName,forceSync){return function(){var args=aps.call(arguments,0);return"string"!=typeof args[0]&&1===args.length&&args.push(null),req.apply(undef,args.concat([relName,forceSync]))}}function makeLoad(depName){return function(value){defined[depName]=value}}function callDep(name){if(hasProp(waiting,name)){var args=waiting[name];delete waiting[name],defining[name]=!0,main.apply(undef,args)}if(!hasProp(defined,name)&&!hasProp(defining,name))throw new Error("No "+name);return defined[name]}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;return index>-1&&(prefix=name.substring(0,index),name=name.substring(index+1,name.length)),[prefix,name]}function makeRelParts(relName){return relName?splitPrefix(relName):[]}function makeConfig(name){return function(){return config&&config.config&&config.config[name]||{}}}makeMap=function(name,relParts){var plugin,relName,parts=splitPrefix(name),prefix=parts[0],relResourceName=relParts[1];return name=parts[1],prefix&&(plugin=callDep(prefix=normalize(prefix,relResourceName))),prefix?name=plugin&&plugin.normalize?plugin.normalize(name,(relName=relResourceName,function(name){return normalize(name,relName)})):normalize(name,relResourceName):(prefix=(parts=splitPrefix(name=normalize(name,relResourceName)))[0],name=parts[1],prefix&&(plugin=callDep(prefix))),{f:prefix?prefix+"!"+name:name,n:name,pr:prefix,p:plugin}},handlers={require:function(name){return makeRequire(name)},exports:function(name){var e=defined[name];return void 0!==e?e:defined[name]={}},module:function(name){return{id:name,uri:"",exports:defined[name],config:makeConfig(name)}}},main=function(name,deps,callback,relName){var cjsModule,depName,ret,map,i,relParts,usingExports,args=[],callbackType=typeof callback;if(relParts=makeRelParts(relName=relName||name),"undefined"===callbackType||"function"===callbackType){for(deps=!deps.length&&callback.length?["require","exports","module"]:deps,i=0;i<deps.length;i+=1)if("require"===(depName=(map=makeMap(deps[i],relParts)).f))args[i]=handlers.require(name);else if("exports"===depName)args[i]=handlers.exports(name),usingExports=!0;else if("module"===depName)cjsModule=args[i]=handlers.module(name);else if(hasProp(defined,depName)||hasProp(waiting,depName)||hasProp(defining,depName))args[i]=callDep(depName);else{if(!map.p)throw new Error(name+" missing "+depName);map.p.load(map.n,makeRequire(relName,!0),makeLoad(depName),{}),args[i]=defined[depName]}ret=callback?callback.apply(defined[name],args):void 0,name&&(cjsModule&&cjsModule.exports!==undef&&cjsModule.exports!==defined[name]?defined[name]=cjsModule.exports:ret===undef&&usingExports||(defined[name]=ret))}else name&&(defined[name]=callback)},requirejs=require=req=function(deps,callback,relName,forceSync,alt){if("string"==typeof deps)return handlers[deps]?handlers[deps](callback):callDep(makeMap(deps,makeRelParts(callback)).f);if(!deps.splice){if((config=deps).deps&&req(config.deps,config.callback),!callback)return;callback.splice?(deps=callback,callback=relName,relName=null):deps=undef}return callback=callback||function(){},"function"==typeof relName&&(relName=forceSync,forceSync=alt),forceSync?main(undef,deps,callback,relName):setTimeout((function(){main(undef,deps,callback,relName)}),4),req},req.config=function(cfg){return req(cfg)},requirejs._defined=defined,(define=function(name,deps,callback){if("string"!=typeof name)throw new Error("See almond README: incorrect module build, no module name");deps.splice||(callback=deps,deps=[]),hasProp(defined,name)||hasProp(waiting,name)||(waiting[name]=[name,deps,callback])}).amd={jQuery:!0}}(),S2.requirejs=requirejs,S2.require=require,S2.define=define)}(),S2.define("almond",(function(){})),S2.define("jquery",[],(function(){var _$=jQuery||$;return null==_$&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),_$})),S2.define("select2/utils",["jquery"],(function($){var Utils={};function getMethods(theClass){var proto=theClass.prototype,methods=[];for(var methodName in proto)"function"==typeof proto[methodName]&&"constructor"!==methodName&&methods.push(methodName);return methods}Utils.Extend=function(ChildClass,SuperClass){var __hasProp={}.hasOwnProperty;function BaseConstructor(){this.constructor=ChildClass}for(var key in SuperClass)__hasProp.call(SuperClass,key)&&(ChildClass[key]=SuperClass[key]);return BaseConstructor.prototype=SuperClass.prototype,ChildClass.prototype=new BaseConstructor,ChildClass.__super__=SuperClass.prototype,ChildClass},Utils.Decorate=function(SuperClass,DecoratorClass){var decoratedMethods=getMethods(DecoratorClass),superMethods=getMethods(SuperClass);function DecoratedClass(){var unshift=Array.prototype.unshift,argCount=DecoratorClass.prototype.constructor.length,calledConstructor=SuperClass.prototype.constructor;argCount>0&&(unshift.call(arguments,SuperClass.prototype.constructor),calledConstructor=DecoratorClass.prototype.constructor),calledConstructor.apply(this,arguments)}DecoratorClass.displayName=SuperClass.displayName,DecoratedClass.prototype=new function(){this.constructor=DecoratedClass};for(var m=0;m<superMethods.length;m++){var superMethod=superMethods[m];DecoratedClass.prototype[superMethod]=SuperClass.prototype[superMethod]}for(var calledMethod=function(methodName){var originalMethod=function(){};methodName in DecoratedClass.prototype&&(originalMethod=DecoratedClass.prototype[methodName]);var decoratedMethod=DecoratorClass.prototype[methodName];return function(){var unshift=Array.prototype.unshift;return unshift.call(arguments,originalMethod),decoratedMethod.apply(this,arguments)}},d=0;d<decoratedMethods.length;d++){var decoratedMethod=decoratedMethods[d];DecoratedClass.prototype[decoratedMethod]=calledMethod(decoratedMethod)}return DecoratedClass};var Observable=function(){this.listeners={}};return Observable.prototype.on=function(event,callback){this.listeners=this.listeners||{},event in this.listeners?this.listeners[event].push(callback):this.listeners[event]=[callback]},Observable.prototype.trigger=function(event){var slice=Array.prototype.slice,params=slice.call(arguments,1);this.listeners=this.listeners||{},null==params&&(params=[]),0===params.length&&params.push({}),params[0]._type=event,event in this.listeners&&this.invoke(this.listeners[event],slice.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},Observable.prototype.invoke=function(listeners,params){for(var i=0,len=listeners.length;i<len;i++)listeners[i].apply(this,params)},Utils.Observable=Observable,Utils.generateChars=function(length){for(var chars="",i=0;i<length;i++)chars+=Math.floor(36*Math.random()).toString(36);return chars},Utils.bind=function(func,context){return function(){func.apply(context,arguments)}},Utils._convertData=function(data){for(var originalKey in data){var keys=originalKey.split("-"),dataLevel=data;if(1!==keys.length){for(var k=0;k<keys.length;k++){var key=keys[k];(key=key.substring(0,1).toLowerCase()+key.substring(1))in dataLevel||(dataLevel[key]={}),k==keys.length-1&&(dataLevel[key]=data[originalKey]),dataLevel=dataLevel[key]}delete data[originalKey]}}return data},Utils.hasScroll=function(index,el){var $el=$(el),overflowX=el.style.overflowX,overflowY=el.style.overflowY;return(overflowX!==overflowY||"hidden"!==overflowY&&"visible"!==overflowY)&&("scroll"===overflowX||"scroll"===overflowY||$el.innerHeight()<el.scrollHeight||$el.innerWidth()<el.scrollWidth)},Utils.escapeMarkup=function(markup){var replaceMap={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof markup?markup:String(markup).replace(/[&<>"'\/\\]/g,(function(match){return replaceMap[match]}))},Utils.appendMany=function($element,$nodes){if("1.7"===$.fn.jquery.substr(0,3)){var $jqNodes=$();$.map($nodes,(function(node){$jqNodes=$jqNodes.add(node)})),$nodes=$jqNodes}$element.append($nodes)},Utils})),S2.define("select2/results",["jquery","./utils"],(function($,Utils){function Results($element,options,dataAdapter){this.$element=$element,this.data=dataAdapter,this.options=options,Results.__super__.constructor.call(this)}return Utils.Extend(Results,Utils.Observable),Results.prototype.render=function(){var $results=$('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&$results.attr("aria-multiselectable","true"),this.$results=$results,$results},Results.prototype.clear=function(){this.$results.empty()},Results.prototype.displayMessage=function(params){var escapeMarkup=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var $message=$('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),message=this.options.get("translations").get(params.message);$message.append(escapeMarkup(message(params.args))),$message[0].className+=" select2-results__message",this.$results.append($message)},Results.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},Results.prototype.append=function(data){this.hideLoading();var $options=[];if(null!=data.results&&0!==data.results.length){data.results=this.sort(data.results);for(var d=0;d<data.results.length;d++){var item=data.results[d],$option=this.option(item);$options.push($option)}this.$results.append($options)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},Results.prototype.position=function($results,$dropdown){$dropdown.find(".select2-results").append($results)},Results.prototype.sort=function(data){return this.options.get("sorter")(data)},Results.prototype.highlightFirstItem=function(){var $options=this.$results.find(".select2-results__option[aria-selected]"),$selected=$options.filter("[aria-selected=true]");$selected.length>0?$selected.first().trigger("mouseenter"):$options.first().trigger("mouseenter"),this.ensureHighlightVisible()},Results.prototype.setClasses=function(){var self=this;this.data.current((function(selected){var selectedIds=$.map(selected,(function(s){return s.id.toString()}));self.$results.find(".select2-results__option[aria-selected]").each((function(){var $option=$(this),item=$.data(this,"data"),id=""+item.id;null!=item.element&&item.element.selected||null==item.element&&$.inArray(id,selectedIds)>-1?$option.attr("aria-selected","true"):$option.attr("aria-selected","false")}))}))},Results.prototype.showLoading=function(params){this.hideLoading();var loading={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(params)},$loading=this.option(loading);$loading.className+=" loading-results",this.$results.prepend($loading)},Results.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},Results.prototype.option=function(data){var option=document.createElement("li");option.className="select2-results__option";var attrs={role:"treeitem","aria-selected":"false"};for(var attr in data.disabled&&(delete attrs["aria-selected"],attrs["aria-disabled"]="true"),null==data.id&&delete attrs["aria-selected"],null!=data._resultId&&(option.id=data._resultId),data.title&&(option.title=data.title),data.children&&(attrs.role="group",attrs["aria-label"]=data.text,delete attrs["aria-selected"]),attrs){var val=attrs[attr];option.setAttribute(attr,val)}if(data.children){var $option=$(option),label=document.createElement("strong");label.className="select2-results__group",$(label),this.template(data,label);for(var $children=[],c=0;c<data.children.length;c++){var child=data.children[c],$child=this.option(child);$children.push($child)}var $childrenContainer=$("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});$childrenContainer.append($children),$option.append(label),$option.append($childrenContainer)}else this.template(data,option);return $.data(option,"data",data),option},Results.prototype.bind=function(container,$container){var self=this,id=container.id+"-results";this.$results.attr("id",id),container.on("results:all",(function(params){self.clear(),self.append(params.data),container.isOpen()&&(self.setClasses(),self.highlightFirstItem())})),container.on("results:append",(function(params){self.append(params.data),container.isOpen()&&self.setClasses()})),container.on("query",(function(params){self.hideMessages(),self.showLoading(params)})),container.on("select",(function(){container.isOpen()&&(self.setClasses(),self.highlightFirstItem())})),container.on("unselect",(function(){container.isOpen()&&(self.setClasses(),self.highlightFirstItem())})),container.on("open",(function(){self.$results.attr("aria-expanded","true"),self.$results.attr("aria-hidden","false"),self.setClasses(),self.ensureHighlightVisible()})),container.on("close",(function(){self.$results.attr("aria-expanded","false"),self.$results.attr("aria-hidden","true"),self.$results.removeAttr("aria-activedescendant")})),container.on("results:toggle",(function(){var $highlighted=self.getHighlightedResults();0!==$highlighted.length&&$highlighted.trigger("mouseup")})),container.on("results:select",(function(){var $highlighted=self.getHighlightedResults();if(0!==$highlighted.length){var data=$highlighted.data("data");"true"==$highlighted.attr("aria-selected")?self.trigger("close",{}):self.trigger("select",{data:data})}})),container.on("results:previous",(function(){var $highlighted=self.getHighlightedResults(),$options=self.$results.find("[aria-selected]"),currentIndex=$options.index($highlighted);if(0!==currentIndex){var nextIndex=currentIndex-1;0===$highlighted.length&&(nextIndex=0);var $next=$options.eq(nextIndex);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top,nextTop=$next.offset().top,nextOffset=self.$results.scrollTop()+(nextTop-currentOffset);0===nextIndex?self.$results.scrollTop(0):nextTop-currentOffset<0&&self.$results.scrollTop(nextOffset)}})),container.on("results:next",(function(){var $highlighted=self.getHighlightedResults(),$options=self.$results.find("[aria-selected]"),nextIndex=$options.index($highlighted)+1;if(!(nextIndex>=$options.length)){var $next=$options.eq(nextIndex);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top+self.$results.outerHeight(!1),nextBottom=$next.offset().top+$next.outerHeight(!1),nextOffset=self.$results.scrollTop()+nextBottom-currentOffset;0===nextIndex?self.$results.scrollTop(0):nextBottom>currentOffset&&self.$results.scrollTop(nextOffset)}})),container.on("results:focus",(function(params){params.element.addClass("select2-results__option--highlighted")})),container.on("results:message",(function(params){self.displayMessage(params)})),$.fn.mousewheel&&this.$results.on("mousewheel",(function(e){var top=self.$results.scrollTop(),bottom=self.$results.get(0).scrollHeight-top+e.deltaY,isAtTop=e.deltaY>0&&top-e.deltaY<=0,isAtBottom=e.deltaY<0&&bottom<=self.$results.height();isAtTop?(self.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):isAtBottom&&(self.$results.scrollTop(self.$results.get(0).scrollHeight-self.$results.height()),e.preventDefault(),e.stopPropagation())})),this.$results.on("mouseup",".select2-results__option[aria-selected]",(function(evt){var $this=$(this),data=$this.data("data");"true"!==$this.attr("aria-selected")?self.trigger("select",{originalEvent:evt,data:data}):self.options.get("multiple")?self.trigger("unselect",{originalEvent:evt,data:data}):self.trigger("close",{})})),this.$results.on("mouseenter",".select2-results__option[aria-selected]",(function(evt){var data=$(this).data("data");self.getHighlightedResults().removeClass("select2-results__option--highlighted"),self.trigger("results:focus",{data:data,element:$(this)})}))},Results.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},Results.prototype.destroy=function(){this.$results.remove()},Results.prototype.ensureHighlightVisible=function(){var $highlighted=this.getHighlightedResults();if(0!==$highlighted.length){var currentIndex=this.$results.find("[aria-selected]").index($highlighted),currentOffset=this.$results.offset().top,nextTop=$highlighted.offset().top,nextOffset=this.$results.scrollTop()+(nextTop-currentOffset),offsetDelta=nextTop-currentOffset;nextOffset-=2*$highlighted.outerHeight(!1),currentIndex<=2?this.$results.scrollTop(0):(offsetDelta>this.$results.outerHeight()||offsetDelta<0)&&this.$results.scrollTop(nextOffset)}},Results.prototype.template=function(result,container){var template=this.options.get("templateResult"),escapeMarkup=this.options.get("escapeMarkup"),content=template(result,container);null==content?container.style.display="none":"string"==typeof content?container.innerHTML=escapeMarkup(content):$(container).append(content)},Results})),S2.define("select2/keys",[],(function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}})),S2.define("select2/selection/base",["jquery","../utils","../keys"],(function($,Utils,KEYS){function BaseSelection($element,options){this.$element=$element,this.options=options,BaseSelection.__super__.constructor.call(this)}return Utils.Extend(BaseSelection,Utils.Observable),BaseSelection.prototype.render=function(){var $selection=$('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),$selection.attr("title",this.$element.attr("title")),$selection.attr("tabindex",this._tabindex),this.$selection=$selection,$selection},BaseSelection.prototype.bind=function(container,$container){var self=this,resultsId=(container.id,container.id+"-results");this.container=container,this.$selection.on("focus",(function(evt){self.trigger("focus",evt)})),this.$selection.on("blur",(function(evt){self._handleBlur(evt)})),this.$selection.on("keydown",(function(evt){self.trigger("keypress",evt),evt.which===KEYS.SPACE&&evt.preventDefault()})),container.on("results:focus",(function(params){self.$selection.attr("aria-activedescendant",params.data._resultId)})),container.on("selection:update",(function(params){self.update(params.data)})),container.on("open",(function(){self.$selection.attr("aria-expanded","true"),self.$selection.attr("aria-owns",resultsId),self._attachCloseHandler(container)})),container.on("close",(function(){self.$selection.attr("aria-expanded","false"),self.$selection.removeAttr("aria-activedescendant"),self.$selection.removeAttr("aria-owns"),self.$selection.focus(),self._detachCloseHandler(container)})),container.on("enable",(function(){self.$selection.attr("tabindex",self._tabindex)})),container.on("disable",(function(){self.$selection.attr("tabindex","-1")}))},BaseSelection.prototype._handleBlur=function(evt){var self=this;window.setTimeout((function(){document.activeElement==self.$selection[0]||$.contains(self.$selection[0],document.activeElement)||self.trigger("blur",evt)}),1)},BaseSelection.prototype._attachCloseHandler=function(container){$(document.body).on("mousedown.select2."+container.id,(function(e){var $select=$(e.target).closest(".select2");$(".select2.select2-container--open").each((function(){var $this=$(this);this!=$select[0]&&$this.data("element").select2("close")}))}))},BaseSelection.prototype._detachCloseHandler=function(container){$(document.body).off("mousedown.select2."+container.id)},BaseSelection.prototype.position=function($selection,$container){$container.find(".selection").append($selection)},BaseSelection.prototype.destroy=function(){this._detachCloseHandler(this.container)},BaseSelection.prototype.update=function(data){throw new Error("The `update` method must be defined in child classes.")},BaseSelection})),S2.define("select2/selection/single",["jquery","./base","../utils","../keys"],(function($,BaseSelection,Utils,KEYS){function SingleSelection(){SingleSelection.__super__.constructor.apply(this,arguments)}return Utils.Extend(SingleSelection,BaseSelection),SingleSelection.prototype.render=function(){var $selection=SingleSelection.__super__.render.call(this);return $selection.addClass("select2-selection--single"),$selection.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),$selection},SingleSelection.prototype.bind=function(container,$container){var self=this;SingleSelection.__super__.bind.apply(this,arguments);var id=container.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",id),this.$selection.attr("aria-labelledby",id),this.$selection.on("mousedown",(function(evt){1===evt.which&&self.trigger("toggle",{originalEvent:evt})})),this.$selection.on("focus",(function(evt){})),this.$selection.on("blur",(function(evt){})),container.on("focus",(function(evt){container.isOpen()||self.$selection.focus()})),container.on("selection:update",(function(params){self.update(params.data)}))},SingleSelection.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},SingleSelection.prototype.display=function(data,container){var template=this.options.get("templateSelection");return this.options.get("escapeMarkup")(template(data,container))},SingleSelection.prototype.selectionContainer=function(){return $("<span></span>")},SingleSelection.prototype.update=function(data){if(0!==data.length){var selection=data[0],$rendered=this.$selection.find(".select2-selection__rendered"),formatted=this.display(selection,$rendered);$rendered.empty().append(formatted),$rendered.prop("title",selection.title||selection.text)}else this.clear()},SingleSelection})),S2.define("select2/selection/multiple",["jquery","./base","../utils"],(function($,BaseSelection,Utils){function MultipleSelection($element,options){MultipleSelection.__super__.constructor.apply(this,arguments)}return Utils.Extend(MultipleSelection,BaseSelection),MultipleSelection.prototype.render=function(){var $selection=MultipleSelection.__super__.render.call(this);return $selection.addClass("select2-selection--multiple"),$selection.html('<ul class="select2-selection__rendered"></ul>'),$selection},MultipleSelection.prototype.bind=function(container,$container){var self=this;MultipleSelection.__super__.bind.apply(this,arguments),this.$selection.on("click",(function(evt){self.trigger("toggle",{originalEvent:evt})})),this.$selection.on("click",".select2-selection__choice__remove",(function(evt){if(!self.options.get("disabled")){var data=$(this).parent().data("data");self.trigger("unselect",{originalEvent:evt,data:data})}}))},MultipleSelection.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},MultipleSelection.prototype.display=function(data,container){var template=this.options.get("templateSelection");return this.options.get("escapeMarkup")(template(data,container))},MultipleSelection.prototype.selectionContainer=function(){return $('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},MultipleSelection.prototype.update=function(data){if(this.clear(),0!==data.length){for(var $selections=[],d=0;d<data.length;d++){var selection=data[d],$selection=this.selectionContainer(),formatted=this.display(selection,$selection);$selection.append(formatted),$selection.prop("title",selection.title||selection.text),$selection.data("data",selection),$selections.push($selection)}var $rendered=this.$selection.find(".select2-selection__rendered");Utils.appendMany($rendered,$selections)}},MultipleSelection})),S2.define("select2/selection/placeholder",["../utils"],(function(Utils){function Placeholder(decorated,$element,options){this.placeholder=this.normalizePlaceholder(options.get("placeholder")),decorated.call(this,$element,options)}return Placeholder.prototype.normalizePlaceholder=function(_,placeholder){return"string"==typeof placeholder&&(placeholder={id:"",text:placeholder}),placeholder},Placeholder.prototype.createPlaceholder=function(decorated,placeholder){var $placeholder=this.selectionContainer();return $placeholder.html(this.display(placeholder)),$placeholder.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),$placeholder},Placeholder.prototype.update=function(decorated,data){var singlePlaceholder=1==data.length&&data[0].id!=this.placeholder.id;if(data.length>1||singlePlaceholder)return decorated.call(this,data);this.clear();var $placeholder=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append($placeholder)},Placeholder})),S2.define("select2/selection/allowClear",["jquery","../keys"],(function($,KEYS){function AllowClear(){}return AllowClear.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",(function(evt){self._handleClear(evt)})),container.on("keypress",(function(evt){self._handleKeyboardClear(evt,container)}))},AllowClear.prototype._handleClear=function(_,evt){if(!this.options.get("disabled")){var $clear=this.$selection.find(".select2-selection__clear");if(0!==$clear.length){evt.stopPropagation();for(var data=$clear.data("data"),d=0;d<data.length;d++){var unselectData={data:data[d]};if(this.trigger("unselect",unselectData),unselectData.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},AllowClear.prototype._handleKeyboardClear=function(_,evt,container){container.isOpen()||evt.which!=KEYS.DELETE&&evt.which!=KEYS.BACKSPACE||this._handleClear(evt)},AllowClear.prototype.update=function(decorated,data){if(decorated.call(this,data),!(this.$selection.find(".select2-selection__placeholder").length>0||0===data.length)){var $remove=$('<span class="select2-selection__clear">&times;</span>');$remove.data("data",data),this.$selection.find(".select2-selection__rendered").prepend($remove)}},AllowClear})),S2.define("select2/selection/search",["jquery","../utils","../keys"],(function($,Utils,KEYS){function Search(decorated,$element,options){decorated.call(this,$element,options)}return Search.prototype.render=function(decorated){var $search=$('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=$search,this.$search=$search.find("input");var $rendered=decorated.call(this);return this._transferTabIndex(),$rendered},Search.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("open",(function(){self.$search.trigger("focus")})),container.on("close",(function(){self.$search.val(""),self.$search.removeAttr("aria-activedescendant"),self.$search.trigger("focus")})),container.on("enable",(function(){self.$search.prop("disabled",!1),self._transferTabIndex()})),container.on("disable",(function(){self.$search.prop("disabled",!0)})),container.on("focus",(function(evt){self.$search.trigger("focus")})),container.on("results:focus",(function(params){self.$search.attr("aria-activedescendant",params.id)})),this.$selection.on("focusin",".select2-search--inline",(function(evt){self.trigger("focus",evt)})),this.$selection.on("focusout",".select2-search--inline",(function(evt){self._handleBlur(evt)})),this.$selection.on("keydown",".select2-search--inline",(function(evt){if(evt.stopPropagation(),self.trigger("keypress",evt),self._keyUpPrevented=evt.isDefaultPrevented(),evt.which===KEYS.BACKSPACE&&""===self.$search.val()){var $previousChoice=self.$searchContainer.prev(".select2-selection__choice");if($previousChoice.length>0){var item=$previousChoice.data("data");self.searchRemoveChoice(item),evt.preventDefault()}}}));var msie=document.documentMode,disableInputEvents=msie&&msie<=11;this.$selection.on("input.searchcheck",".select2-search--inline",(function(evt){disableInputEvents?self.$selection.off("input.search input.searchcheck"):self.$selection.off("keyup.search")})),this.$selection.on("keyup.search input.search",".select2-search--inline",(function(evt){if(disableInputEvents&&"input"===evt.type)self.$selection.off("input.search input.searchcheck");else{var key=evt.which;key!=KEYS.SHIFT&&key!=KEYS.CTRL&&key!=KEYS.ALT&&key!=KEYS.TAB&&self.handleSearch(evt)}}))},Search.prototype._transferTabIndex=function(decorated){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},Search.prototype.createPlaceholder=function(decorated,placeholder){this.$search.attr("placeholder",placeholder.text)},Search.prototype.update=function(decorated,data){var searchHadFocus=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),decorated.call(this,data),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),searchHadFocus&&this.$search.focus()},Search.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var input=this.$search.val();this.trigger("query",{term:input})}this._keyUpPrevented=!1},Search.prototype.searchRemoveChoice=function(decorated,item){this.trigger("unselect",{data:item}),this.$search.val(item.text),this.handleSearch()},Search.prototype.resizeSearch=function(){this.$search.css("width","25px");var width="";width=""!==this.$search.attr("placeholder")?this.$selection.find(".select2-selection__rendered").innerWidth():.75*(this.$search.val().length+1)+"em",this.$search.css("width",width)},Search})),S2.define("select2/selection/eventRelay",["jquery"],(function($){function EventRelay(){}return EventRelay.prototype.bind=function(decorated,container,$container){var self=this,relayEvents=["open","opening","close","closing","select","selecting","unselect","unselecting"],preventableEvents=["opening","closing","selecting","unselecting"];decorated.call(this,container,$container),container.on("*",(function(name,params){if(-1!==$.inArray(name,relayEvents)){params=params||{};var evt=$.Event("select2:"+name,{params:params});self.$element.trigger(evt),-1!==$.inArray(name,preventableEvents)&&(params.prevented=evt.isDefaultPrevented())}}))},EventRelay})),S2.define("select2/translation",["jquery","require"],(function($,require){function Translation(dict){this.dict=dict||{}}return Translation.prototype.all=function(){return this.dict},Translation.prototype.get=function(key){return this.dict[key]},Translation.prototype.extend=function(translation){this.dict=$.extend({},translation.all(),this.dict)},Translation._cache={},Translation.loadPath=function(path){if(!(path in Translation._cache)){var translations=require(path);Translation._cache[path]=translations}return new Translation(Translation._cache[path])},Translation})),S2.define("select2/diacritics",[],(function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","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ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}})),S2.define("select2/data/base",["../utils"],(function(Utils){function BaseAdapter($element,options){BaseAdapter.__super__.constructor.call(this)}return Utils.Extend(BaseAdapter,Utils.Observable),BaseAdapter.prototype.current=function(callback){throw new Error("The `current` method must be defined in child classes.")},BaseAdapter.prototype.query=function(params,callback){throw new Error("The `query` method must be defined in child classes.")},BaseAdapter.prototype.bind=function(container,$container){},BaseAdapter.prototype.destroy=function(){},BaseAdapter.prototype.generateResultId=function(container,data){var id=container.id+"-result-";return id+=Utils.generateChars(4),null!=data.id?id+="-"+data.id.toString():id+="-"+Utils.generateChars(4),id},BaseAdapter})),S2.define("select2/data/select",["./base","../utils","jquery"],(function(BaseAdapter,Utils,$){function SelectAdapter($element,options){this.$element=$element,this.options=options,SelectAdapter.__super__.constructor.call(this)}return Utils.Extend(SelectAdapter,BaseAdapter),SelectAdapter.prototype.current=function(callback){var data=[],self=this;this.$element.find(":selected").each((function(){var $option=$(this),option=self.item($option);data.push(option)})),callback(data)},SelectAdapter.prototype.select=function(data){var self=this;if(data.selected=!0,$(data.element).is("option"))return data.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current((function(currentData){var val=[];(data=[data]).push.apply(data,currentData);for(var d=0;d<data.length;d++){var id=data[d].id;-1===$.inArray(id,val)&&val.push(id)}self.$element.val(val),self.$element.trigger("change")}));else{var val=data.id;this.$element.val(val),this.$element.trigger("change")}},SelectAdapter.prototype.unselect=function(data){var self=this;if(this.$element.prop("multiple")){if(data.selected=!1,$(data.element).is("option"))return data.element.selected=!1,void this.$element.trigger("change");this.current((function(currentData){for(var val=[],d=0;d<currentData.length;d++){var id=currentData[d].id;id!==data.id&&-1===$.inArray(id,val)&&val.push(id)}self.$element.val(val),self.$element.trigger("change")}))}},SelectAdapter.prototype.bind=function(container,$container){var self=this;this.container=container,container.on("select",(function(params){self.select(params.data)})),container.on("unselect",(function(params){self.unselect(params.data)}))},SelectAdapter.prototype.destroy=function(){this.$element.find("*").each((function(){$.removeData(this,"data")}))},SelectAdapter.prototype.query=function(params,callback){var data=[],self=this;this.$element.children().each((function(){var $option=$(this);if($option.is("option")||$option.is("optgroup")){var option=self.item($option),matches=self.matches(params,option);null!==matches&&data.push(matches)}})),callback({results:data})},SelectAdapter.prototype.addOptions=function($options){Utils.appendMany(this.$element,$options)},SelectAdapter.prototype.option=function(data){var option;data.children?(option=document.createElement("optgroup")).label=data.text:void 0!==(option=document.createElement("option")).textContent?option.textContent=data.text:option.innerText=data.text,void 0!==data.id&&(option.value=data.id),data.disabled&&(option.disabled=!0),data.selected&&(option.selected=!0),data.title&&(option.title=data.title);var $option=$(option),normalizedData=this._normalizeItem(data);return normalizedData.element=option,$.data(option,"data",normalizedData),$option},SelectAdapter.prototype.item=function($option){var data={};if(null!=(data=$.data($option[0],"data")))return data;if($option.is("option"))data={id:$option.val(),text:$option.text(),disabled:$option.prop("disabled"),selected:$option.prop("selected"),title:$option.prop("title")};else if($option.is("optgroup")){data={text:$option.prop("label"),children:[],title:$option.prop("title")};for(var $children=$option.children("option"),children=[],c=0;c<$children.length;c++){var $child=$($children[c]),child=this.item($child);children.push(child)}data.children=children}return(data=this._normalizeItem(data)).element=$option[0],$.data($option[0],"data",data),data},SelectAdapter.prototype._normalizeItem=function(item){return $.isPlainObject(item)||(item={id:item,text:item}),null!=(item=$.extend({},{text:""},item)).id&&(item.id=item.id.toString()),null!=item.text&&(item.text=item.text.toString()),null==item._resultId&&item.id&&null!=this.container&&(item._resultId=this.generateResultId(this.container,item)),$.extend({},{selected:!1,disabled:!1},item)},SelectAdapter.prototype.matches=function(params,data){return this.options.get("matcher")(params,data)},SelectAdapter})),S2.define("select2/data/array",["./select","../utils","jquery"],(function(SelectAdapter,Utils,$){function ArrayAdapter($element,options){var data=options.get("data")||[];ArrayAdapter.__super__.constructor.call(this,$element,options),this.addOptions(this.convertToOptions(data))}return Utils.Extend(ArrayAdapter,SelectAdapter),ArrayAdapter.prototype.select=function(data){var $option=this.$element.find("option").filter((function(i,elm){return elm.value==data.id.toString()}));0===$option.length&&($option=this.option(data),this.addOptions($option)),ArrayAdapter.__super__.select.call(this,data)},ArrayAdapter.prototype.convertToOptions=function(data){var self=this,$existing=this.$element.find("option"),existingIds=$existing.map((function(){return self.item($(this)).id})).get(),$options=[];function onlyItem(item){return function(){return $(this).val()==item.id}}for(var d=0;d<data.length;d++){var item=this._normalizeItem(data[d]);if($.inArray(item.id,existingIds)>=0){var $existingOption=$existing.filter(onlyItem(item)),existingData=this.item($existingOption),newData=$.extend(!0,{},item,existingData),$newOption=this.option(newData);$existingOption.replaceWith($newOption)}else{var $option=this.option(item);if(item.children){var $children=this.convertToOptions(item.children);Utils.appendMany($option,$children)}$options.push($option)}}return $options},ArrayAdapter})),S2.define("select2/data/ajax",["./array","../utils","jquery"],(function(ArrayAdapter,Utils,$){function AjaxAdapter($element,options){this.ajaxOptions=this._applyDefaults(options.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),AjaxAdapter.__super__.constructor.call(this,$element,options)}return Utils.Extend(AjaxAdapter,ArrayAdapter),AjaxAdapter.prototype._applyDefaults=function(options){var defaults={data:function(params){return $.extend({},params,{q:params.term})},transport:function(params,success,failure){var $request=$.ajax(params);return $request.then(success),$request.fail(failure),$request}};return $.extend({},defaults,options,!0)},AjaxAdapter.prototype.processResults=function(results){return results},AjaxAdapter.prototype.query=function(params,callback){var self=this;null!=this._request&&($.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var options=$.extend({type:"GET"},this.ajaxOptions);function request(){var $request=options.transport(options,(function(data){var results=self.processResults(data,params);self.options.get("debug")&&window.console&&console.error&&(results&&results.results&&$.isArray(results.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),callback(results)}),(function(){$request.status&&"0"===$request.status||self.trigger("results:message",{message:"errorLoading"})}));self._request=$request}"function"==typeof options.url&&(options.url=options.url.call(this.$element,params)),"function"==typeof options.data&&(options.data=options.data.call(this.$element,params)),this.ajaxOptions.delay&&null!=params.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(request,this.ajaxOptions.delay)):request()},AjaxAdapter})),S2.define("select2/data/tags",["jquery"],(function($){function Tags(decorated,$element,options){var tags=options.get("tags"),createTag=options.get("createTag");void 0!==createTag&&(this.createTag=createTag);var insertTag=options.get("insertTag");if(void 0!==insertTag&&(this.insertTag=insertTag),decorated.call(this,$element,options),$.isArray(tags))for(var t=0;t<tags.length;t++){var tag=tags[t],item=this._normalizeItem(tag),$option=this.option(item);this.$element.append($option)}}return Tags.prototype.query=function(decorated,params,callback){var self=this;this._removeOldTags(),null!=params.term&&null==params.page?decorated.call(this,params,(function wrapper(obj,child){for(var data=obj.results,i=0;i<data.length;i++){var option=data[i],checkChildren=null!=option.children&&!wrapper({results:option.children},!0);if((option.text||"").toUpperCase()===(params.term||"").toUpperCase()||checkChildren)return!child&&(obj.data=data,void callback(obj))}if(child)return!0;var tag=self.createTag(params);if(null!=tag){var $option=self.option(tag);$option.attr("data-select2-tag",!0),self.addOptions([$option]),self.insertTag(data,tag)}obj.results=data,callback(obj)})):decorated.call(this,params,callback)},Tags.prototype.createTag=function(decorated,params){var term=$.trim(params.term);return""===term?null:{id:term,text:term}},Tags.prototype.insertTag=function(_,data,tag){data.unshift(tag)},Tags.prototype._removeOldTags=function(_){this._lastTag,this.$element.find("option[data-select2-tag]").each((function(){this.selected||$(this).remove()}))},Tags})),S2.define("select2/data/tokenizer",["jquery"],(function($){function Tokenizer(decorated,$element,options){var tokenizer=options.get("tokenizer");void 0!==tokenizer&&(this.tokenizer=tokenizer),decorated.call(this,$element,options)}return Tokenizer.prototype.bind=function(decorated,container,$container){decorated.call(this,container,$container),this.$search=container.dropdown.$search||container.selection.$search||$container.find(".select2-search__field")},Tokenizer.prototype.query=function(decorated,params,callback){var self=this;params.term=params.term||"";var tokenData=this.tokenizer(params,this.options,(function(data){var item=self._normalizeItem(data);if(!self.$element.find("option").filter((function(){return $(this).val()===item.id})).length){var $option=self.option(item);$option.attr("data-select2-tag",!0),self._removeOldTags(),self.addOptions([$option])}!function(data){self.trigger("select",{data:data})}(item)}));tokenData.term!==params.term&&(this.$search.length&&(this.$search.val(tokenData.term),this.$search.focus()),params.term=tokenData.term),decorated.call(this,params,callback)},Tokenizer.prototype.tokenizer=function(_,params,options,callback){for(var separators=options.get("tokenSeparators")||[],term=params.term,i=0,createTag=this.createTag||function(params){return{id:params.term,text:params.term}};i<term.length;){var termChar=term[i];if(-1!==$.inArray(termChar,separators)){var part=term.substr(0,i),data=createTag($.extend({},params,{term:part}));null!=data?(callback(data),term=term.substr(i+1)||"",i=0):i++}else i++}return{term:term}},Tokenizer})),S2.define("select2/data/minimumInputLength",[],(function(){function MinimumInputLength(decorated,$e,options){this.minimumInputLength=options.get("minimumInputLength"),decorated.call(this,$e,options)}return MinimumInputLength.prototype.query=function(decorated,params,callback){params.term=params.term||"",params.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:params.term,params:params}}):decorated.call(this,params,callback)},MinimumInputLength})),S2.define("select2/data/maximumInputLength",[],(function(){function MaximumInputLength(decorated,$e,options){this.maximumInputLength=options.get("maximumInputLength"),decorated.call(this,$e,options)}return MaximumInputLength.prototype.query=function(decorated,params,callback){params.term=params.term||"",this.maximumInputLength>0&&params.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:params.term,params:params}}):decorated.call(this,params,callback)},MaximumInputLength})),S2.define("select2/data/maximumSelectionLength",[],(function(){function MaximumSelectionLength(decorated,$e,options){this.maximumSelectionLength=options.get("maximumSelectionLength"),decorated.call(this,$e,options)}return MaximumSelectionLength.prototype.query=function(decorated,params,callback){var self=this;this.current((function(currentData){var count=null!=currentData?currentData.length:0;self.maximumSelectionLength>0&&count>=self.maximumSelectionLength?self.trigger("results:message",{message:"maximumSelected",args:{maximum:self.maximumSelectionLength}}):decorated.call(self,params,callback)}))},MaximumSelectionLength})),S2.define("select2/dropdown",["jquery","./utils"],(function($,Utils){function Dropdown($element,options){this.$element=$element,this.options=options,Dropdown.__super__.constructor.call(this)}return Utils.Extend(Dropdown,Utils.Observable),Dropdown.prototype.render=function(){var $dropdown=$('<span class="select2-dropdown"><span class="select2-results"></span></span>');return $dropdown.attr("dir",this.options.get("dir")),this.$dropdown=$dropdown,$dropdown},Dropdown.prototype.bind=function(){},Dropdown.prototype.position=function($dropdown,$container){},Dropdown.prototype.destroy=function(){this.$dropdown.remove()},Dropdown})),S2.define("select2/dropdown/search",["jquery","../utils"],(function($,Utils){function Search(){}return Search.prototype.render=function(decorated){var $rendered=decorated.call(this),$search=$('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=$search,this.$search=$search.find("input"),$rendered.prepend($search),$rendered},Search.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),this.$search.on("keydown",(function(evt){self.trigger("keypress",evt),self._keyUpPrevented=evt.isDefaultPrevented()})),this.$search.on("input",(function(evt){$(this).off("keyup")})),this.$search.on("keyup input",(function(evt){self.handleSearch(evt)})),container.on("open",(function(){self.$search.attr("tabindex",0),self.$search.focus(),window.setTimeout((function(){self.$search.focus()}),0)})),container.on("close",(function(){self.$search.attr("tabindex",-1),self.$search.val("")})),container.on("focus",(function(){container.isOpen()||self.$search.focus()})),container.on("results:all",(function(params){null!=params.query.term&&""!==params.query.term||(self.showSearch(params)?self.$searchContainer.removeClass("select2-search--hide"):self.$searchContainer.addClass("select2-search--hide"))}))},Search.prototype.handleSearch=function(evt){if(!this._keyUpPrevented){var input=this.$search.val();this.trigger("query",{term:input})}this._keyUpPrevented=!1},Search.prototype.showSearch=function(_,params){return!0},Search})),S2.define("select2/dropdown/hidePlaceholder",[],(function(){function HidePlaceholder(decorated,$element,options,dataAdapter){this.placeholder=this.normalizePlaceholder(options.get("placeholder")),decorated.call(this,$element,options,dataAdapter)}return HidePlaceholder.prototype.append=function(decorated,data){data.results=this.removePlaceholder(data.results),decorated.call(this,data)},HidePlaceholder.prototype.normalizePlaceholder=function(_,placeholder){return"string"==typeof placeholder&&(placeholder={id:"",text:placeholder}),placeholder},HidePlaceholder.prototype.removePlaceholder=function(_,data){for(var modifiedData=data.slice(0),d=data.length-1;d>=0;d--){var item=data[d];this.placeholder.id===item.id&&modifiedData.splice(d,1)}return modifiedData},HidePlaceholder})),S2.define("select2/dropdown/infiniteScroll",["jquery"],(function($){function InfiniteScroll(decorated,$element,options,dataAdapter){this.lastParams={},decorated.call(this,$element,options,dataAdapter),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return InfiniteScroll.prototype.append=function(decorated,data){this.$loadingMore.remove(),this.loading=!1,decorated.call(this,data),this.showLoadingMore(data)&&this.$results.append(this.$loadingMore)},InfiniteScroll.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("query",(function(params){self.lastParams=params,self.loading=!0})),container.on("query:append",(function(params){self.lastParams=params,self.loading=!0})),this.$results.on("scroll",(function(){var isLoadMoreVisible=$.contains(document.documentElement,self.$loadingMore[0]);!self.loading&&isLoadMoreVisible&&self.$results.offset().top+self.$results.outerHeight(!1)+50>=self.$loadingMore.offset().top+self.$loadingMore.outerHeight(!1)&&self.loadMore()}))},InfiniteScroll.prototype.loadMore=function(){this.loading=!0;var params=$.extend({},{page:1},this.lastParams);params.page++,this.trigger("query:append",params)},InfiniteScroll.prototype.showLoadingMore=function(_,data){return data.pagination&&data.pagination.more},InfiniteScroll.prototype.createLoadingMore=function(){var $option=$('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),message=this.options.get("translations").get("loadingMore");return $option.html(message(this.lastParams)),$option},InfiniteScroll})),S2.define("select2/dropdown/attachBody",["jquery","../utils"],(function($,Utils){function AttachBody(decorated,$element,options){this.$dropdownParent=options.get("dropdownParent")||$(document.body),decorated.call(this,$element,options)}return AttachBody.prototype.bind=function(decorated,container,$container){var self=this,setupResultsEvents=!1;decorated.call(this,container,$container),container.on("open",(function(){self._showDropdown(),self._attachPositioningHandler(container),setupResultsEvents||(setupResultsEvents=!0,container.on("results:all",(function(){self._positionDropdown(),self._resizeDropdown()})),container.on("results:append",(function(){self._positionDropdown(),self._resizeDropdown()})))})),container.on("close",(function(){self._hideDropdown(),self._detachPositioningHandler(container)})),this.$dropdownContainer.on("mousedown",(function(evt){evt.stopPropagation()}))},AttachBody.prototype.destroy=function(decorated){decorated.call(this),this.$dropdownContainer.remove()},AttachBody.prototype.position=function(decorated,$dropdown,$container){$dropdown.attr("class",$container.attr("class")),$dropdown.removeClass("select2"),$dropdown.addClass("select2-container--open"),$dropdown.css({position:"absolute",top:-999999}),this.$container=$container},AttachBody.prototype.render=function(decorated){var $container=$("<span></span>"),$dropdown=decorated.call(this);return $container.append($dropdown),this.$dropdownContainer=$container,$container},AttachBody.prototype._hideDropdown=function(decorated){this.$dropdownContainer.detach()},AttachBody.prototype._attachPositioningHandler=function(decorated,container){var self=this,scrollEvent="scroll.select2."+container.id,resizeEvent="resize.select2."+container.id,orientationEvent="orientationchange.select2."+container.id,$watchers=this.$container.parents().filter(Utils.hasScroll);$watchers.each((function(){$(this).data("select2-scroll-position",{x:$(this).scrollLeft(),y:$(this).scrollTop()})})),$watchers.on(scrollEvent,(function(ev){var position=$(this).data("select2-scroll-position");$(this).scrollTop(position.y)})),$(window).on(scrollEvent+" "+resizeEvent+" "+orientationEvent,(function(e){self._positionDropdown(),self._resizeDropdown()}))},AttachBody.prototype._detachPositioningHandler=function(decorated,container){var scrollEvent="scroll.select2."+container.id,resizeEvent="resize.select2."+container.id,orientationEvent="orientationchange.select2."+container.id;this.$container.parents().filter(Utils.hasScroll).off(scrollEvent),$(window).off(scrollEvent+" "+resizeEvent+" "+orientationEvent)},AttachBody.prototype._positionDropdown=function(){var $window=$(window),isCurrentlyAbove=this.$dropdown.hasClass("select2-dropdown--above"),isCurrentlyBelow=this.$dropdown.hasClass("select2-dropdown--below"),newDirection=null,offset=this.$container.offset();offset.bottom=offset.top+this.$container.outerHeight(!1);var container={height:this.$container.outerHeight(!1)};container.top=offset.top,container.bottom=offset.top+container.height;var dropdown_height=this.$dropdown.outerHeight(!1),viewport_top=$window.scrollTop(),viewport_bottom=$window.scrollTop()+$window.height(),enoughRoomAbove=viewport_top<offset.top-dropdown_height,enoughRoomBelow=viewport_bottom>offset.bottom+dropdown_height,css={left:offset.left,top:container.bottom},$offsetParent=this.$dropdownParent;"static"===$offsetParent.css("position")&&($offsetParent=$offsetParent.offsetParent());var parentOffset=$offsetParent.offset();css.top-=parentOffset.top,css.left-=parentOffset.left,isCurrentlyAbove||isCurrentlyBelow||(newDirection="below"),enoughRoomBelow||!enoughRoomAbove||isCurrentlyAbove?!enoughRoomAbove&&enoughRoomBelow&&isCurrentlyAbove&&(newDirection="below"):newDirection="above",("above"==newDirection||isCurrentlyAbove&&"below"!==newDirection)&&(css.top=container.top-parentOffset.top-dropdown_height),null!=newDirection&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+newDirection),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+newDirection)),this.$dropdownContainer.css(css)},AttachBody.prototype._resizeDropdown=function(){var css={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(css.minWidth=css.width,css.position="relative",css.width="auto"),this.$dropdown.css(css)},AttachBody.prototype._showDropdown=function(decorated){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},AttachBody})),S2.define("select2/dropdown/minimumResultsForSearch",[],(function(){function MinimumResultsForSearch(decorated,$element,options,dataAdapter){this.minimumResultsForSearch=options.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),decorated.call(this,$element,options,dataAdapter)}return MinimumResultsForSearch.prototype.showSearch=function(decorated,params){return!(function countResults(data){for(var count=0,d=0;d<data.length;d++){var item=data[d];item.children?count+=countResults(item.children):count++}return count}(params.data.results)<this.minimumResultsForSearch)&&decorated.call(this,params)},MinimumResultsForSearch})),S2.define("select2/dropdown/selectOnClose",[],(function(){function SelectOnClose(){}return SelectOnClose.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("close",(function(params){self._handleSelectOnClose(params)}))},SelectOnClose.prototype._handleSelectOnClose=function(_,params){if(params&&null!=params.originalSelect2Event){var event=params.originalSelect2Event;if("select"===event._type||"unselect"===event._type)return}var $highlightedResults=this.getHighlightedResults();if(!($highlightedResults.length<1)){var data=$highlightedResults.data("data");null!=data.element&&data.element.selected||null==data.element&&data.selected||this.trigger("select",{data:data})}},SelectOnClose})),S2.define("select2/dropdown/closeOnSelect",[],(function(){function CloseOnSelect(){}return CloseOnSelect.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("select",(function(evt){self._selectTriggered(evt)})),container.on("unselect",(function(evt){self._selectTriggered(evt)}))},CloseOnSelect.prototype._selectTriggered=function(_,evt){var originalEvent=evt.originalEvent;originalEvent&&originalEvent.ctrlKey||this.trigger("close",{originalEvent:originalEvent,originalSelect2Event:evt})},CloseOnSelect})),S2.define("select2/i18n/en",[],(function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(args){var overChars=args.input.length-args.maximum,message="Please delete "+overChars+" character";return 1!=overChars&&(message+="s"),message},inputTooShort:function(args){return"Please enter "+(args.minimum-args.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(args){var message="You can only select "+args.maximum+" item";return 1!=args.maximum&&(message+="s"),message},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}})),S2.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],(function($,require,ResultsList,SingleSelection,MultipleSelection,Placeholder,AllowClear,SelectionSearch,EventRelay,Utils,Translation,DIACRITICS,SelectData,ArrayData,AjaxData,Tags,Tokenizer,MinimumInputLength,MaximumInputLength,MaximumSelectionLength,Dropdown,DropdownSearch,HidePlaceholder,InfiniteScroll,AttachBody,MinimumResultsForSearch,SelectOnClose,CloseOnSelect,EnglishTranslation){function Defaults(){this.reset()}return Defaults.prototype.apply=function(options){if(null==(options=$.extend(!0,{},this.defaults,options)).dataAdapter){if(null!=options.ajax?options.dataAdapter=AjaxData:null!=options.data?options.dataAdapter=ArrayData:options.dataAdapter=SelectData,options.minimumInputLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MinimumInputLength)),options.maximumInputLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumInputLength)),options.maximumSelectionLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumSelectionLength)),options.tags&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,Tags)),null==options.tokenSeparators&&null==options.tokenizer||(options.dataAdapter=Utils.Decorate(options.dataAdapter,Tokenizer)),null!=options.query){var Query=require(options.amdBase+"compat/query");options.dataAdapter=Utils.Decorate(options.dataAdapter,Query)}if(null!=options.initSelection){var InitSelection=require(options.amdBase+"compat/initSelection");options.dataAdapter=Utils.Decorate(options.dataAdapter,InitSelection)}}if(null==options.resultsAdapter&&(options.resultsAdapter=ResultsList,null!=options.ajax&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,InfiniteScroll)),null!=options.placeholder&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,HidePlaceholder)),options.selectOnClose&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,SelectOnClose))),null==options.dropdownAdapter){if(options.multiple)options.dropdownAdapter=Dropdown;else{var SearchableDropdown=Utils.Decorate(Dropdown,DropdownSearch);options.dropdownAdapter=SearchableDropdown}if(0!==options.minimumResultsForSearch&&(options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,MinimumResultsForSearch)),options.closeOnSelect&&(options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,CloseOnSelect)),null!=options.dropdownCssClass||null!=options.dropdownCss||null!=options.adaptDropdownCssClass){var DropdownCSS=require(options.amdBase+"compat/dropdownCss");options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,DropdownCSS)}options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,AttachBody)}if(null==options.selectionAdapter){if(options.multiple?options.selectionAdapter=MultipleSelection:options.selectionAdapter=SingleSelection,null!=options.placeholder&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,Placeholder)),options.allowClear&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,AllowClear)),options.multiple&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,SelectionSearch)),null!=options.containerCssClass||null!=options.containerCss||null!=options.adaptContainerCssClass){var ContainerCSS=require(options.amdBase+"compat/containerCss");options.selectionAdapter=Utils.Decorate(options.selectionAdapter,ContainerCSS)}options.selectionAdapter=Utils.Decorate(options.selectionAdapter,EventRelay)}if("string"==typeof options.language)if(options.language.indexOf("-")>0){var baseLanguage=options.language.split("-")[0];options.language=[options.language,baseLanguage]}else options.language=[options.language];if($.isArray(options.language)){var languages=new Translation;options.language.push("en");for(var languageNames=options.language,l=0;l<languageNames.length;l++){var name=languageNames[l],language={};try{language=Translation.loadPath(name)}catch(e){try{name=this.defaults.amdLanguageBase+name,language=Translation.loadPath(name)}catch(ex){options.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+name+'" could not be automatically loaded. A fallback will be used instead.');continue}}languages.extend(language)}options.translations=languages}else{var baseTranslation=Translation.loadPath(this.defaults.amdLanguageBase+"en"),customTranslation=new Translation(options.language);customTranslation.extend(baseTranslation),options.translations=customTranslation}return options},Defaults.prototype.reset=function(){function stripDiacritics(text){return text.replace(/[^\u0000-\u007E]/g,(function(a){return DIACRITICS[a]||a}))}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:Utils.escapeMarkup,language:EnglishTranslation,matcher:function matcher(params,data){if(""===$.trim(params.term))return data;if(data.children&&data.children.length>0){for(var match=$.extend(!0,{},data),c=data.children.length-1;c>=0;c--)null==matcher(params,data.children[c])&&match.children.splice(c,1);return match.children.length>0?match:matcher(params,match)}var original=stripDiacritics(data.text).toUpperCase(),term=stripDiacritics(params.term).toUpperCase();return original.indexOf(term)>-1?data:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(data){return data},templateResult:function(result){return result.text},templateSelection:function(selection){return selection.text},theme:"default",width:"resolve"}},Defaults.prototype.set=function(key,value){var data={};data[$.camelCase(key)]=value;var convertedData=Utils._convertData(data);$.extend(this.defaults,convertedData)},new Defaults})),S2.define("select2/options",["require","jquery","./defaults","./utils"],(function(require,$,Defaults,Utils){function Options(options,$element){if(this.options=options,null!=$element&&this.fromElement($element),this.options=Defaults.apply(this.options),$element&&$element.is("input")){var InputCompat=require(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=Utils.Decorate(this.options.dataAdapter,InputCompat)}}return Options.prototype.fromElement=function($e){var excludedData=["select2"];null==this.options.multiple&&(this.options.multiple=$e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=$e.prop("disabled")),null==this.options.language&&($e.prop("lang")?this.options.language=$e.prop("lang").toLowerCase():$e.closest("[lang]").prop("lang")&&(this.options.language=$e.closest("[lang]").prop("lang"))),null==this.options.dir&&($e.prop("dir")?this.options.dir=$e.prop("dir"):$e.closest("[dir]").prop("dir")?this.options.dir=$e.closest("[dir]").prop("dir"):this.options.dir="ltr"),$e.prop("disabled",this.options.disabled),$e.prop("multiple",this.options.multiple),$e.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),$e.data("data",$e.data("select2Tags")),$e.data("tags",!0)),$e.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),$e.attr("ajax--url",$e.data("ajaxUrl")),$e.data("ajax--url",$e.data("ajaxUrl")));var dataset={};dataset=$.fn.jquery&&"1."==$.fn.jquery.substr(0,2)&&$e[0].dataset?$.extend(!0,{},$e[0].dataset,$e.data()):$e.data();var data=$.extend(!0,{},dataset);for(var key in data=Utils._convertData(data))$.inArray(key,excludedData)>-1||($.isPlainObject(this.options[key])?$.extend(this.options[key],data[key]):this.options[key]=data[key]);return this},Options.prototype.get=function(key){return this.options[key]},Options.prototype.set=function(key,val){this.options[key]=val},Options})),S2.define("select2/core",["jquery","./options","./utils","./keys"],(function($,Options,Utils,KEYS){var Select2=function($element,options){null!=$element.data("select2")&&$element.data("select2").destroy(),this.$element=$element,this.id=this._generateId($element),options=options||{},this.options=new Options(options,$element),Select2.__super__.constructor.call(this);var tabindex=$element.attr("tabindex")||0;$element.data("old-tabindex",tabindex),$element.attr("tabindex","-1");var DataAdapter=this.options.get("dataAdapter");this.dataAdapter=new DataAdapter($element,this.options);var $container=this.render();this._placeContainer($container);var SelectionAdapter=this.options.get("selectionAdapter");this.selection=new SelectionAdapter($element,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,$container);var DropdownAdapter=this.options.get("dropdownAdapter");this.dropdown=new DropdownAdapter($element,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,$container);var ResultsAdapter=this.options.get("resultsAdapter");this.results=new ResultsAdapter($element,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var self=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current((function(initialData){self.trigger("selection:update",{data:initialData})})),$element.addClass("select2-hidden-accessible"),$element.attr("aria-hidden","true"),this._syncAttributes(),$element.data("select2",this)};return Utils.Extend(Select2,Utils.Observable),Select2.prototype._generateId=function($element){return"select2-"+(null!=$element.attr("id")?$element.attr("id"):null!=$element.attr("name")?$element.attr("name")+"-"+Utils.generateChars(2):Utils.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},Select2.prototype._placeContainer=function($container){$container.insertAfter(this.$element);var width=this._resolveWidth(this.$element,this.options.get("width"));null!=width&&$container.css("width",width)},Select2.prototype._resolveWidth=function($element,method){var WIDTH=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==method){var styleWidth=this._resolveWidth($element,"style");return null!=styleWidth?styleWidth:this._resolveWidth($element,"element")}if("element"==method){var elementWidth=$element.outerWidth(!1);return elementWidth<=0?"auto":elementWidth+"px"}if("style"==method){var style=$element.attr("style");if("string"!=typeof style)return null;for(var attrs=style.split(";"),i=0,l=attrs.length;i<l;i+=1){var matches=attrs[i].replace(/\s/g,"").match(WIDTH);if(null!==matches&&matches.length>=1)return matches[1]}return null}return method},Select2.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},Select2.prototype._registerDomEvents=function(){var self=this;this.$element.on("change.select2",(function(){self.dataAdapter.current((function(data){self.trigger("selection:update",{data:data})}))})),this.$element.on("focus.select2",(function(evt){self.trigger("focus",evt)})),this._syncA=Utils.bind(this._syncAttributes,this),this._syncS=Utils.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var observer=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=observer?(this._observer=new observer((function(mutations){$.each(mutations,self._syncA),$.each(mutations,self._syncS)})),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",self._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",self._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",self._syncS,!1))},Select2.prototype._registerDataEvents=function(){var self=this;this.dataAdapter.on("*",(function(name,params){self.trigger(name,params)}))},Select2.prototype._registerSelectionEvents=function(){var self=this,nonRelayEvents=["toggle","focus"];this.selection.on("toggle",(function(){self.toggleDropdown()})),this.selection.on("focus",(function(params){self.focus(params)})),this.selection.on("*",(function(name,params){-1===$.inArray(name,nonRelayEvents)&&self.trigger(name,params)}))},Select2.prototype._registerDropdownEvents=function(){var self=this;this.dropdown.on("*",(function(name,params){self.trigger(name,params)}))},Select2.prototype._registerResultsEvents=function(){var self=this;this.results.on("*",(function(name,params){self.trigger(name,params)}))},Select2.prototype._registerEvents=function(){var self=this;this.on("open",(function(){self.$container.addClass("select2-container--open")})),this.on("close",(function(){self.$container.removeClass("select2-container--open")})),this.on("enable",(function(){self.$container.removeClass("select2-container--disabled")})),this.on("disable",(function(){self.$container.addClass("select2-container--disabled")})),this.on("blur",(function(){self.$container.removeClass("select2-container--focus")})),this.on("query",(function(params){self.isOpen()||self.trigger("open",{}),this.dataAdapter.query(params,(function(data){self.trigger("results:all",{data:data,query:params})}))})),this.on("query:append",(function(params){this.dataAdapter.query(params,(function(data){self.trigger("results:append",{data:data,query:params})}))})),this.on("keypress",(function(evt){var key=evt.which;self.isOpen()?key===KEYS.ESC||key===KEYS.TAB||key===KEYS.UP&&evt.altKey?(self.close(),evt.preventDefault()):key===KEYS.ENTER?(self.trigger("results:select",{}),evt.preventDefault()):key===KEYS.SPACE&&evt.ctrlKey?(self.trigger("results:toggle",{}),evt.preventDefault()):key===KEYS.UP?(self.trigger("results:previous",{}),evt.preventDefault()):key===KEYS.DOWN&&(self.trigger("results:next",{}),evt.preventDefault()):(key===KEYS.ENTER||key===KEYS.SPACE||key===KEYS.DOWN&&evt.altKey)&&(self.open(),evt.preventDefault())}))},Select2.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},Select2.prototype._syncSubtree=function(evt,mutations){var changed=!1,self=this;if(!evt||!evt.target||"OPTION"===evt.target.nodeName||"OPTGROUP"===evt.target.nodeName){if(mutations)if(mutations.addedNodes&&mutations.addedNodes.length>0)for(var n=0;n<mutations.addedNodes.length;n++)mutations.addedNodes[n].selected&&(changed=!0);else mutations.removedNodes&&mutations.removedNodes.length>0&&(changed=!0);else changed=!0;changed&&this.dataAdapter.current((function(currentData){self.trigger("selection:update",{data:currentData})}))}},Select2.prototype.trigger=function(name,args){var actualTrigger=Select2.__super__.trigger,preTriggerMap={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===args&&(args={}),name in preTriggerMap){var preTriggerName=preTriggerMap[name],preTriggerArgs={prevented:!1,name:name,args:args};if(actualTrigger.call(this,preTriggerName,preTriggerArgs),preTriggerArgs.prevented)return void(args.prevented=!0)}actualTrigger.call(this,name,args)},Select2.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},Select2.prototype.open=function(){this.isOpen()||this.trigger("query",{})},Select2.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},Select2.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},Select2.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},Select2.prototype.focus=function(data){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},Select2.prototype.enable=function(args){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=args&&0!==args.length||(args=[!0]);var disabled=!args[0];this.$element.prop("disabled",disabled)},Select2.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var data=[];return this.dataAdapter.current((function(currentData){data=currentData})),data},Select2.prototype.val=function(args){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==args||0===args.length)return this.$element.val();var newVal=args[0];$.isArray(newVal)&&(newVal=$.map(newVal,(function(obj){return obj.toString()}))),this.$element.val(newVal).trigger("change")},Select2.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},Select2.prototype.render=function(){var $container=$('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return $container.attr("dir",this.options.get("dir")),this.$container=$container,this.$container.addClass("select2-container--"+this.options.get("theme")),$container.data("element",this.$element),$container},Select2})),S2.define("jquery-mousewheel",["jquery"],(function($){return $})),S2.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],(function($,_,Select2,Defaults){if(null==$.fn.select2){var thisMethods=["open","close","destroy"];$.fn.select2=function(options){if("object"==typeof(options=options||{}))return this.each((function(){var instanceOptions=$.extend(!0,{},options);new Select2($(this),instanceOptions)})),this;if("string"==typeof options){var ret,args=Array.prototype.slice.call(arguments,1);return this.each((function(){var instance=$(this).data("select2");null==instance&&window.console&&console.error&&console.error("The select2('"+options+"') method was called on an element that is not using Select2."),ret=instance[options].apply(instance,args)})),$.inArray(options,thisMethods)>-1?this:ret}throw new Error("Invalid arguments for Select2: "+options)}}return null==$.fn.select2.defaults&&($.fn.select2.defaults=Defaults),Select2})),{define:S2.define,require:S2.require}}(),select2=S2.require("jquery.select2");return jQuery.fn.select2.amd=S2,select2})?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},function(module,exports,__webpack_require__){var isRegExp=__webpack_require__(537),escapeRegExp=__webpack_require__(538),isString=__webpack_require__(539),flatten=__webpack_require__(540);module.exports=function(source,match,fn){return Array.isArray(source)||(source=[source]),flatten(source.map((function(x){return isString(x)?function(str,match,fn){if(""===str)return str;if(!str||!isString(str))throw new TypeError("First argument to react-string-replace#replaceString must be a string");var re=match;isRegExp(re)||(re=new RegExp("("+escapeRegExp(re)+")","gi"));for(var result=str.split(re),i=1,length=result.length;i<length;i+=2)result[i]=fn(result[i],i);return result}(x,match,fn):x})))}},function(module,exports,__webpack_require__){(function(global,module){var regexpTag="[object RegExp]",freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeExports=exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,freeProcess=freeModule&&freeModule.exports===freeExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp;var objectToString=Object.prototype.toString;var func,isRegExp=nodeIsRegExp?(func=nodeIsRegExp,function(value){return func(value)}):function(value){return function(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}(value)&&objectToString.call(value)==regexpTag};module.exports=isRegExp}).call(this,__webpack_require__(43),__webpack_require__(114)(module))},function(module,exports,__webpack_require__){(function(global){var INFINITY=1/0,symbolTag="[object Symbol]",reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reHasRegExpChar=RegExp(reRegExpChar.source),freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectToString=Object.prototype.toString,Symbol=root.Symbol,symbolProto=Symbol?Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString(value){if("string"==typeof value)return value;if(function(value){return"symbol"==typeof value||function(value){return!!value&&"object"==typeof value}(value)&&objectToString.call(value)==symbolTag}(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-INFINITY?"-0":result}module.exports=function(string){var value;return(string=null==(value=string)?"":baseToString(value))&&reHasRegExpChar.test(string)?string.replace(reRegExpChar,"\\$&"):string}}).call(this,__webpack_require__(43))},function(module,exports){var stringTag="[object String]",objectToString=Object.prototype.toString,isArray=Array.isArray;module.exports=function(value){return"string"==typeof value||!isArray(value)&&function(value){return!!value&&"object"==typeof value}(value)&&objectToString.call(value)==stringTag}},function(module,exports,__webpack_require__){(function(global){var MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,Symbol=root.Symbol,propertyIsEnumerable=objectProto.propertyIsEnumerable,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0;function isFlattenable(value){return isArray(value)||function(value){return function(value){return function(value){return!!value&&"object"==typeof value}(value)&&function(value){return null!=value&&function(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}(value.length)&&!function(value){var tag=function(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}(value)}(value)}(value)&&hasOwnProperty.call(value,"callee")&&(!propertyIsEnumerable.call(value,"callee")||objectToString.call(value)==argsTag)}(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}var isArray=Array.isArray;module.exports=function(array){return(array?array.length:0)?function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];depth>0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}(array,1):[]}}).call(this,__webpack_require__(43))},function(module,exports,__webpack_require__){module.exports=function(){"use strict";var userAgent=navigator.userAgent,platform=navigator.platform,gecko=/gecko\/\d/i.test(userAgent),ie_upto10=/MSIE \d/.test(userAgent),ie_11up=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent),edge=/Edge\/(\d+)/.exec(userAgent),ie=ie_upto10||ie_11up||edge,ie_version=ie&&(ie_upto10?document.documentMode||6:+(edge||ie_11up)[1]),webkit=!edge&&/WebKit\//.test(userAgent),qtwebkit=webkit&&/Qt\/\d+\.\d+/.test(userAgent),chrome=!edge&&/Chrome\//.test(userAgent),presto=/Opera\//.test(userAgent),safari=/Apple Computer/.test(navigator.vendor),mac_geMountainLion=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent),phantom=/PhantomJS/.test(userAgent),ios=!edge&&/AppleWebKit/.test(userAgent)&&/Mobile\/\w+/.test(userAgent),android=/Android/.test(userAgent),mobile=ios||android||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent),mac=ios||/Mac/.test(platform),chromeOS=/\bCrOS\b/.test(userAgent),windows=/win/i.test(platform),presto_version=presto&&userAgent.match(/Version\/(\d*\.\d*)/);presto_version&&(presto_version=Number(presto_version[1])),presto_version&&presto_version>=15&&(presto=!1,webkit=!0);var flipCtrlCmd=mac&&(qtwebkit||presto&&(null==presto_version||presto_version<12.11)),captureRightClick=gecko||ie&&ie_version>=9;function classTest(cls){return new RegExp("(^|\\s)"+cls+"(?:$|\\s)\\s*")}var range,rmClass=function(node,cls){var current=node.className,match=classTest(cls).exec(current);if(match){var after=current.slice(match.index+match[0].length);node.className=current.slice(0,match.index)+(after?match[1]+after:"")}};function removeChildren(e){for(var count=e.childNodes.length;count>0;--count)e.removeChild(e.firstChild);return e}function removeChildrenAndAdd(parent,e){return removeChildren(parent).appendChild(e)}function elt(tag,content,className,style){var e=document.createElement(tag);if(className&&(e.className=className),style&&(e.style.cssText=style),"string"==typeof content)e.appendChild(document.createTextNode(content));else if(content)for(var i=0;i<content.length;++i)e.appendChild(content[i]);return e}function eltP(tag,content,className,style){var e=elt(tag,content,className,style);return e.setAttribute("role","presentation"),e}function contains(parent,child){if(3==child.nodeType&&(child=child.parentNode),parent.contains)return parent.contains(child);do{if(11==child.nodeType&&(child=child.host),child==parent)return!0}while(child=child.parentNode)}function activeElt(){var activeElement;try{activeElement=document.activeElement}catch(e){activeElement=document.body||null}for(;activeElement&&activeElement.shadowRoot&&activeElement.shadowRoot.activeElement;)activeElement=activeElement.shadowRoot.activeElement;return activeElement}function addClass(node,cls){var current=node.className;classTest(cls).test(current)||(node.className+=(current?" ":"")+cls)}function joinClasses(a,b){for(var as=a.split(" "),i=0;i<as.length;i++)as[i]&&!classTest(as[i]).test(b)&&(b+=" "+as[i]);return b}range=document.createRange?function(node,start,end,endNode){var r=document.createRange();return r.setEnd(endNode||node,end),r.setStart(node,start),r}:function(node,start,end){var r=document.body.createTextRange();try{r.moveToElementText(node.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",end),r.moveStart("character",start),r};var selectInput=function(node){node.select()};function bind(f){var args=Array.prototype.slice.call(arguments,1);return function(){return f.apply(null,args)}}function copyObj(obj,target,overwrite){for(var prop in target||(target={}),obj)!obj.hasOwnProperty(prop)||!1===overwrite&&target.hasOwnProperty(prop)||(target[prop]=obj[prop]);return target}function countColumn(string,end,tabSize,startIndex,startValue){null==end&&-1==(end=string.search(/[^\s\u00a0]/))&&(end=string.length);for(var i=startIndex||0,n=startValue||0;;){var nextTab=string.indexOf("\t",i);if(nextTab<0||nextTab>=end)return n+(end-i);n+=nextTab-i,n+=tabSize-n%tabSize,i=nextTab+1}}ios?selectInput=function(node){node.selectionStart=0,node.selectionEnd=node.value.length}:ie&&(selectInput=function(node){try{node.select()}catch(_e){}});var Delayed=function(){this.id=null,this.f=null,this.time=0,this.handler=bind(this.onTimeout,this)};function indexOf(array,elt){for(var i=0;i<array.length;++i)if(array[i]==elt)return i;return-1}Delayed.prototype.onTimeout=function(self){self.id=0,self.time<=+new Date?self.f():setTimeout(self.handler,self.time-+new Date)},Delayed.prototype.set=function(ms,f){this.f=f;var time=+new Date+ms;(!this.id||time<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,ms),this.time=time)};var scrollerGap=30,Pass={toString:function(){return"CodeMirror.Pass"}},sel_dontScroll={scroll:!1},sel_mouse={origin:"*mouse"},sel_move={origin:"+move"};function findColumn(string,goal,tabSize){for(var pos=0,col=0;;){var nextTab=string.indexOf("\t",pos);-1==nextTab&&(nextTab=string.length);var skipped=nextTab-pos;if(nextTab==string.length||col+skipped>=goal)return pos+Math.min(skipped,goal-col);if(col+=nextTab-pos,pos=nextTab+1,(col+=tabSize-col%tabSize)>=goal)return pos}}var spaceStrs=[""];function spaceStr(n){for(;spaceStrs.length<=n;)spaceStrs.push(lst(spaceStrs)+" ");return spaceStrs[n]}function lst(arr){return arr[arr.length-1]}function map(array,f){for(var out=[],i=0;i<array.length;i++)out[i]=f(array[i],i);return out}function nothing(){}function createObj(base,props){var inst;return Object.create?inst=Object.create(base):(nothing.prototype=base,inst=new nothing),props&&copyObj(props,inst),inst}var nonASCIISingleCaseWordChar=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function isWordCharBasic(ch){return/\w/.test(ch)||ch>"€"&&(ch.toUpperCase()!=ch.toLowerCase()||nonASCIISingleCaseWordChar.test(ch))}function isWordChar(ch,helper){return helper?!!(helper.source.indexOf("\\w")>-1&&isWordCharBasic(ch))||helper.test(ch):isWordCharBasic(ch)}function isEmpty(obj){for(var n in obj)if(obj.hasOwnProperty(n)&&obj[n])return!1;return!0}var extendingChars=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function isExtendingChar(ch){return ch.charCodeAt(0)>=768&&extendingChars.test(ch)}function skipExtendingChars(str,pos,dir){for(;(dir<0?pos>0:pos<str.length)&&isExtendingChar(str.charAt(pos));)pos+=dir;return pos}function findFirst(pred,from,to){for(var dir=from>to?-1:1;;){if(from==to)return from;var midF=(from+to)/2,mid=dir<0?Math.ceil(midF):Math.floor(midF);if(mid==from)return pred(mid)?from:to;pred(mid)?to=mid:from=mid+dir}}var bidiOther=null;function getBidiPartAt(order,ch,sticky){var found;bidiOther=null;for(var i=0;i<order.length;++i){var cur=order[i];if(cur.from<ch&&cur.to>ch)return i;cur.to==ch&&(cur.from!=cur.to&&"before"==sticky?found=i:bidiOther=i),cur.from==ch&&(cur.from!=cur.to&&"before"!=sticky?found=i:bidiOther=i)}return null!=found?found:bidiOther}var bidiOrdering=function(){var lowTypes="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",arabicTypes="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",bidiRE=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,isNeutral=/[stwN]/,isStrong=/[LRr]/,countsAsLeft=/[Lb1n]/,countsAsNum=/[1n]/;function BidiSpan(level,from,to){this.level=level,this.from=from,this.to=to}return function(str,direction){var outerType="ltr"==direction?"L":"R";if(0==str.length||"ltr"==direction&&!bidiRE.test(str))return!1;for(var code,len=str.length,types=[],i=0;i<len;++i)types.push((code=str.charCodeAt(i))<=247?lowTypes.charAt(code):1424<=code&&code<=1524?"R":1536<=code&&code<=1785?arabicTypes.charAt(code-1536):1774<=code&&code<=2220?"r":8192<=code&&code<=8203?"w":8204==code?"b":"L");for(var i$1=0,prev=outerType;i$1<len;++i$1){var type=types[i$1];"m"==type?types[i$1]=prev:prev=type}for(var i$2=0,cur=outerType;i$2<len;++i$2){var type$1=types[i$2];"1"==type$1&&"r"==cur?types[i$2]="n":isStrong.test(type$1)&&(cur=type$1,"r"==type$1&&(types[i$2]="R"))}for(var i$3=1,prev$1=types[0];i$3<len-1;++i$3){var type$2=types[i$3];"+"==type$2&&"1"==prev$1&&"1"==types[i$3+1]?types[i$3]="1":","!=type$2||prev$1!=types[i$3+1]||"1"!=prev$1&&"n"!=prev$1||(types[i$3]=prev$1),prev$1=type$2}for(var i$4=0;i$4<len;++i$4){var type$3=types[i$4];if(","==type$3)types[i$4]="N";else if("%"==type$3){var end=void 0;for(end=i$4+1;end<len&&"%"==types[end];++end);for(var replace=i$4&&"!"==types[i$4-1]||end<len&&"1"==types[end]?"1":"N",j=i$4;j<end;++j)types[j]=replace;i$4=end-1}}for(var i$5=0,cur$1=outerType;i$5<len;++i$5){var type$4=types[i$5];"L"==cur$1&&"1"==type$4?types[i$5]="L":isStrong.test(type$4)&&(cur$1=type$4)}for(var i$6=0;i$6<len;++i$6)if(isNeutral.test(types[i$6])){var end$1=void 0;for(end$1=i$6+1;end$1<len&&isNeutral.test(types[end$1]);++end$1);for(var before="L"==(i$6?types[i$6-1]:outerType),replace$1=before==("L"==(end$1<len?types[end$1]:outerType))?before?"L":"R":outerType,j$1=i$6;j$1<end$1;++j$1)types[j$1]=replace$1;i$6=end$1-1}for(var m,order=[],i$7=0;i$7<len;)if(countsAsLeft.test(types[i$7])){var start=i$7;for(++i$7;i$7<len&&countsAsLeft.test(types[i$7]);++i$7);order.push(new BidiSpan(0,start,i$7))}else{var pos=i$7,at=order.length;for(++i$7;i$7<len&&"L"!=types[i$7];++i$7);for(var j$2=pos;j$2<i$7;)if(countsAsNum.test(types[j$2])){pos<j$2&&order.splice(at,0,new BidiSpan(1,pos,j$2));var nstart=j$2;for(++j$2;j$2<i$7&&countsAsNum.test(types[j$2]);++j$2);order.splice(at,0,new BidiSpan(2,nstart,j$2)),pos=j$2}else++j$2;pos<i$7&&order.splice(at,0,new BidiSpan(1,pos,i$7))}return"ltr"==direction&&(1==order[0].level&&(m=str.match(/^\s+/))&&(order[0].from=m[0].length,order.unshift(new BidiSpan(0,0,m[0].length))),1==lst(order).level&&(m=str.match(/\s+$/))&&(lst(order).to-=m[0].length,order.push(new BidiSpan(0,len-m[0].length,len)))),"rtl"==direction?order.reverse():order}}();function getOrder(line,direction){var order=line.order;return null==order&&(order=line.order=bidiOrdering(line.text,direction)),order}var noHandlers=[],on=function(emitter,type,f){if(emitter.addEventListener)emitter.addEventListener(type,f,!1);else if(emitter.attachEvent)emitter.attachEvent("on"+type,f);else{var map=emitter._handlers||(emitter._handlers={});map[type]=(map[type]||noHandlers).concat(f)}};function getHandlers(emitter,type){return emitter._handlers&&emitter._handlers[type]||noHandlers}function off(emitter,type,f){if(emitter.removeEventListener)emitter.removeEventListener(type,f,!1);else if(emitter.detachEvent)emitter.detachEvent("on"+type,f);else{var map=emitter._handlers,arr=map&&map[type];if(arr){var index=indexOf(arr,f);index>-1&&(map[type]=arr.slice(0,index).concat(arr.slice(index+1)))}}}function signal(emitter,type){var handlers=getHandlers(emitter,type);if(handlers.length)for(var args=Array.prototype.slice.call(arguments,2),i=0;i<handlers.length;++i)handlers[i].apply(null,args)}function signalDOMEvent(cm,e,override){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),signal(cm,override||e.type,cm,e),e_defaultPrevented(e)||e.codemirrorIgnore}function signalCursorActivity(cm){var arr=cm._handlers&&cm._handlers.cursorActivity;if(arr)for(var set=cm.curOp.cursorActivityHandlers||(cm.curOp.cursorActivityHandlers=[]),i=0;i<arr.length;++i)-1==indexOf(set,arr[i])&&set.push(arr[i])}function hasHandler(emitter,type){return getHandlers(emitter,type).length>0}function eventMixin(ctor){ctor.prototype.on=function(type,f){on(this,type,f)},ctor.prototype.off=function(type,f){off(this,type,f)}}function e_preventDefault(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function e_stopPropagation(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function e_defaultPrevented(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function e_stop(e){e_preventDefault(e),e_stopPropagation(e)}function e_target(e){return e.target||e.srcElement}function e_button(e){var b=e.which;return null==b&&(1&e.button?b=1:2&e.button?b=3:4&e.button&&(b=2)),mac&&e.ctrlKey&&1==b&&(b=3),b}var zwspSupported,badBidiRects,dragAndDrop=function(){if(ie&&ie_version<9)return!1;var div=elt("div");return"draggable"in div||"dragDrop"in div}();function zeroWidthElement(measure){if(null==zwspSupported){var test=elt("span","​");removeChildrenAndAdd(measure,elt("span",[test,document.createTextNode("x")])),0!=measure.firstChild.offsetHeight&&(zwspSupported=test.offsetWidth<=1&&test.offsetHeight>2&&!(ie&&ie_version<8))}var node=zwspSupported?elt("span","​"):elt("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return node.setAttribute("cm-text",""),node}function hasBadBidiRects(measure){if(null!=badBidiRects)return badBidiRects;var txt=removeChildrenAndAdd(measure,document.createTextNode("AخA")),r0=range(txt,0,1).getBoundingClientRect(),r1=range(txt,1,2).getBoundingClientRect();return removeChildren(measure),!(!r0||r0.left==r0.right)&&(badBidiRects=r1.right-r0.right<3)}var e,splitLinesAuto=3!="\n\nb".split(/\n/).length?function(string){for(var pos=0,result=[],l=string.length;pos<=l;){var nl=string.indexOf("\n",pos);-1==nl&&(nl=string.length);var line=string.slice(pos,"\r"==string.charAt(nl-1)?nl-1:nl),rt=line.indexOf("\r");-1!=rt?(result.push(line.slice(0,rt)),pos+=rt+1):(result.push(line),pos=nl+1)}return result}:function(string){return string.split(/\r\n?|\n/)},hasSelection=window.getSelection?function(te){try{return te.selectionStart!=te.selectionEnd}catch(e){return!1}}:function(te){var range;try{range=te.ownerDocument.selection.createRange()}catch(e){}return!(!range||range.parentElement()!=te)&&0!=range.compareEndPoints("StartToEnd",range)},hasCopyEvent="oncopy"in(e=elt("div"))||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy),badZoomedRects=null,modes={},mimeModes={};function defineMode(name,mode){arguments.length>2&&(mode.dependencies=Array.prototype.slice.call(arguments,2)),modes[name]=mode}function resolveMode(spec){if("string"==typeof spec&&mimeModes.hasOwnProperty(spec))spec=mimeModes[spec];else if(spec&&"string"==typeof spec.name&&mimeModes.hasOwnProperty(spec.name)){var found=mimeModes[spec.name];"string"==typeof found&&(found={name:found}),(spec=createObj(found,spec)).name=found.name}else{if("string"==typeof spec&&/^[\w\-]+\/[\w\-]+\+xml$/.test(spec))return resolveMode("application/xml");if("string"==typeof spec&&/^[\w\-]+\/[\w\-]+\+json$/.test(spec))return resolveMode("application/json")}return"string"==typeof spec?{name:spec}:spec||{name:"null"}}function getMode(options,spec){spec=resolveMode(spec);var mfactory=modes[spec.name];if(!mfactory)return getMode(options,"text/plain");var modeObj=mfactory(options,spec);if(modeExtensions.hasOwnProperty(spec.name)){var exts=modeExtensions[spec.name];for(var prop in exts)exts.hasOwnProperty(prop)&&(modeObj.hasOwnProperty(prop)&&(modeObj["_"+prop]=modeObj[prop]),modeObj[prop]=exts[prop])}if(modeObj.name=spec.name,spec.helperType&&(modeObj.helperType=spec.helperType),spec.modeProps)for(var prop$1 in spec.modeProps)modeObj[prop$1]=spec.modeProps[prop$1];return modeObj}var modeExtensions={};function extendMode(mode,properties){copyObj(properties,modeExtensions.hasOwnProperty(mode)?modeExtensions[mode]:modeExtensions[mode]={})}function copyState(mode,state){if(!0===state)return state;if(mode.copyState)return mode.copyState(state);var nstate={};for(var n in state){var val=state[n];val instanceof Array&&(val=val.concat([])),nstate[n]=val}return nstate}function innerMode(mode,state){for(var info;mode.innerMode&&(info=mode.innerMode(state))&&info.mode!=mode;)state=info.state,mode=info.mode;return info||{mode:mode,state:state}}function startState(mode,a1,a2){return!mode.startState||mode.startState(a1,a2)}var StringStream=function(string,tabSize,lineOracle){this.pos=this.start=0,this.string=string,this.tabSize=tabSize||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=lineOracle};function getLine(doc,n){if((n-=doc.first)<0||n>=doc.size)throw new Error("There is no line "+(n+doc.first)+" in the document.");for(var chunk=doc;!chunk.lines;)for(var i=0;;++i){var child=chunk.children[i],sz=child.chunkSize();if(n<sz){chunk=child;break}n-=sz}return chunk.lines[n]}function getBetween(doc,start,end){var out=[],n=start.line;return doc.iter(start.line,end.line+1,(function(line){var text=line.text;n==end.line&&(text=text.slice(0,end.ch)),n==start.line&&(text=text.slice(start.ch)),out.push(text),++n})),out}function getLines(doc,from,to){var out=[];return doc.iter(from,to,(function(line){out.push(line.text)})),out}function updateLineHeight(line,height){var diff=height-line.height;if(diff)for(var n=line;n;n=n.parent)n.height+=diff}function lineNo(line){if(null==line.parent)return null;for(var cur=line.parent,no=indexOf(cur.lines,line),chunk=cur.parent;chunk;cur=chunk,chunk=chunk.parent)for(var i=0;chunk.children[i]!=cur;++i)no+=chunk.children[i].chunkSize();return no+cur.first}function lineAtHeight(chunk,h){var n=chunk.first;outer:do{for(var i$1=0;i$1<chunk.children.length;++i$1){var child=chunk.children[i$1],ch=child.height;if(h<ch){chunk=child;continue outer}h-=ch,n+=child.chunkSize()}return n}while(!chunk.lines);for(var i=0;i<chunk.lines.length;++i){var lh=chunk.lines[i].height;if(h<lh)break;h-=lh}return n+i}function isLine(doc,l){return l>=doc.first&&l<doc.first+doc.size}function lineNumberFor(options,i){return String(options.lineNumberFormatter(i+options.firstLineNumber))}function Pos(line,ch,sticky){if(void 0===sticky&&(sticky=null),!(this instanceof Pos))return new Pos(line,ch,sticky);this.line=line,this.ch=ch,this.sticky=sticky}function cmp(a,b){return a.line-b.line||a.ch-b.ch}function equalCursorPos(a,b){return a.sticky==b.sticky&&0==cmp(a,b)}function copyPos(x){return Pos(x.line,x.ch)}function maxPos(a,b){return cmp(a,b)<0?b:a}function minPos(a,b){return cmp(a,b)<0?a:b}function clipLine(doc,n){return Math.max(doc.first,Math.min(n,doc.first+doc.size-1))}function clipPos(doc,pos){if(pos.line<doc.first)return Pos(doc.first,0);var last=doc.first+doc.size-1;return pos.line>last?Pos(last,getLine(doc,last).text.length):function(pos,linelen){var ch=pos.ch;return null==ch||ch>linelen?Pos(pos.line,linelen):ch<0?Pos(pos.line,0):pos}(pos,getLine(doc,pos.line).text.length)}function clipPosArray(doc,array){for(var out=[],i=0;i<array.length;i++)out[i]=clipPos(doc,array[i]);return out}StringStream.prototype.eol=function(){return this.pos>=this.string.length},StringStream.prototype.sol=function(){return this.pos==this.lineStart},StringStream.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},StringStream.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},StringStream.prototype.eat=function(match){var ch=this.string.charAt(this.pos);if("string"==typeof match?ch==match:ch&&(match.test?match.test(ch):match(ch)))return++this.pos,ch},StringStream.prototype.eatWhile=function(match){for(var start=this.pos;this.eat(match););return this.pos>start},StringStream.prototype.eatSpace=function(){for(var start=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>start},StringStream.prototype.skipToEnd=function(){this.pos=this.string.length},StringStream.prototype.skipTo=function(ch){var found=this.string.indexOf(ch,this.pos);if(found>-1)return this.pos=found,!0},StringStream.prototype.backUp=function(n){this.pos-=n},StringStream.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=countColumn(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?countColumn(this.string,this.lineStart,this.tabSize):0)},StringStream.prototype.indentation=function(){return countColumn(this.string,null,this.tabSize)-(this.lineStart?countColumn(this.string,this.lineStart,this.tabSize):0)},StringStream.prototype.match=function(pattern,consume,caseInsensitive){if("string"!=typeof pattern){var match=this.string.slice(this.pos).match(pattern);return match&&match.index>0?null:(match&&!1!==consume&&(this.pos+=match[0].length),match)}var cased=function(str){return caseInsensitive?str.toLowerCase():str};if(cased(this.string.substr(this.pos,pattern.length))==cased(pattern))return!1!==consume&&(this.pos+=pattern.length),!0},StringStream.prototype.current=function(){return this.string.slice(this.start,this.pos)},StringStream.prototype.hideFirstChars=function(n,inner){this.lineStart+=n;try{return inner()}finally{this.lineStart-=n}},StringStream.prototype.lookAhead=function(n){var oracle=this.lineOracle;return oracle&&oracle.lookAhead(n)},StringStream.prototype.baseToken=function(){var oracle=this.lineOracle;return oracle&&oracle.baseToken(this.pos)};var SavedContext=function(state,lookAhead){this.state=state,this.lookAhead=lookAhead},Context=function(doc,state,line,lookAhead){this.state=state,this.doc=doc,this.line=line,this.maxLookAhead=lookAhead||0,this.baseTokens=null,this.baseTokenPos=1};function highlightLine(cm,line,context,forceToEnd){var st=[cm.state.modeGen],lineClasses={};runMode(cm,line.text,cm.doc.mode,context,(function(end,style){return st.push(end,style)}),lineClasses,forceToEnd);for(var state=context.state,loop=function(o){context.baseTokens=st;var overlay=cm.state.overlays[o],i=1,at=0;context.state=!0,runMode(cm,line.text,overlay.mode,context,(function(end,style){for(var start=i;at<end;){var i_end=st[i];i_end>end&&st.splice(i,1,end,st[i+1],i_end),i+=2,at=Math.min(end,i_end)}if(style)if(overlay.opaque)st.splice(start,i-start,end,"overlay "+style),i=start+2;else for(;start<i;start+=2){var cur=st[start+1];st[start+1]=(cur?cur+" ":"")+"overlay "+style}}),lineClasses),context.state=state,context.baseTokens=null,context.baseTokenPos=1},o=0;o<cm.state.overlays.length;++o)loop(o);return{styles:st,classes:lineClasses.bgClass||lineClasses.textClass?lineClasses:null}}function getLineStyles(cm,line,updateFrontier){if(!line.styles||line.styles[0]!=cm.state.modeGen){var context=getContextBefore(cm,lineNo(line)),resetState=line.text.length>cm.options.maxHighlightLength&&copyState(cm.doc.mode,context.state),result=highlightLine(cm,line,context);resetState&&(context.state=resetState),line.stateAfter=context.save(!resetState),line.styles=result.styles,result.classes?line.styleClasses=result.classes:line.styleClasses&&(line.styleClasses=null),updateFrontier===cm.doc.highlightFrontier&&(cm.doc.modeFrontier=Math.max(cm.doc.modeFrontier,++cm.doc.highlightFrontier))}return line.styles}function getContextBefore(cm,n,precise){var doc=cm.doc,display=cm.display;if(!doc.mode.startState)return new Context(doc,!0,n);var start=function(cm,n,precise){for(var minindent,minline,doc=cm.doc,lim=precise?-1:n-(cm.doc.mode.innerMode?1e3:100),search=n;search>lim;--search){if(search<=doc.first)return doc.first;var line=getLine(doc,search-1),after=line.stateAfter;if(after&&(!precise||search+(after instanceof SavedContext?after.lookAhead:0)<=doc.modeFrontier))return search;var indented=countColumn(line.text,null,cm.options.tabSize);(null==minline||minindent>indented)&&(minline=search-1,minindent=indented)}return minline}(cm,n,precise),saved=start>doc.first&&getLine(doc,start-1).stateAfter,context=saved?Context.fromSaved(doc,saved,start):new Context(doc,startState(doc.mode),start);return doc.iter(start,n,(function(line){processLine(cm,line.text,context);var pos=context.line;line.stateAfter=pos==n-1||pos%5==0||pos>=display.viewFrom&&pos<display.viewTo?context.save():null,context.nextLine()})),precise&&(doc.modeFrontier=context.line),context}function processLine(cm,text,context,startAt){var mode=cm.doc.mode,stream=new StringStream(text,cm.options.tabSize,context);for(stream.start=stream.pos=startAt||0,""==text&&callBlankLine(mode,context.state);!stream.eol();)readToken(mode,stream,context.state),stream.start=stream.pos}function callBlankLine(mode,state){if(mode.blankLine)return mode.blankLine(state);if(mode.innerMode){var inner=innerMode(mode,state);return inner.mode.blankLine?inner.mode.blankLine(inner.state):void 0}}function readToken(mode,stream,state,inner){for(var i=0;i<10;i++){inner&&(inner[0]=innerMode(mode,state).mode);var style=mode.token(stream,state);if(stream.pos>stream.start)return style}throw new Error("Mode "+mode.name+" failed to advance stream.")}Context.prototype.lookAhead=function(n){var line=this.doc.getLine(this.line+n);return null!=line&&n>this.maxLookAhead&&(this.maxLookAhead=n),line},Context.prototype.baseToken=function(n){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=n;)this.baseTokenPos+=2;var type=this.baseTokens[this.baseTokenPos+1];return{type:type&&type.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-n}},Context.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Context.fromSaved=function(doc,saved,line){return saved instanceof SavedContext?new Context(doc,copyState(doc.mode,saved.state),line,saved.lookAhead):new Context(doc,copyState(doc.mode,saved),line)},Context.prototype.save=function(copy){var state=!1!==copy?copyState(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new SavedContext(state,this.maxLookAhead):state};var Token=function(stream,type,state){this.start=stream.start,this.end=stream.pos,this.string=stream.current(),this.type=type||null,this.state=state};function takeToken(cm,pos,precise,asArray){var style,tokens,doc=cm.doc,mode=doc.mode,line=getLine(doc,(pos=clipPos(doc,pos)).line),context=getContextBefore(cm,pos.line,precise),stream=new StringStream(line.text,cm.options.tabSize,context);for(asArray&&(tokens=[]);(asArray||stream.pos<pos.ch)&&!stream.eol();)stream.start=stream.pos,style=readToken(mode,stream,context.state),asArray&&tokens.push(new Token(stream,style,copyState(doc.mode,context.state)));return asArray?tokens:new Token(stream,style,context.state)}function extractLineClasses(type,output){if(type)for(;;){var lineClass=type.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!lineClass)break;type=type.slice(0,lineClass.index)+type.slice(lineClass.index+lineClass[0].length);var prop=lineClass[1]?"bgClass":"textClass";null==output[prop]?output[prop]=lineClass[2]:new RegExp("(?:^|s)"+lineClass[2]+"(?:$|s)").test(output[prop])||(output[prop]+=" "+lineClass[2])}return type}function runMode(cm,text,mode,context,f,lineClasses,forceToEnd){var flattenSpans=mode.flattenSpans;null==flattenSpans&&(flattenSpans=cm.options.flattenSpans);var style,curStart=0,curStyle=null,stream=new StringStream(text,cm.options.tabSize,context),inner=cm.options.addModeClass&&[null];for(""==text&&extractLineClasses(callBlankLine(mode,context.state),lineClasses);!stream.eol();){if(stream.pos>cm.options.maxHighlightLength?(flattenSpans=!1,forceToEnd&&processLine(cm,text,context,stream.pos),stream.pos=text.length,style=null):style=extractLineClasses(readToken(mode,stream,context.state,inner),lineClasses),inner){var mName=inner[0].name;mName&&(style="m-"+(style?mName+" "+style:mName))}if(!flattenSpans||curStyle!=style){for(;curStart<stream.start;)f(curStart=Math.min(stream.start,curStart+5e3),curStyle);curStyle=style}stream.start=stream.pos}for(;curStart<stream.pos;){var pos=Math.min(stream.pos,curStart+5e3);f(pos,curStyle),curStart=pos}}var sawReadOnlySpans=!1,sawCollapsedSpans=!1;function MarkedSpan(marker,from,to){this.marker=marker,this.from=from,this.to=to}function getMarkedSpanFor(spans,marker){if(spans)for(var i=0;i<spans.length;++i){var span=spans[i];if(span.marker==marker)return span}}function removeMarkedSpan(spans,span){for(var r,i=0;i<spans.length;++i)spans[i]!=span&&(r||(r=[])).push(spans[i]);return r}function stretchSpansOverChange(doc,change){if(change.full)return null;var oldFirst=isLine(doc,change.from.line)&&getLine(doc,change.from.line).markedSpans,oldLast=isLine(doc,change.to.line)&&getLine(doc,change.to.line).markedSpans;if(!oldFirst&&!oldLast)return null;var startCh=change.from.ch,endCh=change.to.ch,isInsert=0==cmp(change.from,change.to),first=function(old,startCh,isInsert){var nw;if(old)for(var i=0;i<old.length;++i){var span=old[i],marker=span.marker;if(null==span.from||(marker.inclusiveLeft?span.from<=startCh:span.from<startCh)||span.from==startCh&&"bookmark"==marker.type&&(!isInsert||!span.marker.insertLeft)){var endsAfter=null==span.to||(marker.inclusiveRight?span.to>=startCh:span.to>startCh);(nw||(nw=[])).push(new MarkedSpan(marker,span.from,endsAfter?null:span.to))}}return nw}(oldFirst,startCh,isInsert),last=function(old,endCh,isInsert){var nw;if(old)for(var i=0;i<old.length;++i){var span=old[i],marker=span.marker;if(null==span.to||(marker.inclusiveRight?span.to>=endCh:span.to>endCh)||span.from==endCh&&"bookmark"==marker.type&&(!isInsert||span.marker.insertLeft)){var startsBefore=null==span.from||(marker.inclusiveLeft?span.from<=endCh:span.from<endCh);(nw||(nw=[])).push(new MarkedSpan(marker,startsBefore?null:span.from-endCh,null==span.to?null:span.to-endCh))}}return nw}(oldLast,endCh,isInsert),sameLine=1==change.text.length,offset=lst(change.text).length+(sameLine?startCh:0);if(first)for(var i=0;i<first.length;++i){var span=first[i];if(null==span.to){var found=getMarkedSpanFor(last,span.marker);found?sameLine&&(span.to=null==found.to?null:found.to+offset):span.to=startCh}}if(last)for(var i$1=0;i$1<last.length;++i$1){var span$1=last[i$1];null!=span$1.to&&(span$1.to+=offset),null==span$1.from?getMarkedSpanFor(first,span$1.marker)||(span$1.from=offset,sameLine&&(first||(first=[])).push(span$1)):(span$1.from+=offset,sameLine&&(first||(first=[])).push(span$1))}first&&(first=clearEmptySpans(first)),last&&last!=first&&(last=clearEmptySpans(last));var newMarkers=[first];if(!sameLine){var gapMarkers,gap=change.text.length-2;if(gap>0&&first)for(var i$2=0;i$2<first.length;++i$2)null==first[i$2].to&&(gapMarkers||(gapMarkers=[])).push(new MarkedSpan(first[i$2].marker,null,null));for(var i$3=0;i$3<gap;++i$3)newMarkers.push(gapMarkers);newMarkers.push(last)}return newMarkers}function clearEmptySpans(spans){for(var i=0;i<spans.length;++i){var span=spans[i];null!=span.from&&span.from==span.to&&!1!==span.marker.clearWhenEmpty&&spans.splice(i--,1)}return spans.length?spans:null}function detachMarkedSpans(line){var spans=line.markedSpans;if(spans){for(var i=0;i<spans.length;++i)spans[i].marker.detachLine(line);line.markedSpans=null}}function attachMarkedSpans(line,spans){if(spans){for(var i=0;i<spans.length;++i)spans[i].marker.attachLine(line);line.markedSpans=spans}}function extraLeft(marker){return marker.inclusiveLeft?-1:0}function extraRight(marker){return marker.inclusiveRight?1:0}function compareCollapsedMarkers(a,b){var lenDiff=a.lines.length-b.lines.length;if(0!=lenDiff)return lenDiff;var aPos=a.find(),bPos=b.find(),fromCmp=cmp(aPos.from,bPos.from)||extraLeft(a)-extraLeft(b);if(fromCmp)return-fromCmp;var toCmp=cmp(aPos.to,bPos.to)||extraRight(a)-extraRight(b);return toCmp||b.id-a.id}function collapsedSpanAtSide(line,start){var found,sps=sawCollapsedSpans&&line.markedSpans;if(sps)for(var sp=void 0,i=0;i<sps.length;++i)(sp=sps[i]).marker.collapsed&&null==(start?sp.from:sp.to)&&(!found||compareCollapsedMarkers(found,sp.marker)<0)&&(found=sp.marker);return found}function collapsedSpanAtStart(line){return collapsedSpanAtSide(line,!0)}function collapsedSpanAtEnd(line){return collapsedSpanAtSide(line,!1)}function collapsedSpanAround(line,ch){var found,sps=sawCollapsedSpans&&line.markedSpans;if(sps)for(var i=0;i<sps.length;++i){var sp=sps[i];sp.marker.collapsed&&(null==sp.from||sp.from<ch)&&(null==sp.to||sp.to>ch)&&(!found||compareCollapsedMarkers(found,sp.marker)<0)&&(found=sp.marker)}return found}function conflictingCollapsedRange(doc,lineNo,from,to,marker){var line=getLine(doc,lineNo),sps=sawCollapsedSpans&&line.markedSpans;if(sps)for(var i=0;i<sps.length;++i){var sp=sps[i];if(sp.marker.collapsed){var found=sp.marker.find(0),fromCmp=cmp(found.from,from)||extraLeft(sp.marker)-extraLeft(marker),toCmp=cmp(found.to,to)||extraRight(sp.marker)-extraRight(marker);if(!(fromCmp>=0&&toCmp<=0||fromCmp<=0&&toCmp>=0)&&(fromCmp<=0&&(sp.marker.inclusiveRight&&marker.inclusiveLeft?cmp(found.to,from)>=0:cmp(found.to,from)>0)||fromCmp>=0&&(sp.marker.inclusiveRight&&marker.inclusiveLeft?cmp(found.from,to)<=0:cmp(found.from,to)<0)))return!0}}}function visualLine(line){for(var merged;merged=collapsedSpanAtStart(line);)line=merged.find(-1,!0).line;return line}function visualLineNo(doc,lineN){var line=getLine(doc,lineN),vis=visualLine(line);return line==vis?lineN:lineNo(vis)}function visualLineEndNo(doc,lineN){if(lineN>doc.lastLine())return lineN;var merged,line=getLine(doc,lineN);if(!lineIsHidden(doc,line))return lineN;for(;merged=collapsedSpanAtEnd(line);)line=merged.find(1,!0).line;return lineNo(line)+1}function lineIsHidden(doc,line){var sps=sawCollapsedSpans&&line.markedSpans;if(sps)for(var sp=void 0,i=0;i<sps.length;++i)if((sp=sps[i]).marker.collapsed){if(null==sp.from)return!0;if(!sp.marker.widgetNode&&0==sp.from&&sp.marker.inclusiveLeft&&lineIsHiddenInner(doc,line,sp))return!0}}function lineIsHiddenInner(doc,line,span){if(null==span.to){var end=span.marker.find(1,!0);return lineIsHiddenInner(doc,end.line,getMarkedSpanFor(end.line.markedSpans,span.marker))}if(span.marker.inclusiveRight&&span.to==line.text.length)return!0;for(var sp=void 0,i=0;i<line.markedSpans.length;++i)if((sp=line.markedSpans[i]).marker.collapsed&&!sp.marker.widgetNode&&sp.from==span.to&&(null==sp.to||sp.to!=span.from)&&(sp.marker.inclusiveLeft||span.marker.inclusiveRight)&&lineIsHiddenInner(doc,line,sp))return!0}function heightAtLine(lineObj){for(var h=0,chunk=(lineObj=visualLine(lineObj)).parent,i=0;i<chunk.lines.length;++i){var line=chunk.lines[i];if(line==lineObj)break;h+=line.height}for(var p=chunk.parent;p;p=(chunk=p).parent)for(var i$1=0;i$1<p.children.length;++i$1){var cur=p.children[i$1];if(cur==chunk)break;h+=cur.height}return h}function lineLength(line){if(0==line.height)return 0;for(var merged,len=line.text.length,cur=line;merged=collapsedSpanAtStart(cur);){var found=merged.find(0,!0);cur=found.from.line,len+=found.from.ch-found.to.ch}for(cur=line;merged=collapsedSpanAtEnd(cur);){var found$1=merged.find(0,!0);len-=cur.text.length-found$1.from.ch,len+=(cur=found$1.to.line).text.length-found$1.to.ch}return len}function findMaxLine(cm){var d=cm.display,doc=cm.doc;d.maxLine=getLine(doc,doc.first),d.maxLineLength=lineLength(d.maxLine),d.maxLineChanged=!0,doc.iter((function(line){var len=lineLength(line);len>d.maxLineLength&&(d.maxLineLength=len,d.maxLine=line)}))}var Line=function(text,markedSpans,estimateHeight){this.text=text,attachMarkedSpans(this,markedSpans),this.height=estimateHeight?estimateHeight(this):1};function cleanUpLine(line){line.parent=null,detachMarkedSpans(line)}Line.prototype.lineNo=function(){return lineNo(this)},eventMixin(Line);var styleToClassCache={},styleToClassCacheWithMode={};function interpretTokenStyle(style,options){if(!style||/^\s*$/.test(style))return null;var cache=options.addModeClass?styleToClassCacheWithMode:styleToClassCache;return cache[style]||(cache[style]=style.replace(/\S+/g,"cm-$&"))}function buildLineContent(cm,lineView){var content=eltP("span",null,null,webkit?"padding-right: .1px":null),builder={pre:eltP("pre",[content],"CodeMirror-line"),content:content,col:0,pos:0,cm:cm,trailingSpace:!1,splitSpaces:cm.getOption("lineWrapping")};lineView.measure={};for(var i=0;i<=(lineView.rest?lineView.rest.length:0);i++){var line=i?lineView.rest[i-1]:lineView.line,order=void 0;builder.pos=0,builder.addToken=buildToken,hasBadBidiRects(cm.display.measure)&&(order=getOrder(line,cm.doc.direction))&&(builder.addToken=buildTokenBadBidi(builder.addToken,order)),builder.map=[],insertLineContent(line,builder,getLineStyles(cm,line,lineView!=cm.display.externalMeasured&&lineNo(line))),line.styleClasses&&(line.styleClasses.bgClass&&(builder.bgClass=joinClasses(line.styleClasses.bgClass,builder.bgClass||"")),line.styleClasses.textClass&&(builder.textClass=joinClasses(line.styleClasses.textClass,builder.textClass||""))),0==builder.map.length&&builder.map.push(0,0,builder.content.appendChild(zeroWidthElement(cm.display.measure))),0==i?(lineView.measure.map=builder.map,lineView.measure.cache={}):((lineView.measure.maps||(lineView.measure.maps=[])).push(builder.map),(lineView.measure.caches||(lineView.measure.caches=[])).push({}))}if(webkit){var last=builder.content.lastChild;(/\bcm-tab\b/.test(last.className)||last.querySelector&&last.querySelector(".cm-tab"))&&(builder.content.className="cm-tab-wrap-hack")}return signal(cm,"renderLine",cm,lineView.line,builder.pre),builder.pre.className&&(builder.textClass=joinClasses(builder.pre.className,builder.textClass||"")),builder}function defaultSpecialCharPlaceholder(ch){var token=elt("span","•","cm-invalidchar");return token.title="\\u"+ch.charCodeAt(0).toString(16),token.setAttribute("aria-label",token.title),token}function buildToken(builder,text,style,startStyle,endStyle,css,attributes){if(text){var content,displayText=builder.splitSpaces?function(text,trailingBefore){if(text.length>1&&!/ /.test(text))return text;for(var spaceBefore=trailingBefore,result="",i=0;i<text.length;i++){var ch=text.charAt(i);" "!=ch||!spaceBefore||i!=text.length-1&&32!=text.charCodeAt(i+1)||(ch=" "),result+=ch,spaceBefore=" "==ch}return result}(text,builder.trailingSpace):text,special=builder.cm.state.specialChars,mustWrap=!1;if(special.test(text)){content=document.createDocumentFragment();for(var pos=0;;){special.lastIndex=pos;var m=special.exec(text),skipped=m?m.index-pos:text.length-pos;if(skipped){var txt=document.createTextNode(displayText.slice(pos,pos+skipped));ie&&ie_version<9?content.appendChild(elt("span",[txt])):content.appendChild(txt),builder.map.push(builder.pos,builder.pos+skipped,txt),builder.col+=skipped,builder.pos+=skipped}if(!m)break;pos+=skipped+1;var txt$1=void 0;if("\t"==m[0]){var tabSize=builder.cm.options.tabSize,tabWidth=tabSize-builder.col%tabSize;(txt$1=content.appendChild(elt("span",spaceStr(tabWidth),"cm-tab"))).setAttribute("role","presentation"),txt$1.setAttribute("cm-text","\t"),builder.col+=tabWidth}else"\r"==m[0]||"\n"==m[0]?((txt$1=content.appendChild(elt("span","\r"==m[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",m[0]),builder.col+=1):((txt$1=builder.cm.options.specialCharPlaceholder(m[0])).setAttribute("cm-text",m[0]),ie&&ie_version<9?content.appendChild(elt("span",[txt$1])):content.appendChild(txt$1),builder.col+=1);builder.map.push(builder.pos,builder.pos+1,txt$1),builder.pos++}}else builder.col+=text.length,content=document.createTextNode(displayText),builder.map.push(builder.pos,builder.pos+text.length,content),ie&&ie_version<9&&(mustWrap=!0),builder.pos+=text.length;if(builder.trailingSpace=32==displayText.charCodeAt(text.length-1),style||startStyle||endStyle||mustWrap||css){var fullStyle=style||"";startStyle&&(fullStyle+=startStyle),endStyle&&(fullStyle+=endStyle);var token=elt("span",[content],fullStyle,css);if(attributes)for(var attr in attributes)attributes.hasOwnProperty(attr)&&"style"!=attr&&"class"!=attr&&token.setAttribute(attr,attributes[attr]);return builder.content.appendChild(token)}builder.content.appendChild(content)}}function buildTokenBadBidi(inner,order){return function(builder,text,style,startStyle,endStyle,css,attributes){style=style?style+" cm-force-border":"cm-force-border";for(var start=builder.pos,end=start+text.length;;){for(var part=void 0,i=0;i<order.length&&!((part=order[i]).to>start&&part.from<=start);i++);if(part.to>=end)return inner(builder,text,style,startStyle,endStyle,css,attributes);inner(builder,text.slice(0,part.to-start),style,startStyle,null,css,attributes),startStyle=null,text=text.slice(part.to-start),start=part.to}}}function buildCollapsedSpan(builder,size,marker,ignoreWidget){var widget=!ignoreWidget&&marker.widgetNode;widget&&builder.map.push(builder.pos,builder.pos+size,widget),!ignoreWidget&&builder.cm.display.input.needsContentAttribute&&(widget||(widget=builder.content.appendChild(document.createElement("span"))),widget.setAttribute("cm-marker",marker.id)),widget&&(builder.cm.display.input.setUneditable(widget),builder.content.appendChild(widget)),builder.pos+=size,builder.trailingSpace=!1}function insertLineContent(line,builder,styles){var spans=line.markedSpans,allText=line.text,at=0;if(spans)for(var style,css,spanStyle,spanEndStyle,spanStartStyle,collapsed,attributes,len=allText.length,pos=0,i=1,text="",nextChange=0;;){if(nextChange==pos){spanStyle=spanEndStyle=spanStartStyle=css="",attributes=null,collapsed=null,nextChange=1/0;for(var foundBookmarks=[],endStyles=void 0,j=0;j<spans.length;++j){var sp=spans[j],m=sp.marker;if("bookmark"==m.type&&sp.from==pos&&m.widgetNode)foundBookmarks.push(m);else if(sp.from<=pos&&(null==sp.to||sp.to>pos||m.collapsed&&sp.to==pos&&sp.from==pos)){if(null!=sp.to&&sp.to!=pos&&nextChange>sp.to&&(nextChange=sp.to,spanEndStyle=""),m.className&&(spanStyle+=" "+m.className),m.css&&(css=(css?css+";":"")+m.css),m.startStyle&&sp.from==pos&&(spanStartStyle+=" "+m.startStyle),m.endStyle&&sp.to==nextChange&&(endStyles||(endStyles=[])).push(m.endStyle,sp.to),m.title&&((attributes||(attributes={})).title=m.title),m.attributes)for(var attr in m.attributes)(attributes||(attributes={}))[attr]=m.attributes[attr];m.collapsed&&(!collapsed||compareCollapsedMarkers(collapsed.marker,m)<0)&&(collapsed=sp)}else sp.from>pos&&nextChange>sp.from&&(nextChange=sp.from)}if(endStyles)for(var j$1=0;j$1<endStyles.length;j$1+=2)endStyles[j$1+1]==nextChange&&(spanEndStyle+=" "+endStyles[j$1]);if(!collapsed||collapsed.from==pos)for(var j$2=0;j$2<foundBookmarks.length;++j$2)buildCollapsedSpan(builder,0,foundBookmarks[j$2]);if(collapsed&&(collapsed.from||0)==pos){if(buildCollapsedSpan(builder,(null==collapsed.to?len+1:collapsed.to)-pos,collapsed.marker,null==collapsed.from),null==collapsed.to)return;collapsed.to==pos&&(collapsed=!1)}}if(pos>=len)break;for(var upto=Math.min(len,nextChange);;){if(text){var end=pos+text.length;if(!collapsed){var tokenText=end>upto?text.slice(0,upto-pos):text;builder.addToken(builder,tokenText,style?style+spanStyle:spanStyle,spanStartStyle,pos+tokenText.length==nextChange?spanEndStyle:"",css,attributes)}if(end>=upto){text=text.slice(upto-pos),pos=upto;break}pos=end,spanStartStyle=""}text=allText.slice(at,at=styles[i++]),style=interpretTokenStyle(styles[i++],builder.cm.options)}}else for(var i$1=1;i$1<styles.length;i$1+=2)builder.addToken(builder,allText.slice(at,at=styles[i$1]),interpretTokenStyle(styles[i$1+1],builder.cm.options))}function LineView(doc,line,lineN){this.line=line,this.rest=function(line){for(var merged,lines;merged=collapsedSpanAtEnd(line);)line=merged.find(1,!0).line,(lines||(lines=[])).push(line);return lines}(line),this.size=this.rest?lineNo(lst(this.rest))-lineN+1:1,this.node=this.text=null,this.hidden=lineIsHidden(doc,line)}function buildViewArray(cm,from,to){for(var nextPos,array=[],pos=from;pos<to;pos=nextPos){var view=new LineView(cm.doc,getLine(cm.doc,pos),pos);nextPos=pos+view.size,array.push(view)}return array}var operationGroup=null,orphanDelayedCallbacks=null;function signalLater(emitter,type){var arr=getHandlers(emitter,type);if(arr.length){var list,args=Array.prototype.slice.call(arguments,2);operationGroup?list=operationGroup.delayedCallbacks:orphanDelayedCallbacks?list=orphanDelayedCallbacks:(list=orphanDelayedCallbacks=[],setTimeout(fireOrphanDelayed,0));for(var loop=function(i){list.push((function(){return arr[i].apply(null,args)}))},i=0;i<arr.length;++i)loop(i)}}function fireOrphanDelayed(){var delayed=orphanDelayedCallbacks;orphanDelayedCallbacks=null;for(var i=0;i<delayed.length;++i)delayed[i]()}function updateLineForChanges(cm,lineView,lineN,dims){for(var j=0;j<lineView.changes.length;j++){var type=lineView.changes[j];"text"==type?updateLineText(cm,lineView):"gutter"==type?updateLineGutter(cm,lineView,lineN,dims):"class"==type?updateLineClasses(cm,lineView):"widget"==type&&updateLineWidgets(cm,lineView,dims)}lineView.changes=null}function ensureLineWrapped(lineView){return lineView.node==lineView.text&&(lineView.node=elt("div",null,null,"position: relative"),lineView.text.parentNode&&lineView.text.parentNode.replaceChild(lineView.node,lineView.text),lineView.node.appendChild(lineView.text),ie&&ie_version<8&&(lineView.node.style.zIndex=2)),lineView.node}function getLineContent(cm,lineView){var ext=cm.display.externalMeasured;return ext&&ext.line==lineView.line?(cm.display.externalMeasured=null,lineView.measure=ext.measure,ext.built):buildLineContent(cm,lineView)}function updateLineText(cm,lineView){var cls=lineView.text.className,built=getLineContent(cm,lineView);lineView.text==lineView.node&&(lineView.node=built.pre),lineView.text.parentNode.replaceChild(built.pre,lineView.text),lineView.text=built.pre,built.bgClass!=lineView.bgClass||built.textClass!=lineView.textClass?(lineView.bgClass=built.bgClass,lineView.textClass=built.textClass,updateLineClasses(cm,lineView)):cls&&(lineView.text.className=cls)}function updateLineClasses(cm,lineView){!function(cm,lineView){var cls=lineView.bgClass?lineView.bgClass+" "+(lineView.line.bgClass||""):lineView.line.bgClass;if(cls&&(cls+=" CodeMirror-linebackground"),lineView.background)cls?lineView.background.className=cls:(lineView.background.parentNode.removeChild(lineView.background),lineView.background=null);else if(cls){var wrap=ensureLineWrapped(lineView);lineView.background=wrap.insertBefore(elt("div",null,cls),wrap.firstChild),cm.display.input.setUneditable(lineView.background)}}(cm,lineView),lineView.line.wrapClass?ensureLineWrapped(lineView).className=lineView.line.wrapClass:lineView.node!=lineView.text&&(lineView.node.className="");var textClass=lineView.textClass?lineView.textClass+" "+(lineView.line.textClass||""):lineView.line.textClass;lineView.text.className=textClass||""}function updateLineGutter(cm,lineView,lineN,dims){if(lineView.gutter&&(lineView.node.removeChild(lineView.gutter),lineView.gutter=null),lineView.gutterBackground&&(lineView.node.removeChild(lineView.gutterBackground),lineView.gutterBackground=null),lineView.line.gutterClass){var wrap=ensureLineWrapped(lineView);lineView.gutterBackground=elt("div",null,"CodeMirror-gutter-background "+lineView.line.gutterClass,"left: "+(cm.options.fixedGutter?dims.fixedPos:-dims.gutterTotalWidth)+"px; width: "+dims.gutterTotalWidth+"px"),cm.display.input.setUneditable(lineView.gutterBackground),wrap.insertBefore(lineView.gutterBackground,lineView.text)}var markers=lineView.line.gutterMarkers;if(cm.options.lineNumbers||markers){var wrap$1=ensureLineWrapped(lineView),gutterWrap=lineView.gutter=elt("div",null,"CodeMirror-gutter-wrapper","left: "+(cm.options.fixedGutter?dims.fixedPos:-dims.gutterTotalWidth)+"px");if(cm.display.input.setUneditable(gutterWrap),wrap$1.insertBefore(gutterWrap,lineView.text),lineView.line.gutterClass&&(gutterWrap.className+=" "+lineView.line.gutterClass),!cm.options.lineNumbers||markers&&markers["CodeMirror-linenumbers"]||(lineView.lineNumber=gutterWrap.appendChild(elt("div",lineNumberFor(cm.options,lineN),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+dims.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+cm.display.lineNumInnerWidth+"px"))),markers)for(var k=0;k<cm.display.gutterSpecs.length;++k){var id=cm.display.gutterSpecs[k].className,found=markers.hasOwnProperty(id)&&markers[id];found&&gutterWrap.appendChild(elt("div",[found],"CodeMirror-gutter-elt","left: "+dims.gutterLeft[id]+"px; width: "+dims.gutterWidth[id]+"px"))}}}function updateLineWidgets(cm,lineView,dims){lineView.alignable&&(lineView.alignable=null);for(var isWidget=classTest("CodeMirror-linewidget"),node=lineView.node.firstChild,next=void 0;node;node=next)next=node.nextSibling,isWidget.test(node.className)&&lineView.node.removeChild(node);insertLineWidgets(cm,lineView,dims)}function buildLineElement(cm,lineView,lineN,dims){var built=getLineContent(cm,lineView);return lineView.text=lineView.node=built.pre,built.bgClass&&(lineView.bgClass=built.bgClass),built.textClass&&(lineView.textClass=built.textClass),updateLineClasses(cm,lineView),updateLineGutter(cm,lineView,lineN,dims),insertLineWidgets(cm,lineView,dims),lineView.node}function insertLineWidgets(cm,lineView,dims){if(insertLineWidgetsFor(cm,lineView.line,lineView,dims,!0),lineView.rest)for(var i=0;i<lineView.rest.length;i++)insertLineWidgetsFor(cm,lineView.rest[i],lineView,dims,!1)}function insertLineWidgetsFor(cm,line,lineView,dims,allowAbove){if(line.widgets)for(var wrap=ensureLineWrapped(lineView),i=0,ws=line.widgets;i<ws.length;++i){var widget=ws[i],node=elt("div",[widget.node],"CodeMirror-linewidget"+(widget.className?" "+widget.className:""));widget.handleMouseEvents||node.setAttribute("cm-ignore-events","true"),positionLineWidget(widget,node,lineView,dims),cm.display.input.setUneditable(node),allowAbove&&widget.above?wrap.insertBefore(node,lineView.gutter||lineView.text):wrap.appendChild(node),signalLater(widget,"redraw")}}function positionLineWidget(widget,node,lineView,dims){if(widget.noHScroll){(lineView.alignable||(lineView.alignable=[])).push(node);var width=dims.wrapperWidth;node.style.left=dims.fixedPos+"px",widget.coverGutter||(width-=dims.gutterTotalWidth,node.style.paddingLeft=dims.gutterTotalWidth+"px"),node.style.width=width+"px"}widget.coverGutter&&(node.style.zIndex=5,node.style.position="relative",widget.noHScroll||(node.style.marginLeft=-dims.gutterTotalWidth+"px"))}function widgetHeight(widget){if(null!=widget.height)return widget.height;var cm=widget.doc.cm;if(!cm)return 0;if(!contains(document.body,widget.node)){var parentStyle="position: relative;";widget.coverGutter&&(parentStyle+="margin-left: -"+cm.display.gutters.offsetWidth+"px;"),widget.noHScroll&&(parentStyle+="width: "+cm.display.wrapper.clientWidth+"px;"),removeChildrenAndAdd(cm.display.measure,elt("div",[widget.node],null,parentStyle))}return widget.height=widget.node.parentNode.offsetHeight}function eventInWidget(display,e){for(var n=e_target(e);n!=display.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==display.sizer&&n!=display.mover)return!0}function paddingTop(display){return display.lineSpace.offsetTop}function paddingVert(display){return display.mover.offsetHeight-display.lineSpace.offsetHeight}function paddingH(display){if(display.cachedPaddingH)return display.cachedPaddingH;var e=removeChildrenAndAdd(display.measure,elt("pre","x","CodeMirror-line-like")),style=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,data={left:parseInt(style.paddingLeft),right:parseInt(style.paddingRight)};return isNaN(data.left)||isNaN(data.right)||(display.cachedPaddingH=data),data}function scrollGap(cm){return scrollerGap-cm.display.nativeBarWidth}function displayWidth(cm){return cm.display.scroller.clientWidth-scrollGap(cm)-cm.display.barWidth}function displayHeight(cm){return cm.display.scroller.clientHeight-scrollGap(cm)-cm.display.barHeight}function mapFromLineView(lineView,line,lineN){if(lineView.line==line)return{map:lineView.measure.map,cache:lineView.measure.cache};for(var i=0;i<lineView.rest.length;i++)if(lineView.rest[i]==line)return{map:lineView.measure.maps[i],cache:lineView.measure.caches[i]};for(var i$1=0;i$1<lineView.rest.length;i$1++)if(lineNo(lineView.rest[i$1])>lineN)return{map:lineView.measure.maps[i$1],cache:lineView.measure.caches[i$1],before:!0}}function measureChar(cm,line,ch,bias){return measureCharPrepared(cm,prepareMeasureForLine(cm,line),ch,bias)}function findViewForLine(cm,lineN){if(lineN>=cm.display.viewFrom&&lineN<cm.display.viewTo)return cm.display.view[findViewIndex(cm,lineN)];var ext=cm.display.externalMeasured;return ext&&lineN>=ext.lineN&&lineN<ext.lineN+ext.size?ext:void 0}function prepareMeasureForLine(cm,line){var lineN=lineNo(line),view=findViewForLine(cm,lineN);view&&!view.text?view=null:view&&view.changes&&(updateLineForChanges(cm,view,lineN,getDimensions(cm)),cm.curOp.forceUpdate=!0),view||(view=function(cm,line){var lineN=lineNo(line=visualLine(line)),view=cm.display.externalMeasured=new LineView(cm.doc,line,lineN);view.lineN=lineN;var built=view.built=buildLineContent(cm,view);return view.text=built.pre,removeChildrenAndAdd(cm.display.lineMeasure,built.pre),view}(cm,line));var info=mapFromLineView(view,line,lineN);return{line:line,view:view,rect:null,map:info.map,cache:info.cache,before:info.before,hasHeights:!1}}function measureCharPrepared(cm,prepared,ch,bias,varHeight){prepared.before&&(ch=-1);var found,key=ch+(bias||"");return prepared.cache.hasOwnProperty(key)?found=prepared.cache[key]:(prepared.rect||(prepared.rect=prepared.view.text.getBoundingClientRect()),prepared.hasHeights||(function(cm,lineView,rect){var wrapping=cm.options.lineWrapping,curWidth=wrapping&&displayWidth(cm);if(!lineView.measure.heights||wrapping&&lineView.measure.width!=curWidth){var heights=lineView.measure.heights=[];if(wrapping){lineView.measure.width=curWidth;for(var rects=lineView.text.firstChild.getClientRects(),i=0;i<rects.length-1;i++){var cur=rects[i],next=rects[i+1];Math.abs(cur.bottom-next.bottom)>2&&heights.push((cur.bottom+next.top)/2-rect.top)}}heights.push(rect.bottom-rect.top)}}(cm,prepared.view,prepared.rect),prepared.hasHeights=!0),(found=function(cm,prepared,ch,bias){var rect,place=nodeAndOffsetInLineMap(prepared.map,ch,bias),node=place.node,start=place.start,end=place.end,collapse=place.collapse;if(3==node.nodeType){for(var i$1=0;i$1<4;i$1++){for(;start&&isExtendingChar(prepared.line.text.charAt(place.coverStart+start));)--start;for(;place.coverStart+end<place.coverEnd&&isExtendingChar(prepared.line.text.charAt(place.coverStart+end));)++end;if((rect=ie&&ie_version<9&&0==start&&end==place.coverEnd-place.coverStart?node.parentNode.getBoundingClientRect():getUsefulRect(range(node,start,end).getClientRects(),bias)).left||rect.right||0==start)break;end=start,start-=1,collapse="right"}ie&&ie_version<11&&(rect=function(measure,rect){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(measure){if(null!=badZoomedRects)return badZoomedRects;var node=removeChildrenAndAdd(measure,elt("span","x")),normal=node.getBoundingClientRect(),fromRange=range(node,0,1).getBoundingClientRect();return badZoomedRects=Math.abs(normal.left-fromRange.left)>1}(measure))return rect;var scaleX=screen.logicalXDPI/screen.deviceXDPI,scaleY=screen.logicalYDPI/screen.deviceYDPI;return{left:rect.left*scaleX,right:rect.right*scaleX,top:rect.top*scaleY,bottom:rect.bottom*scaleY}}(cm.display.measure,rect))}else{var rects;start>0&&(collapse=bias="right"),rect=cm.options.lineWrapping&&(rects=node.getClientRects()).length>1?rects["right"==bias?rects.length-1:0]:node.getBoundingClientRect()}if(ie&&ie_version<9&&!start&&(!rect||!rect.left&&!rect.right)){var rSpan=node.parentNode.getClientRects()[0];rect=rSpan?{left:rSpan.left,right:rSpan.left+charWidth(cm.display),top:rSpan.top,bottom:rSpan.bottom}:nullRect}for(var rtop=rect.top-prepared.rect.top,rbot=rect.bottom-prepared.rect.top,mid=(rtop+rbot)/2,heights=prepared.view.measure.heights,i=0;i<heights.length-1&&!(mid<heights[i]);i++);var top=i?heights[i-1]:0,bot=heights[i],result={left:("right"==collapse?rect.right:rect.left)-prepared.rect.left,right:("left"==collapse?rect.left:rect.right)-prepared.rect.left,top:top,bottom:bot};return rect.left||rect.right||(result.bogus=!0),cm.options.singleCursorHeightPerLine||(result.rtop=rtop,result.rbottom=rbot),result}(cm,prepared,ch,bias)).bogus||(prepared.cache[key]=found)),{left:found.left,right:found.right,top:varHeight?found.rtop:found.top,bottom:varHeight?found.rbottom:found.bottom}}var measureText,nullRect={left:0,right:0,top:0,bottom:0};function nodeAndOffsetInLineMap(map,ch,bias){for(var node,start,end,collapse,mStart,mEnd,i=0;i<map.length;i+=3)if(mStart=map[i],mEnd=map[i+1],ch<mStart?(start=0,end=1,collapse="left"):ch<mEnd?end=1+(start=ch-mStart):(i==map.length-3||ch==mEnd&&map[i+3]>ch)&&(start=(end=mEnd-mStart)-1,ch>=mEnd&&(collapse="right")),null!=start){if(node=map[i+2],mStart==mEnd&&bias==(node.insertLeft?"left":"right")&&(collapse=bias),"left"==bias&&0==start)for(;i&&map[i-2]==map[i-3]&&map[i-1].insertLeft;)node=map[2+(i-=3)],collapse="left";if("right"==bias&&start==mEnd-mStart)for(;i<map.length-3&&map[i+3]==map[i+4]&&!map[i+5].insertLeft;)node=map[(i+=3)+2],collapse="right";break}return{node:node,start:start,end:end,collapse:collapse,coverStart:mStart,coverEnd:mEnd}}function getUsefulRect(rects,bias){var rect=nullRect;if("left"==bias)for(var i=0;i<rects.length&&(rect=rects[i]).left==rect.right;i++);else for(var i$1=rects.length-1;i$1>=0&&(rect=rects[i$1]).left==rect.right;i$1--);return rect}function clearLineMeasurementCacheFor(lineView){if(lineView.measure&&(lineView.measure.cache={},lineView.measure.heights=null,lineView.rest))for(var i=0;i<lineView.rest.length;i++)lineView.measure.caches[i]={}}function clearLineMeasurementCache(cm){cm.display.externalMeasure=null,removeChildren(cm.display.lineMeasure);for(var i=0;i<cm.display.view.length;i++)clearLineMeasurementCacheFor(cm.display.view[i])}function clearCaches(cm){clearLineMeasurementCache(cm),cm.display.cachedCharWidth=cm.display.cachedTextHeight=cm.display.cachedPaddingH=null,cm.options.lineWrapping||(cm.display.maxLineChanged=!0),cm.display.lineNumChars=null}function pageScrollX(){return chrome&&android?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function pageScrollY(){return chrome&&android?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function widgetTopHeight(lineObj){var height=0;if(lineObj.widgets)for(var i=0;i<lineObj.widgets.length;++i)lineObj.widgets[i].above&&(height+=widgetHeight(lineObj.widgets[i]));return height}function intoCoordSystem(cm,lineObj,rect,context,includeWidgets){if(!includeWidgets){var height=widgetTopHeight(lineObj);rect.top+=height,rect.bottom+=height}if("line"==context)return rect;context||(context="local");var yOff=heightAtLine(lineObj);if("local"==context?yOff+=paddingTop(cm.display):yOff-=cm.display.viewOffset,"page"==context||"window"==context){var lOff=cm.display.lineSpace.getBoundingClientRect();yOff+=lOff.top+("window"==context?0:pageScrollY());var xOff=lOff.left+("window"==context?0:pageScrollX());rect.left+=xOff,rect.right+=xOff}return rect.top+=yOff,rect.bottom+=yOff,rect}function fromCoordSystem(cm,coords,context){if("div"==context)return coords;var left=coords.left,top=coords.top;if("page"==context)left-=pageScrollX(),top-=pageScrollY();else if("local"==context||!context){var localBox=cm.display.sizer.getBoundingClientRect();left+=localBox.left,top+=localBox.top}var lineSpaceBox=cm.display.lineSpace.getBoundingClientRect();return{left:left-lineSpaceBox.left,top:top-lineSpaceBox.top}}function charCoords(cm,pos,context,lineObj,bias){return lineObj||(lineObj=getLine(cm.doc,pos.line)),intoCoordSystem(cm,lineObj,measureChar(cm,lineObj,pos.ch,bias),context)}function cursorCoords(cm,pos,context,lineObj,preparedMeasure,varHeight){function get(ch,right){var m=measureCharPrepared(cm,preparedMeasure,ch,right?"right":"left",varHeight);return right?m.left=m.right:m.right=m.left,intoCoordSystem(cm,lineObj,m,context)}lineObj=lineObj||getLine(cm.doc,pos.line),preparedMeasure||(preparedMeasure=prepareMeasureForLine(cm,lineObj));var order=getOrder(lineObj,cm.doc.direction),ch=pos.ch,sticky=pos.sticky;if(ch>=lineObj.text.length?(ch=lineObj.text.length,sticky="before"):ch<=0&&(ch=0,sticky="after"),!order)return get("before"==sticky?ch-1:ch,"before"==sticky);function getBidi(ch,partPos,invert){return get(invert?ch-1:ch,1==order[partPos].level!=invert)}var partPos=getBidiPartAt(order,ch,sticky),other=bidiOther,val=getBidi(ch,partPos,"before"==sticky);return null!=other&&(val.other=getBidi(ch,other,"before"!=sticky)),val}function estimateCoords(cm,pos){var left=0;pos=clipPos(cm.doc,pos),cm.options.lineWrapping||(left=charWidth(cm.display)*pos.ch);var lineObj=getLine(cm.doc,pos.line),top=heightAtLine(lineObj)+paddingTop(cm.display);return{left:left,right:left,top:top,bottom:top+lineObj.height}}function PosWithInfo(line,ch,sticky,outside,xRel){var pos=Pos(line,ch,sticky);return pos.xRel=xRel,outside&&(pos.outside=outside),pos}function coordsChar(cm,x,y){var doc=cm.doc;if((y+=cm.display.viewOffset)<0)return PosWithInfo(doc.first,0,null,-1,-1);var lineN=lineAtHeight(doc,y),last=doc.first+doc.size-1;if(lineN>last)return PosWithInfo(doc.first+doc.size-1,getLine(doc,last).text.length,null,1,1);x<0&&(x=0);for(var lineObj=getLine(doc,lineN);;){var found=coordsCharInner(cm,lineObj,lineN,x,y),collapsed=collapsedSpanAround(lineObj,found.ch+(found.xRel>0||found.outside>0?1:0));if(!collapsed)return found;var rangeEnd=collapsed.find(1);if(rangeEnd.line==lineN)return rangeEnd;lineObj=getLine(doc,lineN=rangeEnd.line)}}function wrappedLineExtent(cm,lineObj,preparedMeasure,y){y-=widgetTopHeight(lineObj);var end=lineObj.text.length,begin=findFirst((function(ch){return measureCharPrepared(cm,preparedMeasure,ch-1).bottom<=y}),end,0);return{begin:begin,end:end=findFirst((function(ch){return measureCharPrepared(cm,preparedMeasure,ch).top>y}),begin,end)}}function wrappedLineExtentChar(cm,lineObj,preparedMeasure,target){return preparedMeasure||(preparedMeasure=prepareMeasureForLine(cm,lineObj)),wrappedLineExtent(cm,lineObj,preparedMeasure,intoCoordSystem(cm,lineObj,measureCharPrepared(cm,preparedMeasure,target),"line").top)}function boxIsAfter(box,x,y,left){return!(box.bottom<=y)&&(box.top>y||(left?box.left:box.right)>x)}function coordsCharInner(cm,lineObj,lineNo,x,y){y-=heightAtLine(lineObj);var preparedMeasure=prepareMeasureForLine(cm,lineObj),widgetHeight=widgetTopHeight(lineObj),begin=0,end=lineObj.text.length,ltr=!0,order=getOrder(lineObj,cm.doc.direction);if(order){var part=(cm.options.lineWrapping?coordsBidiPartWrapped:coordsBidiPart)(cm,lineObj,lineNo,preparedMeasure,order,x,y);begin=(ltr=1!=part.level)?part.from:part.to-1,end=ltr?part.to:part.from-1}var baseX,sticky,chAround=null,boxAround=null,ch=findFirst((function(ch){var box=measureCharPrepared(cm,preparedMeasure,ch);return box.top+=widgetHeight,box.bottom+=widgetHeight,!!boxIsAfter(box,x,y,!1)&&(box.top<=y&&box.left<=x&&(chAround=ch,boxAround=box),!0)}),begin,end),outside=!1;if(boxAround){var atLeft=x-boxAround.left<boxAround.right-x,atStart=atLeft==ltr;ch=chAround+(atStart?0:1),sticky=atStart?"after":"before",baseX=atLeft?boxAround.left:boxAround.right}else{ltr||ch!=end&&ch!=begin||ch++,sticky=0==ch?"after":ch==lineObj.text.length?"before":measureCharPrepared(cm,preparedMeasure,ch-(ltr?1:0)).bottom+widgetHeight<=y==ltr?"after":"before";var coords=cursorCoords(cm,Pos(lineNo,ch,sticky),"line",lineObj,preparedMeasure);baseX=coords.left,outside=y<coords.top?-1:y>=coords.bottom?1:0}return PosWithInfo(lineNo,ch=skipExtendingChars(lineObj.text,ch,1),sticky,outside,x-baseX)}function coordsBidiPart(cm,lineObj,lineNo,preparedMeasure,order,x,y){var index=findFirst((function(i){var part=order[i],ltr=1!=part.level;return boxIsAfter(cursorCoords(cm,Pos(lineNo,ltr?part.to:part.from,ltr?"before":"after"),"line",lineObj,preparedMeasure),x,y,!0)}),0,order.length-1),part=order[index];if(index>0){var ltr=1!=part.level,start=cursorCoords(cm,Pos(lineNo,ltr?part.from:part.to,ltr?"after":"before"),"line",lineObj,preparedMeasure);boxIsAfter(start,x,y,!0)&&start.top>y&&(part=order[index-1])}return part}function coordsBidiPartWrapped(cm,lineObj,_lineNo,preparedMeasure,order,x,y){var ref=wrappedLineExtent(cm,lineObj,preparedMeasure,y),begin=ref.begin,end=ref.end;/\s/.test(lineObj.text.charAt(end-1))&&end--;for(var part=null,closestDist=null,i=0;i<order.length;i++){var p=order[i];if(!(p.from>=end||p.to<=begin)){var endX=measureCharPrepared(cm,preparedMeasure,1!=p.level?Math.min(end,p.to)-1:Math.max(begin,p.from)).right,dist=endX<x?x-endX+1e9:endX-x;(!part||closestDist>dist)&&(part=p,closestDist=dist)}}return part||(part=order[order.length-1]),part.from<begin&&(part={from:begin,to:part.to,level:part.level}),part.to>end&&(part={from:part.from,to:end,level:part.level}),part}function textHeight(display){if(null!=display.cachedTextHeight)return display.cachedTextHeight;if(null==measureText){measureText=elt("pre",null,"CodeMirror-line-like");for(var i=0;i<49;++i)measureText.appendChild(document.createTextNode("x")),measureText.appendChild(elt("br"));measureText.appendChild(document.createTextNode("x"))}removeChildrenAndAdd(display.measure,measureText);var height=measureText.offsetHeight/50;return height>3&&(display.cachedTextHeight=height),removeChildren(display.measure),height||1}function charWidth(display){if(null!=display.cachedCharWidth)return display.cachedCharWidth;var anchor=elt("span","xxxxxxxxxx"),pre=elt("pre",[anchor],"CodeMirror-line-like");removeChildrenAndAdd(display.measure,pre);var rect=anchor.getBoundingClientRect(),width=(rect.right-rect.left)/10;return width>2&&(display.cachedCharWidth=width),width||10}function getDimensions(cm){for(var d=cm.display,left={},width={},gutterLeft=d.gutters.clientLeft,n=d.gutters.firstChild,i=0;n;n=n.nextSibling,++i){var id=cm.display.gutterSpecs[i].className;left[id]=n.offsetLeft+n.clientLeft+gutterLeft,width[id]=n.clientWidth}return{fixedPos:compensateForHScroll(d),gutterTotalWidth:d.gutters.offsetWidth,gutterLeft:left,gutterWidth:width,wrapperWidth:d.wrapper.clientWidth}}function compensateForHScroll(display){return display.scroller.getBoundingClientRect().left-display.sizer.getBoundingClientRect().left}function estimateHeight(cm){var th=textHeight(cm.display),wrapping=cm.options.lineWrapping,perLine=wrapping&&Math.max(5,cm.display.scroller.clientWidth/charWidth(cm.display)-3);return function(line){if(lineIsHidden(cm.doc,line))return 0;var widgetsHeight=0;if(line.widgets)for(var i=0;i<line.widgets.length;i++)line.widgets[i].height&&(widgetsHeight+=line.widgets[i].height);return wrapping?widgetsHeight+(Math.ceil(line.text.length/perLine)||1)*th:widgetsHeight+th}}function estimateLineHeights(cm){var doc=cm.doc,est=estimateHeight(cm);doc.iter((function(line){var estHeight=est(line);estHeight!=line.height&&updateLineHeight(line,estHeight)}))}function posFromMouse(cm,e,liberal,forRect){var display=cm.display;if(!liberal&&"true"==e_target(e).getAttribute("cm-not-content"))return null;var x,y,space=display.lineSpace.getBoundingClientRect();try{x=e.clientX-space.left,y=e.clientY-space.top}catch(e){return null}var line,coords=coordsChar(cm,x,y);if(forRect&&coords.xRel>0&&(line=getLine(cm.doc,coords.line).text).length==coords.ch){var colDiff=countColumn(line,line.length,cm.options.tabSize)-line.length;coords=Pos(coords.line,Math.max(0,Math.round((x-paddingH(cm.display).left)/charWidth(cm.display))-colDiff))}return coords}function findViewIndex(cm,n){if(n>=cm.display.viewTo)return null;if((n-=cm.display.viewFrom)<0)return null;for(var view=cm.display.view,i=0;i<view.length;i++)if((n-=view[i].size)<0)return i}function regChange(cm,from,to,lendiff){null==from&&(from=cm.doc.first),null==to&&(to=cm.doc.first+cm.doc.size),lendiff||(lendiff=0);var display=cm.display;if(lendiff&&to<display.viewTo&&(null==display.updateLineNumbers||display.updateLineNumbers>from)&&(display.updateLineNumbers=from),cm.curOp.viewChanged=!0,from>=display.viewTo)sawCollapsedSpans&&visualLineNo(cm.doc,from)<display.viewTo&&resetView(cm);else if(to<=display.viewFrom)sawCollapsedSpans&&visualLineEndNo(cm.doc,to+lendiff)>display.viewFrom?resetView(cm):(display.viewFrom+=lendiff,display.viewTo+=lendiff);else if(from<=display.viewFrom&&to>=display.viewTo)resetView(cm);else if(from<=display.viewFrom){var cut=viewCuttingPoint(cm,to,to+lendiff,1);cut?(display.view=display.view.slice(cut.index),display.viewFrom=cut.lineN,display.viewTo+=lendiff):resetView(cm)}else if(to>=display.viewTo){var cut$1=viewCuttingPoint(cm,from,from,-1);cut$1?(display.view=display.view.slice(0,cut$1.index),display.viewTo=cut$1.lineN):resetView(cm)}else{var cutTop=viewCuttingPoint(cm,from,from,-1),cutBot=viewCuttingPoint(cm,to,to+lendiff,1);cutTop&&cutBot?(display.view=display.view.slice(0,cutTop.index).concat(buildViewArray(cm,cutTop.lineN,cutBot.lineN)).concat(display.view.slice(cutBot.index)),display.viewTo+=lendiff):resetView(cm)}var ext=display.externalMeasured;ext&&(to<ext.lineN?ext.lineN+=lendiff:from<ext.lineN+ext.size&&(display.externalMeasured=null))}function regLineChange(cm,line,type){cm.curOp.viewChanged=!0;var display=cm.display,ext=cm.display.externalMeasured;if(ext&&line>=ext.lineN&&line<ext.lineN+ext.size&&(display.externalMeasured=null),!(line<display.viewFrom||line>=display.viewTo)){var lineView=display.view[findViewIndex(cm,line)];if(null!=lineView.node){var arr=lineView.changes||(lineView.changes=[]);-1==indexOf(arr,type)&&arr.push(type)}}}function resetView(cm){cm.display.viewFrom=cm.display.viewTo=cm.doc.first,cm.display.view=[],cm.display.viewOffset=0}function viewCuttingPoint(cm,oldN,newN,dir){var diff,index=findViewIndex(cm,oldN),view=cm.display.view;if(!sawCollapsedSpans||newN==cm.doc.first+cm.doc.size)return{index:index,lineN:newN};for(var n=cm.display.viewFrom,i=0;i<index;i++)n+=view[i].size;if(n!=oldN){if(dir>0){if(index==view.length-1)return null;diff=n+view[index].size-oldN,index++}else diff=n-oldN;oldN+=diff,newN+=diff}for(;visualLineNo(cm.doc,newN)!=newN;){if(index==(dir<0?0:view.length-1))return null;newN+=dir*view[index-(dir<0?1:0)].size,index+=dir}return{index:index,lineN:newN}}function countDirtyView(cm){for(var view=cm.display.view,dirty=0,i=0;i<view.length;i++){var lineView=view[i];lineView.hidden||lineView.node&&!lineView.changes||++dirty}return dirty}function updateSelection(cm){cm.display.input.showSelection(cm.display.input.prepareSelection())}function prepareSelection(cm,primary){void 0===primary&&(primary=!0);for(var doc=cm.doc,result={},curFragment=result.cursors=document.createDocumentFragment(),selFragment=result.selection=document.createDocumentFragment(),i=0;i<doc.sel.ranges.length;i++)if(primary||i!=doc.sel.primIndex){var range=doc.sel.ranges[i];if(!(range.from().line>=cm.display.viewTo||range.to().line<cm.display.viewFrom)){var collapsed=range.empty();(collapsed||cm.options.showCursorWhenSelecting)&&drawSelectionCursor(cm,range.head,curFragment),collapsed||drawSelectionRange(cm,range,selFragment)}}return result}function drawSelectionCursor(cm,head,output){var pos=cursorCoords(cm,head,"div",null,null,!cm.options.singleCursorHeightPerLine),cursor=output.appendChild(elt("div"," ","CodeMirror-cursor"));if(cursor.style.left=pos.left+"px",cursor.style.top=pos.top+"px",cursor.style.height=Math.max(0,pos.bottom-pos.top)*cm.options.cursorHeight+"px",pos.other){var otherCursor=output.appendChild(elt("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));otherCursor.style.display="",otherCursor.style.left=pos.other.left+"px",otherCursor.style.top=pos.other.top+"px",otherCursor.style.height=.85*(pos.other.bottom-pos.other.top)+"px"}}function cmpCoords(a,b){return a.top-b.top||a.left-b.left}function drawSelectionRange(cm,range,output){var display=cm.display,doc=cm.doc,fragment=document.createDocumentFragment(),padding=paddingH(cm.display),leftSide=padding.left,rightSide=Math.max(display.sizerWidth,displayWidth(cm)-display.sizer.offsetLeft)-padding.right,docLTR="ltr"==doc.direction;function add(left,top,width,bottom){top<0&&(top=0),top=Math.round(top),bottom=Math.round(bottom),fragment.appendChild(elt("div",null,"CodeMirror-selected","position: absolute; left: "+left+"px;\n top: "+top+"px; width: "+(null==width?rightSide-left:width)+"px;\n height: "+(bottom-top)+"px"))}function drawForLine(line,fromArg,toArg){var start,end,lineObj=getLine(doc,line),lineLen=lineObj.text.length;function coords(ch,bias){return charCoords(cm,Pos(line,ch),"div",lineObj,bias)}function wrapX(pos,dir,side){var extent=wrappedLineExtentChar(cm,lineObj,null,pos),prop="ltr"==dir==("after"==side)?"left":"right";return coords("after"==side?extent.begin:extent.end-(/\s/.test(lineObj.text.charAt(extent.end-1))?2:1),prop)[prop]}var order=getOrder(lineObj,doc.direction);return function(order,from,to,f){if(!order)return f(from,to,"ltr",0);for(var found=!1,i=0;i<order.length;++i){var part=order[i];(part.from<to&&part.to>from||from==to&&part.to==from)&&(f(Math.max(part.from,from),Math.min(part.to,to),1==part.level?"rtl":"ltr",i),found=!0)}found||f(from,to,"ltr")}(order,fromArg||0,null==toArg?lineLen:toArg,(function(from,to,dir,i){var ltr="ltr"==dir,fromPos=coords(from,ltr?"left":"right"),toPos=coords(to-1,ltr?"right":"left"),openStart=null==fromArg&&0==from,openEnd=null==toArg&&to==lineLen,first=0==i,last=!order||i==order.length-1;if(toPos.top-fromPos.top<=3){var openRight=(docLTR?openEnd:openStart)&&last,left=(docLTR?openStart:openEnd)&&first?leftSide:(ltr?fromPos:toPos).left,right=openRight?rightSide:(ltr?toPos:fromPos).right;add(left,fromPos.top,right-left,fromPos.bottom)}else{var topLeft,topRight,botLeft,botRight;ltr?(topLeft=docLTR&&openStart&&first?leftSide:fromPos.left,topRight=docLTR?rightSide:wrapX(from,dir,"before"),botLeft=docLTR?leftSide:wrapX(to,dir,"after"),botRight=docLTR&&openEnd&&last?rightSide:toPos.right):(topLeft=docLTR?wrapX(from,dir,"before"):leftSide,topRight=!docLTR&&openStart&&first?rightSide:fromPos.right,botLeft=!docLTR&&openEnd&&last?leftSide:toPos.left,botRight=docLTR?wrapX(to,dir,"after"):rightSide),add(topLeft,fromPos.top,topRight-topLeft,fromPos.bottom),fromPos.bottom<toPos.top&&add(leftSide,fromPos.bottom,null,toPos.top),add(botLeft,toPos.top,botRight-botLeft,toPos.bottom)}(!start||cmpCoords(fromPos,start)<0)&&(start=fromPos),cmpCoords(toPos,start)<0&&(start=toPos),(!end||cmpCoords(fromPos,end)<0)&&(end=fromPos),cmpCoords(toPos,end)<0&&(end=toPos)})),{start:start,end:end}}var sFrom=range.from(),sTo=range.to();if(sFrom.line==sTo.line)drawForLine(sFrom.line,sFrom.ch,sTo.ch);else{var fromLine=getLine(doc,sFrom.line),toLine=getLine(doc,sTo.line),singleVLine=visualLine(fromLine)==visualLine(toLine),leftEnd=drawForLine(sFrom.line,sFrom.ch,singleVLine?fromLine.text.length+1:null).end,rightStart=drawForLine(sTo.line,singleVLine?0:null,sTo.ch).start;singleVLine&&(leftEnd.top<rightStart.top-2?(add(leftEnd.right,leftEnd.top,null,leftEnd.bottom),add(leftSide,rightStart.top,rightStart.left,rightStart.bottom)):add(leftEnd.right,leftEnd.top,rightStart.left-leftEnd.right,leftEnd.bottom)),leftEnd.bottom<rightStart.top&&add(leftSide,leftEnd.bottom,null,rightStart.top)}output.appendChild(fragment)}function restartBlink(cm){if(cm.state.focused){var display=cm.display;clearInterval(display.blinker);var on=!0;display.cursorDiv.style.visibility="",cm.options.cursorBlinkRate>0?display.blinker=setInterval((function(){return display.cursorDiv.style.visibility=(on=!on)?"":"hidden"}),cm.options.cursorBlinkRate):cm.options.cursorBlinkRate<0&&(display.cursorDiv.style.visibility="hidden")}}function ensureFocus(cm){cm.state.focused||(cm.display.input.focus(),onFocus(cm))}function delayBlurEvent(cm){cm.state.delayingBlurEvent=!0,setTimeout((function(){cm.state.delayingBlurEvent&&(cm.state.delayingBlurEvent=!1,onBlur(cm))}),100)}function onFocus(cm,e){cm.state.delayingBlurEvent&&(cm.state.delayingBlurEvent=!1),"nocursor"!=cm.options.readOnly&&(cm.state.focused||(signal(cm,"focus",cm,e),cm.state.focused=!0,addClass(cm.display.wrapper,"CodeMirror-focused"),cm.curOp||cm.display.selForContextMenu==cm.doc.sel||(cm.display.input.reset(),webkit&&setTimeout((function(){return cm.display.input.reset(!0)}),20)),cm.display.input.receivedFocus()),restartBlink(cm))}function onBlur(cm,e){cm.state.delayingBlurEvent||(cm.state.focused&&(signal(cm,"blur",cm,e),cm.state.focused=!1,rmClass(cm.display.wrapper,"CodeMirror-focused")),clearInterval(cm.display.blinker),setTimeout((function(){cm.state.focused||(cm.display.shift=!1)}),150))}function updateHeightsInViewport(cm){for(var display=cm.display,prevBottom=display.lineDiv.offsetTop,i=0;i<display.view.length;i++){var cur=display.view[i],wrapping=cm.options.lineWrapping,height=void 0,width=0;if(!cur.hidden){if(ie&&ie_version<8){var bot=cur.node.offsetTop+cur.node.offsetHeight;height=bot-prevBottom,prevBottom=bot}else{var box=cur.node.getBoundingClientRect();height=box.bottom-box.top,!wrapping&&cur.text.firstChild&&(width=cur.text.firstChild.getBoundingClientRect().right-box.left-1)}var diff=cur.line.height-height;if((diff>.005||diff<-.005)&&(updateLineHeight(cur.line,height),updateWidgetHeight(cur.line),cur.rest))for(var j=0;j<cur.rest.length;j++)updateWidgetHeight(cur.rest[j]);if(width>cm.display.sizerWidth){var chWidth=Math.ceil(width/charWidth(cm.display));chWidth>cm.display.maxLineLength&&(cm.display.maxLineLength=chWidth,cm.display.maxLine=cur.line,cm.display.maxLineChanged=!0)}}}}function updateWidgetHeight(line){if(line.widgets)for(var i=0;i<line.widgets.length;++i){var w=line.widgets[i],parent=w.node.parentNode;parent&&(w.height=parent.offsetHeight)}}function visibleLines(display,doc,viewport){var top=viewport&&null!=viewport.top?Math.max(0,viewport.top):display.scroller.scrollTop;top=Math.floor(top-paddingTop(display));var bottom=viewport&&null!=viewport.bottom?viewport.bottom:top+display.wrapper.clientHeight,from=lineAtHeight(doc,top),to=lineAtHeight(doc,bottom);if(viewport&&viewport.ensure){var ensureFrom=viewport.ensure.from.line,ensureTo=viewport.ensure.to.line;ensureFrom<from?(from=ensureFrom,to=lineAtHeight(doc,heightAtLine(getLine(doc,ensureFrom))+display.wrapper.clientHeight)):Math.min(ensureTo,doc.lastLine())>=to&&(from=lineAtHeight(doc,heightAtLine(getLine(doc,ensureTo))-display.wrapper.clientHeight),to=ensureTo)}return{from:from,to:Math.max(to,from+1)}}function calculateScrollPos(cm,rect){var display=cm.display,snapMargin=textHeight(cm.display);rect.top<0&&(rect.top=0);var screentop=cm.curOp&&null!=cm.curOp.scrollTop?cm.curOp.scrollTop:display.scroller.scrollTop,screen=displayHeight(cm),result={};rect.bottom-rect.top>screen&&(rect.bottom=rect.top+screen);var docBottom=cm.doc.height+paddingVert(display),atTop=rect.top<snapMargin,atBottom=rect.bottom>docBottom-snapMargin;if(rect.top<screentop)result.scrollTop=atTop?0:rect.top;else if(rect.bottom>screentop+screen){var newTop=Math.min(rect.top,(atBottom?docBottom:rect.bottom)-screen);newTop!=screentop&&(result.scrollTop=newTop)}var screenleft=cm.curOp&&null!=cm.curOp.scrollLeft?cm.curOp.scrollLeft:display.scroller.scrollLeft,screenw=displayWidth(cm)-(cm.options.fixedGutter?display.gutters.offsetWidth:0),tooWide=rect.right-rect.left>screenw;return tooWide&&(rect.right=rect.left+screenw),rect.left<10?result.scrollLeft=0:rect.left<screenleft?result.scrollLeft=Math.max(0,rect.left-(tooWide?0:10)):rect.right>screenw+screenleft-3&&(result.scrollLeft=rect.right+(tooWide?0:10)-screenw),result}function addToScrollTop(cm,top){null!=top&&(resolveScrollToPos(cm),cm.curOp.scrollTop=(null==cm.curOp.scrollTop?cm.doc.scrollTop:cm.curOp.scrollTop)+top)}function ensureCursorVisible(cm){resolveScrollToPos(cm);var cur=cm.getCursor();cm.curOp.scrollToPos={from:cur,to:cur,margin:cm.options.cursorScrollMargin}}function scrollToCoords(cm,x,y){null==x&&null==y||resolveScrollToPos(cm),null!=x&&(cm.curOp.scrollLeft=x),null!=y&&(cm.curOp.scrollTop=y)}function resolveScrollToPos(cm){var range=cm.curOp.scrollToPos;range&&(cm.curOp.scrollToPos=null,scrollToCoordsRange(cm,estimateCoords(cm,range.from),estimateCoords(cm,range.to),range.margin))}function scrollToCoordsRange(cm,from,to,margin){var sPos=calculateScrollPos(cm,{left:Math.min(from.left,to.left),top:Math.min(from.top,to.top)-margin,right:Math.max(from.right,to.right),bottom:Math.max(from.bottom,to.bottom)+margin});scrollToCoords(cm,sPos.scrollLeft,sPos.scrollTop)}function updateScrollTop(cm,val){Math.abs(cm.doc.scrollTop-val)<2||(gecko||updateDisplaySimple(cm,{top:val}),setScrollTop(cm,val,!0),gecko&&updateDisplaySimple(cm),startWorker(cm,100))}function setScrollTop(cm,val,forceScroll){val=Math.min(cm.display.scroller.scrollHeight-cm.display.scroller.clientHeight,val),(cm.display.scroller.scrollTop!=val||forceScroll)&&(cm.doc.scrollTop=val,cm.display.scrollbars.setScrollTop(val),cm.display.scroller.scrollTop!=val&&(cm.display.scroller.scrollTop=val))}function setScrollLeft(cm,val,isScroller,forceScroll){val=Math.min(val,cm.display.scroller.scrollWidth-cm.display.scroller.clientWidth),(isScroller?val==cm.doc.scrollLeft:Math.abs(cm.doc.scrollLeft-val)<2)&&!forceScroll||(cm.doc.scrollLeft=val,alignHorizontally(cm),cm.display.scroller.scrollLeft!=val&&(cm.display.scroller.scrollLeft=val),cm.display.scrollbars.setScrollLeft(val))}function measureForScrollbars(cm){var d=cm.display,gutterW=d.gutters.offsetWidth,docH=Math.round(cm.doc.height+paddingVert(cm.display));return{clientHeight:d.scroller.clientHeight,viewHeight:d.wrapper.clientHeight,scrollWidth:d.scroller.scrollWidth,clientWidth:d.scroller.clientWidth,viewWidth:d.wrapper.clientWidth,barLeft:cm.options.fixedGutter?gutterW:0,docHeight:docH,scrollHeight:docH+scrollGap(cm)+d.barHeight,nativeBarWidth:d.nativeBarWidth,gutterWidth:gutterW}}var NativeScrollbars=function(place,scroll,cm){this.cm=cm;var vert=this.vert=elt("div",[elt("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),horiz=this.horiz=elt("div",[elt("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");vert.tabIndex=horiz.tabIndex=-1,place(vert),place(horiz),on(vert,"scroll",(function(){vert.clientHeight&&scroll(vert.scrollTop,"vertical")})),on(horiz,"scroll",(function(){horiz.clientWidth&&scroll(horiz.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,ie&&ie_version<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};NativeScrollbars.prototype.update=function(measure){var needsH=measure.scrollWidth>measure.clientWidth+1,needsV=measure.scrollHeight>measure.clientHeight+1,sWidth=measure.nativeBarWidth;if(needsV){this.vert.style.display="block",this.vert.style.bottom=needsH?sWidth+"px":"0";var totalHeight=measure.viewHeight-(needsH?sWidth:0);this.vert.firstChild.style.height=Math.max(0,measure.scrollHeight-measure.clientHeight+totalHeight)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(needsH){this.horiz.style.display="block",this.horiz.style.right=needsV?sWidth+"px":"0",this.horiz.style.left=measure.barLeft+"px";var totalWidth=measure.viewWidth-measure.barLeft-(needsV?sWidth:0);this.horiz.firstChild.style.width=Math.max(0,measure.scrollWidth-measure.clientWidth+totalWidth)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&measure.clientHeight>0&&(0==sWidth&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:needsV?sWidth:0,bottom:needsH?sWidth:0}},NativeScrollbars.prototype.setScrollLeft=function(pos){this.horiz.scrollLeft!=pos&&(this.horiz.scrollLeft=pos),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},NativeScrollbars.prototype.setScrollTop=function(pos){this.vert.scrollTop!=pos&&(this.vert.scrollTop=pos),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},NativeScrollbars.prototype.zeroWidthHack=function(){var w=mac&&!mac_geMountainLion?"12px":"18px";this.horiz.style.height=this.vert.style.width=w,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Delayed,this.disableVert=new Delayed},NativeScrollbars.prototype.enableZeroWidthBar=function(bar,delay,type){bar.style.pointerEvents="auto",delay.set(1e3,(function maybeDisable(){var box=bar.getBoundingClientRect();("vert"==type?document.elementFromPoint(box.right-1,(box.top+box.bottom)/2):document.elementFromPoint((box.right+box.left)/2,box.bottom-1))!=bar?bar.style.pointerEvents="none":delay.set(1e3,maybeDisable)}))},NativeScrollbars.prototype.clear=function(){var parent=this.horiz.parentNode;parent.removeChild(this.horiz),parent.removeChild(this.vert)};var NullScrollbars=function(){};function updateScrollbars(cm,measure){measure||(measure=measureForScrollbars(cm));var startWidth=cm.display.barWidth,startHeight=cm.display.barHeight;updateScrollbarsInner(cm,measure);for(var i=0;i<4&&startWidth!=cm.display.barWidth||startHeight!=cm.display.barHeight;i++)startWidth!=cm.display.barWidth&&cm.options.lineWrapping&&updateHeightsInViewport(cm),updateScrollbarsInner(cm,measureForScrollbars(cm)),startWidth=cm.display.barWidth,startHeight=cm.display.barHeight}function updateScrollbarsInner(cm,measure){var d=cm.display,sizes=d.scrollbars.update(measure);d.sizer.style.paddingRight=(d.barWidth=sizes.right)+"px",d.sizer.style.paddingBottom=(d.barHeight=sizes.bottom)+"px",d.heightForcer.style.borderBottom=sizes.bottom+"px solid transparent",sizes.right&&sizes.bottom?(d.scrollbarFiller.style.display="block",d.scrollbarFiller.style.height=sizes.bottom+"px",d.scrollbarFiller.style.width=sizes.right+"px"):d.scrollbarFiller.style.display="",sizes.bottom&&cm.options.coverGutterNextToScrollbar&&cm.options.fixedGutter?(d.gutterFiller.style.display="block",d.gutterFiller.style.height=sizes.bottom+"px",d.gutterFiller.style.width=measure.gutterWidth+"px"):d.gutterFiller.style.display=""}NullScrollbars.prototype.update=function(){return{bottom:0,right:0}},NullScrollbars.prototype.setScrollLeft=function(){},NullScrollbars.prototype.setScrollTop=function(){},NullScrollbars.prototype.clear=function(){};var scrollbarModel={native:NativeScrollbars,null:NullScrollbars};function initScrollbars(cm){cm.display.scrollbars&&(cm.display.scrollbars.clear(),cm.display.scrollbars.addClass&&rmClass(cm.display.wrapper,cm.display.scrollbars.addClass)),cm.display.scrollbars=new scrollbarModel[cm.options.scrollbarStyle]((function(node){cm.display.wrapper.insertBefore(node,cm.display.scrollbarFiller),on(node,"mousedown",(function(){cm.state.focused&&setTimeout((function(){return cm.display.input.focus()}),0)})),node.setAttribute("cm-not-content","true")}),(function(pos,axis){"horizontal"==axis?setScrollLeft(cm,pos):updateScrollTop(cm,pos)}),cm),cm.display.scrollbars.addClass&&addClass(cm.display.wrapper,cm.display.scrollbars.addClass)}var nextOpId=0;function startOperation(cm){var op;cm.curOp={cm:cm,viewChanged:!1,startHeight:cm.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++nextOpId},op=cm.curOp,operationGroup?operationGroup.ops.push(op):op.ownsGroup=operationGroup={ops:[op],delayedCallbacks:[]}}function endOperation(cm){var op=cm.curOp;op&&function(op,endCb){var group=op.ownsGroup;if(group)try{!function(group){var callbacks=group.delayedCallbacks,i=0;do{for(;i<callbacks.length;i++)callbacks[i].call(null);for(var j=0;j<group.ops.length;j++){var op=group.ops[j];if(op.cursorActivityHandlers)for(;op.cursorActivityCalled<op.cursorActivityHandlers.length;)op.cursorActivityHandlers[op.cursorActivityCalled++].call(null,op.cm)}}while(i<callbacks.length)}(group)}finally{operationGroup=null,endCb(group)}}(op,(function(group){for(var i=0;i<group.ops.length;i++)group.ops[i].cm.curOp=null;!function(group){for(var ops=group.ops,i=0;i<ops.length;i++)endOperation_R1(ops[i]);for(var i$1=0;i$1<ops.length;i$1++)endOperation_W1(ops[i$1]);for(var i$2=0;i$2<ops.length;i$2++)endOperation_R2(ops[i$2]);for(var i$3=0;i$3<ops.length;i$3++)endOperation_W2(ops[i$3]);for(var i$4=0;i$4<ops.length;i$4++)endOperation_finish(ops[i$4])}(group)}))}function endOperation_R1(op){var cm=op.cm,display=cm.display;!function(cm){var display=cm.display;!display.scrollbarsClipped&&display.scroller.offsetWidth&&(display.nativeBarWidth=display.scroller.offsetWidth-display.scroller.clientWidth,display.heightForcer.style.height=scrollGap(cm)+"px",display.sizer.style.marginBottom=-display.nativeBarWidth+"px",display.sizer.style.borderRightWidth=scrollGap(cm)+"px",display.scrollbarsClipped=!0)}(cm),op.updateMaxLine&&findMaxLine(cm),op.mustUpdate=op.viewChanged||op.forceUpdate||null!=op.scrollTop||op.scrollToPos&&(op.scrollToPos.from.line<display.viewFrom||op.scrollToPos.to.line>=display.viewTo)||display.maxLineChanged&&cm.options.lineWrapping,op.update=op.mustUpdate&&new DisplayUpdate(cm,op.mustUpdate&&{top:op.scrollTop,ensure:op.scrollToPos},op.forceUpdate)}function endOperation_W1(op){op.updatedDisplay=op.mustUpdate&&updateDisplayIfNeeded(op.cm,op.update)}function endOperation_R2(op){var cm=op.cm,display=cm.display;op.updatedDisplay&&updateHeightsInViewport(cm),op.barMeasure=measureForScrollbars(cm),display.maxLineChanged&&!cm.options.lineWrapping&&(op.adjustWidthTo=measureChar(cm,display.maxLine,display.maxLine.text.length).left+3,cm.display.sizerWidth=op.adjustWidthTo,op.barMeasure.scrollWidth=Math.max(display.scroller.clientWidth,display.sizer.offsetLeft+op.adjustWidthTo+scrollGap(cm)+cm.display.barWidth),op.maxScrollLeft=Math.max(0,display.sizer.offsetLeft+op.adjustWidthTo-displayWidth(cm))),(op.updatedDisplay||op.selectionChanged)&&(op.preparedSelection=display.input.prepareSelection())}function endOperation_W2(op){var cm=op.cm;null!=op.adjustWidthTo&&(cm.display.sizer.style.minWidth=op.adjustWidthTo+"px",op.maxScrollLeft<cm.doc.scrollLeft&&setScrollLeft(cm,Math.min(cm.display.scroller.scrollLeft,op.maxScrollLeft),!0),cm.display.maxLineChanged=!1);var takeFocus=op.focus&&op.focus==activeElt();op.preparedSelection&&cm.display.input.showSelection(op.preparedSelection,takeFocus),(op.updatedDisplay||op.startHeight!=cm.doc.height)&&updateScrollbars(cm,op.barMeasure),op.updatedDisplay&&setDocumentHeight(cm,op.barMeasure),op.selectionChanged&&restartBlink(cm),cm.state.focused&&op.updateInput&&cm.display.input.reset(op.typing),takeFocus&&ensureFocus(op.cm)}function endOperation_finish(op){var cm=op.cm,display=cm.display,doc=cm.doc;op.updatedDisplay&&postUpdateDisplay(cm,op.update),null==display.wheelStartX||null==op.scrollTop&&null==op.scrollLeft&&!op.scrollToPos||(display.wheelStartX=display.wheelStartY=null),null!=op.scrollTop&&setScrollTop(cm,op.scrollTop,op.forceScroll),null!=op.scrollLeft&&setScrollLeft(cm,op.scrollLeft,!0,!0),op.scrollToPos&&function(cm,rect){if(!signalDOMEvent(cm,"scrollCursorIntoView")){var display=cm.display,box=display.sizer.getBoundingClientRect(),doScroll=null;if(rect.top+box.top<0?doScroll=!0:rect.bottom+box.top>(window.innerHeight||document.documentElement.clientHeight)&&(doScroll=!1),null!=doScroll&&!phantom){var scrollNode=elt("div","​",null,"position: absolute;\n top: "+(rect.top-display.viewOffset-paddingTop(cm.display))+"px;\n height: "+(rect.bottom-rect.top+scrollGap(cm)+display.barHeight)+"px;\n left: "+rect.left+"px; width: "+Math.max(2,rect.right-rect.left)+"px;");cm.display.lineSpace.appendChild(scrollNode),scrollNode.scrollIntoView(doScroll),cm.display.lineSpace.removeChild(scrollNode)}}}(cm,function(cm,pos,end,margin){var rect;null==margin&&(margin=0),cm.options.lineWrapping||pos!=end||(end="before"==(pos=pos.ch?Pos(pos.line,"before"==pos.sticky?pos.ch-1:pos.ch,"after"):pos).sticky?Pos(pos.line,pos.ch+1,"before"):pos);for(var limit=0;limit<5;limit++){var changed=!1,coords=cursorCoords(cm,pos),endCoords=end&&end!=pos?cursorCoords(cm,end):coords,scrollPos=calculateScrollPos(cm,rect={left:Math.min(coords.left,endCoords.left),top:Math.min(coords.top,endCoords.top)-margin,right:Math.max(coords.left,endCoords.left),bottom:Math.max(coords.bottom,endCoords.bottom)+margin}),startTop=cm.doc.scrollTop,startLeft=cm.doc.scrollLeft;if(null!=scrollPos.scrollTop&&(updateScrollTop(cm,scrollPos.scrollTop),Math.abs(cm.doc.scrollTop-startTop)>1&&(changed=!0)),null!=scrollPos.scrollLeft&&(setScrollLeft(cm,scrollPos.scrollLeft),Math.abs(cm.doc.scrollLeft-startLeft)>1&&(changed=!0)),!changed)break}return rect}(cm,clipPos(doc,op.scrollToPos.from),clipPos(doc,op.scrollToPos.to),op.scrollToPos.margin));var hidden=op.maybeHiddenMarkers,unhidden=op.maybeUnhiddenMarkers;if(hidden)for(var i=0;i<hidden.length;++i)hidden[i].lines.length||signal(hidden[i],"hide");if(unhidden)for(var i$1=0;i$1<unhidden.length;++i$1)unhidden[i$1].lines.length&&signal(unhidden[i$1],"unhide");display.wrapper.offsetHeight&&(doc.scrollTop=cm.display.scroller.scrollTop),op.changeObjs&&signal(cm,"changes",cm,op.changeObjs),op.update&&op.update.finish()}function runInOp(cm,f){if(cm.curOp)return f();startOperation(cm);try{return f()}finally{endOperation(cm)}}function operation(cm,f){return function(){if(cm.curOp)return f.apply(cm,arguments);startOperation(cm);try{return f.apply(cm,arguments)}finally{endOperation(cm)}}}function methodOp(f){return function(){if(this.curOp)return f.apply(this,arguments);startOperation(this);try{return f.apply(this,arguments)}finally{endOperation(this)}}}function docMethodOp(f){return function(){var cm=this.cm;if(!cm||cm.curOp)return f.apply(this,arguments);startOperation(cm);try{return f.apply(this,arguments)}finally{endOperation(cm)}}}function startWorker(cm,time){cm.doc.highlightFrontier<cm.display.viewTo&&cm.state.highlight.set(time,bind(highlightWorker,cm))}function highlightWorker(cm){var doc=cm.doc;if(!(doc.highlightFrontier>=cm.display.viewTo)){var end=+new Date+cm.options.workTime,context=getContextBefore(cm,doc.highlightFrontier),changedLines=[];doc.iter(context.line,Math.min(doc.first+doc.size,cm.display.viewTo+500),(function(line){if(context.line>=cm.display.viewFrom){var oldStyles=line.styles,resetState=line.text.length>cm.options.maxHighlightLength?copyState(doc.mode,context.state):null,highlighted=highlightLine(cm,line,context,!0);resetState&&(context.state=resetState),line.styles=highlighted.styles;var oldCls=line.styleClasses,newCls=highlighted.classes;newCls?line.styleClasses=newCls:oldCls&&(line.styleClasses=null);for(var ischange=!oldStyles||oldStyles.length!=line.styles.length||oldCls!=newCls&&(!oldCls||!newCls||oldCls.bgClass!=newCls.bgClass||oldCls.textClass!=newCls.textClass),i=0;!ischange&&i<oldStyles.length;++i)ischange=oldStyles[i]!=line.styles[i];ischange&&changedLines.push(context.line),line.stateAfter=context.save(),context.nextLine()}else line.text.length<=cm.options.maxHighlightLength&&processLine(cm,line.text,context),line.stateAfter=context.line%5==0?context.save():null,context.nextLine();if(+new Date>end)return startWorker(cm,cm.options.workDelay),!0})),doc.highlightFrontier=context.line,doc.modeFrontier=Math.max(doc.modeFrontier,context.line),changedLines.length&&runInOp(cm,(function(){for(var i=0;i<changedLines.length;i++)regLineChange(cm,changedLines[i],"text")}))}}var DisplayUpdate=function(cm,viewport,force){var display=cm.display;this.viewport=viewport,this.visible=visibleLines(display,cm.doc,viewport),this.editorIsHidden=!display.wrapper.offsetWidth,this.wrapperHeight=display.wrapper.clientHeight,this.wrapperWidth=display.wrapper.clientWidth,this.oldDisplayWidth=displayWidth(cm),this.force=force,this.dims=getDimensions(cm),this.events=[]};function updateDisplayIfNeeded(cm,update){var display=cm.display,doc=cm.doc;if(update.editorIsHidden)return resetView(cm),!1;if(!update.force&&update.visible.from>=display.viewFrom&&update.visible.to<=display.viewTo&&(null==display.updateLineNumbers||display.updateLineNumbers>=display.viewTo)&&display.renderedView==display.view&&0==countDirtyView(cm))return!1;maybeUpdateLineNumberWidth(cm)&&(resetView(cm),update.dims=getDimensions(cm));var end=doc.first+doc.size,from=Math.max(update.visible.from-cm.options.viewportMargin,doc.first),to=Math.min(end,update.visible.to+cm.options.viewportMargin);display.viewFrom<from&&from-display.viewFrom<20&&(from=Math.max(doc.first,display.viewFrom)),display.viewTo>to&&display.viewTo-to<20&&(to=Math.min(end,display.viewTo)),sawCollapsedSpans&&(from=visualLineNo(cm.doc,from),to=visualLineEndNo(cm.doc,to));var different=from!=display.viewFrom||to!=display.viewTo||display.lastWrapHeight!=update.wrapperHeight||display.lastWrapWidth!=update.wrapperWidth;!function(cm,from,to){var display=cm.display;0==display.view.length||from>=display.viewTo||to<=display.viewFrom?(display.view=buildViewArray(cm,from,to),display.viewFrom=from):(display.viewFrom>from?display.view=buildViewArray(cm,from,display.viewFrom).concat(display.view):display.viewFrom<from&&(display.view=display.view.slice(findViewIndex(cm,from))),display.viewFrom=from,display.viewTo<to?display.view=display.view.concat(buildViewArray(cm,display.viewTo,to)):display.viewTo>to&&(display.view=display.view.slice(0,findViewIndex(cm,to)))),display.viewTo=to}(cm,from,to),display.viewOffset=heightAtLine(getLine(cm.doc,display.viewFrom)),cm.display.mover.style.top=display.viewOffset+"px";var toUpdate=countDirtyView(cm);if(!different&&0==toUpdate&&!update.force&&display.renderedView==display.view&&(null==display.updateLineNumbers||display.updateLineNumbers>=display.viewTo))return!1;var selSnapshot=function(cm){if(cm.hasFocus())return null;var active=activeElt();if(!active||!contains(cm.display.lineDiv,active))return null;var result={activeElt:active};if(window.getSelection){var sel=window.getSelection();sel.anchorNode&&sel.extend&&contains(cm.display.lineDiv,sel.anchorNode)&&(result.anchorNode=sel.anchorNode,result.anchorOffset=sel.anchorOffset,result.focusNode=sel.focusNode,result.focusOffset=sel.focusOffset)}return result}(cm);return toUpdate>4&&(display.lineDiv.style.display="none"),function(cm,updateNumbersFrom,dims){var display=cm.display,lineNumbers=cm.options.lineNumbers,container=display.lineDiv,cur=container.firstChild;function rm(node){var next=node.nextSibling;return webkit&&mac&&cm.display.currentWheelTarget==node?node.style.display="none":node.parentNode.removeChild(node),next}for(var view=display.view,lineN=display.viewFrom,i=0;i<view.length;i++){var lineView=view[i];if(lineView.hidden);else if(lineView.node&&lineView.node.parentNode==container){for(;cur!=lineView.node;)cur=rm(cur);var updateNumber=lineNumbers&&null!=updateNumbersFrom&&updateNumbersFrom<=lineN&&lineView.lineNumber;lineView.changes&&(indexOf(lineView.changes,"gutter")>-1&&(updateNumber=!1),updateLineForChanges(cm,lineView,lineN,dims)),updateNumber&&(removeChildren(lineView.lineNumber),lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options,lineN)))),cur=lineView.node.nextSibling}else{var node=buildLineElement(cm,lineView,lineN,dims);container.insertBefore(node,cur)}lineN+=lineView.size}for(;cur;)cur=rm(cur)}(cm,display.updateLineNumbers,update.dims),toUpdate>4&&(display.lineDiv.style.display=""),display.renderedView=display.view,function(snapshot){if(snapshot&&snapshot.activeElt&&snapshot.activeElt!=activeElt()&&(snapshot.activeElt.focus(),snapshot.anchorNode&&contains(document.body,snapshot.anchorNode)&&contains(document.body,snapshot.focusNode))){var sel=window.getSelection(),range=document.createRange();range.setEnd(snapshot.anchorNode,snapshot.anchorOffset),range.collapse(!1),sel.removeAllRanges(),sel.addRange(range),sel.extend(snapshot.focusNode,snapshot.focusOffset)}}(selSnapshot),removeChildren(display.cursorDiv),removeChildren(display.selectionDiv),display.gutters.style.height=display.sizer.style.minHeight=0,different&&(display.lastWrapHeight=update.wrapperHeight,display.lastWrapWidth=update.wrapperWidth,startWorker(cm,400)),display.updateLineNumbers=null,!0}function postUpdateDisplay(cm,update){for(var viewport=update.viewport,first=!0;(first&&cm.options.lineWrapping&&update.oldDisplayWidth!=displayWidth(cm)||(viewport&&null!=viewport.top&&(viewport={top:Math.min(cm.doc.height+paddingVert(cm.display)-displayHeight(cm),viewport.top)}),update.visible=visibleLines(cm.display,cm.doc,viewport),!(update.visible.from>=cm.display.viewFrom&&update.visible.to<=cm.display.viewTo)))&&updateDisplayIfNeeded(cm,update);first=!1){updateHeightsInViewport(cm);var barMeasure=measureForScrollbars(cm);updateSelection(cm),updateScrollbars(cm,barMeasure),setDocumentHeight(cm,barMeasure),update.force=!1}update.signal(cm,"update",cm),cm.display.viewFrom==cm.display.reportedViewFrom&&cm.display.viewTo==cm.display.reportedViewTo||(update.signal(cm,"viewportChange",cm,cm.display.viewFrom,cm.display.viewTo),cm.display.reportedViewFrom=cm.display.viewFrom,cm.display.reportedViewTo=cm.display.viewTo)}function updateDisplaySimple(cm,viewport){var update=new DisplayUpdate(cm,viewport);if(updateDisplayIfNeeded(cm,update)){updateHeightsInViewport(cm),postUpdateDisplay(cm,update);var barMeasure=measureForScrollbars(cm);updateSelection(cm),updateScrollbars(cm,barMeasure),setDocumentHeight(cm,barMeasure),update.finish()}}function updateGutterSpace(display){var width=display.gutters.offsetWidth;display.sizer.style.marginLeft=width+"px"}function setDocumentHeight(cm,measure){cm.display.sizer.style.minHeight=measure.docHeight+"px",cm.display.heightForcer.style.top=measure.docHeight+"px",cm.display.gutters.style.height=measure.docHeight+cm.display.barHeight+scrollGap(cm)+"px"}function alignHorizontally(cm){var display=cm.display,view=display.view;if(display.alignWidgets||display.gutters.firstChild&&cm.options.fixedGutter){for(var comp=compensateForHScroll(display)-display.scroller.scrollLeft+cm.doc.scrollLeft,gutterW=display.gutters.offsetWidth,left=comp+"px",i=0;i<view.length;i++)if(!view[i].hidden){cm.options.fixedGutter&&(view[i].gutter&&(view[i].gutter.style.left=left),view[i].gutterBackground&&(view[i].gutterBackground.style.left=left));var align=view[i].alignable;if(align)for(var j=0;j<align.length;j++)align[j].style.left=left}cm.options.fixedGutter&&(display.gutters.style.left=comp+gutterW+"px")}}function maybeUpdateLineNumberWidth(cm){if(!cm.options.lineNumbers)return!1;var doc=cm.doc,last=lineNumberFor(cm.options,doc.first+doc.size-1),display=cm.display;if(last.length!=display.lineNumChars){var test=display.measure.appendChild(elt("div",[elt("div",last)],"CodeMirror-linenumber CodeMirror-gutter-elt")),innerW=test.firstChild.offsetWidth,padding=test.offsetWidth-innerW;return display.lineGutter.style.width="",display.lineNumInnerWidth=Math.max(innerW,display.lineGutter.offsetWidth-padding)+1,display.lineNumWidth=display.lineNumInnerWidth+padding,display.lineNumChars=display.lineNumInnerWidth?last.length:-1,display.lineGutter.style.width=display.lineNumWidth+"px",updateGutterSpace(cm.display),!0}return!1}function getGutters(gutters,lineNumbers){for(var result=[],sawLineNumbers=!1,i=0;i<gutters.length;i++){var name=gutters[i],style=null;if("string"!=typeof name&&(style=name.style,name=name.className),"CodeMirror-linenumbers"==name){if(!lineNumbers)continue;sawLineNumbers=!0}result.push({className:name,style:style})}return lineNumbers&&!sawLineNumbers&&result.push({className:"CodeMirror-linenumbers",style:null}),result}function renderGutters(display){var gutters=display.gutters,specs=display.gutterSpecs;removeChildren(gutters),display.lineGutter=null;for(var i=0;i<specs.length;++i){var ref=specs[i],className=ref.className,style=ref.style,gElt=gutters.appendChild(elt("div",null,"CodeMirror-gutter "+className));style&&(gElt.style.cssText=style),"CodeMirror-linenumbers"==className&&(display.lineGutter=gElt,gElt.style.width=(display.lineNumWidth||1)+"px")}gutters.style.display=specs.length?"":"none",updateGutterSpace(display)}function updateGutters(cm){renderGutters(cm.display),regChange(cm),alignHorizontally(cm)}function Display(place,doc,input,options){var d=this;this.input=input,d.scrollbarFiller=elt("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=elt("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=eltP("div",null,"CodeMirror-code"),d.selectionDiv=elt("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=elt("div",null,"CodeMirror-cursors"),d.measure=elt("div",null,"CodeMirror-measure"),d.lineMeasure=elt("div",null,"CodeMirror-measure"),d.lineSpace=eltP("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none");var lines=eltP("div",[d.lineSpace],"CodeMirror-lines");d.mover=elt("div",[lines],null,"position: relative"),d.sizer=elt("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=elt("div",null,null,"position: absolute; height: "+scrollerGap+"px; width: 1px;"),d.gutters=elt("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=elt("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=elt("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),ie&&ie_version<8&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),webkit||gecko&&mobile||(d.scroller.draggable=!0),place&&(place.appendChild?place.appendChild(d.wrapper):place(d.wrapper)),d.viewFrom=d.viewTo=doc.first,d.reportedViewFrom=d.reportedViewTo=doc.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,d.gutterSpecs=getGutters(options.gutters,options.lineNumbers),renderGutters(d),input.init(d)}DisplayUpdate.prototype.signal=function(emitter,type){hasHandler(emitter,type)&&this.events.push(arguments)},DisplayUpdate.prototype.finish=function(){for(var i=0;i<this.events.length;i++)signal.apply(null,this.events[i])};var wheelSamples=0,wheelPixelsPerUnit=null;function wheelEventDelta(e){var dx=e.wheelDeltaX,dy=e.wheelDeltaY;return null==dx&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(dx=e.detail),null==dy&&e.detail&&e.axis==e.VERTICAL_AXIS?dy=e.detail:null==dy&&(dy=e.wheelDelta),{x:dx,y:dy}}function wheelEventPixels(e){var delta=wheelEventDelta(e);return delta.x*=wheelPixelsPerUnit,delta.y*=wheelPixelsPerUnit,delta}function onScrollWheel(cm,e){var delta=wheelEventDelta(e),dx=delta.x,dy=delta.y,display=cm.display,scroll=display.scroller,canScrollX=scroll.scrollWidth>scroll.clientWidth,canScrollY=scroll.scrollHeight>scroll.clientHeight;if(dx&&canScrollX||dy&&canScrollY){if(dy&&mac&&webkit)outer:for(var cur=e.target,view=display.view;cur!=scroll;cur=cur.parentNode)for(var i=0;i<view.length;i++)if(view[i].node==cur){cm.display.currentWheelTarget=cur;break outer}if(dx&&!gecko&&!presto&&null!=wheelPixelsPerUnit)return dy&&canScrollY&&updateScrollTop(cm,Math.max(0,scroll.scrollTop+dy*wheelPixelsPerUnit)),setScrollLeft(cm,Math.max(0,scroll.scrollLeft+dx*wheelPixelsPerUnit)),(!dy||dy&&canScrollY)&&e_preventDefault(e),void(display.wheelStartX=null);if(dy&&null!=wheelPixelsPerUnit){var pixels=dy*wheelPixelsPerUnit,top=cm.doc.scrollTop,bot=top+display.wrapper.clientHeight;pixels<0?top=Math.max(0,top+pixels-50):bot=Math.min(cm.doc.height,bot+pixels+50),updateDisplaySimple(cm,{top:top,bottom:bot})}wheelSamples<20&&(null==display.wheelStartX?(display.wheelStartX=scroll.scrollLeft,display.wheelStartY=scroll.scrollTop,display.wheelDX=dx,display.wheelDY=dy,setTimeout((function(){if(null!=display.wheelStartX){var movedX=scroll.scrollLeft-display.wheelStartX,movedY=scroll.scrollTop-display.wheelStartY,sample=movedY&&display.wheelDY&&movedY/display.wheelDY||movedX&&display.wheelDX&&movedX/display.wheelDX;display.wheelStartX=display.wheelStartY=null,sample&&(wheelPixelsPerUnit=(wheelPixelsPerUnit*wheelSamples+sample)/(wheelSamples+1),++wheelSamples)}}),200)):(display.wheelDX+=dx,display.wheelDY+=dy))}}ie?wheelPixelsPerUnit=-.53:gecko?wheelPixelsPerUnit=15:chrome?wheelPixelsPerUnit=-.7:safari&&(wheelPixelsPerUnit=-1/3);var Selection=function(ranges,primIndex){this.ranges=ranges,this.primIndex=primIndex};Selection.prototype.primary=function(){return this.ranges[this.primIndex]},Selection.prototype.equals=function(other){if(other==this)return!0;if(other.primIndex!=this.primIndex||other.ranges.length!=this.ranges.length)return!1;for(var i=0;i<this.ranges.length;i++){var here=this.ranges[i],there=other.ranges[i];if(!equalCursorPos(here.anchor,there.anchor)||!equalCursorPos(here.head,there.head))return!1}return!0},Selection.prototype.deepCopy=function(){for(var out=[],i=0;i<this.ranges.length;i++)out[i]=new Range(copyPos(this.ranges[i].anchor),copyPos(this.ranges[i].head));return new Selection(out,this.primIndex)},Selection.prototype.somethingSelected=function(){for(var i=0;i<this.ranges.length;i++)if(!this.ranges[i].empty())return!0;return!1},Selection.prototype.contains=function(pos,end){end||(end=pos);for(var i=0;i<this.ranges.length;i++){var range=this.ranges[i];if(cmp(end,range.from())>=0&&cmp(pos,range.to())<=0)return i}return-1};var Range=function(anchor,head){this.anchor=anchor,this.head=head};function normalizeSelection(cm,ranges,primIndex){var mayTouch=cm&&cm.options.selectionsMayTouch,prim=ranges[primIndex];ranges.sort((function(a,b){return cmp(a.from(),b.from())})),primIndex=indexOf(ranges,prim);for(var i=1;i<ranges.length;i++){var cur=ranges[i],prev=ranges[i-1],diff=cmp(prev.to(),cur.from());if(mayTouch&&!cur.empty()?diff>0:diff>=0){var from=minPos(prev.from(),cur.from()),to=maxPos(prev.to(),cur.to()),inv=prev.empty()?cur.from()==cur.head:prev.from()==prev.head;i<=primIndex&&--primIndex,ranges.splice(--i,2,new Range(inv?to:from,inv?from:to))}}return new Selection(ranges,primIndex)}function simpleSelection(anchor,head){return new Selection([new Range(anchor,head||anchor)],0)}function changeEnd(change){return change.text?Pos(change.from.line+change.text.length-1,lst(change.text).length+(1==change.text.length?change.from.ch:0)):change.to}function adjustForChange(pos,change){if(cmp(pos,change.from)<0)return pos;if(cmp(pos,change.to)<=0)return changeEnd(change);var line=pos.line+change.text.length-(change.to.line-change.from.line)-1,ch=pos.ch;return pos.line==change.to.line&&(ch+=changeEnd(change).ch-change.to.ch),Pos(line,ch)}function computeSelAfterChange(doc,change){for(var out=[],i=0;i<doc.sel.ranges.length;i++){var range=doc.sel.ranges[i];out.push(new Range(adjustForChange(range.anchor,change),adjustForChange(range.head,change)))}return normalizeSelection(doc.cm,out,doc.sel.primIndex)}function offsetPos(pos,old,nw){return pos.line==old.line?Pos(nw.line,pos.ch-old.ch+nw.ch):Pos(nw.line+(pos.line-old.line),pos.ch)}function loadMode(cm){cm.doc.mode=getMode(cm.options,cm.doc.modeOption),resetModeState(cm)}function resetModeState(cm){cm.doc.iter((function(line){line.stateAfter&&(line.stateAfter=null),line.styles&&(line.styles=null)})),cm.doc.modeFrontier=cm.doc.highlightFrontier=cm.doc.first,startWorker(cm,100),cm.state.modeGen++,cm.curOp&&regChange(cm)}function isWholeLineUpdate(doc,change){return 0==change.from.ch&&0==change.to.ch&&""==lst(change.text)&&(!doc.cm||doc.cm.options.wholeLineUpdateBefore)}function updateDoc(doc,change,markedSpans,estimateHeight){function spansFor(n){return markedSpans?markedSpans[n]:null}function update(line,text,spans){!function(line,text,markedSpans,estimateHeight){line.text=text,line.stateAfter&&(line.stateAfter=null),line.styles&&(line.styles=null),null!=line.order&&(line.order=null),detachMarkedSpans(line),attachMarkedSpans(line,markedSpans);var estHeight=estimateHeight?estimateHeight(line):1;estHeight!=line.height&&updateLineHeight(line,estHeight)}(line,text,spans,estimateHeight),signalLater(line,"change",line,change)}function linesFor(start,end){for(var result=[],i=start;i<end;++i)result.push(new Line(text[i],spansFor(i),estimateHeight));return result}var from=change.from,to=change.to,text=change.text,firstLine=getLine(doc,from.line),lastLine=getLine(doc,to.line),lastText=lst(text),lastSpans=spansFor(text.length-1),nlines=to.line-from.line;if(change.full)doc.insert(0,linesFor(0,text.length)),doc.remove(text.length,doc.size-text.length);else if(isWholeLineUpdate(doc,change)){var added=linesFor(0,text.length-1);update(lastLine,lastLine.text,lastSpans),nlines&&doc.remove(from.line,nlines),added.length&&doc.insert(from.line,added)}else if(firstLine==lastLine)if(1==text.length)update(firstLine,firstLine.text.slice(0,from.ch)+lastText+firstLine.text.slice(to.ch),lastSpans);else{var added$1=linesFor(1,text.length-1);added$1.push(new Line(lastText+firstLine.text.slice(to.ch),lastSpans,estimateHeight)),update(firstLine,firstLine.text.slice(0,from.ch)+text[0],spansFor(0)),doc.insert(from.line+1,added$1)}else if(1==text.length)update(firstLine,firstLine.text.slice(0,from.ch)+text[0]+lastLine.text.slice(to.ch),spansFor(0)),doc.remove(from.line+1,nlines);else{update(firstLine,firstLine.text.slice(0,from.ch)+text[0],spansFor(0)),update(lastLine,lastText+lastLine.text.slice(to.ch),lastSpans);var added$2=linesFor(1,text.length-1);nlines>1&&doc.remove(from.line+1,nlines-1),doc.insert(from.line+1,added$2)}signalLater(doc,"change",doc,change)}function linkedDocs(doc,f,sharedHistOnly){!function propagate(doc,skip,sharedHist){if(doc.linked)for(var i=0;i<doc.linked.length;++i){var rel=doc.linked[i];if(rel.doc!=skip){var shared=sharedHist&&rel.sharedHist;sharedHistOnly&&!shared||(f(rel.doc,shared),propagate(rel.doc,doc,shared))}}}(doc,null,!0)}function attachDoc(cm,doc){if(doc.cm)throw new Error("This document is already in use.");cm.doc=doc,doc.cm=cm,estimateLineHeights(cm),loadMode(cm),setDirectionClass(cm),cm.options.lineWrapping||findMaxLine(cm),cm.options.mode=doc.modeOption,regChange(cm)}function setDirectionClass(cm){("rtl"==cm.doc.direction?addClass:rmClass)(cm.display.lineDiv,"CodeMirror-rtl")}function History(startGen){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=startGen||1}function historyChangeFromChange(doc,change){var histChange={from:copyPos(change.from),to:changeEnd(change),text:getBetween(doc,change.from,change.to)};return attachLocalSpans(doc,histChange,change.from.line,change.to.line+1),linkedDocs(doc,(function(doc){return attachLocalSpans(doc,histChange,change.from.line,change.to.line+1)}),!0),histChange}function clearSelectionEvents(array){for(;array.length&&lst(array).ranges;)array.pop()}function addChangeToHistory(doc,change,selAfter,opId){var hist=doc.history;hist.undone.length=0;var cur,last,time=+new Date;if((hist.lastOp==opId||hist.lastOrigin==change.origin&&change.origin&&("+"==change.origin.charAt(0)&&hist.lastModTime>time-(doc.cm?doc.cm.options.historyEventDelay:500)||"*"==change.origin.charAt(0)))&&(cur=function(hist,force){return force?(clearSelectionEvents(hist.done),lst(hist.done)):hist.done.length&&!lst(hist.done).ranges?lst(hist.done):hist.done.length>1&&!hist.done[hist.done.length-2].ranges?(hist.done.pop(),lst(hist.done)):void 0}(hist,hist.lastOp==opId)))last=lst(cur.changes),0==cmp(change.from,change.to)&&0==cmp(change.from,last.to)?last.to=changeEnd(change):cur.changes.push(historyChangeFromChange(doc,change));else{var before=lst(hist.done);for(before&&before.ranges||pushSelectionToHistory(doc.sel,hist.done),cur={changes:[historyChangeFromChange(doc,change)],generation:hist.generation},hist.done.push(cur);hist.done.length>hist.undoDepth;)hist.done.shift(),hist.done[0].ranges||hist.done.shift()}hist.done.push(selAfter),hist.generation=++hist.maxGeneration,hist.lastModTime=hist.lastSelTime=time,hist.lastOp=hist.lastSelOp=opId,hist.lastOrigin=hist.lastSelOrigin=change.origin,last||signal(doc,"historyAdded")}function addSelectionToHistory(doc,sel,opId,options){var hist=doc.history,origin=options&&options.origin;opId==hist.lastSelOp||origin&&hist.lastSelOrigin==origin&&(hist.lastModTime==hist.lastSelTime&&hist.lastOrigin==origin||function(doc,origin,prev,sel){var ch=origin.charAt(0);return"*"==ch||"+"==ch&&prev.ranges.length==sel.ranges.length&&prev.somethingSelected()==sel.somethingSelected()&&new Date-doc.history.lastSelTime<=(doc.cm?doc.cm.options.historyEventDelay:500)}(doc,origin,lst(hist.done),sel))?hist.done[hist.done.length-1]=sel:pushSelectionToHistory(sel,hist.done),hist.lastSelTime=+new Date,hist.lastSelOrigin=origin,hist.lastSelOp=opId,options&&!1!==options.clearRedo&&clearSelectionEvents(hist.undone)}function pushSelectionToHistory(sel,dest){var top=lst(dest);top&&top.ranges&&top.equals(sel)||dest.push(sel)}function attachLocalSpans(doc,change,from,to){var existing=change["spans_"+doc.id],n=0;doc.iter(Math.max(doc.first,from),Math.min(doc.first+doc.size,to),(function(line){line.markedSpans&&((existing||(existing=change["spans_"+doc.id]={}))[n]=line.markedSpans),++n}))}function removeClearedSpans(spans){if(!spans)return null;for(var out,i=0;i<spans.length;++i)spans[i].marker.explicitlyCleared?out||(out=spans.slice(0,i)):out&&out.push(spans[i]);return out?out.length?out:null:spans}function mergeOldSpans(doc,change){var old=function(doc,change){var found=change["spans_"+doc.id];if(!found)return null;for(var nw=[],i=0;i<change.text.length;++i)nw.push(removeClearedSpans(found[i]));return nw}(doc,change),stretched=stretchSpansOverChange(doc,change);if(!old)return stretched;if(!stretched)return old;for(var i=0;i<old.length;++i){var oldCur=old[i],stretchCur=stretched[i];if(oldCur&&stretchCur)spans:for(var j=0;j<stretchCur.length;++j){for(var span=stretchCur[j],k=0;k<oldCur.length;++k)if(oldCur[k].marker==span.marker)continue spans;oldCur.push(span)}else stretchCur&&(old[i]=stretchCur)}return old}function copyHistoryArray(events,newGroup,instantiateSel){for(var copy=[],i=0;i<events.length;++i){var event=events[i];if(event.ranges)copy.push(instantiateSel?Selection.prototype.deepCopy.call(event):event);else{var changes=event.changes,newChanges=[];copy.push({changes:newChanges});for(var j=0;j<changes.length;++j){var change=changes[j],m=void 0;if(newChanges.push({from:change.from,to:change.to,text:change.text}),newGroup)for(var prop in change)(m=prop.match(/^spans_(\d+)$/))&&indexOf(newGroup,Number(m[1]))>-1&&(lst(newChanges)[prop]=change[prop],delete change[prop])}}}return copy}function extendRange(range,head,other,extend){if(extend){var anchor=range.anchor;if(other){var posBefore=cmp(head,anchor)<0;posBefore!=cmp(other,anchor)<0?(anchor=head,head=other):posBefore!=cmp(head,other)<0&&(head=other)}return new Range(anchor,head)}return new Range(other||head,head)}function extendSelection(doc,head,other,options,extend){null==extend&&(extend=doc.cm&&(doc.cm.display.shift||doc.extend)),setSelection(doc,new Selection([extendRange(doc.sel.primary(),head,other,extend)],0),options)}function extendSelections(doc,heads,options){for(var out=[],extend=doc.cm&&(doc.cm.display.shift||doc.extend),i=0;i<doc.sel.ranges.length;i++)out[i]=extendRange(doc.sel.ranges[i],heads[i],null,extend);setSelection(doc,normalizeSelection(doc.cm,out,doc.sel.primIndex),options)}function replaceOneSelection(doc,i,range,options){var ranges=doc.sel.ranges.slice(0);ranges[i]=range,setSelection(doc,normalizeSelection(doc.cm,ranges,doc.sel.primIndex),options)}function setSimpleSelection(doc,anchor,head,options){setSelection(doc,simpleSelection(anchor,head),options)}function setSelectionReplaceHistory(doc,sel,options){var done=doc.history.done,last=lst(done);last&&last.ranges?(done[done.length-1]=sel,setSelectionNoUndo(doc,sel,options)):setSelection(doc,sel,options)}function setSelection(doc,sel,options){setSelectionNoUndo(doc,sel,options),addSelectionToHistory(doc,doc.sel,doc.cm?doc.cm.curOp.id:NaN,options)}function setSelectionNoUndo(doc,sel,options){(hasHandler(doc,"beforeSelectionChange")||doc.cm&&hasHandler(doc.cm,"beforeSelectionChange"))&&(sel=function(doc,sel,options){var obj={ranges:sel.ranges,update:function(ranges){this.ranges=[];for(var i=0;i<ranges.length;i++)this.ranges[i]=new Range(clipPos(doc,ranges[i].anchor),clipPos(doc,ranges[i].head))},origin:options&&options.origin};return signal(doc,"beforeSelectionChange",doc,obj),doc.cm&&signal(doc.cm,"beforeSelectionChange",doc.cm,obj),obj.ranges!=sel.ranges?normalizeSelection(doc.cm,obj.ranges,obj.ranges.length-1):sel}(doc,sel,options));var bias=options&&options.bias||(cmp(sel.primary().head,doc.sel.primary().head)<0?-1:1);setSelectionInner(doc,skipAtomicInSelection(doc,sel,bias,!0)),options&&!1===options.scroll||!doc.cm||ensureCursorVisible(doc.cm)}function setSelectionInner(doc,sel){sel.equals(doc.sel)||(doc.sel=sel,doc.cm&&(doc.cm.curOp.updateInput=1,doc.cm.curOp.selectionChanged=!0,signalCursorActivity(doc.cm)),signalLater(doc,"cursorActivity",doc))}function reCheckSelection(doc){setSelectionInner(doc,skipAtomicInSelection(doc,doc.sel,null,!1))}function skipAtomicInSelection(doc,sel,bias,mayClear){for(var out,i=0;i<sel.ranges.length;i++){var range=sel.ranges[i],old=sel.ranges.length==doc.sel.ranges.length&&doc.sel.ranges[i],newAnchor=skipAtomic(doc,range.anchor,old&&old.anchor,bias,mayClear),newHead=skipAtomic(doc,range.head,old&&old.head,bias,mayClear);(out||newAnchor!=range.anchor||newHead!=range.head)&&(out||(out=sel.ranges.slice(0,i)),out[i]=new Range(newAnchor,newHead))}return out?normalizeSelection(doc.cm,out,sel.primIndex):sel}function skipAtomicInner(doc,pos,oldPos,dir,mayClear){var line=getLine(doc,pos.line);if(line.markedSpans)for(var i=0;i<line.markedSpans.length;++i){var sp=line.markedSpans[i],m=sp.marker,preventCursorLeft="selectLeft"in m?!m.selectLeft:m.inclusiveLeft,preventCursorRight="selectRight"in m?!m.selectRight:m.inclusiveRight;if((null==sp.from||(preventCursorLeft?sp.from<=pos.ch:sp.from<pos.ch))&&(null==sp.to||(preventCursorRight?sp.to>=pos.ch:sp.to>pos.ch))){if(mayClear&&(signal(m,"beforeCursorEnter"),m.explicitlyCleared)){if(line.markedSpans){--i;continue}break}if(!m.atomic)continue;if(oldPos){var near=m.find(dir<0?1:-1),diff=void 0;if((dir<0?preventCursorRight:preventCursorLeft)&&(near=movePos(doc,near,-dir,near&&near.line==pos.line?line:null)),near&&near.line==pos.line&&(diff=cmp(near,oldPos))&&(dir<0?diff<0:diff>0))return skipAtomicInner(doc,near,pos,dir,mayClear)}var far=m.find(dir<0?-1:1);return(dir<0?preventCursorLeft:preventCursorRight)&&(far=movePos(doc,far,dir,far.line==pos.line?line:null)),far?skipAtomicInner(doc,far,pos,dir,mayClear):null}}return pos}function skipAtomic(doc,pos,oldPos,bias,mayClear){var dir=bias||1,found=skipAtomicInner(doc,pos,oldPos,dir,mayClear)||!mayClear&&skipAtomicInner(doc,pos,oldPos,dir,!0)||skipAtomicInner(doc,pos,oldPos,-dir,mayClear)||!mayClear&&skipAtomicInner(doc,pos,oldPos,-dir,!0);return found||(doc.cantEdit=!0,Pos(doc.first,0))}function movePos(doc,pos,dir,line){return dir<0&&0==pos.ch?pos.line>doc.first?clipPos(doc,Pos(pos.line-1)):null:dir>0&&pos.ch==(line||getLine(doc,pos.line)).text.length?pos.line<doc.first+doc.size-1?Pos(pos.line+1,0):null:new Pos(pos.line,pos.ch+dir)}function selectAll(cm){cm.setSelection(Pos(cm.firstLine(),0),Pos(cm.lastLine()),sel_dontScroll)}function filterChange(doc,change,update){var obj={canceled:!1,from:change.from,to:change.to,text:change.text,origin:change.origin,cancel:function(){return obj.canceled=!0}};return update&&(obj.update=function(from,to,text,origin){from&&(obj.from=clipPos(doc,from)),to&&(obj.to=clipPos(doc,to)),text&&(obj.text=text),void 0!==origin&&(obj.origin=origin)}),signal(doc,"beforeChange",doc,obj),doc.cm&&signal(doc.cm,"beforeChange",doc.cm,obj),obj.canceled?(doc.cm&&(doc.cm.curOp.updateInput=2),null):{from:obj.from,to:obj.to,text:obj.text,origin:obj.origin}}function makeChange(doc,change,ignoreReadOnly){if(doc.cm){if(!doc.cm.curOp)return operation(doc.cm,makeChange)(doc,change,ignoreReadOnly);if(doc.cm.state.suppressEdits)return}if(!(hasHandler(doc,"beforeChange")||doc.cm&&hasHandler(doc.cm,"beforeChange"))||(change=filterChange(doc,change,!0))){var split=sawReadOnlySpans&&!ignoreReadOnly&&function(doc,from,to){var markers=null;if(doc.iter(from.line,to.line+1,(function(line){if(line.markedSpans)for(var i=0;i<line.markedSpans.length;++i){var mark=line.markedSpans[i].marker;!mark.readOnly||markers&&-1!=indexOf(markers,mark)||(markers||(markers=[])).push(mark)}})),!markers)return null;for(var parts=[{from:from,to:to}],i=0;i<markers.length;++i)for(var mk=markers[i],m=mk.find(0),j=0;j<parts.length;++j){var p=parts[j];if(!(cmp(p.to,m.from)<0||cmp(p.from,m.to)>0)){var newParts=[j,1],dfrom=cmp(p.from,m.from),dto=cmp(p.to,m.to);(dfrom<0||!mk.inclusiveLeft&&!dfrom)&&newParts.push({from:p.from,to:m.from}),(dto>0||!mk.inclusiveRight&&!dto)&&newParts.push({from:m.to,to:p.to}),parts.splice.apply(parts,newParts),j+=newParts.length-3}}return parts}(doc,change.from,change.to);if(split)for(var i=split.length-1;i>=0;--i)makeChangeInner(doc,{from:split[i].from,to:split[i].to,text:i?[""]:change.text,origin:change.origin});else makeChangeInner(doc,change)}}function makeChangeInner(doc,change){if(1!=change.text.length||""!=change.text[0]||0!=cmp(change.from,change.to)){var selAfter=computeSelAfterChange(doc,change);addChangeToHistory(doc,change,selAfter,doc.cm?doc.cm.curOp.id:NaN),makeChangeSingleDoc(doc,change,selAfter,stretchSpansOverChange(doc,change));var rebased=[];linkedDocs(doc,(function(doc,sharedHist){sharedHist||-1!=indexOf(rebased,doc.history)||(rebaseHist(doc.history,change),rebased.push(doc.history)),makeChangeSingleDoc(doc,change,null,stretchSpansOverChange(doc,change))}))}}function makeChangeFromHistory(doc,type,allowSelectionOnly){var suppress=doc.cm&&doc.cm.state.suppressEdits;if(!suppress||allowSelectionOnly){for(var event,hist=doc.history,selAfter=doc.sel,source="undo"==type?hist.done:hist.undone,dest="undo"==type?hist.undone:hist.done,i=0;i<source.length&&(event=source[i],allowSelectionOnly?!event.ranges||event.equals(doc.sel):event.ranges);i++);if(i!=source.length){for(hist.lastOrigin=hist.lastSelOrigin=null;;){if(!(event=source.pop()).ranges){if(suppress)return void source.push(event);break}if(pushSelectionToHistory(event,dest),allowSelectionOnly&&!event.equals(doc.sel))return void setSelection(doc,event,{clearRedo:!1});selAfter=event}var antiChanges=[];pushSelectionToHistory(selAfter,dest),dest.push({changes:antiChanges,generation:hist.generation}),hist.generation=event.generation||++hist.maxGeneration;for(var filter=hasHandler(doc,"beforeChange")||doc.cm&&hasHandler(doc.cm,"beforeChange"),loop=function(i){var change=event.changes[i];if(change.origin=type,filter&&!filterChange(doc,change,!1))return source.length=0,{};antiChanges.push(historyChangeFromChange(doc,change));var after=i?computeSelAfterChange(doc,change):lst(source);makeChangeSingleDoc(doc,change,after,mergeOldSpans(doc,change)),!i&&doc.cm&&doc.cm.scrollIntoView({from:change.from,to:changeEnd(change)});var rebased=[];linkedDocs(doc,(function(doc,sharedHist){sharedHist||-1!=indexOf(rebased,doc.history)||(rebaseHist(doc.history,change),rebased.push(doc.history)),makeChangeSingleDoc(doc,change,null,mergeOldSpans(doc,change))}))},i$1=event.changes.length-1;i$1>=0;--i$1){var returned=loop(i$1);if(returned)return returned.v}}}}function shiftDoc(doc,distance){if(0!=distance&&(doc.first+=distance,doc.sel=new Selection(map(doc.sel.ranges,(function(range){return new Range(Pos(range.anchor.line+distance,range.anchor.ch),Pos(range.head.line+distance,range.head.ch))})),doc.sel.primIndex),doc.cm)){regChange(doc.cm,doc.first,doc.first-distance,distance);for(var d=doc.cm.display,l=d.viewFrom;l<d.viewTo;l++)regLineChange(doc.cm,l,"gutter")}}function makeChangeSingleDoc(doc,change,selAfter,spans){if(doc.cm&&!doc.cm.curOp)return operation(doc.cm,makeChangeSingleDoc)(doc,change,selAfter,spans);if(change.to.line<doc.first)shiftDoc(doc,change.text.length-1-(change.to.line-change.from.line));else if(!(change.from.line>doc.lastLine())){if(change.from.line<doc.first){var shift=change.text.length-1-(doc.first-change.from.line);shiftDoc(doc,shift),change={from:Pos(doc.first,0),to:Pos(change.to.line+shift,change.to.ch),text:[lst(change.text)],origin:change.origin}}var last=doc.lastLine();change.to.line>last&&(change={from:change.from,to:Pos(last,getLine(doc,last).text.length),text:[change.text[0]],origin:change.origin}),change.removed=getBetween(doc,change.from,change.to),selAfter||(selAfter=computeSelAfterChange(doc,change)),doc.cm?function(cm,change,spans){var doc=cm.doc,display=cm.display,from=change.from,to=change.to,recomputeMaxLength=!1,checkWidthStart=from.line;cm.options.lineWrapping||(checkWidthStart=lineNo(visualLine(getLine(doc,from.line))),doc.iter(checkWidthStart,to.line+1,(function(line){if(line==display.maxLine)return recomputeMaxLength=!0,!0}))),doc.sel.contains(change.from,change.to)>-1&&signalCursorActivity(cm),updateDoc(doc,change,spans,estimateHeight(cm)),cm.options.lineWrapping||(doc.iter(checkWidthStart,from.line+change.text.length,(function(line){var len=lineLength(line);len>display.maxLineLength&&(display.maxLine=line,display.maxLineLength=len,display.maxLineChanged=!0,recomputeMaxLength=!1)})),recomputeMaxLength&&(cm.curOp.updateMaxLine=!0)),function(doc,n){if(doc.modeFrontier=Math.min(doc.modeFrontier,n),!(doc.highlightFrontier<n-10)){for(var start=doc.first,line=n-1;line>start;line--){var saved=getLine(doc,line).stateAfter;if(saved&&(!(saved instanceof SavedContext)||line+saved.lookAhead<n)){start=line+1;break}}doc.highlightFrontier=Math.min(doc.highlightFrontier,start)}}(doc,from.line),startWorker(cm,400);var lendiff=change.text.length-(to.line-from.line)-1;change.full?regChange(cm):from.line!=to.line||1!=change.text.length||isWholeLineUpdate(cm.doc,change)?regChange(cm,from.line,to.line+1,lendiff):regLineChange(cm,from.line,"text");var changesHandler=hasHandler(cm,"changes"),changeHandler=hasHandler(cm,"change");if(changeHandler||changesHandler){var obj={from:from,to:to,text:change.text,removed:change.removed,origin:change.origin};changeHandler&&signalLater(cm,"change",cm,obj),changesHandler&&(cm.curOp.changeObjs||(cm.curOp.changeObjs=[])).push(obj)}cm.display.selForContextMenu=null}(doc.cm,change,spans):updateDoc(doc,change,spans),setSelectionNoUndo(doc,selAfter,sel_dontScroll),doc.cantEdit&&skipAtomic(doc,Pos(doc.firstLine(),0))&&(doc.cantEdit=!1)}}function replaceRange(doc,code,from,to,origin){var assign;to||(to=from),cmp(to,from)<0&&(from=(assign=[to,from])[0],to=assign[1]),"string"==typeof code&&(code=doc.splitLines(code)),makeChange(doc,{from:from,to:to,text:code,origin:origin})}function rebaseHistSelSingle(pos,from,to,diff){to<pos.line?pos.line+=diff:from<pos.line&&(pos.line=from,pos.ch=0)}function rebaseHistArray(array,from,to,diff){for(var i=0;i<array.length;++i){var sub=array[i],ok=!0;if(sub.ranges){sub.copied||((sub=array[i]=sub.deepCopy()).copied=!0);for(var j=0;j<sub.ranges.length;j++)rebaseHistSelSingle(sub.ranges[j].anchor,from,to,diff),rebaseHistSelSingle(sub.ranges[j].head,from,to,diff)}else{for(var j$1=0;j$1<sub.changes.length;++j$1){var cur=sub.changes[j$1];if(to<cur.from.line)cur.from=Pos(cur.from.line+diff,cur.from.ch),cur.to=Pos(cur.to.line+diff,cur.to.ch);else if(from<=cur.to.line){ok=!1;break}}ok||(array.splice(0,i+1),i=0)}}}function rebaseHist(hist,change){var from=change.from.line,to=change.to.line,diff=change.text.length-(to-from)-1;rebaseHistArray(hist.done,from,to,diff),rebaseHistArray(hist.undone,from,to,diff)}function changeLine(doc,handle,changeType,op){var no=handle,line=handle;return"number"==typeof handle?line=getLine(doc,clipLine(doc,handle)):no=lineNo(handle),null==no?null:(op(line,no)&&doc.cm&&regLineChange(doc.cm,no,changeType),line)}function LeafChunk(lines){this.lines=lines,this.parent=null;for(var height=0,i=0;i<lines.length;++i)lines[i].parent=this,height+=lines[i].height;this.height=height}function BranchChunk(children){this.children=children;for(var size=0,height=0,i=0;i<children.length;++i){var ch=children[i];size+=ch.chunkSize(),height+=ch.height,ch.parent=this}this.size=size,this.height=height,this.parent=null}Range.prototype.from=function(){return minPos(this.anchor,this.head)},Range.prototype.to=function(){return maxPos(this.anchor,this.head)},Range.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},LeafChunk.prototype={chunkSize:function(){return this.lines.length},removeInner:function(at,n){for(var i=at,e=at+n;i<e;++i){var line=this.lines[i];this.height-=line.height,cleanUpLine(line),signalLater(line,"delete")}this.lines.splice(at,n)},collapse:function(lines){lines.push.apply(lines,this.lines)},insertInner:function(at,lines,height){this.height+=height,this.lines=this.lines.slice(0,at).concat(lines).concat(this.lines.slice(at));for(var i=0;i<lines.length;++i)lines[i].parent=this},iterN:function(at,n,op){for(var e=at+n;at<e;++at)if(op(this.lines[at]))return!0}},BranchChunk.prototype={chunkSize:function(){return this.size},removeInner:function(at,n){this.size-=n;for(var i=0;i<this.children.length;++i){var child=this.children[i],sz=child.chunkSize();if(at<sz){var rm=Math.min(n,sz-at),oldHeight=child.height;if(child.removeInner(at,rm),this.height-=oldHeight-child.height,sz==rm&&(this.children.splice(i--,1),child.parent=null),0==(n-=rm))break;at=0}else at-=sz}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof LeafChunk))){var lines=[];this.collapse(lines),this.children=[new LeafChunk(lines)],this.children[0].parent=this}},collapse:function(lines){for(var i=0;i<this.children.length;++i)this.children[i].collapse(lines)},insertInner:function(at,lines,height){this.size+=lines.length,this.height+=height;for(var i=0;i<this.children.length;++i){var child=this.children[i],sz=child.chunkSize();if(at<=sz){if(child.insertInner(at,lines,height),child.lines&&child.lines.length>50){for(var remaining=child.lines.length%25+25,pos=remaining;pos<child.lines.length;){var leaf=new LeafChunk(child.lines.slice(pos,pos+=25));child.height-=leaf.height,this.children.splice(++i,0,leaf),leaf.parent=this}child.lines=child.lines.slice(0,remaining),this.maybeSpill()}break}at-=sz}},maybeSpill:function(){if(!(this.children.length<=10)){var me=this;do{var sibling=new BranchChunk(me.children.splice(me.children.length-5,5));if(me.parent){me.size-=sibling.size,me.height-=sibling.height;var myIndex=indexOf(me.parent.children,me);me.parent.children.splice(myIndex+1,0,sibling)}else{var copy=new BranchChunk(me.children);copy.parent=me,me.children=[copy,sibling],me=copy}sibling.parent=me.parent}while(me.children.length>10);me.parent.maybeSpill()}},iterN:function(at,n,op){for(var i=0;i<this.children.length;++i){var child=this.children[i],sz=child.chunkSize();if(at<sz){var used=Math.min(n,sz-at);if(child.iterN(at,used,op))return!0;if(0==(n-=used))break;at=0}else at-=sz}}};var LineWidget=function(doc,node,options){if(options)for(var opt in options)options.hasOwnProperty(opt)&&(this[opt]=options[opt]);this.doc=doc,this.node=node};function adjustScrollWhenAboveVisible(cm,line,diff){heightAtLine(line)<(cm.curOp&&cm.curOp.scrollTop||cm.doc.scrollTop)&&addToScrollTop(cm,diff)}LineWidget.prototype.clear=function(){var cm=this.doc.cm,ws=this.line.widgets,line=this.line,no=lineNo(line);if(null!=no&&ws){for(var i=0;i<ws.length;++i)ws[i]==this&&ws.splice(i--,1);ws.length||(line.widgets=null);var height=widgetHeight(this);updateLineHeight(line,Math.max(0,line.height-height)),cm&&(runInOp(cm,(function(){adjustScrollWhenAboveVisible(cm,line,-height),regLineChange(cm,no,"widget")})),signalLater(cm,"lineWidgetCleared",cm,this,no))}},LineWidget.prototype.changed=function(){var this$1=this,oldH=this.height,cm=this.doc.cm,line=this.line;this.height=null;var diff=widgetHeight(this)-oldH;diff&&(lineIsHidden(this.doc,line)||updateLineHeight(line,line.height+diff),cm&&runInOp(cm,(function(){cm.curOp.forceUpdate=!0,adjustScrollWhenAboveVisible(cm,line,diff),signalLater(cm,"lineWidgetChanged",cm,this$1,lineNo(line))})))},eventMixin(LineWidget);var nextMarkerId=0,TextMarker=function(doc,type){this.lines=[],this.type=type,this.doc=doc,this.id=++nextMarkerId};function markText(doc,from,to,options,type){if(options&&options.shared)return function(doc,from,to,options,type){(options=copyObj(options)).shared=!1;var markers=[markText(doc,from,to,options,type)],primary=markers[0],widget=options.widgetNode;return linkedDocs(doc,(function(doc){widget&&(options.widgetNode=widget.cloneNode(!0)),markers.push(markText(doc,clipPos(doc,from),clipPos(doc,to),options,type));for(var i=0;i<doc.linked.length;++i)if(doc.linked[i].isParent)return;primary=lst(markers)})),new SharedTextMarker(markers,primary)}(doc,from,to,options,type);if(doc.cm&&!doc.cm.curOp)return operation(doc.cm,markText)(doc,from,to,options,type);var marker=new TextMarker(doc,type),diff=cmp(from,to);if(options&&copyObj(options,marker,!1),diff>0||0==diff&&!1!==marker.clearWhenEmpty)return marker;if(marker.replacedWith&&(marker.collapsed=!0,marker.widgetNode=eltP("span",[marker.replacedWith],"CodeMirror-widget"),options.handleMouseEvents||marker.widgetNode.setAttribute("cm-ignore-events","true"),options.insertLeft&&(marker.widgetNode.insertLeft=!0)),marker.collapsed){if(conflictingCollapsedRange(doc,from.line,from,to,marker)||from.line!=to.line&&conflictingCollapsedRange(doc,to.line,from,to,marker))throw new Error("Inserting collapsed marker partially overlapping an existing one");sawCollapsedSpans=!0}marker.addToHistory&&addChangeToHistory(doc,{from:from,to:to,origin:"markText"},doc.sel,NaN);var updateMaxLine,curLine=from.line,cm=doc.cm;if(doc.iter(curLine,to.line+1,(function(line){cm&&marker.collapsed&&!cm.options.lineWrapping&&visualLine(line)==cm.display.maxLine&&(updateMaxLine=!0),marker.collapsed&&curLine!=from.line&&updateLineHeight(line,0),function(line,span){line.markedSpans=line.markedSpans?line.markedSpans.concat([span]):[span],span.marker.attachLine(line)}(line,new MarkedSpan(marker,curLine==from.line?from.ch:null,curLine==to.line?to.ch:null)),++curLine})),marker.collapsed&&doc.iter(from.line,to.line+1,(function(line){lineIsHidden(doc,line)&&updateLineHeight(line,0)})),marker.clearOnEnter&&on(marker,"beforeCursorEnter",(function(){return marker.clear()})),marker.readOnly&&(sawReadOnlySpans=!0,(doc.history.done.length||doc.history.undone.length)&&doc.clearHistory()),marker.collapsed&&(marker.id=++nextMarkerId,marker.atomic=!0),cm){if(updateMaxLine&&(cm.curOp.updateMaxLine=!0),marker.collapsed)regChange(cm,from.line,to.line+1);else if(marker.className||marker.startStyle||marker.endStyle||marker.css||marker.attributes||marker.title)for(var i=from.line;i<=to.line;i++)regLineChange(cm,i,"text");marker.atomic&&reCheckSelection(cm.doc),signalLater(cm,"markerAdded",cm,marker)}return marker}TextMarker.prototype.clear=function(){if(!this.explicitlyCleared){var cm=this.doc.cm,withOp=cm&&!cm.curOp;if(withOp&&startOperation(cm),hasHandler(this,"clear")){var found=this.find();found&&signalLater(this,"clear",found.from,found.to)}for(var min=null,max=null,i=0;i<this.lines.length;++i){var line=this.lines[i],span=getMarkedSpanFor(line.markedSpans,this);cm&&!this.collapsed?regLineChange(cm,lineNo(line),"text"):cm&&(null!=span.to&&(max=lineNo(line)),null!=span.from&&(min=lineNo(line))),line.markedSpans=removeMarkedSpan(line.markedSpans,span),null==span.from&&this.collapsed&&!lineIsHidden(this.doc,line)&&cm&&updateLineHeight(line,textHeight(cm.display))}if(cm&&this.collapsed&&!cm.options.lineWrapping)for(var i$1=0;i$1<this.lines.length;++i$1){var visual=visualLine(this.lines[i$1]),len=lineLength(visual);len>cm.display.maxLineLength&&(cm.display.maxLine=visual,cm.display.maxLineLength=len,cm.display.maxLineChanged=!0)}null!=min&&cm&&this.collapsed&&regChange(cm,min,max+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,cm&&reCheckSelection(cm.doc)),cm&&signalLater(cm,"markerCleared",cm,this,min,max),withOp&&endOperation(cm),this.parent&&this.parent.clear()}},TextMarker.prototype.find=function(side,lineObj){var from,to;null==side&&"bookmark"==this.type&&(side=1);for(var i=0;i<this.lines.length;++i){var line=this.lines[i],span=getMarkedSpanFor(line.markedSpans,this);if(null!=span.from&&(from=Pos(lineObj?line:lineNo(line),span.from),-1==side))return from;if(null!=span.to&&(to=Pos(lineObj?line:lineNo(line),span.to),1==side))return to}return from&&{from:from,to:to}},TextMarker.prototype.changed=function(){var this$1=this,pos=this.find(-1,!0),widget=this,cm=this.doc.cm;pos&&cm&&runInOp(cm,(function(){var line=pos.line,lineN=lineNo(pos.line),view=findViewForLine(cm,lineN);if(view&&(clearLineMeasurementCacheFor(view),cm.curOp.selectionChanged=cm.curOp.forceUpdate=!0),cm.curOp.updateMaxLine=!0,!lineIsHidden(widget.doc,line)&&null!=widget.height){var oldHeight=widget.height;widget.height=null;var dHeight=widgetHeight(widget)-oldHeight;dHeight&&updateLineHeight(line,line.height+dHeight)}signalLater(cm,"markerChanged",cm,this$1)}))},TextMarker.prototype.attachLine=function(line){if(!this.lines.length&&this.doc.cm){var op=this.doc.cm.curOp;op.maybeHiddenMarkers&&-1!=indexOf(op.maybeHiddenMarkers,this)||(op.maybeUnhiddenMarkers||(op.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(line)},TextMarker.prototype.detachLine=function(line){if(this.lines.splice(indexOf(this.lines,line),1),!this.lines.length&&this.doc.cm){var op=this.doc.cm.curOp;(op.maybeHiddenMarkers||(op.maybeHiddenMarkers=[])).push(this)}},eventMixin(TextMarker);var SharedTextMarker=function(markers,primary){this.markers=markers,this.primary=primary;for(var i=0;i<markers.length;++i)markers[i].parent=this};function findSharedMarkers(doc){return doc.findMarks(Pos(doc.first,0),doc.clipPos(Pos(doc.lastLine())),(function(m){return m.parent}))}function detachSharedMarkers(markers){for(var loop=function(i){var marker=markers[i],linked=[marker.primary.doc];linkedDocs(marker.primary.doc,(function(d){return linked.push(d)}));for(var j=0;j<marker.markers.length;j++){var subMarker=marker.markers[j];-1==indexOf(linked,subMarker.doc)&&(subMarker.parent=null,marker.markers.splice(j--,1))}},i=0;i<markers.length;i++)loop(i)}SharedTextMarker.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var i=0;i<this.markers.length;++i)this.markers[i].clear();signalLater(this,"clear")}},SharedTextMarker.prototype.find=function(side,lineObj){return this.primary.find(side,lineObj)},eventMixin(SharedTextMarker);var nextDocId=0,Doc=function(text,mode,firstLine,lineSep,direction){if(!(this instanceof Doc))return new Doc(text,mode,firstLine,lineSep,direction);null==firstLine&&(firstLine=0),BranchChunk.call(this,[new LeafChunk([new Line("",null)])]),this.first=firstLine,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=firstLine;var start=Pos(firstLine,0);this.sel=simpleSelection(start),this.history=new History(null),this.id=++nextDocId,this.modeOption=mode,this.lineSep=lineSep,this.direction="rtl"==direction?"rtl":"ltr",this.extend=!1,"string"==typeof text&&(text=this.splitLines(text)),updateDoc(this,{from:start,to:start,text:text}),setSelection(this,simpleSelection(start),sel_dontScroll)};Doc.prototype=createObj(BranchChunk.prototype,{constructor:Doc,iter:function(from,to,op){op?this.iterN(from-this.first,to-from,op):this.iterN(this.first,this.first+this.size,from)},insert:function(at,lines){for(var height=0,i=0;i<lines.length;++i)height+=lines[i].height;this.insertInner(at-this.first,lines,height)},remove:function(at,n){this.removeInner(at-this.first,n)},getValue:function(lineSep){var lines=getLines(this,this.first,this.first+this.size);return!1===lineSep?lines:lines.join(lineSep||this.lineSeparator())},setValue:docMethodOp((function(code){var top=Pos(this.first,0),last=this.first+this.size-1;makeChange(this,{from:top,to:Pos(last,getLine(this,last).text.length),text:this.splitLines(code),origin:"setValue",full:!0},!0),this.cm&&scrollToCoords(this.cm,0,0),setSelection(this,simpleSelection(top),sel_dontScroll)})),replaceRange:function(code,from,to,origin){replaceRange(this,code,from=clipPos(this,from),to=to?clipPos(this,to):from,origin)},getRange:function(from,to,lineSep){var lines=getBetween(this,clipPos(this,from),clipPos(this,to));return!1===lineSep?lines:lines.join(lineSep||this.lineSeparator())},getLine:function(line){var l=this.getLineHandle(line);return l&&l.text},getLineHandle:function(line){if(isLine(this,line))return getLine(this,line)},getLineNumber:function(line){return lineNo(line)},getLineHandleVisualStart:function(line){return"number"==typeof line&&(line=getLine(this,line)),visualLine(line)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(pos){return clipPos(this,pos)},getCursor:function(start){var range=this.sel.primary();return null==start||"head"==start?range.head:"anchor"==start?range.anchor:"end"==start||"to"==start||!1===start?range.to():range.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:docMethodOp((function(line,ch,options){setSimpleSelection(this,clipPos(this,"number"==typeof line?Pos(line,ch||0):line),null,options)})),setSelection:docMethodOp((function(anchor,head,options){setSimpleSelection(this,clipPos(this,anchor),clipPos(this,head||anchor),options)})),extendSelection:docMethodOp((function(head,other,options){extendSelection(this,clipPos(this,head),other&&clipPos(this,other),options)})),extendSelections:docMethodOp((function(heads,options){extendSelections(this,clipPosArray(this,heads),options)})),extendSelectionsBy:docMethodOp((function(f,options){extendSelections(this,clipPosArray(this,map(this.sel.ranges,f)),options)})),setSelections:docMethodOp((function(ranges,primary,options){if(ranges.length){for(var out=[],i=0;i<ranges.length;i++)out[i]=new Range(clipPos(this,ranges[i].anchor),clipPos(this,ranges[i].head));null==primary&&(primary=Math.min(ranges.length-1,this.sel.primIndex)),setSelection(this,normalizeSelection(this.cm,out,primary),options)}})),addSelection:docMethodOp((function(anchor,head,options){var ranges=this.sel.ranges.slice(0);ranges.push(new Range(clipPos(this,anchor),clipPos(this,head||anchor))),setSelection(this,normalizeSelection(this.cm,ranges,ranges.length-1),options)})),getSelection:function(lineSep){for(var lines,ranges=this.sel.ranges,i=0;i<ranges.length;i++){var sel=getBetween(this,ranges[i].from(),ranges[i].to());lines=lines?lines.concat(sel):sel}return!1===lineSep?lines:lines.join(lineSep||this.lineSeparator())},getSelections:function(lineSep){for(var parts=[],ranges=this.sel.ranges,i=0;i<ranges.length;i++){var sel=getBetween(this,ranges[i].from(),ranges[i].to());!1!==lineSep&&(sel=sel.join(lineSep||this.lineSeparator())),parts[i]=sel}return parts},replaceSelection:function(code,collapse,origin){for(var dup=[],i=0;i<this.sel.ranges.length;i++)dup[i]=code;this.replaceSelections(dup,collapse,origin||"+input")},replaceSelections:docMethodOp((function(code,collapse,origin){for(var changes=[],sel=this.sel,i=0;i<sel.ranges.length;i++){var range=sel.ranges[i];changes[i]={from:range.from(),to:range.to(),text:this.splitLines(code[i]),origin:origin}}for(var newSel=collapse&&"end"!=collapse&&function(doc,changes,hint){for(var out=[],oldPrev=Pos(doc.first,0),newPrev=oldPrev,i=0;i<changes.length;i++){var change=changes[i],from=offsetPos(change.from,oldPrev,newPrev),to=offsetPos(changeEnd(change),oldPrev,newPrev);if(oldPrev=change.to,newPrev=to,"around"==hint){var range=doc.sel.ranges[i],inv=cmp(range.head,range.anchor)<0;out[i]=new Range(inv?to:from,inv?from:to)}else out[i]=new Range(from,from)}return new Selection(out,doc.sel.primIndex)}(this,changes,collapse),i$1=changes.length-1;i$1>=0;i$1--)makeChange(this,changes[i$1]);newSel?setSelectionReplaceHistory(this,newSel):this.cm&&ensureCursorVisible(this.cm)})),undo:docMethodOp((function(){makeChangeFromHistory(this,"undo")})),redo:docMethodOp((function(){makeChangeFromHistory(this,"redo")})),undoSelection:docMethodOp((function(){makeChangeFromHistory(this,"undo",!0)})),redoSelection:docMethodOp((function(){makeChangeFromHistory(this,"redo",!0)})),setExtending:function(val){this.extend=val},getExtending:function(){return this.extend},historySize:function(){for(var hist=this.history,done=0,undone=0,i=0;i<hist.done.length;i++)hist.done[i].ranges||++done;for(var i$1=0;i$1<hist.undone.length;i$1++)hist.undone[i$1].ranges||++undone;return{undo:done,redo:undone}},clearHistory:function(){var this$1=this;this.history=new History(this.history.maxGeneration),linkedDocs(this,(function(doc){return doc.history=this$1.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(forceSplit){return forceSplit&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(gen){return this.history.generation==(gen||this.cleanGeneration)},getHistory:function(){return{done:copyHistoryArray(this.history.done),undone:copyHistoryArray(this.history.undone)}},setHistory:function(histData){var hist=this.history=new History(this.history.maxGeneration);hist.done=copyHistoryArray(histData.done.slice(0),null,!0),hist.undone=copyHistoryArray(histData.undone.slice(0),null,!0)},setGutterMarker:docMethodOp((function(line,gutterID,value){return changeLine(this,line,"gutter",(function(line){var markers=line.gutterMarkers||(line.gutterMarkers={});return markers[gutterID]=value,!value&&isEmpty(markers)&&(line.gutterMarkers=null),!0}))})),clearGutter:docMethodOp((function(gutterID){var this$1=this;this.iter((function(line){line.gutterMarkers&&line.gutterMarkers[gutterID]&&changeLine(this$1,line,"gutter",(function(){return line.gutterMarkers[gutterID]=null,isEmpty(line.gutterMarkers)&&(line.gutterMarkers=null),!0}))}))})),lineInfo:function(line){var n;if("number"==typeof line){if(!isLine(this,line))return null;if(n=line,!(line=getLine(this,line)))return null}else if(null==(n=lineNo(line)))return null;return{line:n,handle:line,text:line.text,gutterMarkers:line.gutterMarkers,textClass:line.textClass,bgClass:line.bgClass,wrapClass:line.wrapClass,widgets:line.widgets}},addLineClass:docMethodOp((function(handle,where,cls){return changeLine(this,handle,"gutter"==where?"gutter":"class",(function(line){var prop="text"==where?"textClass":"background"==where?"bgClass":"gutter"==where?"gutterClass":"wrapClass";if(line[prop]){if(classTest(cls).test(line[prop]))return!1;line[prop]+=" "+cls}else line[prop]=cls;return!0}))})),removeLineClass:docMethodOp((function(handle,where,cls){return changeLine(this,handle,"gutter"==where?"gutter":"class",(function(line){var prop="text"==where?"textClass":"background"==where?"bgClass":"gutter"==where?"gutterClass":"wrapClass",cur=line[prop];if(!cur)return!1;if(null==cls)line[prop]=null;else{var found=cur.match(classTest(cls));if(!found)return!1;var end=found.index+found[0].length;line[prop]=cur.slice(0,found.index)+(found.index&&end!=cur.length?" ":"")+cur.slice(end)||null}return!0}))})),addLineWidget:docMethodOp((function(handle,node,options){return function(doc,handle,node,options){var widget=new LineWidget(doc,node,options),cm=doc.cm;return cm&&widget.noHScroll&&(cm.display.alignWidgets=!0),changeLine(doc,handle,"widget",(function(line){var widgets=line.widgets||(line.widgets=[]);if(null==widget.insertAt?widgets.push(widget):widgets.splice(Math.min(widgets.length-1,Math.max(0,widget.insertAt)),0,widget),widget.line=line,cm&&!lineIsHidden(doc,line)){var aboveVisible=heightAtLine(line)<doc.scrollTop;updateLineHeight(line,line.height+widgetHeight(widget)),aboveVisible&&addToScrollTop(cm,widget.height),cm.curOp.forceUpdate=!0}return!0})),cm&&signalLater(cm,"lineWidgetAdded",cm,widget,"number"==typeof handle?handle:lineNo(handle)),widget}(this,handle,node,options)})),removeLineWidget:function(widget){widget.clear()},markText:function(from,to,options){return markText(this,clipPos(this,from),clipPos(this,to),options,options&&options.type||"range")},setBookmark:function(pos,options){var realOpts={replacedWith:options&&(null==options.nodeType?options.widget:options),insertLeft:options&&options.insertLeft,clearWhenEmpty:!1,shared:options&&options.shared,handleMouseEvents:options&&options.handleMouseEvents};return markText(this,pos=clipPos(this,pos),pos,realOpts,"bookmark")},findMarksAt:function(pos){var markers=[],spans=getLine(this,(pos=clipPos(this,pos)).line).markedSpans;if(spans)for(var i=0;i<spans.length;++i){var span=spans[i];(null==span.from||span.from<=pos.ch)&&(null==span.to||span.to>=pos.ch)&&markers.push(span.marker.parent||span.marker)}return markers},findMarks:function(from,to,filter){from=clipPos(this,from),to=clipPos(this,to);var found=[],lineNo=from.line;return this.iter(from.line,to.line+1,(function(line){var spans=line.markedSpans;if(spans)for(var i=0;i<spans.length;i++){var span=spans[i];null!=span.to&&lineNo==from.line&&from.ch>=span.to||null==span.from&&lineNo!=from.line||null!=span.from&&lineNo==to.line&&span.from>=to.ch||filter&&!filter(span.marker)||found.push(span.marker.parent||span.marker)}++lineNo})),found},getAllMarks:function(){var markers=[];return this.iter((function(line){var sps=line.markedSpans;if(sps)for(var i=0;i<sps.length;++i)null!=sps[i].from&&markers.push(sps[i].marker)})),markers},posFromIndex:function(off){var ch,lineNo=this.first,sepSize=this.lineSeparator().length;return this.iter((function(line){var sz=line.text.length+sepSize;if(sz>off)return ch=off,!0;off-=sz,++lineNo})),clipPos(this,Pos(lineNo,ch))},indexFromPos:function(coords){var index=(coords=clipPos(this,coords)).ch;if(coords.line<this.first||coords.ch<0)return 0;var sepSize=this.lineSeparator().length;return this.iter(this.first,coords.line,(function(line){index+=line.text.length+sepSize})),index},copy:function(copyHistory){var doc=new Doc(getLines(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return doc.scrollTop=this.scrollTop,doc.scrollLeft=this.scrollLeft,doc.sel=this.sel,doc.extend=!1,copyHistory&&(doc.history.undoDepth=this.history.undoDepth,doc.setHistory(this.getHistory())),doc},linkedDoc:function(options){options||(options={});var from=this.first,to=this.first+this.size;null!=options.from&&options.from>from&&(from=options.from),null!=options.to&&options.to<to&&(to=options.to);var copy=new Doc(getLines(this,from,to),options.mode||this.modeOption,from,this.lineSep,this.direction);return options.sharedHist&&(copy.history=this.history),(this.linked||(this.linked=[])).push({doc:copy,sharedHist:options.sharedHist}),copy.linked=[{doc:this,isParent:!0,sharedHist:options.sharedHist}],function(doc,markers){for(var i=0;i<markers.length;i++){var marker=markers[i],pos=marker.find(),mFrom=doc.clipPos(pos.from),mTo=doc.clipPos(pos.to);if(cmp(mFrom,mTo)){var subMark=markText(doc,mFrom,mTo,marker.primary,marker.primary.type);marker.markers.push(subMark),subMark.parent=marker}}}(copy,findSharedMarkers(this)),copy},unlinkDoc:function(other){if(other instanceof CodeMirror&&(other=other.doc),this.linked)for(var i=0;i<this.linked.length;++i)if(this.linked[i].doc==other){this.linked.splice(i,1),other.unlinkDoc(this),detachSharedMarkers(findSharedMarkers(this));break}if(other.history==this.history){var splitIds=[other.id];linkedDocs(other,(function(doc){return splitIds.push(doc.id)}),!0),other.history=new History(null),other.history.done=copyHistoryArray(this.history.done,splitIds),other.history.undone=copyHistoryArray(this.history.undone,splitIds)}},iterLinkedDocs:function(f){linkedDocs(this,f)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(str){return this.lineSep?str.split(this.lineSep):splitLinesAuto(str)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:docMethodOp((function(dir){var cm;"rtl"!=dir&&(dir="ltr"),dir!=this.direction&&(this.direction=dir,this.iter((function(line){return line.order=null})),this.cm&&runInOp(cm=this.cm,(function(){setDirectionClass(cm),regChange(cm)})))}))}),Doc.prototype.eachLine=Doc.prototype.iter;var lastDrop=0;function onDrop(e){var cm=this;if(clearDragCursor(cm),!signalDOMEvent(cm,e)&&!eventInWidget(cm.display,e)){e_preventDefault(e),ie&&(lastDrop=+new Date);var pos=posFromMouse(cm,e,!0),files=e.dataTransfer.files;if(pos&&!cm.isReadOnly())if(files&&files.length&&window.FileReader&&window.File)for(var n=files.length,text=Array(n),read=0,markAsReadAndPasteIfAllFilesAreRead=function(){++read==n&&operation(cm,(function(){var change={from:pos=clipPos(cm.doc,pos),to:pos,text:cm.doc.splitLines(text.filter((function(t){return null!=t})).join(cm.doc.lineSeparator())),origin:"paste"};makeChange(cm.doc,change),setSelectionReplaceHistory(cm.doc,simpleSelection(pos,changeEnd(change)))}))()},readTextFromFile=function(file,i){if(cm.options.allowDropFileTypes&&-1==indexOf(cm.options.allowDropFileTypes,file.type))markAsReadAndPasteIfAllFilesAreRead();else{var reader=new FileReader;reader.onerror=function(){return markAsReadAndPasteIfAllFilesAreRead()},reader.onload=function(){var content=reader.result;/[\x00-\x08\x0e-\x1f]{2}/.test(content)?markAsReadAndPasteIfAllFilesAreRead():(text[i]=content,markAsReadAndPasteIfAllFilesAreRead())},reader.readAsText(file)}},i=0;i<files.length;i++)readTextFromFile(files[i],i);else{if(cm.state.draggingText&&cm.doc.sel.contains(pos)>-1)return cm.state.draggingText(e),void setTimeout((function(){return cm.display.input.focus()}),20);try{var text$1=e.dataTransfer.getData("Text");if(text$1){var selected;if(cm.state.draggingText&&!cm.state.draggingText.copy&&(selected=cm.listSelections()),setSelectionNoUndo(cm.doc,simpleSelection(pos,pos)),selected)for(var i$1=0;i$1<selected.length;++i$1)replaceRange(cm.doc,"",selected[i$1].anchor,selected[i$1].head,"drag");cm.replaceSelection(text$1,"around","paste"),cm.display.input.focus()}}catch(e){}}}}function clearDragCursor(cm){cm.display.dragCursor&&(cm.display.lineSpace.removeChild(cm.display.dragCursor),cm.display.dragCursor=null)}function forEachCodeMirror(f){if(document.getElementsByClassName){for(var byClass=document.getElementsByClassName("CodeMirror"),editors=[],i=0;i<byClass.length;i++){var cm=byClass[i].CodeMirror;cm&&editors.push(cm)}editors.length&&editors[0].operation((function(){for(var i=0;i<editors.length;i++)f(editors[i])}))}}var globalsRegistered=!1;function ensureGlobalHandlers(){var resizeTimer;globalsRegistered||(on(window,"resize",(function(){null==resizeTimer&&(resizeTimer=setTimeout((function(){resizeTimer=null,forEachCodeMirror(onResize)}),100))})),on(window,"blur",(function(){return forEachCodeMirror(onBlur)})),globalsRegistered=!0)}function onResize(cm){var d=cm.display;d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.scrollbarsClipped=!1,cm.setSize()}for(var keyNames={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},i=0;i<10;i++)keyNames[i+48]=keyNames[i+96]=String(i);for(var i$1=65;i$1<=90;i$1++)keyNames[i$1]=String.fromCharCode(i$1);for(var i$2=1;i$2<=12;i$2++)keyNames[i$2+111]=keyNames[i$2+63235]="F"+i$2;var keyMap={};function normalizeKeyName(name){var alt,ctrl,shift,cmd,parts=name.split(/-(?!$)/);name=parts[parts.length-1];for(var i=0;i<parts.length-1;i++){var mod=parts[i];if(/^(cmd|meta|m)$/i.test(mod))cmd=!0;else if(/^a(lt)?$/i.test(mod))alt=!0;else if(/^(c|ctrl|control)$/i.test(mod))ctrl=!0;else{if(!/^s(hift)?$/i.test(mod))throw new Error("Unrecognized modifier name: "+mod);shift=!0}}return alt&&(name="Alt-"+name),ctrl&&(name="Ctrl-"+name),cmd&&(name="Cmd-"+name),shift&&(name="Shift-"+name),name}function normalizeKeyMap(keymap){var copy={};for(var keyname in keymap)if(keymap.hasOwnProperty(keyname)){var value=keymap[keyname];if(/^(name|fallthrough|(de|at)tach)$/.test(keyname))continue;if("..."==value){delete keymap[keyname];continue}for(var keys=map(keyname.split(" "),normalizeKeyName),i=0;i<keys.length;i++){var val=void 0,name=void 0;i==keys.length-1?(name=keys.join(" "),val=value):(name=keys.slice(0,i+1).join(" "),val="...");var prev=copy[name];if(prev){if(prev!=val)throw new Error("Inconsistent bindings for "+name)}else copy[name]=val}delete keymap[keyname]}for(var prop in copy)keymap[prop]=copy[prop];return keymap}function lookupKey(key,map,handle,context){var found=(map=getKeyMap(map)).call?map.call(key,context):map[key];if(!1===found)return"nothing";if("..."===found)return"multi";if(null!=found&&handle(found))return"handled";if(map.fallthrough){if("[object Array]"!=Object.prototype.toString.call(map.fallthrough))return lookupKey(key,map.fallthrough,handle,context);for(var i=0;i<map.fallthrough.length;i++){var result=lookupKey(key,map.fallthrough[i],handle,context);if(result)return result}}}function isModifierKey(value){var name="string"==typeof value?value:keyNames[value.keyCode];return"Ctrl"==name||"Alt"==name||"Shift"==name||"Mod"==name}function addModifierNames(name,event,noShift){var base=name;return event.altKey&&"Alt"!=base&&(name="Alt-"+name),(flipCtrlCmd?event.metaKey:event.ctrlKey)&&"Ctrl"!=base&&(name="Ctrl-"+name),(flipCtrlCmd?event.ctrlKey:event.metaKey)&&"Cmd"!=base&&(name="Cmd-"+name),!noShift&&event.shiftKey&&"Shift"!=base&&(name="Shift-"+name),name}function keyName(event,noShift){if(presto&&34==event.keyCode&&event.char)return!1;var name=keyNames[event.keyCode];return null!=name&&!event.altGraphKey&&(3==event.keyCode&&event.code&&(name=event.code),addModifierNames(name,event,noShift))}function getKeyMap(val){return"string"==typeof val?keyMap[val]:val}function deleteNearSelection(cm,compute){for(var ranges=cm.doc.sel.ranges,kill=[],i=0;i<ranges.length;i++){for(var toKill=compute(ranges[i]);kill.length&&cmp(toKill.from,lst(kill).to)<=0;){var replaced=kill.pop();if(cmp(replaced.from,toKill.from)<0){toKill.from=replaced.from;break}}kill.push(toKill)}runInOp(cm,(function(){for(var i=kill.length-1;i>=0;i--)replaceRange(cm.doc,"",kill[i].from,kill[i].to,"+delete");ensureCursorVisible(cm)}))}function moveCharLogically(line,ch,dir){var target=skipExtendingChars(line.text,ch+dir,dir);return target<0||target>line.text.length?null:target}function moveLogically(line,start,dir){var ch=moveCharLogically(line,start.ch,dir);return null==ch?null:new Pos(start.line,ch,dir<0?"after":"before")}function endOfLine(visually,cm,lineObj,lineNo,dir){if(visually){"rtl"==cm.getOption("direction")&&(dir=-dir);var order=getOrder(lineObj,cm.doc.direction);if(order){var ch,part=dir<0?lst(order):order[0],sticky=dir<0==(1==part.level)?"after":"before";if(part.level>0||"rtl"==cm.doc.direction){var prep=prepareMeasureForLine(cm,lineObj);ch=dir<0?lineObj.text.length-1:0;var targetTop=measureCharPrepared(cm,prep,ch).top;ch=findFirst((function(ch){return measureCharPrepared(cm,prep,ch).top==targetTop}),dir<0==(1==part.level)?part.from:part.to-1,ch),"before"==sticky&&(ch=moveCharLogically(lineObj,ch,1))}else ch=dir<0?part.to:part.from;return new Pos(lineNo,ch,sticky)}}return new Pos(lineNo,dir<0?lineObj.text.length:0,dir<0?"before":"after")}keyMap.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},keyMap.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},keyMap.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},keyMap.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},keyMap.default=mac?keyMap.macDefault:keyMap.pcDefault;var commands={selectAll:selectAll,singleSelection:function(cm){return cm.setSelection(cm.getCursor("anchor"),cm.getCursor("head"),sel_dontScroll)},killLine:function(cm){return deleteNearSelection(cm,(function(range){if(range.empty()){var len=getLine(cm.doc,range.head.line).text.length;return range.head.ch==len&&range.head.line<cm.lastLine()?{from:range.head,to:Pos(range.head.line+1,0)}:{from:range.head,to:Pos(range.head.line,len)}}return{from:range.from(),to:range.to()}}))},deleteLine:function(cm){return deleteNearSelection(cm,(function(range){return{from:Pos(range.from().line,0),to:clipPos(cm.doc,Pos(range.to().line+1,0))}}))},delLineLeft:function(cm){return deleteNearSelection(cm,(function(range){return{from:Pos(range.from().line,0),to:range.from()}}))},delWrappedLineLeft:function(cm){return deleteNearSelection(cm,(function(range){var top=cm.charCoords(range.head,"div").top+5;return{from:cm.coordsChar({left:0,top:top},"div"),to:range.from()}}))},delWrappedLineRight:function(cm){return deleteNearSelection(cm,(function(range){var top=cm.charCoords(range.head,"div").top+5,rightPos=cm.coordsChar({left:cm.display.lineDiv.offsetWidth+100,top:top},"div");return{from:range.from(),to:rightPos}}))},undo:function(cm){return cm.undo()},redo:function(cm){return cm.redo()},undoSelection:function(cm){return cm.undoSelection()},redoSelection:function(cm){return cm.redoSelection()},goDocStart:function(cm){return cm.extendSelection(Pos(cm.firstLine(),0))},goDocEnd:function(cm){return cm.extendSelection(Pos(cm.lastLine()))},goLineStart:function(cm){return cm.extendSelectionsBy((function(range){return lineStart(cm,range.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(cm){return cm.extendSelectionsBy((function(range){return lineStartSmart(cm,range.head)}),{origin:"+move",bias:1})},goLineEnd:function(cm){return cm.extendSelectionsBy((function(range){return function(cm,lineN){var line=getLine(cm.doc,lineN),visual=function(line){for(var merged;merged=collapsedSpanAtEnd(line);)line=merged.find(1,!0).line;return line}(line);return visual!=line&&(lineN=lineNo(visual)),endOfLine(!0,cm,line,lineN,-1)}(cm,range.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(cm){return cm.extendSelectionsBy((function(range){var top=cm.cursorCoords(range.head,"div").top+5;return cm.coordsChar({left:cm.display.lineDiv.offsetWidth+100,top:top},"div")}),sel_move)},goLineLeft:function(cm){return cm.extendSelectionsBy((function(range){var top=cm.cursorCoords(range.head,"div").top+5;return cm.coordsChar({left:0,top:top},"div")}),sel_move)},goLineLeftSmart:function(cm){return cm.extendSelectionsBy((function(range){var top=cm.cursorCoords(range.head,"div").top+5,pos=cm.coordsChar({left:0,top:top},"div");return pos.ch<cm.getLine(pos.line).search(/\S/)?lineStartSmart(cm,range.head):pos}),sel_move)},goLineUp:function(cm){return cm.moveV(-1,"line")},goLineDown:function(cm){return cm.moveV(1,"line")},goPageUp:function(cm){return cm.moveV(-1,"page")},goPageDown:function(cm){return cm.moveV(1,"page")},goCharLeft:function(cm){return cm.moveH(-1,"char")},goCharRight:function(cm){return cm.moveH(1,"char")},goColumnLeft:function(cm){return cm.moveH(-1,"column")},goColumnRight:function(cm){return cm.moveH(1,"column")},goWordLeft:function(cm){return cm.moveH(-1,"word")},goGroupRight:function(cm){return cm.moveH(1,"group")},goGroupLeft:function(cm){return cm.moveH(-1,"group")},goWordRight:function(cm){return cm.moveH(1,"word")},delCharBefore:function(cm){return cm.deleteH(-1,"char")},delCharAfter:function(cm){return cm.deleteH(1,"char")},delWordBefore:function(cm){return cm.deleteH(-1,"word")},delWordAfter:function(cm){return cm.deleteH(1,"word")},delGroupBefore:function(cm){return cm.deleteH(-1,"group")},delGroupAfter:function(cm){return cm.deleteH(1,"group")},indentAuto:function(cm){return cm.indentSelection("smart")},indentMore:function(cm){return cm.indentSelection("add")},indentLess:function(cm){return cm.indentSelection("subtract")},insertTab:function(cm){return cm.replaceSelection("\t")},insertSoftTab:function(cm){for(var spaces=[],ranges=cm.listSelections(),tabSize=cm.options.tabSize,i=0;i<ranges.length;i++){var pos=ranges[i].from(),col=countColumn(cm.getLine(pos.line),pos.ch,tabSize);spaces.push(spaceStr(tabSize-col%tabSize))}cm.replaceSelections(spaces)},defaultTab:function(cm){cm.somethingSelected()?cm.indentSelection("add"):cm.execCommand("insertTab")},transposeChars:function(cm){return runInOp(cm,(function(){for(var ranges=cm.listSelections(),newSel=[],i=0;i<ranges.length;i++)if(ranges[i].empty()){var cur=ranges[i].head,line=getLine(cm.doc,cur.line).text;if(line)if(cur.ch==line.length&&(cur=new Pos(cur.line,cur.ch-1)),cur.ch>0)cur=new Pos(cur.line,cur.ch+1),cm.replaceRange(line.charAt(cur.ch-1)+line.charAt(cur.ch-2),Pos(cur.line,cur.ch-2),cur,"+transpose");else if(cur.line>cm.doc.first){var prev=getLine(cm.doc,cur.line-1).text;prev&&(cur=new Pos(cur.line,1),cm.replaceRange(line.charAt(0)+cm.doc.lineSeparator()+prev.charAt(prev.length-1),Pos(cur.line-1,prev.length-1),cur,"+transpose"))}newSel.push(new Range(cur,cur))}cm.setSelections(newSel)}))},newlineAndIndent:function(cm){return runInOp(cm,(function(){for(var sels=cm.listSelections(),i=sels.length-1;i>=0;i--)cm.replaceRange(cm.doc.lineSeparator(),sels[i].anchor,sels[i].head,"+input");sels=cm.listSelections();for(var i$1=0;i$1<sels.length;i$1++)cm.indentLine(sels[i$1].from().line,null,!0);ensureCursorVisible(cm)}))},openLine:function(cm){return cm.replaceSelection("\n","start")},toggleOverwrite:function(cm){return cm.toggleOverwrite()}};function lineStart(cm,lineN){var line=getLine(cm.doc,lineN),visual=visualLine(line);return visual!=line&&(lineN=lineNo(visual)),endOfLine(!0,cm,visual,lineN,1)}function lineStartSmart(cm,pos){var start=lineStart(cm,pos.line),line=getLine(cm.doc,start.line),order=getOrder(line,cm.doc.direction);if(!order||0==order[0].level){var firstNonWS=Math.max(0,line.text.search(/\S/)),inWS=pos.line==start.line&&pos.ch<=firstNonWS&&pos.ch;return Pos(start.line,inWS?0:firstNonWS,start.sticky)}return start}function doHandleBinding(cm,bound,dropShift){if("string"==typeof bound&&!(bound=commands[bound]))return!1;cm.display.input.ensurePolled();var prevShift=cm.display.shift,done=!1;try{cm.isReadOnly()&&(cm.state.suppressEdits=!0),dropShift&&(cm.display.shift=!1),done=bound(cm)!=Pass}finally{cm.display.shift=prevShift,cm.state.suppressEdits=!1}return done}var stopSeq=new Delayed;function dispatchKey(cm,name,e,handle){var seq=cm.state.keySeq;if(seq){if(isModifierKey(name))return"handled";if(/\'$/.test(name)?cm.state.keySeq=null:stopSeq.set(50,(function(){cm.state.keySeq==seq&&(cm.state.keySeq=null,cm.display.input.reset())})),dispatchKeyInner(cm,seq+" "+name,e,handle))return!0}return dispatchKeyInner(cm,name,e,handle)}function dispatchKeyInner(cm,name,e,handle){var result=function(cm,name,handle){for(var i=0;i<cm.state.keyMaps.length;i++){var result=lookupKey(name,cm.state.keyMaps[i],handle,cm);if(result)return result}return cm.options.extraKeys&&lookupKey(name,cm.options.extraKeys,handle,cm)||lookupKey(name,cm.options.keyMap,handle,cm)}(cm,name,handle);return"multi"==result&&(cm.state.keySeq=name),"handled"==result&&signalLater(cm,"keyHandled",cm,name,e),"handled"!=result&&"multi"!=result||(e_preventDefault(e),restartBlink(cm)),!!result}function handleKeyBinding(cm,e){var name=keyName(e,!0);return!!name&&(e.shiftKey&&!cm.state.keySeq?dispatchKey(cm,"Shift-"+name,e,(function(b){return doHandleBinding(cm,b,!0)}))||dispatchKey(cm,name,e,(function(b){if("string"==typeof b?/^go[A-Z]/.test(b):b.motion)return doHandleBinding(cm,b)})):dispatchKey(cm,name,e,(function(b){return doHandleBinding(cm,b)})))}var lastStoppedKey=null;function onKeyDown(e){var cm=this;if(cm.curOp.focus=activeElt(),!signalDOMEvent(cm,e)){ie&&ie_version<11&&27==e.keyCode&&(e.returnValue=!1);var code=e.keyCode;cm.display.shift=16==code||e.shiftKey;var handled=handleKeyBinding(cm,e);presto&&(lastStoppedKey=handled?code:null,!handled&&88==code&&!hasCopyEvent&&(mac?e.metaKey:e.ctrlKey)&&cm.replaceSelection("",null,"cut")),gecko&&!mac&&!handled&&46==code&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=code||/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)||function(cm){var lineDiv=cm.display.lineDiv;function up(e){18!=e.keyCode&&e.altKey||(rmClass(lineDiv,"CodeMirror-crosshair"),off(document,"keyup",up),off(document,"mouseover",up))}addClass(lineDiv,"CodeMirror-crosshair"),on(document,"keyup",up),on(document,"mouseover",up)}(cm)}}function onKeyUp(e){16==e.keyCode&&(this.doc.sel.shift=!1),signalDOMEvent(this,e)}function onKeyPress(e){var cm=this;if(!(eventInWidget(cm.display,e)||signalDOMEvent(cm,e)||e.ctrlKey&&!e.altKey||mac&&e.metaKey)){var keyCode=e.keyCode,charCode=e.charCode;if(presto&&keyCode==lastStoppedKey)return lastStoppedKey=null,void e_preventDefault(e);if(!presto||e.which&&!(e.which<10)||!handleKeyBinding(cm,e)){var ch=String.fromCharCode(null==charCode?keyCode:charCode);"\b"!=ch&&(function(cm,e,ch){return dispatchKey(cm,"'"+ch+"'",e,(function(b){return doHandleBinding(cm,b,!0)}))}(cm,e,ch)||cm.display.input.onKeyPress(e))}}}var lastClick,lastDoubleClick,PastClick=function(time,pos,button){this.time=time,this.pos=pos,this.button=button};function onMouseDown(e){var cm=this,display=cm.display;if(!(signalDOMEvent(cm,e)||display.activeTouch&&display.input.supportsTouch()))if(display.input.ensurePolled(),display.shift=e.shiftKey,eventInWidget(display,e))webkit||(display.scroller.draggable=!1,setTimeout((function(){return display.scroller.draggable=!0}),100));else if(!clickInGutter(cm,e)){var pos=posFromMouse(cm,e),button=e_button(e),repeat=pos?function(pos,button){var now=+new Date;return lastDoubleClick&&lastDoubleClick.compare(now,pos,button)?(lastClick=lastDoubleClick=null,"triple"):lastClick&&lastClick.compare(now,pos,button)?(lastDoubleClick=new PastClick(now,pos,button),lastClick=null,"double"):(lastClick=new PastClick(now,pos,button),lastDoubleClick=null,"single")}(pos,button):"single";window.focus(),1==button&&cm.state.selectingText&&cm.state.selectingText(e),pos&&function(cm,button,pos,repeat,event){var name="Click";return"double"==repeat?name="Double"+name:"triple"==repeat&&(name="Triple"+name),dispatchKey(cm,addModifierNames(name=(1==button?"Left":2==button?"Middle":"Right")+name,event),event,(function(bound){if("string"==typeof bound&&(bound=commands[bound]),!bound)return!1;var done=!1;try{cm.isReadOnly()&&(cm.state.suppressEdits=!0),done=bound(cm,pos)!=Pass}finally{cm.state.suppressEdits=!1}return done}))}(cm,button,pos,repeat,e)||(1==button?pos?function(cm,pos,repeat,event){ie?setTimeout(bind(ensureFocus,cm),0):cm.curOp.focus=activeElt();var contained,behavior=function(cm,repeat,event){var option=cm.getOption("configureMouse"),value=option?option(cm,repeat,event):{};if(null==value.unit){var rect=chromeOS?event.shiftKey&&event.metaKey:event.altKey;value.unit=rect?"rectangle":"single"==repeat?"char":"double"==repeat?"word":"line"}return(null==value.extend||cm.doc.extend)&&(value.extend=cm.doc.extend||event.shiftKey),null==value.addNew&&(value.addNew=mac?event.metaKey:event.ctrlKey),null==value.moveOnDrag&&(value.moveOnDrag=!(mac?event.altKey:event.ctrlKey)),value}(cm,repeat,event),sel=cm.doc.sel;cm.options.dragDrop&&dragAndDrop&&!cm.isReadOnly()&&"single"==repeat&&(contained=sel.contains(pos))>-1&&(cmp((contained=sel.ranges[contained]).from(),pos)<0||pos.xRel>0)&&(cmp(contained.to(),pos)>0||pos.xRel<0)?function(cm,event,pos,behavior){var display=cm.display,moved=!1,dragEnd=operation(cm,(function(e){webkit&&(display.scroller.draggable=!1),cm.state.draggingText=!1,off(display.wrapper.ownerDocument,"mouseup",dragEnd),off(display.wrapper.ownerDocument,"mousemove",mouseMove),off(display.scroller,"dragstart",dragStart),off(display.scroller,"drop",dragEnd),moved||(e_preventDefault(e),behavior.addNew||extendSelection(cm.doc,pos,null,null,behavior.extend),webkit||ie&&9==ie_version?setTimeout((function(){display.wrapper.ownerDocument.body.focus(),display.input.focus()}),20):display.input.focus())})),mouseMove=function(e2){moved=moved||Math.abs(event.clientX-e2.clientX)+Math.abs(event.clientY-e2.clientY)>=10},dragStart=function(){return moved=!0};webkit&&(display.scroller.draggable=!0),cm.state.draggingText=dragEnd,dragEnd.copy=!behavior.moveOnDrag,display.scroller.dragDrop&&display.scroller.dragDrop(),on(display.wrapper.ownerDocument,"mouseup",dragEnd),on(display.wrapper.ownerDocument,"mousemove",mouseMove),on(display.scroller,"dragstart",dragStart),on(display.scroller,"drop",dragEnd),delayBlurEvent(cm),setTimeout((function(){return display.input.focus()}),20)}(cm,event,pos,behavior):function(cm,event,start,behavior){var display=cm.display,doc=cm.doc;e_preventDefault(event);var ourRange,ourIndex,startSel=doc.sel,ranges=startSel.ranges;if(behavior.addNew&&!behavior.extend?(ourIndex=doc.sel.contains(start),ourRange=ourIndex>-1?ranges[ourIndex]:new Range(start,start)):(ourRange=doc.sel.primary(),ourIndex=doc.sel.primIndex),"rectangle"==behavior.unit)behavior.addNew||(ourRange=new Range(start,start)),start=posFromMouse(cm,event,!0,!0),ourIndex=-1;else{var range=rangeForUnit(cm,start,behavior.unit);ourRange=behavior.extend?extendRange(ourRange,range.anchor,range.head,behavior.extend):range}behavior.addNew?-1==ourIndex?(ourIndex=ranges.length,setSelection(doc,normalizeSelection(cm,ranges.concat([ourRange]),ourIndex),{scroll:!1,origin:"*mouse"})):ranges.length>1&&ranges[ourIndex].empty()&&"char"==behavior.unit&&!behavior.extend?(setSelection(doc,normalizeSelection(cm,ranges.slice(0,ourIndex).concat(ranges.slice(ourIndex+1)),0),{scroll:!1,origin:"*mouse"}),startSel=doc.sel):replaceOneSelection(doc,ourIndex,ourRange,sel_mouse):(ourIndex=0,setSelection(doc,new Selection([ourRange],0),sel_mouse),startSel=doc.sel);var lastPos=start;function extendTo(pos){if(0!=cmp(lastPos,pos))if(lastPos=pos,"rectangle"==behavior.unit){for(var ranges=[],tabSize=cm.options.tabSize,startCol=countColumn(getLine(doc,start.line).text,start.ch,tabSize),posCol=countColumn(getLine(doc,pos.line).text,pos.ch,tabSize),left=Math.min(startCol,posCol),right=Math.max(startCol,posCol),line=Math.min(start.line,pos.line),end=Math.min(cm.lastLine(),Math.max(start.line,pos.line));line<=end;line++){var text=getLine(doc,line).text,leftPos=findColumn(text,left,tabSize);left==right?ranges.push(new Range(Pos(line,leftPos),Pos(line,leftPos))):text.length>leftPos&&ranges.push(new Range(Pos(line,leftPos),Pos(line,findColumn(text,right,tabSize))))}ranges.length||ranges.push(new Range(start,start)),setSelection(doc,normalizeSelection(cm,startSel.ranges.slice(0,ourIndex).concat(ranges),ourIndex),{origin:"*mouse",scroll:!1}),cm.scrollIntoView(pos)}else{var head,oldRange=ourRange,range=rangeForUnit(cm,pos,behavior.unit),anchor=oldRange.anchor;cmp(range.anchor,anchor)>0?(head=range.head,anchor=minPos(oldRange.from(),range.anchor)):(head=range.anchor,anchor=maxPos(oldRange.to(),range.head));var ranges$1=startSel.ranges.slice(0);ranges$1[ourIndex]=function(cm,range){var anchor=range.anchor,head=range.head,anchorLine=getLine(cm.doc,anchor.line);if(0==cmp(anchor,head)&&anchor.sticky==head.sticky)return range;var order=getOrder(anchorLine);if(!order)return range;var index=getBidiPartAt(order,anchor.ch,anchor.sticky),part=order[index];if(part.from!=anchor.ch&&part.to!=anchor.ch)return range;var leftSide,boundary=index+(part.from==anchor.ch==(1!=part.level)?0:1);if(0==boundary||boundary==order.length)return range;if(head.line!=anchor.line)leftSide=(head.line-anchor.line)*("ltr"==cm.doc.direction?1:-1)>0;else{var headIndex=getBidiPartAt(order,head.ch,head.sticky),dir=headIndex-index||(head.ch-anchor.ch)*(1==part.level?-1:1);leftSide=headIndex==boundary-1||headIndex==boundary?dir<0:dir>0}var usePart=order[boundary+(leftSide?-1:0)],from=leftSide==(1==usePart.level),ch=from?usePart.from:usePart.to,sticky=from?"after":"before";return anchor.ch==ch&&anchor.sticky==sticky?range:new Range(new Pos(anchor.line,ch,sticky),head)}(cm,new Range(clipPos(doc,anchor),head)),setSelection(doc,normalizeSelection(cm,ranges$1,ourIndex),sel_mouse)}}var editorSize=display.wrapper.getBoundingClientRect(),counter=0;function done(e){cm.state.selectingText=!1,counter=1/0,e&&(e_preventDefault(e),display.input.focus()),off(display.wrapper.ownerDocument,"mousemove",move),off(display.wrapper.ownerDocument,"mouseup",up),doc.history.lastSelOrigin=null}var move=operation(cm,(function(e){0!==e.buttons&&e_button(e)?function extend(e){var curCount=++counter,cur=posFromMouse(cm,e,!0,"rectangle"==behavior.unit);if(cur)if(0!=cmp(cur,lastPos)){cm.curOp.focus=activeElt(),extendTo(cur);var visible=visibleLines(display,doc);(cur.line>=visible.to||cur.line<visible.from)&&setTimeout(operation(cm,(function(){counter==curCount&&extend(e)})),150)}else{var outside=e.clientY<editorSize.top?-20:e.clientY>editorSize.bottom?20:0;outside&&setTimeout(operation(cm,(function(){counter==curCount&&(display.scroller.scrollTop+=outside,extend(e))})),50)}}(e):done(e)})),up=operation(cm,done);cm.state.selectingText=up,on(display.wrapper.ownerDocument,"mousemove",move),on(display.wrapper.ownerDocument,"mouseup",up)}(cm,event,pos,behavior)}(cm,pos,repeat,e):e_target(e)==display.scroller&&e_preventDefault(e):2==button?(pos&&extendSelection(cm.doc,pos),setTimeout((function(){return display.input.focus()}),20)):3==button&&(captureRightClick?cm.display.input.onContextMenu(e):delayBlurEvent(cm)))}}function rangeForUnit(cm,pos,unit){if("char"==unit)return new Range(pos,pos);if("word"==unit)return cm.findWordAt(pos);if("line"==unit)return new Range(Pos(pos.line,0),clipPos(cm.doc,Pos(pos.line+1,0)));var result=unit(cm,pos);return new Range(result.from,result.to)}function gutterEvent(cm,e,type,prevent){var mX,mY;if(e.touches)mX=e.touches[0].clientX,mY=e.touches[0].clientY;else try{mX=e.clientX,mY=e.clientY}catch(e){return!1}if(mX>=Math.floor(cm.display.gutters.getBoundingClientRect().right))return!1;prevent&&e_preventDefault(e);var display=cm.display,lineBox=display.lineDiv.getBoundingClientRect();if(mY>lineBox.bottom||!hasHandler(cm,type))return e_defaultPrevented(e);mY-=lineBox.top-display.viewOffset;for(var i=0;i<cm.display.gutterSpecs.length;++i){var g=display.gutters.childNodes[i];if(g&&g.getBoundingClientRect().right>=mX)return signal(cm,type,cm,lineAtHeight(cm.doc,mY),cm.display.gutterSpecs[i].className,e),e_defaultPrevented(e)}}function clickInGutter(cm,e){return gutterEvent(cm,e,"gutterClick",!0)}function onContextMenu(cm,e){eventInWidget(cm.display,e)||function(cm,e){return!!hasHandler(cm,"gutterContextMenu")&&gutterEvent(cm,e,"gutterContextMenu",!1)}(cm,e)||signalDOMEvent(cm,e,"contextmenu")||captureRightClick||cm.display.input.onContextMenu(e)}function themeChanged(cm){cm.display.wrapper.className=cm.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+cm.options.theme.replace(/(^|\s)\s*/g," cm-s-"),clearCaches(cm)}PastClick.prototype.compare=function(time,pos,button){return this.time+400>time&&0==cmp(pos,this.pos)&&button==this.button};var Init={toString:function(){return"CodeMirror.Init"}},defaults={},optionHandlers={};function dragDropChanged(cm,value,old){if(!value!=!(old&&old!=Init)){var funcs=cm.display.dragFunctions,toggle=value?on:off;toggle(cm.display.scroller,"dragstart",funcs.start),toggle(cm.display.scroller,"dragenter",funcs.enter),toggle(cm.display.scroller,"dragover",funcs.over),toggle(cm.display.scroller,"dragleave",funcs.leave),toggle(cm.display.scroller,"drop",funcs.drop)}}function wrappingChanged(cm){cm.options.lineWrapping?(addClass(cm.display.wrapper,"CodeMirror-wrap"),cm.display.sizer.style.minWidth="",cm.display.sizerWidth=null):(rmClass(cm.display.wrapper,"CodeMirror-wrap"),findMaxLine(cm)),estimateLineHeights(cm),regChange(cm),clearCaches(cm),setTimeout((function(){return updateScrollbars(cm)}),100)}function CodeMirror(place,options){var this$1=this;if(!(this instanceof CodeMirror))return new CodeMirror(place,options);this.options=options=options?copyObj(options):{},copyObj(defaults,options,!1);var doc=options.value;"string"==typeof doc?doc=new Doc(doc,options.mode,null,options.lineSeparator,options.direction):options.mode&&(doc.modeOption=options.mode),this.doc=doc;var input=new CodeMirror.inputStyles[options.inputStyle](this),display=this.display=new Display(place,doc,input,options);for(var opt in display.wrapper.CodeMirror=this,themeChanged(this),options.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),initScrollbars(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Delayed,keySeq:null,specialChars:null},options.autofocus&&!mobile&&display.input.focus(),ie&&ie_version<11&&setTimeout((function(){return this$1.display.input.reset(!0)}),20),function(cm){var d=cm.display;on(d.scroller,"mousedown",operation(cm,onMouseDown)),on(d.scroller,"dblclick",ie&&ie_version<11?operation(cm,(function(e){if(!signalDOMEvent(cm,e)){var pos=posFromMouse(cm,e);if(pos&&!clickInGutter(cm,e)&&!eventInWidget(cm.display,e)){e_preventDefault(e);var word=cm.findWordAt(pos);extendSelection(cm.doc,word.anchor,word.head)}}})):function(e){return signalDOMEvent(cm,e)||e_preventDefault(e)}),on(d.scroller,"contextmenu",(function(e){return onContextMenu(cm,e)})),on(d.input.getField(),"contextmenu",(function(e){d.scroller.contains(e.target)||onContextMenu(cm,e)}));var touchFinished,prevTouch={end:0};function finishTouch(){d.activeTouch&&(touchFinished=setTimeout((function(){return d.activeTouch=null}),1e3),(prevTouch=d.activeTouch).end=+new Date)}function farAway(touch,other){if(null==other.left)return!0;var dx=other.left-touch.left,dy=other.top-touch.top;return dx*dx+dy*dy>400}on(d.scroller,"touchstart",(function(e){if(!signalDOMEvent(cm,e)&&!function(e){if(1!=e.touches.length)return!1;var touch=e.touches[0];return touch.radiusX<=1&&touch.radiusY<=1}(e)&&!clickInGutter(cm,e)){d.input.ensurePolled(),clearTimeout(touchFinished);var now=+new Date;d.activeTouch={start:now,moved:!1,prev:now-prevTouch.end<=300?prevTouch:null},1==e.touches.length&&(d.activeTouch.left=e.touches[0].pageX,d.activeTouch.top=e.touches[0].pageY)}})),on(d.scroller,"touchmove",(function(){d.activeTouch&&(d.activeTouch.moved=!0)})),on(d.scroller,"touchend",(function(e){var touch=d.activeTouch;if(touch&&!eventInWidget(d,e)&&null!=touch.left&&!touch.moved&&new Date-touch.start<300){var range,pos=cm.coordsChar(d.activeTouch,"page");range=!touch.prev||farAway(touch,touch.prev)?new Range(pos,pos):!touch.prev.prev||farAway(touch,touch.prev.prev)?cm.findWordAt(pos):new Range(Pos(pos.line,0),clipPos(cm.doc,Pos(pos.line+1,0))),cm.setSelection(range.anchor,range.head),cm.focus(),e_preventDefault(e)}finishTouch()})),on(d.scroller,"touchcancel",finishTouch),on(d.scroller,"scroll",(function(){d.scroller.clientHeight&&(updateScrollTop(cm,d.scroller.scrollTop),setScrollLeft(cm,d.scroller.scrollLeft,!0),signal(cm,"scroll",cm))})),on(d.scroller,"mousewheel",(function(e){return onScrollWheel(cm,e)})),on(d.scroller,"DOMMouseScroll",(function(e){return onScrollWheel(cm,e)})),on(d.wrapper,"scroll",(function(){return d.wrapper.scrollTop=d.wrapper.scrollLeft=0})),d.dragFunctions={enter:function(e){signalDOMEvent(cm,e)||e_stop(e)},over:function(e){signalDOMEvent(cm,e)||(function(cm,e){var pos=posFromMouse(cm,e);if(pos){var frag=document.createDocumentFragment();drawSelectionCursor(cm,pos,frag),cm.display.dragCursor||(cm.display.dragCursor=elt("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),cm.display.lineSpace.insertBefore(cm.display.dragCursor,cm.display.cursorDiv)),removeChildrenAndAdd(cm.display.dragCursor,frag)}}(cm,e),e_stop(e))},start:function(e){return function(cm,e){if(ie&&(!cm.state.draggingText||+new Date-lastDrop<100))e_stop(e);else if(!signalDOMEvent(cm,e)&&!eventInWidget(cm.display,e)&&(e.dataTransfer.setData("Text",cm.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!safari)){var img=elt("img",null,null,"position: fixed; left: 0; top: 0;");img.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",presto&&(img.width=img.height=1,cm.display.wrapper.appendChild(img),img._top=img.offsetTop),e.dataTransfer.setDragImage(img,0,0),presto&&img.parentNode.removeChild(img)}}(cm,e)},drop:operation(cm,onDrop),leave:function(e){signalDOMEvent(cm,e)||clearDragCursor(cm)}};var inp=d.input.getField();on(inp,"keyup",(function(e){return onKeyUp.call(cm,e)})),on(inp,"keydown",operation(cm,onKeyDown)),on(inp,"keypress",operation(cm,onKeyPress)),on(inp,"focus",(function(e){return onFocus(cm,e)})),on(inp,"blur",(function(e){return onBlur(cm,e)}))}(this),ensureGlobalHandlers(),startOperation(this),this.curOp.forceUpdate=!0,attachDoc(this,doc),options.autofocus&&!mobile||this.hasFocus()?setTimeout(bind(onFocus,this),20):onBlur(this),optionHandlers)optionHandlers.hasOwnProperty(opt)&&optionHandlers[opt](this,options[opt],Init);maybeUpdateLineNumberWidth(this),options.finishInit&&options.finishInit(this);for(var i=0;i<initHooks.length;++i)initHooks[i](this);endOperation(this),webkit&&options.lineWrapping&&"optimizelegibility"==getComputedStyle(display.lineDiv).textRendering&&(display.lineDiv.style.textRendering="auto")}CodeMirror.defaults=defaults,CodeMirror.optionHandlers=optionHandlers;var initHooks=[];function indentLine(cm,n,how,aggressive){var state,doc=cm.doc;null==how&&(how="add"),"smart"==how&&(doc.mode.indent?state=getContextBefore(cm,n).state:how="prev");var tabSize=cm.options.tabSize,line=getLine(doc,n),curSpace=countColumn(line.text,null,tabSize);line.stateAfter&&(line.stateAfter=null);var indentation,curSpaceString=line.text.match(/^\s*/)[0];if(aggressive||/\S/.test(line.text)){if("smart"==how&&((indentation=doc.mode.indent(state,line.text.slice(curSpaceString.length),line.text))==Pass||indentation>150)){if(!aggressive)return;how="prev"}}else indentation=0,how="not";"prev"==how?indentation=n>doc.first?countColumn(getLine(doc,n-1).text,null,tabSize):0:"add"==how?indentation=curSpace+cm.options.indentUnit:"subtract"==how?indentation=curSpace-cm.options.indentUnit:"number"==typeof how&&(indentation=curSpace+how),indentation=Math.max(0,indentation);var indentString="",pos=0;if(cm.options.indentWithTabs)for(var i=Math.floor(indentation/tabSize);i;--i)pos+=tabSize,indentString+="\t";if(pos<indentation&&(indentString+=spaceStr(indentation-pos)),indentString!=curSpaceString)return replaceRange(doc,indentString,Pos(n,0),Pos(n,curSpaceString.length),"+input"),line.stateAfter=null,!0;for(var i$1=0;i$1<doc.sel.ranges.length;i$1++){var range=doc.sel.ranges[i$1];if(range.head.line==n&&range.head.ch<curSpaceString.length){var pos$1=Pos(n,curSpaceString.length);replaceOneSelection(doc,i$1,new Range(pos$1,pos$1));break}}}CodeMirror.defineInitHook=function(f){return initHooks.push(f)};var lastCopied=null;function setLastCopied(newLastCopied){lastCopied=newLastCopied}function applyTextInput(cm,inserted,deleted,sel,origin){var doc=cm.doc;cm.display.shift=!1,sel||(sel=doc.sel);var recent=+new Date-200,paste="paste"==origin||cm.state.pasteIncoming>recent,textLines=splitLinesAuto(inserted),multiPaste=null;if(paste&&sel.ranges.length>1)if(lastCopied&&lastCopied.text.join("\n")==inserted){if(sel.ranges.length%lastCopied.text.length==0){multiPaste=[];for(var i=0;i<lastCopied.text.length;i++)multiPaste.push(doc.splitLines(lastCopied.text[i]))}}else textLines.length==sel.ranges.length&&cm.options.pasteLinesPerSelection&&(multiPaste=map(textLines,(function(l){return[l]})));for(var updateInput=cm.curOp.updateInput,i$1=sel.ranges.length-1;i$1>=0;i$1--){var range=sel.ranges[i$1],from=range.from(),to=range.to();range.empty()&&(deleted&&deleted>0?from=Pos(from.line,from.ch-deleted):cm.state.overwrite&&!paste?to=Pos(to.line,Math.min(getLine(doc,to.line).text.length,to.ch+lst(textLines).length)):paste&&lastCopied&&lastCopied.lineWise&&lastCopied.text.join("\n")==inserted&&(from=to=Pos(from.line,0)));var changeEvent={from:from,to:to,text:multiPaste?multiPaste[i$1%multiPaste.length]:textLines,origin:origin||(paste?"paste":cm.state.cutIncoming>recent?"cut":"+input")};makeChange(cm.doc,changeEvent),signalLater(cm,"inputRead",cm,changeEvent)}inserted&&!paste&&triggerElectric(cm,inserted),ensureCursorVisible(cm),cm.curOp.updateInput<2&&(cm.curOp.updateInput=updateInput),cm.curOp.typing=!0,cm.state.pasteIncoming=cm.state.cutIncoming=-1}function handlePaste(e,cm){var pasted=e.clipboardData&&e.clipboardData.getData("Text");if(pasted)return e.preventDefault(),cm.isReadOnly()||cm.options.disableInput||runInOp(cm,(function(){return applyTextInput(cm,pasted,0,null,"paste")})),!0}function triggerElectric(cm,inserted){if(cm.options.electricChars&&cm.options.smartIndent)for(var sel=cm.doc.sel,i=sel.ranges.length-1;i>=0;i--){var range=sel.ranges[i];if(!(range.head.ch>100||i&&sel.ranges[i-1].head.line==range.head.line)){var mode=cm.getModeAt(range.head),indented=!1;if(mode.electricChars){for(var j=0;j<mode.electricChars.length;j++)if(inserted.indexOf(mode.electricChars.charAt(j))>-1){indented=indentLine(cm,range.head.line,"smart");break}}else mode.electricInput&&mode.electricInput.test(getLine(cm.doc,range.head.line).text.slice(0,range.head.ch))&&(indented=indentLine(cm,range.head.line,"smart"));indented&&signalLater(cm,"electricInput",cm,range.head.line)}}}function copyableRanges(cm){for(var text=[],ranges=[],i=0;i<cm.doc.sel.ranges.length;i++){var line=cm.doc.sel.ranges[i].head.line,lineRange={anchor:Pos(line,0),head:Pos(line+1,0)};ranges.push(lineRange),text.push(cm.getRange(lineRange.anchor,lineRange.head))}return{text:text,ranges:ranges}}function disableBrowserMagic(field,spellcheck,autocorrect,autocapitalize){field.setAttribute("autocorrect",autocorrect?"":"off"),field.setAttribute("autocapitalize",autocapitalize?"":"off"),field.setAttribute("spellcheck",!!spellcheck)}function hiddenTextarea(){var te=elt("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),div=elt("div",[te],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return webkit?te.style.width="1000px":te.setAttribute("wrap","off"),ios&&(te.style.border="1px solid black"),disableBrowserMagic(te),div}function findPosH(doc,pos,dir,unit,visually){var oldPos=pos,origDir=dir,lineObj=getLine(doc,pos.line),lineDir=visually&&doc.cm&&"rtl"==doc.cm.getOption("direction")?-dir:dir;function moveOnce(boundToLine){var next,l;if(null==(next=visually?function(cm,line,start,dir){var bidi=getOrder(line,cm.doc.direction);if(!bidi)return moveLogically(line,start,dir);start.ch>=line.text.length?(start.ch=line.text.length,start.sticky="before"):start.ch<=0&&(start.ch=0,start.sticky="after");var partPos=getBidiPartAt(bidi,start.ch,start.sticky),part=bidi[partPos];if("ltr"==cm.doc.direction&&part.level%2==0&&(dir>0?part.to>start.ch:part.from<start.ch))return moveLogically(line,start,dir);var prep,mv=function(pos,dir){return moveCharLogically(line,pos instanceof Pos?pos.ch:pos,dir)},getWrappedLineExtent=function(ch){return cm.options.lineWrapping?(prep=prep||prepareMeasureForLine(cm,line),wrappedLineExtentChar(cm,line,prep,ch)):{begin:0,end:line.text.length}},wrappedLineExtent=getWrappedLineExtent("before"==start.sticky?mv(start,-1):start.ch);if("rtl"==cm.doc.direction||1==part.level){var moveInStorageOrder=1==part.level==dir<0,ch=mv(start,moveInStorageOrder?1:-1);if(null!=ch&&(moveInStorageOrder?ch<=part.to&&ch<=wrappedLineExtent.end:ch>=part.from&&ch>=wrappedLineExtent.begin)){var sticky=moveInStorageOrder?"before":"after";return new Pos(start.line,ch,sticky)}}var searchInVisualLine=function(partPos,dir,wrappedLineExtent){for(var getRes=function(ch,moveInStorageOrder){return moveInStorageOrder?new Pos(start.line,mv(ch,1),"before"):new Pos(start.line,ch,"after")};partPos>=0&&partPos<bidi.length;partPos+=dir){var part=bidi[partPos],moveInStorageOrder=dir>0==(1!=part.level),ch=moveInStorageOrder?wrappedLineExtent.begin:mv(wrappedLineExtent.end,-1);if(part.from<=ch&&ch<part.to)return getRes(ch,moveInStorageOrder);if(ch=moveInStorageOrder?part.from:mv(part.to,-1),wrappedLineExtent.begin<=ch&&ch<wrappedLineExtent.end)return getRes(ch,moveInStorageOrder)}},res=searchInVisualLine(partPos+dir,dir,wrappedLineExtent);if(res)return res;var nextCh=dir>0?wrappedLineExtent.end:mv(wrappedLineExtent.begin,-1);return null==nextCh||dir>0&&nextCh==line.text.length||!(res=searchInVisualLine(dir>0?0:bidi.length-1,dir,getWrappedLineExtent(nextCh)))?null:res}(doc.cm,lineObj,pos,dir):moveLogically(lineObj,pos,dir))){if(boundToLine||(l=pos.line+lineDir)<doc.first||l>=doc.first+doc.size||(pos=new Pos(l,pos.ch,pos.sticky),!(lineObj=getLine(doc,l))))return!1;pos=endOfLine(visually,doc.cm,lineObj,pos.line,lineDir)}else pos=next;return!0}if("char"==unit)moveOnce();else if("column"==unit)moveOnce(!0);else if("word"==unit||"group"==unit)for(var sawType=null,group="group"==unit,helper=doc.cm&&doc.cm.getHelper(pos,"wordChars"),first=!0;!(dir<0)||moveOnce(!first);first=!1){var cur=lineObj.text.charAt(pos.ch)||"\n",type=isWordChar(cur,helper)?"w":group&&"\n"==cur?"n":!group||/\s/.test(cur)?null:"p";if(!group||first||type||(type="s"),sawType&&sawType!=type){dir<0&&(dir=1,moveOnce(),pos.sticky="after");break}if(type&&(sawType=type),dir>0&&!moveOnce(!first))break}var result=skipAtomic(doc,pos,oldPos,origDir,!0);return equalCursorPos(oldPos,result)&&(result.hitSide=!0),result}function findPosV(cm,pos,dir,unit){var y,target,doc=cm.doc,x=pos.left;if("page"==unit){var pageSize=Math.min(cm.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),moveAmount=Math.max(pageSize-.5*textHeight(cm.display),3);y=(dir>0?pos.bottom:pos.top)+dir*moveAmount}else"line"==unit&&(y=dir>0?pos.bottom+3:pos.top-3);for(;(target=coordsChar(cm,x,y)).outside;){if(dir<0?y<=0:y>=doc.height){target.hitSide=!0;break}y+=5*dir}return target}var ContentEditableInput=function(cm){this.cm=cm,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Delayed,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function posToDOM(cm,pos){var view=findViewForLine(cm,pos.line);if(!view||view.hidden)return null;var line=getLine(cm.doc,pos.line),info=mapFromLineView(view,line,pos.line),order=getOrder(line,cm.doc.direction),side="left";order&&(side=getBidiPartAt(order,pos.ch)%2?"right":"left");var result=nodeAndOffsetInLineMap(info.map,pos.ch,side);return result.offset="right"==result.collapse?result.end:result.start,result}function badPos(pos,bad){return bad&&(pos.bad=!0),pos}function domToPos(cm,node,offset){var lineNode;if(node==cm.display.lineDiv){if(!(lineNode=cm.display.lineDiv.childNodes[offset]))return badPos(cm.clipPos(Pos(cm.display.viewTo-1)),!0);node=null,offset=0}else for(lineNode=node;;lineNode=lineNode.parentNode){if(!lineNode||lineNode==cm.display.lineDiv)return null;if(lineNode.parentNode&&lineNode.parentNode==cm.display.lineDiv)break}for(var i=0;i<cm.display.view.length;i++){var lineView=cm.display.view[i];if(lineView.node==lineNode)return locateNodeInLineView(lineView,node,offset)}}function locateNodeInLineView(lineView,node,offset){var wrapper=lineView.text.firstChild,bad=!1;if(!node||!contains(wrapper,node))return badPos(Pos(lineNo(lineView.line),0),!0);if(node==wrapper&&(bad=!0,node=wrapper.childNodes[offset],offset=0,!node)){var line=lineView.rest?lst(lineView.rest):lineView.line;return badPos(Pos(lineNo(line),line.text.length),bad)}var textNode=3==node.nodeType?node:null,topNode=node;for(textNode||1!=node.childNodes.length||3!=node.firstChild.nodeType||(textNode=node.firstChild,offset&&(offset=textNode.nodeValue.length));topNode.parentNode!=wrapper;)topNode=topNode.parentNode;var measure=lineView.measure,maps=measure.maps;function find(textNode,topNode,offset){for(var i=-1;i<(maps?maps.length:0);i++)for(var map=i<0?measure.map:maps[i],j=0;j<map.length;j+=3){var curNode=map[j+2];if(curNode==textNode||curNode==topNode){var line=lineNo(i<0?lineView.line:lineView.rest[i]),ch=map[j]+offset;return(offset<0||curNode!=textNode)&&(ch=map[j+(offset?1:0)]),Pos(line,ch)}}}var found=find(textNode,topNode,offset);if(found)return badPos(found,bad);for(var after=topNode.nextSibling,dist=textNode?textNode.nodeValue.length-offset:0;after;after=after.nextSibling){if(found=find(after,after.firstChild,0))return badPos(Pos(found.line,found.ch-dist),bad);dist+=after.textContent.length}for(var before=topNode.previousSibling,dist$1=offset;before;before=before.previousSibling){if(found=find(before,before.firstChild,-1))return badPos(Pos(found.line,found.ch+dist$1),bad);dist$1+=before.textContent.length}}ContentEditableInput.prototype.init=function(display){var this$1=this,input=this,cm=input.cm,div=input.div=display.lineDiv;function onCopyCut(e){if(!signalDOMEvent(cm,e)){if(cm.somethingSelected())setLastCopied({lineWise:!1,text:cm.getSelections()}),"cut"==e.type&&cm.replaceSelection("",null,"cut");else{if(!cm.options.lineWiseCopyCut)return;var ranges=copyableRanges(cm);setLastCopied({lineWise:!0,text:ranges.text}),"cut"==e.type&&cm.operation((function(){cm.setSelections(ranges.ranges,0,sel_dontScroll),cm.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var content=lastCopied.text.join("\n");if(e.clipboardData.setData("Text",content),e.clipboardData.getData("Text")==content)return void e.preventDefault()}var kludge=hiddenTextarea(),te=kludge.firstChild;cm.display.lineSpace.insertBefore(kludge,cm.display.lineSpace.firstChild),te.value=lastCopied.text.join("\n");var hadFocus=document.activeElement;selectInput(te),setTimeout((function(){cm.display.lineSpace.removeChild(kludge),hadFocus.focus(),hadFocus==div&&input.showPrimarySelection()}),50)}}disableBrowserMagic(div,cm.options.spellcheck,cm.options.autocorrect,cm.options.autocapitalize),on(div,"paste",(function(e){signalDOMEvent(cm,e)||handlePaste(e,cm)||ie_version<=11&&setTimeout(operation(cm,(function(){return this$1.updateFromDOM()})),20)})),on(div,"compositionstart",(function(e){this$1.composing={data:e.data,done:!1}})),on(div,"compositionupdate",(function(e){this$1.composing||(this$1.composing={data:e.data,done:!1})})),on(div,"compositionend",(function(e){this$1.composing&&(e.data!=this$1.composing.data&&this$1.readFromDOMSoon(),this$1.composing.done=!0)})),on(div,"touchstart",(function(){return input.forceCompositionEnd()})),on(div,"input",(function(){this$1.composing||this$1.readFromDOMSoon()})),on(div,"copy",onCopyCut),on(div,"cut",onCopyCut)},ContentEditableInput.prototype.prepareSelection=function(){var result=prepareSelection(this.cm,!1);return result.focus=this.cm.state.focused,result},ContentEditableInput.prototype.showSelection=function(info,takeFocus){info&&this.cm.display.view.length&&((info.focus||takeFocus)&&this.showPrimarySelection(),this.showMultipleSelections(info))},ContentEditableInput.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ContentEditableInput.prototype.showPrimarySelection=function(){var sel=this.getSelection(),cm=this.cm,prim=cm.doc.sel.primary(),from=prim.from(),to=prim.to();if(cm.display.viewTo==cm.display.viewFrom||from.line>=cm.display.viewTo||to.line<cm.display.viewFrom)sel.removeAllRanges();else{var curAnchor=domToPos(cm,sel.anchorNode,sel.anchorOffset),curFocus=domToPos(cm,sel.focusNode,sel.focusOffset);if(!curAnchor||curAnchor.bad||!curFocus||curFocus.bad||0!=cmp(minPos(curAnchor,curFocus),from)||0!=cmp(maxPos(curAnchor,curFocus),to)){var view=cm.display.view,start=from.line>=cm.display.viewFrom&&posToDOM(cm,from)||{node:view[0].measure.map[2],offset:0},end=to.line<cm.display.viewTo&&posToDOM(cm,to);if(!end){var measure=view[view.length-1].measure,map=measure.maps?measure.maps[measure.maps.length-1]:measure.map;end={node:map[map.length-1],offset:map[map.length-2]-map[map.length-3]}}if(start&&end){var rng,old=sel.rangeCount&&sel.getRangeAt(0);try{rng=range(start.node,start.offset,end.offset,end.node)}catch(e){}rng&&(!gecko&&cm.state.focused?(sel.collapse(start.node,start.offset),rng.collapsed||(sel.removeAllRanges(),sel.addRange(rng))):(sel.removeAllRanges(),sel.addRange(rng)),old&&null==sel.anchorNode?sel.addRange(old):gecko&&this.startGracePeriod()),this.rememberSelection()}else sel.removeAllRanges()}}},ContentEditableInput.prototype.startGracePeriod=function(){var this$1=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){this$1.gracePeriod=!1,this$1.selectionChanged()&&this$1.cm.operation((function(){return this$1.cm.curOp.selectionChanged=!0}))}),20)},ContentEditableInput.prototype.showMultipleSelections=function(info){removeChildrenAndAdd(this.cm.display.cursorDiv,info.cursors),removeChildrenAndAdd(this.cm.display.selectionDiv,info.selection)},ContentEditableInput.prototype.rememberSelection=function(){var sel=this.getSelection();this.lastAnchorNode=sel.anchorNode,this.lastAnchorOffset=sel.anchorOffset,this.lastFocusNode=sel.focusNode,this.lastFocusOffset=sel.focusOffset},ContentEditableInput.prototype.selectionInEditor=function(){var sel=this.getSelection();if(!sel.rangeCount)return!1;var node=sel.getRangeAt(0).commonAncestorContainer;return contains(this.div,node)},ContentEditableInput.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},ContentEditableInput.prototype.blur=function(){this.div.blur()},ContentEditableInput.prototype.getField=function(){return this.div},ContentEditableInput.prototype.supportsTouch=function(){return!0},ContentEditableInput.prototype.receivedFocus=function(){var input=this;this.selectionInEditor()?this.pollSelection():runInOp(this.cm,(function(){return input.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function poll(){input.cm.state.focused&&(input.pollSelection(),input.polling.set(input.cm.options.pollInterval,poll))}))},ContentEditableInput.prototype.selectionChanged=function(){var sel=this.getSelection();return sel.anchorNode!=this.lastAnchorNode||sel.anchorOffset!=this.lastAnchorOffset||sel.focusNode!=this.lastFocusNode||sel.focusOffset!=this.lastFocusOffset},ContentEditableInput.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var sel=this.getSelection(),cm=this.cm;if(android&&chrome&&this.cm.display.gutterSpecs.length&&function(node){for(var scan=node;scan;scan=scan.parentNode)if(/CodeMirror-gutter-wrapper/.test(scan.className))return!0;return!1}(sel.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var anchor=domToPos(cm,sel.anchorNode,sel.anchorOffset),head=domToPos(cm,sel.focusNode,sel.focusOffset);anchor&&head&&runInOp(cm,(function(){setSelection(cm.doc,simpleSelection(anchor,head),sel_dontScroll),(anchor.bad||head.bad)&&(cm.curOp.selectionChanged=!0)}))}}},ContentEditableInput.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var fromIndex,fromLine,fromNode,cm=this.cm,display=cm.display,sel=cm.doc.sel.primary(),from=sel.from(),to=sel.to();if(0==from.ch&&from.line>cm.firstLine()&&(from=Pos(from.line-1,getLine(cm.doc,from.line-1).length)),to.ch==getLine(cm.doc,to.line).text.length&&to.line<cm.lastLine()&&(to=Pos(to.line+1,0)),from.line<display.viewFrom||to.line>display.viewTo-1)return!1;from.line==display.viewFrom||0==(fromIndex=findViewIndex(cm,from.line))?(fromLine=lineNo(display.view[0].line),fromNode=display.view[0].node):(fromLine=lineNo(display.view[fromIndex].line),fromNode=display.view[fromIndex-1].node.nextSibling);var toLine,toNode,toIndex=findViewIndex(cm,to.line);if(toIndex==display.view.length-1?(toLine=display.viewTo-1,toNode=display.lineDiv.lastChild):(toLine=lineNo(display.view[toIndex+1].line)-1,toNode=display.view[toIndex+1].node.previousSibling),!fromNode)return!1;for(var newText=cm.doc.splitLines(function(cm,from,to,fromLine,toLine){var text="",closing=!1,lineSep=cm.doc.lineSeparator(),extraLinebreak=!1;function close(){closing&&(text+=lineSep,extraLinebreak&&(text+=lineSep),closing=extraLinebreak=!1)}function addText(str){str&&(close(),text+=str)}function walk(node){if(1==node.nodeType){var cmText=node.getAttribute("cm-text");if(cmText)return void addText(cmText);var range,markerID=node.getAttribute("cm-marker");if(markerID){var found=cm.findMarks(Pos(fromLine,0),Pos(toLine+1,0),(id=+markerID,function(marker){return marker.id==id}));return void(found.length&&(range=found[0].find(0))&&addText(getBetween(cm.doc,range.from,range.to).join(lineSep)))}if("false"==node.getAttribute("contenteditable"))return;var isBlock=/^(pre|div|p|li|table|br)$/i.test(node.nodeName);if(!/^br$/i.test(node.nodeName)&&0==node.textContent.length)return;isBlock&&close();for(var i=0;i<node.childNodes.length;i++)walk(node.childNodes[i]);/^(pre|p)$/i.test(node.nodeName)&&(extraLinebreak=!0),isBlock&&(closing=!0)}else 3==node.nodeType&&addText(node.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var id}for(;walk(from),from!=to;)from=from.nextSibling,extraLinebreak=!1;return text}(cm,fromNode,toNode,fromLine,toLine)),oldText=getBetween(cm.doc,Pos(fromLine,0),Pos(toLine,getLine(cm.doc,toLine).text.length));newText.length>1&&oldText.length>1;)if(lst(newText)==lst(oldText))newText.pop(),oldText.pop(),toLine--;else{if(newText[0]!=oldText[0])break;newText.shift(),oldText.shift(),fromLine++}for(var cutFront=0,cutEnd=0,newTop=newText[0],oldTop=oldText[0],maxCutFront=Math.min(newTop.length,oldTop.length);cutFront<maxCutFront&&newTop.charCodeAt(cutFront)==oldTop.charCodeAt(cutFront);)++cutFront;for(var newBot=lst(newText),oldBot=lst(oldText),maxCutEnd=Math.min(newBot.length-(1==newText.length?cutFront:0),oldBot.length-(1==oldText.length?cutFront:0));cutEnd<maxCutEnd&&newBot.charCodeAt(newBot.length-cutEnd-1)==oldBot.charCodeAt(oldBot.length-cutEnd-1);)++cutEnd;if(1==newText.length&&1==oldText.length&&fromLine==from.line)for(;cutFront&&cutFront>from.ch&&newBot.charCodeAt(newBot.length-cutEnd-1)==oldBot.charCodeAt(oldBot.length-cutEnd-1);)cutFront--,cutEnd++;newText[newText.length-1]=newBot.slice(0,newBot.length-cutEnd).replace(/^\u200b+/,""),newText[0]=newText[0].slice(cutFront).replace(/\u200b+$/,"");var chFrom=Pos(fromLine,cutFront),chTo=Pos(toLine,oldText.length?lst(oldText).length-cutEnd:0);return newText.length>1||newText[0]||cmp(chFrom,chTo)?(replaceRange(cm.doc,newText,chFrom,chTo,"+input"),!0):void 0},ContentEditableInput.prototype.ensurePolled=function(){this.forceCompositionEnd()},ContentEditableInput.prototype.reset=function(){this.forceCompositionEnd()},ContentEditableInput.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ContentEditableInput.prototype.readFromDOMSoon=function(){var this$1=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(this$1.readDOMTimeout=null,this$1.composing){if(!this$1.composing.done)return;this$1.composing=null}this$1.updateFromDOM()}),80))},ContentEditableInput.prototype.updateFromDOM=function(){var this$1=this;!this.cm.isReadOnly()&&this.pollContent()||runInOp(this.cm,(function(){return regChange(this$1.cm)}))},ContentEditableInput.prototype.setUneditable=function(node){node.contentEditable="false"},ContentEditableInput.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||operation(this.cm,applyTextInput)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},ContentEditableInput.prototype.readOnlyChanged=function(val){this.div.contentEditable=String("nocursor"!=val)},ContentEditableInput.prototype.onContextMenu=function(){},ContentEditableInput.prototype.resetPosition=function(){},ContentEditableInput.prototype.needsContentAttribute=!0;var TextareaInput=function(cm){this.cm=cm,this.prevInput="",this.pollingFast=!1,this.polling=new Delayed,this.hasSelection=!1,this.composing=null};TextareaInput.prototype.init=function(display){var this$1=this,input=this,cm=this.cm;this.createField(display);var te=this.textarea;function prepareCopyCut(e){if(!signalDOMEvent(cm,e)){if(cm.somethingSelected())setLastCopied({lineWise:!1,text:cm.getSelections()});else{if(!cm.options.lineWiseCopyCut)return;var ranges=copyableRanges(cm);setLastCopied({lineWise:!0,text:ranges.text}),"cut"==e.type?cm.setSelections(ranges.ranges,null,sel_dontScroll):(input.prevInput="",te.value=ranges.text.join("\n"),selectInput(te))}"cut"==e.type&&(cm.state.cutIncoming=+new Date)}}display.wrapper.insertBefore(this.wrapper,display.wrapper.firstChild),ios&&(te.style.width="0px"),on(te,"input",(function(){ie&&ie_version>=9&&this$1.hasSelection&&(this$1.hasSelection=null),input.poll()})),on(te,"paste",(function(e){signalDOMEvent(cm,e)||handlePaste(e,cm)||(cm.state.pasteIncoming=+new Date,input.fastPoll())})),on(te,"cut",prepareCopyCut),on(te,"copy",prepareCopyCut),on(display.scroller,"paste",(function(e){if(!eventInWidget(display,e)&&!signalDOMEvent(cm,e)){if(!te.dispatchEvent)return cm.state.pasteIncoming=+new Date,void input.focus();var event=new Event("paste");event.clipboardData=e.clipboardData,te.dispatchEvent(event)}})),on(display.lineSpace,"selectstart",(function(e){eventInWidget(display,e)||e_preventDefault(e)})),on(te,"compositionstart",(function(){var start=cm.getCursor("from");input.composing&&input.composing.range.clear(),input.composing={start:start,range:cm.markText(start,cm.getCursor("to"),{className:"CodeMirror-composing"})}})),on(te,"compositionend",(function(){input.composing&&(input.poll(),input.composing.range.clear(),input.composing=null)}))},TextareaInput.prototype.createField=function(_display){this.wrapper=hiddenTextarea(),this.textarea=this.wrapper.firstChild},TextareaInput.prototype.prepareSelection=function(){var cm=this.cm,display=cm.display,doc=cm.doc,result=prepareSelection(cm);if(cm.options.moveInputWithCursor){var headPos=cursorCoords(cm,doc.sel.primary().head,"div"),wrapOff=display.wrapper.getBoundingClientRect(),lineOff=display.lineDiv.getBoundingClientRect();result.teTop=Math.max(0,Math.min(display.wrapper.clientHeight-10,headPos.top+lineOff.top-wrapOff.top)),result.teLeft=Math.max(0,Math.min(display.wrapper.clientWidth-10,headPos.left+lineOff.left-wrapOff.left))}return result},TextareaInput.prototype.showSelection=function(drawn){var display=this.cm.display;removeChildrenAndAdd(display.cursorDiv,drawn.cursors),removeChildrenAndAdd(display.selectionDiv,drawn.selection),null!=drawn.teTop&&(this.wrapper.style.top=drawn.teTop+"px",this.wrapper.style.left=drawn.teLeft+"px")},TextareaInput.prototype.reset=function(typing){if(!this.contextMenuPending&&!this.composing){var cm=this.cm;if(cm.somethingSelected()){this.prevInput="";var content=cm.getSelection();this.textarea.value=content,cm.state.focused&&selectInput(this.textarea),ie&&ie_version>=9&&(this.hasSelection=content)}else typing||(this.prevInput=this.textarea.value="",ie&&ie_version>=9&&(this.hasSelection=null))}},TextareaInput.prototype.getField=function(){return this.textarea},TextareaInput.prototype.supportsTouch=function(){return!1},TextareaInput.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!mobile||activeElt()!=this.textarea))try{this.textarea.focus()}catch(e){}},TextareaInput.prototype.blur=function(){this.textarea.blur()},TextareaInput.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},TextareaInput.prototype.receivedFocus=function(){this.slowPoll()},TextareaInput.prototype.slowPoll=function(){var this$1=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){this$1.poll(),this$1.cm.state.focused&&this$1.slowPoll()}))},TextareaInput.prototype.fastPoll=function(){var missed=!1,input=this;input.pollingFast=!0,input.polling.set(20,(function p(){input.poll()||missed?(input.pollingFast=!1,input.slowPoll()):(missed=!0,input.polling.set(60,p))}))},TextareaInput.prototype.poll=function(){var this$1=this,cm=this.cm,input=this.textarea,prevInput=this.prevInput;if(this.contextMenuPending||!cm.state.focused||hasSelection(input)&&!prevInput&&!this.composing||cm.isReadOnly()||cm.options.disableInput||cm.state.keySeq)return!1;var text=input.value;if(text==prevInput&&!cm.somethingSelected())return!1;if(ie&&ie_version>=9&&this.hasSelection===text||mac&&/[\uf700-\uf7ff]/.test(text))return cm.display.input.reset(),!1;if(cm.doc.sel==cm.display.selForContextMenu){var first=text.charCodeAt(0);if(8203!=first||prevInput||(prevInput="​"),8666==first)return this.reset(),this.cm.execCommand("undo")}for(var same=0,l=Math.min(prevInput.length,text.length);same<l&&prevInput.charCodeAt(same)==text.charCodeAt(same);)++same;return runInOp(cm,(function(){applyTextInput(cm,text.slice(same),prevInput.length-same,null,this$1.composing?"*compose":null),text.length>1e3||text.indexOf("\n")>-1?input.value=this$1.prevInput="":this$1.prevInput=text,this$1.composing&&(this$1.composing.range.clear(),this$1.composing.range=cm.markText(this$1.composing.start,cm.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},TextareaInput.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},TextareaInput.prototype.onKeyPress=function(){ie&&ie_version>=9&&(this.hasSelection=null),this.fastPoll()},TextareaInput.prototype.onContextMenu=function(e){var input=this,cm=input.cm,display=cm.display,te=input.textarea;input.contextMenuPending&&input.contextMenuPending();var pos=posFromMouse(cm,e),scrollPos=display.scroller.scrollTop;if(pos&&!presto){cm.options.resetSelectionOnContextMenu&&-1==cm.doc.sel.contains(pos)&&operation(cm,setSelection)(cm.doc,simpleSelection(pos),sel_dontScroll);var oldScrollY,oldCSS=te.style.cssText,oldWrapperCSS=input.wrapper.style.cssText,wrapperBox=input.wrapper.offsetParent.getBoundingClientRect();if(input.wrapper.style.cssText="position: static",te.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-wrapperBox.top-5)+"px; left: "+(e.clientX-wrapperBox.left-5)+"px;\n z-index: 1000; background: "+(ie?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",webkit&&(oldScrollY=window.scrollY),display.input.focus(),webkit&&window.scrollTo(null,oldScrollY),display.input.reset(),cm.somethingSelected()||(te.value=input.prevInput=" "),input.contextMenuPending=rehide,display.selForContextMenu=cm.doc.sel,clearTimeout(display.detectingSelectAll),ie&&ie_version>=9&&prepareSelectAllHack(),captureRightClick){e_stop(e);var mouseup=function(){off(window,"mouseup",mouseup),setTimeout(rehide,20)};on(window,"mouseup",mouseup)}else setTimeout(rehide,50)}function prepareSelectAllHack(){if(null!=te.selectionStart){var selected=cm.somethingSelected(),extval="​"+(selected?te.value:"");te.value="⇚",te.value=extval,input.prevInput=selected?"":"​",te.selectionStart=1,te.selectionEnd=extval.length,display.selForContextMenu=cm.doc.sel}}function rehide(){if(input.contextMenuPending==rehide&&(input.contextMenuPending=!1,input.wrapper.style.cssText=oldWrapperCSS,te.style.cssText=oldCSS,ie&&ie_version<9&&display.scrollbars.setScrollTop(display.scroller.scrollTop=scrollPos),null!=te.selectionStart)){(!ie||ie&&ie_version<9)&&prepareSelectAllHack();var i=0,poll=function(){display.selForContextMenu==cm.doc.sel&&0==te.selectionStart&&te.selectionEnd>0&&"​"==input.prevInput?operation(cm,selectAll)(cm):i++<10?display.detectingSelectAll=setTimeout(poll,500):(display.selForContextMenu=null,display.input.reset())};display.detectingSelectAll=setTimeout(poll,200)}}},TextareaInput.prototype.readOnlyChanged=function(val){val||this.reset(),this.textarea.disabled="nocursor"==val},TextareaInput.prototype.setUneditable=function(){},TextareaInput.prototype.needsContentAttribute=!1,function(CodeMirror){var optionHandlers=CodeMirror.optionHandlers;function option(name,deflt,handle,notOnInit){CodeMirror.defaults[name]=deflt,handle&&(optionHandlers[name]=notOnInit?function(cm,val,old){old!=Init&&handle(cm,val,old)}:handle)}CodeMirror.defineOption=option,CodeMirror.Init=Init,option("value","",(function(cm,val){return cm.setValue(val)}),!0),option("mode",null,(function(cm,val){cm.doc.modeOption=val,loadMode(cm)}),!0),option("indentUnit",2,loadMode,!0),option("indentWithTabs",!1),option("smartIndent",!0),option("tabSize",4,(function(cm){resetModeState(cm),clearCaches(cm),regChange(cm)}),!0),option("lineSeparator",null,(function(cm,val){if(cm.doc.lineSep=val,val){var newBreaks=[],lineNo=cm.doc.first;cm.doc.iter((function(line){for(var pos=0;;){var found=line.text.indexOf(val,pos);if(-1==found)break;pos=found+val.length,newBreaks.push(Pos(lineNo,found))}lineNo++}));for(var i=newBreaks.length-1;i>=0;i--)replaceRange(cm.doc,val,newBreaks[i],Pos(newBreaks[i].line,newBreaks[i].ch+val.length))}})),option("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(cm,val,old){cm.state.specialChars=new RegExp(val.source+(val.test("\t")?"":"|\t"),"g"),old!=Init&&cm.refresh()})),option("specialCharPlaceholder",defaultSpecialCharPlaceholder,(function(cm){return cm.refresh()}),!0),option("electricChars",!0),option("inputStyle",mobile?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),option("spellcheck",!1,(function(cm,val){return cm.getInputField().spellcheck=val}),!0),option("autocorrect",!1,(function(cm,val){return cm.getInputField().autocorrect=val}),!0),option("autocapitalize",!1,(function(cm,val){return cm.getInputField().autocapitalize=val}),!0),option("rtlMoveVisually",!windows),option("wholeLineUpdateBefore",!0),option("theme","default",(function(cm){themeChanged(cm),updateGutters(cm)}),!0),option("keyMap","default",(function(cm,val,old){var next=getKeyMap(val),prev=old!=Init&&getKeyMap(old);prev&&prev.detach&&prev.detach(cm,next),next.attach&&next.attach(cm,prev||null)})),option("extraKeys",null),option("configureMouse",null),option("lineWrapping",!1,wrappingChanged,!0),option("gutters",[],(function(cm,val){cm.display.gutterSpecs=getGutters(val,cm.options.lineNumbers),updateGutters(cm)}),!0),option("fixedGutter",!0,(function(cm,val){cm.display.gutters.style.left=val?compensateForHScroll(cm.display)+"px":"0",cm.refresh()}),!0),option("coverGutterNextToScrollbar",!1,(function(cm){return updateScrollbars(cm)}),!0),option("scrollbarStyle","native",(function(cm){initScrollbars(cm),updateScrollbars(cm),cm.display.scrollbars.setScrollTop(cm.doc.scrollTop),cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft)}),!0),option("lineNumbers",!1,(function(cm,val){cm.display.gutterSpecs=getGutters(cm.options.gutters,val),updateGutters(cm)}),!0),option("firstLineNumber",1,updateGutters,!0),option("lineNumberFormatter",(function(integer){return integer}),updateGutters,!0),option("showCursorWhenSelecting",!1,updateSelection,!0),option("resetSelectionOnContextMenu",!0),option("lineWiseCopyCut",!0),option("pasteLinesPerSelection",!0),option("selectionsMayTouch",!1),option("readOnly",!1,(function(cm,val){"nocursor"==val&&(onBlur(cm),cm.display.input.blur()),cm.display.input.readOnlyChanged(val)})),option("disableInput",!1,(function(cm,val){val||cm.display.input.reset()}),!0),option("dragDrop",!0,dragDropChanged),option("allowDropFileTypes",null),option("cursorBlinkRate",530),option("cursorScrollMargin",0),option("cursorHeight",1,updateSelection,!0),option("singleCursorHeightPerLine",!0,updateSelection,!0),option("workTime",100),option("workDelay",100),option("flattenSpans",!0,resetModeState,!0),option("addModeClass",!1,resetModeState,!0),option("pollInterval",100),option("undoDepth",200,(function(cm,val){return cm.doc.history.undoDepth=val})),option("historyEventDelay",1250),option("viewportMargin",10,(function(cm){return cm.refresh()}),!0),option("maxHighlightLength",1e4,resetModeState,!0),option("moveInputWithCursor",!0,(function(cm,val){val||cm.display.input.resetPosition()})),option("tabindex",null,(function(cm,val){return cm.display.input.getField().tabIndex=val||""})),option("autofocus",null),option("direction","ltr",(function(cm,val){return cm.doc.setDirection(val)}),!0),option("phrases",null)}(CodeMirror),function(CodeMirror){var optionHandlers=CodeMirror.optionHandlers,helpers=CodeMirror.helpers={};CodeMirror.prototype={constructor:CodeMirror,focus:function(){window.focus(),this.display.input.focus()},setOption:function(option,value){var options=this.options,old=options[option];options[option]==value&&"mode"!=option||(options[option]=value,optionHandlers.hasOwnProperty(option)&&operation(this,optionHandlers[option])(this,value,old),signal(this,"optionChange",this,option))},getOption:function(option){return this.options[option]},getDoc:function(){return this.doc},addKeyMap:function(map,bottom){this.state.keyMaps[bottom?"push":"unshift"](getKeyMap(map))},removeKeyMap:function(map){for(var maps=this.state.keyMaps,i=0;i<maps.length;++i)if(maps[i]==map||maps[i].name==map)return maps.splice(i,1),!0},addOverlay:methodOp((function(spec,options){var mode=spec.token?spec:CodeMirror.getMode(this.options,spec);if(mode.startState)throw new Error("Overlays may not be stateful.");!function(array,value,score){for(var pos=0,priority=score(value);pos<array.length&&score(array[pos])<=priority;)pos++;array.splice(pos,0,value)}(this.state.overlays,{mode:mode,modeSpec:spec,opaque:options&&options.opaque,priority:options&&options.priority||0},(function(overlay){return overlay.priority})),this.state.modeGen++,regChange(this)})),removeOverlay:methodOp((function(spec){for(var overlays=this.state.overlays,i=0;i<overlays.length;++i){var cur=overlays[i].modeSpec;if(cur==spec||"string"==typeof spec&&cur.name==spec)return overlays.splice(i,1),this.state.modeGen++,void regChange(this)}})),indentLine:methodOp((function(n,dir,aggressive){"string"!=typeof dir&&"number"!=typeof dir&&(dir=null==dir?this.options.smartIndent?"smart":"prev":dir?"add":"subtract"),isLine(this.doc,n)&&indentLine(this,n,dir,aggressive)})),indentSelection:methodOp((function(how){for(var ranges=this.doc.sel.ranges,end=-1,i=0;i<ranges.length;i++){var range=ranges[i];if(range.empty())range.head.line>end&&(indentLine(this,range.head.line,how,!0),end=range.head.line,i==this.doc.sel.primIndex&&ensureCursorVisible(this));else{var from=range.from(),to=range.to(),start=Math.max(end,from.line);end=Math.min(this.lastLine(),to.line-(to.ch?0:1))+1;for(var j=start;j<end;++j)indentLine(this,j,how);var newRanges=this.doc.sel.ranges;0==from.ch&&ranges.length==newRanges.length&&newRanges[i].from().ch>0&&replaceOneSelection(this.doc,i,new Range(from,newRanges[i].to()),sel_dontScroll)}}})),getTokenAt:function(pos,precise){return takeToken(this,pos,precise)},getLineTokens:function(line,precise){return takeToken(this,Pos(line),precise,!0)},getTokenTypeAt:function(pos){pos=clipPos(this.doc,pos);var type,styles=getLineStyles(this,getLine(this.doc,pos.line)),before=0,after=(styles.length-1)/2,ch=pos.ch;if(0==ch)type=styles[2];else for(;;){var mid=before+after>>1;if((mid?styles[2*mid-1]:0)>=ch)after=mid;else{if(!(styles[2*mid+1]<ch)){type=styles[2*mid+2];break}before=mid+1}}var cut=type?type.indexOf("overlay "):-1;return cut<0?type:0==cut?null:type.slice(0,cut-1)},getModeAt:function(pos){var mode=this.doc.mode;return mode.innerMode?CodeMirror.innerMode(mode,this.getTokenAt(pos).state).mode:mode},getHelper:function(pos,type){return this.getHelpers(pos,type)[0]},getHelpers:function(pos,type){var found=[];if(!helpers.hasOwnProperty(type))return found;var help=helpers[type],mode=this.getModeAt(pos);if("string"==typeof mode[type])help[mode[type]]&&found.push(help[mode[type]]);else if(mode[type])for(var i=0;i<mode[type].length;i++){var val=help[mode[type][i]];val&&found.push(val)}else mode.helperType&&help[mode.helperType]?found.push(help[mode.helperType]):help[mode.name]&&found.push(help[mode.name]);for(var i$1=0;i$1<help._global.length;i$1++){var cur=help._global[i$1];cur.pred(mode,this)&&-1==indexOf(found,cur.val)&&found.push(cur.val)}return found},getStateAfter:function(line,precise){var doc=this.doc;return getContextBefore(this,(line=clipLine(doc,null==line?doc.first+doc.size-1:line))+1,precise).state},cursorCoords:function(start,mode){var range=this.doc.sel.primary();return cursorCoords(this,null==start?range.head:"object"==typeof start?clipPos(this.doc,start):start?range.from():range.to(),mode||"page")},charCoords:function(pos,mode){return charCoords(this,clipPos(this.doc,pos),mode||"page")},coordsChar:function(coords,mode){return coordsChar(this,(coords=fromCoordSystem(this,coords,mode||"page")).left,coords.top)},lineAtHeight:function(height,mode){return height=fromCoordSystem(this,{top:height,left:0},mode||"page").top,lineAtHeight(this.doc,height+this.display.viewOffset)},heightAtLine:function(line,mode,includeWidgets){var lineObj,end=!1;if("number"==typeof line){var last=this.doc.first+this.doc.size-1;line<this.doc.first?line=this.doc.first:line>last&&(line=last,end=!0),lineObj=getLine(this.doc,line)}else lineObj=line;return intoCoordSystem(this,lineObj,{top:0,left:0},mode||"page",includeWidgets||end).top+(end?this.doc.height-heightAtLine(lineObj):0)},defaultTextHeight:function(){return textHeight(this.display)},defaultCharWidth:function(){return charWidth(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(pos,node,scroll,vert,horiz){var cm,rect,scrollPos,display=this.display,top=(pos=cursorCoords(this,clipPos(this.doc,pos))).bottom,left=pos.left;if(node.style.position="absolute",node.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(node),display.sizer.appendChild(node),"over"==vert)top=pos.top;else if("above"==vert||"near"==vert){var vspace=Math.max(display.wrapper.clientHeight,this.doc.height),hspace=Math.max(display.sizer.clientWidth,display.lineSpace.clientWidth);("above"==vert||pos.bottom+node.offsetHeight>vspace)&&pos.top>node.offsetHeight?top=pos.top-node.offsetHeight:pos.bottom+node.offsetHeight<=vspace&&(top=pos.bottom),left+node.offsetWidth>hspace&&(left=hspace-node.offsetWidth)}node.style.top=top+"px",node.style.left=node.style.right="","right"==horiz?(left=display.sizer.clientWidth-node.offsetWidth,node.style.right="0px"):("left"==horiz?left=0:"middle"==horiz&&(left=(display.sizer.clientWidth-node.offsetWidth)/2),node.style.left=left+"px"),scroll&&(cm=this,rect={left:left,top:top,right:left+node.offsetWidth,bottom:top+node.offsetHeight},null!=(scrollPos=calculateScrollPos(cm,rect)).scrollTop&&updateScrollTop(cm,scrollPos.scrollTop),null!=scrollPos.scrollLeft&&setScrollLeft(cm,scrollPos.scrollLeft))},triggerOnKeyDown:methodOp(onKeyDown),triggerOnKeyPress:methodOp(onKeyPress),triggerOnKeyUp:onKeyUp,triggerOnMouseDown:methodOp(onMouseDown),execCommand:function(cmd){if(commands.hasOwnProperty(cmd))return commands[cmd].call(null,this)},triggerElectric:methodOp((function(text){triggerElectric(this,text)})),findPosH:function(from,amount,unit,visually){var dir=1;amount<0&&(dir=-1,amount=-amount);for(var cur=clipPos(this.doc,from),i=0;i<amount&&!(cur=findPosH(this.doc,cur,dir,unit,visually)).hitSide;++i);return cur},moveH:methodOp((function(dir,unit){var this$1=this;this.extendSelectionsBy((function(range){return this$1.display.shift||this$1.doc.extend||range.empty()?findPosH(this$1.doc,range.head,dir,unit,this$1.options.rtlMoveVisually):dir<0?range.from():range.to()}),sel_move)})),deleteH:methodOp((function(dir,unit){var sel=this.doc.sel,doc=this.doc;sel.somethingSelected()?doc.replaceSelection("",null,"+delete"):deleteNearSelection(this,(function(range){var other=findPosH(doc,range.head,dir,unit,!1);return dir<0?{from:other,to:range.head}:{from:range.head,to:other}}))})),findPosV:function(from,amount,unit,goalColumn){var dir=1,x=goalColumn;amount<0&&(dir=-1,amount=-amount);for(var cur=clipPos(this.doc,from),i=0;i<amount;++i){var coords=cursorCoords(this,cur,"div");if(null==x?x=coords.left:coords.left=x,(cur=findPosV(this,coords,dir,unit)).hitSide)break}return cur},moveV:methodOp((function(dir,unit){var this$1=this,doc=this.doc,goals=[],collapse=!this.display.shift&&!doc.extend&&doc.sel.somethingSelected();if(doc.extendSelectionsBy((function(range){if(collapse)return dir<0?range.from():range.to();var headPos=cursorCoords(this$1,range.head,"div");null!=range.goalColumn&&(headPos.left=range.goalColumn),goals.push(headPos.left);var pos=findPosV(this$1,headPos,dir,unit);return"page"==unit&&range==doc.sel.primary()&&addToScrollTop(this$1,charCoords(this$1,pos,"div").top-headPos.top),pos}),sel_move),goals.length)for(var i=0;i<doc.sel.ranges.length;i++)doc.sel.ranges[i].goalColumn=goals[i]})),findWordAt:function(pos){var line=getLine(this.doc,pos.line).text,start=pos.ch,end=pos.ch;if(line){var helper=this.getHelper(pos,"wordChars");"before"!=pos.sticky&&end!=line.length||!start?++end:--start;for(var startChar=line.charAt(start),check=isWordChar(startChar,helper)?function(ch){return isWordChar(ch,helper)}:/\s/.test(startChar)?function(ch){return/\s/.test(ch)}:function(ch){return!/\s/.test(ch)&&!isWordChar(ch)};start>0&&check(line.charAt(start-1));)--start;for(;end<line.length&&check(line.charAt(end));)++end}return new Range(Pos(pos.line,start),Pos(pos.line,end))},toggleOverwrite:function(value){null!=value&&value==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?addClass(this.display.cursorDiv,"CodeMirror-overwrite"):rmClass(this.display.cursorDiv,"CodeMirror-overwrite"),signal(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==activeElt()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:methodOp((function(x,y){scrollToCoords(this,x,y)})),getScrollInfo:function(){var scroller=this.display.scroller;return{left:scroller.scrollLeft,top:scroller.scrollTop,height:scroller.scrollHeight-scrollGap(this)-this.display.barHeight,width:scroller.scrollWidth-scrollGap(this)-this.display.barWidth,clientHeight:displayHeight(this),clientWidth:displayWidth(this)}},scrollIntoView:methodOp((function(range,margin){null==range?(range={from:this.doc.sel.primary().head,to:null},null==margin&&(margin=this.options.cursorScrollMargin)):"number"==typeof range?range={from:Pos(range,0),to:null}:null==range.from&&(range={from:range,to:null}),range.to||(range.to=range.from),range.margin=margin||0,null!=range.from.line?function(cm,range){resolveScrollToPos(cm),cm.curOp.scrollToPos=range}(this,range):scrollToCoordsRange(this,range.from,range.to,range.margin)})),setSize:methodOp((function(width,height){var this$1=this,interpret=function(val){return"number"==typeof val||/^\d+$/.test(String(val))?val+"px":val};null!=width&&(this.display.wrapper.style.width=interpret(width)),null!=height&&(this.display.wrapper.style.height=interpret(height)),this.options.lineWrapping&&clearLineMeasurementCache(this);var lineNo=this.display.viewFrom;this.doc.iter(lineNo,this.display.viewTo,(function(line){if(line.widgets)for(var i=0;i<line.widgets.length;i++)if(line.widgets[i].noHScroll){regLineChange(this$1,lineNo,"widget");break}++lineNo})),this.curOp.forceUpdate=!0,signal(this,"refresh",this)})),operation:function(f){return runInOp(this,f)},startOperation:function(){return startOperation(this)},endOperation:function(){return endOperation(this)},refresh:methodOp((function(){var oldHeight=this.display.cachedTextHeight;regChange(this),this.curOp.forceUpdate=!0,clearCaches(this),scrollToCoords(this,this.doc.scrollLeft,this.doc.scrollTop),updateGutterSpace(this.display),(null==oldHeight||Math.abs(oldHeight-textHeight(this.display))>.5)&&estimateLineHeights(this),signal(this,"refresh",this)})),swapDoc:methodOp((function(doc){var old=this.doc;return old.cm=null,this.state.selectingText&&this.state.selectingText(),attachDoc(this,doc),clearCaches(this),this.display.input.reset(),scrollToCoords(this,doc.scrollLeft,doc.scrollTop),this.curOp.forceScroll=!0,signalLater(this,"swapDoc",this,old),old})),phrase:function(phraseText){var phrases=this.options.phrases;return phrases&&Object.prototype.hasOwnProperty.call(phrases,phraseText)?phrases[phraseText]:phraseText},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},eventMixin(CodeMirror),CodeMirror.registerHelper=function(type,name,value){helpers.hasOwnProperty(type)||(helpers[type]=CodeMirror[type]={_global:[]}),helpers[type][name]=value},CodeMirror.registerGlobalHelper=function(type,name,predicate,value){CodeMirror.registerHelper(type,name,value),helpers[type]._global.push({pred:predicate,val:value})}}(CodeMirror);var dontDelegate="iter insert remove copy getEditor constructor".split(" ");for(var prop in Doc.prototype)Doc.prototype.hasOwnProperty(prop)&&indexOf(dontDelegate,prop)<0&&(CodeMirror.prototype[prop]=function(method){return function(){return method.apply(this.doc,arguments)}}(Doc.prototype[prop]));return eventMixin(Doc),CodeMirror.inputStyles={textarea:TextareaInput,contenteditable:ContentEditableInput},CodeMirror.defineMode=function(name){CodeMirror.defaults.mode||"null"==name||(CodeMirror.defaults.mode=name),defineMode.apply(this,arguments)},CodeMirror.defineMIME=function(mime,spec){mimeModes[mime]=spec},CodeMirror.defineMode("null",(function(){return{token:function(stream){return stream.skipToEnd()}}})),CodeMirror.defineMIME("text/plain","null"),CodeMirror.defineExtension=function(name,func){CodeMirror.prototype[name]=func},CodeMirror.defineDocExtension=function(name,func){Doc.prototype[name]=func},CodeMirror.fromTextArea=function(textarea,options){if((options=options?copyObj(options):{}).value=textarea.value,!options.tabindex&&textarea.tabIndex&&(options.tabindex=te
109
  * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
110
  * Released under MIT license, http://github.com/requirejs/almond/LICENSE
111
  */